diff --git a/wp-includes/assets/script-loader-packages.min.php b/wp-includes/assets/script-loader-packages.min.php index 9575fa64e4..221dce78e7 100644 --- a/wp-includes/assets/script-loader-packages.min.php +++ b/wp-includes/assets/script-loader-packages.min.php @@ -1 +1 @@ - array('dependencies' => array('wp-dom-ready', 'wp-i18n'), 'version' => '3156534cc54473497e14'), 'annotations.min.js' => array('dependencies' => array('wp-data', 'wp-hooks', 'wp-i18n', 'wp-rich-text'), 'version' => '238360e96c76d37a2468'), 'api-fetch.min.js' => array('dependencies' => array('wp-i18n', 'wp-url'), 'version' => 'd387b816bc1ed2042e28'), 'autop.min.js' => array('dependencies' => array(), 'version' => '9fb50649848277dd318d'), 'blob.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => '9113eed771d446f4a556'), 'block-directory.min.js' => array('dependencies' => array('react-jsx-runtime', 'wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-notices', 'wp-plugins', 'wp-primitives', 'wp-url'), 'version' => '39151ef09cafcf3bcb90'), 'block-editor.min.js' => array('dependencies' => array('react', 'react-dom', 'react-jsx-runtime', 'wp-a11y', 'wp-api-fetch', 'wp-blob', 'wp-block-serialization-default-parser', 'wp-blocks', 'wp-commands', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-notices', 'wp-polyfill', 'wp-preferences', 'wp-primitives', 'wp-private-apis', 'wp-rich-text', 'wp-style-engine', 'wp-token-list', 'wp-url', 'wp-warning', 'wp-wordcount'), 'version' => '1bc1536e843749059e17'), 'block-library.min.js' => array('dependencies' => array('react-jsx-runtime', 'wp-a11y', 'wp-api-fetch', 'wp-autop', 'wp-blob', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-notices', 'wp-patterns', 'wp-polyfill', 'wp-primitives', 'wp-private-apis', 'wp-rich-text', 'wp-server-side-render', 'wp-url', 'wp-wordcount'), 'version' => '7a4a3cb731837c04e244'), 'block-serialization-default-parser.min.js' => array('dependencies' => array(), 'version' => '14d44daebf663d05d330'), 'blocks.min.js' => array('dependencies' => array('react-jsx-runtime', 'wp-autop', 'wp-blob', 'wp-block-serialization-default-parser', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-private-apis', 'wp-rich-text', 'wp-shortcode', 'wp-warning'), 'version' => 'cb271b6aaf12433d00f9'), 'commands.min.js' => array('dependencies' => array('react', 'react-dom', 'react-jsx-runtime', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-primitives', 'wp-private-apis'), 'version' => 'dd13db18ea4531d4fd4f'), 'components.min.js' => array('dependencies' => array('react', 'react-dom', 'react-jsx-runtime', 'wp-a11y', 'wp-compose', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-primitives', 'wp-private-apis', 'wp-rich-text', 'wp-warning'), 'version' => '9d6405d1df52523cdb7c'), 'compose.min.js' => array('dependencies' => array('react', 'react-jsx-runtime', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-priority-queue'), 'version' => '85dec7c8cc97a2154328'), 'core-commands.min.js' => array('dependencies' => array('react-jsx-runtime', 'wp-commands', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-notices', 'wp-primitives', 'wp-private-apis', 'wp-router', 'wp-url'), 'version' => 'e398c3f43e502a9c4a8f'), 'core-data.min.js' => array('dependencies' => array('react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-private-apis', 'wp-rich-text', 'wp-url', 'wp-warning'), 'version' => 'd2e4efaae0db8468d384'), 'customize-widgets.min.js' => array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-preferences', 'wp-primitives', 'wp-private-apis', 'wp-widgets'), 'version' => '37501962aef2167588ae'), 'data.min.js' => array('dependencies' => array('react-jsx-runtime', 'wp-compose', 'wp-deprecated', 'wp-element', 'wp-is-shallow-equal', 'wp-priority-queue', 'wp-private-apis', 'wp-redux-routine'), 'version' => 'fcf175d67ec974dde948'), 'data-controls.min.js' => array('dependencies' => array('wp-api-fetch', 'wp-data', 'wp-deprecated'), 'version' => '49f5587e8b90f9e7cc7e'), 'date.min.js' => array('dependencies' => array('moment', 'wp-deprecated'), 'version' => 'b2f083170ed22ebef396'), 'deprecated.min.js' => array('dependencies' => array('wp-hooks'), 'version' => 'e1f84915c5e8ae38964c'), 'dom.min.js' => array('dependencies' => array('wp-deprecated'), 'version' => '93117dfee2692b04b770'), 'dom-ready.min.js' => array('dependencies' => array(), 'version' => 'f77871ff7694fffea381'), 'edit-post.min.js' => array('dependencies' => array('react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-commands', 'wp-components', 'wp-compose', 'wp-core-commands', 'wp-core-data', 'wp-data', 'wp-deprecated', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-notices', 'wp-plugins', 'wp-preferences', 'wp-primitives', 'wp-private-apis', 'wp-url', 'wp-widgets'), 'version' => '7afeea389faaa086488e'), 'edit-site.min.js' => array('dependencies' => array('react', 'react-dom', 'react-jsx-runtime', 'wp-a11y', 'wp-api-fetch', 'wp-blob', 'wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-commands', 'wp-components', 'wp-compose', 'wp-core-commands', 'wp-core-data', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-notices', 'wp-patterns', 'wp-plugins', 'wp-polyfill', 'wp-preferences', 'wp-primitives', 'wp-priority-queue', 'wp-private-apis', 'wp-router', 'wp-url', 'wp-warning', 'wp-widgets'), 'version' => '65ffcc054ba0879fe4a8'), 'edit-widgets.min.js' => array('dependencies' => array('react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-patterns', 'wp-plugins', 'wp-preferences', 'wp-primitives', 'wp-private-apis', 'wp-url', 'wp-viewport', 'wp-widgets'), 'version' => '0837e3a0f72404eceec8'), 'editor.min.js' => array('dependencies' => array('react', 'react-jsx-runtime', 'wp-a11y', 'wp-api-fetch', 'wp-blob', 'wp-block-editor', 'wp-blocks', 'wp-commands', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-patterns', 'wp-plugins', 'wp-polyfill', 'wp-preferences', 'wp-primitives', 'wp-private-apis', 'wp-rich-text', 'wp-server-side-render', 'wp-url', 'wp-viewport', 'wp-warning', 'wp-wordcount'), 'version' => 'b248ed022e6a138978b3'), 'element.min.js' => array('dependencies' => array('react', 'react-dom', 'wp-escape-html'), 'version' => 'a4eeeadd23c0d7ab1d2d'), 'escape-html.min.js' => array('dependencies' => array(), 'version' => '6561a406d2d232a6fbd2'), 'fields.min.js' => array('dependencies' => array('react-jsx-runtime', 'wp-blob', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-notices', 'wp-patterns', 'wp-primitives', 'wp-private-apis', 'wp-url'), 'version' => '464fc3ce3c9ae20da608'), 'format-library.min.js' => array('dependencies' => array('react-jsx-runtime', 'wp-a11y', 'wp-block-editor', 'wp-components', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-primitives', 'wp-private-apis', 'wp-rich-text', 'wp-url'), 'version' => '86d7a5d57cc8dd223bba'), 'hooks.min.js' => array('dependencies' => array(), 'version' => '4d63a3d491d11ffd8ac6'), 'html-entities.min.js' => array('dependencies' => array(), 'version' => '2cd3358363e0675638fb'), 'i18n.min.js' => array('dependencies' => array('wp-hooks'), 'version' => '5e580eb46a90c2b997e6'), 'is-shallow-equal.min.js' => array('dependencies' => array(), 'version' => 'e0f9f1d78d83f5196979'), 'keyboard-shortcuts.min.js' => array('dependencies' => array('react-jsx-runtime', 'wp-data', 'wp-element', 'wp-keycodes'), 'version' => '32686e58e84193ce808b'), 'keycodes.min.js' => array('dependencies' => array('wp-i18n'), 'version' => '034ff647a54b018581d3'), 'list-reusable-blocks.min.js' => array('dependencies' => array('react-jsx-runtime', 'wp-api-fetch', 'wp-blob', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n'), 'version' => 'ece12b3c74315b4175ef'), 'media-utils.min.js' => array('dependencies' => array('wp-api-fetch', 'wp-blob', 'wp-element', 'wp-i18n'), 'version' => 'e10cc6bfcff4fe474479'), 'notices.min.js' => array('dependencies' => array('wp-data'), 'version' => '673a68a7ac2f556ed50b'), 'nux.min.js' => array('dependencies' => array('react-jsx-runtime', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => '9a0dc535fe222ae46a48'), 'patterns.min.js' => array('dependencies' => array('react-jsx-runtime', 'wp-a11y', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-notices', 'wp-primitives', 'wp-private-apis', 'wp-url'), 'version' => '712ca62469c7d6090da8'), 'plugins.min.js' => array('dependencies' => array('react-jsx-runtime', 'wp-compose', 'wp-element', 'wp-hooks', 'wp-is-shallow-equal', 'wp-primitives'), 'version' => 'ef6da4a9b2747b62c09c'), 'preferences.min.js' => array('dependencies' => array('react-jsx-runtime', 'wp-a11y', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-i18n', 'wp-primitives', 'wp-private-apis'), 'version' => '859dd2db2fdba6f5c726'), 'preferences-persistence.min.js' => array('dependencies' => array('wp-api-fetch'), 'version' => '9307a8c9e3254140a223'), 'primitives.min.js' => array('dependencies' => array('react-jsx-runtime', 'wp-element'), 'version' => 'aef2543ab60c8c9bb609'), 'priority-queue.min.js' => array('dependencies' => array(), 'version' => '9c21c957c7e50ffdbf48'), 'private-apis.min.js' => array('dependencies' => array(), 'version' => '4b858962c15c2c7a135f'), 'redux-routine.min.js' => array('dependencies' => array(), 'version' => '71b945a4f0f8ce5a037d'), 'reusable-blocks.min.js' => array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-notices', 'wp-primitives', 'wp-url'), 'version' => '73735a77e4e5095733da'), 'rich-text.min.js' => array('dependencies' => array('wp-a11y', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-escape-html', 'wp-i18n', 'wp-keycodes'), 'version' => '4021b9e4e9ef4d3cd868'), 'router.min.js' => array('dependencies' => array('react-jsx-runtime', 'wp-element', 'wp-polyfill', 'wp-private-apis', 'wp-url'), 'version' => 'e4887fecc16ef03e908f'), 'server-side-render.min.js' => array('dependencies' => array('react-jsx-runtime', 'wp-api-fetch', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n', 'wp-url'), 'version' => '345a014347e34be995f0'), 'shortcode.min.js' => array('dependencies' => array(), 'version' => 'b7747eee0efafd2f0c3b'), 'style-engine.min.js' => array('dependencies' => array(), 'version' => '08cc10e9532531e22456'), 'token-list.min.js' => array('dependencies' => array(), 'version' => '3b5f5dcfde830ecef24f'), 'undo-manager.min.js' => array('dependencies' => array('wp-is-shallow-equal'), 'version' => '531015dcaa7cee31c780'), 'url.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'e87eb76272a3a08402d2'), 'viewport.min.js' => array('dependencies' => array('react-jsx-runtime', 'wp-compose', 'wp-data'), 'version' => '829c9a30d366e1e5054c'), 'warning.min.js' => array('dependencies' => array(), 'version' => 'ed7c8b0940914f4fe44b'), 'widgets.min.js' => array('dependencies' => array('react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-notices', 'wp-polyfill', 'wp-primitives'), 'version' => '45d6328bc40634dbcd7b'), 'wordcount.min.js' => array('dependencies' => array(), 'version' => '55d8c2bf3dc99e7ea5ec')); + array('dependencies' => array('wp-dom-ready', 'wp-i18n'), 'version' => '3156534cc54473497e14'), 'annotations.min.js' => array('dependencies' => array('wp-data', 'wp-hooks', 'wp-i18n', 'wp-polyfill', 'wp-rich-text'), 'version' => '238360e96c76d37a2468'), 'api-fetch.min.js' => array('dependencies' => array('wp-i18n', 'wp-polyfill', 'wp-url'), 'version' => 'd387b816bc1ed2042e28'), 'autop.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => '9fb50649848277dd318d'), 'blob.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => '9113eed771d446f4a556'), 'block-directory.min.js' => array('dependencies' => array('react-jsx-runtime', 'wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => 'd8a269fde03418b64180'), 'block-editor.min.js' => array('dependencies' => array('react', 'react-dom', 'react-jsx-runtime', 'wp-a11y', 'wp-api-fetch', 'wp-blob', 'wp-block-serialization-default-parser', 'wp-blocks', 'wp-commands', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-notices', 'wp-polyfill', 'wp-preferences', 'wp-primitives', 'wp-priority-queue', 'wp-private-apis', 'wp-rich-text', 'wp-style-engine', 'wp-token-list', 'wp-url', 'wp-warning'), 'version' => 'ce3d5d2e20d8f6bda917'), 'block-library.min.js' => array('dependencies' => array('react-jsx-runtime', 'wp-a11y', 'wp-api-fetch', 'wp-autop', 'wp-blob', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-notices', 'wp-patterns', 'wp-polyfill', 'wp-primitives', 'wp-private-apis', 'wp-rich-text', 'wp-server-side-render', 'wp-url', 'wp-wordcount'), 'version' => 'd405c7e531dc6e50c014'), 'block-serialization-default-parser.min.js' => array('dependencies' => array(), 'version' => '14d44daebf663d05d330'), 'blocks.min.js' => array('dependencies' => array('react-jsx-runtime', 'wp-autop', 'wp-blob', 'wp-block-serialization-default-parser', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-private-apis', 'wp-rich-text', 'wp-shortcode', 'wp-warning'), 'version' => '67f3e2ba423886e1dc3f'), 'commands.min.js' => array('dependencies' => array('react', 'react-dom', 'react-jsx-runtime', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-polyfill', 'wp-primitives', 'wp-private-apis'), 'version' => '14ee29ad1743be844b11'), 'components.min.js' => array('dependencies' => array('react', 'react-dom', 'react-jsx-runtime', 'wp-a11y', 'wp-compose', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-private-apis', 'wp-rich-text', 'wp-warning'), 'version' => '5b49120970e7868c95f0'), 'compose.min.js' => array('dependencies' => array('react', 'react-jsx-runtime', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-priority-queue'), 'version' => '6f9fbd442ced90fef1d1'), 'core-commands.min.js' => array('dependencies' => array('react-jsx-runtime', 'wp-commands', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-private-apis', 'wp-router', 'wp-url'), 'version' => 'afcb83dba96ea45361e9'), 'core-data.min.js' => array('dependencies' => array('react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-private-apis', 'wp-rich-text', 'wp-url', 'wp-warning'), 'version' => '4dec9b0d8d354bec1705'), 'customize-widgets.min.js' => array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-polyfill', 'wp-preferences', 'wp-primitives', 'wp-private-apis', 'wp-widgets'), 'version' => '42a5462097681fd98f6f'), 'data.min.js' => array('dependencies' => array('react-jsx-runtime', 'wp-compose', 'wp-deprecated', 'wp-element', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-priority-queue', 'wp-private-apis', 'wp-redux-routine'), 'version' => 'fe6c4835cd00e12493c3'), 'data-controls.min.js' => array('dependencies' => array('wp-api-fetch', 'wp-data', 'wp-deprecated'), 'version' => '49f5587e8b90f9e7cc7e'), 'date.min.js' => array('dependencies' => array('moment', 'wp-deprecated', 'wp-polyfill'), 'version' => 'b2f083170ed22ebef396'), 'deprecated.min.js' => array('dependencies' => array('wp-hooks'), 'version' => 'e1f84915c5e8ae38964c'), 'dom.min.js' => array('dependencies' => array('wp-deprecated', 'wp-polyfill'), 'version' => 'f3a673a30f968c8fa314'), 'dom-ready.min.js' => array('dependencies' => array(), 'version' => 'f77871ff7694fffea381'), 'edit-post.min.js' => array('dependencies' => array('react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-commands', 'wp-components', 'wp-compose', 'wp-core-commands', 'wp-core-data', 'wp-data', 'wp-deprecated', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-preferences', 'wp-primitives', 'wp-private-apis', 'wp-url', 'wp-widgets'), 'version' => 'b749ebe90a93e194856d'), 'edit-site.min.js' => array('dependencies' => array('react', 'react-dom', 'react-jsx-runtime', 'wp-a11y', 'wp-api-fetch', 'wp-blob', 'wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-commands', 'wp-components', 'wp-compose', 'wp-core-commands', 'wp-core-data', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-patterns', 'wp-plugins', 'wp-polyfill', 'wp-preferences', 'wp-primitives', 'wp-private-apis', 'wp-router', 'wp-url', 'wp-warning', 'wp-widgets'), 'version' => 'cfab9252db425f7d1382'), 'edit-widgets.min.js' => array('dependencies' => array('react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-patterns', 'wp-plugins', 'wp-polyfill', 'wp-preferences', 'wp-primitives', 'wp-private-apis', 'wp-url', 'wp-viewport', 'wp-widgets'), 'version' => '9a04bb29c0759b535e9e'), 'editor.min.js' => array('dependencies' => array('react', 'react-jsx-runtime', 'wp-a11y', 'wp-api-fetch', 'wp-blob', 'wp-block-editor', 'wp-blocks', 'wp-commands', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-patterns', 'wp-plugins', 'wp-polyfill', 'wp-preferences', 'wp-primitives', 'wp-private-apis', 'wp-rich-text', 'wp-server-side-render', 'wp-url', 'wp-viewport', 'wp-warning', 'wp-wordcount'), 'version' => '0eea218f1b31f50a0f83'), 'element.min.js' => array('dependencies' => array('react', 'react-dom', 'wp-escape-html', 'wp-polyfill'), 'version' => 'a4eeeadd23c0d7ab1d2d'), 'escape-html.min.js' => array('dependencies' => array(), 'version' => '6561a406d2d232a6fbd2'), 'format-library.min.js' => array('dependencies' => array('react-jsx-runtime', 'wp-a11y', 'wp-block-editor', 'wp-components', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-polyfill', 'wp-primitives', 'wp-private-apis', 'wp-rich-text', 'wp-url'), 'version' => '91ae6249c6d0e3b00770'), 'hooks.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => '4d63a3d491d11ffd8ac6'), 'html-entities.min.js' => array('dependencies' => array(), 'version' => '2cd3358363e0675638fb'), 'i18n.min.js' => array('dependencies' => array('wp-hooks', 'wp-polyfill'), 'version' => '5e580eb46a90c2b997e6'), 'is-shallow-equal.min.js' => array('dependencies' => array(), 'version' => 'e0f9f1d78d83f5196979'), 'keyboard-shortcuts.min.js' => array('dependencies' => array('react-jsx-runtime', 'wp-data', 'wp-element', 'wp-keycodes', 'wp-polyfill'), 'version' => '32686e58e84193ce808b'), 'keycodes.min.js' => array('dependencies' => array('wp-i18n', 'wp-polyfill'), 'version' => '034ff647a54b018581d3'), 'list-reusable-blocks.min.js' => array('dependencies' => array('react-jsx-runtime', 'wp-api-fetch', 'wp-blob', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n'), 'version' => 'ece12b3c74315b4175ef'), 'media-utils.min.js' => array('dependencies' => array('wp-api-fetch', 'wp-blob', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-private-apis'), 'version' => 'b0c1e943915981479f43'), 'notices.min.js' => array('dependencies' => array('wp-data', 'wp-polyfill'), 'version' => '673a68a7ac2f556ed50b'), 'nux.min.js' => array('dependencies' => array('react-jsx-runtime', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-primitives'), 'version' => '9a0dc535fe222ae46a48'), 'patterns.min.js' => array('dependencies' => array('react-jsx-runtime', 'wp-a11y', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-private-apis', 'wp-url'), 'version' => '6497476653868ae9d711'), 'plugins.min.js' => array('dependencies' => array('react-jsx-runtime', 'wp-compose', 'wp-deprecated', 'wp-element', 'wp-hooks', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives'), 'version' => '20303a2de19246c83e5a'), 'preferences.min.js' => array('dependencies' => array('react-jsx-runtime', 'wp-a11y', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-primitives', 'wp-private-apis'), 'version' => '4aa23582b858c882a887'), 'preferences-persistence.min.js' => array('dependencies' => array('wp-api-fetch', 'wp-polyfill'), 'version' => '9307a8c9e3254140a223'), 'primitives.min.js' => array('dependencies' => array('react-jsx-runtime', 'wp-element'), 'version' => 'aef2543ab60c8c9bb609'), 'priority-queue.min.js' => array('dependencies' => array(), 'version' => '9c21c957c7e50ffdbf48'), 'private-apis.min.js' => array('dependencies' => array(), 'version' => '0f8478f1ba7e0eea562b'), 'redux-routine.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => '71b945a4f0f8ce5a037d'), 'reusable-blocks.min.js' => array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => '73735a77e4e5095733da'), 'rich-text.min.js' => array('dependencies' => array('wp-a11y', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-escape-html', 'wp-i18n', 'wp-keycodes', 'wp-polyfill'), 'version' => '74178fc8c4d67d66f1a8'), 'router.min.js' => array('dependencies' => array('react-jsx-runtime', 'wp-compose', 'wp-element', 'wp-polyfill', 'wp-private-apis', 'wp-url'), 'version' => '517fbc2dbcabd4a86568'), 'server-side-render.min.js' => array('dependencies' => array('react-jsx-runtime', 'wp-api-fetch', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n', 'wp-url'), 'version' => '345a014347e34be995f0'), 'shortcode.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'b7747eee0efafd2f0c3b'), 'style-engine.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => '08cc10e9532531e22456'), 'token-list.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => '3b5f5dcfde830ecef24f'), 'url.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'e87eb76272a3a08402d2'), 'viewport.min.js' => array('dependencies' => array('react-jsx-runtime', 'wp-compose', 'wp-data', 'wp-polyfill'), 'version' => '829c9a30d366e1e5054c'), 'warning.min.js' => array('dependencies' => array(), 'version' => 'ed7c8b0940914f4fe44b'), 'widgets.min.js' => array('dependencies' => array('react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-notices', 'wp-polyfill', 'wp-primitives'), 'version' => '0b561f75d41627a9d110'), 'wordcount.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => '55d8c2bf3dc99e7ea5ec')); diff --git a/wp-includes/assets/script-loader-packages.php b/wp-includes/assets/script-loader-packages.php index 299bf64718..672fe2ce12 100644 --- a/wp-includes/assets/script-loader-packages.php +++ b/wp-includes/assets/script-loader-packages.php @@ -1 +1 @@ - array('dependencies' => array('wp-dom-ready', 'wp-i18n'), 'version' => '604a4359a838a9073d9f'), 'annotations.js' => array('dependencies' => array('wp-data', 'wp-hooks', 'wp-i18n', 'wp-rich-text'), 'version' => 'dfaab3186d5cfee4a4c2'), 'api-fetch.js' => array('dependencies' => array('wp-i18n', 'wp-url'), 'version' => '1dc17a9f38b17ec87b9a'), 'autop.js' => array('dependencies' => array(), 'version' => 'a0567e518e6863383ace'), 'blob.js' => array('dependencies' => array('wp-polyfill'), 'version' => '65d38acd0a443932b695'), 'block-directory.js' => array('dependencies' => array('react-jsx-runtime', 'wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-notices', 'wp-plugins', 'wp-primitives', 'wp-url'), 'version' => '979c305834207a5c0e54'), 'block-editor.js' => array('dependencies' => array('react', 'react-dom', 'react-jsx-runtime', 'wp-a11y', 'wp-api-fetch', 'wp-blob', 'wp-block-serialization-default-parser', 'wp-blocks', 'wp-commands', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-notices', 'wp-polyfill', 'wp-preferences', 'wp-primitives', 'wp-private-apis', 'wp-rich-text', 'wp-style-engine', 'wp-token-list', 'wp-url', 'wp-warning', 'wp-wordcount'), 'version' => '854db118e672ad6db6d7'), 'block-library.js' => array('dependencies' => array('react-jsx-runtime', 'wp-a11y', 'wp-api-fetch', 'wp-autop', 'wp-blob', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-notices', 'wp-patterns', 'wp-polyfill', 'wp-primitives', 'wp-private-apis', 'wp-rich-text', 'wp-server-side-render', 'wp-url', 'wp-wordcount'), 'version' => '41fd4b4fa38e0c0abec3'), 'block-serialization-default-parser.js' => array('dependencies' => array(), 'version' => '1d1bef54e84a98f3efb9'), 'blocks.js' => array('dependencies' => array('react-jsx-runtime', 'wp-autop', 'wp-blob', 'wp-block-serialization-default-parser', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-private-apis', 'wp-rich-text', 'wp-shortcode', 'wp-warning'), 'version' => 'ef03236d7cc785750826'), 'commands.js' => array('dependencies' => array('react', 'react-dom', 'react-jsx-runtime', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-primitives', 'wp-private-apis'), 'version' => 'b2340c1bb6cb5506b5a4'), 'components.js' => array('dependencies' => array('react', 'react-dom', 'react-jsx-runtime', 'wp-a11y', 'wp-compose', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-primitives', 'wp-private-apis', 'wp-rich-text', 'wp-warning'), 'version' => '891aa1f5b15a94f89929'), 'compose.js' => array('dependencies' => array('react', 'react-jsx-runtime', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-priority-queue'), 'version' => '94f58acc3d48793f0efe'), 'core-commands.js' => array('dependencies' => array('react-jsx-runtime', 'wp-commands', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-notices', 'wp-primitives', 'wp-private-apis', 'wp-router', 'wp-url'), 'version' => '5350d3bfee7bace9f8ff'), 'core-data.js' => array('dependencies' => array('react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-private-apis', 'wp-rich-text', 'wp-url', 'wp-warning'), 'version' => 'f45eb8ae2d0222729424'), 'customize-widgets.js' => array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-preferences', 'wp-primitives', 'wp-private-apis', 'wp-widgets'), 'version' => 'fb91173576d96d4275bb'), 'data.js' => array('dependencies' => array('react-jsx-runtime', 'wp-compose', 'wp-deprecated', 'wp-element', 'wp-is-shallow-equal', 'wp-priority-queue', 'wp-private-apis', 'wp-redux-routine'), 'version' => '5bcfb41b29c3a40285b8'), 'data-controls.js' => array('dependencies' => array('wp-api-fetch', 'wp-data', 'wp-deprecated'), 'version' => 'b0d1c8452218ee235f90'), 'date.js' => array('dependencies' => array('moment', 'wp-deprecated'), 'version' => '2379dbca1a833dd5b5ad'), 'deprecated.js' => array('dependencies' => array('wp-hooks'), 'version' => '741e32edb0e7c2dd30da'), 'dom.js' => array('dependencies' => array('wp-deprecated'), 'version' => '7d8e107fb1cfed074bd4'), 'dom-ready.js' => array('dependencies' => array(), 'version' => '5b9fa8df0892dc9a7c41'), 'edit-post.js' => array('dependencies' => array('react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-commands', 'wp-components', 'wp-compose', 'wp-core-commands', 'wp-core-data', 'wp-data', 'wp-deprecated', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-notices', 'wp-plugins', 'wp-preferences', 'wp-primitives', 'wp-private-apis', 'wp-url', 'wp-widgets'), 'version' => '379b7d969f165a33b933'), 'edit-site.js' => array('dependencies' => array('react', 'react-dom', 'react-jsx-runtime', 'wp-a11y', 'wp-api-fetch', 'wp-blob', 'wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-commands', 'wp-components', 'wp-compose', 'wp-core-commands', 'wp-core-data', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-notices', 'wp-patterns', 'wp-plugins', 'wp-polyfill', 'wp-preferences', 'wp-primitives', 'wp-priority-queue', 'wp-private-apis', 'wp-router', 'wp-url', 'wp-warning', 'wp-widgets'), 'version' => 'f08ccc3f8edb4e91039a'), 'edit-widgets.js' => array('dependencies' => array('react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-patterns', 'wp-plugins', 'wp-preferences', 'wp-primitives', 'wp-private-apis', 'wp-url', 'wp-viewport', 'wp-widgets'), 'version' => '95126521ea5076e77095'), 'editor.js' => array('dependencies' => array('react', 'react-jsx-runtime', 'wp-a11y', 'wp-api-fetch', 'wp-blob', 'wp-block-editor', 'wp-blocks', 'wp-commands', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-patterns', 'wp-plugins', 'wp-polyfill', 'wp-preferences', 'wp-primitives', 'wp-private-apis', 'wp-rich-text', 'wp-server-side-render', 'wp-url', 'wp-viewport', 'wp-warning', 'wp-wordcount'), 'version' => '7c351ba3f08c4a214e88'), 'element.js' => array('dependencies' => array('react', 'react-dom', 'wp-escape-html'), 'version' => 'bac1874db2b732b79415'), 'escape-html.js' => array('dependencies' => array(), 'version' => '93558693d672af42c190'), 'fields.js' => array('dependencies' => array('react-jsx-runtime', 'wp-blob', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-notices', 'wp-patterns', 'wp-primitives', 'wp-private-apis', 'wp-url'), 'version' => '3a958f7d4cfdfe9e0498'), 'format-library.js' => array('dependencies' => array('react-jsx-runtime', 'wp-a11y', 'wp-block-editor', 'wp-components', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-primitives', 'wp-private-apis', 'wp-rich-text', 'wp-url'), 'version' => 'e80f97e0f22c32ff25a9'), 'hooks.js' => array('dependencies' => array(), 'version' => 'be67dc331e61e06d52fa'), 'html-entities.js' => array('dependencies' => array(), 'version' => '0d1913e5b8fb9137bad2'), 'i18n.js' => array('dependencies' => array('wp-hooks'), 'version' => '1f582b6db284acb808fd'), 'is-shallow-equal.js' => array('dependencies' => array(), 'version' => '58ed73f7376c883f832b'), 'keyboard-shortcuts.js' => array('dependencies' => array('react-jsx-runtime', 'wp-data', 'wp-element', 'wp-keycodes'), 'version' => '383ef47df74f55e8d459'), 'keycodes.js' => array('dependencies' => array('wp-i18n'), 'version' => '3d57b6c40dc4cd37d376'), 'list-reusable-blocks.js' => array('dependencies' => array('react-jsx-runtime', 'wp-api-fetch', 'wp-blob', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n'), 'version' => 'f150b400e286fa527a98'), 'media-utils.js' => array('dependencies' => array('wp-api-fetch', 'wp-blob', 'wp-element', 'wp-i18n'), 'version' => '0b348a5e5577b2729956'), 'notices.js' => array('dependencies' => array('wp-data'), 'version' => 'bb7ea4346f0c7a77df98'), 'nux.js' => array('dependencies' => array('react-jsx-runtime', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => '8c1096cef5328ecded5f'), 'patterns.js' => array('dependencies' => array('react-jsx-runtime', 'wp-a11y', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-notices', 'wp-primitives', 'wp-private-apis', 'wp-url'), 'version' => 'e571e66dc4cb9d2c4904'), 'plugins.js' => array('dependencies' => array('react-jsx-runtime', 'wp-compose', 'wp-element', 'wp-hooks', 'wp-is-shallow-equal', 'wp-primitives'), 'version' => 'd16b995e07f5c9e29ee9'), 'preferences.js' => array('dependencies' => array('react-jsx-runtime', 'wp-a11y', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-i18n', 'wp-primitives', 'wp-private-apis'), 'version' => 'e3d3f93049deef6b56f5'), 'preferences-persistence.js' => array('dependencies' => array('wp-api-fetch'), 'version' => 'a5baddbc610561581693'), 'primitives.js' => array('dependencies' => array('react-jsx-runtime', 'wp-element'), 'version' => '66632613c3c6b0ed6f76'), 'priority-queue.js' => array('dependencies' => array(), 'version' => 'be4e4334602693fa7256'), 'private-apis.js' => array('dependencies' => array(), 'version' => '223d0243d34fe78e2946'), 'redux-routine.js' => array('dependencies' => array(), 'version' => '35aec385f9088222e2bc'), 'reusable-blocks.js' => array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-notices', 'wp-primitives', 'wp-url'), 'version' => '84aa323cb26888d4ff08'), 'rich-text.js' => array('dependencies' => array('wp-a11y', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-escape-html', 'wp-i18n', 'wp-keycodes'), 'version' => '4df234de12e2223fa007'), 'router.js' => array('dependencies' => array('react-jsx-runtime', 'wp-element', 'wp-polyfill', 'wp-private-apis', 'wp-url'), 'version' => '6948e1c1a7f3d2810daf'), 'server-side-render.js' => array('dependencies' => array('react-jsx-runtime', 'wp-api-fetch', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n', 'wp-url'), 'version' => '423ca51c7fbed8fc0343'), 'shortcode.js' => array('dependencies' => array(), 'version' => '8f43ae24f9212fc128cc'), 'style-engine.js' => array('dependencies' => array(), 'version' => '5b0bc6c09b352e2161aa'), 'token-list.js' => array('dependencies' => array(), 'version' => '09fdc83606f766278b8b'), 'undo-manager.js' => array('dependencies' => array('wp-is-shallow-equal'), 'version' => 'ecd745bab2a49613d64a'), 'url.js' => array('dependencies' => array('wp-polyfill'), 'version' => '6bfb5499ce08a7944951'), 'viewport.js' => array('dependencies' => array('react-jsx-runtime', 'wp-compose', 'wp-data'), 'version' => '82036eb97185ee78762b'), 'warning.js' => array('dependencies' => array(), 'version' => '4ecd4ff4d8fa94314090'), 'widgets.js' => array('dependencies' => array('react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-notices', 'wp-polyfill', 'wp-primitives'), 'version' => '32f47c8127f482637592'), 'wordcount.js' => array('dependencies' => array(), 'version' => 'f5354b03b95c624877fb')); + array('dependencies' => array('wp-dom-ready', 'wp-i18n'), 'version' => '604a4359a838a9073d9f'), 'annotations.js' => array('dependencies' => array('wp-data', 'wp-hooks', 'wp-i18n', 'wp-polyfill', 'wp-rich-text'), 'version' => '73d73051f4d69009596c'), 'api-fetch.js' => array('dependencies' => array('wp-i18n', 'wp-polyfill', 'wp-url'), 'version' => 'd59a7f541f058c22f9f0'), 'autop.js' => array('dependencies' => array('wp-polyfill'), 'version' => '14b7474af3dda76803b1'), 'blob.js' => array('dependencies' => array('wp-polyfill'), 'version' => '65d38acd0a443932b695'), 'block-directory.js' => array('dependencies' => array('react-jsx-runtime', 'wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => '86b6e368df4f9e1983a8'), 'block-editor.js' => array('dependencies' => array('react', 'react-dom', 'react-jsx-runtime', 'wp-a11y', 'wp-api-fetch', 'wp-blob', 'wp-block-serialization-default-parser', 'wp-blocks', 'wp-commands', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-notices', 'wp-polyfill', 'wp-preferences', 'wp-primitives', 'wp-priority-queue', 'wp-private-apis', 'wp-rich-text', 'wp-style-engine', 'wp-token-list', 'wp-url', 'wp-warning'), 'version' => '8ade6cbd49caf82c7adb'), 'block-library.js' => array('dependencies' => array('react-jsx-runtime', 'wp-a11y', 'wp-api-fetch', 'wp-autop', 'wp-blob', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-notices', 'wp-patterns', 'wp-polyfill', 'wp-primitives', 'wp-private-apis', 'wp-rich-text', 'wp-server-side-render', 'wp-url', 'wp-wordcount'), 'version' => '1c8062b83bfabcf7d747'), 'block-serialization-default-parser.js' => array('dependencies' => array(), 'version' => '1d1bef54e84a98f3efb9'), 'blocks.js' => array('dependencies' => array('react-jsx-runtime', 'wp-autop', 'wp-blob', 'wp-block-serialization-default-parser', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-private-apis', 'wp-rich-text', 'wp-shortcode', 'wp-warning'), 'version' => 'af4340dcf2a2f19fa47e'), 'commands.js' => array('dependencies' => array('react', 'react-dom', 'react-jsx-runtime', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-polyfill', 'wp-primitives', 'wp-private-apis'), 'version' => '5ef4aeff0ba93767a757'), 'components.js' => array('dependencies' => array('react', 'react-dom', 'react-jsx-runtime', 'wp-a11y', 'wp-compose', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-private-apis', 'wp-rich-text', 'wp-warning'), 'version' => '425766cfc43ea834fa70'), 'compose.js' => array('dependencies' => array('react', 'react-jsx-runtime', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-priority-queue'), 'version' => 'b77906fc8402965a182a'), 'core-commands.js' => array('dependencies' => array('react-jsx-runtime', 'wp-commands', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-private-apis', 'wp-router', 'wp-url'), 'version' => '33b3d43d9335cff8b5f7'), 'core-data.js' => array('dependencies' => array('react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-private-apis', 'wp-rich-text', 'wp-url', 'wp-warning'), 'version' => 'c9f8904ed00b65e2b054'), 'customize-widgets.js' => array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-polyfill', 'wp-preferences', 'wp-primitives', 'wp-private-apis', 'wp-widgets'), 'version' => '584f82162a0ce692cf93'), 'data.js' => array('dependencies' => array('react-jsx-runtime', 'wp-compose', 'wp-deprecated', 'wp-element', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-priority-queue', 'wp-private-apis', 'wp-redux-routine'), 'version' => '3e9634f3a81e9afc4f2a'), 'data-controls.js' => array('dependencies' => array('wp-api-fetch', 'wp-data', 'wp-deprecated'), 'version' => 'e31cdcc73f3eea4fbe01'), 'date.js' => array('dependencies' => array('moment', 'wp-deprecated', 'wp-polyfill'), 'version' => 'a2c8f33cbc5146877475'), 'deprecated.js' => array('dependencies' => array('wp-hooks'), 'version' => '741e32edb0e7c2dd30da'), 'dom.js' => array('dependencies' => array('wp-deprecated', 'wp-polyfill'), 'version' => '996dea7d5f43ec743a6d'), 'dom-ready.js' => array('dependencies' => array(), 'version' => '5b9fa8df0892dc9a7c41'), 'edit-post.js' => array('dependencies' => array('react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-commands', 'wp-components', 'wp-compose', 'wp-core-commands', 'wp-core-data', 'wp-data', 'wp-deprecated', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-preferences', 'wp-primitives', 'wp-private-apis', 'wp-url', 'wp-widgets'), 'version' => '1a986e86dd587ce8c36e'), 'edit-site.js' => array('dependencies' => array('react', 'react-dom', 'react-jsx-runtime', 'wp-a11y', 'wp-api-fetch', 'wp-blob', 'wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-commands', 'wp-components', 'wp-compose', 'wp-core-commands', 'wp-core-data', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-patterns', 'wp-plugins', 'wp-polyfill', 'wp-preferences', 'wp-primitives', 'wp-private-apis', 'wp-router', 'wp-url', 'wp-warning', 'wp-widgets'), 'version' => 'a768028c18e97f6113b8'), 'edit-widgets.js' => array('dependencies' => array('react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-patterns', 'wp-plugins', 'wp-polyfill', 'wp-preferences', 'wp-primitives', 'wp-private-apis', 'wp-url', 'wp-viewport', 'wp-widgets'), 'version' => '63c2fdc02d8fa4f071d3'), 'editor.js' => array('dependencies' => array('react', 'react-jsx-runtime', 'wp-a11y', 'wp-api-fetch', 'wp-blob', 'wp-block-editor', 'wp-blocks', 'wp-commands', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-patterns', 'wp-plugins', 'wp-polyfill', 'wp-preferences', 'wp-primitives', 'wp-private-apis', 'wp-rich-text', 'wp-server-side-render', 'wp-url', 'wp-viewport', 'wp-warning', 'wp-wordcount'), 'version' => '888959d2ef87b8ea7d63'), 'element.js' => array('dependencies' => array('react', 'react-dom', 'wp-escape-html', 'wp-polyfill'), 'version' => '2bd42cd4eae00f1ae6ad'), 'escape-html.js' => array('dependencies' => array(), 'version' => '93558693d672af42c190'), 'format-library.js' => array('dependencies' => array('react-jsx-runtime', 'wp-a11y', 'wp-block-editor', 'wp-components', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-polyfill', 'wp-primitives', 'wp-private-apis', 'wp-rich-text', 'wp-url'), 'version' => '39d887508b043f3a68ef'), 'hooks.js' => array('dependencies' => array('wp-polyfill'), 'version' => '8f26bee8391c16dbe897'), 'html-entities.js' => array('dependencies' => array(), 'version' => '0d1913e5b8fb9137bad2'), 'i18n.js' => array('dependencies' => array('wp-hooks', 'wp-polyfill'), 'version' => '8baa5575d49016894c88'), 'is-shallow-equal.js' => array('dependencies' => array(), 'version' => '58ed73f7376c883f832b'), 'keyboard-shortcuts.js' => array('dependencies' => array('react-jsx-runtime', 'wp-data', 'wp-element', 'wp-keycodes', 'wp-polyfill'), 'version' => '22cd049fce9db6c76add'), 'keycodes.js' => array('dependencies' => array('wp-i18n', 'wp-polyfill'), 'version' => '65946bf42d0e559b2712'), 'list-reusable-blocks.js' => array('dependencies' => array('react-jsx-runtime', 'wp-api-fetch', 'wp-blob', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n'), 'version' => 'ad48bd203f06c82d4c77'), 'media-utils.js' => array('dependencies' => array('wp-api-fetch', 'wp-blob', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-private-apis'), 'version' => '20246ba7c2fd2a4dc46a'), 'notices.js' => array('dependencies' => array('wp-data', 'wp-polyfill'), 'version' => '6bb68baa777f00b0e5a6'), 'nux.js' => array('dependencies' => array('react-jsx-runtime', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-primitives'), 'version' => 'f3508afa641f1a7f92c5'), 'patterns.js' => array('dependencies' => array('react-jsx-runtime', 'wp-a11y', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-private-apis', 'wp-url'), 'version' => 'da7c574ebe795865eceb'), 'plugins.js' => array('dependencies' => array('react-jsx-runtime', 'wp-compose', 'wp-deprecated', 'wp-element', 'wp-hooks', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives'), 'version' => '5d2bdb35d678cd801c88'), 'preferences.js' => array('dependencies' => array('react-jsx-runtime', 'wp-a11y', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-primitives', 'wp-private-apis'), 'version' => '406afd4aa71a93538496'), 'preferences-persistence.js' => array('dependencies' => array('wp-api-fetch', 'wp-polyfill'), 'version' => 'b9c309a9f224f1656be0'), 'primitives.js' => array('dependencies' => array('react-jsx-runtime', 'wp-element'), 'version' => '66632613c3c6b0ed6f76'), 'priority-queue.js' => array('dependencies' => array(), 'version' => 'be4e4334602693fa7256'), 'private-apis.js' => array('dependencies' => array(), 'version' => '18ea1d568a3bfd485afb'), 'redux-routine.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'abe5efc91357b462667c'), 'reusable-blocks.js' => array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => 'd9d5c09b6e44d529e667'), 'rich-text.js' => array('dependencies' => array('wp-a11y', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-escape-html', 'wp-i18n', 'wp-keycodes', 'wp-polyfill'), 'version' => 'dbcd0483166d874a412d'), 'router.js' => array('dependencies' => array('react-jsx-runtime', 'wp-compose', 'wp-element', 'wp-polyfill', 'wp-private-apis', 'wp-url'), 'version' => '74a6aae8a222653c5cdc'), 'server-side-render.js' => array('dependencies' => array('react-jsx-runtime', 'wp-api-fetch', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n', 'wp-url'), 'version' => '5058284dc05b1b1b2661'), 'shortcode.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'e28652b6d37b9b2f2316'), 'style-engine.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'b18748a26bf335777de6'), 'token-list.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'eccd639163aeb7ac2e41'), 'url.js' => array('dependencies' => array('wp-polyfill'), 'version' => '93c26a8e23fc5627a60d'), 'viewport.js' => array('dependencies' => array('react-jsx-runtime', 'wp-compose', 'wp-data', 'wp-polyfill'), 'version' => '420418fb1f7a13e34106'), 'warning.js' => array('dependencies' => array(), 'version' => '4ecd4ff4d8fa94314090'), 'widgets.js' => array('dependencies' => array('react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-notices', 'wp-polyfill', 'wp-primitives'), 'version' => '4e19b9db3eb63160a3e8'), 'wordcount.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'd07c59c18b2be51fe0be')); diff --git a/wp-includes/assets/script-modules-packages.min.php b/wp-includes/assets/script-modules-packages.min.php index d781885650..953466394b 100644 --- a/wp-includes/assets/script-modules-packages.min.php +++ b/wp-includes/assets/script-modules-packages.min.php @@ -1 +1 @@ - array('dependencies' => array(), 'version' => '04d9948c85e9600ec2a5', 'type' => 'module'), 'interactivity/debug.min.js' => array('dependencies' => array(), 'version' => '03be8c2fdc10a676f363', 'type' => 'module'), 'interactivity-router/index.min.js' => array('dependencies' => array('@wordpress/interactivity', array('id' => '@wordpress/a11y', 'import' => 'dynamic')), 'version' => '2a2ef420d37f6e7e08a0', 'type' => 'module'), 'a11y/index.min.js' => array('dependencies' => array(), 'version' => 'b7d06936b8bc23cff2ad', 'type' => 'module'), 'block-library/file/view.min.js' => array('dependencies' => array('@wordpress/interactivity'), 'version' => 'fdc2f6842e015af83140', 'type' => 'module'), 'block-library/image/view.min.js' => array('dependencies' => array('@wordpress/interactivity'), 'version' => 'acfec7b3c0be4a859b31', 'type' => 'module'), 'block-library/navigation/view.min.js' => array('dependencies' => array('@wordpress/interactivity'), 'version' => '8ff192874fc8910a284c', 'type' => 'module'), 'block-library/query/view.min.js' => array('dependencies' => array('@wordpress/interactivity', array('id' => '@wordpress/interactivity-router', 'import' => 'dynamic')), 'version' => '0661ecffc048a34462c0', 'type' => 'module'), 'block-library/search/view.min.js' => array('dependencies' => array('@wordpress/interactivity'), 'version' => '2a73400a693958f604de', 'type' => 'module')); + array('dependencies' => array('wp-polyfill'), 'version' => 'a525209c03a87e74ec45', 'type' => 'module'), 'interactivity/debug.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'b1a15c164ed27698ef82', 'type' => 'module'), 'interactivity-router/index.min.js' => array('dependencies' => array('@wordpress/interactivity', 'wp-polyfill', array('id' => '@wordpress/a11y', 'import' => 'dynamic')), 'version' => '0f01f519e3dce3ad547a', 'type' => 'module'), 'a11y/index.min.js' => array('dependencies' => array(), 'version' => 'b7d06936b8bc23cff2ad', 'type' => 'module'), 'block-library/file/view.min.js' => array('dependencies' => array('@wordpress/interactivity'), 'version' => 'fdc2f6842e015af83140', 'type' => 'module'), 'block-library/form/view.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'baaf25398238b4f2a821', 'type' => 'module'), 'block-library/image/view.min.js' => array('dependencies' => array('@wordpress/interactivity'), 'version' => '8f7f3c854009ae207c29', 'type' => 'module'), 'block-library/navigation/view.min.js' => array('dependencies' => array('@wordpress/interactivity', 'wp-polyfill'), 'version' => '8ff192874fc8910a284c', 'type' => 'module'), 'block-library/query/view.min.js' => array('dependencies' => array('@wordpress/interactivity', array('id' => '@wordpress/interactivity-router', 'import' => 'dynamic')), 'version' => '0661ecffc048a34462c0', 'type' => 'module'), 'block-library/search/view.min.js' => array('dependencies' => array('@wordpress/interactivity'), 'version' => '2a73400a693958f604de', 'type' => 'module')); diff --git a/wp-includes/assets/script-modules-packages.php b/wp-includes/assets/script-modules-packages.php index 5aee3af32c..f1babde0b9 100644 --- a/wp-includes/assets/script-modules-packages.php +++ b/wp-includes/assets/script-modules-packages.php @@ -1 +1 @@ - array('dependencies' => array(), 'version' => '991ae29be183b2cf30b6', 'type' => 'module'), 'interactivity/debug.js' => array('dependencies' => array(), 'version' => 'ea4068e0adeb27dfcc96', 'type' => 'module'), 'interactivity-router/index.js' => array('dependencies' => array('@wordpress/interactivity', array('id' => '@wordpress/a11y', 'import' => 'dynamic')), 'version' => 'ed0e9a59494f19f439eb', 'type' => 'module'), 'a11y/index.js' => array('dependencies' => array(), 'version' => '2a5dd8e0f11b6868f8cf', 'type' => 'module'), 'block-library/file/view.js' => array('dependencies' => array('@wordpress/interactivity'), 'version' => '2a6572837a4d7801e87a', 'type' => 'module'), 'block-library/image/view.js' => array('dependencies' => array('@wordpress/interactivity'), 'version' => 'dd49a77cd85a2482f422', 'type' => 'module'), 'block-library/navigation/view.js' => array('dependencies' => array('@wordpress/interactivity'), 'version' => '1da3120e2542a35253d2', 'type' => 'module'), 'block-library/query/view.js' => array('dependencies' => array('@wordpress/interactivity', array('id' => '@wordpress/interactivity-router', 'import' => 'dynamic')), 'version' => '4284e5c7bb31ec1182ca', 'type' => 'module'), 'block-library/search/view.js' => array('dependencies' => array('@wordpress/interactivity'), 'version' => '90af09b582052b715e0f', 'type' => 'module')); + array('dependencies' => array('wp-polyfill'), 'version' => '116169bf40ae097c8126', 'type' => 'module'), 'interactivity/debug.js' => array('dependencies' => array('wp-polyfill'), 'version' => '7a400562839eff47b61a', 'type' => 'module'), 'interactivity-router/index.js' => array('dependencies' => array('@wordpress/interactivity', 'wp-polyfill', array('id' => '@wordpress/a11y', 'import' => 'dynamic')), 'version' => '060124525e1d8dde5e34', 'type' => 'module'), 'a11y/index.js' => array('dependencies' => array(), 'version' => '2a5dd8e0f11b6868f8cf', 'type' => 'module'), 'block-library/file/view.js' => array('dependencies' => array('@wordpress/interactivity'), 'version' => 'e925ab60cccb6624004c', 'type' => 'module'), 'block-library/form/view.js' => array('dependencies' => array('wp-polyfill'), 'version' => '025c7429344421ccb2ef', 'type' => 'module'), 'block-library/image/view.js' => array('dependencies' => array('@wordpress/interactivity'), 'version' => '3fde70256dba53031db9', 'type' => 'module'), 'block-library/navigation/view.js' => array('dependencies' => array('@wordpress/interactivity', 'wp-polyfill'), 'version' => '430dc23d9d561e7844d1', 'type' => 'module'), 'block-library/query/view.js' => array('dependencies' => array('@wordpress/interactivity', array('id' => '@wordpress/interactivity-router', 'import' => 'dynamic')), 'version' => '4284e5c7bb31ec1182ca', 'type' => 'module'), 'block-library/search/view.js' => array('dependencies' => array('@wordpress/interactivity'), 'version' => '90af09b582052b715e0f', 'type' => 'module')); diff --git a/wp-includes/block-editor.php b/wp-includes/block-editor.php index bdca0d2c08..007c713190 100644 --- a/wp-includes/block-editor.php +++ b/wp-includes/block-editor.php @@ -223,6 +223,7 @@ function get_default_block_editor_settings() { 'imageEditing' => true, 'imageSizes' => $available_image_sizes, 'maxUploadFileSize' => $max_upload_size, + '__experimentalDashboardLink' => admin_url( '/' ), // The following flag is required to enable the new Gallery block format on the mobile apps in 5.9. '__unstableGalleryWithImageBlocks' => true, ); diff --git a/wp-includes/blocks/archives/block.json b/wp-includes/blocks/archives/block.json index e36691f314..7fe956a994 100644 --- a/wp-includes/blocks/archives/block.json +++ b/wp-includes/blocks/archives/block.json @@ -26,6 +26,12 @@ }, "supports": { "align": true, + "__experimentalBorder": { + "radius": true, + "color": true, + "width": true, + "style": true + }, "html": false, "spacing": { "margin": true, diff --git a/wp-includes/blocks/archives/editor-rtl.css b/wp-includes/blocks/archives/editor-rtl.css index 172d7871db..7972c7fb12 100644 --- a/wp-includes/blocks/archives/editor-rtl.css +++ b/wp-includes/blocks/archives/editor-rtl.css @@ -1,3 +1,8 @@ ul.wp-block-archives{ padding-right:2.5em; +} + +.wp-block-archives .wp-block-archives{ + border:0; + margin:0; } \ No newline at end of file diff --git a/wp-includes/blocks/archives/editor-rtl.min.css b/wp-includes/blocks/archives/editor-rtl.min.css index acf5f4d3fa..6e2b78d312 100644 --- a/wp-includes/blocks/archives/editor-rtl.min.css +++ b/wp-includes/blocks/archives/editor-rtl.min.css @@ -1 +1 @@ -ul.wp-block-archives{padding-right:2.5em} \ No newline at end of file +ul.wp-block-archives{padding-right:2.5em}.wp-block-archives .wp-block-archives{border:0;margin:0} \ No newline at end of file diff --git a/wp-includes/blocks/archives/editor.css b/wp-includes/blocks/archives/editor.css index 434d6cdd86..b6afb8c020 100644 --- a/wp-includes/blocks/archives/editor.css +++ b/wp-includes/blocks/archives/editor.css @@ -1,3 +1,8 @@ ul.wp-block-archives{ padding-left:2.5em; +} + +.wp-block-archives .wp-block-archives{ + border:0; + margin:0; } \ No newline at end of file diff --git a/wp-includes/blocks/archives/editor.min.css b/wp-includes/blocks/archives/editor.min.css index aa6ba10d5d..d1450830c2 100644 --- a/wp-includes/blocks/archives/editor.min.css +++ b/wp-includes/blocks/archives/editor.min.css @@ -1 +1 @@ -ul.wp-block-archives{padding-left:2.5em} \ No newline at end of file +ul.wp-block-archives{padding-left:2.5em}.wp-block-archives .wp-block-archives{border:0;margin:0} \ No newline at end of file diff --git a/wp-includes/blocks/block.php b/wp-includes/blocks/block.php index 8beef975fa..e8075115ca 100644 --- a/wp-includes/blocks/block.php +++ b/wp-includes/blocks/block.php @@ -87,6 +87,26 @@ function render_block_core_block( $attributes ) { add_filter( 'render_block_context', $filter_block_context, 1 ); } + $ignored_hooked_blocks = get_post_meta( $attributes['ref'], '_wp_ignored_hooked_blocks', true ); + if ( ! empty( $ignored_hooked_blocks ) ) { + $ignored_hooked_blocks = json_decode( $ignored_hooked_blocks, true ); + $attributes['metadata'] = array( + 'ignoredHookedBlocks' => $ignored_hooked_blocks, + ); + } + + // Wrap in "Block" block so the Block Hooks algorithm can insert blocks + // that are hooked as first or last child of `core/block`. + $content = get_comment_delimited_block_content( + 'core/block', + $attributes, + $content + ); + // Apply Block Hooks. + $content = apply_block_hooks_to_content( $content, $reusable_block ); + // Remove block wrapper. + $content = remove_serialized_parent_block( $content ); + $content = do_blocks( $content ); unset( $seen_refs[ $attributes['ref'] ] ); diff --git a/wp-includes/blocks/blocks-json.php b/wp-includes/blocks/blocks-json.php index b297700b87..4fd10f0b63 100644 --- a/wp-includes/blocks/blocks-json.php +++ b/wp-includes/blocks/blocks-json.php @@ -27,6 +27,12 @@ ), 'supports' => array( 'align' => true, + '__experimentalBorder' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true + ), 'html' => false, 'spacing' => array( 'margin' => true, @@ -324,6 +330,16 @@ ) ), 'typography' => array( + '__experimentalSkipSerialization' => array( + 'fontSize', + 'lineHeight', + 'fontFamily', + 'fontWeight', + 'fontStyle', + 'textTransform', + 'textDecoration', + 'letterSpacing' + ), 'fontSize' => true, 'lineHeight' => true, '__experimentalFontFamily' => true, @@ -364,7 +380,6 @@ 'width' => true ) ), - '__experimentalSelector' => '.wp-block-button .wp-block-button__link', 'interactivity' => array( 'clientNavigation' => true ) @@ -381,7 +396,13 @@ ) ), 'editorStyle' => 'wp-block-button-editor', - 'style' => 'wp-block-button' + 'style' => 'wp-block-button', + 'selectors' => array( + 'root' => '.wp-block-button .wp-block-button__link', + 'typography' => array( + 'writingMode' => '.wp-block-button' + ) + ) ), 'buttons' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', @@ -1314,6 +1335,18 @@ '__experimentalDefaultControls' => array( 'fontSize' => true ) + ), + '__experimentalBorder' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true, + '__experimentalDefaultControls' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true + ) ) ), 'editorStyle' => 'wp-block-comments-editor', @@ -1344,6 +1377,11 @@ 'default' => 'none' ) ), + 'example' => array( + 'attributes' => array( + 'paginationArrow' => 'none' + ) + ), 'providesContext' => array( 'comments/paginationArrow' => 'paginationArrow' ), @@ -1690,6 +1728,9 @@ 'tagName' => array( 'type' => 'string', 'default' => 'div' + ), + 'sizeSlug' => array( + 'type' => 'string' ) ), 'usesContext' => array( @@ -1784,6 +1825,18 @@ 'type' => 'rich-text', 'source' => 'rich-text', 'selector' => 'summary' + ), + 'name' => array( + 'type' => 'string', + 'source' => 'attribute', + 'attribute' => 'name', + 'selector' => '.wp-block-details' + ), + 'allowedBlocks' => array( + 'type' => 'array' + ), + 'placeholder' => array( + 'type' => 'string' ) ), 'supports' => array( @@ -1792,6 +1845,7 @@ 'wide', 'full' ), + 'anchor' => true, 'color' => array( 'gradients' => true, 'link' => true, @@ -1914,7 +1968,8 @@ 'role' => 'local' ), 'href' => array( - 'type' => 'string' + 'type' => 'string', + 'role' => 'content' ), 'fileId' => array( 'type' => 'string', @@ -1925,13 +1980,15 @@ 'fileName' => array( 'type' => 'rich-text', 'source' => 'rich-text', - 'selector' => 'a:not([download])' + 'selector' => 'a:not([download])', + 'role' => 'content' ), 'textLinkHref' => array( 'type' => 'string', 'source' => 'attribute', 'selector' => 'a:not([download])', - 'attribute' => 'href' + 'attribute' => 'href', + 'role' => 'content' ), 'textLinkTarget' => array( 'type' => 'string', @@ -1946,7 +2003,8 @@ 'downloadButtonText' => array( 'type' => 'rich-text', 'source' => 'rich-text', - 'selector' => 'a[download]' + 'selector' => 'a[download]', + 'role' => 'content' ), 'displayPreview' => array( 'type' => 'boolean' @@ -2420,13 +2478,7 @@ 'color' => true, 'radius' => true, 'style' => true, - 'width' => true, - '__experimentalDefaultControls' => array( - 'color' => true, - 'radius' => true, - 'style' => true, - 'width' => true - ) + 'width' => true ), 'color' => array( 'gradients' => true, @@ -2551,7 +2603,10 @@ 'usesContext' => array( 'allowResize', 'imageCrop', - 'fixedHeight' + 'fixedHeight', + 'postId', + 'postType', + 'queryId' ), 'description' => 'Insert an image to make a visual statement.', 'keywords' => array( @@ -2889,6 +2944,18 @@ 'fontSize' => true ) ), + '__experimentalBorder' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true, + '__experimentalDefaultControls' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true + ) + ), 'interactivity' => array( 'clientNavigation' => true ) @@ -3027,7 +3094,7 @@ '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/list-item', - 'title' => 'List item', + 'title' => 'List Item', 'category' => 'text', 'parent' => array( 'core/list' @@ -3808,6 +3875,31 @@ ), 'interactivity' => array( 'clientNavigation' => true + ), + 'color' => array( + 'text' => true, + 'background' => true, + 'link' => true, + 'gradients' => true, + '__experimentalDefaultControls' => array( + 'background' => true, + 'text' => true, + 'link' => true + ) + ), + '__experimentalBorder' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true + ), + 'spacing' => array( + 'padding' => true, + 'margin' => true, + '__experimentalDefaultControls' => array( + 'padding' => false, + 'margin' => false + ) ) ), 'editorStyle' => 'wp-block-page-list-editor', @@ -3963,7 +4055,7 @@ '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/pattern', - 'title' => 'Pattern placeholder', + 'title' => 'Pattern Placeholder', 'category' => 'theme', 'description' => 'Show a block pattern.', 'supports' => array( @@ -4009,11 +4101,13 @@ ), 'isLink' => array( 'type' => 'boolean', - 'default' => false + 'default' => false, + 'role' => 'content' ), 'linkTarget' => array( 'type' => 'string', - 'default' => '_self' + 'default' => '_self', + 'role' => 'content' ) ), 'usesContext' => array( @@ -4146,11 +4240,13 @@ ), 'isLink' => array( 'type' => 'boolean', - 'default' => false + 'default' => false, + 'role' => 'content' ), 'linkTarget' => array( 'type' => 'string', - 'default' => '_self' + 'default' => '_self', + 'role' => 'content' ) ), 'usesContext' => array( @@ -4267,6 +4363,11 @@ 'wp-block-post-comments-form', 'wp-block-buttons', 'wp-block-button' + ), + 'example' => array( + 'attributes' => array( + 'textAlign' => 'center' + ) ) ), 'post-content' => array( @@ -4305,6 +4406,7 @@ 'spacing' => array( 'blockGap' => true, 'padding' => true, + 'margin' => true, '__experimentalDefaultControls' => array( 'margin' => false, 'padding' => false @@ -4312,6 +4414,7 @@ ), 'color' => array( 'gradients' => true, + 'heading' => true, 'link' => true, '__experimentalDefaultControls' => array( 'background' => false, @@ -4330,6 +4433,18 @@ '__experimentalDefaultControls' => array( 'fontSize' => true ) + ), + '__experimentalBorder' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true, + '__experimentalDefaultControls' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true + ) ) ), 'style' => 'wp-block-post-content', @@ -4352,7 +4467,8 @@ ), 'isLink' => array( 'type' => 'boolean', - 'default' => false + 'default' => false, + 'role' => 'content' ), 'displayType' => array( 'type' => 'string', @@ -4502,7 +4618,8 @@ 'attributes' => array( 'isLink' => array( 'type' => 'boolean', - 'default' => false + 'default' => false, + 'role' => 'content' ), 'aspectRatio' => array( 'type' => 'string' @@ -4523,11 +4640,13 @@ 'rel' => array( 'type' => 'string', 'attribute' => 'rel', - 'default' => '' + 'default' => '', + 'role' => 'content' ), 'linkTarget' => array( 'type' => 'string', - 'default' => '_self' + 'default' => '_self', + 'role' => 'content' ), 'overlayColor' => array( 'type' => 'string' @@ -4677,7 +4796,7 @@ 'name' => 'core/post-template', 'title' => 'Post Template', 'category' => 'theme', - 'parent' => array( + 'ancestor' => array( 'core/query' ), 'description' => 'Contains the block elements used to render a post, like the title, date, featured image, content or excerpt, and more.', @@ -4688,7 +4807,8 @@ 'displayLayout', 'templateSlug', 'previewPostType', - 'enhancedPagination' + 'enhancedPagination', + 'postType' ), 'supports' => array( 'reusable' => false, @@ -4720,15 +4840,25 @@ ) ), 'spacing' => array( + 'margin' => true, + 'padding' => true, 'blockGap' => array( '__experimentalDefault' => '1.25em' ), '__experimentalDefaultControls' => array( - 'blockGap' => true + 'blockGap' => true, + 'padding' => false, + 'margin' => false ) ), 'interactivity' => array( 'clientNavigation' => true + ), + '__experimentalBorder' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true ) ), 'style' => 'wp-block-post-template', @@ -4841,16 +4971,19 @@ ), 'isLink' => array( 'type' => 'boolean', - 'default' => false + 'default' => false, + 'role' => 'content' ), 'rel' => array( 'type' => 'string', 'attribute' => 'rel', - 'default' => '' + 'default' => '', + 'role' => 'content' ), 'linkTarget' => array( 'type' => 'string', - 'default' => '_self' + 'default' => '_self', + 'role' => 'content' ) ), 'example' => array( @@ -5071,6 +5204,13 @@ 'title' => 'Query Loop', 'category' => 'theme', 'description' => 'An advanced block that allows displaying post types based on different query parameters and visual configurations.', + 'keywords' => array( + 'posts', + 'list', + 'blog', + 'blogs', + 'custom post types' + ), 'textdomain' => 'default', 'attributes' => array( 'queryId' => array( @@ -5114,7 +5254,7 @@ ) ), 'usesContext' => array( - 'postType' + 'templateSlug' ), 'providesContext' => array( 'queryId' => 'queryId', @@ -5137,10 +5277,10 @@ '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/query-no-results', - 'title' => 'No results', + 'title' => 'No Results', 'category' => 'theme', 'description' => 'Contains the block elements used to render content when no query results are found.', - 'parent' => array( + 'ancestor' => array( 'core/query' ), 'textdomain' => 'default', @@ -5432,6 +5572,11 @@ 'default' => true ) ), + 'example' => array( + 'attributes' => array( + 'type' => 'search' + ) + ), 'supports' => array( 'align' => array( 'wide', @@ -5480,6 +5625,72 @@ ), 'style' => 'wp-block-query-title' ), + 'query-total' => array( + '$schema' => 'https://schemas.wp.org/trunk/block.json', + 'apiVersion' => 3, + 'name' => 'core/query-total', + 'title' => 'Query Total', + 'category' => 'theme', + 'ancestor' => array( + 'core/query' + ), + 'description' => 'Display the total number of results in a query.', + 'textdomain' => 'default', + 'attributes' => array( + 'displayType' => array( + 'type' => 'string', + 'default' => 'total-results' + ) + ), + 'usesContext' => array( + 'queryId', + 'query' + ), + 'supports' => array( + 'align' => array( + 'wide', + 'full' + ), + 'html' => false, + 'spacing' => array( + 'margin' => true, + 'padding' => true + ), + 'color' => array( + 'gradients' => true, + 'text' => true, + '__experimentalDefaultControls' => array( + 'background' => true + ) + ), + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalFontStyle' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalLetterSpacing' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), + '__experimentalBorder' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true, + '__experimentalDefaultControls' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true + ) + ) + ), + 'style' => 'wp-block-query-total' + ), 'quote' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, @@ -5710,6 +5921,12 @@ 'html' => false, 'interactivity' => array( 'clientNavigation' => true + ), + 'color' => array( + 'background' => true, + 'text' => true, + 'gradients' => true, + 'link' => true ) ), 'editorStyle' => 'wp-block-rss-editor', @@ -5835,6 +6052,14 @@ 'opacity' => array( 'type' => 'string', 'default' => 'alpha-channel' + ), + 'tagName' => array( + 'type' => 'string', + 'enum' => array( + 'hr', + 'div' + ), + 'default' => 'hr' ) ), 'supports' => array( @@ -5917,11 +6142,13 @@ ), 'isLink' => array( 'type' => 'boolean', - 'default' => true + 'default' => true, + 'role' => 'content' ), 'linkTarget' => array( 'type' => 'string', - 'default' => '_self' + 'default' => '_self', + 'role' => 'content' ), 'shouldSyncIcon' => array( 'type' => 'boolean' @@ -6085,11 +6312,13 @@ ), 'isLink' => array( 'type' => 'boolean', - 'default' => true + 'default' => true, + 'role' => 'content' ), 'linkTarget' => array( 'type' => 'string', - 'default' => '_self' + 'default' => '_self', + 'role' => 'content' ) ), 'example' => array( @@ -6158,13 +6387,15 @@ 'textdomain' => 'default', 'attributes' => array( 'url' => array( - 'type' => 'string' + 'type' => 'string', + 'role' => 'content' ), 'service' => array( 'type' => 'string' ), 'label' => array( - 'type' => 'string' + 'type' => 'string', + 'role' => 'content' ), 'rel' => array( 'type' => 'string' @@ -6566,11 +6797,14 @@ 'width' => true ) ), - '__experimentalSelector' => '.wp-block-table > table', 'interactivity' => array( 'clientNavigation' => true ) ), + 'selectors' => array( + 'root' => '.wp-block-table > table', + 'spacing' => '.wp-block-table' + ), 'styles' => array( array( 'name' => 'regular', diff --git a/wp-includes/blocks/button/block.json b/wp-includes/blocks/button/block.json index 2c1c05baa2..6fcb7aca4c 100644 --- a/wp-includes/blocks/button/block.json +++ b/wp-includes/blocks/button/block.json @@ -85,6 +85,16 @@ } }, "typography": { + "__experimentalSkipSerialization": [ + "fontSize", + "lineHeight", + "fontFamily", + "fontWeight", + "fontStyle", + "textTransform", + "textDecoration", + "letterSpacing" + ], "fontSize": true, "lineHeight": true, "__experimentalFontFamily": true, @@ -122,7 +132,6 @@ "width": true } }, - "__experimentalSelector": ".wp-block-button .wp-block-button__link", "interactivity": { "clientNavigation": true } @@ -132,5 +141,11 @@ { "name": "outline", "label": "Outline" } ], "editorStyle": "wp-block-button-editor", - "style": "wp-block-button" + "style": "wp-block-button", + "selectors": { + "root": ".wp-block-button .wp-block-button__link", + "typography": { + "writingMode": ".wp-block-button" + } + } } diff --git a/wp-includes/blocks/button/style-rtl.css b/wp-includes/blocks/button/style-rtl.css index 007cfc4ed2..5b399897f3 100644 --- a/wp-includes/blocks/button/style-rtl.css +++ b/wp-includes/blocks/button/style-rtl.css @@ -1,8 +1,11 @@ .wp-block-button__link{ + align-content:center; box-sizing:border-box; cursor:pointer; display:inline-block; + height:100%; text-align:center; + width:100%; word-break:break-word; } .wp-block-button__link.aligncenter{ diff --git a/wp-includes/blocks/button/style-rtl.min.css b/wp-includes/blocks/button/style-rtl.min.css index da03e9525d..05a98fcc28 100644 --- a/wp-includes/blocks/button/style-rtl.min.css +++ b/wp-includes/blocks/button/style-rtl.min.css @@ -1 +1 @@ -.wp-block-button__link{box-sizing:border-box;cursor:pointer;display:inline-block;text-align:center;word-break:break-word}.wp-block-button__link.aligncenter{text-align:center}.wp-block-button__link.alignright{text-align:right}:where(.wp-block-button__link){border-radius:9999px;box-shadow:none;padding:calc(.667em + 2px) calc(1.333em + 2px);text-decoration:none}.wp-block-button[style*=text-decoration] .wp-block-button__link{text-decoration:inherit}.wp-block-buttons>.wp-block-button.has-custom-width{max-width:none}.wp-block-buttons>.wp-block-button.has-custom-width .wp-block-button__link{width:100%}.wp-block-buttons>.wp-block-button.has-custom-font-size .wp-block-button__link{font-size:inherit}.wp-block-buttons>.wp-block-button.wp-block-button__width-25{width:calc(25% - var(--wp--style--block-gap, .5em)*.75)}.wp-block-buttons>.wp-block-button.wp-block-button__width-50{width:calc(50% - var(--wp--style--block-gap, .5em)*.5)}.wp-block-buttons>.wp-block-button.wp-block-button__width-75{width:calc(75% - var(--wp--style--block-gap, .5em)*.25)}.wp-block-buttons>.wp-block-button.wp-block-button__width-100{flex-basis:100%;width:100%}.wp-block-buttons.is-vertical>.wp-block-button.wp-block-button__width-25{width:25%}.wp-block-buttons.is-vertical>.wp-block-button.wp-block-button__width-50{width:50%}.wp-block-buttons.is-vertical>.wp-block-button.wp-block-button__width-75{width:75%}.wp-block-button.is-style-squared,.wp-block-button__link.wp-block-button.is-style-squared{border-radius:0}.wp-block-button.no-border-radius,.wp-block-button__link.no-border-radius{border-radius:0!important}:root :where(.wp-block-button .wp-block-button__link.is-style-outline),:root :where(.wp-block-button.is-style-outline>.wp-block-button__link){border:2px solid;padding:.667em 1.333em}:root :where(.wp-block-button .wp-block-button__link.is-style-outline:not(.has-text-color)),:root :where(.wp-block-button.is-style-outline>.wp-block-button__link:not(.has-text-color)){color:currentColor}:root :where(.wp-block-button .wp-block-button__link.is-style-outline:not(.has-background)),:root :where(.wp-block-button.is-style-outline>.wp-block-button__link:not(.has-background)){background-color:initial;background-image:none} \ No newline at end of file +.wp-block-button__link{align-content:center;box-sizing:border-box;cursor:pointer;display:inline-block;height:100%;text-align:center;width:100%;word-break:break-word}.wp-block-button__link.aligncenter{text-align:center}.wp-block-button__link.alignright{text-align:right}:where(.wp-block-button__link){border-radius:9999px;box-shadow:none;padding:calc(.667em + 2px) calc(1.333em + 2px);text-decoration:none}.wp-block-button[style*=text-decoration] .wp-block-button__link{text-decoration:inherit}.wp-block-buttons>.wp-block-button.has-custom-width{max-width:none}.wp-block-buttons>.wp-block-button.has-custom-width .wp-block-button__link{width:100%}.wp-block-buttons>.wp-block-button.has-custom-font-size .wp-block-button__link{font-size:inherit}.wp-block-buttons>.wp-block-button.wp-block-button__width-25{width:calc(25% - var(--wp--style--block-gap, .5em)*.75)}.wp-block-buttons>.wp-block-button.wp-block-button__width-50{width:calc(50% - var(--wp--style--block-gap, .5em)*.5)}.wp-block-buttons>.wp-block-button.wp-block-button__width-75{width:calc(75% - var(--wp--style--block-gap, .5em)*.25)}.wp-block-buttons>.wp-block-button.wp-block-button__width-100{flex-basis:100%;width:100%}.wp-block-buttons.is-vertical>.wp-block-button.wp-block-button__width-25{width:25%}.wp-block-buttons.is-vertical>.wp-block-button.wp-block-button__width-50{width:50%}.wp-block-buttons.is-vertical>.wp-block-button.wp-block-button__width-75{width:75%}.wp-block-button.is-style-squared,.wp-block-button__link.wp-block-button.is-style-squared{border-radius:0}.wp-block-button.no-border-radius,.wp-block-button__link.no-border-radius{border-radius:0!important}:root :where(.wp-block-button .wp-block-button__link.is-style-outline),:root :where(.wp-block-button.is-style-outline>.wp-block-button__link){border:2px solid;padding:.667em 1.333em}:root :where(.wp-block-button .wp-block-button__link.is-style-outline:not(.has-text-color)),:root :where(.wp-block-button.is-style-outline>.wp-block-button__link:not(.has-text-color)){color:currentColor}:root :where(.wp-block-button .wp-block-button__link.is-style-outline:not(.has-background)),:root :where(.wp-block-button.is-style-outline>.wp-block-button__link:not(.has-background)){background-color:initial;background-image:none} \ No newline at end of file diff --git a/wp-includes/blocks/button/style.css b/wp-includes/blocks/button/style.css index 007cfc4ed2..5b399897f3 100644 --- a/wp-includes/blocks/button/style.css +++ b/wp-includes/blocks/button/style.css @@ -1,8 +1,11 @@ .wp-block-button__link{ + align-content:center; box-sizing:border-box; cursor:pointer; display:inline-block; + height:100%; text-align:center; + width:100%; word-break:break-word; } .wp-block-button__link.aligncenter{ diff --git a/wp-includes/blocks/button/style.min.css b/wp-includes/blocks/button/style.min.css index da03e9525d..05a98fcc28 100644 --- a/wp-includes/blocks/button/style.min.css +++ b/wp-includes/blocks/button/style.min.css @@ -1 +1 @@ -.wp-block-button__link{box-sizing:border-box;cursor:pointer;display:inline-block;text-align:center;word-break:break-word}.wp-block-button__link.aligncenter{text-align:center}.wp-block-button__link.alignright{text-align:right}:where(.wp-block-button__link){border-radius:9999px;box-shadow:none;padding:calc(.667em + 2px) calc(1.333em + 2px);text-decoration:none}.wp-block-button[style*=text-decoration] .wp-block-button__link{text-decoration:inherit}.wp-block-buttons>.wp-block-button.has-custom-width{max-width:none}.wp-block-buttons>.wp-block-button.has-custom-width .wp-block-button__link{width:100%}.wp-block-buttons>.wp-block-button.has-custom-font-size .wp-block-button__link{font-size:inherit}.wp-block-buttons>.wp-block-button.wp-block-button__width-25{width:calc(25% - var(--wp--style--block-gap, .5em)*.75)}.wp-block-buttons>.wp-block-button.wp-block-button__width-50{width:calc(50% - var(--wp--style--block-gap, .5em)*.5)}.wp-block-buttons>.wp-block-button.wp-block-button__width-75{width:calc(75% - var(--wp--style--block-gap, .5em)*.25)}.wp-block-buttons>.wp-block-button.wp-block-button__width-100{flex-basis:100%;width:100%}.wp-block-buttons.is-vertical>.wp-block-button.wp-block-button__width-25{width:25%}.wp-block-buttons.is-vertical>.wp-block-button.wp-block-button__width-50{width:50%}.wp-block-buttons.is-vertical>.wp-block-button.wp-block-button__width-75{width:75%}.wp-block-button.is-style-squared,.wp-block-button__link.wp-block-button.is-style-squared{border-radius:0}.wp-block-button.no-border-radius,.wp-block-button__link.no-border-radius{border-radius:0!important}:root :where(.wp-block-button .wp-block-button__link.is-style-outline),:root :where(.wp-block-button.is-style-outline>.wp-block-button__link){border:2px solid;padding:.667em 1.333em}:root :where(.wp-block-button .wp-block-button__link.is-style-outline:not(.has-text-color)),:root :where(.wp-block-button.is-style-outline>.wp-block-button__link:not(.has-text-color)){color:currentColor}:root :where(.wp-block-button .wp-block-button__link.is-style-outline:not(.has-background)),:root :where(.wp-block-button.is-style-outline>.wp-block-button__link:not(.has-background)){background-color:initial;background-image:none} \ No newline at end of file +.wp-block-button__link{align-content:center;box-sizing:border-box;cursor:pointer;display:inline-block;height:100%;text-align:center;width:100%;word-break:break-word}.wp-block-button__link.aligncenter{text-align:center}.wp-block-button__link.alignright{text-align:right}:where(.wp-block-button__link){border-radius:9999px;box-shadow:none;padding:calc(.667em + 2px) calc(1.333em + 2px);text-decoration:none}.wp-block-button[style*=text-decoration] .wp-block-button__link{text-decoration:inherit}.wp-block-buttons>.wp-block-button.has-custom-width{max-width:none}.wp-block-buttons>.wp-block-button.has-custom-width .wp-block-button__link{width:100%}.wp-block-buttons>.wp-block-button.has-custom-font-size .wp-block-button__link{font-size:inherit}.wp-block-buttons>.wp-block-button.wp-block-button__width-25{width:calc(25% - var(--wp--style--block-gap, .5em)*.75)}.wp-block-buttons>.wp-block-button.wp-block-button__width-50{width:calc(50% - var(--wp--style--block-gap, .5em)*.5)}.wp-block-buttons>.wp-block-button.wp-block-button__width-75{width:calc(75% - var(--wp--style--block-gap, .5em)*.25)}.wp-block-buttons>.wp-block-button.wp-block-button__width-100{flex-basis:100%;width:100%}.wp-block-buttons.is-vertical>.wp-block-button.wp-block-button__width-25{width:25%}.wp-block-buttons.is-vertical>.wp-block-button.wp-block-button__width-50{width:50%}.wp-block-buttons.is-vertical>.wp-block-button.wp-block-button__width-75{width:75%}.wp-block-button.is-style-squared,.wp-block-button__link.wp-block-button.is-style-squared{border-radius:0}.wp-block-button.no-border-radius,.wp-block-button__link.no-border-radius{border-radius:0!important}:root :where(.wp-block-button .wp-block-button__link.is-style-outline),:root :where(.wp-block-button.is-style-outline>.wp-block-button__link){border:2px solid;padding:.667em 1.333em}:root :where(.wp-block-button .wp-block-button__link.is-style-outline:not(.has-text-color)),:root :where(.wp-block-button.is-style-outline>.wp-block-button__link:not(.has-text-color)){color:currentColor}:root :where(.wp-block-button .wp-block-button__link.is-style-outline:not(.has-background)),:root :where(.wp-block-button.is-style-outline>.wp-block-button__link:not(.has-background)){background-color:initial;background-image:none} \ No newline at end of file diff --git a/wp-includes/blocks/buttons/style-rtl.css b/wp-includes/blocks/buttons/style-rtl.css index 8ece3079a6..e04d648165 100644 --- a/wp-includes/blocks/buttons/style-rtl.css +++ b/wp-includes/blocks/buttons/style-rtl.css @@ -1,3 +1,6 @@ +.wp-block-buttons{ + box-sizing:border-box; +} .wp-block-buttons.is-vertical{ flex-direction:column; } diff --git a/wp-includes/blocks/buttons/style-rtl.min.css b/wp-includes/blocks/buttons/style-rtl.min.css index 6816481773..1495eab92b 100644 --- a/wp-includes/blocks/buttons/style-rtl.min.css +++ b/wp-includes/blocks/buttons/style-rtl.min.css @@ -1 +1 @@ -.wp-block-buttons.is-vertical{flex-direction:column}.wp-block-buttons.is-vertical>.wp-block-button:last-child{margin-bottom:0}.wp-block-buttons>.wp-block-button{display:inline-block;margin:0}.wp-block-buttons.is-content-justification-left{justify-content:flex-start}.wp-block-buttons.is-content-justification-left.is-vertical{align-items:flex-start}.wp-block-buttons.is-content-justification-center{justify-content:center}.wp-block-buttons.is-content-justification-center.is-vertical{align-items:center}.wp-block-buttons.is-content-justification-right{justify-content:flex-end}.wp-block-buttons.is-content-justification-right.is-vertical{align-items:flex-end}.wp-block-buttons.is-content-justification-space-between{justify-content:space-between}.wp-block-buttons.aligncenter{text-align:center}.wp-block-buttons:not(.is-content-justification-space-between,.is-content-justification-right,.is-content-justification-left,.is-content-justification-center) .wp-block-button.aligncenter{margin-left:auto;margin-right:auto;width:100%}.wp-block-buttons[style*=text-decoration] .wp-block-button,.wp-block-buttons[style*=text-decoration] .wp-block-button__link{text-decoration:inherit}.wp-block-buttons.has-custom-font-size .wp-block-button__link{font-size:inherit}.wp-block-button.aligncenter{text-align:center} \ No newline at end of file +.wp-block-buttons{box-sizing:border-box}.wp-block-buttons.is-vertical{flex-direction:column}.wp-block-buttons.is-vertical>.wp-block-button:last-child{margin-bottom:0}.wp-block-buttons>.wp-block-button{display:inline-block;margin:0}.wp-block-buttons.is-content-justification-left{justify-content:flex-start}.wp-block-buttons.is-content-justification-left.is-vertical{align-items:flex-start}.wp-block-buttons.is-content-justification-center{justify-content:center}.wp-block-buttons.is-content-justification-center.is-vertical{align-items:center}.wp-block-buttons.is-content-justification-right{justify-content:flex-end}.wp-block-buttons.is-content-justification-right.is-vertical{align-items:flex-end}.wp-block-buttons.is-content-justification-space-between{justify-content:space-between}.wp-block-buttons.aligncenter{text-align:center}.wp-block-buttons:not(.is-content-justification-space-between,.is-content-justification-right,.is-content-justification-left,.is-content-justification-center) .wp-block-button.aligncenter{margin-left:auto;margin-right:auto;width:100%}.wp-block-buttons[style*=text-decoration] .wp-block-button,.wp-block-buttons[style*=text-decoration] .wp-block-button__link{text-decoration:inherit}.wp-block-buttons.has-custom-font-size .wp-block-button__link{font-size:inherit}.wp-block-button.aligncenter{text-align:center} \ No newline at end of file diff --git a/wp-includes/blocks/buttons/style.css b/wp-includes/blocks/buttons/style.css index 8ece3079a6..e04d648165 100644 --- a/wp-includes/blocks/buttons/style.css +++ b/wp-includes/blocks/buttons/style.css @@ -1,3 +1,6 @@ +.wp-block-buttons{ + box-sizing:border-box; +} .wp-block-buttons.is-vertical{ flex-direction:column; } diff --git a/wp-includes/blocks/buttons/style.min.css b/wp-includes/blocks/buttons/style.min.css index 6816481773..1495eab92b 100644 --- a/wp-includes/blocks/buttons/style.min.css +++ b/wp-includes/blocks/buttons/style.min.css @@ -1 +1 @@ -.wp-block-buttons.is-vertical{flex-direction:column}.wp-block-buttons.is-vertical>.wp-block-button:last-child{margin-bottom:0}.wp-block-buttons>.wp-block-button{display:inline-block;margin:0}.wp-block-buttons.is-content-justification-left{justify-content:flex-start}.wp-block-buttons.is-content-justification-left.is-vertical{align-items:flex-start}.wp-block-buttons.is-content-justification-center{justify-content:center}.wp-block-buttons.is-content-justification-center.is-vertical{align-items:center}.wp-block-buttons.is-content-justification-right{justify-content:flex-end}.wp-block-buttons.is-content-justification-right.is-vertical{align-items:flex-end}.wp-block-buttons.is-content-justification-space-between{justify-content:space-between}.wp-block-buttons.aligncenter{text-align:center}.wp-block-buttons:not(.is-content-justification-space-between,.is-content-justification-right,.is-content-justification-left,.is-content-justification-center) .wp-block-button.aligncenter{margin-left:auto;margin-right:auto;width:100%}.wp-block-buttons[style*=text-decoration] .wp-block-button,.wp-block-buttons[style*=text-decoration] .wp-block-button__link{text-decoration:inherit}.wp-block-buttons.has-custom-font-size .wp-block-button__link{font-size:inherit}.wp-block-button.aligncenter{text-align:center} \ No newline at end of file +.wp-block-buttons{box-sizing:border-box}.wp-block-buttons.is-vertical{flex-direction:column}.wp-block-buttons.is-vertical>.wp-block-button:last-child{margin-bottom:0}.wp-block-buttons>.wp-block-button{display:inline-block;margin:0}.wp-block-buttons.is-content-justification-left{justify-content:flex-start}.wp-block-buttons.is-content-justification-left.is-vertical{align-items:flex-start}.wp-block-buttons.is-content-justification-center{justify-content:center}.wp-block-buttons.is-content-justification-center.is-vertical{align-items:center}.wp-block-buttons.is-content-justification-right{justify-content:flex-end}.wp-block-buttons.is-content-justification-right.is-vertical{align-items:flex-end}.wp-block-buttons.is-content-justification-space-between{justify-content:space-between}.wp-block-buttons.aligncenter{text-align:center}.wp-block-buttons:not(.is-content-justification-space-between,.is-content-justification-right,.is-content-justification-left,.is-content-justification-center) .wp-block-button.aligncenter{margin-left:auto;margin-right:auto;width:100%}.wp-block-buttons[style*=text-decoration] .wp-block-button,.wp-block-buttons[style*=text-decoration] .wp-block-button__link{text-decoration:inherit}.wp-block-buttons.has-custom-font-size .wp-block-button__link{font-size:inherit}.wp-block-button.aligncenter{text-align:center} \ No newline at end of file diff --git a/wp-includes/blocks/code/style-rtl.css b/wp-includes/blocks/code/style-rtl.css index bfb5909d9d..f1df7aa569 100644 --- a/wp-includes/blocks/code/style-rtl.css +++ b/wp-includes/blocks/code/style-rtl.css @@ -2,8 +2,10 @@ box-sizing:border-box; } .wp-block-code code{ + direction:ltr; display:block; font-family:inherit; overflow-wrap:break-word; + text-align:initial; white-space:pre-wrap; } \ No newline at end of file diff --git a/wp-includes/blocks/code/style-rtl.min.css b/wp-includes/blocks/code/style-rtl.min.css index 3ef3f33ba2..a6c504855f 100644 --- a/wp-includes/blocks/code/style-rtl.min.css +++ b/wp-includes/blocks/code/style-rtl.min.css @@ -1 +1 @@ -.wp-block-code{box-sizing:border-box}.wp-block-code code{display:block;font-family:inherit;overflow-wrap:break-word;white-space:pre-wrap} \ No newline at end of file +.wp-block-code{box-sizing:border-box}.wp-block-code code{direction:ltr;display:block;font-family:inherit;overflow-wrap:break-word;text-align:initial;white-space:pre-wrap} \ No newline at end of file diff --git a/wp-includes/blocks/code/style.css b/wp-includes/blocks/code/style.css index bfb5909d9d..f1df7aa569 100644 --- a/wp-includes/blocks/code/style.css +++ b/wp-includes/blocks/code/style.css @@ -2,8 +2,10 @@ box-sizing:border-box; } .wp-block-code code{ + direction:ltr; display:block; font-family:inherit; overflow-wrap:break-word; + text-align:initial; white-space:pre-wrap; } \ No newline at end of file diff --git a/wp-includes/blocks/code/style.min.css b/wp-includes/blocks/code/style.min.css index 3ef3f33ba2..0ac3861818 100644 --- a/wp-includes/blocks/code/style.min.css +++ b/wp-includes/blocks/code/style.min.css @@ -1 +1,3 @@ -.wp-block-code{box-sizing:border-box}.wp-block-code code{display:block;font-family:inherit;overflow-wrap:break-word;white-space:pre-wrap} \ No newline at end of file +.wp-block-code{box-sizing:border-box}.wp-block-code code{ + /*!rtl:begin:ignore*/direction:ltr;display:block;font-family:inherit;overflow-wrap:break-word;text-align:initial;white-space:pre-wrap + /*!rtl:end:ignore*/} \ No newline at end of file diff --git a/wp-includes/blocks/comment-template/style-rtl.css b/wp-includes/blocks/comment-template/style-rtl.css index 51e5b89939..6b613e508c 100644 --- a/wp-includes/blocks/comment-template/style-rtl.css +++ b/wp-includes/blocks/comment-template/style-rtl.css @@ -20,7 +20,6 @@ .wp-block-comment-template.aligncenter{ margin-left:auto; margin-right:auto; - width:-moz-fit-content; width:fit-content; } .wp-block-comment-template.alignright{ diff --git a/wp-includes/blocks/comment-template/style-rtl.min.css b/wp-includes/blocks/comment-template/style-rtl.min.css index d15f281c49..40a8cfeb54 100644 --- a/wp-includes/blocks/comment-template/style-rtl.min.css +++ b/wp-includes/blocks/comment-template/style-rtl.min.css @@ -1 +1 @@ -.wp-block-comment-template{box-sizing:border-box;list-style:none;margin-bottom:0;max-width:100%;padding:0}.wp-block-comment-template li{clear:both}.wp-block-comment-template ol{list-style:none;margin-bottom:0;max-width:100%;padding-right:2rem}.wp-block-comment-template.alignleft{float:right}.wp-block-comment-template.aligncenter{margin-left:auto;margin-right:auto;width:-moz-fit-content;width:fit-content}.wp-block-comment-template.alignright{float:left} \ No newline at end of file +.wp-block-comment-template{box-sizing:border-box;list-style:none;margin-bottom:0;max-width:100%;padding:0}.wp-block-comment-template li{clear:both}.wp-block-comment-template ol{list-style:none;margin-bottom:0;max-width:100%;padding-right:2rem}.wp-block-comment-template.alignleft{float:right}.wp-block-comment-template.aligncenter{margin-left:auto;margin-right:auto;width:fit-content}.wp-block-comment-template.alignright{float:left} \ No newline at end of file diff --git a/wp-includes/blocks/comment-template/style.css b/wp-includes/blocks/comment-template/style.css index bfec572824..75753665e9 100644 --- a/wp-includes/blocks/comment-template/style.css +++ b/wp-includes/blocks/comment-template/style.css @@ -20,7 +20,6 @@ .wp-block-comment-template.aligncenter{ margin-left:auto; margin-right:auto; - width:-moz-fit-content; width:fit-content; } .wp-block-comment-template.alignright{ diff --git a/wp-includes/blocks/comment-template/style.min.css b/wp-includes/blocks/comment-template/style.min.css index 631ba4f759..985ccfe4be 100644 --- a/wp-includes/blocks/comment-template/style.min.css +++ b/wp-includes/blocks/comment-template/style.min.css @@ -1 +1 @@ -.wp-block-comment-template{box-sizing:border-box;list-style:none;margin-bottom:0;max-width:100%;padding:0}.wp-block-comment-template li{clear:both}.wp-block-comment-template ol{list-style:none;margin-bottom:0;max-width:100%;padding-left:2rem}.wp-block-comment-template.alignleft{float:left}.wp-block-comment-template.aligncenter{margin-left:auto;margin-right:auto;width:-moz-fit-content;width:fit-content}.wp-block-comment-template.alignright{float:right} \ No newline at end of file +.wp-block-comment-template{box-sizing:border-box;list-style:none;margin-bottom:0;max-width:100%;padding:0}.wp-block-comment-template li{clear:both}.wp-block-comment-template ol{list-style:none;margin-bottom:0;max-width:100%;padding-left:2rem}.wp-block-comment-template.alignleft{float:left}.wp-block-comment-template.aligncenter{margin-left:auto;margin-right:auto;width:fit-content}.wp-block-comment-template.alignright{float:right} \ No newline at end of file diff --git a/wp-includes/blocks/comments-pagination/block.json b/wp-includes/blocks/comments-pagination/block.json index 28f6c9fdfd..b29d95bc4f 100644 --- a/wp-includes/blocks/comments-pagination/block.json +++ b/wp-includes/blocks/comments-pagination/block.json @@ -18,6 +18,11 @@ "default": "none" } }, + "example": { + "attributes": { + "paginationArrow": "none" + } + }, "providesContext": { "comments/paginationArrow": "paginationArrow" }, diff --git a/wp-includes/blocks/comments-pagination/editor-rtl.css b/wp-includes/blocks/comments-pagination/editor-rtl.css index 34f63296cd..43167569ab 100644 --- a/wp-includes/blocks/comments-pagination/editor-rtl.css +++ b/wp-includes/blocks/comments-pagination/editor-rtl.css @@ -10,6 +10,7 @@ } .wp-block-comments-pagination>.wp-block-comments-pagination-next,.wp-block-comments-pagination>.wp-block-comments-pagination-numbers,.wp-block-comments-pagination>.wp-block-comments-pagination-previous{ + font-size:inherit; margin-bottom:.5em; margin-right:.5em; margin-top:.5em; diff --git a/wp-includes/blocks/comments-pagination/editor-rtl.min.css b/wp-includes/blocks/comments-pagination/editor-rtl.min.css index f5cbcee19a..a64b9d8a5e 100644 --- a/wp-includes/blocks/comments-pagination/editor-rtl.min.css +++ b/wp-includes/blocks/comments-pagination/editor-rtl.min.css @@ -1 +1 @@ -.wp-block[data-align=center]>.wp-block-comments-pagination{justify-content:center}:where(.editor-styles-wrapper) .wp-block-comments-pagination{max-width:100%}:where(.editor-styles-wrapper) .wp-block-comments-pagination.block-editor-block-list__layout{margin:0}.wp-block-comments-pagination>.wp-block-comments-pagination-next,.wp-block-comments-pagination>.wp-block-comments-pagination-numbers,.wp-block-comments-pagination>.wp-block-comments-pagination-previous{margin-bottom:.5em;margin-right:.5em;margin-top:.5em}.wp-block-comments-pagination>.wp-block-comments-pagination-next:last-child,.wp-block-comments-pagination>.wp-block-comments-pagination-numbers:last-child,.wp-block-comments-pagination>.wp-block-comments-pagination-previous:last-child{margin-right:0} \ No newline at end of file +.wp-block[data-align=center]>.wp-block-comments-pagination{justify-content:center}:where(.editor-styles-wrapper) .wp-block-comments-pagination{max-width:100%}:where(.editor-styles-wrapper) .wp-block-comments-pagination.block-editor-block-list__layout{margin:0}.wp-block-comments-pagination>.wp-block-comments-pagination-next,.wp-block-comments-pagination>.wp-block-comments-pagination-numbers,.wp-block-comments-pagination>.wp-block-comments-pagination-previous{font-size:inherit;margin-bottom:.5em;margin-right:.5em;margin-top:.5em}.wp-block-comments-pagination>.wp-block-comments-pagination-next:last-child,.wp-block-comments-pagination>.wp-block-comments-pagination-numbers:last-child,.wp-block-comments-pagination>.wp-block-comments-pagination-previous:last-child{margin-right:0} \ No newline at end of file diff --git a/wp-includes/blocks/comments-pagination/editor.css b/wp-includes/blocks/comments-pagination/editor.css index 3b3f782a3d..d9bac321ce 100644 --- a/wp-includes/blocks/comments-pagination/editor.css +++ b/wp-includes/blocks/comments-pagination/editor.css @@ -10,6 +10,7 @@ } .wp-block-comments-pagination>.wp-block-comments-pagination-next,.wp-block-comments-pagination>.wp-block-comments-pagination-numbers,.wp-block-comments-pagination>.wp-block-comments-pagination-previous{ + font-size:inherit; margin:.5em .5em .5em 0; } .wp-block-comments-pagination>.wp-block-comments-pagination-next:last-child,.wp-block-comments-pagination>.wp-block-comments-pagination-numbers:last-child,.wp-block-comments-pagination>.wp-block-comments-pagination-previous:last-child{ diff --git a/wp-includes/blocks/comments-pagination/editor.min.css b/wp-includes/blocks/comments-pagination/editor.min.css index 04f8193bf1..ced03f7697 100644 --- a/wp-includes/blocks/comments-pagination/editor.min.css +++ b/wp-includes/blocks/comments-pagination/editor.min.css @@ -1 +1 @@ -.wp-block[data-align=center]>.wp-block-comments-pagination{justify-content:center}:where(.editor-styles-wrapper) .wp-block-comments-pagination{max-width:100%}:where(.editor-styles-wrapper) .wp-block-comments-pagination.block-editor-block-list__layout{margin:0}.wp-block-comments-pagination>.wp-block-comments-pagination-next,.wp-block-comments-pagination>.wp-block-comments-pagination-numbers,.wp-block-comments-pagination>.wp-block-comments-pagination-previous{margin:.5em .5em .5em 0}.wp-block-comments-pagination>.wp-block-comments-pagination-next:last-child,.wp-block-comments-pagination>.wp-block-comments-pagination-numbers:last-child,.wp-block-comments-pagination>.wp-block-comments-pagination-previous:last-child{margin-right:0} \ No newline at end of file +.wp-block[data-align=center]>.wp-block-comments-pagination{justify-content:center}:where(.editor-styles-wrapper) .wp-block-comments-pagination{max-width:100%}:where(.editor-styles-wrapper) .wp-block-comments-pagination.block-editor-block-list__layout{margin:0}.wp-block-comments-pagination>.wp-block-comments-pagination-next,.wp-block-comments-pagination>.wp-block-comments-pagination-numbers,.wp-block-comments-pagination>.wp-block-comments-pagination-previous{font-size:inherit;margin:.5em .5em .5em 0}.wp-block-comments-pagination>.wp-block-comments-pagination-next:last-child,.wp-block-comments-pagination>.wp-block-comments-pagination-numbers:last-child,.wp-block-comments-pagination>.wp-block-comments-pagination-previous:last-child{margin-right:0} \ No newline at end of file diff --git a/wp-includes/blocks/comments-pagination/style-rtl.css b/wp-includes/blocks/comments-pagination/style-rtl.css index 8922daf09a..01a9fea8e1 100644 --- a/wp-includes/blocks/comments-pagination/style-rtl.css +++ b/wp-includes/blocks/comments-pagination/style-rtl.css @@ -1,4 +1,5 @@ .wp-block-comments-pagination>.wp-block-comments-pagination-next,.wp-block-comments-pagination>.wp-block-comments-pagination-numbers,.wp-block-comments-pagination>.wp-block-comments-pagination-previous{ + font-size:inherit; margin-bottom:.5em; margin-right:.5em; } diff --git a/wp-includes/blocks/comments-pagination/style-rtl.min.css b/wp-includes/blocks/comments-pagination/style-rtl.min.css index b470c0bd8e..58e42324bc 100644 --- a/wp-includes/blocks/comments-pagination/style-rtl.min.css +++ b/wp-includes/blocks/comments-pagination/style-rtl.min.css @@ -1 +1 @@ -.wp-block-comments-pagination>.wp-block-comments-pagination-next,.wp-block-comments-pagination>.wp-block-comments-pagination-numbers,.wp-block-comments-pagination>.wp-block-comments-pagination-previous{margin-bottom:.5em;margin-right:.5em}.wp-block-comments-pagination>.wp-block-comments-pagination-next:last-child,.wp-block-comments-pagination>.wp-block-comments-pagination-numbers:last-child,.wp-block-comments-pagination>.wp-block-comments-pagination-previous:last-child{margin-right:0}.wp-block-comments-pagination .wp-block-comments-pagination-previous-arrow{display:inline-block;margin-left:1ch}.wp-block-comments-pagination .wp-block-comments-pagination-previous-arrow:not(.is-arrow-chevron){transform:scaleX(-1)}.wp-block-comments-pagination .wp-block-comments-pagination-next-arrow{display:inline-block;margin-right:1ch}.wp-block-comments-pagination .wp-block-comments-pagination-next-arrow:not(.is-arrow-chevron){transform:scaleX(-1)}.wp-block-comments-pagination.aligncenter{justify-content:center} \ No newline at end of file +.wp-block-comments-pagination>.wp-block-comments-pagination-next,.wp-block-comments-pagination>.wp-block-comments-pagination-numbers,.wp-block-comments-pagination>.wp-block-comments-pagination-previous{font-size:inherit;margin-bottom:.5em;margin-right:.5em}.wp-block-comments-pagination>.wp-block-comments-pagination-next:last-child,.wp-block-comments-pagination>.wp-block-comments-pagination-numbers:last-child,.wp-block-comments-pagination>.wp-block-comments-pagination-previous:last-child{margin-right:0}.wp-block-comments-pagination .wp-block-comments-pagination-previous-arrow{display:inline-block;margin-left:1ch}.wp-block-comments-pagination .wp-block-comments-pagination-previous-arrow:not(.is-arrow-chevron){transform:scaleX(-1)}.wp-block-comments-pagination .wp-block-comments-pagination-next-arrow{display:inline-block;margin-right:1ch}.wp-block-comments-pagination .wp-block-comments-pagination-next-arrow:not(.is-arrow-chevron){transform:scaleX(-1)}.wp-block-comments-pagination.aligncenter{justify-content:center} \ No newline at end of file diff --git a/wp-includes/blocks/comments-pagination/style.css b/wp-includes/blocks/comments-pagination/style.css index 4c3b883d63..e6d94c2b99 100644 --- a/wp-includes/blocks/comments-pagination/style.css +++ b/wp-includes/blocks/comments-pagination/style.css @@ -1,4 +1,5 @@ .wp-block-comments-pagination>.wp-block-comments-pagination-next,.wp-block-comments-pagination>.wp-block-comments-pagination-numbers,.wp-block-comments-pagination>.wp-block-comments-pagination-previous{ + font-size:inherit; margin-bottom:.5em; margin-right:.5em; } diff --git a/wp-includes/blocks/comments-pagination/style.min.css b/wp-includes/blocks/comments-pagination/style.min.css index 7e7fb33678..34bec74b56 100644 --- a/wp-includes/blocks/comments-pagination/style.min.css +++ b/wp-includes/blocks/comments-pagination/style.min.css @@ -1 +1 @@ -.wp-block-comments-pagination>.wp-block-comments-pagination-next,.wp-block-comments-pagination>.wp-block-comments-pagination-numbers,.wp-block-comments-pagination>.wp-block-comments-pagination-previous{margin-bottom:.5em;margin-right:.5em}.wp-block-comments-pagination>.wp-block-comments-pagination-next:last-child,.wp-block-comments-pagination>.wp-block-comments-pagination-numbers:last-child,.wp-block-comments-pagination>.wp-block-comments-pagination-previous:last-child{margin-right:0}.wp-block-comments-pagination .wp-block-comments-pagination-previous-arrow{display:inline-block;margin-right:1ch}.wp-block-comments-pagination .wp-block-comments-pagination-previous-arrow:not(.is-arrow-chevron){transform:scaleX(1)}.wp-block-comments-pagination .wp-block-comments-pagination-next-arrow{display:inline-block;margin-left:1ch}.wp-block-comments-pagination .wp-block-comments-pagination-next-arrow:not(.is-arrow-chevron){transform:scaleX(1)}.wp-block-comments-pagination.aligncenter{justify-content:center} \ No newline at end of file +.wp-block-comments-pagination>.wp-block-comments-pagination-next,.wp-block-comments-pagination>.wp-block-comments-pagination-numbers,.wp-block-comments-pagination>.wp-block-comments-pagination-previous{font-size:inherit;margin-bottom:.5em;margin-right:.5em}.wp-block-comments-pagination>.wp-block-comments-pagination-next:last-child,.wp-block-comments-pagination>.wp-block-comments-pagination-numbers:last-child,.wp-block-comments-pagination>.wp-block-comments-pagination-previous:last-child{margin-right:0}.wp-block-comments-pagination .wp-block-comments-pagination-previous-arrow{display:inline-block;margin-right:1ch}.wp-block-comments-pagination .wp-block-comments-pagination-previous-arrow:not(.is-arrow-chevron){transform:scaleX(1)}.wp-block-comments-pagination .wp-block-comments-pagination-next-arrow{display:inline-block;margin-left:1ch}.wp-block-comments-pagination .wp-block-comments-pagination-next-arrow:not(.is-arrow-chevron){transform:scaleX(1)}.wp-block-comments-pagination.aligncenter{justify-content:center} \ No newline at end of file diff --git a/wp-includes/blocks/comments/block.json b/wp-includes/blocks/comments/block.json index b35ea3505c..ceb8f750c3 100644 --- a/wp-includes/blocks/comments/block.json +++ b/wp-includes/blocks/comments/block.json @@ -45,6 +45,18 @@ "__experimentalDefaultControls": { "fontSize": true } + }, + "__experimentalBorder": { + "radius": true, + "color": true, + "width": true, + "style": true, + "__experimentalDefaultControls": { + "radius": true, + "color": true, + "width": true, + "style": true + } } }, "editorStyle": "wp-block-comments-editor", diff --git a/wp-includes/blocks/comments/editor-rtl.css b/wp-includes/blocks/comments/editor-rtl.css index 1957e9e362..3d0c298eb1 100644 --- a/wp-includes/blocks/comments/editor-rtl.css +++ b/wp-includes/blocks/comments/editor-rtl.css @@ -98,10 +98,14 @@ padding:calc(.667em + 2px); } -:where(.wp-block-post-comments input[type=submit]){ +:where(.wp-block-post-comments input[type=submit],.wp-block-comments__legacy-placeholder input[type=submit]){ border:none; } +.wp-block-comments{ + box-sizing:border-box; +} + .block-library-comments-toolbar__popover .components-popover__content{ min-width:230px; } diff --git a/wp-includes/blocks/comments/editor-rtl.min.css b/wp-includes/blocks/comments/editor-rtl.min.css index 37af71b036..ff190c979e 100644 --- a/wp-includes/blocks/comments/editor-rtl.min.css +++ b/wp-includes/blocks/comments/editor-rtl.min.css @@ -1 +1 @@ -.wp-block-comments__legacy-placeholder,.wp-block-post-comments{box-sizing:border-box}.wp-block-comments__legacy-placeholder .alignleft,.wp-block-post-comments .alignleft{float:right}.wp-block-comments__legacy-placeholder .alignright,.wp-block-post-comments .alignright{float:left}.wp-block-comments__legacy-placeholder .navigation:after,.wp-block-post-comments .navigation:after{clear:both;content:"";display:table}.wp-block-comments__legacy-placeholder .commentlist,.wp-block-post-comments .commentlist{clear:both;list-style:none;margin:0;padding:0}.wp-block-comments__legacy-placeholder .commentlist .comment,.wp-block-post-comments .commentlist .comment{min-height:2.25em;padding-right:3.25em}.wp-block-comments__legacy-placeholder .commentlist .comment p,.wp-block-post-comments .commentlist .comment p{font-size:1em;line-height:1.8;margin:1em 0}.wp-block-comments__legacy-placeholder .commentlist .children,.wp-block-post-comments .commentlist .children{list-style:none;margin:0;padding:0}.wp-block-comments__legacy-placeholder .comment-author,.wp-block-post-comments .comment-author{line-height:1.5}.wp-block-comments__legacy-placeholder .comment-author .avatar,.wp-block-post-comments .comment-author .avatar{border-radius:1.5em;display:block;float:right;height:2.5em;margin-left:.75em;margin-top:.5em;width:2.5em}.wp-block-comments__legacy-placeholder .comment-author cite,.wp-block-post-comments .comment-author cite{font-style:normal}.wp-block-comments__legacy-placeholder .comment-meta,.wp-block-post-comments .comment-meta{font-size:.875em;line-height:1.5}.wp-block-comments__legacy-placeholder .comment-meta b,.wp-block-post-comments .comment-meta b{font-weight:400}.wp-block-comments__legacy-placeholder .comment-meta .comment-awaiting-moderation,.wp-block-post-comments .comment-meta .comment-awaiting-moderation{display:block;margin-bottom:1em;margin-top:1em}.wp-block-comments__legacy-placeholder .comment-body .commentmetadata,.wp-block-post-comments .comment-body .commentmetadata{font-size:.875em}.wp-block-comments__legacy-placeholder .comment-form-author label,.wp-block-comments__legacy-placeholder .comment-form-comment label,.wp-block-comments__legacy-placeholder .comment-form-email label,.wp-block-comments__legacy-placeholder .comment-form-url label,.wp-block-post-comments .comment-form-author label,.wp-block-post-comments .comment-form-comment label,.wp-block-post-comments .comment-form-email label,.wp-block-post-comments .comment-form-url label{display:block;margin-bottom:.25em}.wp-block-comments__legacy-placeholder .comment-form input:not([type=submit]):not([type=checkbox]),.wp-block-comments__legacy-placeholder .comment-form textarea,.wp-block-post-comments .comment-form input:not([type=submit]):not([type=checkbox]),.wp-block-post-comments .comment-form textarea{box-sizing:border-box;display:block;width:100%}.wp-block-comments__legacy-placeholder .comment-form-cookies-consent,.wp-block-post-comments .comment-form-cookies-consent{display:flex;gap:.25em}.wp-block-comments__legacy-placeholder .comment-form-cookies-consent #wp-comment-cookies-consent,.wp-block-post-comments .comment-form-cookies-consent #wp-comment-cookies-consent{margin-top:.35em}.wp-block-comments__legacy-placeholder .comment-reply-title,.wp-block-post-comments .comment-reply-title{margin-bottom:0}.wp-block-comments__legacy-placeholder .comment-reply-title :where(small),.wp-block-post-comments .comment-reply-title :where(small){font-size:var(--wp--preset--font-size--medium,smaller);margin-right:.5em}.wp-block-comments__legacy-placeholder .reply,.wp-block-post-comments .reply{font-size:.875em;margin-bottom:1.4em}.wp-block-comments__legacy-placeholder input:not([type=submit]),.wp-block-comments__legacy-placeholder textarea,.wp-block-post-comments input:not([type=submit]),.wp-block-post-comments textarea{border:1px solid #949494;font-family:inherit;font-size:1em}.wp-block-comments__legacy-placeholder input:not([type=submit]):not([type=checkbox]),.wp-block-comments__legacy-placeholder textarea,.wp-block-post-comments input:not([type=submit]):not([type=checkbox]),.wp-block-post-comments textarea{padding:calc(.667em + 2px)}:where(.wp-block-post-comments input[type=submit]){border:none}.block-library-comments-toolbar__popover .components-popover__content{min-width:230px}.wp-block-comments__legacy-placeholder *{pointer-events:none} \ No newline at end of file +.wp-block-comments__legacy-placeholder,.wp-block-post-comments{box-sizing:border-box}.wp-block-comments__legacy-placeholder .alignleft,.wp-block-post-comments .alignleft{float:right}.wp-block-comments__legacy-placeholder .alignright,.wp-block-post-comments .alignright{float:left}.wp-block-comments__legacy-placeholder .navigation:after,.wp-block-post-comments .navigation:after{clear:both;content:"";display:table}.wp-block-comments__legacy-placeholder .commentlist,.wp-block-post-comments .commentlist{clear:both;list-style:none;margin:0;padding:0}.wp-block-comments__legacy-placeholder .commentlist .comment,.wp-block-post-comments .commentlist .comment{min-height:2.25em;padding-right:3.25em}.wp-block-comments__legacy-placeholder .commentlist .comment p,.wp-block-post-comments .commentlist .comment p{font-size:1em;line-height:1.8;margin:1em 0}.wp-block-comments__legacy-placeholder .commentlist .children,.wp-block-post-comments .commentlist .children{list-style:none;margin:0;padding:0}.wp-block-comments__legacy-placeholder .comment-author,.wp-block-post-comments .comment-author{line-height:1.5}.wp-block-comments__legacy-placeholder .comment-author .avatar,.wp-block-post-comments .comment-author .avatar{border-radius:1.5em;display:block;float:right;height:2.5em;margin-left:.75em;margin-top:.5em;width:2.5em}.wp-block-comments__legacy-placeholder .comment-author cite,.wp-block-post-comments .comment-author cite{font-style:normal}.wp-block-comments__legacy-placeholder .comment-meta,.wp-block-post-comments .comment-meta{font-size:.875em;line-height:1.5}.wp-block-comments__legacy-placeholder .comment-meta b,.wp-block-post-comments .comment-meta b{font-weight:400}.wp-block-comments__legacy-placeholder .comment-meta .comment-awaiting-moderation,.wp-block-post-comments .comment-meta .comment-awaiting-moderation{display:block;margin-bottom:1em;margin-top:1em}.wp-block-comments__legacy-placeholder .comment-body .commentmetadata,.wp-block-post-comments .comment-body .commentmetadata{font-size:.875em}.wp-block-comments__legacy-placeholder .comment-form-author label,.wp-block-comments__legacy-placeholder .comment-form-comment label,.wp-block-comments__legacy-placeholder .comment-form-email label,.wp-block-comments__legacy-placeholder .comment-form-url label,.wp-block-post-comments .comment-form-author label,.wp-block-post-comments .comment-form-comment label,.wp-block-post-comments .comment-form-email label,.wp-block-post-comments .comment-form-url label{display:block;margin-bottom:.25em}.wp-block-comments__legacy-placeholder .comment-form input:not([type=submit]):not([type=checkbox]),.wp-block-comments__legacy-placeholder .comment-form textarea,.wp-block-post-comments .comment-form input:not([type=submit]):not([type=checkbox]),.wp-block-post-comments .comment-form textarea{box-sizing:border-box;display:block;width:100%}.wp-block-comments__legacy-placeholder .comment-form-cookies-consent,.wp-block-post-comments .comment-form-cookies-consent{display:flex;gap:.25em}.wp-block-comments__legacy-placeholder .comment-form-cookies-consent #wp-comment-cookies-consent,.wp-block-post-comments .comment-form-cookies-consent #wp-comment-cookies-consent{margin-top:.35em}.wp-block-comments__legacy-placeholder .comment-reply-title,.wp-block-post-comments .comment-reply-title{margin-bottom:0}.wp-block-comments__legacy-placeholder .comment-reply-title :where(small),.wp-block-post-comments .comment-reply-title :where(small){font-size:var(--wp--preset--font-size--medium,smaller);margin-right:.5em}.wp-block-comments__legacy-placeholder .reply,.wp-block-post-comments .reply{font-size:.875em;margin-bottom:1.4em}.wp-block-comments__legacy-placeholder input:not([type=submit]),.wp-block-comments__legacy-placeholder textarea,.wp-block-post-comments input:not([type=submit]),.wp-block-post-comments textarea{border:1px solid #949494;font-family:inherit;font-size:1em}.wp-block-comments__legacy-placeholder input:not([type=submit]):not([type=checkbox]),.wp-block-comments__legacy-placeholder textarea,.wp-block-post-comments input:not([type=submit]):not([type=checkbox]),.wp-block-post-comments textarea{padding:calc(.667em + 2px)}:where(.wp-block-post-comments input[type=submit],.wp-block-comments__legacy-placeholder input[type=submit]){border:none}.wp-block-comments{box-sizing:border-box}.block-library-comments-toolbar__popover .components-popover__content{min-width:230px}.wp-block-comments__legacy-placeholder *{pointer-events:none} \ No newline at end of file diff --git a/wp-includes/blocks/comments/editor.css b/wp-includes/blocks/comments/editor.css index e1b3136d9d..3af93790a8 100644 --- a/wp-includes/blocks/comments/editor.css +++ b/wp-includes/blocks/comments/editor.css @@ -98,10 +98,14 @@ padding:calc(.667em + 2px); } -:where(.wp-block-post-comments input[type=submit]){ +:where(.wp-block-post-comments input[type=submit],.wp-block-comments__legacy-placeholder input[type=submit]){ border:none; } +.wp-block-comments{ + box-sizing:border-box; +} + .block-library-comments-toolbar__popover .components-popover__content{ min-width:230px; } diff --git a/wp-includes/blocks/comments/editor.min.css b/wp-includes/blocks/comments/editor.min.css index 995153d4c0..d0c3b4b5e1 100644 --- a/wp-includes/blocks/comments/editor.min.css +++ b/wp-includes/blocks/comments/editor.min.css @@ -1 +1 @@ -.wp-block-comments__legacy-placeholder,.wp-block-post-comments{box-sizing:border-box}.wp-block-comments__legacy-placeholder .alignleft,.wp-block-post-comments .alignleft{float:left}.wp-block-comments__legacy-placeholder .alignright,.wp-block-post-comments .alignright{float:right}.wp-block-comments__legacy-placeholder .navigation:after,.wp-block-post-comments .navigation:after{clear:both;content:"";display:table}.wp-block-comments__legacy-placeholder .commentlist,.wp-block-post-comments .commentlist{clear:both;list-style:none;margin:0;padding:0}.wp-block-comments__legacy-placeholder .commentlist .comment,.wp-block-post-comments .commentlist .comment{min-height:2.25em;padding-left:3.25em}.wp-block-comments__legacy-placeholder .commentlist .comment p,.wp-block-post-comments .commentlist .comment p{font-size:1em;line-height:1.8;margin:1em 0}.wp-block-comments__legacy-placeholder .commentlist .children,.wp-block-post-comments .commentlist .children{list-style:none;margin:0;padding:0}.wp-block-comments__legacy-placeholder .comment-author,.wp-block-post-comments .comment-author{line-height:1.5}.wp-block-comments__legacy-placeholder .comment-author .avatar,.wp-block-post-comments .comment-author .avatar{border-radius:1.5em;display:block;float:left;height:2.5em;margin-right:.75em;margin-top:.5em;width:2.5em}.wp-block-comments__legacy-placeholder .comment-author cite,.wp-block-post-comments .comment-author cite{font-style:normal}.wp-block-comments__legacy-placeholder .comment-meta,.wp-block-post-comments .comment-meta{font-size:.875em;line-height:1.5}.wp-block-comments__legacy-placeholder .comment-meta b,.wp-block-post-comments .comment-meta b{font-weight:400}.wp-block-comments__legacy-placeholder .comment-meta .comment-awaiting-moderation,.wp-block-post-comments .comment-meta .comment-awaiting-moderation{display:block;margin-bottom:1em;margin-top:1em}.wp-block-comments__legacy-placeholder .comment-body .commentmetadata,.wp-block-post-comments .comment-body .commentmetadata{font-size:.875em}.wp-block-comments__legacy-placeholder .comment-form-author label,.wp-block-comments__legacy-placeholder .comment-form-comment label,.wp-block-comments__legacy-placeholder .comment-form-email label,.wp-block-comments__legacy-placeholder .comment-form-url label,.wp-block-post-comments .comment-form-author label,.wp-block-post-comments .comment-form-comment label,.wp-block-post-comments .comment-form-email label,.wp-block-post-comments .comment-form-url label{display:block;margin-bottom:.25em}.wp-block-comments__legacy-placeholder .comment-form input:not([type=submit]):not([type=checkbox]),.wp-block-comments__legacy-placeholder .comment-form textarea,.wp-block-post-comments .comment-form input:not([type=submit]):not([type=checkbox]),.wp-block-post-comments .comment-form textarea{box-sizing:border-box;display:block;width:100%}.wp-block-comments__legacy-placeholder .comment-form-cookies-consent,.wp-block-post-comments .comment-form-cookies-consent{display:flex;gap:.25em}.wp-block-comments__legacy-placeholder .comment-form-cookies-consent #wp-comment-cookies-consent,.wp-block-post-comments .comment-form-cookies-consent #wp-comment-cookies-consent{margin-top:.35em}.wp-block-comments__legacy-placeholder .comment-reply-title,.wp-block-post-comments .comment-reply-title{margin-bottom:0}.wp-block-comments__legacy-placeholder .comment-reply-title :where(small),.wp-block-post-comments .comment-reply-title :where(small){font-size:var(--wp--preset--font-size--medium,smaller);margin-left:.5em}.wp-block-comments__legacy-placeholder .reply,.wp-block-post-comments .reply{font-size:.875em;margin-bottom:1.4em}.wp-block-comments__legacy-placeholder input:not([type=submit]),.wp-block-comments__legacy-placeholder textarea,.wp-block-post-comments input:not([type=submit]),.wp-block-post-comments textarea{border:1px solid #949494;font-family:inherit;font-size:1em}.wp-block-comments__legacy-placeholder input:not([type=submit]):not([type=checkbox]),.wp-block-comments__legacy-placeholder textarea,.wp-block-post-comments input:not([type=submit]):not([type=checkbox]),.wp-block-post-comments textarea{padding:calc(.667em + 2px)}:where(.wp-block-post-comments input[type=submit]){border:none}.block-library-comments-toolbar__popover .components-popover__content{min-width:230px}.wp-block-comments__legacy-placeholder *{pointer-events:none} \ No newline at end of file +.wp-block-comments__legacy-placeholder,.wp-block-post-comments{box-sizing:border-box}.wp-block-comments__legacy-placeholder .alignleft,.wp-block-post-comments .alignleft{float:left}.wp-block-comments__legacy-placeholder .alignright,.wp-block-post-comments .alignright{float:right}.wp-block-comments__legacy-placeholder .navigation:after,.wp-block-post-comments .navigation:after{clear:both;content:"";display:table}.wp-block-comments__legacy-placeholder .commentlist,.wp-block-post-comments .commentlist{clear:both;list-style:none;margin:0;padding:0}.wp-block-comments__legacy-placeholder .commentlist .comment,.wp-block-post-comments .commentlist .comment{min-height:2.25em;padding-left:3.25em}.wp-block-comments__legacy-placeholder .commentlist .comment p,.wp-block-post-comments .commentlist .comment p{font-size:1em;line-height:1.8;margin:1em 0}.wp-block-comments__legacy-placeholder .commentlist .children,.wp-block-post-comments .commentlist .children{list-style:none;margin:0;padding:0}.wp-block-comments__legacy-placeholder .comment-author,.wp-block-post-comments .comment-author{line-height:1.5}.wp-block-comments__legacy-placeholder .comment-author .avatar,.wp-block-post-comments .comment-author .avatar{border-radius:1.5em;display:block;float:left;height:2.5em;margin-right:.75em;margin-top:.5em;width:2.5em}.wp-block-comments__legacy-placeholder .comment-author cite,.wp-block-post-comments .comment-author cite{font-style:normal}.wp-block-comments__legacy-placeholder .comment-meta,.wp-block-post-comments .comment-meta{font-size:.875em;line-height:1.5}.wp-block-comments__legacy-placeholder .comment-meta b,.wp-block-post-comments .comment-meta b{font-weight:400}.wp-block-comments__legacy-placeholder .comment-meta .comment-awaiting-moderation,.wp-block-post-comments .comment-meta .comment-awaiting-moderation{display:block;margin-bottom:1em;margin-top:1em}.wp-block-comments__legacy-placeholder .comment-body .commentmetadata,.wp-block-post-comments .comment-body .commentmetadata{font-size:.875em}.wp-block-comments__legacy-placeholder .comment-form-author label,.wp-block-comments__legacy-placeholder .comment-form-comment label,.wp-block-comments__legacy-placeholder .comment-form-email label,.wp-block-comments__legacy-placeholder .comment-form-url label,.wp-block-post-comments .comment-form-author label,.wp-block-post-comments .comment-form-comment label,.wp-block-post-comments .comment-form-email label,.wp-block-post-comments .comment-form-url label{display:block;margin-bottom:.25em}.wp-block-comments__legacy-placeholder .comment-form input:not([type=submit]):not([type=checkbox]),.wp-block-comments__legacy-placeholder .comment-form textarea,.wp-block-post-comments .comment-form input:not([type=submit]):not([type=checkbox]),.wp-block-post-comments .comment-form textarea{box-sizing:border-box;display:block;width:100%}.wp-block-comments__legacy-placeholder .comment-form-cookies-consent,.wp-block-post-comments .comment-form-cookies-consent{display:flex;gap:.25em}.wp-block-comments__legacy-placeholder .comment-form-cookies-consent #wp-comment-cookies-consent,.wp-block-post-comments .comment-form-cookies-consent #wp-comment-cookies-consent{margin-top:.35em}.wp-block-comments__legacy-placeholder .comment-reply-title,.wp-block-post-comments .comment-reply-title{margin-bottom:0}.wp-block-comments__legacy-placeholder .comment-reply-title :where(small),.wp-block-post-comments .comment-reply-title :where(small){font-size:var(--wp--preset--font-size--medium,smaller);margin-left:.5em}.wp-block-comments__legacy-placeholder .reply,.wp-block-post-comments .reply{font-size:.875em;margin-bottom:1.4em}.wp-block-comments__legacy-placeholder input:not([type=submit]),.wp-block-comments__legacy-placeholder textarea,.wp-block-post-comments input:not([type=submit]),.wp-block-post-comments textarea{border:1px solid #949494;font-family:inherit;font-size:1em}.wp-block-comments__legacy-placeholder input:not([type=submit]):not([type=checkbox]),.wp-block-comments__legacy-placeholder textarea,.wp-block-post-comments input:not([type=submit]):not([type=checkbox]),.wp-block-post-comments textarea{padding:calc(.667em + 2px)}:where(.wp-block-post-comments input[type=submit],.wp-block-comments__legacy-placeholder input[type=submit]){border:none}.wp-block-comments{box-sizing:border-box}.block-library-comments-toolbar__popover .components-popover__content{min-width:230px}.wp-block-comments__legacy-placeholder *{pointer-events:none} \ No newline at end of file diff --git a/wp-includes/blocks/comments/style-rtl.css b/wp-includes/blocks/comments/style-rtl.css index 636a8a187f..c746bb1950 100644 --- a/wp-includes/blocks/comments/style-rtl.css +++ b/wp-includes/blocks/comments/style-rtl.css @@ -100,4 +100,8 @@ :where(.wp-block-post-comments input[type=submit]){ border:none; +} + +.wp-block-comments{ + box-sizing:border-box; } \ No newline at end of file diff --git a/wp-includes/blocks/comments/style-rtl.min.css b/wp-includes/blocks/comments/style-rtl.min.css index 8a27a2703e..33a016be90 100644 --- a/wp-includes/blocks/comments/style-rtl.min.css +++ b/wp-includes/blocks/comments/style-rtl.min.css @@ -1 +1 @@ -.wp-block-post-comments{box-sizing:border-box}.wp-block-post-comments .alignleft{float:right}.wp-block-post-comments .alignright{float:left}.wp-block-post-comments .navigation:after{clear:both;content:"";display:table}.wp-block-post-comments .commentlist{clear:both;list-style:none;margin:0;padding:0}.wp-block-post-comments .commentlist .comment{min-height:2.25em;padding-right:3.25em}.wp-block-post-comments .commentlist .comment p{font-size:1em;line-height:1.8;margin:1em 0}.wp-block-post-comments .commentlist .children{list-style:none;margin:0;padding:0}.wp-block-post-comments .comment-author{line-height:1.5}.wp-block-post-comments .comment-author .avatar{border-radius:1.5em;display:block;float:right;height:2.5em;margin-left:.75em;margin-top:.5em;width:2.5em}.wp-block-post-comments .comment-author cite{font-style:normal}.wp-block-post-comments .comment-meta{font-size:.875em;line-height:1.5}.wp-block-post-comments .comment-meta b{font-weight:400}.wp-block-post-comments .comment-meta .comment-awaiting-moderation{display:block;margin-bottom:1em;margin-top:1em}.wp-block-post-comments .comment-body .commentmetadata{font-size:.875em}.wp-block-post-comments .comment-form-author label,.wp-block-post-comments .comment-form-comment label,.wp-block-post-comments .comment-form-email label,.wp-block-post-comments .comment-form-url label{display:block;margin-bottom:.25em}.wp-block-post-comments .comment-form input:not([type=submit]):not([type=checkbox]),.wp-block-post-comments .comment-form textarea{box-sizing:border-box;display:block;width:100%}.wp-block-post-comments .comment-form-cookies-consent{display:flex;gap:.25em}.wp-block-post-comments .comment-form-cookies-consent #wp-comment-cookies-consent{margin-top:.35em}.wp-block-post-comments .comment-reply-title{margin-bottom:0}.wp-block-post-comments .comment-reply-title :where(small){font-size:var(--wp--preset--font-size--medium,smaller);margin-right:.5em}.wp-block-post-comments .reply{font-size:.875em;margin-bottom:1.4em}.wp-block-post-comments input:not([type=submit]),.wp-block-post-comments textarea{border:1px solid #949494;font-family:inherit;font-size:1em}.wp-block-post-comments input:not([type=submit]):not([type=checkbox]),.wp-block-post-comments textarea{padding:calc(.667em + 2px)}:where(.wp-block-post-comments input[type=submit]){border:none} \ No newline at end of file +.wp-block-post-comments{box-sizing:border-box}.wp-block-post-comments .alignleft{float:right}.wp-block-post-comments .alignright{float:left}.wp-block-post-comments .navigation:after{clear:both;content:"";display:table}.wp-block-post-comments .commentlist{clear:both;list-style:none;margin:0;padding:0}.wp-block-post-comments .commentlist .comment{min-height:2.25em;padding-right:3.25em}.wp-block-post-comments .commentlist .comment p{font-size:1em;line-height:1.8;margin:1em 0}.wp-block-post-comments .commentlist .children{list-style:none;margin:0;padding:0}.wp-block-post-comments .comment-author{line-height:1.5}.wp-block-post-comments .comment-author .avatar{border-radius:1.5em;display:block;float:right;height:2.5em;margin-left:.75em;margin-top:.5em;width:2.5em}.wp-block-post-comments .comment-author cite{font-style:normal}.wp-block-post-comments .comment-meta{font-size:.875em;line-height:1.5}.wp-block-post-comments .comment-meta b{font-weight:400}.wp-block-post-comments .comment-meta .comment-awaiting-moderation{display:block;margin-bottom:1em;margin-top:1em}.wp-block-post-comments .comment-body .commentmetadata{font-size:.875em}.wp-block-post-comments .comment-form-author label,.wp-block-post-comments .comment-form-comment label,.wp-block-post-comments .comment-form-email label,.wp-block-post-comments .comment-form-url label{display:block;margin-bottom:.25em}.wp-block-post-comments .comment-form input:not([type=submit]):not([type=checkbox]),.wp-block-post-comments .comment-form textarea{box-sizing:border-box;display:block;width:100%}.wp-block-post-comments .comment-form-cookies-consent{display:flex;gap:.25em}.wp-block-post-comments .comment-form-cookies-consent #wp-comment-cookies-consent{margin-top:.35em}.wp-block-post-comments .comment-reply-title{margin-bottom:0}.wp-block-post-comments .comment-reply-title :where(small){font-size:var(--wp--preset--font-size--medium,smaller);margin-right:.5em}.wp-block-post-comments .reply{font-size:.875em;margin-bottom:1.4em}.wp-block-post-comments input:not([type=submit]),.wp-block-post-comments textarea{border:1px solid #949494;font-family:inherit;font-size:1em}.wp-block-post-comments input:not([type=submit]):not([type=checkbox]),.wp-block-post-comments textarea{padding:calc(.667em + 2px)}:where(.wp-block-post-comments input[type=submit]){border:none}.wp-block-comments{box-sizing:border-box} \ No newline at end of file diff --git a/wp-includes/blocks/comments/style.css b/wp-includes/blocks/comments/style.css index c34c2db28c..42f8a6b18c 100644 --- a/wp-includes/blocks/comments/style.css +++ b/wp-includes/blocks/comments/style.css @@ -100,4 +100,8 @@ :where(.wp-block-post-comments input[type=submit]){ border:none; +} + +.wp-block-comments{ + box-sizing:border-box; } \ No newline at end of file diff --git a/wp-includes/blocks/comments/style.min.css b/wp-includes/blocks/comments/style.min.css index e359e5da26..c04b89d5bb 100644 --- a/wp-includes/blocks/comments/style.min.css +++ b/wp-includes/blocks/comments/style.min.css @@ -1 +1 @@ -.wp-block-post-comments{box-sizing:border-box}.wp-block-post-comments .alignleft{float:left}.wp-block-post-comments .alignright{float:right}.wp-block-post-comments .navigation:after{clear:both;content:"";display:table}.wp-block-post-comments .commentlist{clear:both;list-style:none;margin:0;padding:0}.wp-block-post-comments .commentlist .comment{min-height:2.25em;padding-left:3.25em}.wp-block-post-comments .commentlist .comment p{font-size:1em;line-height:1.8;margin:1em 0}.wp-block-post-comments .commentlist .children{list-style:none;margin:0;padding:0}.wp-block-post-comments .comment-author{line-height:1.5}.wp-block-post-comments .comment-author .avatar{border-radius:1.5em;display:block;float:left;height:2.5em;margin-right:.75em;margin-top:.5em;width:2.5em}.wp-block-post-comments .comment-author cite{font-style:normal}.wp-block-post-comments .comment-meta{font-size:.875em;line-height:1.5}.wp-block-post-comments .comment-meta b{font-weight:400}.wp-block-post-comments .comment-meta .comment-awaiting-moderation{display:block;margin-bottom:1em;margin-top:1em}.wp-block-post-comments .comment-body .commentmetadata{font-size:.875em}.wp-block-post-comments .comment-form-author label,.wp-block-post-comments .comment-form-comment label,.wp-block-post-comments .comment-form-email label,.wp-block-post-comments .comment-form-url label{display:block;margin-bottom:.25em}.wp-block-post-comments .comment-form input:not([type=submit]):not([type=checkbox]),.wp-block-post-comments .comment-form textarea{box-sizing:border-box;display:block;width:100%}.wp-block-post-comments .comment-form-cookies-consent{display:flex;gap:.25em}.wp-block-post-comments .comment-form-cookies-consent #wp-comment-cookies-consent{margin-top:.35em}.wp-block-post-comments .comment-reply-title{margin-bottom:0}.wp-block-post-comments .comment-reply-title :where(small){font-size:var(--wp--preset--font-size--medium,smaller);margin-left:.5em}.wp-block-post-comments .reply{font-size:.875em;margin-bottom:1.4em}.wp-block-post-comments input:not([type=submit]),.wp-block-post-comments textarea{border:1px solid #949494;font-family:inherit;font-size:1em}.wp-block-post-comments input:not([type=submit]):not([type=checkbox]),.wp-block-post-comments textarea{padding:calc(.667em + 2px)}:where(.wp-block-post-comments input[type=submit]){border:none} \ No newline at end of file +.wp-block-post-comments{box-sizing:border-box}.wp-block-post-comments .alignleft{float:left}.wp-block-post-comments .alignright{float:right}.wp-block-post-comments .navigation:after{clear:both;content:"";display:table}.wp-block-post-comments .commentlist{clear:both;list-style:none;margin:0;padding:0}.wp-block-post-comments .commentlist .comment{min-height:2.25em;padding-left:3.25em}.wp-block-post-comments .commentlist .comment p{font-size:1em;line-height:1.8;margin:1em 0}.wp-block-post-comments .commentlist .children{list-style:none;margin:0;padding:0}.wp-block-post-comments .comment-author{line-height:1.5}.wp-block-post-comments .comment-author .avatar{border-radius:1.5em;display:block;float:left;height:2.5em;margin-right:.75em;margin-top:.5em;width:2.5em}.wp-block-post-comments .comment-author cite{font-style:normal}.wp-block-post-comments .comment-meta{font-size:.875em;line-height:1.5}.wp-block-post-comments .comment-meta b{font-weight:400}.wp-block-post-comments .comment-meta .comment-awaiting-moderation{display:block;margin-bottom:1em;margin-top:1em}.wp-block-post-comments .comment-body .commentmetadata{font-size:.875em}.wp-block-post-comments .comment-form-author label,.wp-block-post-comments .comment-form-comment label,.wp-block-post-comments .comment-form-email label,.wp-block-post-comments .comment-form-url label{display:block;margin-bottom:.25em}.wp-block-post-comments .comment-form input:not([type=submit]):not([type=checkbox]),.wp-block-post-comments .comment-form textarea{box-sizing:border-box;display:block;width:100%}.wp-block-post-comments .comment-form-cookies-consent{display:flex;gap:.25em}.wp-block-post-comments .comment-form-cookies-consent #wp-comment-cookies-consent{margin-top:.35em}.wp-block-post-comments .comment-reply-title{margin-bottom:0}.wp-block-post-comments .comment-reply-title :where(small){font-size:var(--wp--preset--font-size--medium,smaller);margin-left:.5em}.wp-block-post-comments .reply{font-size:.875em;margin-bottom:1.4em}.wp-block-post-comments input:not([type=submit]),.wp-block-post-comments textarea{border:1px solid #949494;font-family:inherit;font-size:1em}.wp-block-post-comments input:not([type=submit]):not([type=checkbox]),.wp-block-post-comments textarea{padding:calc(.667em + 2px)}:where(.wp-block-post-comments input[type=submit]){border:none}.wp-block-comments{box-sizing:border-box} \ No newline at end of file diff --git a/wp-includes/blocks/cover.php b/wp-includes/blocks/cover.php index 1ffe7ab3f4..630835a479 100644 --- a/wp-includes/blocks/cover.php +++ b/wp-includes/blocks/cover.php @@ -35,12 +35,12 @@ function render_block_core_cover( $attributes, $content ) { $attr['style'] = 'object-position:' . $object_position . ';'; } - $image = get_the_post_thumbnail( null, 'post-thumbnail', $attr ); + $image = get_the_post_thumbnail( null, $attributes['sizeSlug'] ?? 'post-thumbnail', $attr ); } else { if ( in_the_loop() ) { update_post_thumbnail_cache(); } - $current_featured_image = get_the_post_thumbnail_url(); + $current_featured_image = get_the_post_thumbnail_url( null, $attributes['sizeSlug'] ?? null ); if ( ! $current_featured_image ) { return $content; } diff --git a/wp-includes/blocks/cover/block.json b/wp-includes/blocks/cover/block.json index 0ce80ca8d4..733dfc12fc 100644 --- a/wp-includes/blocks/cover/block.json +++ b/wp-includes/blocks/cover/block.json @@ -78,6 +78,9 @@ "tagName": { "type": "string", "default": "div" + }, + "sizeSlug": { + "type": "string" } }, "usesContext": [ "postId", "postType" ], diff --git a/wp-includes/blocks/cover/editor-rtl.css b/wp-includes/blocks/cover/editor-rtl.css index fe2c6196a6..57d7398149 100644 --- a/wp-includes/blocks/cover/editor-rtl.css +++ b/wp-includes/blocks/cover/editor-rtl.css @@ -26,13 +26,15 @@ width:100%; z-index:1; } +.wp-block-cover.is-transient .wp-block-cover__inner-container{ + z-index:2; +} .wp-block-cover .components-spinner{ margin:0; position:absolute; right:50%; top:50%; transform:translate(50%, -50%); - z-index:1; } .wp-block-cover .wp-block-cover__inner-container{ margin-left:0; @@ -73,10 +75,6 @@ pointer-events:none; } -.wp-block-cover>.components-drop-zone .components-drop-zone__content{ - opacity:.8 !important; -} - .block-editor-block-patterns-list__list-item .has-parallax.wp-block-cover{ background-attachment:scroll; } diff --git a/wp-includes/blocks/cover/editor-rtl.min.css b/wp-includes/blocks/cover/editor-rtl.min.css index 41a05595da..e2f1c71838 100644 --- a/wp-includes/blocks/cover/editor-rtl.min.css +++ b/wp-includes/blocks/cover/editor-rtl.min.css @@ -1 +1 @@ -.wp-block-cover.is-placeholder{align-items:stretch;display:flex;min-height:240px;padding:0!important}.wp-block-cover.is-placeholder .components-placeholder.is-large{justify-content:flex-start;z-index:1}.wp-block-cover.is-placeholder:focus:after{min-height:auto}.wp-block-cover.components-placeholder h2{color:inherit}.wp-block-cover.is-transient{position:relative}.wp-block-cover.is-transient:before{background-color:#fff;content:"";height:100%;opacity:.3;position:absolute;width:100%;z-index:1}.wp-block-cover .components-spinner{margin:0;position:absolute;right:50%;top:50%;transform:translate(50%,-50%);z-index:1}.wp-block-cover .wp-block-cover__inner-container{margin-left:0;margin-right:0;text-align:right}.wp-block-cover .wp-block-cover__placeholder-background-options{width:100%}.wp-block-cover .wp-block-cover__image--placeholder-image{bottom:0;left:0;position:absolute;right:0;top:0}[data-align=left]>.wp-block-cover,[data-align=right]>.wp-block-cover{max-width:420px;width:100%}.block-library-cover__reset-button{margin-right:auto}.block-library-cover__resize-container{bottom:0;left:0;min-height:50px;position:absolute!important;right:0;top:0}.components-popover.block-editor-block-popover.block-library-cover__resizable-box-popover .block-library-cover__resize-container,.components-popover.block-editor-block-popover.block-library-cover__resizable-box-popover .components-popover__content>div{overflow:visible;pointer-events:none}.wp-block-cover>.components-drop-zone .components-drop-zone__content{opacity:.8!important}.block-editor-block-patterns-list__list-item .has-parallax.wp-block-cover{background-attachment:scroll}.color-block-support-panel__inner-wrapper>:not(.block-editor-tools-panel-color-gradient-settings__item){margin-top:24px} \ No newline at end of file +.wp-block-cover.is-placeholder{align-items:stretch;display:flex;min-height:240px;padding:0!important}.wp-block-cover.is-placeholder .components-placeholder.is-large{justify-content:flex-start;z-index:1}.wp-block-cover.is-placeholder:focus:after{min-height:auto}.wp-block-cover.components-placeholder h2{color:inherit}.wp-block-cover.is-transient{position:relative}.wp-block-cover.is-transient:before{background-color:#fff;content:"";height:100%;opacity:.3;position:absolute;width:100%;z-index:1}.wp-block-cover.is-transient .wp-block-cover__inner-container{z-index:2}.wp-block-cover .components-spinner{margin:0;position:absolute;right:50%;top:50%;transform:translate(50%,-50%)}.wp-block-cover .wp-block-cover__inner-container{margin-left:0;margin-right:0;text-align:right}.wp-block-cover .wp-block-cover__placeholder-background-options{width:100%}.wp-block-cover .wp-block-cover__image--placeholder-image{bottom:0;left:0;position:absolute;right:0;top:0}[data-align=left]>.wp-block-cover,[data-align=right]>.wp-block-cover{max-width:420px;width:100%}.block-library-cover__reset-button{margin-right:auto}.block-library-cover__resize-container{bottom:0;left:0;min-height:50px;position:absolute!important;right:0;top:0}.components-popover.block-editor-block-popover.block-library-cover__resizable-box-popover .block-library-cover__resize-container,.components-popover.block-editor-block-popover.block-library-cover__resizable-box-popover .components-popover__content>div{overflow:visible;pointer-events:none}.block-editor-block-patterns-list__list-item .has-parallax.wp-block-cover{background-attachment:scroll}.color-block-support-panel__inner-wrapper>:not(.block-editor-tools-panel-color-gradient-settings__item){margin-top:24px} \ No newline at end of file diff --git a/wp-includes/blocks/cover/editor.css b/wp-includes/blocks/cover/editor.css index 7f0c05daf4..447086eb99 100644 --- a/wp-includes/blocks/cover/editor.css +++ b/wp-includes/blocks/cover/editor.css @@ -26,13 +26,15 @@ width:100%; z-index:1; } +.wp-block-cover.is-transient .wp-block-cover__inner-container{ + z-index:2; +} .wp-block-cover .components-spinner{ left:50%; margin:0; position:absolute; top:50%; transform:translate(-50%, -50%); - z-index:1; } .wp-block-cover .wp-block-cover__inner-container{ margin-left:0; @@ -73,10 +75,6 @@ pointer-events:none; } -.wp-block-cover>.components-drop-zone .components-drop-zone__content{ - opacity:.8 !important; -} - .block-editor-block-patterns-list__list-item .has-parallax.wp-block-cover{ background-attachment:scroll; } diff --git a/wp-includes/blocks/cover/editor.min.css b/wp-includes/blocks/cover/editor.min.css index fd09ba3d93..ea2b99eac6 100644 --- a/wp-includes/blocks/cover/editor.min.css +++ b/wp-includes/blocks/cover/editor.min.css @@ -1 +1 @@ -.wp-block-cover.is-placeholder{align-items:stretch;display:flex;min-height:240px;padding:0!important}.wp-block-cover.is-placeholder .components-placeholder.is-large{justify-content:flex-start;z-index:1}.wp-block-cover.is-placeholder:focus:after{min-height:auto}.wp-block-cover.components-placeholder h2{color:inherit}.wp-block-cover.is-transient{position:relative}.wp-block-cover.is-transient:before{background-color:#fff;content:"";height:100%;opacity:.3;position:absolute;width:100%;z-index:1}.wp-block-cover .components-spinner{left:50%;margin:0;position:absolute;top:50%;transform:translate(-50%,-50%);z-index:1}.wp-block-cover .wp-block-cover__inner-container{margin-left:0;margin-right:0;text-align:left}.wp-block-cover .wp-block-cover__placeholder-background-options{width:100%}.wp-block-cover .wp-block-cover__image--placeholder-image{bottom:0;left:0;position:absolute;right:0;top:0}[data-align=left]>.wp-block-cover,[data-align=right]>.wp-block-cover{max-width:420px;width:100%}.block-library-cover__reset-button{margin-left:auto}.block-library-cover__resize-container{bottom:0;left:0;min-height:50px;position:absolute!important;right:0;top:0}.components-popover.block-editor-block-popover.block-library-cover__resizable-box-popover .block-library-cover__resize-container,.components-popover.block-editor-block-popover.block-library-cover__resizable-box-popover .components-popover__content>div{overflow:visible;pointer-events:none}.wp-block-cover>.components-drop-zone .components-drop-zone__content{opacity:.8!important}.block-editor-block-patterns-list__list-item .has-parallax.wp-block-cover{background-attachment:scroll}.color-block-support-panel__inner-wrapper>:not(.block-editor-tools-panel-color-gradient-settings__item){margin-top:24px} \ No newline at end of file +.wp-block-cover.is-placeholder{align-items:stretch;display:flex;min-height:240px;padding:0!important}.wp-block-cover.is-placeholder .components-placeholder.is-large{justify-content:flex-start;z-index:1}.wp-block-cover.is-placeholder:focus:after{min-height:auto}.wp-block-cover.components-placeholder h2{color:inherit}.wp-block-cover.is-transient{position:relative}.wp-block-cover.is-transient:before{background-color:#fff;content:"";height:100%;opacity:.3;position:absolute;width:100%;z-index:1}.wp-block-cover.is-transient .wp-block-cover__inner-container{z-index:2}.wp-block-cover .components-spinner{left:50%;margin:0;position:absolute;top:50%;transform:translate(-50%,-50%)}.wp-block-cover .wp-block-cover__inner-container{margin-left:0;margin-right:0;text-align:left}.wp-block-cover .wp-block-cover__placeholder-background-options{width:100%}.wp-block-cover .wp-block-cover__image--placeholder-image{bottom:0;left:0;position:absolute;right:0;top:0}[data-align=left]>.wp-block-cover,[data-align=right]>.wp-block-cover{max-width:420px;width:100%}.block-library-cover__reset-button{margin-left:auto}.block-library-cover__resize-container{bottom:0;left:0;min-height:50px;position:absolute!important;right:0;top:0}.components-popover.block-editor-block-popover.block-library-cover__resizable-box-popover .block-library-cover__resize-container,.components-popover.block-editor-block-popover.block-library-cover__resizable-box-popover .components-popover__content>div{overflow:visible;pointer-events:none}.block-editor-block-patterns-list__list-item .has-parallax.wp-block-cover{background-attachment:scroll}.color-block-support-panel__inner-wrapper>:not(.block-editor-tools-panel-color-gradient-settings__item){margin-top:24px} \ No newline at end of file diff --git a/wp-includes/blocks/cover/style-rtl.css b/wp-includes/blocks/cover/style-rtl.css index 357cadfe9b..32b1ae73cf 100644 --- a/wp-includes/blocks/cover/style-rtl.css +++ b/wp-includes/blocks/cover/style-rtl.css @@ -27,7 +27,6 @@ position:absolute; right:0; top:0; - z-index:1; } .wp-block-cover-image.has-background-dim.has-background-dim-10 .wp-block-cover__background,.wp-block-cover-image.has-background-dim.has-background-dim-10 .wp-block-cover__gradient-background,.wp-block-cover-image.has-background-dim.has-background-dim-10:not(.has-background-gradient):before,.wp-block-cover.has-background-dim.has-background-dim-10 .wp-block-cover__background,.wp-block-cover.has-background-dim.has-background-dim-10 .wp-block-cover__gradient-background,.wp-block-cover.has-background-dim.has-background-dim-10:not(.has-background-gradient):before{ opacity:.1; @@ -101,13 +100,9 @@ } .wp-block-cover .wp-block-cover__inner-container,.wp-block-cover-image .wp-block-cover__inner-container{ color:inherit; direction:rtl; + position:relative; width:100%; - z-index:1; } -.has-modal-open .wp-block-cover .wp-block-cover__inner-container,.has-modal-open .wp-block-cover-image .wp-block-cover__inner-container{ - z-index:auto; -} - .wp-block-cover-image.is-position-top-left,.wp-block-cover.is-position-top-left{ align-items:flex-start; justify-content:flex-start; @@ -188,10 +183,6 @@ background-repeat:repeat; background-size:auto; } - -.wp-block-cover__image-background,.wp-block-cover__video-background{ - z-index:0; -} .wp-block-cover-image-text,.wp-block-cover-image-text a,.wp-block-cover-image-text a:active,.wp-block-cover-image-text a:focus,.wp-block-cover-image-text a:hover,.wp-block-cover-text,.wp-block-cover-text a,.wp-block-cover-text a:active,.wp-block-cover-text a:focus,.wp-block-cover-text a:hover,section.wp-block-cover-image h2,section.wp-block-cover-image h2 a,section.wp-block-cover-image h2 a:active,section.wp-block-cover-image h2 a:focus,section.wp-block-cover-image h2 a:hover{ color:#fff; } @@ -233,4 +224,13 @@ :root :where(.wp-block-cover h1:not(.has-text-color)),:root :where(.wp-block-cover h2:not(.has-text-color)),:root :where(.wp-block-cover h3:not(.has-text-color)),:root :where(.wp-block-cover h4:not(.has-text-color)),:root :where(.wp-block-cover h5:not(.has-text-color)),:root :where(.wp-block-cover h6:not(.has-text-color)),:root :where(.wp-block-cover p:not(.has-text-color)){ color:inherit; +} +body:not(.editor-styles-wrapper) .wp-block-cover:not(.wp-block-cover:has(.wp-block-cover__background+.wp-block-cover__inner-container)) .wp-block-cover__image-background,body:not(.editor-styles-wrapper) .wp-block-cover:not(.wp-block-cover:has(.wp-block-cover__background+.wp-block-cover__inner-container)) .wp-block-cover__video-background{ + z-index:0; +} +body:not(.editor-styles-wrapper) .wp-block-cover:not(.wp-block-cover:has(.wp-block-cover__background+.wp-block-cover__inner-container)) .wp-block-cover__background,body:not(.editor-styles-wrapper) .wp-block-cover:not(.wp-block-cover:has(.wp-block-cover__background+.wp-block-cover__inner-container)) .wp-block-cover__gradient-background,body:not(.editor-styles-wrapper) .wp-block-cover:not(.wp-block-cover:has(.wp-block-cover__background+.wp-block-cover__inner-container)) .wp-block-cover__inner-container,body:not(.editor-styles-wrapper) .wp-block-cover:not(.wp-block-cover:has(.wp-block-cover__background+.wp-block-cover__inner-container)).has-background-dim:not(.has-background-gradient):before{ + z-index:1; +} +.has-modal-open body:not(.editor-styles-wrapper) .wp-block-cover:not(.wp-block-cover:has(.wp-block-cover__background+.wp-block-cover__inner-container)) .wp-block-cover__inner-container{ + z-index:auto; } \ No newline at end of file diff --git a/wp-includes/blocks/cover/style-rtl.min.css b/wp-includes/blocks/cover/style-rtl.min.css index 6c32b44488..445c223d4e 100644 --- a/wp-includes/blocks/cover/style-rtl.min.css +++ b/wp-includes/blocks/cover/style-rtl.min.css @@ -1 +1 @@ -.wp-block-cover,.wp-block-cover-image{align-items:center;background-position:50%;box-sizing:border-box;direction:ltr;display:flex;justify-content:center;min-height:430px;overflow:hidden;overflow:clip;padding:1em;position:relative}.wp-block-cover .has-background-dim:not([class*=-background-color]),.wp-block-cover-image .has-background-dim:not([class*=-background-color]),.wp-block-cover-image.has-background-dim:not([class*=-background-color]),.wp-block-cover.has-background-dim:not([class*=-background-color]){background-color:#000}.wp-block-cover .has-background-dim.has-background-gradient,.wp-block-cover-image .has-background-dim.has-background-gradient{background-color:initial}.wp-block-cover-image.has-background-dim:before,.wp-block-cover.has-background-dim:before{background-color:inherit;content:""}.wp-block-cover .wp-block-cover__background,.wp-block-cover .wp-block-cover__gradient-background,.wp-block-cover-image .wp-block-cover__background,.wp-block-cover-image .wp-block-cover__gradient-background,.wp-block-cover-image.has-background-dim:not(.has-background-gradient):before,.wp-block-cover.has-background-dim:not(.has-background-gradient):before{bottom:0;left:0;opacity:.5;position:absolute;right:0;top:0;z-index:1}.wp-block-cover-image.has-background-dim.has-background-dim-10 .wp-block-cover__background,.wp-block-cover-image.has-background-dim.has-background-dim-10 .wp-block-cover__gradient-background,.wp-block-cover-image.has-background-dim.has-background-dim-10:not(.has-background-gradient):before,.wp-block-cover.has-background-dim.has-background-dim-10 .wp-block-cover__background,.wp-block-cover.has-background-dim.has-background-dim-10 .wp-block-cover__gradient-background,.wp-block-cover.has-background-dim.has-background-dim-10:not(.has-background-gradient):before{opacity:.1}.wp-block-cover-image.has-background-dim.has-background-dim-20 .wp-block-cover__background,.wp-block-cover-image.has-background-dim.has-background-dim-20 .wp-block-cover__gradient-background,.wp-block-cover-image.has-background-dim.has-background-dim-20:not(.has-background-gradient):before,.wp-block-cover.has-background-dim.has-background-dim-20 .wp-block-cover__background,.wp-block-cover.has-background-dim.has-background-dim-20 .wp-block-cover__gradient-background,.wp-block-cover.has-background-dim.has-background-dim-20:not(.has-background-gradient):before{opacity:.2}.wp-block-cover-image.has-background-dim.has-background-dim-30 .wp-block-cover__background,.wp-block-cover-image.has-background-dim.has-background-dim-30 .wp-block-cover__gradient-background,.wp-block-cover-image.has-background-dim.has-background-dim-30:not(.has-background-gradient):before,.wp-block-cover.has-background-dim.has-background-dim-30 .wp-block-cover__background,.wp-block-cover.has-background-dim.has-background-dim-30 .wp-block-cover__gradient-background,.wp-block-cover.has-background-dim.has-background-dim-30:not(.has-background-gradient):before{opacity:.3}.wp-block-cover-image.has-background-dim.has-background-dim-40 .wp-block-cover__background,.wp-block-cover-image.has-background-dim.has-background-dim-40 .wp-block-cover__gradient-background,.wp-block-cover-image.has-background-dim.has-background-dim-40:not(.has-background-gradient):before,.wp-block-cover.has-background-dim.has-background-dim-40 .wp-block-cover__background,.wp-block-cover.has-background-dim.has-background-dim-40 .wp-block-cover__gradient-background,.wp-block-cover.has-background-dim.has-background-dim-40:not(.has-background-gradient):before{opacity:.4}.wp-block-cover-image.has-background-dim.has-background-dim-50 .wp-block-cover__background,.wp-block-cover-image.has-background-dim.has-background-dim-50 .wp-block-cover__gradient-background,.wp-block-cover-image.has-background-dim.has-background-dim-50:not(.has-background-gradient):before,.wp-block-cover.has-background-dim.has-background-dim-50 .wp-block-cover__background,.wp-block-cover.has-background-dim.has-background-dim-50 .wp-block-cover__gradient-background,.wp-block-cover.has-background-dim.has-background-dim-50:not(.has-background-gradient):before{opacity:.5}.wp-block-cover-image.has-background-dim.has-background-dim-60 .wp-block-cover__background,.wp-block-cover-image.has-background-dim.has-background-dim-60 .wp-block-cover__gradient-background,.wp-block-cover-image.has-background-dim.has-background-dim-60:not(.has-background-gradient):before,.wp-block-cover.has-background-dim.has-background-dim-60 .wp-block-cover__background,.wp-block-cover.has-background-dim.has-background-dim-60 .wp-block-cover__gradient-background,.wp-block-cover.has-background-dim.has-background-dim-60:not(.has-background-gradient):before{opacity:.6}.wp-block-cover-image.has-background-dim.has-background-dim-70 .wp-block-cover__background,.wp-block-cover-image.has-background-dim.has-background-dim-70 .wp-block-cover__gradient-background,.wp-block-cover-image.has-background-dim.has-background-dim-70:not(.has-background-gradient):before,.wp-block-cover.has-background-dim.has-background-dim-70 .wp-block-cover__background,.wp-block-cover.has-background-dim.has-background-dim-70 .wp-block-cover__gradient-background,.wp-block-cover.has-background-dim.has-background-dim-70:not(.has-background-gradient):before{opacity:.7}.wp-block-cover-image.has-background-dim.has-background-dim-80 .wp-block-cover__background,.wp-block-cover-image.has-background-dim.has-background-dim-80 .wp-block-cover__gradient-background,.wp-block-cover-image.has-background-dim.has-background-dim-80:not(.has-background-gradient):before,.wp-block-cover.has-background-dim.has-background-dim-80 .wp-block-cover__background,.wp-block-cover.has-background-dim.has-background-dim-80 .wp-block-cover__gradient-background,.wp-block-cover.has-background-dim.has-background-dim-80:not(.has-background-gradient):before{opacity:.8}.wp-block-cover-image.has-background-dim.has-background-dim-90 .wp-block-cover__background,.wp-block-cover-image.has-background-dim.has-background-dim-90 .wp-block-cover__gradient-background,.wp-block-cover-image.has-background-dim.has-background-dim-90:not(.has-background-gradient):before,.wp-block-cover.has-background-dim.has-background-dim-90 .wp-block-cover__background,.wp-block-cover.has-background-dim.has-background-dim-90 .wp-block-cover__gradient-background,.wp-block-cover.has-background-dim.has-background-dim-90:not(.has-background-gradient):before{opacity:.9}.wp-block-cover-image.has-background-dim.has-background-dim-100 .wp-block-cover__background,.wp-block-cover-image.has-background-dim.has-background-dim-100 .wp-block-cover__gradient-background,.wp-block-cover-image.has-background-dim.has-background-dim-100:not(.has-background-gradient):before,.wp-block-cover.has-background-dim.has-background-dim-100 .wp-block-cover__background,.wp-block-cover.has-background-dim.has-background-dim-100 .wp-block-cover__gradient-background,.wp-block-cover.has-background-dim.has-background-dim-100:not(.has-background-gradient):before{opacity:1}.wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-0,.wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-0,.wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-0,.wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-0{opacity:0}.wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-10,.wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-10,.wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-10,.wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-10{opacity:.1}.wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-20,.wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-20,.wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-20,.wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-20{opacity:.2}.wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-30,.wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-30,.wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-30,.wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-30{opacity:.3}.wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-40,.wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-40,.wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-40,.wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-40{opacity:.4}.wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-50,.wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-50,.wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-50,.wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-50{opacity:.5}.wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-60,.wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-60,.wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-60,.wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-60{opacity:.6}.wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-70,.wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-70,.wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-70,.wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-70{opacity:.7}.wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-80,.wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-80,.wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-80,.wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-80{opacity:.8}.wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-90,.wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-90,.wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-90,.wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-90{opacity:.9}.wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-100,.wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-100,.wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-100,.wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-100{opacity:1}.wp-block-cover-image.alignleft,.wp-block-cover-image.alignright,.wp-block-cover.alignleft,.wp-block-cover.alignright{max-width:420px;width:100%}.wp-block-cover-image.aligncenter,.wp-block-cover-image.alignleft,.wp-block-cover-image.alignright,.wp-block-cover.aligncenter,.wp-block-cover.alignleft,.wp-block-cover.alignright{display:flex}.wp-block-cover .wp-block-cover__inner-container,.wp-block-cover-image .wp-block-cover__inner-container{color:inherit;direction:rtl;width:100%;z-index:1}.has-modal-open .wp-block-cover .wp-block-cover__inner-container,.has-modal-open .wp-block-cover-image .wp-block-cover__inner-container{z-index:auto}.wp-block-cover-image.is-position-top-left,.wp-block-cover.is-position-top-left{align-items:flex-start;justify-content:flex-start}.wp-block-cover-image.is-position-top-center,.wp-block-cover.is-position-top-center{align-items:flex-start;justify-content:center}.wp-block-cover-image.is-position-top-right,.wp-block-cover.is-position-top-right{align-items:flex-start;justify-content:flex-end}.wp-block-cover-image.is-position-center-left,.wp-block-cover.is-position-center-left{align-items:center;justify-content:flex-start}.wp-block-cover-image.is-position-center-center,.wp-block-cover.is-position-center-center{align-items:center;justify-content:center}.wp-block-cover-image.is-position-center-right,.wp-block-cover.is-position-center-right{align-items:center;justify-content:flex-end}.wp-block-cover-image.is-position-bottom-left,.wp-block-cover.is-position-bottom-left{align-items:flex-end;justify-content:flex-start}.wp-block-cover-image.is-position-bottom-center,.wp-block-cover.is-position-bottom-center{align-items:flex-end;justify-content:center}.wp-block-cover-image.is-position-bottom-right,.wp-block-cover.is-position-bottom-right{align-items:flex-end;justify-content:flex-end}.wp-block-cover-image.has-custom-content-position.has-custom-content-position .wp-block-cover__inner-container,.wp-block-cover.has-custom-content-position.has-custom-content-position .wp-block-cover__inner-container{margin:0}.wp-block-cover-image.has-custom-content-position.has-custom-content-position.is-position-bottom-left .wp-block-cover__inner-container,.wp-block-cover-image.has-custom-content-position.has-custom-content-position.is-position-bottom-right .wp-block-cover__inner-container,.wp-block-cover-image.has-custom-content-position.has-custom-content-position.is-position-center-left .wp-block-cover__inner-container,.wp-block-cover-image.has-custom-content-position.has-custom-content-position.is-position-center-right .wp-block-cover__inner-container,.wp-block-cover-image.has-custom-content-position.has-custom-content-position.is-position-top-left .wp-block-cover__inner-container,.wp-block-cover-image.has-custom-content-position.has-custom-content-position.is-position-top-right .wp-block-cover__inner-container,.wp-block-cover.has-custom-content-position.has-custom-content-position.is-position-bottom-left .wp-block-cover__inner-container,.wp-block-cover.has-custom-content-position.has-custom-content-position.is-position-bottom-right .wp-block-cover__inner-container,.wp-block-cover.has-custom-content-position.has-custom-content-position.is-position-center-left .wp-block-cover__inner-container,.wp-block-cover.has-custom-content-position.has-custom-content-position.is-position-center-right .wp-block-cover__inner-container,.wp-block-cover.has-custom-content-position.has-custom-content-position.is-position-top-left .wp-block-cover__inner-container,.wp-block-cover.has-custom-content-position.has-custom-content-position.is-position-top-right .wp-block-cover__inner-container{margin:0;width:auto}.wp-block-cover .wp-block-cover__image-background,.wp-block-cover video.wp-block-cover__video-background,.wp-block-cover-image .wp-block-cover__image-background,.wp-block-cover-image video.wp-block-cover__video-background{border:none;bottom:0;box-shadow:none;height:100%;left:0;margin:0;max-height:none;max-width:none;object-fit:cover;outline:none;padding:0;position:absolute;right:0;top:0;width:100%}.wp-block-cover-image.has-parallax,.wp-block-cover.has-parallax,.wp-block-cover__image-background.has-parallax,video.wp-block-cover__video-background.has-parallax{background-attachment:fixed;background-repeat:no-repeat;background-size:cover}@supports (-webkit-touch-callout:inherit){.wp-block-cover-image.has-parallax,.wp-block-cover.has-parallax,.wp-block-cover__image-background.has-parallax,video.wp-block-cover__video-background.has-parallax{background-attachment:scroll}}@media (prefers-reduced-motion:reduce){.wp-block-cover-image.has-parallax,.wp-block-cover.has-parallax,.wp-block-cover__image-background.has-parallax,video.wp-block-cover__video-background.has-parallax{background-attachment:scroll}}.wp-block-cover-image.is-repeated,.wp-block-cover.is-repeated,.wp-block-cover__image-background.is-repeated,video.wp-block-cover__video-background.is-repeated{background-repeat:repeat;background-size:auto}.wp-block-cover__image-background,.wp-block-cover__video-background{z-index:0}.wp-block-cover-image-text,.wp-block-cover-image-text a,.wp-block-cover-image-text a:active,.wp-block-cover-image-text a:focus,.wp-block-cover-image-text a:hover,.wp-block-cover-text,.wp-block-cover-text a,.wp-block-cover-text a:active,.wp-block-cover-text a:focus,.wp-block-cover-text a:hover,section.wp-block-cover-image h2,section.wp-block-cover-image h2 a,section.wp-block-cover-image h2 a:active,section.wp-block-cover-image h2 a:focus,section.wp-block-cover-image h2 a:hover{color:#fff}.wp-block-cover-image .wp-block-cover.has-left-content{justify-content:flex-start}.wp-block-cover-image .wp-block-cover.has-right-content{justify-content:flex-end}.wp-block-cover-image.has-left-content .wp-block-cover-image-text,.wp-block-cover.has-left-content .wp-block-cover-text,section.wp-block-cover-image.has-left-content>h2{margin-right:0;text-align:right}.wp-block-cover-image.has-right-content .wp-block-cover-image-text,.wp-block-cover.has-right-content .wp-block-cover-text,section.wp-block-cover-image.has-right-content>h2{margin-left:0;text-align:left}.wp-block-cover .wp-block-cover-text,.wp-block-cover-image .wp-block-cover-image-text,section.wp-block-cover-image>h2{font-size:2em;line-height:1.25;margin-bottom:0;max-width:840px;padding:.44em;text-align:center;z-index:1}:where(.wp-block-cover-image:not(.has-text-color)),:where(.wp-block-cover:not(.has-text-color)){color:#fff}:where(.wp-block-cover-image.is-light:not(.has-text-color)),:where(.wp-block-cover.is-light:not(.has-text-color)){color:#000}:root :where(.wp-block-cover h1:not(.has-text-color)),:root :where(.wp-block-cover h2:not(.has-text-color)),:root :where(.wp-block-cover h3:not(.has-text-color)),:root :where(.wp-block-cover h4:not(.has-text-color)),:root :where(.wp-block-cover h5:not(.has-text-color)),:root :where(.wp-block-cover h6:not(.has-text-color)),:root :where(.wp-block-cover p:not(.has-text-color)){color:inherit} \ No newline at end of file +.wp-block-cover,.wp-block-cover-image{align-items:center;background-position:50%;box-sizing:border-box;direction:ltr;display:flex;justify-content:center;min-height:430px;overflow:hidden;overflow:clip;padding:1em;position:relative}.wp-block-cover .has-background-dim:not([class*=-background-color]),.wp-block-cover-image .has-background-dim:not([class*=-background-color]),.wp-block-cover-image.has-background-dim:not([class*=-background-color]),.wp-block-cover.has-background-dim:not([class*=-background-color]){background-color:#000}.wp-block-cover .has-background-dim.has-background-gradient,.wp-block-cover-image .has-background-dim.has-background-gradient{background-color:initial}.wp-block-cover-image.has-background-dim:before,.wp-block-cover.has-background-dim:before{background-color:inherit;content:""}.wp-block-cover .wp-block-cover__background,.wp-block-cover .wp-block-cover__gradient-background,.wp-block-cover-image .wp-block-cover__background,.wp-block-cover-image .wp-block-cover__gradient-background,.wp-block-cover-image.has-background-dim:not(.has-background-gradient):before,.wp-block-cover.has-background-dim:not(.has-background-gradient):before{bottom:0;left:0;opacity:.5;position:absolute;right:0;top:0}.wp-block-cover-image.has-background-dim.has-background-dim-10 .wp-block-cover__background,.wp-block-cover-image.has-background-dim.has-background-dim-10 .wp-block-cover__gradient-background,.wp-block-cover-image.has-background-dim.has-background-dim-10:not(.has-background-gradient):before,.wp-block-cover.has-background-dim.has-background-dim-10 .wp-block-cover__background,.wp-block-cover.has-background-dim.has-background-dim-10 .wp-block-cover__gradient-background,.wp-block-cover.has-background-dim.has-background-dim-10:not(.has-background-gradient):before{opacity:.1}.wp-block-cover-image.has-background-dim.has-background-dim-20 .wp-block-cover__background,.wp-block-cover-image.has-background-dim.has-background-dim-20 .wp-block-cover__gradient-background,.wp-block-cover-image.has-background-dim.has-background-dim-20:not(.has-background-gradient):before,.wp-block-cover.has-background-dim.has-background-dim-20 .wp-block-cover__background,.wp-block-cover.has-background-dim.has-background-dim-20 .wp-block-cover__gradient-background,.wp-block-cover.has-background-dim.has-background-dim-20:not(.has-background-gradient):before{opacity:.2}.wp-block-cover-image.has-background-dim.has-background-dim-30 .wp-block-cover__background,.wp-block-cover-image.has-background-dim.has-background-dim-30 .wp-block-cover__gradient-background,.wp-block-cover-image.has-background-dim.has-background-dim-30:not(.has-background-gradient):before,.wp-block-cover.has-background-dim.has-background-dim-30 .wp-block-cover__background,.wp-block-cover.has-background-dim.has-background-dim-30 .wp-block-cover__gradient-background,.wp-block-cover.has-background-dim.has-background-dim-30:not(.has-background-gradient):before{opacity:.3}.wp-block-cover-image.has-background-dim.has-background-dim-40 .wp-block-cover__background,.wp-block-cover-image.has-background-dim.has-background-dim-40 .wp-block-cover__gradient-background,.wp-block-cover-image.has-background-dim.has-background-dim-40:not(.has-background-gradient):before,.wp-block-cover.has-background-dim.has-background-dim-40 .wp-block-cover__background,.wp-block-cover.has-background-dim.has-background-dim-40 .wp-block-cover__gradient-background,.wp-block-cover.has-background-dim.has-background-dim-40:not(.has-background-gradient):before{opacity:.4}.wp-block-cover-image.has-background-dim.has-background-dim-50 .wp-block-cover__background,.wp-block-cover-image.has-background-dim.has-background-dim-50 .wp-block-cover__gradient-background,.wp-block-cover-image.has-background-dim.has-background-dim-50:not(.has-background-gradient):before,.wp-block-cover.has-background-dim.has-background-dim-50 .wp-block-cover__background,.wp-block-cover.has-background-dim.has-background-dim-50 .wp-block-cover__gradient-background,.wp-block-cover.has-background-dim.has-background-dim-50:not(.has-background-gradient):before{opacity:.5}.wp-block-cover-image.has-background-dim.has-background-dim-60 .wp-block-cover__background,.wp-block-cover-image.has-background-dim.has-background-dim-60 .wp-block-cover__gradient-background,.wp-block-cover-image.has-background-dim.has-background-dim-60:not(.has-background-gradient):before,.wp-block-cover.has-background-dim.has-background-dim-60 .wp-block-cover__background,.wp-block-cover.has-background-dim.has-background-dim-60 .wp-block-cover__gradient-background,.wp-block-cover.has-background-dim.has-background-dim-60:not(.has-background-gradient):before{opacity:.6}.wp-block-cover-image.has-background-dim.has-background-dim-70 .wp-block-cover__background,.wp-block-cover-image.has-background-dim.has-background-dim-70 .wp-block-cover__gradient-background,.wp-block-cover-image.has-background-dim.has-background-dim-70:not(.has-background-gradient):before,.wp-block-cover.has-background-dim.has-background-dim-70 .wp-block-cover__background,.wp-block-cover.has-background-dim.has-background-dim-70 .wp-block-cover__gradient-background,.wp-block-cover.has-background-dim.has-background-dim-70:not(.has-background-gradient):before{opacity:.7}.wp-block-cover-image.has-background-dim.has-background-dim-80 .wp-block-cover__background,.wp-block-cover-image.has-background-dim.has-background-dim-80 .wp-block-cover__gradient-background,.wp-block-cover-image.has-background-dim.has-background-dim-80:not(.has-background-gradient):before,.wp-block-cover.has-background-dim.has-background-dim-80 .wp-block-cover__background,.wp-block-cover.has-background-dim.has-background-dim-80 .wp-block-cover__gradient-background,.wp-block-cover.has-background-dim.has-background-dim-80:not(.has-background-gradient):before{opacity:.8}.wp-block-cover-image.has-background-dim.has-background-dim-90 .wp-block-cover__background,.wp-block-cover-image.has-background-dim.has-background-dim-90 .wp-block-cover__gradient-background,.wp-block-cover-image.has-background-dim.has-background-dim-90:not(.has-background-gradient):before,.wp-block-cover.has-background-dim.has-background-dim-90 .wp-block-cover__background,.wp-block-cover.has-background-dim.has-background-dim-90 .wp-block-cover__gradient-background,.wp-block-cover.has-background-dim.has-background-dim-90:not(.has-background-gradient):before{opacity:.9}.wp-block-cover-image.has-background-dim.has-background-dim-100 .wp-block-cover__background,.wp-block-cover-image.has-background-dim.has-background-dim-100 .wp-block-cover__gradient-background,.wp-block-cover-image.has-background-dim.has-background-dim-100:not(.has-background-gradient):before,.wp-block-cover.has-background-dim.has-background-dim-100 .wp-block-cover__background,.wp-block-cover.has-background-dim.has-background-dim-100 .wp-block-cover__gradient-background,.wp-block-cover.has-background-dim.has-background-dim-100:not(.has-background-gradient):before{opacity:1}.wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-0,.wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-0,.wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-0,.wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-0{opacity:0}.wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-10,.wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-10,.wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-10,.wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-10{opacity:.1}.wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-20,.wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-20,.wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-20,.wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-20{opacity:.2}.wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-30,.wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-30,.wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-30,.wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-30{opacity:.3}.wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-40,.wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-40,.wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-40,.wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-40{opacity:.4}.wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-50,.wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-50,.wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-50,.wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-50{opacity:.5}.wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-60,.wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-60,.wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-60,.wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-60{opacity:.6}.wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-70,.wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-70,.wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-70,.wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-70{opacity:.7}.wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-80,.wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-80,.wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-80,.wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-80{opacity:.8}.wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-90,.wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-90,.wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-90,.wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-90{opacity:.9}.wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-100,.wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-100,.wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-100,.wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-100{opacity:1}.wp-block-cover-image.alignleft,.wp-block-cover-image.alignright,.wp-block-cover.alignleft,.wp-block-cover.alignright{max-width:420px;width:100%}.wp-block-cover-image.aligncenter,.wp-block-cover-image.alignleft,.wp-block-cover-image.alignright,.wp-block-cover.aligncenter,.wp-block-cover.alignleft,.wp-block-cover.alignright{display:flex}.wp-block-cover .wp-block-cover__inner-container,.wp-block-cover-image .wp-block-cover__inner-container{color:inherit;direction:rtl;position:relative;width:100%}.wp-block-cover-image.is-position-top-left,.wp-block-cover.is-position-top-left{align-items:flex-start;justify-content:flex-start}.wp-block-cover-image.is-position-top-center,.wp-block-cover.is-position-top-center{align-items:flex-start;justify-content:center}.wp-block-cover-image.is-position-top-right,.wp-block-cover.is-position-top-right{align-items:flex-start;justify-content:flex-end}.wp-block-cover-image.is-position-center-left,.wp-block-cover.is-position-center-left{align-items:center;justify-content:flex-start}.wp-block-cover-image.is-position-center-center,.wp-block-cover.is-position-center-center{align-items:center;justify-content:center}.wp-block-cover-image.is-position-center-right,.wp-block-cover.is-position-center-right{align-items:center;justify-content:flex-end}.wp-block-cover-image.is-position-bottom-left,.wp-block-cover.is-position-bottom-left{align-items:flex-end;justify-content:flex-start}.wp-block-cover-image.is-position-bottom-center,.wp-block-cover.is-position-bottom-center{align-items:flex-end;justify-content:center}.wp-block-cover-image.is-position-bottom-right,.wp-block-cover.is-position-bottom-right{align-items:flex-end;justify-content:flex-end}.wp-block-cover-image.has-custom-content-position.has-custom-content-position .wp-block-cover__inner-container,.wp-block-cover.has-custom-content-position.has-custom-content-position .wp-block-cover__inner-container{margin:0}.wp-block-cover-image.has-custom-content-position.has-custom-content-position.is-position-bottom-left .wp-block-cover__inner-container,.wp-block-cover-image.has-custom-content-position.has-custom-content-position.is-position-bottom-right .wp-block-cover__inner-container,.wp-block-cover-image.has-custom-content-position.has-custom-content-position.is-position-center-left .wp-block-cover__inner-container,.wp-block-cover-image.has-custom-content-position.has-custom-content-position.is-position-center-right .wp-block-cover__inner-container,.wp-block-cover-image.has-custom-content-position.has-custom-content-position.is-position-top-left .wp-block-cover__inner-container,.wp-block-cover-image.has-custom-content-position.has-custom-content-position.is-position-top-right .wp-block-cover__inner-container,.wp-block-cover.has-custom-content-position.has-custom-content-position.is-position-bottom-left .wp-block-cover__inner-container,.wp-block-cover.has-custom-content-position.has-custom-content-position.is-position-bottom-right .wp-block-cover__inner-container,.wp-block-cover.has-custom-content-position.has-custom-content-position.is-position-center-left .wp-block-cover__inner-container,.wp-block-cover.has-custom-content-position.has-custom-content-position.is-position-center-right .wp-block-cover__inner-container,.wp-block-cover.has-custom-content-position.has-custom-content-position.is-position-top-left .wp-block-cover__inner-container,.wp-block-cover.has-custom-content-position.has-custom-content-position.is-position-top-right .wp-block-cover__inner-container{margin:0;width:auto}.wp-block-cover .wp-block-cover__image-background,.wp-block-cover video.wp-block-cover__video-background,.wp-block-cover-image .wp-block-cover__image-background,.wp-block-cover-image video.wp-block-cover__video-background{border:none;bottom:0;box-shadow:none;height:100%;left:0;margin:0;max-height:none;max-width:none;object-fit:cover;outline:none;padding:0;position:absolute;right:0;top:0;width:100%}.wp-block-cover-image.has-parallax,.wp-block-cover.has-parallax,.wp-block-cover__image-background.has-parallax,video.wp-block-cover__video-background.has-parallax{background-attachment:fixed;background-repeat:no-repeat;background-size:cover}@supports (-webkit-touch-callout:inherit){.wp-block-cover-image.has-parallax,.wp-block-cover.has-parallax,.wp-block-cover__image-background.has-parallax,video.wp-block-cover__video-background.has-parallax{background-attachment:scroll}}@media (prefers-reduced-motion:reduce){.wp-block-cover-image.has-parallax,.wp-block-cover.has-parallax,.wp-block-cover__image-background.has-parallax,video.wp-block-cover__video-background.has-parallax{background-attachment:scroll}}.wp-block-cover-image.is-repeated,.wp-block-cover.is-repeated,.wp-block-cover__image-background.is-repeated,video.wp-block-cover__video-background.is-repeated{background-repeat:repeat;background-size:auto}.wp-block-cover-image-text,.wp-block-cover-image-text a,.wp-block-cover-image-text a:active,.wp-block-cover-image-text a:focus,.wp-block-cover-image-text a:hover,.wp-block-cover-text,.wp-block-cover-text a,.wp-block-cover-text a:active,.wp-block-cover-text a:focus,.wp-block-cover-text a:hover,section.wp-block-cover-image h2,section.wp-block-cover-image h2 a,section.wp-block-cover-image h2 a:active,section.wp-block-cover-image h2 a:focus,section.wp-block-cover-image h2 a:hover{color:#fff}.wp-block-cover-image .wp-block-cover.has-left-content{justify-content:flex-start}.wp-block-cover-image .wp-block-cover.has-right-content{justify-content:flex-end}.wp-block-cover-image.has-left-content .wp-block-cover-image-text,.wp-block-cover.has-left-content .wp-block-cover-text,section.wp-block-cover-image.has-left-content>h2{margin-right:0;text-align:right}.wp-block-cover-image.has-right-content .wp-block-cover-image-text,.wp-block-cover.has-right-content .wp-block-cover-text,section.wp-block-cover-image.has-right-content>h2{margin-left:0;text-align:left}.wp-block-cover .wp-block-cover-text,.wp-block-cover-image .wp-block-cover-image-text,section.wp-block-cover-image>h2{font-size:2em;line-height:1.25;margin-bottom:0;max-width:840px;padding:.44em;text-align:center;z-index:1}:where(.wp-block-cover-image:not(.has-text-color)),:where(.wp-block-cover:not(.has-text-color)){color:#fff}:where(.wp-block-cover-image.is-light:not(.has-text-color)),:where(.wp-block-cover.is-light:not(.has-text-color)){color:#000}:root :where(.wp-block-cover h1:not(.has-text-color)),:root :where(.wp-block-cover h2:not(.has-text-color)),:root :where(.wp-block-cover h3:not(.has-text-color)),:root :where(.wp-block-cover h4:not(.has-text-color)),:root :where(.wp-block-cover h5:not(.has-text-color)),:root :where(.wp-block-cover h6:not(.has-text-color)),:root :where(.wp-block-cover p:not(.has-text-color)){color:inherit}body:not(.editor-styles-wrapper) .wp-block-cover:not(.wp-block-cover:has(.wp-block-cover__background+.wp-block-cover__inner-container)) .wp-block-cover__image-background,body:not(.editor-styles-wrapper) .wp-block-cover:not(.wp-block-cover:has(.wp-block-cover__background+.wp-block-cover__inner-container)) .wp-block-cover__video-background{z-index:0}body:not(.editor-styles-wrapper) .wp-block-cover:not(.wp-block-cover:has(.wp-block-cover__background+.wp-block-cover__inner-container)) .wp-block-cover__background,body:not(.editor-styles-wrapper) .wp-block-cover:not(.wp-block-cover:has(.wp-block-cover__background+.wp-block-cover__inner-container)) .wp-block-cover__gradient-background,body:not(.editor-styles-wrapper) .wp-block-cover:not(.wp-block-cover:has(.wp-block-cover__background+.wp-block-cover__inner-container)) .wp-block-cover__inner-container,body:not(.editor-styles-wrapper) .wp-block-cover:not(.wp-block-cover:has(.wp-block-cover__background+.wp-block-cover__inner-container)).has-background-dim:not(.has-background-gradient):before{z-index:1}.has-modal-open body:not(.editor-styles-wrapper) .wp-block-cover:not(.wp-block-cover:has(.wp-block-cover__background+.wp-block-cover__inner-container)) .wp-block-cover__inner-container{z-index:auto} \ No newline at end of file diff --git a/wp-includes/blocks/cover/style.css b/wp-includes/blocks/cover/style.css index 4d784b2e7a..77aef0daab 100644 --- a/wp-includes/blocks/cover/style.css +++ b/wp-includes/blocks/cover/style.css @@ -27,7 +27,6 @@ position:absolute; right:0; top:0; - z-index:1; } .wp-block-cover-image.has-background-dim.has-background-dim-10 .wp-block-cover__background,.wp-block-cover-image.has-background-dim.has-background-dim-10 .wp-block-cover__gradient-background,.wp-block-cover-image.has-background-dim.has-background-dim-10:not(.has-background-gradient):before,.wp-block-cover.has-background-dim.has-background-dim-10 .wp-block-cover__background,.wp-block-cover.has-background-dim.has-background-dim-10 .wp-block-cover__gradient-background,.wp-block-cover.has-background-dim.has-background-dim-10:not(.has-background-gradient):before{ opacity:.1; @@ -101,13 +100,9 @@ } .wp-block-cover .wp-block-cover__inner-container,.wp-block-cover-image .wp-block-cover__inner-container{ color:inherit; + position:relative; width:100%; - z-index:1; } -.has-modal-open .wp-block-cover .wp-block-cover__inner-container,.has-modal-open .wp-block-cover-image .wp-block-cover__inner-container{ - z-index:auto; -} - .wp-block-cover-image.is-position-top-left,.wp-block-cover.is-position-top-left{ align-items:flex-start; justify-content:flex-start; @@ -188,10 +183,6 @@ background-repeat:repeat; background-size:auto; } - -.wp-block-cover__image-background,.wp-block-cover__video-background{ - z-index:0; -} .wp-block-cover-image-text,.wp-block-cover-image-text a,.wp-block-cover-image-text a:active,.wp-block-cover-image-text a:focus,.wp-block-cover-image-text a:hover,.wp-block-cover-text,.wp-block-cover-text a,.wp-block-cover-text a:active,.wp-block-cover-text a:focus,.wp-block-cover-text a:hover,section.wp-block-cover-image h2,section.wp-block-cover-image h2 a,section.wp-block-cover-image h2 a:active,section.wp-block-cover-image h2 a:focus,section.wp-block-cover-image h2 a:hover{ color:#fff; } @@ -233,4 +224,13 @@ :root :where(.wp-block-cover h1:not(.has-text-color)),:root :where(.wp-block-cover h2:not(.has-text-color)),:root :where(.wp-block-cover h3:not(.has-text-color)),:root :where(.wp-block-cover h4:not(.has-text-color)),:root :where(.wp-block-cover h5:not(.has-text-color)),:root :where(.wp-block-cover h6:not(.has-text-color)),:root :where(.wp-block-cover p:not(.has-text-color)){ color:inherit; +} +body:not(.editor-styles-wrapper) .wp-block-cover:not(.wp-block-cover:has(.wp-block-cover__background+.wp-block-cover__inner-container)) .wp-block-cover__image-background,body:not(.editor-styles-wrapper) .wp-block-cover:not(.wp-block-cover:has(.wp-block-cover__background+.wp-block-cover__inner-container)) .wp-block-cover__video-background{ + z-index:0; +} +body:not(.editor-styles-wrapper) .wp-block-cover:not(.wp-block-cover:has(.wp-block-cover__background+.wp-block-cover__inner-container)) .wp-block-cover__background,body:not(.editor-styles-wrapper) .wp-block-cover:not(.wp-block-cover:has(.wp-block-cover__background+.wp-block-cover__inner-container)) .wp-block-cover__gradient-background,body:not(.editor-styles-wrapper) .wp-block-cover:not(.wp-block-cover:has(.wp-block-cover__background+.wp-block-cover__inner-container)) .wp-block-cover__inner-container,body:not(.editor-styles-wrapper) .wp-block-cover:not(.wp-block-cover:has(.wp-block-cover__background+.wp-block-cover__inner-container)).has-background-dim:not(.has-background-gradient):before{ + z-index:1; +} +.has-modal-open body:not(.editor-styles-wrapper) .wp-block-cover:not(.wp-block-cover:has(.wp-block-cover__background+.wp-block-cover__inner-container)) .wp-block-cover__inner-container{ + z-index:auto; } \ No newline at end of file diff --git a/wp-includes/blocks/cover/style.min.css b/wp-includes/blocks/cover/style.min.css index a76be821e8..1ee3f94228 100644 --- a/wp-includes/blocks/cover/style.min.css +++ b/wp-includes/blocks/cover/style.min.css @@ -1 +1 @@ -.wp-block-cover,.wp-block-cover-image{align-items:center;background-position:50%;box-sizing:border-box;display:flex;justify-content:center;min-height:430px;overflow:hidden;overflow:clip;padding:1em;position:relative}.wp-block-cover .has-background-dim:not([class*=-background-color]),.wp-block-cover-image .has-background-dim:not([class*=-background-color]),.wp-block-cover-image.has-background-dim:not([class*=-background-color]),.wp-block-cover.has-background-dim:not([class*=-background-color]){background-color:#000}.wp-block-cover .has-background-dim.has-background-gradient,.wp-block-cover-image .has-background-dim.has-background-gradient{background-color:initial}.wp-block-cover-image.has-background-dim:before,.wp-block-cover.has-background-dim:before{background-color:inherit;content:""}.wp-block-cover .wp-block-cover__background,.wp-block-cover .wp-block-cover__gradient-background,.wp-block-cover-image .wp-block-cover__background,.wp-block-cover-image .wp-block-cover__gradient-background,.wp-block-cover-image.has-background-dim:not(.has-background-gradient):before,.wp-block-cover.has-background-dim:not(.has-background-gradient):before{bottom:0;left:0;opacity:.5;position:absolute;right:0;top:0;z-index:1}.wp-block-cover-image.has-background-dim.has-background-dim-10 .wp-block-cover__background,.wp-block-cover-image.has-background-dim.has-background-dim-10 .wp-block-cover__gradient-background,.wp-block-cover-image.has-background-dim.has-background-dim-10:not(.has-background-gradient):before,.wp-block-cover.has-background-dim.has-background-dim-10 .wp-block-cover__background,.wp-block-cover.has-background-dim.has-background-dim-10 .wp-block-cover__gradient-background,.wp-block-cover.has-background-dim.has-background-dim-10:not(.has-background-gradient):before{opacity:.1}.wp-block-cover-image.has-background-dim.has-background-dim-20 .wp-block-cover__background,.wp-block-cover-image.has-background-dim.has-background-dim-20 .wp-block-cover__gradient-background,.wp-block-cover-image.has-background-dim.has-background-dim-20:not(.has-background-gradient):before,.wp-block-cover.has-background-dim.has-background-dim-20 .wp-block-cover__background,.wp-block-cover.has-background-dim.has-background-dim-20 .wp-block-cover__gradient-background,.wp-block-cover.has-background-dim.has-background-dim-20:not(.has-background-gradient):before{opacity:.2}.wp-block-cover-image.has-background-dim.has-background-dim-30 .wp-block-cover__background,.wp-block-cover-image.has-background-dim.has-background-dim-30 .wp-block-cover__gradient-background,.wp-block-cover-image.has-background-dim.has-background-dim-30:not(.has-background-gradient):before,.wp-block-cover.has-background-dim.has-background-dim-30 .wp-block-cover__background,.wp-block-cover.has-background-dim.has-background-dim-30 .wp-block-cover__gradient-background,.wp-block-cover.has-background-dim.has-background-dim-30:not(.has-background-gradient):before{opacity:.3}.wp-block-cover-image.has-background-dim.has-background-dim-40 .wp-block-cover__background,.wp-block-cover-image.has-background-dim.has-background-dim-40 .wp-block-cover__gradient-background,.wp-block-cover-image.has-background-dim.has-background-dim-40:not(.has-background-gradient):before,.wp-block-cover.has-background-dim.has-background-dim-40 .wp-block-cover__background,.wp-block-cover.has-background-dim.has-background-dim-40 .wp-block-cover__gradient-background,.wp-block-cover.has-background-dim.has-background-dim-40:not(.has-background-gradient):before{opacity:.4}.wp-block-cover-image.has-background-dim.has-background-dim-50 .wp-block-cover__background,.wp-block-cover-image.has-background-dim.has-background-dim-50 .wp-block-cover__gradient-background,.wp-block-cover-image.has-background-dim.has-background-dim-50:not(.has-background-gradient):before,.wp-block-cover.has-background-dim.has-background-dim-50 .wp-block-cover__background,.wp-block-cover.has-background-dim.has-background-dim-50 .wp-block-cover__gradient-background,.wp-block-cover.has-background-dim.has-background-dim-50:not(.has-background-gradient):before{opacity:.5}.wp-block-cover-image.has-background-dim.has-background-dim-60 .wp-block-cover__background,.wp-block-cover-image.has-background-dim.has-background-dim-60 .wp-block-cover__gradient-background,.wp-block-cover-image.has-background-dim.has-background-dim-60:not(.has-background-gradient):before,.wp-block-cover.has-background-dim.has-background-dim-60 .wp-block-cover__background,.wp-block-cover.has-background-dim.has-background-dim-60 .wp-block-cover__gradient-background,.wp-block-cover.has-background-dim.has-background-dim-60:not(.has-background-gradient):before{opacity:.6}.wp-block-cover-image.has-background-dim.has-background-dim-70 .wp-block-cover__background,.wp-block-cover-image.has-background-dim.has-background-dim-70 .wp-block-cover__gradient-background,.wp-block-cover-image.has-background-dim.has-background-dim-70:not(.has-background-gradient):before,.wp-block-cover.has-background-dim.has-background-dim-70 .wp-block-cover__background,.wp-block-cover.has-background-dim.has-background-dim-70 .wp-block-cover__gradient-background,.wp-block-cover.has-background-dim.has-background-dim-70:not(.has-background-gradient):before{opacity:.7}.wp-block-cover-image.has-background-dim.has-background-dim-80 .wp-block-cover__background,.wp-block-cover-image.has-background-dim.has-background-dim-80 .wp-block-cover__gradient-background,.wp-block-cover-image.has-background-dim.has-background-dim-80:not(.has-background-gradient):before,.wp-block-cover.has-background-dim.has-background-dim-80 .wp-block-cover__background,.wp-block-cover.has-background-dim.has-background-dim-80 .wp-block-cover__gradient-background,.wp-block-cover.has-background-dim.has-background-dim-80:not(.has-background-gradient):before{opacity:.8}.wp-block-cover-image.has-background-dim.has-background-dim-90 .wp-block-cover__background,.wp-block-cover-image.has-background-dim.has-background-dim-90 .wp-block-cover__gradient-background,.wp-block-cover-image.has-background-dim.has-background-dim-90:not(.has-background-gradient):before,.wp-block-cover.has-background-dim.has-background-dim-90 .wp-block-cover__background,.wp-block-cover.has-background-dim.has-background-dim-90 .wp-block-cover__gradient-background,.wp-block-cover.has-background-dim.has-background-dim-90:not(.has-background-gradient):before{opacity:.9}.wp-block-cover-image.has-background-dim.has-background-dim-100 .wp-block-cover__background,.wp-block-cover-image.has-background-dim.has-background-dim-100 .wp-block-cover__gradient-background,.wp-block-cover-image.has-background-dim.has-background-dim-100:not(.has-background-gradient):before,.wp-block-cover.has-background-dim.has-background-dim-100 .wp-block-cover__background,.wp-block-cover.has-background-dim.has-background-dim-100 .wp-block-cover__gradient-background,.wp-block-cover.has-background-dim.has-background-dim-100:not(.has-background-gradient):before{opacity:1}.wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-0,.wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-0,.wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-0,.wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-0{opacity:0}.wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-10,.wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-10,.wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-10,.wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-10{opacity:.1}.wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-20,.wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-20,.wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-20,.wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-20{opacity:.2}.wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-30,.wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-30,.wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-30,.wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-30{opacity:.3}.wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-40,.wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-40,.wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-40,.wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-40{opacity:.4}.wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-50,.wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-50,.wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-50,.wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-50{opacity:.5}.wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-60,.wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-60,.wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-60,.wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-60{opacity:.6}.wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-70,.wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-70,.wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-70,.wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-70{opacity:.7}.wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-80,.wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-80,.wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-80,.wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-80{opacity:.8}.wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-90,.wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-90,.wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-90,.wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-90{opacity:.9}.wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-100,.wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-100,.wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-100,.wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-100{opacity:1}.wp-block-cover-image.alignleft,.wp-block-cover-image.alignright,.wp-block-cover.alignleft,.wp-block-cover.alignright{max-width:420px;width:100%}.wp-block-cover-image.aligncenter,.wp-block-cover-image.alignleft,.wp-block-cover-image.alignright,.wp-block-cover.aligncenter,.wp-block-cover.alignleft,.wp-block-cover.alignright{display:flex}.wp-block-cover .wp-block-cover__inner-container,.wp-block-cover-image .wp-block-cover__inner-container{color:inherit;width:100%;z-index:1}.has-modal-open .wp-block-cover .wp-block-cover__inner-container,.has-modal-open .wp-block-cover-image .wp-block-cover__inner-container{z-index:auto}.wp-block-cover-image.is-position-top-left,.wp-block-cover.is-position-top-left{align-items:flex-start;justify-content:flex-start}.wp-block-cover-image.is-position-top-center,.wp-block-cover.is-position-top-center{align-items:flex-start;justify-content:center}.wp-block-cover-image.is-position-top-right,.wp-block-cover.is-position-top-right{align-items:flex-start;justify-content:flex-end}.wp-block-cover-image.is-position-center-left,.wp-block-cover.is-position-center-left{align-items:center;justify-content:flex-start}.wp-block-cover-image.is-position-center-center,.wp-block-cover.is-position-center-center{align-items:center;justify-content:center}.wp-block-cover-image.is-position-center-right,.wp-block-cover.is-position-center-right{align-items:center;justify-content:flex-end}.wp-block-cover-image.is-position-bottom-left,.wp-block-cover.is-position-bottom-left{align-items:flex-end;justify-content:flex-start}.wp-block-cover-image.is-position-bottom-center,.wp-block-cover.is-position-bottom-center{align-items:flex-end;justify-content:center}.wp-block-cover-image.is-position-bottom-right,.wp-block-cover.is-position-bottom-right{align-items:flex-end;justify-content:flex-end}.wp-block-cover-image.has-custom-content-position.has-custom-content-position .wp-block-cover__inner-container,.wp-block-cover.has-custom-content-position.has-custom-content-position .wp-block-cover__inner-container{margin:0}.wp-block-cover-image.has-custom-content-position.has-custom-content-position.is-position-bottom-left .wp-block-cover__inner-container,.wp-block-cover-image.has-custom-content-position.has-custom-content-position.is-position-bottom-right .wp-block-cover__inner-container,.wp-block-cover-image.has-custom-content-position.has-custom-content-position.is-position-center-left .wp-block-cover__inner-container,.wp-block-cover-image.has-custom-content-position.has-custom-content-position.is-position-center-right .wp-block-cover__inner-container,.wp-block-cover-image.has-custom-content-position.has-custom-content-position.is-position-top-left .wp-block-cover__inner-container,.wp-block-cover-image.has-custom-content-position.has-custom-content-position.is-position-top-right .wp-block-cover__inner-container,.wp-block-cover.has-custom-content-position.has-custom-content-position.is-position-bottom-left .wp-block-cover__inner-container,.wp-block-cover.has-custom-content-position.has-custom-content-position.is-position-bottom-right .wp-block-cover__inner-container,.wp-block-cover.has-custom-content-position.has-custom-content-position.is-position-center-left .wp-block-cover__inner-container,.wp-block-cover.has-custom-content-position.has-custom-content-position.is-position-center-right .wp-block-cover__inner-container,.wp-block-cover.has-custom-content-position.has-custom-content-position.is-position-top-left .wp-block-cover__inner-container,.wp-block-cover.has-custom-content-position.has-custom-content-position.is-position-top-right .wp-block-cover__inner-container{margin:0;width:auto}.wp-block-cover .wp-block-cover__image-background,.wp-block-cover video.wp-block-cover__video-background,.wp-block-cover-image .wp-block-cover__image-background,.wp-block-cover-image video.wp-block-cover__video-background{border:none;bottom:0;box-shadow:none;height:100%;left:0;margin:0;max-height:none;max-width:none;object-fit:cover;outline:none;padding:0;position:absolute;right:0;top:0;width:100%}.wp-block-cover-image.has-parallax,.wp-block-cover.has-parallax,.wp-block-cover__image-background.has-parallax,video.wp-block-cover__video-background.has-parallax{background-attachment:fixed;background-repeat:no-repeat;background-size:cover}@supports (-webkit-touch-callout:inherit){.wp-block-cover-image.has-parallax,.wp-block-cover.has-parallax,.wp-block-cover__image-background.has-parallax,video.wp-block-cover__video-background.has-parallax{background-attachment:scroll}}@media (prefers-reduced-motion:reduce){.wp-block-cover-image.has-parallax,.wp-block-cover.has-parallax,.wp-block-cover__image-background.has-parallax,video.wp-block-cover__video-background.has-parallax{background-attachment:scroll}}.wp-block-cover-image.is-repeated,.wp-block-cover.is-repeated,.wp-block-cover__image-background.is-repeated,video.wp-block-cover__video-background.is-repeated{background-repeat:repeat;background-size:auto}.wp-block-cover__image-background,.wp-block-cover__video-background{z-index:0}.wp-block-cover-image-text,.wp-block-cover-image-text a,.wp-block-cover-image-text a:active,.wp-block-cover-image-text a:focus,.wp-block-cover-image-text a:hover,.wp-block-cover-text,.wp-block-cover-text a,.wp-block-cover-text a:active,.wp-block-cover-text a:focus,.wp-block-cover-text a:hover,section.wp-block-cover-image h2,section.wp-block-cover-image h2 a,section.wp-block-cover-image h2 a:active,section.wp-block-cover-image h2 a:focus,section.wp-block-cover-image h2 a:hover{color:#fff}.wp-block-cover-image .wp-block-cover.has-left-content{justify-content:flex-start}.wp-block-cover-image .wp-block-cover.has-right-content{justify-content:flex-end}.wp-block-cover-image.has-left-content .wp-block-cover-image-text,.wp-block-cover.has-left-content .wp-block-cover-text,section.wp-block-cover-image.has-left-content>h2{margin-left:0;text-align:left}.wp-block-cover-image.has-right-content .wp-block-cover-image-text,.wp-block-cover.has-right-content .wp-block-cover-text,section.wp-block-cover-image.has-right-content>h2{margin-right:0;text-align:right}.wp-block-cover .wp-block-cover-text,.wp-block-cover-image .wp-block-cover-image-text,section.wp-block-cover-image>h2{font-size:2em;line-height:1.25;margin-bottom:0;max-width:840px;padding:.44em;text-align:center;z-index:1}:where(.wp-block-cover-image:not(.has-text-color)),:where(.wp-block-cover:not(.has-text-color)){color:#fff}:where(.wp-block-cover-image.is-light:not(.has-text-color)),:where(.wp-block-cover.is-light:not(.has-text-color)){color:#000}:root :where(.wp-block-cover h1:not(.has-text-color)),:root :where(.wp-block-cover h2:not(.has-text-color)),:root :where(.wp-block-cover h3:not(.has-text-color)),:root :where(.wp-block-cover h4:not(.has-text-color)),:root :where(.wp-block-cover h5:not(.has-text-color)),:root :where(.wp-block-cover h6:not(.has-text-color)),:root :where(.wp-block-cover p:not(.has-text-color)){color:inherit} \ No newline at end of file +.wp-block-cover,.wp-block-cover-image{align-items:center;background-position:50%;box-sizing:border-box;display:flex;justify-content:center;min-height:430px;overflow:hidden;overflow:clip;padding:1em;position:relative}.wp-block-cover .has-background-dim:not([class*=-background-color]),.wp-block-cover-image .has-background-dim:not([class*=-background-color]),.wp-block-cover-image.has-background-dim:not([class*=-background-color]),.wp-block-cover.has-background-dim:not([class*=-background-color]){background-color:#000}.wp-block-cover .has-background-dim.has-background-gradient,.wp-block-cover-image .has-background-dim.has-background-gradient{background-color:initial}.wp-block-cover-image.has-background-dim:before,.wp-block-cover.has-background-dim:before{background-color:inherit;content:""}.wp-block-cover .wp-block-cover__background,.wp-block-cover .wp-block-cover__gradient-background,.wp-block-cover-image .wp-block-cover__background,.wp-block-cover-image .wp-block-cover__gradient-background,.wp-block-cover-image.has-background-dim:not(.has-background-gradient):before,.wp-block-cover.has-background-dim:not(.has-background-gradient):before{bottom:0;left:0;opacity:.5;position:absolute;right:0;top:0}.wp-block-cover-image.has-background-dim.has-background-dim-10 .wp-block-cover__background,.wp-block-cover-image.has-background-dim.has-background-dim-10 .wp-block-cover__gradient-background,.wp-block-cover-image.has-background-dim.has-background-dim-10:not(.has-background-gradient):before,.wp-block-cover.has-background-dim.has-background-dim-10 .wp-block-cover__background,.wp-block-cover.has-background-dim.has-background-dim-10 .wp-block-cover__gradient-background,.wp-block-cover.has-background-dim.has-background-dim-10:not(.has-background-gradient):before{opacity:.1}.wp-block-cover-image.has-background-dim.has-background-dim-20 .wp-block-cover__background,.wp-block-cover-image.has-background-dim.has-background-dim-20 .wp-block-cover__gradient-background,.wp-block-cover-image.has-background-dim.has-background-dim-20:not(.has-background-gradient):before,.wp-block-cover.has-background-dim.has-background-dim-20 .wp-block-cover__background,.wp-block-cover.has-background-dim.has-background-dim-20 .wp-block-cover__gradient-background,.wp-block-cover.has-background-dim.has-background-dim-20:not(.has-background-gradient):before{opacity:.2}.wp-block-cover-image.has-background-dim.has-background-dim-30 .wp-block-cover__background,.wp-block-cover-image.has-background-dim.has-background-dim-30 .wp-block-cover__gradient-background,.wp-block-cover-image.has-background-dim.has-background-dim-30:not(.has-background-gradient):before,.wp-block-cover.has-background-dim.has-background-dim-30 .wp-block-cover__background,.wp-block-cover.has-background-dim.has-background-dim-30 .wp-block-cover__gradient-background,.wp-block-cover.has-background-dim.has-background-dim-30:not(.has-background-gradient):before{opacity:.3}.wp-block-cover-image.has-background-dim.has-background-dim-40 .wp-block-cover__background,.wp-block-cover-image.has-background-dim.has-background-dim-40 .wp-block-cover__gradient-background,.wp-block-cover-image.has-background-dim.has-background-dim-40:not(.has-background-gradient):before,.wp-block-cover.has-background-dim.has-background-dim-40 .wp-block-cover__background,.wp-block-cover.has-background-dim.has-background-dim-40 .wp-block-cover__gradient-background,.wp-block-cover.has-background-dim.has-background-dim-40:not(.has-background-gradient):before{opacity:.4}.wp-block-cover-image.has-background-dim.has-background-dim-50 .wp-block-cover__background,.wp-block-cover-image.has-background-dim.has-background-dim-50 .wp-block-cover__gradient-background,.wp-block-cover-image.has-background-dim.has-background-dim-50:not(.has-background-gradient):before,.wp-block-cover.has-background-dim.has-background-dim-50 .wp-block-cover__background,.wp-block-cover.has-background-dim.has-background-dim-50 .wp-block-cover__gradient-background,.wp-block-cover.has-background-dim.has-background-dim-50:not(.has-background-gradient):before{opacity:.5}.wp-block-cover-image.has-background-dim.has-background-dim-60 .wp-block-cover__background,.wp-block-cover-image.has-background-dim.has-background-dim-60 .wp-block-cover__gradient-background,.wp-block-cover-image.has-background-dim.has-background-dim-60:not(.has-background-gradient):before,.wp-block-cover.has-background-dim.has-background-dim-60 .wp-block-cover__background,.wp-block-cover.has-background-dim.has-background-dim-60 .wp-block-cover__gradient-background,.wp-block-cover.has-background-dim.has-background-dim-60:not(.has-background-gradient):before{opacity:.6}.wp-block-cover-image.has-background-dim.has-background-dim-70 .wp-block-cover__background,.wp-block-cover-image.has-background-dim.has-background-dim-70 .wp-block-cover__gradient-background,.wp-block-cover-image.has-background-dim.has-background-dim-70:not(.has-background-gradient):before,.wp-block-cover.has-background-dim.has-background-dim-70 .wp-block-cover__background,.wp-block-cover.has-background-dim.has-background-dim-70 .wp-block-cover__gradient-background,.wp-block-cover.has-background-dim.has-background-dim-70:not(.has-background-gradient):before{opacity:.7}.wp-block-cover-image.has-background-dim.has-background-dim-80 .wp-block-cover__background,.wp-block-cover-image.has-background-dim.has-background-dim-80 .wp-block-cover__gradient-background,.wp-block-cover-image.has-background-dim.has-background-dim-80:not(.has-background-gradient):before,.wp-block-cover.has-background-dim.has-background-dim-80 .wp-block-cover__background,.wp-block-cover.has-background-dim.has-background-dim-80 .wp-block-cover__gradient-background,.wp-block-cover.has-background-dim.has-background-dim-80:not(.has-background-gradient):before{opacity:.8}.wp-block-cover-image.has-background-dim.has-background-dim-90 .wp-block-cover__background,.wp-block-cover-image.has-background-dim.has-background-dim-90 .wp-block-cover__gradient-background,.wp-block-cover-image.has-background-dim.has-background-dim-90:not(.has-background-gradient):before,.wp-block-cover.has-background-dim.has-background-dim-90 .wp-block-cover__background,.wp-block-cover.has-background-dim.has-background-dim-90 .wp-block-cover__gradient-background,.wp-block-cover.has-background-dim.has-background-dim-90:not(.has-background-gradient):before{opacity:.9}.wp-block-cover-image.has-background-dim.has-background-dim-100 .wp-block-cover__background,.wp-block-cover-image.has-background-dim.has-background-dim-100 .wp-block-cover__gradient-background,.wp-block-cover-image.has-background-dim.has-background-dim-100:not(.has-background-gradient):before,.wp-block-cover.has-background-dim.has-background-dim-100 .wp-block-cover__background,.wp-block-cover.has-background-dim.has-background-dim-100 .wp-block-cover__gradient-background,.wp-block-cover.has-background-dim.has-background-dim-100:not(.has-background-gradient):before{opacity:1}.wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-0,.wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-0,.wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-0,.wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-0{opacity:0}.wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-10,.wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-10,.wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-10,.wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-10{opacity:.1}.wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-20,.wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-20,.wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-20,.wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-20{opacity:.2}.wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-30,.wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-30,.wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-30,.wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-30{opacity:.3}.wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-40,.wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-40,.wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-40,.wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-40{opacity:.4}.wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-50,.wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-50,.wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-50,.wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-50{opacity:.5}.wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-60,.wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-60,.wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-60,.wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-60{opacity:.6}.wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-70,.wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-70,.wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-70,.wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-70{opacity:.7}.wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-80,.wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-80,.wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-80,.wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-80{opacity:.8}.wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-90,.wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-90,.wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-90,.wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-90{opacity:.9}.wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-100,.wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-100,.wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-100,.wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-100{opacity:1}.wp-block-cover-image.alignleft,.wp-block-cover-image.alignright,.wp-block-cover.alignleft,.wp-block-cover.alignright{max-width:420px;width:100%}.wp-block-cover-image.aligncenter,.wp-block-cover-image.alignleft,.wp-block-cover-image.alignright,.wp-block-cover.aligncenter,.wp-block-cover.alignleft,.wp-block-cover.alignright{display:flex}.wp-block-cover .wp-block-cover__inner-container,.wp-block-cover-image .wp-block-cover__inner-container{color:inherit;position:relative;width:100%}.wp-block-cover-image.is-position-top-left,.wp-block-cover.is-position-top-left{align-items:flex-start;justify-content:flex-start}.wp-block-cover-image.is-position-top-center,.wp-block-cover.is-position-top-center{align-items:flex-start;justify-content:center}.wp-block-cover-image.is-position-top-right,.wp-block-cover.is-position-top-right{align-items:flex-start;justify-content:flex-end}.wp-block-cover-image.is-position-center-left,.wp-block-cover.is-position-center-left{align-items:center;justify-content:flex-start}.wp-block-cover-image.is-position-center-center,.wp-block-cover.is-position-center-center{align-items:center;justify-content:center}.wp-block-cover-image.is-position-center-right,.wp-block-cover.is-position-center-right{align-items:center;justify-content:flex-end}.wp-block-cover-image.is-position-bottom-left,.wp-block-cover.is-position-bottom-left{align-items:flex-end;justify-content:flex-start}.wp-block-cover-image.is-position-bottom-center,.wp-block-cover.is-position-bottom-center{align-items:flex-end;justify-content:center}.wp-block-cover-image.is-position-bottom-right,.wp-block-cover.is-position-bottom-right{align-items:flex-end;justify-content:flex-end}.wp-block-cover-image.has-custom-content-position.has-custom-content-position .wp-block-cover__inner-container,.wp-block-cover.has-custom-content-position.has-custom-content-position .wp-block-cover__inner-container{margin:0}.wp-block-cover-image.has-custom-content-position.has-custom-content-position.is-position-bottom-left .wp-block-cover__inner-container,.wp-block-cover-image.has-custom-content-position.has-custom-content-position.is-position-bottom-right .wp-block-cover__inner-container,.wp-block-cover-image.has-custom-content-position.has-custom-content-position.is-position-center-left .wp-block-cover__inner-container,.wp-block-cover-image.has-custom-content-position.has-custom-content-position.is-position-center-right .wp-block-cover__inner-container,.wp-block-cover-image.has-custom-content-position.has-custom-content-position.is-position-top-left .wp-block-cover__inner-container,.wp-block-cover-image.has-custom-content-position.has-custom-content-position.is-position-top-right .wp-block-cover__inner-container,.wp-block-cover.has-custom-content-position.has-custom-content-position.is-position-bottom-left .wp-block-cover__inner-container,.wp-block-cover.has-custom-content-position.has-custom-content-position.is-position-bottom-right .wp-block-cover__inner-container,.wp-block-cover.has-custom-content-position.has-custom-content-position.is-position-center-left .wp-block-cover__inner-container,.wp-block-cover.has-custom-content-position.has-custom-content-position.is-position-center-right .wp-block-cover__inner-container,.wp-block-cover.has-custom-content-position.has-custom-content-position.is-position-top-left .wp-block-cover__inner-container,.wp-block-cover.has-custom-content-position.has-custom-content-position.is-position-top-right .wp-block-cover__inner-container{margin:0;width:auto}.wp-block-cover .wp-block-cover__image-background,.wp-block-cover video.wp-block-cover__video-background,.wp-block-cover-image .wp-block-cover__image-background,.wp-block-cover-image video.wp-block-cover__video-background{border:none;bottom:0;box-shadow:none;height:100%;left:0;margin:0;max-height:none;max-width:none;object-fit:cover;outline:none;padding:0;position:absolute;right:0;top:0;width:100%}.wp-block-cover-image.has-parallax,.wp-block-cover.has-parallax,.wp-block-cover__image-background.has-parallax,video.wp-block-cover__video-background.has-parallax{background-attachment:fixed;background-repeat:no-repeat;background-size:cover}@supports (-webkit-touch-callout:inherit){.wp-block-cover-image.has-parallax,.wp-block-cover.has-parallax,.wp-block-cover__image-background.has-parallax,video.wp-block-cover__video-background.has-parallax{background-attachment:scroll}}@media (prefers-reduced-motion:reduce){.wp-block-cover-image.has-parallax,.wp-block-cover.has-parallax,.wp-block-cover__image-background.has-parallax,video.wp-block-cover__video-background.has-parallax{background-attachment:scroll}}.wp-block-cover-image.is-repeated,.wp-block-cover.is-repeated,.wp-block-cover__image-background.is-repeated,video.wp-block-cover__video-background.is-repeated{background-repeat:repeat;background-size:auto}.wp-block-cover-image-text,.wp-block-cover-image-text a,.wp-block-cover-image-text a:active,.wp-block-cover-image-text a:focus,.wp-block-cover-image-text a:hover,.wp-block-cover-text,.wp-block-cover-text a,.wp-block-cover-text a:active,.wp-block-cover-text a:focus,.wp-block-cover-text a:hover,section.wp-block-cover-image h2,section.wp-block-cover-image h2 a,section.wp-block-cover-image h2 a:active,section.wp-block-cover-image h2 a:focus,section.wp-block-cover-image h2 a:hover{color:#fff}.wp-block-cover-image .wp-block-cover.has-left-content{justify-content:flex-start}.wp-block-cover-image .wp-block-cover.has-right-content{justify-content:flex-end}.wp-block-cover-image.has-left-content .wp-block-cover-image-text,.wp-block-cover.has-left-content .wp-block-cover-text,section.wp-block-cover-image.has-left-content>h2{margin-left:0;text-align:left}.wp-block-cover-image.has-right-content .wp-block-cover-image-text,.wp-block-cover.has-right-content .wp-block-cover-text,section.wp-block-cover-image.has-right-content>h2{margin-right:0;text-align:right}.wp-block-cover .wp-block-cover-text,.wp-block-cover-image .wp-block-cover-image-text,section.wp-block-cover-image>h2{font-size:2em;line-height:1.25;margin-bottom:0;max-width:840px;padding:.44em;text-align:center;z-index:1}:where(.wp-block-cover-image:not(.has-text-color)),:where(.wp-block-cover:not(.has-text-color)){color:#fff}:where(.wp-block-cover-image.is-light:not(.has-text-color)),:where(.wp-block-cover.is-light:not(.has-text-color)){color:#000}:root :where(.wp-block-cover h1:not(.has-text-color)),:root :where(.wp-block-cover h2:not(.has-text-color)),:root :where(.wp-block-cover h3:not(.has-text-color)),:root :where(.wp-block-cover h4:not(.has-text-color)),:root :where(.wp-block-cover h5:not(.has-text-color)),:root :where(.wp-block-cover h6:not(.has-text-color)),:root :where(.wp-block-cover p:not(.has-text-color)){color:inherit}body:not(.editor-styles-wrapper) .wp-block-cover:not(.wp-block-cover:has(.wp-block-cover__background+.wp-block-cover__inner-container)) .wp-block-cover__image-background,body:not(.editor-styles-wrapper) .wp-block-cover:not(.wp-block-cover:has(.wp-block-cover__background+.wp-block-cover__inner-container)) .wp-block-cover__video-background{z-index:0}body:not(.editor-styles-wrapper) .wp-block-cover:not(.wp-block-cover:has(.wp-block-cover__background+.wp-block-cover__inner-container)) .wp-block-cover__background,body:not(.editor-styles-wrapper) .wp-block-cover:not(.wp-block-cover:has(.wp-block-cover__background+.wp-block-cover__inner-container)) .wp-block-cover__gradient-background,body:not(.editor-styles-wrapper) .wp-block-cover:not(.wp-block-cover:has(.wp-block-cover__background+.wp-block-cover__inner-container)) .wp-block-cover__inner-container,body:not(.editor-styles-wrapper) .wp-block-cover:not(.wp-block-cover:has(.wp-block-cover__background+.wp-block-cover__inner-container)).has-background-dim:not(.has-background-gradient):before{z-index:1}.has-modal-open body:not(.editor-styles-wrapper) .wp-block-cover:not(.wp-block-cover:has(.wp-block-cover__background+.wp-block-cover__inner-container)) .wp-block-cover__inner-container{z-index:auto} \ No newline at end of file diff --git a/wp-includes/blocks/details/block.json b/wp-includes/blocks/details/block.json index a488ae1fa7..19d5c554cd 100644 --- a/wp-includes/blocks/details/block.json +++ b/wp-includes/blocks/details/block.json @@ -16,11 +16,24 @@ "type": "rich-text", "source": "rich-text", "selector": "summary" + }, + "name": { + "type": "string", + "source": "attribute", + "attribute": "name", + "selector": ".wp-block-details" + }, + "allowedBlocks": { + "type": "array" + }, + "placeholder": { + "type": "string" } }, "supports": { "__experimentalOnEnter": true, "align": [ "wide", "full" ], + "anchor": true, "color": { "gradients": true, "link": true, diff --git a/wp-includes/blocks/file/block.json b/wp-includes/blocks/file/block.json index bf0082c576..2c5e888c2a 100644 --- a/wp-includes/blocks/file/block.json +++ b/wp-includes/blocks/file/block.json @@ -16,7 +16,8 @@ "role": "local" }, "href": { - "type": "string" + "type": "string", + "role": "content" }, "fileId": { "type": "string", @@ -27,13 +28,15 @@ "fileName": { "type": "rich-text", "source": "rich-text", - "selector": "a:not([download])" + "selector": "a:not([download])", + "role": "content" }, "textLinkHref": { "type": "string", "source": "attribute", "selector": "a:not([download])", - "attribute": "href" + "attribute": "href", + "role": "content" }, "textLinkTarget": { "type": "string", @@ -48,7 +51,8 @@ "downloadButtonText": { "type": "rich-text", "source": "rich-text", - "selector": "a[download]" + "selector": "a[download]", + "role": "content" }, "displayPreview": { "type": "boolean" diff --git a/wp-includes/blocks/file/view.js b/wp-includes/blocks/file/view.js index c74654a883..6d887f6f50 100644 --- a/wp-includes/blocks/file/view.js +++ b/wp-includes/blocks/file/view.js @@ -42,7 +42,7 @@ const browserSupportsPdfs = () => { return false; } - // Android tablets are the noteable exception. + // Android tablets are the notable exception. if (window.navigator.userAgent.indexOf('Android') > -1) { return false; } diff --git a/wp-includes/blocks/freeform/editor-rtl.css b/wp-includes/blocks/freeform/editor-rtl.css index 6aaa6662ca..8cc8fc7ca2 100644 --- a/wp-includes/blocks/freeform/editor-rtl.css +++ b/wp-includes/blocks/freeform/editor-rtl.css @@ -209,12 +209,10 @@ div[data-type="core/freeform"]:before{ border:1px solid #ddd; outline:1px solid #0000; - transition:border-color .1s linear,box-shadow .1s linear; } -@media (prefers-reduced-motion:reduce){ +@media not (prefers-reduced-motion){ div[data-type="core/freeform"]:before{ - transition-delay:0s; - transition-duration:0s; + transition:border-color .1s linear,box-shadow .1s linear; } } div[data-type="core/freeform"].is-selected:before{ diff --git a/wp-includes/blocks/freeform/editor-rtl.min.css b/wp-includes/blocks/freeform/editor-rtl.min.css index 6ef86e2531..40bec6bf92 100644 --- a/wp-includes/blocks/freeform/editor-rtl.min.css +++ b/wp-includes/blocks/freeform/editor-rtl.min.css @@ -1 +1 @@ -.wp-block-freeform.block-library-rich-text__tinymce{height:auto}.wp-block-freeform.block-library-rich-text__tinymce li,.wp-block-freeform.block-library-rich-text__tinymce p{line-height:1.8}.wp-block-freeform.block-library-rich-text__tinymce ol,.wp-block-freeform.block-library-rich-text__tinymce ul{margin-right:0;padding-right:2.5em}.wp-block-freeform.block-library-rich-text__tinymce blockquote{border-right:4px solid #000;box-shadow:inset 0 0 0 0 #ddd;margin:0;padding-right:1em}.wp-block-freeform.block-library-rich-text__tinymce pre{color:#1e1e1e;font-family:Menlo,Consolas,monaco,monospace;font-size:15px;white-space:pre-wrap}.wp-block-freeform.block-library-rich-text__tinymce>:first-child{margin-top:0}.wp-block-freeform.block-library-rich-text__tinymce>:last-child{margin-bottom:0}.wp-block-freeform.block-library-rich-text__tinymce.mce-edit-focus{outline:none}.wp-block-freeform.block-library-rich-text__tinymce a{color:var(--wp-admin-theme-color)}.wp-block-freeform.block-library-rich-text__tinymce:focus a[data-mce-selected]{background:#e5f5fa;border-radius:2px;box-shadow:0 0 0 1px #e5f5fa;margin:0 -2px;padding:0 2px}.wp-block-freeform.block-library-rich-text__tinymce code{background:#f0f0f0;border-radius:2px;color:#1e1e1e;font-family:Menlo,Consolas,monaco,monospace;font-size:14px;padding:2px}.wp-block-freeform.block-library-rich-text__tinymce:focus code[data-mce-selected]{background:#ddd}.wp-block-freeform.block-library-rich-text__tinymce .alignright{float:right;margin:.5em 0 .5em 1em}.wp-block-freeform.block-library-rich-text__tinymce .alignleft{float:left;margin:.5em 1em .5em 0}.wp-block-freeform.block-library-rich-text__tinymce .aligncenter{display:block;margin-left:auto;margin-right:auto}.wp-block-freeform.block-library-rich-text__tinymce .wp-more-tag{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAADtgAAAAoBAMAAAA86gLBAAAAJFBMVEVMaXG7u7vBwcHDw8POzs68vLzGxsbMzMy+vr7AwMDQ0NDGxsYKLGzpAAAADHRSTlMA///zWf+/f///TMxNVGuqAAABwklEQVR4Ae3dMXLaQBTH4bfj8UCpx8hq0vgKvgFNemhT6Qo6gg6R+0ZahM2QLmyBJ99XWP9V5+o3jIUcLQEAAAAAAAAAAAAAAAAAAAAAAABQ8j0WL9lfTtlt18uNXAUA8O/KVtfa1tdcrOdSh9gCQAMlh1hMNbZZ1bsrsQWABsrhLRbz7z5in/32UbfUMUbkMQCAh5RfGYv82UdMdZ6HS2wjT2ILAI8r3XmM2B3WvM59vfO2xXYW2yYAENuPU8S+X/N67mKxzy225yaxBQCxLV392UdcvwV0jPVUj98ntkBWT7C7+9u2/V/vGtvXIWJ6/4rtbottWa6Ri0NUT/u72LYttrb97LHdvUXMxxrb8TO2W2TF1rYbbLG1bbGNjMi4+2Sbi1FsbbvNFlvbFtt5fDnE3d9sP1/XeIyV2Nr2U2/guZUuptNrH/dPI9eLB6SaAEBs6wPJf3/PNk9tYgsAYrv/8TFuzx/fvkFqGtrEFgDEdpcZUb7ejXy6ntrEFgDENvL6gsas4vbdyKt4DACI7TxElJv/Z7udpqFNbAFAbKduy2uU2trttM/x28UWAAAAAAAAAAAAAAAAAAAAAAAAAADgDyPwGmGTCZp7AAAAAElFTkSuQmCC);background-position:50%;background-repeat:no-repeat;background-size:1900px 20px;cursor:default;display:block;height:20px;margin:15px auto;outline:0;width:96%}.wp-block-freeform.block-library-rich-text__tinymce img::selection{background-color:initial}.wp-block-freeform.block-library-rich-text__tinymce div.mceTemp{-ms-user-select:element}.wp-block-freeform.block-library-rich-text__tinymce dl.wp-caption{margin:0;max-width:100%}.wp-block-freeform.block-library-rich-text__tinymce dl.wp-caption a,.wp-block-freeform.block-library-rich-text__tinymce dl.wp-caption img{display:block}.wp-block-freeform.block-library-rich-text__tinymce dl.wp-caption,.wp-block-freeform.block-library-rich-text__tinymce dl.wp-caption *{-webkit-user-drag:none}.wp-block-freeform.block-library-rich-text__tinymce dl.wp-caption .wp-caption-dd{margin:0;padding-top:.5em}.wp-block-freeform.block-library-rich-text__tinymce .wpview{border:1px solid #0000;clear:both;margin-bottom:16px;position:relative;width:99.99%}.wp-block-freeform.block-library-rich-text__tinymce .wpview iframe{background:#0000;display:block;max-width:100%}.wp-block-freeform.block-library-rich-text__tinymce .wpview .mce-shim{bottom:0;left:0;position:absolute;right:0;top:0}.wp-block-freeform.block-library-rich-text__tinymce .wpview[data-mce-selected="2"] .mce-shim{display:none}.wp-block-freeform.block-library-rich-text__tinymce .wpview .loading-placeholder{border:1px dashed #ddd;padding:10px}.wp-block-freeform.block-library-rich-text__tinymce .wpview .wpview-error{border:1px solid #ddd;margin:0;padding:1em 0;word-wrap:break-word}.wp-block-freeform.block-library-rich-text__tinymce .wpview .wpview-error p{margin:0;text-align:center}.wp-block-freeform.block-library-rich-text__tinymce .wpview[data-mce-selected] .loading-placeholder,.wp-block-freeform.block-library-rich-text__tinymce .wpview[data-mce-selected] .wpview-error{border-color:#0000}.wp-block-freeform.block-library-rich-text__tinymce .wpview .dashicons{display:block;font-size:32px;height:32px;margin:0 auto;width:32px}.wp-block-freeform.block-library-rich-text__tinymce .wpview.wpview-type-gallery:after{clear:both;content:"";display:table}.wp-block-freeform.block-library-rich-text__tinymce .gallery img[data-mce-selected]:focus{outline:none}.wp-block-freeform.block-library-rich-text__tinymce .gallery a{cursor:default}.wp-block-freeform.block-library-rich-text__tinymce .gallery{line-height:1;margin:auto -6px;overflow-x:hidden;padding:6px 0}.wp-block-freeform.block-library-rich-text__tinymce .gallery .gallery-item{box-sizing:border-box;float:right;margin:0;padding:6px;text-align:center}.wp-block-freeform.block-library-rich-text__tinymce .gallery .gallery-caption,.wp-block-freeform.block-library-rich-text__tinymce .gallery .gallery-icon{margin:0}.wp-block-freeform.block-library-rich-text__tinymce .gallery .gallery-caption{font-size:13px;margin:4px 0}.wp-block-freeform.block-library-rich-text__tinymce .gallery-columns-1 .gallery-item{width:100%}.wp-block-freeform.block-library-rich-text__tinymce .gallery-columns-2 .gallery-item{width:50%}.wp-block-freeform.block-library-rich-text__tinymce .gallery-columns-3 .gallery-item{width:33.3333333333%}.wp-block-freeform.block-library-rich-text__tinymce .gallery-columns-4 .gallery-item{width:25%}.wp-block-freeform.block-library-rich-text__tinymce .gallery-columns-5 .gallery-item{width:20%}.wp-block-freeform.block-library-rich-text__tinymce .gallery-columns-6 .gallery-item{width:16.6666666667%}.wp-block-freeform.block-library-rich-text__tinymce .gallery-columns-7 .gallery-item{width:14.2857142857%}.wp-block-freeform.block-library-rich-text__tinymce .gallery-columns-8 .gallery-item{width:12.5%}.wp-block-freeform.block-library-rich-text__tinymce .gallery-columns-9 .gallery-item{width:11.1111111111%}.wp-block-freeform.block-library-rich-text__tinymce .gallery img{border:none;height:auto;max-width:100%;padding:0}div[data-type="core/freeform"]:before{border:1px solid #ddd;outline:1px solid #0000;transition:border-color .1s linear,box-shadow .1s linear}@media (prefers-reduced-motion:reduce){div[data-type="core/freeform"]:before{transition-delay:0s;transition-duration:0s}}div[data-type="core/freeform"].is-selected:before{border-color:#1e1e1e}div[data-type="core/freeform"] .block-editor-block-contextual-toolbar+div{margin-top:0;padding-top:0}div[data-type="core/freeform"].is-selected .block-library-rich-text__tinymce:after{clear:both;content:"";display:table}.mce-toolbar-grp .mce-btn.mce-active button,.mce-toolbar-grp .mce-btn.mce-active i,.mce-toolbar-grp .mce-btn.mce-active:hover button,.mce-toolbar-grp .mce-btn.mce-active:hover i{color:#1e1e1e}.mce-toolbar-grp .mce-rtl .mce-flow-layout-item.mce-last{margin-left:0;margin-right:8px}.mce-toolbar-grp .mce-btn i{font-style:normal}.block-library-classic__toolbar{border:1px solid #ddd;border-bottom:none;border-radius:2px;display:none;margin:0 0 8px;padding:0;position:sticky;top:0;width:auto;z-index:31}div[data-type="core/freeform"].is-selected .block-library-classic__toolbar{border-color:#1e1e1e;display:block}.block-library-classic__toolbar .mce-tinymce{box-shadow:none}@media (min-width:600px){.block-library-classic__toolbar{padding:0}}.block-library-classic__toolbar:empty{background:#f5f5f5;border-bottom:1px solid #e2e4e7;display:block}.block-library-classic__toolbar:empty:before{color:#555d66;content:attr(data-placeholder);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px;line-height:37px;padding:14px}.block-library-classic__toolbar div.mce-toolbar-grp{border-bottom:1px solid #1e1e1e}.block-library-classic__toolbar .mce-menubar,.block-library-classic__toolbar .mce-menubar>div,.block-library-classic__toolbar .mce-tinymce-inline,.block-library-classic__toolbar .mce-tinymce-inline>div,.block-library-classic__toolbar div.mce-toolbar-grp,.block-library-classic__toolbar div.mce-toolbar-grp>div{height:auto!important;width:100%!important}.block-library-classic__toolbar .mce-container-body.mce-abs-layout{overflow:visible}.block-library-classic__toolbar .mce-menubar,.block-library-classic__toolbar div.mce-toolbar-grp{position:static}.block-library-classic__toolbar .mce-toolbar-grp>div{padding:1px 3px}.block-library-classic__toolbar .mce-toolbar-grp .mce-toolbar:not(:first-child){display:none}.block-library-classic__toolbar.has-advanced-toolbar .mce-toolbar-grp .mce-toolbar{display:block}.block-editor-freeform-modal .block-editor-freeform-modal__content .mce-edit-area iframe{height:50vh!important}@media (min-width:960px){.block-editor-freeform-modal .block-editor-freeform-modal__content:not(.is-full-screen){height:9999rem}.block-editor-freeform-modal .block-editor-freeform-modal__content .components-modal__header+div{height:100%}.block-editor-freeform-modal .block-editor-freeform-modal__content .mce-tinymce{height:calc(100% - 52px)}.block-editor-freeform-modal .block-editor-freeform-modal__content .mce-container-body{display:flex;flex-direction:column;height:100%;min-width:50vw}.block-editor-freeform-modal .block-editor-freeform-modal__content .mce-edit-area{display:flex;flex-direction:column;flex-grow:1}.block-editor-freeform-modal .block-editor-freeform-modal__content .mce-edit-area iframe{flex-grow:1;height:10px!important}}.block-editor-freeform-modal__actions{margin-top:16px} \ No newline at end of file +.wp-block-freeform.block-library-rich-text__tinymce{height:auto}.wp-block-freeform.block-library-rich-text__tinymce li,.wp-block-freeform.block-library-rich-text__tinymce p{line-height:1.8}.wp-block-freeform.block-library-rich-text__tinymce ol,.wp-block-freeform.block-library-rich-text__tinymce ul{margin-right:0;padding-right:2.5em}.wp-block-freeform.block-library-rich-text__tinymce blockquote{border-right:4px solid #000;box-shadow:inset 0 0 0 0 #ddd;margin:0;padding-right:1em}.wp-block-freeform.block-library-rich-text__tinymce pre{color:#1e1e1e;font-family:Menlo,Consolas,monaco,monospace;font-size:15px;white-space:pre-wrap}.wp-block-freeform.block-library-rich-text__tinymce>:first-child{margin-top:0}.wp-block-freeform.block-library-rich-text__tinymce>:last-child{margin-bottom:0}.wp-block-freeform.block-library-rich-text__tinymce.mce-edit-focus{outline:none}.wp-block-freeform.block-library-rich-text__tinymce a{color:var(--wp-admin-theme-color)}.wp-block-freeform.block-library-rich-text__tinymce:focus a[data-mce-selected]{background:#e5f5fa;border-radius:2px;box-shadow:0 0 0 1px #e5f5fa;margin:0 -2px;padding:0 2px}.wp-block-freeform.block-library-rich-text__tinymce code{background:#f0f0f0;border-radius:2px;color:#1e1e1e;font-family:Menlo,Consolas,monaco,monospace;font-size:14px;padding:2px}.wp-block-freeform.block-library-rich-text__tinymce:focus code[data-mce-selected]{background:#ddd}.wp-block-freeform.block-library-rich-text__tinymce .alignright{float:right;margin:.5em 0 .5em 1em}.wp-block-freeform.block-library-rich-text__tinymce .alignleft{float:left;margin:.5em 1em .5em 0}.wp-block-freeform.block-library-rich-text__tinymce .aligncenter{display:block;margin-left:auto;margin-right:auto}.wp-block-freeform.block-library-rich-text__tinymce .wp-more-tag{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAADtgAAAAoBAMAAAA86gLBAAAAJFBMVEVMaXG7u7vBwcHDw8POzs68vLzGxsbMzMy+vr7AwMDQ0NDGxsYKLGzpAAAADHRSTlMA///zWf+/f///TMxNVGuqAAABwklEQVR4Ae3dMXLaQBTH4bfj8UCpx8hq0vgKvgFNemhT6Qo6gg6R+0ZahM2QLmyBJ99XWP9V5+o3jIUcLQEAAAAAAAAAAAAAAAAAAAAAAABQ8j0WL9lfTtlt18uNXAUA8O/KVtfa1tdcrOdSh9gCQAMlh1hMNbZZ1bsrsQWABsrhLRbz7z5in/32UbfUMUbkMQCAh5RfGYv82UdMdZ6HS2wjT2ILAI8r3XmM2B3WvM59vfO2xXYW2yYAENuPU8S+X/N67mKxzy225yaxBQCxLV392UdcvwV0jPVUj98ntkBWT7C7+9u2/V/vGtvXIWJ6/4rtbottWa6Ri0NUT/u72LYttrb97LHdvUXMxxrb8TO2W2TF1rYbbLG1bbGNjMi4+2Sbi1FsbbvNFlvbFtt5fDnE3d9sP1/XeIyV2Nr2U2/guZUuptNrH/dPI9eLB6SaAEBs6wPJf3/PNk9tYgsAYrv/8TFuzx/fvkFqGtrEFgDEdpcZUb7ejXy6ntrEFgDENvL6gsas4vbdyKt4DACI7TxElJv/Z7udpqFNbAFAbKduy2uU2trttM/x28UWAAAAAAAAAAAAAAAAAAAAAAAAAADgDyPwGmGTCZp7AAAAAElFTkSuQmCC);background-position:50%;background-repeat:no-repeat;background-size:1900px 20px;cursor:default;display:block;height:20px;margin:15px auto;outline:0;width:96%}.wp-block-freeform.block-library-rich-text__tinymce img::selection{background-color:initial}.wp-block-freeform.block-library-rich-text__tinymce div.mceTemp{-ms-user-select:element}.wp-block-freeform.block-library-rich-text__tinymce dl.wp-caption{margin:0;max-width:100%}.wp-block-freeform.block-library-rich-text__tinymce dl.wp-caption a,.wp-block-freeform.block-library-rich-text__tinymce dl.wp-caption img{display:block}.wp-block-freeform.block-library-rich-text__tinymce dl.wp-caption,.wp-block-freeform.block-library-rich-text__tinymce dl.wp-caption *{-webkit-user-drag:none}.wp-block-freeform.block-library-rich-text__tinymce dl.wp-caption .wp-caption-dd{margin:0;padding-top:.5em}.wp-block-freeform.block-library-rich-text__tinymce .wpview{border:1px solid #0000;clear:both;margin-bottom:16px;position:relative;width:99.99%}.wp-block-freeform.block-library-rich-text__tinymce .wpview iframe{background:#0000;display:block;max-width:100%}.wp-block-freeform.block-library-rich-text__tinymce .wpview .mce-shim{bottom:0;left:0;position:absolute;right:0;top:0}.wp-block-freeform.block-library-rich-text__tinymce .wpview[data-mce-selected="2"] .mce-shim{display:none}.wp-block-freeform.block-library-rich-text__tinymce .wpview .loading-placeholder{border:1px dashed #ddd;padding:10px}.wp-block-freeform.block-library-rich-text__tinymce .wpview .wpview-error{border:1px solid #ddd;margin:0;padding:1em 0;word-wrap:break-word}.wp-block-freeform.block-library-rich-text__tinymce .wpview .wpview-error p{margin:0;text-align:center}.wp-block-freeform.block-library-rich-text__tinymce .wpview[data-mce-selected] .loading-placeholder,.wp-block-freeform.block-library-rich-text__tinymce .wpview[data-mce-selected] .wpview-error{border-color:#0000}.wp-block-freeform.block-library-rich-text__tinymce .wpview .dashicons{display:block;font-size:32px;height:32px;margin:0 auto;width:32px}.wp-block-freeform.block-library-rich-text__tinymce .wpview.wpview-type-gallery:after{clear:both;content:"";display:table}.wp-block-freeform.block-library-rich-text__tinymce .gallery img[data-mce-selected]:focus{outline:none}.wp-block-freeform.block-library-rich-text__tinymce .gallery a{cursor:default}.wp-block-freeform.block-library-rich-text__tinymce .gallery{line-height:1;margin:auto -6px;overflow-x:hidden;padding:6px 0}.wp-block-freeform.block-library-rich-text__tinymce .gallery .gallery-item{box-sizing:border-box;float:right;margin:0;padding:6px;text-align:center}.wp-block-freeform.block-library-rich-text__tinymce .gallery .gallery-caption,.wp-block-freeform.block-library-rich-text__tinymce .gallery .gallery-icon{margin:0}.wp-block-freeform.block-library-rich-text__tinymce .gallery .gallery-caption{font-size:13px;margin:4px 0}.wp-block-freeform.block-library-rich-text__tinymce .gallery-columns-1 .gallery-item{width:100%}.wp-block-freeform.block-library-rich-text__tinymce .gallery-columns-2 .gallery-item{width:50%}.wp-block-freeform.block-library-rich-text__tinymce .gallery-columns-3 .gallery-item{width:33.3333333333%}.wp-block-freeform.block-library-rich-text__tinymce .gallery-columns-4 .gallery-item{width:25%}.wp-block-freeform.block-library-rich-text__tinymce .gallery-columns-5 .gallery-item{width:20%}.wp-block-freeform.block-library-rich-text__tinymce .gallery-columns-6 .gallery-item{width:16.6666666667%}.wp-block-freeform.block-library-rich-text__tinymce .gallery-columns-7 .gallery-item{width:14.2857142857%}.wp-block-freeform.block-library-rich-text__tinymce .gallery-columns-8 .gallery-item{width:12.5%}.wp-block-freeform.block-library-rich-text__tinymce .gallery-columns-9 .gallery-item{width:11.1111111111%}.wp-block-freeform.block-library-rich-text__tinymce .gallery img{border:none;height:auto;max-width:100%;padding:0}div[data-type="core/freeform"]:before{border:1px solid #ddd;outline:1px solid #0000}@media not (prefers-reduced-motion){div[data-type="core/freeform"]:before{transition:border-color .1s linear,box-shadow .1s linear}}div[data-type="core/freeform"].is-selected:before{border-color:#1e1e1e}div[data-type="core/freeform"] .block-editor-block-contextual-toolbar+div{margin-top:0;padding-top:0}div[data-type="core/freeform"].is-selected .block-library-rich-text__tinymce:after{clear:both;content:"";display:table}.mce-toolbar-grp .mce-btn.mce-active button,.mce-toolbar-grp .mce-btn.mce-active i,.mce-toolbar-grp .mce-btn.mce-active:hover button,.mce-toolbar-grp .mce-btn.mce-active:hover i{color:#1e1e1e}.mce-toolbar-grp .mce-rtl .mce-flow-layout-item.mce-last{margin-left:0;margin-right:8px}.mce-toolbar-grp .mce-btn i{font-style:normal}.block-library-classic__toolbar{border:1px solid #ddd;border-bottom:none;border-radius:2px;display:none;margin:0 0 8px;padding:0;position:sticky;top:0;width:auto;z-index:31}div[data-type="core/freeform"].is-selected .block-library-classic__toolbar{border-color:#1e1e1e;display:block}.block-library-classic__toolbar .mce-tinymce{box-shadow:none}@media (min-width:600px){.block-library-classic__toolbar{padding:0}}.block-library-classic__toolbar:empty{background:#f5f5f5;border-bottom:1px solid #e2e4e7;display:block}.block-library-classic__toolbar:empty:before{color:#555d66;content:attr(data-placeholder);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px;line-height:37px;padding:14px}.block-library-classic__toolbar div.mce-toolbar-grp{border-bottom:1px solid #1e1e1e}.block-library-classic__toolbar .mce-menubar,.block-library-classic__toolbar .mce-menubar>div,.block-library-classic__toolbar .mce-tinymce-inline,.block-library-classic__toolbar .mce-tinymce-inline>div,.block-library-classic__toolbar div.mce-toolbar-grp,.block-library-classic__toolbar div.mce-toolbar-grp>div{height:auto!important;width:100%!important}.block-library-classic__toolbar .mce-container-body.mce-abs-layout{overflow:visible}.block-library-classic__toolbar .mce-menubar,.block-library-classic__toolbar div.mce-toolbar-grp{position:static}.block-library-classic__toolbar .mce-toolbar-grp>div{padding:1px 3px}.block-library-classic__toolbar .mce-toolbar-grp .mce-toolbar:not(:first-child){display:none}.block-library-classic__toolbar.has-advanced-toolbar .mce-toolbar-grp .mce-toolbar{display:block}.block-editor-freeform-modal .block-editor-freeform-modal__content .mce-edit-area iframe{height:50vh!important}@media (min-width:960px){.block-editor-freeform-modal .block-editor-freeform-modal__content:not(.is-full-screen){height:9999rem}.block-editor-freeform-modal .block-editor-freeform-modal__content .components-modal__header+div{height:100%}.block-editor-freeform-modal .block-editor-freeform-modal__content .mce-tinymce{height:calc(100% - 52px)}.block-editor-freeform-modal .block-editor-freeform-modal__content .mce-container-body{display:flex;flex-direction:column;height:100%;min-width:50vw}.block-editor-freeform-modal .block-editor-freeform-modal__content .mce-edit-area{display:flex;flex-direction:column;flex-grow:1}.block-editor-freeform-modal .block-editor-freeform-modal__content .mce-edit-area iframe{flex-grow:1;height:10px!important}}.block-editor-freeform-modal__actions{margin-top:16px} \ No newline at end of file diff --git a/wp-includes/blocks/freeform/editor.css b/wp-includes/blocks/freeform/editor.css index 5bda927ea2..bf6245d323 100644 --- a/wp-includes/blocks/freeform/editor.css +++ b/wp-includes/blocks/freeform/editor.css @@ -209,12 +209,10 @@ div[data-type="core/freeform"]:before{ border:1px solid #ddd; outline:1px solid #0000; - transition:border-color .1s linear,box-shadow .1s linear; } -@media (prefers-reduced-motion:reduce){ +@media not (prefers-reduced-motion){ div[data-type="core/freeform"]:before{ - transition-delay:0s; - transition-duration:0s; + transition:border-color .1s linear,box-shadow .1s linear; } } div[data-type="core/freeform"].is-selected:before{ diff --git a/wp-includes/blocks/freeform/editor.min.css b/wp-includes/blocks/freeform/editor.min.css index 8ba88523aa..1252439ff0 100644 --- a/wp-includes/blocks/freeform/editor.min.css +++ b/wp-includes/blocks/freeform/editor.min.css @@ -1 +1 @@ -.wp-block-freeform.block-library-rich-text__tinymce{height:auto}.wp-block-freeform.block-library-rich-text__tinymce li,.wp-block-freeform.block-library-rich-text__tinymce p{line-height:1.8}.wp-block-freeform.block-library-rich-text__tinymce ol,.wp-block-freeform.block-library-rich-text__tinymce ul{margin-left:0;padding-left:2.5em}.wp-block-freeform.block-library-rich-text__tinymce blockquote{border-left:4px solid #000;box-shadow:inset 0 0 0 0 #ddd;margin:0;padding-left:1em}.wp-block-freeform.block-library-rich-text__tinymce pre{color:#1e1e1e;font-family:Menlo,Consolas,monaco,monospace;font-size:15px;white-space:pre-wrap}.wp-block-freeform.block-library-rich-text__tinymce>:first-child{margin-top:0}.wp-block-freeform.block-library-rich-text__tinymce>:last-child{margin-bottom:0}.wp-block-freeform.block-library-rich-text__tinymce.mce-edit-focus{outline:none}.wp-block-freeform.block-library-rich-text__tinymce a{color:var(--wp-admin-theme-color)}.wp-block-freeform.block-library-rich-text__tinymce:focus a[data-mce-selected]{background:#e5f5fa;border-radius:2px;box-shadow:0 0 0 1px #e5f5fa;margin:0 -2px;padding:0 2px}.wp-block-freeform.block-library-rich-text__tinymce code{background:#f0f0f0;border-radius:2px;color:#1e1e1e;font-family:Menlo,Consolas,monaco,monospace;font-size:14px;padding:2px}.wp-block-freeform.block-library-rich-text__tinymce:focus code[data-mce-selected]{background:#ddd}.wp-block-freeform.block-library-rich-text__tinymce .alignright{float:right;margin:.5em 0 .5em 1em}.wp-block-freeform.block-library-rich-text__tinymce .alignleft{float:left;margin:.5em 1em .5em 0}.wp-block-freeform.block-library-rich-text__tinymce .aligncenter{display:block;margin-left:auto;margin-right:auto}.wp-block-freeform.block-library-rich-text__tinymce .wp-more-tag{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAADtgAAAAoBAMAAAA86gLBAAAAJFBMVEVMaXG7u7vBwcHDw8POzs68vLzGxsbMzMy+vr7AwMDQ0NDGxsYKLGzpAAAADHRSTlMA///zWf+/f///TMxNVGuqAAABwklEQVR4Ae3dMXLaQBTH4bfj8UCpx8hq0vgKvgFNemhT6Qo6gg6R+0ZahM2QLmyBJ99XWP9V5+o3jIUcLQEAAAAAAAAAAAAAAAAAAAAAAABQ8j0WL9lfTtlt18uNXAUA8O/KVtfa1tdcrOdSh9gCQAMlh1hMNbZZ1bsrsQWABsrhLRbz7z5in/32UbfUMUbkMQCAh5RfGYv82UdMdZ6HS2wjT2ILAI8r3XmM2B3WvM59vfO2xXYW2yYAENuPU8S+X/N67mKxzy225yaxBQCxLV392UdcvwV0jPVUj98ntkBWT7C7+9u2/V/vGtvXIWJ6/4rtbottWa6Ri0NUT/u72LYttrb97LHdvUXMxxrb8TO2W2TF1rYbbLG1bbGNjMi4+2Sbi1FsbbvNFlvbFtt5fDnE3d9sP1/XeIyV2Nr2U2/guZUuptNrH/dPI9eLB6SaAEBs6wPJf3/PNk9tYgsAYrv/8TFuzx/fvkFqGtrEFgDEdpcZUb7ejXy6ntrEFgDENvL6gsas4vbdyKt4DACI7TxElJv/Z7udpqFNbAFAbKduy2uU2trttM/x28UWAAAAAAAAAAAAAAAAAAAAAAAAAADgDyPwGmGTCZp7AAAAAElFTkSuQmCC);background-position:50%;background-repeat:no-repeat;background-size:1900px 20px;cursor:default;display:block;height:20px;margin:15px auto;outline:0;width:96%}.wp-block-freeform.block-library-rich-text__tinymce img::selection{background-color:initial}.wp-block-freeform.block-library-rich-text__tinymce div.mceTemp{-ms-user-select:element}.wp-block-freeform.block-library-rich-text__tinymce dl.wp-caption{margin:0;max-width:100%}.wp-block-freeform.block-library-rich-text__tinymce dl.wp-caption a,.wp-block-freeform.block-library-rich-text__tinymce dl.wp-caption img{display:block}.wp-block-freeform.block-library-rich-text__tinymce dl.wp-caption,.wp-block-freeform.block-library-rich-text__tinymce dl.wp-caption *{-webkit-user-drag:none}.wp-block-freeform.block-library-rich-text__tinymce dl.wp-caption .wp-caption-dd{margin:0;padding-top:.5em}.wp-block-freeform.block-library-rich-text__tinymce .wpview{border:1px solid #0000;clear:both;margin-bottom:16px;position:relative;width:99.99%}.wp-block-freeform.block-library-rich-text__tinymce .wpview iframe{background:#0000;display:block;max-width:100%}.wp-block-freeform.block-library-rich-text__tinymce .wpview .mce-shim{bottom:0;left:0;position:absolute;right:0;top:0}.wp-block-freeform.block-library-rich-text__tinymce .wpview[data-mce-selected="2"] .mce-shim{display:none}.wp-block-freeform.block-library-rich-text__tinymce .wpview .loading-placeholder{border:1px dashed #ddd;padding:10px}.wp-block-freeform.block-library-rich-text__tinymce .wpview .wpview-error{border:1px solid #ddd;margin:0;padding:1em 0;word-wrap:break-word}.wp-block-freeform.block-library-rich-text__tinymce .wpview .wpview-error p{margin:0;text-align:center}.wp-block-freeform.block-library-rich-text__tinymce .wpview[data-mce-selected] .loading-placeholder,.wp-block-freeform.block-library-rich-text__tinymce .wpview[data-mce-selected] .wpview-error{border-color:#0000}.wp-block-freeform.block-library-rich-text__tinymce .wpview .dashicons{display:block;font-size:32px;height:32px;margin:0 auto;width:32px}.wp-block-freeform.block-library-rich-text__tinymce .wpview.wpview-type-gallery:after{clear:both;content:"";display:table}.wp-block-freeform.block-library-rich-text__tinymce .gallery img[data-mce-selected]:focus{outline:none}.wp-block-freeform.block-library-rich-text__tinymce .gallery a{cursor:default}.wp-block-freeform.block-library-rich-text__tinymce .gallery{line-height:1;margin:auto -6px;overflow-x:hidden;padding:6px 0}.wp-block-freeform.block-library-rich-text__tinymce .gallery .gallery-item{box-sizing:border-box;float:left;margin:0;padding:6px;text-align:center}.wp-block-freeform.block-library-rich-text__tinymce .gallery .gallery-caption,.wp-block-freeform.block-library-rich-text__tinymce .gallery .gallery-icon{margin:0}.wp-block-freeform.block-library-rich-text__tinymce .gallery .gallery-caption{font-size:13px;margin:4px 0}.wp-block-freeform.block-library-rich-text__tinymce .gallery-columns-1 .gallery-item{width:100%}.wp-block-freeform.block-library-rich-text__tinymce .gallery-columns-2 .gallery-item{width:50%}.wp-block-freeform.block-library-rich-text__tinymce .gallery-columns-3 .gallery-item{width:33.3333333333%}.wp-block-freeform.block-library-rich-text__tinymce .gallery-columns-4 .gallery-item{width:25%}.wp-block-freeform.block-library-rich-text__tinymce .gallery-columns-5 .gallery-item{width:20%}.wp-block-freeform.block-library-rich-text__tinymce .gallery-columns-6 .gallery-item{width:16.6666666667%}.wp-block-freeform.block-library-rich-text__tinymce .gallery-columns-7 .gallery-item{width:14.2857142857%}.wp-block-freeform.block-library-rich-text__tinymce .gallery-columns-8 .gallery-item{width:12.5%}.wp-block-freeform.block-library-rich-text__tinymce .gallery-columns-9 .gallery-item{width:11.1111111111%}.wp-block-freeform.block-library-rich-text__tinymce .gallery img{border:none;height:auto;max-width:100%;padding:0}div[data-type="core/freeform"]:before{border:1px solid #ddd;outline:1px solid #0000;transition:border-color .1s linear,box-shadow .1s linear}@media (prefers-reduced-motion:reduce){div[data-type="core/freeform"]:before{transition-delay:0s;transition-duration:0s}}div[data-type="core/freeform"].is-selected:before{border-color:#1e1e1e}div[data-type="core/freeform"] .block-editor-block-contextual-toolbar+div{margin-top:0;padding-top:0}div[data-type="core/freeform"].is-selected .block-library-rich-text__tinymce:after{clear:both;content:"";display:table}.mce-toolbar-grp .mce-btn.mce-active button,.mce-toolbar-grp .mce-btn.mce-active i,.mce-toolbar-grp .mce-btn.mce-active:hover button,.mce-toolbar-grp .mce-btn.mce-active:hover i{color:#1e1e1e}.mce-toolbar-grp .mce-rtl .mce-flow-layout-item.mce-last{margin-left:8px;margin-right:0}.mce-toolbar-grp .mce-btn i{font-style:normal}.block-library-classic__toolbar{border:1px solid #ddd;border-bottom:none;border-radius:2px;display:none;margin:0 0 8px;padding:0;position:sticky;top:0;width:auto;z-index:31}div[data-type="core/freeform"].is-selected .block-library-classic__toolbar{border-color:#1e1e1e;display:block}.block-library-classic__toolbar .mce-tinymce{box-shadow:none}@media (min-width:600px){.block-library-classic__toolbar{padding:0}}.block-library-classic__toolbar:empty{background:#f5f5f5;border-bottom:1px solid #e2e4e7;display:block}.block-library-classic__toolbar:empty:before{color:#555d66;content:attr(data-placeholder);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px;line-height:37px;padding:14px}.block-library-classic__toolbar div.mce-toolbar-grp{border-bottom:1px solid #1e1e1e}.block-library-classic__toolbar .mce-menubar,.block-library-classic__toolbar .mce-menubar>div,.block-library-classic__toolbar .mce-tinymce-inline,.block-library-classic__toolbar .mce-tinymce-inline>div,.block-library-classic__toolbar div.mce-toolbar-grp,.block-library-classic__toolbar div.mce-toolbar-grp>div{height:auto!important;width:100%!important}.block-library-classic__toolbar .mce-container-body.mce-abs-layout{overflow:visible}.block-library-classic__toolbar .mce-menubar,.block-library-classic__toolbar div.mce-toolbar-grp{position:static}.block-library-classic__toolbar .mce-toolbar-grp>div{padding:1px 3px}.block-library-classic__toolbar .mce-toolbar-grp .mce-toolbar:not(:first-child){display:none}.block-library-classic__toolbar.has-advanced-toolbar .mce-toolbar-grp .mce-toolbar{display:block}.block-editor-freeform-modal .block-editor-freeform-modal__content .mce-edit-area iframe{height:50vh!important}@media (min-width:960px){.block-editor-freeform-modal .block-editor-freeform-modal__content:not(.is-full-screen){height:9999rem}.block-editor-freeform-modal .block-editor-freeform-modal__content .components-modal__header+div{height:100%}.block-editor-freeform-modal .block-editor-freeform-modal__content .mce-tinymce{height:calc(100% - 52px)}.block-editor-freeform-modal .block-editor-freeform-modal__content .mce-container-body{display:flex;flex-direction:column;height:100%;min-width:50vw}.block-editor-freeform-modal .block-editor-freeform-modal__content .mce-edit-area{display:flex;flex-direction:column;flex-grow:1}.block-editor-freeform-modal .block-editor-freeform-modal__content .mce-edit-area iframe{flex-grow:1;height:10px!important}}.block-editor-freeform-modal__actions{margin-top:16px} \ No newline at end of file +.wp-block-freeform.block-library-rich-text__tinymce{height:auto}.wp-block-freeform.block-library-rich-text__tinymce li,.wp-block-freeform.block-library-rich-text__tinymce p{line-height:1.8}.wp-block-freeform.block-library-rich-text__tinymce ol,.wp-block-freeform.block-library-rich-text__tinymce ul{margin-left:0;padding-left:2.5em}.wp-block-freeform.block-library-rich-text__tinymce blockquote{border-left:4px solid #000;box-shadow:inset 0 0 0 0 #ddd;margin:0;padding-left:1em}.wp-block-freeform.block-library-rich-text__tinymce pre{color:#1e1e1e;font-family:Menlo,Consolas,monaco,monospace;font-size:15px;white-space:pre-wrap}.wp-block-freeform.block-library-rich-text__tinymce>:first-child{margin-top:0}.wp-block-freeform.block-library-rich-text__tinymce>:last-child{margin-bottom:0}.wp-block-freeform.block-library-rich-text__tinymce.mce-edit-focus{outline:none}.wp-block-freeform.block-library-rich-text__tinymce a{color:var(--wp-admin-theme-color)}.wp-block-freeform.block-library-rich-text__tinymce:focus a[data-mce-selected]{background:#e5f5fa;border-radius:2px;box-shadow:0 0 0 1px #e5f5fa;margin:0 -2px;padding:0 2px}.wp-block-freeform.block-library-rich-text__tinymce code{background:#f0f0f0;border-radius:2px;color:#1e1e1e;font-family:Menlo,Consolas,monaco,monospace;font-size:14px;padding:2px}.wp-block-freeform.block-library-rich-text__tinymce:focus code[data-mce-selected]{background:#ddd}.wp-block-freeform.block-library-rich-text__tinymce .alignright{float:right;margin:.5em 0 .5em 1em}.wp-block-freeform.block-library-rich-text__tinymce .alignleft{float:left;margin:.5em 1em .5em 0}.wp-block-freeform.block-library-rich-text__tinymce .aligncenter{display:block;margin-left:auto;margin-right:auto}.wp-block-freeform.block-library-rich-text__tinymce .wp-more-tag{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAADtgAAAAoBAMAAAA86gLBAAAAJFBMVEVMaXG7u7vBwcHDw8POzs68vLzGxsbMzMy+vr7AwMDQ0NDGxsYKLGzpAAAADHRSTlMA///zWf+/f///TMxNVGuqAAABwklEQVR4Ae3dMXLaQBTH4bfj8UCpx8hq0vgKvgFNemhT6Qo6gg6R+0ZahM2QLmyBJ99XWP9V5+o3jIUcLQEAAAAAAAAAAAAAAAAAAAAAAABQ8j0WL9lfTtlt18uNXAUA8O/KVtfa1tdcrOdSh9gCQAMlh1hMNbZZ1bsrsQWABsrhLRbz7z5in/32UbfUMUbkMQCAh5RfGYv82UdMdZ6HS2wjT2ILAI8r3XmM2B3WvM59vfO2xXYW2yYAENuPU8S+X/N67mKxzy225yaxBQCxLV392UdcvwV0jPVUj98ntkBWT7C7+9u2/V/vGtvXIWJ6/4rtbottWa6Ri0NUT/u72LYttrb97LHdvUXMxxrb8TO2W2TF1rYbbLG1bbGNjMi4+2Sbi1FsbbvNFlvbFtt5fDnE3d9sP1/XeIyV2Nr2U2/guZUuptNrH/dPI9eLB6SaAEBs6wPJf3/PNk9tYgsAYrv/8TFuzx/fvkFqGtrEFgDEdpcZUb7ejXy6ntrEFgDENvL6gsas4vbdyKt4DACI7TxElJv/Z7udpqFNbAFAbKduy2uU2trttM/x28UWAAAAAAAAAAAAAAAAAAAAAAAAAADgDyPwGmGTCZp7AAAAAElFTkSuQmCC);background-position:50%;background-repeat:no-repeat;background-size:1900px 20px;cursor:default;display:block;height:20px;margin:15px auto;outline:0;width:96%}.wp-block-freeform.block-library-rich-text__tinymce img::selection{background-color:initial}.wp-block-freeform.block-library-rich-text__tinymce div.mceTemp{-ms-user-select:element}.wp-block-freeform.block-library-rich-text__tinymce dl.wp-caption{margin:0;max-width:100%}.wp-block-freeform.block-library-rich-text__tinymce dl.wp-caption a,.wp-block-freeform.block-library-rich-text__tinymce dl.wp-caption img{display:block}.wp-block-freeform.block-library-rich-text__tinymce dl.wp-caption,.wp-block-freeform.block-library-rich-text__tinymce dl.wp-caption *{-webkit-user-drag:none}.wp-block-freeform.block-library-rich-text__tinymce dl.wp-caption .wp-caption-dd{margin:0;padding-top:.5em}.wp-block-freeform.block-library-rich-text__tinymce .wpview{border:1px solid #0000;clear:both;margin-bottom:16px;position:relative;width:99.99%}.wp-block-freeform.block-library-rich-text__tinymce .wpview iframe{background:#0000;display:block;max-width:100%}.wp-block-freeform.block-library-rich-text__tinymce .wpview .mce-shim{bottom:0;left:0;position:absolute;right:0;top:0}.wp-block-freeform.block-library-rich-text__tinymce .wpview[data-mce-selected="2"] .mce-shim{display:none}.wp-block-freeform.block-library-rich-text__tinymce .wpview .loading-placeholder{border:1px dashed #ddd;padding:10px}.wp-block-freeform.block-library-rich-text__tinymce .wpview .wpview-error{border:1px solid #ddd;margin:0;padding:1em 0;word-wrap:break-word}.wp-block-freeform.block-library-rich-text__tinymce .wpview .wpview-error p{margin:0;text-align:center}.wp-block-freeform.block-library-rich-text__tinymce .wpview[data-mce-selected] .loading-placeholder,.wp-block-freeform.block-library-rich-text__tinymce .wpview[data-mce-selected] .wpview-error{border-color:#0000}.wp-block-freeform.block-library-rich-text__tinymce .wpview .dashicons{display:block;font-size:32px;height:32px;margin:0 auto;width:32px}.wp-block-freeform.block-library-rich-text__tinymce .wpview.wpview-type-gallery:after{clear:both;content:"";display:table}.wp-block-freeform.block-library-rich-text__tinymce .gallery img[data-mce-selected]:focus{outline:none}.wp-block-freeform.block-library-rich-text__tinymce .gallery a{cursor:default}.wp-block-freeform.block-library-rich-text__tinymce .gallery{line-height:1;margin:auto -6px;overflow-x:hidden;padding:6px 0}.wp-block-freeform.block-library-rich-text__tinymce .gallery .gallery-item{box-sizing:border-box;float:left;margin:0;padding:6px;text-align:center}.wp-block-freeform.block-library-rich-text__tinymce .gallery .gallery-caption,.wp-block-freeform.block-library-rich-text__tinymce .gallery .gallery-icon{margin:0}.wp-block-freeform.block-library-rich-text__tinymce .gallery .gallery-caption{font-size:13px;margin:4px 0}.wp-block-freeform.block-library-rich-text__tinymce .gallery-columns-1 .gallery-item{width:100%}.wp-block-freeform.block-library-rich-text__tinymce .gallery-columns-2 .gallery-item{width:50%}.wp-block-freeform.block-library-rich-text__tinymce .gallery-columns-3 .gallery-item{width:33.3333333333%}.wp-block-freeform.block-library-rich-text__tinymce .gallery-columns-4 .gallery-item{width:25%}.wp-block-freeform.block-library-rich-text__tinymce .gallery-columns-5 .gallery-item{width:20%}.wp-block-freeform.block-library-rich-text__tinymce .gallery-columns-6 .gallery-item{width:16.6666666667%}.wp-block-freeform.block-library-rich-text__tinymce .gallery-columns-7 .gallery-item{width:14.2857142857%}.wp-block-freeform.block-library-rich-text__tinymce .gallery-columns-8 .gallery-item{width:12.5%}.wp-block-freeform.block-library-rich-text__tinymce .gallery-columns-9 .gallery-item{width:11.1111111111%}.wp-block-freeform.block-library-rich-text__tinymce .gallery img{border:none;height:auto;max-width:100%;padding:0}div[data-type="core/freeform"]:before{border:1px solid #ddd;outline:1px solid #0000}@media not (prefers-reduced-motion){div[data-type="core/freeform"]:before{transition:border-color .1s linear,box-shadow .1s linear}}div[data-type="core/freeform"].is-selected:before{border-color:#1e1e1e}div[data-type="core/freeform"] .block-editor-block-contextual-toolbar+div{margin-top:0;padding-top:0}div[data-type="core/freeform"].is-selected .block-library-rich-text__tinymce:after{clear:both;content:"";display:table}.mce-toolbar-grp .mce-btn.mce-active button,.mce-toolbar-grp .mce-btn.mce-active i,.mce-toolbar-grp .mce-btn.mce-active:hover button,.mce-toolbar-grp .mce-btn.mce-active:hover i{color:#1e1e1e}.mce-toolbar-grp .mce-rtl .mce-flow-layout-item.mce-last{margin-left:8px;margin-right:0}.mce-toolbar-grp .mce-btn i{font-style:normal}.block-library-classic__toolbar{border:1px solid #ddd;border-bottom:none;border-radius:2px;display:none;margin:0 0 8px;padding:0;position:sticky;top:0;width:auto;z-index:31}div[data-type="core/freeform"].is-selected .block-library-classic__toolbar{border-color:#1e1e1e;display:block}.block-library-classic__toolbar .mce-tinymce{box-shadow:none}@media (min-width:600px){.block-library-classic__toolbar{padding:0}}.block-library-classic__toolbar:empty{background:#f5f5f5;border-bottom:1px solid #e2e4e7;display:block}.block-library-classic__toolbar:empty:before{color:#555d66;content:attr(data-placeholder);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px;line-height:37px;padding:14px}.block-library-classic__toolbar div.mce-toolbar-grp{border-bottom:1px solid #1e1e1e}.block-library-classic__toolbar .mce-menubar,.block-library-classic__toolbar .mce-menubar>div,.block-library-classic__toolbar .mce-tinymce-inline,.block-library-classic__toolbar .mce-tinymce-inline>div,.block-library-classic__toolbar div.mce-toolbar-grp,.block-library-classic__toolbar div.mce-toolbar-grp>div{height:auto!important;width:100%!important}.block-library-classic__toolbar .mce-container-body.mce-abs-layout{overflow:visible}.block-library-classic__toolbar .mce-menubar,.block-library-classic__toolbar div.mce-toolbar-grp{position:static}.block-library-classic__toolbar .mce-toolbar-grp>div{padding:1px 3px}.block-library-classic__toolbar .mce-toolbar-grp .mce-toolbar:not(:first-child){display:none}.block-library-classic__toolbar.has-advanced-toolbar .mce-toolbar-grp .mce-toolbar{display:block}.block-editor-freeform-modal .block-editor-freeform-modal__content .mce-edit-area iframe{height:50vh!important}@media (min-width:960px){.block-editor-freeform-modal .block-editor-freeform-modal__content:not(.is-full-screen){height:9999rem}.block-editor-freeform-modal .block-editor-freeform-modal__content .components-modal__header+div{height:100%}.block-editor-freeform-modal .block-editor-freeform-modal__content .mce-tinymce{height:calc(100% - 52px)}.block-editor-freeform-modal .block-editor-freeform-modal__content .mce-container-body{display:flex;flex-direction:column;height:100%;min-width:50vw}.block-editor-freeform-modal .block-editor-freeform-modal__content .mce-edit-area{display:flex;flex-direction:column;flex-grow:1}.block-editor-freeform-modal .block-editor-freeform-modal__content .mce-edit-area iframe{flex-grow:1;height:10px!important}}.block-editor-freeform-modal__actions{margin-top:16px} \ No newline at end of file diff --git a/wp-includes/blocks/gallery/editor-rtl.css b/wp-includes/blocks/gallery/editor-rtl.css index 11f8a7d09d..d050e6b5e8 100644 --- a/wp-includes/blocks/gallery/editor-rtl.css +++ b/wp-includes/blocks/gallery/editor-rtl.css @@ -74,9 +74,6 @@ .blocks-gallery-item figure.is-transient img{ opacity:.3; } -.blocks-gallery-item .is-selected .block-library-gallery-item__inline-menu{ - display:inline-flex; -} .blocks-gallery-item .block-editor-media-placeholder{ height:100%; margin:0; @@ -85,49 +82,6 @@ display:flex; } -.block-library-gallery-item__inline-menu{ - background:#fff; - border:1px solid #1e1e1e; - border-radius:2px; - display:none; - margin:8px; - position:absolute; - top:-2px; - transition:box-shadow .2s ease-out; - z-index:20; -} -@media (prefers-reduced-motion:reduce){ - .block-library-gallery-item__inline-menu{ - transition-delay:0s; - transition-duration:0s; - } -} -.block-library-gallery-item__inline-menu:hover{ - box-shadow:0 1px 1px #00000008,0 1px 2px #00000005,0 3px 3px #00000005,0 4px 4px #00000003; -} -@media (min-width:600px){ - .columns-7 .block-library-gallery-item__inline-menu,.columns-8 .block-library-gallery-item__inline-menu{ - padding:2px; - } -} -.block-library-gallery-item__inline-menu .components-button.has-icon:not(:focus){ - border:none; - box-shadow:none; -} -@media (min-width:600px){ - .columns-7 .block-library-gallery-item__inline-menu .components-button.has-icon,.columns-8 .block-library-gallery-item__inline-menu .components-button.has-icon{ - height:inherit; - padding:0; - width:inherit; - } -} -.block-library-gallery-item__inline-menu.is-left{ - right:-2px; -} -.block-library-gallery-item__inline-menu.is-right{ - left:-2px; -} - .wp-block-gallery ul.blocks-gallery-grid{ margin:0; padding:0; diff --git a/wp-includes/blocks/gallery/editor-rtl.min.css b/wp-includes/blocks/gallery/editor-rtl.min.css index a5f2381333..016ff8e478 100644 --- a/wp-includes/blocks/gallery/editor-rtl.min.css +++ b/wp-includes/blocks/gallery/editor-rtl.min.css @@ -1 +1 @@ -:root :where(figure.wp-block-gallery){display:block}:root :where(figure.wp-block-gallery)>.blocks-gallery-caption{flex:0 0 100%}:root :where(figure.wp-block-gallery)>.blocks-gallery-media-placeholder-wrapper{flex-basis:100%}:root :where(figure.wp-block-gallery) .wp-block-image .components-notice.is-error{display:block}:root :where(figure.wp-block-gallery) .wp-block-image .components-notice__content{margin:4px 0}:root :where(figure.wp-block-gallery) .wp-block-image .components-notice__dismiss{left:5px;position:absolute;top:0}:root :where(figure.wp-block-gallery) .block-editor-media-placeholder.is-appender .components-placeholder__label{display:none}:root :where(figure.wp-block-gallery) .block-editor-media-placeholder.is-appender .block-editor-media-placeholder__button{margin-bottom:0}:root :where(figure.wp-block-gallery) .block-editor-media-placeholder{margin:0}:root :where(figure.wp-block-gallery) .block-editor-media-placeholder .components-placeholder__label{display:flex}:root :where(figure.wp-block-gallery) .block-editor-media-placeholder figcaption{z-index:2}:root :where(figure.wp-block-gallery) .components-spinner{margin-right:-9px;margin-top:-9px;position:absolute;right:50%;top:50%}.gallery-settings-buttons .components-button:first-child{margin-left:8px}.gallery-image-sizes .components-base-control__label{margin-bottom:4px}.gallery-image-sizes .gallery-image-sizes__loading{align-items:center;color:#757575;display:flex;font-size:12px}.gallery-image-sizes .components-spinner{margin:0 4px 0 8px}.blocks-gallery-item figure:not(.is-selected):focus,.blocks-gallery-item img:focus{outline:none}.blocks-gallery-item figure.is-selected:before{bottom:0;box-shadow:0 0 0 1px #fff inset,0 0 0 3px var(--wp-admin-theme-color) inset;content:"";left:0;outline:2px solid #0000;pointer-events:none;position:absolute;right:0;top:0;z-index:1}.blocks-gallery-item figure.is-transient img{opacity:.3}.blocks-gallery-item .is-selected .block-library-gallery-item__inline-menu{display:inline-flex}.blocks-gallery-item .block-editor-media-placeholder{height:100%;margin:0}.blocks-gallery-item .block-editor-media-placeholder .components-placeholder__label{display:flex}.block-library-gallery-item__inline-menu{background:#fff;border:1px solid #1e1e1e;border-radius:2px;display:none;margin:8px;position:absolute;top:-2px;transition:box-shadow .2s ease-out;z-index:20}@media (prefers-reduced-motion:reduce){.block-library-gallery-item__inline-menu{transition-delay:0s;transition-duration:0s}}.block-library-gallery-item__inline-menu:hover{box-shadow:0 1px 1px #00000008,0 1px 2px #00000005,0 3px 3px #00000005,0 4px 4px #00000003}@media (min-width:600px){.columns-7 .block-library-gallery-item__inline-menu,.columns-8 .block-library-gallery-item__inline-menu{padding:2px}}.block-library-gallery-item__inline-menu .components-button.has-icon:not(:focus){border:none;box-shadow:none}@media (min-width:600px){.columns-7 .block-library-gallery-item__inline-menu .components-button.has-icon,.columns-8 .block-library-gallery-item__inline-menu .components-button.has-icon{height:inherit;padding:0;width:inherit}}.block-library-gallery-item__inline-menu.is-left{right:-2px}.block-library-gallery-item__inline-menu.is-right{left:-2px}.wp-block-gallery ul.blocks-gallery-grid{margin:0;padding:0}@media (min-width:600px){.wp-block-update-gallery-modal{max-width:480px}}.wp-block-update-gallery-modal-buttons{display:flex;gap:12px;justify-content:flex-end} \ No newline at end of file +:root :where(figure.wp-block-gallery){display:block}:root :where(figure.wp-block-gallery)>.blocks-gallery-caption{flex:0 0 100%}:root :where(figure.wp-block-gallery)>.blocks-gallery-media-placeholder-wrapper{flex-basis:100%}:root :where(figure.wp-block-gallery) .wp-block-image .components-notice.is-error{display:block}:root :where(figure.wp-block-gallery) .wp-block-image .components-notice__content{margin:4px 0}:root :where(figure.wp-block-gallery) .wp-block-image .components-notice__dismiss{left:5px;position:absolute;top:0}:root :where(figure.wp-block-gallery) .block-editor-media-placeholder.is-appender .components-placeholder__label{display:none}:root :where(figure.wp-block-gallery) .block-editor-media-placeholder.is-appender .block-editor-media-placeholder__button{margin-bottom:0}:root :where(figure.wp-block-gallery) .block-editor-media-placeholder{margin:0}:root :where(figure.wp-block-gallery) .block-editor-media-placeholder .components-placeholder__label{display:flex}:root :where(figure.wp-block-gallery) .block-editor-media-placeholder figcaption{z-index:2}:root :where(figure.wp-block-gallery) .components-spinner{margin-right:-9px;margin-top:-9px;position:absolute;right:50%;top:50%}.gallery-settings-buttons .components-button:first-child{margin-left:8px}.gallery-image-sizes .components-base-control__label{margin-bottom:4px}.gallery-image-sizes .gallery-image-sizes__loading{align-items:center;color:#757575;display:flex;font-size:12px}.gallery-image-sizes .components-spinner{margin:0 4px 0 8px}.blocks-gallery-item figure:not(.is-selected):focus,.blocks-gallery-item img:focus{outline:none}.blocks-gallery-item figure.is-selected:before{bottom:0;box-shadow:0 0 0 1px #fff inset,0 0 0 3px var(--wp-admin-theme-color) inset;content:"";left:0;outline:2px solid #0000;pointer-events:none;position:absolute;right:0;top:0;z-index:1}.blocks-gallery-item figure.is-transient img{opacity:.3}.blocks-gallery-item .block-editor-media-placeholder{height:100%;margin:0}.blocks-gallery-item .block-editor-media-placeholder .components-placeholder__label{display:flex}.wp-block-gallery ul.blocks-gallery-grid{margin:0;padding:0}@media (min-width:600px){.wp-block-update-gallery-modal{max-width:480px}}.wp-block-update-gallery-modal-buttons{display:flex;gap:12px;justify-content:flex-end} \ No newline at end of file diff --git a/wp-includes/blocks/gallery/editor.css b/wp-includes/blocks/gallery/editor.css index 5d1aec6079..3bd8c02b61 100644 --- a/wp-includes/blocks/gallery/editor.css +++ b/wp-includes/blocks/gallery/editor.css @@ -74,9 +74,6 @@ .blocks-gallery-item figure.is-transient img{ opacity:.3; } -.blocks-gallery-item .is-selected .block-library-gallery-item__inline-menu{ - display:inline-flex; -} .blocks-gallery-item .block-editor-media-placeholder{ height:100%; margin:0; @@ -85,49 +82,6 @@ display:flex; } -.block-library-gallery-item__inline-menu{ - background:#fff; - border:1px solid #1e1e1e; - border-radius:2px; - display:none; - margin:8px; - position:absolute; - top:-2px; - transition:box-shadow .2s ease-out; - z-index:20; -} -@media (prefers-reduced-motion:reduce){ - .block-library-gallery-item__inline-menu{ - transition-delay:0s; - transition-duration:0s; - } -} -.block-library-gallery-item__inline-menu:hover{ - box-shadow:0 1px 1px #00000008,0 1px 2px #00000005,0 3px 3px #00000005,0 4px 4px #00000003; -} -@media (min-width:600px){ - .columns-7 .block-library-gallery-item__inline-menu,.columns-8 .block-library-gallery-item__inline-menu{ - padding:2px; - } -} -.block-library-gallery-item__inline-menu .components-button.has-icon:not(:focus){ - border:none; - box-shadow:none; -} -@media (min-width:600px){ - .columns-7 .block-library-gallery-item__inline-menu .components-button.has-icon,.columns-8 .block-library-gallery-item__inline-menu .components-button.has-icon{ - height:inherit; - padding:0; - width:inherit; - } -} -.block-library-gallery-item__inline-menu.is-left{ - left:-2px; -} -.block-library-gallery-item__inline-menu.is-right{ - right:-2px; -} - .wp-block-gallery ul.blocks-gallery-grid{ margin:0; padding:0; diff --git a/wp-includes/blocks/gallery/editor.min.css b/wp-includes/blocks/gallery/editor.min.css index 60c4dc6410..55fef45be9 100644 --- a/wp-includes/blocks/gallery/editor.min.css +++ b/wp-includes/blocks/gallery/editor.min.css @@ -1 +1 @@ -:root :where(figure.wp-block-gallery){display:block}:root :where(figure.wp-block-gallery)>.blocks-gallery-caption{flex:0 0 100%}:root :where(figure.wp-block-gallery)>.blocks-gallery-media-placeholder-wrapper{flex-basis:100%}:root :where(figure.wp-block-gallery) .wp-block-image .components-notice.is-error{display:block}:root :where(figure.wp-block-gallery) .wp-block-image .components-notice__content{margin:4px 0}:root :where(figure.wp-block-gallery) .wp-block-image .components-notice__dismiss{position:absolute;right:5px;top:0}:root :where(figure.wp-block-gallery) .block-editor-media-placeholder.is-appender .components-placeholder__label{display:none}:root :where(figure.wp-block-gallery) .block-editor-media-placeholder.is-appender .block-editor-media-placeholder__button{margin-bottom:0}:root :where(figure.wp-block-gallery) .block-editor-media-placeholder{margin:0}:root :where(figure.wp-block-gallery) .block-editor-media-placeholder .components-placeholder__label{display:flex}:root :where(figure.wp-block-gallery) .block-editor-media-placeholder figcaption{z-index:2}:root :where(figure.wp-block-gallery) .components-spinner{left:50%;margin-left:-9px;margin-top:-9px;position:absolute;top:50%}.gallery-settings-buttons .components-button:first-child{margin-right:8px}.gallery-image-sizes .components-base-control__label{margin-bottom:4px}.gallery-image-sizes .gallery-image-sizes__loading{align-items:center;color:#757575;display:flex;font-size:12px}.gallery-image-sizes .components-spinner{margin:0 8px 0 4px}.blocks-gallery-item figure:not(.is-selected):focus,.blocks-gallery-item img:focus{outline:none}.blocks-gallery-item figure.is-selected:before{bottom:0;box-shadow:0 0 0 1px #fff inset,0 0 0 3px var(--wp-admin-theme-color) inset;content:"";left:0;outline:2px solid #0000;pointer-events:none;position:absolute;right:0;top:0;z-index:1}.blocks-gallery-item figure.is-transient img{opacity:.3}.blocks-gallery-item .is-selected .block-library-gallery-item__inline-menu{display:inline-flex}.blocks-gallery-item .block-editor-media-placeholder{height:100%;margin:0}.blocks-gallery-item .block-editor-media-placeholder .components-placeholder__label{display:flex}.block-library-gallery-item__inline-menu{background:#fff;border:1px solid #1e1e1e;border-radius:2px;display:none;margin:8px;position:absolute;top:-2px;transition:box-shadow .2s ease-out;z-index:20}@media (prefers-reduced-motion:reduce){.block-library-gallery-item__inline-menu{transition-delay:0s;transition-duration:0s}}.block-library-gallery-item__inline-menu:hover{box-shadow:0 1px 1px #00000008,0 1px 2px #00000005,0 3px 3px #00000005,0 4px 4px #00000003}@media (min-width:600px){.columns-7 .block-library-gallery-item__inline-menu,.columns-8 .block-library-gallery-item__inline-menu{padding:2px}}.block-library-gallery-item__inline-menu .components-button.has-icon:not(:focus){border:none;box-shadow:none}@media (min-width:600px){.columns-7 .block-library-gallery-item__inline-menu .components-button.has-icon,.columns-8 .block-library-gallery-item__inline-menu .components-button.has-icon{height:inherit;padding:0;width:inherit}}.block-library-gallery-item__inline-menu.is-left{left:-2px}.block-library-gallery-item__inline-menu.is-right{right:-2px}.wp-block-gallery ul.blocks-gallery-grid{margin:0;padding:0}@media (min-width:600px){.wp-block-update-gallery-modal{max-width:480px}}.wp-block-update-gallery-modal-buttons{display:flex;gap:12px;justify-content:flex-end} \ No newline at end of file +:root :where(figure.wp-block-gallery){display:block}:root :where(figure.wp-block-gallery)>.blocks-gallery-caption{flex:0 0 100%}:root :where(figure.wp-block-gallery)>.blocks-gallery-media-placeholder-wrapper{flex-basis:100%}:root :where(figure.wp-block-gallery) .wp-block-image .components-notice.is-error{display:block}:root :where(figure.wp-block-gallery) .wp-block-image .components-notice__content{margin:4px 0}:root :where(figure.wp-block-gallery) .wp-block-image .components-notice__dismiss{position:absolute;right:5px;top:0}:root :where(figure.wp-block-gallery) .block-editor-media-placeholder.is-appender .components-placeholder__label{display:none}:root :where(figure.wp-block-gallery) .block-editor-media-placeholder.is-appender .block-editor-media-placeholder__button{margin-bottom:0}:root :where(figure.wp-block-gallery) .block-editor-media-placeholder{margin:0}:root :where(figure.wp-block-gallery) .block-editor-media-placeholder .components-placeholder__label{display:flex}:root :where(figure.wp-block-gallery) .block-editor-media-placeholder figcaption{z-index:2}:root :where(figure.wp-block-gallery) .components-spinner{left:50%;margin-left:-9px;margin-top:-9px;position:absolute;top:50%}.gallery-settings-buttons .components-button:first-child{margin-right:8px}.gallery-image-sizes .components-base-control__label{margin-bottom:4px}.gallery-image-sizes .gallery-image-sizes__loading{align-items:center;color:#757575;display:flex;font-size:12px}.gallery-image-sizes .components-spinner{margin:0 8px 0 4px}.blocks-gallery-item figure:not(.is-selected):focus,.blocks-gallery-item img:focus{outline:none}.blocks-gallery-item figure.is-selected:before{bottom:0;box-shadow:0 0 0 1px #fff inset,0 0 0 3px var(--wp-admin-theme-color) inset;content:"";left:0;outline:2px solid #0000;pointer-events:none;position:absolute;right:0;top:0;z-index:1}.blocks-gallery-item figure.is-transient img{opacity:.3}.blocks-gallery-item .block-editor-media-placeholder{height:100%;margin:0}.blocks-gallery-item .block-editor-media-placeholder .components-placeholder__label{display:flex}.wp-block-gallery ul.blocks-gallery-grid{margin:0;padding:0}@media (min-width:600px){.wp-block-update-gallery-modal{max-width:480px}}.wp-block-update-gallery-modal-buttons{display:flex;gap:12px;justify-content:flex-end} \ No newline at end of file diff --git a/wp-includes/blocks/heading/block.json b/wp-includes/blocks/heading/block.json index 2276bcbbb5..2869ee85c5 100644 --- a/wp-includes/blocks/heading/block.json +++ b/wp-includes/blocks/heading/block.json @@ -37,13 +37,7 @@ "color": true, "radius": true, "style": true, - "width": true, - "__experimentalDefaultControls": { - "color": true, - "radius": true, - "style": true, - "width": true - } + "width": true }, "color": { "gradients": true, diff --git a/wp-includes/blocks/home-link.php b/wp-includes/blocks/home-link.php index fb72358344..d61aa0bc23 100644 --- a/wp-includes/blocks/home-link.php +++ b/wp-includes/blocks/home-link.php @@ -137,9 +137,6 @@ function block_core_home_link_build_li_wrapper_attributes( $context ) { */ function render_block_core_home_link( $attributes, $content, $block ) { if ( empty( $attributes['label'] ) ) { - // Using a fallback for the label attribute allows rendering the block even if no attributes have been set, - // e.g. when using the block as a hooked block. - // Note that the fallback value needs to be kept in sync with the one set in `edit.js` (upon first loading the block in the editor). $attributes['label'] = __( 'Home' ); } $aria_current = ''; diff --git a/wp-includes/blocks/image.php b/wp-includes/blocks/image.php index 1a5fae7ce9..697f67a927 100644 --- a/wp-includes/blocks/image.php +++ b/wp-includes/blocks/image.php @@ -149,18 +149,14 @@ function block_core_image_render_lightbox( $block_content, $block ) { return $block_content; } - $alt = $p->get_attribute( 'alt' ); - $img_uploaded_src = $p->get_attribute( 'src' ); - $img_class_names = $p->get_attribute( 'class' ); - $img_styles = $p->get_attribute( 'style' ); - $img_width = 'none'; - $img_height = 'none'; - $aria_label = __( 'Enlarge image' ); - - if ( $alt ) { - /* translators: %s: Image alt text. */ - $aria_label = sprintf( __( 'Enlarge image: %s' ), $alt ); - } + $alt = $p->get_attribute( 'alt' ); + $img_uploaded_src = $p->get_attribute( 'src' ); + $img_class_names = $p->get_attribute( 'class' ); + $img_styles = $p->get_attribute( 'style' ); + $img_width = 'none'; + $img_height = 'none'; + $aria_label = __( 'Enlarge' ); + $dialog_aria_label = __( 'Enlarged image' ); if ( isset( $block['attrs']['id'] ) ) { $img_uploaded_src = wp_get_attachment_url( $block['attrs']['id'] ); @@ -190,7 +186,7 @@ function block_core_image_render_lightbox( $block_content, $block ) { 'targetWidth' => $img_width, 'targetHeight' => $img_height, 'scaleAttr' => $block['attrs']['scale'] ?? false, - 'ariaLabel' => $aria_label, + 'ariaLabel' => $dialog_aria_label, 'alt' => $alt, ), ), @@ -290,6 +286,7 @@ function block_core_image_print_lightbox_overlay() { data-wp-on-async--click="actions.hideLightbox" data-wp-on-async-window--resize="callbacks.setOverlayStyles" data-wp-on-async-window--scroll="actions.handleScroll" + data-wp-bind--style="state.overlayStyles" tabindex="-1" > '; $html .= '' . block_core_navigation_submenu_render_submenu_icon() . ''; @@ -222,7 +255,7 @@ function render_block_core_navigation_submenu( $attributes, $content, $block ) { if ( strpos( $inner_blocks_html, 'current-menu-item' ) ) { $tag_processor = new WP_HTML_Tag_Processor( $html ); - while ( $tag_processor->next_tag( array( 'class_name' => 'wp-block-navigation-item__content' ) ) ) { + while ( $tag_processor->next_tag( array( 'class_name' => 'wp-block-navigation-item' ) ) ) { $tag_processor->add_class( 'current-menu-ancestor' ); } $html = $tag_processor->get_updated_html(); diff --git a/wp-includes/blocks/navigation.php b/wp-includes/blocks/navigation.php index fa9bb5a56f..43ca833153 100644 --- a/wp-includes/blocks/navigation.php +++ b/wp-includes/blocks/navigation.php @@ -344,6 +344,10 @@ class WP_Navigation_Block_Renderer { $navigation_name = $attributes['ariaLabel'] ?? ''; + if ( ! empty( $navigation_name ) ) { + return $navigation_name; + } + // Load the navigation post. if ( array_key_exists( 'ref', $attributes ) ) { $navigation_post = get_post( $attributes['ref'] ); @@ -535,8 +539,8 @@ class WP_Navigation_Block_Renderer { $inner_blocks_html, $toggle_aria_label_open, $toggle_aria_label_close, - esc_attr( implode( ' ', $responsive_container_classes ) ), - esc_attr( implode( ' ', $open_button_classes ) ), + esc_attr( trim( implode( ' ', $responsive_container_classes ) ) ), + esc_attr( trim( implode( ' ', $open_button_classes ) ) ), ( ! empty( $overlay_inline_styles ) ) ? "style=\"$overlay_inline_styles\"" : '', $toggle_button_content, $toggle_close_button_content, @@ -563,13 +567,14 @@ class WP_Navigation_Block_Renderer { $is_responsive_menu = static::is_responsive( $attributes ); $style = static::get_styles( $attributes ); $class = static::get_classes( $attributes ); - $wrapper_attributes = get_block_wrapper_attributes( - array( - 'class' => $class, - 'style' => $style, - 'aria-label' => $nav_menu_name, - ) + $extra_attributes = array( + 'class' => $class, + 'style' => $style, ); + if ( ! empty( $nav_menu_name ) ) { + $extra_attributes['aria-label'] = $nav_menu_name; + } + $wrapper_attributes = get_block_wrapper_attributes( $extra_attributes ); if ( $is_responsive_menu ) { $nav_element_directives = static::get_nav_element_directives( $is_interactive ); @@ -813,7 +818,7 @@ function block_core_navigation_add_directives_to_submenu( $tags, $block_attribut ) ) { // Add directives to the parent `
  • `. $tags->set_attribute( 'data-wp-interactive', 'core/navigation' ); - $tags->set_attribute( 'data-wp-context', '{ "submenuOpenedBy": { "click": false, "hover": false, "focus": false }, "type": "submenu" }' ); + $tags->set_attribute( 'data-wp-context', '{ "submenuOpenedBy": { "click": false, "hover": false, "focus": false }, "type": "submenu", "modal": null }' ); $tags->set_attribute( 'data-wp-watch', 'callbacks.initMenu' ); $tags->set_attribute( 'data-wp-on--focusout', 'actions.handleMenuFocusout' ); $tags->set_attribute( 'data-wp-on--keydown', 'actions.handleMenuKeydown' ); @@ -1432,20 +1437,6 @@ function block_core_navigation_get_most_recently_published_navigation() { return null; } -/** - * Accepts the serialized markup of a block and its inner blocks, and returns serialized markup of the inner blocks. - * - * @since 6.5.0 - * - * @param string $serialized_block The serialized markup of a block and its inner blocks. - * @return string - */ -function block_core_navigation_remove_serialized_parent_block( $serialized_block ) { - $start = strpos( $serialized_block, '-->' ) + strlen( '-->' ); - $end = strrpos( $serialized_block, ').)*)?}\s+)?-->/.exec(f);return e?.groups?.attrs&&JSON.parse(e.groups.attrs)?.id}),[b,h,f]),{media:k,postType:w,postPermalink:C}=(0,gt.useSelect)((e=>{const{getMedia:t,getPostType:o,getEditedEntityRecord:a}=e(mt.store);return{media:v&&t(v,{context:"view"}),postType:r&&o(r),postPermalink:a("postType",r,n)?.link}}),[v,r,n]),j=function(e,t){return e?.media_details?.sizes?.[t]?.source_url||e?.source_url}(k,p),S=(0,ot.useBlockProps)({style:{width:u,height:c,aspectRatio:l},className:dt({"is-transient":x})}),B=(0,ot.__experimentalUseBorderProps)(t),T=(0,ot.__experimentalGetShadowClassesAndStyles)(t),N=(0,ot.useBlockEditingMode)(),I=e=>(0,Ye.jsx)(et.Placeholder,{className:dt("block-editor-media-placeholder",B.className),withIllustration:!0,style:{height:!!l&&"100%",width:!!l&&"100%",...B.style,...T.style},children:e}),P=e=>{e?.id&&y(e.id),e?.url&&(0,It.isBlobURL)(e.url)&&_(e.url)};(0,_t.useEffect)((()=>{j&&x&&_()}),[j,x]);const{createErrorNotice:M}=(0,gt.useDispatch)(Pt.store),z=e=>{M(e,{type:"snackbar"}),_()},D="default"===N&&(0,Ye.jsxs)(Ye.Fragment,{children:[(0,Ye.jsx)(ot.InspectorControls,{group:"color",children:(0,Ye.jsx)(Db,{attributes:t,setAttributes:o,clientId:e})}),(0,Ye.jsx)(ot.InspectorControls,{group:"dimensions",children:(0,Ye.jsx)(zb,{clientId:e,attributes:t,setAttributes:o,media:k})}),(0,Ye.jsx)(ot.InspectorControls,{children:(0,Ye.jsxs)(et.PanelBody,{title:(0,tt.__)("Settings"),children:[(0,Ye.jsx)(et.ToggleControl,{__nextHasNoMarginBottom:!0,label:w?.labels.singular_name?(0,tt.sprintf)((0,tt.__)("Link to %s"),w.labels.singular_name):(0,tt.__)("Link to post"),onChange:()=>o({isLink:!s}),checked:s}),s&&(0,Ye.jsxs)(Ye.Fragment,{children:[(0,Ye.jsx)(et.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Open in new tab"),onChange:e=>o({linkTarget:e?"_blank":"_self"}),checked:"_blank"===g}),(0,Ye.jsx)(et.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,tt.__)("Link rel"),value:m,onChange:e=>o({rel:e})})]})]})})]});let A;if(!v&&(i||!n))return(0,Ye.jsxs)(Ye.Fragment,{children:[D,(0,Ye.jsxs)("div",{...S,children:[s?(0,Ye.jsx)("a",{href:C,target:g,...Hb,children:I()}):I(),(0,Ye.jsx)(Ab,{attributes:t,setAttributes:o,clientId:e})]})]});const R=(0,tt.__)("Add a featured image"),H={...B.style,...T.style,height:l?"100%":c,width:!!l&&"100%",objectFit:!(!c&&!l)&&d};return A=v||x?k||x?(0,Ye.jsxs)(Ye.Fragment,{children:[(0,Ye.jsx)("img",{className:B.className,src:x||j,alt:k&&k?.alt_text?(0,tt.sprintf)((0,tt.__)("Featured image: %s"),k.alt_text):(0,tt.__)("Featured image"),style:H}),x&&(0,Ye.jsx)(et.Spinner,{})]}):I():(0,Ye.jsx)(ot.MediaPlaceholder,{onSelect:P,accept:"image/*",allowedTypes:Rb,onError:z,placeholder:I,mediaLibraryButton:({open:e})=>(0,Ye.jsx)(et.Button,{__next40pxDefaultSize:!0,icon:$d,variant:"primary",label:R,showTooltip:!0,tooltipPosition:"top center",onClick:()=>{e()}})}),(0,Ye.jsxs)(Ye.Fragment,{children:[!x&&D,!!k&&!i&&(0,Ye.jsx)(ot.BlockControls,{group:"other",children:(0,Ye.jsx)(ot.MediaReplaceFlow,{mediaId:v,mediaURL:j,allowedTypes:Rb,accept:"image/*",onSelect:P,onError:z,onReset:()=>y(0)})}),(0,Ye.jsxs)("figure",{...S,children:[s?(0,Ye.jsx)("a",{href:C,target:g,...Hb,children:A}):A,(0,Ye.jsx)(Ab,{attributes:t,setAttributes:o,clientId:e})]})]})}},Eb=()=>Xe({name:Fb,metadata:Lb,settings:Vb});const Ob=(0,Ye.jsx)(Ke.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Ye.jsx)(Ke.Path,{d:"M6.6 6L5.4 7l4.5 5-4.5 5 1.1 1 5.5-6-5.4-6zm6 0l-1.1 1 4.5 5-4.5 5 1.1 1 5.5-6-5.5-6z"})}),$b=(0,Ye.jsx)(Ke.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Ye.jsx)(Ke.Path,{d:"M11.6 7l-1.1-1L5 12l5.5 6 1.1-1L7 12l4.6-5zm6 0l-1.1-1-5.5 6 5.5 6 1.1-1-4.6-5 4.6-5z"})}),Gb=[{isDefault:!0,name:"post-next",title:(0,tt.__)("Next post"),description:(0,tt.__)("Displays the post link that follows the current post."),icon:Ob,attributes:{type:"next"},scope:["inserter","transform"]},{name:"post-previous",title:(0,tt.__)("Previous post"),description:(0,tt.__)("Displays the post link that precedes the current post."),icon:$b,attributes:{type:"previous"},scope:["inserter","transform"]}];Gb.forEach((e=>{e.isActive||(e.isActive=(e,t)=>e.type===t.type)}));const Ub=Gb,qb={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/post-navigation-link",title:"Post Navigation Link",category:"theme",description:"Displays the next or previous post link that is adjacent to the current post.",textdomain:"default",attributes:{textAlign:{type:"string"},type:{type:"string",default:"next"},label:{type:"string"},showTitle:{type:"boolean",default:!1},linkLabel:{type:"boolean",default:!1},arrow:{type:"string",default:"none"},taxonomy:{type:"string",default:""}},usesContext:["postType"],supports:{reusable:!1,html:!1,color:{link:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalWritingMode:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0}},style:"wp-block-post-navigation-link"},{name:Wb}=qb,Zb={edit:function({context:{postType:e},attributes:{type:t,label:o,showTitle:n,textAlign:r,linkLabel:a,arrow:i,taxonomy:s},setAttributes:l}){const c="next"===t;let u=c?(0,tt.__)("Next"):(0,tt.__)("Previous");const d={none:"",arrow:c?"→":"←",chevron:c?"»":"«"}[i];n&&(u=c?(0,tt.__)("Next: "):(0,tt.__)("Previous: "));const p=c?(0,tt.__)("Next post"):(0,tt.__)("Previous post"),m=(0,ot.useBlockProps)({className:dt({[`has-text-align-${r}`]:r})}),g=(0,gt.useSelect)((t=>{const{getTaxonomies:o}=t(mt.store);return o({type:e,per_page:-1})}),[e]);return(0,Ye.jsxs)(Ye.Fragment,{children:[(0,Ye.jsx)(ot.InspectorControls,{children:(0,Ye.jsxs)(et.PanelBody,{children:[(0,Ye.jsx)(et.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Display the title as a link"),help:(0,tt.__)("If you have entered a custom label, it will be prepended before the title."),checked:!!n,onChange:()=>l({showTitle:!n})}),n&&(0,Ye.jsx)(et.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Include the label as part of the link"),checked:!!a,onChange:()=>l({linkLabel:!a})}),(0,Ye.jsxs)(et.__experimentalToggleGroupControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,tt.__)("Arrow"),value:i,onChange:e=>{l({arrow:e})},help:(0,tt.__)("A decorative arrow for the next and previous link."),isBlock:!0,children:[(0,Ye.jsx)(et.__experimentalToggleGroupControlOption,{value:"none",label:(0,tt._x)("None","Arrow option for Next/Previous link")}),(0,Ye.jsx)(et.__experimentalToggleGroupControlOption,{value:"arrow",label:(0,tt._x)("Arrow","Arrow option for Next/Previous link")}),(0,Ye.jsx)(et.__experimentalToggleGroupControlOption,{value:"chevron",label:(0,tt._x)("Chevron","Arrow option for Next/Previous link")})]})]})}),(0,Ye.jsx)(ot.InspectorControls,{group:"advanced",children:(0,Ye.jsx)(et.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,tt.__)("Filter by taxonomy"),value:s,options:[{label:(0,tt.__)("Unfiltered"),value:""},...(null!=g?g:[]).filter((({visibility:e})=>!!e?.publicly_queryable)).map((e=>({value:e.slug,label:e.name})))],onChange:e=>l({taxonomy:e}),help:(0,tt.__)("Only link to posts that have the same taxonomy terms as the current post. For example the same tags or categories.")})}),(0,Ye.jsx)(ot.BlockControls,{children:(0,Ye.jsx)(ot.AlignmentToolbar,{value:r,onChange:e=>{l({textAlign:e})}})}),(0,Ye.jsxs)("div",{...m,children:[!c&&d&&(0,Ye.jsx)("span",{className:`wp-block-post-navigation-link__arrow-previous is-arrow-${i}`,children:d}),(0,Ye.jsx)(ot.RichText,{tagName:"a",identifier:"label","aria-label":p,placeholder:u,value:o,allowedFormats:["core/bold","core/italic"],onChange:e=>l({label:e})}),n&&(0,Ye.jsx)("a",{href:"#post-navigation-pseudo-link",onClick:e=>e.preventDefault(),children:(0,tt.__)("An example title")}),c&&d&&(0,Ye.jsx)("span",{className:`wp-block-post-navigation-link__arrow-next is-arrow-${i}`,"aria-hidden":!0,children:d})]})]})},variations:Ub},Qb=()=>Xe({name:Wb,metadata:qb,settings:Zb}),Kb=[["core/post-title"],["core/post-date"],["core/post-excerpt"]];function Yb({classList:e}){const t=(0,ot.useInnerBlocksProps)({className:dt("wp-block-post",e)},{template:Kb,__unstableDisableLayoutClassNames:!0});return(0,Ye.jsx)("li",{...t})}const Jb=(0,_t.memo)((function({blocks:e,blockContextId:t,classList:o,isHidden:n,setActiveBlockContextId:r}){const a=(0,ot.__experimentalUseBlockPreview)({blocks:e,props:{className:dt("wp-block-post",o)}}),i=()=>{r(t)},s={display:n?"none":void 0};return(0,Ye.jsx)("li",{...a,tabIndex:0,role:"button",onClick:i,onKeyPress:i,style:s})}));const Xb={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/post-template",title:"Post Template",category:"theme",parent:["core/query"],description:"Contains the block elements used to render a post, like the title, date, featured image, content or excerpt, and more.",textdomain:"default",usesContext:["queryId","query","displayLayout","templateSlug","previewPostType","enhancedPagination"],supports:{reusable:!1,html:!1,align:["wide","full"],layout:!0,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},spacing:{blockGap:{__experimentalDefault:"1.25em"},__experimentalDefaultControls:{blockGap:!0}},interactivity:{clientNavigation:!0}},style:"wp-block-post-template",editorStyle:"wp-block-post-template-editor"},{name:ey}=Xb,ty={icon:Kr,edit:function({setAttributes:e,clientId:t,context:{query:{perPage:o,offset:n=0,postType:r,order:a,orderBy:i,author:s,search:l,exclude:c,sticky:u,inherit:d,taxQuery:p,parents:m,pages:g,format:h,...x}={},templateSlug:_,previewPostType:b},attributes:{layout:y},__unstableLayoutClassNames:f}){const{type:v,columnCount:k=3}=y||{},[w,C]=(0,_t.useState)(),{posts:j,blocks:S}=(0,gt.useSelect)((e=>{const{getEntityRecords:g,getTaxonomies:y}=e(mt.store),{getBlocks:f}=e(ot.store),v=d&&_?.startsWith("category-")&&g("taxonomy","category",{context:"view",per_page:1,_fields:["id"],slug:_.replace("category-","")}),k={offset:n||0,order:a,orderby:i};if(p&&!d){const e=y({type:r,per_page:-1,context:"view"}),t=Object.entries(p).reduce(((t,[o,n])=>{const r=e?.find((({slug:e})=>e===o));return r?.rest_base&&(t[r?.rest_base]=n),t}),{});Object.keys(t).length&&Object.assign(k,t)}o&&(k.per_page=o),s&&(k.author=s),l&&(k.search=l),c?.length&&(k.exclude=c),m?.length&&(k.parent=m),h?.length&&(k.format=h),u&&(k.sticky="only"===u),d&&(_?.startsWith("archive-")?(k.postType=_.replace("archive-",""),r=k.postType):v&&(k.categories=v[0]?.id));return{posts:g("postType",b||r,{...k,...x}),blocks:f(t)}}),[o,n,a,i,t,s,l,r,c,u,d,_,p,m,h,x,b]),B=(0,_t.useMemo)((()=>j?.map((e=>{var t;return{postType:e.type,postId:e.id,classList:null!==(t=e.class_list)&&void 0!==t?t:""}}))),[j]),T=(0,ot.useBlockProps)({className:dt(f,{[`columns-${k}`]:"grid"===v&&k})});if(!j)return(0,Ye.jsx)("p",{...T,children:(0,Ye.jsx)(et.Spinner,{})});if(!j.length)return(0,Ye.jsxs)("p",{...T,children:[" ",(0,tt.__)("No results found.")]});const N=t=>e({layout:{...y,...t}}),I=[{icon:bp,title:(0,tt._x)("List view","Post template block display setting"),onClick:()=>N({type:"default"}),isActive:"default"===v||"constrained"===v},{icon:Vu,title:(0,tt._x)("Grid view","Post template block display setting"),onClick:()=>N({type:"grid",columnCount:k}),isActive:"grid"===v}];return(0,Ye.jsxs)(Ye.Fragment,{children:[(0,Ye.jsx)(ot.BlockControls,{children:(0,Ye.jsx)(et.ToolbarGroup,{controls:I})}),(0,Ye.jsx)("ul",{...T,children:B&&B.map((e=>(0,Ye.jsxs)(ot.BlockContextProvider,{value:e,children:[e.postId===(w||B[0]?.postId)?(0,Ye.jsx)(Yb,{classList:e.classList}):null,(0,Ye.jsx)(Jb,{blocks:S,blockContextId:e.postId,classList:e.classList,setActiveBlockContextId:C,isHidden:e.postId===(w||B[0]?.postId)})]},e.postId)))})]})},save:function(){return(0,Ye.jsx)(ot.InnerBlocks.Content,{})}},oy=()=>Xe({name:ey,metadata:Xb,settings:ty}),ny=(0,Ye.jsx)(Ke.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Ye.jsx)(Ke.Path,{d:"M20 4H4v1.5h16V4zm-2 9h-3c-1.1 0-2 .9-2 2v3c0 1.1.9 2 2 2h3c1.1 0 2-.9 2-2v-3c0-1.1-.9-2-2-2zm.5 5c0 .3-.2.5-.5.5h-3c-.3 0-.5-.2-.5-.5v-3c0-.3.2-.5.5-.5h3c.3 0 .5.2.5.5v3zM4 9.5h9V8H4v1.5zM9 13H6c-1.1 0-2 .9-2 2v3c0 1.1.9 2 2 2h3c1.1 0 2-.9 2-2v-3c0-1.1-.9-2-2-2zm.5 5c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-3c0-.3.2-.5.5-.5h3c.3 0 .5.2.5.5v3z",fillRule:"evenodd",clipRule:"evenodd"})}),ry=[];const ay=["core/bold","core/image","core/italic","core/link","core/strikethrough","core/text-color"];const iy=(0,Ye.jsx)(Ke.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Ye.jsx)(Ke.Path,{d:"M8.1 12.3c.1.1.3.3.5.3.2.1.4.1.6.1.2 0 .4 0 .6-.1.2-.1.4-.2.5-.3l3-3c.3-.3.5-.7.5-1.1 0-.4-.2-.8-.5-1.1L9.7 3.5c-.1-.2-.3-.3-.5-.3H5c-.4 0-.8.4-.8.8v4.2c0 .2.1.4.2.5l3.7 3.6zM5.8 4.8h3.1l3.4 3.4v.1l-3 3 .5.5-.7-.5-3.3-3.4V4.8zM4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4z"})}),sy={category:ny,post_tag:iy};function ly(e,t){if("core/post-terms"!==t)return e;const o=e.variations.map((e=>{var t;return{...e,icon:null!==(t=sy[e.name])&&void 0!==t?t:ny}}));return{...e,variations:o}}const cy={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/post-terms",title:"Post Terms",category:"theme",description:"Post terms.",textdomain:"default",attributes:{term:{type:"string"},textAlign:{type:"string"},separator:{type:"string",default:", "},prefix:{type:"string",default:""},suffix:{type:"string",default:""}},usesContext:["postId","postType"],example:{viewportWidth:350},supports:{html:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0,link:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{radius:!0,color:!0,width:!0,style:!0}}},style:"wp-block-post-terms"},{name:uy}=cy,dy={icon:ny,edit:function({attributes:e,clientId:t,context:o,isSelected:n,setAttributes:r,insertBlocksAfter:a}){const{term:i,textAlign:s,separator:l,prefix:c,suffix:u}=e,{postId:d,postType:p}=o,m=(0,gt.useSelect)((e=>{if(!i)return{};const{getTaxonomy:t}=e(mt.store),o=t(i);return o?.visibility?.publicly_queryable?o:{}}),[i]),{postTerms:g,hasPostTerms:h,isLoading:x}=function({postId:e,term:t}){const{slug:o}=t;return(0,gt.useSelect)((n=>{const r=t?.visibility?.publicly_queryable;if(!r)return{postTerms:ry,isLoading:!1,hasPostTerms:!1};const{getEntityRecords:a,isResolving:i}=n(mt.store),s=["taxonomy",o,{post:e,per_page:-1,context:"view"}],l=a(...s);return{postTerms:l,isLoading:i("getEntityRecords",s),hasPostTerms:!!l?.length}}),[e,t?.visibility?.publicly_queryable,o])}({postId:d,term:m}),_=d&&p,b=(0,ot.useBlockDisplayInformation)(t),y=(0,ot.useBlockProps)({className:dt({[`has-text-align-${s}`]:s,[`taxonomy-${i}`]:i})});return(0,Ye.jsxs)(Ye.Fragment,{children:[(0,Ye.jsx)(ot.BlockControls,{children:(0,Ye.jsx)(ot.AlignmentToolbar,{value:s,onChange:e=>{r({textAlign:e})}})}),(0,Ye.jsx)(ot.InspectorControls,{group:"advanced",children:(0,Ye.jsx)(et.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,autoComplete:"off",label:(0,tt.__)("Separator"),value:l||"",onChange:e=>{r({separator:e})},help:(0,tt.__)("Enter character(s) used to separate terms.")})}),(0,Ye.jsxs)("div",{...y,children:[x&&_&&(0,Ye.jsx)(et.Spinner,{}),!x&&(n||c)&&(0,Ye.jsx)(ot.RichText,{identifier:"prefix",allowedFormats:ay,className:"wp-block-post-terms__prefix","aria-label":(0,tt.__)("Prefix"),placeholder:(0,tt.__)("Prefix")+" ",value:c,onChange:e=>r({prefix:e}),tagName:"span"}),(!_||!i)&&(0,Ye.jsx)("span",{children:b.title}),_&&!x&&h&&g.map((e=>(0,Ye.jsx)("a",{href:e.link,onClick:e=>e.preventDefault(),children:(0,Xo.decodeEntities)(e.name)},e.id))).reduce(((e,t)=>(0,Ye.jsxs)(Ye.Fragment,{children:[e,(0,Ye.jsx)("span",{className:"wp-block-post-terms__separator",children:l||" "}),t]}))),_&&!x&&!h&&(m?.labels?.no_terms||(0,tt.__)("Term items not found.")),!x&&(n||u)&&(0,Ye.jsx)(ot.RichText,{identifier:"suffix",allowedFormats:ay,className:"wp-block-post-terms__suffix","aria-label":(0,tt.__)("Suffix"),placeholder:" "+(0,tt.__)("Suffix"),value:u,onChange:e=>r({suffix:e}),tagName:"span",__unstableOnSplitAtEnd:()=>a((0,Qe.createBlock)((0,Qe.getDefaultBlockName)()))})]})]})}},py=()=>((0,ks.addFilter)("blocks.registerBlockType","core/template-part",ly),Xe({name:uy,metadata:cy,settings:dy})),my=window.wp.wordcount;const gy=function({attributes:e,setAttributes:t,context:o}){const{textAlign:n}=e,{postId:r,postType:a}=o,[i]=(0,mt.useEntityProp)("postType",a,"content",r),[s]=(0,mt.useEntityBlockEditor)("postType",a,{id:r}),l=(0,_t.useMemo)((()=>{let e;e=i instanceof Function?i({blocks:s}):s?(0,Qe.__unstableSerializeAndClean)(s):i;const t=(0,tt._x)("words","Word count type. Do not translate!"),o=Math.max(1,Math.round((0,my.count)(e||"",t)/189));return(0,tt.sprintf)((0,tt._n)("%s minute","%s minutes",o),o)}),[i,s]),c=(0,ot.useBlockProps)({className:dt({[`has-text-align-${n}`]:n})});return(0,Ye.jsxs)(Ye.Fragment,{children:[(0,Ye.jsx)(ot.BlockControls,{group:"block",children:(0,Ye.jsx)(ot.AlignmentControl,{value:n,onChange:e=>{t({textAlign:e})}})}),(0,Ye.jsx)("div",{...c,children:l})]})},hy=(0,Ye.jsx)(et.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:(0,Ye.jsx)(et.Path,{d:"M12 3c-5 0-9 4-9 9s4 9 9 9 9-4 9-9-4-9-9-9zm0 16.5c-4.1 0-7.5-3.4-7.5-7.5S7.9 4.5 12 4.5s7.5 3.4 7.5 7.5-3.4 7.5-7.5 7.5zM12 7l-1 5c0 .3.2.6.4.8l4.2 2.8-2.7-4.1L12 7z"})}),xy={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,__experimental:!0,name:"core/post-time-to-read",title:"Time To Read",category:"theme",description:"Show minutes required to finish reading the post.",textdomain:"default",usesContext:["postId","postType"],attributes:{textAlign:{type:"string"}},supports:{color:{gradients:!0,__experimentalDefaultControls:{background:!0,text:!0}},html:!1,spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0}}},{name:_y}=xy,by={icon:hy,edit:gy},yy=()=>Xe({name:_y,metadata:xy,settings:by});const fy={attributes:{textAlign:{type:"string"},level:{type:"number",default:2},isLink:{type:"boolean",default:!1},rel:{type:"string",attribute:"rel",default:""},linkTarget:{type:"string",default:"_self"}},supports:{align:["wide","full"],html:!1,color:{gradients:!0,link:!0},spacing:{margin:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0}},save:()=>null,migrate:so,isEligible:({style:e})=>e?.typography?.fontFamily},vy=[fy],ky={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/post-title",title:"Title",category:"theme",description:"Displays the title of a post, page, or any other content-type.",textdomain:"default",usesContext:["postId","postType","queryId"],attributes:{textAlign:{type:"string"},level:{type:"number",default:2},levelOptions:{type:"array"},isLink:{type:"boolean",default:!1},rel:{type:"string",attribute:"rel",default:""},linkTarget:{type:"string",default:"_self"}},example:{viewportWidth:350},supports:{align:["wide","full"],html:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0,link:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{radius:!0,color:!0,width:!0,style:!0}}},style:"wp-block-post-title"},{name:wy}=ky,Cy={icon:za,edit:function({attributes:{level:e,levelOptions:t,textAlign:o,isLink:n,rel:r,linkTarget:a},setAttributes:i,context:{postType:s,postId:l,queryId:c},insertBlocksAfter:u}){const d=0===e?"p":`h${e}`,p=Number.isFinite(c),m=(0,gt.useSelect)((e=>!p&&e(mt.store).canUser("update",{kind:"postType",name:s,id:l})),[p,s,l]),[g="",h,x]=(0,mt.useEntityProp)("postType",s,"title",l),[_]=(0,mt.useEntityProp)("postType",s,"link",l),b=()=>{u((0,Qe.createBlock)((0,Qe.getDefaultBlockName)()))},y=(0,ot.useBlockProps)({className:dt({[`has-text-align-${o}`]:o})}),f=(0,ot.useBlockEditingMode)();let v=(0,Ye.jsx)(d,{...y,children:(0,tt.__)("Title")});return s&&l&&(v=m?(0,Ye.jsx)(ot.PlainText,{tagName:d,placeholder:(0,tt.__)("No title"),value:g,onChange:h,__experimentalVersion:2,__unstableOnSplitAtEnd:b,...y}):(0,Ye.jsx)(d,{...y,dangerouslySetInnerHTML:{__html:x?.rendered}})),n&&s&&l&&(v=m?(0,Ye.jsx)(d,{...y,children:(0,Ye.jsx)(ot.PlainText,{tagName:"a",href:_,target:a,rel:r,placeholder:g.length?null:(0,tt.__)("No title"),value:g,onChange:h,__experimentalVersion:2,__unstableOnSplitAtEnd:b})}):(0,Ye.jsx)(d,{...y,children:(0,Ye.jsx)("a",{href:_,target:a,rel:r,onClick:e=>e.preventDefault(),dangerouslySetInnerHTML:{__html:x?.rendered}})})),(0,Ye.jsxs)(Ye.Fragment,{children:["default"===f&&(0,Ye.jsxs)(Ye.Fragment,{children:[(0,Ye.jsxs)(ot.BlockControls,{group:"block",children:[(0,Ye.jsx)(ot.HeadingLevelDropdown,{value:e,options:t,onChange:e=>i({level:e})}),(0,Ye.jsx)(ot.AlignmentControl,{value:o,onChange:e=>{i({textAlign:e})}})]}),(0,Ye.jsx)(ot.InspectorControls,{children:(0,Ye.jsxs)(et.PanelBody,{title:(0,tt.__)("Settings"),children:[(0,Ye.jsx)(et.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Make title a link"),onChange:()=>i({isLink:!n}),checked:n}),n&&(0,Ye.jsxs)(Ye.Fragment,{children:[(0,Ye.jsx)(et.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Open in new tab"),onChange:e=>i({linkTarget:e?"_blank":"_self"}),checked:"_blank"===a}),(0,Ye.jsx)(et.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,tt.__)("Link rel"),value:r,onChange:e=>i({rel:e})})]})]})})]}),v]})},deprecated:vy},jy=()=>Xe({name:wy,metadata:ky,settings:Cy}),Sy=(0,Ye.jsx)(Ke.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Ye.jsx)(Ke.Path,{d:"M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v12zM7 16.5h6V15H7v1.5zm4-4h6V11h-6v1.5zM9 11H7v1.5h2V11zm6 5.5h2V15h-2v1.5z"})});const By={from:[{type:"block",blocks:["core/code","core/paragraph"],transform:({content:e,anchor:t})=>(0,Qe.createBlock)("core/preformatted",{content:e,anchor:t})},{type:"raw",isMatch:e=>"PRE"===e.nodeName&&!(1===e.children.length&&"CODE"===e.firstChild.nodeName),schema:({phrasingContentSchema:e})=>({pre:{children:e}})}],to:[{type:"block",blocks:["core/paragraph"],transform:e=>(0,Qe.createBlock)("core/paragraph",e)},{type:"block",blocks:["core/code"],transform:e=>(0,Qe.createBlock)("core/code",e)}]},Ty=By,Ny={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/preformatted",title:"Preformatted",category:"text",description:"Add text that respects your spacing and tabs, and also allows styling.",textdomain:"default",attributes:{content:{type:"rich-text",source:"rich-text",selector:"pre",__unstablePreserveWhiteSpace:!0,role:"content"}},supports:{anchor:!0,color:{gradients:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{padding:!0,margin:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{radius:!0,color:!0,width:!0,style:!0}}},style:"wp-block-preformatted"},{name:Iy}=Ny,Py={icon:Sy,example:{attributes:{content:(0,tt.__)("EXT. XANADU - FAINT DAWN - 1940 (MINIATURE)\nWindow, very small in the distance, illuminated.\nAll around this is an almost totally black screen. Now, as the camera moves slowly towards the window which is almost a postage stamp in the frame, other forms appear;")}},transforms:Ty,edit:function({attributes:e,mergeBlocks:t,setAttributes:o,onRemove:n,insertBlocksAfter:r,style:a}){const{content:i}=e,s=(0,ot.useBlockProps)({style:a});return(0,Ye.jsx)(ot.RichText,{tagName:"pre",identifier:"content",preserveWhiteSpace:!0,value:i,onChange:e=>{o({content:e})},onRemove:n,"aria-label":(0,tt.__)("Preformatted text"),placeholder:(0,tt.__)("Write preformatted text…"),onMerge:t,...s,__unstablePastePlainText:!0,__unstableOnSplitAtDoubleLineEnd:()=>r((0,Qe.createBlock)((0,Qe.getDefaultBlockName)()))})},save:function({attributes:e}){const{content:t}=e;return(0,Ye.jsx)("pre",{...ot.useBlockProps.save(),children:(0,Ye.jsx)(ot.RichText.Content,{value:t})})},merge:(e,t)=>({content:e.content+"\n\n"+t.content})},My=()=>Xe({name:Iy,metadata:Ny,settings:Py}),zy=(0,Ye.jsx)(Ke.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Ye.jsx)(Ke.Path,{d:"M18 8H6c-1.1 0-2 .9-2 2v4c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-4c0-1.1-.9-2-2-2zm.5 6c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-4c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v4zM4 4v1.5h16V4H4zm0 16h16v-1.5H4V20z"})}),Dy="is-style-solid-color",Ay={value:{type:"string",source:"html",selector:"blockquote",multiline:"p"},citation:{type:"string",source:"html",selector:"cite",default:""},mainColor:{type:"string"},customMainColor:{type:"string"},textColor:{type:"string"},customTextColor:{type:"string"}};function Ry(e){if(!e)return;const t=e.match(/border-color:([^;]+)[;]?/);return t&&t[1]?t[1]:void 0}function Hy(e){const t=`

    ${e=e||"

    "}

    `.split("

    ");return t.shift(),t.pop(),t.join("
    ")}const Ly={attributes:{value:{type:"string",source:"html",selector:"blockquote",multiline:"p",role:"content"},citation:{type:"string",source:"html",selector:"cite",default:"",role:"content"},textAlign:{type:"string"}},save({attributes:e}){const{textAlign:t,citation:o,value:n}=e,r=!ot.RichText.isEmpty(o);return(0,Ye.jsx)("figure",{...ot.useBlockProps.save({className:dt({[`has-text-align-${t}`]:t})}),children:(0,Ye.jsxs)("blockquote",{children:[(0,Ye.jsx)(ot.RichText.Content,{value:n,multiline:!0}),r&&(0,Ye.jsx)(ot.RichText.Content,{tagName:"cite",value:o})]})})},migrate:({value:e,...t})=>({value:Hy(e),...t})},Fy={attributes:{...Ay},save({attributes:e}){const{mainColor:t,customMainColor:o,customTextColor:n,textColor:r,value:a,citation:i,className:s}=e,l=s?.includes(Dy);let c,u;if(l){const e=(0,ot.getColorClassName)("background-color",t);c=dt({"has-background":e||o,[e]:e}),u={backgroundColor:e?void 0:o}}else o&&(u={borderColor:o});const d=(0,ot.getColorClassName)("color",r),p=dt({"has-text-color":r||n,[d]:d}),m=d?void 0:{color:n};return(0,Ye.jsx)("figure",{...ot.useBlockProps.save({className:c,style:u}),children:(0,Ye.jsxs)("blockquote",{className:p,style:m,children:[(0,Ye.jsx)(ot.RichText.Content,{value:a,multiline:!0}),!ot.RichText.isEmpty(i)&&(0,Ye.jsx)(ot.RichText.Content,{tagName:"cite",value:i})]})})},migrate({value:e,className:t,mainColor:o,customMainColor:n,customTextColor:r,...a}){const i=t?.includes(Dy);let s;return n&&(s=i?{color:{background:n}}:{border:{color:n}}),r&&s&&(s.color={...s.color,text:r}),{value:Hy(e),className:t,backgroundColor:i?o:void 0,borderColor:i?void 0:o,textAlign:i?"left":void 0,style:s,...a}}},Vy={attributes:{...Ay,figureStyle:{source:"attribute",selector:"figure",attribute:"style"}},save({attributes:e}){const{mainColor:t,customMainColor:o,textColor:n,customTextColor:r,value:a,citation:i,className:s,figureStyle:l}=e,c=s?.includes(Dy);let u,d;if(c){const e=(0,ot.getColorClassName)("background-color",t);u=dt({"has-background":e||o,[e]:e}),d={backgroundColor:e?void 0:o}}else if(o)d={borderColor:o};else if(t){d={borderColor:Ry(l)}}const p=(0,ot.getColorClassName)("color",n),m=(n||r)&&dt("has-text-color",{[p]:p}),g=p?void 0:{color:r};return(0,Ye.jsx)("figure",{className:u,style:d,children:(0,Ye.jsxs)("blockquote",{className:m,style:g,children:[(0,Ye.jsx)(ot.RichText.Content,{value:a,multiline:!0}),!ot.RichText.isEmpty(i)&&(0,Ye.jsx)(ot.RichText.Content,{tagName:"cite",value:i})]})})},migrate({value:e,className:t,figureStyle:o,mainColor:n,customMainColor:r,customTextColor:a,...i}){const s=t?.includes(Dy);let l;if(r&&(l=s?{color:{background:r}}:{border:{color:r}}),a&&l&&(l.color={...l.color,text:a}),!s&&n&&o){const n=Ry(o);if(n)return{value:Hy(e),...i,className:t,style:{border:{color:n}}}}return{value:Hy(e),className:t,backgroundColor:s?n:void 0,borderColor:s?void 0:n,textAlign:s?"left":void 0,style:l,...i}}},Ey={attributes:Ay,save({attributes:e}){const{mainColor:t,customMainColor:o,textColor:n,customTextColor:r,value:a,citation:i,className:s}=e,l=s?.includes(Dy);let c,u;if(l)c=(0,ot.getColorClassName)("background-color",t),c||(u={backgroundColor:o});else if(o)u={borderColor:o};else if(t){var d;const e=null!==(d=(0,gt.select)(ot.store).getSettings().colors)&&void 0!==d?d:[];u={borderColor:(0,ot.getColorObjectByAttributeValues)(e,t).color}}const p=(0,ot.getColorClassName)("color",n),m=n||r?dt("has-text-color",{[p]:p}):void 0,g=p?void 0:{color:r};return(0,Ye.jsx)("figure",{className:c,style:u,children:(0,Ye.jsxs)("blockquote",{className:m,style:g,children:[(0,Ye.jsx)(ot.RichText.Content,{value:a,multiline:!0}),!ot.RichText.isEmpty(i)&&(0,Ye.jsx)(ot.RichText.Content,{tagName:"cite",value:i})]})})},migrate({value:e,className:t,mainColor:o,customMainColor:n,customTextColor:r,...a}){const i=t?.includes(Dy);let s={};return n&&(s=i?{color:{background:n}}:{border:{color:n}}),r&&s&&(s.color={...s.color,text:r}),{value:Hy(e),className:t,backgroundColor:i?o:void 0,borderColor:i?void 0:o,textAlign:i?"left":void 0,style:s,...a}}},Oy={attributes:{...Ay},save({attributes:e}){const{value:t,citation:o}=e;return(0,Ye.jsxs)("blockquote",{children:[(0,Ye.jsx)(ot.RichText.Content,{value:t,multiline:!0}),!ot.RichText.isEmpty(o)&&(0,Ye.jsx)(ot.RichText.Content,{tagName:"cite",value:o})]})},migrate:({value:e,...t})=>({value:Hy(e),...t})},$y={attributes:{...Ay,citation:{type:"string",source:"html",selector:"footer"},align:{type:"string",default:"none"}},save({attributes:e}){const{value:t,citation:o,align:n}=e;return(0,Ye.jsxs)("blockquote",{className:`align${n}`,children:[(0,Ye.jsx)(ot.RichText.Content,{value:t,multiline:!0}),!ot.RichText.isEmpty(o)&&(0,Ye.jsx)(ot.RichText.Content,{tagName:"footer",value:o})]})},migrate:({value:e,...t})=>({value:Hy(e),...t})},Gy=[Ly,Fy,Vy,Ey,Oy,$y],Uy="web"===_t.Platform.OS;const qy=function({attributes:e,setAttributes:t,isSelected:o,insertBlocksAfter:n}){const{textAlign:r,citation:a,value:i}=e,s=(0,ot.useBlockProps)({className:dt({[`has-text-align-${r}`]:r})}),l=!ot.RichText.isEmpty(a)||o;return(0,Ye.jsxs)(Ye.Fragment,{children:[(0,Ye.jsx)(ot.BlockControls,{group:"block",children:(0,Ye.jsx)(ot.AlignmentControl,{value:r,onChange:e=>{t({textAlign:e})}})}),(0,Ye.jsx)("figure",{...s,children:(0,Ye.jsxs)("blockquote",{children:[(0,Ye.jsx)(ot.RichText,{identifier:"value",tagName:"p",value:i,onChange:e=>t({value:e}),"aria-label":(0,tt.__)("Pullquote text"),placeholder:(0,tt.__)("Add quote"),textAlign:"center"}),l&&(0,Ye.jsx)(ot.RichText,{identifier:"citation",tagName:Uy?"cite":void 0,style:{display:"block"},value:a,"aria-label":(0,tt.__)("Pullquote citation text"),placeholder:(0,tt.__)("Add citation"),onChange:e=>t({citation:e}),className:"wp-block-pullquote__citation",__unstableMobileNoFocusOnMount:!0,textAlign:"center",__unstableOnSplitAtEnd:()=>n((0,Qe.createBlock)((0,Qe.getDefaultBlockName)()))})]})})]})};const Wy={from:[{type:"block",isMultiBlock:!0,blocks:["core/paragraph"],transform:e=>(0,Qe.createBlock)("core/pullquote",{value:(0,Ao.toHTMLString)({value:(0,Ao.join)(e.map((({content:e})=>(0,Ao.create)({html:e}))),"\n")}),anchor:e.anchor})},{type:"block",blocks:["core/heading"],transform:({content:e,anchor:t})=>(0,Qe.createBlock)("core/pullquote",{value:e,anchor:t})}],to:[{type:"block",blocks:["core/paragraph"],transform:({value:e,citation:t})=>{const o=[];return e&&o.push((0,Qe.createBlock)("core/paragraph",{content:e})),t&&o.push((0,Qe.createBlock)("core/paragraph",{content:t})),0===o.length?(0,Qe.createBlock)("core/paragraph",{content:""}):o}},{type:"block",blocks:["core/heading"],transform:({value:e,citation:t})=>{if(!e)return(0,Qe.createBlock)("core/heading",{content:t});const o=(0,Qe.createBlock)("core/heading",{content:e});return t?[o,(0,Qe.createBlock)("core/heading",{content:t})]:o}}]},Zy=Wy,Qy={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/pullquote",title:"Pullquote",category:"text",description:"Give special visual emphasis to a quote from your text.",textdomain:"default",attributes:{value:{type:"rich-text",source:"rich-text",selector:"p",role:"content"},citation:{type:"rich-text",source:"rich-text",selector:"cite",role:"content"},textAlign:{type:"string"}},supports:{anchor:!0,align:["left","right","wide","full"],background:{backgroundImage:!0,backgroundSize:!0,__experimentalDefaultControls:{backgroundImage:!0}},color:{gradients:!0,background:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},dimensions:{minHeight:!0,__experimentalDefaultControls:{minHeight:!1}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0,__experimentalDefaultControls:{color:!0,radius:!0,style:!0,width:!0}},__experimentalStyle:{typography:{fontSize:"1.5em",lineHeight:"1.6"}},interactivity:{clientNavigation:!0}},editorStyle:"wp-block-pullquote-editor",style:"wp-block-pullquote"},{name:Ky}=Qy,Yy={icon:zy,example:{attributes:{value:(0,tt.__)("One of the hardest things to do in technology is disrupt yourself."),citation:(0,tt.__)("Matt Mullenweg")}},transforms:Zy,edit:qy,save:function({attributes:e}){const{textAlign:t,citation:o,value:n}=e,r=!ot.RichText.isEmpty(o);return(0,Ye.jsx)("figure",{...ot.useBlockProps.save({className:dt({[`has-text-align-${t}`]:t})}),children:(0,Ye.jsxs)("blockquote",{children:[(0,Ye.jsx)(ot.RichText.Content,{tagName:"p",value:n}),r&&(0,Ye.jsx)(ot.RichText.Content,{tagName:"cite",value:o})]})})},deprecated:Gy},Jy=()=>Xe({name:Ky,metadata:Qy,settings:Yy}),Xy=(0,Ye.jsx)(Ke.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Ye.jsx)(Ke.Path,{d:"M18.1823 11.6392C18.1823 13.0804 17.0139 14.2487 15.5727 14.2487C14.3579 14.2487 13.335 13.4179 13.0453 12.2922L13.0377 12.2625L13.0278 12.2335L12.3985 10.377L12.3942 10.3785C11.8571 8.64997 10.246 7.39405 8.33961 7.39405C5.99509 7.39405 4.09448 9.29465 4.09448 11.6392C4.09448 13.9837 5.99509 15.8843 8.33961 15.8843C8.88499 15.8843 9.40822 15.781 9.88943 15.5923L9.29212 14.0697C8.99812 14.185 8.67729 14.2487 8.33961 14.2487C6.89838 14.2487 5.73003 13.0804 5.73003 11.6392C5.73003 10.1979 6.89838 9.02959 8.33961 9.02959C9.55444 9.02959 10.5773 9.86046 10.867 10.9862L10.8772 10.9836L11.4695 12.7311C11.9515 14.546 13.6048 15.8843 15.5727 15.8843C17.9172 15.8843 19.8178 13.9837 19.8178 11.6392C19.8178 9.29465 17.9172 7.39404 15.5727 7.39404C15.0287 7.39404 14.5066 7.4968 14.0264 7.6847L14.6223 9.20781C14.9158 9.093 15.2358 9.02959 15.5727 9.02959C17.0139 9.02959 18.1823 10.1979 18.1823 11.6392Z"})}),ef=e=>{const t=e?.reduce(((e,t)=>{const{mapById:o,mapByName:n,names:r}=e;return o[t.id]=t,n[t.name]=t,r.push(t.name),e}),{mapById:{},mapByName:{},names:[]});return{entities:e,...t}},tf=(e,t)=>{const o=t.split(".");let n=e;return o.forEach((e=>{n=n?.[e]})),n},of=(e,t)=>(e||[]).map((e=>({...e,name:(0,Xo.decodeEntities)(tf(e,t))}))),nf=e=>{const t=(0,gt.useSelect)((t=>{const{getTaxonomies:o,getPostType:n}=t(mt.store);return n(e)?.taxonomies?.length>0?o({type:e,per_page:-1}):[]}),[e]);return(0,_t.useMemo)((()=>t?.filter((({visibility:e})=>!!e?.publicly_queryable))),[t])};function rf(e,t){return!e||e.includes(t)}function af(e,t){const o=(0,gt.useSelect)((e=>e(Qe.store).getActiveBlockVariation("core/query",t)?.name),[t]),n=`core/query/${o}`;return(0,gt.useSelect)((t=>{if(!o)return!1;const{getBlockRootClientId:r,getPatternsByBlockTypes:a}=t(ot.store),i=r(e);return a(n,i).length>0}),[e,o,n])?n:"core/query"}const sf=(e,t)=>(0,gt.useSelect)((o=>{const{getBlockRootClientId:n,getPatternsByBlockTypes:r}=o(ot.store),a=n(e);return r(t,a)}),[t,e]),lf=e=>(0,gt.useSelect)((t=>{const{getClientIdsOfDescendants:o,getBlockName:n}=t(ot.store),r={};return o(e).forEach((e=>{const t=n(e),o=Object.is((0,Qe.getBlockSupport)(t,"interactivity"),!0),a=(0,Qe.getBlockSupport)(t,"interactivity.clientNavigation");o||a?"core/post-content"===t&&(r.hasPostContentBlock=!0):r.hasBlocksFromPlugins=!0})),r.hasUnsupportedBlocks=r.hasBlocksFromPlugins||r.hasPostContentBlock,r}),[e]);function cf({enhancedPagination:e,setAttributes:t,clientId:o}){const{hasUnsupportedBlocks:n}=lf(o),r=window.__experimentalFullPageClientSideNavigation;let a=(0,tt.__)("Browsing between pages requires a full page reload.");return r?a=(0,tt.__)("Experimental full-page client-side navigation setting enabled."):e?a=(0,tt.__)("Reload the full page—instead of just the posts list—when visitors navigate between pages."):n&&(a=(0,tt.__)("Enhancement disabled because there are non-compatible blocks inside the Query block.")),(0,Ye.jsx)(Ye.Fragment,{children:(0,Ye.jsx)(et.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Reload full page"),help:a,checked:!e&&!r,disabled:n||r,onChange:e=>{t({enhancedPagination:!e})}})})}function uf({openPatternSelectionModal:e,name:t,clientId:o}){const n=!!sf(o,t).length;return(0,Ye.jsx)(Ye.Fragment,{children:n&&(0,Ye.jsx)(et.ToolbarGroup,{className:"wp-block-template-part__block-control-group",children:(0,Ye.jsx)(et.ToolbarButton,{onClick:e,children:(0,tt.__)("Replace")})})})}const df=[{label:(0,tt.__)("Newest to oldest"),value:"date/desc"},{label:(0,tt.__)("Oldest to newest"),value:"date/asc"},{label:(0,tt.__)("A → Z"),value:"title/asc"},{label:(0,tt.__)("Z → A"),value:"title/desc"}];const pf=function({order:e,orderBy:t,onChange:o}){return(0,Ye.jsx)(et.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,tt.__)("Order by"),value:`${t}/${e}`,options:df,onChange:e=>{const[t,n]=e.split("/");o({order:n,orderBy:t})}})},mf={who:"authors",per_page:-1,_fields:"id,name",context:"view"};const gf=function({value:e,onChange:t}){const o=(0,gt.useSelect)((e=>{const{getUsers:t}=e(mt.store);return t(mf)}),[]);if(!o)return null;const n=ef(o),r=(e?e.toString().split(","):[]).reduce(((e,t)=>{const o=n.mapById[t];return o&&e.push({id:t,value:o.name}),e}),[]);return(0,Ye.jsx)(et.FormTokenField,{label:(0,tt.__)("Authors"),value:r,suggestions:n.names,onChange:e=>{const o=Array.from(e.reduce(((e,t)=>{const o=((e,t)=>{const o=t?.id||e[t]?.id;if(o)return o})(n.mapByName,t);return o&&e.add(o),e}),new Set));t({author:o.join(",")})},__experimentalShowHowTo:!1,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0})},hf=[],xf={order:"asc",_fields:"id,title",context:"view"};const _f=function({parents:e,postType:t,onChange:o}){const[n,r]=(0,_t.useState)(""),[a,i]=(0,_t.useState)(hf),[s,l]=(0,_t.useState)(hf),c=(0,Ut.useDebounce)(r,250),{searchResults:u,searchHasResolved:d}=(0,gt.useSelect)((o=>{if(!n)return{searchResults:hf,searchHasResolved:!0};const{getEntityRecords:r,hasFinishedResolution:a}=o(mt.store),i=["postType",t,{...xf,search:n,orderby:"relevance",exclude:e,per_page:20}];return{searchResults:r(...i),searchHasResolved:a("getEntityRecords",i)}}),[n,e]),p=(0,gt.useSelect)((o=>{if(!e?.length)return hf;const{getEntityRecords:n}=o(mt.store);return n("postType",t,{...xf,include:e,per_page:e.length})}),[e]);(0,_t.useEffect)((()=>{if(e?.length||i(hf),!p?.length)return;const t=ef(of(p,"title.rendered")),o=e.reduce(((e,o)=>{const n=t.mapById[o];return n&&e.push({id:o,value:n.name}),e}),[]);i(o)}),[e,p]);const m=(0,_t.useMemo)((()=>u?.length?ef(of(u,"title.rendered")):hf),[u]);return(0,_t.useEffect)((()=>{d&&l(m.names)}),[m.names,d]),(0,Ye.jsx)(et.FormTokenField,{__next40pxDefaultSize:!0,label:(0,tt.__)("Parents"),value:a,onInputChange:c,suggestions:s,onChange:e=>{const t=Array.from(e.reduce(((e,t)=>{const o=((e,t)=>{const o=t?.id||e?.[t]?.id;if(o)return o})(m.mapByName,t);return o&&e.add(o),e}),new Set));l(hf),o({parents:t})},__experimentalShowHowTo:!1,__nextHasNoMarginBottom:!0})},bf=[],yf={order:"asc",_fields:"id,name",context:"view"},ff=(e,t)=>{const o=t?.id||e?.find((e=>e.name===t))?.id;if(o)return o;const n=t.toLocaleLowerCase();return e?.find((e=>e.name.toLocaleLowerCase()===n))?.id};function vf({onChange:e,query:t}){const{postType:o,taxQuery:n}=t,r=nf(o);return r&&0!==r.length?(0,Ye.jsx)(et.__experimentalVStack,{spacing:4,children:r.map((t=>{const o=n?.[t.slug]||[];return(0,Ye.jsx)(kf,{taxonomy:t,termIds:o,onChange:o=>e({taxQuery:{...n,[t.slug]:o}})},t.slug)}))}):null}function kf({taxonomy:e,termIds:t,onChange:o}){const[n,r]=(0,_t.useState)(""),[a,i]=(0,_t.useState)(bf),[s,l]=(0,_t.useState)(bf),c=(0,Ut.useDebounce)(r,250),{searchResults:u,searchHasResolved:d}=(0,gt.useSelect)((o=>{if(!n)return{searchResults:bf,searchHasResolved:!0};const{getEntityRecords:r,hasFinishedResolution:a}=o(mt.store),i=["taxonomy",e.slug,{...yf,search:n,orderby:"name",exclude:t,per_page:20}];return{searchResults:r(...i),searchHasResolved:a("getEntityRecords",i)}}),[n,t]),p=(0,gt.useSelect)((o=>{if(!t?.length)return bf;const{getEntityRecords:n}=o(mt.store);return n("taxonomy",e.slug,{...yf,include:t,per_page:t.length})}),[t]);(0,_t.useEffect)((()=>{if(t?.length||i(bf),!p?.length)return;const e=t.reduce(((e,t)=>{const o=p.find((e=>e.id===t));return o&&e.push({id:t,value:o.name}),e}),[]);i(e)}),[t,p]),(0,_t.useEffect)((()=>{d&&l(u.map((e=>e.name)))}),[u,d]);return(0,Ye.jsx)("div",{className:"block-library-query-inspector__taxonomy-control",children:(0,Ye.jsx)(et.FormTokenField,{label:e.name,value:a,onInputChange:c,suggestions:s,displayTransform:Xo.decodeEntities,onChange:e=>{const t=new Set;for(const o of e){const e=ff(u,o);e&&t.add(e)}l(bf),o(Array.from(t))},__experimentalShowHowTo:!1,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0})})}const wf=[{value:"aside",label:(0,tt.__)("Aside")},{value:"audio",label:(0,tt.__)("Audio")},{value:"chat",label:(0,tt.__)("Chat")},{value:"gallery",label:(0,tt.__)("Gallery")},{value:"image",label:(0,tt.__)("Image")},{value:"link",label:(0,tt.__)("Link")},{value:"quote",label:(0,tt.__)("Quote")},{value:"standard",label:(0,tt.__)("Standard")},{value:"status",label:(0,tt.__)("Status")},{value:"video",label:(0,tt.__)("Video")}].sort(((e,t)=>{const o=e.label.toUpperCase(),n=t.label.toUpperCase();return on?1:0}));function Cf(e,t){return e.map((e=>t.find((t=>t.label.toLocaleLowerCase()===e.toLocaleLowerCase()))?.value)).filter(Boolean)}function jf({onChange:e,query:{format:t}}){const o=Array.isArray(t)?t:[t],{supportedFormats:n}=(0,gt.useSelect)((e=>({supportedFormats:e(mt.store).getThemeSupports().formats})),[]),r=wf.filter((e=>n.includes(e.value))),a=o.map((e=>r.find((t=>t.value===e))?.label)).filter(Boolean),i=r.filter((e=>!o.includes(e.value))).map((e=>e.label));return(0,Ye.jsx)(et.FormTokenField,{label:(0,tt.__)("Formats"),value:a,suggestions:i,onChange:t=>{e({format:Cf(t,r)})},__experimentalShowHowTo:!1,__experimentalExpandOnFocus:!0,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0})}const Sf=[{label:(0,tt.__)("Include"),value:""},{label:(0,tt.__)("Exclude"),value:"exclude"},{label:(0,tt.__)("Only"),value:"only"}];function Bf({value:e,onChange:t}){return(0,Ye.jsx)(et.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,tt.__)("Sticky posts"),options:Sf,value:e,onChange:t,help:(0,tt.__)("Sticky posts always appear first, regardless of their publish date.")})}const Tf=({postType:e})=>{const t=(0,pt.addQueryArgs)("post-new.php",{post_type:e}),o=(0,gt.useSelect)((t=>{const{getPostType:o}=t(mt.store);return o(e)?.labels?.add_new_item}),[e]);return(0,Ye.jsx)("div",{className:"wp-block-query__create-new-link",children:(0,_t.createInterpolateElement)(""+o+"",{a:(0,Ye.jsx)("a",{href:t})})})},Nf=({perPage:e,offset:t=0,onChange:o})=>(0,Ye.jsx)(et.RangeControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,tt.__)("Posts per page"),min:1,max:100,onChange:e=>{isNaN(e)||e<1||e>100||o({perPage:e,offset:t})},value:parseInt(e,10)}),If=({offset:e=0,onChange:t})=>(0,Ye.jsx)(et.__experimentalNumberControl,{__next40pxDefaultSize:!0,label:(0,tt.__)("Offset"),value:e,min:0,onChange:e=>{isNaN(e)||e<0||e>100||t({offset:e})}}),Pf=({pages:e,onChange:t})=>(0,Ye.jsx)(et.__experimentalNumberControl,{__next40pxDefaultSize:!0,label:(0,tt.__)("Max pages"),value:e,min:0,onChange:e=>{isNaN(e)||e<0||t({pages:e})},help:(0,tt.__)("Limit the pages you want to show, even if the query has more results. To show all pages use 0 (zero).")}),{BlockInfo:Mf}=Ht(ot.privateApis);function zf(e){const{attributes:t,setQuery:o,setDisplayLayout:n,isTemplate:r}=e,{query:a,displayLayout:i}=t,{order:s,orderBy:l,author:c,pages:u,postType:d,perPage:p,offset:m,sticky:g,inherit:h,taxQuery:x,parents:_,format:b}=a,y=function(e){return(0,gt.useSelect)((t=>t(Qe.store).getActiveBlockVariation("core/query",e)?.allowedControls),[e])}(t),[f,v]=(0,_t.useState)("post"===d),{postTypesTaxonomiesMap:k,postTypesSelectOptions:w,postTypeFormatSupportMap:C}=(()=>{const e=(0,gt.useSelect)((e=>{const{getPostTypes:t}=e(mt.store),o=["attachment"],n=t({per_page:-1})?.filter((({viewable:e,slug:t})=>e&&!o.includes(t)));return n}),[]);return{postTypesTaxonomiesMap:(0,_t.useMemo)((()=>{if(e?.length)return e.reduce(((e,t)=>(e[t.slug]=t.taxonomies,e)),{})}),[e]),postTypesSelectOptions:(0,_t.useMemo)((()=>(e||[]).map((({labels:e,slug:t})=>({label:e.singular_name,value:t})))),[e]),postTypeFormatSupportMap:(0,_t.useMemo)((()=>e?.length?e.reduce(((e,t)=>(e[t.slug]=t.supports?.["post-formats"]||!1,e)),{}):{}),[e])}})(),j=nf(d),S=function(e){return(0,gt.useSelect)((t=>{const o=t(mt.store).getPostType(e);return o?.viewable&&o?.hierarchical}),[e])}(d);(0,_t.useEffect)((()=>{v("post"===d)}),[d]);const B=e=>{const t={postType:e},n=k[e],r=Object.entries(x||{}).reduce(((e,[t,o])=>(n.includes(t)&&(e[t]=o),e)),{});t.taxQuery=Object.keys(r).length?r:void 0,"post"!==e&&(t.sticky=""),t.parents=[];C[e]||(t.format=[]),o(t)},[T,N]=(0,_t.useState)(a.search),I=(0,_t.useCallback)((0,Ut.debounce)((()=>{a.search!==T&&o({search:T})}),250),[T,a.search]);(0,_t.useEffect)((()=>(I(),I.cancel)),[T,I]);const P=r&&rf(y,"inherit"),M=!h&&rf(y,"postType"),z=(0,tt.__)("Post type"),D=(0,tt.__)("Select the type of content to display: posts, pages, or custom post types."),A=!1,R=!h&&rf(y,"order"),H=!h&&f&&rf(y,"sticky"),L=P||M||R||H,F=!!j?.length&&rf(y,"taxQuery"),V=rf(y,"author"),E=rf(y,"search"),O=rf(y,"parents")&&S,$=C[d],G=(0,gt.useSelect)((e=>{if(!$||!rf(y,"format"))return!1;const t=e(mt.store).getThemeSupports();return t.formats&&t.formats.length>0&&t.formats.some((e=>"standard"!==e))}),[y,$]),U=F||V||E||O||G,q=Zt(),W=rf(y,"postCount"),Z=rf(y,"offset"),Q=rf(y,"pages"),K=W||Z||Q;return(0,Ye.jsxs)(Ye.Fragment,{children:[!!d&&(0,Ye.jsx)(Mf,{children:(0,Ye.jsx)(Tf,{postType:d})}),L&&(0,Ye.jsxs)(et.PanelBody,{title:(0,tt.__)("Settings"),children:[P&&(0,Ye.jsxs)(et.__experimentalToggleGroupControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,tt.__)("Query type"),isBlock:!0,onChange:e=>{o({inherit:!!e})},help:h?(0,tt.__)("Display a list of posts or custom post types based on the current template."):(0,tt.__)("Display a list of posts or custom post types based on specific criteria."),value:!!h,children:[(0,Ye.jsx)(et.__experimentalToggleGroupControlOption,{value:!0,label:(0,tt.__)("Default")}),(0,Ye.jsx)(et.__experimentalToggleGroupControlOption,{value:!1,label:(0,tt.__)("Custom")})]}),M&&(w.length>2?(0,Ye.jsx)(et.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,options:w,value:d,label:z,onChange:B,help:D}):(0,Ye.jsx)(et.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,isBlock:!0,value:d,label:z,onChange:B,help:D,children:w.map((e=>(0,Ye.jsx)(et.__experimentalToggleGroupControlOption,{value:e.value,label:e.label},e.value)))})),A,R&&(0,Ye.jsx)(pf,{order:s,orderBy:l,onChange:o}),H&&(0,Ye.jsx)(Bf,{value:g,onChange:e=>o({sticky:e})})]}),!h&&K&&(0,Ye.jsxs)(et.__experimentalToolsPanel,{className:"block-library-query-toolspanel__display",label:(0,tt.__)("Display"),resetAll:()=>{o({offset:0,pages:0})},dropdownMenuProps:q,children:[(0,Ye.jsx)(et.__experimentalToolsPanelItem,{label:(0,tt.__)("Items"),hasValue:()=>p>0,children:(0,Ye.jsx)(Nf,{perPage:p,offset:m,onChange:o})}),(0,Ye.jsx)(et.__experimentalToolsPanelItem,{label:(0,tt.__)("Offset"),hasValue:()=>m>0,onDeselect:()=>o({offset:0}),children:(0,Ye.jsx)(If,{offset:m,onChange:o})}),(0,Ye.jsx)(et.__experimentalToolsPanelItem,{label:(0,tt.__)("Max Pages to Show"),hasValue:()=>u>0,onDeselect:()=>o({pages:0}),children:(0,Ye.jsx)(Pf,{pages:u,onChange:o})})]}),!h&&U&&(0,Ye.jsxs)(et.__experimentalToolsPanel,{className:"block-library-query-toolspanel__filters",label:(0,tt.__)("Filters"),resetAll:()=>{o({author:"",parents:[],search:"",taxQuery:null,format:[]}),N("")},dropdownMenuProps:q,children:[F&&(0,Ye.jsx)(et.__experimentalToolsPanelItem,{label:(0,tt.__)("Taxonomies"),hasValue:()=>Object.values(x||{}).some((e=>!!e.length)),onDeselect:()=>o({taxQuery:null}),children:(0,Ye.jsx)(vf,{onChange:o,query:a})}),V&&(0,Ye.jsx)(et.__experimentalToolsPanelItem,{hasValue:()=>!!c,label:(0,tt.__)("Authors"),onDeselect:()=>o({author:""}),children:(0,Ye.jsx)(gf,{value:c,onChange:o})}),E&&(0,Ye.jsx)(et.__experimentalToolsPanelItem,{hasValue:()=>!!T,label:(0,tt.__)("Keyword"),onDeselect:()=>N(""),children:(0,Ye.jsx)(et.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,tt.__)("Keyword"),value:T,onChange:N})}),O&&(0,Ye.jsx)(et.__experimentalToolsPanelItem,{hasValue:()=>!!_?.length,label:(0,tt.__)("Parents"),onDeselect:()=>o({parents:[]}),children:(0,Ye.jsx)(_f,{parents:_,postType:d,onChange:o})}),G&&(0,Ye.jsx)(et.__experimentalToolsPanelItem,{hasValue:()=>!!b?.length,label:(0,tt.__)("Formats"),onDeselect:()=>o({format:[]}),children:(0,Ye.jsx)(jf,{onChange:o,query:a})})]})]})}const Df="wp-block-query-enhanced-pagination-modal__description";function Af({clientId:e,attributes:{enhancedPagination:t},setAttributes:o}){const[n,r]=(0,_t.useState)(!1),{hasBlocksFromPlugins:a,hasPostContentBlock:i,hasUnsupportedBlocks:s}=lf(e);(0,_t.useEffect)((()=>{t&&s&&!window.__experimentalFullPageClientSideNavigation&&(o({enhancedPagination:!1}),r(!0))}),[t,s,o]);const l=()=>{r(!1)};let c=(0,tt.__)('If you still want to prevent full page reloads, remove that block, then disable "Reload full page" again in the Query Block settings.');return a?c=(0,tt.__)("Currently, avoiding full page reloads is not possible when non-interactive or non-client Navigation compatible blocks from plugins are present inside the Query block.")+" "+c:i&&(c=(0,tt.__)("Currently, avoiding full page reloads is not possible when a Content block is present inside the Query block.")+" "+c),n&&(0,Ye.jsx)(et.Modal,{title:(0,tt.__)("Query block: Reload full page enabled"),className:"wp-block-query__enhanced-pagination-modal",aria:{describedby:Df},role:"alertdialog",focusOnMount:"firstElement",isDismissible:!1,onRequestClose:l,children:(0,Ye.jsxs)(et.__experimentalVStack,{alignment:"right",spacing:5,children:[(0,Ye.jsx)("span",{id:Df,children:c}),(0,Ye.jsx)(et.Button,{__next40pxDefaultSize:!0,variant:"primary",onClick:l,children:(0,tt.__)("OK")})]})})}const Rf=[["core/post-template"]];function Hf({attributes:e,setAttributes:t,openPatternSelectionModal:o,name:n,clientId:r,context:a}){const{queryId:i,query:s,displayLayout:l,enhancedPagination:c,tagName:u="div",query:{inherit:d}={}}=e,{postType:p}=a,{__unstableMarkNextChangeAsNotPersistent:m}=(0,gt.useDispatch)(ot.store),g=(0,Ut.useInstanceId)(Hf),h=(0,ot.useBlockProps)(),x=(0,ot.useInnerBlocksProps)(h,{template:Rf}),_=(0,gt.useSelect)((e=>{const t=e(mt.store).__experimentalGetTemplateForLink()?.type;return"wp_template"===t&&!(void 0!==p)}),[p]),{postsPerPage:b}=(0,gt.useSelect)((e=>{const{getSettings:t}=e(ot.store),{getEntityRecord:o,getEntityRecordEdits:n,canUser:r}=e(mt.store),a=r("read",{kind:"root",name:"site"})?+o("root","site")?.posts_per_page:+t().postsPerPage;return{postsPerPage:+n("root","site")?.posts_per_page||a||3}}),[]),y=(0,_t.useCallback)((e=>t({query:{...s,...e}})),[s,t]);(0,_t.useEffect)((()=>{const e={};(d&&s.perPage!==b||!s.perPage&&b)&&(e.perPage=b),!_&&s.inherit&&(e.inherit=!1),Object.keys(e).length&&(m(),y(e))}),[s.perPage,b,d,_,s.inherit,m,y]),(0,_t.useEffect)((()=>{Number.isFinite(i)||(m(),t({queryId:g}))}),[i,g,m,t]);const f={main:(0,tt.__)("The

    element should be used for the primary content of your document only."),section:(0,tt.__)("The
    element should represent a standalone portion of the document that can't be better represented by another element."),aside:(0,tt.__)("The
  • \n"}))).replace(/¨0/g,""),r.gListLevel--,n&&(e=e.replace(/\s+$/,"")),e}function o(e,t){if("ol"===t){var r=e.match(/^ *(\d+)\./);if(r&&"1"!==r[1])return' start="'+r[1]+'"'}return""}function i(e,r,a){var i=t.disableForced4SpacesIndentedSublists?/^ ?\d+\.[ \t]/gm:/^ {0,3}\d+\.[ \t]/gm,s=t.disableForced4SpacesIndentedSublists?/^ ?[*+-][ \t]/gm:/^ {0,3}[*+-][ \t]/gm,c="ul"===r?i:s,l="";if(-1!==e.search(c))!function t(u){var d=u.search(c),p=o(e,r);-1!==d?(l+="\n\n<"+r+p+">\n"+n(u.slice(0,d),!!a)+"\n",c="ul"===(r="ul"===r?"ol":"ul")?i:s,t(u.slice(d))):l+="\n\n<"+r+p+">\n"+n(u,!!a)+"\n"}(e);else{var u=o(e,r);l="\n\n<"+r+u+">\n"+n(e,!!a)+"\n"}return l}return e=r.converter._dispatch("lists.before",e,t,r),e+="¨0",e=(e=r.gListLevel?e.replace(/^(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,(function(e,t,r){return i(t,r.search(/[*+-]/g)>-1?"ul":"ol",!0)})):e.replace(/(\n\n|^\n?)(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,(function(e,t,r,n){return i(r,n.search(/[*+-]/g)>-1?"ul":"ol",!1)}))).replace(/¨0/,""),e=r.converter._dispatch("lists.after",e,t,r)})),a.subParser("metadata",(function(e,t,r){"use strict";if(!t.metadata)return e;function n(e){r.metadata.raw=e,(e=(e=e.replace(/&/g,"&").replace(/"/g,""")).replace(/\n {4}/g," ")).replace(/^([\S ]+): +([\s\S]+?)$/gm,(function(e,t,n){return r.metadata.parsed[t]=n,""}))}return e=(e=(e=(e=r.converter._dispatch("metadata.before",e,t,r)).replace(/^\s*«««+(\S*?)\n([\s\S]+?)\n»»»+\n/,(function(e,t,r){return n(r),"¨M"}))).replace(/^\s*---+(\S*?)\n([\s\S]+?)\n---+\n/,(function(e,t,o){return t&&(r.metadata.format=t),n(o),"¨M"}))).replace(/¨M/g,""),e=r.converter._dispatch("metadata.after",e,t,r)})),a.subParser("outdent",(function(e,t,r){"use strict";return e=(e=(e=r.converter._dispatch("outdent.before",e,t,r)).replace(/^(\t|[ ]{1,4})/gm,"¨0")).replace(/¨0/g,""),e=r.converter._dispatch("outdent.after",e,t,r)})),a.subParser("paragraphs",(function(e,t,r){"use strict";for(var n=(e=(e=(e=r.converter._dispatch("paragraphs.before",e,t,r)).replace(/^\n+/g,"")).replace(/\n+$/g,"")).split(/\n{2,}/g),o=[],i=n.length,s=0;s=0?o.push(c):c.search(/\S/)>=0&&(c=(c=a.subParser("spanGamut")(c,t,r)).replace(/^([ \t]*)/g,"

    "),c+="

    ",o.push(c))}for(i=o.length,s=0;s]*>\s*]*>/.test(u)&&(d=!0)}o[s]=u}return e=(e=(e=o.join("\n")).replace(/^\n+/g,"")).replace(/\n+$/g,""),r.converter._dispatch("paragraphs.after",e,t,r)})),a.subParser("runExtension",(function(e,t,r,n){"use strict";if(e.filter)t=e.filter(t,n.converter,r);else if(e.regex){var o=e.regex;o instanceof RegExp||(o=new RegExp(o,"g")),t=t.replace(o,e.replace)}return t})),a.subParser("spanGamut",(function(e,t,r){"use strict";return e=r.converter._dispatch("spanGamut.before",e,t,r),e=a.subParser("codeSpans")(e,t,r),e=a.subParser("escapeSpecialCharsWithinTagAttributes")(e,t,r),e=a.subParser("encodeBackslashEscapes")(e,t,r),e=a.subParser("images")(e,t,r),e=a.subParser("anchors")(e,t,r),e=a.subParser("autoLinks")(e,t,r),e=a.subParser("simplifiedAutoLinks")(e,t,r),e=a.subParser("emoji")(e,t,r),e=a.subParser("underline")(e,t,r),e=a.subParser("italicsAndBold")(e,t,r),e=a.subParser("strikethrough")(e,t,r),e=a.subParser("ellipsis")(e,t,r),e=a.subParser("hashHTMLSpans")(e,t,r),e=a.subParser("encodeAmpsAndAngles")(e,t,r),t.simpleLineBreaks?/\n\n¨K/.test(e)||(e=e.replace(/\n+/g,"
    \n")):e=e.replace(/ +\n/g,"
    \n"),e=r.converter._dispatch("spanGamut.after",e,t,r)})),a.subParser("strikethrough",(function(e,t,r){"use strict";return t.strikethrough&&(e=(e=r.converter._dispatch("strikethrough.before",e,t,r)).replace(/(?:~){2}([\s\S]+?)(?:~){2}/g,(function(e,n){return function(e){return t.simplifiedAutoLink&&(e=a.subParser("simplifiedAutoLinks")(e,t,r)),""+e+""}(n)})),e=r.converter._dispatch("strikethrough.after",e,t,r)),e})),a.subParser("stripLinkDefinitions",(function(e,t,r){"use strict";var n=function(e,n,o,i,s,c,l){return n=n.toLowerCase(),o.match(/^data:.+?\/.+?;base64,/)?r.gUrls[n]=o.replace(/\s/g,""):r.gUrls[n]=a.subParser("encodeAmpsAndAngles")(o,t,r),c?c+l:(l&&(r.gTitles[n]=l.replace(/"|'/g,""")),t.parseImgDimensions&&i&&s&&(r.gDimensions[n]={width:i,height:s}),"")};return e=(e=(e=(e+="¨0").replace(/^ {0,3}\[(.+)]:[ \t]*\n?[ \t]*?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n\n|(?=¨0)|(?=\n\[))/gm,n)).replace(/^ {0,3}\[(.+)]:[ \t]*\n?[ \t]*\s]+)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n+|(?=¨0))/gm,n)).replace(/¨0/,"")})),a.subParser("tables",(function(e,t,r){"use strict";if(!t.tables)return e;function n(e,n){return""+a.subParser("spanGamut")(e,t,r)+"\n"}function o(e){var o,i=e.split("\n");for(o=0;o"+(c=a.subParser("spanGamut")(c,t,r))+"\n"));for(o=0;o\n\n\n",o=0;o\n";for(var a=0;a\n"}return r+"\n\n"}(f,m)}return e=(e=(e=(e=r.converter._dispatch("tables.before",e,t,r)).replace(/\\(\|)/g,a.helper.escapeCharactersCallback)).replace(/^ {0,3}\|?.+\|.+\n {0,3}\|?[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*:?[ \t]*(?:[-=]){2,}[\s\S]+?(?:\n\n|¨0)/gm,o)).replace(/^ {0,3}\|.+\|[ \t]*\n {0,3}\|[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*\n( {0,3}\|.+\|[ \t]*\n)*(?:\n|¨0)/gm,o),e=r.converter._dispatch("tables.after",e,t,r)})),a.subParser("underline",(function(e,t,r){"use strict";return t.underline?(e=r.converter._dispatch("underline.before",e,t,r),e=(e=t.literalMidWordUnderscores?(e=e.replace(/\b___(\S[\s\S]*?)___\b/g,(function(e,t){return""+t+""}))).replace(/\b__(\S[\s\S]*?)__\b/g,(function(e,t){return""+t+""})):(e=e.replace(/___(\S[\s\S]*?)___/g,(function(e,t){return/\S$/.test(t)?""+t+"":e}))).replace(/__(\S[\s\S]*?)__/g,(function(e,t){return/\S$/.test(t)?""+t+"":e}))).replace(/(_)/g,a.helper.escapeCharactersCallback),e=r.converter._dispatch("underline.after",e,t,r)):e})),a.subParser("unescapeSpecialChars",(function(e,t,r){"use strict";return e=(e=r.converter._dispatch("unescapeSpecialChars.before",e,t,r)).replace(/¨E(\d+)E/g,(function(e,t){var r=parseInt(t);return String.fromCharCode(r)})),e=r.converter._dispatch("unescapeSpecialChars.after",e,t,r)})),a.subParser("makeMarkdown.blockquote",(function(e,t){"use strict";var r="";if(e.hasChildNodes())for(var n=e.childNodes,o=n.length,i=0;i ")})),a.subParser("makeMarkdown.codeBlock",(function(e,t){"use strict";var r=e.getAttribute("language"),n=e.getAttribute("precodenum");return"```"+r+"\n"+t.preList[n]+"\n```"})),a.subParser("makeMarkdown.codeSpan",(function(e){"use strict";return"`"+e.innerHTML+"`"})),a.subParser("makeMarkdown.emphasis",(function(e,t){"use strict";var r="";if(e.hasChildNodes()){r+="*";for(var n=e.childNodes,o=n.length,i=0;i",e.hasAttribute("width")&&e.hasAttribute("height")&&(t+=" ="+e.getAttribute("width")+"x"+e.getAttribute("height")),e.hasAttribute("title")&&(t+=' "'+e.getAttribute("title")+'"'),t+=")"),t})),a.subParser("makeMarkdown.links",(function(e,t){"use strict";var r="";if(e.hasChildNodes()&&e.hasAttribute("href")){var n=e.childNodes,o=n.length;r="[";for(var i=0;i",e.hasAttribute("title")&&(r+=' "'+e.getAttribute("title")+'"'),r+=")"}return r})),a.subParser("makeMarkdown.list",(function(e,t,r){"use strict";var n="";if(!e.hasChildNodes())return"";for(var o=e.childNodes,i=o.length,s=e.getAttribute("start")||1,c=0;c"+t.preList[r]+""})),a.subParser("makeMarkdown.strikethrough",(function(e,t){"use strict";var r="";if(e.hasChildNodes()){r+="~~";for(var n=e.childNodes,o=n.length,i=0;itr>th"),c=e.querySelectorAll("tbody>tr");for(r=0;rf&&(f=g)}for(r=0;r/g,"\\$1>")).replace(/^#/gm,"\\#")).replace(/^(\s*)([-=]{3,})(\s*)$/,"$1\\$2$3")).replace(/^( {0,3}\d+)\./gm,"$1\\.")).replace(/^( {0,3})([+-])/gm,"$1\\$2")).replace(/]([\s]*)\(/g,"\\]$1\\(")).replace(/^ {0,3}\[([\S \t]*?)]:/gm,"\\[$1]:")}));void 0===(n=function(){"use strict";return a}.call(t,r,t,e))||(e.exports=n)}).call(this)}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var a=t[n]={exports:{}};return e[n].call(a.exports,a,a.exports,r),a.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};(()=>{"use strict";r.r(n),r.d(n,{__EXPERIMENTAL_ELEMENTS:()=>ee,__EXPERIMENTAL_PATHS_WITH_OVERRIDE:()=>te,__EXPERIMENTAL_STYLE_PROPERTY:()=>J,__experimentalCloneSanitizedBlock:()=>xr,__experimentalGetAccessibleBlockLabel:()=>Ke,__experimentalGetBlockAttributesNamesByRole:()=>Ze,__experimentalGetBlockLabel:()=>Ge,__experimentalSanitizeBlockAttributes:()=>Ye,__unstableGetBlockProps:()=>Wr,__unstableGetInnerBlocksProps:()=>Yr,__unstableSerializeAndClean:()=>tn,children:()=>Jn,cloneBlock:()=>Er,createBlock:()=>Tr,createBlocksFromInnerBlocksTemplate:()=>Cr,doBlocksMatchTemplate:()=>oa,findTransform:()=>Lr,getBlockAttributes:()=>ao,getBlockAttributesNamesByRole:()=>Qe,getBlockBindingsSource:()=>ze,getBlockBindingsSources:()=>Ie,getBlockContent:()=>Xr,getBlockDefaultClassName:()=>Fr,getBlockFromExample:()=>zr,getBlockMenuDefaultClassName:()=>qr,getBlockSupport:()=>Te,getBlockTransforms:()=>Mr,getBlockType:()=>we,getBlockTypes:()=>ve,getBlockVariations:()=>Oe,getCategories:()=>ta,getChildBlockNames:()=>Se,getDefaultBlockName:()=>ke,getFreeformContentHandlerName:()=>fe,getGroupingBlockName:()=>ge,getPhrasingContentSchema:()=>Po,getPossibleBlockTransformations:()=>Or,getSaveContent:()=>Zr,getSaveElement:()=>Qr,getUnregisteredTypeHandlerName:()=>be,hasBlockSupport:()=>Ce,hasChildBlocks:()=>Be,hasChildBlocksWithInserterSupport:()=>Ae,isReusableBlock:()=>xe,isTemplatePart:()=>Ee,isUnmodifiedBlock:()=>Ve,isUnmodifiedDefaultBlock:()=>$e,isValidBlockContent:()=>Hn,isValidIcon:()=>Ue,node:()=>Yn,normalizeIconObject:()=>Fe,parse:()=>po,parseWithAttributeSchema:()=>oo,pasteHandler:()=>ea,privateApis:()=>ua,rawHandler:()=>Oo,registerBlockBindingsSource:()=>je,registerBlockCollection:()=>de,registerBlockStyle:()=>Ne,registerBlockType:()=>le,registerBlockVariation:()=>Le,serialize:()=>rn,serializeRawBlock:()=>$r,setCategories:()=>ra,setDefaultBlockName:()=>_e,setFreeformContentHandlerName:()=>he,setGroupingBlockName:()=>ye,setUnregisteredTypeHandlerName:()=>me,store:()=>gr,switchToBlockType:()=>Dr,synchronizeBlocksWithTemplate:()=>la,unregisterBlockBindingsSource:()=>De,unregisterBlockStyle:()=>Pe,unregisterBlockType:()=>pe,unregisterBlockVariation:()=>Me,unstable__bootstrapServerSideBlockDefinitions:()=>se,updateCategory:()=>na,validateBlock:()=>Rn,withBlockContentContext:()=>da});var e={};r.r(e),r.d(e,{getAllBlockBindingsSources:()=>yt,getBlockBindingsSource:()=>kt,getBootstrappedBlockType:()=>bt,getSupportedStyles:()=>mt,getUnprocessedBlockTypes:()=>_t,hasContentRoleAttribute:()=>wt});var t={};r.r(t),r.d(t,{__experimentalHasContentRoleAttribute:()=>$t,getActiveBlockVariation:()=>St,getBlockStyles:()=>xt,getBlockSupport:()=>Dt,getBlockType:()=>Ct,getBlockTypes:()=>Tt,getBlockVariations:()=>Et,getCategories:()=>At,getChildBlockNames:()=>jt,getCollections:()=>Nt,getDefaultBlockName:()=>Pt,getDefaultBlockVariation:()=>Bt,getFreeformFallbackBlockName:()=>Ot,getGroupingBlockName:()=>Mt,getUnregisteredFallbackBlockName:()=>Lt,hasBlockSupport:()=>zt,hasChildBlocks:()=>Ht,hasChildBlocksWithInserterSupport:()=>Vt,isMatchingSearchTerm:()=>Rt});var o={};r.r(o),r.d(o,{__experimentalReapplyBlockFilters:()=>Zt,addBlockCollection:()=>lr,addBlockStyles:()=>Jt,addBlockTypes:()=>Yt,addBlockVariations:()=>tr,reapplyBlockTypeFilters:()=>Qt,removeBlockCollection:()=>ur,removeBlockStyles:()=>er,removeBlockTypes:()=>Xt,removeBlockVariations:()=>rr,setCategories:()=>sr,setDefaultBlockName:()=>nr,setFreeformFallbackBlockName:()=>or,setGroupingBlockName:()=>ir,setUnregisteredFallbackBlockName:()=>ar,updateCategory:()=>cr});var a={};r.r(a),r.d(a,{addBlockBindingsSource:()=>hr,addBootstrappedBlockType:()=>dr,addUnprocessedBlockType:()=>pr,removeBlockBindingsSource:()=>fr});const i=window.wp.data;var s=function(){return s=Object.assign||function(e){for(var t,r=1,n=arguments.length;r0&&r>="0"&&r<="9"?"_"+r+n:""+r.toUpperCase()+n}function h(e,t){return void 0===t&&(t={}),function(e,t){void 0===t&&(t={});for(var r=t.splitRegexp,n=void 0===r?l:r,o=t.stripRegexp,a=void 0===o?u:o,i=t.transform,s=void 0===i?c:i,p=t.delimiter,h=void 0===p?" ":p,f=d(d(e,n,"$1\0$2"),a,"\0"),g=0,m=f.length;"\0"===f.charAt(g);)g++;for(;"\0"===f.charAt(m-1);)m--;return f.slice(g,m).split("\0").map(s).join(h)}(e,s({delimiter:"",transform:p},t))}function f(e,t){return 0===t?e.toLowerCase():p(e,t)}const g=window.wp.i18n;var m={grad:.9,turn:360,rad:360/(2*Math.PI)},b=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},_=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=Math.pow(10,t)),Math.round(r*e)/r+0},y=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=1),e>r?r:e>t?e:t},k=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},w=function(e){return{r:y(e.r,0,255),g:y(e.g,0,255),b:y(e.b,0,255),a:y(e.a)}},v=function(e){return{r:_(e.r),g:_(e.g),b:_(e.b),a:_(e.a,3)}},T=/^#([0-9a-f]{3,8})$/i,C=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},x=function(e){var t=e.r,r=e.g,n=e.b,o=e.a,a=Math.max(t,r,n),i=a-Math.min(t,r,n),s=i?a===t?(r-n)/i:a===r?2+(n-t)/i:4+(t-r)/i:0;return{h:60*(s<0?s+6:s),s:a?i/a*100:0,v:a/255*100,a:o}},E=function(e){var t=e.h,r=e.s,n=e.v,o=e.a;t=t/360*6,r/=100,n/=100;var a=Math.floor(t),i=n*(1-r),s=n*(1-(t-a)*r),c=n*(1-(1-t+a)*r),l=a%6;return{r:255*[n,s,i,i,c,n][l],g:255*[c,n,n,s,i,i][l],b:255*[i,i,c,n,n,s][l],a:o}},S=function(e){return{h:k(e.h),s:y(e.s,0,100),l:y(e.l,0,100),a:y(e.a)}},B=function(e){return{h:_(e.h),s:_(e.s),l:_(e.l),a:_(e.a,3)}},A=function(e){return E((r=(t=e).s,{h:t.h,s:(r*=((n=t.l)<50?n:100-n)/100)>0?2*r/(n+r)*100:0,v:n+r,a:t.a}));var t,r,n},N=function(e){return{h:(t=x(e)).h,s:(o=(200-(r=t.s))*(n=t.v)/100)>0&&o<200?r*n/100/(o<=100?o:200-o)*100:0,l:o/2,a:t.a};var t,r,n,o},P=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,O=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,L=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,M=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,j={string:[[function(e){var t=T.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:4===e.length?_(parseInt(e[3]+e[3],16)/255,2):1}:6===e.length||8===e.length?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:8===e.length?_(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=L.exec(e)||M.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:w({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=P.exec(e)||O.exec(e);if(!t)return null;var r,n,o=S({h:(r=t[1],n=t[2],void 0===n&&(n="deg"),Number(r)*(m[n]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return A(o)},"hsl"]],object:[[function(e){var t=e.r,r=e.g,n=e.b,o=e.a,a=void 0===o?1:o;return b(t)&&b(r)&&b(n)?w({r:Number(t),g:Number(r),b:Number(n),a:Number(a)}):null},"rgb"],[function(e){var t=e.h,r=e.s,n=e.l,o=e.a,a=void 0===o?1:o;if(!b(t)||!b(r)||!b(n))return null;var i=S({h:Number(t),s:Number(r),l:Number(n),a:Number(a)});return A(i)},"hsl"],[function(e){var t=e.h,r=e.s,n=e.v,o=e.a,a=void 0===o?1:o;if(!b(t)||!b(r)||!b(n))return null;var i=function(e){return{h:k(e.h),s:y(e.s,0,100),v:y(e.v,0,100),a:y(e.a)}}({h:Number(t),s:Number(r),v:Number(n),a:Number(a)});return E(i)},"hsv"]]},D=function(e,t){for(var r=0;r=.5},e.prototype.toHex=function(){return t=(e=v(this.rgba)).r,r=e.g,n=e.b,a=(o=e.a)<1?C(_(255*o)):"","#"+C(t)+C(r)+C(n)+a;var e,t,r,n,o,a},e.prototype.toRgb=function(){return v(this.rgba)},e.prototype.toRgbString=function(){return t=(e=v(this.rgba)).r,r=e.g,n=e.b,(o=e.a)<1?"rgba("+t+", "+r+", "+n+", "+o+")":"rgb("+t+", "+r+", "+n+")";var e,t,r,n,o},e.prototype.toHsl=function(){return B(N(this.rgba))},e.prototype.toHslString=function(){return t=(e=B(N(this.rgba))).h,r=e.s,n=e.l,(o=e.a)<1?"hsla("+t+", "+r+"%, "+n+"%, "+o+")":"hsl("+t+", "+r+"%, "+n+"%)";var e,t,r,n,o},e.prototype.toHsv=function(){return e=x(this.rgba),{h:_(e.h),s:_(e.s),v:_(e.v),a:_(e.a,3)};var e},e.prototype.invert=function(){return $({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},e.prototype.saturate=function(e){return void 0===e&&(e=.1),$(I(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),$(I(this.rgba,-e))},e.prototype.grayscale=function(){return $(I(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),$(H(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),$(H(this.rgba,-e))},e.prototype.rotate=function(e){return void 0===e&&(e=15),this.hue(this.hue()+e)},e.prototype.alpha=function(e){return"number"==typeof e?$({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):_(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=N(this.rgba);return"number"==typeof e?$({h:e,s:t.s,l:t.l,a:t.a}):_(t.h)},e.prototype.isEqual=function(e){return this.toHex()===$(e).toHex()},e}(),$=function(e){return e instanceof V?e:new V(e)},U=[];var F=function(e){var t=e/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},q=function(e){return.2126*F(e.r)+.7152*F(e.g)+.0722*F(e.b)};const G=window.wp.element,K=window.wp.dom,W=window.wp.richText,Y=window.wp.deprecated;var Q=r.n(Y);const Z="block-default",X=["attributes","supports","save","migrate","isEligible","apiVersion"],J={"--wp--style--color--link":{value:["color","link"],support:["color","link"]},aspectRatio:{value:["dimensions","aspectRatio"],support:["dimensions","aspectRatio"],useEngine:!0},background:{value:["color","gradient"],support:["color","gradients"],useEngine:!0},backgroundColor:{value:["color","background"],support:["color","background"],requiresOptOut:!0,useEngine:!0},backgroundImage:{value:["background","backgroundImage"],support:["background","backgroundImage"],useEngine:!0},backgroundRepeat:{value:["background","backgroundRepeat"],support:["background","backgroundRepeat"],useEngine:!0},backgroundSize:{value:["background","backgroundSize"],support:["background","backgroundSize"],useEngine:!0},backgroundPosition:{value:["background","backgroundPosition"],support:["background","backgroundPosition"],useEngine:!0},borderColor:{value:["border","color"],support:["__experimentalBorder","color"],useEngine:!0},borderRadius:{value:["border","radius"],support:["__experimentalBorder","radius"],properties:{borderTopLeftRadius:"topLeft",borderTopRightRadius:"topRight",borderBottomLeftRadius:"bottomLeft",borderBottomRightRadius:"bottomRight"},useEngine:!0},borderStyle:{value:["border","style"],support:["__experimentalBorder","style"],useEngine:!0},borderWidth:{value:["border","width"],support:["__experimentalBorder","width"],useEngine:!0},borderTopColor:{value:["border","top","color"],support:["__experimentalBorder","color"],useEngine:!0},borderTopStyle:{value:["border","top","style"],support:["__experimentalBorder","style"],useEngine:!0},borderTopWidth:{value:["border","top","width"],support:["__experimentalBorder","width"],useEngine:!0},borderRightColor:{value:["border","right","color"],support:["__experimentalBorder","color"],useEngine:!0},borderRightStyle:{value:["border","right","style"],support:["__experimentalBorder","style"],useEngine:!0},borderRightWidth:{value:["border","right","width"],support:["__experimentalBorder","width"],useEngine:!0},borderBottomColor:{value:["border","bottom","color"],support:["__experimentalBorder","color"],useEngine:!0},borderBottomStyle:{value:["border","bottom","style"],support:["__experimentalBorder","style"],useEngine:!0},borderBottomWidth:{value:["border","bottom","width"],support:["__experimentalBorder","width"],useEngine:!0},borderLeftColor:{value:["border","left","color"],support:["__experimentalBorder","color"],useEngine:!0},borderLeftStyle:{value:["border","left","style"],support:["__experimentalBorder","style"],useEngine:!0},borderLeftWidth:{value:["border","left","width"],support:["__experimentalBorder","width"],useEngine:!0},color:{value:["color","text"],support:["color","text"],requiresOptOut:!0,useEngine:!0},columnCount:{value:["typography","textColumns"],support:["typography","textColumns"],useEngine:!0},filter:{value:["filter","duotone"],support:["filter","duotone"]},linkColor:{value:["elements","link","color","text"],support:["color","link"]},captionColor:{value:["elements","caption","color","text"],support:["color","caption"]},buttonColor:{value:["elements","button","color","text"],support:["color","button"]},buttonBackgroundColor:{value:["elements","button","color","background"],support:["color","button"]},headingColor:{value:["elements","heading","color","text"],support:["color","heading"]},headingBackgroundColor:{value:["elements","heading","color","background"],support:["color","heading"]},fontFamily:{value:["typography","fontFamily"],support:["typography","__experimentalFontFamily"],useEngine:!0},fontSize:{value:["typography","fontSize"],support:["typography","fontSize"],useEngine:!0},fontStyle:{value:["typography","fontStyle"],support:["typography","__experimentalFontStyle"],useEngine:!0},fontWeight:{value:["typography","fontWeight"],support:["typography","__experimentalFontWeight"],useEngine:!0},lineHeight:{value:["typography","lineHeight"],support:["typography","lineHeight"],useEngine:!0},margin:{value:["spacing","margin"],support:["spacing","margin"],properties:{marginTop:"top",marginRight:"right",marginBottom:"bottom",marginLeft:"left"},useEngine:!0},minHeight:{value:["dimensions","minHeight"],support:["dimensions","minHeight"],useEngine:!0},padding:{value:["spacing","padding"],support:["spacing","padding"],properties:{paddingTop:"top",paddingRight:"right",paddingBottom:"bottom",paddingLeft:"left"},useEngine:!0},textAlign:{value:["typography","textAlign"],support:["typography","textAlign"],useEngine:!1},textDecoration:{value:["typography","textDecoration"],support:["typography","__experimentalTextDecoration"],useEngine:!0},textTransform:{value:["typography","textTransform"],support:["typography","__experimentalTextTransform"],useEngine:!0},letterSpacing:{value:["typography","letterSpacing"],support:["typography","__experimentalLetterSpacing"],useEngine:!0},writingMode:{value:["typography","writingMode"],support:["typography","__experimentalWritingMode"],useEngine:!0},"--wp--style--root--padding":{value:["spacing","padding"],support:["spacing","padding"],properties:{"--wp--style--root--padding-top":"top","--wp--style--root--padding-right":"right","--wp--style--root--padding-bottom":"bottom","--wp--style--root--padding-left":"left"},rootOnly:!0}},ee={link:"a:where(:not(.wp-element-button))",heading:"h1, h2, h3, h4, h5, h6",h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",button:".wp-element-button, .wp-block-button__link",caption:".wp-element-caption, .wp-block-audio figcaption, .wp-block-embed figcaption, .wp-block-gallery figcaption, .wp-block-image figcaption, .wp-block-table figcaption, .wp-block-video figcaption",cite:"cite"},te={"color.duotone":!0,"color.gradients":!0,"color.palette":!0,"dimensions.aspectRatios":!0,"typography.fontSizes":!0,"spacing.spacingSizes":!0},re=(window.wp.warning,window.wp.privateApis),{lock:ne,unlock:oe}=(0,re.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/blocks"),ae={title:"block title",description:"block description",keywords:["block keyword"],styles:[{label:"block style label"}],variations:[{title:"block variation title",description:"block variation description",keywords:["block variation keyword"]}]};function ie(e){return null!==e&&"object"==typeof e}function se(e){const{addBootstrappedBlockType:t}=oe((0,i.dispatch)(gr));for(const[r,n]of Object.entries(e))t(r,n)}function ce({textdomain:e,...t}){const r=["apiVersion","title","category","parent","ancestor","icon","description","keywords","attributes","providesContext","usesContext","selectors","supports","styles","example","variations","blockHooks","allowedBlocks"],n=Object.fromEntries(Object.entries(t).filter((([e])=>r.includes(e))));return e&&Object.keys(ae).forEach((t=>{n[t]&&(n[t]=ue(ae[t],n[t],e))})),n}function le(e,t){const r=ie(e)?e.name:e;if("string"!=typeof r)return;if(!/^[a-z][a-z0-9-]*\/[a-z][a-z0-9-]*$/.test(r))return;if((0,i.select)(gr).getBlockType(r))return;const{addBootstrappedBlockType:n,addUnprocessedBlockType:o}=oe((0,i.dispatch)(gr));if(ie(e)){n(r,ce(e))}return o(r,t),(0,i.select)(gr).getBlockType(r)}function ue(e,t,r){return"string"==typeof e&&"string"==typeof t?(0,g._x)(t,e,r):Array.isArray(e)&&e.length&&Array.isArray(t)?t.map((t=>ue(e[0],t,r))):ie(e)&&Object.entries(e).length&&ie(t)?Object.keys(t).reduce(((n,o)=>e[o]?(n[o]=ue(e[o],t[o],r),n):(n[o]=t[o],n)),{}):t}function de(e,{title:t,icon:r}){(0,i.dispatch)(gr).addBlockCollection(e,t,r)}function pe(e){const t=(0,i.select)(gr).getBlockType(e);if(t)return(0,i.dispatch)(gr).removeBlockTypes(e),t}function he(e){(0,i.dispatch)(gr).setFreeformFallbackBlockName(e)}function fe(){return(0,i.select)(gr).getFreeformFallbackBlockName()}function ge(){return(0,i.select)(gr).getGroupingBlockName()}function me(e){(0,i.dispatch)(gr).setUnregisteredFallbackBlockName(e)}function be(){return(0,i.select)(gr).getUnregisteredFallbackBlockName()}function _e(e){(0,i.dispatch)(gr).setDefaultBlockName(e)}function ye(e){(0,i.dispatch)(gr).setGroupingBlockName(e)}function ke(){return(0,i.select)(gr).getDefaultBlockName()}function we(e){return(0,i.select)(gr)?.getBlockType(e)}function ve(){return(0,i.select)(gr).getBlockTypes()}function Te(e,t,r){return(0,i.select)(gr).getBlockSupport(e,t,r)}function Ce(e,t,r){return(0,i.select)(gr).hasBlockSupport(e,t,r)}function xe(e){return"core/block"===e?.name}function Ee(e){return"core/template-part"===e?.name}const Se=e=>(0,i.select)(gr).getChildBlockNames(e),Be=e=>(0,i.select)(gr).hasChildBlocks(e),Ae=e=>(0,i.select)(gr).hasChildBlocksWithInserterSupport(e),Ne=(e,t)=>{(0,i.dispatch)(gr).addBlockStyles(e,t)},Pe=(e,t)=>{(0,i.dispatch)(gr).removeBlockStyles(e,t)},Oe=(e,t)=>(0,i.select)(gr).getBlockVariations(e,t),Le=(e,t)=>{t.name,(0,i.dispatch)(gr).addBlockVariations(e,t)},Me=(e,t)=>{(0,i.dispatch)(gr).removeBlockVariations(e,t)},je=e=>{const{name:t,label:r,usesContext:n,getValues:o,setValues:a,canUserEditValue:s,getFieldsList:c}=e,l=oe((0,i.select)(gr)).getBlockBindingsSource(t),u=["label","usesContext"];for(const e in l)if(!u.includes(e)&&l[e])return;if(t&&"string"==typeof t&&!/[A-Z]+/.test(t)&&/^[a-z0-9/-]+$/.test(t)&&/^[a-z0-9-]+\/[a-z0-9-]+$/.test(t)&&(r||l?.label)&&(!r||"string"==typeof r)&&(!n||Array.isArray(n))&&!(o&&"function"!=typeof o||a&&"function"!=typeof a||s&&"function"!=typeof s||c&&"function"!=typeof c))return oe((0,i.dispatch)(gr)).addBlockBindingsSource(e)};function De(e){ze(e)&&oe((0,i.dispatch)(gr)).removeBlockBindingsSource(e)}function ze(e){return oe((0,i.select)(gr)).getBlockBindingsSource(e)}function Ie(){return oe((0,i.select)(gr)).getAllBlockBindingsSources()}!function(e){e.forEach((function(e){U.indexOf(e)<0&&(e(V,j),U.push(e))}))}([function(e,t){var r={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},n={};for(var o in r)n[r[o]]=o;var a={};e.prototype.toName=function(t){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var o,i,s=n[this.toHex()];if(s)return s;if(null==t?void 0:t.closest){var c=this.toRgb(),l=1/0,u="black";if(!a.length)for(var d in r)a[d]=new e(r[d]).toRgb();for(var p in r){var h=(o=c,i=a[p],Math.pow(o.r-i.r,2)+Math.pow(o.g-i.g,2)+Math.pow(o.b-i.b,2));h(c=q(i))?(s+.05)/(c+.05):(c+.05)/(s+.05),void 0===(n=2)&&(n=0),void 0===o&&(o=Math.pow(10,n)),Math.floor(o*r)/o+0},e.prototype.isReadable=function(e,t){return void 0===e&&(e="#FFF"),void 0===t&&(t={}),this.contrast(e)>=(i=void 0===(a=(r=t).size)?"normal":a,"AAA"===(o=void 0===(n=r.level)?"AA":n)&&"normal"===i?7:"AA"===o&&"large"===i?3:4.5);var r,n,o,a,i}}]);const Re=["#191e23","#f8f9f9"];function He(e,t){return e.hasOwnProperty("default")?t===e.default:"rich-text"===e.type?!t?.length:void 0===t}function Ve(e){var t;return Object.entries(null!==(t=we(e.name)?.attributes)&&void 0!==t?t:{}).every((([t,r])=>He(r,e.attributes[t])))}function $e(e){return e.name===ke()&&Ve(e)}function Ue(e){return!!e&&("string"==typeof e||(0,G.isValidElement)(e)||"function"==typeof e||e instanceof G.Component)}function Fe(e){if(Ue(e=e||Z))return{src:e};if("background"in e){const t=$(e.background),r=e=>t.contrast(e),n=Math.max(...Re.map(r));return{...e,foreground:e.foreground?e.foreground:Re.find((e=>r(e)===n)),shadowColor:t.alpha(.3).toRgbString()}}return e}function qe(e){return"string"==typeof e?we(e):e}function Ge(e,t,r="visual"){const{__experimentalLabel:n,title:o}=e,a=n&&n(t,{context:r});return a?a.toPlainText?a.toPlainText():(0,K.__unstableStripHTML)(a):o}function Ke(e,t,r,n="vertical"){const o=e?.title,a=e?Ge(e,t,"accessibility"):"",i=void 0!==r,s=a&&a!==o;return i&&"vertical"===n?s?(0,g.sprintf)((0,g.__)("%1$s Block. Row %2$d. %3$s"),o,r,a):(0,g.sprintf)((0,g.__)("%1$s Block. Row %2$d"),o,r):i&&"horizontal"===n?s?(0,g.sprintf)((0,g.__)("%1$s Block. Column %2$d. %3$s"),o,r,a):(0,g.sprintf)((0,g.__)("%1$s Block. Column %2$d"),o,r):s?(0,g.sprintf)((0,g.__)("%1$s Block. %2$s"),o,a):(0,g.sprintf)((0,g.__)("%s Block"),o)}function We(e){return void 0!==e.default?e.default:"rich-text"===e.type?new W.RichTextData:void 0}function Ye(e,t){const r=we(e);if(void 0===r)throw new Error(`Block type '${e}' is not registered.`);return Object.entries(r.attributes).reduce(((e,[r,n])=>{const o=t[r];if(void 0!==o)"rich-text"===n.type?o instanceof W.RichTextData?e[r]=o:"string"==typeof o&&(e[r]=W.RichTextData.fromHTMLString(o)):"string"===n.type&&o instanceof W.RichTextData?e[r]=o.toHTMLString():e[r]=o;else{const t=We(n);void 0!==t&&(e[r]=t)}return-1!==["node","children"].indexOf(n.source)&&("string"==typeof e[r]?e[r]=[e[r]]:Array.isArray(e[r])||(e[r]=[])),e}),{})}function Qe(e,t){const r=we(e)?.attributes;if(!r)return[];const n=Object.keys(r);return t?n.filter((n=>{const o=r[n];return o?.role===t||o?.__experimentalRole===t&&(Q()("__experimentalRole attribute",{since:"6.7",version:"6.8",alternative:"role attribute",hint:`Check the block.json of the ${e} block.`}),!0)})):n}const Ze=(...e)=>(Q()("__experimentalGetBlockAttributesNamesByRole",{since:"6.7",version:"6.8",alternative:"getBlockAttributesNamesByRole"}),Qe(...e));function Xe(e,t){return Object.fromEntries(Object.entries(e).filter((([e])=>!t.includes(e))))}const Je=[{slug:"text",title:(0,g.__)("Text")},{slug:"media",title:(0,g.__)("Media")},{slug:"design",title:(0,g.__)("Design")},{slug:"widgets",title:(0,g.__)("Widgets")},{slug:"theme",title:(0,g.__)("Theme")},{slug:"embed",title:(0,g.__)("Embeds")},{slug:"reusable",title:(0,g.__)("Reusable blocks")}];function et(e){return e.reduce(((e,t)=>({...e,[t.name]:t})),{})}function tt(e){return e.reduce(((e,t)=>(e.some((e=>e.name===t.name))||e.push(t),e)),[])}function rt(e){return(t=null,r)=>{switch(r.type){case"REMOVE_BLOCK_TYPES":return-1!==r.names.indexOf(t)?null:t;case e:return r.name||null}return t}}const nt=rt("SET_DEFAULT_BLOCK_NAME"),ot=rt("SET_FREEFORM_FALLBACK_BLOCK_NAME"),at=rt("SET_UNREGISTERED_FALLBACK_BLOCK_NAME"),it=rt("SET_GROUPING_BLOCK_NAME");function st(e=[],t=[]){const r=Array.from(new Set(e.concat(t)));return r.length>0?r:void 0}const ct=(0,i.combineReducers)({bootstrappedBlockTypes:function(e={},t){switch(t.type){case"ADD_BOOTSTRAPPED_BLOCK_TYPE":const{name:r,blockType:n}=t,o=e[r];let a;return o?(void 0===o.blockHooks&&n.blockHooks&&(a={...o,...a,blockHooks:n.blockHooks}),void 0===o.allowedBlocks&&n.allowedBlocks&&(a={...o,...a,allowedBlocks:n.allowedBlocks})):(a=Object.fromEntries(Object.entries(n).filter((([,e])=>null!=e)).map((([e,t])=>{return[(r=e,void 0===n&&(n={}),h(r,s({transform:f},n))),t];var r,n}))),a.name=r),a?{...e,[r]:a}:e;case"REMOVE_BLOCK_TYPES":return Xe(e,t.names)}return e},unprocessedBlockTypes:function(e={},t){switch(t.type){case"ADD_UNPROCESSED_BLOCK_TYPE":return{...e,[t.name]:t.blockType};case"REMOVE_BLOCK_TYPES":return Xe(e,t.names)}return e},blockTypes:function(e={},t){switch(t.type){case"ADD_BLOCK_TYPES":return{...e,...et(t.blockTypes)};case"REMOVE_BLOCK_TYPES":return Xe(e,t.names)}return e},blockStyles:function(e={},t){var r;switch(t.type){case"ADD_BLOCK_TYPES":return{...e,...Object.fromEntries(Object.entries(et(t.blockTypes)).map((([t,r])=>{var n,o;return[t,tt([...(null!==(n=r.styles)&&void 0!==n?n:[]).map((e=>({...e,source:"block"}))),...(null!==(o=e[r.name])&&void 0!==o?o:[]).filter((({source:e})=>"block"!==e))])]})))};case"ADD_BLOCK_STYLES":const n={};return t.blockNames.forEach((r=>{var o;n[r]=tt([...null!==(o=e[r])&&void 0!==o?o:[],...t.styles])})),{...e,...n};case"REMOVE_BLOCK_STYLES":return{...e,[t.blockName]:(null!==(r=e[t.blockName])&&void 0!==r?r:[]).filter((e=>-1===t.styleNames.indexOf(e.name)))}}return e},blockVariations:function(e={},t){var r,n;switch(t.type){case"ADD_BLOCK_TYPES":return{...e,...Object.fromEntries(Object.entries(et(t.blockTypes)).map((([t,r])=>{var n,o;return[t,tt([...(null!==(n=r.variations)&&void 0!==n?n:[]).map((e=>({...e,source:"block"}))),...(null!==(o=e[r.name])&&void 0!==o?o:[]).filter((({source:e})=>"block"!==e))])]})))};case"ADD_BLOCK_VARIATIONS":return{...e,[t.blockName]:tt([...null!==(r=e[t.blockName])&&void 0!==r?r:[],...t.variations])};case"REMOVE_BLOCK_VARIATIONS":return{...e,[t.blockName]:(null!==(n=e[t.blockName])&&void 0!==n?n:[]).filter((e=>-1===t.variationNames.indexOf(e.name)))}}return e},defaultBlockName:nt,freeformFallbackBlockName:ot,unregisteredFallbackBlockName:at,groupingBlockName:it,categories:function(e=Je,t){switch(t.type){case"SET_CATEGORIES":const r=new Map;return(t.categories||[]).forEach((e=>{r.set(e.slug,e)})),[...r.values()];case"UPDATE_CATEGORY":if(!t.category||!Object.keys(t.category).length)return e;if(e.find((({slug:e})=>e===t.slug)))return e.map((e=>e.slug===t.slug?{...e,...t.category}:e))}return e},collections:function(e={},t){switch(t.type){case"ADD_BLOCK_COLLECTION":return{...e,[t.namespace]:{title:t.title,icon:t.icon}};case"REMOVE_BLOCK_COLLECTION":return Xe(e,t.namespace)}return e},blockBindingsSources:function(e={},t){switch(t.type){case"ADD_BLOCK_BINDINGS_SOURCE":let r;return"core/post-meta"===t.name&&(r=t.getFieldsList),{...e,[t.name]:{label:t.label||e[t.name]?.label,usesContext:st(e[t.name]?.usesContext,t.usesContext),getValues:t.getValues,setValues:t.setValues,canUserEditValue:t.setValues&&t.canUserEditValue,getFieldsList:r}};case"REMOVE_BLOCK_BINDINGS_SOURCE":return Xe(e,t.name)}return e}});var lt=r(9681),ut=r.n(lt);const dt=(e,t,r)=>{var n;const o=Array.isArray(t)?t:t.split(".");let a=e;return o.forEach((e=>{a=a?.[e]})),null!==(n=a)&&void 0!==n?n:r};function pt(e){return"object"==typeof e&&e.constructor===Object&&null!==e}function ht(e,t){return pt(e)&&pt(t)?Object.entries(t).every((([t,r])=>ht(e?.[t],r))):e===t}const ft=["background","backgroundColor","color","linkColor","captionColor","buttonColor","headingColor","fontFamily","fontSize","fontStyle","fontWeight","lineHeight","padding","contentSize","wideSize","blockGap","textDecoration","textTransform","letterSpacing"];function gt(e,t,r){return e.filter((e=>("fontSize"!==e||"heading"!==r)&&(!("textDecoration"===e&&!t&&"link"!==r)&&(!("textTransform"===e&&!t&&!["heading","h1","h2","h3","h4","h5","h6"].includes(r)&&"button"!==r&&"caption"!==r&&"text"!==r)&&(!("letterSpacing"===e&&!t&&!["heading","h1","h2","h3","h4","h5","h6"].includes(r)&&"button"!==r&&"caption"!==r&&"text"!==r)&&!("textColumns"===e&&!t))))))}const mt=(0,i.createSelector)(((e,t,r)=>{if(!t)return gt(ft,t,r);const n=Ct(e,t);if(!n)return[];const o=[];return n?.supports?.spacing?.blockGap&&o.push("blockGap"),n?.supports?.shadow&&o.push("shadow"),Object.keys(J).forEach((e=>{J[e].support&&(J[e].requiresOptOut&&J[e].support[0]in n.supports&&!1!==dt(n.supports,J[e].support)||dt(n.supports,J[e].support,!1))&&o.push(e)})),gt(o,t,r)}),((e,t)=>[e.blockTypes[t]]));function bt(e,t){return e.bootstrappedBlockTypes[t]}function _t(e){return e.unprocessedBlockTypes}function yt(e){return e.blockBindingsSources}function kt(e,t){return e.blockBindingsSources[t]}const wt=(e,t)=>{const r=Ct(e,t);return!!r&&Object.values(r.attributes).some((({role:e,__experimentalRole:r})=>"content"===e||"content"===r&&(Q()("__experimentalRole attribute",{since:"6.7",version:"6.8",alternative:"role attribute",hint:`Check the block.json of the ${t} block.`}),!0)))},vt=(e,t)=>"string"==typeof t?Ct(e,t):t,Tt=(0,i.createSelector)((e=>Object.values(e.blockTypes)),(e=>[e.blockTypes]));function Ct(e,t){return e.blockTypes[t]}function xt(e,t){return e.blockStyles[t]}const Et=(0,i.createSelector)(((e,t,r)=>{const n=e.blockVariations[t];return n&&r?n.filter((e=>(e.scope||["block","inserter"]).includes(r))):n}),((e,t)=>[e.blockVariations[t]]));function St(e,t,r,n){const o=Et(e,t,n);if(!o)return o;const a=Ct(e,t),i=Object.keys(a?.attributes||{});let s,c=0;for(const e of o)if(Array.isArray(e.isActive)){const t=e.isActive.filter((e=>{const t=e.split(".")[0];return i.includes(t)})),n=t.length;if(0===n)continue;t.every((t=>{const n=dt(e.attributes,t);if(void 0===n)return!1;let o=dt(r,t);return o instanceof W.RichTextData&&(o=o.toHTMLString()),ht(o,n)}))&&n>c&&(s=e,c=n)}else if(e.isActive?.(r,e.attributes))return s||e;return s}function Bt(e,t,r){const n=Et(e,t,r);return[...n].reverse().find((({isDefault:e})=>!!e))||n[0]}function At(e){return e.categories}function Nt(e){return e.collections}function Pt(e){return e.defaultBlockName}function Ot(e){return e.freeformFallbackBlockName}function Lt(e){return e.unregisteredFallbackBlockName}function Mt(e){return e.groupingBlockName}const jt=(0,i.createSelector)(((e,t)=>Tt(e).filter((e=>e.parent?.includes(t))).map((({name:e})=>e))),(e=>[e.blockTypes])),Dt=(e,t,r,n)=>{const o=vt(e,t);return o?.supports?dt(o.supports,r,n):n};function zt(e,t,r,n){return!!Dt(e,t,r,n)}function It(e){return ut()(null!=e?e:"").toLowerCase().trim()}function Rt(e,t,r=""){const n=vt(e,t),o=It(r),a=e=>It(e).includes(o);return a(n.title)||n.keywords?.some(a)||a(n.category)||"string"==typeof n.description&&a(n.description)}const Ht=(e,t)=>jt(e,t).length>0,Vt=(e,t)=>jt(e,t).some((t=>zt(e,t,"inserter",!0))),$t=(...e)=>(Q()("__experimentalHasContentRoleAttribute",{since:"6.7",version:"6.8",hint:"This is a private selector."}),wt(...e)); + */function b(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:switch(e=e.type){case a:case s:case i:case p:case f:return e;default:switch(e=e&&e.$$typeof){case u:case l:case d:case g:case h:case c:return e;default:return t}}case o:return t}}}r=Symbol.for("react.module.reference"),t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===a||e===s||e===i||e===p||e===f||e===m||"object"==typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===h||e.$$typeof===c||e.$$typeof===l||e.$$typeof===d||e.$$typeof===r||void 0!==e.getModuleId)}},8529:(e,t,r)=>{"use strict";e.exports=r(5373)},9681:e=>{var t={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ả:"A",Ạ:"A",Ẩ:"A",Ẫ:"A",Ậ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ẻ:"E",Ẽ:"E",Ẹ:"E",Ể:"E",Ễ:"E",Ệ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ỉ:"I",Ị:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ỏ:"O",Ọ:"O",Ổ:"O",Ỗ:"O",Ộ:"O",Ờ:"O",Ở:"O",Ỡ:"O",Ớ:"O",Ợ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ủ:"U",Ụ:"U",Ử:"U",Ữ:"U",Ự:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ả:"a",ạ:"a",ẩ:"a",ẫ:"a",ậ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ẻ:"e",ẽ:"e",ẹ:"e",ể:"e",ễ:"e",ệ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ỉ:"i",ị:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ỏ:"o",ọ:"o",ổ:"o",ỗ:"o",ộ:"o",ờ:"o",ở:"o",ỡ:"o",ớ:"o",ợ:"o",ù:"u",ú:"u",û:"u",ü:"u",ủ:"u",ụ:"u",ử:"u",ữ:"u",ự:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"C",ċ:"c",Č:"C",č:"c",C̆:"C",c̆:"c",Ď:"D",ď:"d",Đ:"D",đ:"d",Ē:"E",ē:"e",Ĕ:"E",ĕ:"e",Ė:"E",ė:"e",Ę:"E",ę:"e",Ě:"E",ě:"e",Ĝ:"G",Ǵ:"G",ĝ:"g",ǵ:"g",Ğ:"G",ğ:"g",Ġ:"G",ġ:"g",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",Ḫ:"H",ḫ:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",IJ:"IJ",ij:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",Ḱ:"K",ḱ:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",Ḿ:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ʼn:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",Ẃ:"W",ẃ:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",Ứ:"U",ứ:"u",Ṹ:"U",ṹ:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",Ṕ:"P",ṕ:"p",Ṥ:"S",ṥ:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",Ồ:"O",ồ:"o",Ṑ:"O",ṑ:"o",Ừ:"U",ừ:"u",Ẁ:"W",ẁ:"w",Ỳ:"Y",ỳ:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",Ṧ:"S",ṧ:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",Ḑ:"D",ḑ:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z",й:"и",Й:"И",ё:"е",Ё:"Е"},r=Object.keys(t).join("|"),n=new RegExp(r,"g"),o=new RegExp(r,"");function a(e){return t[e]}var i=function(e){return e.replace(n,a)};e.exports=i,e.exports.has=function(e){return!!e.match(o)},e.exports.remove=i},1030:function(e,t,r){var n;/*! showdown v 1.9.1 - 02-11-2019 */ +(function(){function o(e){"use strict";var t={omitExtraWLInCodeBlocks:{defaultValue:!1,describe:"Omit the default extra whiteline added to code blocks",type:"boolean"},noHeaderId:{defaultValue:!1,describe:"Turn on/off generated header id",type:"boolean"},prefixHeaderId:{defaultValue:!1,describe:"Add a prefix to the generated header ids. Passing a string will prefix that string to the header id. Setting to true will add a generic 'section-' prefix",type:"string"},rawPrefixHeaderId:{defaultValue:!1,describe:'Setting this option to true will prevent showdown from modifying the prefix. This might result in malformed IDs (if, for instance, the " char is used in the prefix)',type:"boolean"},ghCompatibleHeaderId:{defaultValue:!1,describe:"Generate header ids compatible with github style (spaces are replaced with dashes, a bunch of non alphanumeric chars are removed)",type:"boolean"},rawHeaderId:{defaultValue:!1,describe:"Remove only spaces, ' and \" from generated header ids (including prefixes), replacing them with dashes (-). WARNING: This might result in malformed ids",type:"boolean"},headerLevelStart:{defaultValue:!1,describe:"The header blocks level start",type:"integer"},parseImgDimensions:{defaultValue:!1,describe:"Turn on/off image dimension parsing",type:"boolean"},simplifiedAutoLink:{defaultValue:!1,describe:"Turn on/off GFM autolink style",type:"boolean"},excludeTrailingPunctuationFromURLs:{defaultValue:!1,describe:"Excludes trailing punctuation from links generated with autoLinking",type:"boolean"},literalMidWordUnderscores:{defaultValue:!1,describe:"Parse midword underscores as literal underscores",type:"boolean"},literalMidWordAsterisks:{defaultValue:!1,describe:"Parse midword asterisks as literal asterisks",type:"boolean"},strikethrough:{defaultValue:!1,describe:"Turn on/off strikethrough support",type:"boolean"},tables:{defaultValue:!1,describe:"Turn on/off tables support",type:"boolean"},tablesHeaderId:{defaultValue:!1,describe:"Add an id to table headers",type:"boolean"},ghCodeBlocks:{defaultValue:!0,describe:"Turn on/off GFM fenced code blocks support",type:"boolean"},tasklists:{defaultValue:!1,describe:"Turn on/off GFM tasklist support",type:"boolean"},smoothLivePreview:{defaultValue:!1,describe:"Prevents weird effects in live previews due to incomplete input",type:"boolean"},smartIndentationFix:{defaultValue:!1,description:"Tries to smartly fix indentation in es6 strings",type:"boolean"},disableForced4SpacesIndentedSublists:{defaultValue:!1,description:"Disables the requirement of indenting nested sublists by 4 spaces",type:"boolean"},simpleLineBreaks:{defaultValue:!1,description:"Parses simple line breaks as
    (GFM Style)",type:"boolean"},requireSpaceBeforeHeadingText:{defaultValue:!1,description:"Makes adding a space between `#` and the header text mandatory (GFM Style)",type:"boolean"},ghMentions:{defaultValue:!1,description:"Enables github @mentions",type:"boolean"},ghMentionsLink:{defaultValue:"https://github.com/{u}",description:"Changes the link generated by @mentions. Only applies if ghMentions option is enabled.",type:"string"},encodeEmails:{defaultValue:!0,description:"Encode e-mail addresses through the use of Character Entities, transforming ASCII e-mail addresses into its equivalent decimal entities",type:"boolean"},openLinksInNewWindow:{defaultValue:!1,description:"Open all links in new windows",type:"boolean"},backslashEscapesHTMLTags:{defaultValue:!1,description:"Support for HTML Tag escaping. ex:
    foo
    ",type:"boolean"},emoji:{defaultValue:!1,description:"Enable emoji support. Ex: `this is a :smile: emoji`",type:"boolean"},underline:{defaultValue:!1,description:"Enable support for underline. Syntax is double or triple underscores: `__underline word__`. With this option enabled, underscores no longer parses into `` and ``",type:"boolean"},completeHTMLDocument:{defaultValue:!1,description:"Outputs a complete html document, including ``, `` and `` tags",type:"boolean"},metadata:{defaultValue:!1,description:"Enable support for document metadata (defined at the top of the document between `«««` and `»»»` or between `---` and `---`).",type:"boolean"},splitAdjacentBlockquotes:{defaultValue:!1,description:"Split adjacent blockquote blocks",type:"boolean"}};if(!1===e)return JSON.parse(JSON.stringify(t));var r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]=t[n].defaultValue);return r}var a={},i={},s={},c=o(!0),l="vanilla",u={github:{omitExtraWLInCodeBlocks:!0,simplifiedAutoLink:!0,excludeTrailingPunctuationFromURLs:!0,literalMidWordUnderscores:!0,strikethrough:!0,tables:!0,tablesHeaderId:!0,ghCodeBlocks:!0,tasklists:!0,disableForced4SpacesIndentedSublists:!0,simpleLineBreaks:!0,requireSpaceBeforeHeadingText:!0,ghCompatibleHeaderId:!0,ghMentions:!0,backslashEscapesHTMLTags:!0,emoji:!0,splitAdjacentBlockquotes:!0},original:{noHeaderId:!0,ghCodeBlocks:!1},ghost:{omitExtraWLInCodeBlocks:!0,parseImgDimensions:!0,simplifiedAutoLink:!0,excludeTrailingPunctuationFromURLs:!0,literalMidWordUnderscores:!0,strikethrough:!0,tables:!0,tablesHeaderId:!0,ghCodeBlocks:!0,tasklists:!0,smoothLivePreview:!0,simpleLineBreaks:!0,requireSpaceBeforeHeadingText:!0,ghMentions:!1,encodeEmails:!0},vanilla:o(!0),allOn:function(){"use strict";var e=o(!0),t={};for(var r in e)e.hasOwnProperty(r)&&(t[r]=!0);return t}()};function d(e,t){"use strict";var r=t?"Error in "+t+" extension->":"Error in unnamed extension",n={valid:!0,error:""};a.helper.isArray(e)||(e=[e]);for(var o=0;o").replace(/&/g,"&")};var f=function(e,t,r,n){"use strict";var o,a,i,s,c,l=n||"",u=l.indexOf("g")>-1,d=new RegExp(t+"|"+r,"g"+l.replace(/g/g,"")),p=new RegExp(t,l.replace(/g/g,"")),f=[];do{for(o=0;i=d.exec(e);)if(p.test(i[0]))o++||(s=(a=d.lastIndex)-i[0].length);else if(o&&! --o){c=i.index+i[0].length;var h={left:{start:s,end:a},match:{start:a,end:i.index},right:{start:i.index,end:c},wholeMatch:{start:s,end:c}};if(f.push(h),!u)return f}}while(o&&(d.lastIndex=a));return f};a.helper.matchRecursiveRegExp=function(e,t,r,n){"use strict";for(var o=f(e,t,r,n),a=[],i=0;i0){var u=[];0!==s[0].wholeMatch.start&&u.push(e.slice(0,s[0].wholeMatch.start));for(var d=0;d=0?n+(r||0):n},a.helper.splitAtIndex=function(e,t){"use strict";if(!a.helper.isString(e))throw"InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string";return[e.substring(0,t),e.substring(t)]},a.helper.encodeEmailAddress=function(e){"use strict";var t=[function(e){return"&#"+e.charCodeAt(0)+";"},function(e){return"&#x"+e.charCodeAt(0).toString(16)+";"},function(e){return e}];return e=e.replace(/./g,(function(e){if("@"===e)e=t[Math.floor(2*Math.random())](e);else{var r=Math.random();e=r>.9?t[2](e):r>.45?t[1](e):t[0](e)}return e}))},a.helper.padEnd=function(e,t,r){"use strict";return t|=0,r=String(r||" "),e.length>t?String(e):((t-=e.length)>r.length&&(r+=r.repeat(t/r.length)),String(e)+r.slice(0,t))},"undefined"==typeof console&&(console={warn:function(e){"use strict";alert(e)},log:function(e){"use strict";alert(e)},error:function(e){"use strict";throw e}}),a.helper.regexes={asteriskDashAndColon:/([*_:~])/g},a.helper.emojis={"+1":"👍","-1":"👎",100:"💯",1234:"🔢","1st_place_medal":"🥇","2nd_place_medal":"🥈","3rd_place_medal":"🥉","8ball":"🎱",a:"🅰️",ab:"🆎",abc:"🔤",abcd:"🔡",accept:"🉑",aerial_tramway:"🚡",airplane:"✈️",alarm_clock:"⏰",alembic:"⚗️",alien:"👽",ambulance:"🚑",amphora:"🏺",anchor:"⚓️",angel:"👼",anger:"💢",angry:"😠",anguished:"😧",ant:"🐜",apple:"🍎",aquarius:"♒️",aries:"♈️",arrow_backward:"◀️",arrow_double_down:"⏬",arrow_double_up:"⏫",arrow_down:"⬇️",arrow_down_small:"🔽",arrow_forward:"▶️",arrow_heading_down:"⤵️",arrow_heading_up:"⤴️",arrow_left:"⬅️",arrow_lower_left:"↙️",arrow_lower_right:"↘️",arrow_right:"➡️",arrow_right_hook:"↪️",arrow_up:"⬆️",arrow_up_down:"↕️",arrow_up_small:"🔼",arrow_upper_left:"↖️",arrow_upper_right:"↗️",arrows_clockwise:"🔃",arrows_counterclockwise:"🔄",art:"🎨",articulated_lorry:"🚛",artificial_satellite:"🛰",astonished:"😲",athletic_shoe:"👟",atm:"🏧",atom_symbol:"⚛️",avocado:"🥑",b:"🅱️",baby:"👶",baby_bottle:"🍼",baby_chick:"🐤",baby_symbol:"🚼",back:"🔙",bacon:"🥓",badminton:"🏸",baggage_claim:"🛄",baguette_bread:"🥖",balance_scale:"⚖️",balloon:"🎈",ballot_box:"🗳",ballot_box_with_check:"☑️",bamboo:"🎍",banana:"🍌",bangbang:"‼️",bank:"🏦",bar_chart:"📊",barber:"💈",baseball:"⚾️",basketball:"🏀",basketball_man:"⛹️",basketball_woman:"⛹️‍♀️",bat:"🦇",bath:"🛀",bathtub:"🛁",battery:"🔋",beach_umbrella:"🏖",bear:"🐻",bed:"🛏",bee:"🐝",beer:"🍺",beers:"🍻",beetle:"🐞",beginner:"🔰",bell:"🔔",bellhop_bell:"🛎",bento:"🍱",biking_man:"🚴",bike:"🚲",biking_woman:"🚴‍♀️",bikini:"👙",biohazard:"☣️",bird:"🐦",birthday:"🎂",black_circle:"⚫️",black_flag:"🏴",black_heart:"🖤",black_joker:"🃏",black_large_square:"⬛️",black_medium_small_square:"◾️",black_medium_square:"◼️",black_nib:"✒️",black_small_square:"▪️",black_square_button:"🔲",blonde_man:"👱",blonde_woman:"👱‍♀️",blossom:"🌼",blowfish:"🐡",blue_book:"📘",blue_car:"🚙",blue_heart:"💙",blush:"😊",boar:"🐗",boat:"⛵️",bomb:"💣",book:"📖",bookmark:"🔖",bookmark_tabs:"📑",books:"📚",boom:"💥",boot:"👢",bouquet:"💐",bowing_man:"🙇",bow_and_arrow:"🏹",bowing_woman:"🙇‍♀️",bowling:"🎳",boxing_glove:"🥊",boy:"👦",bread:"🍞",bride_with_veil:"👰",bridge_at_night:"🌉",briefcase:"💼",broken_heart:"💔",bug:"🐛",building_construction:"🏗",bulb:"💡",bullettrain_front:"🚅",bullettrain_side:"🚄",burrito:"🌯",bus:"🚌",business_suit_levitating:"🕴",busstop:"🚏",bust_in_silhouette:"👤",busts_in_silhouette:"👥",butterfly:"🦋",cactus:"🌵",cake:"🍰",calendar:"📆",call_me_hand:"🤙",calling:"📲",camel:"🐫",camera:"📷",camera_flash:"📸",camping:"🏕",cancer:"♋️",candle:"🕯",candy:"🍬",canoe:"🛶",capital_abcd:"🔠",capricorn:"♑️",car:"🚗",card_file_box:"🗃",card_index:"📇",card_index_dividers:"🗂",carousel_horse:"🎠",carrot:"🥕",cat:"🐱",cat2:"🐈",cd:"💿",chains:"⛓",champagne:"🍾",chart:"💹",chart_with_downwards_trend:"📉",chart_with_upwards_trend:"📈",checkered_flag:"🏁",cheese:"🧀",cherries:"🍒",cherry_blossom:"🌸",chestnut:"🌰",chicken:"🐔",children_crossing:"🚸",chipmunk:"🐿",chocolate_bar:"🍫",christmas_tree:"🎄",church:"⛪️",cinema:"🎦",circus_tent:"🎪",city_sunrise:"🌇",city_sunset:"🌆",cityscape:"🏙",cl:"🆑",clamp:"🗜",clap:"👏",clapper:"🎬",classical_building:"🏛",clinking_glasses:"🥂",clipboard:"📋",clock1:"🕐",clock10:"🕙",clock1030:"🕥",clock11:"🕚",clock1130:"🕦",clock12:"🕛",clock1230:"🕧",clock130:"🕜",clock2:"🕑",clock230:"🕝",clock3:"🕒",clock330:"🕞",clock4:"🕓",clock430:"🕟",clock5:"🕔",clock530:"🕠",clock6:"🕕",clock630:"🕡",clock7:"🕖",clock730:"🕢",clock8:"🕗",clock830:"🕣",clock9:"🕘",clock930:"🕤",closed_book:"📕",closed_lock_with_key:"🔐",closed_umbrella:"🌂",cloud:"☁️",cloud_with_lightning:"🌩",cloud_with_lightning_and_rain:"⛈",cloud_with_rain:"🌧",cloud_with_snow:"🌨",clown_face:"🤡",clubs:"♣️",cocktail:"🍸",coffee:"☕️",coffin:"⚰️",cold_sweat:"😰",comet:"☄️",computer:"💻",computer_mouse:"🖱",confetti_ball:"🎊",confounded:"😖",confused:"😕",congratulations:"㊗️",construction:"🚧",construction_worker_man:"👷",construction_worker_woman:"👷‍♀️",control_knobs:"🎛",convenience_store:"🏪",cookie:"🍪",cool:"🆒",policeman:"👮",copyright:"©️",corn:"🌽",couch_and_lamp:"🛋",couple:"👫",couple_with_heart_woman_man:"💑",couple_with_heart_man_man:"👨‍❤️‍👨",couple_with_heart_woman_woman:"👩‍❤️‍👩",couplekiss_man_man:"👨‍❤️‍💋‍👨",couplekiss_man_woman:"💏",couplekiss_woman_woman:"👩‍❤️‍💋‍👩",cow:"🐮",cow2:"🐄",cowboy_hat_face:"🤠",crab:"🦀",crayon:"🖍",credit_card:"💳",crescent_moon:"🌙",cricket:"🏏",crocodile:"🐊",croissant:"🥐",crossed_fingers:"🤞",crossed_flags:"🎌",crossed_swords:"⚔️",crown:"👑",cry:"😢",crying_cat_face:"😿",crystal_ball:"🔮",cucumber:"🥒",cupid:"💘",curly_loop:"➰",currency_exchange:"💱",curry:"🍛",custard:"🍮",customs:"🛃",cyclone:"🌀",dagger:"🗡",dancer:"💃",dancing_women:"👯",dancing_men:"👯‍♂️",dango:"🍡",dark_sunglasses:"🕶",dart:"🎯",dash:"💨",date:"📅",deciduous_tree:"🌳",deer:"🦌",department_store:"🏬",derelict_house:"🏚",desert:"🏜",desert_island:"🏝",desktop_computer:"🖥",male_detective:"🕵️",diamond_shape_with_a_dot_inside:"💠",diamonds:"♦️",disappointed:"😞",disappointed_relieved:"😥",dizzy:"💫",dizzy_face:"😵",do_not_litter:"🚯",dog:"🐶",dog2:"🐕",dollar:"💵",dolls:"🎎",dolphin:"🐬",door:"🚪",doughnut:"🍩",dove:"🕊",dragon:"🐉",dragon_face:"🐲",dress:"👗",dromedary_camel:"🐪",drooling_face:"🤤",droplet:"💧",drum:"🥁",duck:"🦆",dvd:"📀","e-mail":"📧",eagle:"🦅",ear:"👂",ear_of_rice:"🌾",earth_africa:"🌍",earth_americas:"🌎",earth_asia:"🌏",egg:"🥚",eggplant:"🍆",eight_pointed_black_star:"✴️",eight_spoked_asterisk:"✳️",electric_plug:"🔌",elephant:"🐘",email:"✉️",end:"🔚",envelope_with_arrow:"📩",euro:"💶",european_castle:"🏰",european_post_office:"🏤",evergreen_tree:"🌲",exclamation:"❗️",expressionless:"😑",eye:"👁",eye_speech_bubble:"👁‍🗨",eyeglasses:"👓",eyes:"👀",face_with_head_bandage:"🤕",face_with_thermometer:"🤒",fist_oncoming:"👊",factory:"🏭",fallen_leaf:"🍂",family_man_woman_boy:"👪",family_man_boy:"👨‍👦",family_man_boy_boy:"👨‍👦‍👦",family_man_girl:"👨‍👧",family_man_girl_boy:"👨‍👧‍👦",family_man_girl_girl:"👨‍👧‍👧",family_man_man_boy:"👨‍👨‍👦",family_man_man_boy_boy:"👨‍👨‍👦‍👦",family_man_man_girl:"👨‍👨‍👧",family_man_man_girl_boy:"👨‍👨‍👧‍👦",family_man_man_girl_girl:"👨‍👨‍👧‍👧",family_man_woman_boy_boy:"👨‍👩‍👦‍👦",family_man_woman_girl:"👨‍👩‍👧",family_man_woman_girl_boy:"👨‍👩‍👧‍👦",family_man_woman_girl_girl:"👨‍👩‍👧‍👧",family_woman_boy:"👩‍👦",family_woman_boy_boy:"👩‍👦‍👦",family_woman_girl:"👩‍👧",family_woman_girl_boy:"👩‍👧‍👦",family_woman_girl_girl:"👩‍👧‍👧",family_woman_woman_boy:"👩‍👩‍👦",family_woman_woman_boy_boy:"👩‍👩‍👦‍👦",family_woman_woman_girl:"👩‍👩‍👧",family_woman_woman_girl_boy:"👩‍👩‍👧‍👦",family_woman_woman_girl_girl:"👩‍👩‍👧‍👧",fast_forward:"⏩",fax:"📠",fearful:"😨",feet:"🐾",female_detective:"🕵️‍♀️",ferris_wheel:"🎡",ferry:"⛴",field_hockey:"🏑",file_cabinet:"🗄",file_folder:"📁",film_projector:"📽",film_strip:"🎞",fire:"🔥",fire_engine:"🚒",fireworks:"🎆",first_quarter_moon:"🌓",first_quarter_moon_with_face:"🌛",fish:"🐟",fish_cake:"🍥",fishing_pole_and_fish:"🎣",fist_raised:"✊",fist_left:"🤛",fist_right:"🤜",flags:"🎏",flashlight:"🔦",fleur_de_lis:"⚜️",flight_arrival:"🛬",flight_departure:"🛫",floppy_disk:"💾",flower_playing_cards:"🎴",flushed:"😳",fog:"🌫",foggy:"🌁",football:"🏈",footprints:"👣",fork_and_knife:"🍴",fountain:"⛲️",fountain_pen:"🖋",four_leaf_clover:"🍀",fox_face:"🦊",framed_picture:"🖼",free:"🆓",fried_egg:"🍳",fried_shrimp:"🍤",fries:"🍟",frog:"🐸",frowning:"😦",frowning_face:"☹️",frowning_man:"🙍‍♂️",frowning_woman:"🙍",middle_finger:"🖕",fuelpump:"⛽️",full_moon:"🌕",full_moon_with_face:"🌝",funeral_urn:"⚱️",game_die:"🎲",gear:"⚙️",gem:"💎",gemini:"♊️",ghost:"👻",gift:"🎁",gift_heart:"💝",girl:"👧",globe_with_meridians:"🌐",goal_net:"🥅",goat:"🐐",golf:"⛳️",golfing_man:"🏌️",golfing_woman:"🏌️‍♀️",gorilla:"🦍",grapes:"🍇",green_apple:"🍏",green_book:"📗",green_heart:"💚",green_salad:"🥗",grey_exclamation:"❕",grey_question:"❔",grimacing:"😬",grin:"😁",grinning:"😀",guardsman:"💂",guardswoman:"💂‍♀️",guitar:"🎸",gun:"🔫",haircut_woman:"💇",haircut_man:"💇‍♂️",hamburger:"🍔",hammer:"🔨",hammer_and_pick:"⚒",hammer_and_wrench:"🛠",hamster:"🐹",hand:"✋",handbag:"👜",handshake:"🤝",hankey:"💩",hatched_chick:"🐥",hatching_chick:"🐣",headphones:"🎧",hear_no_evil:"🙉",heart:"❤️",heart_decoration:"💟",heart_eyes:"😍",heart_eyes_cat:"😻",heartbeat:"💓",heartpulse:"💗",hearts:"♥️",heavy_check_mark:"✔️",heavy_division_sign:"➗",heavy_dollar_sign:"💲",heavy_heart_exclamation:"❣️",heavy_minus_sign:"➖",heavy_multiplication_x:"✖️",heavy_plus_sign:"➕",helicopter:"🚁",herb:"🌿",hibiscus:"🌺",high_brightness:"🔆",high_heel:"👠",hocho:"🔪",hole:"🕳",honey_pot:"🍯",horse:"🐴",horse_racing:"🏇",hospital:"🏥",hot_pepper:"🌶",hotdog:"🌭",hotel:"🏨",hotsprings:"♨️",hourglass:"⌛️",hourglass_flowing_sand:"⏳",house:"🏠",house_with_garden:"🏡",houses:"🏘",hugs:"🤗",hushed:"😯",ice_cream:"🍨",ice_hockey:"🏒",ice_skate:"⛸",icecream:"🍦",id:"🆔",ideograph_advantage:"🉐",imp:"👿",inbox_tray:"📥",incoming_envelope:"📨",tipping_hand_woman:"💁",information_source:"ℹ️",innocent:"😇",interrobang:"⁉️",iphone:"📱",izakaya_lantern:"🏮",jack_o_lantern:"🎃",japan:"🗾",japanese_castle:"🏯",japanese_goblin:"👺",japanese_ogre:"👹",jeans:"👖",joy:"😂",joy_cat:"😹",joystick:"🕹",kaaba:"🕋",key:"🔑",keyboard:"⌨️",keycap_ten:"🔟",kick_scooter:"🛴",kimono:"👘",kiss:"💋",kissing:"😗",kissing_cat:"😽",kissing_closed_eyes:"😚",kissing_heart:"😘",kissing_smiling_eyes:"😙",kiwi_fruit:"🥝",koala:"🐨",koko:"🈁",label:"🏷",large_blue_circle:"🔵",large_blue_diamond:"🔷",large_orange_diamond:"🔶",last_quarter_moon:"🌗",last_quarter_moon_with_face:"🌜",latin_cross:"✝️",laughing:"😆",leaves:"🍃",ledger:"📒",left_luggage:"🛅",left_right_arrow:"↔️",leftwards_arrow_with_hook:"↩️",lemon:"🍋",leo:"♌️",leopard:"🐆",level_slider:"🎚",libra:"♎️",light_rail:"🚈",link:"🔗",lion:"🦁",lips:"👄",lipstick:"💄",lizard:"🦎",lock:"🔒",lock_with_ink_pen:"🔏",lollipop:"🍭",loop:"➿",loud_sound:"🔊",loudspeaker:"📢",love_hotel:"🏩",love_letter:"💌",low_brightness:"🔅",lying_face:"🤥",m:"Ⓜ️",mag:"🔍",mag_right:"🔎",mahjong:"🀄️",mailbox:"📫",mailbox_closed:"📪",mailbox_with_mail:"📬",mailbox_with_no_mail:"📭",man:"👨",man_artist:"👨‍🎨",man_astronaut:"👨‍🚀",man_cartwheeling:"🤸‍♂️",man_cook:"👨‍🍳",man_dancing:"🕺",man_facepalming:"🤦‍♂️",man_factory_worker:"👨‍🏭",man_farmer:"👨‍🌾",man_firefighter:"👨‍🚒",man_health_worker:"👨‍⚕️",man_in_tuxedo:"🤵",man_judge:"👨‍⚖️",man_juggling:"🤹‍♂️",man_mechanic:"👨‍🔧",man_office_worker:"👨‍💼",man_pilot:"👨‍✈️",man_playing_handball:"🤾‍♂️",man_playing_water_polo:"🤽‍♂️",man_scientist:"👨‍🔬",man_shrugging:"🤷‍♂️",man_singer:"👨‍🎤",man_student:"👨‍🎓",man_teacher:"👨‍🏫",man_technologist:"👨‍💻",man_with_gua_pi_mao:"👲",man_with_turban:"👳",tangerine:"🍊",mans_shoe:"👞",mantelpiece_clock:"🕰",maple_leaf:"🍁",martial_arts_uniform:"🥋",mask:"😷",massage_woman:"💆",massage_man:"💆‍♂️",meat_on_bone:"🍖",medal_military:"🎖",medal_sports:"🏅",mega:"📣",melon:"🍈",memo:"📝",men_wrestling:"🤼‍♂️",menorah:"🕎",mens:"🚹",metal:"🤘",metro:"🚇",microphone:"🎤",microscope:"🔬",milk_glass:"🥛",milky_way:"🌌",minibus:"🚐",minidisc:"💽",mobile_phone_off:"📴",money_mouth_face:"🤑",money_with_wings:"💸",moneybag:"💰",monkey:"🐒",monkey_face:"🐵",monorail:"🚝",moon:"🌔",mortar_board:"🎓",mosque:"🕌",motor_boat:"🛥",motor_scooter:"🛵",motorcycle:"🏍",motorway:"🛣",mount_fuji:"🗻",mountain:"⛰",mountain_biking_man:"🚵",mountain_biking_woman:"🚵‍♀️",mountain_cableway:"🚠",mountain_railway:"🚞",mountain_snow:"🏔",mouse:"🐭",mouse2:"🐁",movie_camera:"🎥",moyai:"🗿",mrs_claus:"🤶",muscle:"💪",mushroom:"🍄",musical_keyboard:"🎹",musical_note:"🎵",musical_score:"🎼",mute:"🔇",nail_care:"💅",name_badge:"📛",national_park:"🏞",nauseated_face:"🤢",necktie:"👔",negative_squared_cross_mark:"❎",nerd_face:"🤓",neutral_face:"😐",new:"🆕",new_moon:"🌑",new_moon_with_face:"🌚",newspaper:"📰",newspaper_roll:"🗞",next_track_button:"⏭",ng:"🆖",no_good_man:"🙅‍♂️",no_good_woman:"🙅",night_with_stars:"🌃",no_bell:"🔕",no_bicycles:"🚳",no_entry:"⛔️",no_entry_sign:"🚫",no_mobile_phones:"📵",no_mouth:"😶",no_pedestrians:"🚷",no_smoking:"🚭","non-potable_water":"🚱",nose:"👃",notebook:"📓",notebook_with_decorative_cover:"📔",notes:"🎶",nut_and_bolt:"🔩",o:"⭕️",o2:"🅾️",ocean:"🌊",octopus:"🐙",oden:"🍢",office:"🏢",oil_drum:"🛢",ok:"🆗",ok_hand:"👌",ok_man:"🙆‍♂️",ok_woman:"🙆",old_key:"🗝",older_man:"👴",older_woman:"👵",om:"🕉",on:"🔛",oncoming_automobile:"🚘",oncoming_bus:"🚍",oncoming_police_car:"🚔",oncoming_taxi:"🚖",open_file_folder:"📂",open_hands:"👐",open_mouth:"😮",open_umbrella:"☂️",ophiuchus:"⛎",orange_book:"📙",orthodox_cross:"☦️",outbox_tray:"📤",owl:"🦉",ox:"🐂",package:"📦",page_facing_up:"📄",page_with_curl:"📃",pager:"📟",paintbrush:"🖌",palm_tree:"🌴",pancakes:"🥞",panda_face:"🐼",paperclip:"📎",paperclips:"🖇",parasol_on_ground:"⛱",parking:"🅿️",part_alternation_mark:"〽️",partly_sunny:"⛅️",passenger_ship:"🛳",passport_control:"🛂",pause_button:"⏸",peace_symbol:"☮️",peach:"🍑",peanuts:"🥜",pear:"🍐",pen:"🖊",pencil2:"✏️",penguin:"🐧",pensive:"😔",performing_arts:"🎭",persevere:"😣",person_fencing:"🤺",pouting_woman:"🙎",phone:"☎️",pick:"⛏",pig:"🐷",pig2:"🐖",pig_nose:"🐽",pill:"💊",pineapple:"🍍",ping_pong:"🏓",pisces:"♓️",pizza:"🍕",place_of_worship:"🛐",plate_with_cutlery:"🍽",play_or_pause_button:"⏯",point_down:"👇",point_left:"👈",point_right:"👉",point_up:"☝️",point_up_2:"👆",police_car:"🚓",policewoman:"👮‍♀️",poodle:"🐩",popcorn:"🍿",post_office:"🏣",postal_horn:"📯",postbox:"📮",potable_water:"🚰",potato:"🥔",pouch:"👝",poultry_leg:"🍗",pound:"💷",rage:"😡",pouting_cat:"😾",pouting_man:"🙎‍♂️",pray:"🙏",prayer_beads:"📿",pregnant_woman:"🤰",previous_track_button:"⏮",prince:"🤴",princess:"👸",printer:"🖨",purple_heart:"💜",purse:"👛",pushpin:"📌",put_litter_in_its_place:"🚮",question:"❓",rabbit:"🐰",rabbit2:"🐇",racehorse:"🐎",racing_car:"🏎",radio:"📻",radio_button:"🔘",radioactive:"☢️",railway_car:"🚃",railway_track:"🛤",rainbow:"🌈",rainbow_flag:"🏳️‍🌈",raised_back_of_hand:"🤚",raised_hand_with_fingers_splayed:"🖐",raised_hands:"🙌",raising_hand_woman:"🙋",raising_hand_man:"🙋‍♂️",ram:"🐏",ramen:"🍜",rat:"🐀",record_button:"⏺",recycle:"♻️",red_circle:"🔴",registered:"®️",relaxed:"☺️",relieved:"😌",reminder_ribbon:"🎗",repeat:"🔁",repeat_one:"🔂",rescue_worker_helmet:"⛑",restroom:"🚻",revolving_hearts:"💞",rewind:"⏪",rhinoceros:"🦏",ribbon:"🎀",rice:"🍚",rice_ball:"🍙",rice_cracker:"🍘",rice_scene:"🎑",right_anger_bubble:"🗯",ring:"💍",robot:"🤖",rocket:"🚀",rofl:"🤣",roll_eyes:"🙄",roller_coaster:"🎢",rooster:"🐓",rose:"🌹",rosette:"🏵",rotating_light:"🚨",round_pushpin:"📍",rowing_man:"🚣",rowing_woman:"🚣‍♀️",rugby_football:"🏉",running_man:"🏃",running_shirt_with_sash:"🎽",running_woman:"🏃‍♀️",sa:"🈂️",sagittarius:"♐️",sake:"🍶",sandal:"👡",santa:"🎅",satellite:"📡",saxophone:"🎷",school:"🏫",school_satchel:"🎒",scissors:"✂️",scorpion:"🦂",scorpius:"♏️",scream:"😱",scream_cat:"🙀",scroll:"📜",seat:"💺",secret:"㊙️",see_no_evil:"🙈",seedling:"🌱",selfie:"🤳",shallow_pan_of_food:"🥘",shamrock:"☘️",shark:"🦈",shaved_ice:"🍧",sheep:"🐑",shell:"🐚",shield:"🛡",shinto_shrine:"⛩",ship:"🚢",shirt:"👕",shopping:"🛍",shopping_cart:"🛒",shower:"🚿",shrimp:"🦐",signal_strength:"📶",six_pointed_star:"🔯",ski:"🎿",skier:"⛷",skull:"💀",skull_and_crossbones:"☠️",sleeping:"😴",sleeping_bed:"🛌",sleepy:"😪",slightly_frowning_face:"🙁",slightly_smiling_face:"🙂",slot_machine:"🎰",small_airplane:"🛩",small_blue_diamond:"🔹",small_orange_diamond:"🔸",small_red_triangle:"🔺",small_red_triangle_down:"🔻",smile:"😄",smile_cat:"😸",smiley:"😃",smiley_cat:"😺",smiling_imp:"😈",smirk:"😏",smirk_cat:"😼",smoking:"🚬",snail:"🐌",snake:"🐍",sneezing_face:"🤧",snowboarder:"🏂",snowflake:"❄️",snowman:"⛄️",snowman_with_snow:"☃️",sob:"😭",soccer:"⚽️",soon:"🔜",sos:"🆘",sound:"🔉",space_invader:"👾",spades:"♠️",spaghetti:"🍝",sparkle:"❇️",sparkler:"🎇",sparkles:"✨",sparkling_heart:"💖",speak_no_evil:"🙊",speaker:"🔈",speaking_head:"🗣",speech_balloon:"💬",speedboat:"🚤",spider:"🕷",spider_web:"🕸",spiral_calendar:"🗓",spiral_notepad:"🗒",spoon:"🥄",squid:"🦑",stadium:"🏟",star:"⭐️",star2:"🌟",star_and_crescent:"☪️",star_of_david:"✡️",stars:"🌠",station:"🚉",statue_of_liberty:"🗽",steam_locomotive:"🚂",stew:"🍲",stop_button:"⏹",stop_sign:"🛑",stopwatch:"⏱",straight_ruler:"📏",strawberry:"🍓",stuck_out_tongue:"😛",stuck_out_tongue_closed_eyes:"😝",stuck_out_tongue_winking_eye:"😜",studio_microphone:"🎙",stuffed_flatbread:"🥙",sun_behind_large_cloud:"🌥",sun_behind_rain_cloud:"🌦",sun_behind_small_cloud:"🌤",sun_with_face:"🌞",sunflower:"🌻",sunglasses:"😎",sunny:"☀️",sunrise:"🌅",sunrise_over_mountains:"🌄",surfing_man:"🏄",surfing_woman:"🏄‍♀️",sushi:"🍣",suspension_railway:"🚟",sweat:"😓",sweat_drops:"💦",sweat_smile:"😅",sweet_potato:"🍠",swimming_man:"🏊",swimming_woman:"🏊‍♀️",symbols:"🔣",synagogue:"🕍",syringe:"💉",taco:"🌮",tada:"🎉",tanabata_tree:"🎋",taurus:"♉️",taxi:"🚕",tea:"🍵",telephone_receiver:"📞",telescope:"🔭",tennis:"🎾",tent:"⛺️",thermometer:"🌡",thinking:"🤔",thought_balloon:"💭",ticket:"🎫",tickets:"🎟",tiger:"🐯",tiger2:"🐅",timer_clock:"⏲",tipping_hand_man:"💁‍♂️",tired_face:"😫",tm:"™️",toilet:"🚽",tokyo_tower:"🗼",tomato:"🍅",tongue:"👅",top:"🔝",tophat:"🎩",tornado:"🌪",trackball:"🖲",tractor:"🚜",traffic_light:"🚥",train:"🚋",train2:"🚆",tram:"🚊",triangular_flag_on_post:"🚩",triangular_ruler:"📐",trident:"🔱",triumph:"😤",trolleybus:"🚎",trophy:"🏆",tropical_drink:"🍹",tropical_fish:"🐠",truck:"🚚",trumpet:"🎺",tulip:"🌷",tumbler_glass:"🥃",turkey:"🦃",turtle:"🐢",tv:"📺",twisted_rightwards_arrows:"🔀",two_hearts:"💕",two_men_holding_hands:"👬",two_women_holding_hands:"👭",u5272:"🈹",u5408:"🈴",u55b6:"🈺",u6307:"🈯️",u6708:"🈷️",u6709:"🈶",u6e80:"🈵",u7121:"🈚️",u7533:"🈸",u7981:"🈲",u7a7a:"🈳",umbrella:"☔️",unamused:"😒",underage:"🔞",unicorn:"🦄",unlock:"🔓",up:"🆙",upside_down_face:"🙃",v:"✌️",vertical_traffic_light:"🚦",vhs:"📼",vibration_mode:"📳",video_camera:"📹",video_game:"🎮",violin:"🎻",virgo:"♍️",volcano:"🌋",volleyball:"🏐",vs:"🆚",vulcan_salute:"🖖",walking_man:"🚶",walking_woman:"🚶‍♀️",waning_crescent_moon:"🌘",waning_gibbous_moon:"🌖",warning:"⚠️",wastebasket:"🗑",watch:"⌚️",water_buffalo:"🐃",watermelon:"🍉",wave:"👋",wavy_dash:"〰️",waxing_crescent_moon:"🌒",wc:"🚾",weary:"😩",wedding:"💒",weight_lifting_man:"🏋️",weight_lifting_woman:"🏋️‍♀️",whale:"🐳",whale2:"🐋",wheel_of_dharma:"☸️",wheelchair:"♿️",white_check_mark:"✅",white_circle:"⚪️",white_flag:"🏳️",white_flower:"💮",white_large_square:"⬜️",white_medium_small_square:"◽️",white_medium_square:"◻️",white_small_square:"▫️",white_square_button:"🔳",wilted_flower:"🥀",wind_chime:"🎐",wind_face:"🌬",wine_glass:"🍷",wink:"😉",wolf:"🐺",woman:"👩",woman_artist:"👩‍🎨",woman_astronaut:"👩‍🚀",woman_cartwheeling:"🤸‍♀️",woman_cook:"👩‍🍳",woman_facepalming:"🤦‍♀️",woman_factory_worker:"👩‍🏭",woman_farmer:"👩‍🌾",woman_firefighter:"👩‍🚒",woman_health_worker:"👩‍⚕️",woman_judge:"👩‍⚖️",woman_juggling:"🤹‍♀️",woman_mechanic:"👩‍🔧",woman_office_worker:"👩‍💼",woman_pilot:"👩‍✈️",woman_playing_handball:"🤾‍♀️",woman_playing_water_polo:"🤽‍♀️",woman_scientist:"👩‍🔬",woman_shrugging:"🤷‍♀️",woman_singer:"👩‍🎤",woman_student:"👩‍🎓",woman_teacher:"👩‍🏫",woman_technologist:"👩‍💻",woman_with_turban:"👳‍♀️",womans_clothes:"👚",womans_hat:"👒",women_wrestling:"🤼‍♀️",womens:"🚺",world_map:"🗺",worried:"😟",wrench:"🔧",writing_hand:"✍️",x:"❌",yellow_heart:"💛",yen:"💴",yin_yang:"☯️",yum:"😋",zap:"⚡️",zipper_mouth_face:"🤐",zzz:"💤",octocat:':octocat:',showdown:"S"},a.Converter=function(e){"use strict";var t={},r=[],n=[],o={},i=l,p={parsed:{},raw:"",format:""};function f(e,t){if(t=t||null,a.helper.isString(e)){if(t=e=a.helper.stdExtName(e),a.extensions[e])return console.warn("DEPRECATION WARNING: "+e+" is an old extension that uses a deprecated loading method.Please inform the developer that the extension should be updated!"),void function(e,t){"function"==typeof e&&(e=e(new a.Converter));a.helper.isArray(e)||(e=[e]);var o=d(e,t);if(!o.valid)throw Error(o.error);for(var i=0;i[ \t]+¨NBSP;<"),!t){if(!window||!window.document)throw new Error("HTMLParser is undefined. If in a webworker or nodejs environment, you need to provide a WHATWG DOM and HTML such as JSDOM");t=window.document}var r=t.createElement("div");r.innerHTML=e;var n={preList:function(e){for(var t=e.querySelectorAll("pre"),r=[],n=0;n'}else r.push(t[n].innerHTML),t[n].innerHTML="",t[n].setAttribute("prenum",n.toString());return r}(r)};!function e(t){for(var r=0;r? ?(['"].*['"])?\)$/m)>-1)i="";else if(!i){if(o||(o=n.toLowerCase().replace(/ ?\n/g," ")),i="#"+o,a.helper.isUndefined(r.gUrls[o]))return e;i=r.gUrls[o],a.helper.isUndefined(r.gTitles[o])||(l=r.gTitles[o])}var u='"};return e=(e=(e=(e=(e=r.converter._dispatch("anchors.before",e,t,r)).replace(/\[((?:\[[^\]]*]|[^\[\]])*)] ?(?:\n *)?\[(.*?)]()()()()/g,n)).replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<([^>]*)>(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,n)).replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]??(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,n)).replace(/\[([^\[\]]+)]()()()()()/g,n),t.ghMentions&&(e=e.replace(/(^|\s)(\\)?(@([a-z\d]+(?:[a-z\d.-]+?[a-z\d]+)*))/gim,(function(e,r,n,o,i){if("\\"===n)return r+o;if(!a.helper.isString(t.ghMentionsLink))throw new Error("ghMentionsLink option must be a string");var s=t.ghMentionsLink.replace(/\{u}/g,i),c="";return t.openLinksInNewWindow&&(c=' rel="noopener noreferrer" target="¨E95Eblank"'),r+'"+o+""}))),e=r.converter._dispatch("anchors.after",e,t,r)}));var h=/([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+?\.[^'">\s]+?)()(\1)?(?=\s|$)(?!["<>])/gi,g=/([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+\.[^'">\s]+?)([.!?,()\[\]])?(\1)?(?=\s|$)(?!["<>])/gi,m=/()<(((https?|ftp|dict):\/\/|www\.)[^'">\s]+)()>()/gi,b=/(^|\s)(?:mailto:)?([A-Za-z0-9!#$%&'*+-/=?^_`{|}~.]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)(?=$|\s)/gim,_=/<()(?:mailto:)?([-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi,y=function(e){"use strict";return function(t,r,n,o,i,s,c){var l=n=n.replace(a.helper.regexes.asteriskDashAndColon,a.helper.escapeCharactersCallback),u="",d="",p=r||"",f=c||"";return/^www\./i.test(n)&&(n=n.replace(/^www\./i,"http://www.")),e.excludeTrailingPunctuationFromURLs&&s&&(u=s),e.openLinksInNewWindow&&(d=' rel="noopener noreferrer" target="¨E95Eblank"'),p+'"+l+""+u+f}},k=function(e,t){"use strict";return function(r,n,o){var i="mailto:";return n=n||"",o=a.subParser("unescapeSpecialChars")(o,e,t),e.encodeEmails?(i=a.helper.encodeEmailAddress(i+o),o=a.helper.encodeEmailAddress(o)):i+=o,n+''+o+""}};a.subParser("autoLinks",(function(e,t,r){"use strict";return e=(e=(e=r.converter._dispatch("autoLinks.before",e,t,r)).replace(m,y(t))).replace(_,k(t,r)),e=r.converter._dispatch("autoLinks.after",e,t,r)})),a.subParser("simplifiedAutoLinks",(function(e,t,r){"use strict";return t.simplifiedAutoLink?(e=r.converter._dispatch("simplifiedAutoLinks.before",e,t,r),e=(e=t.excludeTrailingPunctuationFromURLs?e.replace(g,y(t)):e.replace(h,y(t))).replace(b,k(t,r)),e=r.converter._dispatch("simplifiedAutoLinks.after",e,t,r)):e})),a.subParser("blockGamut",(function(e,t,r){"use strict";return e=r.converter._dispatch("blockGamut.before",e,t,r),e=a.subParser("blockQuotes")(e,t,r),e=a.subParser("headers")(e,t,r),e=a.subParser("horizontalRule")(e,t,r),e=a.subParser("lists")(e,t,r),e=a.subParser("codeBlocks")(e,t,r),e=a.subParser("tables")(e,t,r),e=a.subParser("hashHTMLBlocks")(e,t,r),e=a.subParser("paragraphs")(e,t,r),e=r.converter._dispatch("blockGamut.after",e,t,r)})),a.subParser("blockQuotes",(function(e,t,r){"use strict";e=r.converter._dispatch("blockQuotes.before",e,t,r),e+="\n\n";var n=/(^ {0,3}>[ \t]?.+\n(.+\n)*\n*)+/gm;return t.splitAdjacentBlockquotes&&(n=/^ {0,3}>[\s\S]*?(?:\n\n)/gm),e=e.replace(n,(function(e){return e=(e=(e=e.replace(/^[ \t]*>[ \t]?/gm,"")).replace(/¨0/g,"")).replace(/^[ \t]+$/gm,""),e=a.subParser("githubCodeBlocks")(e,t,r),e=(e=(e=a.subParser("blockGamut")(e,t,r)).replace(/(^|\n)/g,"$1 ")).replace(/(\s*
    [^\r]+?<\/pre>)/gm,(function(e,t){var r=t;return r=(r=r.replace(/^  /gm,"¨0")).replace(/¨0/g,"")})),a.subParser("hashBlock")("
    \n"+e+"\n
    ",t,r)})),e=r.converter._dispatch("blockQuotes.after",e,t,r)})),a.subParser("codeBlocks",(function(e,t,r){"use strict";e=r.converter._dispatch("codeBlocks.before",e,t,r);return e=(e=(e+="¨0").replace(/(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=¨0))/g,(function(e,n,o){var i=n,s=o,c="\n";return i=a.subParser("outdent")(i,t,r),i=a.subParser("encodeCode")(i,t,r),i=(i=(i=a.subParser("detab")(i,t,r)).replace(/^\n+/g,"")).replace(/\n+$/g,""),t.omitExtraWLInCodeBlocks&&(c=""),i="
    "+i+c+"
    ",a.subParser("hashBlock")(i,t,r)+s}))).replace(/¨0/,""),e=r.converter._dispatch("codeBlocks.after",e,t,r)})),a.subParser("codeSpans",(function(e,t,r){"use strict";return void 0===(e=r.converter._dispatch("codeSpans.before",e,t,r))&&(e=""),e=e.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,(function(e,n,o,i){var s=i;return s=(s=s.replace(/^([ \t]*)/g,"")).replace(/[ \t]*$/g,""),s=n+""+(s=a.subParser("encodeCode")(s,t,r))+"",s=a.subParser("hashHTMLSpans")(s,t,r)})),e=r.converter._dispatch("codeSpans.after",e,t,r)})),a.subParser("completeHTMLDocument",(function(e,t,r){"use strict";if(!t.completeHTMLDocument)return e;e=r.converter._dispatch("completeHTMLDocument.before",e,t,r);var n="html",o="\n",a="",i='\n',s="",c="";for(var l in void 0!==r.metadata.parsed.doctype&&(o="\n","html"!==(n=r.metadata.parsed.doctype.toString().toLowerCase())&&"html5"!==n||(i='')),r.metadata.parsed)if(r.metadata.parsed.hasOwnProperty(l))switch(l.toLowerCase()){case"doctype":break;case"title":a=""+r.metadata.parsed.title+"\n";break;case"charset":i="html"===n||"html5"===n?'\n':'\n';break;case"language":case"lang":s=' lang="'+r.metadata.parsed[l]+'"',c+='\n';break;default:c+='\n'}return e=o+"\n\n"+a+i+c+"\n\n"+e.trim()+"\n\n",e=r.converter._dispatch("completeHTMLDocument.after",e,t,r)})),a.subParser("detab",(function(e,t,r){"use strict";return e=(e=(e=(e=(e=(e=r.converter._dispatch("detab.before",e,t,r)).replace(/\t(?=\t)/g," ")).replace(/\t/g,"¨A¨B")).replace(/¨B(.+?)¨A/g,(function(e,t){for(var r=t,n=4-r.length%4,o=0;o/g,">"),e=r.converter._dispatch("encodeAmpsAndAngles.after",e,t,r)})),a.subParser("encodeBackslashEscapes",(function(e,t,r){"use strict";return e=(e=(e=r.converter._dispatch("encodeBackslashEscapes.before",e,t,r)).replace(/\\(\\)/g,a.helper.escapeCharactersCallback)).replace(/\\([`*_{}\[\]()>#+.!~=|-])/g,a.helper.escapeCharactersCallback),e=r.converter._dispatch("encodeBackslashEscapes.after",e,t,r)})),a.subParser("encodeCode",(function(e,t,r){"use strict";return e=(e=r.converter._dispatch("encodeCode.before",e,t,r)).replace(/&/g,"&").replace(//g,">").replace(/([*_{}\[\]\\=~-])/g,a.helper.escapeCharactersCallback),e=r.converter._dispatch("encodeCode.after",e,t,r)})),a.subParser("escapeSpecialCharsWithinTagAttributes",(function(e,t,r){"use strict";return e=(e=(e=r.converter._dispatch("escapeSpecialCharsWithinTagAttributes.before",e,t,r)).replace(/<\/?[a-z\d_:-]+(?:[\s]+[\s\S]+?)?>/gi,(function(e){return e.replace(/(.)<\/?code>(?=.)/g,"$1`").replace(/([\\`*_~=|])/g,a.helper.escapeCharactersCallback)}))).replace(/-]|-[^>])(?:[^-]|-[^-])*)--)>/gi,(function(e){return e.replace(/([\\`*_~=|])/g,a.helper.escapeCharactersCallback)})),e=r.converter._dispatch("escapeSpecialCharsWithinTagAttributes.after",e,t,r)})),a.subParser("githubCodeBlocks",(function(e,t,r){"use strict";return t.ghCodeBlocks?(e=r.converter._dispatch("githubCodeBlocks.before",e,t,r),e=(e=(e+="¨0").replace(/(?:^|\n)(?: {0,3})(```+|~~~+)(?: *)([^\s`~]*)\n([\s\S]*?)\n(?: {0,3})\1/g,(function(e,n,o,i){var s=t.omitExtraWLInCodeBlocks?"":"\n";return i=a.subParser("encodeCode")(i,t,r),i="
    "+(i=(i=(i=a.subParser("detab")(i,t,r)).replace(/^\n+/g,"")).replace(/\n+$/g,""))+s+"
    ",i=a.subParser("hashBlock")(i,t,r),"\n\n¨G"+(r.ghCodeBlocks.push({text:e,codeblock:i})-1)+"G\n\n"}))).replace(/¨0/,""),r.converter._dispatch("githubCodeBlocks.after",e,t,r)):e})),a.subParser("hashBlock",(function(e,t,r){"use strict";return e=(e=r.converter._dispatch("hashBlock.before",e,t,r)).replace(/(^\n+|\n+$)/g,""),e="\n\n¨K"+(r.gHtmlBlocks.push(e)-1)+"K\n\n",e=r.converter._dispatch("hashBlock.after",e,t,r)})),a.subParser("hashCodeTags",(function(e,t,r){"use strict";e=r.converter._dispatch("hashCodeTags.before",e,t,r);return e=a.helper.replaceRecursiveRegExp(e,(function(e,n,o,i){var s=o+a.subParser("encodeCode")(n,t,r)+i;return"¨C"+(r.gHtmlSpans.push(s)-1)+"C"}),"]*>","","gim"),e=r.converter._dispatch("hashCodeTags.after",e,t,r)})),a.subParser("hashElement",(function(e,t,r){"use strict";return function(e,t){var n=t;return n=(n=(n=n.replace(/\n\n/g,"\n")).replace(/^\n/,"")).replace(/\n+$/g,""),n="\n\n¨K"+(r.gHtmlBlocks.push(n)-1)+"K\n\n"}})),a.subParser("hashHTMLBlocks",(function(e,t,r){"use strict";e=r.converter._dispatch("hashHTMLBlocks.before",e,t,r);var n=["pre","div","h1","h2","h3","h4","h5","h6","blockquote","table","dl","ol","ul","script","noscript","form","fieldset","iframe","math","style","section","header","footer","nav","article","aside","address","audio","canvas","figure","hgroup","output","video","p"],o=function(e,t,n,o){var a=e;return-1!==n.search(/\bmarkdown\b/)&&(a=n+r.converter.makeHtml(t)+o),"\n\n¨K"+(r.gHtmlBlocks.push(a)-1)+"K\n\n"};t.backslashEscapesHTMLTags&&(e=e.replace(/\\<(\/?[^>]+?)>/g,(function(e,t){return"<"+t+">"})));for(var i=0;i]*>)","im"),l="<"+n[i]+"\\b[^>]*>",u="";-1!==(s=a.helper.regexIndexOf(e,c));){var d=a.helper.splitAtIndex(e,s),p=a.helper.replaceRecursiveRegExp(d[1],o,l,u,"im");if(p===d[1])break;e=d[0].concat(p)}return e=e.replace(/(\n {0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g,a.subParser("hashElement")(e,t,r)),e=(e=a.helper.replaceRecursiveRegExp(e,(function(e){return"\n\n¨K"+(r.gHtmlBlocks.push(e)-1)+"K\n\n"}),"^ {0,3}\x3c!--","--\x3e","gm")).replace(/(?:\n\n)( {0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g,a.subParser("hashElement")(e,t,r)),e=r.converter._dispatch("hashHTMLBlocks.after",e,t,r)})),a.subParser("hashHTMLSpans",(function(e,t,r){"use strict";function n(e){return"¨C"+(r.gHtmlSpans.push(e)-1)+"C"}return e=(e=(e=(e=(e=r.converter._dispatch("hashHTMLSpans.before",e,t,r)).replace(/<[^>]+?\/>/gi,(function(e){return n(e)}))).replace(/<([^>]+?)>[\s\S]*?<\/\1>/g,(function(e){return n(e)}))).replace(/<([^>]+?)\s[^>]+?>[\s\S]*?<\/\1>/g,(function(e){return n(e)}))).replace(/<[^>]+?>/gi,(function(e){return n(e)})),e=r.converter._dispatch("hashHTMLSpans.after",e,t,r)})),a.subParser("unhashHTMLSpans",(function(e,t,r){"use strict";e=r.converter._dispatch("unhashHTMLSpans.before",e,t,r);for(var n=0;n]*>\\s*]*>","^ {0,3}\\s*
    ","gim"),e=r.converter._dispatch("hashPreCodeTags.after",e,t,r)})),a.subParser("headers",(function(e,t,r){"use strict";e=r.converter._dispatch("headers.before",e,t,r);var n=isNaN(parseInt(t.headerLevelStart))?1:parseInt(t.headerLevelStart),o=t.smoothLivePreview?/^(.+)[ \t]*\n={2,}[ \t]*\n+/gm:/^(.+)[ \t]*\n=+[ \t]*\n+/gm,i=t.smoothLivePreview?/^(.+)[ \t]*\n-{2,}[ \t]*\n+/gm:/^(.+)[ \t]*\n-+[ \t]*\n+/gm;e=(e=e.replace(o,(function(e,o){var i=a.subParser("spanGamut")(o,t,r),s=t.noHeaderId?"":' id="'+c(o)+'"',l=""+i+"";return a.subParser("hashBlock")(l,t,r)}))).replace(i,(function(e,o){var i=a.subParser("spanGamut")(o,t,r),s=t.noHeaderId?"":' id="'+c(o)+'"',l=n+1,u=""+i+"";return a.subParser("hashBlock")(u,t,r)}));var s=t.requireSpaceBeforeHeadingText?/^(#{1,6})[ \t]+(.+?)[ \t]*#*\n+/gm:/^(#{1,6})[ \t]*(.+?)[ \t]*#*\n+/gm;function c(e){var n,o;if(t.customizedHeaderId){var i=e.match(/\{([^{]+?)}\s*$/);i&&i[1]&&(e=i[1])}return n=e,o=a.helper.isString(t.prefixHeaderId)?t.prefixHeaderId:!0===t.prefixHeaderId?"section-":"",t.rawPrefixHeaderId||(n=o+n),n=t.ghCompatibleHeaderId?n.replace(/ /g,"-").replace(/&/g,"").replace(/¨T/g,"").replace(/¨D/g,"").replace(/[&+$,\/:;=?@"#{}|^¨~\[\]`\\*)(%.!'<>]/g,"").toLowerCase():t.rawHeaderId?n.replace(/ /g,"-").replace(/&/g,"&").replace(/¨T/g,"¨").replace(/¨D/g,"$").replace(/["']/g,"-").toLowerCase():n.replace(/[^\w]/g,"").toLowerCase(),t.rawPrefixHeaderId&&(n=o+n),r.hashLinkCounts[n]?n=n+"-"+r.hashLinkCounts[n]++:r.hashLinkCounts[n]=1,n}return e=e.replace(s,(function(e,o,i){var s=i;t.customizedHeaderId&&(s=i.replace(/\s?\{([^{]+?)}\s*$/,""));var l=a.subParser("spanGamut")(s,t,r),u=t.noHeaderId?"":' id="'+c(i)+'"',d=n-1+o.length,p=""+l+"";return a.subParser("hashBlock")(p,t,r)})),e=r.converter._dispatch("headers.after",e,t,r)})),a.subParser("horizontalRule",(function(e,t,r){"use strict";e=r.converter._dispatch("horizontalRule.before",e,t,r);var n=a.subParser("hashBlock")("
    ",t,r);return e=(e=(e=e.replace(/^ {0,2}( ?-){3,}[ \t]*$/gm,n)).replace(/^ {0,2}( ?\*){3,}[ \t]*$/gm,n)).replace(/^ {0,2}( ?_){3,}[ \t]*$/gm,n),e=r.converter._dispatch("horizontalRule.after",e,t,r)})),a.subParser("images",(function(e,t,r){"use strict";function n(e,t,n,o,i,s,c,l){var u=r.gUrls,d=r.gTitles,p=r.gDimensions;if(n=n.toLowerCase(),l||(l=""),e.search(/\(? ?(['"].*['"])?\)$/m)>-1)o="";else if(""===o||null===o){if(""!==n&&null!==n||(n=t.toLowerCase().replace(/ ?\n/g," ")),o="#"+n,a.helper.isUndefined(u[n]))return e;o=u[n],a.helper.isUndefined(d[n])||(l=d[n]),a.helper.isUndefined(p[n])||(i=p[n].width,s=p[n].height)}t=t.replace(/"/g,""").replace(a.helper.regexes.asteriskDashAndColon,a.helper.escapeCharactersCallback);var f=''+t+'"}return e=(e=(e=(e=(e=(e=r.converter._dispatch("images.before",e,t,r)).replace(/!\[([^\]]*?)] ?(?:\n *)?\[([\s\S]*?)]()()()()()/g,n)).replace(/!\[([^\]]*?)][ \t]*()\([ \t]??(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,(function(e,t,r,o,a,i,s,c){return n(e,t,r,o=o.replace(/\s/g,""),a,i,s,c)}))).replace(/!\[([^\]]*?)][ \t]*()\([ \t]?<([^>]*)>(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(?:(["'])([^"]*?)\6))?[ \t]?\)/g,n)).replace(/!\[([^\]]*?)][ \t]*()\([ \t]??(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,n)).replace(/!\[([^\[\]]+)]()()()()()/g,n),e=r.converter._dispatch("images.after",e,t,r)})),a.subParser("italicsAndBold",(function(e,t,r){"use strict";function n(e,t,r){return t+e+r}return e=r.converter._dispatch("italicsAndBold.before",e,t,r),e=t.literalMidWordUnderscores?(e=(e=e.replace(/\b___(\S[\s\S]*?)___\b/g,(function(e,t){return n(t,"","")}))).replace(/\b__(\S[\s\S]*?)__\b/g,(function(e,t){return n(t,"","")}))).replace(/\b_(\S[\s\S]*?)_\b/g,(function(e,t){return n(t,"","")})):(e=(e=e.replace(/___(\S[\s\S]*?)___/g,(function(e,t){return/\S$/.test(t)?n(t,"",""):e}))).replace(/__(\S[\s\S]*?)__/g,(function(e,t){return/\S$/.test(t)?n(t,"",""):e}))).replace(/_([^\s_][\s\S]*?)_/g,(function(e,t){return/\S$/.test(t)?n(t,"",""):e})),e=t.literalMidWordAsterisks?(e=(e=e.replace(/([^*]|^)\B\*\*\*(\S[\s\S]*?)\*\*\*\B(?!\*)/g,(function(e,t,r){return n(r,t+"","")}))).replace(/([^*]|^)\B\*\*(\S[\s\S]*?)\*\*\B(?!\*)/g,(function(e,t,r){return n(r,t+"","")}))).replace(/([^*]|^)\B\*(\S[\s\S]*?)\*\B(?!\*)/g,(function(e,t,r){return n(r,t+"","")})):(e=(e=e.replace(/\*\*\*(\S[\s\S]*?)\*\*\*/g,(function(e,t){return/\S$/.test(t)?n(t,"",""):e}))).replace(/\*\*(\S[\s\S]*?)\*\*/g,(function(e,t){return/\S$/.test(t)?n(t,"",""):e}))).replace(/\*([^\s*][\s\S]*?)\*/g,(function(e,t){return/\S$/.test(t)?n(t,"",""):e})),e=r.converter._dispatch("italicsAndBold.after",e,t,r)})),a.subParser("lists",(function(e,t,r){"use strict";function n(e,n){r.gListLevel++,e=e.replace(/\n{2,}$/,"\n");var o=/(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0| {0,3}([*+-]|\d+[.])[ \t]+))/gm,i=/\n[ \t]*\n(?!¨0)/.test(e+="¨0");return t.disableForced4SpacesIndentedSublists&&(o=/(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0|\2([*+-]|\d+[.])[ \t]+))/gm),e=(e=e.replace(o,(function(e,n,o,s,c,l,u){u=u&&""!==u.trim();var d=a.subParser("outdent")(c,t,r),p="";return l&&t.tasklists&&(p=' class="task-list-item" style="list-style-type: none;"',d=d.replace(/^[ \t]*\[(x|X| )?]/m,(function(){var e='-1?(d=a.subParser("githubCodeBlocks")(d,t,r),d=a.subParser("blockGamut")(d,t,r)):(d=(d=a.subParser("lists")(d,t,r)).replace(/\n$/,""),d=(d=a.subParser("hashHTMLBlocks")(d,t,r)).replace(/\n\n+/g,"\n\n"),d=i?a.subParser("paragraphs")(d,t,r):a.subParser("spanGamut")(d,t,r)),d=""+(d=d.replace("¨A",""))+"\n"}))).replace(/¨0/g,""),r.gListLevel--,n&&(e=e.replace(/\s+$/,"")),e}function o(e,t){if("ol"===t){var r=e.match(/^ *(\d+)\./);if(r&&"1"!==r[1])return' start="'+r[1]+'"'}return""}function i(e,r,a){var i=t.disableForced4SpacesIndentedSublists?/^ ?\d+\.[ \t]/gm:/^ {0,3}\d+\.[ \t]/gm,s=t.disableForced4SpacesIndentedSublists?/^ ?[*+-][ \t]/gm:/^ {0,3}[*+-][ \t]/gm,c="ul"===r?i:s,l="";if(-1!==e.search(c))!function t(u){var d=u.search(c),p=o(e,r);-1!==d?(l+="\n\n<"+r+p+">\n"+n(u.slice(0,d),!!a)+"\n",c="ul"===(r="ul"===r?"ol":"ul")?i:s,t(u.slice(d))):l+="\n\n<"+r+p+">\n"+n(u,!!a)+"\n"}(e);else{var u=o(e,r);l="\n\n<"+r+u+">\n"+n(e,!!a)+"\n"}return l}return e=r.converter._dispatch("lists.before",e,t,r),e+="¨0",e=(e=r.gListLevel?e.replace(/^(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,(function(e,t,r){return i(t,r.search(/[*+-]/g)>-1?"ul":"ol",!0)})):e.replace(/(\n\n|^\n?)(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,(function(e,t,r,n){return i(r,n.search(/[*+-]/g)>-1?"ul":"ol",!1)}))).replace(/¨0/,""),e=r.converter._dispatch("lists.after",e,t,r)})),a.subParser("metadata",(function(e,t,r){"use strict";if(!t.metadata)return e;function n(e){r.metadata.raw=e,(e=(e=e.replace(/&/g,"&").replace(/"/g,""")).replace(/\n {4}/g," ")).replace(/^([\S ]+): +([\s\S]+?)$/gm,(function(e,t,n){return r.metadata.parsed[t]=n,""}))}return e=(e=(e=(e=r.converter._dispatch("metadata.before",e,t,r)).replace(/^\s*«««+(\S*?)\n([\s\S]+?)\n»»»+\n/,(function(e,t,r){return n(r),"¨M"}))).replace(/^\s*---+(\S*?)\n([\s\S]+?)\n---+\n/,(function(e,t,o){return t&&(r.metadata.format=t),n(o),"¨M"}))).replace(/¨M/g,""),e=r.converter._dispatch("metadata.after",e,t,r)})),a.subParser("outdent",(function(e,t,r){"use strict";return e=(e=(e=r.converter._dispatch("outdent.before",e,t,r)).replace(/^(\t|[ ]{1,4})/gm,"¨0")).replace(/¨0/g,""),e=r.converter._dispatch("outdent.after",e,t,r)})),a.subParser("paragraphs",(function(e,t,r){"use strict";for(var n=(e=(e=(e=r.converter._dispatch("paragraphs.before",e,t,r)).replace(/^\n+/g,"")).replace(/\n+$/g,"")).split(/\n{2,}/g),o=[],i=n.length,s=0;s=0?o.push(c):c.search(/\S/)>=0&&(c=(c=a.subParser("spanGamut")(c,t,r)).replace(/^([ \t]*)/g,"

    "),c+="

    ",o.push(c))}for(i=o.length,s=0;s]*>\s*]*>/.test(u)&&(d=!0)}o[s]=u}return e=(e=(e=o.join("\n")).replace(/^\n+/g,"")).replace(/\n+$/g,""),r.converter._dispatch("paragraphs.after",e,t,r)})),a.subParser("runExtension",(function(e,t,r,n){"use strict";if(e.filter)t=e.filter(t,n.converter,r);else if(e.regex){var o=e.regex;o instanceof RegExp||(o=new RegExp(o,"g")),t=t.replace(o,e.replace)}return t})),a.subParser("spanGamut",(function(e,t,r){"use strict";return e=r.converter._dispatch("spanGamut.before",e,t,r),e=a.subParser("codeSpans")(e,t,r),e=a.subParser("escapeSpecialCharsWithinTagAttributes")(e,t,r),e=a.subParser("encodeBackslashEscapes")(e,t,r),e=a.subParser("images")(e,t,r),e=a.subParser("anchors")(e,t,r),e=a.subParser("autoLinks")(e,t,r),e=a.subParser("simplifiedAutoLinks")(e,t,r),e=a.subParser("emoji")(e,t,r),e=a.subParser("underline")(e,t,r),e=a.subParser("italicsAndBold")(e,t,r),e=a.subParser("strikethrough")(e,t,r),e=a.subParser("ellipsis")(e,t,r),e=a.subParser("hashHTMLSpans")(e,t,r),e=a.subParser("encodeAmpsAndAngles")(e,t,r),t.simpleLineBreaks?/\n\n¨K/.test(e)||(e=e.replace(/\n+/g,"
    \n")):e=e.replace(/ +\n/g,"
    \n"),e=r.converter._dispatch("spanGamut.after",e,t,r)})),a.subParser("strikethrough",(function(e,t,r){"use strict";return t.strikethrough&&(e=(e=r.converter._dispatch("strikethrough.before",e,t,r)).replace(/(?:~){2}([\s\S]+?)(?:~){2}/g,(function(e,n){return function(e){return t.simplifiedAutoLink&&(e=a.subParser("simplifiedAutoLinks")(e,t,r)),""+e+""}(n)})),e=r.converter._dispatch("strikethrough.after",e,t,r)),e})),a.subParser("stripLinkDefinitions",(function(e,t,r){"use strict";var n=function(e,n,o,i,s,c,l){return n=n.toLowerCase(),o.match(/^data:.+?\/.+?;base64,/)?r.gUrls[n]=o.replace(/\s/g,""):r.gUrls[n]=a.subParser("encodeAmpsAndAngles")(o,t,r),c?c+l:(l&&(r.gTitles[n]=l.replace(/"|'/g,""")),t.parseImgDimensions&&i&&s&&(r.gDimensions[n]={width:i,height:s}),"")};return e=(e=(e=(e+="¨0").replace(/^ {0,3}\[(.+)]:[ \t]*\n?[ \t]*?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n\n|(?=¨0)|(?=\n\[))/gm,n)).replace(/^ {0,3}\[(.+)]:[ \t]*\n?[ \t]*\s]+)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n+|(?=¨0))/gm,n)).replace(/¨0/,"")})),a.subParser("tables",(function(e,t,r){"use strict";if(!t.tables)return e;function n(e,n){return""+a.subParser("spanGamut")(e,t,r)+"\n"}function o(e){var o,i=e.split("\n");for(o=0;o"+(c=a.subParser("spanGamut")(c,t,r))+"\n"));for(o=0;o\n\n\n",o=0;o\n";for(var a=0;a\n"}return r+"\n\n"}(h,m)}return e=(e=(e=(e=r.converter._dispatch("tables.before",e,t,r)).replace(/\\(\|)/g,a.helper.escapeCharactersCallback)).replace(/^ {0,3}\|?.+\|.+\n {0,3}\|?[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*:?[ \t]*(?:[-=]){2,}[\s\S]+?(?:\n\n|¨0)/gm,o)).replace(/^ {0,3}\|.+\|[ \t]*\n {0,3}\|[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*\n( {0,3}\|.+\|[ \t]*\n)*(?:\n|¨0)/gm,o),e=r.converter._dispatch("tables.after",e,t,r)})),a.subParser("underline",(function(e,t,r){"use strict";return t.underline?(e=r.converter._dispatch("underline.before",e,t,r),e=(e=t.literalMidWordUnderscores?(e=e.replace(/\b___(\S[\s\S]*?)___\b/g,(function(e,t){return""+t+""}))).replace(/\b__(\S[\s\S]*?)__\b/g,(function(e,t){return""+t+""})):(e=e.replace(/___(\S[\s\S]*?)___/g,(function(e,t){return/\S$/.test(t)?""+t+"":e}))).replace(/__(\S[\s\S]*?)__/g,(function(e,t){return/\S$/.test(t)?""+t+"":e}))).replace(/(_)/g,a.helper.escapeCharactersCallback),e=r.converter._dispatch("underline.after",e,t,r)):e})),a.subParser("unescapeSpecialChars",(function(e,t,r){"use strict";return e=(e=r.converter._dispatch("unescapeSpecialChars.before",e,t,r)).replace(/¨E(\d+)E/g,(function(e,t){var r=parseInt(t);return String.fromCharCode(r)})),e=r.converter._dispatch("unescapeSpecialChars.after",e,t,r)})),a.subParser("makeMarkdown.blockquote",(function(e,t){"use strict";var r="";if(e.hasChildNodes())for(var n=e.childNodes,o=n.length,i=0;i ")})),a.subParser("makeMarkdown.codeBlock",(function(e,t){"use strict";var r=e.getAttribute("language"),n=e.getAttribute("precodenum");return"```"+r+"\n"+t.preList[n]+"\n```"})),a.subParser("makeMarkdown.codeSpan",(function(e){"use strict";return"`"+e.innerHTML+"`"})),a.subParser("makeMarkdown.emphasis",(function(e,t){"use strict";var r="";if(e.hasChildNodes()){r+="*";for(var n=e.childNodes,o=n.length,i=0;i",e.hasAttribute("width")&&e.hasAttribute("height")&&(t+=" ="+e.getAttribute("width")+"x"+e.getAttribute("height")),e.hasAttribute("title")&&(t+=' "'+e.getAttribute("title")+'"'),t+=")"),t})),a.subParser("makeMarkdown.links",(function(e,t){"use strict";var r="";if(e.hasChildNodes()&&e.hasAttribute("href")){var n=e.childNodes,o=n.length;r="[";for(var i=0;i",e.hasAttribute("title")&&(r+=' "'+e.getAttribute("title")+'"'),r+=")"}return r})),a.subParser("makeMarkdown.list",(function(e,t,r){"use strict";var n="";if(!e.hasChildNodes())return"";for(var o=e.childNodes,i=o.length,s=e.getAttribute("start")||1,c=0;c"+t.preList[r]+""})),a.subParser("makeMarkdown.strikethrough",(function(e,t){"use strict";var r="";if(e.hasChildNodes()){r+="~~";for(var n=e.childNodes,o=n.length,i=0;itr>th"),c=e.querySelectorAll("tbody>tr");for(r=0;rh&&(h=g)}for(r=0;r/g,"\\$1>")).replace(/^#/gm,"\\#")).replace(/^(\s*)([-=]{3,})(\s*)$/,"$1\\$2$3")).replace(/^( {0,3}\d+)\./gm,"$1\\.")).replace(/^( {0,3})([+-])/gm,"$1\\$2")).replace(/]([\s]*)\(/g,"\\]$1\\(")).replace(/^ {0,3}\[([\S \t]*?)]:/gm,"\\[$1]:")}));void 0===(n=function(){"use strict";return a}.call(t,r,t,e))||(e.exports=n)}).call(this)}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var a=t[n]={exports:{}};return e[n].call(a.exports,a,a.exports,r),a.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};(()=>{"use strict";r.r(n),r.d(n,{__EXPERIMENTAL_ELEMENTS:()=>ee,__EXPERIMENTAL_PATHS_WITH_OVERRIDE:()=>te,__EXPERIMENTAL_STYLE_PROPERTY:()=>J,__experimentalCloneSanitizedBlock:()=>xr,__experimentalGetAccessibleBlockLabel:()=>Ge,__experimentalGetBlockAttributesNamesByRole:()=>Ze,__experimentalGetBlockLabel:()=>qe,__experimentalSanitizeBlockAttributes:()=>Ye,__unstableGetBlockProps:()=>Wr,__unstableGetInnerBlocksProps:()=>Yr,__unstableSerializeAndClean:()=>tn,children:()=>Jn,cloneBlock:()=>Er,createBlock:()=>Tr,createBlocksFromInnerBlocksTemplate:()=>Cr,doBlocksMatchTemplate:()=>oa,findTransform:()=>Lr,getBlockAttributes:()=>ao,getBlockAttributesNamesByRole:()=>Qe,getBlockBindingsSource:()=>ze,getBlockBindingsSources:()=>Ie,getBlockContent:()=>Xr,getBlockDefaultClassName:()=>Fr,getBlockFromExample:()=>zr,getBlockMenuDefaultClassName:()=>qr,getBlockSupport:()=>Te,getBlockTransforms:()=>Mr,getBlockType:()=>we,getBlockTypes:()=>ve,getBlockVariations:()=>Oe,getCategories:()=>ta,getChildBlockNames:()=>Se,getDefaultBlockName:()=>ke,getFreeformContentHandlerName:()=>he,getGroupingBlockName:()=>ge,getPhrasingContentSchema:()=>Po,getPossibleBlockTransformations:()=>Or,getSaveContent:()=>Zr,getSaveElement:()=>Qr,getUnregisteredTypeHandlerName:()=>be,hasBlockSupport:()=>Ce,hasChildBlocks:()=>Be,hasChildBlocksWithInserterSupport:()=>Ae,isReusableBlock:()=>xe,isTemplatePart:()=>Ee,isUnmodifiedBlock:()=>He,isUnmodifiedDefaultBlock:()=>Ve,isValidBlockContent:()=>Hn,isValidIcon:()=>$e,node:()=>Yn,normalizeIconObject:()=>Ue,parse:()=>po,parseWithAttributeSchema:()=>oo,pasteHandler:()=>ea,privateApis:()=>ua,rawHandler:()=>Oo,registerBlockBindingsSource:()=>je,registerBlockCollection:()=>de,registerBlockStyle:()=>Ne,registerBlockType:()=>le,registerBlockVariation:()=>Le,serialize:()=>rn,serializeRawBlock:()=>$r,setCategories:()=>ra,setDefaultBlockName:()=>_e,setFreeformContentHandlerName:()=>fe,setGroupingBlockName:()=>ye,setUnregisteredTypeHandlerName:()=>me,store:()=>gr,switchToBlockType:()=>Dr,synchronizeBlocksWithTemplate:()=>la,unregisterBlockBindingsSource:()=>De,unregisterBlockStyle:()=>Pe,unregisterBlockType:()=>pe,unregisterBlockVariation:()=>Me,unstable__bootstrapServerSideBlockDefinitions:()=>se,updateCategory:()=>na,validateBlock:()=>Rn,withBlockContentContext:()=>da});var e={};r.r(e),r.d(e,{getAllBlockBindingsSources:()=>yt,getBlockBindingsSource:()=>kt,getBootstrappedBlockType:()=>bt,getSupportedStyles:()=>mt,getUnprocessedBlockTypes:()=>_t,hasContentRoleAttribute:()=>wt});var t={};r.r(t),r.d(t,{__experimentalHasContentRoleAttribute:()=>$t,getActiveBlockVariation:()=>St,getBlockStyles:()=>xt,getBlockSupport:()=>Dt,getBlockType:()=>Ct,getBlockTypes:()=>Tt,getBlockVariations:()=>Et,getCategories:()=>At,getChildBlockNames:()=>jt,getCollections:()=>Nt,getDefaultBlockName:()=>Pt,getDefaultBlockVariation:()=>Bt,getFreeformFallbackBlockName:()=>Ot,getGroupingBlockName:()=>Mt,getUnregisteredFallbackBlockName:()=>Lt,hasBlockSupport:()=>zt,hasChildBlocks:()=>Ht,hasChildBlocksWithInserterSupport:()=>Vt,isMatchingSearchTerm:()=>Rt});var o={};r.r(o),r.d(o,{__experimentalReapplyBlockFilters:()=>Zt,addBlockCollection:()=>lr,addBlockStyles:()=>Jt,addBlockTypes:()=>Yt,addBlockVariations:()=>tr,reapplyBlockTypeFilters:()=>Qt,removeBlockCollection:()=>ur,removeBlockStyles:()=>er,removeBlockTypes:()=>Xt,removeBlockVariations:()=>rr,setCategories:()=>sr,setDefaultBlockName:()=>nr,setFreeformFallbackBlockName:()=>or,setGroupingBlockName:()=>ir,setUnregisteredFallbackBlockName:()=>ar,updateCategory:()=>cr});var a={};r.r(a),r.d(a,{addBlockBindingsSource:()=>fr,addBootstrappedBlockType:()=>dr,addUnprocessedBlockType:()=>pr,removeBlockBindingsSource:()=>hr});const i=window.wp.data;var s=function(){return s=Object.assign||function(e){for(var t,r=1,n=arguments.length;r0&&r>="0"&&r<="9"?"_"+r+n:""+r.toUpperCase()+n}function f(e,t){return void 0===t&&(t={}),function(e,t){void 0===t&&(t={});for(var r=t.splitRegexp,n=void 0===r?l:r,o=t.stripRegexp,a=void 0===o?u:o,i=t.transform,s=void 0===i?c:i,p=t.delimiter,f=void 0===p?" ":p,h=d(d(e,n,"$1\0$2"),a,"\0"),g=0,m=h.length;"\0"===h.charAt(g);)g++;for(;"\0"===h.charAt(m-1);)m--;return h.slice(g,m).split("\0").map(s).join(f)}(e,s({delimiter:"",transform:p},t))}function h(e,t){return 0===t?e.toLowerCase():p(e,t)}const g=window.wp.i18n;var m={grad:.9,turn:360,rad:360/(2*Math.PI)},b=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},_=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=Math.pow(10,t)),Math.round(r*e)/r+0},y=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=1),e>r?r:e>t?e:t},k=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},w=function(e){return{r:y(e.r,0,255),g:y(e.g,0,255),b:y(e.b,0,255),a:y(e.a)}},v=function(e){return{r:_(e.r),g:_(e.g),b:_(e.b),a:_(e.a,3)}},T=/^#([0-9a-f]{3,8})$/i,C=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},x=function(e){var t=e.r,r=e.g,n=e.b,o=e.a,a=Math.max(t,r,n),i=a-Math.min(t,r,n),s=i?a===t?(r-n)/i:a===r?2+(n-t)/i:4+(t-r)/i:0;return{h:60*(s<0?s+6:s),s:a?i/a*100:0,v:a/255*100,a:o}},E=function(e){var t=e.h,r=e.s,n=e.v,o=e.a;t=t/360*6,r/=100,n/=100;var a=Math.floor(t),i=n*(1-r),s=n*(1-(t-a)*r),c=n*(1-(1-t+a)*r),l=a%6;return{r:255*[n,s,i,i,c,n][l],g:255*[c,n,n,s,i,i][l],b:255*[i,i,c,n,n,s][l],a:o}},S=function(e){return{h:k(e.h),s:y(e.s,0,100),l:y(e.l,0,100),a:y(e.a)}},B=function(e){return{h:_(e.h),s:_(e.s),l:_(e.l),a:_(e.a,3)}},A=function(e){return E((r=(t=e).s,{h:t.h,s:(r*=((n=t.l)<50?n:100-n)/100)>0?2*r/(n+r)*100:0,v:n+r,a:t.a}));var t,r,n},N=function(e){return{h:(t=x(e)).h,s:(o=(200-(r=t.s))*(n=t.v)/100)>0&&o<200?r*n/100/(o<=100?o:200-o)*100:0,l:o/2,a:t.a};var t,r,n,o},P=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,O=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,L=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,M=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,j={string:[[function(e){var t=T.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:4===e.length?_(parseInt(e[3]+e[3],16)/255,2):1}:6===e.length||8===e.length?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:8===e.length?_(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=L.exec(e)||M.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:w({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=P.exec(e)||O.exec(e);if(!t)return null;var r,n,o=S({h:(r=t[1],n=t[2],void 0===n&&(n="deg"),Number(r)*(m[n]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return A(o)},"hsl"]],object:[[function(e){var t=e.r,r=e.g,n=e.b,o=e.a,a=void 0===o?1:o;return b(t)&&b(r)&&b(n)?w({r:Number(t),g:Number(r),b:Number(n),a:Number(a)}):null},"rgb"],[function(e){var t=e.h,r=e.s,n=e.l,o=e.a,a=void 0===o?1:o;if(!b(t)||!b(r)||!b(n))return null;var i=S({h:Number(t),s:Number(r),l:Number(n),a:Number(a)});return A(i)},"hsl"],[function(e){var t=e.h,r=e.s,n=e.v,o=e.a,a=void 0===o?1:o;if(!b(t)||!b(r)||!b(n))return null;var i=function(e){return{h:k(e.h),s:y(e.s,0,100),v:y(e.v,0,100),a:y(e.a)}}({h:Number(t),s:Number(r),v:Number(n),a:Number(a)});return E(i)},"hsv"]]},D=function(e,t){for(var r=0;r=.5},e.prototype.toHex=function(){return t=(e=v(this.rgba)).r,r=e.g,n=e.b,a=(o=e.a)<1?C(_(255*o)):"","#"+C(t)+C(r)+C(n)+a;var e,t,r,n,o,a},e.prototype.toRgb=function(){return v(this.rgba)},e.prototype.toRgbString=function(){return t=(e=v(this.rgba)).r,r=e.g,n=e.b,(o=e.a)<1?"rgba("+t+", "+r+", "+n+", "+o+")":"rgb("+t+", "+r+", "+n+")";var e,t,r,n,o},e.prototype.toHsl=function(){return B(N(this.rgba))},e.prototype.toHslString=function(){return t=(e=B(N(this.rgba))).h,r=e.s,n=e.l,(o=e.a)<1?"hsla("+t+", "+r+"%, "+n+"%, "+o+")":"hsl("+t+", "+r+"%, "+n+"%)";var e,t,r,n,o},e.prototype.toHsv=function(){return e=x(this.rgba),{h:_(e.h),s:_(e.s),v:_(e.v),a:_(e.a,3)};var e},e.prototype.invert=function(){return $({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},e.prototype.saturate=function(e){return void 0===e&&(e=.1),$(I(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),$(I(this.rgba,-e))},e.prototype.grayscale=function(){return $(I(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),$(H(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),$(H(this.rgba,-e))},e.prototype.rotate=function(e){return void 0===e&&(e=15),this.hue(this.hue()+e)},e.prototype.alpha=function(e){return"number"==typeof e?$({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):_(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=N(this.rgba);return"number"==typeof e?$({h:e,s:t.s,l:t.l,a:t.a}):_(t.h)},e.prototype.isEqual=function(e){return this.toHex()===$(e).toHex()},e}(),$=function(e){return e instanceof V?e:new V(e)},U=[];var F=function(e){var t=e/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},q=function(e){return.2126*F(e.r)+.7152*F(e.g)+.0722*F(e.b)};const G=window.wp.element,K=window.wp.dom,W=window.wp.richText,Y=window.wp.deprecated;var Q=r.n(Y);const Z="block-default",X=["attributes","supports","save","migrate","isEligible","apiVersion"],J={"--wp--style--color--link":{value:["color","link"],support:["color","link"]},aspectRatio:{value:["dimensions","aspectRatio"],support:["dimensions","aspectRatio"],useEngine:!0},background:{value:["color","gradient"],support:["color","gradients"],useEngine:!0},backgroundColor:{value:["color","background"],support:["color","background"],requiresOptOut:!0,useEngine:!0},backgroundImage:{value:["background","backgroundImage"],support:["background","backgroundImage"],useEngine:!0},backgroundRepeat:{value:["background","backgroundRepeat"],support:["background","backgroundRepeat"],useEngine:!0},backgroundSize:{value:["background","backgroundSize"],support:["background","backgroundSize"],useEngine:!0},backgroundPosition:{value:["background","backgroundPosition"],support:["background","backgroundPosition"],useEngine:!0},borderColor:{value:["border","color"],support:["__experimentalBorder","color"],useEngine:!0},borderRadius:{value:["border","radius"],support:["__experimentalBorder","radius"],properties:{borderTopLeftRadius:"topLeft",borderTopRightRadius:"topRight",borderBottomLeftRadius:"bottomLeft",borderBottomRightRadius:"bottomRight"},useEngine:!0},borderStyle:{value:["border","style"],support:["__experimentalBorder","style"],useEngine:!0},borderWidth:{value:["border","width"],support:["__experimentalBorder","width"],useEngine:!0},borderTopColor:{value:["border","top","color"],support:["__experimentalBorder","color"],useEngine:!0},borderTopStyle:{value:["border","top","style"],support:["__experimentalBorder","style"],useEngine:!0},borderTopWidth:{value:["border","top","width"],support:["__experimentalBorder","width"],useEngine:!0},borderRightColor:{value:["border","right","color"],support:["__experimentalBorder","color"],useEngine:!0},borderRightStyle:{value:["border","right","style"],support:["__experimentalBorder","style"],useEngine:!0},borderRightWidth:{value:["border","right","width"],support:["__experimentalBorder","width"],useEngine:!0},borderBottomColor:{value:["border","bottom","color"],support:["__experimentalBorder","color"],useEngine:!0},borderBottomStyle:{value:["border","bottom","style"],support:["__experimentalBorder","style"],useEngine:!0},borderBottomWidth:{value:["border","bottom","width"],support:["__experimentalBorder","width"],useEngine:!0},borderLeftColor:{value:["border","left","color"],support:["__experimentalBorder","color"],useEngine:!0},borderLeftStyle:{value:["border","left","style"],support:["__experimentalBorder","style"],useEngine:!0},borderLeftWidth:{value:["border","left","width"],support:["__experimentalBorder","width"],useEngine:!0},color:{value:["color","text"],support:["color","text"],requiresOptOut:!0,useEngine:!0},columnCount:{value:["typography","textColumns"],support:["typography","textColumns"],useEngine:!0},filter:{value:["filter","duotone"],support:["filter","duotone"]},linkColor:{value:["elements","link","color","text"],support:["color","link"]},captionColor:{value:["elements","caption","color","text"],support:["color","caption"]},buttonColor:{value:["elements","button","color","text"],support:["color","button"]},buttonBackgroundColor:{value:["elements","button","color","background"],support:["color","button"]},headingColor:{value:["elements","heading","color","text"],support:["color","heading"]},headingBackgroundColor:{value:["elements","heading","color","background"],support:["color","heading"]},fontFamily:{value:["typography","fontFamily"],support:["typography","__experimentalFontFamily"],useEngine:!0},fontSize:{value:["typography","fontSize"],support:["typography","fontSize"],useEngine:!0},fontStyle:{value:["typography","fontStyle"],support:["typography","__experimentalFontStyle"],useEngine:!0},fontWeight:{value:["typography","fontWeight"],support:["typography","__experimentalFontWeight"],useEngine:!0},lineHeight:{value:["typography","lineHeight"],support:["typography","lineHeight"],useEngine:!0},margin:{value:["spacing","margin"],support:["spacing","margin"],properties:{marginTop:"top",marginRight:"right",marginBottom:"bottom",marginLeft:"left"},useEngine:!0},minHeight:{value:["dimensions","minHeight"],support:["dimensions","minHeight"],useEngine:!0},padding:{value:["spacing","padding"],support:["spacing","padding"],properties:{paddingTop:"top",paddingRight:"right",paddingBottom:"bottom",paddingLeft:"left"},useEngine:!0},textAlign:{value:["typography","textAlign"],support:["typography","textAlign"],useEngine:!1},textDecoration:{value:["typography","textDecoration"],support:["typography","__experimentalTextDecoration"],useEngine:!0},textTransform:{value:["typography","textTransform"],support:["typography","__experimentalTextTransform"],useEngine:!0},letterSpacing:{value:["typography","letterSpacing"],support:["typography","__experimentalLetterSpacing"],useEngine:!0},writingMode:{value:["typography","writingMode"],support:["typography","__experimentalWritingMode"],useEngine:!0},"--wp--style--root--padding":{value:["spacing","padding"],support:["spacing","padding"],properties:{"--wp--style--root--padding-top":"top","--wp--style--root--padding-right":"right","--wp--style--root--padding-bottom":"bottom","--wp--style--root--padding-left":"left"},rootOnly:!0}},ee={link:"a:where(:not(.wp-element-button))",heading:"h1, h2, h3, h4, h5, h6",h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",button:".wp-element-button, .wp-block-button__link",caption:".wp-element-caption, .wp-block-audio figcaption, .wp-block-embed figcaption, .wp-block-gallery figcaption, .wp-block-image figcaption, .wp-block-table figcaption, .wp-block-video figcaption",cite:"cite"},te={"color.duotone":!0,"color.gradients":!0,"color.palette":!0,"dimensions.aspectRatios":!0,"typography.fontSizes":!0,"spacing.spacingSizes":!0},re=(window.wp.warning,window.wp.privateApis),{lock:ne,unlock:oe}=(0,re.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/blocks"),ae={title:"block title",description:"block description",keywords:["block keyword"],styles:[{label:"block style label"}],variations:[{title:"block variation title",description:"block variation description",keywords:["block variation keyword"]}]};function ie(e){return null!==e&&"object"==typeof e}function se(e){const{addBootstrappedBlockType:t}=oe((0,i.dispatch)(gr));for(const[r,n]of Object.entries(e))t(r,n)}function ce({textdomain:e,...t}){const r=["apiVersion","title","category","parent","ancestor","icon","description","keywords","attributes","providesContext","usesContext","selectors","supports","styles","example","variations","blockHooks","allowedBlocks"],n=Object.fromEntries(Object.entries(t).filter((([e])=>r.includes(e))));return e&&Object.keys(ae).forEach((t=>{n[t]&&(n[t]=ue(ae[t],n[t],e))})),n}function le(e,t){const r=ie(e)?e.name:e;if("string"!=typeof r)return;if(!/^[a-z][a-z0-9-]*\/[a-z][a-z0-9-]*$/.test(r))return;if((0,i.select)(gr).getBlockType(r))return;const{addBootstrappedBlockType:n,addUnprocessedBlockType:o}=oe((0,i.dispatch)(gr));if(ie(e)){n(r,ce(e))}return o(r,t),(0,i.select)(gr).getBlockType(r)}function ue(e,t,r){return"string"==typeof e&&"string"==typeof t?(0,g._x)(t,e,r):Array.isArray(e)&&e.length&&Array.isArray(t)?t.map((t=>ue(e[0],t,r))):ie(e)&&Object.entries(e).length&&ie(t)?Object.keys(t).reduce(((n,o)=>e[o]?(n[o]=ue(e[o],t[o],r),n):(n[o]=t[o],n)),{}):t}function de(e,{title:t,icon:r}){(0,i.dispatch)(gr).addBlockCollection(e,t,r)}function pe(e){const t=(0,i.select)(gr).getBlockType(e);if(t)return(0,i.dispatch)(gr).removeBlockTypes(e),t}function fe(e){(0,i.dispatch)(gr).setFreeformFallbackBlockName(e)}function he(){return(0,i.select)(gr).getFreeformFallbackBlockName()}function ge(){return(0,i.select)(gr).getGroupingBlockName()}function me(e){(0,i.dispatch)(gr).setUnregisteredFallbackBlockName(e)}function be(){return(0,i.select)(gr).getUnregisteredFallbackBlockName()}function _e(e){(0,i.dispatch)(gr).setDefaultBlockName(e)}function ye(e){(0,i.dispatch)(gr).setGroupingBlockName(e)}function ke(){return(0,i.select)(gr).getDefaultBlockName()}function we(e){return(0,i.select)(gr)?.getBlockType(e)}function ve(){return(0,i.select)(gr).getBlockTypes()}function Te(e,t,r){return(0,i.select)(gr).getBlockSupport(e,t,r)}function Ce(e,t,r){return(0,i.select)(gr).hasBlockSupport(e,t,r)}function xe(e){return"core/block"===e?.name}function Ee(e){return"core/template-part"===e?.name}const Se=e=>(0,i.select)(gr).getChildBlockNames(e),Be=e=>(0,i.select)(gr).hasChildBlocks(e),Ae=e=>(0,i.select)(gr).hasChildBlocksWithInserterSupport(e),Ne=(e,t)=>{(0,i.dispatch)(gr).addBlockStyles(e,t)},Pe=(e,t)=>{(0,i.dispatch)(gr).removeBlockStyles(e,t)},Oe=(e,t)=>(0,i.select)(gr).getBlockVariations(e,t),Le=(e,t)=>{t.name,(0,i.dispatch)(gr).addBlockVariations(e,t)},Me=(e,t)=>{(0,i.dispatch)(gr).removeBlockVariations(e,t)},je=e=>{const{name:t,label:r,usesContext:n,getValues:o,setValues:a,canUserEditValue:s,getFieldsList:c}=e,l=oe((0,i.select)(gr)).getBlockBindingsSource(t),u=["label","usesContext"];for(const e in l)if(!u.includes(e)&&l[e])return;if(t&&"string"==typeof t&&!/[A-Z]+/.test(t)&&/^[a-z0-9/-]+$/.test(t)&&/^[a-z0-9-]+\/[a-z0-9-]+$/.test(t)&&(r||l?.label)&&(!r||"string"==typeof r)&&(!n||Array.isArray(n))&&!(o&&"function"!=typeof o||a&&"function"!=typeof a||s&&"function"!=typeof s||c&&"function"!=typeof c))return oe((0,i.dispatch)(gr)).addBlockBindingsSource(e)};function De(e){ze(e)&&oe((0,i.dispatch)(gr)).removeBlockBindingsSource(e)}function ze(e){return oe((0,i.select)(gr)).getBlockBindingsSource(e)}function Ie(){return oe((0,i.select)(gr)).getAllBlockBindingsSources()}!function(e){e.forEach((function(e){U.indexOf(e)<0&&(e(V,j),U.push(e))}))}([function(e,t){var r={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},n={};for(var o in r)n[r[o]]=o;var a={};e.prototype.toName=function(t){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var o,i,s=n[this.toHex()];if(s)return s;if(null==t?void 0:t.closest){var c=this.toRgb(),l=1/0,u="black";if(!a.length)for(var d in r)a[d]=new e(r[d]).toRgb();for(var p in r){var f=(o=c,i=a[p],Math.pow(o.r-i.r,2)+Math.pow(o.g-i.g,2)+Math.pow(o.b-i.b,2));f(c=q(i))?(s+.05)/(c+.05):(c+.05)/(s+.05),void 0===(n=2)&&(n=0),void 0===o&&(o=Math.pow(10,n)),Math.floor(o*r)/o+0},e.prototype.isReadable=function(e,t){return void 0===e&&(e="#FFF"),void 0===t&&(t={}),this.contrast(e)>=(i=void 0===(a=(r=t).size)?"normal":a,"AAA"===(o=void 0===(n=r.level)?"AA":n)&&"normal"===i?7:"AA"===o&&"large"===i?3:4.5);var r,n,o,a,i}}]);const Re=["#191e23","#f8f9f9"];function He(e){var t;return Object.entries(null!==(t=we(e.name)?.attributes)&&void 0!==t?t:{}).every((([t,r])=>{const n=e.attributes[t];return r.hasOwnProperty("default")?n===r.default:"rich-text"===r.type?!n?.length:void 0===n}))}function Ve(e){return e.name===ke()&&He(e)}function $e(e){return!!e&&("string"==typeof e||(0,G.isValidElement)(e)||"function"==typeof e||e instanceof G.Component)}function Ue(e){if($e(e=e||Z))return{src:e};if("background"in e){const t=$(e.background),r=e=>t.contrast(e),n=Math.max(...Re.map(r));return{...e,foreground:e.foreground?e.foreground:Re.find((e=>r(e)===n)),shadowColor:t.alpha(.3).toRgbString()}}return e}function Fe(e){return"string"==typeof e?we(e):e}function qe(e,t,r="visual"){const{__experimentalLabel:n,title:o}=e,a=n&&n(t,{context:r});return a?a.toPlainText?a.toPlainText():(0,K.__unstableStripHTML)(a):o}function Ge(e,t,r,n="vertical"){const o=e?.title,a=e?qe(e,t,"accessibility"):"",i=void 0!==r,s=a&&a!==o;return i&&"vertical"===n?s?(0,g.sprintf)((0,g.__)("%1$s Block. Row %2$d. %3$s"),o,r,a):(0,g.sprintf)((0,g.__)("%1$s Block. Row %2$d"),o,r):i&&"horizontal"===n?s?(0,g.sprintf)((0,g.__)("%1$s Block. Column %2$d. %3$s"),o,r,a):(0,g.sprintf)((0,g.__)("%1$s Block. Column %2$d"),o,r):s?(0,g.sprintf)((0,g.__)("%1$s Block. %2$s"),o,a):(0,g.sprintf)((0,g.__)("%s Block"),o)}function Ke(e){return void 0!==e.default?e.default:"rich-text"===e.type?new W.RichTextData:void 0}function We(e){return void 0!==we(e)}function Ye(e,t){const r=we(e);if(void 0===r)throw new Error(`Block type '${e}' is not registered.`);return Object.entries(r.attributes).reduce(((e,[r,n])=>{const o=t[r];if(void 0!==o)"rich-text"===n.type?o instanceof W.RichTextData?e[r]=o:"string"==typeof o&&(e[r]=W.RichTextData.fromHTMLString(o)):"string"===n.type&&o instanceof W.RichTextData?e[r]=o.toHTMLString():e[r]=o;else{const t=Ke(n);void 0!==t&&(e[r]=t)}return-1!==["node","children"].indexOf(n.source)&&("string"==typeof e[r]?e[r]=[e[r]]:Array.isArray(e[r])||(e[r]=[])),e}),{})}function Qe(e,t){const r=we(e)?.attributes;if(!r)return[];const n=Object.keys(r);return t?n.filter((n=>{const o=r[n];return o?.role===t||o?.__experimentalRole===t&&(Q()("__experimentalRole attribute",{since:"6.7",version:"6.8",alternative:"role attribute",hint:`Check the block.json of the ${e} block.`}),!0)})):n}const Ze=(...e)=>(Q()("__experimentalGetBlockAttributesNamesByRole",{since:"6.7",version:"6.8",alternative:"getBlockAttributesNamesByRole"}),Qe(...e));function Xe(e,t){return Object.fromEntries(Object.entries(e).filter((([e])=>!t.includes(e))))}const Je=[{slug:"text",title:(0,g.__)("Text")},{slug:"media",title:(0,g.__)("Media")},{slug:"design",title:(0,g.__)("Design")},{slug:"widgets",title:(0,g.__)("Widgets")},{slug:"theme",title:(0,g.__)("Theme")},{slug:"embed",title:(0,g.__)("Embeds")},{slug:"reusable",title:(0,g.__)("Reusable blocks")}];function et(e){return e.reduce(((e,t)=>({...e,[t.name]:t})),{})}function tt(e){return e.reduce(((e,t)=>(e.some((e=>e.name===t.name))||e.push(t),e)),[])}function rt(e){return(t=null,r)=>{switch(r.type){case"REMOVE_BLOCK_TYPES":return-1!==r.names.indexOf(t)?null:t;case e:return r.name||null}return t}}const nt=rt("SET_DEFAULT_BLOCK_NAME"),ot=rt("SET_FREEFORM_FALLBACK_BLOCK_NAME"),at=rt("SET_UNREGISTERED_FALLBACK_BLOCK_NAME"),it=rt("SET_GROUPING_BLOCK_NAME");function st(e=[],t=[]){const r=Array.from(new Set(e.concat(t)));return r.length>0?r:void 0}const ct=(0,i.combineReducers)({bootstrappedBlockTypes:function(e={},t){switch(t.type){case"ADD_BOOTSTRAPPED_BLOCK_TYPE":const{name:r,blockType:n}=t,o=e[r];let a;return o?(void 0===o.blockHooks&&n.blockHooks&&(a={...o,...a,blockHooks:n.blockHooks}),void 0===o.allowedBlocks&&n.allowedBlocks&&(a={...o,...a,allowedBlocks:n.allowedBlocks})):(a=Object.fromEntries(Object.entries(n).filter((([,e])=>null!=e)).map((([e,t])=>{return[(r=e,void 0===n&&(n={}),f(r,s({transform:h},n))),t];var r,n}))),a.name=r),a?{...e,[r]:a}:e;case"REMOVE_BLOCK_TYPES":return Xe(e,t.names)}return e},unprocessedBlockTypes:function(e={},t){switch(t.type){case"ADD_UNPROCESSED_BLOCK_TYPE":return{...e,[t.name]:t.blockType};case"REMOVE_BLOCK_TYPES":return Xe(e,t.names)}return e},blockTypes:function(e={},t){switch(t.type){case"ADD_BLOCK_TYPES":return{...e,...et(t.blockTypes)};case"REMOVE_BLOCK_TYPES":return Xe(e,t.names)}return e},blockStyles:function(e={},t){var r;switch(t.type){case"ADD_BLOCK_TYPES":return{...e,...Object.fromEntries(Object.entries(et(t.blockTypes)).map((([t,r])=>{var n,o;return[t,tt([...(null!==(n=r.styles)&&void 0!==n?n:[]).map((e=>({...e,source:"block"}))),...(null!==(o=e[r.name])&&void 0!==o?o:[]).filter((({source:e})=>"block"!==e))])]})))};case"ADD_BLOCK_STYLES":const n={};return t.blockNames.forEach((r=>{var o;n[r]=tt([...null!==(o=e[r])&&void 0!==o?o:[],...t.styles])})),{...e,...n};case"REMOVE_BLOCK_STYLES":return{...e,[t.blockName]:(null!==(r=e[t.blockName])&&void 0!==r?r:[]).filter((e=>-1===t.styleNames.indexOf(e.name)))}}return e},blockVariations:function(e={},t){var r,n;switch(t.type){case"ADD_BLOCK_TYPES":return{...e,...Object.fromEntries(Object.entries(et(t.blockTypes)).map((([t,r])=>{var n,o;return[t,tt([...(null!==(n=r.variations)&&void 0!==n?n:[]).map((e=>({...e,source:"block"}))),...(null!==(o=e[r.name])&&void 0!==o?o:[]).filter((({source:e})=>"block"!==e))])]})))};case"ADD_BLOCK_VARIATIONS":return{...e,[t.blockName]:tt([...null!==(r=e[t.blockName])&&void 0!==r?r:[],...t.variations])};case"REMOVE_BLOCK_VARIATIONS":return{...e,[t.blockName]:(null!==(n=e[t.blockName])&&void 0!==n?n:[]).filter((e=>-1===t.variationNames.indexOf(e.name)))}}return e},defaultBlockName:nt,freeformFallbackBlockName:ot,unregisteredFallbackBlockName:at,groupingBlockName:it,categories:function(e=Je,t){switch(t.type){case"SET_CATEGORIES":const r=new Map;return(t.categories||[]).forEach((e=>{r.set(e.slug,e)})),[...r.values()];case"UPDATE_CATEGORY":if(!t.category||!Object.keys(t.category).length)return e;if(e.find((({slug:e})=>e===t.slug)))return e.map((e=>e.slug===t.slug?{...e,...t.category}:e))}return e},collections:function(e={},t){switch(t.type){case"ADD_BLOCK_COLLECTION":return{...e,[t.namespace]:{title:t.title,icon:t.icon}};case"REMOVE_BLOCK_COLLECTION":return Xe(e,t.namespace)}return e},blockBindingsSources:function(e={},t){switch(t.type){case"ADD_BLOCK_BINDINGS_SOURCE":let r;return"core/post-meta"===t.name&&(r=t.getFieldsList),{...e,[t.name]:{label:t.label||e[t.name]?.label,usesContext:st(e[t.name]?.usesContext,t.usesContext),getValues:t.getValues,setValues:t.setValues,canUserEditValue:t.setValues&&t.canUserEditValue,getFieldsList:r}};case"REMOVE_BLOCK_BINDINGS_SOURCE":return Xe(e,t.name)}return e}});var lt=r(9681),ut=r.n(lt);const dt=(e,t,r)=>{var n;const o=Array.isArray(t)?t:t.split(".");let a=e;return o.forEach((e=>{a=a?.[e]})),null!==(n=a)&&void 0!==n?n:r};function pt(e){return"object"==typeof e&&e.constructor===Object&&null!==e}function ft(e,t){return pt(e)&&pt(t)?Object.entries(t).every((([t,r])=>ft(e?.[t],r))):e===t}const ht=["background","backgroundColor","color","linkColor","captionColor","buttonColor","headingColor","fontFamily","fontSize","fontStyle","fontWeight","lineHeight","padding","contentSize","wideSize","blockGap","textDecoration","textTransform","letterSpacing"];function gt(e,t,r){return e.filter((e=>("fontSize"!==e||"heading"!==r)&&(!("textDecoration"===e&&!t&&"link"!==r)&&(!("textTransform"===e&&!t&&!["heading","h1","h2","h3","h4","h5","h6"].includes(r)&&"button"!==r&&"caption"!==r&&"text"!==r)&&(!("letterSpacing"===e&&!t&&!["heading","h1","h2","h3","h4","h5","h6"].includes(r)&&"button"!==r&&"caption"!==r&&"text"!==r)&&!("textColumns"===e&&!t))))))}const mt=(0,i.createSelector)(((e,t,r)=>{if(!t)return gt(ht,t,r);const n=Ct(e,t);if(!n)return[];const o=[];return n?.supports?.spacing?.blockGap&&o.push("blockGap"),n?.supports?.shadow&&o.push("shadow"),Object.keys(J).forEach((e=>{J[e].support&&(J[e].requiresOptOut&&J[e].support[0]in n.supports&&!1!==dt(n.supports,J[e].support)||dt(n.supports,J[e].support,!1))&&o.push(e)})),gt(o,t,r)}),((e,t)=>[e.blockTypes[t]]));function bt(e,t){return e.bootstrappedBlockTypes[t]}function _t(e){return e.unprocessedBlockTypes}function yt(e){return e.blockBindingsSources}function kt(e,t){return e.blockBindingsSources[t]}const wt=(e,t)=>{const r=Ct(e,t);return!!r&&Object.values(r.attributes).some((({role:e,__experimentalRole:r})=>"content"===e||"content"===r&&(Q()("__experimentalRole attribute",{since:"6.7",version:"6.8",alternative:"role attribute",hint:`Check the block.json of the ${t} block.`}),!0)))},vt=(e,t)=>"string"==typeof t?Ct(e,t):t,Tt=(0,i.createSelector)((e=>Object.values(e.blockTypes)),(e=>[e.blockTypes]));function Ct(e,t){return e.blockTypes[t]}function xt(e,t){return e.blockStyles[t]}const Et=(0,i.createSelector)(((e,t,r)=>{const n=e.blockVariations[t];return n&&r?n.filter((e=>(e.scope||["block","inserter"]).includes(r))):n}),((e,t)=>[e.blockVariations[t]]));function St(e,t,r,n){const o=Et(e,t,n);if(!o)return o;const a=Ct(e,t),i=Object.keys(a?.attributes||{});let s,c=0;for(const e of o)if(Array.isArray(e.isActive)){const t=e.isActive.filter((e=>{const t=e.split(".")[0];return i.includes(t)})),n=t.length;if(0===n)continue;t.every((t=>{const n=dt(e.attributes,t);if(void 0===n)return!1;let o=dt(r,t);return o instanceof W.RichTextData&&(o=o.toHTMLString()),ft(o,n)}))&&n>c&&(s=e,c=n)}else if(e.isActive?.(r,e.attributes))return s||e;return s}function Bt(e,t,r){const n=Et(e,t,r);return[...n].reverse().find((({isDefault:e})=>!!e))||n[0]}function At(e){return e.categories}function Nt(e){return e.collections}function Pt(e){return e.defaultBlockName}function Ot(e){return e.freeformFallbackBlockName}function Lt(e){return e.unregisteredFallbackBlockName}function Mt(e){return e.groupingBlockName}const jt=(0,i.createSelector)(((e,t)=>Tt(e).filter((e=>e.parent?.includes(t))).map((({name:e})=>e))),(e=>[e.blockTypes])),Dt=(e,t,r,n)=>{const o=vt(e,t);return o?.supports?dt(o.supports,r,n):n};function zt(e,t,r,n){return!!Dt(e,t,r,n)}function It(e){return ut()(null!=e?e:"").toLowerCase().trim()}function Rt(e,t,r=""){const n=vt(e,t),o=It(r),a=e=>It(e).includes(o);return a(n.title)||n.keywords?.some(a)||a(n.category)||"string"==typeof n.description&&a(n.description)}const Ht=(e,t)=>jt(e,t).length>0,Vt=(e,t)=>jt(e,t).some((t=>zt(e,t,"inserter",!0))),$t=(...e)=>(Q()("__experimentalHasContentRoleAttribute",{since:"6.7",version:"6.8",hint:"This is a private selector."}),wt(...e)); /*! * is-plain-object * * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. */ -function Ut(e){return"[object Object]"===Object.prototype.toString.call(e)}var Ft=r(8529);const qt=window.wp.hooks,Gt={common:"text",formatting:"text",layout:"design"};function Kt(e=[],t=[]){const r=[...e];return t.forEach((e=>{const t=r.findIndex((t=>t.name===e.name));-1!==t?r[t]={...r[t],...e}:r.push(e)})),r}const Wt=(e,t)=>({select:r})=>{const n=r.getBootstrappedBlockType(e),o={name:e,icon:Z,keywords:[],attributes:{},providesContext:{},usesContext:[],selectors:{},supports:{},styles:[],blockHooks:{},save:()=>null,...n,...t,variations:Kt(Array.isArray(n?.variations)?n.variations:[],Array.isArray(t?.variations)?t.variations:[])},a=(0,qt.applyFilters)("blocks.registerBlockType",o,e,null);if(a.description&&"string"!=typeof a.description&&Q()("Declaring non-string block descriptions",{since:"6.2"}),a.deprecated&&(a.deprecated=a.deprecated.map((e=>Object.fromEntries(Object.entries((0,qt.applyFilters)("blocks.registerBlockType",{...Xe(o,X),...e},o.name,e)).filter((([e])=>X.includes(e))))))),function(e){var t,r;return!1!==Ut(e)&&(void 0===(t=e.constructor)||!1!==Ut(r=t.prototype)&&!1!==r.hasOwnProperty("isPrototypeOf"))}(a)&&"function"==typeof a.save&&(!("edit"in a)||(0,Ft.isValidElementType)(a.edit))&&(Gt.hasOwnProperty(a.category)&&(a.category=Gt[a.category]),"category"in a&&!r.getCategories().some((({slug:e})=>e===a.category))&&delete a.category,"title"in a&&""!==a.title&&"string"==typeof a.title&&(a.icon=Fe(a.icon),Ue(a.icon.src))))return a};function Yt(e){return{type:"ADD_BLOCK_TYPES",blockTypes:Array.isArray(e)?e:[e]}}function Qt(){return({dispatch:e,select:t})=>{const r=[];for(const[n,o]of Object.entries(t.getUnprocessedBlockTypes())){const t=e(Wt(n,o));t&&r.push(t)}r.length&&e.addBlockTypes(r)}}function Zt(){return Q()('wp.data.dispatch( "core/blocks" ).__experimentalReapplyBlockFilters',{since:"6.4",alternative:"reapplyBlockFilters"}),Qt()}function Xt(e){return{type:"REMOVE_BLOCK_TYPES",names:Array.isArray(e)?e:[e]}}function Jt(e,t){return{type:"ADD_BLOCK_STYLES",styles:Array.isArray(t)?t:[t],blockNames:Array.isArray(e)?e:[e]}}function er(e,t){return{type:"REMOVE_BLOCK_STYLES",styleNames:Array.isArray(t)?t:[t],blockName:e}}function tr(e,t){return{type:"ADD_BLOCK_VARIATIONS",variations:Array.isArray(t)?t:[t],blockName:e}}function rr(e,t){return{type:"REMOVE_BLOCK_VARIATIONS",variationNames:Array.isArray(t)?t:[t],blockName:e}}function nr(e){return{type:"SET_DEFAULT_BLOCK_NAME",name:e}}function or(e){return{type:"SET_FREEFORM_FALLBACK_BLOCK_NAME",name:e}}function ar(e){return{type:"SET_UNREGISTERED_FALLBACK_BLOCK_NAME",name:e}}function ir(e){return{type:"SET_GROUPING_BLOCK_NAME",name:e}}function sr(e){return{type:"SET_CATEGORIES",categories:e}}function cr(e,t){return{type:"UPDATE_CATEGORY",slug:e,category:t}}function lr(e,t,r){return{type:"ADD_BLOCK_COLLECTION",namespace:e,title:t,icon:r}}function ur(e){return{type:"REMOVE_BLOCK_COLLECTION",namespace:e}}function dr(e,t){return{type:"ADD_BOOTSTRAPPED_BLOCK_TYPE",name:e,blockType:t}}function pr(e,t){return({dispatch:r})=>{r({type:"ADD_UNPROCESSED_BLOCK_TYPE",name:e,blockType:t});const n=r(Wt(e,t));n&&r.addBlockTypes(n)}}function hr(e){return{type:"ADD_BLOCK_BINDINGS_SOURCE",name:e.name,label:e.label,usesContext:e.usesContext,getValues:e.getValues,setValues:e.setValues,canUserEditValue:e.canUserEditValue,getFieldsList:e.getFieldsList}}function fr(e){return{type:"REMOVE_BLOCK_BINDINGS_SOURCE",name:e}}const gr=(0,i.createReduxStore)("core/blocks",{reducer:ct,selectors:t,actions:o});(0,i.register)(gr),oe(gr).registerPrivateSelectors(e),oe(gr).registerPrivateActions(a);const mr={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let br;const _r=new Uint8Array(16);function yr(){if(!br&&(br="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!br))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return br(_r)}const kr=[];for(let e=0;e<256;++e)kr.push((e+256).toString(16).slice(1));function wr(e,t=0){return kr[e[t+0]]+kr[e[t+1]]+kr[e[t+2]]+kr[e[t+3]]+"-"+kr[e[t+4]]+kr[e[t+5]]+"-"+kr[e[t+6]]+kr[e[t+7]]+"-"+kr[e[t+8]]+kr[e[t+9]]+"-"+kr[e[t+10]]+kr[e[t+11]]+kr[e[t+12]]+kr[e[t+13]]+kr[e[t+14]]+kr[e[t+15]]}const vr=function(e,t,r){if(mr.randomUUID&&!t&&!e)return mr.randomUUID();const n=(e=e||{}).random||(e.rng||yr)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(let e=0;e<16;++e)t[r+e]=n[e];return t}return wr(n)};function Tr(e,t={},r=[]){const n=Ye(e,t);return{clientId:vr(),name:e,isValid:!0,attributes:n,innerBlocks:r}}function Cr(e=[]){return e.map((e=>{const t=Array.isArray(e)?e:[e.name,e.attributes,e.innerBlocks],[r,n,o=[]]=t;return Tr(r,n,Cr(o))}))}function xr(e,t={},r){const n=vr(),o=Ye(e.name,{...e.attributes,...t});return{...e,clientId:n,attributes:o,innerBlocks:r||e.innerBlocks.map((e=>xr(e)))}}function Er(e,t={},r){const n=vr();return{...e,clientId:n,attributes:{...e.attributes,...t},innerBlocks:r||e.innerBlocks.map((e=>Er(e)))}}const Sr=(e,t,r)=>{if(!r.length)return!1;const n=r.length>1,o=r[0].name;if(!(Nr(e)||!n||e.isMultiBlock))return!1;if(!Nr(e)&&!r.every((e=>e.name===o)))return!1;if(!("block"===e.type))return!1;const a=r[0];return!("from"===t&&-1===e.blocks.indexOf(a.name)&&!Nr(e))&&(!(!n&&"from"===t&&Pr(a.name)&&Pr(e.blockName))&&!!jr(e,r))},Br=e=>{if(!e.length)return[];return ve().filter((t=>!!Lr(Mr("from",t.name),(t=>Sr(t,"from",e)))))},Ar=e=>{if(!e.length)return[];const t=we(e[0].name);return(t?Mr("to",t.name):[]).filter((t=>t&&Sr(t,"to",e))).map((e=>e.blocks)).flat().map(we)},Nr=e=>e&&"block"===e.type&&Array.isArray(e.blocks)&&e.blocks.includes("*"),Pr=e=>e===ge();function Or(e){if(!e.length)return[];const t=Br(e),r=Ar(e);return[...new Set([...t,...r])]}function Lr(e,t){const r=(0,qt.createHooks)();for(let n=0;ne||o),o.priority)}return r.applyFilters("transform",null)}function Mr(e,t){if(void 0===t)return ve().map((({name:t})=>Mr(e,t))).flat();const r=qe(t),{name:n,transforms:o}=r||{};if(!o||!Array.isArray(o[e]))return[];const a=o.supportedMobileTransforms&&Array.isArray(o.supportedMobileTransforms),i=a?o[e].filter((e=>"raw"===e.type||("prefix"===e.type||!(!e.blocks||!e.blocks.length)&&(!!Nr(e)||e.blocks.every((e=>o.supportedMobileTransforms.includes(e))))))):o[e];return i.map((e=>({...e,blockName:n,usingMobileTransformations:a})))}function jr(e,t){if("function"!=typeof e.isMatch)return!0;const r=t[0],n=e.isMultiBlock?t.map((e=>e.attributes)):r.attributes,o=e.isMultiBlock?t:r;return e.isMatch(n,o)}function Dr(e,t){const r=Array.isArray(e)?e:[e],n=r.length>1,o=r[0],a=o.name,i=Mr("from",t),s=Lr(Mr("to",a),(e=>"block"===e.type&&(Nr(e)||-1!==e.blocks.indexOf(t))&&(!n||e.isMultiBlock)&&jr(e,r)))||Lr(i,(e=>"block"===e.type&&(Nr(e)||-1!==e.blocks.indexOf(a))&&(!n||e.isMultiBlock)&&jr(e,r)));if(!s)return null;let c;if(c=s.isMultiBlock?"__experimentalConvert"in s?s.__experimentalConvert(r):s.transform(r.map((e=>e.attributes)),r.map((e=>e.innerBlocks))):"__experimentalConvert"in s?s.__experimentalConvert(o):s.transform(o.attributes,o.innerBlocks),null===c||"object"!=typeof c)return null;if(c=Array.isArray(c)?c:[c],c.some((e=>!we(e.name))))return null;if(!c.some((e=>e.name===t)))return null;return c.map(((t,r,n)=>(0,qt.applyFilters)("blocks.switchToBlockType.transformedBlock",t,e,r,n)))}const zr=(e,t)=>{try{var r;return Tr(e,t.attributes,(null!==(r=t.innerBlocks)&&void 0!==r?r:[]).map((e=>zr(e.name,e))))}catch{return Tr("core/missing",{originalName:e,originalContent:"",originalUndelimitedContent:""})}},Ir=window.wp.blockSerializationDefaultParser,Rr=window.wp.autop,Hr=window.wp.isShallowEqual;var Vr=r.n(Hr);function $r(e,t={}){const{isCommentDelimited:r=!0}=t,{blockName:n,attrs:o={},innerBlocks:a=[],innerContent:i=[]}=e;let s=0;const c=i.map((e=>null!==e?e:$r(a[s++],t))).join("\n").replace(/\n+/g,"\n").trim();return r?Jr(n,o,c):c}const Ur=window.ReactJSXRuntime;function Fr(e){const t="wp-block-"+e.replace(/\//,"-").replace(/^core-/,"");return(0,qt.applyFilters)("blocks.getBlockDefaultClassName",t,e)}function qr(e){const t="editor-block-list-item-"+e.replace(/\//,"-").replace(/^core-/,"");return(0,qt.applyFilters)("blocks.getBlockMenuDefaultClassName",t,e)}const Gr={},Kr={};function Wr(e={}){const{blockType:t,attributes:r}=Gr;return Wr.skipFilters?e:(0,qt.applyFilters)("blocks.getSaveContent.extraProps",{...e},t,r)}function Yr(e={}){const{innerBlocks:t}=Kr;if(!Array.isArray(t))return{...e,children:t};const r=rn(t,{isInnerBlocks:!0}),n=(0,Ur.jsx)(G.RawHTML,{children:r});return{...e,children:n}}function Qr(e,t,r=[]){const n=qe(e);if(!n?.save)return null;let{save:o}=n;if(o.prototype instanceof G.Component){const e=new o({attributes:t});o=e.render.bind(e)}Gr.blockType=n,Gr.attributes=t,Kr.innerBlocks=r;let a=o({attributes:t,innerBlocks:r});if(null!==a&&"object"==typeof a&&(0,qt.hasFilter)("blocks.getSaveContent.extraProps")&&!(n.apiVersion>1)){const e=(0,qt.applyFilters)("blocks.getSaveContent.extraProps",{...a.props},n,t);Vr()(e,a.props)||(a=(0,G.cloneElement)(a,e))}return(0,qt.applyFilters)("blocks.getSaveElement",a,n,t)}function Zr(e,t,r){const n=qe(e);return(0,G.renderToString)(Qr(n,t,r))}function Xr(e){let t=e.originalContent;if(e.isValid||e.innerBlocks.length)try{t=Zr(e.name,e.attributes,e.innerBlocks)}catch(e){}return t}function Jr(e,t,r){const n=t&&Object.entries(t).length?function(e){return JSON.stringify(e).replace(/--/g,"\\u002d\\u002d").replace(//g,"\\u003e").replace(/&/g,"\\u0026").replace(/\\"/g,"\\u0022")}(t)+" ":"",o=e?.startsWith("core/")?e.slice(5):e;return r?`\x3c!-- wp:${o} ${n}--\x3e\n`+r+`\n\x3c!-- /wp:${o} --\x3e`:`\x3c!-- wp:${o} ${n}/--\x3e`}function en(e,{isInnerBlocks:t=!1}={}){if(!e.isValid&&e.__unstableBlockSource)return $r(e.__unstableBlockSource);const r=e.name,n=Xr(e);if(r===be()||!t&&r===fe())return n;const o=we(r);if(!o)return n;const a=function(e,t){var r;return Object.entries(null!==(r=e.attributes)&&void 0!==r?r:{}).reduce(((r,[n,o])=>{const a=t[n];return void 0===a||void 0!==o.source||"local"===o.role?r:"local"===o.__experimentalRole?(Q()("__experimentalRole attribute",{since:"6.7",version:"6.8",alternative:"role attribute",hint:`Check the block.json of the ${e?.name} block.`}),r):("default"in o&&JSON.stringify(o.default)===JSON.stringify(a)||(r[n]=a),r)}),{})}(o,e.attributes);return Jr(r,a,n)}function tn(e){1===e.length&&$e(e[0])&&(e=[]);let t=rn(e);return 1===e.length&&e[0].name===fe()&&"core/freeform"===e[0].name&&(t=(0,Rr.removep)(t)),t}function rn(e,t){return(Array.isArray(e)?e:[e]).map((e=>en(e,t))).join("\n\n")}var nn=/^#[xX]([A-Fa-f0-9]+)$/,on=/^#([0-9]+)$/,an=/^([A-Za-z0-9]+)$/,sn=(function(){function e(e){this.named=e}e.prototype.parse=function(e){if(e){var t=e.match(nn);return t?String.fromCharCode(parseInt(t[1],16)):(t=e.match(on))?String.fromCharCode(parseInt(t[1],10)):(t=e.match(an))?this.named[t[1]]:void 0}}}(),/[\t\n\f ]/),cn=/[A-Za-z]/,ln=/\r\n?/g;function un(e){return sn.test(e)}function dn(e){return cn.test(e)}var pn=function(){function e(e,t,r){void 0===r&&(r="precompile"),this.delegate=e,this.entityParser=t,this.mode=r,this.state="beforeData",this.line=-1,this.column=-1,this.input="",this.index=-1,this.tagNameBuffer="",this.states={beforeData:function(){var e=this.peek();if("<"!==e||this.isIgnoredEndTag()){if("precompile"===this.mode&&"\n"===e){var t=this.tagNameBuffer.toLowerCase();"pre"!==t&&"textarea"!==t||this.consume()}this.transitionTo("data"),this.delegate.beginData()}else this.transitionTo("tagOpen"),this.markTagStart(),this.consume()},data:function(){var e=this.peek(),t=this.tagNameBuffer;"<"!==e||this.isIgnoredEndTag()?"&"===e&&"script"!==t&&"style"!==t?(this.consume(),this.delegate.appendToData(this.consumeCharRef()||"&")):(this.consume(),this.delegate.appendToData(e)):(this.delegate.finishData(),this.transitionTo("tagOpen"),this.markTagStart(),this.consume())},tagOpen:function(){var e=this.consume();"!"===e?this.transitionTo("markupDeclarationOpen"):"/"===e?this.transitionTo("endTagOpen"):("@"===e||":"===e||dn(e))&&(this.transitionTo("tagName"),this.tagNameBuffer="",this.delegate.beginStartTag(),this.appendToTagName(e))},markupDeclarationOpen:function(){var e=this.consume();"-"===e&&"-"===this.peek()?(this.consume(),this.transitionTo("commentStart"),this.delegate.beginComment()):"DOCTYPE"===e.toUpperCase()+this.input.substring(this.index,this.index+6).toUpperCase()&&(this.consume(),this.consume(),this.consume(),this.consume(),this.consume(),this.consume(),this.transitionTo("doctype"),this.delegate.beginDoctype&&this.delegate.beginDoctype())},doctype:function(){un(this.consume())&&this.transitionTo("beforeDoctypeName")},beforeDoctypeName:function(){var e=this.consume();un(e)||(this.transitionTo("doctypeName"),this.delegate.appendToDoctypeName&&this.delegate.appendToDoctypeName(e.toLowerCase()))},doctypeName:function(){var e=this.consume();un(e)?this.transitionTo("afterDoctypeName"):">"===e?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypeName&&this.delegate.appendToDoctypeName(e.toLowerCase())},afterDoctypeName:function(){var e=this.consume();if(!un(e))if(">"===e)this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData");else{var t=e.toUpperCase()+this.input.substring(this.index,this.index+5).toUpperCase(),r="PUBLIC"===t.toUpperCase(),n="SYSTEM"===t.toUpperCase();(r||n)&&(this.consume(),this.consume(),this.consume(),this.consume(),this.consume(),this.consume()),r?this.transitionTo("afterDoctypePublicKeyword"):n&&this.transitionTo("afterDoctypeSystemKeyword")}},afterDoctypePublicKeyword:function(){var e=this.peek();un(e)?(this.transitionTo("beforeDoctypePublicIdentifier"),this.consume()):'"'===e?(this.transitionTo("doctypePublicIdentifierDoubleQuoted"),this.consume()):"'"===e?(this.transitionTo("doctypePublicIdentifierSingleQuoted"),this.consume()):">"===e&&(this.consume(),this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData"))},doctypePublicIdentifierDoubleQuoted:function(){var e=this.consume();'"'===e?this.transitionTo("afterDoctypePublicIdentifier"):">"===e?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypePublicIdentifier&&this.delegate.appendToDoctypePublicIdentifier(e)},doctypePublicIdentifierSingleQuoted:function(){var e=this.consume();"'"===e?this.transitionTo("afterDoctypePublicIdentifier"):">"===e?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypePublicIdentifier&&this.delegate.appendToDoctypePublicIdentifier(e)},afterDoctypePublicIdentifier:function(){var e=this.consume();un(e)?this.transitionTo("betweenDoctypePublicAndSystemIdentifiers"):">"===e?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):'"'===e?this.transitionTo("doctypeSystemIdentifierDoubleQuoted"):"'"===e&&this.transitionTo("doctypeSystemIdentifierSingleQuoted")},betweenDoctypePublicAndSystemIdentifiers:function(){var e=this.consume();un(e)||(">"===e?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):'"'===e?this.transitionTo("doctypeSystemIdentifierDoubleQuoted"):"'"===e&&this.transitionTo("doctypeSystemIdentifierSingleQuoted"))},doctypeSystemIdentifierDoubleQuoted:function(){var e=this.consume();'"'===e?this.transitionTo("afterDoctypeSystemIdentifier"):">"===e?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypeSystemIdentifier&&this.delegate.appendToDoctypeSystemIdentifier(e)},doctypeSystemIdentifierSingleQuoted:function(){var e=this.consume();"'"===e?this.transitionTo("afterDoctypeSystemIdentifier"):">"===e?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypeSystemIdentifier&&this.delegate.appendToDoctypeSystemIdentifier(e)},afterDoctypeSystemIdentifier:function(){var e=this.consume();un(e)||">"===e&&(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData"))},commentStart:function(){var e=this.consume();"-"===e?this.transitionTo("commentStartDash"):">"===e?(this.delegate.finishComment(),this.transitionTo("beforeData")):(this.delegate.appendToCommentData(e),this.transitionTo("comment"))},commentStartDash:function(){var e=this.consume();"-"===e?this.transitionTo("commentEnd"):">"===e?(this.delegate.finishComment(),this.transitionTo("beforeData")):(this.delegate.appendToCommentData("-"),this.transitionTo("comment"))},comment:function(){var e=this.consume();"-"===e?this.transitionTo("commentEndDash"):this.delegate.appendToCommentData(e)},commentEndDash:function(){var e=this.consume();"-"===e?this.transitionTo("commentEnd"):(this.delegate.appendToCommentData("-"+e),this.transitionTo("comment"))},commentEnd:function(){var e=this.consume();">"===e?(this.delegate.finishComment(),this.transitionTo("beforeData")):(this.delegate.appendToCommentData("--"+e),this.transitionTo("comment"))},tagName:function(){var e=this.consume();un(e)?this.transitionTo("beforeAttributeName"):"/"===e?this.transitionTo("selfClosingStartTag"):">"===e?(this.delegate.finishTag(),this.transitionTo("beforeData")):this.appendToTagName(e)},endTagName:function(){var e=this.consume();un(e)?(this.transitionTo("beforeAttributeName"),this.tagNameBuffer=""):"/"===e?(this.transitionTo("selfClosingStartTag"),this.tagNameBuffer=""):">"===e?(this.delegate.finishTag(),this.transitionTo("beforeData"),this.tagNameBuffer=""):this.appendToTagName(e)},beforeAttributeName:function(){var e=this.peek();un(e)?this.consume():"/"===e?(this.transitionTo("selfClosingStartTag"),this.consume()):">"===e?(this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):"="===e?(this.delegate.reportSyntaxError("attribute name cannot start with equals sign"),this.transitionTo("attributeName"),this.delegate.beginAttribute(),this.consume(),this.delegate.appendToAttributeName(e)):(this.transitionTo("attributeName"),this.delegate.beginAttribute())},attributeName:function(){var e=this.peek();un(e)?(this.transitionTo("afterAttributeName"),this.consume()):"/"===e?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("selfClosingStartTag")):"="===e?(this.transitionTo("beforeAttributeValue"),this.consume()):">"===e?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):'"'===e||"'"===e||"<"===e?(this.delegate.reportSyntaxError(e+" is not a valid character within attribute names"),this.consume(),this.delegate.appendToAttributeName(e)):(this.consume(),this.delegate.appendToAttributeName(e))},afterAttributeName:function(){var e=this.peek();un(e)?this.consume():"/"===e?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("selfClosingStartTag")):"="===e?(this.consume(),this.transitionTo("beforeAttributeValue")):">"===e?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.transitionTo("attributeName"),this.delegate.beginAttribute(),this.consume(),this.delegate.appendToAttributeName(e))},beforeAttributeValue:function(){var e=this.peek();un(e)?this.consume():'"'===e?(this.transitionTo("attributeValueDoubleQuoted"),this.delegate.beginAttributeValue(!0),this.consume()):"'"===e?(this.transitionTo("attributeValueSingleQuoted"),this.delegate.beginAttributeValue(!0),this.consume()):">"===e?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):(this.transitionTo("attributeValueUnquoted"),this.delegate.beginAttributeValue(!1),this.consume(),this.delegate.appendToAttributeValue(e))},attributeValueDoubleQuoted:function(){var e=this.consume();'"'===e?(this.delegate.finishAttributeValue(),this.transitionTo("afterAttributeValueQuoted")):"&"===e?this.delegate.appendToAttributeValue(this.consumeCharRef()||"&"):this.delegate.appendToAttributeValue(e)},attributeValueSingleQuoted:function(){var e=this.consume();"'"===e?(this.delegate.finishAttributeValue(),this.transitionTo("afterAttributeValueQuoted")):"&"===e?this.delegate.appendToAttributeValue(this.consumeCharRef()||"&"):this.delegate.appendToAttributeValue(e)},attributeValueUnquoted:function(){var e=this.peek();un(e)?(this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("beforeAttributeName")):"/"===e?(this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("selfClosingStartTag")):"&"===e?(this.consume(),this.delegate.appendToAttributeValue(this.consumeCharRef()||"&")):">"===e?(this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):(this.consume(),this.delegate.appendToAttributeValue(e))},afterAttributeValueQuoted:function(){var e=this.peek();un(e)?(this.consume(),this.transitionTo("beforeAttributeName")):"/"===e?(this.consume(),this.transitionTo("selfClosingStartTag")):">"===e?(this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):this.transitionTo("beforeAttributeName")},selfClosingStartTag:function(){">"===this.peek()?(this.consume(),this.delegate.markTagAsSelfClosing(),this.delegate.finishTag(),this.transitionTo("beforeData")):this.transitionTo("beforeAttributeName")},endTagOpen:function(){var e=this.consume();("@"===e||":"===e||dn(e))&&(this.transitionTo("endTagName"),this.tagNameBuffer="",this.delegate.beginEndTag(),this.appendToTagName(e))}},this.reset()}return e.prototype.reset=function(){this.transitionTo("beforeData"),this.input="",this.tagNameBuffer="",this.index=0,this.line=1,this.column=0,this.delegate.reset()},e.prototype.transitionTo=function(e){this.state=e},e.prototype.tokenize=function(e){this.reset(),this.tokenizePart(e),this.tokenizeEOF()},e.prototype.tokenizePart=function(e){for(this.input+=function(e){return e.replace(ln,"\n")}(e);this.index"!==this.input.substring(this.index,this.index+8)||"style"===e&&""!==this.input.substring(this.index,this.index+8)||"script"===e&&"<\/script>"!==this.input.substring(this.index,this.index+9)},e}(),hn=function(){function e(e,t){void 0===t&&(t={}),this.options=t,this.token=null,this.startLine=1,this.startColumn=0,this.tokens=[],this.tokenizer=new pn(this,e,t.mode),this._currentAttribute=void 0}return e.prototype.tokenize=function(e){return this.tokens=[],this.tokenizer.tokenize(e),this.tokens},e.prototype.tokenizePart=function(e){return this.tokens=[],this.tokenizer.tokenizePart(e),this.tokens},e.prototype.tokenizeEOF=function(){return this.tokens=[],this.tokenizer.tokenizeEOF(),this.tokens[0]},e.prototype.reset=function(){this.token=null,this.startLine=1,this.startColumn=0},e.prototype.current=function(){var e=this.token;if(null===e)throw new Error("token was unexpectedly null");if(0===arguments.length)return e;for(var t=0;te("Block validation: "+t,...r)}return{error:e(console.error),warning:e(console.warn),getItems:()=>[]}}const _n=/[\t\n\r\v\f ]+/g,yn=/^[\t\n\r\v\f ]*$/,kn=/^url\s*\(['"\s]*(.*?)['"\s]*\)$/,wn=["allowfullscreen","allowpaymentrequest","allowusermedia","async","autofocus","autoplay","checked","controls","default","defer","disabled","download","formnovalidate","hidden","ismap","itemscope","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected","typemustmatch"],vn=[...wn,"autocapitalize","autocomplete","charset","contenteditable","crossorigin","decoding","dir","draggable","enctype","formenctype","formmethod","http-equiv","inputmode","kind","method","preload","scope","shape","spellcheck","translate","type","wrap"],Tn=[e=>e,function(e){return Bn(e).join(" ")}],Cn=/^[\da-z]+$/i,xn=/^#\d+$/,En=/^#x[\da-f]+$/i;class Sn{parse(e){if(t=e,Cn.test(t)||xn.test(t)||En.test(t))return(0,mn.decodeEntities)("&"+e+";");var t}}function Bn(e){return e.trim().split(_n)}function An(e){return e.attributes.filter((e=>{const[t,r]=e;return r||0===t.indexOf("data-")||vn.includes(t)}))}function Nn(e,t,r=bn()){let n=e.chars,o=t.chars;for(let e=0;e{const[t,...r]=e.split(":"),n=r.join(":");return[t.trim(),On(n.trim())]}));return Object.fromEntries(t)}const Mn={class:(e,t)=>{const[r,n]=[e,t].map(Bn),o=r.filter((e=>!n.includes(e))),a=n.filter((e=>!r.includes(e)));return 0===o.length&&0===a.length},style:(e,t)=>gn()(...[e,t].map(Ln)),...Object.fromEntries(wn.map((e=>[e,()=>!0])))};const jn={StartTag:(e,t,r=bn())=>e.tagName!==t.tagName&&e.tagName.toLowerCase()!==t.tagName.toLowerCase()?(r.warning("Expected tag name `%s`, instead saw `%s`.",t.tagName,e.tagName),!1):function(e,t,r=bn()){if(e.length!==t.length)return r.warning("Expected attributes %o, instead saw %o.",t,e),!1;const n={};for(let e=0;efunction(e,t=bn()){try{return new hn(new Sn).tokenize(e)}catch(r){t.warning("Malformed HTML detected: %s",e)}return null}(e,r)));if(!n||!o)return!1;let a,i;for(;a=Dn(n);){if(i=Dn(o),!i)return r.warning("Expected end of content, instead saw %o.",a),!1;if(a.type!==i.type)return r.warning("Expected token of type `%s` (%o), instead saw `%s` (%o).",i.type,i,a.type,a),!1;const e=jn[a.type];if(e&&!e(a,i,r))return!1;zn(a,o[0])?Dn(o):zn(i,n[0])&&Dn(n)}return!(i=Dn(o))||(r.warning("Expected %o, instead saw end of content.",i),!1)}function Rn(e,t=e.name){if(e.name===fe()||e.name===be())return[!0,[]];const r=function(){const e=[],t=bn();return{error(...r){e.push({log:t.error,args:r})},warning(...r){e.push({log:t.warning,args:r})},getItems:()=>e}}(),n=qe(t);let o;try{o=Zr(n,e.attributes)}catch(e){return r.error("Block validation failed because an error occurred while generating block content:\n\n%s",e.toString()),[!1,r.getItems()]}const a=In(e.originalContent,o,r);return a||r.error("Block validation failed for `%s` (%o).\n\nContent generated by `save` function:\n\n%s\n\nContent retrieved from post body:\n\n%s",n.name,n,o,e.originalContent),[a,r.getItems()]}function Hn(e,t,r){Q()("isValidBlockContent introduces opportunity for data loss",{since:"12.6",plugin:"Gutenberg",alternative:"validateBlock"});const n=qe(e),o={name:n.name,attributes:t,innerBlocks:[],originalContent:r},[a]=Rn(o,n);return a}function Vn(e,t){const r={...t};if("core/cover-image"===e&&(e="core/cover"),"core/text"!==e&&"core/cover-text"!==e||(e="core/paragraph"),e&&0===e.indexOf("core/social-link-")&&(r.service=e.substring(17),e="core/social-link"),e&&0===e.indexOf("core-embed/")){const t=e.substring(11),n={speaker:"speaker-deck",polldaddy:"crowdsignal"};r.providerNameSlug=t in n?n[t]:t,["amazon-kindle","wordpress"].includes(t)||(r.responsive=!0),e="core/embed"}if("core/post-comment-author"===e&&(e="core/comment-author-name"),"core/post-comment-content"===e&&(e="core/comment-content"),"core/post-comment-date"===e&&(e="core/comment-date"),"core/comments-query-loop"===e){e="core/comments";const{className:t=""}=r;t.includes("wp-block-comments-query-loop")||(r.className=["wp-block-comments-query-loop",t].join(" "))}if("core/post-comments"===e&&(e="core/comments",r.legacy=!0),"grid"===t.layout?.type&&"string"==typeof t.layout?.columnCount&&(r.layout={...r.layout,columnCount:parseInt(t.layout.columnCount,10)}),"string"==typeof t.style?.layout?.columnSpan){const e=parseInt(t.style.layout.columnSpan,10);r.style={...r.style,layout:{...r.style.layout,columnSpan:isNaN(e)?void 0:e}}}if("string"==typeof t.style?.layout?.rowSpan){const e=parseInt(t.style.layout.rowSpan,10);r.style={...r.style,layout:{...r.style.layout,rowSpan:isNaN(e)?void 0:e}}}return[e,r]}var $n,Un=function(){return $n||($n=document.implementation.createHTMLDocument("")),$n};function Fn(e,t){if(t){if("string"==typeof e){var r=Un();r.body.innerHTML=e,e=r.body}if("function"==typeof t)return t(e);if(Object===t.constructor)return Object.keys(t).reduce((function(r,n){return r[n]=Fn(e,t[n]),r}),{})}}function qn(e,t){return 1===arguments.length&&(t=e,e=void 0),function(r){var n=r;if(e&&(n=r.querySelector(e)),n)return function(e,t){for(var r,n=t.split(".");r=n.shift();){if(!(r in e))return;e=e[r]}return e}(n,t)}}function Gn(e){const t={};for(let r=0;r{let r=t;e&&(r=t.querySelector(e));try{return Kn(r)}catch(e){return null}}}const Yn={isNodeOfType:function(e,t){return Q()("wp.blocks.node.isNodeOfType",{since:"6.1",version:"6.3",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"}),e&&e.type===t},fromDOM:Kn,toHTML:function(e){return Q()("wp.blocks.node.toHTML",{since:"6.1",version:"6.3",alternative:"wp.richText.toHTMLString",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"}),Zn([e])},matcher:Wn};function Qn(e){Q()("wp.blocks.children.fromDOM",{since:"6.1",version:"6.3",alternative:"wp.richText.create",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"});const t=[];for(let r=0;r{let r=t;return e&&(r=t.querySelector(e)),r?Qn(r.childNodes):[]}}const Jn={concat:function(...e){Q()("wp.blocks.children.concat",{since:"6.1",version:"6.3",alternative:"wp.richText.concat",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"});const t=[];for(let r=0;rfunction(e,t){switch(t){case"rich-text":return e instanceof W.RichTextData;case"string":return"string"==typeof e;case"boolean":return"boolean"==typeof e;case"object":return!!e&&e.constructor===Object;case"null":return null===e;case"array":return Array.isArray(e);case"integer":case"number":return"number"==typeof e}return!0}(e,t)))}function to(e,t,r,n,o){let a;switch(t.source){case void 0:a=n?n[e]:void 0;break;case"raw":a=o;break;case"attribute":case"property":case"html":case"text":case"rich-text":case"children":case"node":case"query":case"tag":a=oo(r,t)}return function(e,t){return void 0===t||eo(e,Array.isArray(t)?t:[t])}(a,t.type)&&function(e,t){return!Array.isArray(t)||t.includes(e)}(a,t.enum)||(a=void 0),void 0===a&&(a=We(t)),a}const ro=function(e,t){var r,n,o=0;function a(){var a,i,s=r,c=arguments.length;e:for(;s;){if(s.args.length===arguments.length){for(i=0;i{switch(e.source){case"attribute":{let t=function(e,t){return 1===arguments.length&&(t=e,e=void 0),function(r){var n=qn(e,"attributes")(r);if(n&&n.hasOwnProperty(t))return n[t].value}}(e.selector,e.attribute);return"boolean"===e.type&&(t=(e=>t=>void 0!==e(t))(t)),t}case"html":return t=e.selector,r=e.multiline,e=>{let n=e;if(t&&(n=e.querySelector(t)),!n)return"";if(r){let e="";const t=n.children.length;for(let o=0;or=>{const n=e?r.querySelector(e):r;return n?W.RichTextData.fromHTMLElement(n,{preserveWhiteSpace:t}):W.RichTextData.empty()})(e.selector,e.__unstablePreserveWhiteSpace);case"children":return Xn(e.selector);case"node":return Wn(e.selector);case"query":const n=Object.fromEntries(Object.entries(e.query).map((([e,t])=>[e,ro(t)])));return function(e,t){return function(r){var n=r.querySelectorAll(e);return[].map.call(n,(function(e){return Fn(e,t)}))}}(e.selector,n);case"tag":{const t=qn(e.selector,"nodeName");return e=>t(e)?.toLowerCase()}default:console.error(`Unknown source type "${e.source}"`)}var t,r}));function no(e){return Fn(e,(e=>e))}function oo(e,t){return ro(t)(no(e))}function ao(e,t,r={}){var n;const o=no(t),a=qe(e),i=Object.fromEntries(Object.entries(null!==(n=a.attributes)&&void 0!==n?n:{}).map((([e,n])=>[e,to(e,n,o,r,t)])));return(0,qt.applyFilters)("blocks.getBlockAttributes",i,a,t,r)}const io={type:"string",source:"attribute",selector:"[data-custom-class-name] > *",attribute:"class"};function so(e){const t=oo(`
    ${e}
    `,io);return t?t.trim().split(/\s+/):[]}function co(e,t){const r=function(e,t,r){if(!Ce(t,"customClassName",!0))return e;const n={...e},{className:o,...a}=n,i=Zr(t,a),s=so(i),c=so(r).filter((e=>!s.includes(e)));return c.length?n.className=c.join(" "):i&&delete n.className,n}(e.attributes,t,e.originalContent);return{...e,attributes:r}}function lo(){return!1}function uo(e,t){let r=function(e,t){const r=fe(),n=e.blockName||fe(),o=e.attrs||{},a=e.innerBlocks||[];let i=e.innerHTML.trim();return n!==r||"core/freeform"!==n||t?.__unstableSkipAutop||(i=(0,Rr.autop)(i).trim()),{...e,blockName:n,attrs:o,innerHTML:i,innerBlocks:a}}(e,t);r=function(e){const[t,r]=Vn(e.blockName,e.attrs);return{...e,blockName:t,attrs:r}}(r);let n=we(r.blockName);n||(r=function(e){const t=be()||fe(),r=$r(e,{isCommentDelimited:!1}),n=$r(e,{isCommentDelimited:!0});return{blockName:t,attrs:{originalName:e.blockName,originalContent:n,originalUndelimitedContent:r},innerHTML:e.blockName?n:e.innerHTML,innerBlocks:e.innerBlocks,innerContent:e.innerContent}}(r),n=we(r.blockName));const o=r.blockName===fe()||r.blockName===be();if(!n||!r.innerHTML&&o)return;const a=r.innerBlocks.map((e=>uo(e,t))).filter((e=>!!e)),i=Tr(r.blockName,ao(n,r.innerHTML,r.attrs),a);i.originalContent=r.innerHTML;const s=function(e,t){const[r]=Rn(e,t);if(r)return{...e,isValid:r,validationIssues:[]};const n=co(e,t),[o,a]=Rn(n,t);return{...n,isValid:o,validationIssues:a}}(i,n),{validationIssues:c}=s,l=function(e,t,r){const n=t.attrs,{deprecated:o}=r;if(!o||!o.length)return e;for(let a=0;ae(...t))):(console.groupCollapsed("Updated Block: %s",n.name),console.info("Block successfully updated for `%s` (%o).\n\nNew content generated by `save` function:\n\n%s\n\nContent retrieved from post body:\n\n%s",n.name,n,Zr(n,l.attributes),l.originalContent),console.groupEnd()),l}function po(e,t){return(0,Ir.parse)(e).reduce(((e,r)=>{const n=uo(r,t);return n&&e.push(n),e}),[])}function ho(){return Mr("from").filter((({type:e})=>"raw"===e)).map((e=>e.isMatch?e:{...e,isMatch:t=>e.selector&&t.matches(e.selector)}))}function fo(e,t){const r=document.implementation.createHTMLDocument("");return r.body.innerHTML=e,Array.from(r.body.children).flatMap((e=>{const r=Lr(ho(),(({isMatch:t})=>t(e)));if(!r)return G.Platform.isNative?po(`\x3c!-- wp:html --\x3e${e.outerHTML}\x3c!-- /wp:html --\x3e`):Tr("core/html",ao("core/html",e.outerHTML));const{transform:n,blockName:o}=r;if(n){const r=n(e,t);return e.hasAttribute("class")&&(r.attributes.className=e.getAttribute("class")),r}return Tr(o,ao(o,e.outerHTML))}))}function go(e,t={}){const r=document.implementation.createHTMLDocument(""),n=document.implementation.createHTMLDocument(""),o=r.body,a=n.body;for(o.innerHTML=e;o.firstChild;){const e=o.firstChild;e.nodeType===e.TEXT_NODE?(0,K.isEmpty)(e)?o.removeChild(e):(a.lastChild&&"P"===a.lastChild.nodeName||a.appendChild(n.createElement("P")),a.lastChild.appendChild(e)):e.nodeType===e.ELEMENT_NODE?"BR"===e.nodeName?(e.nextSibling&&"BR"===e.nextSibling.nodeName&&(a.appendChild(n.createElement("P")),o.removeChild(e.nextSibling)),a.lastChild&&"P"===a.lastChild.nodeName&&a.lastChild.hasChildNodes()?a.lastChild.appendChild(e):o.removeChild(e)):"P"===e.nodeName?(0,K.isEmpty)(e)&&!t.raw?o.removeChild(e):a.appendChild(e):(0,K.isPhrasingContent)(e)?(a.lastChild&&"P"===a.lastChild.nodeName||a.appendChild(n.createElement("P")),a.lastChild.appendChild(e)):a.appendChild(e):o.removeChild(e)}return a.innerHTML}function mo(e,t){if(e.nodeType!==e.COMMENT_NODE)return;if("nextpage"!==e.nodeValue&&0!==e.nodeValue.indexOf("more"))return;const r=function(e,t){if("nextpage"===e.nodeValue)return function(e){const t=e.createElement("wp-block");return t.dataset.block="core/nextpage",t}(t);const r=e.nodeValue.slice(4).trim();let n=e,o=!1;for(;n=n.nextSibling;)if(n.nodeType===n.COMMENT_NODE&&"noteaser"===n.nodeValue){o=!0,(0,K.remove)(n);break}return function(e,t,r){const n=r.createElement("wp-block");n.dataset.block="core/more",e&&(n.dataset.customText=e);t&&(n.dataset.noTeaser="");return n}(r,o,t)}(e,t);if(e.parentNode&&"P"===e.parentNode.nodeName){const n=Array.from(e.parentNode.childNodes),o=n.indexOf(e),a=e.parentNode.parentNode||t.body,i=(e,r)=>(e||(e=t.createElement("p")),e.appendChild(r),e);[n.slice(0,o).reduce(i,null),r,n.slice(o+1).reduce(i,null)].forEach((t=>t&&a.insertBefore(t,e.parentNode))),(0,K.remove)(e.parentNode)}else(0,K.replace)(e,r)}function bo(e){return"OL"===e.nodeName||"UL"===e.nodeName}function _o(e){if(!bo(e))return;const t=e,r=e.previousElementSibling;if(r&&r.nodeName===e.nodeName&&1===t.children.length){for(;t.firstChild;)r.appendChild(t.firstChild);t.parentNode.removeChild(t)}const n=e.parentNode;if(n&&"LI"===n.nodeName&&1===n.children.length&&!/\S/.test((o=n,Array.from(o.childNodes).map((({nodeValue:e=""})=>e)).join("")))){const e=n,r=e.previousElementSibling,o=e.parentNode;r&&(r.appendChild(t),o.removeChild(e))}var o;if(n&&bo(n)){const t=e.previousElementSibling;t?t.appendChild(e):(0,K.unwrap)(e)}}function yo(e){return t=>{"BLOCKQUOTE"===t.nodeName&&(t.innerHTML=go(t.innerHTML,e))}}function ko(e,t=e){const r=e.ownerDocument.createElement("figure");t.parentNode.insertBefore(r,t),r.appendChild(e)}function wo(e,t,r){if(!function(e,t){var r;const n=e.nodeName.toLowerCase();return"figcaption"!==n&&!(0,K.isTextContent)(e)&&n in(null!==(r=t?.figure?.children)&&void 0!==r?r:{})}(e,r))return;let n=e;const o=e.parentNode;(function(e,t){var r;return e.nodeName.toLowerCase()in(null!==(r=t?.figure?.children?.a?.children)&&void 0!==r?r:{})})(e,r)&&"A"===o.nodeName&&1===o.childNodes.length&&(n=e.parentNode);const a=n.closest("p,div");a?e.classList?(e.classList.contains("alignright")||e.classList.contains("alignleft")||e.classList.contains("aligncenter")||!a.textContent.trim())&&ko(n,a):ko(n,a):ko(n)}const vo=window.wp.shortcode,To=e=>Array.isArray(e)?e:[e],Co=/(\n|

    )\s*$/,xo=/^\s*(\n|<\/p>)/;const Eo=function e(t,r=0,n=[]){const o=Lr(Mr("from"),(e=>-1===n.indexOf(e.blockName)&&"shortcode"===e.type&&To(e.tag).some((e=>(0,vo.regexp)(e).test(t)))));if(!o)return[t];const a=To(o.tag).find((e=>(0,vo.regexp)(e).test(t)));let i;const s=r;if(i=(0,vo.next)(a,t,r)){r=i.index+i.content.length;const a=t.substr(0,i.index),c=t.substr(r);if(!(i.shortcode.content?.includes("<")||Co.test(a)&&xo.test(c)))return e(t,r);if(o.isMatch&&!o.isMatch(i.shortcode.attrs))return e(t,s,[...n,o.blockName]);let l=[];if("function"==typeof o.transform)l=[].concat(o.transform(i.shortcode.attrs,i)),l=l.map((e=>(e.originalContent=i.shortcode.content,co(e,we(e.name)))));else{const e=Object.fromEntries(Object.entries(o.attributes).filter((([,e])=>e.shortcode)).map((([e,t])=>[e,t.shortcode(i.shortcode.attrs,i)]))),r=we(o.blockName);if(!r)return[t];const n={...r,attributes:o.attributes};let a=Tr(o.blockName,ao(n,i.shortcode.content,e));a.originalContent=i.shortcode.content,a=co(a,n),l=[a]}return[...e(a.replace(Co,"")),...l,...e(c.replace(xo,""))]}return[t]};function So(e){return function(e,t){const r={phrasingContentSchema:(0,K.getPhrasingContentSchema)(t),isPaste:"paste"===t};function n(e,t,r){switch(r){case"children":return"*"===e||"*"===t?"*":{...e,...t};case"attributes":case"require":return[...e||[],...t||[]];case"isMatch":if(!e||!t)return;return(...r)=>e(...r)||t(...r)}}function o(e,t){for(const r in t)e[r]=e[r]?n(e[r],t[r],r):{...t[r]};return e}return e.map((({isMatch:e,blockName:t,schema:n})=>{const o=Ce(t,"anchor");return n="function"==typeof n?n(r):n,o||e?n?Object.fromEntries(Object.entries(n).map((([t,r])=>{let n=r.attributes||[];return o&&(n=[...n,"id"]),[t,{...r,attributes:n,isMatch:e||void 0}]}))):{}:n})).reduce((function(e,t){for(const r in t)e[r]=e[r]?o(e[r],t[r]):{...t[r]};return e}),{})}(ho(),e)}function Bo(e,t,r,n){Array.from(e).forEach((e=>{Bo(e.childNodes,t,r,n),t.forEach((t=>{r.contains(e)&&t(e,r,n)}))}))}function Ao(e,t=[],r){const n=document.implementation.createHTMLDocument("");return n.body.innerHTML=e,Bo(n.body.childNodes,t,n,r),n.body.innerHTML}function No(e,t){const r=e[`${t}Sibling`];if(r&&(0,K.isPhrasingContent)(r))return r;const{parentNode:n}=e;return n&&(0,K.isPhrasingContent)(n)?No(n,t):void 0}function Po(e){return Q()("wp.blocks.getPhrasingContentSchema",{since:"5.6",alternative:"wp.dom.getPhrasingContentSchema"}),(0,K.getPhrasingContentSchema)(e)}function Oo({HTML:e=""}){if(-1!==e.indexOf("\x3c!-- wp:")){const t=po(e);if(!(1===t.length&&"core/freeform"===t[0].name))return t}const t=Eo(e),r=So();return t.map((e=>{if("string"!=typeof e)return e;return fo(e=go(e=Ao(e,[_o,mo,wo,yo({raw:!0})],r),{raw:!0}),Oo)})).flat().filter(Boolean)}function Lo(e){e.nodeType===e.COMMENT_NODE&&(0,K.remove)(e)}function Mo(e,t){return e.every((e=>function(e,t){if((0,K.isTextContent)(e))return!0;if(!t)return!1;const r=e.nodeName.toLowerCase();return[["ul","li","ol"],["h1","h2","h3","h4","h5","h6"]].some((e=>0===[r,t].filter((t=>!e.includes(t))).length))}(e,t)&&Mo(Array.from(e.children),t)))}function jo(e){return"BR"===e.nodeName&&e.previousSibling&&"BR"===e.previousSibling.nodeName}function Do(e,t){if("SPAN"===e.nodeName&&e.style){const{fontWeight:r,fontStyle:n,textDecorationLine:o,textDecoration:a,verticalAlign:i}=e.style;"bold"!==r&&"700"!==r||(0,K.wrap)(t.createElement("strong"),e),"italic"===n&&(0,K.wrap)(t.createElement("em"),e),("line-through"===o||a.includes("line-through"))&&(0,K.wrap)(t.createElement("s"),e),"super"===i?(0,K.wrap)(t.createElement("sup"),e):"sub"===i&&(0,K.wrap)(t.createElement("sub"),e)}else"B"===e.nodeName?e=(0,K.replaceTag)(e,"strong"):"I"===e.nodeName?e=(0,K.replaceTag)(e,"em"):"A"===e.nodeName&&(e.target&&"_blank"===e.target.toLowerCase()?e.rel="noreferrer noopener":(e.removeAttribute("target"),e.removeAttribute("rel")),e.name&&!e.id&&(e.id=e.name),e.id&&!e.ownerDocument.querySelector(`[href="#${e.id}"]`)&&e.removeAttribute("id"))}function zo(e){"SCRIPT"!==e.nodeName&&"NOSCRIPT"!==e.nodeName&&"TEMPLATE"!==e.nodeName&&"STYLE"!==e.nodeName||e.parentNode.removeChild(e)}function Io(e){if(e.nodeType!==e.ELEMENT_NODE)return;const t=e.getAttribute("style");if(!t||!t.includes("mso-list"))return;"ignore"===t.split(";").reduce(((e,t)=>{const[r,n]=t.split(":");return r&&n&&(e[r.trim().toLowerCase()]=n.trim().toLowerCase()),e}),{})["mso-list"]&&e.remove()}function Ro(e){return"OL"===e.nodeName||"UL"===e.nodeName}function Ho(e,t){if("P"!==e.nodeName)return;const r=e.getAttribute("style");if(!r||!r.includes("mso-list"))return;const n=e.previousElementSibling;if(!n||!Ro(n)){const r=e.textContent.trim().slice(0,1),n=/[1iIaA]/.test(r),o=t.createElement(n?"ol":"ul");n&&o.setAttribute("type",r),e.parentNode.insertBefore(o,e)}const o=e.previousElementSibling,a=o.nodeName,i=t.createElement("li");let s=o;i.innerHTML=Ao(e.innerHTML,[Io]);const c=/mso-list\s*:[^;]+level([0-9]+)/i.exec(r);let l=c&&parseInt(c[1],10)-1||0;for(;l--;)s=s.lastChild||s,Ro(s)&&(s=s.lastChild||s);Ro(s)||(s=s.appendChild(t.createElement(a))),s.appendChild(i),e.parentNode.removeChild(e)}const Vo=window.wp.blob;function $o(e){if("IMG"===e.nodeName){if(0===e.src.indexOf("file:")&&(e.src=""),0===e.src.indexOf("data:")){const[t,r]=e.src.split(","),[n]=t.slice(5).split(";");if(!r||!n)return void(e.src="");let o;try{o=atob(r)}catch(t){return void(e.src="")}const a=new Uint8Array(o.length);for(let e=0;ewindow?.console?.log?.(...e);function Jo(e){return e=Ao(e,[zo,Ko,Io,Do,Lo]),e=Ao(e=(0,K.removeInvalidHTML)(e,(0,K.getPhrasingContentSchema)("paste"),{inline:!0}),[Wo,Yo]),Xo("Processed inline HTML:\n\n",e),e}function ea({HTML:e="",plainText:t="",mode:r="AUTO",tagName:n}){if(e=(e=(e=e.replace(/]+>/g,"")).replace(/^\s*]*>\s*]*>(?:\s*)?/i,"")).replace(/(?:\s*)?<\/body>\s*<\/html>\s*$/i,""),"INLINE"!==r){const r=e||t;if(-1!==r.indexOf("\x3c!-- wp:")){const e=po(r);if(!(1===e.length&&"core/freeform"===e[0].name))return e}}String.prototype.normalize&&(e=e.normalize()),e=Ao(e,[Zo]);const o=t&&(!e||function(e){return!/<(?!br[ />])/i.test(e)}(e));var a;o&&(e=t,/^\s+$/.test(t)||(a=e,e=qo.makeHtml(function(e){return e.replace(/((?:^|\n)```)([^\n`]+)(```(?:$|\n))/,((e,t,r,n)=>`${t}\n${r}\n${n}`))}(function(e){return e.replace(/(^|\n)•( +)/g,"$1*$2")}(a)))));const i=Eo(e),s=i.length>1;if(o&&!s&&"AUTO"===r&&-1===t.indexOf("\n")&&0!==t.indexOf("

    ")&&0===e.indexOf("

    ")&&(r="INLINE"),"INLINE"===r)return Jo(e);if("AUTO"===r&&!s&&function(e,t){const r=document.implementation.createHTMLDocument("");r.body.innerHTML=e;const n=Array.from(r.body.children);return!n.some(jo)&&Mo(n,t)}(e,n))return Jo(e);const c=(0,K.getPhrasingContentSchema)("paste"),l=So("paste"),u=i.map((e=>{if("string"!=typeof e)return e;const t=[Ko,Ho,zo,_o,$o,Do,mo,Lo,Go,wo,yo(),Uo],r={...l,...c};return e=Ao(e,t,l),e=Ao(e=go(e=(0,K.removeInvalidHTML)(e,r)),[Wo,Yo,Qo],l),Xo("Processed HTML piece:\n\n",e),fo(e,ea)})).flat().filter(Boolean);if("AUTO"===r&&1===u.length&&Ce(u[0].name,"__unstablePasteTextInline",!1)){const e=/^[\n]+|[\n]+$/g,r=t.replace(e,"");if(""!==r&&-1===r.indexOf("\n"))return(0,K.removeInvalidHTML)(Xr(u[0]),c).replace(e,"")}return u}function ta(){return(0,i.select)(gr).getCategories()}function ra(e){(0,i.dispatch)(gr).setCategories(e)}function na(e,t){(0,i.dispatch)(gr).updateCategory(e,t)}function oa(e=[],t=[]){return e.length===t.length&&t.every((([t,,r],n)=>{const o=e[n];return t===o.name&&oa(o.innerBlocks,r)}))}const aa=e=>"html"===e?.source,ia=e=>"query"===e?.source;function sa(e,t){return t?Object.fromEntries(Object.entries(t).map((([t,r])=>[t,ca(e[t],r)]))):{}}function ca(e,t){return aa(e)&&Array.isArray(t)?(0,G.renderToString)(t):ia(e)&&t?t.map((t=>sa(e.query,t))):t}function la(e=[],t){return t?t.map((([t,r,n],o)=>{var a;const i=e[o];if(i&&i.name===t){const e=la(i.innerBlocks,n);return{...i,innerBlocks:e}}const s=we(t),c=sa(null!==(a=s?.attributes)&&void 0!==a?a:{},r);let[l,u]=Vn(t,c);return void 0===we(l)&&(u={originalName:t,originalContent:"",originalUndelimitedContent:""},l="core/missing"),Tr(l,u,la([],n))})):e}const ua={};function da(e){return Q()("wp.blocks.withBlockContentContext",{since:"6.1"}),e}ne(ua,{isUnmodifiedBlockContent:function(e){const t=Qe(e.name,"content");return 0===t.length?Ve(e):t.every((t=>{const r=we(e.name)?.attributes[t];return He(r,e.attributes[t])}))}})})(),(window.wp=window.wp||{}).blocks=n})(); \ No newline at end of file +function Ut(e){return"[object Object]"===Object.prototype.toString.call(e)}var Ft=r(8529);const qt=window.wp.hooks,Gt={common:"text",formatting:"text",layout:"design"};function Kt(e=[],t=[]){const r=[...e];return t.forEach((e=>{const t=r.findIndex((t=>t.name===e.name));-1!==t?r[t]={...r[t],...e}:r.push(e)})),r}const Wt=(e,t)=>({select:r})=>{const n=r.getBootstrappedBlockType(e),o={name:e,icon:Z,keywords:[],attributes:{},providesContext:{},usesContext:[],selectors:{},supports:{},styles:[],blockHooks:{},save:()=>null,...n,...t,variations:Kt(Array.isArray(n?.variations)?n.variations:[],Array.isArray(t?.variations)?t.variations:[])},a=(0,qt.applyFilters)("blocks.registerBlockType",o,e,null);if(a.description&&"string"!=typeof a.description&&Q()("Declaring non-string block descriptions",{since:"6.2"}),a.deprecated&&(a.deprecated=a.deprecated.map((e=>Object.fromEntries(Object.entries((0,qt.applyFilters)("blocks.registerBlockType",{...Xe(o,X),...e},o.name,e)).filter((([e])=>X.includes(e))))))),function(e){var t,r;return!1!==Ut(e)&&(void 0===(t=e.constructor)||!1!==Ut(r=t.prototype)&&!1!==r.hasOwnProperty("isPrototypeOf"))}(a)&&"function"==typeof a.save&&(!("edit"in a)||(0,Ft.isValidElementType)(a.edit))&&(Gt.hasOwnProperty(a.category)&&(a.category=Gt[a.category]),"category"in a&&!r.getCategories().some((({slug:e})=>e===a.category))&&delete a.category,"title"in a&&""!==a.title&&"string"==typeof a.title&&(a.icon=Ue(a.icon),$e(a.icon.src)&&(("string"==typeof a?.parent||a?.parent instanceof String)&&(a.parent=[a.parent]),(Array.isArray(a?.parent)||void 0===a?.parent)&&(1!==a?.parent?.length||e!==a.parent[0])))))return a};function Yt(e){return{type:"ADD_BLOCK_TYPES",blockTypes:Array.isArray(e)?e:[e]}}function Qt(){return({dispatch:e,select:t})=>{const r=[];for(const[n,o]of Object.entries(t.getUnprocessedBlockTypes())){const t=e(Wt(n,o));t&&r.push(t)}r.length&&e.addBlockTypes(r)}}function Zt(){return Q()('wp.data.dispatch( "core/blocks" ).__experimentalReapplyBlockFilters',{since:"6.4",alternative:"reapplyBlockFilters"}),Qt()}function Xt(e){return{type:"REMOVE_BLOCK_TYPES",names:Array.isArray(e)?e:[e]}}function Jt(e,t){return{type:"ADD_BLOCK_STYLES",styles:Array.isArray(t)?t:[t],blockNames:Array.isArray(e)?e:[e]}}function er(e,t){return{type:"REMOVE_BLOCK_STYLES",styleNames:Array.isArray(t)?t:[t],blockName:e}}function tr(e,t){return{type:"ADD_BLOCK_VARIATIONS",variations:Array.isArray(t)?t:[t],blockName:e}}function rr(e,t){return{type:"REMOVE_BLOCK_VARIATIONS",variationNames:Array.isArray(t)?t:[t],blockName:e}}function nr(e){return{type:"SET_DEFAULT_BLOCK_NAME",name:e}}function or(e){return{type:"SET_FREEFORM_FALLBACK_BLOCK_NAME",name:e}}function ar(e){return{type:"SET_UNREGISTERED_FALLBACK_BLOCK_NAME",name:e}}function ir(e){return{type:"SET_GROUPING_BLOCK_NAME",name:e}}function sr(e){return{type:"SET_CATEGORIES",categories:e}}function cr(e,t){return{type:"UPDATE_CATEGORY",slug:e,category:t}}function lr(e,t,r){return{type:"ADD_BLOCK_COLLECTION",namespace:e,title:t,icon:r}}function ur(e){return{type:"REMOVE_BLOCK_COLLECTION",namespace:e}}function dr(e,t){return{type:"ADD_BOOTSTRAPPED_BLOCK_TYPE",name:e,blockType:t}}function pr(e,t){return({dispatch:r})=>{r({type:"ADD_UNPROCESSED_BLOCK_TYPE",name:e,blockType:t});const n=r(Wt(e,t));n&&r.addBlockTypes(n)}}function fr(e){return{type:"ADD_BLOCK_BINDINGS_SOURCE",name:e.name,label:e.label,usesContext:e.usesContext,getValues:e.getValues,setValues:e.setValues,canUserEditValue:e.canUserEditValue,getFieldsList:e.getFieldsList}}function hr(e){return{type:"REMOVE_BLOCK_BINDINGS_SOURCE",name:e}}const gr=(0,i.createReduxStore)("core/blocks",{reducer:ct,selectors:t,actions:o});(0,i.register)(gr),oe(gr).registerPrivateSelectors(e),oe(gr).registerPrivateActions(a);const mr={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let br;const _r=new Uint8Array(16);function yr(){if(!br&&(br="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!br))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return br(_r)}const kr=[];for(let e=0;e<256;++e)kr.push((e+256).toString(16).slice(1));function wr(e,t=0){return kr[e[t+0]]+kr[e[t+1]]+kr[e[t+2]]+kr[e[t+3]]+"-"+kr[e[t+4]]+kr[e[t+5]]+"-"+kr[e[t+6]]+kr[e[t+7]]+"-"+kr[e[t+8]]+kr[e[t+9]]+"-"+kr[e[t+10]]+kr[e[t+11]]+kr[e[t+12]]+kr[e[t+13]]+kr[e[t+14]]+kr[e[t+15]]}const vr=function(e,t,r){if(mr.randomUUID&&!t&&!e)return mr.randomUUID();const n=(e=e||{}).random||(e.rng||yr)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(let e=0;e<16;++e)t[r+e]=n[e];return t}return wr(n)};function Tr(e,t={},r=[]){if(!We(e))return Tr("core/missing",{originalName:e,originalContent:"",originalUndelimitedContent:""});const n=Ye(e,t);return{clientId:vr(),name:e,isValid:!0,attributes:n,innerBlocks:r}}function Cr(e=[]){return e.map((e=>{const t=Array.isArray(e)?e:[e.name,e.attributes,e.innerBlocks],[r,n,o=[]]=t;return Tr(r,n,Cr(o))}))}function xr(e,t={},r){const{name:n}=e;if(!We(n))return Tr("core/missing",{originalName:n,originalContent:"",originalUndelimitedContent:""});const o=vr(),a=Ye(n,{...e.attributes,...t});return{...e,clientId:o,attributes:a,innerBlocks:r||e.innerBlocks.map((e=>xr(e)))}}function Er(e,t={},r){const n=vr();return{...e,clientId:n,attributes:{...e.attributes,...t},innerBlocks:r||e.innerBlocks.map((e=>Er(e)))}}const Sr=(e,t,r)=>{if(!r.length)return!1;const n=r.length>1,o=r[0].name;if(!(Nr(e)||!n||e.isMultiBlock))return!1;if(!Nr(e)&&!r.every((e=>e.name===o)))return!1;if(!("block"===e.type))return!1;const a=r[0];return!("from"===t&&-1===e.blocks.indexOf(a.name)&&!Nr(e))&&(!(!n&&"from"===t&&Pr(a.name)&&Pr(e.blockName))&&!!jr(e,r))},Br=e=>{if(!e.length)return[];return ve().filter((t=>!!Lr(Mr("from",t.name),(t=>Sr(t,"from",e)))))},Ar=e=>{if(!e.length)return[];const t=we(e[0].name);return(t?Mr("to",t.name):[]).filter((t=>t&&Sr(t,"to",e))).map((e=>e.blocks)).flat().map(we)},Nr=e=>e&&"block"===e.type&&Array.isArray(e.blocks)&&e.blocks.includes("*"),Pr=e=>e===ge();function Or(e){if(!e.length)return[];const t=Br(e),r=Ar(e);return[...new Set([...t,...r])]}function Lr(e,t){const r=(0,qt.createHooks)();for(let n=0;ne||o),o.priority)}return r.applyFilters("transform",null)}function Mr(e,t){if(void 0===t)return ve().map((({name:t})=>Mr(e,t))).flat();const r=Fe(t),{name:n,transforms:o}=r||{};if(!o||!Array.isArray(o[e]))return[];const a=o.supportedMobileTransforms&&Array.isArray(o.supportedMobileTransforms),i=a?o[e].filter((e=>"raw"===e.type||("prefix"===e.type||!(!e.blocks||!e.blocks.length)&&(!!Nr(e)||e.blocks.every((e=>o.supportedMobileTransforms.includes(e))))))):o[e];return i.map((e=>({...e,blockName:n,usingMobileTransformations:a})))}function jr(e,t){if("function"!=typeof e.isMatch)return!0;const r=t[0],n=e.isMultiBlock?t.map((e=>e.attributes)):r.attributes,o=e.isMultiBlock?t:r;return e.isMatch(n,o)}function Dr(e,t){const r=Array.isArray(e)?e:[e],n=r.length>1,o=r[0],a=o.name,i=Mr("from",t),s=Lr(Mr("to",a),(e=>"block"===e.type&&(Nr(e)||-1!==e.blocks.indexOf(t))&&(!n||e.isMultiBlock)&&jr(e,r)))||Lr(i,(e=>"block"===e.type&&(Nr(e)||-1!==e.blocks.indexOf(a))&&(!n||e.isMultiBlock)&&jr(e,r)));if(!s)return null;let c;if(c=s.isMultiBlock?"__experimentalConvert"in s?s.__experimentalConvert(r):s.transform(r.map((e=>e.attributes)),r.map((e=>e.innerBlocks))):"__experimentalConvert"in s?s.__experimentalConvert(o):s.transform(o.attributes,o.innerBlocks),null===c||"object"!=typeof c)return null;if(c=Array.isArray(c)?c:[c],c.some((e=>!we(e.name))))return null;if(!c.some((e=>e.name===t)))return null;return c.map(((t,r,n)=>(0,qt.applyFilters)("blocks.switchToBlockType.transformedBlock",t,e,r,n)))}const zr=(e,t)=>{var r;return Tr(e,t.attributes,(null!==(r=t.innerBlocks)&&void 0!==r?r:[]).map((e=>zr(e.name,e))))},Ir=window.wp.blockSerializationDefaultParser,Rr=window.wp.autop,Hr=window.wp.isShallowEqual;var Vr=r.n(Hr);function $r(e,t={}){const{isCommentDelimited:r=!0}=t,{blockName:n,attrs:o={},innerBlocks:a=[],innerContent:i=[]}=e;let s=0;const c=i.map((e=>null!==e?e:$r(a[s++],t))).join("\n").replace(/\n+/g,"\n").trim();return r?Jr(n,o,c):c}const Ur=window.ReactJSXRuntime;function Fr(e){const t="wp-block-"+e.replace(/\//,"-").replace(/^core-/,"");return(0,qt.applyFilters)("blocks.getBlockDefaultClassName",t,e)}function qr(e){const t="editor-block-list-item-"+e.replace(/\//,"-").replace(/^core-/,"");return(0,qt.applyFilters)("blocks.getBlockMenuDefaultClassName",t,e)}const Gr={},Kr={};function Wr(e={}){const{blockType:t,attributes:r}=Gr;return Wr.skipFilters?e:(0,qt.applyFilters)("blocks.getSaveContent.extraProps",{...e},t,r)}function Yr(e={}){const{innerBlocks:t}=Kr;if(!Array.isArray(t))return{...e,children:t};const r=rn(t,{isInnerBlocks:!0}),n=(0,Ur.jsx)(G.RawHTML,{children:r});return{...e,children:n}}function Qr(e,t,r=[]){const n=Fe(e);if(!n?.save)return null;let{save:o}=n;if(o.prototype instanceof G.Component){const e=new o({attributes:t});o=e.render.bind(e)}Gr.blockType=n,Gr.attributes=t,Kr.innerBlocks=r;let a=o({attributes:t,innerBlocks:r});if(null!==a&&"object"==typeof a&&(0,qt.hasFilter)("blocks.getSaveContent.extraProps")&&!(n.apiVersion>1)){const e=(0,qt.applyFilters)("blocks.getSaveContent.extraProps",{...a.props},n,t);Vr()(e,a.props)||(a=(0,G.cloneElement)(a,e))}return(0,qt.applyFilters)("blocks.getSaveElement",a,n,t)}function Zr(e,t,r){const n=Fe(e);return(0,G.renderToString)(Qr(n,t,r))}function Xr(e){let t=e.originalContent;if(e.isValid||e.innerBlocks.length)try{t=Zr(e.name,e.attributes,e.innerBlocks)}catch(e){}return t}function Jr(e,t,r){const n=t&&Object.entries(t).length?function(e){return JSON.stringify(e).replace(/--/g,"\\u002d\\u002d").replace(//g,"\\u003e").replace(/&/g,"\\u0026").replace(/\\"/g,"\\u0022")}(t)+" ":"",o=e?.startsWith("core/")?e.slice(5):e;return r?`\x3c!-- wp:${o} ${n}--\x3e\n`+r+`\n\x3c!-- /wp:${o} --\x3e`:`\x3c!-- wp:${o} ${n}/--\x3e`}function en(e,{isInnerBlocks:t=!1}={}){if(!e.isValid&&e.__unstableBlockSource)return $r(e.__unstableBlockSource);const r=e.name,n=Xr(e);if(r===be()||!t&&r===he())return n;const o=we(r);if(!o)return n;const a=function(e,t){var r;return Object.entries(null!==(r=e.attributes)&&void 0!==r?r:{}).reduce(((r,[n,o])=>{const a=t[n];return void 0===a||void 0!==o.source||"local"===o.role?r:"local"===o.__experimentalRole?(Q()("__experimentalRole attribute",{since:"6.7",version:"6.8",alternative:"role attribute",hint:`Check the block.json of the ${e?.name} block.`}),r):("default"in o&&JSON.stringify(o.default)===JSON.stringify(a)||(r[n]=a),r)}),{})}(o,e.attributes);return Jr(r,a,n)}function tn(e){1===e.length&&Ve(e[0])&&(e=[]);let t=rn(e);return 1===e.length&&e[0].name===he()&&"core/freeform"===e[0].name&&(t=(0,Rr.removep)(t)),t}function rn(e,t){return(Array.isArray(e)?e:[e]).map((e=>en(e,t))).join("\n\n")}var nn=/^#[xX]([A-Fa-f0-9]+)$/,on=/^#([0-9]+)$/,an=/^([A-Za-z0-9]+)$/,sn=(function(){function e(e){this.named=e}e.prototype.parse=function(e){if(e){var t=e.match(nn);return t?String.fromCharCode(parseInt(t[1],16)):(t=e.match(on))?String.fromCharCode(parseInt(t[1],10)):(t=e.match(an))?this.named[t[1]]:void 0}}}(),/[\t\n\f ]/),cn=/[A-Za-z]/,ln=/\r\n?/g;function un(e){return sn.test(e)}function dn(e){return cn.test(e)}var pn=function(){function e(e,t,r){void 0===r&&(r="precompile"),this.delegate=e,this.entityParser=t,this.mode=r,this.state="beforeData",this.line=-1,this.column=-1,this.input="",this.index=-1,this.tagNameBuffer="",this.states={beforeData:function(){var e=this.peek();if("<"!==e||this.isIgnoredEndTag()){if("precompile"===this.mode&&"\n"===e){var t=this.tagNameBuffer.toLowerCase();"pre"!==t&&"textarea"!==t||this.consume()}this.transitionTo("data"),this.delegate.beginData()}else this.transitionTo("tagOpen"),this.markTagStart(),this.consume()},data:function(){var e=this.peek(),t=this.tagNameBuffer;"<"!==e||this.isIgnoredEndTag()?"&"===e&&"script"!==t&&"style"!==t?(this.consume(),this.delegate.appendToData(this.consumeCharRef()||"&")):(this.consume(),this.delegate.appendToData(e)):(this.delegate.finishData(),this.transitionTo("tagOpen"),this.markTagStart(),this.consume())},tagOpen:function(){var e=this.consume();"!"===e?this.transitionTo("markupDeclarationOpen"):"/"===e?this.transitionTo("endTagOpen"):("@"===e||":"===e||dn(e))&&(this.transitionTo("tagName"),this.tagNameBuffer="",this.delegate.beginStartTag(),this.appendToTagName(e))},markupDeclarationOpen:function(){var e=this.consume();"-"===e&&"-"===this.peek()?(this.consume(),this.transitionTo("commentStart"),this.delegate.beginComment()):"DOCTYPE"===e.toUpperCase()+this.input.substring(this.index,this.index+6).toUpperCase()&&(this.consume(),this.consume(),this.consume(),this.consume(),this.consume(),this.consume(),this.transitionTo("doctype"),this.delegate.beginDoctype&&this.delegate.beginDoctype())},doctype:function(){un(this.consume())&&this.transitionTo("beforeDoctypeName")},beforeDoctypeName:function(){var e=this.consume();un(e)||(this.transitionTo("doctypeName"),this.delegate.appendToDoctypeName&&this.delegate.appendToDoctypeName(e.toLowerCase()))},doctypeName:function(){var e=this.consume();un(e)?this.transitionTo("afterDoctypeName"):">"===e?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypeName&&this.delegate.appendToDoctypeName(e.toLowerCase())},afterDoctypeName:function(){var e=this.consume();if(!un(e))if(">"===e)this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData");else{var t=e.toUpperCase()+this.input.substring(this.index,this.index+5).toUpperCase(),r="PUBLIC"===t.toUpperCase(),n="SYSTEM"===t.toUpperCase();(r||n)&&(this.consume(),this.consume(),this.consume(),this.consume(),this.consume(),this.consume()),r?this.transitionTo("afterDoctypePublicKeyword"):n&&this.transitionTo("afterDoctypeSystemKeyword")}},afterDoctypePublicKeyword:function(){var e=this.peek();un(e)?(this.transitionTo("beforeDoctypePublicIdentifier"),this.consume()):'"'===e?(this.transitionTo("doctypePublicIdentifierDoubleQuoted"),this.consume()):"'"===e?(this.transitionTo("doctypePublicIdentifierSingleQuoted"),this.consume()):">"===e&&(this.consume(),this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData"))},doctypePublicIdentifierDoubleQuoted:function(){var e=this.consume();'"'===e?this.transitionTo("afterDoctypePublicIdentifier"):">"===e?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypePublicIdentifier&&this.delegate.appendToDoctypePublicIdentifier(e)},doctypePublicIdentifierSingleQuoted:function(){var e=this.consume();"'"===e?this.transitionTo("afterDoctypePublicIdentifier"):">"===e?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypePublicIdentifier&&this.delegate.appendToDoctypePublicIdentifier(e)},afterDoctypePublicIdentifier:function(){var e=this.consume();un(e)?this.transitionTo("betweenDoctypePublicAndSystemIdentifiers"):">"===e?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):'"'===e?this.transitionTo("doctypeSystemIdentifierDoubleQuoted"):"'"===e&&this.transitionTo("doctypeSystemIdentifierSingleQuoted")},betweenDoctypePublicAndSystemIdentifiers:function(){var e=this.consume();un(e)||(">"===e?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):'"'===e?this.transitionTo("doctypeSystemIdentifierDoubleQuoted"):"'"===e&&this.transitionTo("doctypeSystemIdentifierSingleQuoted"))},doctypeSystemIdentifierDoubleQuoted:function(){var e=this.consume();'"'===e?this.transitionTo("afterDoctypeSystemIdentifier"):">"===e?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypeSystemIdentifier&&this.delegate.appendToDoctypeSystemIdentifier(e)},doctypeSystemIdentifierSingleQuoted:function(){var e=this.consume();"'"===e?this.transitionTo("afterDoctypeSystemIdentifier"):">"===e?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypeSystemIdentifier&&this.delegate.appendToDoctypeSystemIdentifier(e)},afterDoctypeSystemIdentifier:function(){var e=this.consume();un(e)||">"===e&&(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData"))},commentStart:function(){var e=this.consume();"-"===e?this.transitionTo("commentStartDash"):">"===e?(this.delegate.finishComment(),this.transitionTo("beforeData")):(this.delegate.appendToCommentData(e),this.transitionTo("comment"))},commentStartDash:function(){var e=this.consume();"-"===e?this.transitionTo("commentEnd"):">"===e?(this.delegate.finishComment(),this.transitionTo("beforeData")):(this.delegate.appendToCommentData("-"),this.transitionTo("comment"))},comment:function(){var e=this.consume();"-"===e?this.transitionTo("commentEndDash"):this.delegate.appendToCommentData(e)},commentEndDash:function(){var e=this.consume();"-"===e?this.transitionTo("commentEnd"):(this.delegate.appendToCommentData("-"+e),this.transitionTo("comment"))},commentEnd:function(){var e=this.consume();">"===e?(this.delegate.finishComment(),this.transitionTo("beforeData")):(this.delegate.appendToCommentData("--"+e),this.transitionTo("comment"))},tagName:function(){var e=this.consume();un(e)?this.transitionTo("beforeAttributeName"):"/"===e?this.transitionTo("selfClosingStartTag"):">"===e?(this.delegate.finishTag(),this.transitionTo("beforeData")):this.appendToTagName(e)},endTagName:function(){var e=this.consume();un(e)?(this.transitionTo("beforeAttributeName"),this.tagNameBuffer=""):"/"===e?(this.transitionTo("selfClosingStartTag"),this.tagNameBuffer=""):">"===e?(this.delegate.finishTag(),this.transitionTo("beforeData"),this.tagNameBuffer=""):this.appendToTagName(e)},beforeAttributeName:function(){var e=this.peek();un(e)?this.consume():"/"===e?(this.transitionTo("selfClosingStartTag"),this.consume()):">"===e?(this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):"="===e?(this.delegate.reportSyntaxError("attribute name cannot start with equals sign"),this.transitionTo("attributeName"),this.delegate.beginAttribute(),this.consume(),this.delegate.appendToAttributeName(e)):(this.transitionTo("attributeName"),this.delegate.beginAttribute())},attributeName:function(){var e=this.peek();un(e)?(this.transitionTo("afterAttributeName"),this.consume()):"/"===e?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("selfClosingStartTag")):"="===e?(this.transitionTo("beforeAttributeValue"),this.consume()):">"===e?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):'"'===e||"'"===e||"<"===e?(this.delegate.reportSyntaxError(e+" is not a valid character within attribute names"),this.consume(),this.delegate.appendToAttributeName(e)):(this.consume(),this.delegate.appendToAttributeName(e))},afterAttributeName:function(){var e=this.peek();un(e)?this.consume():"/"===e?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("selfClosingStartTag")):"="===e?(this.consume(),this.transitionTo("beforeAttributeValue")):">"===e?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.transitionTo("attributeName"),this.delegate.beginAttribute(),this.consume(),this.delegate.appendToAttributeName(e))},beforeAttributeValue:function(){var e=this.peek();un(e)?this.consume():'"'===e?(this.transitionTo("attributeValueDoubleQuoted"),this.delegate.beginAttributeValue(!0),this.consume()):"'"===e?(this.transitionTo("attributeValueSingleQuoted"),this.delegate.beginAttributeValue(!0),this.consume()):">"===e?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):(this.transitionTo("attributeValueUnquoted"),this.delegate.beginAttributeValue(!1),this.consume(),this.delegate.appendToAttributeValue(e))},attributeValueDoubleQuoted:function(){var e=this.consume();'"'===e?(this.delegate.finishAttributeValue(),this.transitionTo("afterAttributeValueQuoted")):"&"===e?this.delegate.appendToAttributeValue(this.consumeCharRef()||"&"):this.delegate.appendToAttributeValue(e)},attributeValueSingleQuoted:function(){var e=this.consume();"'"===e?(this.delegate.finishAttributeValue(),this.transitionTo("afterAttributeValueQuoted")):"&"===e?this.delegate.appendToAttributeValue(this.consumeCharRef()||"&"):this.delegate.appendToAttributeValue(e)},attributeValueUnquoted:function(){var e=this.peek();un(e)?(this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("beforeAttributeName")):"/"===e?(this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("selfClosingStartTag")):"&"===e?(this.consume(),this.delegate.appendToAttributeValue(this.consumeCharRef()||"&")):">"===e?(this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):(this.consume(),this.delegate.appendToAttributeValue(e))},afterAttributeValueQuoted:function(){var e=this.peek();un(e)?(this.consume(),this.transitionTo("beforeAttributeName")):"/"===e?(this.consume(),this.transitionTo("selfClosingStartTag")):">"===e?(this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):this.transitionTo("beforeAttributeName")},selfClosingStartTag:function(){">"===this.peek()?(this.consume(),this.delegate.markTagAsSelfClosing(),this.delegate.finishTag(),this.transitionTo("beforeData")):this.transitionTo("beforeAttributeName")},endTagOpen:function(){var e=this.consume();("@"===e||":"===e||dn(e))&&(this.transitionTo("endTagName"),this.tagNameBuffer="",this.delegate.beginEndTag(),this.appendToTagName(e))}},this.reset()}return e.prototype.reset=function(){this.transitionTo("beforeData"),this.input="",this.tagNameBuffer="",this.index=0,this.line=1,this.column=0,this.delegate.reset()},e.prototype.transitionTo=function(e){this.state=e},e.prototype.tokenize=function(e){this.reset(),this.tokenizePart(e),this.tokenizeEOF()},e.prototype.tokenizePart=function(e){for(this.input+=function(e){return e.replace(ln,"\n")}(e);this.index"!==this.input.substring(this.index,this.index+8)||"style"===e&&""!==this.input.substring(this.index,this.index+8)||"script"===e&&"<\/script>"!==this.input.substring(this.index,this.index+9)},e}(),fn=function(){function e(e,t){void 0===t&&(t={}),this.options=t,this.token=null,this.startLine=1,this.startColumn=0,this.tokens=[],this.tokenizer=new pn(this,e,t.mode),this._currentAttribute=void 0}return e.prototype.tokenize=function(e){return this.tokens=[],this.tokenizer.tokenize(e),this.tokens},e.prototype.tokenizePart=function(e){return this.tokens=[],this.tokenizer.tokenizePart(e),this.tokens},e.prototype.tokenizeEOF=function(){return this.tokens=[],this.tokenizer.tokenizeEOF(),this.tokens[0]},e.prototype.reset=function(){this.token=null,this.startLine=1,this.startColumn=0},e.prototype.current=function(){var e=this.token;if(null===e)throw new Error("token was unexpectedly null");if(0===arguments.length)return e;for(var t=0;te("Block validation: "+t,...r)}return{error:e(console.error),warning:e(console.warn),getItems:()=>[]}}const _n=/[\t\n\r\v\f ]+/g,yn=/^[\t\n\r\v\f ]*$/,kn=/^url\s*\(['"\s]*(.*?)['"\s]*\)$/,wn=["allowfullscreen","allowpaymentrequest","allowusermedia","async","autofocus","autoplay","checked","controls","default","defer","disabled","download","formnovalidate","hidden","ismap","itemscope","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected","typemustmatch"],vn=[...wn,"autocapitalize","autocomplete","charset","contenteditable","crossorigin","decoding","dir","draggable","enctype","formenctype","formmethod","http-equiv","inputmode","kind","method","preload","scope","shape","spellcheck","translate","type","wrap"],Tn=[e=>e,function(e){return Bn(e).join(" ")}],Cn=/^[\da-z]+$/i,xn=/^#\d+$/,En=/^#x[\da-f]+$/i;class Sn{parse(e){if(t=e,Cn.test(t)||xn.test(t)||En.test(t))return(0,mn.decodeEntities)("&"+e+";");var t}}function Bn(e){return e.trim().split(_n)}function An(e){return e.attributes.filter((e=>{const[t,r]=e;return r||0===t.indexOf("data-")||vn.includes(t)}))}function Nn(e,t,r=bn()){let n=e.chars,o=t.chars;for(let e=0;e{const[t,...r]=e.split(":"),n=r.join(":");return[t.trim(),On(n.trim())]}));return Object.fromEntries(t)}const Mn={class:(e,t)=>{const[r,n]=[e,t].map(Bn),o=r.filter((e=>!n.includes(e))),a=n.filter((e=>!r.includes(e)));return 0===o.length&&0===a.length},style:(e,t)=>gn()(...[e,t].map(Ln)),...Object.fromEntries(wn.map((e=>[e,()=>!0])))};const jn={StartTag:(e,t,r=bn())=>e.tagName!==t.tagName&&e.tagName.toLowerCase()!==t.tagName.toLowerCase()?(r.warning("Expected tag name `%s`, instead saw `%s`.",t.tagName,e.tagName),!1):function(e,t,r=bn()){if(e.length!==t.length)return r.warning("Expected attributes %o, instead saw %o.",t,e),!1;const n={};for(let e=0;efunction(e,t=bn()){try{return new fn(new Sn).tokenize(e)}catch(r){t.warning("Malformed HTML detected: %s",e)}return null}(e,r)));if(!n||!o)return!1;let a,i;for(;a=Dn(n);){if(i=Dn(o),!i)return r.warning("Expected end of content, instead saw %o.",a),!1;if(a.type!==i.type)return r.warning("Expected token of type `%s` (%o), instead saw `%s` (%o).",i.type,i,a.type,a),!1;const e=jn[a.type];if(e&&!e(a,i,r))return!1;zn(a,o[0])?Dn(o):zn(i,n[0])&&Dn(n)}return!(i=Dn(o))||(r.warning("Expected %o, instead saw end of content.",i),!1)}function Rn(e,t=e.name){if(e.name===he()||e.name===be())return[!0,[]];const r=function(){const e=[],t=bn();return{error(...r){e.push({log:t.error,args:r})},warning(...r){e.push({log:t.warning,args:r})},getItems:()=>e}}(),n=Fe(t);let o;try{o=Zr(n,e.attributes)}catch(e){return r.error("Block validation failed because an error occurred while generating block content:\n\n%s",e.toString()),[!1,r.getItems()]}const a=In(e.originalContent,o,r);return a||r.error("Block validation failed for `%s` (%o).\n\nContent generated by `save` function:\n\n%s\n\nContent retrieved from post body:\n\n%s",n.name,n,o,e.originalContent),[a,r.getItems()]}function Hn(e,t,r){Q()("isValidBlockContent introduces opportunity for data loss",{since:"12.6",plugin:"Gutenberg",alternative:"validateBlock"});const n=Fe(e),o={name:n.name,attributes:t,innerBlocks:[],originalContent:r},[a]=Rn(o,n);return a}function Vn(e,t){const r={...t};if("core/cover-image"===e&&(e="core/cover"),"core/text"!==e&&"core/cover-text"!==e||(e="core/paragraph"),e&&0===e.indexOf("core/social-link-")&&(r.service=e.substring(17),e="core/social-link"),e&&0===e.indexOf("core-embed/")){const t=e.substring(11),n={speaker:"speaker-deck",polldaddy:"crowdsignal"};r.providerNameSlug=t in n?n[t]:t,["amazon-kindle","wordpress"].includes(t)||(r.responsive=!0),e="core/embed"}if("core/post-comment-author"===e&&(e="core/comment-author-name"),"core/post-comment-content"===e&&(e="core/comment-content"),"core/post-comment-date"===e&&(e="core/comment-date"),"core/comments-query-loop"===e){e="core/comments";const{className:t=""}=r;t.includes("wp-block-comments-query-loop")||(r.className=["wp-block-comments-query-loop",t].join(" "))}if("core/post-comments"===e&&(e="core/comments",r.legacy=!0),"grid"===t.layout?.type&&"string"==typeof t.layout?.columnCount&&(r.layout={...r.layout,columnCount:parseInt(t.layout.columnCount,10)}),"string"==typeof t.style?.layout?.columnSpan){const e=parseInt(t.style.layout.columnSpan,10);r.style={...r.style,layout:{...r.style.layout,columnSpan:isNaN(e)?void 0:e}}}if("string"==typeof t.style?.layout?.rowSpan){const e=parseInt(t.style.layout.rowSpan,10);r.style={...r.style,layout:{...r.style.layout,rowSpan:isNaN(e)?void 0:e}}}return[e,r]}var $n,Un=function(){return $n||($n=document.implementation.createHTMLDocument("")),$n};function Fn(e,t){if(t){if("string"==typeof e){var r=Un();r.body.innerHTML=e,e=r.body}if("function"==typeof t)return t(e);if(Object===t.constructor)return Object.keys(t).reduce((function(r,n){return r[n]=Fn(e,t[n]),r}),{})}}function qn(e,t){return 1===arguments.length&&(t=e,e=void 0),function(r){var n=r;if(e&&(n=r.querySelector(e)),n)return function(e,t){for(var r,n=t.split(".");r=n.shift();){if(!(r in e))return;e=e[r]}return e}(n,t)}}function Gn(e){const t={};for(let r=0;r{let r=t;e&&(r=t.querySelector(e));try{return Kn(r)}catch(e){return null}}}const Yn={isNodeOfType:function(e,t){return Q()("wp.blocks.node.isNodeOfType",{since:"6.1",version:"6.3",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"}),e&&e.type===t},fromDOM:Kn,toHTML:function(e){return Q()("wp.blocks.node.toHTML",{since:"6.1",version:"6.3",alternative:"wp.richText.toHTMLString",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"}),Zn([e])},matcher:Wn};function Qn(e){Q()("wp.blocks.children.fromDOM",{since:"6.1",version:"6.3",alternative:"wp.richText.create",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"});const t=[];for(let r=0;r{let r=t;return e&&(r=t.querySelector(e)),r?Qn(r.childNodes):[]}}const Jn={concat:function(...e){Q()("wp.blocks.children.concat",{since:"6.1",version:"6.3",alternative:"wp.richText.concat",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"});const t=[];for(let r=0;rfunction(e,t){switch(t){case"rich-text":return e instanceof W.RichTextData;case"string":return"string"==typeof e;case"boolean":return"boolean"==typeof e;case"object":return!!e&&e.constructor===Object;case"null":return null===e;case"array":return Array.isArray(e);case"integer":case"number":return"number"==typeof e}return!0}(e,t)))}function to(e,t,r,n,o){let a;switch(t.source){case void 0:a=n?n[e]:void 0;break;case"raw":a=o;break;case"attribute":case"property":case"html":case"text":case"rich-text":case"children":case"node":case"query":case"tag":a=oo(r,t)}return function(e,t){return void 0===t||eo(e,Array.isArray(t)?t:[t])}(a,t.type)&&function(e,t){return!Array.isArray(t)||t.includes(e)}(a,t.enum)||(a=void 0),void 0===a&&(a=Ke(t)),a}const ro=function(e,t){var r,n,o=0;function a(){var a,i,s=r,c=arguments.length;e:for(;s;){if(s.args.length===arguments.length){for(i=0;i{switch(e.source){case"attribute":{let t=function(e,t){return 1===arguments.length&&(t=e,e=void 0),function(r){var n=qn(e,"attributes")(r);if(n&&n.hasOwnProperty(t))return n[t].value}}(e.selector,e.attribute);return"boolean"===e.type&&(t=(e=>t=>void 0!==e(t))(t)),t}case"html":return t=e.selector,r=e.multiline,e=>{let n=e;if(t&&(n=e.querySelector(t)),!n)return"";if(r){let e="";const t=n.children.length;for(let o=0;or=>{const n=e?r.querySelector(e):r;return n?W.RichTextData.fromHTMLElement(n,{preserveWhiteSpace:t}):W.RichTextData.empty()})(e.selector,e.__unstablePreserveWhiteSpace);case"children":return Xn(e.selector);case"node":return Wn(e.selector);case"query":const n=Object.fromEntries(Object.entries(e.query).map((([e,t])=>[e,ro(t)])));return function(e,t){return function(r){var n=r.querySelectorAll(e);return[].map.call(n,(function(e){return Fn(e,t)}))}}(e.selector,n);case"tag":{const t=qn(e.selector,"nodeName");return e=>t(e)?.toLowerCase()}default:console.error(`Unknown source type "${e.source}"`)}var t,r}));function no(e){return Fn(e,(e=>e))}function oo(e,t){return ro(t)(no(e))}function ao(e,t,r={}){var n;const o=no(t),a=Fe(e),i=Object.fromEntries(Object.entries(null!==(n=a.attributes)&&void 0!==n?n:{}).map((([e,n])=>[e,to(e,n,o,r,t)])));return(0,qt.applyFilters)("blocks.getBlockAttributes",i,a,t,r)}const io={type:"string",source:"attribute",selector:"[data-custom-class-name] > *",attribute:"class"};function so(e){const t=oo(`

    ${e}
    `,io);return t?t.trim().split(/\s+/):[]}function co(e,t){const r=function(e,t,r){if(!Ce(t,"customClassName",!0))return e;const n={...e},{className:o,...a}=n,i=Zr(t,a),s=so(i),c=so(r).filter((e=>!s.includes(e)));return c.length?n.className=c.join(" "):i&&delete n.className,n}(e.attributes,t,e.originalContent);return{...e,attributes:r}}function lo(){return!1}function uo(e,t){let r=function(e,t){const r=he(),n=e.blockName||he(),o=e.attrs||{},a=e.innerBlocks||[];let i=e.innerHTML.trim();return n!==r||"core/freeform"!==n||t?.__unstableSkipAutop||(i=(0,Rr.autop)(i).trim()),{...e,blockName:n,attrs:o,innerHTML:i,innerBlocks:a}}(e,t);r=function(e){const[t,r]=Vn(e.blockName,e.attrs);return{...e,blockName:t,attrs:r}}(r);let n=we(r.blockName);n||(r=function(e){const t=be()||he(),r=$r(e,{isCommentDelimited:!1}),n=$r(e,{isCommentDelimited:!0});return{blockName:t,attrs:{originalName:e.blockName,originalContent:n,originalUndelimitedContent:r},innerHTML:e.blockName?n:e.innerHTML,innerBlocks:e.innerBlocks,innerContent:e.innerContent}}(r),n=we(r.blockName));const o=r.blockName===he()||r.blockName===be();if(!n||!r.innerHTML&&o)return;const a=r.innerBlocks.map((e=>uo(e,t))).filter((e=>!!e)),i=Tr(r.blockName,ao(n,r.innerHTML,r.attrs),a);i.originalContent=r.innerHTML;const s=function(e,t){const[r]=Rn(e,t);if(r)return{...e,isValid:r,validationIssues:[]};const n=co(e,t),[o,a]=Rn(n,t);return{...n,isValid:o,validationIssues:a}}(i,n),{validationIssues:c}=s,l=function(e,t,r){const n=t.attrs,{deprecated:o}=r;if(!o||!o.length)return e;for(let a=0;ae(...t))):(console.groupCollapsed("Updated Block: %s",n.name),console.info("Block successfully updated for `%s` (%o).\n\nNew content generated by `save` function:\n\n%s\n\nContent retrieved from post body:\n\n%s",n.name,n,Zr(n,l.attributes),l.originalContent),console.groupEnd()),l}function po(e,t){return(0,Ir.parse)(e).reduce(((e,r)=>{const n=uo(r,t);return n&&e.push(n),e}),[])}function fo(){return Mr("from").filter((({type:e})=>"raw"===e)).map((e=>e.isMatch?e:{...e,isMatch:t=>e.selector&&t.matches(e.selector)}))}function ho(e,t){const r=document.implementation.createHTMLDocument("");return r.body.innerHTML=e,Array.from(r.body.children).flatMap((e=>{const r=Lr(fo(),(({isMatch:t})=>t(e)));if(!r)return G.Platform.isNative?po(`\x3c!-- wp:html --\x3e${e.outerHTML}\x3c!-- /wp:html --\x3e`):Tr("core/html",ao("core/html",e.outerHTML));const{transform:n,blockName:o}=r;if(n){const r=n(e,t);return e.hasAttribute("class")&&(r.attributes.className=e.getAttribute("class")),r}return Tr(o,ao(o,e.outerHTML))}))}function go(e,t={}){const r=document.implementation.createHTMLDocument(""),n=document.implementation.createHTMLDocument(""),o=r.body,a=n.body;for(o.innerHTML=e;o.firstChild;){const e=o.firstChild;e.nodeType===e.TEXT_NODE?(0,K.isEmpty)(e)?o.removeChild(e):(a.lastChild&&"P"===a.lastChild.nodeName||a.appendChild(n.createElement("P")),a.lastChild.appendChild(e)):e.nodeType===e.ELEMENT_NODE?"BR"===e.nodeName?(e.nextSibling&&"BR"===e.nextSibling.nodeName&&(a.appendChild(n.createElement("P")),o.removeChild(e.nextSibling)),a.lastChild&&"P"===a.lastChild.nodeName&&a.lastChild.hasChildNodes()?a.lastChild.appendChild(e):o.removeChild(e)):"P"===e.nodeName?(0,K.isEmpty)(e)&&!t.raw?o.removeChild(e):a.appendChild(e):(0,K.isPhrasingContent)(e)?(a.lastChild&&"P"===a.lastChild.nodeName||a.appendChild(n.createElement("P")),a.lastChild.appendChild(e)):a.appendChild(e):o.removeChild(e)}return a.innerHTML}function mo(e,t){if(e.nodeType!==e.COMMENT_NODE)return;if("nextpage"!==e.nodeValue&&0!==e.nodeValue.indexOf("more"))return;const r=function(e,t){if("nextpage"===e.nodeValue)return function(e){const t=e.createElement("wp-block");return t.dataset.block="core/nextpage",t}(t);const r=e.nodeValue.slice(4).trim();let n=e,o=!1;for(;n=n.nextSibling;)if(n.nodeType===n.COMMENT_NODE&&"noteaser"===n.nodeValue){o=!0,(0,K.remove)(n);break}return function(e,t,r){const n=r.createElement("wp-block");n.dataset.block="core/more",e&&(n.dataset.customText=e);t&&(n.dataset.noTeaser="");return n}(r,o,t)}(e,t);if(e.parentNode&&"P"===e.parentNode.nodeName){const n=Array.from(e.parentNode.childNodes),o=n.indexOf(e),a=e.parentNode.parentNode||t.body,i=(e,r)=>(e||(e=t.createElement("p")),e.appendChild(r),e);[n.slice(0,o).reduce(i,null),r,n.slice(o+1).reduce(i,null)].forEach((t=>t&&a.insertBefore(t,e.parentNode))),(0,K.remove)(e.parentNode)}else(0,K.replace)(e,r)}function bo(e){return"OL"===e.nodeName||"UL"===e.nodeName}function _o(e){if(!bo(e))return;const t=e,r=e.previousElementSibling;if(r&&r.nodeName===e.nodeName&&1===t.children.length){for(;t.firstChild;)r.appendChild(t.firstChild);t.parentNode.removeChild(t)}const n=e.parentNode;if(n&&"LI"===n.nodeName&&1===n.children.length&&!/\S/.test((o=n,Array.from(o.childNodes).map((({nodeValue:e=""})=>e)).join("")))){const e=n,r=e.previousElementSibling,o=e.parentNode;r&&(r.appendChild(t),o.removeChild(e))}var o;if(n&&bo(n)){const t=e.previousElementSibling;t?t.appendChild(e):(0,K.unwrap)(e)}}function yo(e){return t=>{"BLOCKQUOTE"===t.nodeName&&(t.innerHTML=go(t.innerHTML,e))}}function ko(e,t=e){const r=e.ownerDocument.createElement("figure");t.parentNode.insertBefore(r,t),r.appendChild(e)}function wo(e,t,r){if(!function(e,t){var r;const n=e.nodeName.toLowerCase();return"figcaption"!==n&&!(0,K.isTextContent)(e)&&n in(null!==(r=t?.figure?.children)&&void 0!==r?r:{})}(e,r))return;let n=e;const o=e.parentNode;(function(e,t){var r;return e.nodeName.toLowerCase()in(null!==(r=t?.figure?.children?.a?.children)&&void 0!==r?r:{})})(e,r)&&"A"===o.nodeName&&1===o.childNodes.length&&(n=e.parentNode);const a=n.closest("p,div");a?e.classList?(e.classList.contains("alignright")||e.classList.contains("alignleft")||e.classList.contains("aligncenter")||!a.textContent.trim())&&ko(n,a):ko(n,a):ko(n)}const vo=window.wp.shortcode,To=e=>Array.isArray(e)?e:[e],Co=/(\n|

    )\s*$/,xo=/^\s*(\n|<\/p>)/;const Eo=function e(t,r=0,n=[]){const o=Lr(Mr("from"),(e=>-1===n.indexOf(e.blockName)&&"shortcode"===e.type&&To(e.tag).some((e=>(0,vo.regexp)(e).test(t)))));if(!o)return[t];const a=To(o.tag).find((e=>(0,vo.regexp)(e).test(t)));let i;const s=r;if(i=(0,vo.next)(a,t,r)){r=i.index+i.content.length;const a=t.substr(0,i.index),c=t.substr(r);if(!(i.shortcode.content?.includes("<")||Co.test(a)&&xo.test(c)))return e(t,r);if(o.isMatch&&!o.isMatch(i.shortcode.attrs))return e(t,s,[...n,o.blockName]);let l=[];if("function"==typeof o.transform)l=[].concat(o.transform(i.shortcode.attrs,i)),l=l.map((e=>(e.originalContent=i.shortcode.content,co(e,we(e.name)))));else{const e=Object.fromEntries(Object.entries(o.attributes).filter((([,e])=>e.shortcode)).map((([e,t])=>[e,t.shortcode(i.shortcode.attrs,i)]))),r=we(o.blockName);if(!r)return[t];const n={...r,attributes:o.attributes};let a=Tr(o.blockName,ao(n,i.shortcode.content,e));a.originalContent=i.shortcode.content,a=co(a,n),l=[a]}return[...e(a.replace(Co,"")),...l,...e(c.replace(xo,""))]}return[t]};function So(e){return function(e,t){const r={phrasingContentSchema:(0,K.getPhrasingContentSchema)(t),isPaste:"paste"===t};function n(e,t,r){switch(r){case"children":return"*"===e||"*"===t?"*":{...e,...t};case"attributes":case"require":return[...e||[],...t||[]];case"isMatch":if(!e||!t)return;return(...r)=>e(...r)||t(...r)}}function o(e,t){for(const r in t)e[r]=e[r]?n(e[r],t[r],r):{...t[r]};return e}return e.map((({isMatch:e,blockName:t,schema:n})=>{const o=Ce(t,"anchor");return n="function"==typeof n?n(r):n,o||e?n?Object.fromEntries(Object.entries(n).map((([t,r])=>{let n=r.attributes||[];return o&&(n=[...n,"id"]),[t,{...r,attributes:n,isMatch:e||void 0}]}))):{}:n})).reduce((function(e,t){for(const r in t)e[r]=e[r]?o(e[r],t[r]):{...t[r]};return e}),{})}(fo(),e)}function Bo(e,t,r,n){Array.from(e).forEach((e=>{Bo(e.childNodes,t,r,n),t.forEach((t=>{r.contains(e)&&t(e,r,n)}))}))}function Ao(e,t=[],r){const n=document.implementation.createHTMLDocument("");return n.body.innerHTML=e,Bo(n.body.childNodes,t,n,r),n.body.innerHTML}function No(e,t){const r=e[`${t}Sibling`];if(r&&(0,K.isPhrasingContent)(r))return r;const{parentNode:n}=e;return n&&(0,K.isPhrasingContent)(n)?No(n,t):void 0}function Po(e){return Q()("wp.blocks.getPhrasingContentSchema",{since:"5.6",alternative:"wp.dom.getPhrasingContentSchema"}),(0,K.getPhrasingContentSchema)(e)}function Oo({HTML:e=""}){if(-1!==e.indexOf("\x3c!-- wp:")){const t=po(e);if(!(1===t.length&&"core/freeform"===t[0].name))return t}const t=Eo(e),r=So();return t.map((e=>{if("string"!=typeof e)return e;return ho(e=go(e=Ao(e,[_o,mo,wo,yo({raw:!0})],r),{raw:!0}),Oo)})).flat().filter(Boolean)}function Lo(e){e.nodeType===e.COMMENT_NODE&&(0,K.remove)(e)}function Mo(e,t){return e.every((e=>function(e,t){if((0,K.isTextContent)(e))return!0;if(!t)return!1;const r=e.nodeName.toLowerCase();return[["ul","li","ol"],["h1","h2","h3","h4","h5","h6"]].some((e=>0===[r,t].filter((t=>!e.includes(t))).length))}(e,t)&&Mo(Array.from(e.children),t)))}function jo(e){return"BR"===e.nodeName&&e.previousSibling&&"BR"===e.previousSibling.nodeName}function Do(e,t){if("SPAN"===e.nodeName&&e.style){const{fontWeight:r,fontStyle:n,textDecorationLine:o,textDecoration:a,verticalAlign:i}=e.style;"bold"!==r&&"700"!==r||(0,K.wrap)(t.createElement("strong"),e),"italic"===n&&(0,K.wrap)(t.createElement("em"),e),("line-through"===o||a.includes("line-through"))&&(0,K.wrap)(t.createElement("s"),e),"super"===i?(0,K.wrap)(t.createElement("sup"),e):"sub"===i&&(0,K.wrap)(t.createElement("sub"),e)}else"B"===e.nodeName?e=(0,K.replaceTag)(e,"strong"):"I"===e.nodeName?e=(0,K.replaceTag)(e,"em"):"A"===e.nodeName&&(e.target&&"_blank"===e.target.toLowerCase()?e.rel="noreferrer noopener":(e.removeAttribute("target"),e.removeAttribute("rel")),e.name&&!e.id&&(e.id=e.name),e.id&&!e.ownerDocument.querySelector(`[href="#${e.id}"]`)&&e.removeAttribute("id"))}function zo(e){"SCRIPT"!==e.nodeName&&"NOSCRIPT"!==e.nodeName&&"TEMPLATE"!==e.nodeName&&"STYLE"!==e.nodeName||e.parentNode.removeChild(e)}function Io(e){if(e.nodeType!==e.ELEMENT_NODE)return;const t=e.getAttribute("style");if(!t||!t.includes("mso-list"))return;"ignore"===t.split(";").reduce(((e,t)=>{const[r,n]=t.split(":");return r&&n&&(e[r.trim().toLowerCase()]=n.trim().toLowerCase()),e}),{})["mso-list"]&&e.remove()}function Ro(e){return"OL"===e.nodeName||"UL"===e.nodeName}function Ho(e,t){if("P"!==e.nodeName)return;const r=e.getAttribute("style");if(!r||!r.includes("mso-list"))return;const n=e.previousElementSibling;if(!n||!Ro(n)){const r=e.textContent.trim().slice(0,1),n=/[1iIaA]/.test(r),o=t.createElement(n?"ol":"ul");n&&o.setAttribute("type",r),e.parentNode.insertBefore(o,e)}const o=e.previousElementSibling,a=o.nodeName,i=t.createElement("li");let s=o;i.innerHTML=Ao(e.innerHTML,[Io]);const c=/mso-list\s*:[^;]+level([0-9]+)/i.exec(r);let l=c&&parseInt(c[1],10)-1||0;for(;l--;)s=s.lastChild||s,Ro(s)&&(s=s.lastChild||s);Ro(s)||(s=s.appendChild(t.createElement(a))),s.appendChild(i),e.parentNode.removeChild(e)}const Vo=window.wp.blob;function $o(e){if("IMG"===e.nodeName){if(0===e.src.indexOf("file:")&&(e.src=""),0===e.src.indexOf("data:")){const[t,r]=e.src.split(","),[n]=t.slice(5).split(";");if(!r||!n)return void(e.src="");let o;try{o=atob(r)}catch(t){return void(e.src="")}const a=new Uint8Array(o.length);for(let e=0;ewindow?.console?.log?.(...e);function Jo(e){return e=Ao(e,[zo,Ko,Io,Do,Lo]),e=Ao(e=(0,K.removeInvalidHTML)(e,(0,K.getPhrasingContentSchema)("paste"),{inline:!0}),[Wo,Yo]),Xo("Processed inline HTML:\n\n",e),e}function ea({HTML:e="",plainText:t="",mode:r="AUTO",tagName:n}){if(e=(e=(e=e.replace(/]+>/g,"")).replace(/^\s*]*>\s*]*>(?:\s*)?/i,"")).replace(/(?:\s*)?<\/body>\s*<\/html>\s*$/i,""),"INLINE"!==r){const r=e||t;if(-1!==r.indexOf("\x3c!-- wp:")){const e=po(r);if(!(1===e.length&&"core/freeform"===e[0].name))return e}}String.prototype.normalize&&(e=e.normalize()),e=Ao(e,[Zo]);const o=t&&(!e||function(e){return!/<(?!br[ />])/i.test(e)}(e));var a;o&&(e=t,/^\s+$/.test(t)||(a=e,e=qo.makeHtml(function(e){return e.replace(/((?:^|\n)```)([^\n`]+)(```(?:$|\n))/,((e,t,r,n)=>`${t}\n${r}\n${n}`))}(function(e){return e.replace(/(^|\n)•( +)/g,"$1*$2")}(a)))));const i=Eo(e),s=i.length>1;if(o&&!s&&"AUTO"===r&&-1===t.indexOf("\n")&&0!==t.indexOf("

    ")&&0===e.indexOf("

    ")&&(r="INLINE"),"INLINE"===r)return Jo(e);if("AUTO"===r&&!s&&function(e,t){const r=document.implementation.createHTMLDocument("");r.body.innerHTML=e;const n=Array.from(r.body.children);return!n.some(jo)&&Mo(n,t)}(e,n))return Jo(e);const c=(0,K.getPhrasingContentSchema)("paste"),l=So("paste"),u=i.map((e=>{if("string"!=typeof e)return e;const t=[Ko,Ho,zo,_o,$o,Do,mo,Lo,Go,wo,yo(),Uo],r={...l,...c};return e=Ao(e,t,l),e=Ao(e=go(e=(0,K.removeInvalidHTML)(e,r)),[Wo,Yo,Qo],l),Xo("Processed HTML piece:\n\n",e),ho(e,ea)})).flat().filter(Boolean);if("AUTO"===r&&1===u.length&&Ce(u[0].name,"__unstablePasteTextInline",!1)){const e=/^[\n]+|[\n]+$/g,r=t.replace(e,"");if(""!==r&&-1===r.indexOf("\n"))return(0,K.removeInvalidHTML)(Xr(u[0]),c).replace(e,"")}return u}function ta(){return(0,i.select)(gr).getCategories()}function ra(e){(0,i.dispatch)(gr).setCategories(e)}function na(e,t){(0,i.dispatch)(gr).updateCategory(e,t)}function oa(e=[],t=[]){return e.length===t.length&&t.every((([t,,r],n)=>{const o=e[n];return t===o.name&&oa(o.innerBlocks,r)}))}const aa=e=>"html"===e?.source,ia=e=>"query"===e?.source;function sa(e,t){return t?Object.fromEntries(Object.entries(t).map((([t,r])=>[t,ca(e[t],r)]))):{}}function ca(e,t){return aa(e)&&Array.isArray(t)?(0,G.renderToString)(t):ia(e)&&t?t.map((t=>sa(e.query,t))):t}function la(e=[],t){return t?t.map((([t,r,n],o)=>{var a;const i=e[o];if(i&&i.name===t){const e=la(i.innerBlocks,n);return{...i,innerBlocks:e}}const s=we(t),c=sa(null!==(a=s?.attributes)&&void 0!==a?a:{},r),[l,u]=Vn(t,c);return Tr(l,u,la([],n))})):e}const ua={};function da(e){return Q()("wp.blocks.withBlockContentContext",{since:"6.1"}),e}ne(ua,{isContentBlock:function(e){const t=we(e)?.attributes;return!!t&&!!Object.keys(t)?.some((e=>{const r=t[e];return"content"===r?.role||"content"===r?.__experimentalRole}))}})})(),(window.wp=window.wp||{}).blocks=n})(); \ No newline at end of file diff --git a/wp-includes/js/dist/commands.js b/wp-includes/js/dist/commands.js index 553654396d..b222155e50 100644 --- a/wp-includes/js/dist/commands.js +++ b/wp-includes/js/dist/commands.js @@ -138,19 +138,15 @@ var U=1,Y=.9,H=.8,J=.17,p=.1,u=.999,$=.9999;var k=.99,m=/[\\\/_+.#"@\[\(\{&]/,B= ;// ./node_modules/@babel/runtime/helpers/esm/extends.js function _extends() { - _extends = Object.assign ? Object.assign.bind() : function (target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - for (var key in source) { - if (Object.prototype.hasOwnProperty.call(source, key)) { - target[key] = source[key]; - } - } + return _extends = Object.assign ? Object.assign.bind() : function (n) { + for (var e = 1; e < arguments.length; e++) { + var t = arguments[e]; + for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } - return target; - }; - return _extends.apply(this, arguments); + return n; + }, _extends.apply(null, arguments); } + ;// external "React" const external_React_namespaceObject = window["React"]; var external_React_namespaceObject_0 = /*#__PURE__*/__webpack_require__.t(external_React_namespaceObject, 2); @@ -1703,10 +1699,19 @@ var __setModuleDefault = Object.create ? (function(o, v) { o["default"] = v; }; +var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); +}; + function __importStar(mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); __setModuleDefault(result, mod); return result; } @@ -1787,12 +1792,25 @@ function __disposeResources(env) { return next(); } +function __rewriteRelativeImportExtension(path, preserveJsx) { + if (typeof path === "string" && /^\.\.?\//.test(path)) { + return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) { + return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js"); + }); + } + return path; +} + /* harmony default export */ const tslib_es6 = ({ __extends, __assign, __rest, __decorate, __param, + __esDecorate, + __runInitializers, + __propKey, + __setFunctionName, __metadata, __awaiter, __generator, @@ -1815,6 +1833,7 @@ function __disposeResources(env) { __classPrivateFieldIn, __addDisposableResource, __disposeResources, + __rewriteRelativeImportExtension, }); ;// ./node_modules/react-remove-scroll-bar/dist/es2015/constants.js @@ -3127,7 +3146,7 @@ const external_wp_keyboardShortcuts_namespaceObject = window["wp"]["keyboardShor * Return an SVG icon. * * @param {IconProps} props icon is the SVG component to render - * size is a number specifiying the icon size in pixels + * size is a number specifying the icon size in pixels * Other props will be passed to wrapped SVG component * @param {import('react').ForwardedRef} ref The forwarded ref to the SVG element. * @@ -3389,6 +3408,7 @@ function actions_close() { } ;// ./node_modules/@wordpress/commands/build-module/store/selectors.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -3509,6 +3529,7 @@ const store = (0,external_wp_data_namespaceObject.createReduxStore)(STORE_NAME, unlock(store).registerPrivateActions(private_actions_namespaceObject); ;// ./node_modules/@wordpress/commands/build-module/components/command-menu.js +/* wp:polyfill */ /** * External dependencies */ @@ -3530,8 +3551,6 @@ unlock(store).registerPrivateActions(private_actions_namespaceObject); */ - - const inputLabel = (0,external_wp_i18n_namespaceObject.__)('Search commands and settings'); function CommandMenuLoader({ name, diff --git a/wp-includes/js/dist/commands.min.js b/wp-includes/js/dist/commands.min.js index 64c26fb47d..0f8ae7eb5e 100644 --- a/wp-includes/js/dist/commands.min.js +++ b/wp-includes/js/dist/commands.min.js @@ -1,2 +1,2 @@ /*! This file is auto-generated */ -(()=>{"use strict";var e,t,n={},r={};function o(e){var t=r[e];if(void 0!==t)return t.exports;var a=r[e]={exports:{}};return n[e](a,a.exports,o),a.exports}t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,o.t=function(n,r){if(1&r&&(n=this(n)),8&r)return n;if("object"==typeof n&&n){if(4&r&&n.__esModule)return n;if(16&r&&"function"==typeof n.then)return n}var a=Object.create(null);o.r(a);var c={};e=e||[null,t({}),t([]),t(t)];for(var u=2&r&&n;"object"==typeof u&&!~e.indexOf(u);u=t(u))Object.getOwnPropertyNames(u).forEach((e=>c[e]=()=>n[e]));return c.default=()=>n,o.d(a,c),a},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.nc=void 0;var a={};o.r(a),o.d(a,{CommandMenu:()=>Vn,privateApis:()=>qn,store:()=>Fn,useCommand:()=>zn,useCommandLoader:()=>Gn});var c={};o.r(c),o.d(c,{close:()=>Nn,open:()=>An,registerCommand:()=>xn,registerCommandLoader:()=>Rn,unregisterCommand:()=>On,unregisterCommandLoader:()=>kn});var u={};o.r(u),o.d(u,{getCommandLoaders:()=>Mn,getCommands:()=>Ln,getContext:()=>Tn,isOpen:()=>_n});var i={};o.r(i),o.d(i,{setContext:()=>Dn});var l=.999,s=/[\\\/_+.#"@\[\(\{&]/,d=/[\\\/_+.#"@\[\(\{&]/g,f=/[\s-]/,m=/[\s-]/g;function v(e,t,n,r,o,a,c){if(a===t.length)return o===e.length?1:.99;var u=`${o},${a}`;if(void 0!==c[u])return c[u];for(var i,p,h,g,b=r.charAt(a),E=n.indexOf(b,o),y=0;E>=0;)(i=v(e,t,n,r,E+1,a+1,c))>y&&(E===o?i*=1:s.test(e.charAt(E-1))?(i*=.8,(h=e.slice(o,E-1).match(d))&&o>0&&(i*=Math.pow(l,h.length))):f.test(e.charAt(E-1))?(i*=.9,(g=e.slice(o,E-1).match(m))&&o>0&&(i*=Math.pow(l,g.length))):(i*=.17,o>0&&(i*=Math.pow(l,E-o))),e.charAt(E)!==t.charAt(a)&&(i*=.9999)),(i<.1&&n.charAt(E-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(E-1)!==r.charAt(a))&&(.1*(p=v(e,t,n,r,E+1,a+2,c))>i&&(i=.1*p)),i>y&&(y=i),E=n.indexOf(b,E+1);return c[u]=y,y}function p(e){return e.toLowerCase().replace(m," ")}function h(e,t,n){return v(e=n&&n.length>0?""+(e+" "+n.join(" ")):e,t,p(e),p(t),0,0,{})}function g(){return g=Object.assign?Object.assign.bind():function(e){for(var t=1;te.forEach((e=>function(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}(e,t)))}function C(...e){return(0,b.useCallback)(w(...e),e)}function S(...e){const t=e[0];if(1===e.length)return t;const n=()=>{const n=e.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(e){const r=n.reduce(((t,{useScope:n,scopeName:r})=>({...t,...n(e)[`__scope${r}`]})),{});return(0,b.useMemo)((()=>({[`__scope${t.scopeName}`]:r})),[r])}};return n.scopeName=t.scopeName,n}const x=Boolean(null===globalThis||void 0===globalThis?void 0:globalThis.document)?b.useLayoutEffect:()=>{},O=E["useId".toString()]||(()=>{});let R=0;function k(e){const[t,n]=b.useState(O());return x((()=>{e||n((e=>null!=e?e:String(R++)))}),[e]),e||(t?`radix-${t}`:"")}function A(e){const t=(0,b.useRef)(e);return(0,b.useEffect)((()=>{t.current=e})),(0,b.useMemo)((()=>(...e)=>{var n;return null===(n=t.current)||void 0===n?void 0:n.call(t,...e)}),[])}function N({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=function({defaultProp:e,onChange:t}){const n=(0,b.useState)(e),[r]=n,o=(0,b.useRef)(r),a=A(t);return(0,b.useEffect)((()=>{o.current!==r&&(a(r),o.current=r)}),[r,o,a]),n}({defaultProp:t,onChange:n}),a=void 0!==e,c=a?e:r,u=A(n);return[c,(0,b.useCallback)((t=>{if(a){const n="function"==typeof t?t(e):t;n!==e&&u(n)}else o(t)}),[a,e,o,u])]}const L=window.ReactDOM,M=(0,b.forwardRef)(((e,t)=>{const{children:n,...r}=e,o=b.Children.toArray(n),a=o.find(D);if(a){const e=a.props.children,n=o.map((t=>t===a?b.Children.count(e)>1?b.Children.only(null):(0,b.isValidElement)(e)?e.props.children:null:t));return(0,b.createElement)(_,g({},r,{ref:t}),(0,b.isValidElement)(e)?(0,b.cloneElement)(e,void 0,n):null)}return(0,b.createElement)(_,g({},r,{ref:t}),n)}));M.displayName="Slot";const _=(0,b.forwardRef)(((e,t)=>{const{children:n,...r}=e;return(0,b.isValidElement)(n)?(0,b.cloneElement)(n,{...P(r,n.props),ref:t?w(t,n.ref):n.ref}):b.Children.count(n)>1?b.Children.only(null):null}));_.displayName="SlotClone";const T=({children:e})=>(0,b.createElement)(b.Fragment,null,e);function D(e){return(0,b.isValidElement)(e)&&e.type===T}function P(e,t){const n={...t};for(const r in t){const o=e[r],a=t[r];/^on[A-Z]/.test(r)?o&&a?n[r]=(...e)=>{a(...e),o(...e)}:o&&(n[r]=o):"style"===r?n[r]={...o,...a}:"className"===r&&(n[r]=[o,a].filter(Boolean).join(" "))}return{...e,...n}}const I=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce(((e,t)=>{const n=(0,b.forwardRef)(((e,n)=>{const{asChild:r,...o}=e,a=r?M:t;return(0,b.useEffect)((()=>{window[Symbol.for("radix-ui")]=!0}),[]),(0,b.createElement)(a,g({},o,{ref:n}))}));return n.displayName=`Primitive.${t}`,{...e,[t]:n}}),{});const j="dismissableLayer.update",F="dismissableLayer.pointerDownOutside",W="dismissableLayer.focusOutside";let U;const $=(0,b.createContext)({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),B=(0,b.forwardRef)(((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:c,onInteractOutside:u,onDismiss:i,...l}=e,s=(0,b.useContext)($),[d,f]=(0,b.useState)(null),m=null!==(n=null==d?void 0:d.ownerDocument)&&void 0!==n?n:null===globalThis||void 0===globalThis?void 0:globalThis.document,[,v]=(0,b.useState)({}),p=C(t,(e=>f(e))),h=Array.from(s.layers),[E]=[...s.layersWithOutsidePointerEventsDisabled].slice(-1),w=h.indexOf(E),S=d?h.indexOf(d):-1,x=s.layersWithOutsidePointerEventsDisabled.size>0,O=S>=w,R=function(e,t=(null===globalThis||void 0===globalThis?void 0:globalThis.document)){const n=A(e),r=(0,b.useRef)(!1),o=(0,b.useRef)((()=>{}));return(0,b.useEffect)((()=>{const e=e=>{if(e.target&&!r.current){const a={originalEvent:e};function c(){V(F,n,a,{discrete:!0})}"touch"===e.pointerType?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);r.current=!1},a=window.setTimeout((()=>{t.addEventListener("pointerdown",e)}),0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",e),t.removeEventListener("click",o.current)}}),[t,n]),{onPointerDownCapture:()=>r.current=!0}}((e=>{const t=e.target,n=[...s.branches].some((e=>e.contains(t)));O&&!n&&(null==a||a(e),null==u||u(e),e.defaultPrevented||null==i||i())}),m),k=function(e,t=(null===globalThis||void 0===globalThis?void 0:globalThis.document)){const n=A(e),r=(0,b.useRef)(!1);return(0,b.useEffect)((()=>{const e=e=>{if(e.target&&!r.current){V(W,n,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)}),[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}((e=>{const t=e.target;[...s.branches].some((e=>e.contains(t)))||(null==c||c(e),null==u||u(e),e.defaultPrevented||null==i||i())}),m);return function(e,t=(null===globalThis||void 0===globalThis?void 0:globalThis.document)){const n=A(e);(0,b.useEffect)((()=>{const e=e=>{"Escape"===e.key&&n(e)};return t.addEventListener("keydown",e),()=>t.removeEventListener("keydown",e)}),[n,t])}((e=>{S===s.layers.size-1&&(null==o||o(e),!e.defaultPrevented&&i&&(e.preventDefault(),i()))}),m),(0,b.useEffect)((()=>{if(d)return r&&(0===s.layersWithOutsidePointerEventsDisabled.size&&(U=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),s.layersWithOutsidePointerEventsDisabled.add(d)),s.layers.add(d),K(),()=>{r&&1===s.layersWithOutsidePointerEventsDisabled.size&&(m.body.style.pointerEvents=U)}}),[d,m,r,s]),(0,b.useEffect)((()=>()=>{d&&(s.layers.delete(d),s.layersWithOutsidePointerEventsDisabled.delete(d),K())}),[d,s]),(0,b.useEffect)((()=>{const e=()=>v({});return document.addEventListener(j,e),()=>document.removeEventListener(j,e)}),[]),(0,b.createElement)(I.div,g({},l,{ref:p,style:{pointerEvents:x?O?"auto":"none":void 0,...e.style},onFocusCapture:y(e.onFocusCapture,k.onFocusCapture),onBlurCapture:y(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:y(e.onPointerDownCapture,R.onPointerDownCapture)}))}));function K(){const e=new CustomEvent(j);document.dispatchEvent(e)}function V(e,t,n,{discrete:r}){const o=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?function(e,t){e&&(0,L.flushSync)((()=>e.dispatchEvent(t)))}(o,a):o.dispatchEvent(a)}const q="focusScope.autoFocusOnMount",z="focusScope.autoFocusOnUnmount",G={bubbles:!1,cancelable:!0},H=(0,b.forwardRef)(((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:a,...c}=e,[u,i]=(0,b.useState)(null),l=A(o),s=A(a),d=(0,b.useRef)(null),f=C(t,(e=>i(e))),m=(0,b.useRef)({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;(0,b.useEffect)((()=>{if(r){function e(e){if(m.paused||!u)return;const t=e.target;u.contains(t)?d.current=t:J(d.current,{select:!0})}function t(e){if(m.paused||!u)return;const t=e.relatedTarget;null!==t&&(u.contains(t)||J(d.current,{select:!0}))}function n(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&J(u)}document.addEventListener("focusin",e),document.addEventListener("focusout",t);const o=new MutationObserver(n);return u&&o.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),o.disconnect()}}}),[r,u,m.paused]),(0,b.useEffect)((()=>{if(u){Q.add(m);const t=document.activeElement;if(!u.contains(t)){const n=new CustomEvent(q,G);u.addEventListener(q,l),u.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(J(r,{select:t}),document.activeElement!==n)return}((e=X(u),e.filter((e=>"A"!==e.tagName))),{select:!0}),document.activeElement===t&&J(u))}return()=>{u.removeEventListener(q,l),setTimeout((()=>{const e=new CustomEvent(z,G);u.addEventListener(z,s),u.dispatchEvent(e),e.defaultPrevented||J(null!=t?t:document.body,{select:!0}),u.removeEventListener(z,s),Q.remove(m)}),0)}}var e}),[u,l,s,m]);const v=(0,b.useCallback)((e=>{if(!n&&!r)return;if(m.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,o=document.activeElement;if(t&&o){const t=e.currentTarget,[r,a]=function(e){const t=X(e),n=Y(t,e),r=Y(t.reverse(),e);return[n,r]}(t);r&&a?e.shiftKey||o!==a?e.shiftKey&&o===r&&(e.preventDefault(),n&&J(a,{select:!0})):(e.preventDefault(),n&&J(r,{select:!0})):o===t&&e.preventDefault()}}),[n,r,m.paused]);return(0,b.createElement)(I.div,g({tabIndex:-1},c,{ref:f,onKeyDown:v}))}));function X(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Y(e,t){for(const n of e)if(!Z(n,{upTo:t}))return n}function Z(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function J(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}const Q=function(){let e=[];return{add(t){const n=e[0];t!==n&&(null==n||n.pause()),e=ee(e,t),e.unshift(t)},remove(t){var n;e=ee(e,t),null===(n=e[0])||void 0===n||n.resume()}}}();function ee(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}const te=(0,b.forwardRef)(((e,t)=>{var n;const{container:r=(null===globalThis||void 0===globalThis||null===(n=globalThis.document)||void 0===n?void 0:n.body),...o}=e;return r?L.createPortal((0,b.createElement)(I.div,g({},o,{ref:t})),r):null}));const ne=e=>{const{present:t,children:n}=e,r=function(e){const[t,n]=(0,b.useState)(),r=(0,b.useRef)({}),o=(0,b.useRef)(e),a=(0,b.useRef)("none"),c=e?"mounted":"unmounted",[u,i]=function(e,t){return(0,b.useReducer)(((e,n)=>{const r=t[e][n];return null!=r?r:e}),e)}(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return(0,b.useEffect)((()=>{const e=re(r.current);a.current="mounted"===u?e:"none"}),[u]),x((()=>{const t=r.current,n=o.current;if(n!==e){const r=a.current,c=re(t);if(e)i("MOUNT");else if("none"===c||"none"===(null==t?void 0:t.display))i("UNMOUNT");else{i(n&&r!==c?"ANIMATION_OUT":"UNMOUNT")}o.current=e}}),[e,i]),x((()=>{if(t){const e=e=>{const n=re(r.current).includes(e.animationName);e.target===t&&n&&(0,L.flushSync)((()=>i("ANIMATION_END")))},n=e=>{e.target===t&&(a.current=re(r.current))};return t.addEventListener("animationstart",n),t.addEventListener("animationcancel",e),t.addEventListener("animationend",e),()=>{t.removeEventListener("animationstart",n),t.removeEventListener("animationcancel",e),t.removeEventListener("animationend",e)}}i("ANIMATION_END")}),[t,i]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:(0,b.useCallback)((e=>{e&&(r.current=getComputedStyle(e)),n(e)}),[])}}(t),o="function"==typeof n?n({present:r.isPresent}):b.Children.only(n),a=C(r.ref,o.ref);return"function"==typeof n||r.isPresent?(0,b.cloneElement)(o,{ref:a}):null};function re(e){return(null==e?void 0:e.animationName)||"none"}ne.displayName="Presence";let oe=0;function ae(){(0,b.useEffect)((()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",null!==(e=n[0])&&void 0!==e?e:ce()),document.body.insertAdjacentElement("beforeend",null!==(t=n[1])&&void 0!==t?t:ce()),oe++,()=>{1===oe&&document.querySelectorAll("[data-radix-focus-guard]").forEach((e=>e.remove())),oe--}}),[])}function ce(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var ue=function(){return ue=Object.assign||function(e){for(var t,n=1,r=arguments.length;n

    This is the home screen.

    - * - * Navigate to child screen. - * - * - * - * - *

    This is the child screen.

    - * - * Go back - * - *
    - * - * ); - * ``` - */ -const NavigatorProvider = contextConnect(UnconnectedNavigatorProvider, 'NavigatorProvider'); -/* harmony default export */ const navigator_provider_component = ((/* unused pure expression or super */ null && (NavigatorProvider))); +const component_Navigator = contextConnect(UnconnectedNavigator, 'Navigator'); ;// external ["wp","escapeHtml"] const external_wp_escapeHtml_namespaceObject = window["wp"]["escapeHtml"]; +;// ./node_modules/@wordpress/components/build-module/navigator/navigator-screen/use-screen-animate-presence.js +/** + * WordPress dependencies + */ + + + + +/** + * Internal dependencies + */ + + +// Possible values: +// - 'INITIAL': the initial state +// - 'ANIMATING_IN': start enter animation +// - 'IN': enter animation has ended +// - 'ANIMATING_OUT': start exit animation +// - 'OUT': the exit animation has ended + +// Allow an extra 20% of the total animation duration to account for potential +// event loop delays. +const ANIMATION_TIMEOUT_MARGIN = 1.2; +const isEnterAnimation = (animationDirection, animationStatus, animationName) => animationStatus === 'ANIMATING_IN' && animationName === ANIMATION_END_NAMES[animationDirection].in; +const isExitAnimation = (animationDirection, animationStatus, animationName) => animationStatus === 'ANIMATING_OUT' && animationName === ANIMATION_END_NAMES[animationDirection].out; +function useScreenAnimatePresence({ + isMatch, + skipAnimation, + isBack, + onAnimationEnd +}) { + const isRTL = (0,external_wp_i18n_namespaceObject.isRTL)(); + const prefersReducedMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)(); + const [animationStatus, setAnimationStatus] = (0,external_wp_element_namespaceObject.useState)('INITIAL'); + + // Start enter and exit animations when the screen is selected or deselected. + // The animation status is set to `IN` or `OUT` immediately if the animation + // should be skipped. + const becameSelected = animationStatus !== 'ANIMATING_IN' && animationStatus !== 'IN' && isMatch; + const becameUnselected = animationStatus !== 'ANIMATING_OUT' && animationStatus !== 'OUT' && !isMatch; + (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { + if (becameSelected) { + setAnimationStatus(skipAnimation || prefersReducedMotion ? 'IN' : 'ANIMATING_IN'); + } else if (becameUnselected) { + setAnimationStatus(skipAnimation || prefersReducedMotion ? 'OUT' : 'ANIMATING_OUT'); + } + }, [becameSelected, becameUnselected, skipAnimation, prefersReducedMotion]); + + // Animation attributes (derived state). + const animationDirection = isRTL && isBack || !isRTL && !isBack ? 'end' : 'start'; + const isAnimatingIn = animationStatus === 'ANIMATING_IN'; + const isAnimatingOut = animationStatus === 'ANIMATING_OUT'; + let animationType; + if (isAnimatingIn) { + animationType = 'in'; + } else if (isAnimatingOut) { + animationType = 'out'; + } + const onScreenAnimationEnd = (0,external_wp_element_namespaceObject.useCallback)(e => { + onAnimationEnd?.(e); + if (isExitAnimation(animationDirection, animationStatus, e.animationName)) { + // When the exit animation ends on an unselected screen, set the + // status to 'OUT' to remove the screen contents from the DOM. + setAnimationStatus('OUT'); + } else if (isEnterAnimation(animationDirection, animationStatus, e.animationName)) { + // When the enter animation ends on a selected screen, set the + // status to 'IN' to ensure the screen is rendered in the DOM. + setAnimationStatus('IN'); + } + }, [onAnimationEnd, animationStatus, animationDirection]); + + // Fallback timeout to ensure that the logic is applied even if the + // `animationend` event is not triggered. + (0,external_wp_element_namespaceObject.useEffect)(() => { + let animationTimeout; + if (isAnimatingOut) { + animationTimeout = window.setTimeout(() => { + setAnimationStatus('OUT'); + animationTimeout = undefined; + }, TOTAL_ANIMATION_DURATION.OUT * ANIMATION_TIMEOUT_MARGIN); + } else if (isAnimatingIn) { + animationTimeout = window.setTimeout(() => { + setAnimationStatus('IN'); + animationTimeout = undefined; + }, TOTAL_ANIMATION_DURATION.IN * ANIMATION_TIMEOUT_MARGIN); + } + return () => { + if (animationTimeout) { + window.clearTimeout(animationTimeout); + animationTimeout = undefined; + } + }; + }, [isAnimatingOut, isAnimatingIn]); + return { + animationStyles: navigatorScreenAnimation, + // Render the screen's contents in the DOM not only when the screen is + // selected, but also while it is animating out. + shouldRenderScreen: isMatch || animationStatus === 'IN' || animationStatus === 'ANIMATING_OUT', + screenProps: { + onAnimationEnd: onScreenAnimationEnd, + 'data-animation-direction': animationDirection, + 'data-animation-type': animationType, + 'data-skip-animation': skipAnimation || undefined + } + }; +} + ;// ./node_modules/@wordpress/components/build-module/navigator/navigator-screen/component.js +/* wp:polyfill */ /** * External dependencies */ @@ -61107,7 +61522,6 @@ const external_wp_escapeHtml_namespaceObject = window["wp"]["escapeHtml"]; - /** * Internal dependencies */ @@ -61118,25 +61532,36 @@ const external_wp_escapeHtml_namespaceObject = window["wp"]["escapeHtml"]; + function UnconnectedNavigatorScreen(props, forwardedRef) { if (!/^\//.test(props.path)) { - true ? external_wp_warning_default()('wp.components.NavigatorScreen: the `path` should follow a URL-like scheme; it should start with and be separated by the `/` character.') : 0; + true ? external_wp_warning_default()('wp.components.Navigator.Screen: the `path` should follow a URL-like scheme; it should start with and be separated by the `/` character.') : 0; } const screenId = (0,external_wp_element_namespaceObject.useId)(); const { children, className, path, + onAnimationEnd: onAnimationEndProp, ...otherProps - } = useContextSystem(props, 'NavigatorScreen'); + } = useContextSystem(props, 'Navigator.Screen'); const { location, match, addScreen, removeScreen } = (0,external_wp_element_namespaceObject.useContext)(NavigatorContext); + const { + isInitial, + isBack, + focusTargetSelector, + skipFocus + } = location; const isMatch = match === screenId; const wrapperRef = (0,external_wp_element_namespaceObject.useRef)(null); + const skipAnimationAndFocusRestoration = !!isInitial && !isBack; + + // Register / unregister screen with the navigator context. (0,external_wp_element_namespaceObject.useEffect)(() => { const screen = { id: screenId, @@ -61145,103 +61570,71 @@ function UnconnectedNavigatorScreen(props, forwardedRef) { addScreen(screen); return () => removeScreen(screen); }, [screenId, path, addScreen, removeScreen]); - const isRTL = (0,external_wp_i18n_namespaceObject.isRTL)(); + + // Animation. const { - isInitial, - isBack - } = location; - const cx = useCx(); - const classes = (0,external_wp_element_namespaceObject.useMemo)(() => cx(navigatorScreen({ - isInitial, + animationStyles, + shouldRenderScreen, + screenProps + } = useScreenAnimatePresence({ + isMatch, isBack, - isRTL - }), className), [className, cx, isInitial, isBack, isRTL]); + onAnimationEnd: onAnimationEndProp, + skipAnimation: skipAnimationAndFocusRestoration + }); + const cx = useCx(); + const classes = (0,external_wp_element_namespaceObject.useMemo)(() => cx(navigatorScreen, animationStyles, className), [className, cx, animationStyles]); + + // Focus restoration const locationRef = (0,external_wp_element_namespaceObject.useRef)(location); (0,external_wp_element_namespaceObject.useEffect)(() => { locationRef.current = location; }, [location]); - - // Focus restoration - const isInitialLocation = location.isInitial && !location.isBack; (0,external_wp_element_namespaceObject.useEffect)(() => { + const wrapperEl = wrapperRef.current; // Only attempt to restore focus: // - if the current location is not the initial one (to avoid moving focus on page load) // - when the screen becomes visible // - if the wrapper ref has been assigned // - if focus hasn't already been restored for the current location // - if the `skipFocus` option is not set to `true`. This is useful when we trigger the navigation outside of NavigatorScreen. - if (isInitialLocation || !isMatch || !wrapperRef.current || locationRef.current.hasRestoredFocus || location.skipFocus) { + if (skipAnimationAndFocusRestoration || !isMatch || !wrapperEl || locationRef.current.hasRestoredFocus || skipFocus) { return; } - const activeElement = wrapperRef.current.ownerDocument.activeElement; + const activeElement = wrapperEl.ownerDocument.activeElement; // If an element is already focused within the wrapper do not focus the // element. This prevents inputs or buttons from losing focus unnecessarily. - if (wrapperRef.current.contains(activeElement)) { + if (wrapperEl.contains(activeElement)) { return; } let elementToFocus = null; // When navigating back, if a selector is provided, use it to look for the // target element (assumed to be a node inside the current NavigatorScreen) - if (location.isBack && location.focusTargetSelector) { - elementToFocus = wrapperRef.current.querySelector(location.focusTargetSelector); + if (isBack && focusTargetSelector) { + elementToFocus = wrapperEl.querySelector(focusTargetSelector); } // If the previous query didn't run or find any element to focus, fallback // to the first tabbable element in the screen (or the screen itself). if (!elementToFocus) { - const [firstTabbable] = external_wp_dom_namespaceObject.focus.tabbable.find(wrapperRef.current); - elementToFocus = firstTabbable !== null && firstTabbable !== void 0 ? firstTabbable : wrapperRef.current; + const [firstTabbable] = external_wp_dom_namespaceObject.focus.tabbable.find(wrapperEl); + elementToFocus = firstTabbable !== null && firstTabbable !== void 0 ? firstTabbable : wrapperEl; } locationRef.current.hasRestoredFocus = true; elementToFocus.focus(); - }, [isInitialLocation, isMatch, location.isBack, location.focusTargetSelector, location.skipFocus]); + }, [skipAnimationAndFocusRestoration, isMatch, isBack, focusTargetSelector, skipFocus]); const mergedWrapperRef = (0,external_wp_compose_namespaceObject.useMergeRefs)([forwardedRef, wrapperRef]); - return isMatch ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(component, { + return shouldRenderScreen ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(component, { ref: mergedWrapperRef, className: classes, + ...screenProps, ...otherProps, children: children }) : null; } - -/** - * The `NavigatorScreen` component represents a single view/screen/panel and - * should be used in combination with the `NavigatorProvider`, the - * `NavigatorButton` and the `NavigatorBackButton` components (or the `useNavigator` - * hook). - * - * @example - * ```jsx - * import { - * __experimentalNavigatorProvider as NavigatorProvider, - * __experimentalNavigatorScreen as NavigatorScreen, - * __experimentalNavigatorButton as NavigatorButton, - * __experimentalNavigatorBackButton as NavigatorBackButton, - * } from '@wordpress/components'; - * - * const MyNavigation = () => ( - * - * - *

    This is the home screen.

    - * - * Navigate to child screen. - * - *
    - * - * - *

    This is the child screen.

    - * - * Go back - * - *
    - *
    - * ); - * ``` - */ -const NavigatorScreen = contextConnect(UnconnectedNavigatorScreen, 'NavigatorScreen'); -/* harmony default export */ const navigator_screen_component = ((/* unused pure expression or super */ null && (NavigatorScreen))); +const NavigatorScreen = contextConnect(UnconnectedNavigatorScreen, 'Navigator.Screen'); ;// ./node_modules/@wordpress/components/build-module/navigator/use-navigator.js /** @@ -61254,7 +61647,10 @@ const NavigatorScreen = contextConnect(UnconnectedNavigatorScreen, 'NavigatorScr */ /** - * Retrieves a `navigator` instance. + * Retrieves a `navigator` instance. This hook provides advanced functionality, + * such as imperatively navigating to a new location (with options like + * navigating back or skipping focus restoration) and accessing the current + * location and path parameters. */ function useNavigator() { const { @@ -61295,7 +61691,7 @@ function useNavigatorButton(props) { as = build_module_button, attributeName = 'id', ...otherProps - } = useContextSystem(props, 'NavigatorButton'); + } = useContextSystem(props, 'Navigator.Button'); const escapedPath = (0,external_wp_escapeHtml_namespaceObject.escapeAttribute)(path); const { goTo @@ -61335,42 +61731,7 @@ function UnconnectedNavigatorButton(props, forwardedRef) { ...navigatorButtonProps }); } - -/** - * The `NavigatorButton` component can be used to navigate to a screen and should - * be used in combination with the `NavigatorProvider`, the `NavigatorScreen` - * and the `NavigatorBackButton` components (or the `useNavigator` hook). - * - * @example - * ```jsx - * import { - * __experimentalNavigatorProvider as NavigatorProvider, - * __experimentalNavigatorScreen as NavigatorScreen, - * __experimentalNavigatorButton as NavigatorButton, - * __experimentalNavigatorBackButton as NavigatorBackButton, - * } from '@wordpress/components'; - * - * const MyNavigation = () => ( - * - * - *

    This is the home screen.

    - * - * Navigate to child screen. - * - *
    - * - * - *

    This is the child screen.

    - * - * Go back - * - *
    - *
    - * ); - * ``` - */ -const NavigatorButton = contextConnect(UnconnectedNavigatorButton, 'NavigatorButton'); -/* harmony default export */ const navigator_button_component = ((/* unused pure expression or super */ null && (NavigatorButton))); +const NavigatorButton = contextConnect(UnconnectedNavigatorButton, 'Navigator.Button'); ;// ./node_modules/@wordpress/components/build-module/navigator/navigator-back-button/hook.js /** @@ -61390,7 +61751,7 @@ function useNavigatorBackButton(props) { onClick, as = build_module_button, ...otherProps - } = useContextSystem(props, 'NavigatorBackButton'); + } = useContextSystem(props, 'Navigator.BackButton'); const { goBack } = useNavigator(); @@ -61426,12 +61787,161 @@ function UnconnectedNavigatorBackButton(props, forwardedRef) { ...navigatorBackButtonProps }); } +const NavigatorBackButton = contextConnect(UnconnectedNavigatorBackButton, 'Navigator.BackButton'); + +;// ./node_modules/@wordpress/components/build-module/navigator/navigator-to-parent-button/component.js +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + + +function UnconnectedNavigatorToParentButton(props, forwardedRef) { + external_wp_deprecated_default()('wp.components.NavigatorToParentButton', { + since: '6.7', + alternative: 'wp.components.Navigator.BackButton' + }); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigatorBackButton, { + ref: forwardedRef, + ...props + }); +} + +/** + * @deprecated + */ +const NavigatorToParentButton = contextConnect(UnconnectedNavigatorToParentButton, 'Navigator.ToParentButton'); + +;// ./node_modules/@wordpress/components/build-module/navigator/legacy.js +/** + * Internal dependencies + */ + + + + + + + +/** + * The `NavigatorProvider` component allows rendering nested views/panels/menus + * (via the `NavigatorScreen` component and navigate between them + * (via the `NavigatorButton` and `NavigatorBackButton` components). + * + * ```jsx + * import { + * __experimentalNavigatorProvider as NavigatorProvider, + * __experimentalNavigatorScreen as NavigatorScreen, + * __experimentalNavigatorButton as NavigatorButton, + * __experimentalNavigatorBackButton as NavigatorBackButton, + * } from '@wordpress/components'; + * + * const MyNavigation = () => ( + * + * + *

    This is the home screen.

    + * + * Navigate to child screen. + * + *
    + * + * + *

    This is the child screen.

    + * + * Go back + * + *
    + *
    + * ); + * ``` + */ +const NavigatorProvider = Object.assign(component_Navigator, { + displayName: 'NavigatorProvider' +}); + +/** + * The `NavigatorScreen` component represents a single view/screen/panel and + * should be used in combination with the `NavigatorProvider`, the + * `NavigatorButton` and the `NavigatorBackButton` components. + * + * @example + * ```jsx + * import { + * __experimentalNavigatorProvider as NavigatorProvider, + * __experimentalNavigatorScreen as NavigatorScreen, + * __experimentalNavigatorButton as NavigatorButton, + * __experimentalNavigatorBackButton as NavigatorBackButton, + * } from '@wordpress/components'; + * + * const MyNavigation = () => ( + * + * + *

    This is the home screen.

    + * + * Navigate to child screen. + * + *
    + * + * + *

    This is the child screen.

    + * + * Go back + * + *
    + *
    + * ); + * ``` + */ +const legacy_NavigatorScreen = Object.assign(NavigatorScreen, { + displayName: 'NavigatorScreen' +}); + +/** + * The `NavigatorButton` component can be used to navigate to a screen and should + * be used in combination with the `NavigatorProvider`, the `NavigatorScreen` + * and the `NavigatorBackButton` components. + * + * @example + * ```jsx + * import { + * __experimentalNavigatorProvider as NavigatorProvider, + * __experimentalNavigatorScreen as NavigatorScreen, + * __experimentalNavigatorButton as NavigatorButton, + * __experimentalNavigatorBackButton as NavigatorBackButton, + * } from '@wordpress/components'; + * + * const MyNavigation = () => ( + * + * + *

    This is the home screen.

    + * + * Navigate to child screen. + * + *
    + * + * + *

    This is the child screen.

    + * + * Go back + * + *
    + *
    + * ); + * ``` + */ +const legacy_NavigatorButton = Object.assign(NavigatorButton, { + displayName: 'NavigatorButton' +}); /** * The `NavigatorBackButton` component can be used to navigate to a screen and * should be used in combination with the `NavigatorProvider`, the - * `NavigatorScreen` and the `NavigatorButton` components (or the `useNavigator` - * hook). + * `NavigatorScreen` and the `NavigatorButton` components. * * @example * ```jsx @@ -61461,31 +61971,9 @@ function UnconnectedNavigatorBackButton(props, forwardedRef) { * ); * ``` */ -const NavigatorBackButton = contextConnect(UnconnectedNavigatorBackButton, 'NavigatorBackButton'); -/* harmony default export */ const navigator_back_button_component = ((/* unused pure expression or super */ null && (NavigatorBackButton))); - -;// ./node_modules/@wordpress/components/build-module/navigator/navigator-to-parent-button/component.js -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - - - -function UnconnectedNavigatorToParentButton(props, forwardedRef) { - external_wp_deprecated_default()('wp.components.NavigatorToParentButton', { - since: '6.7', - alternative: 'wp.components.NavigatorBackButton' - }); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigatorBackButton, { - ref: forwardedRef, - ...props - }); -} +const legacy_NavigatorBackButton = Object.assign(NavigatorBackButton, { + displayName: 'NavigatorBackButton' +}); /** * _Note: this component is deprecated. Please use the `NavigatorBackButton` @@ -61493,10 +61981,145 @@ function UnconnectedNavigatorToParentButton(props, forwardedRef) { * * @deprecated */ -const NavigatorToParentButton = contextConnect(UnconnectedNavigatorToParentButton, 'NavigatorToParentButton'); -/* harmony default export */ const navigator_to_parent_button_component = ((/* unused pure expression or super */ null && (NavigatorToParentButton))); +const legacy_NavigatorToParentButton = Object.assign(NavigatorToParentButton, { + displayName: 'NavigatorToParentButton' +}); + +;// ./node_modules/@wordpress/components/build-module/navigator/index.js +/** + * Internal dependencies + */ + + + + + + +/** + * The `Navigator` component allows rendering nested views/panels/menus + * (via the `Navigator.Screen` component) and navigate between them + * (via the `Navigator.Button` and `Navigator.BackButton` components). + * + * ```jsx + * import { Navigator } from '@wordpress/components'; + * + * const MyNavigation = () => ( + * + * + *

    This is the home screen.

    + * + * Navigate to child screen. + * + *
    + * + * + *

    This is the child screen.

    + * + * Go back + * + *
    + *
    + * ); + * ``` + */ +const navigator_Navigator = Object.assign(component_Navigator, { + /** + * The `Navigator.Screen` component represents a single view/screen/panel and + * should be used in combination with the `Navigator`, the `Navigator.Button` + * and the `Navigator.BackButton` components. + * + * @example + * ```jsx + * import { Navigator } from '@wordpress/components'; + * + * const MyNavigation = () => ( + * + * + *

    This is the home screen.

    + * + * Navigate to child screen. + * + *
    + * + * + *

    This is the child screen.

    + * + * Go back + * + *
    + *
    + * ); + * ``` + */ + Screen: Object.assign(NavigatorScreen, { + displayName: 'Navigator.Screen' + }), + /** + * The `Navigator.Button` component can be used to navigate to a screen and + * should be used in combination with the `Navigator`, the `Navigator.Screen` + * and the `Navigator.BackButton` components. + * + * @example + * ```jsx + * import { Navigator } from '@wordpress/components'; + * + * const MyNavigation = () => ( + * + * + *

    This is the home screen.

    + * + * Navigate to child screen. + * + *
    + * + * + *

    This is the child screen.

    + * + * Go back + * + *
    + *
    + * ); + * ``` + */ + Button: Object.assign(NavigatorButton, { + displayName: 'Navigator.Button' + }), + /** + * The `Navigator.BackButton` component can be used to navigate to a screen and + * should be used in combination with the `Navigator`, the `Navigator.Screen` + * and the `Navigator.Button` components. + * + * @example + * ```jsx + * import { Navigator } from '@wordpress/components'; + * + * const MyNavigation = () => ( + * + * + *

    This is the home screen.

    + * + * Navigate to child screen. + * + *
    + * + * + *

    This is the child screen.

    + * + * Go back + * + *
    + *
    + * ); + * ``` + */ + BackButton: Object.assign(NavigatorBackButton, { + displayName: 'Navigator.BackButton' + }) +}); ;// ./node_modules/@wordpress/components/build-module/notice/index.js +/* wp:polyfill */ /** * External dependencies */ @@ -61516,7 +62139,6 @@ const NavigatorToParentButton = contextConnect(UnconnectedNavigatorToParentButto - const notice_noop = () => {}; /** @@ -61620,6 +62242,7 @@ function Notice({ computedVariant = 'primary'; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_button, { + __next40pxDefaultSize: true, href: url, variant: computedVariant, onClick: url ? undefined : onClick, @@ -61629,6 +62252,7 @@ function Notice({ }) })] }), isDismissible && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_button, { + size: "small", className: "components-notice__dismiss", icon: library_close, label: (0,external_wp_i18n_namespaceObject.__)('Close'), @@ -61639,6 +62263,7 @@ function Notice({ /* harmony default export */ const build_module_notice = (Notice); ;// ./node_modules/@wordpress/components/build-module/notice/list.js +/* wp:polyfill */ /** * External dependencies */ @@ -61705,7 +62330,6 @@ function NoticeList({ ;// ./node_modules/@wordpress/components/build-module/panel/header.js - /** * Internal dependencies */ @@ -61744,7 +62368,6 @@ function PanelHeader({ */ - function UnforwardedPanel({ header, className, @@ -61815,7 +62438,6 @@ const chevronUp = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)( - const body_noop = () => {}; function UnforwardedPanelBody(props, ref) { const { @@ -61892,6 +62514,7 @@ const PanelBodyTitle = (0,external_wp_element_namespaceObject.forwardRef)(({ return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h2", { className: "components-panel__body-title", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(build_module_button, { + __next40pxDefaultSize: true, className: "components-panel__body-toggle", "aria-expanded": isOpened, ref: ref, @@ -61965,7 +62588,6 @@ const PanelRow = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedP */ - const PlaceholderIllustration = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { className: "components-placeholder__illustration", fill: "none", @@ -62119,7 +62741,6 @@ const ProgressElement = /*#__PURE__*/emotion_styled_base_browser_esm("progress", */ - function UnforwardedProgressBar(props, ref) { const { className, @@ -62163,6 +62784,7 @@ const ProgressBar = (0,external_wp_element_namespaceObject.forwardRef)(Unforward /* harmony default export */ const progress_bar = (ProgressBar); ;// ./node_modules/@wordpress/components/build-module/query-controls/terms.js +/* wp:polyfill */ /** * Internal dependencies */ @@ -62217,6 +62839,7 @@ function buildTermsTree(flatTerms) { ;// external ["wp","htmlEntities"] const external_wp_htmlEntities_namespaceObject = window["wp"]["htmlEntities"]; ;// ./node_modules/@wordpress/components/build-module/tree-select/index.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -62230,6 +62853,7 @@ const external_wp_htmlEntities_namespaceObject = window["wp"]["htmlEntities"]; + const tree_select_CONTEXT_VALUE = { BaseControl: { // Temporary during deprecation grace period: Overrides the underlying `__associatedWPComponentName` @@ -62247,11 +62871,11 @@ function getSelectOptions(tree, level = 0) { } /** - * TreeSelect component is used to generate select input fields. + * Generates a hierarchical select input. * * ```jsx + * import { useState } from 'react'; * import { TreeSelect } from '@wordpress/components'; - * import { useState } from '@wordpress/element'; * * const MyTreeSelect = () => { * const [ page, setPage ] = useState( 'p21' ); @@ -62259,6 +62883,7 @@ function getSelectOptions(tree, level = 0) { * return ( * setPage( newPage ) } @@ -62309,9 +62934,15 @@ function TreeSelect(props) { label: noOptionLabel }, ...getSelectOptions(tree)].filter(option => !!option); }, [noOptionLabel, tree]); + maybeWarnDeprecated36pxSize({ + componentName: 'TreeSelect', + size: restProps.size, + __next40pxDefaultSize: restProps.__next40pxDefaultSize + }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ContextSystemProvider, { value: tree_select_CONTEXT_VALUE, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SelectControl, { + __shouldNotWarnDeprecated36pxSize: true, label, options, onChange, @@ -62389,6 +63020,7 @@ function CategorySelect({ } ;// ./node_modules/@wordpress/components/build-module/query-controls/index.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -62558,13 +63190,13 @@ const RadioGroupContext = (0,external_wp_element_namespaceObject.createContext)( */ - /** * Internal dependencies */ + function UnforwardedRadio({ value, children, @@ -62576,6 +63208,11 @@ function UnforwardedRadio({ } = (0,external_wp_element_namespaceObject.useContext)(RadioGroupContext); const selectedValue = useStoreState(store, 'value'); const isChecked = selectedValue !== undefined && selectedValue === value; + maybeWarnDeprecated36pxSize({ + componentName: 'Radio', + size: undefined, + __next40pxDefaultSize: props.__next40pxDefaultSize + }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Radio, { disabled: disabled, store: store, @@ -62606,6 +63243,8 @@ const radio_Radio = (0,external_wp_element_namespaceObject.forwardRef)(Unforward */ + + /** * Internal dependencies */ @@ -62626,17 +63265,23 @@ function UnforwardedRadioGroup({ defaultValue: defaultChecked, setValue: newValue => { onChange?.(newValue !== null && newValue !== void 0 ? newValue : undefined); - } + }, + rtl: (0,external_wp_i18n_namespaceObject.isRTL)() }); const contextValue = (0,external_wp_element_namespaceObject.useMemo)(() => ({ store: radioStore, disabled }), [radioStore, disabled]); + external_wp_deprecated_default()('wp.components.__experimentalRadioGroup', { + alternative: 'wp.components.RadioControl or wp.components.__experimentalToggleGroupControl', + since: '6.8' + }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(RadioGroupContext.Provider, { value: contextValue, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(RadioGroup, { store: radioStore, render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(button_group, { + __shouldNotWarnDeprecated: true, children: children }), "aria-label": label, @@ -62653,6 +63298,7 @@ const radio_group_RadioGroup = (0,external_wp_element_namespaceObject.forwardRef /* harmony default export */ const radio_group = (radio_group_RadioGroup); ;// ./node_modules/@wordpress/components/build-module/radio-control/index.js +/* wp:polyfill */ /** * External dependencies */ @@ -62670,7 +63316,6 @@ const radio_group_RadioGroup = (0,external_wp_element_namespaceObject.forwardRef - function generateOptionDescriptionId(radioGroupId, index) { return `${radioGroupId}-${index}-option-description`; } @@ -63938,7 +64583,6 @@ const label_ForwardedComponent = (0,external_wp_element_namespaceObject.forwardR - const resize_tooltip_noop = () => {}; function ResizeTooltip({ axis, @@ -63984,6 +64628,7 @@ const resize_tooltip_ForwardedComponent = (0,external_wp_element_namespaceObject /* harmony default export */ const resize_tooltip = (resize_tooltip_ForwardedComponent); ;// ./node_modules/@wordpress/components/build-module/resizable-box/index.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -63999,7 +64644,6 @@ const resize_tooltip_ForwardedComponent = (0,external_wp_element_namespaceObject */ - const HANDLE_CLASS_NAME = 'components-resizable-box__handle'; const SIDE_HANDLE_CLASS_NAME = 'components-resizable-box__side-handle'; const CORNER_HANDLE_CLASS_NAME = 'components-resizable-box__corner-handle'; @@ -64042,7 +64686,15 @@ function UnforwardedResizableBox({ ...props }, ref) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(Resizable, { - className: dist_clsx('components-resizable-box__container', showHandle && 'has-show-handle', className), + className: dist_clsx('components-resizable-box__container', showHandle && 'has-show-handle', className) + // Add a focusable element within the drag handle. Unfortunately, + // `re-resizable` does not make them properly focusable by default, + // causing focus to move the the block wrapper which triggers block + // drag. + , + handleComponent: Object.fromEntries(Object.keys(HANDLE_CLASSES).map(key => [key, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + tabIndex: -1 + }, key)])), handleClasses: HANDLE_CLASSES, handleStyles: HANDLE_STYLES, ref: ref, @@ -64116,6 +64768,7 @@ function ResponsiveWrapper({ /* harmony default export */ const responsive_wrapper = (ResponsiveWrapper); ;// ./node_modules/@wordpress/components/build-module/sandbox/index.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -64126,7 +64779,6 @@ function ResponsiveWrapper({ * Internal dependencies */ - const observeAndResizeJS = function () { const { MutationObserver @@ -64331,21 +64983,18 @@ function SandBox({ iframe?.removeEventListener('load', tryNoForceSandBox, false); defaultView?.removeEventListener('message', checkMessageForResize); }; - // Ignore reason: passing `exhaustive-deps` will likely involve a more detailed refactor. + // Passing `exhaustive-deps` will likely involve a more detailed refactor. // See https://github.com/WordPress/gutenberg/pull/44378 - // eslint-disable-next-line react-hooks/exhaustive-deps }, []); (0,external_wp_element_namespaceObject.useEffect)(() => { trySandBox(); - // Ignore reason: passing `exhaustive-deps` will likely involve a more detailed refactor. + // Passing `exhaustive-deps` will likely involve a more detailed refactor. // See https://github.com/WordPress/gutenberg/pull/44378 - // eslint-disable-next-line react-hooks/exhaustive-deps }, [title, styles, scripts]); (0,external_wp_element_namespaceObject.useEffect)(() => { trySandBox(true); - // Ignore reason: passing `exhaustive-deps` will likely involve a more detailed refactor. + // Passing `exhaustive-deps` will likely involve a more detailed refactor. // See https://github.com/WordPress/gutenberg/pull/44378 - // eslint-disable-next-line react-hooks/exhaustive-deps }, [html, type]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("iframe", { ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([ref, (0,external_wp_compose_namespaceObject.useFocusableIframe)()]), @@ -64361,6 +65010,7 @@ function SandBox({ /* harmony default export */ const sandbox = (SandBox); ;// ./node_modules/@wordpress/components/build-module/snackbar/index.js +/* wp:polyfill */ /** * External dependencies */ @@ -64380,7 +65030,6 @@ function SandBox({ */ - const NOTICE_TIMEOUT = 10000; /** @@ -64486,8 +65135,9 @@ function UnforwardedSnackbar({ url }, index) => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_button, { + __next40pxDefaultSize: true, href: url, - variant: "tertiary", + variant: "link", onClick: event => onActionClick(event, onClick), className: "components-snackbar__action", children: label @@ -64521,6 +65171,7 @@ const Snackbar = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedS /* harmony default export */ const snackbar = (Snackbar); ;// ./node_modules/@wordpress/components/build-module/snackbar/list.js +/* wp:polyfill */ /** * External dependencies */ @@ -64538,7 +65189,6 @@ const Snackbar = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedS - const SNACKBAR_VARIANTS = { init: { height: 0, @@ -64676,7 +65326,6 @@ const SpinnerIndicator = /*#__PURE__*/emotion_styled_base_browser_esm("path", t */ - function UnforwardedSpinner({ className, ...props @@ -64919,7 +65568,7 @@ function createTabStore(_a = {}) { } -;// ./node_modules/@ariakit/react-core/esm/__chunks/JZUY7XL6.js +;// ./node_modules/@ariakit/react-core/esm/__chunks/PY4NZ6HS.js "use client"; @@ -64936,7 +65585,7 @@ function useTabStoreProps(store, update, props) { store = useCompositeStoreProps(store, update, props); useStoreProps(store, props, "selectedId", "setSelectedId"); useStoreProps(store, props, "selectOnMove"); - const [panels, updatePanels] = _2GXGCHW6_useStore(() => store.panels, {}); + const [panels, updatePanels] = YV4JVR4I_useStore(() => store.panels, {}); useUpdateEffect(updatePanels, [store, updatePanels]); return Object.assign( (0,external_React_.useMemo)(() => _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, store), { panels }), [store, panels]), @@ -64950,27 +65599,27 @@ function useTabStore(props = {}) { composite: props.composite !== void 0 ? props.composite : composite, combobox: props.combobox !== void 0 ? props.combobox : combobox }); - const [store, update] = _2GXGCHW6_useStore(createTabStore, props); + const [store, update] = YV4JVR4I_useStore(createTabStore, props); return useTabStoreProps(store, update, props); } -;// ./node_modules/@ariakit/react-core/esm/__chunks/TNITL632.js +;// ./node_modules/@ariakit/react-core/esm/__chunks/UYGDZTLQ.js "use client"; // src/tab/tab-context.tsx -var TNITL632_ctx = createStoreContext( +var UYGDZTLQ_ctx = createStoreContext( [CompositeContextProvider], [CompositeScopedContextProvider] ); -var useTabContext = TNITL632_ctx.useContext; -var useTabScopedContext = TNITL632_ctx.useScopedContext; -var useTabProviderContext = TNITL632_ctx.useProviderContext; -var TabContextProvider = TNITL632_ctx.ContextProvider; -var TabScopedContextProvider = TNITL632_ctx.ScopedContextProvider; +var useTabContext = UYGDZTLQ_ctx.useContext; +var useTabScopedContext = UYGDZTLQ_ctx.useScopedContext; +var useTabProviderContext = UYGDZTLQ_ctx.useProviderContext; +var TabContextProvider = UYGDZTLQ_ctx.ContextProvider; +var TabScopedContextProvider = UYGDZTLQ_ctx.ScopedContextProvider; @@ -65022,9 +65671,9 @@ var useTabList = createHook( return props; } ); -var tab_list_TabList = forwardRef2(function TabList2(props) { +var TabList = forwardRef2(function TabList2(props) { const htmlProps = useTabList(props); - return HKOOKEDE_createElement(tab_list_TagName, htmlProps); + return LMDWO4NN_createElement(tab_list_TagName, htmlProps); }); @@ -65119,13 +65768,14 @@ var useTab = createHook(function useTab2(_a) { accessibleWhenDisabled, store: store.composite, shouldRegisterItem: canRegisterComposedItem && shouldRegisterItem, + rowId: props.rowId, render: props.render }; props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), { render: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( - _7QKWW6TW_CompositeItem, + P2CTZE2T_CompositeItem, _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, defaultProps), { - render: store.combobox && store.composite !== store.combobox ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(_7QKWW6TW_CompositeItem, _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, defaultProps), { store: store.combobox })) : defaultProps.render + render: store.combobox && store.composite !== store.combobox ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(P2CTZE2T_CompositeItem, _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, defaultProps), { store: store.combobox })) : defaultProps.render }) ) }); @@ -65142,7 +65792,7 @@ var useTab = createHook(function useTab2(_a) { var Tab = memo2( forwardRef2(function Tab2(props) { const htmlProps = useTab(props); - return HKOOKEDE_createElement(tab_TagName, htmlProps); + return LMDWO4NN_createElement(tab_TagName, htmlProps); }) ); @@ -65170,7 +65820,6 @@ var Tab = memo2( - var tab_panel_TagName = "div"; var useTabPanel = createHook( function useTabPanel2(_a) { @@ -65178,12 +65827,16 @@ var useTabPanel = createHook( store, unmountOnHide, tabId: tabIdProp, - getItem: getItemProp + getItem: getItemProp, + scrollRestoration, + scrollElement } = _b, props = __objRest(_b, [ "store", "unmountOnHide", "tabId", - "getItem" + "getItem", + "scrollRestoration", + "scrollElement" ]); const context = useTabProviderContext(); store = store || context; @@ -65193,6 +65846,58 @@ var useTabPanel = createHook( ); const ref = (0,external_React_.useRef)(null); const id = useId(props.id); + const tabId = useStoreState( + store.panels, + () => { + var _a2; + return tabIdProp || ((_a2 = store == null ? void 0 : store.panels.item(id)) == null ? void 0 : _a2.tabId); + } + ); + const open = useStoreState( + store, + (state) => !!tabId && state.selectedId === tabId + ); + const disclosure = useDisclosureStore({ open }); + const mounted = useStoreState(disclosure, "mounted"); + const scrollPositionRef = (0,external_React_.useRef)( + /* @__PURE__ */ new Map() + ); + const getScrollElement = useEvent(() => { + const panelElement = ref.current; + if (!panelElement) return null; + if (!scrollElement) return panelElement; + if (typeof scrollElement === "function") { + return scrollElement(panelElement); + } + if ("current" in scrollElement) { + return scrollElement.current; + } + return scrollElement; + }); + (0,external_React_.useEffect)(() => { + var _a2, _b2; + if (!scrollRestoration) return; + if (!mounted) return; + const element = getScrollElement(); + if (!element) return; + if (scrollRestoration === "reset") { + element.scroll(0, 0); + return; + } + if (!tabId) return; + const position = scrollPositionRef.current.get(tabId); + element.scroll((_a2 = position == null ? void 0 : position.x) != null ? _a2 : 0, (_b2 = position == null ? void 0 : position.y) != null ? _b2 : 0); + const onScroll = () => { + scrollPositionRef.current.set(tabId, { + x: element.scrollLeft, + y: element.scrollTop + }); + }; + element.addEventListener("scroll", onScroll); + return () => { + element.removeEventListener("scroll", onScroll); + }; + }, [scrollRestoration, mounted, tabId, getScrollElement, store]); const [hasTabbableChildren, setHasTabbableChildren] = (0,external_React_.useState)(false); (0,external_React_.useEffect)(() => { const element = ref.current; @@ -65215,18 +65920,16 @@ var useTabPanel = createHook( onKeyDownProp == null ? void 0 : onKeyDownProp(event); if (event.defaultPrevented) return; if (!(store == null ? void 0 : store.composite)) return; - const state = store.getState(); - const tab = createTabStore(_3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, state), { activeId: state.selectedId })); - tab.setState("renderedItems", state.renderedItems); const keyMap = { - ArrowLeft: tab.previous, - ArrowRight: tab.next, - Home: tab.first, - End: tab.last + ArrowLeft: store.previous, + ArrowRight: store.next, + Home: store.first, + End: store.last }; const action = keyMap[event.key]; if (!action) return; - const nextId = action(); + const { selectedId } = store.getState(); + const nextId = action({ activeId: selectedId }); if (!nextId) return; event.preventDefault(); store.move(nextId); @@ -65236,17 +65939,6 @@ var useTabPanel = createHook( (element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(TabScopedContextProvider, { value: store, children: element }), [store] ); - const tabId = store.panels.useState( - () => { - var _a2; - return tabIdProp || ((_a2 = store == null ? void 0 : store.panels.item(id)) == null ? void 0 : _a2.tabId); - } - ); - const open = store.useState( - (state) => !!tabId && state.selectedId === tabId - ); - const disclosure = useDisclosureStore({ open }); - const mounted = disclosure.useState("mounted"); props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({ id, role: "tabpanel", @@ -65268,30 +65960,30 @@ var useTabPanel = createHook( ); var TabPanel = forwardRef2(function TabPanel2(props) { const htmlProps = useTabPanel(props); - return HKOOKEDE_createElement(tab_panel_TagName, htmlProps); + return LMDWO4NN_createElement(tab_panel_TagName, htmlProps); }); ;// ./node_modules/@wordpress/components/build-module/tab-panel/index.js +/* wp:polyfill */ /** * External dependencies */ - /** * WordPress dependencies */ + /** * Internal dependencies */ - // Separate the actual tab name from the instance ID. This is // necessary because Ariakit internally uses the element ID when // a new tab is selected, but our implementation looks specifically @@ -65373,7 +66065,8 @@ const UnforwardedTabPanel = ({ }, orientation, selectOnMove, - defaultSelectedId: prependInstanceId(initialTabName) + defaultSelectedId: prependInstanceId(initialTabName), + rtl: (0,external_wp_i18n_namespaceObject.isRTL)() }); const selectedTabName = extractTabName(useStoreState(tabStore, 'selectedId')); const setTabStoreSelectedId = (0,external_wp_element_namespaceObject.useCallback)(tabName => { @@ -65433,7 +66126,7 @@ const UnforwardedTabPanel = ({ return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: className, ref: ref, - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(tab_list_TabList, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TabList, { store: tabStore, className: "components-tab-panel__tabs", children: tabs.map(tab => { @@ -65445,6 +66138,7 @@ const UnforwardedTabPanel = ({ disabled: tab.disabled, "aria-controls": `${prependInstanceId(tab.name)}-view`, render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_button, { + __next40pxDefaultSize: true, icon: tab.icon, label: tab.icon && tab.title, showTooltip: !!tab.icon @@ -65482,6 +66176,7 @@ const tab_panel_TabPanel = (0,external_wp_element_namespaceObject.forwardRef)(Un */ + function UnforwardedTextControl(props, ref) { const { __nextHasNoMarginBottom, @@ -65498,6 +66193,11 @@ function UnforwardedTextControl(props, ref) { } = props; const id = (0,external_wp_compose_namespaceObject.useInstanceId)(TextControl, 'inspector-text-control', idProp); const onChangeValue = event => onChange(event.target.value); + maybeWarnDeprecated36pxSize({ + componentName: 'TextControl', + size: undefined, + __next40pxDefaultSize + }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(base_control, { __nextHasNoMarginBottom: __nextHasNoMarginBottom, __associatedWPComponentName: "TextControl", @@ -65534,6 +66234,7 @@ function UnforwardedTextControl(props, ref) { * return ( * setClassName( value ) } @@ -65679,7 +66380,6 @@ const TextareaControl = (0,external_wp_element_namespaceObject.forwardRef)(Unfor */ - /** * Highlights occurrences of a given string within another string of text. Wraps * each match with a `` tag which provides browser default styling. @@ -65738,7 +66438,6 @@ const tip = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(extern * Internal dependencies */ - function Tip(props) { const { children @@ -65779,7 +66478,6 @@ function Tip(props) { - function UnforwardedToggleControl({ __nextHasNoMarginBottom, label, @@ -65875,25 +66573,25 @@ function UnforwardedToggleControl({ const ToggleControl = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedToggleControl); /* harmony default export */ const toggle_control = (ToggleControl); -;// ./node_modules/@ariakit/react-core/esm/__chunks/IIER4YBF.js +;// ./node_modules/@ariakit/react-core/esm/__chunks/A3WPL2ZJ.js "use client"; // src/toolbar/toolbar-context.tsx -var IIER4YBF_ctx = createStoreContext( +var A3WPL2ZJ_ctx = createStoreContext( [CompositeContextProvider], [CompositeScopedContextProvider] ); -var useToolbarContext = IIER4YBF_ctx.useContext; -var useToolbarScopedContext = IIER4YBF_ctx.useScopedContext; -var useToolbarProviderContext = IIER4YBF_ctx.useProviderContext; -var ToolbarContextProvider = IIER4YBF_ctx.ContextProvider; -var ToolbarScopedContextProvider = IIER4YBF_ctx.ScopedContextProvider; +var useToolbarContext = A3WPL2ZJ_ctx.useContext; +var useToolbarScopedContext = A3WPL2ZJ_ctx.useScopedContext; +var useToolbarProviderContext = A3WPL2ZJ_ctx.useProviderContext; +var ToolbarContextProvider = A3WPL2ZJ_ctx.ContextProvider; +var ToolbarScopedContextProvider = A3WPL2ZJ_ctx.ScopedContextProvider; -;// ./node_modules/@ariakit/react-core/esm/__chunks/IE4UOD3X.js +;// ./node_modules/@ariakit/react-core/esm/__chunks/BOLVLGVE.js "use client"; @@ -65901,7 +66599,7 @@ var ToolbarScopedContextProvider = IIER4YBF_ctx.ScopedContextProvider; // src/toolbar/toolbar-item.tsx -var IE4UOD3X_TagName = "button"; +var BOLVLGVE_TagName = "button"; var useToolbarItem = createHook( function useToolbarItem2(_a) { var _b = _a, { store } = _b, props = __objRest(_b, ["store"]); @@ -65914,7 +66612,7 @@ var useToolbarItem = createHook( var ToolbarItem = memo2( forwardRef2(function ToolbarItem2(props) { const htmlProps = useToolbarItem(props); - return HKOOKEDE_createElement(IE4UOD3X_TagName, htmlProps); + return LMDWO4NN_createElement(BOLVLGVE_TagName, htmlProps); }) ); @@ -66047,6 +66745,7 @@ function UnforwardedToolbarButton(props, ref) { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_button, { ref: ref, icon: restProps.icon, + size: "compact", label: title, shortcut: restProps.shortcut, "data-subscript": restProps.subscript, @@ -66077,6 +66776,7 @@ function UnforwardedToolbarButton(props, ref) { ...restProps, ref: ref, children: toolbarItemProps => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_button, { + size: "compact", label: title, isPressed: isActive, ...toolbarItemProps, @@ -66166,6 +66866,7 @@ function ToolbarGroupCollapsed({ /* harmony default export */ const toolbar_group_collapsed = (ToolbarGroupCollapsed); ;// ./node_modules/@wordpress/components/build-module/toolbar/toolbar-group/index.js +/* wp:polyfill */ /** * External dependencies */ @@ -66184,7 +66885,6 @@ function ToolbarGroupCollapsed({ - function isNestedArray(arr) { return Array.isArray(arr) && Array.isArray(arr[0]); } @@ -66290,7 +66990,7 @@ function createToolbarStore(props = {}) { } -;// ./node_modules/@ariakit/react-core/esm/__chunks/GO2SPXQX.js +;// ./node_modules/@ariakit/react-core/esm/__chunks/7M5THDKH.js "use client"; @@ -66301,7 +67001,7 @@ function useToolbarStoreProps(store, update, props) { return useCompositeStoreProps(store, update, props); } function useToolbarStore(props = {}) { - const [store, update] = _2GXGCHW6_useStore(createToolbarStore, props); + const [store, update] = YV4JVR4I_useStore(createToolbarStore, props); return useToolbarStoreProps(store, update, props); } @@ -66370,7 +67070,7 @@ var useToolbar = createHook( ); var Toolbar = forwardRef2(function Toolbar2(props) { const htmlProps = useToolbar(props); - return HKOOKEDE_createElement(toolbar_TagName, htmlProps); + return LMDWO4NN_createElement(toolbar_TagName, htmlProps); }); @@ -66450,6 +67150,9 @@ function UnforwardedToolbar({ }, Dropdown: { variant: 'toolbar' + }, + Menu: { + variant: 'toolbar' } }; }, [isVariantDefined]); @@ -66689,6 +67392,7 @@ function useToolsPanelHeader(props) { } ;// ./node_modules/@wordpress/components/build-module/tools-panel/tools-panel-header/component.js +/* wp:polyfill */ /** * External dependencies */ @@ -66712,8 +67416,6 @@ function useToolsPanelHeader(props) { - - const DefaultControlsGroup = ({ itemClassName, items, @@ -66872,6 +67574,7 @@ const ConnectedToolsPanelHeader = contextConnect(component_ToolsPanelHeader, 'To /* harmony default export */ const tools_panel_header_component = (ConnectedToolsPanelHeader); ;// ./node_modules/@wordpress/components/build-module/tools-panel/tools-panel/hook.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -67228,7 +67931,6 @@ function useToolsPanel(props) { - const UnconnectedToolsPanel = (props, forwardedRef) => { const { children, @@ -67287,6 +67989,7 @@ const UnconnectedToolsPanel = (props, forwardedRef) => { * onDeselect={ () => setHeight() } * > * { * onDeselect={ () => setWidth() } * > * (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(WrappedComponent => { return class extends external_wp_element_namespaceObject.Component { constructor(props) { @@ -68368,6 +69075,7 @@ const withConstrainedTabbing = (0,external_wp_compose_namespaceObject.createHigh ;// external ["wp","hooks"] const external_wp_hooks_namespaceObject = window["wp"]["hooks"]; ;// ./node_modules/@wordpress/components/build-module/higher-order/with-filters/index.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -68528,7 +69236,7 @@ function isComponentLike(object) { * describing the component and the * focus return characteristics. * - * @return Higher Order Component with the focus restauration behaviour. + * @return Higher Order Component with the focus restoration behaviour. */ /* harmony default export */ const with_focus_return = ((0,external_wp_compose_namespaceObject.createHigherOrderComponent)( // @ts-expect-error TODO: Reconcile with intended `createHigherOrderComponent` types @@ -68564,6 +69272,7 @@ const with_focus_return_Provider = ({ }; ;// ./node_modules/@wordpress/components/build-module/higher-order/with-notices/index.js +/* wp:polyfill */ /** * External dependencies */ @@ -68667,7 +69376,7 @@ const with_focus_return_Provider = ({ return Component; }, 'withNotices')); -;// ./node_modules/@ariakit/react-core/esm/__chunks/LG4RFBHV.js +;// ./node_modules/@ariakit/react-core/esm/__chunks/B2J376ND.js "use client"; @@ -68676,15 +69385,15 @@ const with_focus_return_Provider = ({ // src/menu/menu-context.tsx -var LG4RFBHV_menu = createStoreContext( +var B2J376ND_menu = createStoreContext( [CompositeContextProvider, HovercardContextProvider], [CompositeScopedContextProvider, HovercardScopedContextProvider] ); -var useMenuContext = LG4RFBHV_menu.useContext; -var useMenuScopedContext = LG4RFBHV_menu.useScopedContext; -var useMenuProviderContext = LG4RFBHV_menu.useProviderContext; -var MenuContextProvider = LG4RFBHV_menu.ContextProvider; -var MenuScopedContextProvider = LG4RFBHV_menu.ScopedContextProvider; +var useMenuContext = B2J376ND_menu.useContext; +var useMenuScopedContext = B2J376ND_menu.useScopedContext; +var useMenuProviderContext = B2J376ND_menu.useProviderContext; +var MenuContextProvider = B2J376ND_menu.ContextProvider; +var MenuScopedContextProvider = B2J376ND_menu.ScopedContextProvider; var useMenuBarContext = (/* unused pure expression or super */ null && (useMenubarContext)); var useMenuBarScopedContext = (/* unused pure expression or super */ null && (useMenubarScopedContext)); var useMenuBarProviderContext = (/* unused pure expression or super */ null && (useMenubarProviderContext)); @@ -68696,7 +69405,7 @@ var MenuItemCheckedContext = (0,external_React_.createContext)( -;// ./node_modules/@ariakit/react-core/esm/__chunks/WSQNIDGC.js +;// ./node_modules/@ariakit/react-core/esm/__chunks/62UHHO2X.js "use client"; @@ -68707,12 +69416,12 @@ var menubar = createStoreContext( [CompositeContextProvider], [CompositeScopedContextProvider] ); -var WSQNIDGC_useMenubarContext = menubar.useContext; -var WSQNIDGC_useMenubarScopedContext = menubar.useScopedContext; -var WSQNIDGC_useMenubarProviderContext = menubar.useProviderContext; -var WSQNIDGC_MenubarContextProvider = menubar.ContextProvider; -var WSQNIDGC_MenubarScopedContextProvider = menubar.ScopedContextProvider; -var WSQNIDGC_MenuItemCheckedContext = (0,external_React_.createContext)( +var _62UHHO2X_useMenubarContext = menubar.useContext; +var _62UHHO2X_useMenubarScopedContext = menubar.useScopedContext; +var _62UHHO2X_useMenubarProviderContext = menubar.useProviderContext; +var _62UHHO2X_MenubarContextProvider = menubar.ContextProvider; +var _62UHHO2X_MenubarScopedContextProvider = menubar.ScopedContextProvider; +var _62UHHO2X_MenuItemCheckedContext = (0,external_React_.createContext)( void 0 ); @@ -68832,7 +69541,7 @@ function createMenuStore(_a = {}) { } -;// ./node_modules/@ariakit/react-core/esm/__chunks/MS4VD4RJ.js +;// ./node_modules/@ariakit/react-core/esm/__chunks/MRTXKBQF.js "use client"; @@ -68863,19 +69572,1160 @@ function useMenuStoreProps(store, update, props) { } function useMenuStore(props = {}) { const parent = useMenuContext(); - const menubar = WSQNIDGC_useMenubarContext(); + const menubar = _62UHHO2X_useMenubarContext(); const combobox = useComboboxProviderContext(); props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), { parent: props.parent !== void 0 ? props.parent : parent, menubar: props.menubar !== void 0 ? props.menubar : menubar, combobox: props.combobox !== void 0 ? props.combobox : combobox }); - const [store, update] = _2GXGCHW6_useStore(createMenuStore, props); + const [store, update] = YV4JVR4I_useStore(createMenuStore, props); return useMenuStoreProps(store, update, props); } +;// ./node_modules/@wordpress/components/build-module/menu/context.js +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + +const context_Context = (0,external_wp_element_namespaceObject.createContext)(undefined); + +;// ./node_modules/@ariakit/react-core/esm/__chunks/MVIULMNR.js +"use client"; + + + + + + + + + +// src/menu/menu-item.tsx + + + + +var MVIULMNR_TagName = "div"; +function menuHasFocus(baseElement, items, currentTarget) { + var _a; + if (!baseElement) return false; + if (hasFocusWithin(baseElement)) return true; + const expandedItem = items == null ? void 0 : items.find((item) => { + var _a2; + if (item.element === currentTarget) return false; + return ((_a2 = item.element) == null ? void 0 : _a2.getAttribute("aria-expanded")) === "true"; + }); + const expandedMenuId = (_a = expandedItem == null ? void 0 : expandedItem.element) == null ? void 0 : _a.getAttribute("aria-controls"); + if (!expandedMenuId) return false; + const doc = getDocument(baseElement); + const expandedMenu = doc.getElementById(expandedMenuId); + if (!expandedMenu) return false; + if (hasFocusWithin(expandedMenu)) return true; + return !!expandedMenu.querySelector("[role=menuitem][aria-expanded=true]"); +} +var useMenuItem = createHook( + function useMenuItem2(_a) { + var _b = _a, { + store, + hideOnClick = true, + preventScrollOnKeyDown = true, + focusOnHover, + blurOnHoverEnd + } = _b, props = __objRest(_b, [ + "store", + "hideOnClick", + "preventScrollOnKeyDown", + "focusOnHover", + "blurOnHoverEnd" + ]); + const menuContext = useMenuScopedContext(true); + const menubarContext = _62UHHO2X_useMenubarScopedContext(); + store = store || menuContext || menubarContext; + invariant( + store, + false && 0 + ); + const onClickProp = props.onClick; + const hideOnClickProp = useBooleanEvent(hideOnClick); + const hideMenu = "hideAll" in store ? store.hideAll : void 0; + const isWithinMenu = !!hideMenu; + const onClick = useEvent((event) => { + onClickProp == null ? void 0 : onClickProp(event); + if (event.defaultPrevented) return; + if (isDownloading(event)) return; + if (isOpeningInNewTab(event)) return; + if (!hideMenu) return; + const popupType = event.currentTarget.getAttribute("aria-haspopup"); + if (popupType === "menu") return; + if (!hideOnClickProp(event)) return; + hideMenu(); + }); + const contentElement = useStoreState( + store, + (state) => "contentElement" in state ? state.contentElement : null + ); + const role = getPopupItemRole(contentElement, "menuitem"); + props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({ + role + }, props), { + onClick + }); + props = useCompositeItem(_3YLGPPWQ_spreadValues({ + store, + preventScrollOnKeyDown + }, props)); + props = useCompositeHover(_3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({ + store + }, props), { + focusOnHover(event) { + const getFocusOnHover = () => { + if (typeof focusOnHover === "function") return focusOnHover(event); + if (focusOnHover != null) return focusOnHover; + return true; + }; + if (!store) return false; + if (!getFocusOnHover()) return false; + const { baseElement, items } = store.getState(); + if (isWithinMenu) { + if (event.currentTarget.hasAttribute("aria-expanded")) { + event.currentTarget.focus(); + } + return true; + } + if (menuHasFocus(baseElement, items, event.currentTarget)) { + event.currentTarget.focus(); + return true; + } + return false; + }, + blurOnHoverEnd(event) { + if (typeof blurOnHoverEnd === "function") return blurOnHoverEnd(event); + if (blurOnHoverEnd != null) return blurOnHoverEnd; + return isWithinMenu; + } + })); + return props; + } +); +var MVIULMNR_MenuItem = memo2( + forwardRef2(function MenuItem2(props) { + const htmlProps = useMenuItem(props); + return LMDWO4NN_createElement(MVIULMNR_TagName, htmlProps); + }) +); + + + +;// ./node_modules/@ariakit/react-core/esm/__chunks/RNCDFVMF.js +"use client"; + + +// src/checkbox/checkbox-context.tsx +var RNCDFVMF_ctx = createStoreContext(); +var useCheckboxContext = RNCDFVMF_ctx.useContext; +var useCheckboxScopedContext = RNCDFVMF_ctx.useScopedContext; +var useCheckboxProviderContext = RNCDFVMF_ctx.useProviderContext; +var CheckboxContextProvider = RNCDFVMF_ctx.ContextProvider; +var CheckboxScopedContextProvider = RNCDFVMF_ctx.ScopedContextProvider; + + + +;// ./node_modules/@ariakit/react-core/esm/__chunks/ASMQKSDT.js +"use client"; + + + + + + + + +// src/checkbox/checkbox.tsx + + + +var ASMQKSDT_TagName = "input"; +function setMixed(element, mixed) { + if (mixed) { + element.indeterminate = true; + } else if (element.indeterminate) { + element.indeterminate = false; + } +} +function isNativeCheckbox(tagName, type) { + return tagName === "input" && (!type || type === "checkbox"); +} +function getPrimitiveValue(value) { + if (Array.isArray(value)) { + return value.toString(); + } + return value; +} +var useCheckbox = createHook( + function useCheckbox2(_a) { + var _b = _a, { + store, + name, + value: valueProp, + checked: checkedProp, + defaultChecked + } = _b, props = __objRest(_b, [ + "store", + "name", + "value", + "checked", + "defaultChecked" + ]); + const context = useCheckboxContext(); + store = store || context; + const [_checked, setChecked] = (0,external_React_.useState)(defaultChecked != null ? defaultChecked : false); + const checked = useStoreState(store, (state) => { + if (checkedProp !== void 0) return checkedProp; + if ((state == null ? void 0 : state.value) === void 0) return _checked; + if (valueProp != null) { + if (Array.isArray(state.value)) { + const primitiveValue = getPrimitiveValue(valueProp); + return state.value.includes(primitiveValue); + } + return state.value === valueProp; + } + if (Array.isArray(state.value)) return false; + if (typeof state.value === "boolean") return state.value; + return false; + }); + const ref = (0,external_React_.useRef)(null); + const tagName = useTagName(ref, ASMQKSDT_TagName); + const nativeCheckbox = isNativeCheckbox(tagName, props.type); + const mixed = checked ? checked === "mixed" : void 0; + const isChecked = checked === "mixed" ? false : checked; + const disabled = disabledFromProps(props); + const [propertyUpdated, schedulePropertyUpdate] = useForceUpdate(); + (0,external_React_.useEffect)(() => { + const element = ref.current; + if (!element) return; + setMixed(element, mixed); + if (nativeCheckbox) return; + element.checked = isChecked; + if (name !== void 0) { + element.name = name; + } + if (valueProp !== void 0) { + element.value = `${valueProp}`; + } + }, [propertyUpdated, mixed, nativeCheckbox, isChecked, name, valueProp]); + const onChangeProp = props.onChange; + const onChange = useEvent((event) => { + if (disabled) { + event.stopPropagation(); + event.preventDefault(); + return; + } + setMixed(event.currentTarget, mixed); + if (!nativeCheckbox) { + event.currentTarget.checked = !event.currentTarget.checked; + schedulePropertyUpdate(); + } + onChangeProp == null ? void 0 : onChangeProp(event); + if (event.defaultPrevented) return; + const elementChecked = event.currentTarget.checked; + setChecked(elementChecked); + store == null ? void 0 : store.setValue((prevValue) => { + if (valueProp == null) return elementChecked; + const primitiveValue = getPrimitiveValue(valueProp); + if (!Array.isArray(prevValue)) { + return prevValue === primitiveValue ? false : primitiveValue; + } + if (elementChecked) { + if (prevValue.includes(primitiveValue)) { + return prevValue; + } + return [...prevValue, primitiveValue]; + } + return prevValue.filter((v) => v !== primitiveValue); + }); + }); + const onClickProp = props.onClick; + const onClick = useEvent((event) => { + onClickProp == null ? void 0 : onClickProp(event); + if (event.defaultPrevented) return; + if (nativeCheckbox) return; + onChange(event); + }); + props = useWrapElement( + props, + (element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CheckboxCheckedContext.Provider, { value: isChecked, children: element }), + [isChecked] + ); + props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({ + role: !nativeCheckbox ? "checkbox" : void 0, + type: nativeCheckbox ? "checkbox" : void 0, + "aria-checked": checked + }, props), { + ref: useMergeRefs(ref, props.ref), + onChange, + onClick + }); + props = useCommand(_3YLGPPWQ_spreadValues({ clickOnEnter: !nativeCheckbox }, props)); + return removeUndefinedValues(_3YLGPPWQ_spreadValues({ + name: nativeCheckbox ? name : void 0, + value: nativeCheckbox ? valueProp : void 0, + checked: isChecked + }, props)); + } +); +var Checkbox = forwardRef2(function Checkbox2(props) { + const htmlProps = useCheckbox(props); + return LMDWO4NN_createElement(ASMQKSDT_TagName, htmlProps); +}); + + + +;// ./node_modules/@ariakit/core/esm/checkbox/checkbox-store.js +"use client"; + + + + +// src/checkbox/checkbox-store.ts +function createCheckboxStore(props = {}) { + var _a; + throwOnConflictingProps(props, props.store); + const syncState = (_a = props.store) == null ? void 0 : _a.getState(); + const initialState = { + value: defaultValue( + props.value, + syncState == null ? void 0 : syncState.value, + props.defaultValue, + false + ) + }; + const checkbox = createStore(initialState, props.store); + return _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, checkbox), { + setValue: (value) => checkbox.setState("value", value) + }); +} + + +;// ./node_modules/@ariakit/react-core/esm/__chunks/HAVBGUA3.js +"use client"; + + + +// src/checkbox/checkbox-store.ts + +function useCheckboxStoreProps(store, update, props) { + useUpdateEffect(update, [props.store]); + useStoreProps(store, props, "value", "setValue"); + return store; +} +function useCheckboxStore(props = {}) { + const [store, update] = YV4JVR4I_useStore(createCheckboxStore, props); + return useCheckboxStoreProps(store, update, props); +} + + + +;// ./node_modules/@ariakit/react-core/esm/menu/menu-item-checkbox.js +"use client"; + + + + + + + + + + + + + + + + + + + + + + + + + + +// src/menu/menu-item-checkbox.tsx + + +var menu_item_checkbox_TagName = "div"; +function menu_item_checkbox_getPrimitiveValue(value) { + if (Array.isArray(value)) { + return value.toString(); + } + return value; +} +function getValue(storeValue, value, checked) { + if (value === void 0) { + if (Array.isArray(storeValue)) return storeValue; + return !!checked; + } + const primitiveValue = menu_item_checkbox_getPrimitiveValue(value); + if (!Array.isArray(storeValue)) { + if (checked) { + return primitiveValue; + } + return storeValue === primitiveValue ? false : storeValue; + } + if (checked) { + if (storeValue.includes(primitiveValue)) { + return storeValue; + } + return [...storeValue, primitiveValue]; + } + return storeValue.filter((v) => v !== primitiveValue); +} +var useMenuItemCheckbox = createHook( + function useMenuItemCheckbox2(_a) { + var _b = _a, { + store, + name, + value, + checked, + defaultChecked: defaultCheckedProp, + hideOnClick = false + } = _b, props = __objRest(_b, [ + "store", + "name", + "value", + "checked", + "defaultChecked", + "hideOnClick" + ]); + const context = useMenuScopedContext(); + store = store || context; + invariant( + store, + false && 0 + ); + const defaultChecked = useInitialValue(defaultCheckedProp); + (0,external_React_.useEffect)(() => { + store == null ? void 0 : store.setValue(name, (prevValue = []) => { + if (!defaultChecked) return prevValue; + return getValue(prevValue, value, true); + }); + }, [store, name, value, defaultChecked]); + (0,external_React_.useEffect)(() => { + if (checked === void 0) return; + store == null ? void 0 : store.setValue(name, (prevValue) => { + return getValue(prevValue, value, checked); + }); + }, [store, name, value, checked]); + const checkboxStore = useCheckboxStore({ + value: store.useState((state) => state.values[name]), + setValue(internalValue) { + store == null ? void 0 : store.setValue(name, () => { + if (checked === void 0) return internalValue; + const nextValue = getValue(internalValue, value, checked); + if (!Array.isArray(nextValue)) return nextValue; + if (!Array.isArray(internalValue)) return nextValue; + if (shallowEqual(internalValue, nextValue)) return internalValue; + return nextValue; + }); + } + }); + props = _3YLGPPWQ_spreadValues({ + role: "menuitemcheckbox" + }, props); + props = useCheckbox(_3YLGPPWQ_spreadValues({ + store: checkboxStore, + name, + value, + checked + }, props)); + props = useMenuItem(_3YLGPPWQ_spreadValues({ store, hideOnClick }, props)); + return props; + } +); +var MenuItemCheckbox = memo2( + forwardRef2(function MenuItemCheckbox2(props) { + const htmlProps = useMenuItemCheckbox(props); + return LMDWO4NN_createElement(menu_item_checkbox_TagName, htmlProps); + }) +); + + +;// ./node_modules/@ariakit/react-core/esm/menu/menu-item-radio.js +"use client"; + + + + + + + + + + + + + + + + + + + + + + + + +// src/menu/menu-item-radio.tsx + + + +var menu_item_radio_TagName = "div"; +function menu_item_radio_getValue(prevValue, value, checked) { + if (checked === void 0) return prevValue; + if (checked) return value; + return prevValue; +} +var useMenuItemRadio = createHook( + function useMenuItemRadio2(_a) { + var _b = _a, { + store, + name, + value, + checked, + onChange: onChangeProp, + hideOnClick = false + } = _b, props = __objRest(_b, [ + "store", + "name", + "value", + "checked", + "onChange", + "hideOnClick" + ]); + const context = useMenuScopedContext(); + store = store || context; + invariant( + store, + false && 0 + ); + const defaultChecked = useInitialValue(props.defaultChecked); + (0,external_React_.useEffect)(() => { + store == null ? void 0 : store.setValue(name, (prevValue = false) => { + return menu_item_radio_getValue(prevValue, value, defaultChecked); + }); + }, [store, name, value, defaultChecked]); + (0,external_React_.useEffect)(() => { + if (checked === void 0) return; + store == null ? void 0 : store.setValue(name, (prevValue) => { + return menu_item_radio_getValue(prevValue, value, checked); + }); + }, [store, name, value, checked]); + const isChecked = store.useState((state) => state.values[name] === value); + props = useWrapElement( + props, + (element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(MenuItemCheckedContext.Provider, { value: !!isChecked, children: element }), + [isChecked] + ); + props = _3YLGPPWQ_spreadValues({ + role: "menuitemradio" + }, props); + props = useRadio(_3YLGPPWQ_spreadValues({ + name, + value, + checked: isChecked, + onChange(event) { + onChangeProp == null ? void 0 : onChangeProp(event); + if (event.defaultPrevented) return; + const element = event.currentTarget; + store == null ? void 0 : store.setValue(name, (prevValue) => { + return menu_item_radio_getValue(prevValue, value, checked != null ? checked : element.checked); + }); + } + }, props)); + props = useMenuItem(_3YLGPPWQ_spreadValues({ store, hideOnClick }, props)); + return props; + } +); +var MenuItemRadio = memo2( + forwardRef2(function MenuItemRadio2(props) { + const htmlProps = useMenuItemRadio(props); + return LMDWO4NN_createElement(menu_item_radio_TagName, htmlProps); + }) +); + + +;// ./node_modules/@ariakit/react-core/esm/menu/menu-group.js +"use client"; + + + + + + + + +// src/menu/menu-group.tsx +var menu_group_TagName = "div"; +var useMenuGroup = createHook( + function useMenuGroup2(props) { + props = useCompositeGroup(props); + return props; + } +); +var menu_group_MenuGroup = forwardRef2(function MenuGroup2(props) { + const htmlProps = useMenuGroup(props); + return LMDWO4NN_createElement(menu_group_TagName, htmlProps); +}); + + +;// ./node_modules/@ariakit/react-core/esm/menu/menu-group-label.js +"use client"; + + + + + + + + +// src/menu/menu-group-label.tsx +var menu_group_label_TagName = "div"; +var useMenuGroupLabel = createHook( + function useMenuGroupLabel2(props) { + props = useCompositeGroupLabel(props); + return props; + } +); +var MenuGroupLabel = forwardRef2(function MenuGroupLabel2(props) { + const htmlProps = useMenuGroupLabel(props); + return LMDWO4NN_createElement(menu_group_label_TagName, htmlProps); +}); + + +;// ./node_modules/@ariakit/react-core/esm/__chunks/TP7N7UIH.js +"use client"; + + + + + +// src/composite/composite-separator.tsx + +var TP7N7UIH_TagName = "hr"; +var useCompositeSeparator = createHook(function useCompositeSeparator2(_a) { + var _b = _a, { store } = _b, props = __objRest(_b, ["store"]); + const context = useCompositeContext(); + store = store || context; + invariant( + store, + false && 0 + ); + const orientation = store.useState( + (state) => state.orientation === "horizontal" ? "vertical" : "horizontal" + ); + props = useSeparator(_3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), { orientation })); + return props; +}); +var CompositeSeparator = forwardRef2(function CompositeSeparator2(props) { + const htmlProps = useCompositeSeparator(props); + return LMDWO4NN_createElement(TP7N7UIH_TagName, htmlProps); +}); + + + +;// ./node_modules/@ariakit/react-core/esm/menu/menu-separator.js +"use client"; + + + + + + + + + + + + + + + +// src/menu/menu-separator.tsx +var menu_separator_TagName = "hr"; +var useMenuSeparator = createHook( + function useMenuSeparator2(_a) { + var _b = _a, { store } = _b, props = __objRest(_b, ["store"]); + const context = useMenuContext(); + store = store || context; + props = useCompositeSeparator(_3YLGPPWQ_spreadValues({ store }, props)); + return props; + } +); +var MenuSeparator = forwardRef2(function MenuSeparator2(props) { + const htmlProps = useMenuSeparator(props); + return LMDWO4NN_createElement(menu_separator_TagName, htmlProps); +}); + + +;// ./node_modules/@wordpress/components/build-module/menu/styles.js + +function menu_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } +/** + * External dependencies + */ + + +/** + * Internal dependencies + */ + + + + +const styles_ANIMATION_PARAMS = { + SCALE_AMOUNT_OUTER: 0.82, + SCALE_AMOUNT_CONTENT: 0.9, + DURATION: { + IN: '400ms', + OUT: '200ms' + }, + EASING: 'cubic-bezier(0.33, 0, 0, 1)' +}; +const CONTENT_WRAPPER_PADDING = space(1); +const ITEM_PADDING_BLOCK = space(2); +const ITEM_PADDING_INLINE = space(3); + +// TODO: +// - border color and divider color are different from COLORS.theme variables +// - lighter text color is not defined in COLORS.theme, should it be? +// - lighter background color is not defined in COLORS.theme, should it be? +const DEFAULT_BORDER_COLOR = COLORS.theme.gray[300]; +const DIVIDER_COLOR = COLORS.theme.gray[200]; +const LIGHTER_TEXT_COLOR = COLORS.theme.gray[700]; +const LIGHT_BACKGROUND_COLOR = COLORS.theme.gray[100]; +const TOOLBAR_VARIANT_BORDER_COLOR = COLORS.theme.foreground; +const DEFAULT_BOX_SHADOW = `0 0 0 ${config_values.borderWidth} ${DEFAULT_BORDER_COLOR}, ${config_values.elevationMedium}`; +const TOOLBAR_VARIANT_BOX_SHADOW = `0 0 0 ${config_values.borderWidth} ${TOOLBAR_VARIANT_BORDER_COLOR}`; +const GRID_TEMPLATE_COLS = 'minmax( 0, max-content ) 1fr'; +const PopoverOuterWrapper = /*#__PURE__*/emotion_styled_base_browser_esm("div", true ? { + target: "e1wg7tti14" +} : 0)("position:relative;background-color:", COLORS.ui.background, ";border-radius:", config_values.radiusMedium, ";", props => /*#__PURE__*/emotion_react_browser_esm_css("box-shadow:", props.variant === 'toolbar' ? TOOLBAR_VARIANT_BOX_SHADOW : DEFAULT_BOX_SHADOW, ";" + ( true ? "" : 0), true ? "" : 0), " overflow:hidden;@media not ( prefers-reduced-motion ){transition-property:transform,opacity;transition-timing-function:", styles_ANIMATION_PARAMS.EASING, ";transition-duration:", styles_ANIMATION_PARAMS.DURATION.IN, ";will-change:transform,opacity;opacity:0;&:has( [data-enter] ){opacity:1;}&:has( [data-leave] ){transition-duration:", styles_ANIMATION_PARAMS.DURATION.OUT, ";}&:has( [data-side='bottom'] ),&:has( [data-side='top'] ){transform:scaleY( ", styles_ANIMATION_PARAMS.SCALE_AMOUNT_OUTER, " );}&:has( [data-side='bottom'] ){transform-origin:top;}&:has( [data-side='top'] ){transform-origin:bottom;}&:has( [data-enter][data-side='bottom'] ),&:has( [data-enter][data-side='top'] ),&:has( [data-leave][data-side='bottom'] ),&:has( [data-leave][data-side='top'] ){transform:scaleY( 1 );}}" + ( true ? "" : 0)); +const PopoverInnerWrapper = /*#__PURE__*/emotion_styled_base_browser_esm("div", true ? { + target: "e1wg7tti13" +} : 0)("position:relative;z-index:1000000;display:grid;grid-template-columns:", GRID_TEMPLATE_COLS, ";grid-template-rows:auto;box-sizing:border-box;min-width:160px;max-width:320px;max-height:var( --popover-available-height );padding:", CONTENT_WRAPPER_PADDING, ";overscroll-behavior:contain;overflow:auto;outline:2px solid transparent!important;@media not ( prefers-reduced-motion ){transition:inherit;transform-origin:inherit;&[data-side='bottom'],&[data-side='top']{transform:scaleY(\n\t\t\t\tcalc(\n\t\t\t\t\t1 / ", styles_ANIMATION_PARAMS.SCALE_AMOUNT_OUTER, " *\n\t\t\t\t\t\t", styles_ANIMATION_PARAMS.SCALE_AMOUNT_CONTENT, "\n\t\t\t\t)\n\t\t\t);}&[data-enter][data-side='bottom'],&[data-enter][data-side='top'],&[data-leave][data-side='bottom'],&[data-leave][data-side='top']{transform:scaleY( 1 );}}" + ( true ? "" : 0)); +const baseItem = /*#__PURE__*/emotion_react_browser_esm_css("all:unset;position:relative;min-height:", space(10), ";box-sizing:border-box;grid-column:1/-1;display:grid;grid-template-columns:", GRID_TEMPLATE_COLS, ";align-items:center;@supports ( grid-template-columns: subgrid ){grid-template-columns:subgrid;}font-size:", font('default.fontSize'), ";font-family:inherit;font-weight:normal;line-height:20px;color:", COLORS.theme.foreground, ";border-radius:", config_values.radiusSmall, ";padding-block:", ITEM_PADDING_BLOCK, ";padding-inline:", ITEM_PADDING_INLINE, ";scroll-margin:", CONTENT_WRAPPER_PADDING, ";user-select:none;outline:none;&[aria-disabled='true']{color:", COLORS.ui.textDisabled, ";cursor:not-allowed;}&[data-active-item]:not( [data-focus-visible] ):not(\n\t\t\t[aria-disabled='true']\n\t\t){background-color:", COLORS.theme.accent, ";color:", COLORS.theme.accentInverted, ";}&[data-focus-visible]{box-shadow:0 0 0 1.5px ", COLORS.theme.accent, ";outline:2px solid transparent;}&:active,&[data-active]{}", PopoverInnerWrapper, ":not(:focus) &:not(:focus)[aria-expanded=\"true\"]{background-color:", LIGHT_BACKGROUND_COLOR, ";color:", COLORS.theme.foreground, ";}svg{fill:currentColor;}" + ( true ? "" : 0), true ? "" : 0); +const styles_Item = /*#__PURE__*/emotion_styled_base_browser_esm(MVIULMNR_MenuItem, true ? { + target: "e1wg7tti12" +} : 0)(baseItem, ";" + ( true ? "" : 0)); +const styles_CheckboxItem = /*#__PURE__*/emotion_styled_base_browser_esm(MenuItemCheckbox, true ? { + target: "e1wg7tti11" +} : 0)(baseItem, ";" + ( true ? "" : 0)); +const styles_RadioItem = /*#__PURE__*/emotion_styled_base_browser_esm(MenuItemRadio, true ? { + target: "e1wg7tti10" +} : 0)(baseItem, ";" + ( true ? "" : 0)); +const ItemPrefixWrapper = /*#__PURE__*/emotion_styled_base_browser_esm("span", true ? { + target: "e1wg7tti9" +} : 0)("grid-column:1;", styles_CheckboxItem, ">&,", styles_RadioItem, ">&{min-width:", space(6), ";}", styles_CheckboxItem, ">&,", styles_RadioItem, ">&,&:not( :empty ){margin-inline-end:", space(2), ";}display:flex;align-items:center;justify-content:center;color:", LIGHTER_TEXT_COLOR, ";[data-active-item]:not( [data-focus-visible] )>&,[aria-disabled='true']>&{color:inherit;}" + ( true ? "" : 0)); +const ItemContentWrapper = /*#__PURE__*/emotion_styled_base_browser_esm("div", true ? { + target: "e1wg7tti8" +} : 0)("grid-column:2;display:flex;align-items:center;justify-content:space-between;gap:", space(3), ";pointer-events:none;" + ( true ? "" : 0)); +const ItemChildrenWrapper = /*#__PURE__*/emotion_styled_base_browser_esm("div", true ? { + target: "e1wg7tti7" +} : 0)("flex:1;display:inline-flex;flex-direction:column;gap:", space(1), ";" + ( true ? "" : 0)); +const ItemSuffixWrapper = /*#__PURE__*/emotion_styled_base_browser_esm("span", true ? { + target: "e1wg7tti6" +} : 0)("flex:0 1 fit-content;min-width:0;width:fit-content;display:flex;align-items:center;justify-content:center;gap:", space(3), ";color:", LIGHTER_TEXT_COLOR, ";[data-active-item]:not( [data-focus-visible] ) *:not(", PopoverInnerWrapper, ") &,[aria-disabled='true'] *:not(", PopoverInnerWrapper, ") &{color:inherit;}" + ( true ? "" : 0)); +const styles_Group = /*#__PURE__*/emotion_styled_base_browser_esm(menu_group_MenuGroup, true ? { + target: "e1wg7tti5" +} : 0)( true ? { + name: "49aokf", + styles: "display:contents" +} : 0); +const styles_GroupLabel = /*#__PURE__*/emotion_styled_base_browser_esm(MenuGroupLabel, true ? { + target: "e1wg7tti4" +} : 0)("grid-column:1/-1;padding-block-start:", space(3), ";padding-block-end:", space(2), ";padding-inline:", ITEM_PADDING_INLINE, ";" + ( true ? "" : 0)); +const styles_Separator = /*#__PURE__*/emotion_styled_base_browser_esm(MenuSeparator, true ? { + target: "e1wg7tti3" +} : 0)("grid-column:1/-1;border:none;height:", config_values.borderWidth, ";background-color:", props => props.variant === 'toolbar' ? TOOLBAR_VARIANT_BORDER_COLOR : DIVIDER_COLOR, ";margin-block:", space(2), ";margin-inline:", ITEM_PADDING_INLINE, ";outline:2px solid transparent;" + ( true ? "" : 0)); +const SubmenuChevronIcon = /*#__PURE__*/emotion_styled_base_browser_esm(build_module_icon, true ? { + target: "e1wg7tti2" +} : 0)("width:", space(1.5), ";", rtl({ + transform: `scaleX(1)` +}, { + transform: `scaleX(-1)` +}), ";" + ( true ? "" : 0)); +const styles_ItemLabel = /*#__PURE__*/emotion_styled_base_browser_esm(truncate_component, true ? { + target: "e1wg7tti1" +} : 0)("font-size:", font('default.fontSize'), ";line-height:20px;color:inherit;" + ( true ? "" : 0)); +const styles_ItemHelpText = /*#__PURE__*/emotion_styled_base_browser_esm(truncate_component, true ? { + target: "e1wg7tti0" +} : 0)("font-size:", font('helpText.fontSize'), ";line-height:16px;color:", LIGHTER_TEXT_COLOR, ";overflow-wrap:anywhere;[data-active-item]:not( [data-focus-visible] ) *:not( ", PopoverInnerWrapper, " ) &,[aria-disabled='true'] *:not( ", PopoverInnerWrapper, " ) &{color:inherit;}" + ( true ? "" : 0)); + +;// ./node_modules/@wordpress/components/build-module/menu/item.js +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + + + +const item_Item = (0,external_wp_element_namespaceObject.forwardRef)(function Item({ + prefix, + suffix, + children, + disabled = false, + hideOnClick = true, + store, + ...props +}, ref) { + const menuContext = (0,external_wp_element_namespaceObject.useContext)(context_Context); + if (!menuContext?.store) { + throw new Error('Menu.Item can only be rendered inside a Menu component'); + } + + // In most cases, the menu store will be retrieved from context (ie. the store + // created by the top-level menu component). But in rare cases (ie. + // `Menu.SubmenuTriggerItem`), the context store wouldn't be correct. This is + // why the component accepts a `store` prop to override the context store. + const computedStore = store !== null && store !== void 0 ? store : menuContext.store; + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(styles_Item, { + ref: ref, + ...props, + accessibleWhenDisabled: true, + disabled: disabled, + hideOnClick: hideOnClick, + store: computedStore, + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ItemPrefixWrapper, { + children: prefix + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(ItemContentWrapper, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ItemChildrenWrapper, { + children: children + }), suffix && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ItemSuffixWrapper, { + children: suffix + })] + })] + }); +}); + +;// ./node_modules/@ariakit/react-core/esm/menu/menu-item-check.js +"use client"; + + + + + + + + + + + + + + + +// src/menu/menu-item-check.tsx + +var menu_item_check_TagName = "span"; +var useMenuItemCheck = createHook( + function useMenuItemCheck2(_a) { + var _b = _a, { store, checked } = _b, props = __objRest(_b, ["store", "checked"]); + const context = (0,external_React_.useContext)(MenuItemCheckedContext); + checked = checked != null ? checked : context; + props = useCheckboxCheck(_3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), { checked })); + return props; + } +); +var MenuItemCheck = forwardRef2(function MenuItemCheck2(props) { + const htmlProps = useMenuItemCheck(props); + return LMDWO4NN_createElement(menu_item_check_TagName, htmlProps); +}); + + +;// ./node_modules/@wordpress/components/build-module/menu/checkbox-item.js +/** + * External dependencies + */ + + +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + + + +const CheckboxItem = (0,external_wp_element_namespaceObject.forwardRef)(function CheckboxItem({ + suffix, + children, + disabled = false, + hideOnClick = false, + ...props +}, ref) { + const menuContext = (0,external_wp_element_namespaceObject.useContext)(context_Context); + if (!menuContext?.store) { + throw new Error('Menu.CheckboxItem can only be rendered inside a Menu component'); + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(styles_CheckboxItem, { + ref: ref, + ...props, + accessibleWhenDisabled: true, + disabled: disabled, + hideOnClick: hideOnClick, + store: menuContext.store, + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MenuItemCheck, { + store: menuContext.store, + render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ItemPrefixWrapper, {}) + // Override some ariakit inline styles + , + style: { + width: 'auto', + height: 'auto' + }, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(icons_build_module_icon, { + icon: library_check, + size: 24 + }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(ItemContentWrapper, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ItemChildrenWrapper, { + children: children + }), suffix && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ItemSuffixWrapper, { + children: suffix + })] + })] + }); +}); + +;// ./node_modules/@wordpress/components/build-module/menu/radio-item.js +/** + * External dependencies + */ + + +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + + + + +const radioCheck = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Circle, { + cx: 12, + cy: 12, + r: 3 + }) +}); +const RadioItem = (0,external_wp_element_namespaceObject.forwardRef)(function RadioItem({ + suffix, + children, + disabled = false, + hideOnClick = false, + ...props +}, ref) { + const menuContext = (0,external_wp_element_namespaceObject.useContext)(context_Context); + if (!menuContext?.store) { + throw new Error('Menu.RadioItem can only be rendered inside a Menu component'); + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(styles_RadioItem, { + ref: ref, + ...props, + accessibleWhenDisabled: true, + disabled: disabled, + hideOnClick: hideOnClick, + store: menuContext.store, + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MenuItemCheck, { + store: menuContext.store, + render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ItemPrefixWrapper, {}) + // Override some ariakit inline styles + , + style: { + width: 'auto', + height: 'auto' + }, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(icons_build_module_icon, { + icon: radioCheck, + size: 24 + }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(ItemContentWrapper, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ItemChildrenWrapper, { + children: children + }), suffix && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ItemSuffixWrapper, { + children: suffix + })] + })] + }); +}); + +;// ./node_modules/@wordpress/components/build-module/menu/group.js +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + + + +const group_Group = (0,external_wp_element_namespaceObject.forwardRef)(function Group(props, ref) { + const menuContext = (0,external_wp_element_namespaceObject.useContext)(context_Context); + if (!menuContext?.store) { + throw new Error('Menu.Group can only be rendered inside a Menu component'); + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(styles_Group, { + ref: ref, + ...props, + store: menuContext.store + }); +}); + +;// ./node_modules/@wordpress/components/build-module/menu/group-label.js +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + + + + +const group_label_GroupLabel = (0,external_wp_element_namespaceObject.forwardRef)(function Group(props, ref) { + const menuContext = (0,external_wp_element_namespaceObject.useContext)(context_Context); + if (!menuContext?.store) { + throw new Error('Menu.GroupLabel can only be rendered inside a Menu component'); + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(styles_GroupLabel, { + ref: ref, + render: + /*#__PURE__*/ + // @ts-expect-error The `children` prop is passed + (0,external_ReactJSXRuntime_namespaceObject.jsx)(text_component, { + upperCase: true, + variant: "muted", + size: "11px", + weight: 500, + lineHeight: "16px" + }), + ...props, + store: menuContext.store + }); +}); + +;// ./node_modules/@wordpress/components/build-module/menu/separator.js +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + + + +const separator_Separator = (0,external_wp_element_namespaceObject.forwardRef)(function Separator(props, ref) { + const menuContext = (0,external_wp_element_namespaceObject.useContext)(context_Context); + if (!menuContext?.store) { + throw new Error('Menu.Separator can only be rendered inside a Menu component'); + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(styles_Separator, { + ref: ref, + ...props, + store: menuContext.store, + variant: menuContext.variant + }); +}); + +;// ./node_modules/@wordpress/components/build-module/menu/item-label.js +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + + + +const ItemLabel = (0,external_wp_element_namespaceObject.forwardRef)(function ItemLabel(props, ref) { + const menuContext = (0,external_wp_element_namespaceObject.useContext)(context_Context); + if (!menuContext?.store) { + throw new Error('Menu.ItemLabel can only be rendered inside a Menu component'); + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(styles_ItemLabel, { + numberOfLines: 1, + ref: ref, + ...props + }); +}); + +;// ./node_modules/@wordpress/components/build-module/menu/item-help-text.js +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + + + +const ItemHelpText = (0,external_wp_element_namespaceObject.forwardRef)(function ItemHelpText(props, ref) { + const menuContext = (0,external_wp_element_namespaceObject.useContext)(context_Context); + if (!menuContext?.store) { + throw new Error('Menu.ItemHelpText can only be rendered inside a Menu component'); + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(styles_ItemHelpText, { + numberOfLines: 2, + ref: ref, + ...props + }); +}); + ;// ./node_modules/@ariakit/react-core/esm/menu/menu-button.js "use client"; @@ -68972,7 +70822,8 @@ var useMenuButton = createHook( showMenu(); } }); - const dir = store.useState( + const dir = useStoreState( + store, (state) => state.placement.split("-")[0] ); const onKeyDownProp = props.onKeyDown; @@ -69069,11 +70920,115 @@ var useMenuButton = createHook( ); var MenuButton = forwardRef2(function MenuButton2(props) { const htmlProps = useMenuButton(props); - return HKOOKEDE_createElement(menu_button_TagName, htmlProps); + return LMDWO4NN_createElement(menu_button_TagName, htmlProps); }); -;// ./node_modules/@ariakit/react-core/esm/__chunks/GFJK2WVK.js +;// ./node_modules/@wordpress/components/build-module/menu/trigger-button.js +/** + * External dependencies + */ + + +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + + +const TriggerButton = (0,external_wp_element_namespaceObject.forwardRef)(function TriggerButton({ + children, + disabled = false, + ...props +}, ref) { + const menuContext = (0,external_wp_element_namespaceObject.useContext)(context_Context); + if (!menuContext?.store) { + throw new Error('Menu.TriggerButton can only be rendered inside a Menu component'); + } + if (menuContext.store.parent) { + throw new Error('Menu.TriggerButton should not be rendered inside a nested Menu component. Use Menu.SubmenuTriggerItem instead.'); + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MenuButton, { + ref: ref, + ...props, + disabled: disabled, + store: menuContext.store, + children: children + }); +}); + +;// ./node_modules/@wordpress/icons/build-module/library/chevron-right-small.js +/** + * WordPress dependencies + */ + + +const chevronRightSmall = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z" + }) +}); +/* harmony default export */ const chevron_right_small = (chevronRightSmall); + +;// ./node_modules/@wordpress/components/build-module/menu/submenu-trigger-item.js +/** + * External dependencies + */ + + +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + + + + +const SubmenuTriggerItem = (0,external_wp_element_namespaceObject.forwardRef)(function SubmenuTriggerItem({ + suffix, + ...otherProps +}, ref) { + const menuContext = (0,external_wp_element_namespaceObject.useContext)(context_Context); + if (!menuContext?.store.parent) { + throw new Error('Menu.SubmenuTriggerItem can only be rendered inside a nested Menu component'); + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MenuButton, { + ref: ref, + accessibleWhenDisabled: true, + store: menuContext.store, + render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(item_Item, { + ...otherProps, + // The menu item needs to register and be part of the parent menu. + // Without specifying the store explicitly, the `Item` component + // would otherwise read the store via context and pick up the one from + // the sub-menu `Menu` component. + store: menuContext.store.parent, + suffix: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [suffix, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SubmenuChevronIcon, { + "aria-hidden": "true", + icon: chevron_right_small, + size: 24, + preserveAspectRatio: "xMidYMid slice" + })] + }) + }) + }); +}); + +;// ./node_modules/@ariakit/react-core/esm/__chunks/ASGALOAX.js "use client"; @@ -69088,7 +71043,7 @@ var MenuButton = forwardRef2(function MenuButton2(props) { -var GFJK2WVK_TagName = "div"; +var ASGALOAX_TagName = "div"; function useAriaLabelledBy(_a) { var _b = _a, { store } = _b, props = __objRest(_b, ["store"]); const [id, setId] = (0,external_React_.useState)(void 0); @@ -69212,7 +71167,7 @@ var useMenuList = createHook( ); var MenuList = forwardRef2(function MenuList2(props) { const htmlProps = useMenuList(props); - return HKOOKEDE_createElement(GFJK2WVK_TagName, htmlProps); + return LMDWO4NN_createElement(ASGALOAX_TagName, htmlProps); }); @@ -69266,6 +71221,7 @@ var MenuList = forwardRef2(function MenuList2(props) { + // src/menu/menu.tsx @@ -69413,919 +71369,13 @@ var useMenu = createHook(function useMenu2(_a) { var Menu = createDialogComponent( forwardRef2(function Menu2(props) { const htmlProps = useMenu(props); - return HKOOKEDE_createElement(menu_TagName, htmlProps); + return LMDWO4NN_createElement(menu_TagName, htmlProps); }), useMenuProviderContext ); -;// ./node_modules/@wordpress/icons/build-module/library/chevron-right-small.js -/** - * WordPress dependencies - */ - - -const chevronRightSmall = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - d: "M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z" - }) -}); -/* harmony default export */ const chevron_right_small = (chevronRightSmall); - -;// ./node_modules/@ariakit/react-core/esm/__chunks/UQC4RYOT.js -"use client"; - - - - - - - - - -// src/menu/menu-item.tsx - - - - -var UQC4RYOT_TagName = "div"; -function menuHasFocus(baseElement, items, currentTarget) { - var _a; - if (!baseElement) return false; - if (hasFocusWithin(baseElement)) return true; - const expandedItem = items == null ? void 0 : items.find((item) => { - var _a2; - if (item.element === currentTarget) return false; - return ((_a2 = item.element) == null ? void 0 : _a2.getAttribute("aria-expanded")) === "true"; - }); - const expandedMenuId = (_a = expandedItem == null ? void 0 : expandedItem.element) == null ? void 0 : _a.getAttribute("aria-controls"); - if (!expandedMenuId) return false; - const doc = getDocument(baseElement); - const expandedMenu = doc.getElementById(expandedMenuId); - if (!expandedMenu) return false; - if (hasFocusWithin(expandedMenu)) return true; - return !!expandedMenu.querySelector("[role=menuitem][aria-expanded=true]"); -} -var useMenuItem = createHook( - function useMenuItem2(_a) { - var _b = _a, { - store, - hideOnClick = true, - preventScrollOnKeyDown = true, - focusOnHover, - blurOnHoverEnd - } = _b, props = __objRest(_b, [ - "store", - "hideOnClick", - "preventScrollOnKeyDown", - "focusOnHover", - "blurOnHoverEnd" - ]); - const menuContext = useMenuScopedContext(true); - const menubarContext = WSQNIDGC_useMenubarScopedContext(); - store = store || menuContext || menubarContext; - invariant( - store, - false && 0 - ); - const onClickProp = props.onClick; - const hideOnClickProp = useBooleanEvent(hideOnClick); - const hideMenu = "hideAll" in store ? store.hideAll : void 0; - const isWithinMenu = !!hideMenu; - const onClick = useEvent((event) => { - onClickProp == null ? void 0 : onClickProp(event); - if (event.defaultPrevented) return; - if (isDownloading(event)) return; - if (isOpeningInNewTab(event)) return; - if (!hideMenu) return; - const popupType = event.currentTarget.getAttribute("aria-haspopup"); - if (popupType === "menu") return; - if (!hideOnClickProp(event)) return; - hideMenu(); - }); - const contentElement = useStoreState( - store, - (state) => "contentElement" in state ? state.contentElement : null - ); - const role = getPopupItemRole(contentElement, "menuitem"); - props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({ - role - }, props), { - onClick - }); - props = useCompositeItem(_3YLGPPWQ_spreadValues({ - store, - preventScrollOnKeyDown - }, props)); - props = useCompositeHover(_3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({ - store - }, props), { - focusOnHover(event) { - const getFocusOnHover = () => { - if (typeof focusOnHover === "function") return focusOnHover(event); - if (focusOnHover != null) return focusOnHover; - return true; - }; - if (!store) return false; - if (!getFocusOnHover()) return false; - const { baseElement, items } = store.getState(); - if (isWithinMenu) { - if (event.currentTarget.hasAttribute("aria-expanded")) { - event.currentTarget.focus(); - } - return true; - } - if (menuHasFocus(baseElement, items, event.currentTarget)) { - event.currentTarget.focus(); - return true; - } - return false; - }, - blurOnHoverEnd(event) { - if (typeof blurOnHoverEnd === "function") return blurOnHoverEnd(event); - if (blurOnHoverEnd != null) return blurOnHoverEnd; - return isWithinMenu; - } - })); - return props; - } -); -var UQC4RYOT_MenuItem = memo2( - forwardRef2(function MenuItem2(props) { - const htmlProps = useMenuItem(props); - return HKOOKEDE_createElement(UQC4RYOT_TagName, htmlProps); - }) -); - - - -;// ./node_modules/@ariakit/react-core/esm/__chunks/AUGWLYYL.js -"use client"; - - -// src/checkbox/checkbox-context.tsx -var AUGWLYYL_ctx = createStoreContext(); -var useCheckboxContext = AUGWLYYL_ctx.useContext; -var useCheckboxScopedContext = AUGWLYYL_ctx.useScopedContext; -var useCheckboxProviderContext = AUGWLYYL_ctx.useProviderContext; -var CheckboxContextProvider = AUGWLYYL_ctx.ContextProvider; -var CheckboxScopedContextProvider = AUGWLYYL_ctx.ScopedContextProvider; - - - -;// ./node_modules/@ariakit/react-core/esm/__chunks/U5ZVLSUU.js -"use client"; - - - - - - - - -// src/checkbox/checkbox.tsx - - - -var U5ZVLSUU_TagName = "input"; -function setMixed(element, mixed) { - if (mixed) { - element.indeterminate = true; - } else if (element.indeterminate) { - element.indeterminate = false; - } -} -function isNativeCheckbox(tagName, type) { - return tagName === "input" && (!type || type === "checkbox"); -} -function getPrimitiveValue(value) { - if (Array.isArray(value)) { - return value.toString(); - } - return value; -} -var useCheckbox = createHook( - function useCheckbox2(_a) { - var _b = _a, { - store, - name, - value: valueProp, - checked: checkedProp, - defaultChecked - } = _b, props = __objRest(_b, [ - "store", - "name", - "value", - "checked", - "defaultChecked" - ]); - const context = useCheckboxContext(); - store = store || context; - const [_checked, setChecked] = (0,external_React_.useState)(defaultChecked != null ? defaultChecked : false); - const checked = useStoreState(store, (state) => { - if (checkedProp !== void 0) return checkedProp; - if ((state == null ? void 0 : state.value) === void 0) return _checked; - if (valueProp != null) { - if (Array.isArray(state.value)) { - const primitiveValue = getPrimitiveValue(valueProp); - return state.value.includes(primitiveValue); - } - return state.value === valueProp; - } - if (Array.isArray(state.value)) return false; - if (typeof state.value === "boolean") return state.value; - return false; - }); - const ref = (0,external_React_.useRef)(null); - const tagName = useTagName(ref, U5ZVLSUU_TagName); - const nativeCheckbox = isNativeCheckbox(tagName, props.type); - const mixed = checked ? checked === "mixed" : void 0; - const isChecked = checked === "mixed" ? false : checked; - const disabled = disabledFromProps(props); - const [propertyUpdated, schedulePropertyUpdate] = useForceUpdate(); - (0,external_React_.useEffect)(() => { - const element = ref.current; - if (!element) return; - setMixed(element, mixed); - if (nativeCheckbox) return; - element.checked = isChecked; - if (name !== void 0) { - element.name = name; - } - if (valueProp !== void 0) { - element.value = `${valueProp}`; - } - }, [propertyUpdated, mixed, nativeCheckbox, isChecked, name, valueProp]); - const onChangeProp = props.onChange; - const onChange = useEvent((event) => { - if (disabled) { - event.stopPropagation(); - event.preventDefault(); - return; - } - setMixed(event.currentTarget, mixed); - if (!nativeCheckbox) { - event.currentTarget.checked = !event.currentTarget.checked; - schedulePropertyUpdate(); - } - onChangeProp == null ? void 0 : onChangeProp(event); - if (event.defaultPrevented) return; - const elementChecked = event.currentTarget.checked; - setChecked(elementChecked); - store == null ? void 0 : store.setValue((prevValue) => { - if (valueProp == null) return elementChecked; - const primitiveValue = getPrimitiveValue(valueProp); - if (!Array.isArray(prevValue)) { - return prevValue === primitiveValue ? false : primitiveValue; - } - if (elementChecked) { - if (prevValue.includes(primitiveValue)) { - return prevValue; - } - return [...prevValue, primitiveValue]; - } - return prevValue.filter((v) => v !== primitiveValue); - }); - }); - const onClickProp = props.onClick; - const onClick = useEvent((event) => { - onClickProp == null ? void 0 : onClickProp(event); - if (event.defaultPrevented) return; - if (nativeCheckbox) return; - onChange(event); - }); - props = useWrapElement( - props, - (element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CheckboxCheckedContext.Provider, { value: isChecked, children: element }), - [isChecked] - ); - props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({ - role: !nativeCheckbox ? "checkbox" : void 0, - type: nativeCheckbox ? "checkbox" : void 0, - "aria-checked": checked - }, props), { - ref: useMergeRefs(ref, props.ref), - onChange, - onClick - }); - props = useCommand(_3YLGPPWQ_spreadValues({ clickOnEnter: !nativeCheckbox }, props)); - return removeUndefinedValues(_3YLGPPWQ_spreadValues({ - name: nativeCheckbox ? name : void 0, - value: nativeCheckbox ? valueProp : void 0, - checked: isChecked - }, props)); - } -); -var Checkbox = forwardRef2(function Checkbox2(props) { - const htmlProps = useCheckbox(props); - return HKOOKEDE_createElement(U5ZVLSUU_TagName, htmlProps); -}); - - - -;// ./node_modules/@ariakit/core/esm/checkbox/checkbox-store.js -"use client"; - - - - -// src/checkbox/checkbox-store.ts -function createCheckboxStore(props = {}) { - var _a; - throwOnConflictingProps(props, props.store); - const syncState = (_a = props.store) == null ? void 0 : _a.getState(); - const initialState = { - value: defaultValue( - props.value, - syncState == null ? void 0 : syncState.value, - props.defaultValue, - false - ) - }; - const checkbox = createStore(initialState, props.store); - return _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, checkbox), { - setValue: (value) => checkbox.setState("value", value) - }); -} - - -;// ./node_modules/@ariakit/react-core/esm/__chunks/EJOTW52C.js -"use client"; - - - -// src/checkbox/checkbox-store.ts - -function useCheckboxStoreProps(store, update, props) { - useUpdateEffect(update, [props.store]); - useStoreProps(store, props, "value", "setValue"); - return store; -} -function useCheckboxStore(props = {}) { - const [store, update] = _2GXGCHW6_useStore(createCheckboxStore, props); - return useCheckboxStoreProps(store, update, props); -} - - - -;// ./node_modules/@ariakit/react-core/esm/menu/menu-item-checkbox.js -"use client"; - - - - - - - - - - - - - - - - - - - - - - - - - - -// src/menu/menu-item-checkbox.tsx - - -var menu_item_checkbox_TagName = "div"; -function menu_item_checkbox_getPrimitiveValue(value) { - if (Array.isArray(value)) { - return value.toString(); - } - return value; -} -function getValue(storeValue, value, checked) { - if (value === void 0) { - if (Array.isArray(storeValue)) return storeValue; - return !!checked; - } - const primitiveValue = menu_item_checkbox_getPrimitiveValue(value); - if (!Array.isArray(storeValue)) { - if (checked) { - return primitiveValue; - } - return storeValue === primitiveValue ? false : storeValue; - } - if (checked) { - if (storeValue.includes(primitiveValue)) { - return storeValue; - } - return [...storeValue, primitiveValue]; - } - return storeValue.filter((v) => v !== primitiveValue); -} -var useMenuItemCheckbox = createHook( - function useMenuItemCheckbox2(_a) { - var _b = _a, { - store, - name, - value, - checked, - defaultChecked: defaultCheckedProp, - hideOnClick = false - } = _b, props = __objRest(_b, [ - "store", - "name", - "value", - "checked", - "defaultChecked", - "hideOnClick" - ]); - const context = useMenuScopedContext(); - store = store || context; - invariant( - store, - false && 0 - ); - const defaultChecked = useInitialValue(defaultCheckedProp); - (0,external_React_.useEffect)(() => { - store == null ? void 0 : store.setValue(name, (prevValue = []) => { - if (!defaultChecked) return prevValue; - return getValue(prevValue, value, true); - }); - }, [store, name, value, defaultChecked]); - (0,external_React_.useEffect)(() => { - if (checked === void 0) return; - store == null ? void 0 : store.setValue(name, (prevValue) => { - return getValue(prevValue, value, checked); - }); - }, [store, name, value, checked]); - const checkboxStore = useCheckboxStore({ - value: store.useState((state) => state.values[name]), - setValue(internalValue) { - store == null ? void 0 : store.setValue(name, () => { - if (checked === void 0) return internalValue; - const nextValue = getValue(internalValue, value, checked); - if (!Array.isArray(nextValue)) return nextValue; - if (!Array.isArray(internalValue)) return nextValue; - if (shallowEqual(internalValue, nextValue)) return internalValue; - return nextValue; - }); - } - }); - props = _3YLGPPWQ_spreadValues({ - role: "menuitemcheckbox" - }, props); - props = useCheckbox(_3YLGPPWQ_spreadValues({ - store: checkboxStore, - name, - value, - checked - }, props)); - props = useMenuItem(_3YLGPPWQ_spreadValues({ store, hideOnClick }, props)); - return props; - } -); -var MenuItemCheckbox = memo2( - forwardRef2(function MenuItemCheckbox2(props) { - const htmlProps = useMenuItemCheckbox(props); - return HKOOKEDE_createElement(menu_item_checkbox_TagName, htmlProps); - }) -); - - -;// ./node_modules/@ariakit/react-core/esm/menu/menu-item-radio.js -"use client"; - - - - - - - - - - - - - - - - - - - - - - - - -// src/menu/menu-item-radio.tsx - - - -var menu_item_radio_TagName = "div"; -function menu_item_radio_getValue(prevValue, value, checked) { - if (checked === void 0) return prevValue; - if (checked) return value; - return prevValue; -} -var useMenuItemRadio = createHook( - function useMenuItemRadio2(_a) { - var _b = _a, { - store, - name, - value, - checked, - onChange: onChangeProp, - hideOnClick = false - } = _b, props = __objRest(_b, [ - "store", - "name", - "value", - "checked", - "onChange", - "hideOnClick" - ]); - const context = useMenuScopedContext(); - store = store || context; - invariant( - store, - false && 0 - ); - const defaultChecked = useInitialValue(props.defaultChecked); - (0,external_React_.useEffect)(() => { - store == null ? void 0 : store.setValue(name, (prevValue = false) => { - return menu_item_radio_getValue(prevValue, value, defaultChecked); - }); - }, [store, name, value, defaultChecked]); - (0,external_React_.useEffect)(() => { - if (checked === void 0) return; - store == null ? void 0 : store.setValue(name, (prevValue) => { - return menu_item_radio_getValue(prevValue, value, checked); - }); - }, [store, name, value, checked]); - const isChecked = store.useState((state) => state.values[name] === value); - props = useWrapElement( - props, - (element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(MenuItemCheckedContext.Provider, { value: !!isChecked, children: element }), - [isChecked] - ); - props = _3YLGPPWQ_spreadValues({ - role: "menuitemradio" - }, props); - props = useRadio(_3YLGPPWQ_spreadValues({ - name, - value, - checked: isChecked, - onChange(event) { - onChangeProp == null ? void 0 : onChangeProp(event); - if (event.defaultPrevented) return; - const element = event.currentTarget; - store == null ? void 0 : store.setValue(name, (prevValue) => { - return menu_item_radio_getValue(prevValue, value, checked != null ? checked : element.checked); - }); - } - }, props)); - props = useMenuItem(_3YLGPPWQ_spreadValues({ store, hideOnClick }, props)); - return props; - } -); -var MenuItemRadio = memo2( - forwardRef2(function MenuItemRadio2(props) { - const htmlProps = useMenuItemRadio(props); - return HKOOKEDE_createElement(menu_item_radio_TagName, htmlProps); - }) -); - - -;// ./node_modules/@ariakit/react-core/esm/menu/menu-group.js -"use client"; - - - - - - - - -// src/menu/menu-group.tsx -var menu_group_TagName = "div"; -var useMenuGroup = createHook( - function useMenuGroup2(props) { - props = useCompositeGroup(props); - return props; - } -); -var menu_group_MenuGroup = forwardRef2(function MenuGroup2(props) { - const htmlProps = useMenuGroup(props); - return HKOOKEDE_createElement(menu_group_TagName, htmlProps); -}); - - -;// ./node_modules/@ariakit/react-core/esm/menu/menu-group-label.js -"use client"; - - - - - - - - -// src/menu/menu-group-label.tsx -var menu_group_label_TagName = "div"; -var useMenuGroupLabel = createHook( - function useMenuGroupLabel2(props) { - props = useCompositeGroupLabel(props); - return props; - } -); -var MenuGroupLabel = forwardRef2(function MenuGroupLabel2(props) { - const htmlProps = useMenuGroupLabel(props); - return HKOOKEDE_createElement(menu_group_label_TagName, htmlProps); -}); - - -;// ./node_modules/@ariakit/react-core/esm/__chunks/WEEEI3KU.js -"use client"; - - - - - -// src/composite/composite-separator.tsx - -var WEEEI3KU_TagName = "hr"; -var useCompositeSeparator = createHook(function useCompositeSeparator2(_a) { - var _b = _a, { store } = _b, props = __objRest(_b, ["store"]); - const context = useCompositeContext(); - store = store || context; - invariant( - store, - false && 0 - ); - const orientation = store.useState( - (state) => state.orientation === "horizontal" ? "vertical" : "horizontal" - ); - props = useSeparator(_3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), { orientation })); - return props; -}); -var CompositeSeparator = forwardRef2(function CompositeSeparator2(props) { - const htmlProps = useCompositeSeparator(props); - return HKOOKEDE_createElement(WEEEI3KU_TagName, htmlProps); -}); - - - -;// ./node_modules/@ariakit/react-core/esm/menu/menu-separator.js -"use client"; - - - - - - - - - - - - - - - -// src/menu/menu-separator.tsx -var menu_separator_TagName = "hr"; -var useMenuSeparator = createHook( - function useMenuSeparator2(_a) { - var _b = _a, { store } = _b, props = __objRest(_b, ["store"]); - const context = useMenuContext(); - store = store || context; - props = useCompositeSeparator(_3YLGPPWQ_spreadValues({ store }, props)); - return props; - } -); -var MenuSeparator = forwardRef2(function MenuSeparator2(props) { - const htmlProps = useMenuSeparator(props); - return HKOOKEDE_createElement(menu_separator_TagName, htmlProps); -}); - - -;// ./node_modules/@wordpress/components/build-module/dropdown-menu-v2/styles.js - -function dropdown_menu_v2_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } -/** - * External dependencies - */ - - -/** - * Internal dependencies - */ - - - - -const styles_ANIMATION_PARAMS = { - SCALE_AMOUNT_OUTER: 0.82, - SCALE_AMOUNT_CONTENT: 0.9, - DURATION: { - IN: '400ms', - OUT: '200ms' - }, - EASING: 'cubic-bezier(0.33, 0, 0, 1)' -}; -const CONTENT_WRAPPER_PADDING = space(1); -const ITEM_PADDING_BLOCK = space(2); -const ITEM_PADDING_INLINE = space(3); - -// TODO: -// - border color and divider color are different from COLORS.theme variables -// - lighter text color is not defined in COLORS.theme, should it be? -// - lighter background color is not defined in COLORS.theme, should it be? -const DEFAULT_BORDER_COLOR = COLORS.theme.gray[300]; -const DIVIDER_COLOR = COLORS.theme.gray[200]; -const LIGHTER_TEXT_COLOR = COLORS.theme.gray[700]; -const LIGHT_BACKGROUND_COLOR = COLORS.theme.gray[100]; -const TOOLBAR_VARIANT_BORDER_COLOR = COLORS.theme.foreground; -const DEFAULT_BOX_SHADOW = `0 0 0 ${config_values.borderWidth} ${DEFAULT_BORDER_COLOR}, ${config_values.elevationMedium}`; -const TOOLBAR_VARIANT_BOX_SHADOW = `0 0 0 ${config_values.borderWidth} ${TOOLBAR_VARIANT_BORDER_COLOR}`; -const GRID_TEMPLATE_COLS = 'minmax( 0, max-content ) 1fr'; -const MenuPopoverOuterWrapper = /*#__PURE__*/emotion_styled_base_browser_esm("div", true ? { - target: "e1kdzosf14" -} : 0)("position:relative;background-color:", COLORS.ui.background, ";border-radius:", config_values.radiusMedium, ";", props => /*#__PURE__*/emotion_react_browser_esm_css("box-shadow:", props.variant === 'toolbar' ? TOOLBAR_VARIANT_BOX_SHADOW : DEFAULT_BOX_SHADOW, ";" + ( true ? "" : 0), true ? "" : 0), " overflow:hidden;@media not ( prefers-reduced-motion ){transition-property:transform,opacity;transition-timing-function:", styles_ANIMATION_PARAMS.EASING, ";transition-duration:", styles_ANIMATION_PARAMS.DURATION.IN, ";will-change:transform,opacity;opacity:0;&:has( [data-enter] ){opacity:1;}&:has( [data-leave] ){transition-duration:", styles_ANIMATION_PARAMS.DURATION.OUT, ";}&:has( [data-side='bottom'] ),&:has( [data-side='top'] ){transform:scaleY( ", styles_ANIMATION_PARAMS.SCALE_AMOUNT_OUTER, " );}&:has( [data-side='bottom'] ){transform-origin:top;}&:has( [data-side='top'] ){transform-origin:bottom;}&:has( [data-enter][data-side='bottom'] ),&:has( [data-enter][data-side='top'] ),&:has( [data-leave][data-side='bottom'] ),&:has( [data-leave][data-side='top'] ){transform:scaleY( 1 );}}" + ( true ? "" : 0)); -const MenuPopoverInnerWrapper = /*#__PURE__*/emotion_styled_base_browser_esm("div", true ? { - target: "e1kdzosf13" -} : 0)("position:relative;z-index:1000000;display:grid;grid-template-columns:", GRID_TEMPLATE_COLS, ";grid-template-rows:auto;box-sizing:border-box;min-width:160px;max-width:320px;max-height:var( --popover-available-height );padding:", CONTENT_WRAPPER_PADDING, ";overscroll-behavior:contain;overflow:auto;outline:2px solid transparent!important;@media not ( prefers-reduced-motion ){transition:inherit;transform-origin:inherit;&[data-side='bottom'],&[data-side='top']{transform:scaleY(\n\t\t\t\tcalc(\n\t\t\t\t\t1 / ", styles_ANIMATION_PARAMS.SCALE_AMOUNT_OUTER, " *\n\t\t\t\t\t\t", styles_ANIMATION_PARAMS.SCALE_AMOUNT_CONTENT, "\n\t\t\t\t)\n\t\t\t);}&[data-enter][data-side='bottom'],&[data-enter][data-side='top'],&[data-leave][data-side='bottom'],&[data-leave][data-side='top']{transform:scaleY( 1 );}}" + ( true ? "" : 0)); -const baseItem = /*#__PURE__*/emotion_react_browser_esm_css("all:unset;position:relative;min-height:", space(10), ";box-sizing:border-box;grid-column:1/-1;display:grid;grid-template-columns:", GRID_TEMPLATE_COLS, ";align-items:center;@supports ( grid-template-columns: subgrid ){grid-template-columns:subgrid;}font-size:", font('default.fontSize'), ";font-family:inherit;font-weight:normal;line-height:20px;color:", COLORS.theme.foreground, ";border-radius:", config_values.radiusSmall, ";padding-block:", ITEM_PADDING_BLOCK, ";padding-inline:", ITEM_PADDING_INLINE, ";scroll-margin:", CONTENT_WRAPPER_PADDING, ";user-select:none;outline:none;&[aria-disabled='true']{color:", COLORS.ui.textDisabled, ";cursor:not-allowed;}&[data-active-item]:not( [data-focus-visible] ):not(\n\t\t\t[aria-disabled='true']\n\t\t){background-color:", COLORS.theme.accent, ";color:", COLORS.white, ";}&[data-focus-visible]{box-shadow:0 0 0 1.5px ", COLORS.theme.accent, ";outline:2px solid transparent;}&:active,&[data-active]{}", MenuPopoverInnerWrapper, ":not(:focus) &:not(:focus)[aria-expanded=\"true\"]{background-color:", LIGHT_BACKGROUND_COLOR, ";color:", COLORS.theme.foreground, ";}svg{fill:currentColor;}" + ( true ? "" : 0), true ? "" : 0); -const styles_DropdownMenuItem = /*#__PURE__*/emotion_styled_base_browser_esm(UQC4RYOT_MenuItem, true ? { - target: "e1kdzosf12" -} : 0)(baseItem, ";" + ( true ? "" : 0)); -const styles_DropdownMenuCheckboxItem = /*#__PURE__*/emotion_styled_base_browser_esm(MenuItemCheckbox, true ? { - target: "e1kdzosf11" -} : 0)(baseItem, ";" + ( true ? "" : 0)); -const styles_DropdownMenuRadioItem = /*#__PURE__*/emotion_styled_base_browser_esm(MenuItemRadio, true ? { - target: "e1kdzosf10" -} : 0)(baseItem, ";" + ( true ? "" : 0)); -const ItemPrefixWrapper = /*#__PURE__*/emotion_styled_base_browser_esm("span", true ? { - target: "e1kdzosf9" -} : 0)("grid-column:1;", styles_DropdownMenuCheckboxItem, ">&,", styles_DropdownMenuRadioItem, ">&{min-width:", space(6), ";}", styles_DropdownMenuCheckboxItem, ">&,", styles_DropdownMenuRadioItem, ">&,&:not( :empty ){margin-inline-end:", space(2), ";}display:flex;align-items:center;justify-content:center;color:", LIGHTER_TEXT_COLOR, ";[data-active-item]:not( [data-focus-visible] )>&,[aria-disabled='true']>&{color:inherit;}" + ( true ? "" : 0)); -const DropdownMenuItemContentWrapper = /*#__PURE__*/emotion_styled_base_browser_esm("div", true ? { - target: "e1kdzosf8" -} : 0)("grid-column:2;display:flex;align-items:center;justify-content:space-between;gap:", space(3), ";pointer-events:none;" + ( true ? "" : 0)); -const DropdownMenuItemChildrenWrapper = /*#__PURE__*/emotion_styled_base_browser_esm("div", true ? { - target: "e1kdzosf7" -} : 0)("flex:1;display:inline-flex;flex-direction:column;gap:", space(1), ";" + ( true ? "" : 0)); -const ItemSuffixWrapper = /*#__PURE__*/emotion_styled_base_browser_esm("span", true ? { - target: "e1kdzosf6" -} : 0)("flex:0 1 fit-content;min-width:0;width:fit-content;display:flex;align-items:center;justify-content:center;gap:", space(3), ";color:", LIGHTER_TEXT_COLOR, ";[data-active-item]:not( [data-focus-visible] ) *:not(", MenuPopoverInnerWrapper, ") &,[aria-disabled='true'] *:not(", MenuPopoverInnerWrapper, ") &{color:inherit;}" + ( true ? "" : 0)); -const styles_DropdownMenuGroup = /*#__PURE__*/emotion_styled_base_browser_esm(menu_group_MenuGroup, true ? { - target: "e1kdzosf5" -} : 0)( true ? { - name: "49aokf", - styles: "display:contents" -} : 0); -const DropdownMenuGroupLabel = /*#__PURE__*/emotion_styled_base_browser_esm(MenuGroupLabel, true ? { - target: "e1kdzosf4" -} : 0)("grid-column:1/-1;padding-block-start:", space(3), ";padding-block-end:", space(2), ";padding-inline:", ITEM_PADDING_INLINE, ";" + ( true ? "" : 0)); -const styles_DropdownMenuSeparator = /*#__PURE__*/emotion_styled_base_browser_esm(MenuSeparator, true ? { - target: "e1kdzosf3" -} : 0)("grid-column:1/-1;border:none;height:", config_values.borderWidth, ";background-color:", props => props.variant === 'toolbar' ? TOOLBAR_VARIANT_BORDER_COLOR : DIVIDER_COLOR, ";margin-block:", space(2), ";margin-inline:", ITEM_PADDING_INLINE, ";outline:2px solid transparent;" + ( true ? "" : 0)); -const SubmenuChevronIcon = /*#__PURE__*/emotion_styled_base_browser_esm(build_module_icon, true ? { - target: "e1kdzosf2" -} : 0)("width:", space(1.5), ";", rtl({ - transform: `scaleX(1)` -}, { - transform: `scaleX(-1)` -}), ";" + ( true ? "" : 0)); -const styles_DropdownMenuItemLabel = /*#__PURE__*/emotion_styled_base_browser_esm(truncate_component, true ? { - target: "e1kdzosf1" -} : 0)("font-size:", font('default.fontSize'), ";line-height:20px;color:inherit;" + ( true ? "" : 0)); -const styles_DropdownMenuItemHelpText = /*#__PURE__*/emotion_styled_base_browser_esm(truncate_component, true ? { - target: "e1kdzosf0" -} : 0)("font-size:", font('helpText.fontSize'), ";line-height:16px;color:", LIGHTER_TEXT_COLOR, ";word-break:break-all;[data-active-item]:not( [data-focus-visible] ) *:not( ", MenuPopoverInnerWrapper, " ) &,[aria-disabled='true'] *:not( ", MenuPopoverInnerWrapper, " ) &{color:inherit;}" + ( true ? "" : 0)); - -;// ./node_modules/@wordpress/components/build-module/dropdown-menu-v2/context.js -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - -const DropdownMenuContext = (0,external_wp_element_namespaceObject.createContext)(undefined); - -;// ./node_modules/@wordpress/components/build-module/dropdown-menu-v2/use-temporary-focus-visible-fix.js -/** - * WordPress dependencies - */ - -function useTemporaryFocusVisibleFix({ - onBlur: onBlurProp -}) { - const [focusVisible, setFocusVisible] = (0,external_wp_element_namespaceObject.useState)(false); - return { - 'data-focus-visible': focusVisible || undefined, - onFocusVisible: () => { - (0,external_wp_element_namespaceObject.flushSync)(() => setFocusVisible(true)); - }, - onBlur: event => { - onBlurProp?.(event); - setFocusVisible(false); - } - }; -} - -;// ./node_modules/@wordpress/components/build-module/dropdown-menu-v2/item.js -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - - - - - - -const DropdownMenuItem = (0,external_wp_element_namespaceObject.forwardRef)(function DropdownMenuItem({ - prefix, - suffix, - children, - onBlur, - hideOnClick = true, - ...props -}, ref) { - // TODO: Remove when https://github.com/ariakit/ariakit/issues/4083 is fixed - const focusVisibleFixProps = useTemporaryFocusVisibleFix({ - onBlur - }); - const dropdownMenuContext = (0,external_wp_element_namespaceObject.useContext)(DropdownMenuContext); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(styles_DropdownMenuItem, { - ref: ref, - ...props, - ...focusVisibleFixProps, - accessibleWhenDisabled: true, - hideOnClick: hideOnClick, - store: dropdownMenuContext?.store, - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ItemPrefixWrapper, { - children: prefix - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(DropdownMenuItemContentWrapper, { - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DropdownMenuItemChildrenWrapper, { - children: children - }), suffix && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ItemSuffixWrapper, { - children: suffix - })] - })] - }); -}); - -;// ./node_modules/@ariakit/react-core/esm/menu/menu-item-check.js -"use client"; - - - - - - - - - - - - - - - -// src/menu/menu-item-check.tsx - -var menu_item_check_TagName = "span"; -var useMenuItemCheck = createHook( - function useMenuItemCheck2(_a) { - var _b = _a, { store, checked } = _b, props = __objRest(_b, ["store", "checked"]); - const context = (0,external_React_.useContext)(MenuItemCheckedContext); - checked = checked != null ? checked : context; - props = useCheckboxCheck(_3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), { checked })); - return props; - } -); -var MenuItemCheck = forwardRef2(function MenuItemCheck2(props) { - const htmlProps = useMenuItemCheck(props); - return HKOOKEDE_createElement(menu_item_check_TagName, htmlProps); -}); - - -;// ./node_modules/@wordpress/components/build-module/dropdown-menu-v2/checkbox-item.js +;// ./node_modules/@wordpress/components/build-module/menu/popover.js /** * External dependencies */ @@ -70336,7 +71386,6 @@ var MenuItemCheck = forwardRef2(function MenuItemCheck2(props) { */ - /** * Internal dependencies */ @@ -70344,255 +71393,82 @@ var MenuItemCheck = forwardRef2(function MenuItemCheck2(props) { - - -const DropdownMenuCheckboxItem = (0,external_wp_element_namespaceObject.forwardRef)(function DropdownMenuCheckboxItem({ - suffix, +const menu_popover_Popover = (0,external_wp_element_namespaceObject.forwardRef)(function Popover({ + gutter, children, - onBlur, - hideOnClick = false, - ...props + shift, + modal = true, + ...otherProps }, ref) { - // TODO: Remove when https://github.com/ariakit/ariakit/issues/4083 is fixed - const focusVisibleFixProps = useTemporaryFocusVisibleFix({ - onBlur - }); - const dropdownMenuContext = (0,external_wp_element_namespaceObject.useContext)(DropdownMenuContext); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(styles_DropdownMenuCheckboxItem, { + const menuContext = (0,external_wp_element_namespaceObject.useContext)(context_Context); + + // Extract the side from the applied placement — useful for animations. + // Using `currentPlacement` instead of `placement` to make sure that we + // use the final computed placement (including "flips" etc). + const appliedPlacementSide = useStoreState(menuContext?.store, 'currentPlacement')?.split('-')[0]; + const hideOnEscape = (0,external_wp_element_namespaceObject.useCallback)(event => { + // Pressing Escape can cause unexpected consequences (ie. exiting + // full screen mode on MacOs, close parent modals...). + event.preventDefault(); + // Returning `true` causes the menu to hide. + return true; + }, []); + const computedDirection = useStoreState(menuContext?.store, 'rtl') ? 'rtl' : 'ltr'; + const wrapperProps = (0,external_wp_element_namespaceObject.useMemo)(() => ({ + dir: computedDirection, + style: { + direction: computedDirection + } + }), [computedDirection]); + if (!menuContext?.store) { + throw new Error('Menu.Popover can only be rendered inside a Menu component'); + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Menu, { + ...otherProps, ref: ref, - ...props, - ...focusVisibleFixProps, - accessibleWhenDisabled: true, - hideOnClick: hideOnClick, - store: dropdownMenuContext?.store, - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MenuItemCheck, { - store: dropdownMenuContext?.store, - render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ItemPrefixWrapper, {}) - // Override some ariakit inline styles - , - style: { - width: 'auto', - height: 'auto' - }, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(icons_build_module_icon, { - icon: library_check, - size: 24 - }) - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(DropdownMenuItemContentWrapper, { - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DropdownMenuItemChildrenWrapper, { - children: children - }), suffix && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ItemSuffixWrapper, { - children: suffix - })] - })] - }); -}); - -;// ./node_modules/@wordpress/components/build-module/dropdown-menu-v2/radio-item.js -/** - * External dependencies - */ - - -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - - - - - - - -const radioCheck = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Circle, { - cx: 12, - cy: 12, - r: 3 - }) -}); -const DropdownMenuRadioItem = (0,external_wp_element_namespaceObject.forwardRef)(function DropdownMenuRadioItem({ - suffix, - children, - onBlur, - hideOnClick = false, - ...props -}, ref) { - // TODO: Remove when https://github.com/ariakit/ariakit/issues/4083 is fixed - const focusVisibleFixProps = useTemporaryFocusVisibleFix({ - onBlur - }); - const dropdownMenuContext = (0,external_wp_element_namespaceObject.useContext)(DropdownMenuContext); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(styles_DropdownMenuRadioItem, { - ref: ref, - ...props, - ...focusVisibleFixProps, - accessibleWhenDisabled: true, - hideOnClick: hideOnClick, - store: dropdownMenuContext?.store, - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MenuItemCheck, { - store: dropdownMenuContext?.store, - render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ItemPrefixWrapper, {}) - // Override some ariakit inline styles - , - style: { - width: 'auto', - height: 'auto' - }, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(icons_build_module_icon, { - icon: radioCheck, - size: 24 - }) - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(DropdownMenuItemContentWrapper, { - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DropdownMenuItemChildrenWrapper, { - children: children - }), suffix && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ItemSuffixWrapper, { - children: suffix - })] - })] - }); -}); - -;// ./node_modules/@wordpress/components/build-module/dropdown-menu-v2/group.js -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - - - - -const DropdownMenuGroup = (0,external_wp_element_namespaceObject.forwardRef)(function DropdownMenuGroup(props, ref) { - const dropdownMenuContext = (0,external_wp_element_namespaceObject.useContext)(DropdownMenuContext); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(styles_DropdownMenuGroup, { - ref: ref, - ...props, - store: dropdownMenuContext?.store - }); -}); - -;// ./node_modules/@wordpress/components/build-module/dropdown-menu-v2/group-label.js -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - - - - - -const group_label_DropdownMenuGroupLabel = (0,external_wp_element_namespaceObject.forwardRef)(function DropdownMenuGroup(props, ref) { - const dropdownMenuContext = (0,external_wp_element_namespaceObject.useContext)(DropdownMenuContext); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DropdownMenuGroupLabel, { - ref: ref, - render: + modal: modal, + store: menuContext.store + // Root menu has an 8px distance from its trigger, + // otherwise 0 (which causes the submenu to slightly overlap) + , + gutter: gutter !== null && gutter !== void 0 ? gutter : menuContext.store.parent ? 0 : 8 + // Align nested menu by the same (but opposite) amount + // as the menu container's padding. + , + shift: shift !== null && shift !== void 0 ? shift : menuContext.store.parent ? -4 : 0, + hideOnHoverOutside: false, + "data-side": appliedPlacementSide, + wrapperProps: wrapperProps, + hideOnEscape: hideOnEscape, + unmountOnHide: true, + render: renderProps => /*#__PURE__*/ - // @ts-expect-error The `children` prop is passed - (0,external_ReactJSXRuntime_namespaceObject.jsx)(text_component, { - upperCase: true, - variant: "muted", - size: "11px", - weight: 500, - lineHeight: "16px" + // Two wrappers are needed for the entry animation, where the menu + // container scales with a different factor than its contents. + // The {...renderProps} are passed to the inner wrapper, so that the + // menu element is the direct parent of the menu item elements. + (0,external_ReactJSXRuntime_namespaceObject.jsx)(PopoverOuterWrapper, { + variant: menuContext.variant, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PopoverInnerWrapper, { + ...renderProps + }) }), - ...props, - store: dropdownMenuContext?.store + children: children }); }); -;// ./node_modules/@wordpress/components/build-module/dropdown-menu-v2/separator.js -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - - - - -const DropdownMenuSeparator = (0,external_wp_element_namespaceObject.forwardRef)(function DropdownMenuSeparator(props, ref) { - const dropdownMenuContext = (0,external_wp_element_namespaceObject.useContext)(DropdownMenuContext); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(styles_DropdownMenuSeparator, { - ref: ref, - ...props, - store: dropdownMenuContext?.store, - variant: dropdownMenuContext?.variant - }); -}); - -;// ./node_modules/@wordpress/components/build-module/dropdown-menu-v2/item-label.js -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - - - -const DropdownMenuItemLabel = (0,external_wp_element_namespaceObject.forwardRef)(function DropdownMenuItemLabel(props, ref) { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(styles_DropdownMenuItemLabel, { - numberOfLines: 1, - ref: ref, - ...props - }); -}); - -;// ./node_modules/@wordpress/components/build-module/dropdown-menu-v2/item-help-text.js -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - - - -const DropdownMenuItemHelpText = (0,external_wp_element_namespaceObject.forwardRef)(function DropdownMenuItemHelpText(props, ref) { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(styles_DropdownMenuItemHelpText, { - numberOfLines: 2, - ref: ref, - ...props - }); -}); - -;// ./node_modules/@wordpress/components/build-module/dropdown-menu-v2/index.js +;// ./node_modules/@wordpress/components/build-module/menu/index.js /** * External dependencies */ - /** * WordPress dependencies */ - /** * Internal dependencies */ @@ -70610,42 +71486,32 @@ const DropdownMenuItemHelpText = (0,external_wp_element_namespaceObject.forwardR -const dropdown_menu_v2_UnconnectedDropdownMenu = (props, ref) => { - var _props$placement; +const UnconnectedMenu = props => { const { - // Store props - open, + children, defaultOpen = false, + open, onOpenChange, placement, - // Menu trigger props - trigger, - // Menu props - gutter, - children, - shift, - modal = true, // From internal components context - variant, - // Rest - ...otherProps - } = useContextSystem(props, 'DropdownMenu'); - const parentContext = (0,external_wp_element_namespaceObject.useContext)(DropdownMenuContext); - const computedDirection = (0,external_wp_i18n_namespaceObject.isRTL)() ? 'rtl' : 'ltr'; + variant + } = useContextSystem(props, 'Menu'); + const parentContext = (0,external_wp_element_namespaceObject.useContext)(context_Context); + const rtl = (0,external_wp_i18n_namespaceObject.isRTL)(); // If an explicit value for the `placement` prop is not passed, - // apply a default placement of `bottom-start` for the root dropdown, - // and of `right-start` for nested dropdowns. - let computedPlacement = (_props$placement = props.placement) !== null && _props$placement !== void 0 ? _props$placement : parentContext?.store ? 'right-start' : 'bottom-start'; + // apply a default placement of `bottom-start` for the root menu popover, + // and of `right-start` for nested menu popovers. + let computedPlacement = placement !== null && placement !== void 0 ? placement : parentContext?.store ? 'right-start' : 'bottom-start'; // Swap left/right in case of RTL direction - if (computedDirection === 'rtl') { + if (rtl) { if (/right/.test(computedPlacement)) { computedPlacement = computedPlacement.replace('right', 'left'); } else if (/left/.test(computedPlacement)) { computedPlacement = computedPlacement.replace('left', 'right'); } } - const dropdownMenuStore = useMenuStore({ + const menuStore = useMenuStore({ parent: parentContext?.store, open, defaultOpen, @@ -70654,115 +71520,129 @@ const dropdown_menu_v2_UnconnectedDropdownMenu = (props, ref) => { setOpen(willBeOpen) { onOpenChange?.(willBeOpen); }, - rtl: computedDirection === 'rtl' + rtl }); const contextValue = (0,external_wp_element_namespaceObject.useMemo)(() => ({ - store: dropdownMenuStore, + store: menuStore, variant - }), [dropdownMenuStore, variant]); - - // Extract the side from the applied placement — useful for animations. - // Using `currentPlacement` instead of `placement` to make sure that we - // use the final computed placement (including "flips" etc). - const appliedPlacementSide = useStoreState(dropdownMenuStore, 'currentPlacement').split('-')[0]; - if (dropdownMenuStore.parent && !((0,external_wp_element_namespaceObject.isValidElement)(trigger) && DropdownMenuItem === trigger.type)) { - // eslint-disable-next-line no-console - console.warn('For nested DropdownMenus, the `trigger` should always be a `DropdownMenuItem`.'); - } - const hideOnEscape = (0,external_wp_element_namespaceObject.useCallback)(event => { - // Pressing Escape can cause unexpected consequences (ie. exiting - // full screen mode on MacOs, close parent modals...). - event.preventDefault(); - // Returning `true` causes the menu to hide. - return true; - }, []); - const wrapperProps = (0,external_wp_element_namespaceObject.useMemo)(() => ({ - dir: computedDirection, - style: { - direction: computedDirection - } - }), [computedDirection]); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MenuButton, { - ref: ref, - store: dropdownMenuStore, - render: dropdownMenuStore.parent ? (0,external_wp_element_namespaceObject.cloneElement)(trigger, { - // Add submenu arrow, unless a `suffix` is explicitly specified - suffix: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: [trigger.props.suffix, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SubmenuChevronIcon, { - "aria-hidden": "true", - icon: chevron_right_small, - size: 24, - preserveAspectRatio: "xMidYMid slice" - })] - }) - }) : trigger - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Menu, { - ...otherProps, - modal: modal, - store: dropdownMenuStore - // Root menu has an 8px distance from its trigger, - // otherwise 0 (which causes the submenu to slightly overlap) - , - gutter: gutter !== null && gutter !== void 0 ? gutter : dropdownMenuStore.parent ? 0 : 8 - // Align nested menu by the same (but opposite) amount - // as the menu container's padding. - , - shift: shift !== null && shift !== void 0 ? shift : dropdownMenuStore.parent ? -4 : 0, - hideOnHoverOutside: false, - "data-side": appliedPlacementSide, - wrapperProps: wrapperProps, - hideOnEscape: hideOnEscape, - unmountOnHide: true, - render: renderProps => - /*#__PURE__*/ - // Two wrappers are needed for the entry animation, where the menu - // container scales with a different factor than its contents. - // The {...renderProps} are passed to the inner wrapper, so that the - // menu element is the direct parent of the menu item elements. - (0,external_ReactJSXRuntime_namespaceObject.jsx)(MenuPopoverOuterWrapper, { - variant: variant, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MenuPopoverInnerWrapper, { - ...renderProps - }) - }), - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DropdownMenuContext.Provider, { - value: contextValue, - children: children - }) - })] + }), [menuStore, variant]); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(context_Context.Provider, { + value: contextValue, + children: children }); }; -const DropdownMenuV2 = Object.assign(contextConnect(dropdown_menu_v2_UnconnectedDropdownMenu, 'DropdownMenu'), { - Context: Object.assign(DropdownMenuContext, { - displayName: 'DropdownMenuV2.Context' + +/** + * Menu is a collection of React components that combine to render + * ARIA-compliant [menu](https://www.w3.org/WAI/ARIA/apg/patterns/menu/) and + * [menu button](https://www.w3.org/WAI/ARIA/apg/patterns/menubutton/) patterns. + * + * `Menu` itself is a wrapper component and context provider. + * It is responsible for managing the state of the menu and its items, and for + * rendering the `Menu.TriggerButton` (or the `Menu.SubmenuTriggerItem`) + * component, and the `Menu.Popover` component. + */ +const menu_Menu = Object.assign(contextConnectWithoutRef(UnconnectedMenu, 'Menu'), { + Context: Object.assign(context_Context, { + displayName: 'Menu.Context' }), - Item: Object.assign(DropdownMenuItem, { - displayName: 'DropdownMenuV2.Item' + /** + * Renders a menu item inside the `Menu.Popover` or `Menu.Group` components. + * + * It can optionally contain one instance of the `Menu.ItemLabel` component + * and one instance of the `Menu.ItemHelpText` component. + */ + Item: Object.assign(item_Item, { + displayName: 'Menu.Item' }), - RadioItem: Object.assign(DropdownMenuRadioItem, { - displayName: 'DropdownMenuV2.RadioItem' + /** + * Renders a radio menu item inside the `Menu.Popover` or `Menu.Group` + * components. + * + * It can optionally contain one instance of the `Menu.ItemLabel` component + * and one instance of the `Menu.ItemHelpText` component. + */ + RadioItem: Object.assign(RadioItem, { + displayName: 'Menu.RadioItem' }), - CheckboxItem: Object.assign(DropdownMenuCheckboxItem, { - displayName: 'DropdownMenuV2.CheckboxItem' + /** + * Renders a checkbox menu item inside the `Menu.Popover` or `Menu.Group` + * components. + * + * It can optionally contain one instance of the `Menu.ItemLabel` component + * and one instance of the `Menu.ItemHelpText` component. + */ + CheckboxItem: Object.assign(CheckboxItem, { + displayName: 'Menu.CheckboxItem' }), - Group: Object.assign(DropdownMenuGroup, { - displayName: 'DropdownMenuV2.Group' + /** + * Renders a group for menu items. + * + * It should contain one instance of `Menu.GroupLabel` and one or more + * instances of `Menu.Item`, `Menu.RadioItem`, or `Menu.CheckboxItem`. + */ + Group: Object.assign(group_Group, { + displayName: 'Menu.Group' }), - GroupLabel: Object.assign(group_label_DropdownMenuGroupLabel, { - displayName: 'DropdownMenuV2.GroupLabel' + /** + * Renders a label in a menu group. + * + * This component should be wrapped with `Menu.Group` so the + * `aria-labelledby` is correctly set on the group element. + */ + GroupLabel: Object.assign(group_label_GroupLabel, { + displayName: 'Menu.GroupLabel' }), - Separator: Object.assign(DropdownMenuSeparator, { - displayName: 'DropdownMenuV2.Separator' + /** + * Renders a divider between menu items or menu groups. + */ + Separator: Object.assign(separator_Separator, { + displayName: 'Menu.Separator' }), - ItemLabel: Object.assign(DropdownMenuItemLabel, { - displayName: 'DropdownMenuV2.ItemLabel' + /** + * Renders a menu item's label text. It should be wrapped with `Menu.Item`, + * `Menu.RadioItem`, or `Menu.CheckboxItem`. + */ + ItemLabel: Object.assign(ItemLabel, { + displayName: 'Menu.ItemLabel' }), - ItemHelpText: Object.assign(DropdownMenuItemHelpText, { - displayName: 'DropdownMenuV2.ItemHelpText' + /** + * Renders a menu item's help text. It should be wrapped with `Menu.Item`, + * `Menu.RadioItem`, or `Menu.CheckboxItem`. + */ + ItemHelpText: Object.assign(ItemHelpText, { + displayName: 'Menu.ItemHelpText' + }), + /** + * Renders a dropdown menu element that's controlled by a sibling + * `Menu.TriggerButton` component. It renders a popover and automatically + * focuses on items when the menu is shown. + * + * The only valid children of `Menu.Popover` are `Menu.Item`, + * `Menu.RadioItem`, `Menu.CheckboxItem`, `Menu.Group`, `Menu.Separator`, + * and `Menu` (for nested dropdown menus). + */ + Popover: Object.assign(menu_popover_Popover, { + displayName: 'Menu.Popover' + }), + /** + * Renders a menu button that toggles the visibility of a sibling + * `Menu.Popover` component when clicked or when using arrow keys. + */ + TriggerButton: Object.assign(TriggerButton, { + displayName: 'Menu.TriggerButton' + }), + /** + * Renders a menu item that toggles the visibility of a sibling + * `Menu.Popover` component when clicked or when using arrow keys. + * + * This component is used to create a nested dropdown menu. + */ + SubmenuTriggerItem: Object.assign(SubmenuTriggerItem, { + displayName: 'Menu.SubmenuTriggerItem' }) }); -/* harmony default export */ const dropdown_menu_v2 = ((/* unused pure expression or super */ null && (DropdownMenuV2))); +/* harmony default export */ const build_module_menu = ((/* unused pure expression or super */ null && (menu_Menu))); ;// ./node_modules/@wordpress/components/build-module/theme/styles.js @@ -70791,6 +71671,7 @@ const theme_styles_Wrapper = /*#__PURE__*/emotion_styled_base_browser_esm("div", } : 0); ;// ./node_modules/@wordpress/components/build-module/theme/color-algorithms.js +/* wp:polyfill */ /** * External dependencies */ @@ -70963,6 +71844,7 @@ const useTabsContext = () => (0,external_wp_element_namespaceObject.useContext)( ;// ./node_modules/@wordpress/components/build-module/tabs/styles.js +function tabs_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } /** * External dependencies */ @@ -70974,15 +71856,25 @@ const useTabsContext = () => (0,external_wp_element_namespaceObject.useContext)( */ -const TabListWrapper = /*#__PURE__*/emotion_styled_base_browser_esm("div", true ? { - target: "enfox0g2" -} : 0)("position:relative;display:flex;align-items:stretch;flex-direction:row;text-align:center;&[aria-orientation='vertical']{flex-direction:column;text-align:start;}@media not ( prefers-reduced-motion ){&.is-animation-enabled::after{transition-property:transform;transition-duration:0.2s;transition-timing-function:ease-out;}}--direction-factor:1;--direction-origin-x:left;--indicator-start:var( --indicator-left );&:dir( rtl ){--direction-factor:-1;--direction-origin-x:right;--indicator-start:var( --indicator-right );}&::after{content:'';position:absolute;pointer-events:none;transform-origin:var( --direction-origin-x ) top;outline:2px solid transparent;outline-offset:-1px;}--antialiasing-factor:100;&:not( [aria-orientation='vertical'] ){&::after{bottom:0;height:0;width:calc( var( --antialiasing-factor ) * 1px );transform:translateX(\n\t\t\t\t\tcalc(\n\t\t\t\t\t\tvar( --indicator-start ) * var( --direction-factor ) *\n\t\t\t\t\t\t\t1px\n\t\t\t\t\t)\n\t\t\t\t) scaleX(\n\t\t\t\t\tcalc(\n\t\t\t\t\t\tvar( --indicator-width ) / var( --antialiasing-factor )\n\t\t\t\t\t)\n\t\t\t\t);border-bottom:var( --wp-admin-border-width-focus ) solid ", COLORS.theme.accent, ";}}&[aria-orientation='vertical']::after{z-index:-1;top:0;left:0;width:100%;height:calc( var( --antialiasing-factor ) * 1px );transform:translateY( calc( var( --indicator-top ) * 1px ) ) scaleY(\n\t\t\t\tcalc( var( --indicator-height ) / var( --antialiasing-factor ) )\n\t\t\t);background-color:", COLORS.theme.gray[100], ";}" + ( true ? "" : 0)); + +const StyledTabList = /*#__PURE__*/emotion_styled_base_browser_esm(TabList, true ? { + target: "enfox0g4" +} : 0)("display:flex;align-items:stretch;overflow-x:auto;&[aria-orientation='vertical']{flex-direction:column;}:where( [aria-orientation='horizontal'] ){width:fit-content;}--direction-factor:1;--direction-start:left;--direction-end:right;--selected-start:var( --selected-left, 0 );&:dir( rtl ){--direction-factor:-1;--direction-start:right;--direction-end:left;--selected-start:var( --selected-right, 0 );}@media not ( prefers-reduced-motion ){&[data-indicator-animated]::before{transition-property:transform,border-radius,border-block;transition-duration:0.2s;transition-timing-function:ease-out;}}position:relative;&::before{content:'';position:absolute;pointer-events:none;transform-origin:var( --direction-start ) top;outline:2px solid transparent;outline-offset:-1px;}--antialiasing-factor:100;&[aria-orientation='horizontal']{--fade-width:4rem;--fade-gradient-base:transparent 0%,black var( --fade-width );--fade-gradient-composed:var( --fade-gradient-base ),black 60%,transparent 50%;&.is-overflowing-first{mask-image:linear-gradient(\n\t\t\t\tto var( --direction-end ),\n\t\t\t\tvar( --fade-gradient-base )\n\t\t\t);}&.is-overflowing-last{mask-image:linear-gradient(\n\t\t\t\tto var( --direction-start ),\n\t\t\t\tvar( --fade-gradient-base )\n\t\t\t);}&.is-overflowing-first.is-overflowing-last{mask-image:linear-gradient(\n\t\t\t\t\tto right,\n\t\t\t\t\tvar( --fade-gradient-composed )\n\t\t\t\t),linear-gradient( to left, var( --fade-gradient-composed ) );}&::before{bottom:0;height:0;width:calc( var( --antialiasing-factor ) * 1px );transform:translateX(\n\t\t\t\t\tcalc(\n\t\t\t\t\t\tvar( --selected-start ) * var( --direction-factor ) *\n\t\t\t\t\t\t\t1px\n\t\t\t\t\t)\n\t\t\t\t) scaleX(\n\t\t\t\t\tcalc(\n\t\t\t\t\t\tvar( --selected-width, 0 ) /\n\t\t\t\t\t\t\tvar( --antialiasing-factor )\n\t\t\t\t\t)\n\t\t\t\t);border-bottom:var( --wp-admin-border-width-focus ) solid ", COLORS.theme.accent, ";}}&[aria-orientation='vertical']{&::before{border-radius:", config_values.radiusSmall, "/calc(\n\t\t\t\t\t", config_values.radiusSmall, " /\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\tvar( --selected-height, 0 ) /\n\t\t\t\t\t\t\t\tvar( --antialiasing-factor )\n\t\t\t\t\t\t)\n\t\t\t\t);top:0;left:0;width:100%;height:calc( var( --antialiasing-factor ) * 1px );transform:translateY( calc( var( --selected-top, 0 ) * 1px ) ) scaleY(\n\t\t\t\t\tcalc(\n\t\t\t\t\t\tvar( --selected-height, 0 ) /\n\t\t\t\t\t\t\tvar( --antialiasing-factor )\n\t\t\t\t\t)\n\t\t\t\t);background-color:color-mix(\n\t\t\t\tin srgb,\n\t\t\t\t", COLORS.theme.accent, ",\n\t\t\t\ttransparent 96%\n\t\t\t);}&[data-select-on-move='true']:has(\n\t\t\t\t:is( :focus-visible, [data-focus-visible] )\n\t\t\t)::before{box-sizing:border-box;border:var( --wp-admin-border-width-focus ) solid ", COLORS.theme.accent, ";border-block-width:calc(\n\t\t\t\tvar( --wp-admin-border-width-focus, 1px ) /\n\t\t\t\t\t(\n\t\t\t\t\t\tvar( --selected-height, 0 ) /\n\t\t\t\t\t\t\tvar( --antialiasing-factor )\n\t\t\t\t\t)\n\t\t\t);}}" + ( true ? "" : 0)); const styles_Tab = /*#__PURE__*/emotion_styled_base_browser_esm(Tab, true ? { + target: "enfox0g3" +} : 0)("&{border-radius:0;background:transparent;border:none;box-shadow:none;flex:1 0 auto;white-space:nowrap;display:flex;align-items:center;cursor:pointer;line-height:1.2;font-weight:400;color:", COLORS.theme.foreground, ";position:relative;&[aria-disabled='true']{cursor:default;color:", COLORS.ui.textDisabled, ";}&:not( [aria-disabled='true'] ):is( :hover, [data-focus-visible] ){color:", COLORS.theme.accent, ";}&:focus:not( :disabled ){box-shadow:none;outline:none;}&::after{position:absolute;pointer-events:none;outline:var( --wp-admin-border-width-focus ) solid ", COLORS.theme.accent, ";border-radius:", config_values.radiusSmall, ";opacity:0;@media not ( prefers-reduced-motion ){transition:opacity 0.1s linear;}}&[data-focus-visible]::after{opacity:1;}}[aria-orientation='horizontal'] &{padding-inline:", space(4), ";height:", space(12), ";scroll-margin:24px;&::after{content:'';inset:", space(3), ";}}[aria-orientation='vertical'] &{padding:", space(2), " ", space(3), ";min-height:", space(10), ";&[aria-selected='true']{color:", COLORS.theme.accent, ";fill:currentColor;}}[aria-orientation='vertical'][data-select-on-move='false'] &::after{content:'';inset:var( --wp-admin-border-width-focus );}" + ( true ? "" : 0)); +const TabChildren = /*#__PURE__*/emotion_styled_base_browser_esm("span", true ? { + target: "enfox0g2" +} : 0)( true ? { + name: "9at4z3", + styles: "flex-grow:1;display:flex;align-items:center;[aria-orientation='horizontal'] &{justify-content:center;}[aria-orientation='vertical'] &{justify-content:start;}" +} : 0); +const TabChevron = /*#__PURE__*/emotion_styled_base_browser_esm(build_module_icon, true ? { target: "enfox0g1" -} : 0)("&{display:inline-flex;align-items:center;position:relative;border-radius:0;min-height:", space(12), ";height:auto;background:transparent;border:none;box-shadow:none;cursor:pointer;line-height:1.2;padding:", space(3), " ", space(4), ";margin-left:0;font-weight:500;text-align:inherit;hyphens:auto;color:", COLORS.theme.foreground, ";&[aria-disabled='true']{cursor:default;color:", COLORS.ui.textDisabled, ";}&:not( [aria-disabled='true'] ):hover{color:", COLORS.theme.accent, ";}&:focus:not( :disabled ){position:relative;box-shadow:none;outline:none;}&::before{content:'';position:absolute;top:", space(3), ";right:", space(3), ";bottom:", space(3), ";left:", space(3), ";pointer-events:none;outline:var( --wp-admin-border-width-focus ) solid ", COLORS.theme.accent, ";border-radius:", config_values.radiusSmall, ";opacity:0;@media not ( prefers-reduced-motion ){transition:opacity 0.1s linear;}}&:focus-visible::before{opacity:1;}}[aria-orientation='vertical'] &{min-height:", space(10), ";}" + ( true ? "" : 0)); +} : 0)("flex-shrink:0;margin-inline-end:", space(-1), ";[aria-orientation='horizontal'] &{display:none;}opacity:0;[role='tab']:is( [aria-selected='true'], [data-focus-visible], :hover ) &{opacity:1;}@media not ( prefers-reduced-motion ){[data-select-on-move='true'] [role='tab']:is( [aria-selected='true'], ) &{transition:opacity 0.15s 0.15s linear;}}&:dir( rtl ){rotate:180deg;}" + ( true ? "" : 0)); const styles_TabPanel = /*#__PURE__*/emotion_styled_base_browser_esm(TabPanel, true ? { target: "enfox0g0" -} : 0)("&:focus{box-shadow:none;outline:none;}&:focus-visible{box-shadow:0 0 0 var( --wp-admin-border-width-focus ) ", COLORS.theme.accent, ";outline:2px solid transparent;outline-offset:0;}" + ( true ? "" : 0)); +} : 0)("&:focus{box-shadow:none;outline:none;}&[data-focus-visible]{box-shadow:0 0 0 var( --wp-admin-border-width-focus ) ", COLORS.theme.accent, ";outline:2px solid transparent;outline-offset:0;}" + ( true ? "" : 0)); ;// ./node_modules/@wordpress/components/build-module/tabs/tab.js /** @@ -70999,6 +71891,7 @@ const styles_TabPanel = /*#__PURE__*/emotion_styled_base_browser_esm(TabPanel, + const tab_Tab = (0,external_wp_element_namespaceObject.forwardRef)(function Tab({ children, tabId, @@ -71006,217 +71899,96 @@ const tab_Tab = (0,external_wp_element_namespaceObject.forwardRef)(function Tab( render, ...otherProps }, ref) { - const context = useTabsContext(); - if (!context) { - true ? external_wp_warning_default()('`Tabs.Tab` must be wrapped in a `Tabs` component.') : 0; - return null; - } + var _useTabsContext; const { store, instanceId - } = context; + } = (_useTabsContext = useTabsContext()) !== null && _useTabsContext !== void 0 ? _useTabsContext : {}; + if (!store) { + true ? external_wp_warning_default()('`Tabs.Tab` must be wrapped in a `Tabs` component.') : 0; + return null; + } const instancedTabId = `${instanceId}-${tabId}`; - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(styles_Tab, { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(styles_Tab, { ref: ref, store: store, id: instancedTabId, disabled: disabled, render: render, ...otherProps, - children: children + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TabChildren, { + children: children + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TabChevron, { + icon: chevron_right + })] }); }); -;// ./node_modules/@wordpress/components/build-module/utils/hooks/use-event.js +;// ./node_modules/@wordpress/components/build-module/tabs/use-track-overflow.js /* eslint-disable jsdoc/require-param */ /** * WordPress dependencies */ -/** - * Any function. - */ /** - * Creates a stable callback function that has access to the latest state and - * can be used within event handlers and effect callbacks. Throws when used in - * the render phase. + * Tracks if an element contains overflow and on which end by tracking the + * first and last child elements with an `IntersectionObserver` in relation + * to the parent element. * - * @example - * - * ```tsx - * function Component(props) { - * const onClick = useEvent(props.onClick); - * React.useEffect(() => {}, [onClick]); - * } - * ``` + * Note that the returned value will only indicate whether the first or last + * element is currently "going out of bounds" but not whether it happens on + * the X or Y axis. */ -function use_event_useEvent(callback) { - const ref = (0,external_wp_element_namespaceObject.useRef)(() => { - throw new Error('Cannot call an event handler while rendering.'); - }); - (0,external_wp_element_namespaceObject.useInsertionEffect)(() => { - ref.current = callback; - }); - return (0,external_wp_element_namespaceObject.useCallback)((...args) => ref.current?.(...args), []); -} -/* eslint-enable jsdoc/require-param */ - -;// ./node_modules/@wordpress/components/build-module/utils/element-rect.js -/* eslint-disable jsdoc/require-param */ -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - - -/** - * The position and dimensions of an element, relative to its offset parent. - */ - -/** - * An `ElementOffsetRect` object with all values set to zero. - */ -const NULL_ELEMENT_OFFSET_RECT = { - top: 0, - right: 0, - bottom: 0, - left: 0, - width: 0, - height: 0 -}; - -/** - * Returns the position and dimensions of an element, relative to its offset - * parent, with subpixel precision. Values reflect the real measures before any - * potential scaling distortions along the X and Y axes. - * - * Useful in contexts where plain `getBoundingClientRect` calls or `ResizeObserver` - * entries are not suitable, such as when the element is transformed, and when - * `element.offset` methods are not precise enough. - * - * **Note:** in some contexts, like when the scale is 0, this method will fail - * because it's impossible to calculate a scaling ratio. When that happens, it - * will return `undefined`. - */ -function getElementOffsetRect(element) { - var _element$offsetParent; - // Position and dimension values computed with `getBoundingClientRect` have - // subpixel precision, but are affected by distortions since they represent - // the "real" measures, or in other words, the actual final values as rendered - // by the browser. - const rect = element.getBoundingClientRect(); - if (rect.width === 0 || rect.height === 0) { - return; - } - const offsetParentRect = (_element$offsetParent = element.offsetParent?.getBoundingClientRect()) !== null && _element$offsetParent !== void 0 ? _element$offsetParent : NULL_ELEMENT_OFFSET_RECT; - - // Computed widths and heights have subpixel precision, and are not affected - // by distortions. - const computedWidth = parseFloat(getComputedStyle(element).width); - const computedHeight = parseFloat(getComputedStyle(element).height); - - // We can obtain the current scale factor for the element by comparing "computed" - // dimensions with the "real" ones. - const scaleX = computedWidth / rect.width; - const scaleY = computedHeight / rect.height; - return { - // To obtain the adjusted values for the position: - // 1. Compute the element's position relative to the offset parent. - // 2. Correct for the scale factor. - top: (rect.top - offsetParentRect?.top) * scaleY, - right: (offsetParentRect?.right - rect.right) * scaleX, - bottom: (offsetParentRect?.bottom - rect.bottom) * scaleY, - left: (rect.left - offsetParentRect?.left) * scaleX, - // Computed dimensions don't need any adjustments. - width: computedWidth, - height: computedHeight - }; -} -const POLL_RATE = 100; - -/** - * Tracks the position and dimensions of an element, relative to its offset - * parent. The element can be changed dynamically. - * - * **Note:** sometimes, the measurement will fail (see `getElementOffsetRect`'s - * documentation for more details). When that happens, this hook will attempt - * to measure again after a frame, and if that fails, it will poll every 100 - * milliseconds until it succeeds. - */ -function useTrackElementOffsetRect(targetElement) { - const [indicatorPosition, setIndicatorPosition] = (0,external_wp_element_namespaceObject.useState)(NULL_ELEMENT_OFFSET_RECT); - const intervalRef = (0,external_wp_element_namespaceObject.useRef)(); - const measure = use_event_useEvent(() => { - if (targetElement) { - const elementOffsetRect = getElementOffsetRect(targetElement); - if (elementOffsetRect) { - setIndicatorPosition(elementOffsetRect); - clearInterval(intervalRef.current); - return true; +function useTrackOverflow(parent, children) { + const [first, setFirst] = (0,external_wp_element_namespaceObject.useState)(false); + const [last, setLast] = (0,external_wp_element_namespaceObject.useState)(false); + const [observer, setObserver] = (0,external_wp_element_namespaceObject.useState)(); + const callback = (0,external_wp_compose_namespaceObject.useEvent)(entries => { + for (const entry of entries) { + if (entry.target === children.first) { + setFirst(!entry.isIntersecting); + } + if (entry.target === children.last) { + setLast(!entry.isIntersecting); } - } else { - clearInterval(intervalRef.current); - } - return false; - }); - const setElement = (0,external_wp_compose_namespaceObject.useResizeObserver)(() => { - if (!measure()) { - requestAnimationFrame(() => { - if (!measure()) { - intervalRef.current = setInterval(measure, POLL_RATE); - } - }); } }); - (0,external_wp_element_namespaceObject.useLayoutEffect)(() => setElement(targetElement), [setElement, targetElement]); - return indicatorPosition; -} - -/* eslint-enable jsdoc/require-param */ - -;// ./node_modules/@wordpress/components/build-module/utils/hooks/use-on-value-update.js -/* eslint-disable jsdoc/require-param */ -/** - * WordPress dependencies - */ - -/** - * Internal dependencies - */ - - -/** - * Context object for the `onUpdate` callback of `useOnValueUpdate`. - */ - -/** - * Calls the `onUpdate` callback when the `value` changes. - */ -function useOnValueUpdate( -/** - * The value to watch for changes. - */ -value, -/** - * Callback to fire when the value changes. - */ -onUpdate) { - const previousValueRef = (0,external_wp_element_namespaceObject.useRef)(value); - const updateCallbackEvent = use_event_useEvent(onUpdate); (0,external_wp_element_namespaceObject.useEffect)(() => { - if (previousValueRef.current !== value) { - updateCallbackEvent({ - previousValue: previousValueRef.current - }); - previousValueRef.current = value; + if (!parent || !window.IntersectionObserver) { + return; } - }, [updateCallbackEvent, value]); + const newObserver = new IntersectionObserver(callback, { + root: parent, + threshold: 0.9 + }); + setObserver(newObserver); + return () => newObserver.disconnect(); + }, [callback, parent]); + (0,external_wp_element_namespaceObject.useEffect)(() => { + if (!observer) { + return; + } + if (children.first) { + observer.observe(children.first); + } + if (children.last) { + observer.observe(children.last); + } + return () => { + if (children.first) { + observer.unobserve(children.first); + } + if (children.last) { + observer.unobserve(children.last); + } + }; + }, [children.first, children.last, observer]); + return { + first, + last + }; } /* eslint-enable jsdoc/require-param */ @@ -71233,6 +72005,7 @@ onUpdate) { + /** * Internal dependencies */ @@ -71243,32 +72016,87 @@ onUpdate) { -const TabList = (0,external_wp_element_namespaceObject.forwardRef)(function TabList({ +const DEFAULT_SCROLL_MARGIN = 24; + +/** + * Scrolls a given parent element so that a given rect is visible. + * + * The scroll is updated initially and whenever the rect changes. + */ +function useScrollRectIntoView(parent, rect, { + margin = DEFAULT_SCROLL_MARGIN +} = {}) { + (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { + if (!parent || !rect) { + return; + } + const { + scrollLeft: parentScroll + } = parent; + const parentWidth = parent.getBoundingClientRect().width; + const { + left: childLeft, + width: childWidth + } = rect; + const parentRightEdge = parentScroll + parentWidth; + const childRightEdge = childLeft + childWidth; + const rightOverflow = childRightEdge + margin - parentRightEdge; + const leftOverflow = parentScroll - (childLeft - margin); + let scrollLeft = null; + if (leftOverflow > 0) { + scrollLeft = parentScroll - leftOverflow; + } else if (rightOverflow > 0) { + scrollLeft = parentScroll + rightOverflow; + } + if (scrollLeft !== null) { + /** + * The optional chaining is used here to avoid unit test failures. + * It can be removed when JSDOM supports `Element` scroll methods. + * See: https://github.com/WordPress/gutenberg/pull/66498#issuecomment-2441146096 + */ + parent.scroll?.({ + left: scrollLeft + }); + } + }, [margin, parent, rect]); +} +const tablist_TabList = (0,external_wp_element_namespaceObject.forwardRef)(function TabList({ children, ...otherProps }, ref) { - const context = useTabsContext(); - const tabStoreState = useStoreState(context?.store); - const selectedId = tabStoreState?.selectedId; - const indicatorPosition = useTrackElementOffsetRect(context?.store.item(selectedId)?.element); - const [animationEnabled, setAnimationEnabled] = (0,external_wp_element_namespaceObject.useState)(false); - useOnValueUpdate(selectedId, ({ - previousValue - }) => previousValue && setAnimationEnabled(true)); - if (!context || !tabStoreState) { - true ? external_wp_warning_default()('`Tabs.TabList` must be wrapped in a `Tabs` component.') : 0; - return null; - } + var _useTabsContext; const { store - } = context; - const { - activeId, - selectOnMove - } = tabStoreState; - const { - setActiveId - } = store; + } = (_useTabsContext = useTabsContext()) !== null && _useTabsContext !== void 0 ? _useTabsContext : {}; + const selectedId = useStoreState(store, 'selectedId'); + const activeId = useStoreState(store, 'activeId'); + const selectOnMove = useStoreState(store, 'selectOnMove'); + const items = useStoreState(store, 'items'); + const [parent, setParent] = (0,external_wp_element_namespaceObject.useState)(); + const refs = (0,external_wp_compose_namespaceObject.useMergeRefs)([ref, setParent]); + const selectedItem = store?.item(selectedId); + const renderedItems = useStoreState(store, 'renderedItems'); + const selectedItemIndex = renderedItems && selectedItem ? renderedItems.indexOf(selectedItem) : -1; + // Use selectedItemIndex as a dependency to force recalculation when the + // selected item index changes (elements are swapped / added / removed). + const selectedRect = useTrackElementOffsetRect(selectedItem?.element, [selectedItemIndex]); + + // Track overflow to show scroll hints. + const overflow = useTrackOverflow(parent, { + first: items?.at(0)?.element, + last: items?.at(-1)?.element + }); + + // Size, position, and animate the indicator. + useAnimatedOffsetRect(parent, selectedRect, { + prefix: 'selected', + dataAttribute: 'indicator-animated', + transitionEndFilter: event => event.pseudoElement === '::before', + roundRect: true + }); + + // Make sure selected tab is scrolled into view. + useScrollRectIntoView(parent, selectedRect); const onBlur = () => { if (!selectOnMove) { return; @@ -71279,30 +72107,29 @@ const TabList = (0,external_wp_element_namespaceObject.forwardRef)(function TabL // that the selected tab will receive keyboard focus when tabbing back into // the tablist. if (selectedId !== activeId) { - setActiveId(selectedId); + store?.setActiveId(selectedId); } }; - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(tab_list_TabList, { - ref: ref, + if (!store) { + true ? external_wp_warning_default()('`Tabs.TabList` must be wrapped in a `Tabs` component.') : 0; + return null; + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(StyledTabList, { + ref: refs, store: store, - render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TabListWrapper, { - onTransitionEnd: event => { - if (event.pseudoElement === '::after') { - setAnimationEnabled(false); - } - } - }), - onBlur: onBlur, - ...otherProps, - style: { - '--indicator-top': indicatorPosition.top, - '--indicator-right': indicatorPosition.right, - '--indicator-left': indicatorPosition.left, - '--indicator-width': indicatorPosition.width, - '--indicator-height': indicatorPosition.height, - ...otherProps.style + render: props => { + var _props$tabIndex; + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + ...props, + // Fallback to -1 to prevent browsers from making the tablist + // tabbable when it is a scrolling container. + tabIndex: (_props$tabIndex = props.tabIndex) !== null && _props$tabIndex !== void 0 ? _props$tabIndex : -1 + }); }, - className: dist_clsx(animationEnabled ? 'is-animation-enabled' : '', otherProps.className), + onBlur: onBlur, + "data-select-on-move": selectOnMove ? 'true' : 'false', + ...otherProps, + className: dist_clsx(overflow.first && 'is-overflowing-first', overflow.last && 'is-overflowing-last', otherProps.className), children: children }); }); @@ -71359,18 +72186,19 @@ const tabpanel_TabPanel = (0,external_wp_element_namespaceObject.forwardRef)(fun }); ;// ./node_modules/@wordpress/components/build-module/tabs/index.js +/* wp:polyfill */ /** * External dependencies */ - /** * WordPress dependencies */ + /** * Internal dependencies */ @@ -71380,128 +72208,58 @@ const tabpanel_TabPanel = (0,external_wp_element_namespaceObject.forwardRef)(fun -function Tabs({ +function externalToInternalTabId(externalId, instanceId) { + return externalId && `${instanceId}-${externalId}`; +} +function internalToExternalTabId(internalId, instanceId) { + return typeof internalId === 'string' ? internalId.replace(`${instanceId}-`, '') : internalId; +} + +/** + * Tabs is a collection of React components that combine to render + * an [ARIA-compliant tabs pattern](https://www.w3.org/WAI/ARIA/apg/patterns/tabs/). + * + * Tabs organizes content across different screens, data sets, and interactions. + * It has two sections: a list of tabs, and the view to show when a tab is chosen. + * + * `Tabs` itself is a wrapper component and context provider. + * It is responsible for managing the state of the tabs, and rendering one instance of the `Tabs.TabList` component and one or more instances of the `Tab.TabPanel` component. + */ +const Tabs = Object.assign(function Tabs({ selectOnMove = true, defaultTabId, orientation = 'horizontal', onSelect, children, - selectedTabId + selectedTabId, + activeTabId, + defaultActiveTabId, + onActiveTabIdChange }) { const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(Tabs, 'tabs'); const store = useTabStore({ selectOnMove, orientation, - defaultSelectedId: defaultTabId && `${instanceId}-${defaultTabId}`, - setSelectedId: selectedId => { - const strippedDownId = typeof selectedId === 'string' ? selectedId.replace(`${instanceId}-`, '') : selectedId; - onSelect?.(strippedDownId); + defaultSelectedId: externalToInternalTabId(defaultTabId, instanceId), + setSelectedId: newSelectedId => { + onSelect?.(internalToExternalTabId(newSelectedId, instanceId)); }, - selectedId: selectedTabId && `${instanceId}-${selectedTabId}` + selectedId: externalToInternalTabId(selectedTabId, instanceId), + defaultActiveId: externalToInternalTabId(defaultActiveTabId, instanceId), + setActiveId: newActiveId => { + onActiveTabIdChange?.(internalToExternalTabId(newActiveId, instanceId)); + }, + activeId: externalToInternalTabId(activeTabId, instanceId), + rtl: (0,external_wp_i18n_namespaceObject.isRTL)() }); - const isControlled = selectedTabId !== undefined; const { items, - selectedId, activeId } = useStoreState(store); const { - setSelectedId, setActiveId } = store; - - // Keep track of whether tabs have been populated. This is used to prevent - // certain effects from firing too early while tab data and relevant - // variables are undefined during the initial render. - const tabsHavePopulatedRef = (0,external_wp_element_namespaceObject.useRef)(false); - if (items.length > 0) { - tabsHavePopulatedRef.current = true; - } - const selectedTab = items.find(item => item.id === selectedId); - const firstEnabledTab = items.find(item => { - // Ariakit internally refers to disabled tabs as `dimmed`. - return !item.dimmed; - }); - const initialTab = items.find(item => item.id === `${instanceId}-${defaultTabId}`); - - // Handle selecting the initial tab. - (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { - if (isControlled) { - return; - } - - // Wait for the denoted initial tab to be declared before making a - // selection. This ensures that if a tab is declared lazily it can - // still receive initial selection, as well as ensuring no tab is - // selected if an invalid `defaultTabId` is provided. - if (defaultTabId && !initialTab) { - return; - } - - // If the currently selected tab is missing (i.e. removed from the DOM), - // fall back to the initial tab or the first enabled tab if there is - // one. Otherwise, no tab should be selected. - if (!items.find(item => item.id === selectedId)) { - if (initialTab && !initialTab.dimmed) { - setSelectedId(initialTab?.id); - return; - } - if (firstEnabledTab) { - setSelectedId(firstEnabledTab.id); - } else if (tabsHavePopulatedRef.current) { - setSelectedId(null); - } - } - }, [firstEnabledTab, initialTab, defaultTabId, isControlled, items, selectedId, setSelectedId]); - - // Handle the currently selected tab becoming disabled. - (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { - if (!selectedTab?.dimmed) { - return; - } - - // In controlled mode, we trust that disabling tabs is done - // intentionally, and don't select a new tab automatically. - if (isControlled) { - setSelectedId(null); - return; - } - - // If the currently selected tab becomes disabled, fall back to the - // `defaultTabId` if possible. Otherwise select the first - // enabled tab (if there is one). - if (initialTab && !initialTab.dimmed) { - setSelectedId(initialTab.id); - return; - } - if (firstEnabledTab) { - setSelectedId(firstEnabledTab.id); - } - }, [firstEnabledTab, initialTab, isControlled, selectedTab?.dimmed, setSelectedId]); - - // Clear `selectedId` if the active tab is removed from the DOM in controlled mode. - (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { - if (!isControlled) { - return; - } - - // Once the tabs have populated, if the `selectedTabId` still can't be - // found, clear the selection. - if (tabsHavePopulatedRef.current && !!selectedTabId && !selectedTab) { - setSelectedId(null); - } - }, [isControlled, selectedTab, selectedTabId, setSelectedId]); (0,external_wp_element_namespaceObject.useEffect)(() => { - // If there is no active tab, fallback to place focus on the first enabled tab - // so there is always an active element - if (selectedTabId === null && !activeId && firstEnabledTab?.id) { - setActiveId(firstEnabledTab.id); - } - }, [selectedTabId, activeId, firstEnabledTab?.id, setActiveId]); - (0,external_wp_element_namespaceObject.useEffect)(() => { - if (!isControlled) { - return; - } requestAnimationFrame(() => { const focusedElement = items?.[0]?.element?.ownerDocument.activeElement; if (!focusedElement || !items.some(item => focusedElement === item.element)) { @@ -71516,7 +72274,7 @@ function Tabs({ setActiveId(focusedElement.id); } }); - }, [activeId, isControlled, items, setActiveId]); + }, [activeId, items, setActiveId]); const contextValue = (0,external_wp_element_namespaceObject.useMemo)(() => ({ store, instanceId @@ -71525,12 +72283,34 @@ function Tabs({ value: contextValue, children: children }); -} -Tabs.TabList = TabList; -Tabs.Tab = tab_Tab; -Tabs.TabPanel = tabpanel_TabPanel; -Tabs.Context = TabsContext; -/* harmony default export */ const tabs = (Tabs); +}, { + /** + * Renders a single tab. + * + * The currently active tab receives default styling that can be + * overridden with CSS targeting `[aria-selected="true"]`. + */ + Tab: Object.assign(tab_Tab, { + displayName: 'Tabs.Tab' + }), + /** + * A wrapper component for the `Tab` components. + * + * It is responsible for rendering the list of tabs. + */ + TabList: Object.assign(tablist_TabList, { + displayName: 'Tabs.TabList' + }), + /** + * Renders the content to display for a single tab once that tab is selected. + */ + TabPanel: Object.assign(tabpanel_TabPanel, { + displayName: 'Tabs.TabPanel' + }), + Context: Object.assign(TabsContext, { + displayName: 'Tabs.Context' + }) +}); ;// external ["wp","privateApis"] const external_wp_privateApis_namespaceObject = window["wp"]["privateApis"]; @@ -71544,6 +72324,138 @@ const { unlock } = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/components'); +;// ./node_modules/@wordpress/icons/build-module/library/info.js +/** + * WordPress dependencies + */ + + +const info = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + viewBox: "0 0 24 24", + xmlns: "http://www.w3.org/2000/svg", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M5.5 12a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0ZM12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm.75 4v1.5h-1.5V8h1.5Zm0 8v-5h-1.5v5h1.5Z" + }) +}); +/* harmony default export */ const library_info = (info); + +;// ./node_modules/@wordpress/icons/build-module/library/published.js +/** + * WordPress dependencies + */ + + +const published = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm11.53-1.47-1.06-1.06L11 12.94l-1.47-1.47-1.06 1.06L11 15.06l4.53-4.53Z" + }) +}); +/* harmony default export */ const library_published = (published); + +;// ./node_modules/@wordpress/icons/build-module/library/caution.js +/** + * WordPress dependencies + */ + + +const caution = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + viewBox: "0 0 24 24", + xmlns: "http://www.w3.org/2000/svg", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M5.5 12a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0ZM12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm-.75 12v-1.5h1.5V16h-1.5Zm0-8v5h1.5V8h-1.5Z" + }) +}); +/* harmony default export */ const library_caution = (caution); + +;// ./node_modules/@wordpress/icons/build-module/library/error.js +/** + * WordPress dependencies + */ + + +const error = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + viewBox: "0 0 24 24", + xmlns: "http://www.w3.org/2000/svg", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M12.218 5.377a.25.25 0 0 0-.436 0l-7.29 12.96a.25.25 0 0 0 .218.373h14.58a.25.25 0 0 0 .218-.372l-7.29-12.96Zm-1.743-.735c.669-1.19 2.381-1.19 3.05 0l7.29 12.96a1.75 1.75 0 0 1-1.525 2.608H4.71a1.75 1.75 0 0 1-1.525-2.608l7.29-12.96ZM12.75 17.46h-1.5v-1.5h1.5v1.5Zm-1.5-3h1.5v-5h-1.5v5Z" + }) +}); +/* harmony default export */ const library_error = (error); + +;// ./node_modules/@wordpress/components/build-module/badge/index.js +/** + * External dependencies + */ + + +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + + +/** + * Returns an icon based on the badge context. + * + * @return The corresponding icon for the provided context. + */ + +function contextBasedIcon(intent = 'default') { + switch (intent) { + case 'info': + return library_info; + case 'success': + return library_published; + case 'warning': + return library_caution; + case 'error': + return library_error; + default: + return null; + } +} +function Badge({ + className, + intent = 'default', + children, + ...props +}) { + const icon = contextBasedIcon(intent); + const hasIcon = !!icon; + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("span", { + className: dist_clsx('components-badge', className, { + [`is-${intent}`]: intent, + 'has-icon': hasIcon + }), + ...props, + children: [hasIcon && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, { + icon: icon, + size: 16, + fill: "currentColor", + className: "components-badge__icon" + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { + className: "components-badge__content", + children: children + })] + }); +} +/* harmony default export */ const badge = (Badge); + ;// ./node_modules/@wordpress/components/build-module/private-apis.js /** * Internal dependencies @@ -71559,12 +72471,12 @@ const { const privateApis = {}; lock(privateApis, { __experimentalPopoverLegacyPositionToPlacement: positionToPlacement, - createPrivateSlotFill: createPrivateSlotFill, ComponentsContext: ComponentsContext, - Tabs: tabs, + Tabs: Tabs, Theme: theme, - DropdownMenuV2: DropdownMenuV2, - kebabCase: kebabCase + Menu: menu_Menu, + kebabCase: kebabCase, + Badge: badge }); ;// ./node_modules/@wordpress/components/build-module/index.js @@ -71690,6 +72602,7 @@ lock(privateApis, { + // Higher-Order Components. diff --git a/wp-includes/js/dist/components.min.js b/wp-includes/js/dist/components.min.js index 5124e06731..2a33dec72e 100644 --- a/wp-includes/js/dist/components.min.js +++ b/wp-includes/js/dist/components.min.js @@ -1,5 +1,5 @@ /*! This file is auto-generated */ -(()=>{var e,t,n={66:e=>{"use strict";var t=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===n}(e)}(e)};var n="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function r(e,t){return!1!==t.clone&&t.isMergeableObject(e)?l((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function o(e,t,n){return e.concat(t).map((function(e){return r(e,n)}))}function i(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return Object.propertyIsEnumerable.call(e,t)})):[]}(e))}function s(e,t){try{return t in e}catch(e){return!1}}function a(e,t,n){var o={};return n.isMergeableObject(e)&&i(e).forEach((function(t){o[t]=r(e[t],n)})),i(t).forEach((function(i){(function(e,t){return s(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,i)||(s(e,i)&&n.isMergeableObject(t[i])?o[i]=function(e,t){if(!t.customMerge)return l;var n=t.customMerge(e);return"function"==typeof n?n:l}(i,n)(e[i],t[i],n):o[i]=r(t[i],n))})),o}function l(e,n,i){(i=i||{}).arrayMerge=i.arrayMerge||o,i.isMergeableObject=i.isMergeableObject||t,i.cloneUnlessOtherwiseSpecified=r;var s=Array.isArray(n);return s===Array.isArray(e)?s?i.arrayMerge(e,n,i):a(e,n,i):r(n,i)}l.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return l(e,n,t)}),{})};var c=l;e.exports=c},7734:e=>{"use strict";e.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var r,o,i;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(o=r;0!=o--;)if(!e(t[o],n[o]))return!1;return!0}if(t instanceof Map&&n instanceof Map){if(t.size!==n.size)return!1;for(o of t.entries())if(!n.has(o[0]))return!1;for(o of t.entries())if(!e(o[1],n.get(o[0])))return!1;return!0}if(t instanceof Set&&n instanceof Set){if(t.size!==n.size)return!1;for(o of t.entries())if(!n.has(o[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(n)){if((r=t.length)!=n.length)return!1;for(o=r;0!=o--;)if(t[o]!==n[o])return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(i=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(o=r;0!=o--;)if(!Object.prototype.hasOwnProperty.call(n,i[o]))return!1;for(o=r;0!=o--;){var s=i[o];if(!e(t[s],n[s]))return!1}return!0}return t!=t&&n!=n}},8924:(e,t)=>{var n={};n.parse=function(){var e=/^(\-(webkit|o|ms|moz)\-)?(linear\-gradient)/i,t=/^(\-(webkit|o|ms|moz)\-)?(repeating\-linear\-gradient)/i,n=/^(\-(webkit|o|ms|moz)\-)?(radial\-gradient)/i,r=/^(\-(webkit|o|ms|moz)\-)?(repeating\-radial\-gradient)/i,o=/^to (left (top|bottom)|right (top|bottom)|left|right|top|bottom)/i,i=/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,s=/^(left|center|right|top|bottom)/i,a=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,l=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,c=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,u=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,d=/^\(/,p=/^\)/,f=/^,/,h=/^\#([0-9a-fA-F]+)/,m=/^([a-zA-Z]+)/,g=/^rgb/i,v=/^rgba/i,b=/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/,x="";function y(e){var t=new Error(x+": "+e);throw t.source=x,t}function w(){var e=R(_);return x.length>0&&y("Invalid input not EOF"),e}function _(){return S("linear-gradient",e,k)||S("repeating-linear-gradient",t,k)||S("radial-gradient",n,j)||S("repeating-radial-gradient",r,j)}function S(e,t,n){return C(t,(function(t){var r=n();return r&&(O(f)||y("Missing comma before color stops")),{type:e,orientation:r,colorStops:R(I)}}))}function C(e,t){var n=O(e);if(n)return O(d)||y("Missing ("),result=t(n),O(p)||y("Missing )"),result}function k(){return D("directional",o,1)||D("angular",u,1)}function j(){var e,t,n=E();return n&&((e=[]).push(n),t=x,O(f)&&((n=E())?e.push(n):x=t)),e}function E(){var e=function(){var e=D("shape",/^(circle)/i,0);e&&(e.style=A()||P());return e}()||function(){var e=D("shape",/^(ellipse)/i,0);e&&(e.style=M()||P());return e}();if(e)e.at=function(){if(D("position",/^at/,0)){var e=T();return e||y("Missing positioning value"),e}}();else{var t=T();t&&(e={type:"default-radial",at:t})}return e}function P(){return D("extent-keyword",i,1)}function T(){var e={x:M(),y:M()};if(e.x||e.y)return{type:"position",value:e}}function R(e){var t=e(),n=[];if(t)for(n.push(t);O(f);)(t=e())?n.push(t):y("One extra comma");return n}function I(){var e=D("hex",h,1)||C(v,(function(){return{type:"rgba",value:R(N)}}))||C(g,(function(){return{type:"rgb",value:R(N)}}))||D("literal",m,0);return e||y("Expected color definition"),e.length=M(),e}function N(){return O(b)[1]}function M(){return D("%",l,1)||D("position-keyword",s,1)||A()}function A(){return D("px",a,1)||D("em",c,1)}function D(e,t,n){var r=O(t);if(r)return{type:e,value:r[n]}}function O(e){var t,n;return(n=/^[\n\r\t\s]+/.exec(x))&&z(n[0].length),(t=e.exec(x))&&z(t[0].length),t}function z(e){x=x.substr(e)}return function(e){return x=e.toString(),w()}}(),t.parse=(n||{}).parse},9664:e=>{e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}return n.m=e,n.c=t,n.p="",n(0)}([function(e,t,n){e.exports=n(1)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2);Object.defineProperty(t,"combineChunks",{enumerable:!0,get:function(){return r.combineChunks}}),Object.defineProperty(t,"fillInChunks",{enumerable:!0,get:function(){return r.fillInChunks}}),Object.defineProperty(t,"findAll",{enumerable:!0,get:function(){return r.findAll}}),Object.defineProperty(t,"findChunks",{enumerable:!0,get:function(){return r.findChunks}})},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.findAll=function(e){var t=e.autoEscape,i=e.caseSensitive,s=void 0!==i&&i,a=e.findChunks,l=void 0===a?r:a,c=e.sanitize,u=e.searchWords,d=e.textToHighlight;return o({chunksToHighlight:n({chunks:l({autoEscape:t,caseSensitive:s,sanitize:c,searchWords:u,textToHighlight:d})}),totalLength:d?d.length:0})};var n=t.combineChunks=function(e){var t=e.chunks;return t=t.sort((function(e,t){return e.start-t.start})).reduce((function(e,t){if(0===e.length)return[t];var n=e.pop();if(t.start<=n.end){var r=Math.max(n.end,t.end);e.push({highlight:!1,start:n.start,end:r})}else e.push(n,t);return e}),[])},r=function(e){var t=e.autoEscape,n=e.caseSensitive,r=e.sanitize,o=void 0===r?i:r,s=e.searchWords,a=e.textToHighlight;return a=o(a),s.filter((function(e){return e})).reduce((function(e,r){r=o(r),t&&(r=r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"));for(var i=new RegExp(r,n?"g":"gi"),s=void 0;s=i.exec(a);){var l=s.index,c=i.lastIndex;c>l&&e.push({highlight:!1,start:l,end:c}),s.index===i.lastIndex&&i.lastIndex++}return e}),[])};t.findChunks=r;var o=t.fillInChunks=function(e){var t=e.chunksToHighlight,n=e.totalLength,r=[],o=function(e,t,n){t-e>0&&r.push({start:e,end:t,highlight:n})};if(0===t.length)o(0,n,!1);else{var i=0;t.forEach((function(e){o(i,e.start,!1),o(e.start,e.end,!0),i=e.end})),o(i,n,!1)}return r};function i(e){return e}}])},1880:(e,t,n)=>{"use strict";var r=n(1178),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},s={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},a={};function l(e){return r.isMemo(e)?s:a[e.$$typeof]||o}a[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},a[r.Memo]=s;var c=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,p=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,h=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(h){var o=f(n);o&&o!==h&&e(t,o,r)}var s=u(n);d&&(s=s.concat(d(n)));for(var a=l(t),m=l(n),g=0;g{"use strict"; +(()=>{var e,t,n={66:e=>{"use strict";var t=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===n}(e)}(e)};var n="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function r(e,t){return!1!==t.clone&&t.isMergeableObject(e)?l((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function o(e,t,n){return e.concat(t).map((function(e){return r(e,n)}))}function i(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return Object.propertyIsEnumerable.call(e,t)})):[]}(e))}function s(e,t){try{return t in e}catch(e){return!1}}function a(e,t,n){var o={};return n.isMergeableObject(e)&&i(e).forEach((function(t){o[t]=r(e[t],n)})),i(t).forEach((function(i){(function(e,t){return s(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,i)||(s(e,i)&&n.isMergeableObject(t[i])?o[i]=function(e,t){if(!t.customMerge)return l;var n=t.customMerge(e);return"function"==typeof n?n:l}(i,n)(e[i],t[i],n):o[i]=r(t[i],n))})),o}function l(e,n,i){(i=i||{}).arrayMerge=i.arrayMerge||o,i.isMergeableObject=i.isMergeableObject||t,i.cloneUnlessOtherwiseSpecified=r;var s=Array.isArray(n);return s===Array.isArray(e)?s?i.arrayMerge(e,n,i):a(e,n,i):r(n,i)}l.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return l(e,n,t)}),{})};var c=l;e.exports=c},7734:e=>{"use strict";e.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var r,o,i;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(o=r;0!=o--;)if(!e(t[o],n[o]))return!1;return!0}if(t instanceof Map&&n instanceof Map){if(t.size!==n.size)return!1;for(o of t.entries())if(!n.has(o[0]))return!1;for(o of t.entries())if(!e(o[1],n.get(o[0])))return!1;return!0}if(t instanceof Set&&n instanceof Set){if(t.size!==n.size)return!1;for(o of t.entries())if(!n.has(o[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(n)){if((r=t.length)!=n.length)return!1;for(o=r;0!=o--;)if(t[o]!==n[o])return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(i=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(o=r;0!=o--;)if(!Object.prototype.hasOwnProperty.call(n,i[o]))return!1;for(o=r;0!=o--;){var s=i[o];if(!e(t[s],n[s]))return!1}return!0}return t!=t&&n!=n}},8924:(e,t)=>{var n={};n.parse=function(){var e=/^(\-(webkit|o|ms|moz)\-)?(linear\-gradient)/i,t=/^(\-(webkit|o|ms|moz)\-)?(repeating\-linear\-gradient)/i,n=/^(\-(webkit|o|ms|moz)\-)?(radial\-gradient)/i,r=/^(\-(webkit|o|ms|moz)\-)?(repeating\-radial\-gradient)/i,o=/^to (left (top|bottom)|right (top|bottom)|left|right|top|bottom)/i,i=/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,s=/^(left|center|right|top|bottom)/i,a=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,l=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,c=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,u=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,d=/^\(/,p=/^\)/,f=/^,/,h=/^\#([0-9a-fA-F]+)/,m=/^([a-zA-Z]+)/,g=/^rgb/i,v=/^rgba/i,b=/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/,x="";function y(e){var t=new Error(x+": "+e);throw t.source=x,t}function w(){var e=T(_);return x.length>0&&y("Invalid input not EOF"),e}function _(){return S("linear-gradient",e,k)||S("repeating-linear-gradient",t,k)||S("radial-gradient",n,j)||S("repeating-radial-gradient",r,j)}function S(e,t,n){return C(t,(function(t){var r=n();return r&&(z(f)||y("Missing comma before color stops")),{type:e,orientation:r,colorStops:T(I)}}))}function C(e,t){var n=z(e);if(n)return z(d)||y("Missing ("),result=t(n),z(p)||y("Missing )"),result}function k(){return D("directional",o,1)||D("angular",u,1)}function j(){var e,t,n=E();return n&&((e=[]).push(n),t=x,z(f)&&((n=E())?e.push(n):x=t)),e}function E(){var e=function(){var e=D("shape",/^(circle)/i,0);e&&(e.style=A()||P());return e}()||function(){var e=D("shape",/^(ellipse)/i,0);e&&(e.style=M()||P());return e}();if(e)e.at=function(){if(D("position",/^at/,0)){var e=N();return e||y("Missing positioning value"),e}}();else{var t=N();t&&(e={type:"default-radial",at:t})}return e}function P(){return D("extent-keyword",i,1)}function N(){var e={x:M(),y:M()};if(e.x||e.y)return{type:"position",value:e}}function T(e){var t=e(),n=[];if(t)for(n.push(t);z(f);)(t=e())?n.push(t):y("One extra comma");return n}function I(){var e=D("hex",h,1)||C(v,(function(){return{type:"rgba",value:T(R)}}))||C(g,(function(){return{type:"rgb",value:T(R)}}))||D("literal",m,0);return e||y("Expected color definition"),e.length=M(),e}function R(){return z(b)[1]}function M(){return D("%",l,1)||D("position-keyword",s,1)||A()}function A(){return D("px",a,1)||D("em",c,1)}function D(e,t,n){var r=z(t);if(r)return{type:e,value:r[n]}}function z(e){var t,n;return(n=/^[\n\r\t\s]+/.exec(x))&&O(n[0].length),(t=e.exec(x))&&O(t[0].length),t}function O(e){x=x.substr(e)}return function(e){return x=e.toString(),w()}}(),t.parse=(n||{}).parse},9664:e=>{e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}return n.m=e,n.c=t,n.p="",n(0)}([function(e,t,n){e.exports=n(1)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2);Object.defineProperty(t,"combineChunks",{enumerable:!0,get:function(){return r.combineChunks}}),Object.defineProperty(t,"fillInChunks",{enumerable:!0,get:function(){return r.fillInChunks}}),Object.defineProperty(t,"findAll",{enumerable:!0,get:function(){return r.findAll}}),Object.defineProperty(t,"findChunks",{enumerable:!0,get:function(){return r.findChunks}})},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.findAll=function(e){var t=e.autoEscape,i=e.caseSensitive,s=void 0!==i&&i,a=e.findChunks,l=void 0===a?r:a,c=e.sanitize,u=e.searchWords,d=e.textToHighlight;return o({chunksToHighlight:n({chunks:l({autoEscape:t,caseSensitive:s,sanitize:c,searchWords:u,textToHighlight:d})}),totalLength:d?d.length:0})};var n=t.combineChunks=function(e){var t=e.chunks;return t=t.sort((function(e,t){return e.start-t.start})).reduce((function(e,t){if(0===e.length)return[t];var n=e.pop();if(t.start<=n.end){var r=Math.max(n.end,t.end);e.push({highlight:!1,start:n.start,end:r})}else e.push(n,t);return e}),[])},r=function(e){var t=e.autoEscape,n=e.caseSensitive,r=e.sanitize,o=void 0===r?i:r,s=e.searchWords,a=e.textToHighlight;return a=o(a),s.filter((function(e){return e})).reduce((function(e,r){r=o(r),t&&(r=r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"));for(var i=new RegExp(r,n?"g":"gi"),s=void 0;s=i.exec(a);){var l=s.index,c=i.lastIndex;c>l&&e.push({highlight:!1,start:l,end:c}),s.index===i.lastIndex&&i.lastIndex++}return e}),[])};t.findChunks=r;var o=t.fillInChunks=function(e){var t=e.chunksToHighlight,n=e.totalLength,r=[],o=function(e,t,n){t-e>0&&r.push({start:e,end:t,highlight:n})};if(0===t.length)o(0,n,!1);else{var i=0;t.forEach((function(e){o(i,e.start,!1),o(e.start,e.end,!0),i=e.end})),o(i,n,!1)}return r};function i(e){return e}}])},1880:(e,t,n)=>{"use strict";var r=n(1178),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},s={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},a={};function l(e){return r.isMemo(e)?s:a[e.$$typeof]||o}a[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},a[r.Memo]=s;var c=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,p=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,h=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(h){var o=f(n);o&&o!==h&&e(t,o,r)}var s=u(n);d&&(s=s.concat(d(n)));for(var a=l(t),m=l(n),g=0;g{"use strict"; /** @license React v16.13.1 * react-is.production.min.js * @@ -7,27 +7,27 @@ * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,o=n?Symbol.for("react.portal"):60106,i=n?Symbol.for("react.fragment"):60107,s=n?Symbol.for("react.strict_mode"):60108,a=n?Symbol.for("react.profiler"):60114,l=n?Symbol.for("react.provider"):60109,c=n?Symbol.for("react.context"):60110,u=n?Symbol.for("react.async_mode"):60111,d=n?Symbol.for("react.concurrent_mode"):60111,p=n?Symbol.for("react.forward_ref"):60112,f=n?Symbol.for("react.suspense"):60113,h=n?Symbol.for("react.suspense_list"):60120,m=n?Symbol.for("react.memo"):60115,g=n?Symbol.for("react.lazy"):60116,v=n?Symbol.for("react.block"):60121,b=n?Symbol.for("react.fundamental"):60117,x=n?Symbol.for("react.responder"):60118,y=n?Symbol.for("react.scope"):60119;function w(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case u:case d:case i:case a:case s:case f:return e;default:switch(e=e&&e.$$typeof){case c:case p:case g:case m:case l:return e;default:return t}}case o:return t}}}function _(e){return w(e)===d}t.AsyncMode=u,t.ConcurrentMode=d,t.ContextConsumer=c,t.ContextProvider=l,t.Element=r,t.ForwardRef=p,t.Fragment=i,t.Lazy=g,t.Memo=m,t.Portal=o,t.Profiler=a,t.StrictMode=s,t.Suspense=f,t.isAsyncMode=function(e){return _(e)||w(e)===u},t.isConcurrentMode=_,t.isContextConsumer=function(e){return w(e)===c},t.isContextProvider=function(e){return w(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return w(e)===p},t.isFragment=function(e){return w(e)===i},t.isLazy=function(e){return w(e)===g},t.isMemo=function(e){return w(e)===m},t.isPortal=function(e){return w(e)===o},t.isProfiler=function(e){return w(e)===a},t.isStrictMode=function(e){return w(e)===s},t.isSuspense=function(e){return w(e)===f},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===d||e===a||e===s||e===f||e===h||"object"==typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===m||e.$$typeof===l||e.$$typeof===c||e.$$typeof===p||e.$$typeof===b||e.$$typeof===x||e.$$typeof===y||e.$$typeof===v)},t.typeOf=w},1178:(e,t,n)=>{"use strict";e.exports=n(2950)},9681:e=>{var t={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ả:"A",Ạ:"A",Ẩ:"A",Ẫ:"A",Ậ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ẻ:"E",Ẽ:"E",Ẹ:"E",Ể:"E",Ễ:"E",Ệ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ỉ:"I",Ị:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ỏ:"O",Ọ:"O",Ổ:"O",Ỗ:"O",Ộ:"O",Ờ:"O",Ở:"O",Ỡ:"O",Ớ:"O",Ợ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ủ:"U",Ụ:"U",Ử:"U",Ữ:"U",Ự:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ả:"a",ạ:"a",ẩ:"a",ẫ:"a",ậ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ẻ:"e",ẽ:"e",ẹ:"e",ể:"e",ễ:"e",ệ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ỉ:"i",ị:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ỏ:"o",ọ:"o",ổ:"o",ỗ:"o",ộ:"o",ờ:"o",ở:"o",ỡ:"o",ớ:"o",ợ:"o",ù:"u",ú:"u",û:"u",ü:"u",ủ:"u",ụ:"u",ử:"u",ữ:"u",ự:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"C",ċ:"c",Č:"C",č:"c",C̆:"C",c̆:"c",Ď:"D",ď:"d",Đ:"D",đ:"d",Ē:"E",ē:"e",Ĕ:"E",ĕ:"e",Ė:"E",ė:"e",Ę:"E",ę:"e",Ě:"E",ě:"e",Ĝ:"G",Ǵ:"G",ĝ:"g",ǵ:"g",Ğ:"G",ğ:"g",Ġ:"G",ġ:"g",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",Ḫ:"H",ḫ:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",IJ:"IJ",ij:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",Ḱ:"K",ḱ:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",Ḿ:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ʼn:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",Ẃ:"W",ẃ:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",Ứ:"U",ứ:"u",Ṹ:"U",ṹ:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",Ṕ:"P",ṕ:"p",Ṥ:"S",ṥ:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",Ồ:"O",ồ:"o",Ṑ:"O",ṑ:"o",Ừ:"U",ừ:"u",Ẁ:"W",ẁ:"w",Ỳ:"Y",ỳ:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",Ṧ:"S",ṧ:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",Ḑ:"D",ḑ:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z",й:"и",Й:"И",ё:"е",Ё:"Е"},n=Object.keys(t).join("|"),r=new RegExp(n,"g"),o=new RegExp(n,"");function i(e){return t[e]}var s=function(e){return e.replace(r,i)};e.exports=s,e.exports.has=function(e){return!!e.match(o)},e.exports.remove=s},8477:(e,t,n)=>{"use strict"; + */var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,o=n?Symbol.for("react.portal"):60106,i=n?Symbol.for("react.fragment"):60107,s=n?Symbol.for("react.strict_mode"):60108,a=n?Symbol.for("react.profiler"):60114,l=n?Symbol.for("react.provider"):60109,c=n?Symbol.for("react.context"):60110,u=n?Symbol.for("react.async_mode"):60111,d=n?Symbol.for("react.concurrent_mode"):60111,p=n?Symbol.for("react.forward_ref"):60112,f=n?Symbol.for("react.suspense"):60113,h=n?Symbol.for("react.suspense_list"):60120,m=n?Symbol.for("react.memo"):60115,g=n?Symbol.for("react.lazy"):60116,v=n?Symbol.for("react.block"):60121,b=n?Symbol.for("react.fundamental"):60117,x=n?Symbol.for("react.responder"):60118,y=n?Symbol.for("react.scope"):60119;function w(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case u:case d:case i:case a:case s:case f:return e;default:switch(e=e&&e.$$typeof){case c:case p:case g:case m:case l:return e;default:return t}}case o:return t}}}function _(e){return w(e)===d}t.AsyncMode=u,t.ConcurrentMode=d,t.ContextConsumer=c,t.ContextProvider=l,t.Element=r,t.ForwardRef=p,t.Fragment=i,t.Lazy=g,t.Memo=m,t.Portal=o,t.Profiler=a,t.StrictMode=s,t.Suspense=f,t.isAsyncMode=function(e){return _(e)||w(e)===u},t.isConcurrentMode=_,t.isContextConsumer=function(e){return w(e)===c},t.isContextProvider=function(e){return w(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return w(e)===p},t.isFragment=function(e){return w(e)===i},t.isLazy=function(e){return w(e)===g},t.isMemo=function(e){return w(e)===m},t.isPortal=function(e){return w(e)===o},t.isProfiler=function(e){return w(e)===a},t.isStrictMode=function(e){return w(e)===s},t.isSuspense=function(e){return w(e)===f},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===d||e===a||e===s||e===f||e===h||"object"==typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===m||e.$$typeof===l||e.$$typeof===c||e.$$typeof===p||e.$$typeof===b||e.$$typeof===x||e.$$typeof===y||e.$$typeof===v)},t.typeOf=w},1178:(e,t,n)=>{"use strict";e.exports=n(2950)},9681:e=>{var t={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ả:"A",Ạ:"A",Ẩ:"A",Ẫ:"A",Ậ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ẻ:"E",Ẽ:"E",Ẹ:"E",Ể:"E",Ễ:"E",Ệ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ỉ:"I",Ị:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ỏ:"O",Ọ:"O",Ổ:"O",Ỗ:"O",Ộ:"O",Ờ:"O",Ở:"O",Ỡ:"O",Ớ:"O",Ợ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ủ:"U",Ụ:"U",Ử:"U",Ữ:"U",Ự:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ả:"a",ạ:"a",ẩ:"a",ẫ:"a",ậ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ẻ:"e",ẽ:"e",ẹ:"e",ể:"e",ễ:"e",ệ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ỉ:"i",ị:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ỏ:"o",ọ:"o",ổ:"o",ỗ:"o",ộ:"o",ờ:"o",ở:"o",ỡ:"o",ớ:"o",ợ:"o",ù:"u",ú:"u",û:"u",ü:"u",ủ:"u",ụ:"u",ử:"u",ữ:"u",ự:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"C",ċ:"c",Č:"C",č:"c",C̆:"C",c̆:"c",Ď:"D",ď:"d",Đ:"D",đ:"d",Ē:"E",ē:"e",Ĕ:"E",ĕ:"e",Ė:"E",ė:"e",Ę:"E",ę:"e",Ě:"E",ě:"e",Ĝ:"G",Ǵ:"G",ĝ:"g",ǵ:"g",Ğ:"G",ğ:"g",Ġ:"G",ġ:"g",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",Ḫ:"H",ḫ:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",IJ:"IJ",ij:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",Ḱ:"K",ḱ:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",Ḿ:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ʼn:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",Ẃ:"W",ẃ:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",Ứ:"U",ứ:"u",Ṹ:"U",ṹ:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",Ṕ:"P",ṕ:"p",Ṥ:"S",ṥ:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",Ồ:"O",ồ:"o",Ṑ:"O",ṑ:"o",Ừ:"U",ừ:"u",Ẁ:"W",ẁ:"w",Ỳ:"Y",ỳ:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",Ṧ:"S",ṧ:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",Ḑ:"D",ḑ:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z",й:"и",Й:"И",ё:"е",Ё:"Е"},n=Object.keys(t).join("|"),r=new RegExp(n,"g"),o=new RegExp(n,"");function i(e){return t[e]}var s=function(e){return e.replace(r,i)};e.exports=s,e.exports.has=function(e){return!!e.match(o)},e.exports.remove=s},83:(e,t,n)=>{"use strict"; /** * @license React - * use-sync-external-store-shim.production.min.js + * use-sync-external-store-shim.production.js * - * Copyright (c) Facebook, Inc. and its affiliates. + * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var r=n(1609);var o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},i=r.useState,s=r.useEffect,a=r.useLayoutEffect,l=r.useDebugValue;function c(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!o(e,n)}catch(e){return!0}}var u="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),o=r[0].inst,u=r[1];return a((function(){o.value=n,o.getSnapshot=t,c(o)&&u({inst:o})}),[e,n,t]),s((function(){return c(o)&&u({inst:o}),e((function(){c(o)&&u({inst:o})}))}),[e]),l(n),n};t.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:u},422:(e,t,n)=>{"use strict";e.exports=n(8477)},1609:e=>{"use strict";e.exports=window.React}},r={};function o(e){var t=r[e];if(void 0!==t)return t.exports;var i=r[e]={exports:{}};return n[e](i,i.exports,o),i.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,o.t=function(n,r){if(1&r&&(n=this(n)),8&r)return n;if("object"==typeof n&&n){if(4&r&&n.__esModule)return n;if(16&r&&"function"==typeof n.then)return n}var i=Object.create(null);o.r(i);var s={};e=e||[null,t({}),t([]),t(t)];for(var a=2&r&&n;"object"==typeof a&&!~e.indexOf(a);a=t(a))Object.getOwnPropertyNames(a).forEach((e=>s[e]=()=>n[e]));return s.default=()=>n,o.d(i,s),i},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.nc=void 0;var i={};(()=>{"use strict";o.r(i),o.d(i,{AlignmentMatrixControl:()=>Ll,AnglePickerControl:()=>dy,Animate:()=>Vl,Autocomplete:()=>Cw,BaseControl:()=>Ax,BlockQuotation:()=>n.BlockQuotation,Button:()=>$x,ButtonGroup:()=>sE,Card:()=>VE,CardBody:()=>ZE,CardDivider:()=>cP,CardFooter:()=>dP,CardHeader:()=>fP,CardMedia:()=>mP,CheckboxControl:()=>gP,Circle:()=>n.Circle,ClipboardButton:()=>bP,ColorIndicator:()=>A_,ColorPalette:()=>_k,ColorPicker:()=>JC,ComboboxControl:()=>QT,Composite:()=>Dn,CustomGradientPicker:()=>sT,CustomSelectControl:()=>MI,Dashicon:()=>Lx,DatePicker:()=>SM,DateTimePicker:()=>UM,Disabled:()=>eA,Draggable:()=>rA,DropZone:()=>iA,DropZoneProvider:()=>sA,Dropdown:()=>F_,DropdownMenu:()=>CT,DuotonePicker:()=>hA,DuotoneSwatch:()=>cA,ExternalLink:()=>mA,Fill:()=>lw,Flex:()=>mg,FlexBlock:()=>vg,FlexItem:()=>Tg,FocalPointPicker:()=>FA,FocusReturnProvider:()=>kB,FocusableIframe:()=>BA,FontSizePicker:()=>nD,FormFileUpload:()=>rD,FormToggle:()=>sD,FormTokenField:()=>pD,G:()=>n.G,GradientPicker:()=>dT,Guide:()=>mD,GuidePage:()=>gD,HorizontalRule:()=>n.HorizontalRule,Icon:()=>Fx,IconButton:()=>vD,IsolatedEventContainer:()=>cB,KeyboardShortcuts:()=>wD,Line:()=>n.Line,MenuGroup:()=>_D,MenuItem:()=>CD,MenuItemsChoice:()=>jD,Modal:()=>mR,NavigableMenu:()=>yT,Notice:()=>KO,NoticeList:()=>YO,Panel:()=>ZO,PanelBody:()=>nz,PanelHeader:()=>XO,PanelRow:()=>rz,Path:()=>n.Path,Placeholder:()=>iz,Polygon:()=>n.Polygon,Popover:()=>vw,ProgressBar:()=>dz,QueryControls:()=>wz,RadioControl:()=>Rz,RangeControl:()=>KS,Rect:()=>n.Rect,ResizableBox:()=>gL,ResponsiveWrapper:()=>vL,SVG:()=>n.SVG,SandBox:()=>xL,ScrollLock:()=>Ny,SearchControl:()=>vO,SelectControl:()=>oS,Slot:()=>cw,SlotFillProvider:()=>uw,Snackbar:()=>wL,SnackbarList:()=>SL,Spinner:()=>TL,TabPanel:()=>UL,TabbableContainer:()=>ED,TextControl:()=>KL,TextHighlight:()=>eF,TextareaControl:()=>JL,TimePicker:()=>VM,Tip:()=>nF,ToggleControl:()=>oF,Toolbar:()=>SF,ToolbarButton:()=>hF,ToolbarDropdownMenu:()=>CF,ToolbarGroup:()=>vF,ToolbarItem:()=>pF,Tooltip:()=>Yi,TreeSelect:()=>gz,VisuallyHidden:()=>pl,__experimentalAlignmentMatrixControl:()=>Ll,__experimentalApplyValueToSides:()=>qj,__experimentalBorderBoxControl:()=>wj,__experimentalBorderControl:()=>nj,__experimentalBoxControl:()=>iE,__experimentalConfirmDialog:()=>vR,__experimentalDimensionControl:()=>qM,__experimentalDivider:()=>aP,__experimentalDropdownContentWrapper:()=>mk,__experimentalElevation:()=>uE,__experimentalGrid:()=>ij,__experimentalHStack:()=>ny,__experimentalHasSplitBorders:()=>hj,__experimentalHeading:()=>dk,__experimentalInputControl:()=>zx,__experimentalInputControlPrefixWrapper:()=>iC,__experimentalInputControlSuffixWrapper:()=>B_,__experimentalIsDefinedBorder:()=>fj,__experimentalIsEmptyBorder:()=>pj,__experimentalItem:()=>xD,__experimentalItemGroup:()=>AP,__experimentalNavigation:()=>KD,__experimentalNavigationBackButton:()=>ZD,__experimentalNavigationGroup:()=>eO,__experimentalNavigationItem:()=>cO,__experimentalNavigationMenu:()=>wO,__experimentalNavigatorBackButton:()=>$O,__experimentalNavigatorButton:()=>VO,__experimentalNavigatorProvider:()=>zO,__experimentalNavigatorScreen:()=>FO,__experimentalNavigatorToParentButton:()=>HO,__experimentalNumberControl:()=>iy,__experimentalPaletteEdit:()=>VT,__experimentalParseQuantityAndUnitFromRawValue:()=>Wk,__experimentalRadio:()=>Cz,__experimentalRadioGroup:()=>jz,__experimentalScrollable:()=>YE,__experimentalSpacer:()=>jg,__experimentalStyleProvider:()=>Jy,__experimentalSurface:()=>RL,__experimentalText:()=>Nv,__experimentalToggleGroupControl:()=>p_,__experimentalToggleGroupControlOption:()=>zM,__experimentalToggleGroupControlOptionIcon:()=>I_,__experimentalToolbarContext:()=>dF,__experimentalToolsPanel:()=>KF,__experimentalToolsPanelContext:()=>DF,__experimentalToolsPanelItem:()=>XF,__experimentalTreeGrid:()=>nB,__experimentalTreeGridCell:()=>aB,__experimentalTreeGridItem:()=>sB,__experimentalTreeGridRow:()=>rB,__experimentalTruncate:()=>ck,__experimentalUnitControl:()=>Zk,__experimentalUseCustomUnits:()=>Uk,__experimentalUseNavigator:()=>BO,__experimentalUseSlot:()=>Dy,__experimentalUseSlotFills:()=>uB,__experimentalVStack:()=>lk,__experimentalView:()=>dl,__experimentalZStack:()=>mB,__unstableAnimatePresence:()=>og,__unstableComposite:()=>rR,__unstableCompositeGroup:()=>oR,__unstableCompositeItem:()=>iR,__unstableDisclosureContent:()=>tA,__unstableGetAnimateClassName:()=>Bl,__unstableMotion:()=>Xm,__unstableMotionContext:()=>Hl,__unstableUseAutocompleteProps:()=>Sw,__unstableUseCompositeState:()=>sR,__unstableUseNavigateRegions:()=>vB,createSlotFill:()=>dw,navigateRegions:()=>bB,privateApis:()=>T$,useBaseControlProps:()=>kw,withConstrainedTabbing:()=>xB,withFallbackStyles:()=>yB,withFilters:()=>SB,withFocusOutside:()=>qT,withFocusReturn:()=>CB,withNotices:()=>jB,withSpokenMessages:()=>dO});var e={};o.r(e),o.d(e,{Text:()=>vv,block:()=>bv,destructive:()=>yv,highlighterText:()=>_v,muted:()=>wv,positive:()=>xv,upperCase:()=>Sv});var t={};o.r(t),o.d(t,{Rp:()=>w_,y0:()=>g_,ou:()=>S_,uG:()=>b_,eh:()=>v_});const n=window.wp.primitives;function r(e){var t,n,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e)){var i=e.length;for(t=0;tt in e?u(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,v=(e,t)=>{for(var n in t||(t={}))h.call(t,n)&&g(e,n,t[n]);if(f)for(var n of f(t))m.call(t,n)&&g(e,n,t[n]);return e},b=(e,t)=>d(e,p(t)),x=(e,t)=>{var n={};for(var r in e)h.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&f)for(var r of f(e))t.indexOf(r)<0&&m.call(e,r)&&(n[r]=e[r]);return n},y=Object.defineProperty,w=Object.defineProperties,_=Object.getOwnPropertyDescriptors,S=Object.getOwnPropertySymbols,C=Object.prototype.hasOwnProperty,k=Object.prototype.propertyIsEnumerable,j=(e,t,n)=>t in e?y(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,E=(e,t)=>{for(var n in t||(t={}))C.call(t,n)&&j(e,n,t[n]);if(S)for(var n of S(t))k.call(t,n)&&j(e,n,t[n]);return e},P=(e,t)=>w(e,_(t)),T=(e,t)=>{var n={};for(var r in e)C.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&S)for(var r of S(e))t.indexOf(r)<0&&k.call(e,r)&&(n[r]=e[r]);return n};function R(...e){}function I(e,t){if(function(e){return"function"==typeof e}(e)){return e(function(e){return"function"==typeof e}(t)?t():t)}return e}function N(e,t){return"function"==typeof Object.hasOwn?Object.hasOwn(e,t):Object.prototype.hasOwnProperty.call(e,t)}function M(...e){return(...t)=>{for(const n of e)"function"==typeof n&&n(...t)}}function A(e){return e}function D(e,t){if(!e){if("string"!=typeof t)throw new Error("Invariant failed");throw new Error(t)}}function O(e,...t){const n="function"==typeof e?e(...t):e;return null!=n&&!n}function z(e){return e.disabled||!0===e["aria-disabled"]||"true"===e["aria-disabled"]}function L(e){const t={};for(const n in e)void 0!==e[n]&&(t[n]=e[n]);return t}function F(...e){for(const t of e)if(void 0!==t)return t}var B=o(1609),V=o.t(B,2),$=o.n(B);function H(e,t){"function"==typeof e?e(t):e&&(e.current=t)}function W(e){if(!function(e){return!!e&&!!(0,B.isValidElement)(e)&&("ref"in e.props||"ref"in e)}(e))return null;return v({},e.props).ref||e.ref}var U,G="undefined"!=typeof window&&!!(null==(U=window.document)?void 0:U.createElement);function K(e){return e?e.ownerDocument||e:document}function q(e,t=!1){const{activeElement:n}=K(e);if(!(null==n?void 0:n.nodeName))return null;if(X(n)&&n.contentDocument)return q(n.contentDocument.body,t);if(t){const e=n.getAttribute("aria-activedescendant");if(e){const t=K(n).getElementById(e);if(t)return t}}return n}function Y(e,t){return e===t||e.contains(t)}function X(e){return"IFRAME"===e.tagName}function Z(e){const t=e.tagName.toLowerCase();return"button"===t||!("input"!==t||!e.type)&&-1!==Q.indexOf(e.type)}var Q=["button","color","file","image","reset","submit"];function J(e){if("function"==typeof e.checkVisibility)return e.checkVisibility();const t=e;return t.offsetWidth>0||t.offsetHeight>0||e.getClientRects().length>0}function ee(e){try{const t=e instanceof HTMLInputElement&&null!==e.selectionStart,n="TEXTAREA"===e.tagName;return t||n||!1}catch(e){return!1}}function te(e){return e.isContentEditable||ee(e)}function ne(e,t){const n=null==e?void 0:e.getAttribute("role");return n&&-1!==["dialog","menu","listbox","tree","grid"].indexOf(n)?n:t}function re(e,t){var n;const r=ne(e);if(!r)return t;return null!=(n={menu:"menuitem",listbox:"option",tree:"treeitem"}[r])?n:t}function oe(e){if(!e)return null;if(e.clientHeight&&e.scrollHeight>e.clientHeight){const{overflowY:t}=getComputedStyle(e);if("visible"!==t&&"hidden"!==t)return e}else if(e.clientWidth&&e.scrollWidth>e.clientWidth){const{overflowX:t}=getComputedStyle(e);if("visible"!==t&&"hidden"!==t)return e}return oe(e.parentElement)||document.scrollingElement||document.body}function ie(){return!!G&&/mac|iphone|ipad|ipod/i.test(navigator.platform)}function se(){return G&&ie()&&/apple/i.test(navigator.vendor)}function ae(){return G&&navigator.platform.startsWith("Mac")&&!(G&&navigator.maxTouchPoints)}function le(e){return Boolean(e.currentTarget&&!Y(e.currentTarget,e.target))}function ce(e){return e.target===e.currentTarget}function ue(e){const t=e.currentTarget;if(!t)return!1;const n=ie();if(n&&!e.metaKey)return!1;if(!n&&!e.ctrlKey)return!1;const r=t.tagName.toLowerCase();return"a"===r||("button"===r&&"submit"===t.type||"input"===r&&"submit"===t.type)}function de(e){const t=e.currentTarget;if(!t)return!1;const n=t.tagName.toLowerCase();return!!e.altKey&&("a"===n||("button"===n&&"submit"===t.type||"input"===n&&"submit"===t.type))}function pe(e,t){const n=new FocusEvent("blur",t),r=e.dispatchEvent(n),o=P(E({},t),{bubbles:!0});return e.dispatchEvent(new FocusEvent("focusout",o)),r}function fe(e,t){const n=new MouseEvent("click",t);return e.dispatchEvent(n)}function he(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Y(n,r)}function me(e,t,n,r){const o=(e=>{if(r){const t=setTimeout(e,r);return()=>clearTimeout(t)}const t=requestAnimationFrame(e);return()=>cancelAnimationFrame(t)})((()=>{e.removeEventListener(t,i,!0),n()})),i=()=>{o(),n()};return e.addEventListener(t,i,{once:!0,capture:!0}),o}function ge(e,t,n,r=window){const o=[];try{r.document.addEventListener(e,t,n);for(const i of Array.from(r.frames))o.push(ge(e,t,n,i))}catch(e){}return()=>{try{r.document.removeEventListener(e,t,n)}catch(e){}for(const e of o)e()}}var ve=v({},V),be=ve.useId,xe=(ve.useDeferredValue,ve.useInsertionEffect),ye=G?B.useLayoutEffect:B.useEffect;function we(e){const[t]=(0,B.useState)(e);return t}function _e(e){const t=(0,B.useRef)(e);return ye((()=>{t.current=e})),t}function Se(e){const t=(0,B.useRef)((()=>{throw new Error("Cannot call an event handler while rendering.")}));return xe?xe((()=>{t.current=e})):t.current=e,(0,B.useCallback)(((...e)=>{var n;return null==(n=t.current)?void 0:n.call(t,...e)}),[])}function Ce(e){const[t,n]=(0,B.useState)(null);return ye((()=>{if(null==t)return;if(!e)return;let n=null;return e((e=>(n=e,t))),()=>{e(n)}}),[t,e]),[t,n]}function ke(...e){return(0,B.useMemo)((()=>{if(e.some(Boolean))return t=>{for(const n of e)H(n,t)}}),e)}function je(e){if(be){const t=be();return e||t}const[t,n]=(0,B.useState)(e);return ye((()=>{if(e||t)return;const r=Math.random().toString(36).substr(2,6);n(`id-${r}`)}),[e,t]),e||t}function Ee(e,t){const n=e=>{if("string"==typeof e)return e},[r,o]=(0,B.useState)((()=>n(t)));return ye((()=>{const r=e&&"current"in e?e.current:e;o((null==r?void 0:r.tagName.toLowerCase())||n(t))}),[e,t]),r}function Pe(e,t){const n=(0,B.useRef)(!1);(0,B.useEffect)((()=>{if(n.current)return e();n.current=!0}),t),(0,B.useEffect)((()=>()=>{n.current=!1}),[])}function Te(){return(0,B.useReducer)((()=>[]),[])}function Re(e){return Se("function"==typeof e?e:()=>e)}function Ie(e,t,n=[]){const r=(0,B.useCallback)((n=>(e.wrapElement&&(n=e.wrapElement(n)),t(n))),[...n,e.wrapElement]);return b(v({},e),{wrapElement:r})}function Ne(e=!1,t){const[n,r]=(0,B.useState)(null);return{portalRef:ke(r,t),portalNode:n,domReady:!e||n}}function Me(e,t,n){const r=e.onLoadedMetadataCapture,o=(0,B.useMemo)((()=>Object.assign((()=>{}),b(v({},r),{[t]:n}))),[r,t,n]);return[null==r?void 0:r[t],{onLoadedMetadataCapture:o}]}function Ae(){(0,B.useEffect)((()=>{ge("mousemove",Le,!0),ge("mousedown",Fe,!0),ge("mouseup",Fe,!0),ge("keydown",Fe,!0),ge("scroll",Fe,!0)}),[]);return Se((()=>De))}var De=!1,Oe=0,ze=0;function Le(e){(function(e){const t=e.movementX||e.screenX-Oe,n=e.movementY||e.screenY-ze;return Oe=e.screenX,ze=e.screenY,t||n||!1})(e)&&(De=!0)}function Fe(){De=!1}function Be(e,t){const n=e.__unstableInternals;return D(n,"Invalid store"),n[t]}function Ve(e,...t){let n=e,r=n,o=Symbol(),i=R;const s=new Set,a=new Set,l=new Set,c=new Set,u=new Set,d=new WeakMap,p=new WeakMap,f=(e,t,n=c)=>(n.add(t),p.set(t,e),()=>{var e;null==(e=d.get(t))||e(),d.delete(t),p.delete(t),n.delete(t)}),h=(e,i,s=!1)=>{var l;if(!N(n,e))return;const f=I(i,n[e]);if(f===n[e])return;if(!s)for(const n of t)null==(l=null==n?void 0:n.setState)||l.call(n,e,f);const h=n;n=P(E({},n),{[e]:f});const m=Symbol();o=m,a.add(e);const g=(t,r,o)=>{var i;const s=p.get(t);s&&!s.some((t=>o?o.has(t):t===e))||(null==(i=d.get(t))||i(),d.set(t,t(n,r)))};for(const e of c)g(e,h);queueMicrotask((()=>{if(o!==m)return;const e=n;for(const e of u)g(e,r,a);r=e,a.clear()}))},m={getState:()=>n,setState:h,__unstableInternals:{setup:e=>(l.add(e),()=>l.delete(e)),init:()=>{const e=s.size,r=Symbol();s.add(r);const o=()=>{s.delete(r),s.size||i()};if(e)return o;const a=(c=n,Object.keys(c)).map((e=>M(...t.map((t=>{var n;const r=null==(n=null==t?void 0:t.getState)?void 0:n.call(t);if(r&&N(r,e))return Ue(t,[e],(t=>{h(e,t[e],!0)}))})))));var c;const u=[];for(const e of l)u.push(e());const d=t.map(He);return i=M(...a,...u,...d),o},subscribe:(e,t)=>f(e,t),sync:(e,t)=>(d.set(t,t(n,n)),f(e,t)),batch:(e,t)=>(d.set(t,t(n,r)),f(e,t,u)),pick:e=>Ve(function(e,t){const n={};for(const r of t)N(e,r)&&(n[r]=e[r]);return n}(n,e),m),omit:e=>Ve(function(e,t){const n=E({},e);for(const e of t)N(n,e)&&delete n[e];return n}(n,e),m)}};return m}function $e(e,...t){if(e)return Be(e,"setup")(...t)}function He(e,...t){if(e)return Be(e,"init")(...t)}function We(e,...t){if(e)return Be(e,"subscribe")(...t)}function Ue(e,...t){if(e)return Be(e,"sync")(...t)}function Ge(e,...t){if(e)return Be(e,"batch")(...t)}function Ke(e,...t){if(e)return Be(e,"omit")(...t)}function qe(...e){const t=e.reduce(((e,t)=>{var n;const r=null==(n=null==t?void 0:t.getState)?void 0:n.call(t);return r?Object.assign(e,r):e}),{});return Ve(t,...e)}var Ye=o(422),{useSyncExternalStore:Xe}=Ye,Ze=()=>()=>{};function Qe(e,t=A){const n=B.useCallback((t=>e?We(e,null,t):Ze()),[e]),r=()=>{const n="string"==typeof t?t:null,r="function"==typeof t?t:null,o=null==e?void 0:e.getState();return r?r(o):o&&n&&N(o,n)?o[n]:void 0};return Xe(n,r,r)}function Je(e,t,n,r){const o=N(t,n)?t[n]:void 0,i=r?t[r]:void 0,s=_e({value:o,setValue:i});ye((()=>Ue(e,[n],((e,t)=>{const{value:r,setValue:o}=s.current;o&&e[n]!==t[n]&&e[n]!==r&&o(e[n])}))),[e,n]),ye((()=>{if(void 0!==o)return e.setState(n,o),Ge(e,[n],(()=>{void 0!==o&&e.setState(n,o)}))}))}function et(e,t){const[n,r]=B.useState((()=>e(t)));ye((()=>He(n)),[n]);const o=B.useCallback((e=>Qe(n,e)),[n]);return[B.useMemo((()=>b(v({},n),{useState:o})),[n,o]),Se((()=>{r((n=>e(v(v({},t),n.getState()))))}))]}function tt(e,t,n){return Pe(t,[n.store]),Je(e,n,"items","setItems"),e}function nt(e){const t=e.map(((e,t)=>[t,e]));let n=!1;return t.sort((([e,t],[r,o])=>{const i=t.element,s=o.element;return i===s?0:i&&s?function(e,t){return Boolean(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}(i,s)?(e>r&&(n=!0),-1):(et)):e}function rt(e={}){var t;e.store;const n=null==(t=e.store)?void 0:t.getState(),r=F(e.items,null==n?void 0:n.items,e.defaultItems,[]),o=new Map(r.map((e=>[e.id,e]))),i={items:r,renderedItems:F(null==n?void 0:n.renderedItems,[])},s=null==(a=e.store)?void 0:a.__unstablePrivateStore;var a;const l=Ve({items:r,renderedItems:i.renderedItems},s),c=Ve(i,e.store),u=e=>{const t=nt(e);l.setState("renderedItems",t),c.setState("renderedItems",t)};$e(c,(()=>He(l))),$e(l,(()=>Ge(l,["items"],(e=>{c.setState("items",e.items)})))),$e(l,(()=>Ge(l,["renderedItems"],(e=>{let t=!0,n=requestAnimationFrame((()=>{const{renderedItems:t}=c.getState();e.renderedItems!==t&&u(e.renderedItems)}));if("function"!=typeof IntersectionObserver)return()=>cancelAnimationFrame(n);const r=function(e){var t;const n=e.find((e=>!!e.element)),r=[...e].reverse().find((e=>!!e.element));let o=null==(t=null==n?void 0:n.element)?void 0:t.parentElement;for(;o&&(null==r?void 0:r.element);){if(r&&o.contains(r.element))return o;o=o.parentElement}return K(o).body}(e.renderedItems),o=new IntersectionObserver((()=>{t?t=!1:(cancelAnimationFrame(n),n=requestAnimationFrame((()=>u(e.renderedItems))))}),{root:r});for(const t of e.renderedItems)t.element&&o.observe(t.element);return()=>{cancelAnimationFrame(n),o.disconnect()}}))));const d=(e,t,n=!1)=>{let r;t((t=>{const n=t.findIndex((({id:t})=>t===e.id)),i=t.slice();if(-1!==n){r=t[n];const s=E(E({},r),e);i[n]=s,o.set(e.id,s)}else i.push(e),o.set(e.id,e);return i}));return()=>{t((t=>{if(!r)return n&&o.delete(e.id),t.filter((({id:t})=>t!==e.id));const i=t.findIndex((({id:t})=>t===e.id));if(-1===i)return t;const s=t.slice();return s[i]=r,o.set(e.id,r),s}))}},p=e=>d(e,(e=>l.setState("items",e)),!0);return P(E({},c),{registerItem:p,renderItem:e=>M(p(e),d(e,(e=>l.setState("renderedItems",e)))),item:e=>{if(!e)return null;let t=o.get(e);if(!t){const{items:n}=c.getState();t=n.find((t=>t.id===e)),t&&o.set(e,t)}return t||null},__unstablePrivateStore:l})}function ot(e){return Array.isArray(e)?e:void 0!==e?[e]:[]}function it(e){const t=[];for(const n of e)t.push(...n);return t}function st(e){return e.slice().reverse()}var at={id:null};function lt(e,t){return e.find((e=>t?!e.disabled&&e.id!==t:!e.disabled))}function ct(e,t){return e.filter((e=>e.rowId===t))}function ut(e){const t=[];for(const n of e){const e=t.find((e=>{var t;return(null==(t=e[0])?void 0:t.rowId)===n.rowId}));e?e.push(n):t.push([n])}return t}function dt(e){let t=0;for(const{length:n}of e)n>t&&(t=n);return t}function pt(e,t,n){const r=dt(e);for(const o of e)for(let e=0;eUe(i,["renderedItems","activeId"],(e=>{i.setState("activeId",(t=>{var n;return void 0!==t?t:null==(n=lt(e.renderedItems))?void 0:n.id}))}))));const s=(e,t,n,r)=>{var o,s;const{activeId:a,rtl:l,focusLoop:c,focusWrap:u,includesBaseElement:d}=i.getState(),p=l&&"vertical"!==t?st(e):e;if(null==a)return null==(o=lt(p))?void 0:o.id;const f=p.find((e=>e.id===a));if(!f)return null==(s=lt(p))?void 0:s.id;const h=!!f.rowId,m=p.indexOf(f),g=p.slice(m+1),v=ct(g,f.rowId);if(void 0!==r){const e=function(e,t){return e.filter((e=>t?!e.disabled&&e.id!==t:!e.disabled))}(v,a),t=e.slice(r)[0]||e[e.length-1];return null==t?void 0:t.id}const b=function(e){return"vertical"===e?"horizontal":"horizontal"===e?"vertical":void 0}(h?t||"horizontal":t),x=c&&c!==b,y=h&&u&&u!==b;if(n=n||!h&&x&&d,x){const e=function(e,t,n=!1){const r=e.findIndex((e=>e.id===t));return[...e.slice(r+1),...n?[at]:[],...e.slice(0,r)]}(y&&!n?p:ct(p,f.rowId),a,n),t=lt(e,a);return null==t?void 0:t.id}if(y){const e=lt(n?v:g,a);return n?(null==e?void 0:e.id)||null:null==e?void 0:e.id}const w=lt(v,a);return!w&&n?null:null==w?void 0:w.id};return P(E(E({},r),i),{setBaseElement:e=>i.setState("baseElement",e),setActiveId:e=>i.setState("activeId",e),move:e=>{void 0!==e&&(i.setState("activeId",e),i.setState("moves",(e=>e+1)))},first:()=>{var e;return null==(e=lt(i.getState().renderedItems))?void 0:e.id},last:()=>{var e;return null==(e=lt(st(i.getState().renderedItems)))?void 0:e.id},next:e=>{const{renderedItems:t,orientation:n}=i.getState();return s(t,n,!1,e)},previous:e=>{var t;const{renderedItems:n,orientation:r,includesBaseElement:o}=i.getState(),a=!!!(null==(t=lt(n))?void 0:t.rowId)&&o;return s(st(n),r,a,e)},down:e=>{const{activeId:t,renderedItems:n,focusShift:r,focusLoop:o,includesBaseElement:a}=i.getState(),l=r&&!e,c=ft(it(pt(ut(n),t,l)));return s(c,"vertical",o&&"horizontal"!==o&&a,e)},up:e=>{const{activeId:t,renderedItems:n,focusShift:r,includesBaseElement:o}=i.getState(),a=r&&!e,l=ft(st(it(pt(ut(n),t,a))));return s(l,"vertical",o,e)}})}function mt(e,t,n){return Je(e=tt(e,t,n),n,"activeId","setActiveId"),Je(e,n,"includesBaseElement"),Je(e,n,"virtualFocus"),Je(e,n,"orientation"),Je(e,n,"rtl"),Je(e,n,"focusLoop"),Je(e,n,"focusWrap"),Je(e,n,"focusShift"),e}function gt(e={}){const[t,n]=et(ht,e);return mt(t,n,e)}var vt={id:null};function bt(e,t){return t&&e.item(t)||null}var xt=Symbol("FOCUS_SILENTLY");function yt(e,t,n){if(!t)return!1;if(t===n)return!1;const r=e.item(t.id);return!!r&&(!n||r.element!==n)}const wt=window.ReactJSXRuntime;function _t(e){const t=B.forwardRef(((t,n)=>e(b(v({},t),{ref:n}))));return t.displayName=e.displayName||e.name,t}function St(e,t){return B.memo(e,t)}function Ct(e,t){const n=t,{wrapElement:r,render:o}=n,i=x(n,["wrapElement","render"]),s=ke(t.ref,W(o));let a;if(B.isValidElement(o)){const e=b(v({},o.props),{ref:s});a=B.cloneElement(o,function(e,t){const n=v({},e);for(const r in t){if(!N(t,r))continue;if("className"===r){const r="className";n[r]=e[r]?`${e[r]} ${t[r]}`:t[r];continue}if("style"===r){const r="style";n[r]=e[r]?v(v({},e[r]),t[r]):t[r];continue}const o=t[r];if("function"==typeof o&&r.startsWith("on")){const t=e[r];if("function"==typeof t){n[r]=(...e)=>{o(...e),t(...e)};continue}}n[r]=o}return n}(i,e))}else a=o?o(i):(0,wt.jsx)(e,v({},i));return r?r(a):a}function kt(e){const t=(t={})=>e(t);return t.displayName=e.name,t}function jt(e=[],t=[]){const n=B.createContext(void 0),r=B.createContext(void 0),o=()=>B.useContext(n),i=t=>e.reduceRight(((e,n)=>(0,wt.jsx)(n,b(v({},t),{children:e}))),(0,wt.jsx)(n.Provider,v({},t)));return{context:n,scopedContext:r,useContext:o,useScopedContext:(e=!1)=>{const t=B.useContext(r),n=o();return e?t:t||n},useProviderContext:()=>{const e=B.useContext(r),t=o();if(!e||e!==t)return t},ContextProvider:i,ScopedContextProvider:e=>(0,wt.jsx)(i,b(v({},e),{children:t.reduceRight(((t,n)=>(0,wt.jsx)(n,b(v({},e),{children:t}))),(0,wt.jsx)(r.Provider,v({},e)))}))}}var Et=jt(),Pt=Et.useContext,Tt=(Et.useScopedContext,Et.useProviderContext,jt([Et.ContextProvider],[Et.ScopedContextProvider])),Rt=Tt.useContext,It=(Tt.useScopedContext,Tt.useProviderContext),Nt=Tt.ContextProvider,Mt=Tt.ScopedContextProvider,At=(0,B.createContext)(void 0),Dt=(0,B.createContext)(void 0),Ot=(0,B.createContext)(!0),zt="input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], summary, iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false'])";function Lt(e){return!!e.matches(zt)&&(!!J(e)&&!e.closest("[inert]"))}function Ft(e){if(!Lt(e))return!1;if(function(e){return Number.parseInt(e.getAttribute("tabindex")||"0",10)<0}(e))return!1;if(!("form"in e))return!0;if(!e.form)return!0;if(e.checked)return!0;if("radio"!==e.type)return!0;const t=e.form.elements.namedItem(e.name);if(!t)return!0;if(!("length"in t))return!0;const n=q(e);return!n||(n===e||(!("form"in n)||(n.form!==e.form||n.name!==e.name)))}function Bt(e,t){const n=Array.from(e.querySelectorAll(zt));t&&n.unshift(e);const r=n.filter(Lt);return r.forEach(((e,t)=>{if(X(e)&&e.contentDocument){const n=e.contentDocument.body;r.splice(t,1,...Bt(n))}})),r}function Vt(e,t,n){const r=Array.from(e.querySelectorAll(zt)),o=r.filter(Ft);return t&&Ft(e)&&o.unshift(e),o.forEach(((e,t)=>{if(X(e)&&e.contentDocument){const r=Vt(e.contentDocument.body,!1,n);o.splice(t,1,...r)}})),!o.length&&n?r:o}function $t(e,t,n){const[r]=Vt(e,t,n);return r||null}function Ht(e,t){return function(e,t,n,r){const o=q(e),i=Bt(e,t),s=i.indexOf(o),a=i.slice(s+1);return a.find(Ft)||(n?i.find(Ft):null)||(r?a[0]:null)||null}(document.body,!1,e,t)}function Wt(e,t){return function(e,t,n,r){const o=q(e),i=Bt(e,t).reverse(),s=i.indexOf(o),a=i.slice(s+1);return a.find(Ft)||(n?i.find(Ft):null)||(r?a[0]:null)||null}(document.body,!1,e,t)}function Ut(e){const t=q(e);if(!t)return!1;if(t===e)return!0;const n=t.getAttribute("aria-activedescendant");return!!n&&n===e.id}function Gt(e){const t=q(e);if(!t)return!1;if(Y(e,t))return!0;const n=t.getAttribute("aria-activedescendant");return!!n&&("id"in e&&(n===e.id||!!e.querySelector(`#${CSS.escape(n)}`)))}function Kt(e){!Gt(e)&&Lt(e)&&e.focus()}function qt(e){var t;const n=null!=(t=e.getAttribute("tabindex"))?t:"";e.setAttribute("data-tabindex",n),e.setAttribute("tabindex","-1")}var Yt=se(),Xt=["text","search","url","tel","email","password","number","date","month","week","time","datetime","datetime-local"],Zt=Symbol("safariFocusAncestor");function Qt(e,t){e&&(e[Zt]=t)}function Jt(e){return!("input"!==e.tagName.toLowerCase()||!e.type)&&("radio"===e.type||"checkbox"===e.type)}function en(e,t,n,r,o){return e?t?n&&!r?-1:void 0:n?o:o||0:o}function tn(e,t){return Se((n=>{null==e||e(n),n.defaultPrevented||t&&(n.stopPropagation(),n.preventDefault())}))}var nn=!0;function rn(e){const t=e.target;t&&"hasAttribute"in t&&(t.hasAttribute("data-focus-visible")||(nn=!1))}function on(e){e.metaKey||e.ctrlKey||e.altKey||(nn=!0)}var sn=kt((function(e){var t=e,{focusable:n=!0,accessibleWhenDisabled:r,autoFocus:o,onFocusVisible:i}=t,s=x(t,["focusable","accessibleWhenDisabled","autoFocus","onFocusVisible"]);const a=(0,B.useRef)(null);(0,B.useEffect)((()=>{n&&(ge("mousedown",rn,!0),ge("keydown",on,!0))}),[n]),Yt&&(0,B.useEffect)((()=>{if(!n)return;const e=a.current;if(!e)return;if(!Jt(e))return;const t=function(e){return"labels"in e?e.labels:null}(e);if(!t)return;const r=()=>queueMicrotask((()=>e.focus()));for(const e of t)e.addEventListener("mouseup",r);return()=>{for(const e of t)e.removeEventListener("mouseup",r)}}),[n]);const l=n&&z(s),c=!!l&&!r,[u,d]=(0,B.useState)(!1);(0,B.useEffect)((()=>{n&&c&&u&&d(!1)}),[n,c,u]),(0,B.useEffect)((()=>{if(!n)return;if(!u)return;const e=a.current;if(!e)return;if("undefined"==typeof IntersectionObserver)return;const t=new IntersectionObserver((()=>{Lt(e)||d(!1)}));return t.observe(e),()=>t.disconnect()}),[n,u]);const p=tn(s.onKeyPressCapture,l),f=tn(s.onMouseDownCapture,l),h=tn(s.onClickCapture,l),m=s.onMouseDown,g=Se((e=>{if(null==m||m(e),e.defaultPrevented)return;if(!n)return;const t=e.currentTarget;if(!Yt)return;if(le(e))return;if(!Z(t)&&!Jt(t))return;let r=!1;const o=()=>{r=!0};t.addEventListener("focusin",o,{capture:!0,once:!0});const i=function(e){for(;e&&!Lt(e);)e=e.closest(zt);return e||null}(t.parentElement);Qt(i,!0),me(t,"mouseup",(()=>{t.removeEventListener("focusin",o,!0),Qt(i,!1),r||Kt(t)}))})),y=(e,t)=>{if(t&&(e.currentTarget=t),!n)return;const r=e.currentTarget;r&&Ut(r)&&(null==i||i(e),e.defaultPrevented||(r.dataset.focusVisible="true",d(!0)))},w=s.onKeyDownCapture,_=Se((e=>{if(null==w||w(e),e.defaultPrevented)return;if(!n)return;if(u)return;if(e.metaKey)return;if(e.altKey)return;if(e.ctrlKey)return;if(!ce(e))return;const t=e.currentTarget;me(t,"focusout",(()=>y(e,t)))})),S=s.onFocusCapture,C=Se((e=>{if(null==S||S(e),e.defaultPrevented)return;if(!n)return;if(!ce(e))return void d(!1);const t=e.currentTarget,r=()=>y(e,t);nn||function(e){const{tagName:t,readOnly:n,type:r}=e;return"TEXTAREA"===t&&!n||("SELECT"===t&&!n||("INPUT"!==t||n?!!e.isContentEditable||!("combobox"!==e.getAttribute("role")||!e.dataset.name):Xt.includes(r)))}(e.target)?me(e.target,"focusout",r):d(!1)})),k=s.onBlur,j=Se((e=>{null==k||k(e),n&&he(e)&&d(!1)})),E=(0,B.useContext)(Ot),P=Se((e=>{n&&o&&e&&E&&queueMicrotask((()=>{Ut(e)||Lt(e)&&e.focus()}))})),T=Ee(a),R=n&&function(e){return!e||"button"===e||"summary"===e||"input"===e||"select"===e||"textarea"===e||"a"===e}(T),I=n&&function(e){return!e||"button"===e||"input"===e||"select"===e||"textarea"===e}(T),N=s.style,M=(0,B.useMemo)((()=>c?v({pointerEvents:"none"},N):N),[c,N]);return L(s=b(v({"data-focus-visible":n&&u||void 0,"data-autofocus":o||void 0,"aria-disabled":l||void 0},s),{ref:ke(a,P,s.ref),style:M,tabIndex:en(n,c,R,I,s.tabIndex),disabled:!(!I||!c)||void 0,contentEditable:l?void 0:s.contentEditable,onKeyPressCapture:p,onClickCapture:h,onMouseDownCapture:f,onMouseDown:g,onKeyDownCapture:_,onFocusCapture:C,onBlur:j}))}));_t((function(e){return Ct("div",sn(e))}));function an(e,t,n){return Se((r=>{var o;if(null==t||t(r),r.defaultPrevented)return;if(r.isPropagationStopped())return;if(!ce(r))return;if(function(e){return"Shift"===e.key||"Control"===e.key||"Alt"===e.key||"Meta"===e.key}(r))return;if(function(e){const t=e.target;return!(t&&!ee(t)||1!==e.key.length||e.ctrlKey||e.metaKey)}(r))return;const i=e.getState(),s=null==(o=bt(e,i.activeId))?void 0:o.element;if(!s)return;const a=r,{view:l}=a,c=x(a,["view"]);s!==(null==n?void 0:n.current)&&s.focus(),function(e,t,n){const r=new KeyboardEvent(t,n);return e.dispatchEvent(r)}(s,r.type,c)||r.preventDefault(),r.currentTarget.contains(s)&&r.stopPropagation()}))}var ln=kt((function(e){var t=e,{store:n,composite:r=!0,focusOnMove:o=r,moveOnKeyPress:i=!0}=t,s=x(t,["store","composite","focusOnMove","moveOnKeyPress"]);const a=It();D(n=n||a,!1);const l=(0,B.useRef)(null),c=(0,B.useRef)(null),u=function(e){const[t,n]=(0,B.useState)(!1),r=(0,B.useCallback)((()=>n(!0)),[]),o=e.useState((t=>bt(e,t.activeId)));return(0,B.useEffect)((()=>{const e=null==o?void 0:o.element;t&&e&&(n(!1),e.focus({preventScroll:!0}))}),[o,t]),r}(n),d=n.useState("moves"),[,p]=Ce(r?n.setBaseElement:null);(0,B.useEffect)((()=>{var e;if(!n)return;if(!d)return;if(!r)return;if(!o)return;const{activeId:t}=n.getState(),i=null==(e=bt(n,t))?void 0:e.element;i&&function(e,t){"scrollIntoView"in e?(e.focus({preventScroll:!0}),e.scrollIntoView(E({block:"nearest",inline:"nearest"},t))):e.focus()}(i)}),[n,d,r,o]),ye((()=>{if(!n)return;if(!d)return;if(!r)return;const{baseElement:e,activeId:t}=n.getState();if(!(null===t))return;if(!e)return;const o=c.current;c.current=null,o&&pe(o,{relatedTarget:e}),Ut(e)||e.focus()}),[n,d,r]);const f=n.useState("activeId"),h=n.useState("virtualFocus");ye((()=>{var e;if(!n)return;if(!r)return;if(!h)return;const t=c.current;if(c.current=null,!t)return;const o=(null==(e=bt(n,f))?void 0:e.element)||q(t);o!==t&&pe(t,{relatedTarget:o})}),[n,f,h,r]);const m=an(n,s.onKeyDownCapture,c),g=an(n,s.onKeyUpCapture,c),y=s.onFocusCapture,w=Se((e=>{if(null==y||y(e),e.defaultPrevented)return;if(!n)return;const{virtualFocus:t}=n.getState();if(!t)return;const r=e.relatedTarget,o=function(e){const t=e[xt];return delete e[xt],t}(e.currentTarget);ce(e)&&o&&(e.stopPropagation(),c.current=r)})),_=s.onFocus,S=Se((e=>{if(null==_||_(e),e.defaultPrevented)return;if(!r)return;if(!n)return;const{relatedTarget:t}=e,{virtualFocus:o}=n.getState();o?ce(e)&&!yt(n,t)&&queueMicrotask(u):ce(e)&&n.setActiveId(null)})),C=s.onBlurCapture,k=Se((e=>{var t;if(null==C||C(e),e.defaultPrevented)return;if(!n)return;const{virtualFocus:r,activeId:o}=n.getState();if(!r)return;const i=null==(t=bt(n,o))?void 0:t.element,s=e.relatedTarget,a=yt(n,s),l=c.current;if(c.current=null,ce(e)&&a)s===i?l&&l!==s&&pe(l,e):i?pe(i,e):l&&pe(l,e),e.stopPropagation();else{!yt(n,e.target)&&i&&pe(i,e)}})),j=s.onKeyDown,P=Re(i),T=Se((e=>{var t;if(null==j||j(e),e.defaultPrevented)return;if(!n)return;if(!ce(e))return;const{orientation:r,items:o,renderedItems:i,activeId:s}=n.getState(),a=bt(n,s);if(null==(t=null==a?void 0:a.element)?void 0:t.isConnected)return;const l="horizontal"!==r,c="vertical"!==r,u=function(e){return e.some((e=>!!e.rowId))}(i);if(("ArrowLeft"===e.key||"ArrowRight"===e.key||"Home"===e.key||"End"===e.key)&&ee(e.currentTarget))return;const d={ArrowUp:(u||l)&&(()=>{if(u){const e=o&&function(e){return function(e,t){return e.find((e=>t?!e.disabled&&e.id!==t:!e.disabled))}(it(st(function(e){const t=[];for(const n of e){const e=t.find((e=>{var t;return(null==(t=e[0])?void 0:t.rowId)===n.rowId}));e?e.push(n):t.push([n])}return t}(e))))}(o);return null==e?void 0:e.id}return null==n?void 0:n.last()}),ArrowRight:(u||c)&&n.first,ArrowDown:(u||l)&&n.first,ArrowLeft:(u||c)&&n.last,Home:n.first,End:n.last,PageUp:n.first,PageDown:n.last},p=d[e.key];if(p){const t=p();if(void 0!==t){if(!P(e))return;e.preventDefault(),n.move(t)}}}));s=Ie(s,(e=>(0,wt.jsx)(Nt,{value:n,children:e})),[n]);const R=n.useState((e=>{var t;if(n&&r&&e.virtualFocus)return null==(t=bt(n,e.activeId))?void 0:t.id}));s=b(v({"aria-activedescendant":R},s),{ref:ke(l,p,s.ref),onKeyDownCapture:m,onKeyUpCapture:g,onFocusCapture:w,onFocus:S,onBlurCapture:k,onKeyDown:T});const I=n.useState((e=>r&&(e.virtualFocus||null===e.activeId)));return s=sn(v({focusable:I},s))})),cn=_t((function(e){return Ct("div",ln(e))}));const un=(0,c.createContext)({}),dn=()=>(0,c.useContext)(un);var pn=(0,B.createContext)(void 0),fn=kt((function(e){const[t,n]=(0,B.useState)();return e=Ie(e,(e=>(0,wt.jsx)(pn.Provider,{value:n,children:e})),[]),L(e=v({role:"group","aria-labelledby":t},e))})),hn=(_t((function(e){return Ct("div",fn(e))})),kt((function(e){var t=e,{store:n}=t,r=x(t,["store"]);return r=fn(r)}))),mn=_t((function(e){return Ct("div",hn(e))}));const gn=(0,c.forwardRef)((function(e,t){var n;const r=dn(),o=null!==(n=e.store)&&void 0!==n?n:r.store;return(0,wt.jsx)(mn,{store:o,...e,ref:t})}));var vn=kt((function(e){const t=(0,B.useContext)(pn),n=je(e.id);return ye((()=>(null==t||t(n),()=>null==t?void 0:t(void 0))),[t,n]),L(e=v({id:n,"aria-hidden":!0},e))})),bn=(_t((function(e){return Ct("div",vn(e))})),kt((function(e){var t=e,{store:n}=t,r=x(t,["store"]);return r=vn(r)}))),xn=_t((function(e){return Ct("div",bn(e))}));const yn=(0,c.forwardRef)((function(e,t){var n;const r=dn(),o=null!==(n=e.store)&&void 0!==n?n:r.store;return(0,wt.jsx)(xn,{store:o,...e,ref:t})})),wn=(0,c.forwardRef)((function(e,t){var n;const r=dn(),o=null!==(n=e.store)&&void 0!==n?n:r.store;return(0,wt.jsx)(mn,{store:o,...e,ref:t})}));var _n=kt((function(e){var t=e,{store:n,shouldRegisterItem:r=!0,getItem:o=A,element:i}=t,s=x(t,["store","shouldRegisterItem","getItem","element"]);const a=Pt();n=n||a;const l=je(s.id),c=(0,B.useRef)(i);return(0,B.useEffect)((()=>{const e=c.current;if(!l)return;if(!e)return;if(!r)return;const t=o({id:l,element:e});return null==n?void 0:n.renderItem(t)}),[l,r,o,n]),L(s=b(v({},s),{ref:ke(c,s.ref)}))}));_t((function(e){return Ct("div",_n(e))}));function Sn(e){if(!e.isTrusted)return!1;const t=e.currentTarget;return"Enter"===e.key?Z(t)||"SUMMARY"===t.tagName||"A"===t.tagName:" "===e.key&&(Z(t)||"SUMMARY"===t.tagName||"INPUT"===t.tagName||"SELECT"===t.tagName)}var Cn=Symbol("command"),kn=kt((function(e){var t=e,{clickOnEnter:n=!0,clickOnSpace:r=!0}=t,o=x(t,["clickOnEnter","clickOnSpace"]);const i=(0,B.useRef)(null),s=Ee(i),a=o.type,[l,c]=(0,B.useState)((()=>!!s&&Z({tagName:s,type:a})));(0,B.useEffect)((()=>{i.current&&c(Z(i.current))}),[]);const[u,d]=(0,B.useState)(!1),p=(0,B.useRef)(!1),f=z(o),[h,m]=Me(o,Cn,!0),g=o.onKeyDown,y=Se((e=>{null==g||g(e);const t=e.currentTarget;if(e.defaultPrevented)return;if(h)return;if(f)return;if(!ce(e))return;if(ee(t))return;if(t.isContentEditable)return;const o=n&&"Enter"===e.key,i=r&&" "===e.key,s="Enter"===e.key&&!n,a=" "===e.key&&!r;if(s||a)e.preventDefault();else if(o||i){const n=Sn(e);if(o){if(!n){e.preventDefault();const n=e,{view:r}=n,o=x(n,["view"]),i=()=>fe(t,o);G&&/firefox\//i.test(navigator.userAgent)?me(t,"keyup",i):queueMicrotask(i)}}else i&&(p.current=!0,n||(e.preventDefault(),d(!0)))}})),w=o.onKeyUp,_=Se((e=>{if(null==w||w(e),e.defaultPrevented)return;if(h)return;if(f)return;if(e.metaKey)return;const t=r&&" "===e.key;if(p.current&&t&&(p.current=!1,!Sn(e))){e.preventDefault(),d(!1);const t=e.currentTarget,n=e,{view:r}=n,o=x(n,["view"]);queueMicrotask((()=>fe(t,o)))}}));return o=b(v(v({"data-active":u||void 0,type:l?"button":void 0},m),o),{ref:ke(i,o.ref),onKeyDown:y,onKeyUp:_}),o=sn(o)}));_t((function(e){return Ct("button",kn(e))}));function jn(e,t=!1){const{top:n}=e.getBoundingClientRect();return t?n+e.clientHeight:n}function En(e,t,n,r=!1){var o;if(!t)return;if(!n)return;const{renderedItems:i}=t.getState(),s=oe(e);if(!s)return;const a=function(e,t=!1){const n=e.clientHeight,{top:r}=e.getBoundingClientRect(),o=1.5*Math.max(.875*n,n-40),i=t?n-o+r:o+r;return"HTML"===e.tagName?i+e.scrollTop:i}(s,r);let l,c;for(let e=0;e=0){void 0!==c&&cr||(e&&(null==h?void 0:h.baseElement)&&h.baseElement===e.baseElement?h.id:void 0))),g=z(u)&&!u.accessibleWhenDisabled,y=(0,B.useCallback)((e=>{const t=b(v({},e),{id:p||e.id,rowId:m,disabled:!!g});return a?a(t):t}),[p,m,g,a]),w=u.onFocus,_=(0,B.useRef)(!1),S=Se((e=>{if(null==w||w(e),e.defaultPrevented)return;if(le(e))return;if(!p)return;if(!n)return;if(function(e,t){return!ce(e)&&yt(t,e.target)}(e,n))return;const{virtualFocus:t,baseElement:r}=n.getState();if(n.setActiveId(p),te(e.currentTarget)&&function(e,t=!1){if(ee(e))e.setSelectionRange(t?e.value.length:0,e.value.length);else if(e.isContentEditable){const n=K(e).getSelection();null==n||n.selectAllChildren(e),t&&(null==n||n.collapseToEnd())}}(e.currentTarget),!t)return;if(!ce(e))return;if(te(o=e.currentTarget)||"INPUT"===o.tagName&&!Z(o))return;var o;if(!(null==r?void 0:r.isConnected))return;se()&&e.currentTarget.hasAttribute("data-autofocus")&&e.currentTarget.scrollIntoView({block:"nearest",inline:"nearest"}),_.current=!0;e.relatedTarget===r||yt(n,e.relatedTarget)?function(e){e[xt]=!0,e.focus({preventScroll:!0})}(r):r.focus()})),C=u.onBlurCapture,k=Se((e=>{if(null==C||C(e),e.defaultPrevented)return;const t=null==n?void 0:n.getState();(null==t?void 0:t.virtualFocus)&&_.current&&(_.current=!1,e.preventDefault(),e.stopPropagation())})),j=u.onKeyDown,E=Re(o),P=Re(i),T=Se((e=>{if(null==j||j(e),e.defaultPrevented)return;if(!ce(e))return;if(!n)return;const{currentTarget:t}=e,r=n.getState(),o=n.item(p),i=!!(null==o?void 0:o.rowId),s="horizontal"!==r.orientation,a="vertical"!==r.orientation,l=()=>!!i||(!!a||(!r.baseElement||!ee(r.baseElement))),c={ArrowUp:(i||s)&&n.up,ArrowRight:(i||a)&&n.next,ArrowDown:(i||s)&&n.down,ArrowLeft:(i||a)&&n.previous,Home:()=>{if(l())return!i||e.ctrlKey?null==n?void 0:n.first():null==n?void 0:n.previous(-1)},End:()=>{if(l())return!i||e.ctrlKey?null==n?void 0:n.last():null==n?void 0:n.next(-1)},PageUp:()=>En(t,n,null==n?void 0:n.up,!0),PageDown:()=>En(t,n,null==n?void 0:n.down)}[e.key];if(c){if(te(t)){const n=function(e){let t=0,n=0;if(ee(e))t=e.selectionStart||0,n=e.selectionEnd||0;else if(e.isContentEditable){const r=K(e).getSelection();if((null==r?void 0:r.rangeCount)&&r.anchorNode&&Y(e,r.anchorNode)&&r.focusNode&&Y(e,r.focusNode)){const o=r.getRangeAt(0),i=o.cloneRange();i.selectNodeContents(e),i.setEnd(o.startContainer,o.startOffset),t=i.toString().length,i.setEnd(o.endContainer,o.endOffset),n=i.toString().length}}return{start:t,end:n}}(t),r=a&&"ArrowLeft"===e.key,o=a&&"ArrowRight"===e.key,i=s&&"ArrowUp"===e.key,l=s&&"ArrowDown"===e.key;if(o||l){const{length:e}=function(e){if(ee(e))return e.value;if(e.isContentEditable){const t=K(e).createRange();return t.selectNodeContents(e),t.toString()}return""}(t);if(n.end!==e)return}else if((r||i)&&0!==n.start)return}const r=c();if(E(e)||void 0!==r){if(!P(e))return;e.preventDefault(),n.move(r)}}})),R=Qe(n,(e=>(null==e?void 0:e.baseElement)||void 0)),I=(0,B.useMemo)((()=>({id:p,baseElement:R})),[p,R]);u=Ie(u,(e=>(0,wt.jsx)(At.Provider,{value:I,children:e})),[I]);const N=Qe(n,(e=>!!e&&e.activeId===p)),M=Qe(n,(e=>null!=l?l:e&&(null==h?void 0:h.ariaSetSize)&&h.baseElement===e.baseElement?h.ariaSetSize:void 0)),A=Qe(n,(e=>{if(null!=c)return c;if(!e)return;if(!(null==h?void 0:h.ariaPosInSet))return;if(h.baseElement!==e.baseElement)return;const t=e.renderedItems.filter((e=>e.rowId===m));return h.ariaPosInSet+t.findIndex((e=>e.id===p))})),D=Qe(n,(e=>!(null==e?void 0:e.renderedItems.length)||!e.virtualFocus&&(!!s||e.activeId===p)));return u=b(v({id:p,"data-active-item":N||void 0},u),{ref:ke(f,u.ref),tabIndex:D?u.tabIndex:-1,onFocus:S,onBlurCapture:k,onKeyDown:T}),u=kn(u),u=_n(b(v({store:n},u),{getItem:y,shouldRegisterItem:!!p&&u.shouldRegisterItem})),L(b(v({},u),{"aria-setsize":M,"aria-posinset":A}))})),Tn=St(_t((function(e){return Ct("button",Pn(e))})));const Rn=(0,c.forwardRef)((function(e,t){var n;const r=dn(),o=null!==(n=e.store)&&void 0!==n?n:r.store,i=Qe(o,(e=>null!==e?.activeId&&!o?.item(e?.activeId)?.element?.isConnected));return(0,wt.jsx)(Tn,{store:o,tabbable:i,...e,ref:t})}));var In=kt((function(e){var t=e,{store:n,"aria-setsize":r,"aria-posinset":o}=t,i=x(t,["store","aria-setsize","aria-posinset"]);const s=Rt();D(n=n||s,!1);const a=je(i.id),l=n.useState((e=>e.baseElement||void 0)),c=(0,B.useMemo)((()=>({id:a,baseElement:l,ariaSetSize:r,ariaPosInSet:o})),[a,l,r,o]);return i=Ie(i,(e=>(0,wt.jsx)(Dt.Provider,{value:c,children:e})),[c]),L(i=v({id:a},i))})),Nn=_t((function(e){return Ct("div",In(e))}));const Mn=(0,c.forwardRef)((function(e,t){var n;const r=dn(),o=null!==(n=e.store)&&void 0!==n?n:r.store;return(0,wt.jsx)(Nn,{store:o,...e,ref:t})})),An=(0,c.forwardRef)((function(e,t){var n;const r=dn(),o=null!==(n=e.store)&&void 0!==n?n:r.store;return(0,wt.jsx)(Nn,{store:o,...e,ref:t})})),Dn=Object.assign((0,c.forwardRef)((function({activeId:e,defaultActiveId:t,setActiveId:n,focusLoop:r=!1,focusWrap:o=!1,focusShift:i=!1,virtualFocus:s=!1,orientation:l="both",rtl:u=(0,a.isRTL)(),children:d,disabled:p=!1,...f},h){const m=f.store,g=gt({activeId:e,defaultActiveId:t,setActiveId:n,focusLoop:r,focusWrap:o,focusShift:i,virtualFocus:s,orientation:l,rtl:u}),v=null!=m?m:g,b=(0,c.useMemo)((()=>({store:v})),[v]);return(0,wt.jsx)(cn,{disabled:p,store:v,...f,ref:h,children:(0,wt.jsx)(un.Provider,{value:b,children:d})})})),{Group:Object.assign(gn,{displayName:"Composite.Group"}),GroupLabel:Object.assign(yn,{displayName:"Composite.GroupLabel"}),Item:Object.assign(Rn,{displayName:"Composite.Item"}),Row:Object.assign(Mn,{displayName:"Composite.Row"}),Hover:Object.assign(wn,{displayName:"Composite.Hover"}),Typeahead:Object.assign(An,{displayName:"Composite.Typeahead"}),Context:Object.assign(un,{displayName:"Composite.Context"})});function On(e={}){const t=qe(e.store,Ke(e.disclosure,["contentElement","disclosureElement"])),n=null==t?void 0:t.getState(),r=F(e.open,null==n?void 0:n.open,e.defaultOpen,!1),o=F(e.animated,null==n?void 0:n.animated,!1),i=Ve({open:r,animated:o,animating:!!o&&r,mounted:r,contentElement:F(null==n?void 0:n.contentElement,null),disclosureElement:F(null==n?void 0:n.disclosureElement,null)},t);return $e(i,(()=>Ue(i,["animated","animating"],(e=>{e.animated||i.setState("animating",!1)})))),$e(i,(()=>We(i,["open"],(()=>{i.getState().animated&&i.setState("animating",!0)})))),$e(i,(()=>Ue(i,["open","animating"],(e=>{i.setState("mounted",e.open||e.animating)})))),P(E({},i),{disclosure:e.disclosure,setOpen:e=>i.setState("open",e),show:()=>i.setState("open",!0),hide:()=>i.setState("open",!1),toggle:()=>i.setState("open",(e=>!e)),stopAnimation:()=>i.setState("animating",!1),setContentElement:e=>i.setState("contentElement",e),setDisclosureElement:e=>i.setState("disclosureElement",e)})}function zn(e,t,n){return Pe(t,[n.store,n.disclosure]),Je(e,n,"open","setOpen"),Je(e,n,"mounted","setMounted"),Je(e,n,"animated"),Object.assign(e,{disclosure:n.disclosure})}function Ln(e={}){const[t,n]=et(On,e);return zn(t,n,e)}function Fn(e={}){return On(e)}function Bn(e,t,n){return zn(e,t,n)}function Vn(e,t,n){return Pe(t,[n.popover]),Je(e,n,"placement"),Bn(e,t,n)}function $n(e,t,n){return Je(e,n,"timeout"),Je(e,n,"showTimeout"),Je(e,n,"hideTimeout"),Vn(e,t,n)}function Hn(e={}){var t=e,{popover:n}=t,r=T(t,["popover"]);const o=qe(r.store,Ke(n,["arrowElement","anchorElement","contentElement","popoverElement","disclosureElement"])),i=null==o?void 0:o.getState(),s=Fn(P(E({},r),{store:o})),a=F(r.placement,null==i?void 0:i.placement,"bottom"),l=Ve(P(E({},s.getState()),{placement:a,currentPlacement:a,anchorElement:F(null==i?void 0:i.anchorElement,null),popoverElement:F(null==i?void 0:i.popoverElement,null),arrowElement:F(null==i?void 0:i.arrowElement,null),rendered:Symbol("rendered")}),s,o);return P(E(E({},s),l),{setAnchorElement:e=>l.setState("anchorElement",e),setPopoverElement:e=>l.setState("popoverElement",e),setArrowElement:e=>l.setState("arrowElement",e),render:()=>l.setState("rendered",Symbol("rendered"))})}function Wn(e={}){var t;const n=null==(t=e.store)?void 0:t.getState(),r=Hn(P(E({},e),{placement:F(e.placement,null==n?void 0:n.placement,"bottom")})),o=F(e.timeout,null==n?void 0:n.timeout,500),i=Ve(P(E({},r.getState()),{timeout:o,showTimeout:F(e.showTimeout,null==n?void 0:n.showTimeout),hideTimeout:F(e.hideTimeout,null==n?void 0:n.hideTimeout),autoFocusOnShow:F(null==n?void 0:n.autoFocusOnShow,!1)}),r,e.store);return P(E(E({},r),i),{setAutoFocusOnShow:e=>i.setState("autoFocusOnShow",e)})}function Un(e={}){var t;const n=null==(t=e.store)?void 0:t.getState(),r=Wn(P(E({},e),{placement:F(e.placement,null==n?void 0:n.placement,"top"),hideTimeout:F(e.hideTimeout,null==n?void 0:n.hideTimeout,0)})),o=Ve(P(E({},r.getState()),{type:F(e.type,null==n?void 0:n.type,"description"),skipTimeout:F(e.skipTimeout,null==n?void 0:n.skipTimeout,300)}),r,e.store);return E(E({},r),o)}function Gn(e={}){const[t,n]=et(Un,e);return function(e,t,n){return Je(e,n,"type"),Je(e,n,"skipTimeout"),$n(e,t,n)}(t,n,e)}kt((function(e){return e}));var Kn=_t((function(e){return Ct("div",e)}));Object.assign(Kn,["a","button","details","dialog","div","form","h1","h2","h3","h4","h5","h6","header","img","input","label","li","nav","ol","p","section","select","span","summary","textarea","ul","svg"].reduce(((e,t)=>(e[t]=_t((function(e){return Ct(t,e)})),e)),{}));var qn=jt(),Yn=(qn.useContext,qn.useScopedContext,qn.useProviderContext),Xn=jt([qn.ContextProvider],[qn.ScopedContextProvider]),Zn=(Xn.useContext,Xn.useScopedContext,Xn.useProviderContext),Qn=Xn.ContextProvider,Jn=Xn.ScopedContextProvider,er=(0,B.createContext)(void 0),tr=(0,B.createContext)(void 0),nr=jt([Qn],[Jn]),rr=nr.useContext,or=(nr.useScopedContext,nr.useProviderContext),ir=nr.ContextProvider,sr=nr.ScopedContextProvider,ar=jt([ir],[sr]),lr=(ar.useContext,ar.useScopedContext,ar.useProviderContext),cr=ar.ContextProvider,ur=ar.ScopedContextProvider,dr=kt((function(e){var t=e,{store:n,showOnHover:r=!0}=t,o=x(t,["store","showOnHover"]);const i=lr();D(n=n||i,!1);const s=z(o),a=(0,B.useRef)(0);(0,B.useEffect)((()=>()=>window.clearTimeout(a.current)),[]),(0,B.useEffect)((()=>ge("mouseleave",(e=>{if(!n)return;const{anchorElement:t}=n.getState();t&&e.target===t&&(window.clearTimeout(a.current),a.current=0)}),!0)),[n]);const l=o.onMouseMove,c=Re(r),u=Ae(),d=Se((e=>{if(null==l||l(e),s)return;if(!n)return;if(e.defaultPrevented)return;if(a.current)return;if(!u())return;if(!c(e))return;const t=e.currentTarget;n.setAnchorElement(t),n.setDisclosureElement(t);const{showTimeout:r,timeout:o}=n.getState(),i=()=>{a.current=0,u()&&(null==n||n.setAnchorElement(t),null==n||n.show(),queueMicrotask((()=>{null==n||n.setDisclosureElement(t)})))},d=null!=r?r:o;0===d?i():a.current=window.setTimeout(i,d)})),p=o.onClick,f=Se((e=>{null==p||p(e),n&&(window.clearTimeout(a.current),a.current=0)})),h=(0,B.useCallback)((e=>{if(!n)return;const{anchorElement:t}=n.getState();(null==t?void 0:t.isConnected)||n.setAnchorElement(e)}),[n]);return o=b(v({},o),{ref:ke(h,o.ref),onMouseMove:d,onClick:f}),o=sn(o)})),pr=(_t((function(e){return Ct("a",dr(e))})),jt([cr],[ur])),fr=(pr.useContext,pr.useScopedContext,pr.useProviderContext),hr=(pr.ContextProvider,pr.ScopedContextProvider),mr=Ve({activeStore:null});function gr(e){return()=>{const{activeStore:t}=mr.getState();t===e&&mr.setState("activeStore",null)}}var vr=kt((function(e){var t=e,{store:n,showOnHover:r=!0}=t,o=x(t,["store","showOnHover"]);const i=fr();D(n=n||i,!1);const s=(0,B.useRef)(!1);(0,B.useEffect)((()=>Ue(n,["mounted"],(e=>{e.mounted||(s.current=!1)}))),[n]),(0,B.useEffect)((()=>{if(n)return M(gr(n),Ue(n,["mounted","skipTimeout"],(e=>{if(!n)return;if(e.mounted){const{activeStore:e}=mr.getState();return e!==n&&(null==e||e.hide()),mr.setState("activeStore",n)}const t=setTimeout(gr(n),e.skipTimeout);return()=>clearTimeout(t)})))}),[n]);const a=o.onMouseEnter,l=Se((e=>{null==a||a(e),s.current=!0})),c=o.onFocusVisible,u=Se((e=>{null==c||c(e),e.defaultPrevented||(null==n||n.setAnchorElement(e.currentTarget),null==n||n.show())})),d=o.onBlur,p=Se((e=>{if(null==d||d(e),e.defaultPrevented)return;const{activeStore:t}=mr.getState();s.current=!1,t===n&&mr.setState("activeStore",null)})),f=n.useState("type"),h=n.useState((e=>{var t;return null==(t=e.contentElement)?void 0:t.id}));return o=b(v({"aria-labelledby":"label"===f?h:void 0},o),{onMouseEnter:l,onFocusVisible:u,onBlur:p}),o=dr(v({store:n,showOnHover(e){if(!s.current)return!1;if(O(r,e))return!1;const{activeStore:t}=mr.getState();return!t||(null==n||n.show(),!1)}},o))})),br=_t((function(e){return Ct("div",vr(e))}));function xr(e){return[e.clientX,e.clientY]}function yr(e,t){const[n,r]=e;let o=!1;for(let e=t.length,i=0,s=e-1;i=u&&r0&&(r===u?r>d&&(o=!o):o=!o)}}else if(ll&&r<=u){if(0===p)return!0;p<0&&(r===u?r=c&&n<=a||n>=a&&n<=c))return!0}return o}function wr(e,t){const n=e.getBoundingClientRect(),{top:r,right:o,bottom:i,left:s}=n,[a,l]=function(e,t){const{top:n,right:r,bottom:o,left:i}=t,[s,a]=e;return[sr?"right":null,ao?"bottom":null]}(t,n),c=[t];return a?("top"!==l&&c.push(["left"===a?s:o,r]),c.push(["left"===a?o:s,r]),c.push(["left"===a?o:s,i]),"bottom"!==l&&c.push(["left"===a?s:o,i])):"top"===l?(c.push([s,r]),c.push([s,i]),c.push([o,i]),c.push([o,r])):(c.push([s,i]),c.push([s,r]),c.push([o,r]),c.push([o,i])),c}function _r(e,...t){if(!e)return!1;const n=e.getAttribute("data-backdrop");return null!=n&&(""===n||("true"===n||(!t.length||t.some((e=>n===e)))))}var Sr=new WeakMap;function Cr(e,t,n){Sr.has(e)||Sr.set(e,new Map);const r=Sr.get(e),o=r.get(t);if(!o)return r.set(t,n()),()=>{var e;null==(e=r.get(t))||e(),r.delete(t)};const i=n(),s=()=>{i(),o(),r.delete(t)};return r.set(t,s),()=>{r.get(t)===s&&(i(),r.set(t,o))}}function kr(e,t,n){return Cr(e,t,(()=>{const r=e.getAttribute(t);return e.setAttribute(t,n),()=>{null==r?e.removeAttribute(t):e.setAttribute(t,r)}}))}function jr(e,t,n){return Cr(e,t,(()=>{const r=t in e,o=e[t];return e[t]=n,()=>{r?e[t]=o:delete e[t]}}))}function Er(e,t){if(!e)return()=>{};return Cr(e,"style",(()=>{const n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}))}var Pr=["SCRIPT","STYLE"];function Tr(e){return`__ariakit-dialog-snapshot-${e}`}function Rr(e,t,n){return!Pr.includes(t.tagName)&&(!!function(e,t){const n=K(t),r=Tr(e);if(!n.body[r])return!0;for(;;){if(t===n.body)return!1;if(t[r])return!0;if(!t.parentElement)return!1;t=t.parentElement}}(e,t)&&!n.some((e=>e&&Y(t,e))))}function Ir(e,t,n,r){for(let o of t){if(!(null==o?void 0:o.isConnected))continue;const i=t.some((e=>!!e&&(e!==o&&e.contains(o)))),s=K(o),a=o;for(;o.parentElement&&o!==s.body;){if(null==r||r(o.parentElement,a),!i)for(const r of o.parentElement.children)Rr(e,r,t)&&n(r,a);o=o.parentElement}}}function Nr(e="",t=!1){return`__ariakit-dialog-${t?"ancestor":"outside"}${e?`-${e}`:""}`}function Mr(e,t=""){return M(jr(e,Nr("",!0),!0),jr(e,Nr(t,!0),!0))}function Ar(e,t){if(e[Nr(t,!0)])return!0;const n=Nr(t);for(;;){if(e[n])return!0;if(!e.parentElement)return!1;e=e.parentElement}}function Dr(e,t){const n=[],r=t.map((e=>null==e?void 0:e.id));Ir(e,t,(t=>{_r(t,...r)||n.unshift(function(e,t=""){return M(jr(e,Nr(),!0),jr(e,Nr(t),!0))}(t,e))}),((t,r)=>{r.hasAttribute("data-dialog")&&r.id!==e||n.unshift(Mr(t,e))}));return()=>{for(const e of n)e()}}const Or=window.ReactDOM;function zr(e,t){const n=setTimeout(t,e);return()=>clearTimeout(n)}function Lr(...e){return e.join(", ").split(", ").reduce(((e,t)=>{const n=t.endsWith("ms")?1:1e3,r=Number.parseFloat(t||"0s")*n;return r>e?r:e}),0)}function Fr(e,t,n){return!(n||!1===t||e&&!t)}var Br=kt((function(e){var t=e,{store:n,alwaysVisible:r}=t,o=x(t,["store","alwaysVisible"]);const i=Yn();D(n=n||i,!1);const s=(0,B.useRef)(null),a=je(o.id),[l,c]=(0,B.useState)(null),u=n.useState("open"),d=n.useState("mounted"),p=n.useState("animated"),f=n.useState("contentElement"),h=Qe(n.disclosure,"contentElement");ye((()=>{s.current&&(null==n||n.setContentElement(s.current))}),[n]),ye((()=>{let e;return null==n||n.setState("animated",(t=>(e=t,!0))),()=>{void 0!==e&&(null==n||n.setState("animated",e))}}),[n]),ye((()=>{if(p){if(null==f?void 0:f.isConnected)return function(e){let t=requestAnimationFrame((()=>{t=requestAnimationFrame(e)}));return()=>cancelAnimationFrame(t)}((()=>{c(u?"enter":d?"leave":null)}));c(null)}}),[p,f,u,d]),ye((()=>{if(!n)return;if(!p)return;const e=()=>null==n?void 0:n.setState("animating",!1),t=()=>(0,Or.flushSync)(e);if(!l||!f)return void e();if("leave"===l&&u)return;if("enter"===l&&!u)return;if("number"==typeof p){return zr(p,t)}const{transitionDuration:r,animationDuration:o,transitionDelay:i,animationDelay:s}=getComputedStyle(f),{transitionDuration:a="0",animationDuration:c="0",transitionDelay:d="0",animationDelay:m="0"}=h?getComputedStyle(h):{},g=Lr(i,s,d,m)+Lr(r,o,a,c);if(!g)return"enter"===l&&n.setState("animated",!1),void e();return zr(Math.max(g-1e3/60,0),t)}),[n,p,f,h,u,l]),o=Ie(o,(e=>(0,wt.jsx)(Jn,{value:n,children:e})),[n]);const m=Fr(d,o.hidden,r),g=o.style,y=(0,B.useMemo)((()=>m?b(v({},g),{display:"none"}):g),[m,g]);return L(o=b(v({id:a,"data-open":u||void 0,"data-enter":"enter"===l||void 0,"data-leave":"leave"===l||void 0,hidden:m},o),{ref:ke(a?n.setContentElement:null,s,o.ref),style:y}))})),Vr=_t((function(e){return Ct("div",Br(e))})),$r=_t((function(e){var t=e,{unmountOnHide:n}=t,r=x(t,["unmountOnHide"]);const o=Yn();return!1===Qe(r.store||o,(e=>!n||(null==e?void 0:e.mounted)))?null:(0,wt.jsx)(Vr,v({},r))}));function Hr({store:e,backdrop:t,alwaysVisible:n,hidden:r}){const o=(0,B.useRef)(null),i=Ln({disclosure:e}),s=e.useState("contentElement");ye((()=>{const e=o.current,t=s;e&&t&&(e.style.zIndex=getComputedStyle(t).zIndex)}),[s]),ye((()=>{const e=null==s?void 0:s.id;if(!e)return;const t=o.current;return t?Mr(t,e):void 0}),[s]);const a=Br({ref:o,store:i,role:"presentation","data-backdrop":(null==s?void 0:s.id)||"",alwaysVisible:n,hidden:null!=r?r:void 0,style:{position:"fixed",top:0,right:0,bottom:0,left:0}});if(!t)return null;if((0,B.isValidElement)(t))return(0,wt.jsx)(Kn,b(v({},a),{render:t}));const l="boolean"!=typeof t?t:"div";return(0,wt.jsx)(Kn,b(v({},a),{render:(0,wt.jsx)(l,{})}))}function Wr(e){return kr(e,"aria-hidden","true")}function Ur(){return"inert"in HTMLElement.prototype}function Gr(e,t){if(!("style"in e))return R;if(Ur())return jr(e,"inert",!0);const n=Vt(e,!0).map((e=>{if(null==t?void 0:t.some((t=>t&&Y(t,e))))return R;const n=Cr(e,"focus",(()=>(e.focus=R,()=>{delete e.focus})));return M(kr(e,"tabindex","-1"),n)}));return M(...n,Wr(e),Er(e,{pointerEvents:"none",userSelect:"none",cursor:"default"}))}function Kr(e,t,n){const r=function({attribute:e,contentId:t,contentElement:n,enabled:r}){const[o,i]=Te(),s=(0,B.useCallback)((()=>{if(!r)return!1;if(!n)return!1;const{body:o}=K(n),i=o.getAttribute(e);return!i||i===t}),[o,r,n,e,t]);return(0,B.useEffect)((()=>{if(!r)return;if(!t)return;if(!n)return;const{body:o}=K(n);if(s())return o.setAttribute(e,t),()=>o.removeAttribute(e);const a=new MutationObserver((()=>(0,Or.flushSync)(i)));return a.observe(o,{attributeFilter:[e]}),()=>a.disconnect()}),[o,r,t,n,s,e]),s}({attribute:"data-dialog-prevent-body-scroll",contentElement:e,contentId:t,enabled:n});(0,B.useEffect)((()=>{if(!r())return;if(!e)return;const t=K(e),n=function(e){return K(e).defaultView||window}(e),{documentElement:o,body:i}=t,s=o.style.getPropertyValue("--scrollbar-width"),a=s?Number.parseInt(s):n.innerWidth-o.clientWidth,l=function(e){const t=e.getBoundingClientRect().left;return Math.round(t)+e.scrollLeft?"paddingLeft":"paddingRight"}(o),c=ie()&&!ae();return M((d="--scrollbar-width",p=`${a}px`,(u=o)?Cr(u,d,(()=>{const e=u.style.getPropertyValue(d);return u.style.setProperty(d,p),()=>{e?u.style.setProperty(d,e):u.style.removeProperty(d)}})):()=>{}),c?(()=>{var e,t;const{scrollX:r,scrollY:o,visualViewport:s}=n,c=null!=(e=null==s?void 0:s.offsetLeft)?e:0,u=null!=(t=null==s?void 0:s.offsetTop)?t:0,d=Er(i,{position:"fixed",overflow:"hidden",top:-(o-Math.floor(u))+"px",left:-(r-Math.floor(c))+"px",right:"0",[l]:`${a}px`});return()=>{d(),n.scrollTo({left:r,top:o,behavior:"instant"})}})():Er(i,{overflow:"hidden",[l]:`${a}px`}));var u,d,p}),[r,e])}var qr=(0,B.createContext)({});function Yr({store:e,type:t,listener:n,capture:r,domReady:o}){const i=Se(n),s=Qe(e,"open"),a=(0,B.useRef)(!1);ye((()=>{if(!s)return;if(!o)return;const{contentElement:t}=e.getState();if(!t)return;const n=()=>{a.current=!0};return t.addEventListener("focusin",n,!0),()=>t.removeEventListener("focusin",n,!0)}),[e,s,o]),(0,B.useEffect)((()=>{if(!s)return;return ge(t,(t=>{const{contentElement:n,disclosureElement:r}=e.getState(),o=t.target;if(!n)return;if(!o)return;if(!function(e){return"HTML"===e.tagName||Y(K(e).body,e)}(o))return;if(Y(n,o))return;if(function(e,t){if(!e)return!1;if(Y(e,t))return!0;const n=t.getAttribute("aria-activedescendant");if(n){const t=K(e).getElementById(n);if(t)return Y(e,t)}return!1}(r,o))return;if(o.hasAttribute("data-focus-trap"))return;if(function(e,t){if(!("clientY"in e))return!1;const n=t.getBoundingClientRect();return 0!==n.width&&0!==n.height&&n.top<=e.clientY&&e.clientY<=n.top+n.height&&n.left<=e.clientX&&e.clientX<=n.left+n.width}(t,n))return;var s;a.current&&!Ar(o,n.id)||((s=o)&&s[Zt]||i(t))}),r)}),[s,r])}function Xr(e,t){return"function"==typeof e?e(t):!!e}function Zr(e,t,n){const r=function(e){const t=(0,B.useRef)();return(0,B.useEffect)((()=>{if(e)return ge("mousedown",(e=>{t.current=e.target}),!0);t.current=null}),[e]),t}(Qe(e,"open")),o={store:e,domReady:n,capture:!0};Yr(b(v({},o),{type:"click",listener:n=>{const{contentElement:o}=e.getState(),i=r.current;i&&J(i)&&Ar(i,null==o?void 0:o.id)&&Xr(t,n)&&e.hide()}})),Yr(b(v({},o),{type:"focusin",listener:n=>{const{contentElement:r}=e.getState();r&&n.target!==K(r)&&Xr(t,n)&&e.hide()}})),Yr(b(v({},o),{type:"contextmenu",listener:n=>{Xr(t,n)&&e.hide()}}))}var Qr=kt((function(e){var t=e,{autoFocusOnShow:n=!0}=t,r=x(t,["autoFocusOnShow"]);return r=Ie(r,(e=>(0,wt.jsx)(Ot.Provider,{value:n,children:e})),[n])})),Jr=(_t((function(e){return Ct("div",Qr(e))})),(0,B.createContext)(0));function eo({level:e,children:t}){const n=(0,B.useContext)(Jr),r=Math.max(Math.min(e||n+1,6),1);return(0,wt.jsx)(Jr.Provider,{value:r,children:t})}var to=kt((function(e){return e=b(v({},e),{style:v({border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"},e.style)})})),no=(_t((function(e){return Ct("span",to(e))})),kt((function(e){return e=b(v({"data-focus-trap":"",tabIndex:0,"aria-hidden":!0},e),{style:v({position:"fixed",top:0,left:0},e.style)}),e=to(e)}))),ro=_t((function(e){return Ct("span",no(e))})),oo=(0,B.createContext)(null);function io(e){queueMicrotask((()=>{null==e||e.focus()}))}var so=kt((function(e){var t=e,{preserveTabOrder:n,preserveTabOrderAnchor:r,portalElement:o,portalRef:i,portal:s=!0}=t,a=x(t,["preserveTabOrder","preserveTabOrderAnchor","portalElement","portalRef","portal"]);const l=(0,B.useRef)(null),c=ke(l,a.ref),u=(0,B.useContext)(oo),[d,p]=(0,B.useState)(null),[f,h]=(0,B.useState)(null),m=(0,B.useRef)(null),g=(0,B.useRef)(null),y=(0,B.useRef)(null),w=(0,B.useRef)(null);return ye((()=>{const e=l.current;if(!e||!s)return void p(null);const t=function(e,t){return t?"function"==typeof t?t(e):t:K(e).createElement("div")}(e,o);if(!t)return void p(null);const n=t.isConnected;if(!n){const n=u||function(e){return K(e).body}(e);n.appendChild(t)}return t.id||(t.id=e.id?`portal/${e.id}`:function(e="id"){return`${e?`${e}-`:""}${Math.random().toString(36).substr(2,6)}`}()),p(t),H(i,t),n?void 0:()=>{t.remove(),H(i,null)}}),[s,o,u,i]),ye((()=>{if(!s)return;if(!n)return;if(!r)return;const e=K(r).createElement("span");return e.style.position="fixed",r.insertAdjacentElement("afterend",e),h(e),()=>{e.remove(),h(null)}}),[s,n,r]),(0,B.useEffect)((()=>{if(!d)return;if(!n)return;let e=0;const t=t=>{if(!he(t))return;const n="focusin"===t.type;if(cancelAnimationFrame(e),n)return function(e){const t=e.querySelectorAll("[data-tabindex]"),n=e=>{const t=e.getAttribute("data-tabindex");e.removeAttribute("data-tabindex"),t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")};e.hasAttribute("data-tabindex")&&n(e);for(const e of t)n(e)}(d);e=requestAnimationFrame((()=>{!function(e,t){const n=Vt(e,t);for(const e of n)qt(e)}(d,!0)}))};return d.addEventListener("focusin",t,!0),d.addEventListener("focusout",t,!0),()=>{cancelAnimationFrame(e),d.removeEventListener("focusin",t,!0),d.removeEventListener("focusout",t,!0)}}),[d,n]),a=Ie(a,(e=>{if(e=(0,wt.jsx)(oo.Provider,{value:d||u,children:e}),!s)return e;if(!d)return(0,wt.jsx)("span",{ref:c,id:a.id,style:{position:"fixed"},hidden:!0});e=(0,wt.jsxs)(wt.Fragment,{children:[n&&d&&(0,wt.jsx)(ro,{ref:g,className:"__focus-trap-inner-before",onFocus:e=>{he(e,d)?io(Ht()):io(m.current)}}),e,n&&d&&(0,wt.jsx)(ro,{ref:y,className:"__focus-trap-inner-after",onFocus:e=>{he(e,d)?io(Wt()):io(w.current)}})]}),d&&(e=(0,Or.createPortal)(e,d));let t=(0,wt.jsxs)(wt.Fragment,{children:[n&&d&&(0,wt.jsx)(ro,{ref:m,className:"__focus-trap-outer-before",onFocus:e=>{!(e.relatedTarget===w.current)&&he(e,d)?io(g.current):io(Wt())}}),n&&(0,wt.jsx)("span",{"aria-owns":null==d?void 0:d.id,style:{position:"fixed"}}),n&&d&&(0,wt.jsx)(ro,{ref:w,className:"__focus-trap-outer-after",onFocus:e=>{if(he(e,d))io(y.current);else{const e=Ht();if(e===g.current)return void requestAnimationFrame((()=>{var e;return null==(e=Ht())?void 0:e.focus()}));io(e)}}})]});return f&&n&&(t=(0,Or.createPortal)(t,f)),(0,wt.jsxs)(wt.Fragment,{children:[t,e]})}),[d,u,s,a.id,n,f]),a=b(v({},a),{ref:c})})),ao=(_t((function(e){return Ct("div",so(e))})),se());function lo(e,t=!1){if(!e)return null;const n="current"in e?e.current:e;return n?t?Lt(n)?n:null:n:null}var co=kt((function(e){var t=e,{store:n,open:r,onClose:o,focusable:i=!0,modal:s=!0,portal:a=!!s,backdrop:l=!!s,hideOnEscape:c=!0,hideOnInteractOutside:u=!0,getPersistentElements:d,preventBodyScroll:p=!!s,autoFocusOnShow:f=!0,autoFocusOnHide:h=!0,initialFocus:m,finalFocus:g,unmountOnHide:y,unstable_treeSnapshotKey:w}=t,_=x(t,["store","open","onClose","focusable","modal","portal","backdrop","hideOnEscape","hideOnInteractOutside","getPersistentElements","preventBodyScroll","autoFocusOnShow","autoFocusOnHide","initialFocus","finalFocus","unmountOnHide","unstable_treeSnapshotKey"]);const S=Zn(),C=(0,B.useRef)(null),k=function(e={}){const[t,n]=et(Fn,e);return Bn(t,n,e)}({store:n||S,open:r,setOpen(e){if(e)return;const t=C.current;if(!t)return;const n=new Event("close",{bubbles:!1,cancelable:!0});o&&t.addEventListener("close",o,{once:!0}),t.dispatchEvent(n),n.defaultPrevented&&k.setOpen(!0)}}),{portalRef:j,domReady:E}=Ne(a,_.portalRef),P=_.preserveTabOrder,T=k.useState((e=>P&&!s&&e.mounted)),R=je(_.id),I=k.useState("open"),N=k.useState("mounted"),A=k.useState("contentElement"),D=Fr(N,_.hidden,_.alwaysVisible);Kr(A,R,p&&!D),Zr(k,u,E);const{wrapElement:O,nestedDialogs:z}=function(e){const t=(0,B.useContext)(qr),[n,r]=(0,B.useState)([]),o=(0,B.useCallback)((e=>{var n;return r((t=>[...t,e])),M(null==(n=t.add)?void 0:n.call(t,e),(()=>{r((t=>t.filter((t=>t!==e))))}))}),[t]);ye((()=>Ue(e,["open","contentElement"],(n=>{var r;if(n.open&&n.contentElement)return null==(r=t.add)?void 0:r.call(t,e)}))),[e,t]);const i=(0,B.useMemo)((()=>({store:e,add:o})),[e,o]);return{wrapElement:(0,B.useCallback)((e=>(0,wt.jsx)(qr.Provider,{value:i,children:e})),[i]),nestedDialogs:n}}(k);_=Ie(_,O,[O]),ye((()=>{if(!I)return;const e=C.current,t=q(e,!0);t&&"BODY"!==t.tagName&&(e&&Y(e,t)||k.setDisclosureElement(t))}),[k,I]),ao&&(0,B.useEffect)((()=>{if(!N)return;const{disclosureElement:e}=k.getState();if(!e)return;if(!Z(e))return;const t=()=>{let t=!1;const n=()=>{t=!0};e.addEventListener("focusin",n,{capture:!0,once:!0}),me(e,"mouseup",(()=>{e.removeEventListener("focusin",n,!0),t||Kt(e)}))};return e.addEventListener("mousedown",t),()=>{e.removeEventListener("mousedown",t)}}),[k,N]),(0,B.useEffect)((()=>{if(!s)return;if(!N)return;if(!E)return;const e=C.current;if(!e)return;return e.querySelector("[data-dialog-dismiss]")?void 0:function(e,t){const n=K(e).createElement("button");return n.type="button",n.tabIndex=-1,n.textContent="Dismiss popup",Object.assign(n.style,{border:"0px",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0px",position:"absolute",whiteSpace:"nowrap",width:"1px"}),n.addEventListener("click",t),e.prepend(n),()=>{n.removeEventListener("click",t),n.remove()}}(e,k.hide)}),[k,s,N,E]),ye((()=>{if(!Ur())return;if(I)return;if(!N)return;if(!E)return;const e=C.current;return e?Gr(e):void 0}),[I,N,E]);const L=I&&E;ye((()=>{if(!R)return;if(!L)return;const e=C.current;return function(e,t){const{body:n}=K(t[0]),r=[];return Ir(e,t,(t=>{r.push(jr(t,Tr(e),!0))})),M(jr(n,Tr(e),!0),(()=>{for(const e of r)e()}))}(R,[e])}),[R,L,w]);const F=Se(d);ye((()=>{if(!R)return;if(!L)return;const{disclosureElement:e}=k.getState(),t=[C.current,...F()||[],...z.map((e=>e.getState().contentElement))];return s?M(Dr(R,t),function(e,t){const n=[],r=t.map((e=>null==e?void 0:e.id));return Ir(e,t,(e=>{_r(e,...r)||n.unshift(Gr(e,t))}),(e=>{e.hasAttribute("role")&&(t.some((t=>t&&Y(t,e)))||n.unshift(kr(e,"role","none")))})),()=>{for(const e of n)e()}}(R,t)):Dr(R,[e,...t])}),[R,k,L,F,z,s,w]);const V=!!f,$=Re(f),[H,W]=(0,B.useState)(!1);(0,B.useEffect)((()=>{if(!I)return;if(!V)return;if(!E)return;if(!(null==A?void 0:A.isConnected))return;const e=lo(m,!0)||A.querySelector("[data-autofocus=true],[autofocus]")||$t(A,!0,a&&T)||A,t=Lt(e);$(t?e:null)&&(W(!0),queueMicrotask((()=>{e.focus(),ao&&e.scrollIntoView({block:"nearest",inline:"nearest"})})))}),[I,V,E,A,m,a,T,$]);const U=!!h,G=Re(h),[X,Q]=(0,B.useState)(!1);(0,B.useEffect)((()=>{if(I)return Q(!0),()=>Q(!1)}),[I]);const J=(0,B.useCallback)(((e,t=!0)=>{const{disclosureElement:n}=k.getState();if(function(e){const t=q();return!(!t||e&&Y(e,t)||!Lt(t))}(e))return;let r=lo(g)||n;if(null==r?void 0:r.id){const e=K(r),t=`[aria-activedescendant="${r.id}"]`,n=e.querySelector(t);n&&(r=n)}if(r&&!Lt(r)){const e=r.closest("[data-dialog]");if(null==e?void 0:e.id){const t=K(e),n=`[aria-controls~="${e.id}"]`,o=t.querySelector(n);o&&(r=o)}}const o=r&&Lt(r);o||!t?G(o?r:null)&&o&&(null==r||r.focus()):requestAnimationFrame((()=>J(e,!1)))}),[k,g,G]),ee=(0,B.useRef)(!1);ye((()=>{if(I)return;if(!X)return;if(!U)return;const e=C.current;ee.current=!0,J(e)}),[I,X,E,U,J]),(0,B.useEffect)((()=>{if(!X)return;if(!U)return;const e=C.current;return()=>{ee.current?ee.current=!1:J(e)}}),[X,U,J]);const te=Re(c);(0,B.useEffect)((()=>{if(!E)return;if(!N)return;return ge("keydown",(e=>{if("Escape"!==e.key)return;if(e.defaultPrevented)return;const t=C.current;if(!t)return;if(Ar(t))return;const n=e.target;if(!n)return;const{disclosureElement:r}=k.getState();("BODY"===n.tagName||Y(t,n)||!r||Y(r,n))&&te(e)&&k.hide()}),!0)}),[k,E,N,te]);const ne=(_=Ie(_,(e=>(0,wt.jsx)(eo,{level:s?1:void 0,children:e})),[s])).hidden,re=_.alwaysVisible;_=Ie(_,(e=>l?(0,wt.jsxs)(wt.Fragment,{children:[(0,wt.jsx)(Hr,{store:k,backdrop:l,hidden:ne,alwaysVisible:re}),e]}):e),[k,l,ne,re]);const[oe,ie]=(0,B.useState)(),[se,ae]=(0,B.useState)();return _=Ie(_,(e=>(0,wt.jsx)(Jn,{value:k,children:(0,wt.jsx)(er.Provider,{value:ie,children:(0,wt.jsx)(tr.Provider,{value:ae,children:e})})})),[k]),_=b(v({id:R,"data-dialog":"",role:"dialog",tabIndex:i?-1:void 0,"aria-labelledby":oe,"aria-describedby":se},_),{ref:ke(C,_.ref)}),_=Qr(b(v({},_),{autoFocusOnShow:H})),_=Br(v({store:k},_)),_=sn(b(v({},_),{focusable:i})),_=so(b(v({portal:a},_),{portalRef:j,preserveTabOrder:T}))}));function uo(e,t=Zn){return _t((function(n){const r=t();return Qe(n.store||r,(e=>!n.unmountOnHide||(null==e?void 0:e.mounted)||!!n.open))?(0,wt.jsx)(e,v({},n)):null}))}uo(_t((function(e){return Ct("div",co(e))})),Zn);const po=Math.min,fo=Math.max,ho=(Math.round,Math.floor,{left:"right",right:"left",bottom:"top",top:"bottom"}),mo={start:"end",end:"start"};function go(e,t,n){return fo(e,po(t,n))}function vo(e,t){return"function"==typeof e?e(t):e}function bo(e){return e.split("-")[0]}function xo(e){return e.split("-")[1]}function yo(e){return"x"===e?"y":"x"}function wo(e){return"y"===e?"height":"width"}function _o(e){return["top","bottom"].includes(bo(e))?"y":"x"}function So(e){return yo(_o(e))}function Co(e){return e.replace(/start|end/g,(e=>mo[e]))}function ko(e){return e.replace(/left|right|bottom|top/g,(e=>ho[e]))}function jo(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function Eo(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function Po(e,t,n){let{reference:r,floating:o}=e;const i=_o(t),s=So(t),a=wo(s),l=bo(t),c="y"===i,u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,p=r[a]/2-o[a]/2;let f;switch(l){case"top":f={x:u,y:r.y-o.height};break;case"bottom":f={x:u,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:d};break;case"left":f={x:r.x-o.width,y:d};break;default:f={x:r.x,y:r.y}}switch(xo(t)){case"start":f[s]-=p*(n&&c?-1:1);break;case"end":f[s]+=p*(n&&c?-1:1)}return f}async function To(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:p=!1,padding:f=0}=vo(t,e),h=jo(f),m=a[p?"floating"===d?"reference":"floating":d],g=Eo(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(m)))||n?m:m.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),v="floating"===d?{...s.floating,x:r,y:o}:s.reference,b=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),x=await(null==i.isElement?void 0:i.isElement(b))&&await(null==i.getScale?void 0:i.getScale(b))||{x:1,y:1},y=Eo(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:v,offsetParent:b,strategy:l}):v);return{top:(g.top-y.top+h.top)/x.y,bottom:(y.bottom-g.bottom+h.bottom)/x.y,left:(g.left-y.left+h.left)/x.x,right:(y.right-g.right+h.right)/x.x}}const Ro=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,o=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),s=bo(n),a=xo(n),l="y"===_o(n),c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,d=vo(t,e);let{mainAxis:p,crossAxis:f,alignmentAxis:h}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&"number"==typeof h&&(f="end"===a?-1*h:h),l?{x:f*u,y:p*c}:{x:p*c,y:f*u}}(t,e);return{x:n+o.x,y:r+o.y,data:o}}}},Io=Math.min,No=Math.max,Mo=Math.round,Ao=Math.floor,Do=e=>({x:e,y:e});function Oo(){return"undefined"!=typeof window}function zo(e){return Bo(e)?(e.nodeName||"").toLowerCase():"#document"}function Lo(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Fo(e){var t;return null==(t=(Bo(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function Bo(e){return!!Oo()&&(e instanceof Node||e instanceof Lo(e).Node)}function Vo(e){return!!Oo()&&(e instanceof Element||e instanceof Lo(e).Element)}function $o(e){return!!Oo()&&(e instanceof HTMLElement||e instanceof Lo(e).HTMLElement)}function Ho(e){return!(!Oo()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof Lo(e).ShadowRoot)}function Wo(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Xo(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function Uo(e){return["table","td","th"].includes(zo(e))}function Go(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function Ko(e){const t=qo(),n=Vo(e)?Xo(e):e;return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function qo(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function Yo(e){return["html","body","#document"].includes(zo(e))}function Xo(e){return Lo(e).getComputedStyle(e)}function Zo(e){return Vo(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Qo(e){if("html"===zo(e))return e;const t=e.assignedSlot||e.parentNode||Ho(e)&&e.host||Fo(e);return Ho(t)?t.host:t}function Jo(e){const t=Qo(e);return Yo(t)?e.ownerDocument?e.ownerDocument.body:e.body:$o(t)&&Wo(t)?t:Jo(t)}function ei(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=Jo(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),s=Lo(o);if(i){const e=function(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}(s);return t.concat(s,s.visualViewport||[],Wo(o)?o:[],e&&n?ei(e):[])}return t.concat(o,ei(o,[],n))}function ti(e){const t=Xo(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=$o(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=Mo(n)!==i||Mo(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function ni(e){return Vo(e)?e:e.contextElement}function ri(e){const t=ni(e);if(!$o(t))return Do(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=ti(t);let s=(i?Mo(n.width):n.width)/r,a=(i?Mo(n.height):n.height)/o;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const oi=Do(0);function ii(e){const t=Lo(e);return qo()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:oi}function si(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=ni(e);let s=Do(1);t&&(r?Vo(r)&&(s=ri(r)):s=ri(e));const a=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==Lo(e))&&t}(i,n,r)?ii(i):Do(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,d=o.height/s.y;if(i){const e=Lo(i),t=r&&Vo(r)?Lo(r):r;let n=e,o=n.frameElement;for(;o&&r&&t!==n;){const e=ri(o),t=o.getBoundingClientRect(),r=Xo(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,s=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=i,c+=s,n=Lo(o),o=n.frameElement}}return Eo({width:u,height:d,x:l,y:c})}const ai=[":popover-open",":modal"];function li(e){return ai.some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function ci(e){return si(Fo(e)).left+Zo(e).scrollLeft}function ui(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=Lo(e),r=Fo(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const e=qo();(!e||e&&"fixed"===t)&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}(e,n);else if("document"===t)r=function(e){const t=Fo(e),n=Zo(e),r=e.ownerDocument.body,o=No(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=No(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+ci(e);const a=-n.scrollTop;return"rtl"===Xo(r).direction&&(s+=No(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}(Fo(e));else if(Vo(t))r=function(e,t){const n=si(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=$o(e)?ri(e):Do(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=ii(e);r={...t,x:t.x-n.x,y:t.y-n.y}}return Eo(r)}function di(e,t){const n=Qo(e);return!(n===t||!Vo(n)||Yo(n))&&("fixed"===Xo(n).position||di(n,t))}function pi(e,t,n){const r=$o(t),o=Fo(t),i="fixed"===n,s=si(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=Do(0);if(r||!r&&!i)if(("body"!==zo(t)||Wo(o))&&(a=Zo(t)),r){const e=si(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&(l.x=ci(o));return{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function fi(e,t){return $o(e)&&"fixed"!==Xo(e).position?t?t(e):e.offsetParent:null}function hi(e,t){const n=Lo(e);if(!$o(e)||li(e))return n;let r=fi(e,t);for(;r&&Uo(r)&&"static"===Xo(r).position;)r=fi(r,t);return r&&("html"===zo(r)||"body"===zo(r)&&"static"===Xo(r).position&&!Ko(r))?n:r||function(e){let t=Qo(e);for(;$o(t)&&!Yo(t);){if(Ko(t))return t;if(Go(t))return null;t=Qo(t)}return null}(e)||n}const mi={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,s=Fo(r),a=!!t&&li(t.floating);if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=Do(1);const u=Do(0),d=$o(r);if((d||!d&&!i)&&(("body"!==zo(r)||Wo(s))&&(l=Zo(r)),$o(r))){const e=si(r);c=ri(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x,y:n.y*c.y-l.scrollTop*c.y+u.y}},getDocumentElement:Fo,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i="clippingAncestors"===n?function(e,t){const n=t.get(e);if(n)return n;let r=ei(e,[],!1).filter((e=>Vo(e)&&"body"!==zo(e))),o=null;const i="fixed"===Xo(e).position;let s=i?Qo(e):e;for(;Vo(s)&&!Yo(s);){const t=Xo(s),n=Ko(s);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||Wo(s)&&!n&&di(e,s))?r=r.filter((e=>e!==s)):o=t,s=Qo(s)}return t.set(e,r),r}(t,this._c):[].concat(n),s=[...i,r],a=s[0],l=s.reduce(((e,n)=>{const r=ui(t,n,o);return e.top=No(r.top,e.top),e.right=Io(r.right,e.right),e.bottom=Io(r.bottom,e.bottom),e.left=No(r.left,e.left),e}),ui(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:hi,getElementRects:async function(e){const t=this.getOffsetParent||hi,n=this.getDimensions;return{reference:pi(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,...await n(e.floating)}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=ti(e);return{width:t,height:n}},getScale:ri,isElement:Vo,isRTL:function(e){return"rtl"===Xo(e).direction}};function gi(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=ni(e),u=o||i?[...c?ei(c):[],...ei(t)]:[];u.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const d=c&&a?function(e,t){let n,r=null;const o=Fo(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function s(a,l){void 0===a&&(a=!1),void 0===l&&(l=1),i();const{left:c,top:u,width:d,height:p}=e.getBoundingClientRect();if(a||t(),!d||!p)return;const f={rootMargin:-Ao(u)+"px "+-Ao(o.clientWidth-(c+d))+"px "+-Ao(o.clientHeight-(u+p))+"px "+-Ao(c)+"px",threshold:No(0,Io(1,l))||1};let h=!0;function m(e){const t=e[0].intersectionRatio;if(t!==l){if(!h)return s();t?s(!1,t):n=setTimeout((()=>{s(!1,1e-7)}),100)}h=!1}try{r=new IntersectionObserver(m,{...f,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(m,f)}r.observe(e)}(!0),i}(c,n):null;let p,f=-1,h=null;s&&(h=new ResizeObserver((e=>{let[r]=e;r&&r.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame((()=>{var e;null==(e=h)||e.observe(t)}))),n()})),c&&!l&&h.observe(c),h.observe(t));let m=l?si(e):null;return l&&function t(){const r=si(e);!m||r.x===m.x&&r.y===m.y&&r.width===m.width&&r.height===m.height||n();m=r,p=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach((e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==d||d(),null==(e=h)||e.disconnect(),h=null,l&&cancelAnimationFrame(p)}}const vi=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=vo(e,t),c={x:n,y:r},u=await To(t,l),d=_o(bo(o)),p=yo(d);let f=c[p],h=c[d];if(i){const e="y"===p?"bottom":"right";f=go(f+u["y"===p?"top":"left"],f,f-u[e])}if(s){const e="y"===d?"bottom":"right";h=go(h+u["y"===d?"top":"left"],h,h-u[e])}const m=a.fn({...t,[p]:f,[d]:h});return{...m,data:{x:m.x-n,y:m.y-r}}}}},bi=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:m=!0,...g}=vo(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const v=bo(o),b=bo(a)===a,x=await(null==l.isRTL?void 0:l.isRTL(c.floating)),y=p||(b||!m?[ko(a)]:function(e){const t=ko(e);return[Co(e),t,Co(t)]}(a));p||"none"===h||y.push(...function(e,t,n,r){const o=xo(e);let i=function(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:s;default:return[]}}(bo(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(Co)))),i}(a,m,h,x));const w=[a,...y],_=await To(t,g),S=[];let C=(null==(r=i.flip)?void 0:r.overflows)||[];if(u&&S.push(_[v]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=xo(e),o=So(e),i=wo(o);let s="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=ko(s)),[s,ko(s)]}(o,s,x);S.push(_[e[0]],_[e[1]])}if(C=[...C,{placement:o,overflows:S}],!S.every((e=>e<=0))){var k,j;const e=((null==(k=i.flip)?void 0:k.index)||0)+1,t=w[e];if(t)return{data:{index:e,overflows:C},reset:{placement:t}};let n=null==(j=C.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:j.placement;if(!n)switch(f){case"bestFit":{var E;const e=null==(E=C.map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:E[0];e&&(n=e);break}case"initialPlacement":n=a}if(o!==n)return{reset:{placement:n}}}return{}}}},xi=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:i}=t,{apply:s=()=>{},...a}=vo(e,t),l=await To(t,a),c=bo(n),u=xo(n),d="y"===_o(n),{width:p,height:f}=r.floating;let h,m;"top"===c||"bottom"===c?(h=c,m=u===(await(null==o.isRTL?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(m=c,h="end"===u?"top":"bottom");const g=f-l[h],v=p-l[m],b=!t.middlewareData.shift;let x=g,y=v;if(d){const e=p-l.left-l.right;y=u||b?po(v,e):e}else{const e=f-l.top-l.bottom;x=u||b?po(g,e):e}if(b&&!u){const e=fo(l.left,0),t=fo(l.right,0),n=fo(l.top,0),r=fo(l.bottom,0);d?y=p-2*(0!==e||0!==t?e+t:fo(l.left,l.right)):x=f-2*(0!==n||0!==r?n+r:fo(l.top,l.bottom))}await s({...t,availableWidth:y,availableHeight:x});const w=await o.getDimensions(i.floating);return p!==w.width||f!==w.height?{reset:{rects:!0}}:{}}}},yi=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=vo(e,t)||{};if(null==c)return{};const d=jo(u),p={x:n,y:r},f=So(o),h=wo(f),m=await s.getDimensions(c),g="y"===f,v=g?"top":"left",b=g?"bottom":"right",x=g?"clientHeight":"clientWidth",y=i.reference[h]+i.reference[f]-p[f]-i.floating[h],w=p[f]-i.reference[f],_=await(null==s.getOffsetParent?void 0:s.getOffsetParent(c));let S=_?_[x]:0;S&&await(null==s.isElement?void 0:s.isElement(_))||(S=a.floating[x]||i.floating[h]);const C=y/2-w/2,k=S/2-m[h]/2-1,j=po(d[v],k),E=po(d[b],k),P=j,T=S-m[h]-E,R=S/2-m[h]/2+C,I=go(P,R,T),N=!l.arrow&&null!=xo(o)&&R!=I&&i.reference[h]/2-(Rn&&(f=n)}if(c){var v,b;const e="y"===p?"width":"height",t=["top","left"].includes(bo(o)),n=i.reference[d]-i.floating[e]+(t&&(null==(v=s.offset)?void 0:v[d])||0)+(t?0:g.crossAxis),r=i.reference[d]+i.reference[e]+(t?0:(null==(b=s.offset)?void 0:b[d])||0)-(t?g.crossAxis:0);hr&&(h=r)}return{[p]:f,[d]:h}}}},_i=(e,t,n)=>{const r=new Map,o={platform:mi,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(null==s.isRTL?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=Po(c,r,l),p=r,f={},h=0;for(let n=0;no})}function Ci(e,t){return{contextElement:e||void 0,getBoundingClientRect:()=>{const n=e,r=null==t?void 0:t(n);return r||!n?function(e){if(!e)return Si();const{x:t,y:n,width:r,height:o}=e;return Si(t,n,r,o)}(r):n.getBoundingClientRect()}}}function ki(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}function ji(e){const t=window.devicePixelRatio||1;return Math.round(e*t)/t}function Ei(e,t){return Ro((({placement:n})=>{var r;const o=((null==e?void 0:e.clientHeight)||0)/2,i="number"==typeof t.gutter?t.gutter+o:null!=(r=t.gutter)?r:o;return{crossAxis:!!n.split("-")[1]?void 0:t.shift,mainAxis:i,alignmentAxis:t.shift}}))}function Pi(e){if(!1===e.flip)return;const t="string"==typeof e.flip?e.flip.split(" "):void 0;return D(!t||t.every(ki),!1),bi({padding:e.overflowPadding,fallbackPlacements:t})}function Ti(e){if(e.slide||e.overlap)return vi({mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding,limiter:wi()})}function Ri(e){return xi({padding:e.overflowPadding,apply({elements:t,availableWidth:n,availableHeight:r,rects:o}){const i=t.floating,s=Math.round(o.reference.width);n=Math.floor(n),r=Math.floor(r),i.style.setProperty("--popover-anchor-width",`${s}px`),i.style.setProperty("--popover-available-width",`${n}px`),i.style.setProperty("--popover-available-height",`${r}px`),e.sameWidth&&(i.style.width=`${s}px`),e.fitViewport&&(i.style.maxWidth=`${n}px`,i.style.maxHeight=`${r}px`)}})}function Ii(e,t){if(e)return yi({element:e,padding:t.arrowPadding})}var Ni=kt((function(e){var t=e,{store:n,modal:r=!1,portal:o=!!r,preserveTabOrder:i=!0,autoFocusOnShow:s=!0,wrapperProps:a,fixed:l=!1,flip:c=!0,shift:u=0,slide:d=!0,overlap:p=!1,sameWidth:f=!1,fitViewport:h=!1,gutter:m,arrowPadding:g=4,overflowPadding:y=8,getAnchorRect:w,updatePosition:_}=t,S=x(t,["store","modal","portal","preserveTabOrder","autoFocusOnShow","wrapperProps","fixed","flip","shift","slide","overlap","sameWidth","fitViewport","gutter","arrowPadding","overflowPadding","getAnchorRect","updatePosition"]);const C=or();D(n=n||C,!1);const k=n.useState("arrowElement"),j=n.useState("anchorElement"),E=n.useState("disclosureElement"),P=n.useState("popoverElement"),T=n.useState("contentElement"),R=n.useState("placement"),I=n.useState("mounted"),N=n.useState("rendered"),M=(0,B.useRef)(null),[A,O]=(0,B.useState)(!1),{portalRef:z,domReady:L}=Ne(o,S.portalRef),F=Se(w),V=Se(_),$=!!_;ye((()=>{if(!(null==P?void 0:P.isConnected))return;P.style.setProperty("--popover-overflow-padding",`${y}px`);const e=Ci(j,F),t=async()=>{if(!I)return;k||(M.current=M.current||document.createElement("div"));const t=k||M.current,r=[Ei(t,{gutter:m,shift:u}),Pi({flip:c,overflowPadding:y}),Ti({slide:d,shift:u,overlap:p,overflowPadding:y}),Ii(t,{arrowPadding:g}),Ri({sameWidth:f,fitViewport:h,overflowPadding:y})],o=await _i(e,P,{placement:R,strategy:l?"fixed":"absolute",middleware:r});null==n||n.setState("currentPlacement",o.placement),O(!0);const i=ji(o.x),s=ji(o.y);if(Object.assign(P.style,{top:"0",left:"0",transform:`translate3d(${i}px,${s}px,0)`}),t&&o.middlewareData.arrow){const{x:e,y:n}=o.middlewareData.arrow,r=o.placement.split("-")[0],i=t.clientWidth/2,s=t.clientHeight/2,a=null!=e?e+i:-i,l=null!=n?n+s:-s;P.style.setProperty("--popover-transform-origin",{top:`${a}px calc(100% + ${s}px)`,bottom:`${a}px ${-s}px`,left:`calc(100% + ${i}px) ${l}px`,right:`${-i}px ${l}px`}[r]),Object.assign(t.style,{left:null!=e?`${e}px`:"",top:null!=n?`${n}px`:"",[r]:"100%"})}},r=gi(e,P,(async()=>{$?(await V({updatePosition:t}),O(!0)):await t()}),{elementResize:"function"==typeof ResizeObserver});return()=>{O(!1),r()}}),[n,N,P,k,j,P,R,I,L,l,c,u,d,p,f,h,m,g,y,F,$,V]),ye((()=>{if(!I)return;if(!L)return;if(!(null==P?void 0:P.isConnected))return;if(!(null==T?void 0:T.isConnected))return;const e=()=>{P.style.zIndex=getComputedStyle(T).zIndex};e();let t=requestAnimationFrame((()=>{t=requestAnimationFrame(e)}));return()=>cancelAnimationFrame(t)}),[I,L,P,T]);const H=l?"fixed":"absolute";return S=Ie(S,(e=>(0,wt.jsx)("div",b(v({},a),{style:v({position:H,top:0,left:0,width:"max-content"},null==a?void 0:a.style),ref:null==n?void 0:n.setPopoverElement,children:e}))),[n,H,a]),S=Ie(S,(e=>(0,wt.jsx)(sr,{value:n,children:e})),[n]),S=b(v({"data-placing":!A||void 0},S),{style:v({position:"relative"},S.style)}),S=co(b(v({store:n,modal:r,portal:o,preserveTabOrder:i,preserveTabOrderAnchor:E||j,autoFocusOnShow:A&&s},S),{portalRef:z}))}));uo(_t((function(e){return Ct("div",Ni(e))})),or);function Mi(e,t,n,r){return!!Gt(t)||!!e&&(!!Y(t,e)||(!(!n||!Y(n,e))||!!(null==r?void 0:r.some((t=>Mi(e,t,n))))))}var Ai=(0,B.createContext)(null),Di=kt((function(e){var t=e,{store:n,modal:r=!1,portal:o=!!r,hideOnEscape:i=!0,hideOnHoverOutside:s=!0,disablePointerEventsOnApproach:a=!!s}=t,l=x(t,["store","modal","portal","hideOnEscape","hideOnHoverOutside","disablePointerEventsOnApproach"]);const c=lr();D(n=n||c,!1);const u=(0,B.useRef)(null),[d,p]=(0,B.useState)([]),f=(0,B.useRef)(0),h=(0,B.useRef)(null),{portalRef:m,domReady:g}=Ne(o,l.portalRef),y=Ae(),w=!!s,_=Re(s),S=!!a,C=Re(a),k=n.useState("open"),j=n.useState("mounted");(0,B.useEffect)((()=>{if(!g)return;if(!j)return;if(!w&&!S)return;const e=u.current;if(!e)return;return M(ge("mousemove",(t=>{if(!n)return;if(!y())return;const{anchorElement:r,hideTimeout:o,timeout:i}=n.getState(),s=h.current,[a]=t.composedPath(),l=r;if(Mi(a,e,l,d))return h.current=a&&l&&Y(l,a)?xr(t):null,window.clearTimeout(f.current),void(f.current=0);if(!f.current){if(s){const n=xr(t);if(yr(n,wr(e,s))){if(h.current=n,!C(t))return;return t.preventDefault(),void t.stopPropagation()}}_(t)&&(f.current=window.setTimeout((()=>{f.current=0,null==n||n.hide()}),null!=o?o:i))}}),!0),(()=>clearTimeout(f.current)))}),[n,y,g,j,w,S,d,C,_]),(0,B.useEffect)((()=>{if(!g)return;if(!j)return;if(!S)return;const e=e=>{const t=u.current;if(!t)return;const n=h.current;if(!n)return;const r=wr(t,n);if(yr(xr(e),r)){if(!C(e))return;e.preventDefault(),e.stopPropagation()}};return M(ge("mouseenter",e,!0),ge("mouseover",e,!0),ge("mouseout",e,!0),ge("mouseleave",e,!0))}),[g,j,S,C]),(0,B.useEffect)((()=>{g&&(k||null==n||n.setAutoFocusOnShow(!1))}),[n,g,k]);const E=_e(k);(0,B.useEffect)((()=>{if(g)return()=>{E.current||null==n||n.setAutoFocusOnShow(!1)}}),[n,g]);const P=(0,B.useContext)(Ai);ye((()=>{if(r)return;if(!o)return;if(!j)return;if(!g)return;const e=u.current;return e?null==P?void 0:P(e):void 0}),[r,o,j,g]);const T=(0,B.useCallback)((e=>{p((t=>[...t,e]));const t=null==P?void 0:P(e);return()=>{p((t=>t.filter((t=>t!==e)))),null==t||t()}}),[P]);l=Ie(l,(e=>(0,wt.jsx)(ur,{value:n,children:(0,wt.jsx)(Ai.Provider,{value:T,children:e})})),[n,T]),l=b(v({},l),{ref:ke(u,l.ref)}),l=function(e){var t=e,{store:n}=t,r=x(t,["store"]);const[o,i]=(0,B.useState)(!1),s=n.useState("mounted");(0,B.useEffect)((()=>{s||i(!1)}),[s]);const a=r.onFocus,l=Se((e=>{null==a||a(e),e.defaultPrevented||i(!0)})),c=(0,B.useRef)(null);return(0,B.useEffect)((()=>Ue(n,["anchorElement"],(e=>{c.current=e.anchorElement}))),[]),b(v({autoFocusOnHide:o,finalFocus:c},r),{onFocus:l})}(v({store:n},l));const R=n.useState((e=>r||e.autoFocusOnShow));return l=Ni(b(v({store:n,modal:r,portal:o,autoFocusOnShow:R},l),{portalRef:m,hideOnEscape:e=>!O(i,e)&&(requestAnimationFrame((()=>{requestAnimationFrame((()=>{null==n||n.hide()}))})),!0)}))})),Oi=(uo(_t((function(e){return Ct("div",Di(e))})),lr),kt((function(e){var t=e,{store:n,portal:r=!0,gutter:o=8,preserveTabOrder:i=!1,hideOnHoverOutside:s=!0,hideOnInteractOutside:a=!0}=t,l=x(t,["store","portal","gutter","preserveTabOrder","hideOnHoverOutside","hideOnInteractOutside"]);const c=fr();D(n=n||c,!1),l=Ie(l,(e=>(0,wt.jsx)(hr,{value:n,children:e})),[n]);const u=n.useState((e=>"description"===e.type?"tooltip":"none"));return l=v({role:u},l),l=Di(b(v({},l),{store:n,portal:r,gutter:o,preserveTabOrder:i,hideOnHoverOutside(e){if(O(s,e))return!1;const t=null==n?void 0:n.getState().anchorElement;return!t||!("focusVisible"in t.dataset)},hideOnInteractOutside:e=>{if(O(a,e))return!1;const t=null==n?void 0:n.getState().anchorElement;return!t||!Y(t,e.target)}}))}))),zi=uo(_t((function(e){return Ct("div",Oi(e))})),fr);const Li=window.wp.deprecated;var Fi=o.n(Li);const Bi=function(e){const{shortcut:t,className:n}=e;if(!t)return null;let r,o;return"string"==typeof t&&(r=t),null!==t&&"object"==typeof t&&(r=t.display,o=t.ariaLabel),(0,wt.jsx)("span",{className:n,"aria-label":o,children:r})},Vi={bottom:"bottom",top:"top","middle left":"left","middle right":"right","bottom left":"bottom-end","bottom center":"bottom","bottom right":"bottom-start","top left":"top-end","top center":"top","top right":"top-start","middle left left":"left","middle left right":"left","middle left bottom":"left-end","middle left top":"left-start","middle right left":"right","middle right right":"right","middle right bottom":"right-end","middle right top":"right-start","bottom left left":"bottom-end","bottom left right":"bottom-end","bottom left bottom":"bottom-end","bottom left top":"bottom-end","bottom center left":"bottom","bottom center right":"bottom","bottom center bottom":"bottom","bottom center top":"bottom","bottom right left":"bottom-start","bottom right right":"bottom-start","bottom right bottom":"bottom-start","bottom right top":"bottom-start","top left left":"top-end","top left right":"top-end","top left bottom":"top-end","top left top":"top-end","top center left":"top","top center right":"top","top center bottom":"top","top center top":"top","top right left":"top-start","top right right":"top-start","top right bottom":"top-start","top right top":"top-start",middle:"bottom","middle center":"bottom","middle center bottom":"bottom","middle center left":"bottom","middle center right":"bottom","middle center top":"bottom"},$i=e=>{var t;return null!==(t=Vi[e])&&void 0!==t?t:"bottom"},Hi={top:{originX:.5,originY:1},"top-start":{originX:0,originY:1},"top-end":{originX:1,originY:1},right:{originX:0,originY:.5},"right-start":{originX:0,originY:0},"right-end":{originX:0,originY:1},bottom:{originX:.5,originY:0},"bottom-start":{originX:0,originY:0},"bottom-end":{originX:1,originY:0},left:{originX:1,originY:.5},"left-start":{originX:1,originY:0},"left-end":{originX:1,originY:1},overlay:{originX:.5,originY:.5}};const Wi=e=>null===e||Number.isNaN(e)?void 0:Math.round(e),Ui=(0,c.createContext)({isNestedInTooltip:!1}),Gi=700,Ki={isNestedInTooltip:!0};const qi=(0,c.forwardRef)((function(e,t){const{children:n,className:r,delay:o=Gi,hideOnClick:i=!0,placement:a,position:u,shortcut:d,text:p,...f}=e,{isNestedInTooltip:h}=(0,c.useContext)(Ui),m=(0,l.useInstanceId)(qi,"tooltip"),g=p||d?m:void 0,v=1===c.Children.count(n);let b;void 0!==a?b=a:void 0!==u&&(b=$i(u),Fi()("`position` prop in wp.components.tooltip",{since:"6.4",alternative:"`placement` prop"})),b=b||"bottom";const x=Gn({placement:b,showTimeout:o}),y=Qe(x,"mounted");return h?v?(0,wt.jsx)(Kn,{...f,render:n}):n:(0,wt.jsxs)(Ui.Provider,{value:Ki,children:[(0,wt.jsx)(br,{onClick:i?x.hide:void 0,store:x,render:v?(w=n,g&&y&&void 0===w.props["aria-describedby"]&&w.props["aria-label"]!==p?(0,c.cloneElement)(w,{"aria-describedby":g}):w):void 0,ref:t,children:v?void 0:n}),v&&(p||d)&&(0,wt.jsxs)(zi,{...f,className:s("components-tooltip",r),unmountOnHide:!0,gutter:4,id:g,overflowPadding:.5,store:x,children:[p,d&&(0,wt.jsx)(Bi,{className:p?"components-tooltip__shortcut":"",shortcut:d})]})]});var w})),Yi=qi;window.wp.warning;var Xi=o(66),Zi=o.n(Xi),Qi=o(7734),Ji=o.n(Qi); + */var r=n(1609);var o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},i=r.useState,s=r.useEffect,a=r.useLayoutEffect,l=r.useDebugValue;function c(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!o(e,n)}catch(e){return!0}}var u="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),o=r[0].inst,u=r[1];return a((function(){o.value=n,o.getSnapshot=t,c(o)&&u({inst:o})}),[e,n,t]),s((function(){return c(o)&&u({inst:o}),e((function(){c(o)&&u({inst:o})}))}),[e]),l(n),n};t.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:u},422:(e,t,n)=>{"use strict";e.exports=n(83)},1609:e=>{"use strict";e.exports=window.React}},r={};function o(e){var t=r[e];if(void 0!==t)return t.exports;var i=r[e]={exports:{}};return n[e](i,i.exports,o),i.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,o.t=function(n,r){if(1&r&&(n=this(n)),8&r)return n;if("object"==typeof n&&n){if(4&r&&n.__esModule)return n;if(16&r&&"function"==typeof n.then)return n}var i=Object.create(null);o.r(i);var s={};e=e||[null,t({}),t([]),t(t)];for(var a=2&r&&n;"object"==typeof a&&!~e.indexOf(a);a=t(a))Object.getOwnPropertyNames(a).forEach((e=>s[e]=()=>n[e]));return s.default=()=>n,o.d(i,s),i},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.nc=void 0;var i={};(()=>{"use strict";o.r(i),o.d(i,{AlignmentMatrixControl:()=>Yl,AnglePickerControl:()=>_y,Animate:()=>Ql,Autocomplete:()=>Aw,BaseControl:()=>Wx,BlockQuotation:()=>n.BlockQuotation,BorderBoxControl:()=>Cj,BorderControl:()=>ij,BoxControl:()=>aE,Button:()=>Jx,ButtonGroup:()=>lE,Card:()=>HE,CardBody:()=>JE,CardDivider:()=>dP,CardFooter:()=>fP,CardHeader:()=>mP,CardMedia:()=>vP,CheckboxControl:()=>bP,Circle:()=>n.Circle,ClipboardButton:()=>yP,ColorIndicator:()=>F_,ColorPalette:()=>kk,ColorPicker:()=>nk,ComboboxControl:()=>tT,Composite:()=>Gn,CustomGradientPicker:()=>uN,CustomSelectControl:()=>PI,Dashicon:()=>Yx,DatePicker:()=>bM,DateTimePicker:()=>BM,Disabled:()=>YM,Draggable:()=>QM,DropZone:()=>eA,DropZoneProvider:()=>tA,Dropdown:()=>W_,DropdownMenu:()=>PN,DuotonePicker:()=>cA,DuotoneSwatch:()=>oA,ExternalLink:()=>uA,Fill:()=>vw,Flex:()=>kg,FlexBlock:()=>Eg,FlexItem:()=>Fg,FocalPointPicker:()=>AA,FocusReturnProvider:()=>LB,FocusableIframe:()=>DA,FontSizePicker:()=>XA,FormFileUpload:()=>ZA,FormToggle:()=>eD,FormTokenField:()=>sD,G:()=>n.G,GradientPicker:()=>mN,Guide:()=>cD,GuidePage:()=>uD,HorizontalRule:()=>n.HorizontalRule,Icon:()=>Xx,IconButton:()=>dD,IsolatedEventContainer:()=>_B,KeyboardShortcuts:()=>fD,Line:()=>n.Line,MenuGroup:()=>hD,MenuItem:()=>gD,MenuItemsChoice:()=>bD,Modal:()=>bT,NavigableMenu:()=>CN,Navigator:()=>nO,Notice:()=>sO,NoticeList:()=>lO,Panel:()=>uO,PanelBody:()=>mO,PanelHeader:()=>cO,PanelRow:()=>gO,Path:()=>n.Path,Placeholder:()=>bO,Polygon:()=>n.Polygon,Popover:()=>jw,ProgressBar:()=>CO,QueryControls:()=>AO,RadioControl:()=>HO,RangeControl:()=>ZS,Rect:()=>n.Rect,ResizableBox:()=>NL,ResponsiveWrapper:()=>TL,SVG:()=>n.SVG,SandBox:()=>RL,ScrollLock:()=>Hy,SearchControl:()=>cz,SelectControl:()=>cS,Slot:()=>bw,SlotFillProvider:()=>xw,Snackbar:()=>AL,SnackbarList:()=>zL,Spinner:()=>$L,TabPanel:()=>oF,TabbableContainer:()=>xD,TextControl:()=>sF,TextHighlight:()=>fF,TextareaControl:()=>pF,TimePicker:()=>zM,Tip:()=>mF,ToggleControl:()=>vF,Toolbar:()=>zF,ToolbarButton:()=>EF,ToolbarDropdownMenu:()=>OF,ToolbarGroup:()=>TF,ToolbarItem:()=>kF,Tooltip:()=>ss,TreeSelect:()=>NO,VisuallyHidden:()=>Sl,__experimentalAlignmentMatrixControl:()=>Yl,__experimentalApplyValueToSides:()=>Aj,__experimentalBorderBoxControl:()=>Cj,__experimentalBorderControl:()=>ij,__experimentalBoxControl:()=>aE,__experimentalConfirmDialog:()=>yT,__experimentalDimensionControl:()=>HM,__experimentalDivider:()=>cP,__experimentalDropdownContentWrapper:()=>bk,__experimentalElevation:()=>pE,__experimentalGrid:()=>lj,__experimentalHStack:()=>fy,__experimentalHasSplitBorders:()=>vj,__experimentalHeading:()=>hk,__experimentalInputControl:()=>qx,__experimentalInputControlPrefixWrapper:()=>lC,__experimentalInputControlSuffixWrapper:()=>U_,__experimentalIsDefinedBorder:()=>gj,__experimentalIsEmptyBorder:()=>mj,__experimentalItem:()=>OP,__experimentalItemGroup:()=>LP,__experimentalNavigation:()=>FD,__experimentalNavigationBackButton:()=>HD,__experimentalNavigationGroup:()=>GD,__experimentalNavigationItem:()=>tz,__experimentalNavigationMenu:()=>fz,__experimentalNavigatorBackButton:()=>eO,__experimentalNavigatorButton:()=>Jz,__experimentalNavigatorProvider:()=>Zz,__experimentalNavigatorScreen:()=>Qz,__experimentalNavigatorToParentButton:()=>tO,__experimentalNumberControl:()=>gy,__experimentalPaletteEdit:()=>HN,__experimentalParseQuantityAndUnitFromRawValue:()=>Kk,__experimentalRadio:()=>OO,__experimentalRadioGroup:()=>FO,__experimentalScrollable:()=>ZE,__experimentalSpacer:()=>zg,__experimentalStyleProvider:()=>lw,__experimentalSurface:()=>HL,__experimentalText:()=>$v,__experimentalToggleGroupControl:()=>x_,__experimentalToggleGroupControlOption:()=>RM,__experimentalToggleGroupControlOptionIcon:()=>z_,__experimentalToolbarContext:()=>CF,__experimentalToolsPanel:()=>sB,__experimentalToolsPanelContext:()=>qF,__experimentalToolsPanelItem:()=>cB,__experimentalTreeGrid:()=>mB,__experimentalTreeGridCell:()=>yB,__experimentalTreeGridItem:()=>xB,__experimentalTreeGridRow:()=>gB,__experimentalTruncate:()=>pk,__experimentalUnitControl:()=>ej,__experimentalUseCustomUnits:()=>qk,__experimentalUseNavigator:()=>Kz,__experimentalUseSlot:()=>Gy,__experimentalUseSlotFills:()=>SB,__experimentalVStack:()=>dk,__experimentalView:()=>_l,__experimentalZStack:()=>PB,__unstableAnimatePresence:()=>hg,__unstableComposite:()=>sT,__unstableCompositeGroup:()=>aT,__unstableCompositeItem:()=>lT,__unstableDisclosureContent:()=>XM,__unstableGetAnimateClassName:()=>Zl,__unstableMotion:()=>ag,__unstableUseAutocompleteProps:()=>Mw,__unstableUseCompositeState:()=>cT,__unstableUseNavigateRegions:()=>TB,createSlotFill:()=>yw,navigateRegions:()=>IB,privateApis:()=>Y$,useBaseControlProps:()=>Dw,useNavigator:()=>Kz,withConstrainedTabbing:()=>RB,withFallbackStyles:()=>MB,withFilters:()=>zB,withFocusOutside:()=>ZN,withFocusReturn:()=>OB,withNotices:()=>FB,withSpokenMessages:()=>rz});var e={};o.r(e),o.d(e,{Text:()=>Ev,block:()=>Pv,destructive:()=>Tv,highlighterText:()=>Rv,muted:()=>Iv,positive:()=>Nv,upperCase:()=>Mv});var t={};o.r(t),o.d(t,{Rp:()=>P_,y0:()=>S_,uG:()=>k_,eh:()=>C_});const n=window.wp.primitives;function r(e){var t,n,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e)){var i=e.length;for(t=0;tt in e?u(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,v=(e,t)=>{for(var n in t||(t={}))h.call(t,n)&&g(e,n,t[n]);if(f)for(var n of f(t))m.call(t,n)&&g(e,n,t[n]);return e},b=(e,t)=>d(e,p(t)),x=(e,t)=>{var n={};for(var r in e)h.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&f)for(var r of f(e))t.indexOf(r)<0&&m.call(e,r)&&(n[r]=e[r]);return n},y=Object.defineProperty,w=Object.defineProperties,_=Object.getOwnPropertyDescriptors,S=Object.getOwnPropertySymbols,C=Object.prototype.hasOwnProperty,k=Object.prototype.propertyIsEnumerable,j=(e,t,n)=>t in e?y(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,E=(e,t)=>{for(var n in t||(t={}))C.call(t,n)&&j(e,n,t[n]);if(S)for(var n of S(t))k.call(t,n)&&j(e,n,t[n]);return e},P=(e,t)=>w(e,_(t)),N=(e,t)=>{var n={};for(var r in e)C.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&S)for(var r of S(e))t.indexOf(r)<0&&k.call(e,r)&&(n[r]=e[r]);return n};function T(...e){}function I(e,t){if(function(e){return"function"==typeof e}(e)){return e(function(e){return"function"==typeof e}(t)?t():t)}return e}function R(e,t){return"function"==typeof Object.hasOwn?Object.hasOwn(e,t):Object.prototype.hasOwnProperty.call(e,t)}function M(...e){return(...t)=>{for(const n of e)"function"==typeof n&&n(...t)}}function A(e){return e}function D(e,t){if(!e){if("string"!=typeof t)throw new Error("Invariant failed");throw new Error(t)}}function z(e,...t){const n="function"==typeof e?e(...t):e;return null!=n&&!n}function O(e){return e.disabled||!0===e["aria-disabled"]||"true"===e["aria-disabled"]}function L(e){const t={};for(const n in e)void 0!==e[n]&&(t[n]=e[n]);return t}function F(...e){for(const t of e)if(void 0!==t)return t}var B=o(1609),V=o.t(B,2),$=o.n(B);function H(e,t){"function"==typeof e?e(t):e&&(e.current=t)}function W(e){if(!function(e){return!!e&&!!(0,B.isValidElement)(e)&&("ref"in e.props||"ref"in e)}(e))return null;return v({},e.props).ref||e.ref}var U,G="undefined"!=typeof window&&!!(null==(U=window.document)?void 0:U.createElement);function K(e){return e?"self"in e?e.document:e.ownerDocument||document:document}function q(e){return e?"self"in e?e.self:K(e).defaultView||window:self}function Y(e,t=!1){const{activeElement:n}=K(e);if(!(null==n?void 0:n.nodeName))return null;if(Z(n)&&n.contentDocument)return Y(n.contentDocument.body,t);if(t){const e=n.getAttribute("aria-activedescendant");if(e){const t=K(n).getElementById(e);if(t)return t}}return n}function X(e,t){return e===t||e.contains(t)}function Z(e){return"IFRAME"===e.tagName}function Q(e){const t=e.tagName.toLowerCase();return"button"===t||!("input"!==t||!e.type)&&-1!==J.indexOf(e.type)}var J=["button","color","file","image","reset","submit"];function ee(e){if("function"==typeof e.checkVisibility)return e.checkVisibility();const t=e;return t.offsetWidth>0||t.offsetHeight>0||e.getClientRects().length>0}function te(e){try{const t=e instanceof HTMLInputElement&&null!==e.selectionStart,n="TEXTAREA"===e.tagName;return t||n||!1}catch(e){return!1}}function ne(e){return e.isContentEditable||te(e)}function re(e,t){const n=null==e?void 0:e.getAttribute("role");return n&&-1!==["dialog","menu","listbox","tree","grid"].indexOf(n)?n:t}function oe(e,t){var n;const r=re(e);if(!r)return t;return null!=(n={menu:"menuitem",listbox:"option",tree:"treeitem"}[r])?n:t}function ie(e){if(!e)return null;const t=e=>"auto"===e||"scroll"===e;if(e.clientHeight&&e.scrollHeight>e.clientHeight){const{overflowY:n}=getComputedStyle(e);if(t(n))return e}else if(e.clientWidth&&e.scrollWidth>e.clientWidth){const{overflowX:n}=getComputedStyle(e);if(t(n))return e}return ie(e.parentElement)||document.scrollingElement||document.body}function se(e,t){const n=e.map(((e,t)=>[t,e]));let r=!1;return n.sort((([e,n],[o,i])=>{const s=t(n),a=t(i);return s===a?0:s&&a?function(e,t){return Boolean(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}(s,a)?(e>o&&(r=!0),-1):(et)):e}function ae(){return!!G&&/mac|iphone|ipad|ipod/i.test(navigator.platform)}function le(){return G&&ae()&&/apple/i.test(navigator.vendor)}function ce(){return G&&navigator.platform.startsWith("Mac")&&!(G&&navigator.maxTouchPoints)}function ue(e){return Boolean(e.currentTarget&&!X(e.currentTarget,e.target))}function de(e){return e.target===e.currentTarget}function pe(e){const t=e.currentTarget;if(!t)return!1;const n=ae();if(n&&!e.metaKey)return!1;if(!n&&!e.ctrlKey)return!1;const r=t.tagName.toLowerCase();return"a"===r||("button"===r&&"submit"===t.type||"input"===r&&"submit"===t.type)}function fe(e){const t=e.currentTarget;if(!t)return!1;const n=t.tagName.toLowerCase();return!!e.altKey&&("a"===n||("button"===n&&"submit"===t.type||"input"===n&&"submit"===t.type))}function he(e,t){const n=new FocusEvent("blur",t),r=e.dispatchEvent(n),o=P(E({},t),{bubbles:!0});return e.dispatchEvent(new FocusEvent("focusout",o)),r}function me(e,t){const n=new MouseEvent("click",t);return e.dispatchEvent(n)}function ge(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!X(n,r)}function ve(e,t,n,r){const o=(e=>{if(r){const t=setTimeout(e,r);return()=>clearTimeout(t)}const t=requestAnimationFrame(e);return()=>cancelAnimationFrame(t)})((()=>{e.removeEventListener(t,i,!0),n()})),i=()=>{o(),n()};return e.addEventListener(t,i,{once:!0,capture:!0}),o}function be(e,t,n,r=window){const o=[];try{r.document.addEventListener(e,t,n);for(const i of Array.from(r.frames))o.push(be(e,t,n,i))}catch(e){}return()=>{try{r.document.removeEventListener(e,t,n)}catch(e){}for(const e of o)e()}}var xe=v({},V),ye=xe.useId,we=(xe.useDeferredValue,xe.useInsertionEffect),_e=G?B.useLayoutEffect:B.useEffect;function Se(e){const[t]=(0,B.useState)(e);return t}function Ce(e){const t=(0,B.useRef)(e);return _e((()=>{t.current=e})),t}function ke(e){const t=(0,B.useRef)((()=>{throw new Error("Cannot call an event handler while rendering.")}));return we?we((()=>{t.current=e})):t.current=e,(0,B.useCallback)(((...e)=>{var n;return null==(n=t.current)?void 0:n.call(t,...e)}),[])}function je(e){const[t,n]=(0,B.useState)(null);return _e((()=>{if(null==t)return;if(!e)return;let n=null;return e((e=>(n=e,t))),()=>{e(n)}}),[t,e]),[t,n]}function Ee(...e){return(0,B.useMemo)((()=>{if(e.some(Boolean))return t=>{for(const n of e)H(n,t)}}),e)}function Pe(e){if(ye){const t=ye();return e||t}const[t,n]=(0,B.useState)(e);return _e((()=>{if(e||t)return;const r=Math.random().toString(36).slice(2,8);n(`id-${r}`)}),[e,t]),e||t}function Ne(e,t){const n=e=>{if("string"==typeof e)return e},[r,o]=(0,B.useState)((()=>n(t)));return _e((()=>{const r=e&&"current"in e?e.current:e;o((null==r?void 0:r.tagName.toLowerCase())||n(t))}),[e,t]),r}function Te(e,t){const n=(0,B.useRef)(!1);(0,B.useEffect)((()=>{if(n.current)return e();n.current=!0}),t),(0,B.useEffect)((()=>()=>{n.current=!1}),[])}function Ie(){return(0,B.useReducer)((()=>[]),[])}function Re(e){return ke("function"==typeof e?e:()=>e)}function Me(e,t,n=[]){const r=(0,B.useCallback)((n=>(e.wrapElement&&(n=e.wrapElement(n)),t(n))),[...n,e.wrapElement]);return b(v({},e),{wrapElement:r})}function Ae(e=!1,t){const[n,r]=(0,B.useState)(null);return{portalRef:Ee(r,t),portalNode:n,domReady:!e||n}}function De(e,t,n){const r=e.onLoadedMetadataCapture,o=(0,B.useMemo)((()=>Object.assign((()=>{}),b(v({},r),{[t]:n}))),[r,t,n]);return[null==r?void 0:r[t],{onLoadedMetadataCapture:o}]}function ze(){(0,B.useEffect)((()=>{be("mousemove",Be,!0),be("mousedown",Ve,!0),be("mouseup",Ve,!0),be("keydown",Ve,!0),be("scroll",Ve,!0)}),[]);return ke((()=>Oe))}var Oe=!1,Le=0,Fe=0;function Be(e){(function(e){const t=e.movementX||e.screenX-Le,n=e.movementY||e.screenY-Fe;return Le=e.screenX,Fe=e.screenY,t||n||!1})(e)&&(Oe=!0)}function Ve(){Oe=!1}function $e(e,t){const n=e.__unstableInternals;return D(n,"Invalid store"),n[t]}function He(e,...t){let n=e,r=n,o=Symbol(),i=T;const s=new Set,a=new Set,l=new Set,c=new Set,u=new Set,d=new WeakMap,p=new WeakMap,f=(e,t,n=c)=>(n.add(t),p.set(t,e),()=>{var e;null==(e=d.get(t))||e(),d.delete(t),p.delete(t),n.delete(t)}),h=(e,i,s=!1)=>{var l;if(!R(n,e))return;const f=I(i,n[e]);if(f===n[e])return;if(!s)for(const n of t)null==(l=null==n?void 0:n.setState)||l.call(n,e,f);const h=n;n=P(E({},n),{[e]:f});const m=Symbol();o=m,a.add(e);const g=(t,r,o)=>{var i;const s=p.get(t);s&&!s.some((t=>o?o.has(t):t===e))||(null==(i=d.get(t))||i(),d.set(t,t(n,r)))};for(const e of c)g(e,h);queueMicrotask((()=>{if(o!==m)return;const e=n;for(const e of u)g(e,r,a);r=e,a.clear()}))},m={getState:()=>n,setState:h,__unstableInternals:{setup:e=>(l.add(e),()=>l.delete(e)),init:()=>{const e=s.size,r=Symbol();s.add(r);const o=()=>{s.delete(r),s.size||i()};if(e)return o;const a=(c=n,Object.keys(c)).map((e=>M(...t.map((t=>{var n;const r=null==(n=null==t?void 0:t.getState)?void 0:n.call(t);if(r&&R(r,e))return Ke(t,[e],(t=>{h(e,t[e],!0)}))})))));var c;const u=[];for(const e of l)u.push(e());const d=t.map(Ue);return i=M(...a,...u,...d),o},subscribe:(e,t)=>f(e,t),sync:(e,t)=>(d.set(t,t(n,n)),f(e,t)),batch:(e,t)=>(d.set(t,t(n,r)),f(e,t,u)),pick:e=>He(function(e,t){const n={};for(const r of t)R(e,r)&&(n[r]=e[r]);return n}(n,e),m),omit:e=>He(function(e,t){const n=E({},e);for(const e of t)R(n,e)&&delete n[e];return n}(n,e),m)}};return m}function We(e,...t){if(e)return $e(e,"setup")(...t)}function Ue(e,...t){if(e)return $e(e,"init")(...t)}function Ge(e,...t){if(e)return $e(e,"subscribe")(...t)}function Ke(e,...t){if(e)return $e(e,"sync")(...t)}function qe(e,...t){if(e)return $e(e,"batch")(...t)}function Ye(e,...t){if(e)return $e(e,"omit")(...t)}function Xe(...e){const t=e.reduce(((e,t)=>{var n;const r=null==(n=null==t?void 0:t.getState)?void 0:n.call(t);return r?Object.assign(e,r):e}),{}),n=He(t,...e);return Object.assign({},...e,n)}var Ze=o(422),{useSyncExternalStore:Qe}=Ze,Je=()=>()=>{};function et(e,t=A){const n=B.useCallback((t=>e?Ge(e,null,t):Je()),[e]),r=()=>{const n="string"==typeof t?t:null,r="function"==typeof t?t:null,o=null==e?void 0:e.getState();return r?r(o):o&&n&&R(o,n)?o[n]:void 0};return Qe(n,r,r)}function tt(e,t){const n=B.useRef({}),r=B.useCallback((t=>e?Ge(e,null,t):Je()),[e]),o=()=>{const r=null==e?void 0:e.getState();let o=!1;const i=n.current;for(const e in t){const n=t[e];if("function"==typeof n){const t=n(r);t!==i[e]&&(i[e]=t,o=!0)}if("string"==typeof n){if(!r)continue;if(!R(r,n))continue;const t=r[n];t!==i[e]&&(i[e]=t,o=!0)}}return o&&(n.current=v({},i)),n.current};return Qe(r,o,o)}function nt(e,t,n,r){const o=R(t,n)?t[n]:void 0,i=r?t[r]:void 0,s=Ce({value:o,setValue:i});_e((()=>Ke(e,[n],((e,t)=>{const{value:r,setValue:o}=s.current;o&&e[n]!==t[n]&&e[n]!==r&&o(e[n])}))),[e,n]),_e((()=>{if(void 0!==o)return e.setState(n,o),qe(e,[n],(()=>{void 0!==o&&e.setState(n,o)}))}))}function rt(e,t){const[n,r]=B.useState((()=>e(t)));_e((()=>Ue(n)),[n]);const o=B.useCallback((e=>et(n,e)),[n]);return[B.useMemo((()=>b(v({},n),{useState:o})),[n,o]),ke((()=>{r((n=>e(v(v({},t),n.getState()))))}))]}function ot(e,t,n){return Te(t,[n.store]),nt(e,n,"items","setItems"),e}function it(e={}){var t;e.store;const n=null==(t=e.store)?void 0:t.getState(),r=F(e.items,null==n?void 0:n.items,e.defaultItems,[]),o=new Map(r.map((e=>[e.id,e]))),i={items:r,renderedItems:F(null==n?void 0:n.renderedItems,[])},s=null==(a=e.store)?void 0:a.__unstablePrivateStore;var a;const l=He({items:r,renderedItems:i.renderedItems},s),c=He(i,e.store),u=e=>{const t=se(e,(e=>e.element));l.setState("renderedItems",t),c.setState("renderedItems",t)};We(c,(()=>Ue(l))),We(l,(()=>qe(l,["items"],(e=>{c.setState("items",e.items)})))),We(l,(()=>qe(l,["renderedItems"],(e=>{let t=!0,n=requestAnimationFrame((()=>{const{renderedItems:t}=c.getState();e.renderedItems!==t&&u(e.renderedItems)}));if("function"!=typeof IntersectionObserver)return()=>cancelAnimationFrame(n);const r=function(e){var t;const n=e.find((e=>!!e.element)),r=[...e].reverse().find((e=>!!e.element));let o=null==(t=null==n?void 0:n.element)?void 0:t.parentElement;for(;o&&(null==r?void 0:r.element);){if(r&&o.contains(r.element))return o;o=o.parentElement}return K(o).body}(e.renderedItems),o=new IntersectionObserver((()=>{t?t=!1:(cancelAnimationFrame(n),n=requestAnimationFrame((()=>u(e.renderedItems))))}),{root:r});for(const t of e.renderedItems)t.element&&o.observe(t.element);return()=>{cancelAnimationFrame(n),o.disconnect()}}))));const d=(e,t,n=!1)=>{let r;t((t=>{const n=t.findIndex((({id:t})=>t===e.id)),i=t.slice();if(-1!==n){r=t[n];const s=E(E({},r),e);i[n]=s,o.set(e.id,s)}else i.push(e),o.set(e.id,e);return i}));return()=>{t((t=>{if(!r)return n&&o.delete(e.id),t.filter((({id:t})=>t!==e.id));const i=t.findIndex((({id:t})=>t===e.id));if(-1===i)return t;const s=t.slice();return s[i]=r,o.set(e.id,r),s}))}},p=e=>d(e,(e=>l.setState("items",e)),!0);return P(E({},c),{registerItem:p,renderItem:e=>M(p(e),d(e,(e=>l.setState("renderedItems",e)))),item:e=>{if(!e)return null;let t=o.get(e);if(!t){const{items:n}=l.getState();t=n.find((t=>t.id===e)),t&&o.set(e,t)}return t||null},__unstablePrivateStore:l})}function st(e){return Array.isArray(e)?e:void 0!==e?[e]:[]}function at(e){const t=[];for(const n of e)t.push(...n);return t}function lt(e){return e.slice().reverse()}var ct={id:null};function ut(e,t){return e.find((e=>t?!e.disabled&&e.id!==t:!e.disabled))}function dt(e,t){return e.filter((e=>e.rowId===t))}function pt(e){const t=[];for(const n of e){const e=t.find((e=>{var t;return(null==(t=e[0])?void 0:t.rowId)===n.rowId}));e?e.push(n):t.push([n])}return t}function ft(e){let t=0;for(const{length:n}of e)n>t&&(t=n);return t}function ht(e={}){var t;const n=null==(t=e.store)?void 0:t.getState(),r=it(e),o=F(e.activeId,null==n?void 0:n.activeId,e.defaultActiveId),i=He(P(E({},r.getState()),{id:F(e.id,null==n?void 0:n.id,`id-${Math.random().toString(36).slice(2,8)}`),activeId:o,baseElement:F(null==n?void 0:n.baseElement,null),includesBaseElement:F(e.includesBaseElement,null==n?void 0:n.includesBaseElement,null===o),moves:F(null==n?void 0:n.moves,0),orientation:F(e.orientation,null==n?void 0:n.orientation,"both"),rtl:F(e.rtl,null==n?void 0:n.rtl,!1),virtualFocus:F(e.virtualFocus,null==n?void 0:n.virtualFocus,!1),focusLoop:F(e.focusLoop,null==n?void 0:n.focusLoop,!1),focusWrap:F(e.focusWrap,null==n?void 0:n.focusWrap,!1),focusShift:F(e.focusShift,null==n?void 0:n.focusShift,!1)}),r,e.store);We(i,(()=>Ke(i,["renderedItems","activeId"],(e=>{i.setState("activeId",(t=>{var n;return void 0!==t?t:null==(n=ut(e.renderedItems))?void 0:n.id}))}))));const s=(e="next",t={})=>{var n,r;const o=i.getState(),{skip:s=0,activeId:a=o.activeId,focusShift:l=o.focusShift,focusLoop:c=o.focusLoop,focusWrap:u=o.focusWrap,includesBaseElement:d=o.includesBaseElement,renderedItems:p=o.renderedItems,rtl:f=o.rtl}=t,h="up"===e||"down"===e,m="next"===e||"down"===e,g=m?f&&!h:!f||h,v=l&&!s;let b=h?at(function(e,t,n){const r=ft(e);for(const o of e)for(let e=0;ee.id===a));if(!x)return null==(r=ut(b))?void 0:r.id;const y=b.some((e=>e.rowId)),w=b.indexOf(x),_=b.slice(w+1),S=dt(_,x.rowId);if(s){const e=function(e,t){return e.filter((e=>t?!e.disabled&&e.id!==t:!e.disabled))}(S,a),t=e.slice(s)[0]||e[e.length-1];return null==t?void 0:t.id}const C=c&&(h?"horizontal"!==c:"vertical"!==c),k=y&&u&&(h?"horizontal"!==u:"vertical"!==u),j=m?(!y||h)&&C&&d:!!h&&d;if(C){const e=function(e,t,n=!1){const r=e.findIndex((e=>e.id===t));return[...e.slice(r+1),...n?[ct]:[],...e.slice(0,r)]}(k&&!j?b:dt(b,x.rowId),a,j),t=ut(e,a);return null==t?void 0:t.id}if(k){const e=ut(j?S:_,a);return j?(null==e?void 0:e.id)||null:null==e?void 0:e.id}const N=ut(S,a);return!N&&j?null:null==N?void 0:N.id};return P(E(E({},r),i),{setBaseElement:e=>i.setState("baseElement",e),setActiveId:e=>i.setState("activeId",e),move:e=>{void 0!==e&&(i.setState("activeId",e),i.setState("moves",(e=>e+1)))},first:()=>{var e;return null==(e=ut(i.getState().renderedItems))?void 0:e.id},last:()=>{var e;return null==(e=ut(lt(i.getState().renderedItems)))?void 0:e.id},next:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),s("next",e)),previous:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),s("previous",e)),down:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),s("down",e)),up:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),s("up",e))})}function mt(e){const t=Pe(e.id);return v({id:t},e)}function gt(e,t,n){return nt(e=ot(e,t,n),n,"activeId","setActiveId"),nt(e,n,"includesBaseElement"),nt(e,n,"virtualFocus"),nt(e,n,"orientation"),nt(e,n,"rtl"),nt(e,n,"focusLoop"),nt(e,n,"focusWrap"),nt(e,n,"focusShift"),e}function vt(e={}){e=mt(e);const[t,n]=rt(ht,e);return gt(t,n,e)}var bt={id:null};function xt(e,t){return t&&e.item(t)||null}var yt=Symbol("FOCUS_SILENTLY");function wt(e,t,n){if(!t)return!1;if(t===n)return!1;const r=e.item(t.id);return!!r&&(!n||r.element!==n)}const _t=window.ReactJSXRuntime;function St(e){const t=B.forwardRef(((t,n)=>e(b(v({},t),{ref:n}))));return t.displayName=e.displayName||e.name,t}function Ct(e,t){return B.memo(e,t)}function kt(e,t){const n=t,{wrapElement:r,render:o}=n,i=x(n,["wrapElement","render"]),s=Ee(t.ref,W(o));let a;if(B.isValidElement(o)){const e=b(v({},o.props),{ref:s});a=B.cloneElement(o,function(e,t){const n=v({},e);for(const r in t){if(!R(t,r))continue;if("className"===r){const r="className";n[r]=e[r]?`${e[r]} ${t[r]}`:t[r];continue}if("style"===r){const r="style";n[r]=e[r]?v(v({},e[r]),t[r]):t[r];continue}const o=t[r];if("function"==typeof o&&r.startsWith("on")){const t=e[r];if("function"==typeof t){n[r]=(...e)=>{o(...e),t(...e)};continue}}n[r]=o}return n}(i,e))}else a=o?o(i):(0,_t.jsx)(e,v({},i));return r?r(a):a}function jt(e){const t=(t={})=>e(t);return t.displayName=e.name,t}function Et(e=[],t=[]){const n=B.createContext(void 0),r=B.createContext(void 0),o=()=>B.useContext(n),i=t=>e.reduceRight(((e,n)=>(0,_t.jsx)(n,b(v({},t),{children:e}))),(0,_t.jsx)(n.Provider,v({},t)));return{context:n,scopedContext:r,useContext:o,useScopedContext:(e=!1)=>{const t=B.useContext(r),n=o();return e?t:t||n},useProviderContext:()=>{const e=B.useContext(r),t=o();if(!e||e!==t)return t},ContextProvider:i,ScopedContextProvider:e=>(0,_t.jsx)(i,b(v({},e),{children:t.reduceRight(((t,n)=>(0,_t.jsx)(n,b(v({},e),{children:t}))),(0,_t.jsx)(r.Provider,v({},e)))}))}}var Pt=Et(),Nt=Pt.useContext,Tt=(Pt.useScopedContext,Pt.useProviderContext,Et([Pt.ContextProvider],[Pt.ScopedContextProvider])),It=Tt.useContext,Rt=(Tt.useScopedContext,Tt.useProviderContext),Mt=Tt.ContextProvider,At=Tt.ScopedContextProvider,Dt=(0,B.createContext)(void 0),zt=(0,B.createContext)(void 0),Ot=(0,B.createContext)(!0),Lt="input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], summary, iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false'])";function Ft(e){return!!e.matches(Lt)&&(!!ee(e)&&!e.closest("[inert]"))}function Bt(e){if(!Ft(e))return!1;if(function(e){return Number.parseInt(e.getAttribute("tabindex")||"0",10)<0}(e))return!1;if(!("form"in e))return!0;if(!e.form)return!0;if(e.checked)return!0;if("radio"!==e.type)return!0;const t=e.form.elements.namedItem(e.name);if(!t)return!0;if(!("length"in t))return!0;const n=Y(e);return!n||(n===e||(!("form"in n)||(n.form!==e.form||n.name!==e.name)))}function Vt(e,t){const n=Array.from(e.querySelectorAll(Lt));t&&n.unshift(e);const r=n.filter(Ft);return r.forEach(((e,t)=>{if(Z(e)&&e.contentDocument){const n=e.contentDocument.body;r.splice(t,1,...Vt(n))}})),r}function $t(e,t,n){const r=Array.from(e.querySelectorAll(Lt)),o=r.filter(Bt);return t&&Bt(e)&&o.unshift(e),o.forEach(((e,t)=>{if(Z(e)&&e.contentDocument){const r=$t(e.contentDocument.body,!1,n);o.splice(t,1,...r)}})),!o.length&&n?r:o}function Ht(e,t,n){const[r]=$t(e,t,n);return r||null}function Wt(e,t){return function(e,t,n,r){const o=Y(e),i=Vt(e,t),s=i.indexOf(o),a=i.slice(s+1);return a.find(Bt)||(n?i.find(Bt):null)||(r?a[0]:null)||null}(document.body,!1,e,t)}function Ut(e,t){return function(e,t,n,r){const o=Y(e),i=Vt(e,t).reverse(),s=i.indexOf(o),a=i.slice(s+1);return a.find(Bt)||(n?i.find(Bt):null)||(r?a[0]:null)||null}(document.body,!1,e,t)}function Gt(e){const t=Y(e);if(!t)return!1;if(t===e)return!0;const n=t.getAttribute("aria-activedescendant");return!!n&&n===e.id}function Kt(e){const t=Y(e);if(!t)return!1;if(X(e,t))return!0;const n=t.getAttribute("aria-activedescendant");return!!n&&("id"in e&&(n===e.id||!!e.querySelector(`#${CSS.escape(n)}`)))}function qt(e){!Kt(e)&&Ft(e)&&e.focus()}function Yt(e){var t;const n=null!=(t=e.getAttribute("tabindex"))?t:"";e.setAttribute("data-tabindex",n),e.setAttribute("tabindex","-1")}var Xt=le(),Zt=["text","search","url","tel","email","password","number","date","month","week","time","datetime","datetime-local"],Qt=Symbol("safariFocusAncestor");function Jt(e,t){e&&(e[Qt]=t)}function en(e){return!("input"!==e.tagName.toLowerCase()||!e.type)&&("radio"===e.type||"checkbox"===e.type)}function tn(e,t,n,r,o){return e?t?n&&!r?-1:void 0:n?o:o||0:o}function nn(e,t){return ke((n=>{null==e||e(n),n.defaultPrevented||t&&(n.stopPropagation(),n.preventDefault())}))}var rn=!0;function on(e){const t=e.target;t&&"hasAttribute"in t&&(t.hasAttribute("data-focus-visible")||(rn=!1))}function sn(e){e.metaKey||e.ctrlKey||e.altKey||(rn=!0)}var an=jt((function(e){var t=e,{focusable:n=!0,accessibleWhenDisabled:r,autoFocus:o,onFocusVisible:i}=t,s=x(t,["focusable","accessibleWhenDisabled","autoFocus","onFocusVisible"]);const a=(0,B.useRef)(null);(0,B.useEffect)((()=>{n&&(be("mousedown",on,!0),be("keydown",sn,!0))}),[n]),Xt&&(0,B.useEffect)((()=>{if(!n)return;const e=a.current;if(!e)return;if(!en(e))return;const t=function(e){return"labels"in e?e.labels:null}(e);if(!t)return;const r=()=>queueMicrotask((()=>e.focus()));for(const e of t)e.addEventListener("mouseup",r);return()=>{for(const e of t)e.removeEventListener("mouseup",r)}}),[n]);const l=n&&O(s),c=!!l&&!r,[u,d]=(0,B.useState)(!1);(0,B.useEffect)((()=>{n&&c&&u&&d(!1)}),[n,c,u]),(0,B.useEffect)((()=>{if(!n)return;if(!u)return;const e=a.current;if(!e)return;if("undefined"==typeof IntersectionObserver)return;const t=new IntersectionObserver((()=>{Ft(e)||d(!1)}));return t.observe(e),()=>t.disconnect()}),[n,u]);const p=nn(s.onKeyPressCapture,l),f=nn(s.onMouseDownCapture,l),h=nn(s.onClickCapture,l),m=s.onMouseDown,g=ke((e=>{if(null==m||m(e),e.defaultPrevented)return;if(!n)return;const t=e.currentTarget;if(!Xt)return;if(ue(e))return;if(!Q(t)&&!en(t))return;let r=!1;const o=()=>{r=!0};t.addEventListener("focusin",o,{capture:!0,once:!0});const i=function(e){for(;e&&!Ft(e);)e=e.closest(Lt);return e||null}(t.parentElement);Jt(i,!0),ve(t,"mouseup",(()=>{t.removeEventListener("focusin",o,!0),Jt(i,!1),r||qt(t)}))})),y=(e,t)=>{if(t&&(e.currentTarget=t),!n)return;const r=e.currentTarget;r&&Gt(r)&&(null==i||i(e),e.defaultPrevented||(r.dataset.focusVisible="true",d(!0)))},w=s.onKeyDownCapture,_=ke((e=>{if(null==w||w(e),e.defaultPrevented)return;if(!n)return;if(u)return;if(e.metaKey)return;if(e.altKey)return;if(e.ctrlKey)return;if(!de(e))return;const t=e.currentTarget;ve(t,"focusout",(()=>y(e,t)))})),S=s.onFocusCapture,C=ke((e=>{if(null==S||S(e),e.defaultPrevented)return;if(!n)return;if(!de(e))return void d(!1);const t=e.currentTarget,r=()=>y(e,t);rn||function(e){const{tagName:t,readOnly:n,type:r}=e;return"TEXTAREA"===t&&!n||("SELECT"===t&&!n||("INPUT"!==t||n?!!e.isContentEditable||!("combobox"!==e.getAttribute("role")||!e.dataset.name):Zt.includes(r)))}(e.target)?ve(e.target,"focusout",r):d(!1)})),k=s.onBlur,j=ke((e=>{null==k||k(e),n&&ge(e)&&d(!1)})),E=(0,B.useContext)(Ot),P=ke((e=>{n&&o&&e&&E&&queueMicrotask((()=>{Gt(e)||Ft(e)&&e.focus()}))})),N=Ne(a),T=n&&function(e){return!e||"button"===e||"summary"===e||"input"===e||"select"===e||"textarea"===e||"a"===e}(N),I=n&&function(e){return!e||"button"===e||"input"===e||"select"===e||"textarea"===e}(N),R=s.style,M=(0,B.useMemo)((()=>c?v({pointerEvents:"none"},R):R),[c,R]);return L(s=b(v({"data-focus-visible":n&&u||void 0,"data-autofocus":o||void 0,"aria-disabled":l||void 0},s),{ref:Ee(a,P,s.ref),style:M,tabIndex:tn(n,c,T,I,s.tabIndex),disabled:!(!I||!c)||void 0,contentEditable:l?void 0:s.contentEditable,onKeyPressCapture:p,onClickCapture:h,onMouseDownCapture:f,onMouseDown:g,onKeyDownCapture:_,onFocusCapture:C,onBlur:j}))}));St((function(e){return kt("div",an(e))}));function ln(e,t,n){return ke((r=>{var o;if(null==t||t(r),r.defaultPrevented)return;if(r.isPropagationStopped())return;if(!de(r))return;if(function(e){return"Shift"===e.key||"Control"===e.key||"Alt"===e.key||"Meta"===e.key}(r))return;if(function(e){const t=e.target;return!(t&&!te(t)||1!==e.key.length||e.ctrlKey||e.metaKey)}(r))return;const i=e.getState(),s=null==(o=xt(e,i.activeId))?void 0:o.element;if(!s)return;const a=r,{view:l}=a,c=x(a,["view"]);s!==(null==n?void 0:n.current)&&s.focus(),function(e,t,n){const r=new KeyboardEvent(t,n);return e.dispatchEvent(r)}(s,r.type,c)||r.preventDefault(),r.currentTarget.contains(s)&&r.stopPropagation()}))}var cn=jt((function(e){var t=e,{store:n,composite:r=!0,focusOnMove:o=r,moveOnKeyPress:i=!0}=t,s=x(t,["store","composite","focusOnMove","moveOnKeyPress"]);const a=Rt();D(n=n||a,!1);const l=(0,B.useRef)(null),c=(0,B.useRef)(null),u=function(e){const[t,n]=(0,B.useState)(!1),r=(0,B.useCallback)((()=>n(!0)),[]),o=e.useState((t=>xt(e,t.activeId)));return(0,B.useEffect)((()=>{const e=null==o?void 0:o.element;t&&e&&(n(!1),e.focus({preventScroll:!0}))}),[o,t]),r}(n),d=n.useState("moves"),[,p]=je(r?n.setBaseElement:null);(0,B.useEffect)((()=>{var e;if(!n)return;if(!d)return;if(!r)return;if(!o)return;const{activeId:t}=n.getState(),i=null==(e=xt(n,t))?void 0:e.element;i&&function(e,t){"scrollIntoView"in e?(e.focus({preventScroll:!0}),e.scrollIntoView(E({block:"nearest",inline:"nearest"},t))):e.focus()}(i)}),[n,d,r,o]),_e((()=>{if(!n)return;if(!d)return;if(!r)return;const{baseElement:e,activeId:t}=n.getState();if(!(null===t))return;if(!e)return;const o=c.current;c.current=null,o&&he(o,{relatedTarget:e}),Gt(e)||e.focus()}),[n,d,r]);const f=n.useState("activeId"),h=n.useState("virtualFocus");_e((()=>{var e;if(!n)return;if(!r)return;if(!h)return;const t=c.current;if(c.current=null,!t)return;const o=(null==(e=xt(n,f))?void 0:e.element)||Y(t);o!==t&&he(t,{relatedTarget:o})}),[n,f,h,r]);const m=ln(n,s.onKeyDownCapture,c),g=ln(n,s.onKeyUpCapture,c),y=s.onFocusCapture,w=ke((e=>{if(null==y||y(e),e.defaultPrevented)return;if(!n)return;const{virtualFocus:t}=n.getState();if(!t)return;const r=e.relatedTarget,o=function(e){const t=e[yt];return delete e[yt],t}(e.currentTarget);de(e)&&o&&(e.stopPropagation(),c.current=r)})),_=s.onFocus,S=ke((e=>{if(null==_||_(e),e.defaultPrevented)return;if(!r)return;if(!n)return;const{relatedTarget:t}=e,{virtualFocus:o}=n.getState();o?de(e)&&!wt(n,t)&&queueMicrotask(u):de(e)&&n.setActiveId(null)})),C=s.onBlurCapture,k=ke((e=>{var t;if(null==C||C(e),e.defaultPrevented)return;if(!n)return;const{virtualFocus:r,activeId:o}=n.getState();if(!r)return;const i=null==(t=xt(n,o))?void 0:t.element,s=e.relatedTarget,a=wt(n,s),l=c.current;if(c.current=null,de(e)&&a)s===i?l&&l!==s&&he(l,e):i?he(i,e):l&&he(l,e),e.stopPropagation();else{!wt(n,e.target)&&i&&he(i,e)}})),j=s.onKeyDown,P=Re(i),N=ke((e=>{var t;if(null==j||j(e),e.defaultPrevented)return;if(!n)return;if(!de(e))return;const{orientation:r,renderedItems:o,activeId:i}=n.getState(),s=xt(n,i);if(null==(t=null==s?void 0:s.element)?void 0:t.isConnected)return;const a="horizontal"!==r,l="vertical"!==r,c=o.some((e=>!!e.rowId));if(("ArrowLeft"===e.key||"ArrowRight"===e.key||"Home"===e.key||"End"===e.key)&&te(e.currentTarget))return;const u={ArrowUp:(c||a)&&(()=>{if(c){const e=function(e){return function(e,t){return e.find((e=>t?!e.disabled&&e.id!==t:!e.disabled))}(at(lt(function(e){const t=[];for(const n of e){const e=t.find((e=>{var t;return(null==(t=e[0])?void 0:t.rowId)===n.rowId}));e?e.push(n):t.push([n])}return t}(e))))}(o);return null==e?void 0:e.id}return null==n?void 0:n.last()}),ArrowRight:(c||l)&&n.first,ArrowDown:(c||a)&&n.first,ArrowLeft:(c||l)&&n.last,Home:n.first,End:n.last,PageUp:n.first,PageDown:n.last},d=u[e.key];if(d){const t=d();if(void 0!==t){if(!P(e))return;e.preventDefault(),n.move(t)}}}));s=Me(s,(e=>(0,_t.jsx)(Mt,{value:n,children:e})),[n]);const T=n.useState((e=>{var t;if(n&&r&&e.virtualFocus)return null==(t=xt(n,e.activeId))?void 0:t.id}));s=b(v({"aria-activedescendant":T},s),{ref:Ee(l,p,s.ref),onKeyDownCapture:m,onKeyUpCapture:g,onFocusCapture:w,onFocus:S,onBlurCapture:k,onKeyDown:N});const I=n.useState((e=>r&&(e.virtualFocus||null===e.activeId)));return s=an(v({focusable:I},s))})),un=St((function(e){return kt("div",cn(e))}));const dn=(0,c.createContext)({}),pn=()=>(0,c.useContext)(dn);var fn=(0,B.createContext)(void 0),hn=jt((function(e){const[t,n]=(0,B.useState)();return e=Me(e,(e=>(0,_t.jsx)(fn.Provider,{value:n,children:e})),[]),L(e=v({role:"group","aria-labelledby":t},e))})),mn=(St((function(e){return kt("div",hn(e))})),jt((function(e){var t=e,{store:n}=t,r=x(t,["store"]);return r=hn(r)}))),gn=St((function(e){return kt("div",mn(e))}));const vn=(0,c.forwardRef)((function(e,t){var n;const r=pn(),o=null!==(n=e.store)&&void 0!==n?n:r.store;return(0,_t.jsx)(gn,{store:o,...e,ref:t})}));var bn=jt((function(e){const t=(0,B.useContext)(fn),n=Pe(e.id);return _e((()=>(null==t||t(n),()=>null==t?void 0:t(void 0))),[t,n]),L(e=v({id:n,"aria-hidden":!0},e))})),xn=(St((function(e){return kt("div",bn(e))})),jt((function(e){var t=e,{store:n}=t,r=x(t,["store"]);return r=bn(r)}))),yn=St((function(e){return kt("div",xn(e))}));const wn=(0,c.forwardRef)((function(e,t){var n;const r=pn(),o=null!==(n=e.store)&&void 0!==n?n:r.store;return(0,_t.jsx)(yn,{store:o,...e,ref:t})}));function _n(e){const t=e.relatedTarget;return(null==t?void 0:t.nodeType)===Node.ELEMENT_NODE?t:null}var Sn=Symbol("composite-hover");var Cn=jt((function(e){var t=e,{store:n,focusOnHover:r=!0,blurOnHoverEnd:o=!!r}=t,i=x(t,["store","focusOnHover","blurOnHoverEnd"]);const s=It();D(n=n||s,!1);const a=ze(),l=i.onMouseMove,c=Re(r),u=ke((e=>{if(null==l||l(e),!e.defaultPrevented&&a()&&c(e)){if(!Kt(e.currentTarget)){const e=null==n?void 0:n.getState().baseElement;e&&!Gt(e)&&e.focus()}null==n||n.setActiveId(e.currentTarget.id)}})),d=i.onMouseLeave,p=Re(o),f=ke((e=>{var t;null==d||d(e),e.defaultPrevented||a()&&(function(e){const t=_n(e);return!!t&&X(e.currentTarget,t)}(e)||function(e){let t=_n(e);if(!t)return!1;do{if(R(t,Sn)&&t[Sn])return!0;t=t.parentElement}while(t);return!1}(e)||c(e)&&p(e)&&(null==n||n.setActiveId(null),null==(t=null==n?void 0:n.getState().baseElement)||t.focus()))})),h=(0,B.useCallback)((e=>{e&&(e[Sn]=!0)}),[]);return L(i=b(v({},i),{ref:Ee(h,i.ref),onMouseMove:u,onMouseLeave:f}))})),kn=Ct(St((function(e){return kt("div",Cn(e))})));const jn=(0,c.forwardRef)((function(e,t){var n;const r=pn(),o=null!==(n=e.store)&&void 0!==n?n:r.store;return(0,_t.jsx)(kn,{store:o,...e,ref:t})}));var En=jt((function(e){var t=e,{store:n,shouldRegisterItem:r=!0,getItem:o=A,element:i}=t,s=x(t,["store","shouldRegisterItem","getItem","element"]);const a=Nt();n=n||a;const l=Pe(s.id),c=(0,B.useRef)(i);return(0,B.useEffect)((()=>{const e=c.current;if(!l)return;if(!e)return;if(!r)return;const t=o({id:l,element:e});return null==n?void 0:n.renderItem(t)}),[l,r,o,n]),L(s=b(v({},s),{ref:Ee(c,s.ref)}))}));St((function(e){return kt("div",En(e))}));function Pn(e){if(!e.isTrusted)return!1;const t=e.currentTarget;return"Enter"===e.key?Q(t)||"SUMMARY"===t.tagName||"A"===t.tagName:" "===e.key&&(Q(t)||"SUMMARY"===t.tagName||"INPUT"===t.tagName||"SELECT"===t.tagName)}var Nn=Symbol("command"),Tn=jt((function(e){var t=e,{clickOnEnter:n=!0,clickOnSpace:r=!0}=t,o=x(t,["clickOnEnter","clickOnSpace"]);const i=(0,B.useRef)(null),[s,a]=(0,B.useState)(!1);(0,B.useEffect)((()=>{i.current&&a(Q(i.current))}),[]);const[l,c]=(0,B.useState)(!1),u=(0,B.useRef)(!1),d=O(o),[p,f]=De(o,Nn,!0),h=o.onKeyDown,m=ke((e=>{null==h||h(e);const t=e.currentTarget;if(e.defaultPrevented)return;if(p)return;if(d)return;if(!de(e))return;if(te(t))return;if(t.isContentEditable)return;const o=n&&"Enter"===e.key,i=r&&" "===e.key,s="Enter"===e.key&&!n,a=" "===e.key&&!r;if(s||a)e.preventDefault();else if(o||i){const n=Pn(e);if(o){if(!n){e.preventDefault();const n=e,{view:r}=n,o=x(n,["view"]),i=()=>me(t,o);G&&/firefox\//i.test(navigator.userAgent)?ve(t,"keyup",i):queueMicrotask(i)}}else i&&(u.current=!0,n||(e.preventDefault(),c(!0)))}})),g=o.onKeyUp,y=ke((e=>{if(null==g||g(e),e.defaultPrevented)return;if(p)return;if(d)return;if(e.metaKey)return;const t=r&&" "===e.key;if(u.current&&t&&(u.current=!1,!Pn(e))){e.preventDefault(),c(!1);const t=e.currentTarget,n=e,{view:r}=n,o=x(n,["view"]);queueMicrotask((()=>me(t,o)))}}));return o=b(v(v({"data-active":l||void 0,type:s?"button":void 0},f),o),{ref:Ee(i,o.ref),onKeyDown:m,onKeyUp:y}),o=an(o)}));St((function(e){return kt("button",Tn(e))}));function In(e,t=!1){const{top:n}=e.getBoundingClientRect();return t?n+e.clientHeight:n}function Rn(e,t,n,r=!1){var o;if(!t)return;if(!n)return;const{renderedItems:i}=t.getState(),s=ie(e);if(!s)return;const a=function(e,t=!1){const n=e.clientHeight,{top:r}=e.getBoundingClientRect(),o=1.5*Math.max(.875*n,n-40),i=t?n-o+r:o+r;return"HTML"===e.tagName?i+e.scrollTop:i}(s,r);let l,c;for(let e=0;e=0){void 0!==c&&cr||(e&&(null==h?void 0:h.baseElement)&&h.baseElement===e.baseElement?h.id:void 0),baseElement:e=>(null==e?void 0:e.baseElement)||void 0,isActiveItem:e=>!!e&&e.activeId===p,ariaSetSize:e=>null!=l?l:e&&(null==h?void 0:h.ariaSetSize)&&h.baseElement===e.baseElement?h.ariaSetSize:void 0,ariaPosInSet(e){if(null!=c)return c;if(!e)return;if(!(null==h?void 0:h.ariaPosInSet))return;if(h.baseElement!==e.baseElement)return;const t=e.renderedItems.filter((e=>e.rowId===g));return h.ariaPosInSet+t.findIndex((e=>e.id===p))},isTabbable(e){if(!(null==e?void 0:e.renderedItems.length))return!0;if(e.virtualFocus)return!1;if(s)return!0;if(null===e.activeId)return!1;const t=null==n?void 0:n.item(e.activeId);return!!(null==t?void 0:t.disabled)||(!(null==t?void 0:t.element)||e.activeId===p)}}),k=(0,B.useCallback)((e=>{var t;const n=b(v({},e),{id:p||e.id,rowId:g,disabled:!!m,children:null==(t=e.element)?void 0:t.textContent});return a?a(n):n}),[p,g,m,a]),j=u.onFocus,E=(0,B.useRef)(!1),P=ke((e=>{if(null==j||j(e),e.defaultPrevented)return;if(ue(e))return;if(!p)return;if(!n)return;if(function(e,t){return!de(e)&&wt(t,e.target)}(e,n))return;const{virtualFocus:t,baseElement:r}=n.getState();if(n.setActiveId(p),ne(e.currentTarget)&&function(e,t=!1){if(te(e))e.setSelectionRange(t?e.value.length:0,e.value.length);else if(e.isContentEditable){const n=K(e).getSelection();null==n||n.selectAllChildren(e),t&&(null==n||n.collapseToEnd())}}(e.currentTarget),!t)return;if(!de(e))return;if(ne(o=e.currentTarget)||"INPUT"===o.tagName&&!Q(o))return;var o;if(!(null==r?void 0:r.isConnected))return;le()&&e.currentTarget.hasAttribute("data-autofocus")&&e.currentTarget.scrollIntoView({block:"nearest",inline:"nearest"}),E.current=!0;e.relatedTarget===r||wt(n,e.relatedTarget)?function(e){e[yt]=!0,e.focus({preventScroll:!0})}(r):r.focus()})),N=u.onBlurCapture,T=ke((e=>{if(null==N||N(e),e.defaultPrevented)return;const t=null==n?void 0:n.getState();(null==t?void 0:t.virtualFocus)&&E.current&&(E.current=!1,e.preventDefault(),e.stopPropagation())})),I=u.onKeyDown,R=Re(o),M=Re(i),A=ke((e=>{if(null==I||I(e),e.defaultPrevented)return;if(!de(e))return;if(!n)return;const{currentTarget:t}=e,r=n.getState(),o=n.item(p),i=!!(null==o?void 0:o.rowId),s="horizontal"!==r.orientation,a="vertical"!==r.orientation,l=()=>!!i||(!!a||(!r.baseElement||!te(r.baseElement))),c={ArrowUp:(i||s)&&n.up,ArrowRight:(i||a)&&n.next,ArrowDown:(i||s)&&n.down,ArrowLeft:(i||a)&&n.previous,Home:()=>{if(l())return!i||e.ctrlKey?null==n?void 0:n.first():null==n?void 0:n.previous(-1)},End:()=>{if(l())return!i||e.ctrlKey?null==n?void 0:n.last():null==n?void 0:n.next(-1)},PageUp:()=>Rn(t,n,null==n?void 0:n.up,!0),PageDown:()=>Rn(t,n,null==n?void 0:n.down)}[e.key];if(c){if(ne(t)){const n=function(e){let t=0,n=0;if(te(e))t=e.selectionStart||0,n=e.selectionEnd||0;else if(e.isContentEditable){const r=K(e).getSelection();if((null==r?void 0:r.rangeCount)&&r.anchorNode&&X(e,r.anchorNode)&&r.focusNode&&X(e,r.focusNode)){const o=r.getRangeAt(0),i=o.cloneRange();i.selectNodeContents(e),i.setEnd(o.startContainer,o.startOffset),t=i.toString().length,i.setEnd(o.endContainer,o.endOffset),n=i.toString().length}}return{start:t,end:n}}(t),r=a&&"ArrowLeft"===e.key,o=a&&"ArrowRight"===e.key,i=s&&"ArrowUp"===e.key,l=s&&"ArrowDown"===e.key;if(o||l){const{length:e}=function(e){if(te(e))return e.value;if(e.isContentEditable){const t=K(e).createRange();return t.selectNodeContents(e),t.toString()}return""}(t);if(n.end!==e)return}else if((r||i)&&0!==n.start)return}const r=c();if(R(e)||void 0!==r){if(!M(e))return;e.preventDefault(),n.move(r)}}})),D=(0,B.useMemo)((()=>({id:p,baseElement:y})),[p,y]);return u=Me(u,(e=>(0,_t.jsx)(Dt.Provider,{value:D,children:e})),[D]),u=b(v({id:p,"data-active-item":w||void 0},u),{ref:Ee(f,u.ref),tabIndex:C?u.tabIndex:-1,onFocus:P,onBlurCapture:T,onKeyDown:A}),u=Tn(u),u=En(b(v({store:n},u),{getItem:k,shouldRegisterItem:!!p&&u.shouldRegisterItem})),L(b(v({},u),{"aria-setsize":_,"aria-posinset":S}))})),An=Ct(St((function(e){return kt("button",Mn(e))})));const Dn=(0,c.forwardRef)((function(e,t){var n;const r=pn(),o=null!==(n=e.store)&&void 0!==n?n:r.store;return(0,_t.jsx)(An,{store:o,...e,ref:t})}));var zn=jt((function(e){var t=e,{store:n,"aria-setsize":r,"aria-posinset":o}=t,i=x(t,["store","aria-setsize","aria-posinset"]);const s=It();D(n=n||s,!1);const a=Pe(i.id),l=n.useState((e=>e.baseElement||void 0)),c=(0,B.useMemo)((()=>({id:a,baseElement:l,ariaSetSize:r,ariaPosInSet:o})),[a,l,r,o]);return i=Me(i,(e=>(0,_t.jsx)(zt.Provider,{value:c,children:e})),[c]),L(i=v({id:a},i))})),On=St((function(e){return kt("div",zn(e))}));const Ln=(0,c.forwardRef)((function(e,t){var n;const r=pn(),o=null!==(n=e.store)&&void 0!==n?n:r.store;return(0,_t.jsx)(On,{store:o,...e,ref:t})}));var Fn="";function Bn(){Fn=""}function Vn(e,t){var n;const r=(null==(n=e.element)?void 0:n.textContent)||e.children||"value"in e&&e.value;return!!r&&(o=r,o.normalize("NFD").replace(/[\u0300-\u036f]/g,"")).trim().toLowerCase().startsWith(t.toLowerCase());var o}function $n(e,t,n){if(!n)return e;const r=e.find((e=>e.id===n));return r&&Vn(r,t)?Fn!==t&&Vn(r,Fn)?e:(Fn=t,function(e,t,n=!1){const r=e.findIndex((e=>e.id===t));return[...e.slice(r+1),...n?[bt]:[],...e.slice(0,r)]}(e.filter((e=>Vn(e,Fn))),n).filter((e=>e.id!==n))):e}var Hn=jt((function(e){var t=e,{store:n,typeahead:r=!0}=t,o=x(t,["store","typeahead"]);const i=It();D(n=n||i,!1);const s=o.onKeyDownCapture,a=(0,B.useRef)(0),l=ke((e=>{if(null==s||s(e),e.defaultPrevented)return;if(!r)return;if(!n)return;if(!function(e){const t=e.target;return(!t||!te(t))&&(!(" "!==e.key||!Fn.length)||1===e.key.length&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&/^[\p{Letter}\p{Number}]$/u.test(e.key))}(e))return Bn();const{renderedItems:t,items:o,activeId:i,id:l}=n.getState();let c=function(e){return e.filter((e=>!e.disabled))}(o.length>t.length?o:t);const u=`[data-offscreen-id="${l}"]`,d=K(e.currentTarget).querySelectorAll(u);for(const e of d){const t="true"===e.ariaDisabled||"disabled"in e&&!!e.disabled;c.push({id:e.id,element:e,disabled:t})}if(d.length&&(c=se(c,(e=>e.element))),!function(e,t){if(de(e))return!0;const n=e.target;if(!n)return!1;const r=t.some((e=>e.element===n));return r}(e,c))return Bn();e.preventDefault(),window.clearTimeout(a.current),a.current=window.setTimeout((()=>{Fn=""}),500);const p=e.key.toLowerCase();Fn+=p,c=$n(c,p,i);const f=c.find((e=>Vn(e,Fn)));f?n.move(f.id):Bn()}));return L(o=b(v({},o),{onKeyDownCapture:l}))})),Wn=St((function(e){return kt("div",Hn(e))}));const Un=(0,c.forwardRef)((function(e,t){var n;const r=pn(),o=null!==(n=e.store)&&void 0!==n?n:r.store;return(0,_t.jsx)(Wn,{store:o,...e,ref:t})})),Gn=Object.assign((0,c.forwardRef)((function({activeId:e,defaultActiveId:t,setActiveId:n,focusLoop:r=!1,focusWrap:o=!1,focusShift:i=!1,virtualFocus:s=!1,orientation:l="both",rtl:u=(0,a.isRTL)(),children:d,disabled:p=!1,...f},h){const m=f.store,g=vt({activeId:e,defaultActiveId:t,setActiveId:n,focusLoop:r,focusWrap:o,focusShift:i,virtualFocus:s,orientation:l,rtl:u}),v=null!=m?m:g,b=(0,c.useMemo)((()=>({store:v})),[v]);return(0,_t.jsx)(un,{disabled:p,store:v,...f,ref:h,children:(0,_t.jsx)(dn.Provider,{value:b,children:d})})})),{Group:Object.assign(vn,{displayName:"Composite.Group"}),GroupLabel:Object.assign(wn,{displayName:"Composite.GroupLabel"}),Item:Object.assign(Dn,{displayName:"Composite.Item"}),Row:Object.assign(Ln,{displayName:"Composite.Row"}),Hover:Object.assign(jn,{displayName:"Composite.Hover"}),Typeahead:Object.assign(Un,{displayName:"Composite.Typeahead"}),Context:Object.assign(dn,{displayName:"Composite.Context"})});function Kn(e={}){const t=Xe(e.store,Ye(e.disclosure,["contentElement","disclosureElement"])),n=null==t?void 0:t.getState(),r=F(e.open,null==n?void 0:n.open,e.defaultOpen,!1),o=F(e.animated,null==n?void 0:n.animated,!1),i=He({open:r,animated:o,animating:!!o&&r,mounted:r,contentElement:F(null==n?void 0:n.contentElement,null),disclosureElement:F(null==n?void 0:n.disclosureElement,null)},t);return We(i,(()=>Ke(i,["animated","animating"],(e=>{e.animated||i.setState("animating",!1)})))),We(i,(()=>Ge(i,["open"],(()=>{i.getState().animated&&i.setState("animating",!0)})))),We(i,(()=>Ke(i,["open","animating"],(e=>{i.setState("mounted",e.open||e.animating)})))),P(E({},i),{disclosure:e.disclosure,setOpen:e=>i.setState("open",e),show:()=>i.setState("open",!0),hide:()=>i.setState("open",!1),toggle:()=>i.setState("open",(e=>!e)),stopAnimation:()=>i.setState("animating",!1),setContentElement:e=>i.setState("contentElement",e),setDisclosureElement:e=>i.setState("disclosureElement",e)})}function qn(e,t,n){return Te(t,[n.store,n.disclosure]),nt(e,n,"open","setOpen"),nt(e,n,"mounted","setMounted"),nt(e,n,"animated"),Object.assign(e,{disclosure:n.disclosure})}function Yn(e={}){const[t,n]=rt(Kn,e);return qn(t,n,e)}function Xn(e={}){return Kn(e)}function Zn(e,t,n){return qn(e,t,n)}function Qn(e,t,n){return Te(t,[n.popover]),nt(e,n,"placement"),Zn(e,t,n)}function Jn(e,t,n){return nt(e,n,"timeout"),nt(e,n,"showTimeout"),nt(e,n,"hideTimeout"),Qn(e,t,n)}function er(e={}){var t=e,{popover:n}=t,r=N(t,["popover"]);const o=Xe(r.store,Ye(n,["arrowElement","anchorElement","contentElement","popoverElement","disclosureElement"])),i=null==o?void 0:o.getState(),s=Xn(P(E({},r),{store:o})),a=F(r.placement,null==i?void 0:i.placement,"bottom"),l=He(P(E({},s.getState()),{placement:a,currentPlacement:a,anchorElement:F(null==i?void 0:i.anchorElement,null),popoverElement:F(null==i?void 0:i.popoverElement,null),arrowElement:F(null==i?void 0:i.arrowElement,null),rendered:Symbol("rendered")}),s,o);return P(E(E({},s),l),{setAnchorElement:e=>l.setState("anchorElement",e),setPopoverElement:e=>l.setState("popoverElement",e),setArrowElement:e=>l.setState("arrowElement",e),render:()=>l.setState("rendered",Symbol("rendered"))})}function tr(e={}){var t;const n=null==(t=e.store)?void 0:t.getState(),r=er(P(E({},e),{placement:F(e.placement,null==n?void 0:n.placement,"bottom")})),o=F(e.timeout,null==n?void 0:n.timeout,500),i=He(P(E({},r.getState()),{timeout:o,showTimeout:F(e.showTimeout,null==n?void 0:n.showTimeout),hideTimeout:F(e.hideTimeout,null==n?void 0:n.hideTimeout),autoFocusOnShow:F(null==n?void 0:n.autoFocusOnShow,!1)}),r,e.store);return P(E(E({},r),i),{setAutoFocusOnShow:e=>i.setState("autoFocusOnShow",e)})}function nr(e={}){var t;const n=null==(t=e.store)?void 0:t.getState(),r=tr(P(E({},e),{placement:F(e.placement,null==n?void 0:n.placement,"top"),hideTimeout:F(e.hideTimeout,null==n?void 0:n.hideTimeout,0)})),o=He(P(E({},r.getState()),{type:F(e.type,null==n?void 0:n.type,"description"),skipTimeout:F(e.skipTimeout,null==n?void 0:n.skipTimeout,300)}),r,e.store);return E(E({},r),o)}function rr(e={}){const[t,n]=rt(nr,e);return function(e,t,n){return nt(e,n,"type"),nt(e,n,"skipTimeout"),Jn(e,t,n)}(t,n,e)}jt((function(e){return e}));var or=St((function(e){return kt("div",e)}));Object.assign(or,["a","button","details","dialog","div","form","h1","h2","h3","h4","h5","h6","header","img","input","label","li","nav","ol","p","section","select","span","summary","textarea","ul","svg"].reduce(((e,t)=>(e[t]=St((function(e){return kt(t,e)})),e)),{}));var ir=Et(),sr=(ir.useContext,ir.useScopedContext,ir.useProviderContext),ar=Et([ir.ContextProvider],[ir.ScopedContextProvider]),lr=(ar.useContext,ar.useScopedContext,ar.useProviderContext),cr=ar.ContextProvider,ur=ar.ScopedContextProvider,dr=(0,B.createContext)(void 0),pr=(0,B.createContext)(void 0),fr=Et([cr],[ur]),hr=fr.useContext,mr=(fr.useScopedContext,fr.useProviderContext),gr=fr.ContextProvider,vr=fr.ScopedContextProvider,br=Et([gr],[vr]),xr=(br.useContext,br.useScopedContext,br.useProviderContext),yr=br.ContextProvider,wr=br.ScopedContextProvider,_r=jt((function(e){var t=e,{store:n,showOnHover:r=!0}=t,o=x(t,["store","showOnHover"]);const i=xr();D(n=n||i,!1);const s=O(o),a=(0,B.useRef)(0);(0,B.useEffect)((()=>()=>window.clearTimeout(a.current)),[]),(0,B.useEffect)((()=>be("mouseleave",(e=>{if(!n)return;const{anchorElement:t}=n.getState();t&&e.target===t&&(window.clearTimeout(a.current),a.current=0)}),!0)),[n]);const l=o.onMouseMove,c=Re(r),u=ze(),d=ke((e=>{if(null==l||l(e),s)return;if(!n)return;if(e.defaultPrevented)return;if(a.current)return;if(!u())return;if(!c(e))return;const t=e.currentTarget;n.setAnchorElement(t),n.setDisclosureElement(t);const{showTimeout:r,timeout:o}=n.getState(),i=()=>{a.current=0,u()&&(null==n||n.setAnchorElement(t),null==n||n.show(),queueMicrotask((()=>{null==n||n.setDisclosureElement(t)})))},d=null!=r?r:o;0===d?i():a.current=window.setTimeout(i,d)})),p=o.onClick,f=ke((e=>{null==p||p(e),n&&(window.clearTimeout(a.current),a.current=0)})),h=(0,B.useCallback)((e=>{if(!n)return;const{anchorElement:t}=n.getState();(null==t?void 0:t.isConnected)||n.setAnchorElement(e)}),[n]);return o=b(v({},o),{ref:Ee(h,o.ref),onMouseMove:d,onClick:f}),o=an(o)})),Sr=(St((function(e){return kt("a",_r(e))})),Et([yr],[wr])),Cr=(Sr.useContext,Sr.useScopedContext,Sr.useProviderContext),kr=(Sr.ContextProvider,Sr.ScopedContextProvider),jr=He({activeStore:null});function Er(e){return()=>{const{activeStore:t}=jr.getState();t===e&&jr.setState("activeStore",null)}}var Pr=jt((function(e){var t=e,{store:n,showOnHover:r=!0}=t,o=x(t,["store","showOnHover"]);const i=Cr();D(n=n||i,!1);const s=(0,B.useRef)(!1);(0,B.useEffect)((()=>Ke(n,["mounted"],(e=>{e.mounted||(s.current=!1)}))),[n]),(0,B.useEffect)((()=>{if(n)return M(Er(n),Ke(n,["mounted","skipTimeout"],(e=>{if(!n)return;if(e.mounted){const{activeStore:e}=jr.getState();return e!==n&&(null==e||e.hide()),jr.setState("activeStore",n)}const t=setTimeout(Er(n),e.skipTimeout);return()=>clearTimeout(t)})))}),[n]);const a=o.onMouseEnter,l=ke((e=>{null==a||a(e),s.current=!0})),c=o.onFocusVisible,u=ke((e=>{null==c||c(e),e.defaultPrevented||(null==n||n.setAnchorElement(e.currentTarget),null==n||n.show())})),d=o.onBlur,p=ke((e=>{if(null==d||d(e),e.defaultPrevented)return;const{activeStore:t}=jr.getState();s.current=!1,t===n&&jr.setState("activeStore",null)})),f=n.useState("type"),h=n.useState((e=>{var t;return null==(t=e.contentElement)?void 0:t.id}));return o=b(v({"aria-labelledby":"label"===f?h:void 0},o),{onMouseEnter:l,onFocusVisible:u,onBlur:p}),o=_r(v({store:n,showOnHover(e){if(!s.current)return!1;if(z(r,e))return!1;const{activeStore:t}=jr.getState();return!t||(null==n||n.show(),!1)}},o))})),Nr=St((function(e){return kt("div",Pr(e))}));function Tr(e){return[e.clientX,e.clientY]}function Ir(e,t){const[n,r]=e;let o=!1;for(let e=t.length,i=0,s=e-1;i=u&&r0&&(r===u?r>d&&(o=!o):o=!o)}}else if(ll&&r<=u){if(0===p)return!0;p<0&&(r===u?r=c&&n<=a||n>=a&&n<=c))return!0}return o}function Rr(e,t){const n=e.getBoundingClientRect(),{top:r,right:o,bottom:i,left:s}=n,[a,l]=function(e,t){const{top:n,right:r,bottom:o,left:i}=t,[s,a]=e;return[sr?"right":null,ao?"bottom":null]}(t,n),c=[t];return a?("top"!==l&&c.push(["left"===a?s:o,r]),c.push(["left"===a?o:s,r]),c.push(["left"===a?o:s,i]),"bottom"!==l&&c.push(["left"===a?s:o,i])):"top"===l?(c.push([s,r]),c.push([s,i]),c.push([o,i]),c.push([o,r])):(c.push([s,i]),c.push([s,r]),c.push([o,r]),c.push([o,i])),c}function Mr(e,...t){if(!e)return!1;const n=e.getAttribute("data-backdrop");return null!=n&&(""===n||("true"===n||(!t.length||t.some((e=>n===e)))))}var Ar=new WeakMap;function Dr(e,t,n){Ar.has(e)||Ar.set(e,new Map);const r=Ar.get(e),o=r.get(t);if(!o)return r.set(t,n()),()=>{var e;null==(e=r.get(t))||e(),r.delete(t)};const i=n(),s=()=>{i(),o(),r.delete(t)};return r.set(t,s),()=>{r.get(t)===s&&(i(),r.set(t,o))}}function zr(e,t,n){return Dr(e,t,(()=>{const r=e.getAttribute(t);return e.setAttribute(t,n),()=>{null==r?e.removeAttribute(t):e.setAttribute(t,r)}}))}function Or(e,t,n){return Dr(e,t,(()=>{const r=t in e,o=e[t];return e[t]=n,()=>{r?e[t]=o:delete e[t]}}))}function Lr(e,t){if(!e)return()=>{};return Dr(e,"style",(()=>{const n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}))}var Fr=["SCRIPT","STYLE"];function Br(e){return`__ariakit-dialog-snapshot-${e}`}function Vr(e,t,n){return!Fr.includes(t.tagName)&&(!!function(e,t){const n=K(t),r=Br(e);if(!n.body[r])return!0;for(;;){if(t===n.body)return!1;if(t[r])return!0;if(!t.parentElement)return!1;t=t.parentElement}}(e,t)&&!n.some((e=>e&&X(t,e))))}function $r(e,t,n,r){for(let o of t){if(!(null==o?void 0:o.isConnected))continue;const i=t.some((e=>!!e&&(e!==o&&e.contains(o)))),s=K(o),a=o;for(;o.parentElement&&o!==s.body;){if(null==r||r(o.parentElement,a),!i)for(const r of o.parentElement.children)Vr(e,r,t)&&n(r,a);o=o.parentElement}}}function Hr(e="",t=!1){return`__ariakit-dialog-${t?"ancestor":"outside"}${e?`-${e}`:""}`}function Wr(e,t=""){return M(Or(e,Hr("",!0),!0),Or(e,Hr(t,!0),!0))}function Ur(e,t){if(e[Hr(t,!0)])return!0;const n=Hr(t);for(;;){if(e[n])return!0;if(!e.parentElement)return!1;e=e.parentElement}}function Gr(e,t){const n=[],r=t.map((e=>null==e?void 0:e.id));$r(e,t,(t=>{Mr(t,...r)||n.unshift(function(e,t=""){return M(Or(e,Hr(),!0),Or(e,Hr(t),!0))}(t,e))}),((t,r)=>{r.hasAttribute("data-dialog")&&r.id!==e||n.unshift(Wr(t,e))}));return()=>{for(const e of n)e()}}const Kr=window.ReactDOM;function qr(e,t){const n=setTimeout(t,e);return()=>clearTimeout(n)}function Yr(...e){return e.join(", ").split(", ").reduce(((e,t)=>{const n=t.endsWith("ms")?1:1e3,r=Number.parseFloat(t||"0s")*n;return r>e?r:e}),0)}function Xr(e,t,n){return!(n||!1===t||e&&!t)}var Zr=jt((function(e){var t=e,{store:n,alwaysVisible:r}=t,o=x(t,["store","alwaysVisible"]);const i=sr();D(n=n||i,!1);const s=(0,B.useRef)(null),a=Pe(o.id),[l,c]=(0,B.useState)(null),u=n.useState("open"),d=n.useState("mounted"),p=n.useState("animated"),f=n.useState("contentElement"),h=et(n.disclosure,"contentElement");_e((()=>{s.current&&(null==n||n.setContentElement(s.current))}),[n]),_e((()=>{let e;return null==n||n.setState("animated",(t=>(e=t,!0))),()=>{void 0!==e&&(null==n||n.setState("animated",e))}}),[n]),_e((()=>{if(p){if(null==f?void 0:f.isConnected)return function(e){let t=requestAnimationFrame((()=>{t=requestAnimationFrame(e)}));return()=>cancelAnimationFrame(t)}((()=>{c(u?"enter":d?"leave":null)}));c(null)}}),[p,f,u,d]),_e((()=>{if(!n)return;if(!p)return;if(!l)return;if(!f)return;const e=()=>null==n?void 0:n.setState("animating",!1),t=()=>(0,Kr.flushSync)(e);if("leave"===l&&u)return;if("enter"===l&&!u)return;if("number"==typeof p){return qr(p,t)}const{transitionDuration:r,animationDuration:o,transitionDelay:i,animationDelay:s}=getComputedStyle(f),{transitionDuration:a="0",animationDuration:c="0",transitionDelay:d="0",animationDelay:m="0"}=h?getComputedStyle(h):{},g=Yr(i,s,d,m)+Yr(r,o,a,c);if(!g)return"enter"===l&&n.setState("animated",!1),void e();return qr(Math.max(g-1e3/60,0),t)}),[n,p,f,h,u,l]),o=Me(o,(e=>(0,_t.jsx)(ur,{value:n,children:e})),[n]);const m=Xr(d,o.hidden,r),g=o.style,y=(0,B.useMemo)((()=>m?b(v({},g),{display:"none"}):g),[m,g]);return L(o=b(v({id:a,"data-open":u||void 0,"data-enter":"enter"===l||void 0,"data-leave":"leave"===l||void 0,hidden:m},o),{ref:Ee(a?n.setContentElement:null,s,o.ref),style:y}))})),Qr=St((function(e){return kt("div",Zr(e))})),Jr=St((function(e){var t=e,{unmountOnHide:n}=t,r=x(t,["unmountOnHide"]);const o=sr();return!1===et(r.store||o,(e=>!n||(null==e?void 0:e.mounted)))?null:(0,_t.jsx)(Qr,v({},r))}));function eo({store:e,backdrop:t,alwaysVisible:n,hidden:r}){const o=(0,B.useRef)(null),i=Yn({disclosure:e}),s=et(e,"contentElement");(0,B.useEffect)((()=>{const e=o.current,t=s;e&&t&&(e.style.zIndex=getComputedStyle(t).zIndex)}),[s]),_e((()=>{const e=null==s?void 0:s.id;if(!e)return;const t=o.current;return t?Wr(t,e):void 0}),[s]);const a=Zr({ref:o,store:i,role:"presentation","data-backdrop":(null==s?void 0:s.id)||"",alwaysVisible:n,hidden:null!=r?r:void 0,style:{position:"fixed",top:0,right:0,bottom:0,left:0}});if(!t)return null;if((0,B.isValidElement)(t))return(0,_t.jsx)(or,b(v({},a),{render:t}));const l="boolean"!=typeof t?t:"div";return(0,_t.jsx)(or,b(v({},a),{render:(0,_t.jsx)(l,{})}))}function to(e){return zr(e,"aria-hidden","true")}function no(){return"inert"in HTMLElement.prototype}function ro(e,t){if(!("style"in e))return T;if(no())return Or(e,"inert",!0);const n=$t(e,!0).map((e=>{if(null==t?void 0:t.some((t=>t&&X(t,e))))return T;const n=Dr(e,"focus",(()=>(e.focus=T,()=>{delete e.focus})));return M(zr(e,"tabindex","-1"),n)}));return M(...n,to(e),Lr(e,{pointerEvents:"none",userSelect:"none",cursor:"default"}))}function oo(e,t,n){const r=function({attribute:e,contentId:t,contentElement:n,enabled:r}){const[o,i]=Ie(),s=(0,B.useCallback)((()=>{if(!r)return!1;if(!n)return!1;const{body:o}=K(n),i=o.getAttribute(e);return!i||i===t}),[o,r,n,e,t]);return(0,B.useEffect)((()=>{if(!r)return;if(!t)return;if(!n)return;const{body:o}=K(n);if(s())return o.setAttribute(e,t),()=>o.removeAttribute(e);const a=new MutationObserver((()=>(0,Kr.flushSync)(i)));return a.observe(o,{attributeFilter:[e]}),()=>a.disconnect()}),[o,r,t,n,s,e]),s}({attribute:"data-dialog-prevent-body-scroll",contentElement:e,contentId:t,enabled:n});(0,B.useEffect)((()=>{if(!r())return;if(!e)return;const t=K(e),n=q(e),{documentElement:o,body:i}=t,s=o.style.getPropertyValue("--scrollbar-width"),a=s?Number.parseInt(s):n.innerWidth-o.clientWidth,l=function(e){const t=e.getBoundingClientRect().left;return Math.round(t)+e.scrollLeft?"paddingLeft":"paddingRight"}(o),c=ae()&&!ce();return M((d="--scrollbar-width",p=`${a}px`,(u=o)?Dr(u,d,(()=>{const e=u.style.getPropertyValue(d);return u.style.setProperty(d,p),()=>{e?u.style.setProperty(d,e):u.style.removeProperty(d)}})):()=>{}),c?(()=>{var e,t;const{scrollX:r,scrollY:o,visualViewport:s}=n,c=null!=(e=null==s?void 0:s.offsetLeft)?e:0,u=null!=(t=null==s?void 0:s.offsetTop)?t:0,d=Lr(i,{position:"fixed",overflow:"hidden",top:-(o-Math.floor(u))+"px",left:-(r-Math.floor(c))+"px",right:"0",[l]:`${a}px`});return()=>{d(),n.scrollTo({left:r,top:o,behavior:"instant"})}})():Lr(i,{overflow:"hidden",[l]:`${a}px`}));var u,d,p}),[r,e])}var io=(0,B.createContext)({});function so({store:e,type:t,listener:n,capture:r,domReady:o}){const i=ke(n),s=et(e,"open"),a=(0,B.useRef)(!1);_e((()=>{if(!s)return;if(!o)return;const{contentElement:t}=e.getState();if(!t)return;const n=()=>{a.current=!0};return t.addEventListener("focusin",n,!0),()=>t.removeEventListener("focusin",n,!0)}),[e,s,o]),(0,B.useEffect)((()=>{if(!s)return;return be(t,(t=>{const{contentElement:n,disclosureElement:r}=e.getState(),o=t.target;if(!n)return;if(!o)return;if(!function(e){return"HTML"===e.tagName||X(K(e).body,e)}(o))return;if(X(n,o))return;if(function(e,t){if(!e)return!1;if(X(e,t))return!0;const n=t.getAttribute("aria-activedescendant");if(n){const t=K(e).getElementById(n);if(t)return X(e,t)}return!1}(r,o))return;if(o.hasAttribute("data-focus-trap"))return;if(function(e,t){if(!("clientY"in e))return!1;const n=t.getBoundingClientRect();return 0!==n.width&&0!==n.height&&n.top<=e.clientY&&e.clientY<=n.top+n.height&&n.left<=e.clientX&&e.clientX<=n.left+n.width}(t,n))return;var s;a.current&&!Ur(o,n.id)||((s=o)&&s[Qt]||i(t))}),r)}),[s,r])}function ao(e,t){return"function"==typeof e?e(t):!!e}function lo(e,t,n){const r=function(e){const t=(0,B.useRef)();return(0,B.useEffect)((()=>{if(e)return be("mousedown",(e=>{t.current=e.target}),!0);t.current=null}),[e]),t}(et(e,"open")),o={store:e,domReady:n,capture:!0};so(b(v({},o),{type:"click",listener:n=>{const{contentElement:o}=e.getState(),i=r.current;i&&ee(i)&&Ur(i,null==o?void 0:o.id)&&ao(t,n)&&e.hide()}})),so(b(v({},o),{type:"focusin",listener:n=>{const{contentElement:r}=e.getState();r&&n.target!==K(r)&&ao(t,n)&&e.hide()}})),so(b(v({},o),{type:"contextmenu",listener:n=>{ao(t,n)&&e.hide()}}))}var co=jt((function(e){var t=e,{autoFocusOnShow:n=!0}=t,r=x(t,["autoFocusOnShow"]);return r=Me(r,(e=>(0,_t.jsx)(Ot.Provider,{value:n,children:e})),[n])})),uo=(St((function(e){return kt("div",co(e))})),(0,B.createContext)(0));function po({level:e,children:t}){const n=(0,B.useContext)(uo),r=Math.max(Math.min(e||n+1,6),1);return(0,_t.jsx)(uo.Provider,{value:r,children:t})}var fo=jt((function(e){return e=b(v({},e),{style:v({border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"},e.style)})})),ho=(St((function(e){return kt("span",fo(e))})),jt((function(e){return e=b(v({"data-focus-trap":"",tabIndex:0,"aria-hidden":!0},e),{style:v({position:"fixed",top:0,left:0},e.style)}),e=fo(e)}))),mo=St((function(e){return kt("span",ho(e))})),go=(0,B.createContext)(null);function vo(e){queueMicrotask((()=>{null==e||e.focus()}))}var bo=jt((function(e){var t=e,{preserveTabOrder:n,preserveTabOrderAnchor:r,portalElement:o,portalRef:i,portal:s=!0}=t,a=x(t,["preserveTabOrder","preserveTabOrderAnchor","portalElement","portalRef","portal"]);const l=(0,B.useRef)(null),c=Ee(l,a.ref),u=(0,B.useContext)(go),[d,p]=(0,B.useState)(null),[f,h]=(0,B.useState)(null),m=(0,B.useRef)(null),g=(0,B.useRef)(null),y=(0,B.useRef)(null),w=(0,B.useRef)(null);return _e((()=>{const e=l.current;if(!e||!s)return void p(null);const t=function(e,t){return t?"function"==typeof t?t(e):t:K(e).createElement("div")}(e,o);if(!t)return void p(null);const n=t.isConnected;if(!n){const n=u||function(e){return K(e).body}(e);n.appendChild(t)}return t.id||(t.id=e.id?`portal/${e.id}`:function(e="id"){return`${e?`${e}-`:""}${Math.random().toString(36).slice(2,8)}`}()),p(t),H(i,t),n?void 0:()=>{t.remove(),H(i,null)}}),[s,o,u,i]),_e((()=>{if(!s)return;if(!n)return;if(!r)return;const e=K(r).createElement("span");return e.style.position="fixed",r.insertAdjacentElement("afterend",e),h(e),()=>{e.remove(),h(null)}}),[s,n,r]),(0,B.useEffect)((()=>{if(!d)return;if(!n)return;let e=0;const t=t=>{if(!ge(t))return;const n="focusin"===t.type;if(cancelAnimationFrame(e),n)return function(e){const t=e.querySelectorAll("[data-tabindex]"),n=e=>{const t=e.getAttribute("data-tabindex");e.removeAttribute("data-tabindex"),t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")};e.hasAttribute("data-tabindex")&&n(e);for(const e of t)n(e)}(d);e=requestAnimationFrame((()=>{!function(e,t){const n=$t(e,t);for(const e of n)Yt(e)}(d,!0)}))};return d.addEventListener("focusin",t,!0),d.addEventListener("focusout",t,!0),()=>{cancelAnimationFrame(e),d.removeEventListener("focusin",t,!0),d.removeEventListener("focusout",t,!0)}}),[d,n]),a=Me(a,(e=>{if(e=(0,_t.jsx)(go.Provider,{value:d||u,children:e}),!s)return e;if(!d)return(0,_t.jsx)("span",{ref:c,id:a.id,style:{position:"fixed"},hidden:!0});e=(0,_t.jsxs)(_t.Fragment,{children:[n&&d&&(0,_t.jsx)(mo,{ref:g,"data-focus-trap":a.id,className:"__focus-trap-inner-before",onFocus:e=>{ge(e,d)?vo(Wt()):vo(m.current)}}),e,n&&d&&(0,_t.jsx)(mo,{ref:y,"data-focus-trap":a.id,className:"__focus-trap-inner-after",onFocus:e=>{ge(e,d)?vo(Ut()):vo(w.current)}})]}),d&&(e=(0,Kr.createPortal)(e,d));let t=(0,_t.jsxs)(_t.Fragment,{children:[n&&d&&(0,_t.jsx)(mo,{ref:m,"data-focus-trap":a.id,className:"__focus-trap-outer-before",onFocus:e=>{!(e.relatedTarget===w.current)&&ge(e,d)?vo(g.current):vo(Ut())}}),n&&(0,_t.jsx)("span",{"aria-owns":null==d?void 0:d.id,style:{position:"fixed"}}),n&&d&&(0,_t.jsx)(mo,{ref:w,"data-focus-trap":a.id,className:"__focus-trap-outer-after",onFocus:e=>{if(ge(e,d))vo(y.current);else{const e=Wt();if(e===g.current)return void requestAnimationFrame((()=>{var e;return null==(e=Wt())?void 0:e.focus()}));vo(e)}}})]});return f&&n&&(t=(0,Kr.createPortal)(t,f)),(0,_t.jsxs)(_t.Fragment,{children:[t,e]})}),[d,u,s,a.id,n,f]),a=b(v({},a),{ref:c})})),xo=(St((function(e){return kt("div",bo(e))})),le());function yo(e,t=!1){if(!e)return null;const n="current"in e?e.current:e;return n?t?Ft(n)?n:null:n:null}var wo=jt((function(e){var t=e,{store:n,open:r,onClose:o,focusable:i=!0,modal:s=!0,portal:a=!!s,backdrop:l=!!s,hideOnEscape:c=!0,hideOnInteractOutside:u=!0,getPersistentElements:d,preventBodyScroll:p=!!s,autoFocusOnShow:f=!0,autoFocusOnHide:h=!0,initialFocus:m,finalFocus:g,unmountOnHide:y,unstable_treeSnapshotKey:w}=t,_=x(t,["store","open","onClose","focusable","modal","portal","backdrop","hideOnEscape","hideOnInteractOutside","getPersistentElements","preventBodyScroll","autoFocusOnShow","autoFocusOnHide","initialFocus","finalFocus","unmountOnHide","unstable_treeSnapshotKey"]);const S=lr(),C=(0,B.useRef)(null),k=function(e={}){const[t,n]=rt(Xn,e);return Zn(t,n,e)}({store:n||S,open:r,setOpen(e){if(e)return;const t=C.current;if(!t)return;const n=new Event("close",{bubbles:!1,cancelable:!0});o&&t.addEventListener("close",o,{once:!0}),t.dispatchEvent(n),n.defaultPrevented&&k.setOpen(!0)}}),{portalRef:j,domReady:E}=Ae(a,_.portalRef),P=_.preserveTabOrder,N=et(k,(e=>P&&!s&&e.mounted)),T=Pe(_.id),I=et(k,"open"),R=et(k,"mounted"),A=et(k,"contentElement"),D=Xr(R,_.hidden,_.alwaysVisible);oo(A,T,p&&!D),lo(k,u,E);const{wrapElement:z,nestedDialogs:O}=function(e){const t=(0,B.useContext)(io),[n,r]=(0,B.useState)([]),o=(0,B.useCallback)((e=>{var n;return r((t=>[...t,e])),M(null==(n=t.add)?void 0:n.call(t,e),(()=>{r((t=>t.filter((t=>t!==e))))}))}),[t]);_e((()=>Ke(e,["open","contentElement"],(n=>{var r;if(n.open&&n.contentElement)return null==(r=t.add)?void 0:r.call(t,e)}))),[e,t]);const i=(0,B.useMemo)((()=>({store:e,add:o})),[e,o]);return{wrapElement:(0,B.useCallback)((e=>(0,_t.jsx)(io.Provider,{value:i,children:e})),[i]),nestedDialogs:n}}(k);_=Me(_,z,[z]),_e((()=>{if(!I)return;const e=C.current,t=Y(e,!0);t&&"BODY"!==t.tagName&&(e&&X(e,t)||k.setDisclosureElement(t))}),[k,I]),xo&&(0,B.useEffect)((()=>{if(!R)return;const{disclosureElement:e}=k.getState();if(!e)return;if(!Q(e))return;const t=()=>{let t=!1;const n=()=>{t=!0};e.addEventListener("focusin",n,{capture:!0,once:!0}),ve(e,"mouseup",(()=>{e.removeEventListener("focusin",n,!0),t||qt(e)}))};return e.addEventListener("mousedown",t),()=>{e.removeEventListener("mousedown",t)}}),[k,R]),(0,B.useEffect)((()=>{if(!R)return;if(!E)return;const e=C.current;if(!e)return;const t=q(e),n=t.visualViewport||t,r=()=>{var n,r;const o=null!=(r=null==(n=t.visualViewport)?void 0:n.height)?r:t.innerHeight;e.style.setProperty("--dialog-viewport-height",`${o}px`)};return r(),n.addEventListener("resize",r),()=>{n.removeEventListener("resize",r)}}),[R,E]),(0,B.useEffect)((()=>{if(!s)return;if(!R)return;if(!E)return;const e=C.current;if(!e)return;return e.querySelector("[data-dialog-dismiss]")?void 0:function(e,t){const n=K(e).createElement("button");return n.type="button",n.tabIndex=-1,n.textContent="Dismiss popup",Object.assign(n.style,{border:"0px",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0px",position:"absolute",whiteSpace:"nowrap",width:"1px"}),n.addEventListener("click",t),e.prepend(n),()=>{n.removeEventListener("click",t),n.remove()}}(e,k.hide)}),[k,s,R,E]),_e((()=>{if(!no())return;if(I)return;if(!R)return;if(!E)return;const e=C.current;return e?ro(e):void 0}),[I,R,E]);const L=I&&E;_e((()=>{if(!T)return;if(!L)return;const e=C.current;return function(e,t){const{body:n}=K(t[0]),r=[];return $r(e,t,(t=>{r.push(Or(t,Br(e),!0))})),M(Or(n,Br(e),!0),(()=>{for(const e of r)e()}))}(T,[e])}),[T,L,w]);const F=ke(d);_e((()=>{if(!T)return;if(!L)return;const{disclosureElement:e}=k.getState(),t=[C.current,...F()||[],...O.map((e=>e.getState().contentElement))];return s?M(Gr(T,t),function(e,t){const n=[],r=t.map((e=>null==e?void 0:e.id));return $r(e,t,(e=>{Mr(e,...r)||function(e,...t){if(!e)return!1;const n=e.getAttribute("data-focus-trap");return null!=n&&(!t.length||""!==n&&t.some((e=>n===e)))}(e,...r)||n.unshift(ro(e,t))}),(e=>{e.hasAttribute("role")&&(t.some((t=>t&&X(t,e)))||n.unshift(zr(e,"role","none")))})),()=>{for(const e of n)e()}}(T,t)):Gr(T,[e,...t])}),[T,k,L,F,O,s,w]);const V=!!f,$=Re(f),[H,W]=(0,B.useState)(!1);(0,B.useEffect)((()=>{if(!I)return;if(!V)return;if(!E)return;if(!(null==A?void 0:A.isConnected))return;const e=yo(m,!0)||A.querySelector("[data-autofocus=true],[autofocus]")||Ht(A,!0,a&&N)||A,t=Ft(e);$(t?e:null)&&(W(!0),queueMicrotask((()=>{e.focus(),xo&&e.scrollIntoView({block:"nearest",inline:"nearest"})})))}),[I,V,E,A,m,a,N,$]);const U=!!h,G=Re(h),[Z,J]=(0,B.useState)(!1);(0,B.useEffect)((()=>{if(I)return J(!0),()=>J(!1)}),[I]);const ee=(0,B.useCallback)(((e,t=!0)=>{const{disclosureElement:n}=k.getState();if(function(e){const t=Y();return!(!t||e&&X(e,t)||!Ft(t))}(e))return;let r=yo(g)||n;if(null==r?void 0:r.id){const e=K(r),t=`[aria-activedescendant="${r.id}"]`,n=e.querySelector(t);n&&(r=n)}if(r&&!Ft(r)){const e=r.closest("[data-dialog]");if(null==e?void 0:e.id){const t=K(e),n=`[aria-controls~="${e.id}"]`,o=t.querySelector(n);o&&(r=o)}}const o=r&&Ft(r);o||!t?G(o?r:null)&&o&&(null==r||r.focus()):requestAnimationFrame((()=>ee(e,!1)))}),[k,g,G]),te=(0,B.useRef)(!1);_e((()=>{if(I)return;if(!Z)return;if(!U)return;const e=C.current;te.current=!0,ee(e)}),[I,Z,E,U,ee]),(0,B.useEffect)((()=>{if(!Z)return;if(!U)return;const e=C.current;return()=>{te.current?te.current=!1:ee(e)}}),[Z,U,ee]);const ne=Re(c);(0,B.useEffect)((()=>{if(!E)return;if(!R)return;return be("keydown",(e=>{if("Escape"!==e.key)return;if(e.defaultPrevented)return;const t=C.current;if(!t)return;if(Ur(t))return;const n=e.target;if(!n)return;const{disclosureElement:r}=k.getState();("BODY"===n.tagName||X(t,n)||!r||X(r,n))&&ne(e)&&k.hide()}),!0)}),[k,E,R,ne]);const re=(_=Me(_,(e=>(0,_t.jsx)(po,{level:s?1:void 0,children:e})),[s])).hidden,oe=_.alwaysVisible;_=Me(_,(e=>l?(0,_t.jsxs)(_t.Fragment,{children:[(0,_t.jsx)(eo,{store:k,backdrop:l,hidden:re,alwaysVisible:oe}),e]}):e),[k,l,re,oe]);const[ie,se]=(0,B.useState)(),[ae,le]=(0,B.useState)();return _=Me(_,(e=>(0,_t.jsx)(ur,{value:k,children:(0,_t.jsx)(dr.Provider,{value:se,children:(0,_t.jsx)(pr.Provider,{value:le,children:e})})})),[k]),_=b(v({id:T,"data-dialog":"",role:"dialog",tabIndex:i?-1:void 0,"aria-labelledby":ie,"aria-describedby":ae},_),{ref:Ee(C,_.ref)}),_=co(b(v({},_),{autoFocusOnShow:H})),_=Zr(v({store:k},_)),_=an(b(v({},_),{focusable:i})),_=bo(b(v({portal:a},_),{portalRef:j,preserveTabOrder:N}))}));function _o(e,t=lr){return St((function(n){const r=t();return et(n.store||r,(e=>!n.unmountOnHide||(null==e?void 0:e.mounted)||!!n.open))?(0,_t.jsx)(e,v({},n)):null}))}_o(St((function(e){return kt("div",wo(e))})),lr);const So=Math.min,Co=Math.max,ko=(Math.round,Math.floor,{left:"right",right:"left",bottom:"top",top:"bottom"}),jo={start:"end",end:"start"};function Eo(e,t,n){return Co(e,So(t,n))}function Po(e,t){return"function"==typeof e?e(t):e}function No(e){return e.split("-")[0]}function To(e){return e.split("-")[1]}function Io(e){return"x"===e?"y":"x"}function Ro(e){return"y"===e?"height":"width"}function Mo(e){return["top","bottom"].includes(No(e))?"y":"x"}function Ao(e){return Io(Mo(e))}function Do(e){return e.replace(/start|end/g,(e=>jo[e]))}function zo(e){return e.replace(/left|right|bottom|top/g,(e=>ko[e]))}function Oo(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function Lo(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function Fo(e,t,n){let{reference:r,floating:o}=e;const i=Mo(t),s=Ao(t),a=Ro(s),l=No(t),c="y"===i,u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,p=r[a]/2-o[a]/2;let f;switch(l){case"top":f={x:u,y:r.y-o.height};break;case"bottom":f={x:u,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:d};break;case"left":f={x:r.x-o.width,y:d};break;default:f={x:r.x,y:r.y}}switch(To(t)){case"start":f[s]-=p*(n&&c?-1:1);break;case"end":f[s]+=p*(n&&c?-1:1)}return f}async function Bo(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:p=!1,padding:f=0}=Po(t,e),h=Oo(f),m=a[p?"floating"===d?"reference":"floating":d],g=Lo(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(m)))||n?m:m.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),v="floating"===d?{...s.floating,x:r,y:o}:s.reference,b=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),x=await(null==i.isElement?void 0:i.isElement(b))&&await(null==i.getScale?void 0:i.getScale(b))||{x:1,y:1},y=Lo(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:v,offsetParent:b,strategy:l}):v);return{top:(g.top-y.top+h.top)/x.y,bottom:(y.bottom-g.bottom+h.bottom)/x.y,left:(g.left-y.left+h.left)/x.x,right:(y.right-g.right+h.right)/x.x}}const Vo=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,o=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),s=No(n),a=To(n),l="y"===Mo(n),c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,d=Po(t,e);let{mainAxis:p,crossAxis:f,alignmentAxis:h}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&"number"==typeof h&&(f="end"===a?-1*h:h),l?{x:f*u,y:p*c}:{x:p*c,y:f*u}}(t,e);return{x:n+o.x,y:r+o.y,data:o}}}},$o=Math.min,Ho=Math.max,Wo=Math.round,Uo=Math.floor,Go=e=>({x:e,y:e});function Ko(){return"undefined"!=typeof window}function qo(e){return Zo(e)?(e.nodeName||"").toLowerCase():"#document"}function Yo(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Xo(e){var t;return null==(t=(Zo(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function Zo(e){return!!Ko()&&(e instanceof Node||e instanceof Yo(e).Node)}function Qo(e){return!!Ko()&&(e instanceof Element||e instanceof Yo(e).Element)}function Jo(e){return!!Ko()&&(e instanceof HTMLElement||e instanceof Yo(e).HTMLElement)}function ei(e){return!(!Ko()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof Yo(e).ShadowRoot)}function ti(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=ai(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function ni(e){return["table","td","th"].includes(qo(e))}function ri(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function oi(e){const t=ii(),n=Qo(e)?ai(e):e;return["transform","translate","scale","rotate","perspective"].some((e=>!!n[e]&&"none"!==n[e]))||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","translate","scale","rotate","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function ii(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function si(e){return["html","body","#document"].includes(qo(e))}function ai(e){return Yo(e).getComputedStyle(e)}function li(e){return Qo(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ci(e){if("html"===qo(e))return e;const t=e.assignedSlot||e.parentNode||ei(e)&&e.host||Xo(e);return ei(t)?t.host:t}function ui(e){const t=ci(e);return si(t)?e.ownerDocument?e.ownerDocument.body:e.body:Jo(t)&&ti(t)?t:ui(t)}function di(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=ui(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),s=Yo(o);if(i){const e=function(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}(s);return t.concat(s,s.visualViewport||[],ti(o)?o:[],e&&n?di(e):[])}return t.concat(o,di(o,[],n))}function pi(e){const t=ai(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Jo(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=Wo(n)!==i||Wo(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function fi(e){return Qo(e)?e:e.contextElement}function hi(e){const t=fi(e);if(!Jo(t))return Go(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=pi(t);let s=(i?Wo(n.width):n.width)/r,a=(i?Wo(n.height):n.height)/o;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const mi=Go(0);function gi(e){const t=Yo(e);return ii()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:mi}function vi(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=fi(e);let s=Go(1);t&&(r?Qo(r)&&(s=hi(r)):s=hi(e));const a=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==Yo(e))&&t}(i,n,r)?gi(i):Go(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,d=o.height/s.y;if(i){const e=Yo(i),t=r&&Qo(r)?Yo(r):r;let n=e,o=n.frameElement;for(;o&&r&&t!==n;){const e=hi(o),t=o.getBoundingClientRect(),r=ai(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,s=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=i,c+=s,n=Yo(o),o=n.frameElement}}return Lo({width:u,height:d,x:l,y:c})}const bi=[":popover-open",":modal"];function xi(e){return bi.some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function yi(e){return vi(Xo(e)).left+li(e).scrollLeft}function wi(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=Yo(e),r=Xo(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const e=ii();(!e||e&&"fixed"===t)&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}(e,n);else if("document"===t)r=function(e){const t=Xo(e),n=li(e),r=e.ownerDocument.body,o=Ho(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Ho(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+yi(e);const a=-n.scrollTop;return"rtl"===ai(r).direction&&(s+=Ho(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}(Xo(e));else if(Qo(t))r=function(e,t){const n=vi(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Jo(e)?hi(e):Go(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=gi(e);r={...t,x:t.x-n.x,y:t.y-n.y}}return Lo(r)}function _i(e,t){const n=ci(e);return!(n===t||!Qo(n)||si(n))&&("fixed"===ai(n).position||_i(n,t))}function Si(e,t,n){const r=Jo(t),o=Xo(t),i="fixed"===n,s=vi(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=Go(0);if(r||!r&&!i)if(("body"!==qo(t)||ti(o))&&(a=li(t)),r){const e=vi(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&(l.x=yi(o));return{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function Ci(e,t){return Jo(e)&&"fixed"!==ai(e).position?t?t(e):e.offsetParent:null}function ki(e,t){const n=Yo(e);if(!Jo(e)||xi(e))return n;let r=Ci(e,t);for(;r&&ni(r)&&"static"===ai(r).position;)r=Ci(r,t);return r&&("html"===qo(r)||"body"===qo(r)&&"static"===ai(r).position&&!oi(r))?n:r||function(e){let t=ci(e);for(;Jo(t)&&!si(t);){if(oi(t))return t;if(ri(t))return null;t=ci(t)}return null}(e)||n}const ji={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,s=Xo(r),a=!!t&&xi(t.floating);if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=Go(1);const u=Go(0),d=Jo(r);if((d||!d&&!i)&&(("body"!==qo(r)||ti(s))&&(l=li(r)),Jo(r))){const e=vi(r);c=hi(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x,y:n.y*c.y-l.scrollTop*c.y+u.y}},getDocumentElement:Xo,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i="clippingAncestors"===n?function(e,t){const n=t.get(e);if(n)return n;let r=di(e,[],!1).filter((e=>Qo(e)&&"body"!==qo(e))),o=null;const i="fixed"===ai(e).position;let s=i?ci(e):e;for(;Qo(s)&&!si(s);){const t=ai(s),n=oi(s);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||ti(s)&&!n&&_i(e,s))?r=r.filter((e=>e!==s)):o=t,s=ci(s)}return t.set(e,r),r}(t,this._c):[].concat(n),s=[...i,r],a=s[0],l=s.reduce(((e,n)=>{const r=wi(t,n,o);return e.top=Ho(r.top,e.top),e.right=$o(r.right,e.right),e.bottom=$o(r.bottom,e.bottom),e.left=Ho(r.left,e.left),e}),wi(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:ki,getElementRects:async function(e){const t=this.getOffsetParent||ki,n=this.getDimensions;return{reference:Si(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,...await n(e.floating)}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=pi(e);return{width:t,height:n}},getScale:hi,isElement:Qo,isRTL:function(e){return"rtl"===ai(e).direction}};function Ei(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=fi(e),u=o||i?[...c?di(c):[],...di(t)]:[];u.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const d=c&&a?function(e,t){let n,r=null;const o=Xo(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function s(a,l){void 0===a&&(a=!1),void 0===l&&(l=1),i();const{left:c,top:u,width:d,height:p}=e.getBoundingClientRect();if(a||t(),!d||!p)return;const f={rootMargin:-Uo(u)+"px "+-Uo(o.clientWidth-(c+d))+"px "+-Uo(o.clientHeight-(u+p))+"px "+-Uo(c)+"px",threshold:Ho(0,$o(1,l))||1};let h=!0;function m(e){const t=e[0].intersectionRatio;if(t!==l){if(!h)return s();t?s(!1,t):n=setTimeout((()=>{s(!1,1e-7)}),100)}h=!1}try{r=new IntersectionObserver(m,{...f,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(m,f)}r.observe(e)}(!0),i}(c,n):null;let p,f=-1,h=null;s&&(h=new ResizeObserver((e=>{let[r]=e;r&&r.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame((()=>{var e;null==(e=h)||e.observe(t)}))),n()})),c&&!l&&h.observe(c),h.observe(t));let m=l?vi(e):null;return l&&function t(){const r=vi(e);!m||r.x===m.x&&r.y===m.y&&r.width===m.width&&r.height===m.height||n();m=r,p=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach((e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==d||d(),null==(e=h)||e.disconnect(),h=null,l&&cancelAnimationFrame(p)}}const Pi=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Po(e,t),c={x:n,y:r},u=await Bo(t,l),d=Mo(No(o)),p=Io(d);let f=c[p],h=c[d];if(i){const e="y"===p?"bottom":"right";f=Eo(f+u["y"===p?"top":"left"],f,f-u[e])}if(s){const e="y"===d?"bottom":"right";h=Eo(h+u["y"===d?"top":"left"],h,h-u[e])}const m=a.fn({...t,[p]:f,[d]:h});return{...m,data:{x:m.x-n,y:m.y-r}}}}},Ni=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:m=!0,...g}=Po(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const v=No(o),b=No(a)===a,x=await(null==l.isRTL?void 0:l.isRTL(c.floating)),y=p||(b||!m?[zo(a)]:function(e){const t=zo(e);return[Do(e),t,Do(t)]}(a));p||"none"===h||y.push(...function(e,t,n,r){const o=To(e);let i=function(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:s;default:return[]}}(No(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(Do)))),i}(a,m,h,x));const w=[a,...y],_=await Bo(t,g),S=[];let C=(null==(r=i.flip)?void 0:r.overflows)||[];if(u&&S.push(_[v]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=To(e),o=Ao(e),i=Ro(o);let s="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=zo(s)),[s,zo(s)]}(o,s,x);S.push(_[e[0]],_[e[1]])}if(C=[...C,{placement:o,overflows:S}],!S.every((e=>e<=0))){var k,j;const e=((null==(k=i.flip)?void 0:k.index)||0)+1,t=w[e];if(t)return{data:{index:e,overflows:C},reset:{placement:t}};let n=null==(j=C.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:j.placement;if(!n)switch(f){case"bestFit":{var E;const e=null==(E=C.map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:E[0];e&&(n=e);break}case"initialPlacement":n=a}if(o!==n)return{reset:{placement:n}}}return{}}}},Ti=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:i}=t,{apply:s=()=>{},...a}=Po(e,t),l=await Bo(t,a),c=No(n),u=To(n),d="y"===Mo(n),{width:p,height:f}=r.floating;let h,m;"top"===c||"bottom"===c?(h=c,m=u===(await(null==o.isRTL?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(m=c,h="end"===u?"top":"bottom");const g=f-l[h],v=p-l[m],b=!t.middlewareData.shift;let x=g,y=v;if(d){const e=p-l.left-l.right;y=u||b?So(v,e):e}else{const e=f-l.top-l.bottom;x=u||b?So(g,e):e}if(b&&!u){const e=Co(l.left,0),t=Co(l.right,0),n=Co(l.top,0),r=Co(l.bottom,0);d?y=p-2*(0!==e||0!==t?e+t:Co(l.left,l.right)):x=f-2*(0!==n||0!==r?n+r:Co(l.top,l.bottom))}await s({...t,availableWidth:y,availableHeight:x});const w=await o.getDimensions(i.floating);return p!==w.width||f!==w.height?{reset:{rects:!0}}:{}}}},Ii=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=Po(e,t)||{};if(null==c)return{};const d=Oo(u),p={x:n,y:r},f=Ao(o),h=Ro(f),m=await s.getDimensions(c),g="y"===f,v=g?"top":"left",b=g?"bottom":"right",x=g?"clientHeight":"clientWidth",y=i.reference[h]+i.reference[f]-p[f]-i.floating[h],w=p[f]-i.reference[f],_=await(null==s.getOffsetParent?void 0:s.getOffsetParent(c));let S=_?_[x]:0;S&&await(null==s.isElement?void 0:s.isElement(_))||(S=a.floating[x]||i.floating[h]);const C=y/2-w/2,k=S/2-m[h]/2-1,j=So(d[v],k),E=So(d[b],k),P=j,N=S-m[h]-E,T=S/2-m[h]/2+C,I=Eo(P,T,N),R=!l.arrow&&null!=To(o)&&T!=I&&i.reference[h]/2-(Tn&&(f=n)}if(c){var v,b;const e="y"===p?"width":"height",t=["top","left"].includes(No(o)),n=i.reference[d]-i.floating[e]+(t&&(null==(v=s.offset)?void 0:v[d])||0)+(t?0:g.crossAxis),r=i.reference[d]+i.reference[e]+(t?0:(null==(b=s.offset)?void 0:b[d])||0)-(t?g.crossAxis:0);hr&&(h=r)}return{[p]:f,[d]:h}}}},Mi=(e,t,n)=>{const r=new Map,o={platform:ji,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(null==s.isRTL?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=Fo(c,r,l),p=r,f={},h=0;for(let n=0;no})}function Di(e,t){return{contextElement:e||void 0,getBoundingClientRect:()=>{const n=e,r=null==t?void 0:t(n);return r||!n?function(e){if(!e)return Ai();const{x:t,y:n,width:r,height:o}=e;return Ai(t,n,r,o)}(r):n.getBoundingClientRect()}}}function zi(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}function Oi(e){const t=window.devicePixelRatio||1;return Math.round(e*t)/t}function Li(e,t){return Vo((({placement:n})=>{var r;const o=((null==e?void 0:e.clientHeight)||0)/2,i="number"==typeof t.gutter?t.gutter+o:null!=(r=t.gutter)?r:o;return{crossAxis:!!n.split("-")[1]?void 0:t.shift,mainAxis:i,alignmentAxis:t.shift}}))}function Fi(e){if(!1===e.flip)return;const t="string"==typeof e.flip?e.flip.split(" "):void 0;return D(!t||t.every(zi),!1),Ni({padding:e.overflowPadding,fallbackPlacements:t})}function Bi(e){if(e.slide||e.overlap)return Pi({mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding,limiter:Ri()})}function Vi(e){return Ti({padding:e.overflowPadding,apply({elements:t,availableWidth:n,availableHeight:r,rects:o}){const i=t.floating,s=Math.round(o.reference.width);n=Math.floor(n),r=Math.floor(r),i.style.setProperty("--popover-anchor-width",`${s}px`),i.style.setProperty("--popover-available-width",`${n}px`),i.style.setProperty("--popover-available-height",`${r}px`),e.sameWidth&&(i.style.width=`${s}px`),e.fitViewport&&(i.style.maxWidth=`${n}px`,i.style.maxHeight=`${r}px`)}})}function $i(e,t){if(e)return Ii({element:e,padding:t.arrowPadding})}var Hi=jt((function(e){var t=e,{store:n,modal:r=!1,portal:o=!!r,preserveTabOrder:i=!0,autoFocusOnShow:s=!0,wrapperProps:a,fixed:l=!1,flip:c=!0,shift:u=0,slide:d=!0,overlap:p=!1,sameWidth:f=!1,fitViewport:h=!1,gutter:m,arrowPadding:g=4,overflowPadding:y=8,getAnchorRect:w,updatePosition:_}=t,S=x(t,["store","modal","portal","preserveTabOrder","autoFocusOnShow","wrapperProps","fixed","flip","shift","slide","overlap","sameWidth","fitViewport","gutter","arrowPadding","overflowPadding","getAnchorRect","updatePosition"]);const C=mr();D(n=n||C,!1);const k=n.useState("arrowElement"),j=n.useState("anchorElement"),E=n.useState("disclosureElement"),P=n.useState("popoverElement"),N=n.useState("contentElement"),T=n.useState("placement"),I=n.useState("mounted"),R=n.useState("rendered"),M=(0,B.useRef)(null),[A,z]=(0,B.useState)(!1),{portalRef:O,domReady:L}=Ae(o,S.portalRef),F=ke(w),V=ke(_),$=!!_;_e((()=>{if(!(null==P?void 0:P.isConnected))return;P.style.setProperty("--popover-overflow-padding",`${y}px`);const e=Di(j,F),t=async()=>{if(!I)return;k||(M.current=M.current||document.createElement("div"));const t=k||M.current,r=[Li(t,{gutter:m,shift:u}),Fi({flip:c,overflowPadding:y}),Bi({slide:d,shift:u,overlap:p,overflowPadding:y}),$i(t,{arrowPadding:g}),Vi({sameWidth:f,fitViewport:h,overflowPadding:y})],o=await Mi(e,P,{placement:T,strategy:l?"fixed":"absolute",middleware:r});null==n||n.setState("currentPlacement",o.placement),z(!0);const i=Oi(o.x),s=Oi(o.y);if(Object.assign(P.style,{top:"0",left:"0",transform:`translate3d(${i}px,${s}px,0)`}),t&&o.middlewareData.arrow){const{x:e,y:n}=o.middlewareData.arrow,r=o.placement.split("-")[0],i=t.clientWidth/2,s=t.clientHeight/2,a=null!=e?e+i:-i,l=null!=n?n+s:-s;P.style.setProperty("--popover-transform-origin",{top:`${a}px calc(100% + ${s}px)`,bottom:`${a}px ${-s}px`,left:`calc(100% + ${i}px) ${l}px`,right:`${-i}px ${l}px`}[r]),Object.assign(t.style,{left:null!=e?`${e}px`:"",top:null!=n?`${n}px`:"",[r]:"100%"})}},r=Ei(e,P,(async()=>{$?(await V({updatePosition:t}),z(!0)):await t()}),{elementResize:"function"==typeof ResizeObserver});return()=>{z(!1),r()}}),[n,R,P,k,j,P,T,I,L,l,c,u,d,p,f,h,m,g,y,F,$,V]),_e((()=>{if(!I)return;if(!L)return;if(!(null==P?void 0:P.isConnected))return;if(!(null==N?void 0:N.isConnected))return;const e=()=>{P.style.zIndex=getComputedStyle(N).zIndex};e();let t=requestAnimationFrame((()=>{t=requestAnimationFrame(e)}));return()=>cancelAnimationFrame(t)}),[I,L,P,N]);const H=l?"fixed":"absolute";return S=Me(S,(e=>(0,_t.jsx)("div",b(v({},a),{style:v({position:H,top:0,left:0,width:"max-content"},null==a?void 0:a.style),ref:null==n?void 0:n.setPopoverElement,children:e}))),[n,H,a]),S=Me(S,(e=>(0,_t.jsx)(vr,{value:n,children:e})),[n]),S=b(v({"data-placing":!A||void 0},S),{style:v({position:"relative"},S.style)}),S=wo(b(v({store:n,modal:r,portal:o,preserveTabOrder:i,preserveTabOrderAnchor:E||j,autoFocusOnShow:A&&s},S),{portalRef:O}))}));_o(St((function(e){return kt("div",Hi(e))})),mr);function Wi(e,t,n,r){return!!Kt(t)||!!e&&(!!X(t,e)||(!(!n||!X(n,e))||!!(null==r?void 0:r.some((t=>Wi(e,t,n))))))}var Ui=(0,B.createContext)(null),Gi=jt((function(e){var t=e,{store:n,modal:r=!1,portal:o=!!r,hideOnEscape:i=!0,hideOnHoverOutside:s=!0,disablePointerEventsOnApproach:a=!!s}=t,l=x(t,["store","modal","portal","hideOnEscape","hideOnHoverOutside","disablePointerEventsOnApproach"]);const c=xr();D(n=n||c,!1);const u=(0,B.useRef)(null),[d,p]=(0,B.useState)([]),f=(0,B.useRef)(0),h=(0,B.useRef)(null),{portalRef:m,domReady:g}=Ae(o,l.portalRef),y=ze(),w=!!s,_=Re(s),S=!!a,C=Re(a),k=n.useState("open"),j=n.useState("mounted");(0,B.useEffect)((()=>{if(!g)return;if(!j)return;if(!w&&!S)return;const e=u.current;if(!e)return;return M(be("mousemove",(t=>{if(!n)return;if(!y())return;const{anchorElement:r,hideTimeout:o,timeout:i}=n.getState(),s=h.current,[a]=t.composedPath(),l=r;if(Wi(a,e,l,d))return h.current=a&&l&&X(l,a)?Tr(t):null,window.clearTimeout(f.current),void(f.current=0);if(!f.current){if(s){const n=Tr(t);if(Ir(n,Rr(e,s))){if(h.current=n,!C(t))return;return t.preventDefault(),void t.stopPropagation()}}_(t)&&(f.current=window.setTimeout((()=>{f.current=0,null==n||n.hide()}),null!=o?o:i))}}),!0),(()=>clearTimeout(f.current)))}),[n,y,g,j,w,S,d,C,_]),(0,B.useEffect)((()=>{if(!g)return;if(!j)return;if(!S)return;const e=e=>{const t=u.current;if(!t)return;const n=h.current;if(!n)return;const r=Rr(t,n);if(Ir(Tr(e),r)){if(!C(e))return;e.preventDefault(),e.stopPropagation()}};return M(be("mouseenter",e,!0),be("mouseover",e,!0),be("mouseout",e,!0),be("mouseleave",e,!0))}),[g,j,S,C]),(0,B.useEffect)((()=>{g&&(k||null==n||n.setAutoFocusOnShow(!1))}),[n,g,k]);const E=Ce(k);(0,B.useEffect)((()=>{if(g)return()=>{E.current||null==n||n.setAutoFocusOnShow(!1)}}),[n,g]);const P=(0,B.useContext)(Ui);_e((()=>{if(r)return;if(!o)return;if(!j)return;if(!g)return;const e=u.current;return e?null==P?void 0:P(e):void 0}),[r,o,j,g]);const N=(0,B.useCallback)((e=>{p((t=>[...t,e]));const t=null==P?void 0:P(e);return()=>{p((t=>t.filter((t=>t!==e)))),null==t||t()}}),[P]);l=Me(l,(e=>(0,_t.jsx)(wr,{value:n,children:(0,_t.jsx)(Ui.Provider,{value:N,children:e})})),[n,N]),l=b(v({},l),{ref:Ee(u,l.ref)}),l=function(e){var t=e,{store:n}=t,r=x(t,["store"]);const[o,i]=(0,B.useState)(!1),s=n.useState("mounted");(0,B.useEffect)((()=>{s||i(!1)}),[s]);const a=r.onFocus,l=ke((e=>{null==a||a(e),e.defaultPrevented||i(!0)})),c=(0,B.useRef)(null);return(0,B.useEffect)((()=>Ke(n,["anchorElement"],(e=>{c.current=e.anchorElement}))),[]),b(v({autoFocusOnHide:o,finalFocus:c},r),{onFocus:l})}(v({store:n},l));const T=n.useState((e=>r||e.autoFocusOnShow));return l=Hi(b(v({store:n,modal:r,portal:o,autoFocusOnShow:T},l),{portalRef:m,hideOnEscape:e=>!z(i,e)&&(requestAnimationFrame((()=>{requestAnimationFrame((()=>{null==n||n.hide()}))})),!0)}))})),Ki=(_o(St((function(e){return kt("div",Gi(e))})),xr),jt((function(e){var t=e,{store:n,portal:r=!0,gutter:o=8,preserveTabOrder:i=!1,hideOnHoverOutside:s=!0,hideOnInteractOutside:a=!0}=t,l=x(t,["store","portal","gutter","preserveTabOrder","hideOnHoverOutside","hideOnInteractOutside"]);const c=Cr();D(n=n||c,!1),l=Me(l,(e=>(0,_t.jsx)(kr,{value:n,children:e})),[n]);const u=n.useState((e=>"description"===e.type?"tooltip":"none"));return l=v({role:u},l),l=Gi(b(v({},l),{store:n,portal:r,gutter:o,preserveTabOrder:i,hideOnHoverOutside(e){if(z(s,e))return!1;const t=null==n?void 0:n.getState().anchorElement;return!t||!("focusVisible"in t.dataset)},hideOnInteractOutside:e=>{if(z(a,e))return!1;const t=null==n?void 0:n.getState().anchorElement;return!t||!X(t,e.target)}}))}))),qi=_o(St((function(e){return kt("div",Ki(e))})),Cr);const Yi=window.wp.deprecated;var Xi=o.n(Yi);const Zi=function(e){const{shortcut:t,className:n}=e;if(!t)return null;let r,o;return"string"==typeof t&&(r=t),null!==t&&"object"==typeof t&&(r=t.display,o=t.ariaLabel),(0,_t.jsx)("span",{className:n,"aria-label":o,children:r})},Qi={bottom:"bottom",top:"top","middle left":"left","middle right":"right","bottom left":"bottom-end","bottom center":"bottom","bottom right":"bottom-start","top left":"top-end","top center":"top","top right":"top-start","middle left left":"left","middle left right":"left","middle left bottom":"left-end","middle left top":"left-start","middle right left":"right","middle right right":"right","middle right bottom":"right-end","middle right top":"right-start","bottom left left":"bottom-end","bottom left right":"bottom-end","bottom left bottom":"bottom-end","bottom left top":"bottom-end","bottom center left":"bottom","bottom center right":"bottom","bottom center bottom":"bottom","bottom center top":"bottom","bottom right left":"bottom-start","bottom right right":"bottom-start","bottom right bottom":"bottom-start","bottom right top":"bottom-start","top left left":"top-end","top left right":"top-end","top left bottom":"top-end","top left top":"top-end","top center left":"top","top center right":"top","top center bottom":"top","top center top":"top","top right left":"top-start","top right right":"top-start","top right bottom":"top-start","top right top":"top-start",middle:"bottom","middle center":"bottom","middle center bottom":"bottom","middle center left":"bottom","middle center right":"bottom","middle center top":"bottom"},Ji=e=>{var t;return null!==(t=Qi[e])&&void 0!==t?t:"bottom"},es={top:{originX:.5,originY:1},"top-start":{originX:0,originY:1},"top-end":{originX:1,originY:1},right:{originX:0,originY:.5},"right-start":{originX:0,originY:0},"right-end":{originX:0,originY:1},bottom:{originX:.5,originY:0},"bottom-start":{originX:0,originY:0},"bottom-end":{originX:1,originY:0},left:{originX:1,originY:.5},"left-start":{originX:1,originY:0},"left-end":{originX:1,originY:1},overlay:{originX:.5,originY:.5}};const ts=e=>null===e||Number.isNaN(e)?void 0:Math.round(e),ns=(0,c.createContext)({isNestedInTooltip:!1}),rs=700,os={isNestedInTooltip:!0};const is=(0,c.forwardRef)((function(e,t){const{children:n,className:r,delay:o=rs,hideOnClick:i=!0,placement:a,position:u,shortcut:d,text:p,...f}=e,{isNestedInTooltip:h}=(0,c.useContext)(ns),m=(0,l.useInstanceId)(is,"tooltip"),g=p||d?m:void 0,v=1===c.Children.count(n);let b;void 0!==a?b=a:void 0!==u&&(b=Ji(u),Xi()("`position` prop in wp.components.tooltip",{since:"6.4",alternative:"`placement` prop"})),b=b||"bottom";const x=rr({placement:b,showTimeout:o}),y=et(x,"mounted");return h?v?(0,_t.jsx)(or,{...f,render:n}):n:(0,_t.jsxs)(ns.Provider,{value:os,children:[(0,_t.jsx)(Nr,{onClick:i?x.hide:void 0,store:x,render:v?(w=n,g&&y&&void 0===w.props["aria-describedby"]&&w.props["aria-label"]!==p?(0,c.cloneElement)(w,{"aria-describedby":g}):w):void 0,ref:t,children:v?void 0:n}),v&&(p||d)&&(0,_t.jsxs)(qi,{...f,className:s("components-tooltip",r),unmountOnHide:!0,gutter:4,id:g,overflowPadding:.5,store:x,children:[p,d&&(0,_t.jsx)(Zi,{className:p?"components-tooltip__shortcut":"",shortcut:d})]})]});var w})),ss=is;window.wp.warning;var as=o(66),ls=o.n(as),cs=o(7734),us=o.n(cs); /*! * is-plain-object * * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. */ -function es(e){return"[object Object]"===Object.prototype.toString.call(e)}function ts(e){var t,n;return!1!==es(e)&&(void 0===(t=e.constructor)||!1!==es(n=t.prototype)&&!1!==n.hasOwnProperty("isPrototypeOf"))}const ns=function(e,t){const n=(0,c.useRef)(!1);(0,c.useEffect)((()=>{if(n.current)return e();n.current=!0}),t),(0,c.useEffect)((()=>()=>{n.current=!1}),[])},rs=(0,c.createContext)({}),os=()=>(0,c.useContext)(rs);const is=(0,c.memo)((({children:e,value:t})=>{const n=function({value:e}){const t=os(),n=(0,c.useRef)(e);return ns((()=>{Ji()(n.current,e)&&n.current}),[e]),(0,c.useMemo)((()=>Zi()(null!=t?t:{},null!=e?e:{},{isMergeableObject:ts})),[t,e])}({value:t});return(0,wt.jsx)(rs.Provider,{value:n,children:e})})),ss="data-wp-component",as="data-wp-c16t",ls="__contextSystemKey__";var cs=function(){return cs=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0?ks(Ds,--Ms):0,Is--,10===As&&(Is=1,Rs--),As}function Fs(){return As=Ms2||Hs(As)>3?"":" "}function qs(e,t){for(;--t&&Fs()&&!(As<48||As>102||As>57&&As<65||As>70&&As<97););return $s(e,Vs()+(t<6&&32==Bs()&&32==Fs()))}function Ys(e){for(;Fs();)switch(As){case e:return Ms;case 34:case 39:34!==e&&39!==e&&Ys(As);break;case 40:41===e&&Ys(e);break;case 92:Fs()}return Ms}function Xs(e,t){for(;Fs()&&e+As!==57&&(e+As!==84||47!==Bs()););return"/*"+$s(t,Ms-1)+"*"+ys(47===e?e:Fs())}function Zs(e){for(;!Hs(Bs());)Fs();return $s(e,Ms)}var Qs="-ms-",Js="-moz-",ea="-webkit-",ta="comm",na="rule",ra="decl",oa="@keyframes";function ia(e,t){for(var n="",r=Ps(e),o=0;o0&&Es(S)-d&&Ts(f>32?da(S+";",r,n,d-1):da(Ss(S," ","")+";",r,n,d-2),l);break;case 59:S+=";";default:if(Ts(_=ca(S,t,n,c,u,o,a,x,y=[],w=[],d),i),123===b)if(0===u)la(S,t,_,_,y,i,d,a,w);else switch(99===p&&110===ks(S,3)?100:p){case 100:case 109:case 115:la(e,_,_,r&&Ts(ca(e,_,_,0,0,o,a,x,o,y=[],d),w),o,w,d,a,r?y:w);break;default:la(S,_,_,_,[""],w,0,a,w)}}c=u=f=0,m=v=1,x=S="",d=s;break;case 58:d=1+Es(S),f=h;default:if(m<1)if(123==b)--m;else if(125==b&&0==m++&&125==Ls())continue;switch(S+=ys(b),b*m){case 38:v=u>0?1:(S+="\f",-1);break;case 44:a[c++]=(Es(S)-1)*v,v=1;break;case 64:45===Bs()&&(S+=Gs(Fs())),p=Bs(),u=d=Es(x=S+=Zs(Vs())),b++;break;case 45:45===h&&2==Es(S)&&(m=0)}}return i}function ca(e,t,n,r,o,i,s,a,l,c,u){for(var d=o-1,p=0===o?i:[""],f=Ps(p),h=0,m=0,g=0;h0?p[v]+" "+b:Ss(b,/&\f/g,p[v])))&&(l[g++]=x);return Os(e,t,n,0===o?na:a,l,c,u)}function ua(e,t,n){return Os(e,t,n,ta,ys(As),js(e,2,-2),0)}function da(e,t,n,r){return Os(e,t,n,ra,js(e,0,r),js(e,r+1,-1),r)}var pa=function(e,t,n){for(var r=0,o=0;r=o,o=Bs(),38===r&&12===o&&(t[n]=1),!Hs(o);)Fs();return $s(e,Ms)},fa=function(e,t){return Us(function(e,t){var n=-1,r=44;do{switch(Hs(r)){case 0:38===r&&12===Bs()&&(t[n]=1),e[n]+=pa(Ms-1,t,n);break;case 2:e[n]+=Gs(r);break;case 4:if(44===r){e[++n]=58===Bs()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=ys(r)}}while(r=Fs());return e}(Ws(e),t))},ha=new WeakMap,ma=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,n=e.parent,r=e.column===n.column&&e.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||ha.get(n))&&!r){ha.set(e,!0);for(var o=[],i=fa(t,o),s=n.props,a=0,l=0;a6)switch(ks(e,t+1)){case 109:if(45!==ks(e,t+4))break;case 102:return Ss(e,/(.+:)(.+)-([^]+)/,"$1"+ea+"$2-$3$1"+Js+(108==ks(e,t+3)?"$3":"$2-$3"))+e;case 115:return~Cs(e,"stretch")?va(Ss(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==ks(e,t+1))break;case 6444:switch(ks(e,Es(e)-3-(~Cs(e,"!important")&&10))){case 107:return Ss(e,":",":"+ea)+e;case 101:return Ss(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+ea+(45===ks(e,14)?"inline-":"")+"box$3$1"+ea+"$2$3$1"+Qs+"$2box$3")+e}break;case 5936:switch(ks(e,t+11)){case 114:return ea+e+Qs+Ss(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return ea+e+Qs+Ss(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return ea+e+Qs+Ss(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return ea+e+Qs+e+e}return e}var ba=[function(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case ra:e.return=va(e.value,e.length);break;case oa:return ia([zs(e,{value:Ss(e.value,"@","@"+ea)})],r);case na:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,(function(t){switch(function(e,t){return(e=t.exec(e))?e[0]:e}(t,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return ia([zs(e,{props:[Ss(t,/:(read-\w+)/,":-moz-$1")]})],r);case"::placeholder":return ia([zs(e,{props:[Ss(t,/:(plac\w+)/,":"+ea+"input-$1")]}),zs(e,{props:[Ss(t,/:(plac\w+)/,":-moz-$1")]}),zs(e,{props:[Ss(t,/:(plac\w+)/,Qs+"input-$1")]})],r)}return""}))}}];const xa=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,(function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))}))}var r=e.stylisPlugins||ba;var o,i,s={},a=[];o=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),(function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n=4;++r,o-=4)t=1540483477*(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(o){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)};const wa={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function _a(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var Sa=/[A-Z]|^ms/g,Ca=/_EMO_([^_]+?)_([^]*?)_EMO_/g,ka=function(e){return 45===e.charCodeAt(1)},ja=function(e){return null!=e&&"boolean"!=typeof e},Ea=_a((function(e){return ka(e)?e:e.replace(Sa,"-$&").toLowerCase()})),Pa=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(Ca,(function(e,t,n){return Ra={name:t,styles:n,next:Ra},t}))}return 1===wa[e]||ka(e)||"number"!=typeof t||0===t?t:t+"px"};function Ta(e,t,n){if(null==n)return"";if(void 0!==n.__emotion_styles)return n;switch(typeof n){case"boolean":return"";case"object":if(1===n.anim)return Ra={name:n.name,styles:n.styles,next:Ra},n.name;if(void 0!==n.styles){var r=n.next;if(void 0!==r)for(;void 0!==r;)Ra={name:r.name,styles:r.styles,next:Ra},r=r.next;return n.styles+";"}return function(e,t,n){var r="";if(Array.isArray(n))for(var o=0;o{const e=(0,B.useContext)(Da),t=(0,c.useCallback)(((...t)=>{if(null===e)throw new Error("The `useCx` hook should be only used within a valid Emotion Cache Context");return Ka(...t.map((t=>(e=>null!=e&&["name","styles"].every((t=>void 0!==e[t])))(t)?(Va(e,t,!1),`${e.key}-${t.name}`):t)))}),[e]);return t};function Ya(e,t){const n=os(),r=n?.[t]||{},o={[as]:!0,...(i=t,{[ss]:i})};var i;const{_overrides:s,...a}=r,l=Object.entries(a).length?Object.assign({},a,e):e,c=qa()(vs(t),e.className),u="function"==typeof l.renderChildren?l.renderChildren(l):l.children;for(const e in l)o[e]=l[e];for(const e in s)o[e]=s[e];return void 0!==u&&(o.children=u),o.className=c,o}function Xa(e,t){return Qa(e,t,{forwardsRef:!0})}function Za(e,t){return Qa(e,t)}function Qa(e,t,n){const r=n?.forwardsRef?(0,c.forwardRef)(e):e;let o=r[ls]||[t];return Array.isArray(t)&&(o=[...o,...t]),"string"==typeof t&&(o=[...o,t]),Object.assign(r,{[ls]:[...new Set(o)],displayName:t,selector:`.${vs(t)}`})}function Ja(e){if(!e)return[];let t=[];return e[ls]&&(t=e[ls]),e.type&&e.type[ls]&&(t=e.type[ls]),t}function el(e,t){return!!e&&("string"==typeof t?Ja(e).includes(t):!!Array.isArray(t)&&t.some((t=>Ja(e).includes(t))))}const tl={border:0,clip:"rect(1px, 1px, 1px, 1px)",WebkitClipPath:"inset( 50% )",clipPath:"inset( 50% )",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",wordWrap:"normal"};function nl(){return nl=Object.assign?Object.assign.bind():function(e){for(var t=1;t96?ol:il},al=function(e,t,n){var r;if(t){var o=t.shouldForwardProp;r=e.__emotion_forwardProp&&o?function(t){return e.__emotion_forwardProp(t)&&o(t)}:o}return"function"!=typeof r&&n&&(r=e.__emotion_forwardProp),r},ll=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;Ba(t,n,r);Aa((function(){return Va(t,n,r)}));return null};const cl=function e(t,n){var r,o,i=t.__emotion_real===t,s=i&&t.__emotion_base||t;void 0!==n&&(r=n.label,o=n.target);var a=al(t,n,i),l=a||sl(s),c=!l("as");return function(){var u=arguments,d=i&&void 0!==t.__emotion_styles?t.__emotion_styles.slice(0):[];if(void 0!==r&&d.push("label:"+r+";"),null==u[0]||void 0===u[0].raw)d.push.apply(d,u);else{0,d.push(u[0][0]);for(var p=u.length,f=1;fbl("direction:ltr;display:grid;grid-template-columns:repeat( 3, 1fr );grid-template-rows:repeat( 3, 1fr );box-sizing:border-box;width:",e,"px;aspect-ratio:1;border-radius:",Pl.radiusMedium,";outline:none;","");var Rl={name:"e0dnmk",styles:"cursor:pointer"};const Il=cl("div",{target:"e1r95csn3"})(Tl," border:1px solid transparent;",(e=>e.disablePointerEvents?bl("",""):Rl),";"),Nl=cl("div",{target:"e1r95csn2"})({name:"1fbxn64",styles:"grid-column:1/-1;box-sizing:border-box;display:grid;grid-template-columns:repeat( 3, 1fr )"}),Ml=cl("span",{target:"e1r95csn1"})({name:"e2kws5",styles:"position:relative;display:flex;align-items:center;justify-content:center;box-sizing:border-box;margin:0;padding:0;appearance:none;border:none;outline:none"}),Al=cl("span",{target:"e1r95csn0"})("display:block;contain:strict;box-sizing:border-box;width:",6,"px;aspect-ratio:1;margin:auto;color:",kl.theme.gray[400],";border:",3,"px solid currentColor;",Ml,"[data-active-item] &{color:",kl.gray[900],";transform:scale( calc( 5 / 3 ) );}",Ml,":not([data-active-item]):hover &{color:",kl.theme.accent,";}",Ml,"[data-focus-visible] &{outline:1px solid ",kl.theme.accent,";outline-offset:1px;}@media not ( prefers-reduced-motion ){transition-property:color,transform;transition-duration:120ms;transition-timing-function:linear;}");function Dl({id:e,value:t,...n}){return(0,wt.jsx)(Yi,{text:hl[t],children:(0,wt.jsxs)(Dn.Item,{id:e,render:(0,wt.jsx)(Ml,{...n,role:"gridcell"}),children:[(0,wt.jsx)(pl,{children:t}),(0,wt.jsx)(Al,{role:"presentation"})]})})}const Ol=function({className:e,disablePointerEvents:t=!0,size:r,width:o,height:i,style:a={},value:l="center",...c}){var u,d;return(0,wt.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:null!==(u=null!=r?r:o)&&void 0!==u?u:24,height:null!==(d=null!=r?r:i)&&void 0!==d?d:24,role:"presentation",className:s("component-alignment-matrix-control-icon",e),style:{pointerEvents:t?"none":void 0,...a},...c,children:ml.map(((e,t)=>{const r=function(e="center"){const t=gl(e);if(!t)return;const n=ml.indexOf(t);return n>-1?n:void 0}(l)===t?4:2;return(0,wt.jsx)(n.Rect,{x:1.5+t%3*7+(7-r)/2,y:1.5+7*Math.floor(t/3)+(7-r)/2,width:r,height:r,fill:"currentColor"},e)}))})};const zl=Object.assign((function e({className:t,id:n,label:r=(0,a.__)("Alignment Matrix Control"),defaultValue:o="center center",value:i,onChange:u,width:d=92,...p}){const f=(0,l.useInstanceId)(e,"alignment-matrix-control",n),h=(0,c.useCallback)((e=>{const t=function(e,t){const n=t?.replace(e+"-","");return gl(n)}(f,e);t&&u?.(t)}),[f,u]),m=s("component-alignment-matrix-control",t);return(0,wt.jsx)(Dn,{defaultActiveId:vl(f,o),activeId:vl(f,i),setActiveId:h,rtl:(0,a.isRTL)(),render:(0,wt.jsx)(Il,{...p,"aria-label":r,className:m,id:f,role:"grid",size:d}),children:fl.map(((e,t)=>(0,wt.jsx)(Dn.Row,{render:(0,wt.jsx)(Nl,{role:"row"}),children:e.map((e=>(0,wt.jsx)(Dl,{id:vl(f,e),value:e},e)))},t)))})}),{Icon:Object.assign(Ol,{displayName:"AlignmentMatrixControl.Icon"})}),Ll=zl;function Fl(e){return"appear"===e?"top":"left"}function Bl(e){if("loading"===e.type)return"components-animate__loading";const{type:t,origin:n=Fl(t)}=e;if("appear"===t){const[e,t="center"]=n.split(" ");return s("components-animate__appear",{["is-from-"+t]:"center"!==t,["is-from-"+e]:"middle"!==e})}return"slide-in"===t?s("components-animate__slide-in","is-from-"+n):void 0}const Vl=function({type:e,options:t={},children:n}){return n({className:Bl({type:e,...t})})},$l=(0,B.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),Hl=(0,B.createContext)({}),Wl=(0,B.createContext)(null),Ul="undefined"!=typeof document,Gl=Ul?B.useLayoutEffect:B.useEffect,Kl=(0,B.createContext)({strict:!1}),ql=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Yl="data-"+ql("framerAppearId"),Xl=!1,Zl=!1;class Ql{constructor(){this.order=[],this.scheduled=new Set}add(e){if(!this.scheduled.has(e))return this.scheduled.add(e),this.order.push(e),!0}remove(e){const t=this.order.indexOf(e);-1!==t&&(this.order.splice(t,1),this.scheduled.delete(e))}clear(){this.order.length=0,this.scheduled.clear()}}const Jl=["read","resolveKeyframes","update","preRender","render","postRender"];function ec(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},i=Jl.reduce(((e,t)=>(e[t]=function(e){let t=new Ql,n=new Ql,r=0,o=!1,i=!1;const s=new WeakSet,a={schedule:(e,i=!1,a=!1)=>{const l=a&&o,c=l?t:n;return i&&s.add(e),c.add(e)&&l&&o&&(r=t.order.length),e},cancel:e=>{n.remove(e),s.delete(e)},process:l=>{if(o)i=!0;else{if(o=!0,[t,n]=[n,t],n.clear(),r=t.order.length,r)for(let n=0;nn=!0)),e)),{}),s=e=>{i[e].process(o)},a=()=>{const i=Zl?o.timestamp:performance.now();n=!1,o.delta=r?1e3/60:Math.max(Math.min(i-o.timestamp,40),1),o.timestamp=i,o.isProcessing=!0,Jl.forEach(s),o.isProcessing=!1,n&&t&&(r=!1,e(a))};return{schedule:Jl.reduce(((t,s)=>{const l=i[s];return t[s]=(t,i=!1,s=!1)=>(n||(n=!0,r=!0,o.isProcessing||e(a)),l.schedule(t,i,s)),t}),{}),cancel:e=>Jl.forEach((t=>i[t].cancel(e))),state:o,steps:i}}const{schedule:tc,cancel:nc}=ec(queueMicrotask,!1);function rc(e){return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}function oc(e,t,n){return(0,B.useCallback)((r=>{r&&e.mount&&e.mount(r),t&&(r?t.mount(r):t.unmount()),n&&("function"==typeof n?n(r):rc(n)&&(n.current=r))}),[t])}function ic(e){return"string"==typeof e||Array.isArray(e)}function sc(e){return null!==e&&"object"==typeof e&&"function"==typeof e.start}const ac=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],lc=["initial",...ac];function cc(e){return sc(e.animate)||lc.some((t=>ic(e[t])))}function uc(e){return Boolean(cc(e)||e.variants)}function dc(e){const{initial:t,animate:n}=function(e,t){if(cc(e)){const{initial:t,animate:n}=e;return{initial:!1===t||ic(t)?t:void 0,animate:ic(n)?n:void 0}}return!1!==e.inherit?t:{}}(e,(0,B.useContext)(Hl));return(0,B.useMemo)((()=>({initial:t,animate:n})),[pc(t),pc(n)])}function pc(e){return Array.isArray(e)?e.join(" "):e}const fc={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},hc={};for(const e in fc)hc[e]={isEnabled:t=>fc[e].some((e=>!!t[e]))};const mc=(0,B.createContext)({}),gc=(0,B.createContext)({}),vc=Symbol.for("motionComponentSymbol");function bc({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:o}){e&&function(e){for(const t in e)hc[t]={...hc[t],...e[t]}}(e);const i=(0,B.forwardRef)((function(i,s){let a;const l={...(0,B.useContext)($l),...i,layoutId:xc(i)},{isStatic:c}=l,u=dc(i),d=r(i,c);if(!c&&Ul){u.visualElement=function(e,t,n,r){const{visualElement:o}=(0,B.useContext)(Hl),i=(0,B.useContext)(Kl),s=(0,B.useContext)(Wl),a=(0,B.useContext)($l).reducedMotion,l=(0,B.useRef)();r=r||i.renderer,!l.current&&r&&(l.current=r(e,{visualState:t,parent:o,props:n,presenceContext:s,blockInitialAnimation:!!s&&!1===s.initial,reducedMotionConfig:a}));const c=l.current;(0,B.useInsertionEffect)((()=>{c&&c.update(n,s)}));const u=(0,B.useRef)(Boolean(n[Yl]&&!window.HandoffComplete));return Gl((()=>{c&&(tc.render(c.render),u.current&&c.animationState&&c.animationState.animateChanges())})),(0,B.useEffect)((()=>{c&&(c.updateFeatures(),!u.current&&c.animationState&&c.animationState.animateChanges(),u.current&&(u.current=!1,window.HandoffComplete=!0))})),c}(o,d,l,t);const n=(0,B.useContext)(gc),r=(0,B.useContext)(Kl).strict;u.visualElement&&(a=u.visualElement.loadFeatures(l,r,e,n))}return(0,wt.jsxs)(Hl.Provider,{value:u,children:[a&&u.visualElement?(0,wt.jsx)(a,{visualElement:u.visualElement,...l}):null,n(o,i,oc(d,u.visualElement,s),d,c,u.visualElement)]})}));return i[vc]=o,i}function xc({layoutId:e}){const t=(0,B.useContext)(mc).id;return t&&void 0!==e?t+"-"+e:e}function yc(e){function t(t,n={}){return bc(e(t,n))}if("undefined"==typeof Proxy)return t;const n=new Map;return new Proxy(t,{get:(e,r)=>(n.has(r)||n.set(r,t(r)),n.get(r))})}const wc=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function _c(e){return"string"==typeof e&&!e.includes("-")&&!!(wc.indexOf(e)>-1||/[A-Z]/u.test(e))}const Sc={};const Cc=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],kc=new Set(Cc);function jc(e,{layout:t,layoutId:n}){return kc.has(e)||e.startsWith("origin")||(t||void 0!==n)&&(!!Sc[e]||"opacity"===e)}const Ec=e=>Boolean(e&&e.getVelocity),Pc={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Tc=Cc.length;const Rc=e=>t=>"string"==typeof t&&t.startsWith(e),Ic=Rc("--"),Nc=Rc("var(--"),Mc=e=>!!Nc(e)&&Ac.test(e.split("/*")[0].trim()),Ac=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Dc=(e,t)=>t&&"number"==typeof e?t.transform(e):e,Oc=(e,t,n)=>n>t?t:n"number"==typeof e,parse:parseFloat,transform:e=>e},Lc={...zc,transform:e=>Oc(0,1,e)},Fc={...zc,default:1},Bc=e=>Math.round(1e5*e)/1e5,Vc=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,$c=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,Hc=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;function Wc(e){return"string"==typeof e}const Uc=e=>({test:t=>Wc(t)&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}),Gc=Uc("deg"),Kc=Uc("%"),qc=Uc("px"),Yc=Uc("vh"),Xc=Uc("vw"),Zc={...Kc,parse:e=>Kc.parse(e)/100,transform:e=>Kc.transform(100*e)},Qc={...zc,transform:Math.round},Jc={borderWidth:qc,borderTopWidth:qc,borderRightWidth:qc,borderBottomWidth:qc,borderLeftWidth:qc,borderRadius:qc,radius:qc,borderTopLeftRadius:qc,borderTopRightRadius:qc,borderBottomRightRadius:qc,borderBottomLeftRadius:qc,width:qc,maxWidth:qc,height:qc,maxHeight:qc,size:qc,top:qc,right:qc,bottom:qc,left:qc,padding:qc,paddingTop:qc,paddingRight:qc,paddingBottom:qc,paddingLeft:qc,margin:qc,marginTop:qc,marginRight:qc,marginBottom:qc,marginLeft:qc,rotate:Gc,rotateX:Gc,rotateY:Gc,rotateZ:Gc,scale:Fc,scaleX:Fc,scaleY:Fc,scaleZ:Fc,skew:Gc,skewX:Gc,skewY:Gc,distance:qc,translateX:qc,translateY:qc,translateZ:qc,x:qc,y:qc,z:qc,perspective:qc,transformPerspective:qc,opacity:Lc,originX:Zc,originY:Zc,originZ:qc,zIndex:Qc,backgroundPositionX:qc,backgroundPositionY:qc,fillOpacity:Lc,strokeOpacity:Lc,numOctaves:Qc};function eu(e,t,n,r){const{style:o,vars:i,transform:s,transformOrigin:a}=e;let l=!1,c=!1,u=!0;for(const e in t){const n=t[e];if(Ic(e)){i[e]=n;continue}const r=Jc[e],d=Dc(n,r);if(kc.has(e)){if(l=!0,s[e]=d,!u)continue;n!==(r.default||0)&&(u=!1)}else e.startsWith("origin")?(c=!0,a[e]=d):o[e]=d}if(t.transform||(l||r?o.transform=function(e,{enableHardwareAcceleration:t=!0,allowTransformNone:n=!0},r,o){let i="";for(let t=0;t({style:{},transform:{},transformOrigin:{},vars:{}});function nu(e,t,n){for(const r in t)Ec(t[r])||jc(r,n)||(e[r]=t[r])}function ru(e,t,n){const r={};return nu(r,e.style||{},e),Object.assign(r,function({transformTemplate:e},t,n){return(0,B.useMemo)((()=>{const r={style:{},transform:{},transformOrigin:{},vars:{}};return eu(r,t,{enableHardwareAcceleration:!n},e),Object.assign({},r.vars,r.style)}),[t])}(e,t,n)),r}function ou(e,t,n){const r={},o=ru(e,t,n);return e.drag&&!1!==e.dragListener&&(r.draggable=!1,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.touchAction=!0===e.drag?"none":"pan-"+("x"===e.drag?"y":"x")),void 0===e.tabIndex&&(e.onTap||e.onTapStart||e.whileTap)&&(r.tabIndex=0),r.style=o,r}const iu=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function su(e){return e.startsWith("while")||e.startsWith("drag")&&"draggable"!==e||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||iu.has(e)}let au=e=>!su(e);try{(lu=require("@emotion/is-prop-valid").default)&&(au=e=>e.startsWith("on")?!su(e):lu(e))}catch(U){}var lu;function cu(e,t,n){return"string"==typeof e?e:qc.transform(t+n*e)}const uu={offset:"stroke-dashoffset",array:"stroke-dasharray"},du={offset:"strokeDashoffset",array:"strokeDasharray"};function pu(e,{attrX:t,attrY:n,attrScale:r,originX:o,originY:i,pathLength:s,pathSpacing:a=1,pathOffset:l=0,...c},u,d,p){if(eu(e,c,u,p),d)return void(e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox));e.attrs=e.style,e.style={};const{attrs:f,style:h,dimensions:m}=e;f.transform&&(m&&(h.transform=f.transform),delete f.transform),m&&(void 0!==o||void 0!==i||h.transform)&&(h.transformOrigin=function(e,t,n){return`${cu(t,e.x,e.width)} ${cu(n,e.y,e.height)}`}(m,void 0!==o?o:.5,void 0!==i?i:.5)),void 0!==t&&(f.x=t),void 0!==n&&(f.y=n),void 0!==r&&(f.scale=r),void 0!==s&&function(e,t,n=1,r=0,o=!0){e.pathLength=1;const i=o?uu:du;e[i.offset]=qc.transform(-r);const s=qc.transform(t),a=qc.transform(n);e[i.array]=`${s} ${a}`}(f,s,a,l,!1)}const fu=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}}),hu=e=>"string"==typeof e&&"svg"===e.toLowerCase();function mu(e,t,n,r){const o=(0,B.useMemo)((()=>{const n={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return pu(n,t,{enableHardwareAcceleration:!1},hu(r),e.transformTemplate),{...n.attrs,style:{...n.style}}}),[t]);if(e.style){const t={};nu(t,e.style,e),o.style={...t,...o.style}}return o}function gu(e=!1){return(t,n,r,{latestValues:o},i)=>{const s=(_c(t)?mu:ou)(n,o,i,t),a=function(e,t,n){const r={};for(const o in e)"values"===o&&"object"==typeof e.values||(au(o)||!0===n&&su(o)||!t&&!su(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}(n,"string"==typeof t,e),l=t!==B.Fragment?{...a,...s,ref:r}:{},{children:c}=n,u=(0,B.useMemo)((()=>Ec(c)?c.get():c),[c]);return(0,B.createElement)(t,{...l,children:u})}}function vu(e,{style:t,vars:n},r,o){Object.assign(e.style,t,o&&o.getProjectionStyles(r));for(const t in n)e.style.setProperty(t,n[t])}const bu=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function xu(e,t,n,r){vu(e,t,void 0,r);for(const n in t.attrs)e.setAttribute(bu.has(n)?n:ql(n),t.attrs[n])}function yu(e,t,n){var r;const{style:o}=e,i={};for(const s in o)(Ec(o[s])||t.style&&Ec(t.style[s])||jc(s,e)||void 0!==(null===(r=null==n?void 0:n.getValue(s))||void 0===r?void 0:r.liveStyle))&&(i[s]=o[s]);return i}function wu(e,t,n){const r=yu(e,t,n);for(const n in e)if(Ec(e[n])||Ec(t[n])){r[-1!==Cc.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=e[n]}return r}function _u(e){const t=[{},{}];return null==e||e.values.forEach(((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()})),t}function Su(e,t,n,r){if("function"==typeof t){const[o,i]=_u(r);t=t(void 0!==n?n:e.custom,o,i)}if("string"==typeof t&&(t=e.variants&&e.variants[t]),"function"==typeof t){const[o,i]=_u(r);t=t(void 0!==n?n:e.custom,o,i)}return t}function Cu(e){const t=(0,B.useRef)(null);return null===t.current&&(t.current=e()),t.current}const ku=e=>Array.isArray(e),ju=e=>ku(e)?e[e.length-1]||0:e;function Eu(e){const t=Ec(e)?e.get():e;return(e=>Boolean(e&&"object"==typeof e&&e.mix&&e.toValue))(t)?t.toValue():t}const Pu=e=>(t,n)=>{const r=(0,B.useContext)(Hl),o=(0,B.useContext)(Wl),i=()=>function({scrapeMotionValuesFromProps:e,createRenderState:t,onMount:n},r,o,i){const s={latestValues:Tu(r,o,i,e),renderState:t()};return n&&(s.mount=e=>n(r,e,s)),s}(e,t,r,o);return n?i():Cu(i)};function Tu(e,t,n,r){const o={},i=r(e,{});for(const e in i)o[e]=Eu(i[e]);let{initial:s,animate:a}=e;const l=cc(e),c=uc(e);t&&c&&!l&&!1!==e.inherit&&(void 0===s&&(s=t.initial),void 0===a&&(a=t.animate));let u=!!n&&!1===n.initial;u=u||!1===s;const d=u?a:s;if(d&&"boolean"!=typeof d&&!sc(d)){(Array.isArray(d)?d:[d]).forEach((t=>{const n=Su(e,t);if(!n)return;const{transitionEnd:r,transition:i,...s}=n;for(const e in s){let t=s[e];if(Array.isArray(t)){t=t[u?t.length-1:0]}null!==t&&(o[e]=t)}for(const e in r)o[e]=r[e]}))}return o}const Ru=e=>e,{schedule:Iu,cancel:Nu,state:Mu,steps:Au}=ec("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:Ru,!0),Du={useVisualState:Pu({scrapeMotionValuesFromProps:wu,createRenderState:fu,onMount:(e,t,{renderState:n,latestValues:r})=>{Iu.read((()=>{try{n.dimensions="function"==typeof t.getBBox?t.getBBox():t.getBoundingClientRect()}catch(e){n.dimensions={x:0,y:0,width:0,height:0}}})),Iu.render((()=>{pu(n,r,{enableHardwareAcceleration:!1},hu(t.tagName),e.transformTemplate),xu(t,n)}))}})},Ou={useVisualState:Pu({scrapeMotionValuesFromProps:yu,createRenderState:tu})};function zu(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const Lu=e=>"mouse"===e.pointerType?"number"!=typeof e.button||e.button<=0:!1!==e.isPrimary;function Fu(e,t="page"){return{point:{x:e[`${t}X`],y:e[`${t}Y`]}}}function Bu(e,t,n,r){return zu(e,t,(e=>t=>Lu(t)&&e(t,Fu(t)))(n),r)}const Vu=(e,t)=>n=>t(e(n)),$u=(...e)=>e.reduce(Vu);function Hu(e){let t=null;return()=>{const n=()=>{t=null};return null===t&&(t=e,n)}}const Wu=Hu("dragHorizontal"),Uu=Hu("dragVertical");function Gu(e){let t=!1;if("y"===e)t=Uu();else if("x"===e)t=Wu();else{const e=Wu(),n=Uu();e&&n?t=()=>{e(),n()}:(e&&e(),n&&n())}return t}function Ku(){const e=Gu(!0);return!e||(e(),!1)}class qu{constructor(e){this.isMounted=!1,this.node=e}update(){}}function Yu(e,t){const n=t?"pointerenter":"pointerleave",r=t?"onHoverStart":"onHoverEnd";return Bu(e.current,n,((n,o)=>{if("touch"===n.pointerType||Ku())return;const i=e.getProps();e.animationState&&i.whileHover&&e.animationState.setActive("whileHover",t);const s=i[r];s&&Iu.postRender((()=>s(n,o)))}),{passive:!e.getProps()[r]})}const Xu=(e,t)=>!!t&&(e===t||Xu(e,t.parentElement));function Zu(e,t){if(!t)return;const n=new PointerEvent("pointer"+e);t(n,Fu(n))}const Qu=new WeakMap,Ju=new WeakMap,ed=e=>{const t=Qu.get(e.target);t&&t(e)},td=e=>{e.forEach(ed)};function nd(e,t,n){const r=function({root:e,...t}){const n=e||document;Ju.has(n)||Ju.set(n,{});const r=Ju.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(td,{root:e,...t})),r[o]}(t);return Qu.set(e,n),r.observe(e),()=>{Qu.delete(e),r.unobserve(e)}}const rd={some:0,all:1};const od={inView:{Feature:class extends qu{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r="some",once:o}=e,i={root:t?t.current:void 0,rootMargin:n,threshold:"number"==typeof r?r:rd[r]};return nd(this.node.current,i,(e=>{const{isIntersecting:t}=e;if(this.isInView===t)return;if(this.isInView=t,o&&!t&&this.hasEnteredView)return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",t);const{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),i=t?n:r;i&&i(e)}))}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:e,prevProps:t}=this.node;["amount","margin","root"].some(function({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}(e,t))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends qu{constructor(){super(...arguments),this.removeStartListeners=Ru,this.removeEndListeners=Ru,this.removeAccessibleListeners=Ru,this.startPointerPress=(e,t)=>{if(this.isPressing)return;this.removeEndListeners();const n=this.node.getProps(),r=Bu(window,"pointerup",((e,t)=>{if(!this.checkPressEnd())return;const{onTap:n,onTapCancel:r,globalTapTarget:o}=this.node.getProps(),i=o||Xu(this.node.current,e.target)?n:r;i&&Iu.update((()=>i(e,t)))}),{passive:!(n.onTap||n.onPointerUp)}),o=Bu(window,"pointercancel",((e,t)=>this.cancelPress(e,t)),{passive:!(n.onTapCancel||n.onPointerCancel)});this.removeEndListeners=$u(r,o),this.startPress(e,t)},this.startAccessiblePress=()=>{const e=zu(this.node.current,"keydown",(e=>{if("Enter"!==e.key||this.isPressing)return;this.removeEndListeners(),this.removeEndListeners=zu(this.node.current,"keyup",(e=>{"Enter"===e.key&&this.checkPressEnd()&&Zu("up",((e,t)=>{const{onTap:n}=this.node.getProps();n&&Iu.postRender((()=>n(e,t)))}))})),Zu("down",((e,t)=>{this.startPress(e,t)}))})),t=zu(this.node.current,"blur",(()=>{this.isPressing&&Zu("cancel",((e,t)=>this.cancelPress(e,t)))}));this.removeAccessibleListeners=$u(e,t)}}startPress(e,t){this.isPressing=!0;const{onTapStart:n,whileTap:r}=this.node.getProps();r&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),n&&Iu.postRender((()=>n(e,t)))}checkPressEnd(){this.removeEndListeners(),this.isPressing=!1;return this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!Ku()}cancelPress(e,t){if(!this.checkPressEnd())return;const{onTapCancel:n}=this.node.getProps();n&&Iu.postRender((()=>n(e,t)))}mount(){const e=this.node.getProps(),t=Bu(e.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(e.onTapStart||e.onPointerStart)}),n=zu(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=$u(t,n)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}},focus:{Feature:class extends qu{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch(t){e=!0}e&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=$u(zu(this.node.current,"focus",(()=>this.onFocus())),zu(this.node.current,"blur",(()=>this.onBlur())))}unmount(){}}},hover:{Feature:class extends qu{mount(){this.unmount=$u(Yu(this.node,!0),Yu(this.node,!1))}unmount(){}}}};function id(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r1e3*e,ld=e=>e/1e3,cd={type:"spring",stiffness:500,damping:25,restSpeed:10},ud={type:"keyframes",duration:.8},dd={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},pd=(e,{keyframes:t})=>t.length>2?ud:kc.has(e)?e.startsWith("scale")?{type:"spring",stiffness:550,damping:0===t[1]?2*Math.sqrt(550):30,restSpeed:10}:cd:dd;function fd(e,t){return e[t]||e.default||e}const hd=!1,md=e=>null!==e;function gd(e,{repeat:t,repeatType:n="loop"},r){const o=e.filter(md),i=t&&"loop"!==n&&t%2==1?0:o.length-1;return i&&void 0!==r?r:o[i]}let vd;function bd(){vd=void 0}const xd={now:()=>(void 0===vd&&xd.set(Mu.isProcessing||Zl?Mu.timestamp:performance.now()),vd),set:e=>{vd=e,queueMicrotask(bd)}},yd=e=>/^0[^.\s]+$/u.test(e);let wd=Ru,_d=Ru;const Sd=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Cd=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function kd(e,t,n=1){_d(n<=4,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[r,o]=function(e){const t=Cd.exec(e);if(!t)return[,];const[,n,r,o]=t;return[`--${null!=n?n:r}`,o]}(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const e=i.trim();return Sd(e)?parseFloat(e):e}return Mc(o)?kd(o,t,n+1):o}const jd=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),Ed=e=>e===zc||e===qc,Pd=(e,t)=>parseFloat(e.split(", ")[t]),Td=(e,t)=>(n,{transform:r})=>{if("none"===r||!r)return 0;const o=r.match(/^matrix3d\((.+)\)$/u);if(o)return Pd(o[1],t);{const t=r.match(/^matrix\((.+)\)$/u);return t?Pd(t[1],e):0}},Rd=new Set(["x","y","z"]),Id=Cc.filter((e=>!Rd.has(e)));const Nd={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:Td(4,13),y:Td(5,14)};Nd.translateX=Nd.x,Nd.translateY=Nd.y;const Md=e=>t=>t.test(e),Ad=[zc,qc,Kc,Gc,Xc,Yc,{test:e=>"auto"===e,parse:e=>e}],Dd=e=>Ad.find(Md(e)),Od=new Set;let zd=!1,Ld=!1;function Fd(){if(Ld){const e=Array.from(Od).filter((e=>e.needsMeasurement)),t=new Set(e.map((e=>e.element))),n=new Map;t.forEach((e=>{const t=function(e){const t=[];return Id.forEach((n=>{const r=e.getValue(n);void 0!==r&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))})),t}(e);t.length&&(n.set(e,t),e.render())})),e.forEach((e=>e.measureInitialState())),t.forEach((e=>{e.render();const t=n.get(e);t&&t.forEach((([t,n])=>{var r;null===(r=e.getValue(t))||void 0===r||r.set(n)}))})),e.forEach((e=>e.measureEndState())),e.forEach((e=>{void 0!==e.suspendedScrollY&&window.scrollTo(0,e.suspendedScrollY)}))}Ld=!1,zd=!1,Od.forEach((e=>e.complete())),Od.clear()}function Bd(){Od.forEach((e=>{e.readKeyframes(),e.needsMeasurement&&(Ld=!0)}))}class Vd{constructor(e,t,n,r,o,i=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=o,this.isAsync=i}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Od.add(this),zd||(zd=!0,Iu.read(Bd),Iu.resolveKeyframes(Fd))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;for(let o=0;on=>Boolean(Wc(n)&&Hc.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t)),Hd=(e,t,n)=>r=>{if(!Wc(r))return r;const[o,i,s,a]=r.match(Vc);return{[e]:parseFloat(o),[t]:parseFloat(i),[n]:parseFloat(s),alpha:void 0!==a?parseFloat(a):1}},Wd={...zc,transform:e=>Math.round((e=>Oc(0,255,e))(e))},Ud={test:$d("rgb","red"),parse:Hd("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Wd.transform(e)+", "+Wd.transform(t)+", "+Wd.transform(n)+", "+Bc(Lc.transform(r))+")"};const Gd={test:$d("#"),parse:function(e){let t="",n="",r="",o="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),o=e.substring(4,5),t+=t,n+=n,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}},transform:Ud.transform},Kd={test:$d("hsl","hue"),parse:Hd("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Kc.transform(Bc(t))+", "+Kc.transform(Bc(n))+", "+Bc(Lc.transform(r))+")"},qd={test:e=>Ud.test(e)||Gd.test(e)||Kd.test(e),parse:e=>Ud.test(e)?Ud.parse(e):Kd.test(e)?Kd.parse(e):Gd.parse(e),transform:e=>Wc(e)?e:e.hasOwnProperty("red")?Ud.transform(e):Kd.transform(e)};const Yd="number",Xd="color",Zd=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Qd(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},o=[];let i=0;const s=t.replace(Zd,(e=>(qd.test(e)?(r.color.push(i),o.push(Xd),n.push(qd.parse(e))):e.startsWith("var(")?(r.var.push(i),o.push("var"),n.push(e)):(r.number.push(i),o.push(Yd),n.push(parseFloat(e))),++i,"${}"))).split("${}");return{values:n,split:s,indexes:r,types:o}}function Jd(e){return Qd(e).values}function ep(e){const{split:t,types:n}=Qd(e),r=t.length;return e=>{let o="";for(let i=0;i"number"==typeof e?0:e;const np={test:function(e){var t,n;return isNaN(e)&&Wc(e)&&((null===(t=e.match(Vc))||void 0===t?void 0:t.length)||0)+((null===(n=e.match($c))||void 0===n?void 0:n.length)||0)>0},parse:Jd,createTransformer:ep,getAnimatableNone:function(e){const t=Jd(e);return ep(e)(t.map(tp))}},rp=new Set(["brightness","contrast","saturate","opacity"]);function op(e){const[t,n]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;const[r]=n.match(Vc)||[];if(!r)return e;const o=n.replace(r,"");let i=rp.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+o+")"}const ip=/\b([a-z-]*)\(.*?\)/gu,sp={...np,getAnimatableNone:e=>{const t=e.match(ip);return t?t.map(op).join(" "):e}},ap={...Jc,color:qd,backgroundColor:qd,outlineColor:qd,fill:qd,stroke:qd,borderColor:qd,borderTopColor:qd,borderRightColor:qd,borderBottomColor:qd,borderLeftColor:qd,filter:sp,WebkitFilter:sp},lp=e=>ap[e];function cp(e,t){let n=lp(e);return n!==sp&&(n=np),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const up=new Set(["auto","none","0"]);class dp extends Vd{constructor(e,t,n,r){super(e,t,n,r,null==r?void 0:r.owner,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:t,name:n}=this;if(!t.current)return;super.readKeyframes();for(let n=0;n{t.getValue(e).set(n)})),this.resolveNoneKeyframes()}}const pp=(e,t)=>"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!np.test(e)&&"0"!==e||e.startsWith("url(")));class fp{constructor({autoplay:e=!0,delay:t=0,type:n="keyframes",repeat:r=0,repeatDelay:o=0,repeatType:i="loop",...s}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.options={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:o,repeatType:i,...s},this.updateFinishedPromise()}get resolved(){return this._resolved||this.hasAttemptedResolve||(Bd(),Fd()),this._resolved}onKeyframesResolved(e,t){this.hasAttemptedResolve=!0;const{name:n,type:r,velocity:o,delay:i,onComplete:s,onUpdate:a,isGenerator:l}=this.options;if(!l&&!function(e,t,n,r){const o=e[0];if(null===o)return!1;if("display"===t||"visibility"===t)return!0;const i=e[e.length-1],s=pp(o,t),a=pp(i,t);return wd(s===a,`You are trying to animate ${t} from "${o}" to "${i}". ${o} is not an animatable value - to enable this animation set ${o} to a value animatable to ${i} via the \`style\` property.`),!(!s||!a)&&(function(e){const t=e[0];if(1===e.length)return!0;for(let n=0;n{this.resolveFinishedPromise=e}))}}function hp(e,t){return t?e*(1e3/t):0}function mp(e,t,n){const r=Math.max(t-5,0);return hp(n-e(r),t-r)}const gp=.001;function vp({duration:e=800,bounce:t=.25,velocity:n=0,mass:r=1}){let o,i;wd(e<=ad(10),"Spring duration must be 10 seconds or less");let s=1-t;s=Oc(.05,1,s),e=Oc(.01,10,ld(e)),s<1?(o=t=>{const r=t*s,o=r*e,i=r-n,a=xp(t,s),l=Math.exp(-o);return gp-i/a*l},i=t=>{const r=t*s*e,i=r*n+n,a=Math.pow(s,2)*Math.pow(t,2)*e,l=Math.exp(-r),c=xp(Math.pow(t,2),s);return(-o(t)+gp>0?-1:1)*((i-a)*l)/c}):(o=t=>Math.exp(-t*e)*((t-n)*e+1)-.001,i=t=>Math.exp(-t*e)*(e*e*(n-t)));const a=function(e,t,n){let r=n;for(let n=1;nvoid 0!==e[t]))}function Sp({keyframes:e,restDelta:t,restSpeed:n,...r}){const o=e[0],i=e[e.length-1],s={done:!1,value:o},{stiffness:a,damping:l,mass:c,duration:u,velocity:d,isResolvedFromDuration:p}=function(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!_p(e,wp)&&_p(e,yp)){const n=vp(e);t={...t,...n,mass:1},t.isResolvedFromDuration=!0}return t}({...r,velocity:-ld(r.velocity||0)}),f=d||0,h=l/(2*Math.sqrt(a*c)),m=i-o,g=ld(Math.sqrt(a/c)),v=Math.abs(m)<5;let b;if(n||(n=v?.01:2),t||(t=v?.005:.5),h<1){const e=xp(g,h);b=t=>{const n=Math.exp(-h*g*t);return i-n*((f+h*g*m)/e*Math.sin(e*t)+m*Math.cos(e*t))}}else if(1===h)b=e=>i-Math.exp(-g*e)*(m+(f+g*m)*e);else{const e=g*Math.sqrt(h*h-1);b=t=>{const n=Math.exp(-h*g*t),r=Math.min(e*t,300);return i-n*((f+h*g*m)*Math.sinh(r)+e*m*Math.cosh(r))/e}}return{calculatedDuration:p&&u||null,next:e=>{const r=b(e);if(p)s.done=e>=u;else{let o=f;0!==e&&(o=h<1?mp(b,e,r):0);const a=Math.abs(o)<=n,l=Math.abs(i-r)<=t;s.done=a&&l}return s.value=s.done?i:r,s}}}function Cp({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:i=500,modifyTarget:s,min:a,max:l,restDelta:c=.5,restSpeed:u}){const d=e[0],p={done:!1,value:d},f=e=>void 0===a?l:void 0===l||Math.abs(a-e)-h*Math.exp(-e/r),b=e=>g+v(e),x=e=>{const t=v(e),n=b(e);p.done=Math.abs(t)<=c,p.value=p.done?g:n};let y,w;const _=e=>{(e=>void 0!==a&&el)(p.value)&&(y=e,w=Sp({keyframes:[p.value,f(p.value)],velocity:mp(b,e,p.value),damping:o,stiffness:i,restDelta:c,restSpeed:u}))};return _(0),{calculatedDuration:null,next:e=>{let t=!1;return w||void 0!==y||(t=!0,x(e),_(e)),void 0!==y&&e>=y?w.next(e-y):(!t&&x(e),p)}}}const kp=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e;function jp(e,t,n,r){if(e===t&&n===r)return Ru;const o=t=>function(e,t,n,r,o){let i,s,a=0;do{s=t+(n-t)/2,i=kp(s,r,o)-e,i>0?n=s:t=s}while(Math.abs(i)>1e-7&&++a<12);return s}(t,0,1,e,n);return e=>0===e||1===e?e:kp(o(e),t,r)}const Ep=jp(.42,0,1,1),Pp=jp(0,0,.58,1),Tp=jp(.42,0,.58,1),Rp=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Ip=e=>t=>1-e(1-t),Np=e=>1-Math.sin(Math.acos(e)),Mp=Ip(Np),Ap=Rp(Np),Dp=jp(.33,1.53,.69,.99),Op=Ip(Dp),zp=Rp(Op),Lp={linear:Ru,easeIn:Ep,easeInOut:Tp,easeOut:Pp,circIn:Np,circInOut:Ap,circOut:Mp,backIn:Op,backInOut:zp,backOut:Dp,anticipate:e=>(e*=2)<1?.5*Op(e):.5*(2-Math.pow(2,-10*(e-1)))},Fp=e=>{if(Array.isArray(e)){_d(4===e.length,"Cubic bezier arrays must contain four numerical values.");const[t,n,r,o]=e;return jp(t,n,r,o)}return"string"==typeof e?(_d(void 0!==Lp[e],`Invalid easing type '${e}'`),Lp[e]):e},Bp=(e,t,n)=>{const r=t-e;return 0===r?1:(n-e)/r},Vp=(e,t,n)=>e+(t-e)*n;function $p(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}const Hp=(e,t,n)=>{const r=e*e,o=n*(t*t-r)+r;return o<0?0:Math.sqrt(o)},Wp=[Gd,Ud,Kd];function Up(e){const t=(e=>Wp.find((t=>t.test(e))))(e);_d(Boolean(t),`'${e}' is not an animatable color. Use the equivalent color code instead.`);let n=t.parse(e);return t===Kd&&(n=function({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,n/=100;let o=0,i=0,s=0;if(t/=100){const r=n<.5?n*(1+t):n+t-n*t,a=2*n-r;o=$p(a,r,e+1/3),i=$p(a,r,e),s=$p(a,r,e-1/3)}else o=i=s=n;return{red:Math.round(255*o),green:Math.round(255*i),blue:Math.round(255*s),alpha:r}}(n)),n}const Gp=(e,t)=>{const n=Up(e),r=Up(t),o={...n};return e=>(o.red=Hp(n.red,r.red,e),o.green=Hp(n.green,r.green,e),o.blue=Hp(n.blue,r.blue,e),o.alpha=Vp(n.alpha,r.alpha,e),Ud.transform(o))},Kp=new Set(["none","hidden"]);function qp(e,t){return n=>n>0?t:e}function Yp(e,t){return n=>Vp(e,t,n)}function Xp(e){return"number"==typeof e?Yp:"string"==typeof e?Mc(e)?qp:qd.test(e)?Gp:Jp:Array.isArray(e)?Zp:"object"==typeof e?qd.test(e)?Gp:Qp:qp}function Zp(e,t){const n=[...e],r=n.length,o=e.map(((e,n)=>Xp(e)(e,t[n])));return e=>{for(let t=0;t{for(const t in r)n[t]=r[t](e);return n}}const Jp=(e,t)=>{const n=np.createTransformer(t),r=Qd(e),o=Qd(t);return r.indexes.var.length===o.indexes.var.length&&r.indexes.color.length===o.indexes.color.length&&r.indexes.number.length>=o.indexes.number.length?Kp.has(e)&&!o.values.length||Kp.has(t)&&!r.values.length?function(e,t){return Kp.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}(e,t):$u(Zp(function(e,t){var n;const r=[],o={color:0,var:0,number:0};for(let i=0;it[0];if(2===i&&e[0]===e[1])return()=>t[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const s=function(e,t,n){const r=[],o=n||ef,i=e.length-1;for(let n=0;n{let n=0;if(a>1)for(;nl(Oc(e[0],e[i-1],t)):l}function nf(e){const t=[0];return function(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const o=Bp(0,t,r);e.push(Vp(n,1,o))}}(t,e.length-1),t}function rf({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const o=(e=>Array.isArray(e)&&"number"!=typeof e[0])(r)?r.map(Fp):Fp(r),i={done:!1,value:t[0]},s=function(e,t){return e.map((e=>e*t))}(n&&n.length===t.length?n:nf(t),e),a=tf(s,t,{ease:Array.isArray(o)?o:(l=t,c=o,l.map((()=>c||Tp)).splice(0,l.length-1))});var l,c;return{calculatedDuration:e,next:t=>(i.value=a(t),i.done=t>=e,i)}}const of=e=>{const t=({timestamp:t})=>e(t);return{start:()=>Iu.update(t,!0),stop:()=>Nu(t),now:()=>Mu.isProcessing?Mu.timestamp:xd.now()}},sf={decay:Cp,inertia:Cp,tween:rf,keyframes:rf,spring:Sp},af=e=>e/100;class lf extends fp{constructor({KeyframeResolver:e=Vd,...t}){super(t),this.holdTime=null,this.startTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.teardown();const{onStop:e}=this.options;e&&e()};const{name:n,motionValue:r,keyframes:o}=this.options,i=(e,t)=>this.onKeyframesResolved(e,t);n&&r&&r.owner?this.resolver=r.owner.resolveKeyframes(o,i,n,r):this.resolver=new e(o,i,n,r),this.resolver.scheduleResolve()}initPlayback(e){const{type:t="keyframes",repeat:n=0,repeatDelay:r=0,repeatType:o,velocity:i=0}=this.options,s=sf[t]||rf;let a,l;s!==rf&&"number"!=typeof e[0]&&(a=$u(af,ef(e[0],e[1])),e=[0,100]);const c=s({...this.options,keyframes:e});"mirror"===o&&(l=s({...this.options,keyframes:[...e].reverse(),velocity:-i})),null===c.calculatedDuration&&(c.calculatedDuration=function(e){let t=0,n=e.next(t);for(;!n.done&&t<2e4;)t+=50,n=e.next(t);return t>=2e4?1/0:t}(c));const{calculatedDuration:u}=c,d=u+r;return{generator:c,mirroredGenerator:l,mapPercentToKeyframes:a,calculatedDuration:u,resolvedDuration:d,totalDuration:d*(n+1)-r}}onPostResolved(){const{autoplay:e=!0}=this.options;this.play(),"paused"!==this.pendingPlayState&&e?this.state=this.pendingPlayState:this.pause()}tick(e,t=!1){const{resolved:n}=this;if(!n){const{keyframes:e}=this.options;return{done:!0,value:e[e.length-1]}}const{finalKeyframe:r,generator:o,mirroredGenerator:i,mapPercentToKeyframes:s,keyframes:a,calculatedDuration:l,totalDuration:c,resolvedDuration:u}=n;if(null===this.startTime)return o.next(0);const{delay:d,repeat:p,repeatType:f,repeatDelay:h,onUpdate:m}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-c/this.speed,this.startTime)),t?this.currentTime=e:null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=Math.round(e-this.startTime)*this.speed;const g=this.currentTime-d*(this.speed>=0?1:-1),v=this.speed>=0?g<0:g>c;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=c);let b=this.currentTime,x=o;if(p){const e=Math.min(this.currentTime,c)/u;let t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),1===n&&t--,t=Math.min(t,p+1);Boolean(t%2)&&("reverse"===f?(n=1-n,h&&(n-=h/u)):"mirror"===f&&(x=i)),b=Oc(0,1,n)*u}const y=v?{done:!1,value:a[0]}:x.next(b);s&&(y.value=s(y.value));let{done:w}=y;v||null===l||(w=this.speed>=0?this.currentTime>=c:this.currentTime<=0);const _=null===this.holdTime&&("finished"===this.state||"running"===this.state&&w);return _&&void 0!==r&&(y.value=gd(a,this.options,r)),m&&m(y.value),_&&this.finish(),y}get duration(){const{resolved:e}=this;return e?ld(e.calculatedDuration):0}get time(){return ld(this.currentTime)}set time(e){e=ad(e),this.currentTime=e,null!==this.holdTime||0===this.speed?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.speed)}get speed(){return this.playbackSpeed}set speed(e){const t=this.playbackSpeed!==e;this.playbackSpeed=e,t&&(this.time=ld(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved)return void(this.pendingPlayState="running");if(this.isStopped)return;const{driver:e=of,onPlay:t}=this.options;this.driver||(this.driver=e((e=>this.tick(e)))),t&&t();const n=this.driver.now();null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime&&"finished"!==this.state||(this.startTime=n),"finished"===this.state&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var e;this._resolved?(this.state="paused",this.holdTime=null!==(e=this.currentTime)&&void 0!==e?e:0):this.pendingPlayState="paused"}complete(){"running"!==this.state&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:e}=this.options;e&&e()}cancel(){null!==this.cancelTime&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}}const cf=e=>Array.isArray(e)&&"number"==typeof e[0];function uf(e){return Boolean(!e||"string"==typeof e&&e in pf||cf(e)||Array.isArray(e)&&e.every(uf))}const df=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,pf={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:df([0,.65,.55,1]),circOut:df([.55,0,1,.45]),backIn:df([.31,.01,.66,-.59]),backOut:df([.33,1.53,.69,.99])};function ff(e){return hf(e)||pf.easeOut}function hf(e){return e?cf(e)?df(e):Array.isArray(e)?e.map(ff):pf[e]:void 0}const mf=function(e){let t;return()=>(void 0===t&&(t=e()),t)}((()=>Object.hasOwnProperty.call(Element.prototype,"animate"))),gf=new Set(["opacity","clipPath","filter","transform"]);class vf extends fp{constructor(e){super(e);const{name:t,motionValue:n,keyframes:r}=this.options;this.resolver=new dp(r,((e,t)=>this.onKeyframesResolved(e,t)),t,n),this.resolver.scheduleResolve()}initPlayback(e,t){var n;let{duration:r=300,times:o,ease:i,type:s,motionValue:a,name:l}=this.options;if(!(null===(n=a.owner)||void 0===n?void 0:n.current))return!1;if(function(e){return"spring"===e.type||"backgroundColor"===e.name||!uf(e.ease)}(this.options)){const{onComplete:t,onUpdate:n,motionValue:a,...l}=this.options,c=function(e,t){const n=new lf({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const o=[];let i=0;for(;!r.done&&i<2e4;)r=n.sample(i),o.push(r.value),i+=10;return{times:void 0,keyframes:o,duration:i-10,ease:"linear"}}(e,l);1===(e=c.keyframes).length&&(e[1]=e[0]),r=c.duration,o=c.times,i=c.ease,s="keyframes"}const c=function(e,t,n,{delay:r=0,duration:o=300,repeat:i=0,repeatType:s="loop",ease:a,times:l}={}){const c={[t]:n};l&&(c.offset=l);const u=hf(a);return Array.isArray(u)&&(c.easing=u),e.animate(c,{delay:r,duration:o,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:i+1,direction:"reverse"===s?"alternate":"normal"})}(a.owner.current,l,e,{...this.options,duration:r,times:o,ease:i});return c.startTime=xd.now(),this.pendingTimeline?(c.timeline=this.pendingTimeline,this.pendingTimeline=void 0):c.onfinish=()=>{const{onComplete:n}=this.options;a.set(gd(e,this.options,t)),n&&n(),this.cancel(),this.resolveFinishedPromise()},{animation:c,duration:r,times:o,type:s,ease:i,keyframes:e}}get duration(){const{resolved:e}=this;if(!e)return 0;const{duration:t}=e;return ld(t)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:t}=e;return ld(t.currentTime||0)}set time(e){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.currentTime=ad(e)}get speed(){const{resolved:e}=this;if(!e)return 1;const{animation:t}=e;return t.playbackRate}set speed(e){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playbackRate=e}get state(){const{resolved:e}=this;if(!e)return"idle";const{animation:t}=e;return t.playState}attachTimeline(e){if(this._resolved){const{resolved:t}=this;if(!t)return Ru;const{animation:n}=t;n.timeline=e,n.onfinish=null}else this.pendingTimeline=e;return Ru}play(){if(this.isStopped)return;const{resolved:e}=this;if(!e)return;const{animation:t}=e;"finished"===t.playState&&this.updateFinishedPromise(),t.play()}pause(){const{resolved:e}=this;if(!e)return;const{animation:t}=e;t.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;const{resolved:e}=this;if(!e)return;const{animation:t,keyframes:n,duration:r,type:o,ease:i,times:s}=e;if("idle"!==t.playState&&"finished"!==t.playState){if(this.time){const{motionValue:e,onUpdate:t,onComplete:a,...l}=this.options,c=new lf({...l,keyframes:n,duration:r,type:o,ease:i,times:s,isGenerator:!0}),u=ad(this.time);e.setWithVelocity(c.sample(u-10).value,c.sample(u).value,10)}this.cancel()}}complete(){const{resolved:e}=this;e&&e.animation.finish()}cancel(){const{resolved:e}=this;e&&e.animation.cancel()}static supports(e){const{motionValue:t,name:n,repeatDelay:r,repeatType:o,damping:i,type:s}=e;return mf()&&n&&gf.has(n)&&t&&t.owner&&t.owner.current instanceof HTMLElement&&!t.owner.getProps().onUpdate&&!r&&"mirror"!==o&&0!==i&&"inertia"!==s}}const bf=(e,t,n,r={},o,i)=>s=>{const a=fd(r,e)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c-=ad(l);let u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:e=>{t.set(e),a.onUpdate&&a.onUpdate(e)},onComplete:()=>{s(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:i?void 0:o};(function({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:o,repeat:i,repeatType:s,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length})(a)||(u={...u,...pd(e,u)}),u.duration&&(u.duration=ad(u.duration)),u.repeatDelay&&(u.repeatDelay=ad(u.repeatDelay)),void 0!==u.from&&(u.keyframes[0]=u.from);let d=!1;if((!1===u.type||0===u.duration&&!u.repeatDelay)&&(u.duration=0,0===u.delay&&(d=!0)),(hd||Xl)&&(d=!0,u.duration=0,u.delay=0),d&&!i&&void 0!==t.get()){const e=gd(u.keyframes,a);if(void 0!==e)return void Iu.update((()=>{u.onUpdate(e),u.onComplete()}))}return!i&&vf.supports(u)?new vf(u):new lf(u)};function xf(e){return Boolean(Ec(e)&&e.add)}function yf(e,t){-1===e.indexOf(t)&&e.push(t)}function wf(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class _f{constructor(){this.subscriptions=[]}add(e){return yf(this.subscriptions,e),()=>wf(this.subscriptions,e)}notify(e,t,n){const r=this.subscriptions.length;if(r)if(1===r)this.subscriptions[0](e,t,n);else for(let o=0;o{const n=xd.now();this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),t&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){var t;this.current=e,this.updatedAt=xd.now(),null===this.canTrackVelocity&&void 0!==e&&(this.canTrackVelocity=(t=this.current,!isNaN(parseFloat(t))))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new _f);const n=this.events[e].add(t);return"change"===e?()=>{n(),Iu.read((()=>{this.events.change.getSize()||this.stop()}))}:n}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e,t=!0){t&&this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e,t)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return Sf.current&&Sf.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const e=xd.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||e-this.updatedAt>30)return 0;const t=Math.min(this.updatedAt-this.prevUpdatedAt,30);return hp(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise((t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()})).then((()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()}))}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function kf(e,t){return new Cf(e,t)}function jf(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,kf(n))}function Ef({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&!0!==t[n];return t[n]=!1,r}function Pf(e,t,{delay:n=0,transitionOverride:r,type:o}={}){var i;let{transition:s=e.getDefaultTransition(),transitionEnd:a,...l}=t;const c=e.getValue("willChange");r&&(s=r);const u=[],d=o&&e.animationState&&e.animationState.getState()[o];for(const t in l){const r=e.getValue(t,null!==(i=e.latestValues[t])&&void 0!==i?i:null),o=l[t];if(void 0===o||d&&Ef(d,t))continue;const a={delay:n,elapsed:0,...fd(s||{},t)};let p=!1;if(window.HandoffAppearAnimations){const n=e.getProps()[Yl];if(n){const e=window.HandoffAppearAnimations(n,t,r,Iu);null!==e&&(a.elapsed=e,p=!0)}}r.start(bf(t,r,o,e.shouldReduceMotion&&kc.has(t)?{type:!1}:a,e,p));const f=r.animation;f&&(xf(c)&&(c.add(t),f.then((()=>c.remove(t)))),u.push(f))}return a&&Promise.all(u).then((()=>{Iu.update((()=>{a&&function(e,t){const n=sd(e,t);let{transitionEnd:r={},transition:o={},...i}=n||{};i={...i,...r};for(const t in i)jf(e,t,ju(i[t]))}(e,a)}))})),u}function Tf(e,t,n={}){var r;const o=sd(e,t,"exit"===n.type?null===(r=e.presenceContext)||void 0===r?void 0:r.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=o||{};n.transitionOverride&&(i=n.transitionOverride);const s=o?()=>Promise.all(Pf(e,o,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(r=0)=>{const{delayChildren:o=0,staggerChildren:s,staggerDirection:a}=i;return function(e,t,n=0,r=0,o=1,i){const s=[],a=(e.variantChildren.size-1)*r,l=1===o?(e=0)=>e*r:(e=0)=>a-e*r;return Array.from(e.variantChildren).sort(Rf).forEach(((e,r)=>{e.notify("AnimationStart",t),s.push(Tf(e,t,{...i,delay:n+l(r)}).then((()=>e.notify("AnimationComplete",t))))})),Promise.all(s)}(e,t,o+r,s,a,n)}:()=>Promise.resolve(),{when:l}=i;if(l){const[e,t]="beforeChildren"===l?[s,a]:[a,s];return e().then((()=>t()))}return Promise.all([s(),a(n.delay)])}function Rf(e,t){return e.sortNodePosition(t)}const If=[...ac].reverse(),Nf=ac.length;function Mf(e){return t=>Promise.all(t.map((({animation:t,options:n})=>function(e,t,n={}){let r;if(e.notify("AnimationStart",t),Array.isArray(t)){const o=t.map((t=>Tf(e,t,n)));r=Promise.all(o)}else if("string"==typeof t)r=Tf(e,t,n);else{const o="function"==typeof t?sd(e,t,n.custom):t;r=Promise.all(Pf(e,o,n))}return r.then((()=>{Iu.postRender((()=>{e.notify("AnimationComplete",t)}))}))}(e,t,n))))}function Af(e){let t=Mf(e);const n={animate:Of(!0),whileInView:Of(),whileHover:Of(),whileTap:Of(),whileDrag:Of(),whileFocus:Of(),exit:Of()};let r=!0;const o=t=>(n,r)=>{var o;const i=sd(e,r,"exit"===t?null===(o=e.presenceContext)||void 0===o?void 0:o.custom:void 0);if(i){const{transition:e,transitionEnd:t,...r}=i;n={...n,...r,...t}}return n};function i(i){const s=e.getProps(),a=e.getVariantContext(!0)||{},l=[],c=new Set;let u={},d=1/0;for(let t=0;td&&m,x=!1;const y=Array.isArray(h)?h:[h];let w=y.reduce(o(p),{});!1===g&&(w={});const{prevResolvedValues:_={}}=f,S={..._,...w},C=t=>{b=!0,c.has(t)&&(x=!0,c.delete(t)),f.needsAnimating[t]=!0;const n=e.getValue(t);n&&(n.liveStyle=!1)};for(const e in S){const t=w[e],n=_[e];if(u.hasOwnProperty(e))continue;let r=!1;r=ku(t)&&ku(n)?!id(t,n):t!==n,r?null!=t?C(e):c.add(e):void 0!==t&&c.has(e)?C(e):f.protectedKeys[e]=!0}f.prevProp=h,f.prevResolvedValues=w,f.isActive&&(u={...u,...w}),r&&e.blockInitialAnimation&&(b=!1),!b||v&&!x||l.push(...y.map((e=>({animation:e,options:{type:p}}))))}if(c.size){const t={};c.forEach((n=>{const r=e.getBaseTarget(n),o=e.getValue(n);o&&(o.liveStyle=!0),t[n]=null!=r?r:null})),l.push({animation:t})}let p=Boolean(l.length);return!r||!1!==s.initial&&s.initial!==s.animate||e.manuallyAnimateOnMount||(p=!1),r=!1,p?t(l):Promise.resolve()}return{animateChanges:i,setActive:function(t,r){var o;if(n[t].isActive===r)return Promise.resolve();null===(o=e.variantChildren)||void 0===o||o.forEach((e=>{var n;return null===(n=e.animationState)||void 0===n?void 0:n.setActive(t,r)})),n[t].isActive=r;const s=i(t);for(const e in n)n[e].protectedKeys={};return s},setAnimateFunction:function(n){t=n(e)},getState:()=>n}}function Df(e,t){return"string"==typeof t?t!==e:!!Array.isArray(t)&&!id(t,e)}function Of(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}let zf=0;const Lf={animation:{Feature:class extends qu{constructor(e){super(e),e.animationState||(e.animationState=Af(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();this.unmount(),sc(e)&&(this.unmount=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){}}},exit:{Feature:class extends qu{constructor(){super(...arguments),this.id=zf++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;const r=this.node.animationState.setActive("exit",!e);t&&!e&&r.then((()=>t(this.id)))}mount(){const{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}}},Ff=(e,t)=>Math.abs(e-t);class Bf{constructor(e,t,{transformPagePoint:n,contextWindow:r,dragSnapToOrigin:o=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;const e=Hf(this.lastMoveEventInfo,this.history),t=null!==this.startEvent,n=function(e,t){const n=Ff(e.x,t.x),r=Ff(e.y,t.y);return Math.sqrt(n**2+r**2)}(e.offset,{x:0,y:0})>=3;if(!t&&!n)return;const{point:r}=e,{timestamp:o}=Mu;this.history.push({...r,timestamp:o});const{onStart:i,onMove:s}=this.handlers;t||(i&&i(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),s&&s(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastMoveEventInfo=Vf(t,this.transformPagePoint),Iu.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();const{onEnd:n,onSessionEnd:r,resumeAnimation:o}=this.handlers;if(this.dragSnapToOrigin&&o&&o(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const i=Hf("pointercancel"===e.type?this.lastMoveEventInfo:Vf(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,i),r&&r(e,i)},!Lu(e))return;this.dragSnapToOrigin=o,this.handlers=t,this.transformPagePoint=n,this.contextWindow=r||window;const i=Vf(Fu(e),this.transformPagePoint),{point:s}=i,{timestamp:a}=Mu;this.history=[{...s,timestamp:a}];const{onSessionStart:l}=t;l&&l(e,Hf(i,this.history)),this.removeListeners=$u(Bu(this.contextWindow,"pointermove",this.handlePointerMove),Bu(this.contextWindow,"pointerup",this.handlePointerUp),Bu(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),Nu(this.updatePoint)}}function Vf(e,t){return t?{point:t(e.point)}:e}function $f(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Hf({point:e},t){return{point:e,delta:$f(e,Uf(t)),offset:$f(e,Wf(t)),velocity:Gf(t,.1)}}function Wf(e){return e[0]}function Uf(e){return e[e.length-1]}function Gf(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=Uf(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>ad(t)));)n--;if(!r)return{x:0,y:0};const i=ld(o.timestamp-r.timestamp);if(0===i)return{x:0,y:0};const s={x:(o.x-r.x)/i,y:(o.y-r.y)/i};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function Kf(e){return e.max-e.min}function qf(e,t=0,n=.01){return Math.abs(e-t)<=n}function Yf(e,t,n,r=.5){e.origin=r,e.originPoint=Vp(t.min,t.max,e.origin),e.scale=Kf(n)/Kf(t),(qf(e.scale,1,1e-4)||isNaN(e.scale))&&(e.scale=1),e.translate=Vp(n.min,n.max,e.origin)-e.originPoint,(qf(e.translate)||isNaN(e.translate))&&(e.translate=0)}function Xf(e,t,n,r){Yf(e.x,t.x,n.x,r?r.originX:void 0),Yf(e.y,t.y,n.y,r?r.originY:void 0)}function Zf(e,t,n){e.min=n.min+t.min,e.max=e.min+Kf(t)}function Qf(e,t,n){e.min=t.min-n.min,e.max=e.min+Kf(t)}function Jf(e,t,n){Qf(e.x,t.x,n.x),Qf(e.y,t.y,n.y)}function eh(e,t,n){return{min:void 0!==t?e.min+t:void 0,max:void 0!==n?e.max+n-(e.max-e.min):void 0}}function th(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min1.0000000000001||e<.999999999999?e:1}function vh(e,t){e.min=e.min+t,e.max=e.max+t}function bh(e,t,[n,r,o]){const i=void 0!==t[o]?t[o]:.5,s=Vp(e.min,e.max,i);hh(e,t[n],t[r],s,t.scale)}const xh=["x","scaleX","originX"],yh=["y","scaleY","originY"];function wh(e,t){bh(e.x,t,xh),bh(e.y,t,yh)}function _h(e,t){return sh(function(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}(e.getBoundingClientRect(),t))}const Sh=({current:e})=>e?e.ownerDocument.defaultView:null,Ch=new WeakMap;class kh{constructor(e){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic={x:{min:0,max:0},y:{min:0,max:0}},this.visualElement=e}start(e,{snapToCursor:t=!1}={}){const{presenceContext:n}=this.visualElement;if(n&&!1===n.isPresent)return;const{dragSnapToOrigin:r}=this.getProps();this.panSession=new Bf(e,{onSessionStart:e=>{const{dragSnapToOrigin:n}=this.getProps();n?this.pauseAnimation():this.stopAnimation(),t&&this.snapToCursor(Fu(e,"page").point)},onStart:(e,t)=>{const{drag:n,dragPropagation:r,onDragStart:o}=this.getProps();if(n&&!r&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=Gu(n),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),ih((e=>{let t=this.getAxisMotionValue(e).get()||0;if(Kc.test(t)){const{projection:n}=this.visualElement;if(n&&n.layout){const r=n.layout.layoutBox[e];if(r){t=Kf(r)*(parseFloat(t)/100)}}}this.originPoint[e]=t})),o&&Iu.postRender((()=>o(e,t)));const{animationState:i}=this.visualElement;i&&i.setActive("whileDrag",!0)},onMove:(e,t)=>{const{dragPropagation:n,dragDirectionLock:r,onDirectionLock:o,onDrag:i}=this.getProps();if(!n&&!this.openGlobalLock)return;const{offset:s}=t;if(r&&null===this.currentDirection)return this.currentDirection=function(e,t=10){let n=null;Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x");return n}(s),void(null!==this.currentDirection&&o&&o(this.currentDirection));this.updateAxis("x",t.point,s),this.updateAxis("y",t.point,s),this.visualElement.render(),i&&i(e,t)},onSessionEnd:(e,t)=>this.stop(e,t),resumeAnimation:()=>ih((e=>{var t;return"paused"===this.getAnimationState(e)&&(null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.play())}))},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:r,contextWindow:Sh(this.visualElement)})}stop(e,t){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:r}=t;this.startAnimation(r);const{onDragEnd:o}=this.getProps();o&&Iu.postRender((()=>o(e,t)))}cancel(){this.isDragging=!1;const{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),t&&t.setActive("whileDrag",!1)}updateAxis(e,t,n){const{drag:r}=this.getProps();if(!n||!jh(e,r,this.currentDirection))return;const o=this.getAxisMotionValue(e);let i=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(i=function(e,{min:t,max:n},r){return void 0!==t&&en&&(e=r?Vp(n,e,r.max):Math.min(e,n)),e}(i,this.constraints[e],this.elastic[e])),o.set(i)}resolveConstraints(){var e;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):null===(e=this.visualElement.projection)||void 0===e?void 0:e.layout,o=this.constraints;t&&rc(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!r)&&function(e,{top:t,left:n,bottom:r,right:o}){return{x:eh(e.x,n,o),y:eh(e.y,t,r)}}(r.layoutBox,t),this.elastic=function(e=nh){return!1===e?e=0:!0===e&&(e=nh),{x:rh(e,"left","right"),y:rh(e,"top","bottom")}}(n),o!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&ih((e=>{!1!==this.constraints&&this.getAxisMotionValue(e)&&(this.constraints[e]=function(e,t){const n={};return void 0!==t.min&&(n.min=t.min-e.min),void 0!==t.max&&(n.max=t.max-e.min),n}(r.layoutBox[e],this.constraints[e]))}))}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!rc(e))return!1;const n=e.current;_d(null!==n,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const o=function(e,t,n){const r=_h(e,n),{scroll:o}=t;return o&&(vh(r.x,o.offset.x),vh(r.y,o.offset.y)),r}(n,r.root,this.visualElement.getTransformPagePoint());let i=function(e,t){return{x:th(e.x,t.x),y:th(e.y,t.y)}}(r.layout.layoutBox,o);if(t){const e=t(function({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}(i));this.hasMutatedConstraints=!!e,e&&(i=sh(e))}return i}startAnimation(e){const{drag:t,dragMomentum:n,dragElastic:r,dragTransition:o,dragSnapToOrigin:i,onDragTransitionEnd:s}=this.getProps(),a=this.constraints||{},l=ih((s=>{if(!jh(s,t,this.currentDirection))return;let l=a&&a[s]||{};i&&(l={min:0,max:0});const c=r?200:1e6,u=r?40:1e7,d={type:"inertia",velocity:n?e[s]:0,bounceStiffness:c,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...o,...l};return this.startAxisValueAnimation(s,d)}));return Promise.all(l).then(s)}startAxisValueAnimation(e,t){const n=this.getAxisMotionValue(e);return n.start(bf(e,n,0,t,this.visualElement))}stopAnimation(){ih((e=>this.getAxisMotionValue(e).stop()))}pauseAnimation(){ih((e=>{var t;return null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.pause()}))}getAnimationState(e){var t;return null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.state}getAxisMotionValue(e){const t=`_drag${e.toUpperCase()}`,n=this.visualElement.getProps(),r=n[t];return r||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){ih((t=>{const{drag:n}=this.getProps();if(!jh(t,n,this.currentDirection))return;const{projection:r}=this.visualElement,o=this.getAxisMotionValue(t);if(r&&r.layout){const{min:n,max:i}=r.layout.layoutBox[t];o.set(e[t]-Vp(n,i,.5))}}))}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!rc(t)||!n||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};ih((e=>{const t=this.getAxisMotionValue(e);if(t&&!1!==this.constraints){const n=t.get();r[e]=function(e,t){let n=.5;const r=Kf(e),o=Kf(t);return o>r?n=Bp(t.min,t.max-r,e.min):r>o&&(n=Bp(e.min,e.max-o,t.min)),Oc(0,1,n)}({min:n,max:n},this.constraints[e])}}));const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),ih((t=>{if(!jh(t,e,null))return;const n=this.getAxisMotionValue(t),{min:o,max:i}=this.constraints[t];n.set(Vp(o,i,r[t]))}))}addListeners(){if(!this.visualElement.current)return;Ch.set(this.visualElement,this);const e=Bu(this.visualElement.current,"pointerdown",(e=>{const{drag:t,dragListener:n=!0}=this.getProps();t&&n&&this.start(e)})),t=()=>{const{dragConstraints:e}=this.getProps();rc(e)&&(this.constraints=this.resolveRefConstraints())},{projection:n}=this.visualElement,r=n.addEventListener("measure",t);n&&!n.layout&&(n.root&&n.root.updateScroll(),n.updateLayout()),t();const o=zu(window,"resize",(()=>this.scalePositionWithinConstraints())),i=n.addEventListener("didUpdate",(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(ih((t=>{const n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))})),this.visualElement.render())}));return()=>{o(),e(),r(),i&&i()}}getProps(){const e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:o=!1,dragElastic:i=nh,dragMomentum:s=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:o,dragElastic:i,dragMomentum:s}}}function jh(e,t,n){return!(!0!==t&&t!==e||null!==n&&n!==e)}const Eh=e=>(t,n)=>{e&&Iu.postRender((()=>e(t,n)))};const Ph={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Th(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Rh={correct:(e,t)=>{if(!t.target)return e;if("string"==typeof e){if(!qc.test(e))return e;e=parseFloat(e)}return`${Th(e,t.target.x)}% ${Th(e,t.target.y)}%`}},Ih={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=np.parse(e);if(o.length>5)return r;const i=np.createTransformer(e),s="number"!=typeof o[0]?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;o[0+s]/=a,o[1+s]/=l;const c=Vp(a,l,.5);return"number"==typeof o[2+s]&&(o[2+s]/=c),"number"==typeof o[3+s]&&(o[3+s]/=c),i(o)}};class Nh extends B.Component{componentDidMount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:o}=e;var i;i=Ah,Object.assign(Sc,i),o&&(t.group&&t.group.add(o),n&&n.register&&r&&n.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",(()=>{this.safeToRemove()})),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),Ph.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:t,visualElement:n,drag:r,isPresent:o}=this.props,i=n.projection;return i?(i.isPresent=o,r||e.layoutDependency!==t||void 0===t?i.willUpdate():this.safeToRemove(),e.isPresent!==o&&(o?i.promote():i.relegate()||Iu.postRender((()=>{const e=i.getStack();e&&e.members.length||this.safeToRemove()}))),null):null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),tc.postRender((()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()})))}componentWillUnmount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function Mh(e){const[t,n]=function(){const e=(0,B.useContext)(Wl);if(null===e)return[!0,null];const{isPresent:t,onExitComplete:n,register:r}=e,o=(0,B.useId)();return(0,B.useEffect)((()=>r(o)),[]),!t&&n?[!1,()=>n&&n(o)]:[!0]}(),r=(0,B.useContext)(mc);return(0,wt.jsx)(Nh,{...e,layoutGroup:r,switchLayoutGroup:(0,B.useContext)(gc),isPresent:t,safeToRemove:n})}const Ah={borderRadius:{...Rh,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Rh,borderTopRightRadius:Rh,borderBottomLeftRadius:Rh,borderBottomRightRadius:Rh,boxShadow:Ih},Dh=["TopLeft","TopRight","BottomLeft","BottomRight"],Oh=Dh.length,zh=e=>"string"==typeof e?parseFloat(e):e,Lh=e=>"number"==typeof e||qc.test(e);function Fh(e,t){return void 0!==e[t]?e[t]:e.borderRadius}const Bh=$h(0,.5,Mp),Vh=$h(.5,.95,Ru);function $h(e,t,n){return r=>rt?1:n(Bp(e,t,r))}function Hh(e,t){e.min=t.min,e.max=t.max}function Wh(e,t){Hh(e.x,t.x),Hh(e.y,t.y)}function Uh(e,t,n,r,o){return e=ph(e-=t,1/n,r),void 0!==o&&(e=ph(e,1/o,r)),e}function Gh(e,t,[n,r,o],i,s){!function(e,t=0,n=1,r=.5,o,i=e,s=e){Kc.test(t)&&(t=parseFloat(t),t=Vp(s.min,s.max,t/100)-s.min);if("number"!=typeof t)return;let a=Vp(i.min,i.max,r);e===i&&(a-=t),e.min=Uh(e.min,t,n,a,o),e.max=Uh(e.max,t,n,a,o)}(e,t[n],t[r],t[o],t.scale,i,s)}const Kh=["x","scaleX","originX"],qh=["y","scaleY","originY"];function Yh(e,t,n,r){Gh(e.x,t,Kh,n?n.x:void 0,r?r.x:void 0),Gh(e.y,t,qh,n?n.y:void 0,r?r.y:void 0)}function Xh(e){return 0===e.translate&&1===e.scale}function Zh(e){return Xh(e.x)&&Xh(e.y)}function Qh(e,t){return Math.round(e.x.min)===Math.round(t.x.min)&&Math.round(e.x.max)===Math.round(t.x.max)&&Math.round(e.y.min)===Math.round(t.y.min)&&Math.round(e.y.max)===Math.round(t.y.max)}function Jh(e){return Kf(e.x)/Kf(e.y)}class em{constructor(){this.members=[]}add(e){yf(this.members,e),e.scheduleRender()}remove(e){if(wf(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){const t=this.members.findIndex((t=>e===t));if(0===t)return!1;let n;for(let e=t;e>=0;e--){const t=this.members[e];if(!1!==t.isPresent){n=t;break}}return!!n&&(this.promote(n),!0)}promote(e,t){const n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.instance&&n.scheduleRender(),e.scheduleRender(),e.resumeFrom=n,t&&(e.resumeFrom.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:r}=e.options;!1===r&&n.hide()}}exitAnimationComplete(){this.members.forEach((e=>{const{options:t,resumingFrom:n}=e;t.onExitComplete&&t.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()}))}scheduleRender(){this.members.forEach((e=>{e.instance&&e.scheduleRender(!1)}))}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function tm(e,t,n){let r="";const o=e.x.translate/t.x,i=e.y.translate/t.y,s=(null==n?void 0:n.z)||0;if((o||i||s)&&(r=`translate3d(${o}px, ${i}px, ${s}px) `),1===t.x&&1===t.y||(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:e,rotate:t,rotateX:o,rotateY:i,skewX:s,skewY:a}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),o&&(r+=`rotateX(${o}deg) `),i&&(r+=`rotateY(${i}deg) `),s&&(r+=`skewX(${s}deg) `),a&&(r+=`skewY(${a}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return 1===a&&1===l||(r+=`scale(${a}, ${l})`),r||"none"}const nm=(e,t)=>e.depth-t.depth;class rm{constructor(){this.children=[],this.isDirty=!1}add(e){yf(this.children,e),this.isDirty=!0}remove(e){wf(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(nm),this.isDirty=!1,this.children.forEach(e)}}const om=["","X","Y","Z"],im={visibility:"hidden"};let sm=0;const am={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function lm(e,t,n,r){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function cm({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(e={},n=(null==t?void 0:t())){this.id=sm++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{var e;this.projectionUpdateScheduled=!1,am.totalNodes=am.resolvedTargetDeltas=am.recalculatedProjection=0,this.nodes.forEach(pm),this.nodes.forEach(xm),this.nodes.forEach(ym),this.nodes.forEach(fm),e=am,window.MotionDebug&&window.MotionDebug.record(e)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;ethis.root.updateBlockedByResize=!1;e(t,(()=>{this.root.updateBlockedByResize=!0,n&&n(),n=function(e,t){const n=xd.now(),r=({timestamp:o})=>{const i=o-n;i>=t&&(Nu(r),e(i-t))};return Iu.read(r,!0),()=>Nu(r)}(r,250),Ph.hasAnimatedSinceResize&&(Ph.hasAnimatedSinceResize=!1,this.nodes.forEach(bm))}))}o&&this.root.registerSharedNode(o,this),!1!==this.options.animate&&s&&(o||i)&&this.addEventListener("didUpdate",(({delta:e,hasLayoutChanged:t,hasRelativeTargetChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const o=this.options.transition||s.getDefaultTransition()||jm,{onLayoutAnimationStart:i,onLayoutAnimationComplete:a}=s.getProps(),l=!this.targetLayout||!Qh(this.targetLayout,r)||n,c=!t&&n;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||c||t&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(e,c);const t={...fd(o,"layout"),onPlay:i,onComplete:a};(s.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t)}else t||bm(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r}))}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Nu(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,window.HandoffCancelAllAnimations&&window.HandoffCancelAllAnimations(),this.nodes&&this.nodes.forEach(wm),this.animationId++)}getTransformTemplate(){const{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;ethis.update())))}clearAllSnapshots(){this.nodes.forEach(hm),this.sharedNodes.forEach(_m)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Iu.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Iu.postRender((()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()}))}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure())}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e{const n=t/1e3;Sm(i.x,e.x,n),Sm(i.y,e.y,n),this.setTargetDelta(i),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Jf(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox),function(e,t,n,r){Cm(e.x,t.x,n.x,r),Cm(e.y,t.y,n.y,r)}(this.relativeTarget,this.relativeTargetOrigin,s,n),d&&function(e,t){return e.x.min===t.x.min&&e.x.max===t.x.max&&e.y.min===t.y.min&&e.y.max===t.y.max}(this.relativeTarget,d)&&(this.isProjectionDirty=!1),d||(d={x:{min:0,max:0},y:{min:0,max:0}}),Wh(d,this.relativeTarget)),a&&(this.animationValues=o,function(e,t,n,r,o,i){o?(e.opacity=Vp(0,void 0!==n.opacity?n.opacity:1,Bh(r)),e.opacityExit=Vp(void 0!==t.opacity?t.opacity:1,0,Vh(r))):i&&(e.opacity=Vp(void 0!==t.opacity?t.opacity:1,void 0!==n.opacity?n.opacity:1,r));for(let o=0;o{Ph.hasAnimatedSinceResize=!0,this.currentAnimation=function(e,t,n){const r=Ec(e)?e:kf(e);return r.start(bf("",r,t,n)),r.animation}(0,1e3,{...e,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0}))}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const e=this.getLead();let{targetWithTransforms:t,target:n,layout:r,latestValues:o}=e;if(t&&n&&r){if(this!==e&&this.layout&&r&&Rm(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const t=Kf(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;const r=Kf(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}Wh(t,n),wh(t,o),Xf(this.projectionDeltaWithTransform,this.layoutCorrected,t,o)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new em);this.sharedNodes.get(e).add(t);const n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){const e=this.getStack();return!e||e.lead===this}getLead(){var e;const{layoutId:t}=this.options;return t&&(null===(e=this.getStack())||void 0===e?void 0:e.lead)||this}getPrevLead(){var e;const{layoutId:t}=this.options;return t?null===(e=this.getStack())||void 0===e?void 0:e.prevLead:void 0}getStack(){const{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){const r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){const e=this.getStack();return!!e&&e.relegate(this)}resetSkewAndRotation(){const{visualElement:e}=this.options;if(!e)return;let t=!1;const{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;const r={};n.z&&lm("z",e,r,this.animationValues);for(let t=0;t{var t;return null===(t=e.currentAnimation)||void 0===t?void 0:t.stop()})),this.root.nodes.forEach(mm),this.root.sharedNodes.clear()}}}function um(e){e.updateLayout()}function dm(e){var t;const n=(null===(t=e.resumeFrom)||void 0===t?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:t,measuredBox:r}=e.layout,{animationType:o}=e.options,i=n.source!==e.layout.source;"size"===o?ih((e=>{const r=i?n.measuredBox[e]:n.layoutBox[e],o=Kf(r);r.min=t[e].min,r.max=r.min+o})):Rm(o,n.layoutBox,t)&&ih((r=>{const o=i?n.measuredBox[r]:n.layoutBox[r],s=Kf(t[r]);o.max=o.min+s,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+s)}));const s={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};Xf(s,t,n.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};i?Xf(a,e.applyTransform(r,!0),n.measuredBox):Xf(a,t,n.layoutBox);const l=!Zh(s);let c=!1;if(!e.resumeFrom){const r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){const{snapshot:o,layout:i}=r;if(o&&i){const s={x:{min:0,max:0},y:{min:0,max:0}};Jf(s,n.layoutBox,o.layoutBox);const a={x:{min:0,max:0},y:{min:0,max:0}};Jf(a,t,i.layoutBox),Qh(s,a)||(c=!0),r.options.layoutRoot&&(e.relativeTarget=a,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners("didUpdate",{layout:t,snapshot:n,delta:a,layoutDelta:s,hasLayoutChanged:l,hasRelativeTargetChanged:c})}else if(e.isLead()){const{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function pm(e){am.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=Boolean(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function fm(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function hm(e){e.clearSnapshot()}function mm(e){e.clearMeasurements()}function gm(e){e.isLayoutDirty=!1}function vm(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function bm(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function xm(e){e.resolveTargetDelta()}function ym(e){e.calcProjection()}function wm(e){e.resetSkewAndRotation()}function _m(e){e.removeLeadSnapshot()}function Sm(e,t,n){e.translate=Vp(t.translate,0,n),e.scale=Vp(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Cm(e,t,n,r){e.min=Vp(t.min,n.min,r),e.max=Vp(t.max,n.max,r)}function km(e){return e.animationValues&&void 0!==e.animationValues.opacityExit}const jm={duration:.45,ease:[.4,0,.1,1]},Em=e=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Pm=Em("applewebkit/")&&!Em("chrome/")?Math.round:Ru;function Tm(e){e.min=Pm(e.min),e.max=Pm(e.max)}function Rm(e,t,n){return"position"===e||"preserve-aspect"===e&&!qf(Jh(t),Jh(n),.2)}const Im=cm({attachResizeListener:(e,t)=>zu(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Nm={current:void 0},Mm=cm({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Nm.current){const e=new Im({});e.mount(window),e.setOptions({layoutScroll:!0}),Nm.current=e}return Nm.current},resetTransform:(e,t)=>{e.style.transform=void 0!==t?t:"none"},checkIsScrollRoot:e=>Boolean("fixed"===window.getComputedStyle(e).position)}),Am={pan:{Feature:class extends qu{constructor(){super(...arguments),this.removePointerDownListener=Ru}onPointerDown(e){this.session=new Bf(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Sh(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:Eh(e),onStart:Eh(t),onMove:n,onEnd:(e,t)=>{delete this.session,r&&Iu.postRender((()=>r(e,t)))}}}mount(){this.removePointerDownListener=Bu(this.node.current,"pointerdown",(e=>this.onPointerDown(e)))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends qu{constructor(e){super(e),this.removeGroupControls=Ru,this.removeListeners=Ru,this.controls=new kh(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Ru}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:Mm,MeasureLayout:Mh}},Dm={current:null},Om={current:!1};const zm=new WeakMap,Lm=[...Ad,qd,np],Fm=Object.keys(hc),Bm=Fm.length,Vm=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],$m=lc.length;function Hm(e){if(e)return!1!==e.options.allowProjection?e.projection:Hm(e.parent)}class Wm{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,blockInitialAnimation:o,visualState:i},s={}){this.resolveKeyframes=(e,t,n,r)=>new this.KeyframeResolver(e,t,n,r,this),this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Vd,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>Iu.render(this.render,!1,!0);const{latestValues:a,renderState:l}=i;this.latestValues=a,this.baseTarget={...a},this.initialValues=t.initial?{...a}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.options=s,this.blockInitialAnimation=Boolean(o),this.isControllingVariants=cc(t),this.isVariantNode=uc(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(e&&e.current);const{willChange:c,...u}=this.scrapeMotionValuesFromProps(t,{},this);for(const e in u){const t=u[e];void 0!==a[e]&&Ec(t)&&(t.set(a[e],!1),xf(c)&&c.add(e))}}mount(e){this.current=e,zm.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach(((e,t)=>this.bindToMotionValue(t,e))),Om.current||function(){if(Om.current=!0,Ul)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Dm.current=e.matches;e.addListener(t),t()}else Dm.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||Dm.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){var e;zm.delete(this.current),this.projection&&this.projection.unmount(),Nu(this.notifyUpdate),Nu(this.render),this.valueSubscriptions.forEach((e=>e())),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const t in this.features)null===(e=this.features[t])||void 0===e||e.unmount();this.current=null}bindToMotionValue(e,t){const n=kc.has(e),r=t.on("change",(t=>{this.latestValues[e]=t,this.props.onUpdate&&Iu.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)})),o=t.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(e,(()=>{r(),o(),t.owner&&t.stop()}))}sortNodePosition(e){return this.current&&this.sortInstanceNodePosition&&this.type===e.type?this.sortInstanceNodePosition(this.current,e.current):0}loadFeatures({children:e,...t},n,r,o){let i,s;for(let e=0;ethis.scheduleRender(),animationType:"string"==typeof n?n:"both",initialPromotionConfig:o,layoutScroll:a,layoutRoot:l})}return s}updateFeatures(){for(const e in this.features){const t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;tt.variantChildren.delete(e)}addValue(e,t){const n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);const t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return void 0===n&&void 0!==t&&(n=kf(null===t?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){var n;let r=void 0===this.latestValues[e]&&this.current?null!==(n=this.getBaseTargetFromProps(this.props,e))&&void 0!==n?n:this.readValueFromInstance(this.current,e,this.options):this.latestValues[e];return null!=r&&("string"==typeof r&&(Sd(r)||yd(r))?r=parseFloat(r):!(e=>Lm.find(Md(e)))(r)&&np.test(t)&&(r=cp(e,t)),this.setBaseTarget(e,Ec(r)?r.get():r)),Ec(r)?r.get():r}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){var t;const{initial:n}=this.props;let r;if("string"==typeof n||"object"==typeof n){const o=Su(this.props,n,null===(t=this.presenceContext)||void 0===t?void 0:t.custom);o&&(r=o[e])}if(n&&void 0!==r)return r;const o=this.getBaseTargetFromProps(this.props,e);return void 0===o||Ec(o)?void 0!==this.initialValues[e]&&void 0===r?void 0:this.baseTarget[e]:o}on(e,t){return this.events[e]||(this.events[e]=new _f),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}}class Um extends Wm{constructor(){super(...arguments),this.KeyframeResolver=dp}sortInstanceNodePosition(e,t){return 2&e.compareDocumentPosition(t)?1:-1}getBaseTargetFromProps(e,t){return e.style?e.style[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}}class Gm extends Um{constructor(){super(...arguments),this.type="html"}readValueFromInstance(e,t){if(kc.has(t)){const e=lp(t);return e&&e.default||0}{const r=(n=e,window.getComputedStyle(n)),o=(Ic(t)?r.getPropertyValue(t):r[t])||0;return"string"==typeof o?o.trim():o}var n}measureInstanceViewportBox(e,{transformPagePoint:t}){return _h(e,t)}build(e,t,n,r){eu(e,t,n,r.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return yu(e,t,n)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Ec(e)&&(this.childSubscription=e.on("change",(e=>{this.current&&(this.current.textContent=`${e}`)})))}renderInstance(e,t,n,r){vu(e,t,n,r)}}class Km extends Um{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(kc.has(t)){const e=lp(t);return e&&e.default||0}return t=bu.has(t)?t:ql(t),e.getAttribute(t)}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}scrapeMotionValuesFromProps(e,t,n){return wu(e,t,n)}build(e,t,n,r){pu(e,t,n,this.isSVGTag,r.transformTemplate)}renderInstance(e,t,n,r){xu(e,t,0,r)}mount(e){this.isSVGTag=hu(e.tagName),super.mount(e)}}const qm=(e,t)=>_c(e)?new Km(t,{enableHardwareAcceleration:!1}):new Gm(t,{allowProjection:e!==B.Fragment,enableHardwareAcceleration:!0}),Ym={...Lf,...od,...Am,...{layout:{ProjectionNode:Mm,MeasureLayout:Mh}}},Xm=yc(((e,t)=>function(e,{forwardMotionProps:t=!1},n,r){return{..._c(e)?Du:Ou,preloadedFeatures:n,useRender:gu(t),createVisualElement:r,Component:e}}(e,t,Ym,qm)));function Zm(){const e=(0,B.useRef)(!1);return Gl((()=>(e.current=!0,()=>{e.current=!1})),[]),e}function Qm(){const e=Zm(),[t,n]=(0,B.useState)(0),r=(0,B.useCallback)((()=>{e.current&&n(t+1)}),[t]);return[(0,B.useCallback)((()=>Iu.postRender(r)),[r]),t]}class Jm extends B.Component{getSnapshotBeforeUpdate(e){const t=this.props.childRef.current;if(t&&e.isPresent&&!this.props.isPresent){const e=this.props.sizeRef.current;e.height=t.offsetHeight||0,e.width=t.offsetWidth||0,e.top=t.offsetTop,e.left=t.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function eg({children:e,isPresent:t}){const n=(0,B.useId)(),r=(0,B.useRef)(null),o=(0,B.useRef)({width:0,height:0,top:0,left:0}),{nonce:i}=(0,B.useContext)($l);return(0,B.useInsertionEffect)((()=>{const{width:e,height:s,top:a,left:l}=o.current;if(t||!r.current||!e||!s)return;r.current.dataset.motionPopId=n;const c=document.createElement("style");return i&&(c.nonce=i),document.head.appendChild(c),c.sheet&&c.sheet.insertRule(`\n [data-motion-pop-id="${n}"] {\n position: absolute !important;\n width: ${e}px !important;\n height: ${s}px !important;\n top: ${a}px !important;\n left: ${l}px !important;\n }\n `),()=>{document.head.removeChild(c)}}),[t]),(0,wt.jsx)(Jm,{isPresent:t,childRef:r,sizeRef:o,children:B.cloneElement(e,{ref:r})})}const tg=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:o,presenceAffectsLayout:i,mode:s})=>{const a=Cu(ng),l=(0,B.useId)(),c=(0,B.useMemo)((()=>({id:l,initial:t,isPresent:n,custom:o,onExitComplete:e=>{a.set(e,!0);for(const e of a.values())if(!e)return;r&&r()},register:e=>(a.set(e,!1),()=>a.delete(e))})),i?[Math.random()]:[n]);return(0,B.useMemo)((()=>{a.forEach(((e,t)=>a.set(t,!1)))}),[n]),B.useEffect((()=>{!n&&!a.size&&r&&r()}),[n]),"popLayout"===s&&(e=(0,wt.jsx)(eg,{isPresent:n,children:e})),(0,wt.jsx)(Wl.Provider,{value:c,children:e})};function ng(){return new Map}const rg=e=>e.key||"";const og=({children:e,custom:t,initial:n=!0,onExitComplete:r,exitBeforeEnter:o,presenceAffectsLayout:i=!0,mode:s="sync"})=>{_d(!o,"Replace exitBeforeEnter with mode='wait'");const a=(0,B.useContext)(mc).forceRender||Qm()[0],l=Zm(),c=function(e){const t=[];return B.Children.forEach(e,(e=>{(0,B.isValidElement)(e)&&t.push(e)})),t}(e);let u=c;const d=(0,B.useRef)(new Map).current,p=(0,B.useRef)(u),f=(0,B.useRef)(new Map).current,h=(0,B.useRef)(!0);var m;if(Gl((()=>{h.current=!1,function(e,t){e.forEach((e=>{const n=rg(e);t.set(n,e)}))}(c,f),p.current=u})),m=()=>{h.current=!0,f.clear(),d.clear()},(0,B.useEffect)((()=>()=>m()),[]),h.current)return(0,wt.jsx)(wt.Fragment,{children:u.map((e=>(0,wt.jsx)(tg,{isPresent:!0,initial:!!n&&void 0,presenceAffectsLayout:i,mode:s,children:e},rg(e))))});u=[...u];const g=p.current.map(rg),v=c.map(rg),b=g.length;for(let e=0;e{if(-1!==v.indexOf(n))return;const o=f.get(n);if(!o)return;const h=g.indexOf(n);let m=e;if(!m){const e=()=>{d.delete(n);const e=Array.from(f.keys()).filter((e=>!v.includes(e)));if(e.forEach((e=>f.delete(e))),p.current=c.filter((t=>{const r=rg(t);return r===n||e.includes(r)})),!d.size){if(!1===l.current)return;a(),r&&r()}};m=(0,wt.jsx)(tg,{isPresent:!1,onExitComplete:e,custom:t,presenceAffectsLayout:i,mode:s,children:o},rg(o)),d.set(n,m)}u.splice(h,0,m)})),u=u.map((e=>{const t=e.key;return d.has(t)?e:(0,wt.jsx)(tg,{isPresent:!0,presenceAffectsLayout:i,mode:s,children:e},rg(e))})),(0,wt.jsx)(wt.Fragment,{children:d.size?u:u.map((e=>(0,B.cloneElement)(e)))})},ig=["40em","52em","64em"],sg=(e={})=>{const{defaultIndex:t=0}=e;if("number"!=typeof t)throw new TypeError(`Default breakpoint index should be a number. Got: ${t}, ${typeof t}`);if(t<0||t>ig.length-1)throw new RangeError(`Default breakpoint index out of range. Theme has ${ig.length} breakpoints, got index ${t}`);const[n,r]=(0,c.useState)(t);return(0,c.useEffect)((()=>{const e=()=>{const e=ig.filter((e=>"undefined"!=typeof window&&window.matchMedia(`screen and (min-width: ${e})`).matches)).length;n!==e&&r(e)};return e(),"undefined"!=typeof window&&window.addEventListener("resize",e),()=>{"undefined"!=typeof window&&window.removeEventListener("resize",e)}}),[n]),n};function ag(e,t={}){const n=sg(t);if(!Array.isArray(e)&&"function"!=typeof e)return e;const r=e||[];return r[n>=r.length?r.length-1:n]}const lg={name:"zjik7",styles:"display:flex"},cg={name:"qgaee5",styles:"display:block;max-height:100%;max-width:100%;min-height:0;min-width:0"},ug={name:"82a6rk",styles:"flex:1"},dg={name:"13nosa1",styles:">*{min-height:0;}"},pg={name:"1pwxzk4",styles:">*{min-width:0;}"};function fg(e){const{align:t,className:n,direction:r="row",expanded:o=!0,gap:i=2,justify:s="space-between",wrap:a=!1,...l}=Ya(function(e){const{isReversed:t,...n}=e;return void 0!==t?(Fi()("Flex isReversed",{alternative:'Flex direction="row-reverse" or "column-reverse"',since:"5.9"}),{...n,direction:t?"row-reverse":"row"}):n}(e),"Flex"),u=ag(Array.isArray(r)?r:[r]),d="string"==typeof u&&!!u.includes("column"),p=qa();return{...l,className:(0,c.useMemo)((()=>{const e=bl({alignItems:null!=t?t:d?"normal":"center",flexDirection:u,flexWrap:a?"wrap":void 0,gap:yl(i),justifyContent:s,height:d&&o?"100%":void 0,width:!d&&o?"100%":void 0},"","");return p(lg,e,d?dg:pg,n)}),[t,n,p,u,o,i,d,s,a]),isColumn:d}}const hg=(0,c.createContext)({flexItemDisplay:void 0});const mg=Xa((function(e,t){const{children:n,isColumn:r,...o}=fg(e);return(0,wt.jsx)(hg.Provider,{value:{flexItemDisplay:r?"block":void 0},children:(0,wt.jsx)(dl,{...o,ref:t,children:n})})}),"Flex");function gg(e){const{className:t,display:n,isBlock:r=!1,...o}=Ya(e,"FlexItem"),i={},s=(0,c.useContext)(hg).flexItemDisplay;i.Base=bl({display:n||s},"","");return{...o,className:qa()(cg,i.Base,r&&ug,t)}}const vg=Xa((function(e,t){const n=function(e){return gg({isBlock:!0,...Ya(e,"FlexBlock")})}(e);return(0,wt.jsx)(dl,{...n,ref:t})}),"FlexBlock"),bg=new RegExp(/-left/g),xg=new RegExp(/-right/g),yg=new RegExp(/Left/g),wg=new RegExp(/Right/g);function _g(e){return"left"===e?"right":"right"===e?"left":bg.test(e)?e.replace(bg,"-right"):xg.test(e)?e.replace(xg,"-left"):yg.test(e)?e.replace(yg,"Right"):wg.test(e)?e.replace(wg,"Left"):e}function Sg(e={},t){return()=>t?(0,a.isRTL)()?bl(t,"",""):bl(e,"",""):(0,a.isRTL)()?bl(((e={})=>Object.fromEntries(Object.entries(e).map((([e,t])=>[_g(e),t]))))(e),"",""):bl(e,"","")}Sg.watch=()=>(0,a.isRTL)();const Cg=e=>null!=e;const kg=Xa((function(e,t){const n=function(e){const{className:t,margin:n,marginBottom:r=2,marginLeft:o,marginRight:i,marginTop:s,marginX:a,marginY:l,padding:c,paddingBottom:u,paddingLeft:d,paddingRight:p,paddingTop:f,paddingX:h,paddingY:m,...g}=Ya(e,"Spacer");return{...g,className:qa()(Cg(n)&&bl("margin:",yl(n),";",""),Cg(l)&&bl("margin-bottom:",yl(l),";margin-top:",yl(l),";",""),Cg(a)&&bl("margin-left:",yl(a),";margin-right:",yl(a),";",""),Cg(s)&&bl("margin-top:",yl(s),";",""),Cg(r)&&bl("margin-bottom:",yl(r),";",""),Cg(o)&&Sg({marginLeft:yl(o)})(),Cg(i)&&Sg({marginRight:yl(i)})(),Cg(c)&&bl("padding:",yl(c),";",""),Cg(m)&&bl("padding-bottom:",yl(m),";padding-top:",yl(m),";",""),Cg(h)&&bl("padding-left:",yl(h),";padding-right:",yl(h),";",""),Cg(f)&&bl("padding-top:",yl(f),";",""),Cg(u)&&bl("padding-bottom:",yl(u),";",""),Cg(d)&&Sg({paddingLeft:yl(d)})(),Cg(p)&&Sg({paddingRight:yl(p)})(),t)}}(e);return(0,wt.jsx)(dl,{...n,ref:t})}),"Spacer"),jg=kg,Eg=(0,wt.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,wt.jsx)(n.Path,{d:"M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z"})}),Pg=(0,wt.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,wt.jsx)(n.Path,{d:"M7 11.5h10V13H7z"})});const Tg=Xa((function(e,t){const n=gg(e);return(0,wt.jsx)(dl,{...n,ref:t})}),"FlexItem");const Rg={name:"hdknak",styles:"display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap"};function Ig(e){return null!=e}const Ng=e=>"string"==typeof e?(e=>parseFloat(e))(e):e,Mg="…",Ag={auto:"auto",head:"head",middle:"middle",tail:"tail",none:"none"},Dg={ellipsis:Mg,ellipsizeMode:Ag.auto,limit:0,numberOfLines:0};function Og(e="",t){const n={...Dg,...t},{ellipsis:r,ellipsizeMode:o,limit:i}=n;if(o===Ag.none)return e;let s,a;switch(o){case Ag.head:s=0,a=i;break;case Ag.middle:s=Math.floor(i/2),a=Math.floor(i/2);break;default:s=i,a=0}const l=o!==Ag.auto?function(e,t,n,r){if("string"!=typeof e)return"";const o=e.length,i=~~t,s=~~n,a=Ig(r)?r:Mg;return 0===i&&0===s||i>=o||s>=o||i+s>=o?e:0===s?e.slice(0,i)+a:e.slice(0,i)+a+e.slice(o-s)}(e,s,a,r):e;return l}function zg(e){const{className:t,children:n,ellipsis:r=Mg,ellipsizeMode:o=Ag.auto,limit:i=0,numberOfLines:s=0,...a}=Ya(e,"Truncate"),l=qa();let u;"string"==typeof n?u=n:"number"==typeof n&&(u=n.toString());const d=u?Og(u,{ellipsis:r,ellipsizeMode:o,limit:i,numberOfLines:s}):n,p=!!u&&o===Ag.auto;return{...a,className:(0,c.useMemo)((()=>l(p&&!s&&Rg,p&&!!s&&bl(1===s?"word-break: break-all;":""," -webkit-box-orient:vertical;-webkit-line-clamp:",s,";display:-webkit-box;overflow:hidden;",""),t)),[t,l,s,p]),children:d}}var Lg={grad:.9,turn:360,rad:360/(2*Math.PI)},Fg=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},Bg=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},Vg=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},$g=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},Hg=function(e){return{r:Vg(e.r,0,255),g:Vg(e.g,0,255),b:Vg(e.b,0,255),a:Vg(e.a)}},Wg=function(e){return{r:Bg(e.r),g:Bg(e.g),b:Bg(e.b),a:Bg(e.a,3)}},Ug=/^#([0-9a-f]{3,8})$/i,Gg=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},Kg=function(e){var t=e.r,n=e.g,r=e.b,o=e.a,i=Math.max(t,n,r),s=i-Math.min(t,n,r),a=s?i===t?(n-r)/s:i===n?2+(r-t)/s:4+(t-n)/s:0;return{h:60*(a<0?a+6:a),s:i?s/i*100:0,v:i/255*100,a:o}},qg=function(e){var t=e.h,n=e.s,r=e.v,o=e.a;t=t/360*6,n/=100,r/=100;var i=Math.floor(t),s=r*(1-n),a=r*(1-(t-i)*n),l=r*(1-(1-t+i)*n),c=i%6;return{r:255*[r,a,s,s,l,r][c],g:255*[l,r,r,a,s,s][c],b:255*[s,s,l,r,r,a][c],a:o}},Yg=function(e){return{h:$g(e.h),s:Vg(e.s,0,100),l:Vg(e.l,0,100),a:Vg(e.a)}},Xg=function(e){return{h:Bg(e.h),s:Bg(e.s),l:Bg(e.l),a:Bg(e.a,3)}},Zg=function(e){return qg((n=(t=e).s,{h:t.h,s:(n*=((r=t.l)<50?r:100-r)/100)>0?2*n/(r+n)*100:0,v:r+n,a:t.a}));var t,n,r},Qg=function(e){return{h:(t=Kg(e)).h,s:(o=(200-(n=t.s))*(r=t.v)/100)>0&&o<200?n*r/100/(o<=100?o:200-o)*100:0,l:o/2,a:t.a};var t,n,r,o},Jg=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,ev=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,tv=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,nv=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,rv={string:[[function(e){var t=Ug.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:4===e.length?Bg(parseInt(e[3]+e[3],16)/255,2):1}:6===e.length||8===e.length?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:8===e.length?Bg(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=tv.exec(e)||nv.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:Hg({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=Jg.exec(e)||ev.exec(e);if(!t)return null;var n,r,o=Yg({h:(n=t[1],r=t[2],void 0===r&&(r="deg"),Number(n)*(Lg[r]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return Zg(o)},"hsl"]],object:[[function(e){var t=e.r,n=e.g,r=e.b,o=e.a,i=void 0===o?1:o;return Fg(t)&&Fg(n)&&Fg(r)?Hg({r:Number(t),g:Number(n),b:Number(r),a:Number(i)}):null},"rgb"],[function(e){var t=e.h,n=e.s,r=e.l,o=e.a,i=void 0===o?1:o;if(!Fg(t)||!Fg(n)||!Fg(r))return null;var s=Yg({h:Number(t),s:Number(n),l:Number(r),a:Number(i)});return Zg(s)},"hsl"],[function(e){var t=e.h,n=e.s,r=e.v,o=e.a,i=void 0===o?1:o;if(!Fg(t)||!Fg(n)||!Fg(r))return null;var s=function(e){return{h:$g(e.h),s:Vg(e.s,0,100),v:Vg(e.v,0,100),a:Vg(e.a)}}({h:Number(t),s:Number(n),v:Number(r),a:Number(i)});return qg(s)},"hsv"]]},ov=function(e,t){for(var n=0;n=.5},e.prototype.toHex=function(){return t=(e=Wg(this.rgba)).r,n=e.g,r=e.b,i=(o=e.a)<1?Gg(Bg(255*o)):"","#"+Gg(t)+Gg(n)+Gg(r)+i;var e,t,n,r,o,i},e.prototype.toRgb=function(){return Wg(this.rgba)},e.prototype.toRgbString=function(){return t=(e=Wg(this.rgba)).r,n=e.g,r=e.b,(o=e.a)<1?"rgba("+t+", "+n+", "+r+", "+o+")":"rgb("+t+", "+n+", "+r+")";var e,t,n,r,o},e.prototype.toHsl=function(){return Xg(Qg(this.rgba))},e.prototype.toHslString=function(){return t=(e=Xg(Qg(this.rgba))).h,n=e.s,r=e.l,(o=e.a)<1?"hsla("+t+", "+n+"%, "+r+"%, "+o+")":"hsl("+t+", "+n+"%, "+r+"%)";var e,t,n,r,o},e.prototype.toHsv=function(){return e=Kg(this.rgba),{h:Bg(e.h),s:Bg(e.s),v:Bg(e.v),a:Bg(e.a,3)};var e},e.prototype.invert=function(){return uv({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},e.prototype.saturate=function(e){return void 0===e&&(e=.1),uv(sv(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),uv(sv(this.rgba,-e))},e.prototype.grayscale=function(){return uv(sv(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),uv(lv(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),uv(lv(this.rgba,-e))},e.prototype.rotate=function(e){return void 0===e&&(e=15),this.hue(this.hue()+e)},e.prototype.alpha=function(e){return"number"==typeof e?uv({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):Bg(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=Qg(this.rgba);return"number"==typeof e?uv({h:e,s:t.s,l:t.l,a:t.a}):Bg(t.h)},e.prototype.isEqual=function(e){return this.toHex()===uv(e).toHex()},e}(),uv=function(e){return e instanceof cv?e:new cv(e)},dv=[],pv=function(e){e.forEach((function(e){dv.indexOf(e)<0&&(e(cv,rv),dv.push(e))}))};function fv(e,t){var n={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},r={};for(var o in n)r[n[o]]=o;var i={};e.prototype.toName=function(t){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var o,s,a=r[this.toHex()];if(a)return a;if(null==t?void 0:t.closest){var l=this.toRgb(),c=1/0,u="black";if(!i.length)for(var d in n)i[d]=new e(n[d]).toRgb();for(var p in n){var f=(o=l,s=i[p],Math.pow(o.r-s.r,2)+Math.pow(o.g-s.g,2)+Math.pow(o.b-s.b,2));f{const t={};for(const n in e)t[n.toLowerCase()]=e[n];return t}));const jv={body:13,caption:10,footnote:11,largeTitle:28,subheadline:12,title:20},Ev=[1,2,3,4,5,6].flatMap((e=>[e,e.toString()]));function Pv(e=13){if(e in jv)return Pv(jv[e]);if("number"!=typeof e){const t=parseFloat(e);if(Number.isNaN(t))return e;e=t}return`calc(${`(${e} / 13)`} * ${Pl.fontSize})`}function Tv(e=3){if(!Ev.includes(e))return Pv(e);return Pl[`fontSizeH${e}`]}var Rv={name:"50zrmy",styles:"text-transform:uppercase"};function Iv(t){const{adjustLineHeightForInnerControls:n,align:r,children:o,className:i,color:s,ellipsizeMode:a,isDestructive:l=!1,display:u,highlightEscape:d=!1,highlightCaseSensitive:p=!1,highlightWords:f,highlightSanitize:h,isBlock:m=!1,letterSpacing:g,lineHeight:v,optimizeReadabilityFor:b,size:x,truncate:y=!1,upperCase:w=!1,variant:_,weight:S=Pl.fontWeight,...C}=Ya(t,"Text");let k=o;const j=Array.isArray(f),E="caption"===x;if(j){if("string"!=typeof o)throw new TypeError("`children` of `Text` must only be `string` types when `highlightWords` is defined");k=function({activeClassName:e="",activeIndex:t=-1,activeStyle:n,autoEscape:r,caseSensitive:o=!1,children:i,findChunks:s,highlightClassName:a="",highlightStyle:l={},highlightTag:u="mark",sanitize:d,searchWords:p=[],unhighlightClassName:f="",unhighlightStyle:h}){if(!i)return null;if("string"!=typeof i)return i;const m=i,g=(0,Cv.findAll)({autoEscape:r,caseSensitive:o,findChunks:s,sanitize:d,searchWords:p,textToHighlight:m}),v=u;let b,x=-1,y="";const w=g.map(((r,i)=>{const s=m.substr(r.start,r.end-r.start);if(r.highlight){let r;x++,r="object"==typeof a?o?a[s]:(a=kv(a))[s.toLowerCase()]:a;const u=x===+t;y=`${r} ${u?e:""}`,b=!0===u&&null!==n?Object.assign({},l,n):l;const d={children:s,className:y,key:i,style:b};return"string"!=typeof v&&(d.highlightIndex=x),(0,c.createElement)(v,d)}return(0,c.createElement)("span",{children:s,className:f,key:i,style:h})}));return w}({autoEscape:d,children:o,caseSensitive:p,searchWords:f,sanitize:h})}const P=qa();let T;!0===y&&(T="auto"),!1===y&&(T="none");const R=zg({...C,className:(0,c.useMemo)((()=>{const t={},o=function(e,t){if(t)return t;if(!e)return;let n=`calc(${Pl.controlHeight} + ${yl(2)})`;switch(e){case"large":n=`calc(${Pl.controlHeightLarge} + ${yl(2)})`;break;case"small":n=`calc(${Pl.controlHeightSmall} + ${yl(2)})`;break;case"xSmall":n=`calc(${Pl.controlHeightXSmall} + ${yl(2)})`}return n}(n,v);if(t.Base=bl({color:s,display:u,fontSize:Pv(x),fontWeight:S,lineHeight:o,letterSpacing:g,textAlign:r},"",""),t.upperCase=Rv,t.optimalTextColor=null,b){const e="dark"===gv(b);t.optimalTextColor=bl(e?{color:kl.gray[900]}:{color:kl.white},"","")}return P(vv,t.Base,t.optimalTextColor,l&&yv,!!j&&_v,m&&bv,E&&wv,_&&e[_],w&&t.upperCase,i)}),[n,r,i,s,P,u,m,E,l,j,g,v,b,x,w,_,S]),children:o,ellipsizeMode:a||T});return!y&&Array.isArray(o)&&(k=c.Children.map(o,(e=>{if("object"!=typeof e||null===e||!("props"in e))return e;return el(e,["Link"])?(0,c.cloneElement)(e,{size:e.props.size||"inherit"}):e}))),{...R,children:y?R.children:k}}const Nv=Xa((function(e,t){const n=Iv(e);return(0,wt.jsx)(dl,{as:"span",...n,ref:t})}),"Text");const Mv={name:"9amh4a",styles:"font-size:11px;font-weight:500;line-height:1.4;text-transform:uppercase"};const Av=cl("span",{target:"em5sgkm8"})({name:"pvvbxf",styles:"box-sizing:border-box;display:block"}),Dv=cl("span",{target:"em5sgkm7"})({name:"jgf79h",styles:"align-items:center;align-self:stretch;box-sizing:border-box;display:flex"}),Ov=({disabled:e,isBorderless:t})=>t?"transparent":e?kl.ui.borderDisabled:kl.ui.border,zv=cl("div",{target:"em5sgkm6"})("&&&{box-sizing:border-box;border-color:",Ov,";border-radius:inherit;border-style:solid;border-width:1px;bottom:0;left:0;margin:0;padding:0;pointer-events:none;position:absolute;right:0;top:0;",Sg({paddingLeft:2}),";}"),Lv=cl(mg,{target:"em5sgkm5"})("box-sizing:border-box;position:relative;border-radius:",Pl.radiusSmall,";padding-top:0;&:focus-within:not( :has( :is( ",Av,", ",Dv," ):focus-within ) ){",zv,"{border-color:",kl.ui.borderFocus,";box-shadow:",Pl.controlBoxShadowFocus,";outline:2px solid transparent;outline-offset:-2px;}}"),Fv=({disabled:e})=>bl({backgroundColor:e?kl.ui.backgroundDisabled:kl.ui.background},"","");var Bv={name:"1d3w5wq",styles:"width:100%"};const Vv=({__unstableInputWidth:e,labelPosition:t})=>e?"side"===t?"":bl("edge"===t?{flex:`0 0 ${e}`}:{width:e},"",""):Bv,$v=cl("div",{target:"em5sgkm4"})("align-items:center;box-sizing:border-box;border-radius:inherit;display:flex;flex:1;position:relative;",Fv," ",Vv,";"),Hv=({disabled:e})=>e?bl({color:kl.ui.textDisabled},"",""):"",Wv=({inputSize:e})=>{const t={default:"13px",small:"11px",compact:"13px","__unstable-large":"13px"},n=t[e]||t.default;return n?bl("font-size:","16px",";@media ( min-width: 600px ){font-size:",n,";}",""):""},Uv=({inputSize:e,__next40pxDefaultSize:t})=>{const n={default:{height:40,lineHeight:1,minHeight:40,paddingLeft:Pl.controlPaddingX,paddingRight:Pl.controlPaddingX},small:{height:24,lineHeight:1,minHeight:24,paddingLeft:Pl.controlPaddingXSmall,paddingRight:Pl.controlPaddingXSmall},compact:{height:32,lineHeight:1,minHeight:32,paddingLeft:Pl.controlPaddingXSmall,paddingRight:Pl.controlPaddingXSmall},"__unstable-large":{height:40,lineHeight:1,minHeight:40,paddingLeft:Pl.controlPaddingX,paddingRight:Pl.controlPaddingX}};return t||(n.default=n.compact),n[e]||n.default},Gv=e=>bl(Uv(e),"",""),Kv=({paddingInlineStart:e,paddingInlineEnd:t})=>bl({paddingInlineStart:e,paddingInlineEnd:t},"",""),qv=({isDragging:e,dragCursor:t})=>{let n,r;return e&&(n=bl("cursor:",t,";user-select:none;&::-webkit-outer-spin-button,&::-webkit-inner-spin-button{-webkit-appearance:none!important;margin:0!important;}","")),e&&t&&(r=bl("&:active{cursor:",t,";}","")),bl(n," ",r,";","")},Yv=cl("input",{target:"em5sgkm3"})("&&&{background-color:transparent;box-sizing:border-box;border:none;box-shadow:none!important;color:",kl.theme.foreground,";display:block;font-family:inherit;margin:0;outline:none;width:100%;",qv," ",Hv," ",Wv," ",Gv," ",Kv," &::-webkit-input-placeholder{line-height:normal;}}"),Xv=cl(Nv,{target:"em5sgkm2"})("&&&{",Mv,";box-sizing:border-box;display:block;padding-top:0;padding-bottom:0;max-width:100%;z-index:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}"),Zv=e=>(0,wt.jsx)(Xv,{...e,as:"label"}),Qv=cl(Tg,{target:"em5sgkm1"})({name:"1b6uupn",styles:"max-width:calc( 100% - 10px )"}),Jv=({variant:e="default",size:t,__next40pxDefaultSize:n,isPrefix:r})=>{const{paddingLeft:o}=Uv({inputSize:t,__next40pxDefaultSize:n}),i=r?"paddingInlineStart":"paddingInlineEnd";return bl("default"===e?{[i]:o}:{display:"flex",[i]:o-4},"","")},eb=cl("div",{target:"em5sgkm0"})(Jv,";");const tb=(0,c.memo)((function({disabled:e=!1,isBorderless:t=!1}){return(0,wt.jsx)(zv,{"aria-hidden":"true",className:"components-input-control__backdrop",disabled:e,isBorderless:t})})),nb=tb;function rb({children:e,hideLabelFromVision:t,htmlFor:n,...r}){return e?t?(0,wt.jsx)(pl,{as:"label",htmlFor:n,children:e}):(0,wt.jsx)(Qv,{children:(0,wt.jsx)(Zv,{htmlFor:n,...r,children:e})}):null}function ob(e){const{__next36pxDefaultSize:t,__next40pxDefaultSize:n,...r}=e;return{...r,__next40pxDefaultSize:null!=n?n:t}}function ib(e){const t={};switch(e){case"top":t.direction="column",t.expanded=!1,t.gap=0;break;case"bottom":t.direction="column-reverse",t.expanded=!1,t.gap=0;break;case"edge":t.justify="space-between"}return t}function sb(e,t){const{__next40pxDefaultSize:n,__unstableInputWidth:r,children:o,className:i,disabled:s=!1,hideLabelFromVision:a=!1,labelPosition:u,id:d,isBorderless:p=!1,label:f,prefix:h,size:m="default",suffix:g,...v}=ob(Ya(e,"InputBase")),b=function(e){const t=(0,l.useInstanceId)(sb);return e||`input-base-control-${t}`}(d),x=a||!f,y=(0,c.useMemo)((()=>({InputControlPrefixWrapper:{__next40pxDefaultSize:n,size:m},InputControlSuffixWrapper:{__next40pxDefaultSize:n,size:m}})),[n,m]);return(0,wt.jsxs)(Lv,{...v,...ib(u),className:i,gap:2,ref:t,children:[(0,wt.jsx)(rb,{className:"components-input-control__label",hideLabelFromVision:a,labelPosition:u,htmlFor:b,children:f}),(0,wt.jsxs)($v,{__unstableInputWidth:r,className:"components-input-control__container",disabled:s,hideLabel:x,labelPosition:u,children:[(0,wt.jsxs)(is,{value:y,children:[h&&(0,wt.jsx)(Av,{className:"components-input-control__prefix",children:h}),o,g&&(0,wt.jsx)(Dv,{className:"components-input-control__suffix",children:g})]}),(0,wt.jsx)(nb,{disabled:s,isBorderless:p})]})]})}const ab=Xa(sb,"InputBase");const lb={toVector:(e,t)=>(void 0===e&&(e=t),Array.isArray(e)?e:[e,e]),add:(e,t)=>[e[0]+t[0],e[1]+t[1]],sub:(e,t)=>[e[0]-t[0],e[1]-t[1]],addTo(e,t){e[0]+=t[0],e[1]+=t[1]},subTo(e,t){e[0]-=t[0],e[1]-=t[1]}};function cb(e,t,n){return 0===t||Math.abs(t)===1/0?Math.pow(e,5*n):e*t*n/(t+n*e)}function ub(e,t,n,r=.15){return 0===r?function(e,t,n){return Math.max(t,Math.min(e,n))}(e,t,n):en?+cb(e-n,n-t,r)+n:e}function db(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}function pb(e,t,n){return(t=db(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function hb(e){for(var t=1;t{var n,r;return t.target===e.currentTarget||(null===(n=e.currentTarget)||void 0===n||null===(r=n.contains)||void 0===r?void 0:r.call(n,t.target))}))}(e).map((e=>e.identifier))}function kb(e){const t=Sb(e);return wb(e)?t.identifier:t.pointerId}function jb(e){const t=Sb(e);return[t.clientX,t.clientY]}function Eb(e,...t){return"function"==typeof e?e(...t):e}function Pb(){}function Tb(...e){return 0===e.length?Pb:1===e.length?e[0]:function(){let t;for(const n of e)t=n.apply(this,arguments)||t;return t}}function Rb(e,t){return Object.assign({},t,e||{})}class Ib{constructor(e,t,n){this.ctrl=e,this.args=t,this.key=n,this.state||(this.state={},this.computeValues([0,0]),this.computeInitial(),this.init&&this.init(),this.reset())}get state(){return this.ctrl.state[this.key]}set state(e){this.ctrl.state[this.key]=e}get shared(){return this.ctrl.state.shared}get eventStore(){return this.ctrl.gestureEventStores[this.key]}get timeoutStore(){return this.ctrl.gestureTimeoutStores[this.key]}get config(){return this.ctrl.config[this.key]}get sharedConfig(){return this.ctrl.config.shared}get handler(){return this.ctrl.handlers[this.key]}reset(){const{state:e,shared:t,ingKey:n,args:r}=this;t[n]=e._active=e.active=e._blocked=e._force=!1,e._step=[!1,!1],e.intentional=!1,e._movement=[0,0],e._distance=[0,0],e._direction=[0,0],e._delta=[0,0],e._bounds=[[-1/0,1/0],[-1/0,1/0]],e.args=r,e.axis=void 0,e.memo=void 0,e.elapsedTime=e.timeDelta=0,e.direction=[0,0],e.distance=[0,0],e.overflow=[0,0],e._movementBound=[!1,!1],e.velocity=[0,0],e.movement=[0,0],e.delta=[0,0],e.timeStamp=0}start(e){const t=this.state,n=this.config;t._active||(this.reset(),this.computeInitial(),t._active=!0,t.target=e.target,t.currentTarget=e.currentTarget,t.lastOffset=n.from?Eb(n.from,t):t.offset,t.offset=t.lastOffset,t.startTime=t.timeStamp=e.timeStamp)}computeValues(e){const t=this.state;t._values=e,t.values=this.config.transform(e)}computeInitial(){const e=this.state;e._initial=e._values,e.initial=e.values}compute(e){const{state:t,config:n,shared:r}=this;t.args=this.args;let o=0;if(e&&(t.event=e,n.preventDefault&&e.cancelable&&t.event.preventDefault(),t.type=e.type,r.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,r.locked=!!document.pointerLockElement,Object.assign(r,function(e){const t={};if("buttons"in e&&(t.buttons=e.buttons),"shiftKey"in e){const{shiftKey:n,altKey:r,metaKey:o,ctrlKey:i}=e;Object.assign(t,{shiftKey:n,altKey:r,metaKey:o,ctrlKey:i})}return t}(e)),r.down=r.pressed=r.buttons%2==1||r.touches>0,o=e.timeStamp-t.timeStamp,t.timeStamp=e.timeStamp,t.elapsedTime=t.timeStamp-t.startTime),t._active){const e=t._delta.map(Math.abs);lb.addTo(t._distance,e)}this.axisIntent&&this.axisIntent(e);const[i,s]=t._movement,[a,l]=n.threshold,{_step:c,values:u}=t;if(n.hasCustomTransform?(!1===c[0]&&(c[0]=Math.abs(i)>=a&&u[0]),!1===c[1]&&(c[1]=Math.abs(s)>=l&&u[1])):(!1===c[0]&&(c[0]=Math.abs(i)>=a&&Math.sign(i)*a),!1===c[1]&&(c[1]=Math.abs(s)>=l&&Math.sign(s)*l)),t.intentional=!1!==c[0]||!1!==c[1],!t.intentional)return;const d=[0,0];if(n.hasCustomTransform){const[e,t]=u;d[0]=!1!==c[0]?e-c[0]:0,d[1]=!1!==c[1]?t-c[1]:0}else d[0]=!1!==c[0]?i-c[0]:0,d[1]=!1!==c[1]?s-c[1]:0;this.restrictToAxis&&!t._blocked&&this.restrictToAxis(d);const p=t.offset,f=t._active&&!t._blocked||t.active;f&&(t.first=t._active&&!t.active,t.last=!t._active&&t.active,t.active=r[this.ingKey]=t._active,e&&(t.first&&("bounds"in n&&(t._bounds=Eb(n.bounds,t)),this.setup&&this.setup()),t.movement=d,this.computeOffset()));const[h,m]=t.offset,[[g,v],[b,x]]=t._bounds;t.overflow=[hv?1:0,mx?1:0],t._movementBound[0]=!!t.overflow[0]&&(!1===t._movementBound[0]?t._movement[0]:t._movementBound[0]),t._movementBound[1]=!!t.overflow[1]&&(!1===t._movementBound[1]?t._movement[1]:t._movementBound[1]);const y=t._active&&n.rubberband||[0,0];if(t.offset=function(e,[t,n],[r,o]){const[[i,s],[a,l]]=e;return[ub(t,i,s,r),ub(n,a,l,o)]}(t._bounds,t.offset,y),t.delta=lb.sub(t.offset,p),this.computeMovement(),f&&(!t.last||o>32)){t.delta=lb.sub(t.offset,p);const e=t.delta.map(Math.abs);lb.addTo(t.distance,e),t.direction=t.delta.map(Math.sign),t._direction=t._delta.map(Math.sign),!t.first&&o>0&&(t.velocity=[e[0]/o,e[1]/o],t.timeDelta=o)}}emit(){const e=this.state,t=this.shared,n=this.config;if(e._active||this.clean(),(e._blocked||!e.intentional)&&!e._force&&!n.triggerAllEvents)return;const r=this.handler(hb(hb(hb({},t),e),{},{[this.aliasKey]:e.values}));void 0!==r&&(e.memo=r)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}class Nb extends Ib{constructor(...e){super(...e),pb(this,"aliasKey","xy")}reset(){super.reset(),this.state.axis=void 0}init(){this.state.offset=[0,0],this.state.lastOffset=[0,0]}computeOffset(){this.state.offset=lb.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=lb.sub(this.state.offset,this.state.lastOffset)}axisIntent(e){const t=this.state,n=this.config;if(!t.axis&&e){const r="object"==typeof n.axisThreshold?n.axisThreshold[_b(e)]:n.axisThreshold;t.axis=function([e,t],n){const r=Math.abs(e),o=Math.abs(t);return r>o&&r>n?"x":o>r&&o>n?"y":void 0}(t._movement,r)}t._blocked=(n.lockDirection||!!n.axis)&&!t.axis||!!n.axis&&n.axis!==t.axis}restrictToAxis(e){if(this.config.axis||this.config.lockDirection)switch(this.state.axis){case"x":e[1]=0;break;case"y":e[0]=0}}}const Mb=e=>e,Ab={enabled:(e=!0)=>e,eventOptions:(e,t,n)=>hb(hb({},n.shared.eventOptions),e),preventDefault:(e=!1)=>e,triggerAllEvents:(e=!1)=>e,rubberband(e=0){switch(e){case!0:return[.15,.15];case!1:return[0,0];default:return lb.toVector(e)}},from:e=>"function"==typeof e?e:null!=e?lb.toVector(e):void 0,transform(e,t,n){const r=e||n.shared.transform;return this.hasCustomTransform=!!r,r||Mb},threshold:e=>lb.toVector(e,0)};const Db=hb(hb({},Ab),{},{axis(e,t,{axis:n}){if(this.lockDirection="lock"===n,!this.lockDirection)return n},axisThreshold:(e=0)=>e,bounds(e={}){if("function"==typeof e)return t=>Db.bounds(e(t));if("current"in e)return()=>e.current;if("function"==typeof HTMLElement&&e instanceof HTMLElement)return e;const{left:t=-1/0,right:n=1/0,top:r=-1/0,bottom:o=1/0}=e;return[[t,n],[r,o]]}}),Ob={ArrowRight:(e,t=1)=>[e*t,0],ArrowLeft:(e,t=1)=>[-1*e*t,0],ArrowUp:(e,t=1)=>[0,-1*e*t],ArrowDown:(e,t=1)=>[0,e*t]};const zb="undefined"!=typeof window&&window.document&&window.document.createElement;function Lb(){return zb&&"ontouchstart"in window}const Fb={isBrowser:zb,gesture:function(){try{return"constructor"in GestureEvent}catch(e){return!1}}(),touch:Lb(),touchscreen:Lb()||zb&&window.navigator.maxTouchPoints>1,pointer:zb&&"onpointerdown"in window,pointerLock:zb&&"exitPointerLock"in window.document},Bb={mouse:0,touch:0,pen:8},Vb=hb(hb({},Db),{},{device(e,t,{pointer:{touch:n=!1,lock:r=!1,mouse:o=!1}={}}){return this.pointerLock=r&&Fb.pointerLock,Fb.touch&&n?"touch":this.pointerLock?"mouse":Fb.pointer&&!o?"pointer":Fb.touch?"touch":"mouse"},preventScrollAxis(e,t,{preventScroll:n}){if(this.preventScrollDelay="number"==typeof n?n:n||void 0===n&&e?250:void 0,Fb.touchscreen&&!1!==n)return e||(void 0!==n?"y":void 0)},pointerCapture(e,t,{pointer:{capture:n=!0,buttons:r=1,keys:o=!0}={}}){return this.pointerButtons=r,this.keys=o,!this.pointerLock&&"pointer"===this.device&&n},threshold(e,t,{filterTaps:n=!1,tapsThreshold:r=3,axis:o}){const i=lb.toVector(e,n?r:o?1:0);return this.filterTaps=n,this.tapsThreshold=r,i},swipe({velocity:e=.5,distance:t=50,duration:n=250}={}){return{velocity:this.transform(lb.toVector(e)),distance:this.transform(lb.toVector(t)),duration:n}},delay(e=0){switch(e){case!0:return 180;case!1:return 0;default:return e}},axisThreshold:e=>e?hb(hb({},Bb),e):Bb,keyboardDisplacement:(e=10)=>e});hb(hb({},Ab),{},{device(e,t,{shared:n,pointer:{touch:r=!1}={}}){if(n.target&&!Fb.touch&&Fb.gesture)return"gesture";if(Fb.touch&&r)return"touch";if(Fb.touchscreen){if(Fb.pointer)return"pointer";if(Fb.touch)return"touch"}},bounds(e,t,{scaleBounds:n={},angleBounds:r={}}){const o=e=>{const t=Rb(Eb(n,e),{min:-1/0,max:1/0});return[t.min,t.max]},i=e=>{const t=Rb(Eb(r,e),{min:-1/0,max:1/0});return[t.min,t.max]};return"function"!=typeof n&&"function"!=typeof r?[o(),i()]:e=>[o(e),i(e)]},threshold(e,t,n){this.lockDirection="lock"===n.axis;return lb.toVector(e,this.lockDirection?[.1,3]:0)},modifierKey:e=>void 0===e?"ctrlKey":e,pinchOnWheel:(e=!0)=>e});hb(hb({},Db),{},{mouseOnly:(e=!0)=>e});hb(hb({},Db),{},{mouseOnly:(e=!0)=>e});const $b=new Map,Hb=new Map;const Wb={key:"drag",engine:class extends Nb{constructor(...e){super(...e),pb(this,"ingKey","dragging")}reset(){super.reset();const e=this.state;e._pointerId=void 0,e._pointerActive=!1,e._keyboardActive=!1,e._preventScroll=!1,e._delayed=!1,e.swipe=[0,0],e.tap=!1,e.canceled=!1,e.cancel=this.cancel.bind(this)}setup(){const e=this.state;if(e._bounds instanceof HTMLElement){const t=e._bounds.getBoundingClientRect(),n=e.currentTarget.getBoundingClientRect(),r={left:t.left-n.left+e.offset[0],right:t.right-n.right+e.offset[0],top:t.top-n.top+e.offset[1],bottom:t.bottom-n.bottom+e.offset[1]};e._bounds=Db.bounds(r)}}cancel(){const e=this.state;e.canceled||(e.canceled=!0,e._active=!1,setTimeout((()=>{this.compute(),this.emit()}),0))}setActive(){this.state._active=this.state._pointerActive||this.state._keyboardActive}clean(){this.pointerClean(),this.state._pointerActive=!1,this.state._keyboardActive=!1,super.clean()}pointerDown(e){const t=this.config,n=this.state;if(null!=e.buttons&&(Array.isArray(t.pointerButtons)?!t.pointerButtons.includes(e.buttons):-1!==t.pointerButtons&&t.pointerButtons!==e.buttons))return;const r=this.ctrl.setEventIds(e);t.pointerCapture&&e.target.setPointerCapture(e.pointerId),r&&r.size>1&&n._pointerActive||(this.start(e),this.setupPointer(e),n._pointerId=kb(e),n._pointerActive=!0,this.computeValues(jb(e)),this.computeInitial(),t.preventScrollAxis&&"mouse"!==_b(e)?(n._active=!1,this.setupScrollPrevention(e)):t.delay>0?(this.setupDelayTrigger(e),t.triggerAllEvents&&(this.compute(e),this.emit())):this.startPointerDrag(e))}startPointerDrag(e){const t=this.state;t._active=!0,t._preventScroll=!0,t._delayed=!1,this.compute(e),this.emit()}pointerMove(e){const t=this.state,n=this.config;if(!t._pointerActive)return;const r=kb(e);if(void 0!==t._pointerId&&r!==t._pointerId)return;const o=jb(e);return document.pointerLockElement===e.target?t._delta=[e.movementX,e.movementY]:(t._delta=lb.sub(o,t._values),this.computeValues(o)),lb.addTo(t._movement,t._delta),this.compute(e),t._delayed&&t.intentional?(this.timeoutStore.remove("dragDelay"),t.active=!1,void this.startPointerDrag(e)):n.preventScrollAxis&&!t._preventScroll?t.axis?t.axis===n.preventScrollAxis||"xy"===n.preventScrollAxis?(t._active=!1,void this.clean()):(this.timeoutStore.remove("startPointerDrag"),void this.startPointerDrag(e)):void 0:void this.emit()}pointerUp(e){this.ctrl.setEventIds(e);try{this.config.pointerCapture&&e.target.hasPointerCapture(e.pointerId)&&e.target.releasePointerCapture(e.pointerId)}catch(e){0}const t=this.state,n=this.config;if(!t._active||!t._pointerActive)return;const r=kb(e);if(void 0!==t._pointerId&&r!==t._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(e);const[o,i]=t._distance;if(t.tap=o<=n.tapsThreshold&&i<=n.tapsThreshold,t.tap&&n.filterTaps)t._force=!0;else{const[e,r]=t._delta,[o,i]=t._movement,[s,a]=n.swipe.velocity,[l,c]=n.swipe.distance,u=n.swipe.duration;if(t.elapsedTimes&&Math.abs(o)>l&&(t.swipe[0]=Math.sign(e)),u>a&&Math.abs(i)>c&&(t.swipe[1]=Math.sign(r))}}this.emit()}pointerClick(e){!this.state.tap&&e.detail>0&&(e.preventDefault(),e.stopPropagation())}setupPointer(e){const t=this.config,n=t.device;t.pointerLock&&e.currentTarget.requestPointerLock(),t.pointerCapture||(this.eventStore.add(this.sharedConfig.window,n,"change",this.pointerMove.bind(this)),this.eventStore.add(this.sharedConfig.window,n,"end",this.pointerUp.bind(this)),this.eventStore.add(this.sharedConfig.window,n,"cancel",this.pointerUp.bind(this)))}pointerClean(){this.config.pointerLock&&document.pointerLockElement===this.state.currentTarget&&document.exitPointerLock()}preventScroll(e){this.state._preventScroll&&e.cancelable&&e.preventDefault()}setupScrollPrevention(e){this.state._preventScroll=!1,function(e){"persist"in e&&"function"==typeof e.persist&&e.persist()}(e);const t=this.eventStore.add(this.sharedConfig.window,"touch","change",this.preventScroll.bind(this),{passive:!1});this.eventStore.add(this.sharedConfig.window,"touch","end",t),this.eventStore.add(this.sharedConfig.window,"touch","cancel",t),this.timeoutStore.add("startPointerDrag",this.startPointerDrag.bind(this),this.config.preventScrollDelay,e)}setupDelayTrigger(e){this.state._delayed=!0,this.timeoutStore.add("dragDelay",(()=>{this.state._step=[0,0],this.startPointerDrag(e)}),this.config.delay)}keyDown(e){const t=Ob[e.key];if(t){const n=this.state,r=e.shiftKey?10:e.altKey?.1:1;this.start(e),n._delta=t(this.config.keyboardDisplacement,r),n._keyboardActive=!0,lb.addTo(n._movement,n._delta),this.compute(e),this.emit()}}keyUp(e){e.key in Ob&&(this.state._keyboardActive=!1,this.setActive(),this.compute(e),this.emit())}bind(e){const t=this.config.device;e(t,"start",this.pointerDown.bind(this)),this.config.pointerCapture&&(e(t,"change",this.pointerMove.bind(this)),e(t,"end",this.pointerUp.bind(this)),e(t,"cancel",this.pointerUp.bind(this)),e("lostPointerCapture","",this.pointerUp.bind(this))),this.config.keys&&(e("key","down",this.keyDown.bind(this)),e("key","up",this.keyUp.bind(this))),this.config.filterTaps&&e("click","",this.pointerClick.bind(this),{capture:!0,passive:!1})}},resolver:Vb};function Ub(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}const Gb={target(e){if(e)return()=>"current"in e?e.current:e},enabled:(e=!0)=>e,window:(e=(Fb.isBrowser?window:void 0))=>e,eventOptions:({passive:e=!0,capture:t=!1}={})=>({passive:e,capture:t}),transform:e=>e},Kb=["target","eventOptions","window","enabled","transform"];function qb(e={},t){const n={};for(const[r,o]of Object.entries(t))switch(typeof o){case"function":n[r]=o.call(n,e[r],r,e);break;case"object":n[r]=qb(e[r],o);break;case"boolean":o&&(n[r]=e[r])}return n}class Yb{constructor(e,t){pb(this,"_listeners",new Set),this._ctrl=e,this._gestureKey=t}add(e,t,n,r,o){const i=this._listeners,s=function(e,t=""){const n=mb[e];return e+(n&&n[t]||t)}(t,n),a=hb(hb({},this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{}),o);e.addEventListener(s,r,a);const l=()=>{e.removeEventListener(s,r,a),i.delete(l)};return i.add(l),l}clean(){this._listeners.forEach((e=>e())),this._listeners.clear()}}class Xb{constructor(){pb(this,"_timeouts",new Map)}add(e,t,n=140,...r){this.remove(e),this._timeouts.set(e,window.setTimeout(t,n,...r))}remove(e){const t=this._timeouts.get(e);t&&window.clearTimeout(t)}clean(){this._timeouts.forEach((e=>{window.clearTimeout(e)})),this._timeouts.clear()}}class Zb{constructor(e){pb(this,"gestures",new Set),pb(this,"_targetEventStore",new Yb(this)),pb(this,"gestureEventStores",{}),pb(this,"gestureTimeoutStores",{}),pb(this,"handlers",{}),pb(this,"config",{}),pb(this,"pointerIds",new Set),pb(this,"touchIds",new Set),pb(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),function(e,t){t.drag&&Qb(e,"drag");t.wheel&&Qb(e,"wheel");t.scroll&&Qb(e,"scroll");t.move&&Qb(e,"move");t.pinch&&Qb(e,"pinch");t.hover&&Qb(e,"hover")}(this,e)}setEventIds(e){return wb(e)?(this.touchIds=new Set(Cb(e)),this.touchIds):"pointerId"in e?("pointerup"===e.type||"pointercancel"===e.type?this.pointerIds.delete(e.pointerId):"pointerdown"===e.type&&this.pointerIds.add(e.pointerId),this.pointerIds):void 0}applyHandlers(e,t){this.handlers=e,this.nativeHandlers=t}applyConfig(e,t){this.config=function(e,t,n={}){const r=e,{target:o,eventOptions:i,window:s,enabled:a,transform:l}=r,c=Ub(r,Kb);if(n.shared=qb({target:o,eventOptions:i,window:s,enabled:a,transform:l},Gb),t){const e=Hb.get(t);n[t]=qb(hb({shared:n.shared},c),e)}else for(const e in c){const t=Hb.get(e);t&&(n[e]=qb(hb({shared:n.shared},c[e]),t))}return n}(e,t,this.config)}clean(){this._targetEventStore.clean();for(const e of this.gestures)this.gestureEventStores[e].clean(),this.gestureTimeoutStores[e].clean()}effect(){return this.config.shared.target&&this.bind(),()=>this._targetEventStore.clean()}bind(...e){const t=this.config.shared,n={};let r;if(!t.target||(r=t.target(),r)){if(t.enabled){for(const t of this.gestures){const o=this.config[t],i=Jb(n,o.eventOptions,!!r);if(o.enabled){new($b.get(t))(this,e,t).bind(i)}}const o=Jb(n,t.eventOptions,!!r);for(const t in this.nativeHandlers)o(t,"",(n=>this.nativeHandlers[t](hb(hb({},this.state.shared),{},{event:n,args:e}))),void 0,!0)}for(const e in n)n[e]=Tb(...n[e]);if(!r)return n;for(const e in n){const{device:t,capture:o,passive:i}=yb(e);this._targetEventStore.add(r,t,"",n[e],{capture:o,passive:i})}}}}function Qb(e,t){e.gestures.add(t),e.gestureEventStores[t]=new Yb(e,t),e.gestureTimeoutStores[t]=new Xb}const Jb=(e,t,n)=>(r,o,i,s={},a=!1)=>{var l,c;const u=null!==(l=s.capture)&&void 0!==l?l:t.capture,d=null!==(c=s.passive)&&void 0!==c?c:t.passive;let p=a?r:bb(r,o,u);n&&d&&(p+="Passive"),e[p]=e[p]||[],e[p].push(i)};function ex(e,t={},n,r){const o=$().useMemo((()=>new Zb(e)),[]);if(o.applyHandlers(e,r),o.applyConfig(t,n),$().useEffect(o.effect.bind(o)),$().useEffect((()=>o.clean.bind(o)),[]),void 0===t.target)return o.bind.bind(o)}function tx(e,t){var n;return n=Wb,$b.set(n.key,n.engine),Hb.set(n.key,n.resolver),ex({drag:e},t||{},"drag")}const nx=e=>e,rx={error:null,initialValue:"",isDirty:!1,isDragEnabled:!1,isDragging:!1,isPressEnterToChange:!1,value:""},ox="CHANGE",ix="COMMIT",sx="CONTROL",ax="DRAG_END",lx="DRAG_START",cx="DRAG",ux="INVALIDATE",dx="PRESS_DOWN",px="PRESS_ENTER",fx="PRESS_UP",hx="RESET";function mx(e=nx,t=rx,n){const[r,o]=(0,c.useReducer)((i=e,(e,t)=>{const n={...e};switch(t.type){case sx:return n.value=t.payload.value,n.isDirty=!1,n._event=void 0,n;case fx:case dx:n.isDirty=!1;break;case lx:n.isDragging=!0;break;case ax:n.isDragging=!1;break;case ox:n.error=null,n.value=t.payload.value,e.isPressEnterToChange&&(n.isDirty=!0);break;case ix:n.value=t.payload.value,n.isDirty=!1;break;case hx:n.error=null,n.isDirty=!1,n.value=t.payload.value||e.initialValue;break;case ux:n.error=t.payload.error}return n._event=t.payload.event,i(n,t)}),function(e=rx){const{value:t}=e;return{...rx,...e,initialValue:t}}(t));var i;const s=e=>(t,n)=>{o({type:e,payload:{value:t,event:n}})},a=e=>t=>{o({type:e,payload:{event:t}})},l=e=>t=>{o({type:e,payload:t})},u=s(ox),d=s(hx),p=s(ix),f=l(lx),h=l(cx),m=l(ax),g=a(fx),v=a(dx),b=a(px),x=(0,c.useRef)(r),y=(0,c.useRef)({value:t.value,onChangeHandler:n});return(0,c.useLayoutEffect)((()=>{x.current=r,y.current={value:t.value,onChangeHandler:n}})),(0,c.useLayoutEffect)((()=>{var e;void 0===x.current._event||r.value===y.current.value||r.isDirty||y.current.onChangeHandler(null!==(e=r.value)&&void 0!==e?e:"",{event:x.current._event})}),[r.value,r.isDirty]),(0,c.useLayoutEffect)((()=>{var e;t.value===x.current.value||x.current.isDirty||o({type:sx,payload:{value:null!==(e=t.value)&&void 0!==e?e:""}})}),[t.value]),{change:u,commit:p,dispatch:o,drag:h,dragEnd:m,dragStart:f,invalidate:(e,t)=>o({type:ux,payload:{error:e,event:t}}),pressDown:v,pressEnter:b,pressUp:g,reset:d,state:r}}function gx(e){return t=>{const{isComposing:n}="nativeEvent"in t?t.nativeEvent:t;n||229===t.keyCode||e(t)}}const vx=()=>{};const bx=(0,c.forwardRef)((function({disabled:e=!1,dragDirection:t="n",dragThreshold:n=10,id:r,isDragEnabled:o=!1,isPressEnterToChange:i=!1,onBlur:s=vx,onChange:a=vx,onDrag:l=vx,onDragEnd:u=vx,onDragStart:d=vx,onKeyDown:p=vx,onValidate:f=vx,size:h="default",stateReducer:m=e=>e,value:g,type:v,...b},x){const{state:y,change:w,commit:_,drag:S,dragEnd:C,dragStart:k,invalidate:j,pressDown:E,pressEnter:P,pressUp:T,reset:R}=mx(m,{isDragEnabled:o,value:g,isPressEnterToChange:i},a),{value:I,isDragging:N,isDirty:M}=y,A=(0,c.useRef)(!1),D=function(e,t){const n=function(e){let t="ns-resize";switch(e){case"n":case"s":t="ns-resize";break;case"e":case"w":t="ew-resize"}return t}(t);return(0,c.useEffect)((()=>{document.documentElement.style.cursor=e?n:null}),[e,n]),n}(N,t),O=e=>{const t=e.currentTarget.value;try{f(t),_(t,e)}catch(t){j(t,e)}},z=tx((e=>{const{distance:t,dragging:n,event:r,target:o}=e;if(e.event={...e.event,target:o},t){if(r.stopPropagation(),!n)return u(e),void C(e);l(e),S(e),N||(d(e),k(e))}}),{axis:"e"===t||"w"===t?"x":"y",threshold:n,enabled:o,pointer:{capture:!1}}),L=o?z():{};let F;return"number"===v&&(F=e=>{b.onMouseDown?.(e),e.currentTarget!==e.currentTarget.ownerDocument.activeElement&&e.currentTarget.focus()}),(0,wt.jsx)(Yv,{...b,...L,className:"components-input-control__input",disabled:e,dragCursor:D,isDragging:N,id:r,onBlur:e=>{s(e),!M&&e.target.validity.valid||(A.current=!0,O(e))},onChange:e=>{const t=e.target.value;w(t,e)},onKeyDown:gx((e=>{const{key:t}=e;switch(p(e),t){case"ArrowUp":T(e);break;case"ArrowDown":E(e);break;case"Enter":P(e),i&&(e.preventDefault(),O(e));break;case"Escape":i&&M&&(e.preventDefault(),R(g,e))}})),onMouseDown:F,ref:x,inputSize:h,value:null!=I?I:"",type:v})})),xx=bx,yx={"default.fontFamily":"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif","default.fontSize":"13px","helpText.fontSize":"12px",mobileTextMinFontSize:"16px"};function wx(e){var t;return null!==(t=yx[e])&&void 0!==t?t:""}const _x={name:"kv6lnz",styles:"box-sizing:border-box;*,*::before,*::after{box-sizing:inherit;}"};const Sx=cl("div",{target:"ej5x27r4"})("font-family:",wx("default.fontFamily"),";font-size:",wx("default.fontSize"),";",_x,";"),Cx=({__nextHasNoMarginBottom:e=!1})=>!e&&bl("margin-bottom:",yl(2),";",""),kx=cl("div",{target:"ej5x27r3"})(Cx," .components-panel__row &{margin-bottom:inherit;}"),jx=bl(Mv,";display:block;margin-bottom:",yl(2),";padding:0;",""),Ex=cl("label",{target:"ej5x27r2"})(jx,";");var Px={name:"11yad0w",styles:"margin-bottom:revert"};const Tx=({__nextHasNoMarginBottom:e=!1})=>!e&&Px,Rx=cl("p",{target:"ej5x27r1"})("margin-top:",yl(2),";margin-bottom:0;font-size:",wx("helpText.fontSize"),";font-style:normal;color:",kl.gray[700],";",Tx,";"),Ix=cl("span",{target:"ej5x27r0"})(jx,";"),Nx=(0,c.forwardRef)(((e,t)=>{const{className:n,children:r,...o}=e;return(0,wt.jsx)(Ix,{ref:t,...o,className:s("components-base-control__label",n),children:r})})),Mx=Object.assign(Za((e=>{const{__nextHasNoMarginBottom:t=!1,__associatedWPComponentName:n="BaseControl",id:r,label:o,hideLabelFromVision:i=!1,help:s,className:a,children:l}=Ya(e,"BaseControl");return t||Fi()(`Bottom margin styles for wp.components.${n}`,{since:"6.7",version:"7.0",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version."}),(0,wt.jsxs)(Sx,{className:a,children:[(0,wt.jsxs)(kx,{className:"components-base-control__field",__nextHasNoMarginBottom:t,children:[o&&r&&(i?(0,wt.jsx)(pl,{as:"label",htmlFor:r,children:o}):(0,wt.jsx)(Ex,{className:"components-base-control__label",htmlFor:r,children:o})),o&&!r&&(i?(0,wt.jsx)(pl,{as:"label",children:o}):(0,wt.jsx)(Nx,{children:o})),l]}),!!s&&(0,wt.jsx)(Rx,{id:r?r+"__help":void 0,className:"components-base-control__help",__nextHasNoMarginBottom:t,children:s})]})}),"BaseControl"),{VisualLabel:Nx}),Ax=Mx,Dx=()=>{};const Ox=(0,c.forwardRef)((function(e,t){const{__next40pxDefaultSize:n,__unstableStateReducer:r=e=>e,__unstableInputWidth:o,className:i,disabled:a=!1,help:u,hideLabelFromVision:d=!1,id:p,isPressEnterToChange:f=!1,label:h,labelPosition:m="top",onChange:g=Dx,onValidate:v=Dx,onKeyDown:b=Dx,prefix:x,size:y="default",style:w,suffix:_,value:S,...C}=ob(e),k=function(e){const t=(0,l.useInstanceId)(Ox);return e||`inspector-input-control-${t}`}(p),j=s("components-input-control",i),E=function(e){const t=(0,c.useRef)(e.value),[n,r]=(0,c.useState)({}),o=void 0!==n.value?n.value:e.value;return(0,c.useLayoutEffect)((()=>{const{current:o}=t;t.current=e.value,void 0===n.value||n.isStale?n.isStale&&e.value!==o&&r({}):r({...n,isStale:!0})}),[e.value,n]),{value:o,onBlur:t=>{r({}),e.onBlur?.(t)},onChange:(t,n)=>{r((e=>Object.assign(e,{value:t,isStale:!1}))),e.onChange(t,n)}}}({value:S,onBlur:C.onBlur,onChange:g}),P=u?{"aria-describedby":`${k}__help`}:{};return(0,wt.jsx)(Ax,{className:j,help:u,id:k,__nextHasNoMarginBottom:!0,children:(0,wt.jsx)(ab,{__next40pxDefaultSize:n,__unstableInputWidth:o,disabled:a,gap:3,hideLabelFromVision:d,id:k,justify:"left",label:h,labelPosition:m,prefix:x,size:y,style:w,suffix:_,children:(0,wt.jsx)(xx,{...C,...P,__next40pxDefaultSize:n,className:"components-input-control__input",disabled:a,id:k,isPressEnterToChange:f,onKeyDown:b,onValidate:v,paddingInlineStart:x?yl(1):void 0,paddingInlineEnd:_?yl(1):void 0,ref:t,size:y,stateReducer:r,...E})})})})),zx=Ox;const Lx=function({icon:e,className:t,size:n=20,style:r={},...o}){const i=["dashicon","dashicons","dashicons-"+e,t].filter(Boolean).join(" "),s={...20!=n?{fontSize:`${n}px`,width:`${n}px`,height:`${n}px`}:{},...r};return(0,wt.jsx)("span",{className:i,style:s,...o})};const Fx=function({icon:e=null,size:t=("string"==typeof e?20:24),...r}){if("string"==typeof e)return(0,wt.jsx)(Lx,{icon:e,size:t,...r});if((0,c.isValidElement)(e)&&Lx===e.type)return(0,c.cloneElement)(e,{...r});if("function"==typeof e)return(0,c.createElement)(e,{size:t,...r});if(e&&("svg"===e.type||e.type===n.SVG)){const o={...e.props,width:t,height:t,...r};return(0,wt.jsx)(n.SVG,{...o})}return(0,c.isValidElement)(e)?(0,c.cloneElement)(e,{size:t,...r}):e},Bx=["onMouseDown","onClick"];const Vx=(0,c.forwardRef)((function(e,t){const{__next40pxDefaultSize:n,accessibleWhenDisabled:r,isBusy:o,isDestructive:i,className:a,disabled:c,icon:u,iconPosition:d="left",iconSize:p,showTooltip:f,tooltipPosition:h,shortcut:m,label:g,children:v,size:b="default",text:x,variant:y,description:w,..._}=function({__experimentalIsFocusable:e,isDefault:t,isPrimary:n,isSecondary:r,isTertiary:o,isLink:i,isPressed:s,isSmall:a,size:l,variant:c,describedBy:u,...d}){let p=l,f=c;const h={accessibleWhenDisabled:e,"aria-pressed":s,description:u};var m,g,v,b,x,y;return a&&(null!==(m=p)&&void 0!==m||(p="small")),n&&(null!==(g=f)&&void 0!==g||(f="primary")),o&&(null!==(v=f)&&void 0!==v||(f="tertiary")),r&&(null!==(b=f)&&void 0!==b||(f="secondary")),t&&(Fi()("wp.components.Button `isDefault` prop",{since:"5.4",alternative:'variant="secondary"'}),null!==(x=f)&&void 0!==x||(f="secondary")),i&&(null!==(y=f)&&void 0!==y||(f="link")),{...h,...d,size:p,variant:f}}(e),{href:S,target:C,"aria-checked":k,"aria-pressed":j,"aria-selected":E,...P}="href"in _?_:{href:void 0,target:void 0,..._},T=(0,l.useInstanceId)(Vx,"components-button__description"),R="string"==typeof v&&!!v||Array.isArray(v)&&v?.[0]&&null!==v[0]&&"components-tooltip"!==v?.[0]?.props?.className,I=s("components-button",a,{"is-next-40px-default-size":n,"is-secondary":"secondary"===y,"is-primary":"primary"===y,"is-small":"small"===b,"is-compact":"compact"===b,"is-tertiary":"tertiary"===y,"is-pressed":[!0,"true","mixed"].includes(j),"is-pressed-mixed":"mixed"===j,"is-busy":o,"is-link":"link"===y,"is-destructive":i,"has-text":!!u&&(R||x),"has-icon":!!u}),N=c&&!r,M=void 0===S||c?"button":"a",A="button"===M?{type:"button",disabled:N,"aria-checked":k,"aria-pressed":j,"aria-selected":E}:{},D="a"===M?{href:S,target:C}:{},O={};if(c&&r){A["aria-disabled"]=!0,D["aria-disabled"]=!0;for(const e of Bx)O[e]=e=>{e&&(e.stopPropagation(),e.preventDefault())}}const z=!N&&(f&&!!g||!!m||!!g&&!v?.length&&!1!==f),L=w?T:void 0,F=P["aria-describedby"]||L,B={className:I,"aria-label":P["aria-label"]||g,"aria-describedby":F,ref:t},V=(0,wt.jsxs)(wt.Fragment,{children:[u&&"left"===d&&(0,wt.jsx)(Fx,{icon:u,size:p}),x&&(0,wt.jsx)(wt.Fragment,{children:x}),v,u&&"right"===d&&(0,wt.jsx)(Fx,{icon:u,size:p})]}),$="a"===M?(0,wt.jsx)("a",{...D,...P,...O,...B,children:V}):(0,wt.jsx)("button",{...A,...P,...O,...B,children:V}),H=z?{text:v?.length&&w?w:g,shortcut:m,placement:h&&$i(h)}:{};return(0,wt.jsxs)(wt.Fragment,{children:[(0,wt.jsx)(Yi,{...H,children:$}),w&&(0,wt.jsx)(pl,{children:(0,wt.jsx)("span",{id:L,children:w})})]})})),$x=Vx;var Hx={name:"euqsgg",styles:"input[type='number']::-webkit-outer-spin-button,input[type='number']::-webkit-inner-spin-button{-webkit-appearance:none!important;margin:0!important;}input[type='number']{-moz-appearance:textfield;}"};const Wx=({hideHTMLArrows:e})=>e?Hx:"",Ux=cl(zx,{target:"ep09it41"})(Wx,";"),Gx=cl($x,{target:"ep09it40"})("&&&&&{color:",kl.theme.accent,";}"),Kx={smallSpinButtons:bl("width:",yl(5),";min-width:",yl(5),";height:",yl(5),";","")};function qx(e){const t=Number(e);return isNaN(t)?0:t}function Yx(...e){return e.reduce(((e,t)=>e+qx(t)),0)}function Xx(e,t,n){const r=qx(e);return Math.max(t,Math.min(r,n))}function Zx(e=0,t=1/0,n=1/0,r=1){const o=qx(e),i=qx(r),s=function(e){const t=(e+"").split(".");return void 0!==t[1]?t[1].length:0}(r),a=Xx(Math.round(o/i)*i,t,n);return s?qx(a.toFixed(s)):a}const Qx={bottom:{align:"flex-end",justify:"center"},bottomLeft:{align:"flex-end",justify:"flex-start"},bottomRight:{align:"flex-end",justify:"flex-end"},center:{align:"center",justify:"center"},edge:{align:"center",justify:"space-between"},left:{align:"center",justify:"flex-start"},right:{align:"center",justify:"flex-end"},stretch:{align:"stretch"},top:{align:"flex-start",justify:"center"},topLeft:{align:"flex-start",justify:"flex-start"},topRight:{align:"flex-start",justify:"flex-end"}},Jx={bottom:{justify:"flex-end",align:"center"},bottomLeft:{justify:"flex-end",align:"flex-start"},bottomRight:{justify:"flex-end",align:"flex-end"},center:{justify:"center",align:"center"},edge:{justify:"space-between",align:"center"},left:{justify:"center",align:"flex-start"},right:{justify:"center",align:"flex-end"},stretch:{align:"stretch"},top:{justify:"flex-start",align:"center"},topLeft:{justify:"flex-start",align:"flex-start"},topRight:{justify:"flex-start",align:"flex-end"}};function ey(e){return"string"==typeof e?[e]:c.Children.toArray(e).filter((e=>(0,c.isValidElement)(e)))}function ty(e){const{alignment:t="edge",children:n,direction:r,spacing:o=2,...i}=Ya(e,"HStack"),s=function(e,t="row"){if(!Ig(e))return{};const n="column"===t?Jx:Qx;return e in n?n[e]:{align:e}}(t,r),a=ey(n).map(((e,t)=>{if(el(e,["Spacer"])){const n=e,r=n.key||`hstack-${t}`;return(0,wt.jsx)(Tg,{isBlock:!0,...n.props},r)}return e})),l={children:a,direction:r,justify:"center",...s,...i,gap:o},{isColumn:c,...u}=fg(l);return u}const ny=Xa((function(e,t){const n=ty(e);return(0,wt.jsx)(dl,{...n,ref:t})}),"HStack"),ry=()=>{};const oy=(0,c.forwardRef)((function(e,t){const{__unstableStateReducer:n,className:r,dragDirection:o="n",hideHTMLArrows:i=!1,spinControls:u=(i?"none":"native"),isDragEnabled:d=!0,isShiftStepEnabled:p=!0,label:f,max:h=1/0,min:m=-1/0,required:g=!1,shiftStep:v=10,step:b=1,spinFactor:x=1,type:y="number",value:w,size:_="default",suffix:S,onChange:C=ry,...k}=ob(e);i&&Fi()("wp.components.NumberControl hideHTMLArrows prop ",{alternative:'spinControls="none"',since:"6.2",version:"6.3"});const j=(0,c.useRef)(),E=(0,l.useMergeRefs)([j,t]),P="any"===b,T=P?1:Ng(b),R=Ng(x)*T,I=Zx(0,m,h,T),N=(e,t)=>P?""+Math.min(h,Math.max(m,Ng(e))):""+Zx(e,m,h,null!=t?t:T),M="number"===y?"off":void 0,A=s("components-number-control",r),D=qa()("small"===_&&Kx.smallSpinButtons),O=(e,t,n)=>{n?.preventDefault();const r=n?.shiftKey&&p,o=r?Ng(v)*R:R;let i=function(e){const t=""===e;return!Ig(e)||t}(e)?I:e;return"up"===t?i=Yx(i,o):"down"===t&&(i=function(...e){return e.reduce(((e,t,n)=>{const r=qx(t);return 0===n?r:e-r}),0)}(i,o)),N(i,r?o:void 0)},z=e=>t=>C(String(O(w,e,t)),{event:{...t,target:j.current}});return(0,wt.jsx)(Ux,{autoComplete:M,inputMode:"numeric",...k,className:A,dragDirection:o,hideHTMLArrows:"native"!==u,isDragEnabled:d,label:f,max:h,min:m,ref:E,required:g,step:b,type:y,value:w,__unstableStateReducer:(e,t)=>{var r;const i=((e,t)=>{const n={...e},{type:r,payload:i}=t,s=i.event,l=n.value;if(r!==fx&&r!==dx||(n.value=O(l,r===fx?"up":"down",s)),r===cx&&d){const[e,t]=i.delta,r=i.shiftKey&&p,s=r?Ng(v)*R:R;let c,u;switch(o){case"n":u=t,c=-1;break;case"e":u=e,c=(0,a.isRTL)()?-1:1;break;case"s":u=t,c=1;break;case"w":u=e,c=(0,a.isRTL)()?1:-1}if(0!==u){u=Math.ceil(Math.abs(u))*Math.sign(u);const e=u*s*c;n.value=N(Yx(l,e),r?s:void 0)}}if(r===px||r===ix){const e=!1===g&&""===l;n.value=e?l:N(l)}return n})(e,t);return null!==(r=n?.(i,t))&&void 0!==r?r:i},size:_,suffix:"custom"===u?(0,wt.jsxs)(wt.Fragment,{children:[S,(0,wt.jsx)(jg,{marginBottom:0,marginRight:2,children:(0,wt.jsxs)(ny,{spacing:1,children:[(0,wt.jsx)(Gx,{className:D,icon:Eg,size:"small",label:(0,a.__)("Increment"),onClick:z("up")}),(0,wt.jsx)(Gx,{className:D,icon:Pg,size:"small",label:(0,a.__)("Decrement"),onClick:z("down")})]})})]}):S,onChange:C})})),iy=oy;const sy=cl("div",{target:"eln3bjz3"})("border-radius:",Pl.radiusRound,";border:",Pl.borderWidth," solid ",kl.ui.border,";box-sizing:border-box;cursor:grab;height:",32,"px;overflow:hidden;width:",32,"px;:active{cursor:grabbing;}"),ay=cl("div",{target:"eln3bjz2"})({name:"1r307gh",styles:"box-sizing:border-box;position:relative;width:100%;height:100%;:focus-visible{outline:none;}"}),ly=cl("div",{target:"eln3bjz1"})("background:",kl.theme.accent,";border-radius:",Pl.radiusRound,";box-sizing:border-box;display:block;left:50%;top:4px;transform:translateX( -50% );position:absolute;width:",6,"px;height:",6,"px;"),cy=cl(Nv,{target:"eln3bjz0"})("color:",kl.theme.accent,";margin-right:",yl(3),";");const uy=function({value:e,onChange:t,...n}){const r=(0,c.useRef)(null),o=(0,c.useRef)(),i=(0,c.useRef)(),s=e=>{if(void 0!==e&&(e.preventDefault(),e.target?.focus(),void 0!==o.current&&void 0!==t)){const{x:n,y:r}=o.current;t(function(e,t,n,r){const o=r-t,i=n-e,s=Math.atan2(o,i),a=Math.round(s*(180/Math.PI))+90;if(a<0)return 360+a;return a}(n,r,e.clientX,e.clientY))}},{startDrag:a,isDragging:u}=(0,l.__experimentalUseDragging)({onDragStart:e=>{(()=>{if(null===r.current)return;const e=r.current.getBoundingClientRect();o.current={x:e.x+e.width/2,y:e.y+e.height/2}})(),s(e)},onDragMove:s,onDragEnd:s});return(0,c.useEffect)((()=>{u?(void 0===i.current&&(i.current=document.body.style.cursor),document.body.style.cursor="grabbing"):(document.body.style.cursor=i.current||"",i.current=void 0)}),[u]),(0,wt.jsx)(sy,{ref:r,onMouseDown:a,className:"components-angle-picker-control__angle-circle",...n,children:(0,wt.jsx)(ay,{style:e?{transform:`rotate(${e}deg)`}:void 0,className:"components-angle-picker-control__angle-circle-indicator-wrapper",tabIndex:-1,children:(0,wt.jsx)(ly,{className:"components-angle-picker-control__angle-circle-indicator"})})})};const dy=(0,c.forwardRef)((function(e,t){const{className:n,label:r=(0,a.__)("Angle"),onChange:o,value:i,...l}=e,c=s("components-angle-picker-control",n),u=(0,wt.jsx)(cy,{children:"°"}),[d,p]=(0,a.isRTL)()?[u,null]:[null,u];return(0,wt.jsxs)(mg,{...l,ref:t,className:c,gap:2,children:[(0,wt.jsx)(vg,{children:(0,wt.jsx)(iy,{label:r,className:"components-angle-picker-control__input-field",max:360,min:0,onChange:e=>{if(void 0===o)return;const t=void 0!==e&&""!==e?parseInt(e,10):0;o(t)},size:"__unstable-large",step:"1",value:i,spinControls:"none",prefix:d,suffix:p})}),(0,wt.jsx)(jg,{marginBottom:"1",marginTop:"auto",children:(0,wt.jsx)(uy,{"aria-hidden":"true",value:i,onChange:o})})]})}));var py=o(9681),fy=o.n(py);const hy=window.wp.richText,my=window.wp.a11y,gy=window.wp.keycodes,vy=new RegExp(/[\u007e\u00ad\u2053\u207b\u208b\u2212\p{Pd}]/gu),by=e=>fy()(e).toLocaleLowerCase().replace(vy,"-");function xy(e){var t;let n=null!==(t=e?.toString?.())&&void 0!==t?t:"";return n=n.replace(/['\u2019]/,""),ms(n,{splitRegexp:[/(?!(?:1ST|2ND|3RD|[4-9]TH)(?![a-z]))([a-z0-9])([A-Z])/g,/(?!(?:1st|2nd|3rd|[4-9]th)(?![a-z]))([0-9])([a-z])/g,/([A-Za-z])([0-9])/g,/([A-Z])([A-Z][a-z])/g]})}function yy(e){return e.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&")}function wy(e){return t=>{const[n,r]=(0,c.useState)([]);return(0,c.useLayoutEffect)((()=>{const{options:n,isDebounced:o}=e,i=(0,l.debounce)((()=>{const o=Promise.resolve("function"==typeof n?n(t):n).then((n=>{if(o.canceled)return;const i=n.map(((t,n)=>({key:`${e.name}-${n}`,value:t,label:e.getOptionLabel(t),keywords:e.getOptionKeywords?e.getOptionKeywords(t):[],isDisabled:!!e.isOptionDisabled&&e.isOptionDisabled(t)}))),s=new RegExp("(?:\\b|\\s|^)"+yy(t),"i");r(function(e,t=[],n=10){const r=[];for(let o=0;oe.test(fy()(t))))&&(r.push(i),r.length===n))break}return r}(s,i))}));return o}),o?250:0),s=i();return()=>{i.cancel(),s&&(s.canceled=!0)}}),[t]),[n]}}const _y=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(o=n,{}.hasOwnProperty.call(o,"current"))?null!=n.current?yi({element:n.current,padding:r}).fn(t):{}:n?yi({element:n,padding:r}).fn(t):{};var o}});var Sy="undefined"!=typeof document?B.useLayoutEffect:B.useEffect;function Cy(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!=r--;)if(!Cy(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!=r--;){const n=o[r];if(("_owner"!==n||!e.$$typeof)&&!Cy(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function ky(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function jy(e,t){const n=ky(e);return Math.round(t*n)/n}function Ey(e){const t=B.useRef(e);return Sy((()=>{t.current=e})),t}const Py=(0,wt.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,wt.jsx)(n.Path,{d:"m13.06 12 6.47-6.47-1.06-1.06L12 10.94 5.53 4.47 4.47 5.53 10.94 12l-6.47 6.47 1.06 1.06L12 13.06l6.47 6.47 1.06-1.06L13.06 12Z"})});let Ty=0;function Ry(e){const t=document.scrollingElement||document.body;e&&(Ty=t.scrollTop);const n=e?"add":"remove";t.classList[n]("lockscroll"),document.documentElement.classList[n]("lockscroll"),e||(t.scrollTop=Ty)}let Iy=0;const Ny=function(){return(0,c.useEffect)((()=>(0===Iy&&Ry(!0),++Iy,()=>{1===Iy&&Ry(!1),--Iy})),[]),null},My={slots:(0,l.observableMap)(),fills:(0,l.observableMap)(),registerSlot:()=>{},updateSlot:()=>{},unregisterSlot:()=>{},registerFill:()=>{},unregisterFill:()=>{},isDefault:!0},Ay=(0,c.createContext)(My);function Dy(e){const t=(0,c.useContext)(Ay);return{...(0,l.useObservableValue)(t.slots,e),...(0,c.useMemo)((()=>({updateSlot:n=>t.updateSlot(e,n),unregisterSlot:n=>t.unregisterSlot(e,n),registerFill:n=>t.registerFill(e,n),unregisterFill:n=>t.unregisterFill(e,n)})),[e,t])}}const Oy={registerSlot:()=>{},unregisterSlot:()=>{},registerFill:()=>{},unregisterFill:()=>{},getSlot:()=>{},getFills:()=>[],subscribe:()=>()=>{}},zy=(0,c.createContext)(Oy),Ly=e=>{const{getSlot:t,subscribe:n}=(0,c.useContext)(zy);return(0,c.useSyncExternalStore)(n,(()=>t(e)),(()=>t(e)))};function Fy({name:e,children:t}){const{registerFill:n,unregisterFill:r}=(0,c.useContext)(zy),o=Ly(e),i=(0,c.useRef)({name:e,children:t});return(0,c.useLayoutEffect)((()=>{const t=i.current;return n(e,t),()=>r(e,t)}),[]),(0,c.useLayoutEffect)((()=>{i.current.children=t,o&&o.forceUpdate()}),[t]),(0,c.useLayoutEffect)((()=>{e!==i.current.name&&(r(i.current.name,i.current),i.current.name=e,n(e,i.current))}),[e]),null}function By(e){return"function"==typeof e}class Vy extends c.Component{constructor(e){super(e),this.isUnmounted=!1}componentDidMount(){const{registerSlot:e}=this.props;this.isUnmounted=!1,e(this.props.name,this)}componentWillUnmount(){const{unregisterSlot:e}=this.props;this.isUnmounted=!0,e(this.props.name,this)}componentDidUpdate(e){const{name:t,unregisterSlot:n,registerSlot:r}=this.props;e.name!==t&&(n(e.name,this),r(t,this))}forceUpdate(){this.isUnmounted||super.forceUpdate()}render(){var e;const{children:t,name:n,fillProps:r={},getFills:o}=this.props,i=(null!==(e=o(n,this))&&void 0!==e?e:[]).map((e=>{const t=By(e.children)?e.children(r):e.children;return c.Children.map(t,((e,t)=>{if(!e||"string"==typeof e)return e;let n=t;return"object"==typeof e&&"key"in e&&e?.key&&(n=e.key),(0,c.cloneElement)(e,{key:n})}))})).filter((e=>!(0,c.isEmptyElement)(e)));return(0,wt.jsx)(wt.Fragment,{children:By(t)?t(i):i})}}const $y=e=>(0,wt.jsx)(zy.Consumer,{children:({registerSlot:t,unregisterSlot:n,getFills:r})=>(0,wt.jsx)(Vy,{...e,registerSlot:t,unregisterSlot:n,getFills:r})}),Hy={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let Wy;const Uy=new Uint8Array(16);function Gy(){if(!Wy&&(Wy="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Wy))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Wy(Uy)}const Ky=[];for(let e=0;e<256;++e)Ky.push((e+256).toString(16).slice(1));function qy(e,t=0){return Ky[e[t+0]]+Ky[e[t+1]]+Ky[e[t+2]]+Ky[e[t+3]]+"-"+Ky[e[t+4]]+Ky[e[t+5]]+"-"+Ky[e[t+6]]+Ky[e[t+7]]+"-"+Ky[e[t+8]]+Ky[e[t+9]]+"-"+Ky[e[t+10]]+Ky[e[t+11]]+Ky[e[t+12]]+Ky[e[t+13]]+Ky[e[t+14]]+Ky[e[t+15]]}const Yy=function(e,t,n){if(Hy.randomUUID&&!t&&!e)return Hy.randomUUID();const r=(e=e||{}).random||(e.rng||Gy)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=r[e];return t}return qy(r)},Xy=new Set,Zy=new WeakMap;function Qy(e){const{children:t,document:n}=e;if(!n)return null;const r=(e=>{if(Zy.has(e))return Zy.get(e);let t=Yy().replace(/[0-9]/g,"");for(;Xy.has(t);)t=Yy().replace(/[0-9]/g,"");Xy.add(t);const n=xa({container:e,key:t});return Zy.set(e,n),n})(n.head);return(0,wt.jsx)(Oa,{value:r,children:t})}const Jy=Qy;function ew(e){var t;const{name:n,children:r}=e,{registerFill:o,unregisterFill:i,...s}=Dy(n),a=function(){const[,e]=(0,c.useState)({}),t=(0,c.useRef)(!0);return(0,c.useEffect)((()=>(t.current=!0,()=>{t.current=!1})),[]),()=>{t.current&&e({})}}(),l=(0,c.useRef)({rerender:a});if((0,c.useEffect)((()=>(o(l),()=>{i(l)})),[o,i]),!s.ref||!s.ref.current)return null;const u=(0,wt.jsx)(Jy,{document:s.ref.current.ownerDocument,children:"function"==typeof r?r(null!==(t=s.fillProps)&&void 0!==t?t:{}):r});return(0,c.createPortal)(u,s.ref.current)}const tw=(0,c.forwardRef)((function(e,t){const{name:n,fillProps:r={},as:o,children:i,...s}=e,{registerSlot:a,unregisterSlot:u,...d}=(0,c.useContext)(Ay),p=(0,c.useRef)(null);return(0,c.useLayoutEffect)((()=>(a(n,p,r),()=>{u(n,p)})),[a,u,n]),(0,c.useLayoutEffect)((()=>{d.updateSlot(n,r)})),(0,wt.jsx)(dl,{as:o,ref:(0,l.useMergeRefs)([t,p]),...s})})),nw=window.wp.isShallowEqual;var rw=o.n(nw);function ow(){const e=(0,l.observableMap)(),t=(0,l.observableMap)();return{slots:e,fills:t,registerSlot:(t,n,r)=>{const o=e.get(t);e.set(t,{...o,ref:n||o?.ref,fillProps:r||o?.fillProps||{}})},updateSlot:(n,r)=>{const o=e.get(n);if(!o)return;if(rw()(o.fillProps,r))return;o.fillProps=r;const i=t.get(n);i&&i.forEach((e=>e.current.rerender()))},unregisterSlot:(t,n)=>{e.get(t)?.ref===n&&e.delete(t)},registerFill:(e,n)=>{t.set(e,[...t.get(e)||[],n])},unregisterFill:(e,n)=>{const r=t.get(e);r&&t.set(e,r.filter((e=>e!==n)))}}}function iw({children:e}){const[t]=(0,c.useState)(ow);return(0,wt.jsx)(Ay.Provider,{value:t,children:e})}function sw(){const e={},t={};let n=[];function r(t){return e[t]}function o(e){const t=r(e);t&&t.forceUpdate()}function i(){n.forEach((e=>e()))}return{registerSlot:function(t,n){const r=e[t];e[t]=n,i(),o(t),r&&r.forceUpdate()},unregisterSlot:function(t,n){e[t]===n&&(delete e[t],i())},registerFill:function(e,n){t[e]=[...t[e]||[],n],o(e)},unregisterFill:function(e,n){var r;t[e]=null!==(r=t[e]?.filter((e=>e!==n)))&&void 0!==r?r:[],o(e)},getSlot:r,getFills:function(n,r){return e[n]!==r?[]:t[n]},subscribe:function(e){return n.push(e),()=>{n=n.filter((t=>t!==e))}}}}const aw=function({children:e}){const[t]=(0,c.useState)(sw);return(0,wt.jsx)(zy.Provider,{value:t,children:e})};function lw(e){return(0,wt.jsxs)(wt.Fragment,{children:[(0,wt.jsx)(Fy,{...e}),(0,wt.jsx)(ew,{...e})]})}const cw=(0,c.forwardRef)((function(e,t){const{bubblesVirtually:n,...r}=e;return n?(0,wt.jsx)(tw,{...r,ref:t}):(0,wt.jsx)($y,{...r})}));function uw({children:e,passthrough:t=!1}){return!(0,c.useContext)(Ay).isDefault&&t?(0,wt.jsx)(wt.Fragment,{children:e}):(0,wt.jsx)(aw,{children:(0,wt.jsx)(iw,{children:e})})}function dw(e){const t="symbol"==typeof e?e.description:e,n=t=>(0,wt.jsx)(lw,{name:e,...t});n.displayName=`${t}Fill`;const r=t=>(0,wt.jsx)(cw,{name:e,...t});return r.displayName=`${t}Slot`,r.__unstableName=e,{Fill:n,Slot:r}}uw.displayName="SlotFillProvider";const pw="Popover",fw=()=>(0,wt.jsxs)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 100 100",className:"components-popover__triangle",role:"presentation",children:[(0,wt.jsx)(n.Path,{className:"components-popover__triangle-bg",d:"M 0 0 L 50 50 L 100 0"}),(0,wt.jsx)(n.Path,{className:"components-popover__triangle-border",d:"M 0 0 L 50 50 L 100 0",vectorEffect:"non-scaling-stroke"})]}),hw=(0,c.createContext)(void 0),mw="components-popover__fallback-container",gw=Xa(((e,t)=>{const{animate:n=!0,headerTitle:r,constrainTabbing:o,onClose:i,children:a,className:u,noArrow:d=!0,position:p,placement:f="bottom-start",offset:h=0,focusOnMount:m="firstElement",anchor:g,expandOnMobile:v,onFocusOutside:b,__unstableSlotName:x=pw,flip:y=!0,resize:w=!0,shift:_=!1,inline:S=!1,variant:C,style:k,__unstableForcePosition:j,anchorRef:E,anchorRect:P,getAnchorRect:T,isAlternate:R,...I}=Ya(e,"Popover");let N=y,M=w;void 0!==j&&(Fi()("`__unstableForcePosition` prop in wp.components.Popover",{since:"6.1",version:"6.3",alternative:"`flip={ false }` and `resize={ false }`"}),N=!j,M=!j),void 0!==E&&Fi()("`anchorRef` prop in wp.components.Popover",{since:"6.1",alternative:"`anchor` prop"}),void 0!==P&&Fi()("`anchorRect` prop in wp.components.Popover",{since:"6.1",alternative:"`anchor` prop"}),void 0!==T&&Fi()("`getAnchorRect` prop in wp.components.Popover",{since:"6.1",alternative:"`anchor` prop"});const A=R?"toolbar":C;void 0!==R&&Fi()("`isAlternate` prop in wp.components.Popover",{since:"6.2",alternative:"`variant` prop with the `'toolbar'` value"});const D=(0,c.useRef)(null),[O,z]=(0,c.useState)(null),L=(0,c.useCallback)((e=>{z(e)}),[]),F=(0,l.useViewportMatch)("medium","<"),V=v&&F,$=!V&&!d,H=p?$i(p):f,W=[..."overlay"===f?[{name:"overlay",fn:({rects:e})=>e.reference},xi({apply({rects:e,elements:t}){var n;const{firstElementChild:r}=null!==(n=t.floating)&&void 0!==n?n:{};r instanceof HTMLElement&&Object.assign(r.style,{width:`${e.reference.width}px`,height:`${e.reference.height}px`})}})]:[],Ro(h),N&&bi(),M&&xi({apply(e){var t;const{firstElementChild:n}=null!==(t=Q.floating.current)&&void 0!==t?t:{};n instanceof HTMLElement&&Object.assign(n.style,{maxHeight:`${e.availableHeight}px`,overflow:"auto"})}}),_&&vi({crossAxis:!0,limiter:wi(),padding:1}),_y({element:D})],U=(0,c.useContext)(hw)||x,G=Dy(U);let K;(i||b)&&(K=(e,t)=>{"focus-outside"===e&&b?b(t):i&&i()});const[q,Y]=(0,l.__experimentalUseDialog)({constrainTabbing:o,focusOnMount:m,__unstableOnClose:K,onClose:K}),{x:X,y:Z,refs:Q,strategy:J,update:ee,placement:te,middlewareData:{arrow:ne}}=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[u,d]=B.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,f]=B.useState(r);Cy(p,r)||f(r);const[h,m]=B.useState(null),[g,v]=B.useState(null),b=B.useCallback((e=>{e!==_.current&&(_.current=e,m(e))}),[]),x=B.useCallback((e=>{e!==S.current&&(S.current=e,v(e))}),[]),y=i||h,w=s||g,_=B.useRef(null),S=B.useRef(null),C=B.useRef(u),k=null!=l,j=Ey(l),E=Ey(o),P=B.useCallback((()=>{if(!_.current||!S.current)return;const e={placement:t,strategy:n,middleware:p};E.current&&(e.platform=E.current),_i(_.current,S.current,e).then((e=>{const t={...e,isPositioned:!0};T.current&&!Cy(C.current,t)&&(C.current=t,Or.flushSync((()=>{d(t)})))}))}),[p,t,n,E]);Sy((()=>{!1===c&&C.current.isPositioned&&(C.current.isPositioned=!1,d((e=>({...e,isPositioned:!1}))))}),[c]);const T=B.useRef(!1);Sy((()=>(T.current=!0,()=>{T.current=!1})),[]),Sy((()=>{if(y&&(_.current=y),w&&(S.current=w),y&&w){if(j.current)return j.current(y,w,P);P()}}),[y,w,P,j,k]);const R=B.useMemo((()=>({reference:_,floating:S,setReference:b,setFloating:x})),[b,x]),I=B.useMemo((()=>({reference:y,floating:w})),[y,w]),N=B.useMemo((()=>{const e={position:n,left:0,top:0};if(!I.floating)return e;const t=jy(I.floating,u.x),r=jy(I.floating,u.y);return a?{...e,transform:"translate("+t+"px, "+r+"px)",...ky(I.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}}),[n,a,I.floating,u.x,u.y]);return B.useMemo((()=>({...u,update:P,refs:R,elements:I,floatingStyles:N})),[u,P,R,I,N])}({placement:"overlay"===H?void 0:H,middleware:W,whileElementsMounted:(e,t,n)=>gi(e,t,n,{layoutShift:!1,animationFrame:!0})}),re=(0,c.useCallback)((e=>{D.current=e,ee()}),[ee]),oe=E?.top,ie=E?.bottom,se=E?.startContainer,ae=E?.current;(0,c.useLayoutEffect)((()=>{const e=(({anchor:e,anchorRef:t,anchorRect:n,getAnchorRect:r,fallbackReferenceElement:o})=>{var i;let s=null;return e?s=e:function(e){return!!e?.top}(t)?s={getBoundingClientRect(){const e=t.top.getBoundingClientRect(),n=t.bottom.getBoundingClientRect();return new window.DOMRect(e.x,e.y,e.width,n.bottom-e.top)}}:function(e){return!!e?.current}(t)?s=t.current:t?s=t:n?s={getBoundingClientRect:()=>n}:r?s={getBoundingClientRect(){var e,t,n,i;const s=r(o);return new window.DOMRect(null!==(e=s.x)&&void 0!==e?e:s.left,null!==(t=s.y)&&void 0!==t?t:s.top,null!==(n=s.width)&&void 0!==n?n:s.right-s.left,null!==(i=s.height)&&void 0!==i?i:s.bottom-s.top)}}:o&&(s=o.parentElement),null!==(i=s)&&void 0!==i?i:null})({anchor:g,anchorRef:E,anchorRect:P,getAnchorRect:T,fallbackReferenceElement:O});Q.setReference(e)}),[g,E,oe,ie,se,ae,P,T,O,Q]);const le=(0,l.useMergeRefs)([Q.setFloating,q,t]),ce=V?void 0:{position:J,top:0,left:0,x:Wi(X),y:Wi(Z)},ue=(0,l.useReducedMotion)(),de=n&&!V&&!ue,[pe,fe]=(0,c.useState)(!1),{style:he,...me}=(0,c.useMemo)((()=>(e=>{const t=e.startsWith("top")||e.startsWith("bottom")?"translateY":"translateX",n=e.startsWith("top")||e.startsWith("left")?1:-1;return{style:Hi[e],initial:{opacity:0,scale:0,[t]:2*n+"em"},animate:{opacity:1,scale:1,[t]:0},transition:{duration:.1,ease:[0,0,.2,1]}}})(te)),[te]),ge=de?{style:{...k,...he,...ce},onAnimationComplete:()=>fe(!0),...me}:{animate:!1,style:{...k,...ce}},ve=(!de||pe)&&null!==X&&null!==Z;let be=(0,wt.jsxs)(Xm.div,{className:s(u,{"is-expanded":V,"is-positioned":ve,[`is-${"toolbar"===A?"alternate":A}`]:A}),...ge,...I,ref:le,...Y,tabIndex:-1,children:[V&&(0,wt.jsx)(Ny,{}),V&&(0,wt.jsxs)("div",{className:"components-popover__header",children:[(0,wt.jsx)("span",{className:"components-popover__header-title",children:r}),(0,wt.jsx)($x,{className:"components-popover__close",icon:Py,onClick:i})]}),(0,wt.jsx)("div",{className:"components-popover__content",children:a}),$&&(0,wt.jsx)("div",{ref:re,className:["components-popover__arrow",`is-${te.split("-")[0]}`].join(" "),style:{left:void 0!==ne?.x&&Number.isFinite(ne.x)?`${ne.x}px`:"",top:void 0!==ne?.y&&Number.isFinite(ne.y)?`${ne.y}px`:""},children:(0,wt.jsx)(fw,{})})]});const xe=G.ref&&!S,ye=E||P||g;return xe?be=(0,wt.jsx)(lw,{name:U,children:be}):S||(be=(0,c.createPortal)((0,wt.jsx)(Qy,{document,children:be}),(()=>{let e=document.body.querySelector("."+mw);return e||(e=document.createElement("div"),e.className=mw,document.body.append(e)),e})())),ye?be:(0,wt.jsxs)(wt.Fragment,{children:[(0,wt.jsx)("span",{ref:L}),be]})}),"Popover");gw.Slot=(0,c.forwardRef)((function({name:e=pw},t){return(0,wt.jsx)(cw,{bubblesVirtually:!0,name:e,className:"popover-slot",ref:t})})),gw.__unstableSlotNameProvider=hw.Provider;const vw=gw;function bw({items:e,onSelect:t,selectedIndex:n,instanceId:r,listBoxId:o,className:i,Component:a="div"}){return(0,wt.jsx)(a,{id:o,role:"listbox",className:"components-autocomplete__results",children:e.map(((e,o)=>(0,wt.jsx)($x,{id:`components-autocomplete-item-${r}-${e.key}`,role:"option","aria-selected":o===n,accessibleWhenDisabled:!0,disabled:e.isDisabled,className:s("components-autocomplete__result",i,{"is-selected":o===n}),variant:o===n?"primary":void 0,onClick:()=>t(e),children:e.label},e.key)))})}function xw(e){var t;const n=null!==(t=e.useItems)&&void 0!==t?t:wy(e);return function({filterValue:e,instanceId:t,listBoxId:r,className:o,selectedIndex:i,onChangeOptions:s,onSelect:u,onReset:d,reset:p,contentRef:f}){const[h]=n(e),m=(0,hy.useAnchor)({editableContentElement:f.current}),[g,v]=(0,c.useState)(!1),b=(0,c.useRef)(null),x=(0,l.useMergeRefs)([b,(0,l.useRefEffect)((e=>{f.current&&v(e.ownerDocument!==f.current.ownerDocument)}),[f])]);var y,w;y=b,w=p,(0,c.useEffect)((()=>{const e=e=>{y.current&&!y.current.contains(e.target)&&w(e)};return document.addEventListener("mousedown",e),document.addEventListener("touchstart",e),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("touchstart",e)}}),[w]);const _=(0,l.useDebounce)(my.speak,500);return(0,c.useLayoutEffect)((()=>{s(h),function(t){_&&(t.length?_(e?(0,a.sprintf)((0,a._n)("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",t.length),t.length):(0,a.sprintf)((0,a._n)("Initial %d result loaded. Type to filter all available results. Use up and down arrow keys to navigate.","Initial %d results loaded. Type to filter all available results. Use up and down arrow keys to navigate.",t.length),t.length),"assertive"):_((0,a.__)("No results."),"assertive"))}(h)}),[h]),0===h.length?null:(0,wt.jsxs)(wt.Fragment,{children:[(0,wt.jsx)(vw,{focusOnMount:!1,onClose:d,placement:"top-start",className:"components-autocomplete__popover",anchor:m,ref:x,children:(0,wt.jsx)(bw,{items:h,onSelect:u,selectedIndex:i,instanceId:t,listBoxId:r,className:o})}),f.current&&g&&(0,Or.createPortal)((0,wt.jsx)(bw,{items:h,onSelect:u,selectedIndex:i,instanceId:t,listBoxId:r,className:o,Component:pl}),f.current.ownerDocument.body)]})}}const yw=e=>{if(null===e)return"";switch(typeof e){case"string":case"number":return e.toString();case"boolean":default:return"";case"object":if(e instanceof Array)return e.map(yw).join("");if("props"in e)return yw(e.props.children)}return""},ww=[];function _w({record:e,onChange:t,onReplace:n,completers:r,contentRef:o}){const i=(0,l.useInstanceId)(_w),[s,a]=(0,c.useState)(0),[u,d]=(0,c.useState)(ww),[p,f]=(0,c.useState)(""),[h,m]=(0,c.useState)(null),[g,v]=(0,c.useState)(null),b=(0,c.useRef)(!1);function x(r){const{getOptionCompletion:o}=h||{};if(!r.isDisabled){if(o){const i=o(r.value,p),s=(e=>null!==e&&"object"==typeof e&&"action"in e&&void 0!==e.action&&"value"in e&&void 0!==e.value)(i)?i:{action:"insert-at-caret",value:i};if("replace"===s.action)return void n([s.value]);"insert-at-caret"===s.action&&function(n){if(null===h)return;const r=e.start,o=r-h.triggerPrefix.length-p.length,i=(0,hy.create)({html:(0,c.renderToString)(n)});t((0,hy.insert)(e,i,o,r))}(s.value)}y()}}function y(){a(0),d(ww),f(""),m(null),v(null)}const w=(0,c.useMemo)((()=>(0,hy.isCollapsed)(e)?(0,hy.getTextContent)((0,hy.slice)(e,0)):""),[e]);(0,c.useEffect)((()=>{if(!w)return void(h&&y());const t=r.reduce(((e,t)=>w.lastIndexOf(t.triggerPrefix)>(null!==e?w.lastIndexOf(e.triggerPrefix):-1)?t:e),null);if(!t)return void(h&&y());const{allowContext:n,triggerPrefix:o}=t,i=w.lastIndexOf(o),s=w.slice(i+o.length);if(s.length>50)return;const a=0===u.length,l=s.split(/\s/),c=1===l.length,d=b.current&&l.length<=3;if(a&&!d&&!c)return void(h&&y());const p=(0,hy.getTextContent)((0,hy.slice)(e,void 0,(0,hy.getTextContent)(e).length));if(n&&!n(w.slice(0,i),p))return void(h&&y());if(/^\s/.test(s)||/\s\s+$/.test(s))return void(h&&y());if(!/[\u0000-\uFFFF]*$/.test(s))return void(h&&y());const x=yy(t.triggerPrefix),_=fy()(w),S=_.slice(_.lastIndexOf(t.triggerPrefix)).match(new RegExp(`${x}([\0-￿]*)$`)),C=S&&S[1];m(t),v((()=>t!==h?xw(t):g)),f(null===C?"":C)}),[w]);const{key:_=""}=u[s]||{},{className:S}=h||{},C=!!h&&u.length>0,k=C?`components-autocomplete-listbox-${i}`:void 0,j=C?`components-autocomplete-item-${i}-${_}`:null,E=void 0!==e.start;return{listBoxId:k,activeId:j,onKeyDown:gx((function(e){if(b.current="Backspace"===e.key,h&&0!==u.length&&!e.defaultPrevented){switch(e.key){case"ArrowUp":{const e=(0===s?u.length:s)-1;a(e),(0,gy.isAppleOS)()&&(0,my.speak)(yw(u[e].label),"assertive");break}case"ArrowDown":{const e=(s+1)%u.length;a(e),(0,gy.isAppleOS)()&&(0,my.speak)(yw(u[e].label),"assertive");break}case"Escape":m(null),v(null),e.preventDefault();break;case"Enter":x(u[s]);break;case"ArrowLeft":case"ArrowRight":return void y();default:return}e.preventDefault()}})),popover:E&&g&&(0,wt.jsx)(g,{className:S,filterValue:p,instanceId:i,listBoxId:k,selectedIndex:s,onChangeOptions:function(e){a(e.length===u.length?s:0),d(e)},onSelect:x,value:e,contentRef:o,reset:y})}}function Sw(e){const t=(0,c.useRef)(null),n=(0,c.useRef)(),{record:r}=e,o=function(e){const t=(0,c.useRef)(new Set);return t.current.add(e),t.current.size>2&&t.current.delete(Array.from(t.current)[0]),Array.from(t.current)[0]}(r),{popover:i,listBoxId:s,activeId:a,onKeyDown:u}=_w({...e,contentRef:t});n.current=u;const d=(0,l.useMergeRefs)([t,(0,l.useRefEffect)((e=>{function t(e){n.current?.(e)}return e.addEventListener("keydown",t),()=>{e.removeEventListener("keydown",t)}}),[])]);return r.text!==o?.text?{ref:d,children:i,"aria-autocomplete":s?"list":void 0,"aria-owns":s,"aria-activedescendant":a}:{ref:d}}function Cw({children:e,isSelected:t,...n}){const{popover:r,...o}=_w(n);return(0,wt.jsxs)(wt.Fragment,{children:[e(o),t&&r]})}function kw(e){const{help:t,id:n,...r}=e,o=(0,l.useInstanceId)(Ax,"wp-components-base-control",n);return{baseControlProps:{id:o,help:t,...r},controlProps:{id:o,...t?{"aria-describedby":`${o}__help`}:{}}}}const jw=(0,wt.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,wt.jsx)(n.Path,{d:"M10 17.389H8.444A5.194 5.194 0 1 1 8.444 7H10v1.5H8.444a3.694 3.694 0 0 0 0 7.389H10v1.5ZM14 7h1.556a5.194 5.194 0 0 1 0 10.39H14v-1.5h1.556a3.694 3.694 0 0 0 0-7.39H14V7Zm-4.5 6h5v-1.5h-5V13Z"})}),Ew=(0,wt.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,wt.jsx)(n.Path,{d:"M17.031 4.703 15.576 4l-1.56 3H14v.03l-2.324 4.47H9.5V13h1.396l-1.502 2.889h-.95a3.694 3.694 0 0 1 0-7.389H10V7H8.444a5.194 5.194 0 1 0 0 10.389h.17L7.5 19.53l1.416.719L15.049 8.5h.507a3.694 3.694 0 0 1 0 7.39H14v1.5h1.556a5.194 5.194 0 0 0 .273-10.383l1.202-2.304Z"})});const Pw=bl("",""),Tw={name:"bjn8wh",styles:"position:relative"},Rw=e=>{const{color:t=kl.gray[200],style:n="solid",width:r=Pl.borderWidth}=e||{};return`${t} ${!!r&&"0"!==r||!!t?n||"solid":n} ${r!==Pl.borderWidth?`clamp(1px, ${r}, 10px)`:r}`},Iw={name:"1nwbfnf",styles:"grid-column:span 2;margin:0 auto"};function Nw(e){const{className:t,size:n="default",...r}=Ya(e,"BorderBoxControlLinkedButton"),o=qa();return{...r,className:(0,c.useMemo)((()=>o((e=>bl("position:absolute;top:","__unstable-large"===e?"8px":"3px",";",Sg({right:0})()," line-height:0;",""))(n),t)),[t,o,n])}}const Mw=Xa(((e,t)=>{const{className:n,isLinked:r,...o}=Nw(e),i=r?(0,a.__)("Unlink sides"):(0,a.__)("Link sides");return(0,wt.jsx)(Yi,{text:i,children:(0,wt.jsx)(dl,{className:n,children:(0,wt.jsx)($x,{...o,size:"small",icon:r?jw:Ew,iconSize:24,"aria-label":i,ref:t})})})}),"BorderBoxControlLinkedButton");function Aw(e){const{className:t,value:n,size:r="default",...o}=Ya(e,"BorderBoxControlVisualizer"),i=qa(),s=(0,c.useMemo)((()=>i(((e,t)=>bl("position:absolute;top:","__unstable-large"===t?"20px":"15px",";right:","__unstable-large"===t?"39px":"29px",";bottom:","__unstable-large"===t?"20px":"15px",";left:","__unstable-large"===t?"39px":"29px",";border-top:",Rw(e?.top),";border-bottom:",Rw(e?.bottom),";",Sg({borderLeft:Rw(e?.left)})()," ",Sg({borderRight:Rw(e?.right)})(),";",""))(n,r),t)),[i,t,n,r]);return{...o,className:s,value:n}}const Dw=Xa(((e,t)=>{const{value:n,...r}=Aw(e);return(0,wt.jsx)(dl,{...r,ref:t})}),"BorderBoxControlVisualizer"),Ow=(0,wt.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,wt.jsx)(n.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"})}),zw=(0,wt.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,wt.jsx)(n.Path,{d:"M5 11.25h14v1.5H5z"})}),Lw=(0,wt.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,wt.jsx)(n.Path,{fillRule:"evenodd",d:"M5 11.25h3v1.5H5v-1.5zm5.5 0h3v1.5h-3v-1.5zm8.5 0h-3v1.5h3v-1.5z",clipRule:"evenodd"})}),Fw=(0,wt.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,wt.jsx)(n.Path,{fillRule:"evenodd",d:"M5.25 11.25h1.5v1.5h-1.5v-1.5zm3 0h1.5v1.5h-1.5v-1.5zm4.5 0h-1.5v1.5h1.5v-1.5zm1.5 0h1.5v1.5h-1.5v-1.5zm4.5 0h-1.5v1.5h1.5v-1.5z",clipRule:"evenodd"})}),Bw=(0,B.createContext)(null),Vw=e=>!e.isLayoutDirty&&e.willUpdate(!1);function $w(){const e=new Set,t=new WeakMap,n=()=>e.forEach(Vw);return{add:r=>{e.add(r),t.set(r,r.addEventListener("willUpdate",n))},remove:r=>{e.delete(r);const o=t.get(r);o&&(o(),t.delete(r)),n()},dirty:n}}const Hw=e=>!0===e,Ww=({children:e,id:t,inherit:n=!0})=>{const r=(0,B.useContext)(mc),o=(0,B.useContext)(Bw),[i,s]=Qm(),a=(0,B.useRef)(null),l=r.id||o;null===a.current&&((e=>Hw(!0===e)||"id"===e)(n)&&l&&(t=t?l+"-"+t:l),a.current={id:t,group:Hw(n)&&r.group||$w()});const c=(0,B.useMemo)((()=>({...a.current,forceRender:i})),[s]);return(0,wt.jsx)(mc.Provider,{value:c,children:e})};const Uw=e=>{const t=bl("border-color:",kl.ui.border,";","");return bl(e&&t," &:hover{border-color:",kl.ui.borderHover,";}&:focus-within{border-color:",kl.ui.borderFocus,";box-shadow:",Pl.controlBoxShadowFocus,";z-index:1;outline:2px solid transparent;outline-offset:-2px;}","")};var Gw={name:"1aqh2c7",styles:"min-height:40px;padding:3px"},Kw={name:"1ndywgm",styles:"min-height:36px;padding:2px"};const qw=e=>({default:Kw,"__unstable-large":Gw}[e]),Yw={name:"7whenc",styles:"display:flex;width:100%"},Xw=cl("div",{target:"eakva830"})({name:"zjik7",styles:"display:flex"});function Zw(e={}){var t,n=T(e,[]);const r=null==(t=n.store)?void 0:t.getState(),o=ht(P(E({},n),{focusLoop:F(n.focusLoop,null==r?void 0:r.focusLoop,!0)})),i=Ve(P(E({},o.getState()),{value:F(n.value,null==r?void 0:r.value,n.defaultValue,null)}),o,n.store);return P(E(E({},o),i),{setValue:e=>i.setState("value",e)})}function Qw(e={}){const[t,n]=et(Zw,e);return function(e,t,n){return Je(e=mt(e,t,n),n,"value","setValue"),e}(t,n,e)}var Jw=jt([Nt],[Mt]),e_=Jw.useContext,t_=(Jw.useScopedContext,Jw.useProviderContext),n_=(Jw.ContextProvider,Jw.ScopedContextProvider),r_=kt((function(e){var t=e,{store:n}=t,r=x(t,["store"]);const o=t_();return D(n=n||o,!1),r=Ie(r,(e=>(0,wt.jsx)(n_,{value:n,children:e})),[n]),r=v({role:"radiogroup"},r),r=ln(v({store:n},r))})),o_=_t((function(e){return Ct("div",r_(e))}));const i_=(0,c.createContext)({}),s_=i_;function a_(e){const t=(0,c.useRef)(!0),n=(0,l.usePrevious)(e),r=(0,c.useRef)(!1);(0,c.useEffect)((()=>{t.current&&(t.current=!1)}),[]);const o=r.current||!t.current&&n!==e;return(0,c.useEffect)((()=>{r.current=o}),[o]),o?{value:null!=e?e:"",defaultValue:void 0}:{value:void 0,defaultValue:e}}const l_=(0,c.forwardRef)((function({children:e,isAdaptiveWidth:t,label:n,onChange:r,size:o,value:i,id:s,...u},d){const p=(0,l.useInstanceId)(l_,"toggle-group-control-as-radio-group"),f=s||p,{value:h,defaultValue:m}=a_(i),g=r?e=>{r(null!=e?e:void 0)}:void 0,v=Qw({defaultValue:m,value:h,setValue:g,rtl:(0,a.isRTL)()}),b=Qe(v,"value"),x=v.setValue;(0,c.useEffect)((()=>{""===b&&v.setActiveId(void 0)}),[v,b]);const y=(0,c.useMemo)((()=>({activeItemIsNotFirstItem:()=>v.getState().activeId!==v.first(),baseId:f,isBlock:!t,size:o,value:b,setValue:x})),[f,t,v,o,b,x]);return(0,wt.jsx)(s_.Provider,{value:y,children:(0,wt.jsx)(o_,{store:v,"aria-label":n,render:(0,wt.jsx)(dl,{}),...u,id:f,ref:d,children:e})})}));function c_({defaultValue:e,onChange:t,value:n}){const r=void 0!==n,o=r?n:e,[i,s]=(0,c.useState)(o);let a;return a=r&&"function"==typeof t?t:r||"function"!=typeof t?s:e=>{t(e),s(e)},[r?n:i,a]}const u_=(0,c.forwardRef)((function({children:e,isAdaptiveWidth:t,label:n,onChange:r,size:o,value:i,id:s,...a},u){const d=(0,l.useInstanceId)(u_,"toggle-group-control-as-button-group"),p=s||d,{value:f,defaultValue:h}=a_(i),[m,g]=c_({defaultValue:h,value:f,onChange:r}),v=(0,c.useMemo)((()=>({baseId:p,value:m,setValue:g,isBlock:!t,isDeselectable:!0,size:o})),[p,m,g,t,o]);return(0,wt.jsx)(s_.Provider,{value:v,children:(0,wt.jsx)(dl,{"aria-label":n,...a,ref:u,role:"group",children:e})})}));const d_=Xa((function(e,t){const{__nextHasNoMarginBottom:n=!1,__next40pxDefaultSize:r=!1,className:o,isAdaptiveWidth:i=!1,isBlock:s=!1,isDeselectable:a=!1,label:u,hideLabelFromVision:d=!1,help:p,onChange:f,size:h="default",value:m,children:g,...v}=Ya(e,"ToggleGroupControl"),b=(0,l.useInstanceId)(d_,"toggle-group-control"),x=r&&"default"===h?"__unstable-large":h,y=qa(),w=(0,c.useMemo)((()=>y((({isBlock:e,isDeselectable:t,size:n})=>bl("background:",kl.ui.background,";border:1px solid transparent;border-radius:",Pl.radiusSmall,";display:inline-flex;min-width:0;position:relative;",qw(n)," ",!t&&Uw(e),";",""))({isBlock:s,isDeselectable:a,size:x}),s&&Yw,o)),[o,y,s,a,x]),_=a?u_:l_;return(0,wt.jsxs)(Ax,{help:p,__nextHasNoMarginBottom:n,__associatedWPComponentName:"ToggleGroupControl",children:[!d&&(0,wt.jsx)(Xw,{children:(0,wt.jsx)(Ax.VisualLabel,{children:u})}),(0,wt.jsx)(_,{...v,className:w,isAdaptiveWidth:i,label:u,onChange:f,ref:t,size:x,value:m,children:(0,wt.jsx)(Ww,{id:b,children:g})})]})}),"ToggleGroupControl"),p_=d_;var f_="input";var h_=kt((function(e){var t=e,{store:n,name:r,value:o,checked:i}=t,s=x(t,["store","name","value","checked"]);const a=e_();n=n||a;const l=je(s.id),c=(0,B.useRef)(null),u=Qe(n,(e=>null!=i?i:function(e,t){if(void 0!==t)return null!=e&&null!=t?t===e:!!t}(o,null==e?void 0:e.value)));(0,B.useEffect)((()=>{if(!l)return;if(!u)return;(null==n?void 0:n.getState().activeId)===l||null==n||n.setActiveId(l)}),[n,u,l]);const d=s.onChange,p=function(e,t){return"input"===e&&(!t||"radio"===t)}(Ee(c,f_),s.type),f=z(s),[h,m]=Te();(0,B.useEffect)((()=>{const e=c.current;e&&(p||(void 0!==u&&(e.checked=u),void 0!==r&&(e.name=r),void 0!==o&&(e.value=`${o}`)))}),[h,p,u,r,o]);const g=Se((e=>{if(f)return e.preventDefault(),void e.stopPropagation();p||(e.currentTarget.checked=!0,m()),null==d||d(e),e.defaultPrevented||null==n||n.setValue(o)})),y=s.onClick,w=Se((e=>{null==y||y(e),e.defaultPrevented||p||g(e)})),_=s.onFocus,S=Se((e=>{if(null==_||_(e),e.defaultPrevented)return;if(!p)return;if(!n)return;const{moves:t,activeId:r}=n.getState();t&&(l&&r!==l||g(e))}));return s=b(v({id:l,role:p?void 0:"radio",type:p?"radio":void 0,"aria-checked":u},s),{ref:ke(c,s.ref),onChange:g,onClick:w,onFocus:S}),s=Pn(v({store:n,clickOnEnter:!p},s)),L(v({name:p?r:void 0,value:p?o:void 0,checked:u},s))})),m_=St(_t((function(e){const t=h_(e);return Ct(f_,t)})));const g_=cl("div",{target:"et6ln9s1"})({name:"sln1fl",styles:"display:inline-flex;max-width:100%;min-width:0;position:relative"}),v_={name:"82a6rk",styles:"flex:1"},b_=({isDeselectable:e,isIcon:t,isPressed:n,size:r})=>bl("align-items:center;appearance:none;background:transparent;border:none;border-radius:",Pl.radiusXSmall,";color:",kl.gray[700],";fill:currentColor;cursor:pointer;display:flex;font-family:inherit;height:100%;justify-content:center;line-height:100%;outline:none;padding:0 12px;position:relative;text-align:center;@media not ( prefers-reduced-motion ){transition:background ",Pl.transitionDurationFast," linear,color ",Pl.transitionDurationFast," linear,font-weight 60ms linear;}user-select:none;width:100%;z-index:2;&::-moz-focus-inner{border:0;}&[disabled]{opacity:0.4;cursor:default;}&:active{background:",Pl.controlBackgroundColor,";}",e&&y_," ",t&&__({size:r})," ",n&&x_,";",""),x_=bl("color:",kl.white,";&:active{background:transparent;}",""),y_=bl("color:",kl.gray[900],";&:focus{box-shadow:inset 0 0 0 1px ",kl.white,",0 0 0 ",Pl.borderWidthFocus," ",kl.theme.accent,";outline:2px solid transparent;}",""),w_=cl("div",{target:"et6ln9s0"})("display:flex;font-size:",Pl.fontSize,";line-height:1;"),__=({size:e="default"})=>bl("color:",kl.gray[900],";height:",{default:"30px","__unstable-large":"32px"}[e],";aspect-ratio:1;padding-left:0;padding-right:0;",""),S_=bl("background:",kl.gray[900],";border-radius:",Pl.radiusXSmall,";position:absolute;inset:0;z-index:1;outline:2px solid transparent;outline-offset:-3px;",""),{Rp:C_,y0:k_}=t,j_={duration:0},E_=({showTooltip:e,text:t,children:n})=>e&&t?(0,wt.jsx)(Yi,{text:t,placement:"top",children:n}):(0,wt.jsx)(wt.Fragment,{children:n});const P_=Xa((function e(t,n){const r=(0,l.useReducedMotion)(),o=(0,c.useContext)(i_),i=Ya({...t,id:(0,l.useInstanceId)(e,o.baseId||"toggle-group-control-option-base")},"ToggleGroupControlOptionBase"),{isBlock:s=!1,isDeselectable:a=!1,size:u="default"}=o,{className:d,isIcon:p=!1,value:f,children:h,showTooltip:m=!1,disabled:g,...v}=i,b=o.value===f,x=qa(),y=(0,c.useMemo)((()=>x(s&&v_)),[x,s]),w=(0,c.useMemo)((()=>x(b_({isDeselectable:a,isIcon:p,isPressed:b,size:u}),d)),[x,a,p,b,u,d]),_=(0,c.useMemo)((()=>x(S_)),[x]),S={...v,className:w,"data-value":f,ref:n};return(0,wt.jsxs)(k_,{className:y,children:[(0,wt.jsx)(E_,{showTooltip:m,text:v["aria-label"],children:a?(0,wt.jsx)("button",{...S,disabled:g,"aria-pressed":b,type:"button",onClick:()=>{a&&b?o.setValue(void 0):o.setValue(f)},children:(0,wt.jsx)(C_,{children:h})}):(0,wt.jsx)(m_,{disabled:g,onFocusVisible:()=>{(null===o.value||""===o.value)&&!o.activeItemIsNotFirstItem?.()||o.setValue(f)},render:(0,wt.jsx)("button",{type:"button",...S}),value:f,children:(0,wt.jsx)(C_,{children:h})})}),b?(0,wt.jsx)(Xm.div,{layout:!0,layoutRoot:!0,children:(0,wt.jsx)(Xm.div,{className:_,transition:r?j_:void 0,role:"presentation",layoutId:"toggle-group-backdrop-shared-layout-id"})}):null]})}),"ToggleGroupControlOptionBase"),T_=P_;const R_=(0,c.forwardRef)((function(e,t){const{icon:n,label:r,...o}=e;return(0,wt.jsx)(T_,{...o,isIcon:!0,"aria-label":r,showTooltip:!0,ref:t,children:(0,wt.jsx)(Fx,{icon:n})})})),I_=R_,N_=[{label:(0,a.__)("Solid"),icon:zw,value:"solid"},{label:(0,a.__)("Dashed"),icon:Lw,value:"dashed"},{label:(0,a.__)("Dotted"),icon:Fw,value:"dotted"}];const M_=Xa((function({onChange:e,...t},n){return(0,wt.jsx)(p_,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,ref:n,isDeselectable:!0,onChange:t=>{e?.(t)},...t,children:N_.map((e=>(0,wt.jsx)(I_,{value:e.value,icon:e.icon,label:e.label},e.value)))})}),"BorderControlStylePicker");const A_=(0,c.forwardRef)((function(e,t){const{className:n,colorValue:r,...o}=e;return(0,wt.jsx)("span",{className:s("component-color-indicator",n),style:{background:r},ref:t,...o})}));var D_=function(e){var t=e/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},O_=function(e){return.2126*D_(e.r)+.7152*D_(e.g)+.0722*D_(e.b)};function z_(e){e.prototype.luminance=function(){return e=O_(this.rgba),void 0===(t=2)&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0;var e,t,n},e.prototype.contrast=function(t){void 0===t&&(t="#FFF");var n,r,o,i,s,a,l,c=t instanceof e?t:new e(t);return i=this.rgba,s=c.toRgb(),n=(a=O_(i))>(l=O_(s))?(a+.05)/(l+.05):(l+.05)/(a+.05),void 0===(r=2)&&(r=0),void 0===o&&(o=Math.pow(10,r)),Math.floor(o*n)/o+0},e.prototype.isReadable=function(e,t){return void 0===e&&(e="#FFF"),void 0===t&&(t={}),this.contrast(e)>=(s=void 0===(i=(n=t).size)?"normal":i,"AAA"===(o=void 0===(r=n.level)?"AA":r)&&"normal"===s?7:"AA"===o&&"large"===s?3:4.5);var n,r,o,i,s}}const L_=Xa(((e,t)=>{const{renderContent:n,renderToggle:r,className:o,contentClassName:i,expandOnMobile:a,headerTitle:u,focusOnMount:d,popoverProps:p,onClose:f,onToggle:h,style:m,open:g,defaultOpen:v,position:b,variant:x}=Ya(e,"Dropdown");void 0!==b&&Fi()("`position` prop in wp.components.Dropdown",{since:"6.2",alternative:"`popoverProps.placement` prop",hint:"Note that the `position` prop will override any values passed through the `popoverProps.placement` prop."});const[y,w]=(0,c.useState)(null),_=(0,c.useRef)(),[S,C]=c_({defaultValue:v,value:g,onChange:h});function k(){f?.(),C(!1)}const j={isOpen:!!S,onToggle:()=>C(!S),onClose:k},E=!!(p?.anchor||p?.anchorRef||p?.getAnchorRect||p?.anchorRect);return(0,wt.jsxs)("div",{className:o,ref:(0,l.useMergeRefs)([_,t,w]),tabIndex:-1,style:m,children:[r(j),S&&(0,wt.jsx)(vw,{position:b,onClose:k,onFocusOutside:function(){if(!_.current)return;const{ownerDocument:e}=_.current,t=e?.activeElement?.closest('[role="dialog"]');_.current.contains(e.activeElement)||t&&!t.contains(_.current)||k()},expandOnMobile:a,headerTitle:u,focusOnMount:d,offset:13,anchor:E?void 0:y,variant:x,...p,className:s("components-dropdown__content",p?.className,i),children:n(j)})]})}),"Dropdown"),F_=L_;const B_=Xa((function(e,t){const n=Ya(e,"InputControlSuffixWrapper");return(0,wt.jsx)(eb,{...n,ref:t})}),"InputControlSuffixWrapper");const V_=({disabled:e})=>e?bl("color:",kl.ui.textDisabled,";cursor:default;",""):"";var $_={name:"1lv1yo7",styles:"display:inline-flex"};const H_=({variant:e})=>"minimal"===e?$_:"",W_=cl(ab,{target:"e1mv6sxx3"})("color:",kl.theme.foreground,";cursor:pointer;",V_," ",H_,";"),U_=({__next40pxDefaultSize:e,multiple:t,selectSize:n="default"})=>{if(t)return;const r={default:{height:40,minHeight:40,paddingTop:0,paddingBottom:0},small:{height:24,minHeight:24,paddingTop:0,paddingBottom:0},compact:{height:32,minHeight:32,paddingTop:0,paddingBottom:0},"__unstable-large":{height:40,minHeight:40,paddingTop:0,paddingBottom:0}};e||(r.default=r.compact);return bl(r[n]||r.default,"","")},G_=({__next40pxDefaultSize:e,multiple:t,selectSize:n="default"})=>{const r={default:Pl.controlPaddingX,small:Pl.controlPaddingXSmall,compact:Pl.controlPaddingXSmall,"__unstable-large":Pl.controlPaddingX};e||(r.default=r.compact);const o=r[n]||r.default;return Sg({paddingLeft:o,paddingRight:o+18,...t?{paddingTop:o,paddingBottom:o}:{}})},K_=({multiple:e})=>({overflow:e?"auto":"hidden"});var q_={name:"n1jncc",styles:"field-sizing:content"};const Y_=({variant:e})=>"minimal"===e?q_:"",X_=cl("select",{target:"e1mv6sxx2"})("&&&{appearance:none;background:transparent;box-sizing:border-box;border:none;box-shadow:none!important;color:currentColor;cursor:inherit;display:block;font-family:inherit;margin:0;width:100%;max-width:none;white-space:nowrap;text-overflow:ellipsis;",Wv,";",U_,";",G_,";",K_," ",Y_,";}"),Z_=cl("div",{target:"e1mv6sxx1"})("margin-inline-end:",yl(-1),";line-height:0;path{fill:currentColor;}"),Q_=cl(B_,{target:"e1mv6sxx0"})("position:absolute;pointer-events:none;",Sg({right:0}),";");const J_=(0,c.forwardRef)((function({icon:e,size:t=24,...n},r){return(0,c.cloneElement)(e,{width:t,height:t,...n,ref:r})})),eS=(0,wt.jsx)(n.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,wt.jsx)(n.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"})}),tS=()=>(0,wt.jsx)(Q_,{children:(0,wt.jsx)(Z_,{children:(0,wt.jsx)(J_,{icon:eS,size:18})})});function nS({options:e}){return e.map((({id:e,label:t,value:n,...r},o)=>{const i=e||`${t}-${n}-${o}`;return(0,wt.jsx)("option",{value:n,...r,children:t},i)}))}const rS=(0,c.forwardRef)((function(e,t){const{className:n,disabled:r=!1,help:o,hideLabelFromVision:i,id:a,label:c,multiple:u=!1,onChange:d,options:p=[],size:f="default",value:h,labelPosition:m="top",children:g,prefix:v,suffix:b,variant:x="default",__next40pxDefaultSize:y=!1,__nextHasNoMarginBottom:w=!1,..._}=ob(e),S=function(e){const t=(0,l.useInstanceId)(rS);return e||`inspector-select-control-${t}`}(a),C=o?`${S}__help`:void 0;if(!p?.length&&!g)return null;const k=s("components-select-control",n);return(0,wt.jsx)(Ax,{help:o,id:S,__nextHasNoMarginBottom:w,__associatedWPComponentName:"SelectControl",children:(0,wt.jsx)(W_,{className:k,disabled:r,hideLabelFromVision:i,id:S,isBorderless:"minimal"===x,label:c,size:f,suffix:b||!u&&(0,wt.jsx)(tS,{}),prefix:v,labelPosition:m,__unstableInputWidth:"minimal"===x?"auto":void 0,variant:x,__next40pxDefaultSize:y,children:(0,wt.jsx)(X_,{..._,__next40pxDefaultSize:y,"aria-describedby":C,className:"components-select-control__input",disabled:r,id:S,multiple:u,onChange:t=>{if(e.multiple){const n=Array.from(t.target.options).filter((({selected:e})=>e)).map((({value:e})=>e));e.onChange?.(n,{event:t})}else e.onChange?.(t.target.value,{event:t})},ref:t,selectSize:f,value:h,variant:x,children:g||(0,wt.jsx)(nS,{options:p})})})})})),oS=rS,iS={initial:void 0,fallback:""};const sS=function(e,t=iS){const{initial:n,fallback:r}={...iS,...t},[o,i]=(0,c.useState)(e),s=Ig(e);return(0,c.useEffect)((()=>{s&&o&&i(void 0)}),[s,o]),[function(e=[],t){var n;return null!==(n=e.find(Ig))&&void 0!==n?n:t}([e,o,n],r),(0,c.useCallback)((e=>{s||i(e)}),[s])]};function aS(e,t,n){return"number"!=typeof e?null:parseFloat(`${Xx(e,t,n)}`)}const lS=30,cS=()=>bl({height:lS,minHeight:lS},"",""),uS=12,dS=({__next40pxDefaultSize:e})=>!e&&bl({minHeight:lS},"",""),pS=cl("div",{target:"e1epgpqk14"})("-webkit-tap-highlight-color:transparent;align-items:center;display:flex;justify-content:flex-start;padding:0;position:relative;touch-action:none;width:100%;min-height:40px;",dS,";"),fS=({color:e=kl.ui.borderFocus})=>bl({color:e},"",""),hS=({marks:e,__nextHasNoMarginBottom:t})=>t?"":bl({marginBottom:e?16:void 0},"",""),mS=cl("div",{target:"e1epgpqk13"})("display:block;flex:1;position:relative;width:100%;",fS,";",cS,";",hS,";"),gS=cl("span",{target:"e1epgpqk12"})("display:flex;margin-top:",4,"px;",Sg({marginRight:6}),";"),vS=cl("span",{target:"e1epgpqk11"})("display:flex;margin-top:",4,"px;",Sg({marginLeft:6}),";"),bS=({disabled:e,railColor:t})=>{let n=t||"";return e&&(n=kl.ui.backgroundDisabled),bl({background:n},"","")},xS=cl("span",{target:"e1epgpqk10"})("background-color:",kl.gray[300],";left:0;pointer-events:none;right:0;display:block;height:",4,"px;position:absolute;margin-top:",13,"px;top:0;border-radius:",Pl.radiusFull,";",bS,";"),yS=({disabled:e,trackColor:t})=>{let n=t||"currentColor";return e&&(n=kl.gray[400]),bl({background:n},"","")},wS=cl("span",{target:"e1epgpqk9"})("background-color:currentColor;border-radius:",Pl.radiusFull,";height:",4,"px;pointer-events:none;display:block;position:absolute;margin-top:",13,"px;top:0;",yS,";"),_S=cl("span",{target:"e1epgpqk8"})({name:"l7tjj5",styles:"display:block;pointer-events:none;position:relative;width:100%;user-select:none"}),SS=({disabled:e,isFilled:t})=>{let n=t?"currentColor":kl.gray[300];return e&&(n=kl.gray[400]),bl({backgroundColor:n},"","")},CS=cl("span",{target:"e1epgpqk7"})("height:",uS,"px;left:0;position:absolute;top:9px;width:1px;",SS,";"),kS=({isFilled:e})=>bl({color:e?kl.gray[700]:kl.gray[300]},"",""),jS=cl("span",{target:"e1epgpqk6"})("color:",kl.gray[300],";font-size:11px;position:absolute;top:22px;white-space:nowrap;",Sg({left:0}),";",Sg({transform:"translateX( -50% )"},{transform:"translateX( 50% )"}),";",kS,";"),ES=({disabled:e})=>bl("background-color:",e?kl.gray[400]:kl.theme.accent,";",""),PS=cl("span",{target:"e1epgpqk5"})("align-items:center;display:flex;height:",uS,"px;justify-content:center;margin-top:",9,"px;outline:0;pointer-events:none;position:absolute;top:0;user-select:none;width:",uS,"px;border-radius:",Pl.radiusRound,";",ES,";",Sg({marginLeft:-10}),";",Sg({transform:"translateX( 4.5px )"},{transform:"translateX( -4.5px )"}),";"),TS=({isFocused:e})=>e?bl("&::before{content:' ';position:absolute;background-color:",kl.theme.accent,";opacity:0.4;border-radius:",Pl.radiusRound,";height:",20,"px;width:",20,"px;top:-4px;left:-4px;}",""):"",RS=cl("span",{target:"e1epgpqk4"})("align-items:center;border-radius:",Pl.radiusRound,";height:100%;outline:0;position:absolute;user-select:none;width:100%;box-shadow:",Pl.elevationXSmall,";",ES,";",TS,";"),IS=cl("input",{target:"e1epgpqk3"})("box-sizing:border-box;cursor:pointer;display:block;height:100%;left:0;margin:0 -",6,"px;opacity:0;outline:none;position:absolute;right:0;top:0;width:calc( 100% + ",uS,"px );"),NS=({show:e})=>bl({opacity:e?1:0},"","");var MS={name:"1cypxip",styles:"top:-80%"},AS={name:"1lr98c4",styles:"bottom:-80%"};const DS=({position:e})=>"bottom"===e?AS:MS,OS=cl("span",{target:"e1epgpqk2"})("background:rgba( 0, 0, 0, 0.8 );border-radius:",Pl.radiusSmall,";color:white;display:inline-block;font-size:12px;min-width:32px;opacity:0;padding:4px 8px;pointer-events:none;position:absolute;text-align:center;user-select:none;line-height:1.4;@media not ( prefers-reduced-motion ){transition:opacity 120ms ease;}",NS,";",DS,";",Sg({transform:"translateX(-50%)"},{transform:"translateX(50%)"}),";"),zS=cl(iy,{target:"e1epgpqk1"})("display:inline-block;font-size:13px;margin-top:0;input[type='number']&{",cS,";}",Sg({marginLeft:`${yl(4)} !important`}),";"),LS=cl("span",{target:"e1epgpqk0"})("display:block;margin-top:0;button,button.is-small{margin-left:0;",cS,";}",Sg({marginLeft:8}),";");const FS=(0,c.forwardRef)((function(e,t){const{describedBy:n,label:r,value:o,...i}=e;return(0,wt.jsx)(IS,{...i,"aria-describedby":n,"aria-label":r,"aria-hidden":!1,ref:t,tabIndex:0,type:"range",value:o})}));function BS(e){const{className:t,isFilled:n=!1,label:r,style:o={},...i}=e,a=s("components-range-control__mark",n&&"is-filled",t),l=s("components-range-control__mark-label",n&&"is-filled");return(0,wt.jsxs)(wt.Fragment,{children:[(0,wt.jsx)(CS,{...i,"aria-hidden":"true",className:a,isFilled:n,style:o}),r&&(0,wt.jsx)(jS,{"aria-hidden":"true",className:l,isFilled:n,style:o,children:r})]})}function VS(e){const{disabled:t=!1,marks:n=!1,min:r=0,max:o=100,step:i=1,value:s=0,...a}=e;return(0,wt.jsxs)(wt.Fragment,{children:[(0,wt.jsx)(xS,{disabled:t,...a}),n&&(0,wt.jsx)($S,{disabled:t,marks:n,min:r,max:o,step:i,value:s})]})}function $S(e){const{disabled:t=!1,marks:n=!1,min:r=0,max:o=100,step:i=1,value:s=0}=e,l=function({marks:e,min:t=0,max:n=100,step:r=1,value:o=0}){if(!e)return[];const i=n-t;if(!Array.isArray(e)){e=[];const n=1+Math.round(i/r);for(;n>e.push({value:r*e.length+t}););}const s=[];return e.forEach(((e,r)=>{if(e.valuen)return;const l=`mark-${r}`,c=e.value<=o,u=(e.value-t)/i*100+"%",d={[(0,a.isRTL)()?"right":"left"]:u};s.push({...e,isFilled:c,key:l,style:d})})),s}({marks:n,min:r,max:o,step:"any"===i?1:i,value:s});return(0,wt.jsx)(_S,{"aria-hidden":"true",className:"components-range-control__marks",children:l.map((e=>(0,B.createElement)(BS,{...e,key:e.key,"aria-hidden":"true",disabled:t})))})}function HS(e){const{className:t,inputRef:n,tooltipPosition:r,show:o=!1,style:i={},value:a=0,renderTooltipContent:l=e=>e,zIndex:u=100,...d}=e,p=function({inputRef:e,tooltipPosition:t}){const[n,r]=(0,c.useState)(),o=(0,c.useCallback)((()=>{e&&e.current&&r(t)}),[t,e]);return(0,c.useEffect)((()=>{o()}),[o]),(0,c.useEffect)((()=>(window.addEventListener("resize",o),()=>{window.removeEventListener("resize",o)}))),n}({inputRef:n,tooltipPosition:r}),f=s("components-simple-tooltip",t),h={...i,zIndex:u};return(0,wt.jsx)(OS,{...d,"aria-hidden":o,className:f,position:p,show:o,role:"tooltip",style:h,children:l(a)})}const WS=()=>{};function US({resetFallbackValue:e,initialPosition:t}){return void 0!==e?Number.isNaN(e)?null:e:void 0!==t?Number.isNaN(t)?null:t:null}const GS=(0,c.forwardRef)((function e(t,n){const{__nextHasNoMarginBottom:r=!1,afterIcon:o,allowReset:i=!1,beforeIcon:u,className:d,color:p=kl.theme.accent,currentInput:f,disabled:h=!1,help:m,hideLabelFromVision:g=!1,initialPosition:v,isShiftStepEnabled:b=!0,label:x,marks:y=!1,max:w=100,min:_=0,onBlur:S=WS,onChange:C=WS,onFocus:k=WS,onMouseLeave:j=WS,onMouseMove:E=WS,railColor:P,renderTooltipContent:T=e=>e,resetFallbackValue:R,__next40pxDefaultSize:I=!1,shiftStep:N=10,showTooltip:M,step:A=1,trackColor:D,value:O,withInputField:z=!0,...L}=t,[F,B]=function(e){const{min:t,max:n,value:r,initial:o}=e,[i,s]=sS(aS(r,t,n),{initial:aS(null!=o?o:null,t,n),fallback:null});return[i,(0,c.useCallback)((e=>{s(null===e?null:aS(e,t,n))}),[t,n,s])]}({min:_,max:w,value:null!=O?O:null,initial:v}),V=(0,c.useRef)(!1);let $=M,H=z;"any"===A&&($=!1,H=!1);const[W,U]=(0,c.useState)($),[G,K]=(0,c.useState)(!1),q=(0,c.useRef)(),Y=q.current?.matches(":focus"),X=!h&&G,Z=null===F,Q=Z?"":void 0!==F?F:f,J=Z?(w-_)/2+_:F,ee=`${Xx(Z?50:(F-_)/(w-_)*100,0,100)}%`,te=s("components-range-control",d),ne=s("components-range-control__wrapper",!!y&&"is-marked"),re=(0,l.useInstanceId)(e,"inspector-range-control"),oe=m?`${re}__help`:void 0,ie=!1!==$&&Number.isFinite(F),se=()=>{const e=Number.isNaN(R)?null:null!=R?R:null;B(e),C(null!=e?e:void 0)},ae={[(0,a.isRTL)()?"right":"left"]:ee};return(0,wt.jsx)(Ax,{__nextHasNoMarginBottom:r,__associatedWPComponentName:"RangeControl",className:te,label:x,hideLabelFromVision:g,id:`${re}`,help:m,children:(0,wt.jsxs)(pS,{className:"components-range-control__root",__next40pxDefaultSize:I,children:[u&&(0,wt.jsx)(gS,{children:(0,wt.jsx)(Fx,{icon:u})}),(0,wt.jsxs)(mS,{__nextHasNoMarginBottom:r,className:ne,color:p,marks:!!y,children:[(0,wt.jsx)(FS,{...L,className:"components-range-control__slider",describedBy:oe,disabled:h,id:`${re}`,label:x,max:w,min:_,onBlur:e=>{S(e),K(!1),U(!1)},onChange:e=>{const t=parseFloat(e.target.value);B(t),C(t)},onFocus:e=>{k(e),K(!0),U(!0)},onMouseMove:E,onMouseLeave:j,ref:(0,l.useMergeRefs)([q,n]),step:A,value:null!=Q?Q:void 0}),(0,wt.jsx)(VS,{"aria-hidden":!0,disabled:h,marks:y,max:w,min:_,railColor:P,step:A,value:J}),(0,wt.jsx)(wS,{"aria-hidden":!0,className:"components-range-control__track",disabled:h,style:{width:ee},trackColor:D}),(0,wt.jsx)(PS,{className:"components-range-control__thumb-wrapper",style:ae,disabled:h,children:(0,wt.jsx)(RS,{"aria-hidden":!0,isFocused:X,disabled:h})}),ie&&(0,wt.jsx)(HS,{className:"components-range-control__tooltip",inputRef:q,tooltipPosition:"bottom",renderTooltipContent:T,show:Y||W,style:ae,value:F})]}),o&&(0,wt.jsx)(vS,{children:(0,wt.jsx)(Fx,{icon:o})}),H&&(0,wt.jsx)(zS,{"aria-label":x,className:"components-range-control__number",disabled:h,inputMode:"decimal",isShiftStepEnabled:b,max:w,min:_,onBlur:()=>{V.current&&(se(),V.current=!1)},onChange:e=>{let t=parseFloat(e);B(t),isNaN(t)?i&&(V.current=!0):((t<_||t>w)&&(t=aS(t,_,w)),C(t),V.current=!1)},shiftStep:N,size:I?"__unstable-large":"default",__unstableInputWidth:yl(I?20:16),step:A,value:Q}),i&&(0,wt.jsx)(LS,{children:(0,wt.jsx)($x,{className:"components-range-control__reset",accessibleWhenDisabled:!h,disabled:h||F===US({resetFallbackValue:R,initialPosition:v}),variant:"secondary",size:"small",onClick:se,children:(0,a.__)("Reset")})})]})})})),KS=GS,qS=cl(iy,{target:"ez9hsf47"})("width:",yl(24),";"),YS=cl(oS,{target:"ez9hsf46"})("margin-left:",yl(-2),";width:5em;"),XS=cl(KS,{target:"ez9hsf45"})("flex:1;margin-right:",yl(2),";"),ZS=`\n.react-colorful__interactive {\n\twidth: calc( 100% - ${yl(2)} );\n\tmargin-left: ${yl(1)};\n}`,QS=cl("div",{target:"ez9hsf44"})("padding-top:",yl(2),";padding-right:0;padding-left:0;padding-bottom:0;"),JS=cl(ny,{target:"ez9hsf43"})("padding-left:",yl(4),";padding-right:",yl(4),";"),eC=cl(mg,{target:"ez9hsf42"})("padding-top:",yl(4),";padding-left:",yl(4),";padding-right:",yl(3),";padding-bottom:",yl(5),";"),tC=cl("div",{target:"ez9hsf41"})(_x,";width:216px;.react-colorful{display:flex;flex-direction:column;align-items:center;width:216px;height:auto;}.react-colorful__saturation{width:100%;border-radius:0;height:216px;margin-bottom:",yl(4),";border-bottom:none;}.react-colorful__hue,.react-colorful__alpha{width:184px;height:16px;border-radius:",Pl.radiusFull,";margin-bottom:",yl(2),";}.react-colorful__pointer{height:16px;width:16px;border:none;box-shadow:0 0 2px 0 rgba( 0, 0, 0, 0.25 );outline:2px solid transparent;}.react-colorful__pointer-fill{box-shadow:inset 0 0 0 ",Pl.borderWidthFocus," #fff;}",ZS,";"),nC=cl($x,{target:"ez9hsf40"})("&&&&&{min-width:",yl(6),";padding:0;>svg{margin-right:0;}}"),rC=(0,wt.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,wt.jsx)(n.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M5 4.5h11a.5.5 0 0 1 .5.5v11a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V5a.5.5 0 0 1 .5-.5ZM3 5a2 2 0 0 1 2-2h11a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5Zm17 3v10.75c0 .69-.56 1.25-1.25 1.25H6v1.5h12.75a2.75 2.75 0 0 0 2.75-2.75V8H20Z"})}),oC=e=>{const{color:t,colorType:n}=e,[r,o]=(0,c.useState)(null),i=(0,c.useRef)(),s=(0,l.useCopyToClipboard)((()=>{switch(n){case"hsl":return t.toHslString();case"rgb":return t.toRgbString();default:return t.toHex()}}),(()=>{i.current&&clearTimeout(i.current),o(t.toHex()),i.current=setTimeout((()=>{o(null),i.current=void 0}),3e3)}));return(0,c.useEffect)((()=>()=>{i.current&&clearTimeout(i.current)}),[]),(0,wt.jsx)(Yi,{delay:0,hideOnClick:!1,text:r===t.toHex()?(0,a.__)("Copied!"):(0,a.__)("Copy"),children:(0,wt.jsx)(nC,{size:"small",ref:s,icon:rC,showTooltip:!1})})};const iC=Xa((function(e,t){const n=Ya(e,"InputControlPrefixWrapper");return(0,wt.jsx)(eb,{...n,isPrefix:!0,ref:t})}),"InputControlPrefixWrapper"),sC=({min:e,max:t,label:n,abbreviation:r,onChange:o,value:i})=>(0,wt.jsxs)(ny,{spacing:4,children:[(0,wt.jsx)(qS,{min:e,max:t,label:n,hideLabelFromVision:!0,value:i,onChange:e=>{o(e?"string"!=typeof e?e:parseInt(e,10):0)},prefix:(0,wt.jsx)(iC,{children:(0,wt.jsx)(Nv,{color:kl.theme.accent,lineHeight:1,children:r})}),spinControls:"none",size:"__unstable-large"}),(0,wt.jsx)(XS,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:n,hideLabelFromVision:!0,min:e,max:t,value:i,onChange:o,withInputField:!1})]}),aC=({color:e,onChange:t,enableAlpha:n})=>{const{r,g:o,b:i,a:s}=e.toRgb();return(0,wt.jsxs)(wt.Fragment,{children:[(0,wt.jsx)(sC,{min:0,max:255,label:"Red",abbreviation:"R",value:r,onChange:e=>t(uv({r:e,g:o,b:i,a:s}))}),(0,wt.jsx)(sC,{min:0,max:255,label:"Green",abbreviation:"G",value:o,onChange:e=>t(uv({r,g:e,b:i,a:s}))}),(0,wt.jsx)(sC,{min:0,max:255,label:"Blue",abbreviation:"B",value:i,onChange:e=>t(uv({r,g:o,b:e,a:s}))}),n&&(0,wt.jsx)(sC,{min:0,max:100,label:"Alpha",abbreviation:"A",value:Math.trunc(100*s),onChange:e=>t(uv({r,g:o,b:i,a:e/100}))})]})},lC=({color:e,onChange:t,enableAlpha:n})=>{const r=(0,c.useMemo)((()=>e.toHsl()),[e]),[o,i]=(0,c.useState)({...r}),s=e.isEqual(uv(o));(0,c.useEffect)((()=>{s||i(r)}),[r,s]);const a=s?o:r,l=n=>{const r=uv({...a,...n});e.isEqual(r)?i((e=>({...e,...n}))):t(r)};return(0,wt.jsxs)(wt.Fragment,{children:[(0,wt.jsx)(sC,{min:0,max:359,label:"Hue",abbreviation:"H",value:a.h,onChange:e=>{l({h:e})}}),(0,wt.jsx)(sC,{min:0,max:100,label:"Saturation",abbreviation:"S",value:a.s,onChange:e=>{l({s:e})}}),(0,wt.jsx)(sC,{min:0,max:100,label:"Lightness",abbreviation:"L",value:a.l,onChange:e=>{l({l:e})}}),n&&(0,wt.jsx)(sC,{min:0,max:100,label:"Alpha",abbreviation:"A",value:Math.trunc(100*a.a),onChange:e=>{l({a:e/100})}})]})},cC=({color:e,onChange:t,enableAlpha:n})=>(0,wt.jsx)(Ox,{prefix:(0,wt.jsx)(iC,{children:(0,wt.jsx)(Nv,{color:kl.theme.accent,lineHeight:1,children:"#"})}),value:e.toHex().slice(1).toUpperCase(),onChange:e=>{if(!e)return;const n=e.startsWith("#")?e:"#"+e;t(uv(n))},maxLength:n?9:7,label:(0,a.__)("Hex color"),hideLabelFromVision:!0,size:"__unstable-large",__unstableStateReducer:(e,t)=>{const n=t.payload?.event?.nativeEvent;if("insertFromPaste"!==n?.inputType)return{...e};const r=e.value?.startsWith("#")?e.value.slice(1).toUpperCase():e.value?.toUpperCase();return{...e,value:r}},__unstableInputWidth:"9em"}),uC=({colorType:e,color:t,onChange:n,enableAlpha:r})=>{const o={color:t,onChange:n,enableAlpha:r};switch(e){case"hsl":return(0,wt.jsx)(lC,{...o});case"rgb":return(0,wt.jsx)(aC,{...o});default:return(0,wt.jsx)(cC,{...o})}};function dC(){return(dC=Object.assign||function(e){for(var t=1;t=0||(o[n]=e[n]);return o}function fC(e){var t=(0,B.useRef)(e),n=(0,B.useRef)((function(e){t.current&&t.current(e)}));return t.current=e,n.current}var hC=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e0:e.buttons>0)&&o.current?i(vC(o.current,e,a.current)):n(!1)},t=function(){return n(!1)};function n(n){var r=l.current,i=gC(o.current),s=n?i.addEventListener:i.removeEventListener;s(r?"touchmove":"mousemove",e),s(r?"touchend":"mouseup",t)}return[function(e){var t=e.nativeEvent,r=o.current;if(r&&(bC(t),!function(e,t){return t&&!mC(e)}(t,l.current)&&r)){if(mC(t)){l.current=!0;var s=t.changedTouches||[];s.length&&(a.current=s[0].identifier)}r.focus(),i(vC(r,t,a.current)),n(!0)}},function(e){var t=e.which||e.keyCode;t<37||t>40||(e.preventDefault(),s({left:39===t?.05:37===t?-.05:0,top:40===t?.05:38===t?-.05:0}))},n]}),[s,i]),u=c[0],d=c[1],p=c[2];return(0,B.useEffect)((function(){return p}),[p]),B.createElement("div",dC({},r,{onTouchStart:u,onMouseDown:u,className:"react-colorful__interactive",ref:o,onKeyDown:d,tabIndex:0,role:"slider"}))})),yC=function(e){return e.filter(Boolean).join(" ")},wC=function(e){var t=e.color,n=e.left,r=e.top,o=void 0===r?.5:r,i=yC(["react-colorful__pointer",e.className]);return B.createElement("div",{className:i,style:{top:100*o+"%",left:100*n+"%"}},B.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},_C=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n},SC=(Math.PI,function(e){var t=e.s,n=e.v,r=e.a,o=(200-t)*n/100;return{h:_C(e.h),s:_C(o>0&&o<200?t*n/100/(o<=100?o:200-o)*100:0),l:_C(o/2),a:_C(r,2)}}),CC=function(e){var t=SC(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},kC=function(e){var t=SC(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},jC=function(e){var t=e.h,n=e.s,r=e.v,o=e.a;t=t/360*6,n/=100,r/=100;var i=Math.floor(t),s=r*(1-n),a=r*(1-(t-i)*n),l=r*(1-(1-t+i)*n),c=i%6;return{r:_C(255*[r,a,s,s,l,r][c]),g:_C(255*[l,r,r,a,s,s][c]),b:_C(255*[s,s,l,r,r,a][c]),a:_C(o,2)}},EC=function(e){var t=/rgba?\(?\s*(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return t?TC({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):{h:0,s:0,v:0,a:1}},PC=EC,TC=function(e){var t=e.r,n=e.g,r=e.b,o=e.a,i=Math.max(t,n,r),s=i-Math.min(t,n,r),a=s?i===t?(n-r)/s:i===n?2+(r-t)/s:4+(t-n)/s:0;return{h:_C(60*(a<0?a+6:a)),s:_C(i?s/i*100:0),v:_C(i/255*100),a:o}},RC=B.memo((function(e){var t=e.hue,n=e.onChange,r=yC(["react-colorful__hue",e.className]);return B.createElement("div",{className:r},B.createElement(xC,{onMove:function(e){n({h:360*e.left})},onKey:function(e){n({h:hC(t+360*e.left,0,360)})},"aria-label":"Hue","aria-valuenow":_C(t),"aria-valuemax":"360","aria-valuemin":"0"},B.createElement(wC,{className:"react-colorful__hue-pointer",left:t/360,color:CC({h:t,s:100,v:100,a:1})})))})),IC=B.memo((function(e){var t=e.hsva,n=e.onChange,r={backgroundColor:CC({h:t.h,s:100,v:100,a:1})};return B.createElement("div",{className:"react-colorful__saturation",style:r},B.createElement(xC,{onMove:function(e){n({s:100*e.left,v:100-100*e.top})},onKey:function(e){n({s:hC(t.s+100*e.left,0,100),v:hC(t.v-100*e.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+_C(t.s)+"%, Brightness "+_C(t.v)+"%"},B.createElement(wC,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:CC(t)})))})),NC=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0},MC=function(e,t){return e.replace(/\s/g,"")===t.replace(/\s/g,"")};function AC(e,t,n){var r=fC(n),o=(0,B.useState)((function(){return e.toHsva(t)})),i=o[0],s=o[1],a=(0,B.useRef)({color:t,hsva:i});(0,B.useEffect)((function(){if(!e.equal(t,a.current.color)){var n=e.toHsva(t);a.current={hsva:n,color:t},s(n)}}),[t,e]),(0,B.useEffect)((function(){var t;NC(i,a.current.hsva)||e.equal(t=e.fromHsva(i),a.current.color)||(a.current={hsva:i,color:t},r(t))}),[i,e,r]);var l=(0,B.useCallback)((function(e){s((function(t){return Object.assign({},t,e)}))}),[]);return[i,l]}var DC,OC="undefined"!=typeof window?B.useLayoutEffect:B.useEffect,zC=new Map,LC=function(e){OC((function(){var t=e.current?e.current.ownerDocument:document;if(void 0!==t&&!zC.has(t)){var n=t.createElement("style");n.innerHTML='.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url(\'data:image/svg+xml;charset=utf-8,\')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}',zC.set(t,n);var r=DC||o.nc;r&&n.setAttribute("nonce",r),t.head.appendChild(n)}}),[])},FC=function(e){var t=e.className,n=e.colorModel,r=e.color,o=void 0===r?n.defaultColor:r,i=e.onChange,s=pC(e,["className","colorModel","color","onChange"]),a=(0,B.useRef)(null);LC(a);var l=AC(n,o,i),c=l[0],u=l[1],d=yC(["react-colorful",t]);return B.createElement("div",dC({},s,{ref:a,className:d}),B.createElement(IC,{hsva:c,onChange:u}),B.createElement(RC,{hue:c.h,onChange:u,className:"react-colorful__last-control"}))},BC=function(e){var t=e.className,n=e.hsva,r=e.onChange,o={backgroundImage:"linear-gradient(90deg, "+kC(Object.assign({},n,{a:0}))+", "+kC(Object.assign({},n,{a:1}))+")"},i=yC(["react-colorful__alpha",t]),s=_C(100*n.a);return B.createElement("div",{className:i},B.createElement("div",{className:"react-colorful__alpha-gradient",style:o}),B.createElement(xC,{onMove:function(e){r({a:e.left})},onKey:function(e){r({a:hC(n.a+e.left)})},"aria-label":"Alpha","aria-valuetext":s+"%","aria-valuenow":s,"aria-valuemin":"0","aria-valuemax":"100"},B.createElement(wC,{className:"react-colorful__alpha-pointer",left:n.a,color:kC(n)})))},VC=function(e){var t=e.className,n=e.colorModel,r=e.color,o=void 0===r?n.defaultColor:r,i=e.onChange,s=pC(e,["className","colorModel","color","onChange"]),a=(0,B.useRef)(null);LC(a);var l=AC(n,o,i),c=l[0],u=l[1],d=yC(["react-colorful",t]);return B.createElement("div",dC({},s,{ref:a,className:d}),B.createElement(IC,{hsva:c,onChange:u}),B.createElement(RC,{hue:c.h,onChange:u}),B.createElement(BC,{hsva:c,onChange:u,className:"react-colorful__last-control"}))},$C={defaultColor:"rgba(0, 0, 0, 1)",toHsva:EC,fromHsva:function(e){var t=jC(e);return"rgba("+t.r+", "+t.g+", "+t.b+", "+t.a+")"},equal:MC},HC=function(e){return B.createElement(VC,dC({},e,{colorModel:$C}))},WC={defaultColor:"rgb(0, 0, 0)",toHsva:PC,fromHsva:function(e){var t=jC(e);return"rgb("+t.r+", "+t.g+", "+t.b+")"},equal:MC},UC=function(e){return B.createElement(FC,dC({},e,{colorModel:WC}))};const GC=({color:e,enableAlpha:t,onChange:n})=>{const r=t?HC:UC,o=(0,c.useMemo)((()=>e.toRgbString()),[e]);return(0,wt.jsx)(r,{color:o,onChange:e=>{n(uv(e))},onPointerDown:({currentTarget:e,pointerId:t})=>{e.setPointerCapture(t)},onPointerUp:({currentTarget:e,pointerId:t})=>{e.releasePointerCapture(t)}})};pv([fv]);const KC=[{label:"RGB",value:"rgb"},{label:"HSL",value:"hsl"},{label:"Hex",value:"hex"}],qC=Xa(((e,t)=>{const{enableAlpha:n=!1,color:r,onChange:o,defaultValue:i="#fff",copyFormat:s,...u}=Ya(e,"ColorPicker"),[d,p]=c_({onChange:o,value:r,defaultValue:i}),f=(0,c.useMemo)((()=>uv(d||"")),[d]),h=(0,l.useDebounce)(p),m=(0,c.useCallback)((e=>{h(e.toHex())}),[h]),[g,v]=(0,c.useState)(s||"hex");return(0,wt.jsxs)(tC,{ref:t,...u,children:[(0,wt.jsx)(GC,{onChange:m,color:f,enableAlpha:n}),(0,wt.jsxs)(QS,{children:[(0,wt.jsxs)(JS,{justify:"space-between",children:[(0,wt.jsx)(YS,{__nextHasNoMarginBottom:!0,options:KC,value:g,onChange:e=>v(e),label:(0,a.__)("Color format"),hideLabelFromVision:!0,variant:"minimal"}),(0,wt.jsx)(oC,{color:f,colorType:s||g})]}),(0,wt.jsx)(eC,{direction:"column",gap:2,children:(0,wt.jsx)(uC,{colorType:g,color:f,onChange:m,enableAlpha:n})})]})]})}),"ColorPicker"),YC=qC;function XC(e){if(void 0!==e)return"string"==typeof e?e:e.hex?e.hex:void 0}const ZC=gs((e=>{const t=uv(e),n=t.toHex(),r=t.toRgb(),o=t.toHsv(),i=t.toHsl();return{hex:n,rgb:r,hsv:o,hsl:i,source:"hex",oldHue:i.h}}));function QC(e){const{onChangeComplete:t}=e,n=(0,c.useCallback)((e=>{t(ZC(e))}),[t]);return function(e){return void 0!==e.onChangeComplete||void 0!==e.disableAlpha||"string"==typeof e.color?.hex}(e)?{color:XC(e.color),enableAlpha:!e.disableAlpha,onChange:n}:{...e,color:e.color,enableAlpha:e.enableAlpha,onChange:e.onChange}}const JC=e=>(0,wt.jsx)(YC,{...QC(e)}),ek=(0,c.createContext)({}),tk=(0,wt.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,wt.jsx)(n.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})});const nk=(0,c.forwardRef)((function(e,t){const{isPressed:n,...r}=e;return(0,wt.jsx)($x,{...r,"aria-pressed":n,ref:t})}));const rk=(0,c.forwardRef)((function(e,t){const{id:n,isSelected:r,...o}=e,{setActiveId:i,activeId:s}=(0,c.useContext)(ek);return(0,c.useEffect)((()=>{r&&!s&&window.setTimeout((()=>i?.(n)),0)}),[r,i,s,n]),(0,wt.jsx)(Dn.Item,{render:(0,wt.jsx)($x,{...o,role:"option","aria-selected":!!r,ref:t}),id:n})}));function ok(e){const{actions:t,options:n,baseId:r,className:o,loop:i=!0,children:s,...l}=e,[u,d]=(0,c.useState)(void 0),p=(0,c.useMemo)((()=>({baseId:r,activeId:u,setActiveId:d})),[r,u,d]);return(0,wt.jsx)("div",{className:o,children:(0,wt.jsxs)(ek.Provider,{value:p,children:[(0,wt.jsx)(Dn,{...l,id:r,focusLoop:i,rtl:(0,a.isRTL)(),role:"listbox",activeId:u,setActiveId:d,children:n}),s,t]})})}function ik(e){const{actions:t,options:n,children:r,baseId:o,...i}=e,s=(0,c.useMemo)((()=>({baseId:o})),[o]);return(0,wt.jsx)("div",{...i,id:o,children:(0,wt.jsxs)(ek.Provider,{value:s,children:[n,r,t]})})}function sk(e){const{asButtons:t,actions:n,options:r,children:o,className:i,...a}=e,c=(0,l.useInstanceId)(sk,"components-circular-option-picker",a.id),u=t?ik:ok,d=n?(0,wt.jsx)("div",{className:"components-circular-option-picker__custom-clear-wrapper",children:n}):void 0,p=(0,wt.jsx)("div",{className:"components-circular-option-picker__swatches",children:r});return(0,wt.jsx)(u,{...a,baseId:c,className:s("components-circular-option-picker",i),actions:d,options:p,children:o})}sk.Option=function e({className:t,isSelected:n,selectedIconProps:r={},tooltipText:o,...i}){const{baseId:a,setActiveId:u}=(0,c.useContext)(ek),d={id:(0,l.useInstanceId)(e,a||"components-circular-option-picker__option"),className:"components-circular-option-picker__option",...i},p=void 0!==u?(0,wt.jsx)(rk,{...d,isSelected:n}):(0,wt.jsx)(nk,{...d,isPressed:n});return(0,wt.jsxs)("div",{className:s(t,"components-circular-option-picker__option-wrapper"),children:[o?(0,wt.jsx)(Yi,{text:o,children:p}):p,n&&(0,wt.jsx)(J_,{icon:tk,...r})]})},sk.OptionGroup=function({className:e,options:t,...n}){const r="aria-label"in n||"aria-labelledby"in n?"group":void 0;return(0,wt.jsx)("div",{...n,role:r,className:s("components-circular-option-picker__option-group","components-circular-option-picker__swatches",e),children:t})},sk.ButtonAction=function({className:e,children:t,...n}){return(0,wt.jsx)($x,{className:s("components-circular-option-picker__clear",e),variant:"tertiary",...n,children:t})},sk.DropdownLinkAction=function({buttonProps:e,className:t,dropdownProps:n,linkText:r}){return(0,wt.jsx)(F_,{className:s("components-circular-option-picker__dropdown-link-action",t),renderToggle:({isOpen:t,onToggle:n})=>(0,wt.jsx)($x,{"aria-expanded":t,"aria-haspopup":"true",onClick:n,variant:"link",...e,children:r}),...n})};const ak=sk;const lk=Xa((function(e,t){const n=function(e){const{expanded:t=!1,alignment:n="stretch",...r}=Ya(e,"VStack");return ty({direction:"column",expanded:t,alignment:n,...r})}(e);return(0,wt.jsx)(dl,{...n,ref:t})}),"VStack");const ck=Xa((function(e,t){const n=zg(e);return(0,wt.jsx)(dl,{as:"span",...n,ref:t})}),"Truncate");const uk=Xa((function(e,t){const n=function(e){const{as:t,level:n=2,color:r=kl.gray[900],isBlock:o=!0,weight:i=Pl.fontWeightHeading,...s}=Ya(e,"Heading"),a=t||`h${n}`,l={};return"string"==typeof a&&"h"!==a[0]&&(l.role="heading",l["aria-level"]="string"==typeof n?parseInt(n):n),{...Iv({color:r,isBlock:o,weight:i,size:Tv(n),...s}),...l,as:a}}(e);return(0,wt.jsx)(dl,{...n,ref:t})}),"Heading"),dk=uk;const pk=cl(dk,{target:"ev9wop70"})({name:"13lxv2o",styles:"text-transform:uppercase;line-height:24px;font-weight:500;&&&{font-size:11px;margin-bottom:0;}"}),fk=({paddingSize:e="small"})=>{if("none"===e)return;const t={small:yl(2),medium:yl(4)};return bl("padding:",t[e]||t.small,";","")},hk=cl("div",{target:"eovvns30"})("margin-left:",yl(-2),";margin-right:",yl(-2),";&:first-of-type{margin-top:",yl(-2),";}&:last-of-type{margin-bottom:",yl(-2),";}",fk,";");const mk=Xa((function(e,t){const{paddingSize:n="small",...r}=Ya(e,"DropdownContentWrapper");return(0,wt.jsx)(hk,{...r,paddingSize:n,ref:t})}),"DropdownContentWrapper");pv([fv,z_]);const gk=e=>{const t=/var\(/.test(null!=e?e:""),n=/color-mix\(/.test(null!=e?e:"");return!t&&!n},vk=e=>e.length>0&&e.every((e=>{return t=e,Array.isArray(t.colors)&&!("color"in t);var t}));function bk({className:e,clearColor:t,colors:n,onChange:r,value:o,...i}){const s=(0,c.useMemo)((()=>n.map((({color:e,name:n},i)=>{const s=uv(e),l=o===e;return(0,wt.jsx)(ak.Option,{isSelected:l,selectedIconProps:l?{fill:s.contrast()>s.contrast("#000")?"#fff":"#000"}:{},tooltipText:n||(0,a.sprintf)((0,a.__)("Color code: %s"),e),style:{backgroundColor:e,color:e},onClick:l?t:()=>r(e,i),"aria-label":n?(0,a.sprintf)((0,a.__)("Color: %s"),n):(0,a.sprintf)((0,a.__)("Color code: %s"),e)},`${e}-${i}`)}))),[n,o,r,t]);return(0,wt.jsx)(ak.OptionGroup,{className:e,options:s,...i})}function xk({className:e,clearColor:t,colors:n,onChange:r,value:o,headingLevel:i}){const s=(0,l.useInstanceId)(xk,"color-palette");return 0===n.length?null:(0,wt.jsx)(lk,{spacing:3,className:e,children:n.map((({name:e,colors:n},a)=>{const l=`${s}-${a}`;return(0,wt.jsxs)(lk,{spacing:2,children:[(0,wt.jsx)(pk,{id:l,level:i,children:e}),(0,wt.jsx)(bk,{clearColor:t,colors:n,onChange:e=>r(e,a),value:o,"aria-labelledby":l})]},a)}))})}function yk({isRenderedInSidebar:e,popoverProps:t,...n}){const r=(0,c.useMemo)((()=>({shift:!0,resize:!1,...e?{placement:"left-start",offset:34}:{placement:"bottom",offset:8},...t})),[e,t]);return(0,wt.jsx)(F_,{contentClassName:"components-color-palette__custom-color-dropdown-content",popoverProps:r,...n})}pv([fv,z_]);const wk=(0,c.forwardRef)((function(e,t){const{asButtons:n,loop:r,clearable:o=!0,colors:i=[],disableCustomColors:l=!1,enableAlpha:u=!1,onChange:d,value:p,__experimentalIsRenderedInSidebar:f=!1,headingLevel:h=2,"aria-label":m,"aria-labelledby":g,...v}=e,[b,x]=(0,c.useState)(p),y=(0,c.useCallback)((()=>d(void 0)),[d]),w=(0,c.useCallback)((e=>{x(((e,t)=>{if(!e||!t||gk(e))return e;const{ownerDocument:n}=t,{defaultView:r}=n,o=r?.getComputedStyle(t).backgroundColor;return o?uv(o).toHex():e})(p,e))}),[p]),_=vk(i),S=(0,c.useMemo)((()=>((e,t=[],n=!1)=>{if(!e)return"";const r=!!e&&gk(e),o=r?uv(e).toHex():e,i=n?t:[{colors:t}];for(const{colors:e}of i)for(const{name:t,color:n}of e)if(o===(r?uv(n).toHex():n))return t;return(0,a.__)("Custom")})(p,i,_)),[p,i,_]),C=p?.startsWith("#"),k=p?.replace(/^var\((.+)\)$/,"$1"),j=k?(0,a.sprintf)((0,a.__)('Custom color picker. The currently selected color is called "%1$s" and has a value of "%2$s".'),S,k):(0,a.__)("Custom color picker."),E={clearColor:y,onChange:d,value:p},P=!!o&&(0,wt.jsx)(ak.ButtonAction,{onClick:y,children:(0,a.__)("Clear")});let T;if(n)T={asButtons:!0};else{const e={asButtons:!1,loop:r};T=m?{...e,"aria-label":m}:g?{...e,"aria-labelledby":g}:{...e,"aria-label":(0,a.__)("Custom color picker.")}}return(0,wt.jsxs)(lk,{spacing:3,ref:t,...v,children:[!l&&(0,wt.jsx)(yk,{isRenderedInSidebar:f,renderContent:()=>(0,wt.jsx)(mk,{paddingSize:"none",children:(0,wt.jsx)(JC,{color:b,onChange:e=>d(e),enableAlpha:u})}),renderToggle:({isOpen:e,onToggle:t})=>(0,wt.jsxs)(lk,{className:"components-color-palette__custom-color-wrapper",spacing:0,children:[(0,wt.jsx)("button",{ref:w,className:"components-color-palette__custom-color-button","aria-expanded":e,"aria-haspopup":"true",onClick:t,"aria-label":j,style:{background:p},type:"button"}),(0,wt.jsxs)(lk,{className:"components-color-palette__custom-color-text-wrapper",spacing:.5,children:[(0,wt.jsx)(ck,{className:"components-color-palette__custom-color-name",children:p?S:(0,a.__)("No color selected")}),(0,wt.jsx)(ck,{className:s("components-color-palette__custom-color-value",{"components-color-palette__custom-color-value--is-hex":C}),children:k})]})]})}),(i.length>0||P)&&(0,wt.jsx)(ak,{...T,actions:P,options:_?(0,wt.jsx)(xk,{...E,headingLevel:h,colors:i,value:p}):(0,wt.jsx)(bk,{...E,colors:i,value:p})})]})})),_k=wk,Sk=cl(iy,{target:"e1bagdl32"})("&&&{input{display:block;width:100%;}",zv,"{transition:box-shadow 0.1s linear;}}"),Ck=({selectSize:e})=>({small:bl("box-sizing:border-box;padding:2px 1px;width:20px;font-size:8px;line-height:1;letter-spacing:-0.5px;text-transform:uppercase;text-align-last:center;&:not( :disabled ){color:",kl.gray[800],";}",""),default:bl("box-sizing:border-box;min-width:24px;max-width:48px;height:24px;margin-inline-end:",yl(2),";padding:",yl(1),";font-size:13px;line-height:1;text-align-last:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;field-sizing:content;&:not( :disabled ){color:",kl.theme.accent,";}","")}[e]),kk=cl("div",{target:"e1bagdl31"})("&&&{pointer-events:none;",Ck,";color:",kl.gray[900],";}"),jk=({selectSize:e="default"})=>({small:bl("height:100%;border:1px solid transparent;transition:box-shadow 0.1s linear,border 0.1s linear;",Sg({borderTopLeftRadius:0,borderBottomLeftRadius:0})()," &:not(:disabled):hover{background-color:",kl.gray[100],";}&:focus{border:1px solid ",kl.ui.borderFocus,";box-shadow:inset 0 0 0 ",Pl.borderWidth+" "+kl.ui.borderFocus,";outline-offset:0;outline:2px solid transparent;z-index:1;}",""),default:bl("display:flex;justify-content:center;align-items:center;&:where( :not( :disabled ) ):hover{box-shadow:0 0 0 ",Pl.borderWidth+" "+kl.ui.borderFocus,";outline:",Pl.borderWidth," solid transparent;}&:focus{box-shadow:0 0 0 ",Pl.borderWidthFocus+" "+kl.ui.borderFocus,";outline:",Pl.borderWidthFocus," solid transparent;}","")}[e]),Ek=cl("select",{target:"e1bagdl30"})("&&&{appearance:none;background:transparent;border-radius:",Pl.radiusXSmall,";border:none;display:block;outline:none;margin:0;min-height:auto;font-family:inherit;",Ck,";",jk,";&:not( :disabled ){cursor:pointer;}}"),Pk=bl("box-shadow:inset ",Pl.controlBoxShadowFocus,";",""),Tk=bl("border:0;padding:0;margin:0;",_x,";",""),Rk=bl(Sk,"{flex:0 0 auto;}",""),Ik=bl("background:#fff;&&>button{aspect-ratio:1;padding:0;display:flex;align-items:center;justify-content:center;",Sg({borderRadius:"2px 0 0 2px"},{borderRadius:"0 2px 2px 0"})()," border:",Pl.borderWidth," solid ",kl.ui.border,";&:focus,&:hover:not( :disabled ){",Pk," border-color:",kl.ui.borderFocus,";z-index:1;position:relative;}}",""),Nk=(e,t)=>{const{style:n}=e||{};return bl("border-radius:",Pl.radiusFull,";border:2px solid transparent;",n?(e=>{const{color:t,style:n}=e||{},r=n&&"none"!==n?kl.gray[300]:void 0;return bl("border-style:","none"===n?"solid":n,";border-color:",t||r,";","")})(e):void 0," width:","__unstable-large"===t?"24px":"22px",";height:","__unstable-large"===t?"24px":"22px",";padding:","__unstable-large"===t?"2px":"1px",";&>span{height:",yl(4),";width:",yl(4),";background:linear-gradient(\n\t\t\t\t-45deg,\n\t\t\t\ttransparent 48%,\n\t\t\t\trgb( 0 0 0 / 20% ) 48%,\n\t\t\t\trgb( 0 0 0 / 20% ) 52%,\n\t\t\t\ttransparent 52%\n\t\t\t);}","")},Mk=bl("width:",228,"px;>div:first-of-type>",Ex,"{margin-bottom:0;}&& ",Ex,"+button:not( .has-text ){min-width:24px;padding:0;}",""),Ak=bl("",""),Dk=bl("",""),Ok=bl("justify-content:center;width:100%;&&{border-top:",Pl.borderWidth," solid ",kl.gray[400],";border-top-left-radius:0;border-top-right-radius:0;height:40px;}",""),zk="web"===c.Platform.OS,Lk={px:{value:"px",label:zk?"px":(0,a.__)("Pixels (px)"),a11yLabel:(0,a.__)("Pixels (px)"),step:1},"%":{value:"%",label:zk?"%":(0,a.__)("Percentage (%)"),a11yLabel:(0,a.__)("Percent (%)"),step:.1},em:{value:"em",label:zk?"em":(0,a.__)("Relative to parent font size (em)"),a11yLabel:(0,a._x)("ems","Relative to parent font size (em)"),step:.01},rem:{value:"rem",label:zk?"rem":(0,a.__)("Relative to root font size (rem)"),a11yLabel:(0,a._x)("rems","Relative to root font size (rem)"),step:.01},vw:{value:"vw",label:zk?"vw":(0,a.__)("Viewport width (vw)"),a11yLabel:(0,a.__)("Viewport width (vw)"),step:.1},vh:{value:"vh",label:zk?"vh":(0,a.__)("Viewport height (vh)"),a11yLabel:(0,a.__)("Viewport height (vh)"),step:.1},vmin:{value:"vmin",label:zk?"vmin":(0,a.__)("Viewport smallest dimension (vmin)"),a11yLabel:(0,a.__)("Viewport smallest dimension (vmin)"),step:.1},vmax:{value:"vmax",label:zk?"vmax":(0,a.__)("Viewport largest dimension (vmax)"),a11yLabel:(0,a.__)("Viewport largest dimension (vmax)"),step:.1},ch:{value:"ch",label:zk?"ch":(0,a.__)("Width of the zero (0) character (ch)"),a11yLabel:(0,a.__)("Width of the zero (0) character (ch)"),step:.01},ex:{value:"ex",label:zk?"ex":(0,a.__)("x-height of the font (ex)"),a11yLabel:(0,a.__)("x-height of the font (ex)"),step:.01},cm:{value:"cm",label:zk?"cm":(0,a.__)("Centimeters (cm)"),a11yLabel:(0,a.__)("Centimeters (cm)"),step:.001},mm:{value:"mm",label:zk?"mm":(0,a.__)("Millimeters (mm)"),a11yLabel:(0,a.__)("Millimeters (mm)"),step:.1},in:{value:"in",label:zk?"in":(0,a.__)("Inches (in)"),a11yLabel:(0,a.__)("Inches (in)"),step:.001},pc:{value:"pc",label:zk?"pc":(0,a.__)("Picas (pc)"),a11yLabel:(0,a.__)("Picas (pc)"),step:1},pt:{value:"pt",label:zk?"pt":(0,a.__)("Points (pt)"),a11yLabel:(0,a.__)("Points (pt)"),step:1},svw:{value:"svw",label:zk?"svw":(0,a.__)("Small viewport width (svw)"),a11yLabel:(0,a.__)("Small viewport width (svw)"),step:.1},svh:{value:"svh",label:zk?"svh":(0,a.__)("Small viewport height (svh)"),a11yLabel:(0,a.__)("Small viewport height (svh)"),step:.1},svi:{value:"svi",label:zk?"svi":(0,a.__)("Viewport smallest size in the inline direction (svi)"),a11yLabel:(0,a.__)("Small viewport width or height (svi)"),step:.1},svb:{value:"svb",label:zk?"svb":(0,a.__)("Viewport smallest size in the block direction (svb)"),a11yLabel:(0,a.__)("Small viewport width or height (svb)"),step:.1},svmin:{value:"svmin",label:zk?"svmin":(0,a.__)("Small viewport smallest dimension (svmin)"),a11yLabel:(0,a.__)("Small viewport smallest dimension (svmin)"),step:.1},lvw:{value:"lvw",label:zk?"lvw":(0,a.__)("Large viewport width (lvw)"),a11yLabel:(0,a.__)("Large viewport width (lvw)"),step:.1},lvh:{value:"lvh",label:zk?"lvh":(0,a.__)("Large viewport height (lvh)"),a11yLabel:(0,a.__)("Large viewport height (lvh)"),step:.1},lvi:{value:"lvi",label:zk?"lvi":(0,a.__)("Large viewport width or height (lvi)"),a11yLabel:(0,a.__)("Large viewport width or height (lvi)"),step:.1},lvb:{value:"lvb",label:zk?"lvb":(0,a.__)("Large viewport width or height (lvb)"),a11yLabel:(0,a.__)("Large viewport width or height (lvb)"),step:.1},lvmin:{value:"lvmin",label:zk?"lvmin":(0,a.__)("Large viewport smallest dimension (lvmin)"),a11yLabel:(0,a.__)("Large viewport smallest dimension (lvmin)"),step:.1},dvw:{value:"dvw",label:zk?"dvw":(0,a.__)("Dynamic viewport width (dvw)"),a11yLabel:(0,a.__)("Dynamic viewport width (dvw)"),step:.1},dvh:{value:"dvh",label:zk?"dvh":(0,a.__)("Dynamic viewport height (dvh)"),a11yLabel:(0,a.__)("Dynamic viewport height (dvh)"),step:.1},dvi:{value:"dvi",label:zk?"dvi":(0,a.__)("Dynamic viewport width or height (dvi)"),a11yLabel:(0,a.__)("Dynamic viewport width or height (dvi)"),step:.1},dvb:{value:"dvb",label:zk?"dvb":(0,a.__)("Dynamic viewport width or height (dvb)"),a11yLabel:(0,a.__)("Dynamic viewport width or height (dvb)"),step:.1},dvmin:{value:"dvmin",label:zk?"dvmin":(0,a.__)("Dynamic viewport smallest dimension (dvmin)"),a11yLabel:(0,a.__)("Dynamic viewport smallest dimension (dvmin)"),step:.1},dvmax:{value:"dvmax",label:zk?"dvmax":(0,a.__)("Dynamic viewport largest dimension (dvmax)"),a11yLabel:(0,a.__)("Dynamic viewport largest dimension (dvmax)"),step:.1},svmax:{value:"svmax",label:zk?"svmax":(0,a.__)("Small viewport largest dimension (svmax)"),a11yLabel:(0,a.__)("Small viewport largest dimension (svmax)"),step:.1},lvmax:{value:"lvmax",label:zk?"lvmax":(0,a.__)("Large viewport largest dimension (lvmax)"),a11yLabel:(0,a.__)("Large viewport largest dimension (lvmax)"),step:.1}},Fk=Object.values(Lk),Bk=[Lk.px,Lk["%"],Lk.em,Lk.rem,Lk.vw,Lk.vh],Vk=Lk.px;function $k(e,t,n){return Wk(t?`${null!=e?e:""}${t}`:e,n)}function Hk(e){return Array.isArray(e)&&!!e.length}function Wk(e,t=Fk){let n,r;if(void 0!==e||null===e){n=`${e}`.trim();const t=parseFloat(n);r=isFinite(t)?t:void 0}const o=n?.match(/[\d.\-\+]*\s*(.*)/),i=o?.[1]?.toLowerCase();let s;if(Hk(t)){const e=t.find((e=>e.value===i));s=e?.value}else s=Vk.value;return[r,s]}const Uk=({units:e=Fk,availableUnits:t=[],defaultValues:n})=>{const r=function(e=[],t){return Array.isArray(t)?t.filter((t=>e.includes(t.value))):[]}(t,e);return n&&r.forEach(((e,t)=>{if(n[e.value]){const[o]=Wk(n[e.value]);r[t].default=o}})),r};const Gk=e=>e.replace(/^var\((.+)\)$/,"$1"),Kk=Xa(((e,t)=>{const{__experimentalIsRenderedInSidebar:n,border:r,colors:o,disableCustomColors:i,enableAlpha:s,enableStyle:l,indicatorClassName:u,indicatorWrapperClassName:d,isStyleSettable:p,onReset:f,onColorChange:h,onStyleChange:m,popoverContentClassName:g,popoverControlsClassName:v,resetButtonClassName:b,showDropdownHeader:x,size:y,__unstablePopoverProps:w,..._}=function(e){const{border:t,className:n,colors:r=[],enableAlpha:o=!1,enableStyle:i=!0,onChange:s,previousStyleSelection:a,size:l="default",__experimentalIsRenderedInSidebar:u=!1,...d}=Ya(e,"BorderControlDropdown"),[p]=Wk(t?.width),f=0===p,h=qa(),m=(0,c.useMemo)((()=>h(Ik,n)),[n,h]),g=(0,c.useMemo)((()=>h(Dk)),[h]),v=(0,c.useMemo)((()=>h(Nk(t,l))),[t,h,l]),b=(0,c.useMemo)((()=>h(Mk)),[h]),x=(0,c.useMemo)((()=>h(Ak)),[h]),y=(0,c.useMemo)((()=>h(Ok)),[h]);return{...d,border:t,className:m,colors:r,enableAlpha:o,enableStyle:i,indicatorClassName:g,indicatorWrapperClassName:v,onColorChange:e=>{s({color:e,style:"none"===t?.style?a:t?.style,width:f&&e?"1px":t?.width})},onStyleChange:e=>{const n=f&&e?"1px":t?.width;s({...t,style:e,width:n})},onReset:()=>{s({...t,color:void 0,style:void 0})},popoverContentClassName:x,popoverControlsClassName:b,resetButtonClassName:y,size:l,__experimentalIsRenderedInSidebar:u}}(e),{color:S,style:C}=r||{},k=((e,t)=>{if(e&&t){if(vk(t)){let n;return t.some((t=>t.colors.some((t=>t.color===e&&(n=t,!0))))),n}return t.find((t=>t.color===e))}})(S,o),j=((e,t,n,r)=>{if(r){if(t){const e=Gk(t.color);return n?(0,a.sprintf)((0,a.__)('Border color and style picker. The currently selected color is called "%1$s" and has a value of "%2$s". The currently selected style is "%3$s".'),t.name,e,n):(0,a.sprintf)((0,a.__)('Border color and style picker. The currently selected color is called "%1$s" and has a value of "%2$s".'),t.name,e)}if(e){const t=Gk(e);return n?(0,a.sprintf)((0,a.__)('Border color and style picker. The currently selected color has a value of "%1$s". The currently selected style is "%2$s".'),t,n):(0,a.sprintf)((0,a.__)('Border color and style picker. The currently selected color has a value of "%s".'),t)}return(0,a.__)("Border color and style picker.")}return t?(0,a.sprintf)((0,a.__)('Border color picker. The currently selected color is called "%1$s" and has a value of "%2$s".'),t.name,Gk(t.color)):e?(0,a.sprintf)((0,a.__)('Border color picker. The currently selected color has a value of "%s".'),Gk(e)):(0,a.__)("Border color picker.")})(S,k,C,l),E=S||C&&"none"!==C,P=n?"bottom left":void 0;return(0,wt.jsx)(F_,{renderToggle:({onToggle:e})=>(0,wt.jsx)($x,{onClick:e,variant:"tertiary","aria-label":j,tooltipPosition:P,label:(0,a.__)("Border color and style picker"),showTooltip:!0,__next40pxDefaultSize:"__unstable-large"===y,children:(0,wt.jsx)("span",{className:d,children:(0,wt.jsx)(A_,{className:u,colorValue:S})})}),renderContent:({onClose:e})=>(0,wt.jsxs)(wt.Fragment,{children:[(0,wt.jsx)(mk,{paddingSize:"medium",children:(0,wt.jsxs)(lk,{className:v,spacing:6,children:[x?(0,wt.jsxs)(ny,{children:[(0,wt.jsx)(Ex,{children:(0,a.__)("Border color")}),(0,wt.jsx)($x,{size:"small",label:(0,a.__)("Close border color"),icon:Ow,onClick:e})]}):void 0,(0,wt.jsx)(_k,{className:g,value:S,onChange:h,colors:o,disableCustomColors:i,__experimentalIsRenderedInSidebar:n,clearable:!1,enableAlpha:s}),l&&p&&(0,wt.jsx)(M_,{label:(0,a.__)("Style"),value:C,onChange:m})]})}),E&&(0,wt.jsx)(mk,{paddingSize:"none",children:(0,wt.jsx)($x,{className:b,variant:"tertiary",onClick:()=>{f(),e()},children:(0,a.__)("Reset")})})]}),popoverProps:{...w},..._,ref:t})}),"BorderControlDropdown"),qk=Kk;const Yk=(0,c.forwardRef)((function({className:e,isUnitSelectTabbable:t=!0,onChange:n,size:r="default",unit:o="px",units:i=Bk,...a},l){if(!Hk(i)||1===i?.length)return(0,wt.jsx)(kk,{className:"components-unit-control__unit-label",selectSize:r,children:o});const c=s("components-unit-control__select",e);return(0,wt.jsx)(Ek,{ref:l,className:c,onChange:e=>{const{value:t}=e.target,r=i.find((e=>e.value===t));n?.(t,{event:e,data:r})},selectSize:r,tabIndex:t?void 0:-1,value:o,...a,children:i.map((e=>(0,wt.jsx)("option",{value:e.value,children:e.label},e.value)))})}));const Xk=(0,c.forwardRef)((function(e,t){const{__unstableStateReducer:n,autoComplete:r="off",children:o,className:i,disabled:l=!1,disableUnits:u=!1,isPressEnterToChange:d=!1,isResetValueOnUnitChange:p=!1,isUnitSelectTabbable:f=!0,label:h,onChange:m,onUnitChange:g,size:v="default",unit:b,units:x=Bk,value:y,onFocus:w,..._}=ob(e);"unit"in e&&Fi()("UnitControl unit prop",{since:"5.6",hint:"The unit should be provided within the `value` prop.",version:"6.2"});const S=null!=y?y:void 0,[C,k]=(0,c.useMemo)((()=>{const e=function(e,t,n=Fk){const r=Array.isArray(n)?[...n]:[],[,o]=$k(e,t,Fk);return o&&!r.some((e=>e.value===o))&&Lk[o]&&r.unshift(Lk[o]),r}(S,b,x),[{value:t=""}={},...n]=e,r=n.reduce(((e,{value:t})=>{const n=yy(t?.substring(0,1)||"");return e.includes(n)?e:`${e}|${n}`}),yy(t.substring(0,1)));return[e,new RegExp(`^(?:${r})$`,"i")]}),[S,b,x]),[j,E]=$k(S,b,C),[P,T]=sS(1===C.length?C[0].value:b,{initial:E,fallback:""});(0,c.useEffect)((()=>{void 0!==E&&T(E)}),[E,T]);const R=s("components-unit-control","components-unit-control-wrapper",i);let I;!u&&f&&C.length&&(I=e=>{_.onKeyDown?.(e),e.metaKey||e.ctrlKey||!k.test(e.key)||N.current?.focus()});const N=(0,c.useRef)(null),M=u?null:(0,wt.jsx)(Yk,{ref:N,"aria-label":(0,a.__)("Select unit"),disabled:l,isUnitSelectTabbable:f,onChange:(e,t)=>{const{data:n}=t;let r=`${null!=j?j:""}${e}`;p&&void 0!==n?.default&&(r=`${n.default}${e}`),m?.(r,t),g?.(e,t),T(e)},size:["small","compact"].includes(v)||"default"===v&&!_.__next40pxDefaultSize?"small":"default",unit:P,units:C,onFocus:w,onBlur:e.onBlur});let A=_.step;if(!A&&C){var D;const e=C.find((e=>e.value===P));A=null!==(D=e?.step)&&void 0!==D?D:1}return(0,wt.jsx)(Sk,{..._,autoComplete:r,className:R,disabled:l,spinControls:"none",isPressEnterToChange:d,label:h,onKeyDown:I,onChange:(e,t)=>{if(""===e||null==e)return void m?.("",t);const n=function(e,t,n,r){const[o,i]=Wk(e,t),s=null!=o?o:n;let a=i||r;return!a&&Hk(t)&&(a=t[0].value),[s,a]}(e,C,j,P).join("");m?.(n,t)},ref:t,size:v,suffix:M,type:d?"text":"number",value:null!=j?j:"",step:A,onFocus:w,__unstableStateReducer:n})})),Zk=Xk,Qk=e=>void 0!==e?.width&&""!==e.width||void 0!==e?.color;function Jk(e){const{className:t,colors:n=[],isCompact:r,onChange:o,enableAlpha:i=!0,enableStyle:s=!0,shouldSanitizeBorder:a=!0,size:l="default",value:u,width:d,__experimentalIsRenderedInSidebar:p=!1,__next40pxDefaultSize:f,...h}=Ya(e,"BorderControl"),m="default"===l&&f?"__unstable-large":l,[g,v]=Wk(u?.width),b=v||"px",x=0===g,[y,w]=(0,c.useState)(),[_,S]=(0,c.useState)(),C=!a||Qk(u),k=(0,c.useCallback)((e=>{!a||Qk(e)?o(e):o(void 0)}),[o,a]),j=(0,c.useCallback)((e=>{const t=""===e?void 0:e,[n]=Wk(e),r=0===n,o={...u,width:t};r&&!x&&(w(u?.color),S(u?.style),o.color=void 0,o.style="none"),!r&&x&&(void 0===o.color&&(o.color=y),"none"===o.style&&(o.style=_)),k(o)}),[u,x,y,_,k]),E=(0,c.useCallback)((e=>{j(`${e}${b}`)}),[j,b]),P=qa(),T=(0,c.useMemo)((()=>P(Tk,t)),[t,P]);let R=d;r&&(R="__unstable-large"===l?"116px":"90px");const I=(0,c.useMemo)((()=>{const e=!!R&&Rk,t=(e=>bl("height:","__unstable-large"===e?"40px":"30px",";",""))(m);return P(bl(Sk,"{flex:1 1 40%;}&& ",Ek,"{min-height:0;}",""),e,t)}),[R,P,m]),N=(0,c.useMemo)((()=>P(bl("flex:1 1 60%;",Sg({marginRight:yl(3)})(),";",""))),[P]);return{...h,className:T,colors:n,enableAlpha:i,enableStyle:s,innerWrapperClassName:I,inputWidth:R,isStyleSettable:C,onBorderChange:k,onSliderChange:E,onWidthChange:j,previousStyleSelection:_,sliderClassName:N,value:u,widthUnit:b,widthValue:g,size:m,__experimentalIsRenderedInSidebar:p,__next40pxDefaultSize:f}}const ej=e=>{const{label:t,hideLabelFromVision:n}=e;return t?n?(0,wt.jsx)(pl,{as:"legend",children:t}):(0,wt.jsx)(Ex,{as:"legend",children:t}):null},tj=Xa(((e,t)=>{const{__next40pxDefaultSize:n=!1,colors:r,disableCustomColors:o,disableUnits:i,enableAlpha:s,enableStyle:l,hideLabelFromVision:c,innerWrapperClassName:u,inputWidth:d,isStyleSettable:p,label:f,onBorderChange:h,onSliderChange:m,onWidthChange:g,placeholder:v,__unstablePopoverProps:b,previousStyleSelection:x,showDropdownHeader:y,size:w,sliderClassName:_,value:S,widthUnit:C,widthValue:k,withSlider:j,__experimentalIsRenderedInSidebar:E,...P}=Jk(e);return(0,wt.jsxs)(dl,{as:"fieldset",...P,ref:t,children:[(0,wt.jsx)(ej,{label:f,hideLabelFromVision:c}),(0,wt.jsxs)(ny,{spacing:4,className:u,children:[(0,wt.jsx)(Zk,{prefix:(0,wt.jsx)(jg,{marginRight:1,marginBottom:0,children:(0,wt.jsx)(qk,{border:S,colors:r,__unstablePopoverProps:b,disableCustomColors:o,enableAlpha:s,enableStyle:l,isStyleSettable:p,onChange:h,previousStyleSelection:x,showDropdownHeader:y,__experimentalIsRenderedInSidebar:E,size:w})}),label:(0,a.__)("Border width"),hideLabelFromVision:!0,min:0,onChange:g,value:S?.width||"",placeholder:v,disableUnits:i,__unstableInputWidth:d,size:w}),j&&(0,wt.jsx)(KS,{__nextHasNoMarginBottom:!0,label:(0,a.__)("Border width"),hideLabelFromVision:!0,className:_,initialPosition:0,max:100,min:0,onChange:m,step:["px","%"].includes(C)?1:.1,value:k||void 0,withInputField:!1,__next40pxDefaultSize:n})]})]})}),"BorderControl"),nj=tj,rj={bottom:{alignItems:"flex-end",justifyContent:"center"},bottomLeft:{alignItems:"flex-start",justifyContent:"flex-end"},bottomRight:{alignItems:"flex-end",justifyContent:"flex-end"},center:{alignItems:"center",justifyContent:"center"},spaced:{alignItems:"center",justifyContent:"space-between"},left:{alignItems:"center",justifyContent:"flex-start"},right:{alignItems:"center",justifyContent:"flex-end"},stretch:{alignItems:"stretch"},top:{alignItems:"flex-start",justifyContent:"center"},topLeft:{alignItems:"flex-start",justifyContent:"flex-start"},topRight:{alignItems:"flex-start",justifyContent:"flex-end"}};function oj(e){const{align:t,alignment:n,className:r,columnGap:o,columns:i=2,gap:s=3,isInline:a=!1,justify:l,rowGap:u,rows:d,templateColumns:p,templateRows:f,...h}=Ya(e,"Grid"),m=ag(Array.isArray(i)?i:[i]),g=ag(Array.isArray(d)?d:[d]),v=p||!!i&&`repeat( ${m}, 1fr )`,b=f||!!d&&`repeat( ${g}, 1fr )`,x=qa();return{...h,className:(0,c.useMemo)((()=>{const e=function(e){return e?rj[e]:{}}(n),i=bl({alignItems:t,display:a?"inline-grid":"grid",gap:`calc( ${Pl.gridBase} * ${s} )`,gridTemplateColumns:v||void 0,gridTemplateRows:b||void 0,gridRowGap:u,gridColumnGap:o,justifyContent:l,verticalAlign:a?"middle":void 0,...e},"","");return x(i,r)}),[t,n,r,o,x,s,v,b,a,l,u])}}const ij=Xa((function(e,t){const n=oj(e);return(0,wt.jsx)(dl,{...n,ref:t})}),"Grid");function sj(e){const{className:t,colors:n=[],enableAlpha:r=!1,enableStyle:o=!0,size:i="default",__experimentalIsRenderedInSidebar:s=!1,...a}=Ya(e,"BorderBoxControlSplitControls"),l=qa(),u=(0,c.useMemo)((()=>l((e=>bl("position:relative;flex:1;width:","__unstable-large"===e?void 0:"80%",";",""))(i),t)),[l,t,i]);return{...a,centeredClassName:(0,c.useMemo)((()=>l(Iw,t)),[l,t]),className:u,colors:n,enableAlpha:r,enableStyle:o,rightAlignedClassName:(0,c.useMemo)((()=>l(bl(Sg({marginLeft:"auto"})(),";",""),t)),[l,t]),size:i,__experimentalIsRenderedInSidebar:s}}const aj=Xa(((e,t)=>{const{centeredClassName:n,colors:r,disableCustomColors:o,enableAlpha:i,enableStyle:s,onChange:u,popoverPlacement:d,popoverOffset:p,rightAlignedClassName:f,size:h="default",value:m,__experimentalIsRenderedInSidebar:g,...v}=sj(e),[b,x]=(0,c.useState)(null),y=(0,c.useMemo)((()=>d?{placement:d,offset:p,anchor:b,shift:!0}:void 0),[d,p,b]),w={colors:r,disableCustomColors:o,enableAlpha:i,enableStyle:s,isCompact:!0,__experimentalIsRenderedInSidebar:g,size:h},_=(0,l.useMergeRefs)([x,t]);return(0,wt.jsxs)(ij,{...v,ref:_,gap:4,children:[(0,wt.jsx)(Dw,{value:m,size:h}),(0,wt.jsx)(nj,{className:n,hideLabelFromVision:!0,label:(0,a.__)("Top border"),onChange:e=>u(e,"top"),__unstablePopoverProps:y,value:m?.top,...w}),(0,wt.jsx)(nj,{hideLabelFromVision:!0,label:(0,a.__)("Left border"),onChange:e=>u(e,"left"),__unstablePopoverProps:y,value:m?.left,...w}),(0,wt.jsx)(nj,{className:f,hideLabelFromVision:!0,label:(0,a.__)("Right border"),onChange:e=>u(e,"right"),__unstablePopoverProps:y,value:m?.right,...w}),(0,wt.jsx)(nj,{className:n,hideLabelFromVision:!0,label:(0,a.__)("Bottom border"),onChange:e=>u(e,"bottom"),__unstablePopoverProps:y,value:m?.bottom,...w})]})}),"BorderBoxControlSplitControls"),lj=aj,cj=/^([\d.\-+]*)\s*(fr|cm|mm|Q|in|pc|pt|px|em|ex|ch|rem|lh|vw|vh|vmin|vmax|%|cap|ic|rlh|vi|vb|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx|svw|lvw|dvw|svh|lvh|dvh|svi|lvi|dvi|svb|lvb|dvb|svmin|lvmin|dvmin|svmax|lvmax|dvmax)?$/;const uj=["top","right","bottom","left"],dj=["color","style","width"],pj=e=>!e||!dj.some((t=>void 0!==e[t])),fj=e=>{if(!e)return!1;if(hj(e)){return!uj.every((t=>pj(e[t])))}return!pj(e)},hj=(e={})=>Object.keys(e).some((e=>-1!==uj.indexOf(e))),mj=e=>{if(!hj(e))return!1;const t=uj.map((t=>gj(e?.[t])));return!t.every((e=>e===t[0]))},gj=(e,t)=>{if(pj(e))return t;const{color:n,style:r,width:o}=t||{},{color:i=n,style:s=r,width:a=o}=e;return[a,!!a&&"0"!==a||!!i?s||"solid":s,i].filter(Boolean).join(" ")},vj=e=>function(e){if(0===e.length)return;const t={};let n,r=0;return e.forEach((e=>{t[e]=void 0===t[e]?1:t[e]+1,t[e]>r&&(n=e,r=t[e])})),n}(e.map((e=>void 0===e?void 0:function(e){const t=e.trim().match(cj);if(!t)return[void 0,void 0];const[,n,r]=t;let o=parseFloat(n);return o=Number.isNaN(o)?void 0:o,[o,r]}(`${e}`)[1])).filter((e=>void 0!==e)));function bj(e){const{className:t,colors:n=[],onChange:r,enableAlpha:o=!1,enableStyle:i=!0,size:s="default",value:a,__experimentalIsRenderedInSidebar:l=!1,__next40pxDefaultSize:u,...d}=Ya(e,"BorderBoxControl"),p="default"===s&&u?"__unstable-large":s,f=mj(a),h=hj(a),m=h?(e=>{if(!e)return;const t=[],n=[],r=[];uj.forEach((o=>{t.push(e[o]?.color),n.push(e[o]?.style),r.push(e[o]?.width)}));const o=t.every((e=>e===t[0])),i=n.every((e=>e===n[0])),s=r.every((e=>e===r[0]));return{color:o?t[0]:void 0,style:i?n[0]:void 0,width:s?r[0]:vj(r)}})(a):a,g=h?a:(e=>{if(e&&!pj(e))return{top:e,right:e,bottom:e,left:e}})(a),v=!isNaN(parseFloat(`${m?.width}`)),[b,x]=(0,c.useState)(!f),y=qa(),w=(0,c.useMemo)((()=>y(Pw,t)),[y,t]),_=(0,c.useMemo)((()=>y(bl("flex:1;",Sg({marginRight:"24px"})(),";",""))),[y]),S=(0,c.useMemo)((()=>y(Tw)),[y]);return{...d,className:w,colors:n,disableUnits:f&&!v,enableAlpha:o,enableStyle:i,hasMixedBorders:f,isLinked:b,linkedControlClassName:_,onLinkedChange:e=>{if(!e)return r(void 0);if(!f||(t=e)&&dj.every((e=>void 0!==t[e])))return r(pj(e)?void 0:e);var t;const n=((e,t)=>{const n={};return e.color!==t.color&&(n.color=t.color),e.style!==t.style&&(n.style=t.style),e.width!==t.width&&(n.width=t.width),n})(m,e),o={top:{...a?.top,...n},right:{...a?.right,...n},bottom:{...a?.bottom,...n},left:{...a?.left,...n}};if(mj(o))return r(o);const i=pj(o.top)?void 0:o.top;r(i)},onSplitChange:(e,t)=>{const n={...g,[t]:e};mj(n)?r(n):r(e)},toggleLinked:()=>x(!b),linkedValue:m,size:p,splitValue:g,wrapperClassName:S,__experimentalIsRenderedInSidebar:l}}const xj=e=>{const{label:t,hideLabelFromVision:n}=e;return t?n?(0,wt.jsx)(pl,{as:"label",children:t}):(0,wt.jsx)(Ex,{children:t}):null},yj=Xa(((e,t)=>{const{className:n,colors:r,disableCustomColors:o,disableUnits:i,enableAlpha:s,enableStyle:u,hasMixedBorders:d,hideLabelFromVision:p,isLinked:f,label:h,linkedControlClassName:m,linkedValue:g,onLinkedChange:v,onSplitChange:b,popoverPlacement:x,popoverOffset:y,size:w,splitValue:_,toggleLinked:S,wrapperClassName:C,__experimentalIsRenderedInSidebar:k,...j}=bj(e),[E,P]=(0,c.useState)(null),T=(0,c.useMemo)((()=>x?{placement:x,offset:y,anchor:E,shift:!0}:void 0),[x,y,E]),R=(0,l.useMergeRefs)([P,t]);return(0,wt.jsxs)(dl,{className:n,...j,ref:R,children:[(0,wt.jsx)(xj,{label:h,hideLabelFromVision:p}),(0,wt.jsxs)(dl,{className:C,children:[f?(0,wt.jsx)(nj,{className:m,colors:r,disableUnits:i,disableCustomColors:o,enableAlpha:s,enableStyle:u,onChange:v,placeholder:d?(0,a.__)("Mixed"):void 0,__unstablePopoverProps:T,shouldSanitizeBorder:!1,value:g,withSlider:!0,width:"__unstable-large"===w?"116px":"110px",__experimentalIsRenderedInSidebar:k,size:w}):(0,wt.jsx)(lj,{colors:r,disableCustomColors:o,enableAlpha:s,enableStyle:u,onChange:b,popoverPlacement:x,popoverOffset:y,value:_,__experimentalIsRenderedInSidebar:k,size:w}),(0,wt.jsx)(Mw,{onClick:S,isLinked:f,size:w})]})]})}),"BorderBoxControl"),wj=yj;const _j=cl("span",{target:"e1j5nr4z8"})({name:"1w884gc",styles:"box-sizing:border-box;display:block;width:24px;height:24px;position:relative;padding:4px"}),Sj=cl("span",{target:"e1j5nr4z7"})({name:"i6vjox",styles:"box-sizing:border-box;display:block;position:relative;width:100%;height:100%"}),Cj=({isFocused:e})=>bl({backgroundColor:"currentColor",opacity:e?1:.3},"",""),kj=cl("span",{target:"e1j5nr4z6"})("box-sizing:border-box;display:block;pointer-events:none;position:absolute;",Cj,";"),jj=cl(kj,{target:"e1j5nr4z5"})({name:"1k2w39q",styles:"bottom:3px;top:3px;width:2px"}),Ej=cl(kj,{target:"e1j5nr4z4"})({name:"1q9b07k",styles:"height:2px;left:3px;right:3px"}),Pj=cl(Ej,{target:"e1j5nr4z3"})({name:"abcix4",styles:"top:0"}),Tj=cl(jj,{target:"e1j5nr4z2"})({name:"1wf8jf",styles:"right:0"}),Rj=cl(Ej,{target:"e1j5nr4z1"})({name:"8tapst",styles:"bottom:0"}),Ij=cl(jj,{target:"e1j5nr4z0"})({name:"1ode3cm",styles:"left:0"});function Nj({size:e=24,side:t="all",sides:n,...r}){const o=e=>!(e=>n?.length&&!n.includes(e))(e)&&("all"===t||t===e),i=o("top")||o("vertical"),s=o("right")||o("horizontal"),a=o("bottom")||o("vertical"),l=o("left")||o("horizontal"),c=e/24;return(0,wt.jsx)(_j,{style:{transform:`scale(${c})`},...r,children:(0,wt.jsxs)(Sj,{children:[(0,wt.jsx)(Pj,{isFocused:i}),(0,wt.jsx)(Tj,{isFocused:s}),(0,wt.jsx)(Rj,{isFocused:a}),(0,wt.jsx)(Ij,{isFocused:l})]})})}const Mj=cl(Zk,{target:"e1jovhle5"})({name:"1ejyr19",styles:"max-width:90px"}),Aj=cl(ny,{target:"e1jovhle4"})({name:"1j1lmoi",styles:"grid-column:1/span 3"}),Dj=cl($x,{target:"e1jovhle3"})({name:"tkya7b",styles:"grid-area:1/2;justify-self:end"}),Oj=cl("div",{target:"e1jovhle2"})({name:"1dfa8al",styles:"grid-area:1/3;justify-self:end"}),zj=cl(Nj,{target:"e1jovhle1"})({name:"ou8xsw",styles:"flex:0 0 auto"}),Lj=cl(KS,{target:"e1jovhle0"})("width:100%;margin-inline-end:",yl(2),";"),Fj={px:{max:300,step:1},"%":{max:100,step:1},vw:{max:100,step:1},vh:{max:100,step:1},em:{max:10,step:.1},rm:{max:10,step:.1},svw:{max:100,step:1},lvw:{max:100,step:1},dvw:{max:100,step:1},svh:{max:100,step:1},lvh:{max:100,step:1},dvh:{max:100,step:1},vi:{max:100,step:1},svi:{max:100,step:1},lvi:{max:100,step:1},dvi:{max:100,step:1},vb:{max:100,step:1},svb:{max:100,step:1},lvb:{max:100,step:1},dvb:{max:100,step:1},vmin:{max:100,step:1},svmin:{max:100,step:1},lvmin:{max:100,step:1},dvmin:{max:100,step:1},vmax:{max:100,step:1},svmax:{max:100,step:1},lvmax:{max:100,step:1},dvmax:{max:100,step:1}},Bj={all:(0,a.__)("All sides"),top:(0,a.__)("Top side"),bottom:(0,a.__)("Bottom side"),left:(0,a.__)("Left side"),right:(0,a.__)("Right side"),mixed:(0,a.__)("Mixed"),vertical:(0,a.__)("Top and bottom sides"),horizontal:(0,a.__)("Left and right sides")},Vj={top:void 0,right:void 0,bottom:void 0,left:void 0},$j=["top","right","bottom","left"];function Hj(e){return e.sort(((t,n)=>e.filter((e=>e===t)).length-e.filter((e=>e===n)).length)).pop()}function Wj(e={},t,n=$j){const r=function(e){const t=[];if(!e?.length)return $j;if(e.includes("vertical"))t.push("top","bottom");else if(e.includes("horizontal"))t.push("left","right");else{const n=$j.filter((t=>e.includes(t)));t.push(...n)}return t}(n).map((t=>Wk(e[t]))),o=r.map((e=>{var t;return null!==(t=e[0])&&void 0!==t?t:""})),i=r.map((e=>e[1])),s=o.every((e=>e===o[0]))?o[0]:"";let a;var l;"number"==typeof s?a=Hj(i):a=null!==(l=function(e){if(!e||"object"!=typeof e)return;const t=Object.values(e).filter(Boolean);return Hj(t)}(t))&&void 0!==l?l:Hj(i);return[s,a].join("")}function Uj(e={},t,n=$j){const r=Wj(e,t,n);return isNaN(parseFloat(r))}function Gj(e){return e&&Object.values(e).filter((e=>!!e&&/\d/.test(e))).length>0}function Kj(e,t){let n="all";return e||(n=t?"vertical":"top"),n}function qj(e,t,n){const r={...e};return n?.length?n.forEach((e=>{"vertical"===e?(r.top=t,r.bottom=t):"horizontal"===e?(r.left=t,r.right=t):r[e]=t})):$j.forEach((e=>r[e]=t)),r}const Yj=()=>{};function Xj({__next40pxDefaultSize:e,onChange:t=Yj,onFocus:n=Yj,values:r,sides:o,selectedUnits:i,setSelectedUnits:s,...a}){var c,u;const d=(0,l.useInstanceId)(Xj,"box-control-input-all"),p=Wj(r,i,o),f=Gj(r)&&Uj(r,i,o),h=f?Bj.mixed:void 0,[m,g]=Wk(p),v=e=>{const n=void 0!==e&&!isNaN(parseFloat(e)),i=qj(r,n?e:void 0,o);t(i)};return(0,wt.jsxs)(wt.Fragment,{children:[(0,wt.jsx)(Mj,{...a,__next40pxDefaultSize:e,className:"component-box-control__unit-control",disableUnits:f,id:d,isPressEnterToChange:!0,value:p,onChange:v,onUnitChange:e=>{const t=qj(i,e,o);s(t)},onFocus:e=>{n(e,{side:"all"})},placeholder:h,label:Bj.all,hideLabelFromVision:!0}),(0,wt.jsx)(Lj,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:e,"aria-controls":d,label:Bj.all,hideLabelFromVision:!0,onChange:e=>{v(void 0!==e?[e,g].join(""):void 0)},min:0,max:null!==(c=Fj[null!=g?g:"px"]?.max)&&void 0!==c?c:10,step:null!==(u=Fj[null!=g?g:"px"]?.step)&&void 0!==u?u:.1,value:null!=m?m:0,withInputField:!1})]})}const Zj=()=>{};function Qj({__next40pxDefaultSize:e,onChange:t=Zj,onFocus:n=Zj,values:r,selectedUnits:o,setSelectedUnits:i,sides:s,...a}){const c=(0,l.useInstanceId)(Qj,"box-control-input"),u=e=>t=>{n(t,{side:e})},d=(e,n,o)=>{const i={...r},s=void 0!==n&&!isNaN(parseFloat(n))?n:void 0;if(i[e]=s,o?.event.altKey)switch(e){case"top":i.bottom=s;break;case"bottom":i.top=s;break;case"left":i.right=s;break;case"right":i.left=s}(e=>{t(e)})(i)},p=e=>t=>{const n={...o};n[e]=t,i(n)},f=s?.length?$j.filter((e=>s.includes(e))):$j;return(0,wt.jsx)(wt.Fragment,{children:f.map((t=>{var n,i;const[l,f]=Wk(r[t]),h=r[t]?f:o[t],m=[c,t].join("-");return(0,wt.jsxs)(Aj,{expanded:!0,children:[(0,wt.jsx)(zj,{side:t,sides:s}),(0,wt.jsx)(Yi,{placement:"top-end",text:Bj[t],children:(0,wt.jsx)(Mj,{...a,__next40pxDefaultSize:e,className:"component-box-control__unit-control",id:m,isPressEnterToChange:!0,value:[l,h].join(""),onChange:(e,n)=>d(t,e,n),onUnitChange:p(t),onFocus:u(t),label:Bj[t],hideLabelFromVision:!0})}),(0,wt.jsx)(Lj,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:e,"aria-controls":m,label:Bj[t],hideLabelFromVision:!0,onChange:e=>{d(t,void 0!==e?[e,h].join(""):void 0)},min:0,max:null!==(n=Fj[null!=h?h:"px"]?.max)&&void 0!==n?n:10,step:null!==(i=Fj[null!=h?h:"px"]?.step)&&void 0!==i?i:.1,value:null!=l?l:0,withInputField:!1})]},`box-control-${t}`)}))})}const Jj=["vertical","horizontal"];function eE({__next40pxDefaultSize:e,onChange:t,onFocus:n,values:r,selectedUnits:o,setSelectedUnits:i,sides:s,...a}){const c=(0,l.useInstanceId)(eE,"box-control-input"),u=e=>t=>{n&&n(t,{side:e})},d=(e,n)=>{if(!t)return;const o={...r},i=void 0!==n&&!isNaN(parseFloat(n))?n:void 0;"vertical"===e&&(o.top=i,o.bottom=i),"horizontal"===e&&(o.left=i,o.right=i),t(o)},p=e=>t=>{const n={...o};"vertical"===e&&(n.top=t,n.bottom=t),"horizontal"===e&&(n.left=t,n.right=t),i(n)},f=s?.length?Jj.filter((e=>s.includes(e))):Jj;return(0,wt.jsx)(wt.Fragment,{children:f.map((t=>{var n,i;const[l,f]=Wk("vertical"===t?r.top:r.left),h="vertical"===t?o.top:o.left,m=[c,t].join("-");return(0,wt.jsxs)(Aj,{children:[(0,wt.jsx)(zj,{side:t,sides:s}),(0,wt.jsx)(Yi,{placement:"top-end",text:Bj[t],children:(0,B.createElement)(Mj,{...a,__next40pxDefaultSize:e,className:"component-box-control__unit-control",id:m,isPressEnterToChange:!0,value:[l,null!=h?h:f].join(""),onChange:e=>d(t,e),onUnitChange:p(t),onFocus:u(t),label:Bj[t],hideLabelFromVision:!0,key:t})}),(0,wt.jsx)(Lj,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:e,"aria-controls":m,label:Bj[t],hideLabelFromVision:!0,onChange:e=>d(t,void 0!==e?[e,null!=h?h:f].join(""):void 0),min:0,max:null!==(n=Fj[null!=h?h:"px"]?.max)&&void 0!==n?n:10,step:null!==(i=Fj[null!=h?h:"px"]?.step)&&void 0!==i?i:.1,value:null!=l?l:0,withInputField:!1})]},t)}))})}function tE({isLinked:e,...t}){const n=e?(0,a.__)("Unlink sides"):(0,a.__)("Link sides");return(0,wt.jsx)(Yi,{text:n,children:(0,wt.jsx)($x,{...t,className:"component-box-control__linked-button",size:"small",icon:e?jw:Ew,iconSize:24,"aria-label":n})})}const nE={min:0},rE=()=>{};function oE({__next40pxDefaultSize:e=!1,id:t,inputProps:n=nE,onChange:r=rE,label:o=(0,a.__)("Box Control"),values:i,units:s,sides:u,splitOnAxis:d=!1,allowReset:p=!0,resetValues:f=Vj,onMouseOver:h,onMouseOut:m}){const[g,v]=sS(i,{fallback:Vj}),b=g||Vj,x=Gj(i),y=1===u?.length,[w,_]=(0,c.useState)(x),[S,C]=(0,c.useState)(!x||!Uj(b)||y),[k,j]=(0,c.useState)(Kj(S,d)),[E,P]=(0,c.useState)({top:Wk(i?.top)[1],right:Wk(i?.right)[1],bottom:Wk(i?.bottom)[1],left:Wk(i?.left)[1]}),T=function(e){const t=(0,l.useInstanceId)(oE,"inspector-box-control");return e||t}(t),R=`${T}-heading`,I={...n,onChange:e=>{r(e),v(e),_(!0)},onFocus:(e,{side:t})=>{j(t)},isLinked:S,units:s,selectedUnits:E,setSelectedUnits:P,sides:u,values:b,onMouseOver:h,onMouseOut:m,__next40pxDefaultSize:e};return(0,wt.jsxs)(ij,{id:T,columns:3,templateColumns:"1fr min-content min-content",role:"group","aria-labelledby":R,children:[(0,wt.jsx)(Mx.VisualLabel,{id:R,children:o}),S&&(0,wt.jsxs)(Aj,{children:[(0,wt.jsx)(zj,{side:k,sides:u}),(0,wt.jsx)(Xj,{...I})]}),!y&&(0,wt.jsx)(Oj,{children:(0,wt.jsx)(tE,{onClick:()=>{C(!S),j(Kj(!S,d))},isLinked:S})}),!S&&d&&(0,wt.jsx)(eE,{...I}),!S&&!d&&(0,wt.jsx)(Qj,{...I}),p&&(0,wt.jsx)(Dj,{className:"component-box-control__reset-button",variant:"secondary",size:"small",onClick:()=>{r(f),v(f),P(f),_(!1)},disabled:!w,children:(0,a.__)("Reset")})]})}const iE=oE;const sE=(0,c.forwardRef)((function(e,t){const{className:n,...r}=e,o=s("components-button-group",n);return(0,wt.jsx)("div",{ref:t,role:"group",className:o,...r})}));const aE={name:"12ip69d",styles:"background:transparent;display:block;margin:0!important;pointer-events:none;position:absolute;will-change:box-shadow"};function lE(e){return`0 ${e}px ${2*e}px 0\n\t${`rgba(0, 0, 0, ${e/20})`}`}const cE=Xa((function(e,t){const n=function(e){const{active:t,borderRadius:n="inherit",className:r,focus:o,hover:i,isInteractive:s=!1,offset:a=0,value:l=0,...u}=Ya(e,"Elevation"),d=qa();return{...u,className:(0,c.useMemo)((()=>{let e=Ig(i)?i:2*l,c=Ig(t)?t:l/2;s||(e=Ig(i)?i:void 0,c=Ig(t)?t:void 0);const u=`box-shadow ${Pl.transitionDuration} ${Pl.transitionTimingFunction}`,p={};return p.Base=bl({borderRadius:n,bottom:a,boxShadow:lE(l),opacity:Pl.elevationIntensity,left:a,right:a,top:a},bl("@media not ( prefers-reduced-motion ){transition:",u,";}",""),"",""),Ig(e)&&(p.hover=bl("*:hover>&{box-shadow:",lE(e),";}","")),Ig(c)&&(p.active=bl("*:active>&{box-shadow:",lE(c),";}","")),Ig(o)&&(p.focus=bl("*:focus>&{box-shadow:",lE(o),";}","")),d(aE,p.Base,p.hover,p.focus,p.active,r)}),[t,n,r,d,o,i,s,a,l]),"aria-hidden":!0}}(e);return(0,wt.jsx)(dl,{...n,ref:t})}),"Elevation"),uE=cE;const dE=`calc(${Pl.radiusLarge} - 1px)`,pE=bl("box-shadow:0 0 0 1px ",Pl.surfaceBorderColor,";outline:none;",""),fE={name:"1showjb",styles:"border-bottom:1px solid;box-sizing:border-box;&:last-child{border-bottom:none;}"},hE={name:"14n5oej",styles:"border-top:1px solid;box-sizing:border-box;&:first-of-type{border-top:none;}"},mE={name:"13udsys",styles:"height:100%"},gE={name:"6ywzd",styles:"box-sizing:border-box;height:auto;max-height:100%"},vE={name:"dq805e",styles:"box-sizing:border-box;overflow:hidden;&>img,&>iframe{display:block;height:auto;max-width:100%;width:100%;}"},bE={name:"c990dr",styles:"box-sizing:border-box;display:block;width:100%"},xE=bl("&:first-of-type{border-top-left-radius:",dE,";border-top-right-radius:",dE,";}&:last-of-type{border-bottom-left-radius:",dE,";border-bottom-right-radius:",dE,";}",""),yE=bl("border-color:",Pl.colorDivider,";",""),wE={name:"1t90u8d",styles:"box-shadow:none"},_E={name:"1e1ncky",styles:"border:none"},SE=bl("border-radius:",dE,";",""),CE=bl("padding:",Pl.cardPaddingXSmall,";",""),kE={large:bl("padding:",Pl.cardPaddingLarge,";",""),medium:bl("padding:",Pl.cardPaddingMedium,";",""),small:bl("padding:",Pl.cardPaddingSmall,";",""),xSmall:CE,extraSmall:CE},jE=bl("background-color:",kl.ui.backgroundDisabled,";",""),EE=bl("background-color:",Pl.surfaceColor,";color:",kl.gray[900],";position:relative;","");Pl.surfaceBackgroundColor;function PE({borderBottom:e,borderLeft:t,borderRight:n,borderTop:r}){const o=`1px solid ${Pl.surfaceBorderColor}`;return bl({borderBottom:e?o:void 0,borderLeft:t?o:void 0,borderRight:n?o:void 0,borderTop:r?o:void 0},"","")}const TE=bl("",""),RE=bl("background:",Pl.surfaceBackgroundTintColor,";",""),IE=bl("background:",Pl.surfaceBackgroundTertiaryColor,";",""),NE=e=>[e,e].join(" "),ME=e=>["90deg",[Pl.surfaceBackgroundColor,e].join(" "),"transparent 1%"].join(","),AE=e=>[[Pl.surfaceBackgroundColor,e].join(" "),"transparent 1%"].join(","),DE=(e,t)=>bl("background:",(e=>[`linear-gradient( ${ME(e)} ) center`,`linear-gradient( ${AE(e)} ) center`,Pl.surfaceBorderBoldColor].join(","))(t),";background-size:",NE(e),";",""),OE=[`linear-gradient( ${[`${Pl.surfaceBorderSubtleColor} 1px`,"transparent 1px"].join(",")} )`,`linear-gradient( ${["90deg",`${Pl.surfaceBorderSubtleColor} 1px`,"transparent 1px"].join(",")} )`].join(","),zE=(e,t,n)=>{switch(e){case"dotted":return DE(t,n);case"grid":return(e=>bl("background:",Pl.surfaceBackgroundColor,";background-image:",OE,";background-size:",NE(e),";",""))(t);case"primary":return TE;case"secondary":return RE;case"tertiary":return IE}};function LE(e){const{backgroundSize:t=12,borderBottom:n=!1,borderLeft:r=!1,borderRight:o=!1,borderTop:i=!1,className:s,variant:a="primary",...l}=Ya(e,"Surface"),u=qa();return{...l,className:(0,c.useMemo)((()=>{const e={borders:PE({borderBottom:n,borderLeft:r,borderRight:o,borderTop:i})};return u(EE,e.borders,zE(a,`${t}px`,t-1+"px"),s)}),[t,n,r,o,i,s,u,a])}}function FE(e){const{className:t,elevation:n=0,isBorderless:r=!1,isRounded:o=!0,size:i="medium",...s}=Ya(function({elevation:e,isElevated:t,...n}){const r={...n};let o=e;var i;return t&&(Fi()("Card isElevated prop",{since:"5.9",alternative:"elevation"}),null!==(i=o)&&void 0!==i||(o=2)),void 0!==o&&(r.elevation=o),r}(e),"Card"),a=qa();return{...LE({...s,className:(0,c.useMemo)((()=>a(pE,r&&wE,o&&SE,t)),[t,a,r,o])}),elevation:n,isBorderless:r,isRounded:o,size:i}}const BE=Xa((function(e,t){const{children:n,elevation:r,isBorderless:o,isRounded:i,size:s,...a}=FE(e),l=i?Pl.radiusLarge:0,u=qa(),d=(0,c.useMemo)((()=>u(bl({borderRadius:l},"",""))),[u,l]),p=(0,c.useMemo)((()=>{const e={size:s,isBorderless:o};return{CardBody:e,CardHeader:e,CardFooter:e}}),[o,s]);return(0,wt.jsx)(is,{value:p,children:(0,wt.jsxs)(dl,{...a,ref:t,children:[(0,wt.jsx)(dl,{className:u(mE),children:n}),(0,wt.jsx)(uE,{className:d,isInteractive:!1,value:r?1:0}),(0,wt.jsx)(uE,{className:d,isInteractive:!1,value:r})]})})}),"Card"),VE=BE;const $E=bl("@media only screen and ( min-device-width: 40em ){&::-webkit-scrollbar{height:12px;width:12px;}&::-webkit-scrollbar-track{background-color:transparent;}&::-webkit-scrollbar-track{background:",Pl.colorScrollbarTrack,";border-radius:8px;}&::-webkit-scrollbar-thumb{background-clip:padding-box;background-color:",Pl.colorScrollbarThumb,";border:2px solid rgba( 0, 0, 0, 0 );border-radius:7px;}&:hover::-webkit-scrollbar-thumb{background-color:",Pl.colorScrollbarThumbHover,";}}",""),HE={name:"13udsys",styles:"height:100%"},WE={name:"7zq9w",styles:"scroll-behavior:smooth"},UE={name:"q33xhg",styles:"overflow-x:auto;overflow-y:hidden"},GE={name:"103x71s",styles:"overflow-x:hidden;overflow-y:auto"},KE={name:"umwchj",styles:"overflow-y:auto"};const qE=Xa((function(e,t){const n=function(e){const{className:t,scrollDirection:n="y",smoothScroll:r=!1,...o}=Ya(e,"Scrollable"),i=qa();return{...o,className:(0,c.useMemo)((()=>i(HE,$E,r&&WE,"x"===n&&UE,"y"===n&&GE,"auto"===n&&KE,t)),[t,i,n,r])}}(e);return(0,wt.jsx)(dl,{...n,ref:t})}),"Scrollable"),YE=qE;const XE=Xa((function(e,t){const{isScrollable:n,...r}=function(e){const{className:t,isScrollable:n=!1,isShady:r=!1,size:o="medium",...i}=Ya(e,"CardBody"),s=qa();return{...i,className:(0,c.useMemo)((()=>s(gE,xE,kE[o],r&&jE,"components-card__body",t)),[t,s,r,o]),isScrollable:n}}(e);return n?(0,wt.jsx)(YE,{...r,ref:t}):(0,wt.jsx)(dl,{...r,ref:t})}),"CardBody"),ZE=XE;var QE=kt((function(e){var t=e,{orientation:n="horizontal"}=t,r=x(t,["orientation"]);return r=v({role:"separator","aria-orientation":n},r)})),JE=_t((function(e){return Ct("hr",QE(e))}));const eP={vertical:{start:"marginLeft",end:"marginRight"},horizontal:{start:"marginTop",end:"marginBottom"}},tP=({"aria-orientation":e="horizontal",margin:t,marginStart:n,marginEnd:r})=>bl(Sg({[eP[e].start]:yl(null!=n?n:t),[eP[e].end]:yl(null!=r?r:t)})(),"","");var nP={name:"1u4hpl4",styles:"display:inline"};const rP=({"aria-orientation":e="horizontal"})=>"vertical"===e?nP:void 0,oP=({"aria-orientation":e="horizontal"})=>bl({["vertical"===e?"borderRight":"borderBottom"]:"1px solid currentColor"},"",""),iP=({"aria-orientation":e="horizontal"})=>bl({height:"vertical"===e?"auto":0,width:"vertical"===e?0:"auto"},"",""),sP=cl("hr",{target:"e19on6iw0"})("border:0;margin:0;",rP," ",oP," ",iP," ",tP,";");const aP=Xa((function(e,t){const n=Ya(e,"Divider");return(0,wt.jsx)(JE,{render:(0,wt.jsx)(sP,{}),...n,ref:t})}),"Divider");const lP=Xa((function(e,t){const n=function(e){const{className:t,...n}=Ya(e,"CardDivider"),r=qa();return{...n,className:(0,c.useMemo)((()=>r(bE,yE,"components-card__divider",t)),[t,r])}}(e);return(0,wt.jsx)(aP,{...n,ref:t})}),"CardDivider"),cP=lP;const uP=Xa((function(e,t){const n=function(e){const{className:t,justify:n,isBorderless:r=!1,isShady:o=!1,size:i="medium",...s}=Ya(e,"CardFooter"),a=qa();return{...s,className:(0,c.useMemo)((()=>a(hE,xE,yE,kE[i],r&&_E,o&&jE,"components-card__footer",t)),[t,a,r,o,i]),justify:n}}(e);return(0,wt.jsx)(mg,{...n,ref:t})}),"CardFooter"),dP=uP;const pP=Xa((function(e,t){const n=function(e){const{className:t,isBorderless:n=!1,isShady:r=!1,size:o="medium",...i}=Ya(e,"CardHeader"),s=qa();return{...i,className:(0,c.useMemo)((()=>s(fE,xE,yE,kE[o],n&&_E,r&&jE,"components-card__header",t)),[t,s,n,r,o])}}(e);return(0,wt.jsx)(mg,{...n,ref:t})}),"CardHeader"),fP=pP;const hP=Xa((function(e,t){const n=function(e){const{className:t,...n}=Ya(e,"CardMedia"),r=qa();return{...n,className:(0,c.useMemo)((()=>r(vE,xE,"components-card__media",t)),[t,r])}}(e);return(0,wt.jsx)(dl,{...n,ref:t})}),"CardMedia"),mP=hP;const gP=function e(t){const{__nextHasNoMarginBottom:n,label:r,className:o,heading:i,checked:a,indeterminate:u,help:d,id:p,onChange:f,...h}=t;i&&Fi()("`heading` prop in `CheckboxControl`",{alternative:"a separate element to implement a heading",since:"5.8"});const[m,g]=(0,c.useState)(!1),[v,b]=(0,c.useState)(!1),x=(0,l.useRefEffect)((e=>{e&&(e.indeterminate=!!u,g(e.matches(":checked")),b(e.matches(":indeterminate")))}),[a,u]),y=(0,l.useInstanceId)(e,"inspector-checkbox-control",p);return(0,wt.jsx)(Ax,{__nextHasNoMarginBottom:n,__associatedWPComponentName:"CheckboxControl",label:i,id:y,help:d&&(0,wt.jsx)("span",{className:"components-checkbox-control__help",children:d}),className:s("components-checkbox-control",o),children:(0,wt.jsxs)(ny,{spacing:0,justify:"start",alignment:"top",children:[(0,wt.jsxs)("span",{className:"components-checkbox-control__input-container",children:[(0,wt.jsx)("input",{ref:x,id:y,className:"components-checkbox-control__input",type:"checkbox",value:"1",onChange:e=>f(e.target.checked),checked:a,"aria-describedby":d?y+"__help":void 0,...h}),v?(0,wt.jsx)(J_,{icon:Pg,className:"components-checkbox-control__indeterminate",role:"presentation"}):null,m?(0,wt.jsx)(J_,{icon:tk,className:"components-checkbox-control__checked",role:"presentation"}):null]}),r&&(0,wt.jsx)("label",{className:"components-checkbox-control__label",htmlFor:y,children:r})]})})},vP=4e3;function bP({className:e,children:t,onCopy:n,onFinishCopy:r,text:o,...i}){Fi()("wp.components.ClipboardButton",{since:"5.8",alternative:"wp.compose.useCopyToClipboard"});const a=(0,c.useRef)(),u=(0,l.useCopyToClipboard)(o,(()=>{n(),a.current&&clearTimeout(a.current),r&&(a.current=setTimeout((()=>r()),vP))}));(0,c.useEffect)((()=>{a.current&&clearTimeout(a.current)}),[]);const d=s("components-clipboard-button",e);return(0,wt.jsx)($x,{...i,className:d,ref:u,onCopy:e=>{e.target.focus()},children:t})}const xP=(0,wt.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,wt.jsx)(n.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"})});const yP={name:"1bcj5ek",styles:"width:100%;display:block"},wP={name:"150ruhm",styles:"box-sizing:border-box;width:100%;display:block;margin:0;color:inherit"},_P=bl("border:1px solid ",Pl.surfaceBorderColor,";",""),SP=bl(">*:not( marquee )>*{border-bottom:1px solid ",Pl.surfaceBorderColor,";}>*:last-of-type>*:not( :focus ){border-bottom-color:transparent;}",""),CP=Pl.radiusSmall,kP=bl("border-radius:",CP,";",""),jP=bl("border-radius:",CP,";>*:first-of-type>*{border-top-left-radius:",CP,";border-top-right-radius:",CP,";}>*:last-of-type>*{border-bottom-left-radius:",CP,";border-bottom-right-radius:",CP,";}",""),EP=`calc(${Pl.fontSize} * ${Pl.fontLineHeightBase})`,PP=`calc((${Pl.controlHeight} - ${EP} - 2px) / 2)`,TP=`calc((${Pl.controlHeightSmall} - ${EP} - 2px) / 2)`,RP=`calc((${Pl.controlHeightLarge} - ${EP} - 2px) / 2)`,IP={small:bl("padding:",TP," ",Pl.controlPaddingXSmall,"px;",""),medium:bl("padding:",PP," ",Pl.controlPaddingX,"px;",""),large:bl("padding:",RP," ",Pl.controlPaddingXLarge,"px;","")};const NP=(0,c.createContext)({size:"medium"}),MP=()=>(0,c.useContext)(NP);const AP=Xa((function(e,t){const{isBordered:n,isSeparated:r,size:o,...i}=function(e){const{className:t,isBordered:n=!1,isRounded:r=!0,isSeparated:o=!1,role:i="list",...s}=Ya(e,"ItemGroup");return{isBordered:n,className:qa()(n&&_P,o&&SP,r&&jP,t),role:i,isSeparated:o,...s}}(e),{size:s}=MP(),a={spacedAround:!n&&!r,size:o||s};return(0,wt.jsx)(NP.Provider,{value:a,children:(0,wt.jsx)(dl,{...i,ref:t})})}),"ItemGroup");function DP(e){return Math.max(0,Math.min(100,e))}function OP(e,t,n){const r=e.slice();return r[t]=n,r}function zP(e,t,n){if(function(e,t,n,r=0){const o=e[t].position,i=Math.min(o,n),s=Math.max(o,n);return e.some((({position:e},o)=>o!==t&&(Math.abs(e-n)({placement:"bottom",offset:8,resize:!1})),[]),o=s("components-custom-gradient-picker__control-point-dropdown",t);return(0,wt.jsx)(yk,{isRenderedInSidebar:e,popoverProps:r,className:o,...n})}function $P({disableRemove:e,disableAlpha:t,gradientPickerDomRef:n,ignoreMarkerPosition:r,value:o,onChange:i,onStartControlPointChange:s,onStopControlPointChange:l,__experimentalIsRenderedInSidebar:u}){const d=(0,c.useRef)(),p=e=>{if(void 0===d.current||null===n.current)return;const t=FP(e.clientX,n.current),{initialPosition:r,index:s,significantMoveHappened:a}=d.current;!a&&Math.abs(r-t)>=5&&(d.current.significantMoveHappened=!0),i(zP(o,s,t))},f=()=>{window&&window.removeEventListener&&d.current&&d.current.listenersActivated&&(window.removeEventListener("mousemove",p),window.removeEventListener("mouseup",f),l(),d.current.listenersActivated=!1)},h=(0,c.useRef)();return h.current=f,(0,c.useEffect)((()=>()=>{h.current?.()}),[]),(0,wt.jsx)(wt.Fragment,{children:o.map(((n,c)=>{const h=n?.position;return r!==h&&(0,wt.jsx)(VP,{isRenderedInSidebar:u,onClose:l,renderToggle:({isOpen:e,onToggle:t})=>(0,wt.jsx)(BP,{onClick:()=>{d.current&&d.current.significantMoveHappened||(e?l():s(),t())},onMouseDown:()=>{window&&window.addEventListener&&(d.current={initialPosition:h,index:c,significantMoveHappened:!1,listenersActivated:!0},s(),window.addEventListener("mousemove",p),window.addEventListener("mouseup",f))},onKeyDown:e=>{"ArrowLeft"===e.code?(e.stopPropagation(),i(zP(o,c,DP(n.position-10)))):"ArrowRight"===e.code&&(e.stopPropagation(),i(zP(o,c,DP(n.position+10))))},isOpen:e,position:n.position,color:n.color},c),renderContent:({onClose:r})=>(0,wt.jsxs)(mk,{paddingSize:"none",children:[(0,wt.jsx)(JC,{enableAlpha:!t,color:n.color,onChange:e=>{i(LP(o,c,uv(e).toRgbString()))}}),!e&&o.length>2&&(0,wt.jsx)(ny,{className:"components-custom-gradient-picker__remove-control-point-wrapper",alignment:"center",children:(0,wt.jsx)($x,{onClick:()=>{i(function(e,t){return e.filter(((e,n)=>n!==t))}(o,c)),r()},variant:"link",children:(0,a.__)("Remove Control Point")})})]}),style:{left:`${n.position}%`,transform:"translateX( -50% )"}},c)}))})}$P.InsertPoint=function({value:e,onChange:t,onOpenInserter:n,onCloseInserter:r,insertPosition:o,disableAlpha:i,__experimentalIsRenderedInSidebar:s}){const[a,l]=(0,c.useState)(!1);return(0,wt.jsx)(VP,{isRenderedInSidebar:s,className:"components-custom-gradient-picker__inserter",onClose:()=>{r()},renderToggle:({isOpen:e,onToggle:t})=>(0,wt.jsx)($x,{"aria-expanded":e,"aria-haspopup":"true",onClick:()=>{e?r():(l(!1),n()),t()},className:"components-custom-gradient-picker__insert-point-dropdown",icon:Eg}),renderContent:()=>(0,wt.jsx)(mk,{paddingSize:"none",children:(0,wt.jsx)(JC,{enableAlpha:!i,onChange:n=>{a?t(function(e,t,n){const r=e.findIndex((e=>e.position===t));return LP(e,r,n)}(e,o,uv(n).toRgbString())):(t(function(e,t,n){const r=e.findIndex((e=>e.position>t)),o={color:n,position:t},i=e.slice();return i.splice(r-1,0,o),i}(e,o,uv(n).toRgbString())),l(!0))}})}),style:null!==o?{left:`${o}%`,transform:"translateX( -50% )"}:void 0})};const HP=$P,WP=(e,t)=>{switch(t.type){case"MOVE_INSERTER":if("IDLE"===e.id||"MOVING_INSERTER"===e.id)return{id:"MOVING_INSERTER",insertPosition:t.insertPosition};break;case"STOP_INSERTER_MOVE":if("MOVING_INSERTER"===e.id)return{id:"IDLE"};break;case"OPEN_INSERTER":if("MOVING_INSERTER"===e.id)return{id:"INSERTING_CONTROL_POINT",insertPosition:e.insertPosition};break;case"CLOSE_INSERTER":if("INSERTING_CONTROL_POINT"===e.id)return{id:"IDLE"};break;case"START_CONTROL_CHANGE":if("IDLE"===e.id)return{id:"MOVING_CONTROL_POINT"};break;case"STOP_CONTROL_CHANGE":if("MOVING_CONTROL_POINT"===e.id)return{id:"IDLE"}}return e},UP={id:"IDLE"};function GP({background:e,hasGradient:t,value:n,onChange:r,disableInserter:o=!1,disableAlpha:i=!1,__experimentalIsRenderedInSidebar:a=!1}){const l=(0,c.useRef)(null),[u,d]=(0,c.useReducer)(WP,UP),p=e=>{if(!l.current)return;const t=FP(e.clientX,l.current);n.some((({position:e})=>Math.abs(t-e)<10))?"MOVING_INSERTER"===u.id&&d({type:"STOP_INSERTER_MOVE"}):d({type:"MOVE_INSERTER",insertPosition:t})},f="MOVING_INSERTER"===u.id,h="INSERTING_CONTROL_POINT"===u.id;return(0,wt.jsxs)("div",{className:s("components-custom-gradient-picker__gradient-bar",{"has-gradient":t}),onMouseEnter:p,onMouseMove:p,onMouseLeave:()=>{d({type:"STOP_INSERTER_MOVE"})},children:[(0,wt.jsx)("div",{className:"components-custom-gradient-picker__gradient-bar-background",style:{background:e,opacity:t?1:.4}}),(0,wt.jsxs)("div",{ref:l,className:"components-custom-gradient-picker__markers-container",children:[!o&&(f||h)&&(0,wt.jsx)(HP.InsertPoint,{__experimentalIsRenderedInSidebar:a,disableAlpha:i,insertPosition:u.insertPosition,value:n,onChange:r,onOpenInserter:()=>{d({type:"OPEN_INSERTER"})},onCloseInserter:()=>{d({type:"CLOSE_INSERTER"})}}),(0,wt.jsx)(HP,{__experimentalIsRenderedInSidebar:a,disableAlpha:i,disableRemove:o,gradientPickerDomRef:l,ignoreMarkerPosition:h?u.insertPosition:void 0,value:n,onChange:r,onStartControlPointChange:()=>{d({type:"START_CONTROL_CHANGE"})},onStopControlPointChange:()=>{d({type:"STOP_CONTROL_CHANGE"})}})]})]})}var KP=o(8924);const qP="linear-gradient(135deg, rgba(6, 147, 227, 1) 0%, rgb(155, 81, 224) 100%)",YP={type:"angular",value:"90"},XP=[{value:"linear-gradient",label:(0,a.__)("Linear")},{value:"radial-gradient",label:(0,a.__)("Radial")}],ZP={top:0,"top right":45,"right top":45,right:90,"right bottom":135,"bottom right":135,bottom:180,"bottom left":225,"left bottom":225,left:270,"top left":315,"left top":315};function QP({type:e,value:t,length:n}){return`${function({type:e,value:t}){return"literal"===e?t:"hex"===e?`#${t}`:`${e}(${t.join(",")})`}({type:e,value:t})} ${function(e){if(!e)return"";const{value:t,type:n}=e;return`${t}${n}`}(n)}`}function JP({type:e,orientation:t,colorStops:n}){const r=function(e){if(!Array.isArray(e)&&e&&"angular"===e.type)return`${e.value}deg`}(t);return`${e}(${[r,...n.sort(((e,t)=>{const n=e=>void 0===e?.length?.value?0:parseInt(e.length.value);return n(e)-n(t)})).map(QP)].filter(Boolean).join(",")})`}function eT(e){return void 0===e.length||"%"!==e.length.type}function tT(e){switch(e.type){case"hex":return`#${e.value}`;case"literal":return e.value;case"rgb":case"rgba":return`${e.type}(${e.value.join(",")})`;default:return"transparent"}}pv([fv]);const nT=cl(vg,{target:"e10bzpgi1"})({name:"1gvx10y",styles:"flex-grow:5"}),rT=cl(vg,{target:"e10bzpgi0"})({name:"1gvx10y",styles:"flex-grow:5"}),oT=({gradientAST:e,hasGradient:t,onChange:n})=>{var r;const o=null!==(r=e?.orientation?.value)&&void 0!==r?r:180;return(0,wt.jsx)(dy,{onChange:t=>{n(JP({...e,orientation:{type:"angular",value:`${t}`}}))},value:t?o:""})},iT=({gradientAST:e,hasGradient:t,onChange:n})=>{const{type:r}=e;return(0,wt.jsx)(oS,{__nextHasNoMarginBottom:!0,className:"components-custom-gradient-picker__type-picker",label:(0,a.__)("Type"),labelPosition:"top",onChange:t=>{"linear-gradient"===t&&n(JP({...e,orientation:e.orientation?void 0:YP,type:"linear-gradient"})),"radial-gradient"===t&&(()=>{const{orientation:t,...r}=e;n(JP({...r,type:"radial-gradient"}))})()},options:XP,size:"__unstable-large",value:t?r:void 0})};const sT=function({value:e,onChange:t,__experimentalIsRenderedInSidebar:n=!1}){const{gradientAST:r,hasGradient:o}=function(e){let t,n=!!e;const r=null!=e?e:qP;try{t=KP.parse(r)[0]}catch(e){console.warn("wp.components.CustomGradientPicker failed to parse the gradient with error",e),t=KP.parse(qP)[0],n=!1}if(Array.isArray(t.orientation)||"directional"!==t.orientation?.type||(t.orientation={type:"angular",value:ZP[t.orientation.value].toString()}),t.colorStops.some(eT)){const{colorStops:e}=t,n=100/(e.length-1);e.forEach(((e,t)=>{e.length={value:""+n*t,type:"%"}}))}return{gradientAST:t,hasGradient:n}}(e),i=function(e){return JP({type:"linear-gradient",orientation:YP,colorStops:e.colorStops})}(r),s=r.colorStops.map((e=>({color:tT(e),position:parseInt(e.length.value)})));return(0,wt.jsxs)(lk,{spacing:4,className:"components-custom-gradient-picker",children:[(0,wt.jsx)(GP,{__experimentalIsRenderedInSidebar:n,background:i,hasGradient:o,value:s,onChange:e=>{t(JP(function(e,t){return{...e,colorStops:t.map((({position:e,color:t})=>{const{r:n,g:r,b:o,a:i}=uv(t).toRgb();return{length:{type:"%",value:e?.toString()},type:i<1?"rgba":"rgb",value:i<1?[`${n}`,`${r}`,`${o}`,`${i}`]:[`${n}`,`${r}`,`${o}`]}}))}}(r,e)))}}),(0,wt.jsxs)(mg,{gap:3,className:"components-custom-gradient-picker__ui-line",children:[(0,wt.jsx)(nT,{children:(0,wt.jsx)(iT,{gradientAST:r,hasGradient:o,onChange:t})}),(0,wt.jsx)(rT,{children:"linear-gradient"===r.type&&(0,wt.jsx)(oT,{gradientAST:r,hasGradient:o,onChange:t})})]})]})},aT=e=>e.length>0&&e.every((e=>{return t=e,Array.isArray(t.gradients)&&!("gradient"in t);var t}));function lT({className:e,clearGradient:t,gradients:n,onChange:r,value:o,...i}){const s=(0,c.useMemo)((()=>n.map((({gradient:e,name:n,slug:i},s)=>(0,wt.jsx)(ak.Option,{value:e,isSelected:o===e,tooltipText:n||(0,a.sprintf)((0,a.__)("Gradient code: %s"),e),style:{color:"rgba( 0,0,0,0 )",background:e},onClick:o===e?t:()=>r(e,s),"aria-label":n?(0,a.sprintf)((0,a.__)("Gradient: %s"),n):(0,a.sprintf)((0,a.__)("Gradient code: %s"),e)},i)))),[n,o,r,t]);return(0,wt.jsx)(ak.OptionGroup,{className:e,options:s,...i})}function cT({className:e,clearGradient:t,gradients:n,onChange:r,value:o,headingLevel:i}){const s=(0,l.useInstanceId)(cT);return(0,wt.jsx)(lk,{spacing:3,className:e,children:n.map((({name:e,gradients:n},a)=>{const l=`color-palette-${s}-${a}`;return(0,wt.jsxs)(lk,{spacing:2,children:[(0,wt.jsx)(pk,{level:i,id:l,children:e}),(0,wt.jsx)(lT,{clearGradient:t,gradients:n,onChange:e=>r(e,a),value:o,"aria-labelledby":l})]},a)}))})}function uT(e){const{asButtons:t,loop:n,actions:r,headingLevel:o,"aria-label":i,"aria-labelledby":s,...l}=e,c=aT(e.gradients)?(0,wt.jsx)(cT,{headingLevel:o,...l}):(0,wt.jsx)(lT,{...l});let u;if(t)u={asButtons:!0};else{const e={asButtons:!1,loop:n};u=i?{...e,"aria-label":i}:s?{...e,"aria-labelledby":s}:{...e,"aria-label":(0,a.__)("Custom color picker.")}}return(0,wt.jsx)(ak,{...u,actions:r,options:c})}const dT=function({className:e,gradients:t=[],onChange:n,value:r,clearable:o=!0,disableCustomGradients:i=!1,__experimentalIsRenderedInSidebar:s,headingLevel:l=2,...u}){const d=(0,c.useCallback)((()=>n(void 0)),[n]);return(0,wt.jsxs)(lk,{spacing:t.length?4:0,children:[!i&&(0,wt.jsx)(sT,{__experimentalIsRenderedInSidebar:s,value:r,onChange:n}),(t.length>0||o)&&(0,wt.jsx)(uT,{...u,className:e,clearGradient:d,gradients:t,onChange:n,value:r,actions:o&&!i&&(0,wt.jsx)(ak.ButtonAction,{onClick:d,children:(0,a.__)("Clear")}),headingLevel:l})]})},pT=(0,wt.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,wt.jsx)(n.Path,{d:"M5 5v1.5h14V5H5zm0 7.8h14v-1.5H5v1.5zM5 19h14v-1.5H5V19z"})}),fT=window.wp.dom,hT=()=>{},mT=["menuitem","menuitemradio","menuitemcheckbox"];class gT extends c.Component{constructor(e){super(e),this.onKeyDown=this.onKeyDown.bind(this),this.bindContainer=this.bindContainer.bind(this),this.getFocusableContext=this.getFocusableContext.bind(this),this.getFocusableIndex=this.getFocusableIndex.bind(this)}componentDidMount(){this.container&&this.container.addEventListener("keydown",this.onKeyDown)}componentWillUnmount(){this.container&&this.container.removeEventListener("keydown",this.onKeyDown)}bindContainer(e){const{forwardedRef:t}=this.props;this.container=e,"function"==typeof t?t(e):t&&"current"in t&&(t.current=e)}getFocusableContext(e){if(!this.container)return null;const{onlyBrowserTabstops:t}=this.props,n=(t?fT.focus.tabbable:fT.focus.focusable).find(this.container),r=this.getFocusableIndex(n,e);return r>-1&&e?{index:r,target:e,focusables:n}:null}getFocusableIndex(e,t){return e.indexOf(t)}onKeyDown(e){this.props.onKeyDown&&this.props.onKeyDown(e);const{getFocusableContext:t}=this,{cycle:n=!0,eventToOffset:r,onNavigate:o=hT,stopNavigationEvents:i}=this.props,s=r(e);if(void 0!==s&&i){e.stopImmediatePropagation();const t=e.target?.getAttribute("role");!!t&&mT.includes(t)&&e.preventDefault()}if(!s)return;const a=e.target?.ownerDocument?.activeElement;if(!a)return;const l=t(a);if(!l)return;const{index:c,focusables:u}=l,d=n?function(e,t,n){const r=e+n;return r<0?t+r:r>=t?r-t:r}(c,u.length,s):c+s;d>=0&&d(0,wt.jsx)(gT,{...e,forwardedRef:t});vT.displayName="NavigableContainer";const bT=(0,c.forwardRef)(vT);const xT=(0,c.forwardRef)((function({role:e="menu",orientation:t="vertical",...n},r){return(0,wt.jsx)(bT,{ref:r,stopNavigationEvents:!0,onlyBrowserTabstops:!1,role:e,"aria-orientation":"presentation"===e||"vertical"!==t&&"horizontal"!==t?void 0:t,eventToOffset:e=>{const{code:n}=e;let r=["ArrowDown"],o=["ArrowUp"];return"horizontal"===t&&(r=["ArrowRight"],o=["ArrowLeft"]),"both"===t&&(r=["ArrowRight","ArrowDown"],o=["ArrowLeft","ArrowUp"]),r.includes(n)?1:o.includes(n)?-1:["ArrowDown","ArrowUp","ArrowLeft","ArrowRight"].includes(n)?0:void 0},...n})})),yT=xT;function wT(e={},t={}){const n={...e,...t};return t.className&&e.className&&(n.className=s(t.className,e.className)),n}function _T(e){return"function"==typeof e}const ST=Za((function(e){const{children:t,className:n,controls:r,icon:o=pT,label:i,popoverProps:a,toggleProps:l,menuProps:c,disableOpenOnArrowDown:u=!1,text:d,noIcons:p,open:f,defaultOpen:h,onToggle:m,variant:g}=Ya(e,"DropdownMenu");if(!r?.length&&!_T(t))return null;let v;r?.length&&(v=r,Array.isArray(v[0])||(v=[r]));const b=wT({className:"components-dropdown-menu__popover",variant:g},a);return(0,wt.jsx)(F_,{className:n,popoverProps:b,renderToggle:({isOpen:e,onToggle:t})=>{var n;const{as:r=$x,...a}=null!=l?l:{},c=wT({className:s("components-dropdown-menu__toggle",{"is-opened":e})},a);return(0,wt.jsx)(r,{...c,icon:o,onClick:e=>{t(),c.onClick&&c.onClick(e)},onKeyDown:n=>{(n=>{u||e||"ArrowDown"!==n.code||(n.preventDefault(),t())})(n),c.onKeyDown&&c.onKeyDown(n)},"aria-haspopup":"true","aria-expanded":e,label:i,text:d,showTooltip:null===(n=l?.showTooltip)||void 0===n||n,children:c.children})},renderContent:e=>{const n=wT({"aria-label":i,className:s("components-dropdown-menu__menu",{"no-icons":p})},c);return(0,wt.jsxs)(yT,{...n,role:"menu",children:[_T(t)?t(e):null,v?.flatMap(((t,n)=>t.map(((t,r)=>(0,wt.jsx)($x,{onClick:n=>{n.stopPropagation(),e.onClose(),t.onClick&&t.onClick()},className:s("components-dropdown-menu__menu-item",{"has-separator":n>0&&0===r,"is-active":t.isActive,"is-icon-only":!t.title}),icon:t.icon,label:t.label,"aria-checked":"menuitemcheckbox"===t.role||"menuitemradio"===t.role?t.isActive:void 0,role:"menuitemcheckbox"===t.role||"menuitemradio"===t.role?t.role:"menuitem",accessibleWhenDisabled:!0,disabled:t.isDisabled,children:t.title},[n,r].join())))))]})},open:f,defaultOpen:h,onToggle:m})}),"DropdownMenu"),CT=ST;const kT=cl(A_,{target:"e1lpqc909"})("&&{flex-shrink:0;width:",yl(6),";height:",yl(6),";}"),jT=cl(zx,{target:"e1lpqc908"})($v,"{background:",kl.gray[100],";border-radius:",Pl.radiusXSmall,";",Yv,Yv,Yv,Yv,"{height:",yl(8),";}",zv,zv,zv,"{border-color:transparent;box-shadow:none;}}"),ET=({as:e})=>"button"===e?bl("display:flex;align-items:center;width:100%;appearance:none;background:transparent;border:none;border-radius:0;padding:0;cursor:pointer;&:hover{color:",kl.theme.accent,";}",""):null,PT=cl(dl,{target:"e1lpqc907"})(ET," padding-block:3px;padding-inline-start:",yl(3),";border:1px solid ",Pl.surfaceBorderColor,";border-bottom-color:transparent;font-size:",wx("default.fontSize"),";&:focus-visible{border-color:transparent;box-shadow:0 0 0 var( --wp-admin-border-width-focus ) ",kl.theme.accent,";outline:2px solid transparent;outline-offset:0;}border-top-left-radius:",Pl.radiusSmall,";border-top-right-radius:",Pl.radiusSmall,";&+&{border-top-left-radius:0;border-top-right-radius:0;}&:last-child{border-bottom-left-radius:",Pl.radiusSmall,";border-bottom-right-radius:",Pl.radiusSmall,";border-bottom-color:",Pl.surfaceBorderColor,";}&.is-selected+&{border-top-color:transparent;}&.is-selected{border-color:",kl.theme.accent,";}"),TT=cl("div",{target:"e1lpqc906"})("line-height:",yl(8),";margin-left:",yl(2),";margin-right:",yl(2),";white-space:nowrap;overflow:hidden;"),RT=cl(dk,{target:"e1lpqc905"})("text-transform:uppercase;line-height:",yl(6),";font-weight:500;&&&{font-size:11px;margin-bottom:0;}"),IT=cl(dl,{target:"e1lpqc904"})("height:",yl(6),";display:flex;"),NT=cl(dl,{target:"e1lpqc903"})("margin-top:",yl(2),";"),MT=cl(dl,{target:"e1lpqc902"})({name:"u6wnko",styles:"&&&{.components-button.has-icon{min-width:0;padding:0;}}"}),AT=cl($x,{target:"e1lpqc901"})("&&{color:",kl.theme.accent,";}"),DT=cl($x,{target:"e1lpqc900"})("&&{margin-top:",yl(1),";}");function OT({value:e,onChange:t,label:n}){return(0,wt.jsx)(jT,{label:n,hideLabelFromVision:!0,value:e,onChange:t})}function zT({isGradient:e,element:t,onChange:n,popoverProps:r,onClose:o=()=>{}}){const i=(0,c.useMemo)((()=>({shift:!0,offset:20,resize:!1,placement:"left-start",...r,className:s("components-palette-edit__popover",r?.className)})),[r]);return(0,wt.jsxs)(vw,{...i,onClose:o,children:[!e&&(0,wt.jsx)(JC,{color:t.color,enableAlpha:!0,onChange:e=>{n({...t,color:e})}}),e&&(0,wt.jsx)("div",{className:"components-palette-edit__popover-gradient-picker",children:(0,wt.jsx)(sT,{__experimentalIsRenderedInSidebar:!0,value:t.gradient,onChange:e=>{n({...t,gradient:e})}})})]})}function LT({canOnlyChangeValues:e,element:t,onChange:n,onRemove:r,popoverProps:o,slugPrefix:i,isGradient:s}){const l=s?t.gradient:t.color,[u,d]=(0,c.useState)(!1),[p,f]=(0,c.useState)(null),h=(0,c.useMemo)((()=>({...o,anchor:p})),[p,o]);return(0,wt.jsxs)(PT,{ref:f,as:"div",children:[(0,wt.jsxs)(ny,{justify:"flex-start",children:[(0,wt.jsx)($x,{onClick:()=>{d(!0)},"aria-label":(0,a.sprintf)((0,a.__)("Edit: %s"),t.name.trim().length?t.name:l),style:{padding:0},children:(0,wt.jsx)(kT,{colorValue:l})}),(0,wt.jsx)(Tg,{children:e?(0,wt.jsx)(TT,{children:t.name.trim().length?t.name:" "}):(0,wt.jsx)(OT,{label:s?(0,a.__)("Gradient name"):(0,a.__)("Color name"),value:t.name,onChange:e=>n({...t,name:e,slug:i+xy(null!=e?e:"")})})}),!e&&(0,wt.jsx)(Tg,{children:(0,wt.jsx)(DT,{size:"small",icon:zw,label:(0,a.sprintf)((0,a.__)("Remove color: %s"),t.name.trim().length?t.name:l),onClick:r})})]}),u&&(0,wt.jsx)(zT,{isGradient:s,onChange:n,element:t,popoverProps:h,onClose:()=>d(!1)})]})}function FT({elements:e,onChange:t,canOnlyChangeValues:n,slugPrefix:r,isGradient:o,popoverProps:i,addColorRef:s}){const a=(0,c.useRef)();(0,c.useEffect)((()=>{a.current=e}),[e]);const u=(0,l.useDebounce)((e=>t(function(e){const t={};return e.map((e=>{var n;let r;const{slug:o}=e;return t[o]=(t[o]||0)+1,t[o]>1&&(r=`${o}-${t[o]-1}`),{...e,slug:null!==(n=r)&&void 0!==n?n:o}}))}(e))),100);return(0,wt.jsx)(lk,{spacing:3,children:(0,wt.jsx)(AP,{isRounded:!0,children:e.map(((a,l)=>(0,wt.jsx)(LT,{isGradient:o,canOnlyChangeValues:n,element:a,onChange:t=>{u(e.map(((e,n)=>n===l?t:e)))},onRemove:()=>{const n=e.filter(((e,t)=>t!==l));t(n.length?n:void 0),s.current?.focus()},slugPrefix:r,popoverProps:i},l)))})})}const BT=[];const VT=function({gradients:e,colors:t=BT,onChange:n,paletteLabel:r,paletteLabelHeadingLevel:o=2,emptyMessage:i,canOnlyChangeValues:s,canReset:u,slugPrefix:d="",popoverProps:p}){const f=!!e,h=f?e:t,[m,g]=(0,c.useState)(!1),[v,b]=(0,c.useState)(null),x=m&&!!v&&h[v]&&!h[v].slug,y=h.length>0,w=(0,l.useDebounce)(n,100),_=(0,c.useCallback)(((e,t)=>{const n=void 0===t?void 0:h[t];n&&n[f?"gradient":"color"]===e?b(t):g(!0)}),[f,h]),S=(0,c.useRef)(null);return(0,wt.jsxs)(MT,{children:[(0,wt.jsxs)(ny,{children:[(0,wt.jsx)(RT,{level:o,children:r}),(0,wt.jsxs)(IT,{children:[y&&m&&(0,wt.jsx)(AT,{size:"small",onClick:()=>{g(!1),b(null)},children:(0,a.__)("Done")}),!s&&(0,wt.jsx)($x,{ref:S,size:"small",isPressed:x,icon:Eg,label:f?(0,a.__)("Add gradient"):(0,a.__)("Add color"),onClick:()=>{const{name:r,slug:o}=function(e,t){const n=new RegExp(`^${t}color-([\\d]+)$`),r=e.reduce(((e,t)=>{if("string"==typeof t?.slug){const r=t?.slug.match(n);if(r){const t=parseInt(r[1],10);if(t>=e)return t+1}}return e}),1);return{name:(0,a.sprintf)((0,a.__)("Color %s"),r),slug:`${t}color-${r}`}}(h,d);n(e?[...e,{gradient:qP,name:r,slug:o}]:[...t,{color:"#000",name:r,slug:o}]),g(!0),b(h.length)}}),y&&(!m||!s||u)&&(0,wt.jsx)(CT,{icon:xP,label:f?(0,a.__)("Gradient options"):(0,a.__)("Color options"),toggleProps:{size:"small"},children:({onClose:e})=>(0,wt.jsx)(wt.Fragment,{children:(0,wt.jsxs)(yT,{role:"menu",children:[!m&&(0,wt.jsx)($x,{variant:"tertiary",onClick:()=>{g(!0),e()},className:"components-palette-edit__menu-button",children:(0,a.__)("Show details")}),!s&&(0,wt.jsx)($x,{variant:"tertiary",onClick:()=>{b(null),g(!1),n(),e()},className:"components-palette-edit__menu-button",children:f?(0,a.__)("Remove all gradients"):(0,a.__)("Remove all colors")}),u&&(0,wt.jsx)($x,{variant:"tertiary",onClick:()=>{b(null),n(),e()},children:f?(0,a.__)("Reset gradient"):(0,a.__)("Reset colors")})]})})})]})]}),y&&(0,wt.jsxs)(NT,{children:[m&&(0,wt.jsx)(FT,{canOnlyChangeValues:s,elements:h,onChange:n,slugPrefix:d,isGradient:f,popoverProps:p,addColorRef:S}),!m&&null!==v&&(0,wt.jsx)(zT,{isGradient:f,onClose:()=>b(null),onChange:e=>{w(h.map(((t,n)=>n===v?e:t)))},element:h[null!=v?v:-1],popoverProps:p}),!m&&(f?(0,wt.jsx)(dT,{gradients:e,onChange:_,clearable:!1,disableCustomGradients:!0}):(0,wt.jsx)(_k,{colors:t,onChange:_,clearable:!1,disableCustomColors:!0}))]}),!y&&i&&(0,wt.jsx)(NT,{children:i})]})},$T=({__next40pxDefaultSize:e})=>!e&&bl("height:28px;padding-left:",yl(1),";padding-right:",yl(1),";",""),HT=cl(mg,{target:"evuatpg0"})("height:38px;padding-left:",yl(2),";padding-right:",yl(2),";",$T,";");const WT=(0,c.forwardRef)((function(e,t){const{value:n,isExpanded:r,instanceId:o,selectedSuggestionIndex:i,className:a,onChange:l,onFocus:u,onBlur:d,...p}=e,[f,h]=(0,c.useState)(!1),m=n?n.length+1:0;return(0,wt.jsx)("input",{ref:t,id:`components-form-token-input-${o}`,type:"text",...p,value:n||"",onChange:e=>{l&&l({value:e.target.value})},onFocus:e=>{h(!0),u?.(e)},onBlur:e=>{h(!1),d?.(e)},size:m,className:s(a,"components-form-token-field__input"),autoComplete:"off",role:"combobox","aria-expanded":r,"aria-autocomplete":"list","aria-owns":r?`components-form-token-suggestions-${o}`:void 0,"aria-activedescendant":f&&-1!==i&&r?`components-form-token-suggestions-${o}-${i}`:void 0,"aria-describedby":`components-form-token-suggestions-howto-${o}`})})),UT=WT,GT=e=>{e.preventDefault()};const KT=function({selectedIndex:e,scrollIntoView:t,match:n,onHover:r,onSelect:o,suggestions:i=[],displayTransform:a,instanceId:c,__experimentalRenderItem:u}){const d=(0,l.useRefEffect)((n=>(e>-1&&t&&n.children[e]&&n.children[e].scrollIntoView({behavior:"instant",block:"nearest",inline:"nearest"}),()=>{0})),[e,t]),p=e=>()=>{r?.(e)},f=e=>()=>{o?.(e)};return(0,wt.jsx)("ul",{ref:d,className:"components-form-token-field__suggestions-list",id:`components-form-token-suggestions-${c}`,role:"listbox",children:i.map(((t,r)=>{const o=(e=>{const t=a(n).toLocaleLowerCase();if(0===t.length)return null;const r=a(e),o=r.toLocaleLowerCase().indexOf(t);return{suggestionBeforeMatch:r.substring(0,o),suggestionMatch:r.substring(o,o+t.length),suggestionAfterMatch:r.substring(o+t.length)}})(t),i=r===e,l="object"==typeof t&&t?.disabled,d="object"==typeof t&&"value"in t?t?.value:a(t),h=s("components-form-token-field__suggestion",{"is-selected":i});let m;return m="function"==typeof u?u({item:t}):o?(0,wt.jsxs)("span",{"aria-label":a(t),children:[o.suggestionBeforeMatch,(0,wt.jsx)("strong",{className:"components-form-token-field__suggestion-match",children:o.suggestionMatch}),o.suggestionAfterMatch]}):a(t),(0,wt.jsx)("li",{id:`components-form-token-suggestions-${c}-${r}`,role:"option",className:h,onMouseDown:GT,onClick:f(t),onMouseEnter:p(t),"aria-selected":r===e,"aria-disabled":l,children:m},d)}))})},qT=(0,l.createHigherOrderComponent)((e=>t=>{const[n,r]=(0,c.useState)(void 0),o=(0,c.useCallback)((e=>r((()=>e?.handleFocusOutside?e.handleFocusOutside.bind(e):void 0))),[]);return(0,wt.jsx)("div",{...(0,l.__experimentalUseFocusOutside)(n),children:(0,wt.jsx)(e,{ref:o,...t})})}),"withFocusOutside"),YT=()=>{},XT=qT(class extends c.Component{handleFocusOutside(e){this.props.onFocusOutside(e)}render(){return this.props.children}}),ZT=(e,t)=>null===e?-1:t.indexOf(e);const QT=function e(t){var n;const{__nextHasNoMarginBottom:r=!1,__next40pxDefaultSize:o=!1,value:i,label:u,options:d,onChange:p,onFilterValueChange:f=YT,hideLabelFromVision:h,help:m,allowReset:g=!0,className:v,messages:b={selected:(0,a.__)("Item selected.")},__experimentalRenderItem:x,expandOnFocus:y=!0,placeholder:w}=ob(t),[_,S]=c_({value:i,onChange:p}),C=d.find((e=>e.value===_)),k=null!==(n=C?.label)&&void 0!==n?n:"",j=(0,l.useInstanceId)(e,"combobox-control"),[E,P]=(0,c.useState)(C||null),[T,R]=(0,c.useState)(!1),[I,N]=(0,c.useState)(!1),[M,A]=(0,c.useState)(""),D=(0,c.useRef)(null),O=(0,c.useMemo)((()=>{const e=[],t=[],n=by(M);return d.forEach((r=>{const o=by(r.label).indexOf(n);0===o?e.push(r):o>0&&t.push(r)})),e.concat(t)}),[M,d]),z=e=>{e.disabled||(S(e.value),(0,my.speak)(b.selected,"assertive"),P(e),A(""),R(!1))},L=(e=1)=>{let t=ZT(E,O)+e;t<0?t=O.length-1:t>=O.length&&(t=0),P(O[t]),R(!0)},F=gx((e=>{let t=!1;if(!e.defaultPrevented){switch(e.code){case"Enter":E&&(z(E),t=!0);break;case"ArrowUp":L(-1),t=!0;break;case"ArrowDown":L(1),t=!0;break;case"Escape":R(!1),P(null),t=!0}t&&e.preventDefault()}}));return(0,c.useEffect)((()=>{const e=O.length>0,t=ZT(E,O)>0;e&&!t&&P(O[0])}),[O,E]),(0,c.useEffect)((()=>{const e=O.length>0;if(T){const t=e?(0,a.sprintf)((0,a._n)("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",O.length),O.length):(0,a.__)("No results.");(0,my.speak)(t,"polite")}}),[O,T]),(0,wt.jsx)(XT,{onFocusOutside:()=>{R(!1)},children:(0,wt.jsx)(Ax,{__nextHasNoMarginBottom:r,__associatedWPComponentName:"ComboboxControl",className:s(v,"components-combobox-control"),label:u,id:`components-form-token-input-${j}`,hideLabelFromVision:h,help:m,children:(0,wt.jsxs)("div",{className:"components-combobox-control__suggestions-container",tabIndex:-1,onKeyDown:F,children:[(0,wt.jsxs)(HT,{__next40pxDefaultSize:o,children:[(0,wt.jsx)(vg,{children:(0,wt.jsx)(UT,{className:"components-combobox-control__input",instanceId:j,ref:D,placeholder:w,value:T?M:k,onFocus:()=>{N(!0),y&&R(!0),f(""),A("")},onBlur:()=>{N(!1)},onClick:()=>{R(!0)},isExpanded:T,selectedSuggestionIndex:ZT(E,O),onChange:e=>{const t=e.value;A(t),f(t),I&&R(!0)}})}),g&&(0,wt.jsx)(Tg,{children:(0,wt.jsx)($x,{className:"components-combobox-control__reset",icon:Ow,disabled:!_,onClick:()=>{S(null),D.current?.focus()},onKeyDown:e=>{e.stopPropagation()},label:(0,a.__)("Reset")})})]}),T&&(0,wt.jsx)(KT,{instanceId:j,match:{label:M,value:""},displayTransform:e=>e.label,suggestions:O,selectedIndex:ZT(E,O),onHover:P,onSelect:z,scrollIntoView:!0,__experimentalRenderItem:x})]})})})};function JT(e){if(e.state){const{state:t,...n}=e,{store:r,...o}=JT(t);return{...n,...o,store:r}}return e}const eR={__unstableComposite:"Composite",__unstableCompositeGroup:"Composite.Group or Composite.Row",__unstableCompositeItem:"Composite.Item",__unstableUseCompositeState:"Composite"};function tR(e,t={}){var n;const r=null!==(n=e.displayName)&&void 0!==n?n:"",o=n=>{Fi()(`wp.components.${r}`,{since:"6.7",alternative:eR.hasOwnProperty(r)?eR[r]:void 0});const{store:o,...i}=JT(n),s=i;return s.id=(0,l.useInstanceId)(o,s.baseId,s.id),Object.entries(t).forEach((([e,t])=>{s.hasOwnProperty(e)&&(Object.assign(s,{[t]:s[e]}),delete s[e])})),delete s.baseId,(0,wt.jsx)(e,{...s,store:o})};return o.displayName=r,o}const nR=(0,c.forwardRef)((({role:e,...t},n)=>{const r="row"===e?Dn.Row:Dn.Group;return(0,wt.jsx)(r,{ref:n,role:e,...t})})),rR=tR(Object.assign(Dn,{displayName:"__unstableComposite"}),{baseId:"id"}),oR=tR(Object.assign(nR,{displayName:"__unstableCompositeGroup"})),iR=tR(Object.assign(Dn.Item,{displayName:"__unstableCompositeItem"}),{focusable:"accessibleWhenDisabled"});function sR(e={}){Fi()("wp.components.__unstableUseCompositeState",{since:"6.7",alternative:eR.__unstableUseCompositeState});const{baseId:t,currentId:n,orientation:r,rtl:o=!1,loop:i=!1,wrap:s=!1,shift:a=!1,unstable_virtual:c}=e;return{baseId:(0,l.useInstanceId)(rR,"composite",t),store:gt({defaultActiveId:n,rtl:o,orientation:r,focusLoop:i,focusShift:a,focusWrap:s,virtualFocus:c})}}const aR=new Set(["alert","status","log","marquee","timer"]),lR=[];function cR(e){const t=e.getAttribute("role");return!("SCRIPT"===e.tagName||e.hasAttribute("aria-hidden")||e.hasAttribute("aria-live")||t&&aR.has(t))}const uR=Pl.transitionDuration,dR=Number.parseInt(Pl.transitionDuration);const pR=(0,c.createContext)(new Set),fR=new Map;const hR=(0,c.forwardRef)((function(e,t){const{bodyOpenClassName:n="modal-open",role:r="dialog",title:o=null,focusOnMount:i=!0,shouldCloseOnEsc:u=!0,shouldCloseOnClickOutside:d=!0,isDismissible:p=!0,aria:f={labelledby:void 0,describedby:void 0},onRequestClose:h,icon:m,closeButtonLabel:g,children:v,style:b,overlayClassName:x,className:y,contentLabel:w,onKeyDown:_,isFullScreen:S=!1,size:C,headerActions:k=null,__experimentalHideHeader:j=!1}=e,E=(0,c.useRef)(),P=(0,l.useInstanceId)(hR),T=o?`components-modal-header-${P}`:f.labelledby,R=(0,l.useFocusOnMount)("firstContentElement"===i?"firstElement":i),I=(0,l.useConstrainedTabbing)(),N=(0,l.useFocusReturn)(),M=(0,c.useRef)(null),A=(0,c.useRef)(null),[D,O]=(0,c.useState)(!1),[z,L]=(0,c.useState)(!1);let F;S||"fill"===C?F="is-full-screen":C&&(F=`has-size-${C}`);const B=(0,c.useCallback)((()=>{if(!M.current)return;const e=(0,fT.getScrollContainer)(M.current);M.current===e?L(!0):L(!1)}),[M]);(0,c.useEffect)((()=>(function(e){const t=Array.from(document.body.children),n=[];lR.push(n);for(const r of t)r!==e&&cR(r)&&(r.setAttribute("aria-hidden","true"),n.push(r))}(E.current),()=>function(){const e=lR.pop();if(e)for(const t of e)t.removeAttribute("aria-hidden")}())),[]);const V=(0,c.useRef)();(0,c.useEffect)((()=>{V.current=h}),[h]);const $=(0,c.useContext)(pR),[H]=(0,c.useState)((()=>new Set));(0,c.useEffect)((()=>{$.add(V);for(const e of $)e!==V&&e.current?.();return()=>{for(const e of H)e.current?.();$.delete(V)}}),[$,H]),(0,c.useEffect)((()=>{var e;const t=n,r=1+(null!==(e=fR.get(t))&&void 0!==e?e:0);return fR.set(t,r),document.body.classList.add(n),()=>{const e=fR.get(t)-1;0===e?(document.body.classList.remove(t),fR.delete(t)):fR.set(t,e)}}),[n]);const{closeModal:W,frameRef:U,frameStyle:G,overlayClassname:K}=function(){const e=(0,c.useRef)(),[t,n]=(0,c.useState)(!1),r=(0,l.useReducedMotion)(),o=(0,c.useCallback)((()=>new Promise((t=>{const o=e.current;if(r)return void t();if(!o)return void t();let i;Promise.race([new Promise((e=>{i=t=>{"components-modal__disappear-animation"===t.animationName&&e()},o.addEventListener("animationend",i),n(!0)})),new Promise((e=>{setTimeout((()=>e()),1.2*dR)}))]).then((()=>{i&&o.removeEventListener("animationend",i),n(!1),t()}))}))),[r]);return{overlayClassname:t?"is-animating-out":void 0,frameRef:e,frameStyle:{"--modal-frame-animation-duration":`${uR}`},closeModal:o}}();(0,c.useLayoutEffect)((()=>{if(!window.ResizeObserver||!A.current)return;const e=new ResizeObserver(B);return e.observe(A.current),B(),()=>{e.disconnect()}}),[B,A]);const q=(0,c.useCallback)((e=>{var t;const n=null!==(t=e?.currentTarget?.scrollTop)&&void 0!==t?t:-1;!D&&n>0?O(!0):D&&n<=0&&O(!1)}),[D]);let Y=null;const X={onPointerDown:e=>{e.target===e.currentTarget&&(Y=e.target,e.preventDefault())},onPointerUp:({target:e,button:t})=>{const n=e===Y;Y=null,0===t&&n&&W().then((()=>h()))}},Z=(0,wt.jsx)("div",{ref:(0,l.useMergeRefs)([E,t]),className:s("components-modal__screen-overlay",K,x),onKeyDown:gx((function(e){!u||"Escape"!==e.code&&"Escape"!==e.key||e.defaultPrevented||(e.preventDefault(),W().then((()=>h(e))))})),...d?X:{},children:(0,wt.jsx)(Jy,{document,children:(0,wt.jsx)("div",{className:s("components-modal__frame",F,y),style:{...G,...b},ref:(0,l.useMergeRefs)([U,I,N,"firstContentElement"!==i?R:null]),role:r,"aria-label":w,"aria-labelledby":w?void 0:T,"aria-describedby":f.describedby,tabIndex:-1,onKeyDown:_,children:(0,wt.jsxs)("div",{className:s("components-modal__content",{"hide-header":j,"is-scrollable":z,"has-scrolled-content":D}),role:"document",onScroll:q,ref:M,"aria-label":z?(0,a.__)("Scrollable section"):void 0,tabIndex:z?0:void 0,children:[!j&&(0,wt.jsxs)("div",{className:"components-modal__header",children:[(0,wt.jsxs)("div",{className:"components-modal__header-heading-container",children:[m&&(0,wt.jsx)("span",{className:"components-modal__icon-container","aria-hidden":!0,children:m}),o&&(0,wt.jsx)("h1",{id:T,className:"components-modal__header-heading",children:o})]}),k,p&&(0,wt.jsxs)(wt.Fragment,{children:[(0,wt.jsx)(jg,{marginBottom:0,marginLeft:3}),(0,wt.jsx)($x,{size:"small",onClick:e=>W().then((()=>h(e))),icon:Py,label:g||(0,a.__)("Close")})]})]}),(0,wt.jsx)("div",{ref:(0,l.useMergeRefs)([A,"firstContentElement"===i?R:null]),children:v})]})})})});return(0,c.createPortal)((0,wt.jsx)(pR.Provider,{value:H,children:Z}),document.body)})),mR=hR;const gR={name:"7g5ii0",styles:"&&{z-index:1000001;}"},vR=Xa(((e,t)=>{const{isOpen:n,onConfirm:r,onCancel:o,children:i,confirmButtonText:s,cancelButtonText:l,...u}=Ya(e,"ConfirmDialog"),d=qa()(gR),p=(0,c.useRef)(),f=(0,c.useRef)(),[h,m]=(0,c.useState)(),[g,v]=(0,c.useState)();(0,c.useEffect)((()=>{const e=void 0!==n;m(!e||n),v(!e)}),[n]);const b=(0,c.useCallback)((e=>t=>{e?.(t),g&&m(!1)}),[g,m]),x=(0,c.useCallback)((e=>{e.target===p.current||e.target===f.current||"Enter"!==e.key||b(r)(e)}),[b,r]),y=null!=l?l:(0,a.__)("Cancel"),w=null!=s?s:(0,a.__)("OK");return(0,wt.jsx)(wt.Fragment,{children:h&&(0,wt.jsx)(mR,{onRequestClose:b(o),onKeyDown:x,closeButtonLabel:y,isDismissible:!0,ref:t,overlayClassName:d,__experimentalHideHeader:!0,...u,children:(0,wt.jsxs)(lk,{spacing:8,children:[(0,wt.jsx)(Nv,{children:i}),(0,wt.jsxs)(mg,{direction:"row",justify:"flex-end",children:[(0,wt.jsx)($x,{__next40pxDefaultSize:!0,ref:p,variant:"tertiary",onClick:b(o),children:y}),(0,wt.jsx)($x,{__next40pxDefaultSize:!0,ref:f,variant:"primary",onClick:b(r),children:w})]})]})})})}),"ConfirmDialog");(0,B.createContext)(void 0);var bR=jt([ir,Nt],[sr,Mt]),xR=bR.useContext,yR=(bR.useScopedContext,bR.useProviderContext);bR.ContextProvider,bR.ScopedContextProvider,(0,B.createContext)(void 0),(0,B.createContext)(!1);function wR(e={}){var t=e,{combobox:n}=t,r=T(t,["combobox"]);const o=qe(r.store,Ke(n,["value","items","renderedItems","baseElement","arrowElement","anchorElement","contentElement","popoverElement","disclosureElement"])),i=o.getState(),s=ht(P(E({},r),{store:o,virtualFocus:F(r.virtualFocus,i.virtualFocus,!0),includesBaseElement:F(r.includesBaseElement,i.includesBaseElement,!1),activeId:F(r.activeId,i.activeId,r.defaultActiveId,null),orientation:F(r.orientation,i.orientation,"vertical")})),a=Hn(P(E({},r),{store:o,placement:F(r.placement,i.placement,"bottom-start")})),l=new String(""),c=P(E(E({},s.getState()),a.getState()),{value:F(r.value,i.value,r.defaultValue,l),setValueOnMove:F(r.setValueOnMove,i.setValueOnMove,!1),labelElement:F(i.labelElement,null),selectElement:F(i.selectElement,null),listElement:F(i.listElement,null)}),u=Ve(c,s,a,o);return $e(u,(()=>Ue(u,["value","items"],(e=>{if(e.value!==l)return;if(!e.items.length)return;const t=e.items.find((e=>!e.disabled&&null!=e.value));null!=(null==t?void 0:t.value)&&u.setState("value",t.value)})))),$e(u,(()=>Ue(u,["mounted"],(e=>{e.mounted||u.setState("activeId",c.activeId)})))),$e(u,(()=>Ue(u,["mounted","items","value"],(e=>{if(n)return;if(e.mounted)return;const t=ot(e.value),r=t[t.length-1];if(null==r)return;const o=e.items.find((e=>!e.disabled&&e.value===r));o&&u.setState("activeId",o.id)})))),$e(u,(()=>Ge(u,["setValueOnMove","moves"],(e=>{const{mounted:t,value:n,activeId:r}=u.getState();if(!e.setValueOnMove&&t)return;if(Array.isArray(n))return;if(!e.moves)return;if(!r)return;const o=s.item(r);o&&!o.disabled&&null!=o.value&&u.setState("value",o.value)})))),P(E(E(E({},s),a),u),{combobox:n,setValue:e=>u.setState("value",e),setLabelElement:e=>u.setState("labelElement",e),setSelectElement:e=>u.setState("selectElement",e),setListElement:e=>u.setState("listElement",e)})}function _R(e={}){const t=yR();e=b(v({},e),{combobox:void 0!==e.combobox?e.combobox:t});const[n,r]=et(wR,e);return function(e,t,n){return Pe(t,[n.combobox]),Je(e,n,"value","setValue"),Je(e,n,"setValueOnMove"),Object.assign(Vn(mt(e,t,n),t,n),{combobox:n.combobox})}(n,r,e)}var SR=jt([ir,Nt],[sr,Mt]),CR=SR.useContext,kR=SR.useScopedContext,jR=SR.useProviderContext,ER=(SR.ContextProvider,SR.ScopedContextProvider),PR=(0,B.createContext)(!1),TR=(0,B.createContext)(null),RR=kt((function(e){var t=e,{store:n}=t,r=x(t,["store"]);const o=jR();D(n=n||o,!1);const i=je(r.id),s=r.onClick,a=Se((e=>{null==s||s(e),e.defaultPrevented||queueMicrotask((()=>{const e=null==n?void 0:n.getState().selectElement;null==e||e.focus()}))}));return L(r=b(v({id:i},r),{ref:ke(n.setLabelElement,r.ref),onClick:a,style:v({cursor:"default"},r.style)}))})),IR=St(_t((function(e){return Ct("div",RR(e))}))),NR="button",MR=kt((function(e){const t=(0,B.useRef)(null),n=Ee(t,NR),[r,o]=(0,B.useState)((()=>!!n&&Z({tagName:n,type:e.type})));return(0,B.useEffect)((()=>{t.current&&o(Z(t.current))}),[]),e=b(v({role:r||"a"===n?void 0:"button"},e),{ref:ke(t,e.ref)}),e=kn(e)})),AR=(_t((function(e){const t=MR(e);return Ct(NR,t)})),Symbol("disclosure")),DR=kt((function(e){var t=e,{store:n,toggleOnClick:r=!0}=t,o=x(t,["store","toggleOnClick"]);const i=Yn();D(n=n||i,!1);const s=(0,B.useRef)(null),[a,l]=(0,B.useState)(!1),c=n.useState("disclosureElement"),u=n.useState("open");(0,B.useEffect)((()=>{let e=c===s.current;(null==c?void 0:c.isConnected)||(null==n||n.setDisclosureElement(s.current),e=!0),l(u&&e)}),[c,n,u]);const d=o.onClick,p=Re(r),[f,h]=Me(o,AR,!0),m=Se((e=>{null==d||d(e),e.defaultPrevented||f||p(e)&&(null==n||n.setDisclosureElement(e.currentTarget),null==n||n.toggle())})),g=n.useState("contentElement");return o=b(v(v({"aria-expanded":a,"aria-controls":null==g?void 0:g.id},h),o),{ref:ke(s,o.ref),onClick:m}),o=MR(o)})),OR=(_t((function(e){return Ct("button",DR(e))})),kt((function(e){var t=e,{store:n}=t,r=x(t,["store"]);const o=Zn();D(n=n||o,!1);const i=n.useState("contentElement");return r=v({"aria-haspopup":ne(i,"dialog")},r),r=DR(v({store:n},r))}))),zR=(_t((function(e){return Ct("button",OR(e))})),kt((function(e){var t=e,{store:n}=t,r=x(t,["store"]);const o=or();return n=n||o,r=b(v({},r),{ref:ke(null==n?void 0:n.setAnchorElement,r.ref)})}))),LR=(_t((function(e){return Ct("div",zR(e))})),kt((function(e){var t=e,{store:n}=t,r=x(t,["store"]);const o=or();D(n=n||o,!1);const i=r.onClick,s=Se((e=>{null==n||n.setAnchorElement(e.currentTarget),null==i||i(e)}));return r=Ie(r,(e=>(0,wt.jsx)(sr,{value:n,children:e})),[n]),r=b(v({},r),{onClick:s}),r=zR(v({store:n},r)),r=OR(v({store:n},r))}))),FR=(_t((function(e){return Ct("button",LR(e))})),{top:"4,10 8,6 12,10",right:"6,4 10,8 6,12",bottom:"4,6 8,10 12,6",left:"10,4 6,8 10,12"}),BR=kt((function(e){var t=e,{store:n,placement:r}=t,o=x(t,["store","placement"]);const i=rr();D(n=n||i,!1);const s=n.useState((e=>r||e.placement)).split("-")[0],a=FR[s],l=(0,B.useMemo)((()=>(0,wt.jsx)("svg",{display:"block",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,viewBox:"0 0 16 16",height:"1em",width:"1em",children:(0,wt.jsx)("polyline",{points:a})})),[a]);return L(o=b(v({children:l,"aria-hidden":!0},o),{style:v({width:"1em",height:"1em",pointerEvents:"none"},o.style)}))})),VR=(_t((function(e){return Ct("span",BR(e))})),kt((function(e){var t=e,{store:n}=t,r=x(t,["store"]);const o=CR();return r=BR(v({store:n=n||o},r))}))),$R=_t((function(e){return Ct("span",VR(e))})),HR="";function WR(){HR=""}function UR(e,t){var n;const r=(null==(n=e.element)?void 0:n.textContent)||e.children||"value"in e&&e.value;return!!r&&(o=r,o.normalize("NFD").replace(/[\u0300-\u036f]/g,"")).trim().toLowerCase().startsWith(t.toLowerCase());var o}function GR(e,t,n){if(!n)return e;const r=e.find((e=>e.id===n));return r&&UR(r,t)?HR!==t&&UR(r,HR)?e:(HR=t,function(e,t,n=!1){const r=e.findIndex((e=>e.id===t));return[...e.slice(r+1),...n?[vt]:[],...e.slice(0,r)]}(e.filter((e=>UR(e,HR))),n).filter((e=>e.id!==n))):e}var KR=kt((function(e){var t=e,{store:n,typeahead:r=!0}=t,o=x(t,["store","typeahead"]);const i=Rt();D(n=n||i,!1);const s=o.onKeyDownCapture,a=(0,B.useRef)(0),l=Se((e=>{if(null==s||s(e),e.defaultPrevented)return;if(!r)return;if(!n)return;const{renderedItems:t,items:o,activeId:i}=n.getState();if(!function(e){const t=e.target;return(!t||!ee(t))&&(!(" "!==e.key||!HR.length)||1===e.key.length&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&/^[\p{Letter}\p{Number}]$/u.test(e.key))}(e))return WR();let l=function(e){return e.filter((e=>!e.disabled))}(t.length?t:o);if(!function(e,t){if(ce(e))return!0;const n=e.target;if(!n)return!1;const r=t.some((e=>e.element===n));return r}(e,l))return WR();e.preventDefault(),window.clearTimeout(a.current),a.current=window.setTimeout((()=>{HR=""}),500);const c=e.key.toLowerCase();HR+=c,l=GR(l,c,i);const u=l.find((e=>UR(e,HR)));u?n.move(u.id):WR()}));return L(o=b(v({},o),{onKeyDownCapture:l}))}));_t((function(e){return Ct("div",KR(e))}));function qR(e,t){return()=>{const n=t();if(!n)return;let r=0,o=e.item(n);const i=o;for(;o&&null==o.value;){const n=t(++r);if(!n)return;if(o=e.item(n),o===i)break}return null==o?void 0:o.id}}var YR=kt((function(e){var t=e,{store:n,name:r,form:o,required:i,showOnKeyDown:s=!0,moveOnKeyDown:a=!0,toggleOnPress:l=!0,toggleOnClick:c=l}=t,u=x(t,["store","name","form","required","showOnKeyDown","moveOnKeyDown","toggleOnPress","toggleOnClick"]);const d=jR();D(n=n||d,!1);const p=u.onKeyDown,f=Re(s),h=Re(a),m=n.useState("placement").split("-")[0],g=n.useState("value"),y=Array.isArray(g),w=Se((e=>{var t;if(null==p||p(e),e.defaultPrevented)return;if(!n)return;const{orientation:r,items:o,activeId:i}=n.getState(),s="horizontal"!==r,a="vertical"!==r,l=!!(null==(t=o.find((e=>!e.disabled&&null!=e.value)))?void 0:t.rowId),c={ArrowUp:(l||s)&&qR(n,n.up),ArrowRight:(l||a)&&qR(n,n.next),ArrowDown:(l||s)&&qR(n,n.down),ArrowLeft:(l||a)&&qR(n,n.previous)}[e.key];c&&h(e)&&(e.preventDefault(),n.move(c()));const u="top"===m||"bottom"===m;({ArrowDown:u,ArrowUp:u,ArrowLeft:"left"===m,ArrowRight:"right"===m})[e.key]&&f(e)&&(e.preventDefault(),n.move(i),me(e.currentTarget,"keyup",n.show))}));u=Ie(u,(e=>(0,wt.jsx)(ER,{value:n,children:e})),[n]);const[_,S]=(0,B.useState)(!1),C=(0,B.useRef)(!1);(0,B.useEffect)((()=>{const e=C.current;C.current=!1,e||S(!1)}),[g]);const k=n.useState((e=>{var t;return null==(t=e.labelElement)?void 0:t.id})),j=u["aria-label"],E=u["aria-labelledby"]||k,P=n.useState((e=>{if(r)return e.items})),T=(0,B.useMemo)((()=>[...new Set(null==P?void 0:P.map((e=>e.value)).filter((e=>null!=e)))]),[P]);u=Ie(u,(e=>r?(0,wt.jsxs)(wt.Fragment,{children:[(0,wt.jsxs)("select",{style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"},tabIndex:-1,"aria-hidden":!0,"aria-label":j,"aria-labelledby":E,name:r,form:o,required:i,value:g,multiple:y,onFocus:()=>{var e;return null==(e=null==n?void 0:n.getState().selectElement)?void 0:e.focus()},onChange:e=>{var t;C.current=!0,S(!0),null==n||n.setValue(y?(t=e.target,Array.from(t.selectedOptions).map((e=>e.value))):e.target.value)},children:[ot(g).map((e=>null==e||T.includes(e)?null:(0,wt.jsx)("option",{value:e,children:e},e))),T.map((e=>(0,wt.jsx)("option",{value:e,children:e},e)))]}),e]}):e),[n,j,E,r,o,i,g,y,T]);const R=(0,wt.jsxs)(wt.Fragment,{children:[g,(0,wt.jsx)($R,{})]}),I=n.useState("contentElement");return u=b(v({role:"combobox","aria-autocomplete":"none","aria-labelledby":k,"aria-haspopup":ne(I,"listbox"),"data-autofill":_||void 0,"data-name":r,children:R},u),{ref:ke(n.setSelectElement,u.ref),onKeyDown:w}),u=LR(v({store:n,toggleOnClick:c},u)),u=KR(v({store:n},u))})),XR=_t((function(e){return Ct("button",YR(e))})),ZR=(0,B.createContext)(null),QR=kt((function(e){var t=e,{store:n,resetOnEscape:r=!0,hideOnEnter:o=!0,focusOnMove:i=!0,composite:s,alwaysVisible:a}=t,l=x(t,["store","resetOnEscape","hideOnEnter","focusOnMove","composite","alwaysVisible"]);const c=CR();D(n=n||c,!1);const u=je(l.id),d=n.useState("value"),p=Array.isArray(d),[f,h]=(0,B.useState)(d),m=n.useState("mounted");(0,B.useEffect)((()=>{m||h(d)}),[m,d]),r=r&&!p;const g=l.onKeyDown,y=Re(r),w=Re(o),_=Se((e=>{null==g||g(e),e.defaultPrevented||("Escape"===e.key&&y(e)&&(null==n||n.setValue(f))," "!==e.key&&"Enter"!==e.key||ce(e)&&w(e)&&(e.preventDefault(),null==n||n.hide()))})),S=(0,B.useContext)(TR),C=(0,B.useState)(),[k,j]=S||C,E=(0,B.useMemo)((()=>[k,j]),[k]),[P,T]=(0,B.useState)(null),R=(0,B.useContext)(ZR);(0,B.useEffect)((()=>{if(R)return R(n),()=>R(null)}),[R,n]),l=Ie(l,(e=>(0,wt.jsx)(ER,{value:n,children:(0,wt.jsx)(ZR.Provider,{value:T,children:(0,wt.jsx)(TR.Provider,{value:E,children:e})})})),[n,E]);const I=!!n.combobox;s=null!=s?s:!I&&P!==n;const[N,M]=Ce(s?n.setListElement:null),A=function(e,t,n){const[r,o]=(0,B.useState)(n);return ye((()=>{const n=e&&"current"in e?e.current:e;if(!n)return;const r=()=>{const e=n.getAttribute(t);null!=e&&o(e)},i=new MutationObserver(r);return i.observe(n,{attributeFilter:[t]}),r(),()=>i.disconnect()}),[e,t]),r}(N,"role",l.role),O=(s||("listbox"===A||"menu"===A||"tree"===A||"grid"===A))&&p||void 0,z=Fr(m,l.hidden,a),L=z?b(v({},l.style),{display:"none"}):l.style;s&&(l=v({role:"listbox","aria-multiselectable":O},l));const F=n.useState((e=>{var t;return k||(null==(t=e.labelElement)?void 0:t.id)}));return l=b(v({id:u,"aria-labelledby":F,hidden:z},l),{ref:ke(M,l.ref),style:L,onKeyDown:_}),l=ln(b(v({store:n},l),{composite:s})),l=KR(v({store:n,typeahead:!I},l))})),JR=(_t((function(e){return Ct("div",QR(e))})),kt((function(e){var t=e,{store:n,alwaysVisible:r}=t,o=x(t,["store","alwaysVisible"]);const i=jR();return o=QR(v({store:n=n||i,alwaysVisible:r},o)),o=Ni(v({store:n,alwaysVisible:r},o))}))),eI=uo(_t((function(e){return Ct("div",JR(e))})),jR);function tI(e){const t=e.relatedTarget;return(null==t?void 0:t.nodeType)===Node.ELEMENT_NODE?t:null}var nI=Symbol("composite-hover");var rI=kt((function(e){var t=e,{store:n,focusOnHover:r=!0,blurOnHoverEnd:o=!!r}=t,i=x(t,["store","focusOnHover","blurOnHoverEnd"]);const s=Rt();D(n=n||s,!1);const a=Ae(),l=i.onMouseMove,c=Re(r),u=Se((e=>{if(null==l||l(e),!e.defaultPrevented&&a()&&c(e)){if(!Gt(e.currentTarget)){const e=null==n?void 0:n.getState().baseElement;e&&!Ut(e)&&e.focus()}null==n||n.setActiveId(e.currentTarget.id)}})),d=i.onMouseLeave,p=Re(o),f=Se((e=>{var t;null==d||d(e),e.defaultPrevented||a()&&(function(e){const t=tI(e);return!!t&&Y(e.currentTarget,t)}(e)||function(e){let t=tI(e);if(!t)return!1;do{if(N(t,nI)&&t[nI])return!0;t=t.parentElement}while(t);return!1}(e)||c(e)&&p(e)&&(null==n||n.setActiveId(null),null==(t=null==n?void 0:n.getState().baseElement)||t.focus()))})),h=(0,B.useCallback)((e=>{e&&(e[nI]=!0)}),[]);return L(i=b(v({},i),{ref:ke(h,i.ref),onMouseMove:u,onMouseLeave:f}))}));St(_t((function(e){return Ct("div",rI(e))})));var oI=kt((function(e){var t,n=e,{store:r,value:o,getItem:i,hideOnClick:s,setValueOnClick:a=null!=o,preventScrollOnKeyDown:l=!0,focusOnHover:c=!0}=n,u=x(n,["store","value","getItem","hideOnClick","setValueOnClick","preventScrollOnKeyDown","focusOnHover"]);const d=kR();D(r=r||d,!1);const p=je(u.id),f=z(u),h=(0,B.useCallback)((e=>{const t=b(v({},e),{value:f?void 0:o,children:o});return i?i(t):t}),[f,o,i]),m=r.useState((e=>Array.isArray(e.value)));s=null!=s?s:null!=o&&!m;const g=u.onClick,y=Re(a),w=Re(s),_=Se((e=>{null==g||g(e),e.defaultPrevented||de(e)||ue(e)||(y(e)&&null!=o&&(null==r||r.setValue((e=>Array.isArray(e)?e.includes(o)?e.filter((e=>e!==o)):[...e,o]:o))),w(e)&&(null==r||r.hide()))})),S=r.useState((e=>function(e,t){if(null!=t)return null!=e&&(Array.isArray(e)?e.includes(t):e===t)}(e.value,o)));u=Ie(u,(e=>(0,wt.jsx)(PR.Provider,{value:null!=S&&S,children:e})),[S]);const C=r.useState("listElement"),k=r.useState((e=>null!=o&&(null!=e.value&&((e.activeId===p||!(null==r?void 0:r.item(e.activeId)))&&(Array.isArray(e.value)?e.value[e.value.length-1]===o:e.value===o)))));u=b(v({id:p,role:re(C),"aria-selected":S,children:o},u),{autoFocus:null!=(t=u.autoFocus)?t:k,onClick:_}),u=Pn(v({store:r,getItem:h,preventScrollOnKeyDown:l},u));const j=Re(c);return u=rI(b(v({store:r},u),{focusOnHover(e){if(!j(e))return!1;const t=null==r?void 0:r.getState();return!!(null==t?void 0:t.open)}}))})),iI=St(_t((function(e){return Ct("div",oI(e))}))),sI=(0,B.createContext)(!1),aI=(0,wt.jsx)("svg",{display:"block",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,viewBox:"0 0 16 16",height:"1em",width:"1em",children:(0,wt.jsx)("polyline",{points:"4,8 7,12 12,4"})});var lI=kt((function(e){var t=e,{store:n,checked:r}=t,o=x(t,["store","checked"]);const i=(0,B.useContext)(sI),s=function(e){return e.checked?e.children||aI:"function"==typeof e.children?e.children:null}({checked:r=null!=r?r:i,children:o.children});return L(o=b(v({"aria-hidden":!0},o),{children:s,style:v({width:"1em",height:"1em",pointerEvents:"none"},o.style)}))})),cI=(_t((function(e){return Ct("span",lI(e))})),kt((function(e){var t=e,{store:n,checked:r}=t,o=x(t,["store","checked"]);const i=(0,B.useContext)(PR);return r=null!=r?r:i,o=lI(b(v({},o),{checked:r}))}))),uI=_t((function(e){return Ct("span",cI(e))}));const dI="2px",pI="400ms",fI="cubic-bezier( 0.16, 1, 0.3, 1 )",hI={compact:Pl.controlPaddingXSmall,small:Pl.controlPaddingXSmall,default:Pl.controlPaddingX},mI=cl(XR,{shouldForwardProp:e=>"hasCustomRenderProp"!==e,target:"e1p3eej77"})((({size:e,hasCustomRenderProp:t})=>bl("display:block;background-color:",kl.theme.background,";border:none;color:",kl.theme.foreground,";cursor:pointer;font-family:inherit;text-align:start;user-select:none;width:100%;&[data-focus-visible]{outline:none;}",((e,t)=>{const n={compact:{[t]:32,paddingInlineStart:hI.compact,paddingInlineEnd:hI.compact+18},default:{[t]:40,paddingInlineStart:hI.default,paddingInlineEnd:hI.default+18},small:{[t]:24,paddingInlineStart:hI.small,paddingInlineEnd:hI.small+18}};return n[e]||n.default})(e,t?"minHeight":"height")," ",!t&&xI," ",Wv({inputSize:e}),";","")),""),gI=xl({"0%":{opacity:0,transform:`translateY(-${dI})`},"100%":{opacity:1,transform:"translateY(0)"}}),vI=cl(eI,{target:"e1p3eej76"})("display:flex;flex-direction:column;background-color:",kl.theme.background,";border-radius:",Pl.radiusSmall,";border:1px solid ",kl.theme.foreground,";box-shadow:",Pl.elevationMedium,";z-index:1000000;max-height:min( var( --popover-available-height, 400px ), 400px );overflow:auto;overscroll-behavior:contain;min-width:min-content;&[data-open]{@media not ( prefers-reduced-motion ){animation-duration:",pI,";animation-timing-function:",fI,";animation-name:",gI,";will-change:transform,opacity;}}&[data-focus-visible]{outline:none;}"),bI=cl(iI,{target:"e1p3eej75"})((({size:e})=>bl("cursor:default;display:flex;align-items:center;justify-content:space-between;font-size:",Pl.fontSize,";line-height:28px;padding-block:",yl(2),";scroll-margin:",yl(1),";user-select:none;&[aria-disabled='true']{cursor:not-allowed;}&[data-active-item]{background-color:",kl.theme.gray[300],";}",(e=>{const t={compact:{paddingInlineStart:hI.compact,paddingInlineEnd:hI.compact-6},default:{paddingInlineStart:hI.default,paddingInlineEnd:hI.default-6},small:{paddingInlineStart:hI.small,paddingInlineEnd:hI.small-6}};return t[e]||t.default})(e),";","")),""),xI={name:"1h52dri",styles:"overflow:hidden;text-overflow:ellipsis;white-space:nowrap"},yI=cl("div",{target:"e1p3eej74"})(xI,";"),wI=cl("span",{target:"e1p3eej73"})("color:",kl.theme.gray[600],";margin-inline-start:",yl(2),";"),_I=cl("div",{target:"e1p3eej72"})("display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;flex:1;column-gap:",yl(4),";"),SI=cl("span",{target:"e1p3eej71"})("color:",kl.theme.gray[600],";text-align:initial;line-height:",Pl.fontLineHeightBase,";padding-inline-end:",yl(1),";margin-block:",yl(1),";"),CI=cl(uI,{target:"e1p3eej70"})("display:flex;align-items:center;margin-inline-start:",yl(2),";align-self:start;margin-block-start:2px;font-size:0;",_I,"~&,&:not(:empty){font-size:24px;}"),kI=(0,c.createContext)(void 0);function jI(e){return(Array.isArray(e)?0===e.length:null==e)?(0,a.__)("Select an item"):Array.isArray(e)?1===e.length?e[0]:(0,a.sprintf)((0,a.__)("%s items selected"),e.length):e}const EI=({renderSelectedValue:e,size:t="default",store:n,...r})=>{const{value:o}=Qe(n),i=(0,c.useMemo)((()=>null!=e?e:jI),[e]);return(0,wt.jsx)(mI,{...r,size:t,hasCustomRenderProp:!!e,store:n,children:i(o)})};const PI=function(e){const{children:t,hideLabelFromVision:n=!1,label:r,size:o,store:i,className:s,isLegacy:a=!1,...l}=e,u=(0,c.useCallback)((e=>{a&&e.stopPropagation()}),[a]),d=(0,c.useMemo)((()=>({store:i,size:o})),[i,o]);return(0,wt.jsxs)("div",{className:s,children:[(0,wt.jsx)(IR,{store:i,render:n?(0,wt.jsx)(pl,{}):(0,wt.jsx)(Ax.VisualLabel,{as:"div"}),children:r}),(0,wt.jsxs)(ab,{__next40pxDefaultSize:!0,size:o,suffix:(0,wt.jsx)(tS,{}),children:[(0,wt.jsx)(EI,{...l,size:o,store:i,showOnKeyDown:!a}),(0,wt.jsx)(vI,{gutter:12,store:i,sameWidth:!0,slide:!1,onKeyDown:u,flip:!a,children:(0,wt.jsx)(kI.Provider,{value:d,children:t})})]})]})};function TI({children:e,...t}){var n;const r=(0,c.useContext)(kI);return(0,wt.jsxs)(bI,{store:r?.store,size:null!==(n=r?.size)&&void 0!==n?n:"default",...t,children:[null!=e?e:t.value,(0,wt.jsx)(CI,{children:(0,wt.jsx)(J_,{icon:tk})})]})}TI.displayName="CustomSelectControlV2.Item";const RI=TI;function II({__experimentalHint:e,...t}){return{hint:e,...t}}function NI(e,t){return t||(0,a.sprintf)((0,a.__)("Currently selected: %s"),e)}const MI=function e(t){const{__next40pxDefaultSize:n=!1,describedBy:r,options:o,onChange:i,size:a="default",value:c,className:u,showSelectedHint:d=!1,...p}=function({__experimentalShowSelectedHint:e,...t}){return{showSelectedHint:e,...t}}(t),f=(0,l.useInstanceId)(e,"custom-select-control__description"),h=_R({async setValue(e){const t=o.find((t=>t.name===e));if(!i||!t)return;await Promise.resolve();const n=h.getState(),r={highlightedIndex:n.renderedItems.findIndex((t=>t.value===e)),inputValue:"",isOpen:n.open,selectedItem:t,type:""};i(r)},value:c?.name,defaultValue:o[0]?.name}),m=o.map(II).map((({name:e,key:t,hint:n,style:r,className:o})=>{const i=(0,wt.jsxs)(_I,{children:[(0,wt.jsx)("span",{children:e}),(0,wt.jsx)(SI,{className:"components-custom-select-control__item-hint",children:n})]});return(0,wt.jsx)(RI,{value:e,children:n?i:e,style:r,className:s(o,"components-custom-select-control__item",{"has-hint":n})},t)})),{value:g}=h.getState(),v=n&&"default"===a||"__unstable-large"===a?"default":n||"default"!==a?a:"compact";return(0,wt.jsxs)(wt.Fragment,{children:[(0,wt.jsx)(PI,{"aria-describedby":f,renderSelectedValue:d?()=>{const e=o?.map(II)?.find((({name:e})=>g===e))?.hint;return(0,wt.jsxs)(yI,{children:[g,e&&(0,wt.jsx)(wI,{className:"components-custom-select-control__hint",children:e})]})}:void 0,size:v,store:h,className:s("components-custom-select-control",u),isLegacy:!0,...p,children:m}),(0,wt.jsx)(pl,{children:(0,wt.jsx)("span",{id:f,children:NI(g,r)})})]})};function AI(e){const t=Object.prototype.toString.call(e);return e instanceof Date||"object"==typeof e&&"[object Date]"===t?new e.constructor(+e):"number"==typeof e||"[object Number]"===t||"string"==typeof e||"[object String]"===t?new Date(e):new Date(NaN)}function DI(e){const t=AI(e);return t.setHours(0,0,0,0),t}function OI(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function zI(e,t){const n=AI(e);if(isNaN(t))return OI(e,NaN);if(!t)return n;const r=n.getDate(),o=OI(e,n.getTime());o.setMonth(n.getMonth()+t+1,0);return r>=o.getDate()?o:(n.setFullYear(o.getFullYear(),o.getMonth(),r),n)}function LI(e,t){return zI(e,-t)}const FI={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function BI(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const VI={date:BI({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:BI({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:BI({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},$I={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function HI(e){return(t,n)=>{let r;if("formatting"===(n?.context?String(n.context):"standalone")&&e.formattingValues){const t=e.defaultFormattingWidth||e.defaultWidth,o=n?.width?String(n.width):t;r=e.formattingValues[o]||e.formattingValues[t]}else{const t=e.defaultWidth,o=n?.width?String(n.width):e.defaultWidth;r=e.values[o]||e.values[t]}return r[e.argumentCallback?e.argumentCallback(t):t]}}const WI={ordinalNumber:(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:HI({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:HI({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:HI({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:HI({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:HI({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})};function UI(e){return(t,n={})=>{const r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(o);if(!i)return null;const s=i[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(a)?function(e,t){for(let n=0;ne.test(s))):function(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n;return}(a,(e=>e.test(s)));let c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;return{value:c,rest:t.slice(s.length)}}}const GI={ordinalNumber:(KI={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)},(e,t={})=>{const n=e.match(KI.matchPattern);if(!n)return null;const r=n[0],o=e.match(KI.parsePattern);if(!o)return null;let i=KI.valueCallback?KI.valueCallback(o[0]):o[0];return i=t.valueCallback?t.valueCallback(i):i,{value:i,rest:e.slice(r.length)}}),era:UI({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:UI({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:UI({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:UI({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:UI({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})};var KI;const qI={code:"en-US",formatDistance:(e,t,n)=>{let r;const o=FI[e];return r="string"==typeof o?o:1===t?o.one:o.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},formatLong:VI,formatRelative:(e,t,n,r)=>$I[e],localize:WI,match:GI,options:{weekStartsOn:0,firstWeekContainsDate:1}};let YI={};function XI(){return YI}Math.pow(10,8);const ZI=6048e5;function QI(e){const t=AI(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function JI(e,t){const n=DI(e),r=DI(t),o=+n-QI(n),i=+r-QI(r);return Math.round((o-i)/864e5)}function eN(e){const t=AI(e),n=OI(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function tN(e){const t=AI(e);return JI(t,eN(t))+1}function nN(e,t){const n=XI(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=AI(e),i=o.getDay(),s=(i=o.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}function iN(e){const t=oN(e),n=OI(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),rN(n)}function sN(e){const t=AI(e),n=+rN(t)-+iN(t);return Math.round(n/ZI)+1}function aN(e,t){const n=AI(e),r=n.getFullYear(),o=XI(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,s=OI(e,0);s.setFullYear(r+1,0,i),s.setHours(0,0,0,0);const a=nN(s,t),l=OI(e,0);l.setFullYear(r,0,i),l.setHours(0,0,0,0);const c=nN(l,t);return n.getTime()>=a.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function lN(e,t){const n=XI(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,o=aN(e,t),i=OI(e,0);i.setFullYear(o,0,r),i.setHours(0,0,0,0);return nN(i,t)}function cN(e,t){const n=AI(e),r=+nN(n,t)-+lN(n,t);return Math.round(r/ZI)+1}function uN(e,t){return(e<0?"-":"")+Math.abs(e).toString().padStart(t,"0")}const dN={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return uN("yy"===t?r%100:r,t.length)},M(e,t){const n=e.getMonth();return"M"===t?String(n+1):uN(n+1,2)},d:(e,t)=>uN(e.getDate(),t.length),a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:(e,t)=>uN(e.getHours()%12||12,t.length),H:(e,t)=>uN(e.getHours(),t.length),m:(e,t)=>uN(e.getMinutes(),t.length),s:(e,t)=>uN(e.getSeconds(),t.length),S(e,t){const n=t.length,r=e.getMilliseconds();return uN(Math.trunc(r*Math.pow(10,n-3)),t.length)}},pN="midnight",fN="noon",hN="morning",mN="afternoon",gN="evening",vN="night",bN={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if("yo"===t){const t=e.getFullYear(),r=t>0?t:1-t;return n.ordinalNumber(r,{unit:"year"})}return dN.y(e,t)},Y:function(e,t,n,r){const o=aN(e,r),i=o>0?o:1-o;if("YY"===t){return uN(i%100,2)}return"Yo"===t?n.ordinalNumber(i,{unit:"year"}):uN(i,t.length)},R:function(e,t){return uN(oN(e),t.length)},u:function(e,t){return uN(e.getFullYear(),t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return uN(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return uN(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return dN.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return uN(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const o=cN(e,r);return"wo"===t?n.ordinalNumber(o,{unit:"week"}):uN(o,t.length)},I:function(e,t,n){const r=sN(e);return"Io"===t?n.ordinalNumber(r,{unit:"week"}):uN(r,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getDate(),{unit:"date"}):dN.d(e,t)},D:function(e,t,n){const r=tN(e);return"Do"===t?n.ordinalNumber(r,{unit:"dayOfYear"}):uN(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const o=e.getDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return uN(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const o=e.getDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return uN(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),o=0===r?7:r;switch(t){case"i":return String(o);case"ii":return uN(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let o;switch(o=12===r?fN:0===r?pN:r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let o;switch(o=r>=17?gN:r>=12?mN:r>=4?hN:vN,t){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){let t=e.getHours()%12;return 0===t&&(t=12),n.ordinalNumber(t,{unit:"hour"})}return dN.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getHours(),{unit:"hour"}):dN.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return"Ko"===t?n.ordinalNumber(r,{unit:"hour"}):uN(r,t.length)},k:function(e,t,n){let r=e.getHours();return 0===r&&(r=24),"ko"===t?n.ordinalNumber(r,{unit:"hour"}):uN(r,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):dN.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getSeconds(),{unit:"second"}):dN.s(e,t)},S:function(e,t){return dN.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(0===r)return"Z";switch(t){case"X":return yN(r);case"XXXX":case"XX":return wN(r);default:return wN(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return yN(r);case"xxxx":case"xx":return wN(r);default:return wN(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+xN(r,":");default:return"GMT"+wN(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+xN(r,":");default:return"GMT"+wN(r,":")}},t:function(e,t,n){return uN(Math.trunc(e.getTime()/1e3),t.length)},T:function(e,t,n){return uN(e.getTime(),t.length)}};function xN(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),i=r%60;return 0===i?n+String(o):n+String(o)+t+uN(i,2)}function yN(e,t){if(e%60==0){return(e>0?"-":"+")+uN(Math.abs(e)/60,2)}return wN(e,t)}function wN(e,t=""){const n=e>0?"-":"+",r=Math.abs(e);return n+uN(Math.trunc(r/60),2)+t+uN(r%60,2)}const _N=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},SN=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},CN={p:SN,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return _N(e,t);let i;switch(r){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;default:i=t.dateTime({width:"full"})}return i.replace("{{date}}",_N(r,t)).replace("{{time}}",SN(o,t))}},kN=/^D+$/,jN=/^Y+$/,EN=["D","DD","YY","YYYY"];function PN(e){return e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e)}function TN(e){if(!PN(e)&&"number"!=typeof e)return!1;const t=AI(e);return!isNaN(Number(t))}const RN=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,IN=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,NN=/^'([^]*?)'?$/,MN=/''/g,AN=/[a-zA-Z]/;function DN(e,t,n){const r=XI(),o=n?.locale??r.locale??qI,i=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,s=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,a=AI(e);if(!TN(a))throw new RangeError("Invalid time value");let l=t.match(IN).map((e=>{const t=e[0];if("p"===t||"P"===t){return(0,CN[t])(e,o.formatLong)}return e})).join("").match(RN).map((e=>{if("''"===e)return{isToken:!1,value:"'"};const t=e[0];if("'"===t)return{isToken:!1,value:ON(e)};if(bN[t])return{isToken:!0,value:e};if(t.match(AN))throw new RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}}));o.localize.preprocessor&&(l=o.localize.preprocessor(a,l));const c={firstWeekContainsDate:i,weekStartsOn:s,locale:o};return l.map((r=>{if(!r.isToken)return r.value;const i=r.value;(!n?.useAdditionalWeekYearTokens&&function(e){return jN.test(e)}(i)||!n?.useAdditionalDayOfYearTokens&&function(e){return kN.test(e)}(i))&&function(e,t,n){const r=function(e,t,n){const r="Y"===e[0]?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}(e,t,n);if(console.warn(r),EN.includes(e))throw new RangeError(r)}(i,t,String(e));return(0,bN[i[0]])(a,i,o.localize,c)})).join("")}function ON(e){const t=e.match(NN);return t?t[1].replace(MN,"'"):e}function zN(e,t){const n=AI(e),r=AI(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function LN(e,t){return+AI(e)==+AI(t)}function FN(e,t){return+DI(e)==+DI(t)}function BN(e,t){const n=AI(e);return isNaN(t)?OI(e,NaN):t?(n.setDate(n.getDate()+t),n):n}function VN(e,t){return BN(e,7*t)}function $N(e,t){return VN(e,-t)}function HN(e,t){const n=XI(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=AI(e),i=o.getDay(),s=6+(ir.getTime()}function qN(e,t){return+AI(e)<+AI(t)}function YN(e){const t=AI(e),n=t.getFullYear(),r=t.getMonth(),o=OI(e,0);return o.setFullYear(n,r+1,0),o.setHours(0,0,0,0),o.getDate()}function XN(e,t){const n=AI(e),r=n.getFullYear(),o=n.getDate(),i=OI(e,0);i.setFullYear(r,t,15),i.setHours(0,0,0,0);const s=YN(i);return n.setMonth(t,Math.min(o,s)),n}function ZN(e,t){let n=AI(e);return isNaN(+n)?OI(e,NaN):(null!=t.year&&n.setFullYear(t.year),null!=t.month&&(n=XN(n,t.month)),null!=t.date&&n.setDate(t.date),null!=t.hours&&n.setHours(t.hours),null!=t.minutes&&n.setMinutes(t.minutes),null!=t.seconds&&n.setSeconds(t.seconds),null!=t.milliseconds&&n.setMilliseconds(t.milliseconds),n)}function QN(){return DI(Date.now())}function JN(e,t){const n=AI(e);return isNaN(+n)?OI(e,NaN):(n.setFullYear(t),n)}function eM(e,t){return zI(e,12*t)}function tM(e,t){return eM(e,-t)}function nM(e,t){const n=AI(e.start),r=AI(e.end);let o=+n>+r;const i=o?+n:+r,s=o?r:n;s.setHours(0,0,0,0);let a=t?.step??1;if(!a)return[];a<0&&(a=-a,o=!o);const l=[];for(;+s<=i;)l.push(AI(s)),s.setDate(s.getDate()+a),s.setHours(0,0,0,0);return o?l.reverse():l}function rM(e,t){const n=AI(e.start),r=AI(e.end);let o=+n>+r;const i=o?+n:+r,s=o?r:n;s.setHours(0,0,0,0),s.setDate(1);let a=t?.step??1;if(!a)return[];a<0&&(a=-a,o=!o);const l=[];for(;+s<=i;)l.push(AI(s)),s.setMonth(s.getMonth()+a);return o?l.reverse():l}function oM(e){const t=AI(e);return t.setDate(1),t.setHours(0,0,0,0),t}function iM(e){const t=AI(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function sM(e,t){const n=AI(e.start),r=AI(e.end);let o=+n>+r;const i=nN(o?r:n,t),s=nN(o?n:r,t);i.setHours(15),s.setHours(15);const a=+s.getTime();let l=i,c=t?.step??1;if(!c)return[];c<0&&(c=-c,o=!o);const u=[];for(;+l<=a;)l.setHours(0),u.push(AI(l)),l=VN(l,c),l.setHours(15);return o?u.reverse():u}let aM=function(e){return e[e.SUNDAY=0]="SUNDAY",e[e.MONDAY=1]="MONDAY",e[e.TUESDAY=2]="TUESDAY",e[e.WEDNESDAY=3]="WEDNESDAY",e[e.THURSDAY=4]="THURSDAY",e[e.FRIDAY=5]="FRIDAY",e[e.SATURDAY=6]="SATURDAY",e}({});const lM=(e,t,n)=>(LN(e,t)||KN(e,t))&&(LN(e,n)||qN(e,n)),cM=e=>ZN(e,{hours:0,minutes:0,seconds:0,milliseconds:0}),uM=cl("div",{target:"e105ri6r5"})(_x,";"),dM=cl(ny,{target:"e105ri6r4"})("margin-bottom:",yl(4),";"),pM=cl(dk,{target:"e105ri6r3"})("font-size:",Pl.fontSize,";font-weight:",Pl.fontWeight,";strong{font-weight:",Pl.fontWeightHeading,";}"),fM=cl("div",{target:"e105ri6r2"})("column-gap:",yl(2),";display:grid;grid-template-columns:0.5fr repeat( 5, 1fr ) 0.5fr;justify-items:center;row-gap:",yl(2),";"),hM=cl("div",{target:"e105ri6r1"})("color:",kl.theme.gray[700],";font-size:",Pl.fontSize,";line-height:",Pl.fontLineHeightBase,";&:nth-of-type( 1 ){justify-self:start;}&:nth-of-type( 7 ){justify-self:end;}"),mM=cl($x,{shouldForwardProp:e=>!["column","isSelected","isToday","hasEvents"].includes(e),target:"e105ri6r0"})("grid-column:",(e=>e.column),";position:relative;justify-content:center;",(e=>1===e.column&&"\n\t\tjustify-self: start;\n\t\t")," ",(e=>7===e.column&&"\n\t\tjustify-self: end;\n\t\t")," ",(e=>e.disabled&&"\n\t\tpointer-events: none;\n\t\t")," &&&{border-radius:",Pl.radiusRound,";height:",yl(7),";width:",yl(7),";",(e=>e.isSelected&&`\n\t\t\t\tbackground: ${kl.theme.accent};\n\n\t\t\t\t&,\n\t\t\t\t&:hover:not(:disabled, [aria-disabled=true]) {\n\t\t\t\t\tcolor: ${kl.theme.accentInverted};\n\t\t\t\t}\n\n\t\t\t\t&:focus:not(:disabled),\n\t\t\t\t&:focus:not(:disabled) {\n\t\t\t\t\tborder: ${Pl.borderWidthFocus} solid currentColor;\n\t\t\t\t}\n\n\t\t\t\t/* Highlight the selected day for high-contrast mode */\n\t\t\t\t&::after {\n\t\t\t\t\tcontent: '';\n\t\t\t\t\tposition: absolute;\n\t\t\t\t\tpointer-events: none;\n\t\t\t\t\tinset: 0;\n\t\t\t\t\tborder-radius: inherit;\n\t\t\t\t\tborder: 1px solid transparent;\n\t\t\t\t}\n\t\t\t`)," ",(e=>!e.isSelected&&e.isToday&&`\n\t\t\tbackground: ${kl.theme.gray[200]};\n\t\t\t`),";}",(e=>e.hasEvents&&`\n\t\t::before {\n\t\t\tborder: 2px solid ${e.isSelected?kl.theme.accentInverted:kl.theme.accent};\n\t\t\tborder-radius: ${Pl.radiusRound};\n\t\t\tcontent: " ";\n\t\t\tleft: 50%;\n\t\t\tposition: absolute;\n\t\t\ttransform: translate(-50%, 9px);\n\t\t}\n\t\t`),";");function gM(e){return"string"==typeof e?new Date(e):AI(e)}function vM(e,t){return t?(e%12+12)%24:e%12}function bM(e){return(t,n)=>{const r={...t};return n.type!==ix&&n.type!==fx&&n.type!==dx||void 0!==r.value&&(r.value=r.value.toString().padStart(e,"0")),r}}function xM(e){var t;const n=null!==(t=e.target?.ownerDocument.defaultView?.HTMLInputElement)&&void 0!==t?t:HTMLInputElement;return e.target instanceof n&&e.target.validity.valid}const yM="yyyy-MM-dd'T'HH:mm:ss";function wM({day:e,column:t,isSelected:n,isFocusable:r,isFocusAllowed:o,isToday:i,isInvalid:s,numEvents:a,onClick:l,onKeyDown:u}){const d=(0,c.useRef)();return(0,c.useEffect)((()=>{d.current&&r&&o&&d.current.focus()}),[r]),(0,wt.jsx)(mM,{ref:d,className:"components-datetime__date__day",disabled:s,tabIndex:r?0:-1,"aria-label":_M(e,n,a),column:t,isSelected:n,isToday:i,hasEvents:a>0,onClick:l,onKeyDown:u,children:(0,GN.dateI18n)("j",e,-e.getTimezoneOffset())})}function _M(e,t,n){const{formats:r}=(0,GN.getSettings)(),o=(0,GN.dateI18n)(r.date,e,-e.getTimezoneOffset());return t&&n>0?(0,a.sprintf)((0,a._n)("%1$s. Selected. There is %2$d event","%1$s. Selected. There are %2$d events",n),o,n):t?(0,a.sprintf)((0,a.__)("%1$s. Selected"),o):n>0?(0,a.sprintf)((0,a._n)("%1$s. There is %2$d event","%1$s. There are %2$d events",n),o,n):o}const SM=function({currentDate:e,onChange:t,events:n=[],isInvalidDate:r,onMonthPreviewed:o,startOfWeek:i=0}){const s=e?gM(e):new Date,{calendar:l,viewing:u,setSelected:d,setViewing:p,isSelected:f,viewPreviousMonth:h,viewNextMonth:m}=(({weekStartsOn:e=aM.SUNDAY,viewing:t=new Date,selected:n=[],numberOfMonths:r=1}={})=>{const[o,i]=(0,c.useState)(t),s=(0,c.useCallback)((()=>i(QN())),[i]),a=(0,c.useCallback)((e=>i((t=>XN(t,e)))),[]),l=(0,c.useCallback)((()=>i((e=>LI(e,1)))),[]),u=(0,c.useCallback)((()=>i((e=>zI(e,1)))),[]),d=(0,c.useCallback)((e=>i((t=>JN(t,e)))),[]),p=(0,c.useCallback)((()=>i((e=>tM(e,1)))),[]),f=(0,c.useCallback)((()=>i((e=>eM(e,1)))),[]),[h,m]=(0,c.useState)(n.map(cM)),g=(0,c.useCallback)((e=>h.findIndex((t=>LN(t,e)))>-1),[h]),v=(0,c.useCallback)(((e,t)=>{m(t?Array.isArray(e)?e:[e]:t=>t.concat(Array.isArray(e)?e:[e]))}),[]),b=(0,c.useCallback)((e=>m((t=>Array.isArray(e)?t.filter((t=>!e.map((e=>e.getTime())).includes(t.getTime()))):t.filter((t=>!LN(t,e)))))),[]),x=(0,c.useCallback)(((e,t)=>g(e)?b(e):v(e,t)),[b,g,v]),y=(0,c.useCallback)(((e,t,n)=>{m(n?nM({start:e,end:t}):n=>n.concat(nM({start:e,end:t})))}),[]),w=(0,c.useCallback)(((e,t)=>{m((n=>n.filter((n=>!nM({start:e,end:t}).map((e=>e.getTime())).includes(n.getTime())))))}),[]),_=(0,c.useMemo)((()=>rM({start:oM(o),end:iM(zI(o,r-1))}).map((t=>sM({start:oM(t),end:iM(t)},{weekStartsOn:e}).map((t=>nM({start:nN(t,{weekStartsOn:e}),end:HN(t,{weekStartsOn:e})})))))),[o,e,r]);return{clearTime:cM,inRange:lM,viewing:o,setViewing:i,viewToday:s,viewMonth:a,viewPreviousMonth:l,viewNextMonth:u,viewYear:d,viewPreviousYear:p,viewNextYear:f,selected:h,setSelected:m,clearSelected:()=>m([]),isSelected:g,select:v,deselect:b,toggle:x,selectRange:y,deselectRange:w,calendar:_}})({selected:[DI(s)],viewing:DI(s),weekStartsOn:i}),[g,v]=(0,c.useState)(DI(s)),[b,x]=(0,c.useState)(!1),[y,w]=(0,c.useState)(e);return e!==y&&(w(e),d([DI(s)]),p(DI(s)),v(DI(s))),(0,wt.jsxs)(uM,{className:"components-datetime__date",role:"application","aria-label":(0,a.__)("Calendar"),children:[(0,wt.jsxs)(dM,{children:[(0,wt.jsx)($x,{icon:(0,a.isRTL)()?WN:UN,variant:"tertiary","aria-label":(0,a.__)("View previous month"),onClick:()=>{h(),v(LI(g,1)),o?.(DN(LI(u,1),yM))},size:"compact"}),(0,wt.jsxs)(pM,{level:3,children:[(0,wt.jsx)("strong",{children:(0,GN.dateI18n)("F",u,-u.getTimezoneOffset())})," ",(0,GN.dateI18n)("Y",u,-u.getTimezoneOffset())]}),(0,wt.jsx)($x,{icon:(0,a.isRTL)()?UN:WN,variant:"tertiary","aria-label":(0,a.__)("View next month"),onClick:()=>{m(),v(zI(g,1)),o?.(DN(zI(u,1),yM))},size:"compact"})]}),(0,wt.jsxs)(fM,{onFocus:()=>x(!0),onBlur:()=>x(!1),children:[l[0][0].map((e=>(0,wt.jsx)(hM,{children:(0,GN.dateI18n)("D",e,-e.getTimezoneOffset())},e.toString()))),l[0].map((e=>e.map(((e,i)=>zN(e,u)?(0,wt.jsx)(wM,{day:e,column:i+1,isSelected:f(e),isFocusable:LN(e,g),isFocusAllowed:b,isToday:FN(e,new Date),isInvalid:!!r&&r(e),numEvents:n.filter((t=>FN(t.date,e))).length,onClick:()=>{d([e]),v(e),t?.(DN(new Date(e.getFullYear(),e.getMonth(),e.getDate(),s.getHours(),s.getMinutes(),s.getSeconds(),s.getMilliseconds()),yM))},onKeyDown:t=>{let n;"ArrowLeft"===t.key&&(n=BN(e,(0,a.isRTL)()?1:-1)),"ArrowRight"===t.key&&(n=BN(e,(0,a.isRTL)()?-1:1)),"ArrowUp"===t.key&&(n=$N(e,1)),"ArrowDown"===t.key&&(n=VN(e,1)),"PageUp"===t.key&&(n=LI(e,1)),"PageDown"===t.key&&(n=zI(e,1)),"Home"===t.key&&(n=nN(e)),"End"===t.key&&(n=DI(HN(e))),n&&(t.preventDefault(),v(n),zN(n,u)||(p(n),o?.(DN(n,yM))))}},e.toString()):null))))]})]})};function CM(e){const t=AI(e);return t.setSeconds(0,0),t}const kM=cl("div",{target:"evcr2319"})("box-sizing:border-box;font-size:",Pl.fontSize,";"),jM=cl("fieldset",{target:"evcr2318"})("border:0;margin:0 0 ",yl(4)," 0;padding:0;&:last-child{margin-bottom:0;}"),EM=cl("div",{target:"evcr2317"})({name:"pd0mhc",styles:"direction:ltr;display:flex"}),PM=bl("&&& ",Yv,"{padding-left:",yl(2),";padding-right:",yl(2),";text-align:center;}",""),TM=cl(iy,{target:"evcr2316"})(PM," width:",yl(9),";&&& ",Yv,"{padding-right:0;}&&& ",zv,"{border-right:0;border-top-right-radius:0;border-bottom-right-radius:0;}"),RM=cl("span",{target:"evcr2315"})("border-top:",Pl.borderWidth," solid ",kl.gray[700],";border-bottom:",Pl.borderWidth," solid ",kl.gray[700],";font-size:",Pl.fontSize,";line-height:calc(\n\t\t",Pl.controlHeight," - ",Pl.borderWidth," * 2\n\t);display:inline-block;"),IM=cl(iy,{target:"evcr2314"})(PM," width:",yl(9),";&&& ",Yv,"{padding-left:0;}&&& ",zv,"{border-left:0;border-top-left-radius:0;border-bottom-left-radius:0;}"),NM=cl("div",{target:"evcr2313"})({name:"1ff36h2",styles:"flex-grow:1"}),MM=cl(iy,{target:"evcr2312"})(PM," width:",yl(9),";"),AM=cl(iy,{target:"evcr2311"})(PM," width:",yl(14),";"),DM=cl("div",{target:"evcr2310"})({name:"ebu3jh",styles:"text-decoration:underline dotted"}),OM=()=>{const{timezone:e}=(0,GN.getSettings)(),t=(new Date).getTimezoneOffset()/60*-1;if(Number(e.offset)===t)return null;const n=Number(e.offset)>=0?"+":"",r=""!==e.abbr&&isNaN(Number(e.abbr))?e.abbr:`UTC${n}${e.offsetFormatted}`,o=e.string.replace("_"," "),i="UTC"===e.string?(0,a.__)("Coordinated Universal Time"):`(${r}) ${o}`;return 0===o.trim().length?(0,wt.jsx)(DM,{className:"components-datetime__timezone",children:r}):(0,wt.jsx)(Yi,{placement:"top",text:i,children:(0,wt.jsx)(DM,{className:"components-datetime__timezone",children:r})})};const zM=(0,c.forwardRef)((function(e,t){const{label:n,...r}=e,o=r["aria-label"]||n;return(0,wt.jsx)(T_,{...r,"aria-label":o,ref:t,children:n})}));function LM({value:e,defaultValue:t,is12Hour:n,label:r,minutesProps:o,onChange:i}){const[l={hours:(new Date).getHours(),minutes:(new Date).getMinutes()},u]=c_({value:e,onChange:i,defaultValue:t}),d=l.hours<12?"AM":"PM";const p=l.hours%12||12;const f=e=>(t,{event:r})=>{if(!xM(r))return;const o=Number(t);u({...l,[e]:"hours"===e&&n?vM(o,"PM"===d):o})};const h=r?jM:c.Fragment;return(0,wt.jsxs)(h,{children:[r&&(0,wt.jsx)(Ax.VisualLabel,{as:"legend",children:r}),(0,wt.jsxs)(ny,{alignment:"left",expanded:!1,children:[(0,wt.jsxs)(EM,{className:"components-datetime__time-field components-datetime__time-field-time",children:[(0,wt.jsx)(TM,{className:"components-datetime__time-field-hours-input",label:(0,a.__)("Hours"),hideLabelFromVision:!0,__next40pxDefaultSize:!0,value:String(n?p:l.hours).padStart(2,"0"),step:1,min:n?1:0,max:n?12:23,required:!0,spinControls:"none",isPressEnterToChange:!0,isDragEnabled:!1,isShiftStepEnabled:!1,onChange:f("hours"),__unstableStateReducer:bM(2)}),(0,wt.jsx)(RM,{className:"components-datetime__time-separator","aria-hidden":"true",children:":"}),(0,wt.jsx)(IM,{className:s("components-datetime__time-field-minutes-input",o?.className),label:(0,a.__)("Minutes"),hideLabelFromVision:!0,__next40pxDefaultSize:!0,value:String(l.minutes).padStart(2,"0"),step:1,min:0,max:59,required:!0,spinControls:"none",isPressEnterToChange:!0,isDragEnabled:!1,isShiftStepEnabled:!1,onChange:(...e)=>{f("minutes")(...e),o?.onChange?.(...e)},__unstableStateReducer:bM(2),...o})]}),n&&(0,wt.jsxs)(p_,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,isBlock:!0,label:(0,a.__)("Select AM or PM"),hideLabelFromVision:!0,value:d,onChange:e=>{var t;(t=e,()=>{d!==t&&u({...l,hours:vM(p,"PM"===t)})})()},children:[(0,wt.jsx)(zM,{value:"AM",label:(0,a.__)("AM")}),(0,wt.jsx)(zM,{value:"PM",label:(0,a.__)("PM")})]})]})]})}const FM=["dmy","mdy","ymd"];function BM({is12Hour:e,currentTime:t,onChange:n,dateOrder:r,hideLabelFromVision:o=!1}){const[i,s]=(0,c.useState)((()=>t?CM(gM(t)):new Date));(0,c.useEffect)((()=>{s(t?CM(gM(t)):new Date)}),[t]);const l=[{value:"01",label:(0,a.__)("January")},{value:"02",label:(0,a.__)("February")},{value:"03",label:(0,a.__)("March")},{value:"04",label:(0,a.__)("April")},{value:"05",label:(0,a.__)("May")},{value:"06",label:(0,a.__)("June")},{value:"07",label:(0,a.__)("July")},{value:"08",label:(0,a.__)("August")},{value:"09",label:(0,a.__)("September")},{value:"10",label:(0,a.__)("October")},{value:"11",label:(0,a.__)("November")},{value:"12",label:(0,a.__)("December")}],{day:u,month:d,year:p,minutes:f,hours:h}=(0,c.useMemo)((()=>({day:DN(i,"dd"),month:DN(i,"MM"),year:DN(i,"yyyy"),minutes:DN(i,"mm"),hours:DN(i,"HH"),am:DN(i,"a")})),[i]),m=e=>(t,{event:r})=>{if(!xM(r))return;const o=Number(t),a=ZN(i,{[e]:o});s(a),n?.(DN(a,yM))},g=(0,wt.jsx)(MM,{className:"components-datetime__time-field components-datetime__time-field-day",label:(0,a.__)("Day"),hideLabelFromVision:!0,__next40pxDefaultSize:!0,value:u,step:1,min:1,max:31,required:!0,spinControls:"none",isPressEnterToChange:!0,isDragEnabled:!1,isShiftStepEnabled:!1,onChange:m("date")},"day"),v=(0,wt.jsx)(NM,{children:(0,wt.jsx)(oS,{className:"components-datetime__time-field components-datetime__time-field-month",label:(0,a.__)("Month"),hideLabelFromVision:!0,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:d,options:l,onChange:e=>{const t=XN(i,Number(e)-1);s(t),n?.(DN(t,yM))}})},"month"),b=(0,wt.jsx)(AM,{className:"components-datetime__time-field components-datetime__time-field-year",label:(0,a.__)("Year"),hideLabelFromVision:!0,__next40pxDefaultSize:!0,value:p,step:1,min:1,max:9999,required:!0,spinControls:"none",isPressEnterToChange:!0,isDragEnabled:!1,isShiftStepEnabled:!1,onChange:m("year"),__unstableStateReducer:bM(4)},"year"),x=e?"mdy":"dmy",y=(r&&FM.includes(r)?r:x).split("").map((e=>{switch(e){case"d":return g;case"m":return v;case"y":return b;default:return null}}));return(0,wt.jsxs)(kM,{className:"components-datetime__time",children:[(0,wt.jsxs)(jM,{children:[o?(0,wt.jsx)(pl,{as:"legend",children:(0,a.__)("Time")}):(0,wt.jsx)(Ax.VisualLabel,{as:"legend",className:"components-datetime__time-legend",children:(0,a.__)("Time")}),(0,wt.jsxs)(ny,{className:"components-datetime__time-wrapper",children:[(0,wt.jsx)(LM,{value:{hours:Number(h),minutes:Number(f)},is12Hour:e,onChange:({hours:e,minutes:t})=>{const r=ZN(i,{hours:e,minutes:t});s(r),n?.(DN(r,yM))}}),(0,wt.jsx)(jg,{}),(0,wt.jsx)(OM,{})]})]}),(0,wt.jsxs)(jM,{children:[o?(0,wt.jsx)(pl,{as:"legend",children:(0,a.__)("Date")}):(0,wt.jsx)(Ax.VisualLabel,{as:"legend",className:"components-datetime__time-legend",children:(0,a.__)("Date")}),(0,wt.jsx)(ny,{className:"components-datetime__time-wrapper",children:y})]})]})}BM.TimeInput=LM,Object.assign(BM.TimeInput,{displayName:"TimePicker.TimeInput"});const VM=BM;const $M=cl(lk,{target:"e1p5onf00"})({name:"1khn195",styles:"box-sizing:border-box"}),HM=()=>{};const WM=(0,c.forwardRef)((function({currentDate:e,is12Hour:t,dateOrder:n,isInvalidDate:r,onMonthPreviewed:o=HM,onChange:i,events:s,startOfWeek:a},l){return(0,wt.jsx)($M,{ref:l,className:"components-datetime",spacing:4,children:(0,wt.jsxs)(wt.Fragment,{children:[(0,wt.jsx)(VM,{currentTime:e,onChange:i,is12Hour:t,dateOrder:n}),(0,wt.jsx)(SM,{currentDate:e,onChange:i,isInvalidDate:r,events:s,onMonthPreviewed:o,startOfWeek:a})]})})})),UM=WM,GM=[{name:(0,a._x)("None","Size of a UI element"),slug:"none"},{name:(0,a._x)("Small","Size of a UI element"),slug:"small"},{name:(0,a._x)("Medium","Size of a UI element"),slug:"medium"},{name:(0,a._x)("Large","Size of a UI element"),slug:"large"},{name:(0,a._x)("Extra Large","Size of a UI element"),slug:"xlarge"}],KM={BaseControl:{_overrides:{__associatedWPComponentName:"DimensionControl"}}};const qM=function(e){const{__next40pxDefaultSize:t=!1,__nextHasNoMarginBottom:n=!1,label:r,value:o,sizes:i=GM,icon:l,onChange:c,className:u=""}=e;Fi()("wp.components.DimensionControl",{since:"6.7",version:"7.0"});const d=(0,wt.jsxs)(wt.Fragment,{children:[l&&(0,wt.jsx)(Fx,{icon:l}),r]});return(0,wt.jsx)(is,{value:KM,children:(0,wt.jsx)(oS,{__next40pxDefaultSize:t,__nextHasNoMarginBottom:n,className:s(u,"block-editor-dimension-control"),label:d,hideLabelFromVision:!1,value:o,onChange:e=>{const t=((e,t)=>e.find((e=>t===e.slug)))(i,e);t&&o!==t.slug?"function"==typeof c&&c(t.slug):c?.(void 0)},options:(e=>{const t=e.map((({name:e,slug:t})=>({label:e,value:t})));return[{label:(0,a.__)("Default"),value:""},...t]})(i)})})};const YM={name:"u2jump",styles:"position:relative;pointer-events:none;&::after{content:'';position:absolute;top:0;right:0;bottom:0;left:0;}*{pointer-events:none;}"},XM=(0,c.createContext)(!1),{Consumer:ZM,Provider:QM}=XM;function JM({className:e,children:t,isDisabled:n=!0,...r}){const o=qa();return(0,wt.jsx)(QM,{value:n,children:(0,wt.jsx)("div",{inert:n?"true":void 0,className:n?o(YM,e,"components-disabled"):void 0,...r,children:t})})}JM.Context=XM,JM.Consumer=ZM;const eA=JM,tA=(0,c.forwardRef)((({visible:e,children:t,...n},r)=>{const o=Ln({open:e});return(0,wt.jsx)($r,{store:o,ref:r,...n,children:t})})),nA="is-dragging-components-draggable";const rA=function({children:e,onDragStart:t,onDragOver:n,onDragEnd:r,appendToOwnerDocument:o=!1,cloneClassname:i,elementId:s,transferData:a,__experimentalTransferDataType:u="text",__experimentalDragComponent:d}){const p=(0,c.useRef)(null),f=(0,c.useRef)((()=>{}));return(0,c.useEffect)((()=>()=>{f.current()}),[]),(0,wt.jsxs)(wt.Fragment,{children:[e({onDraggableStart:function(e){const{ownerDocument:r}=e.target;e.dataTransfer.setData(u,JSON.stringify(a));const c=r.createElement("div");c.style.top="0",c.style.left="0";const d=r.createElement("div");"function"==typeof e.dataTransfer.setDragImage&&(d.classList.add("components-draggable__invisible-drag-image"),r.body.appendChild(d),e.dataTransfer.setDragImage(d,0,0)),c.classList.add("components-draggable__clone"),i&&c.classList.add(i);let h=0,m=0;if(p.current){h=e.clientX,m=e.clientY,c.style.transform=`translate( ${h}px, ${m}px )`;const t=r.createElement("div");t.innerHTML=p.current.innerHTML,c.appendChild(t),r.body.appendChild(c)}else{const e=r.getElementById(s),t=e.getBoundingClientRect(),n=e.parentNode,i=t.top,a=t.left;c.style.width=`${t.width+0}px`;const l=e.cloneNode(!0);l.id=`clone-${s}`,h=a-0,m=i-0,c.style.transform=`translate( ${h}px, ${m}px )`,Array.from(l.querySelectorAll("iframe")).forEach((e=>e.parentNode?.removeChild(e))),c.appendChild(l),o?r.body.appendChild(c):n?.appendChild(c)}let g=e.clientX,v=e.clientY;const b=(0,l.throttle)((function(e){if(g===e.clientX&&v===e.clientY)return;const t=h+e.clientX-g,r=m+e.clientY-v;c.style.transform=`translate( ${t}px, ${r}px )`,g=e.clientX,v=e.clientY,h=t,m=r,n&&n(e)}),16);r.addEventListener("dragover",b),r.body.classList.add(nA),t&&t(e),f.current=()=>{c&&c.parentNode&&c.parentNode.removeChild(c),d&&d.parentNode&&d.parentNode.removeChild(d),r.body.classList.remove(nA),r.removeEventListener("dragover",b)}},onDraggableEnd:function(e){e.preventDefault(),f.current(),r&&r(e)}}),d&&(0,wt.jsx)("div",{className:"components-draggable-drag-component-root",style:{display:"none"},ref:p,children:d})]})},oA=(0,wt.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,wt.jsx)(n.Path,{d:"M18.5 15v3.5H13V6.7l4.5 4.1 1-1.1-6.2-5.8-5.8 5.8 1 1.1 4-4v11.7h-6V15H4v5h16v-5z"})});const iA=function({className:e,label:t,onFilesDrop:n,onHTMLDrop:r,onDrop:o,...i}){const[u,d]=(0,c.useState)(),[p,f]=(0,c.useState)(),[h,m]=(0,c.useState)(),g=(0,l.__experimentalUseDropZone)({onDrop(e){const t=e.dataTransfer?(0,fT.getFilesFromDataTransfer)(e.dataTransfer):[],i=e.dataTransfer?.getData("text/html");i&&r?r(i):t.length&&n?n(t):o&&o(e)},onDragStart(e){d(!0);let t="default";e.dataTransfer?.types.includes("text/html")?t="html":(e.dataTransfer?.types.includes("Files")||(e.dataTransfer?(0,fT.getFilesFromDataTransfer)(e.dataTransfer):[]).length>0)&&(t="file"),m(t)},onDragEnd(){f(!1),d(!1),m(void 0)},onDragEnter(){f(!0)},onDragLeave(){f(!1)}}),v=s("components-drop-zone",e,{"is-active":(u||p)&&("file"===h&&n||"html"===h&&r||"default"===h&&o),"is-dragging-over-document":u,"is-dragging-over-element":p,[`is-dragging-${h}`]:!!h});return(0,wt.jsx)("div",{...i,ref:g,className:v,children:(0,wt.jsx)("div",{className:"components-drop-zone__content",children:(0,wt.jsxs)("div",{className:"components-drop-zone__content-inner",children:[(0,wt.jsx)(J_,{icon:oA,className:"components-drop-zone__content-icon"}),(0,wt.jsx)("span",{className:"components-drop-zone__content-text",children:t||(0,a.__)("Drop files to upload")})]})})})};function sA({children:e}){return Fi()("wp.components.DropZoneProvider",{since:"5.8",hint:"wp.component.DropZone no longer needs a provider. wp.components.DropZoneProvider is safe to remove from your code."}),e}const aA=(0,wt.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,wt.jsx)(n.Path,{d:"M5 17.7c.4.5.8.9 1.2 1.2l1.1-1.4c-.4-.3-.7-.6-1-1L5 17.7zM5 6.3l1.4 1.1c.3-.4.6-.7 1-1L6.3 5c-.5.4-.9.8-1.3 1.3zm.1 7.8l-1.7.5c.2.6.4 1.1.7 1.6l1.5-.8c-.2-.4-.4-.8-.5-1.3zM4.8 12v-.7L3 11.1v1.8l1.7-.2c.1-.2.1-.5.1-.7zm3 7.9c.5.3 1.1.5 1.6.7l.5-1.7c-.5-.1-.9-.3-1.3-.5l-.8 1.5zM19 6.3c-.4-.5-.8-.9-1.2-1.2l-1.1 1.4c.4.3.7.6 1 1L19 6.3zm-.1 3.6l1.7-.5c-.2-.6-.4-1.1-.7-1.6l-1.5.8c.2.4.4.8.5 1.3zM5.6 8.6l-1.5-.8c-.3.5-.5 1-.7 1.6l1.7.5c.1-.5.3-.9.5-1.3zm2.2-4.5l.8 1.5c.4-.2.8-.4 1.3-.5l-.5-1.7c-.6.2-1.1.4-1.6.7zm8.8 13.5l1.1 1.4c.5-.4.9-.8 1.2-1.2l-1.4-1.1c-.2.3-.5.6-.9.9zm1.8-2.2l1.5.8c.3-.5.5-1.1.7-1.6l-1.7-.5c-.1.5-.3.9-.5 1.3zm2.6-4.3l-1.7.2v1.4l1.7.2V12v-.9zM11.1 3l.2 1.7h1.4l.2-1.7h-1.8zm3 2.1c.5.1.9.3 1.3.5l.8-1.5c-.5-.3-1.1-.5-1.6-.7l-.5 1.7zM12 19.2h-.7l-.2 1.8h1.8l-.2-1.7c-.2-.1-.5-.1-.7-.1zm2.1-.3l.5 1.7c.6-.2 1.1-.4 1.6-.7l-.8-1.5c-.4.2-.8.4-1.3.5z"})});function lA(e=[],t="90deg"){const n=100/e.length,r=e.map(((e,t)=>`${e} ${t*n}%, ${e} ${(t+1)*n}%`)).join(", ");return`linear-gradient( ${t}, ${r} )`}pv([fv]);const cA=function({values:e}){return e?(0,wt.jsx)(A_,{colorValue:lA(e,"135deg")}):(0,wt.jsx)(Fx,{icon:aA})};function uA({label:e,value:t,colors:n,disableCustomColors:r,enableAlpha:o,onChange:i}){const[s,u]=(0,c.useState)(!1),d=(0,l.useInstanceId)(uA,"color-list-picker-option"),p=`${d}__label`,f=`${d}__content`;return(0,wt.jsxs)(wt.Fragment,{children:[(0,wt.jsx)($x,{className:"components-color-list-picker__swatch-button",onClick:()=>u((e=>!e)),"aria-expanded":s,"aria-controls":f,children:(0,wt.jsxs)(ny,{justify:"flex-start",spacing:2,children:[t?(0,wt.jsx)(A_,{colorValue:t,className:"components-color-list-picker__swatch-color"}):(0,wt.jsx)(Fx,{icon:aA}),(0,wt.jsx)("span",{id:p,children:e})]})}),(0,wt.jsx)("div",{role:"group",id:f,"aria-labelledby":p,"aria-hidden":!s,children:s&&(0,wt.jsx)(_k,{"aria-label":(0,a.__)("Color options"),className:"components-color-list-picker__color-picker",colors:n,value:t,clearable:!1,onChange:i,disableCustomColors:r,enableAlpha:o})})]})}const dA=function({colors:e,labels:t,value:n=[],disableCustomColors:r,enableAlpha:o,onChange:i}){return(0,wt.jsx)("div",{className:"components-color-list-picker",children:t.map(((t,s)=>(0,wt.jsx)(uA,{label:t,value:n[s],colors:e,disableCustomColors:r,enableAlpha:o,onChange:e=>{const t=n.slice();t[s]=e,i(t)}},s)))})},pA=["#333","#CCC"];function fA({value:e,onChange:t}){const n=!!e,r=n?e:pA,o=lA(r),i=(s=r).map(((e,t)=>({position:100*t/(s.length-1),color:e})));var s;return(0,wt.jsx)(GP,{disableInserter:!0,background:o,hasGradient:n,value:i,onChange:e=>{const n=function(e=[]){return e.map((({color:e})=>e))}(e);t(n)}})}const hA=function({asButtons:e,loop:t,clearable:n=!0,unsetable:r=!0,colorPalette:o,duotonePalette:i,disableCustomColors:s,disableCustomDuotone:l,value:u,onChange:d,"aria-label":p,"aria-labelledby":f,...h}){const[m,g]=(0,c.useMemo)((()=>{return!(e=o)||e.length<2?["#000","#fff"]:e.map((({color:e})=>({color:e,brightness:uv(e).brightness()}))).reduce((([e,t],n)=>[n.brightness<=e.brightness?n:e,n.brightness>=t.brightness?n:t]),[{brightness:1,color:""},{brightness:0,color:""}]).map((({color:e})=>e));var e}),[o]),v="unset"===u,b=(0,a.__)("Unset"),x=(0,wt.jsx)(ak.Option,{value:"unset",isSelected:v,tooltipText:b,"aria-label":b,className:"components-duotone-picker__color-indicator",onClick:()=>{d(v?void 0:"unset")}},"unset"),y=i.map((({colors:e,slug:t,name:n})=>{const r={background:lA(e,"135deg"),color:"transparent"},o=null!=n?n:(0,a.sprintf)((0,a.__)("Duotone code: %s"),t),i=n?(0,a.sprintf)((0,a.__)("Duotone: %s"),n):o,s=Ji()(e,u);return(0,wt.jsx)(ak.Option,{value:e,isSelected:s,"aria-label":i,tooltipText:o,style:r,onClick:()=>{d(s?void 0:e)}},t)}));let w;if(e)w={asButtons:!0};else{const e={asButtons:!1,loop:t};w=p?{...e,"aria-label":p}:f?{...e,"aria-labelledby":f}:{...e,"aria-label":(0,a.__)("Custom color picker.")}}const _=r?[x,...y]:y;return(0,wt.jsx)(ak,{...h,...w,options:_,actions:!!n&&(0,wt.jsx)(ak.ButtonAction,{onClick:()=>d(void 0),children:(0,a.__)("Clear")}),children:(0,wt.jsx)(jg,{paddingTop:0===_.length?0:4,children:(0,wt.jsxs)(lk,{spacing:3,children:[!s&&!l&&(0,wt.jsx)(fA,{value:v?void 0:u,onChange:d}),!l&&(0,wt.jsx)(dA,{labels:[(0,a.__)("Shadows"),(0,a.__)("Highlights")],colors:o,value:v?void 0:u,disableCustomColors:s,enableAlpha:!0,onChange:e=>{e[0]||(e[0]=m),e[1]||(e[1]=g);const t=e.length>=2?e:void 0;d(t)}})]})})})};const mA=(0,c.forwardRef)((function(e,t){const{href:n,children:r,className:o,rel:i="",...l}=e,c=[...new Set([...i.split(" "),"external","noreferrer","noopener"].filter(Boolean))].join(" "),u=s("components-external-link",o),d=!!n?.startsWith("#");return(0,wt.jsxs)("a",{...l,className:u,href:n,onClick:t=>{d&&t.preventDefault(),e.onClick&&e.onClick(t)},target:"_blank",rel:c,ref:t,children:[(0,wt.jsx)("span",{className:"components-external-link__contents",children:r}),(0,wt.jsx)("span",{className:"components-external-link__icon","aria-label":(0,a.__)("(opens in a new tab)"),children:"↗"})]})})),gA={width:200,height:170},vA=["avi","mpg","mpeg","mov","mp4","m4v","ogg","ogv","webm","wmv"];function bA(e){return Math.round(100*e)}const xA=cl("div",{target:"eeew7dm8"})({name:"jqnsxy",styles:"background-color:transparent;display:flex;text-align:center;width:100%"}),yA=cl("div",{target:"eeew7dm7"})("align-items:center;border-radius:",Pl.radiusSmall,";cursor:pointer;display:inline-flex;justify-content:center;margin:auto;position:relative;height:100%;&:after{border-radius:inherit;bottom:0;box-shadow:inset 0 0 0 1px rgba( 0, 0, 0, 0.1 );content:'';left:0;pointer-events:none;position:absolute;right:0;top:0;}img,video{border-radius:inherit;box-sizing:border-box;display:block;height:auto;margin:0;max-height:100%;max-width:100%;pointer-events:none;user-select:none;width:auto;}"),wA=cl("div",{target:"eeew7dm6"})("background:",kl.gray[100],";border-radius:inherit;box-sizing:border-box;height:",gA.height,"px;max-width:280px;min-width:",gA.width,"px;width:100%;"),_A=cl(Zk,{target:"eeew7dm5"})({name:"1d3w5wq",styles:"width:100%"});var SA={name:"1mn7kwb",styles:"padding-bottom:1em"};const CA=({__nextHasNoMarginBottom:e})=>e?void 0:SA;var kA={name:"1mn7kwb",styles:"padding-bottom:1em"};const jA=({hasHelpText:e=!1})=>e?kA:void 0,EA=cl(mg,{target:"eeew7dm4"})("max-width:320px;padding-top:1em;",jA," ",CA,";"),PA=cl("div",{target:"eeew7dm3"})("left:50%;overflow:hidden;pointer-events:none;position:absolute;top:50%;transform:translate3d( -50%, -50%, 0 );z-index:1;@media not ( prefers-reduced-motion ){transition:opacity 100ms linear;}opacity:",(({showOverlay:e})=>e?1:0),";"),TA=cl("div",{target:"eeew7dm2"})({name:"1yzbo24",styles:"background:rgba( 255, 255, 255, 0.4 );backdrop-filter:blur( 16px ) saturate( 180% );position:absolute;transform:translateZ( 0 )"}),RA=cl(TA,{target:"eeew7dm1"})({name:"1sw8ur",styles:"height:1px;left:1px;right:1px"}),IA=cl(TA,{target:"eeew7dm0"})({name:"188vg4t",styles:"width:1px;top:1px;bottom:1px"}),NA=()=>{};function MA({__nextHasNoMarginBottom:e,hasHelpText:t,onChange:n=NA,point:r={x:.5,y:.5}}){const o=bA(r.x),i=bA(r.y),s=(e,t)=>{if(void 0===e)return;const o=parseInt(e,10);isNaN(o)||n({...r,[t]:o/100})};return(0,wt.jsxs)(EA,{className:"focal-point-picker__controls",__nextHasNoMarginBottom:e,hasHelpText:t,gap:4,children:[(0,wt.jsx)(AA,{label:(0,a.__)("Left"),"aria-label":(0,a.__)("Focal point left position"),value:[o,"%"].join(""),onChange:e=>s(e,"x"),dragDirection:"e"}),(0,wt.jsx)(AA,{label:(0,a.__)("Top"),"aria-label":(0,a.__)("Focal point top position"),value:[i,"%"].join(""),onChange:e=>s(e,"y"),dragDirection:"s"})]})}function AA(e){return(0,wt.jsx)(_A,{__next40pxDefaultSize:!0,className:"focal-point-picker__controls-position-unit-control",labelPosition:"top",max:100,min:0,units:[{value:"%",label:"%"}],...e})}const DA=cl("div",{target:"e19snlhg0"})("background-color:transparent;cursor:grab;height:40px;margin:-20px 0 0 -20px;position:absolute;user-select:none;width:40px;will-change:transform;z-index:10000;background:rgba( 255, 255, 255, 0.4 );border:1px solid rgba( 255, 255, 255, 0.4 );border-radius:",Pl.radiusRound,";backdrop-filter:blur( 16px ) saturate( 180% );box-shadow:rgb( 0 0 0 / 10% ) 0px 0px 8px;@media not ( prefers-reduced-motion ){transition:transform 100ms linear;}",(({isDragging:e})=>e&&"\n\t\t\tbox-shadow: rgb( 0 0 0 / 12% ) 0px 0px 10px;\n\t\t\ttransform: scale( 1.1 );\n\t\t\tcursor: grabbing;\n\t\t\t"),";");function OA({left:e="50%",top:t="50%",...n}){const r={left:e,top:t};return(0,wt.jsx)(DA,{...n,className:"components-focal-point-picker__icon_container",style:r})}function zA({bounds:e,...t}){return(0,wt.jsxs)(PA,{...t,className:"components-focal-point-picker__grid",style:{width:e.width,height:e.height},children:[(0,wt.jsx)(RA,{style:{top:"33%"}}),(0,wt.jsx)(RA,{style:{top:"66%"}}),(0,wt.jsx)(IA,{style:{left:"33%"}}),(0,wt.jsx)(IA,{style:{left:"66%"}})]})}function LA({alt:e,autoPlay:t,src:n,onLoad:r,mediaRef:o,muted:i=!0,...s}){if(!n)return(0,wt.jsx)(wA,{className:"components-focal-point-picker__media components-focal-point-picker__media--placeholder",ref:o,...s});return function(e=""){return!!e&&(e.startsWith("data:video/")||vA.includes(function(e=""){const t=e.split(".");return t[t.length-1]}(e)))}(n)?(0,wt.jsx)("video",{...s,autoPlay:t,className:"components-focal-point-picker__media components-focal-point-picker__media--video",loop:!0,muted:i,onLoadedData:r,ref:o,src:n}):(0,wt.jsx)("img",{...s,alt:e,className:"components-focal-point-picker__media components-focal-point-picker__media--image",onLoad:r,ref:o,src:n})}const FA=function e({__nextHasNoMarginBottom:t,autoPlay:n=!0,className:r,help:o,label:i,onChange:u,onDrag:d,onDragEnd:p,onDragStart:f,resolvePoint:h,url:m,value:g={x:.5,y:.5},...v}){const[b,x]=(0,c.useState)(g),[y,w]=(0,c.useState)(!1),{startDrag:_,endDrag:S,isDragging:C}=(0,l.__experimentalUseDragging)({onDragStart:e=>{E.current?.focus();const t=I(e);t&&(f?.(t,e),x(t))},onDragMove:e=>{e.preventDefault();const t=I(e);t&&(d?.(t,e),x(t))},onDragEnd:()=>{p?.(),u?.(b)}}),{x:k,y:j}=C?b:g,E=(0,c.useRef)(null),[P,T]=(0,c.useState)(gA),R=(0,c.useRef)((()=>{if(!E.current)return;const{clientWidth:e,clientHeight:t}=E.current;T(e>0&&t>0?{width:e,height:t}:{...gA})}));(0,c.useEffect)((()=>{const e=R.current;if(!E.current)return;const{defaultView:t}=E.current.ownerDocument;return t?.addEventListener("resize",e),()=>t?.removeEventListener("resize",e)}),[]),(0,l.useIsomorphicLayoutEffect)((()=>{R.current()}),[]);const I=({clientX:e,clientY:t,shiftKey:n})=>{if(!E.current)return;const{top:r,left:o}=E.current.getBoundingClientRect();let i=(e-o)/P.width,s=(t-r)/P.height;return n&&(i=.1*Math.round(i/.1),s=.1*Math.round(s/.1)),N({x:i,y:s})},N=e=>{var t;const n=null!==(t=h?.(e))&&void 0!==t?t:e;n.x=Math.max(0,Math.min(n.x,1)),n.y=Math.max(0,Math.min(n.y,1));const r=e=>Math.round(100*e)/100;return{x:r(n.x),y:r(n.y)}},M={left:void 0!==k?k*P.width:.5*P.width,top:void 0!==j?j*P.height:.5*P.height},A=s("components-focal-point-picker-control",r),D=`inspector-focal-point-picker-control-${(0,l.useInstanceId)(e)}`;return ns((()=>{w(!0);const e=window.setTimeout((()=>{w(!1)}),600);return()=>window.clearTimeout(e)}),[k,j]),(0,wt.jsxs)(Ax,{...v,__nextHasNoMarginBottom:t,__associatedWPComponentName:"FocalPointPicker",label:i,id:D,help:o,className:A,children:[(0,wt.jsx)(xA,{className:"components-focal-point-picker-wrapper",children:(0,wt.jsxs)(yA,{className:"components-focal-point-picker",onKeyDown:e=>{const{code:t,shiftKey:n}=e;if(!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(t))return;e.preventDefault();const r={x:k,y:j},o=n?.1:.01,i="ArrowUp"===t||"ArrowLeft"===t?-1*o:o,s="ArrowUp"===t||"ArrowDown"===t?"y":"x";r[s]=r[s]+i,u?.(N(r))},onMouseDown:_,onBlur:()=>{C&&S()},ref:E,role:"button",tabIndex:-1,children:[(0,wt.jsx)(zA,{bounds:P,showOverlay:y}),(0,wt.jsx)(LA,{alt:(0,a.__)("Media preview"),autoPlay:n,onLoad:R.current,src:m}),(0,wt.jsx)(OA,{...M,isDragging:C})]})}),(0,wt.jsx)(MA,{__nextHasNoMarginBottom:t,hasHelpText:!!o,point:{x:k,y:j},onChange:e=>{u?.(N(e))}})]})};function BA({iframeRef:e,...t}){const n=(0,l.useMergeRefs)([e,(0,l.useFocusableIframe)()]);return Fi()("wp.components.FocusableIframe",{since:"5.9",alternative:"wp.compose.useFocusableIframe"}),(0,wt.jsx)("iframe",{ref:n,...t})}const VA=(0,wt.jsxs)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,wt.jsx)(n.Path,{d:"m19 7.5h-7.628c-.3089-.87389-1.1423-1.5-2.122-1.5-.97966 0-1.81309.62611-2.12197 1.5h-2.12803v1.5h2.12803c.30888.87389 1.14231 1.5 2.12197 1.5.9797 0 1.8131-.62611 2.122-1.5h7.628z"}),(0,wt.jsx)(n.Path,{d:"m19 15h-2.128c-.3089-.8739-1.1423-1.5-2.122-1.5s-1.8131.6261-2.122 1.5h-7.628v1.5h7.628c.3089.8739 1.1423 1.5 2.122 1.5s1.8131-.6261 2.122-1.5h2.128z"})]});function $A(e){const[t,...n]=e;if(!t)return null;const[,r]=Wk(t.size);return n.every((e=>{const[,t]=Wk(e.size);return t===r}))?r:null}const HA=cl("fieldset",{target:"e8tqeku4"})({name:"1t1ytme",styles:"border:0;margin:0;padding:0"}),WA=cl(ny,{target:"e8tqeku3"})("height:",yl(4),";"),UA=cl($x,{target:"e8tqeku2"})("margin-top:",yl(-1),";"),GA=cl(Ax.VisualLabel,{target:"e8tqeku1"})("display:flex;gap:",yl(1),";justify-content:flex-start;margin-bottom:0;"),KA=cl("span",{target:"e8tqeku0"})("color:",kl.gray[700],";"),qA={key:"default",name:(0,a.__)("Default"),value:void 0},YA={key:"custom",name:(0,a.__)("Custom")},XA=e=>{var t;const{__next40pxDefaultSize:n,fontSizes:r,value:o,disableCustomFontSizes:i,size:s,onChange:l,onSelectCustom:c}=e,u=!!$A(r),d=[qA,...r.map((e=>{let t;if(u){const[n]=Wk(e.size);void 0!==n&&(t=String(n))}else(function(e){return/^[\d\.]+(px|em|rem|vw|vh|%|svw|lvw|dvw|svh|lvh|dvh|vi|svi|lvi|dvi|vb|svb|lvb|dvb|vmin|svmin|lvmin|dvmin|vmax|svmax|lvmax|dvmax)?$/i.test(String(e))})(e.size)&&(t=String(e.size));return{key:e.slug,name:e.name||e.slug,value:e.size,hint:t}})),...i?[]:[YA]],p=o?null!==(t=d.find((e=>e.value===o)))&&void 0!==t?t:YA:qA;return(0,wt.jsx)(MI,{__next40pxDefaultSize:n,className:"components-font-size-picker__select",label:(0,a.__)("Font size"),hideLabelFromVision:!0,describedBy:(0,a.sprintf)((0,a.__)("Currently selected font size: %s"),p.name),options:d,value:p,showSelectedHint:!0,onChange:({selectedItem:e})=>{e===YA?c():l(e.value)},size:s})},ZA=[(0,a.__)("S"),(0,a.__)("M"),(0,a.__)("L"),(0,a.__)("XL"),(0,a.__)("XXL")],QA=[(0,a.__)("Small"),(0,a.__)("Medium"),(0,a.__)("Large"),(0,a.__)("Extra Large"),(0,a.__)("Extra Extra Large")],JA=e=>{const{fontSizes:t,value:n,__next40pxDefaultSize:r,size:o,onChange:i}=e;return(0,wt.jsx)(p_,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:r,label:(0,a.__)("Font size"),hideLabelFromVision:!0,value:n,onChange:i,isBlock:!0,size:o,children:t.map(((e,t)=>(0,wt.jsx)(zM,{value:e.size,label:ZA[t],"aria-label":e.name||QA[t],showTooltip:!0},e.slug)))})},eD=["px","em","rem","vw","vh"],tD=(0,c.forwardRef)(((e,t)=>{const{__next40pxDefaultSize:n=!1,fallbackFontSize:r,fontSizes:o=[],disableCustomFontSizes:i=!1,onChange:s,size:l="default",units:u=eD,value:d,withSlider:p=!1,withReset:f=!0}=e,h=Uk({availableUnits:u}),m=o.find((e=>e.size===d)),g=!!d&&!m,[v,b]=(0,c.useState)(g);let x;x=!i&&v?"custom":o.length>5?"select":"togglegroup";const y=(0,c.useMemo)((()=>{switch(x){case"custom":return(0,a.__)("Custom");case"togglegroup":if(m)return m.name||QA[o.indexOf(m)];break;case"select":const e=$A(o);if(e)return`(${e})`}return""}),[x,m,o]);if(0===o.length&&i)return null;const w="string"==typeof d||"string"==typeof o[0]?.size,[_,S]=Wk(d,h),C=!!S&&["em","rem","vw","vh"].includes(S),k=void 0===d;return(0,wt.jsxs)(HA,{ref:t,className:"components-font-size-picker",children:[(0,wt.jsx)(pl,{as:"legend",children:(0,a.__)("Font size")}),(0,wt.jsx)(jg,{children:(0,wt.jsxs)(WA,{className:"components-font-size-picker__header",children:[(0,wt.jsxs)(GA,{"aria-label":`${(0,a.__)("Size")} ${y||""}`,children:[(0,a.__)("Size"),y&&(0,wt.jsx)(KA,{className:"components-font-size-picker__header__hint",children:y})]}),!i&&(0,wt.jsx)(UA,{label:"custom"===x?(0,a.__)("Use size preset"):(0,a.__)("Set custom size"),icon:VA,onClick:()=>b(!v),isPressed:"custom"===x,size:"small"})]})}),(0,wt.jsxs)("div",{children:["select"===x&&(0,wt.jsx)(XA,{__next40pxDefaultSize:n,fontSizes:o,value:d,disableCustomFontSizes:i,size:l,onChange:e=>{void 0===e?s?.(void 0):s?.(w?e:Number(e),o.find((t=>t.size===e)))},onSelectCustom:()=>b(!0)}),"togglegroup"===x&&(0,wt.jsx)(JA,{fontSizes:o,value:d,__next40pxDefaultSize:n,size:l,onChange:e=>{void 0===e?s?.(void 0):s?.(w?e:Number(e),o.find((t=>t.size===e)))}}),"custom"===x&&(0,wt.jsxs)(mg,{className:"components-font-size-picker__custom-size-control",children:[(0,wt.jsx)(Tg,{isBlock:!0,children:(0,wt.jsx)(Zk,{__next40pxDefaultSize:n,label:(0,a.__)("Custom"),labelPosition:"top",hideLabelFromVision:!0,value:d,onChange:e=>{b(!0),s?.(void 0===e?void 0:w?e:parseInt(e,10))},size:l,units:w?h:[],min:0})}),p&&(0,wt.jsx)(Tg,{isBlock:!0,children:(0,wt.jsx)(jg,{marginX:2,marginBottom:0,children:(0,wt.jsx)(KS,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:n,className:"components-font-size-picker__custom-input",label:(0,a.__)("Custom Size"),hideLabelFromVision:!0,value:_,initialPosition:r,withInputField:!1,onChange:e=>{b(!0),s?.(void 0===e?void 0:w?e+(null!=S?S:"px"):e)},min:0,max:C?10:100,step:C?.1:1})})}),f&&(0,wt.jsx)(Tg,{children:(0,wt.jsx)(Vx,{disabled:k,accessibleWhenDisabled:!0,onClick:()=>{s?.(void 0)},variant:"secondary",__next40pxDefaultSize:!0,size:"__unstable-large"===l||e.__next40pxDefaultSize?"default":"small",children:(0,a.__)("Reset")})})]})]})]})})),nD=tD;const rD=function({accept:e,children:t,multiple:n=!1,onChange:r,onClick:o,render:i,...s}){const a=(0,c.useRef)(null),l=()=>{a.current?.click()},u=i?i({openFileDialog:l}):(0,wt.jsx)($x,{onClick:l,...s,children:t}),d=!(globalThis.window?.navigator.userAgent.includes("Safari")&&!globalThis.window?.navigator.userAgent.includes("Chrome")&&!globalThis.window?.navigator.userAgent.includes("Chromium"))&&e?.includes("image/*")?`${e}, image/heic, image/heif`:e;return(0,wt.jsxs)("div",{className:"components-form-file-upload",children:[u,(0,wt.jsx)("input",{type:"file",ref:a,multiple:n,style:{display:"none"},accept:d,onChange:r,onClick:o,"data-testid":"form-file-upload-input"})]})},oD=()=>{};const iD=(0,c.forwardRef)((function(e,t){const{className:n,checked:r,id:o,disabled:i,onChange:a=oD,...l}=e,c=s("components-form-toggle",n,{"is-checked":r,"is-disabled":i});return(0,wt.jsxs)("span",{className:c,children:[(0,wt.jsx)("input",{className:"components-form-toggle__input",id:o,type:"checkbox",checked:r,onChange:a,disabled:i,...l,ref:t}),(0,wt.jsx)("span",{className:"components-form-toggle__track"}),(0,wt.jsx)("span",{className:"components-form-toggle__thumb"})]})})),sD=iD,aD=()=>{};function lD({value:e,status:t,title:n,displayTransform:r,isBorderless:o=!1,disabled:i=!1,onClickRemove:c=aD,onMouseEnter:u,onMouseLeave:d,messages:p,termPosition:f,termsCount:h}){const m=(0,l.useInstanceId)(lD),g=s("components-form-token-field__token",{"is-error":"error"===t,"is-success":"success"===t,"is-validating":"validating"===t,"is-borderless":o,"is-disabled":i}),v=r(e),b=(0,a.sprintf)((0,a.__)("%1$s (%2$s of %3$s)"),v,f,h);return(0,wt.jsxs)("span",{className:g,onMouseEnter:u,onMouseLeave:d,title:n,children:[(0,wt.jsxs)("span",{className:"components-form-token-field__token-text",id:`components-form-token-field__token-text-${m}`,children:[(0,wt.jsx)(pl,{as:"span",children:b}),(0,wt.jsx)("span",{"aria-hidden":"true",children:v})]}),(0,wt.jsx)($x,{className:"components-form-token-field__remove-token",icon:Ow,onClick:i?void 0:()=>c({value:e}),disabled:i,label:p.remove,"aria-describedby":`components-form-token-field__token-text-${m}`})]})}const cD=({__next40pxDefaultSize:e,hasTokens:t})=>!e&&bl("padding-top:",yl(t?1:.5),";padding-bottom:",yl(t?1:.5),";",""),uD=cl(mg,{target:"ehq8nmi0"})("padding:7px;",_x," ",cD,";"),dD=e=>e;const pD=function e(t){const{autoCapitalize:n,autoComplete:r,maxLength:o,placeholder:i,label:u=(0,a.__)("Add item"),className:d,suggestions:p=[],maxSuggestions:f=100,value:h=[],displayTransform:m=dD,saveTransform:g=e=>e.trim(),onChange:v=()=>{},onInputChange:b=()=>{},onFocus:x,isBorderless:y=!1,disabled:w=!1,tokenizeOnSpace:_=!1,messages:S={added:(0,a.__)("Item added."),removed:(0,a.__)("Item removed."),remove:(0,a.__)("Remove item"),__experimentalInvalid:(0,a.__)("Invalid item")},__experimentalRenderItem:C,__experimentalExpandOnFocus:k=!1,__experimentalValidateInput:j=()=>!0,__experimentalShowHowTo:E=!0,__next40pxDefaultSize:P=!1,__experimentalAutoSelectFirstMatch:T=!1,__nextHasNoMarginBottom:R=!1,tokenizeOnBlur:I=!1}=ob(t);R||Fi()("Bottom margin styles for wp.components.FormTokenField",{since:"6.7",version:"7.0",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version."});const N=(0,l.useInstanceId)(e),[M,A]=(0,c.useState)(""),[D,O]=(0,c.useState)(0),[z,L]=(0,c.useState)(!1),[F,B]=(0,c.useState)(!1),[V,$]=(0,c.useState)(-1),[H,W]=(0,c.useState)(!1),U=(0,l.usePrevious)(p),G=(0,l.usePrevious)(h),K=(0,c.useRef)(null),q=(0,c.useRef)(null),Y=(0,l.useDebounce)(my.speak,500);function X(){K.current?.focus()}function Z(){return K.current===K.current?.ownerDocument.activeElement}function Q(e){if(fe()&&j(M))L(!1),I&&fe()&&ae(M);else{if(A(""),O(0),L(!1),k){const t=e.relatedTarget===q.current;B(t)}else B(!1);$(-1),W(!1)}}function J(e){e.target===q.current&&z&&e.preventDefault()}function ee(e){le(e.value),X()}function te(e){const t=e.value,n=_?/[ ,\t]+/:/[,\t]+/,r=t.split(n),o=r[r.length-1]||"";r.length>1&&se(r.slice(0,-1)),A(o),b(o)}function ne(e){let t=!1;return Z()&&pe()&&(e(),t=!0),t}function re(){const e=de()-1;e>-1&&le(h[e])}function oe(){const e=de();e!function(e){return h.some((t=>ce(e)===ce(t)))}(e))))];if(t.length>0){const e=[...h];e.splice(de(),0,...t),v(e)}}function ae(e){j(e)?(se([e]),(0,my.speak)(S.added,"assertive"),A(""),$(-1),W(!1),B(!k),z&&!I&&X()):(0,my.speak)(S.__experimentalInvalid,"assertive")}function le(e){const t=h.filter((t=>ce(t)!==ce(e)));v(t),(0,my.speak)(S.removed,"assertive")}function ce(e){return"object"==typeof e?e.value:e}function ue(e=M,t=p,n=h,r=f,o=g){let i=o(e);const s=[],a=[],l=n.map((e=>"string"==typeof e?e:e.value));return 0===i.length?t=t.filter((e=>!l.includes(e))):(i=i.toLocaleLowerCase(),t.forEach((e=>{const t=e.toLocaleLowerCase().indexOf(i);-1===l.indexOf(e)&&(0===t?s.push(e):t>0&&a.push(e))})),t=s.concat(a)),t.slice(0,r)}function de(){return h.length-D}function pe(){return 0===M.length}function fe(){return g(M).length>0}function he(e=!0){const t=M.trim().length>1,n=ue(M),r=n.length>0,o=Z()&&k;if(B(o||t&&r),e&&(T&&t&&r?($(0),W(!0)):($(-1),W(!1))),t){const e=r?(0,a.sprintf)((0,a._n)("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",n.length),n.length):(0,a.__)("No results.");Y(e,"assertive")}}function me(e,t,n){const r=ce(e),o="string"!=typeof e?e.status:void 0,i=t+1,s=n.length;return(0,wt.jsx)(Tg,{children:(0,wt.jsx)(lD,{value:r,status:o,title:"string"!=typeof e?e.title:void 0,displayTransform:m,onClickRemove:ee,isBorderless:"string"!=typeof e&&e.isBorderless||y,onMouseEnter:"string"!=typeof e?e.onMouseEnter:void 0,onMouseLeave:"string"!=typeof e?e.onMouseLeave:void 0,disabled:"error"!==o&&w,messages:S,termsCount:s,termPosition:i})},"token-"+r)}(0,c.useEffect)((()=>{z&&!Z()&&X()}),[z]),(0,c.useEffect)((()=>{const e=!rw()(p,U||[]);(e||h!==G)&&he(e)}),[p,U,h,G]),(0,c.useEffect)((()=>{he()}),[M]),(0,c.useEffect)((()=>{he()}),[T]),w&&z&&(L(!1),A(""));const ge=s(d,"components-form-token-field__input-container",{"is-active":z,"is-disabled":w});let ve={className:"components-form-token-field",tabIndex:-1};const be=ue();return w||(ve=Object.assign({},ve,{onKeyDown:gx((function(e){let t=!1;if(!e.defaultPrevented){switch(e.key){case"Backspace":t=ne(re);break;case"Enter":t=ie();break;case"ArrowLeft":t=function(){let e=!1;return pe()&&(O((e=>Math.min(e+1,h.length))),e=!0),e}();break;case"ArrowUp":$((e=>(0===e?ue(M,p,h,f,g).length:e)-1)),W(!0),t=!0;break;case"ArrowRight":t=function(){let e=!1;return pe()&&(O((e=>Math.max(e-1,0))),e=!0),e}();break;case"ArrowDown":$((e=>(e+1)%ue(M,p,h,f,g).length)),W(!0),t=!0;break;case"Delete":t=ne(oe);break;case"Space":_&&(t=ie());break;case"Escape":t=function(e){return e.target instanceof HTMLInputElement&&(A(e.target.value),B(!1),$(-1),W(!1)),!0}(e)}t&&e.preventDefault()}})),onKeyPress:function(e){let t=!1;","===e.key&&(fe()&&ae(M),t=!0);t&&e.preventDefault()},onFocus:function(e){Z()||e.target===q.current?(L(!0),B(k||F)):L(!1),"function"==typeof x&&x(e)}})),(0,wt.jsxs)("div",{...ve,children:[u&&(0,wt.jsx)(Ex,{htmlFor:`components-form-token-input-${N}`,className:"components-form-token-field__label",children:u}),(0,wt.jsxs)("div",{ref:q,className:ge,tabIndex:-1,onMouseDown:J,onTouchStart:J,children:[(0,wt.jsx)(uD,{justify:"flex-start",align:"center",gap:1,wrap:!0,__next40pxDefaultSize:P,hasTokens:!!h.length,children:function(){const e=h.map(me);return e.splice(de(),0,function(){const e={instanceId:N,autoCapitalize:n,autoComplete:r,placeholder:0===h.length?i:"",disabled:w,value:M,onBlur:Q,isExpanded:F,selectedSuggestionIndex:V};return(0,wt.jsx)(UT,{...e,onChange:o&&h.length>=o?void 0:te,ref:K},"input")}()),e}()}),F&&(0,wt.jsx)(KT,{instanceId:N,match:g(M),displayTransform:m,suggestions:be,selectedIndex:V,scrollIntoView:H,onHover:function(e){const t=ue().indexOf(e);t>=0&&($(t),W(!1))},onSelect:function(e){ae(e)},__experimentalRenderItem:C})]}),!R&&(0,wt.jsx)(jg,{marginBottom:2}),E&&(0,wt.jsx)(Rx,{id:`components-form-token-suggestions-howto-${N}`,className:"components-form-token-field__help",__nextHasNoMarginBottom:R,children:_?(0,a.__)("Separate with commas, spaces, or the Enter key."):(0,a.__)("Separate with commas or the Enter key.")})]})},fD=()=>(0,wt.jsx)(n.SVG,{width:"8",height:"8",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,wt.jsx)(n.Circle,{cx:"4",cy:"4",r:"4"})});function hD({currentPage:e,numberOfPages:t,setCurrentPage:n}){return(0,wt.jsx)("ul",{className:"components-guide__page-control","aria-label":(0,a.__)("Guide controls"),children:Array.from({length:t}).map(((r,o)=>(0,wt.jsx)("li",{"aria-current":o===e?"step":void 0,children:(0,wt.jsx)($x,{icon:(0,wt.jsx)(fD,{}),"aria-label":(0,a.sprintf)((0,a.__)("Page %1$d of %2$d"),o+1,t),onClick:()=>n(o)},o)},o)))})}const mD=function({children:e,className:t,contentLabel:n,finishButtonText:r=(0,a.__)("Finish"),onFinish:o,pages:i=[]}){const l=(0,c.useRef)(null),[u,d]=(0,c.useState)(0);var p;(0,c.useEffect)((()=>{const e=l.current?.querySelector(".components-guide");e instanceof HTMLElement&&e.focus()}),[u]),(0,c.useEffect)((()=>{c.Children.count(e)&&Fi()("Passing children to ",{since:"5.5",alternative:"the `pages` prop"})}),[e]),c.Children.count(e)&&(i=null!==(p=c.Children.map(e,(e=>({content:e}))))&&void 0!==p?p:[]);const f=u>0,h=u{f&&d(u-1)},g=()=>{h&&d(u+1)};return 0===i.length?null:(0,wt.jsx)(mR,{className:s("components-guide",t),contentLabel:n,isDismissible:i.length>1,onRequestClose:o,onKeyDown:e=>{"ArrowLeft"===e.code?(m(),e.preventDefault()):"ArrowRight"===e.code&&(g(),e.preventDefault())},ref:l,children:(0,wt.jsxs)("div",{className:"components-guide__container",children:[(0,wt.jsxs)("div",{className:"components-guide__page",children:[i[u].image,i.length>1&&(0,wt.jsx)(hD,{currentPage:u,numberOfPages:i.length,setCurrentPage:d}),i[u].content]}),(0,wt.jsxs)("div",{className:"components-guide__footer",children:[f&&(0,wt.jsx)($x,{className:"components-guide__back-button",variant:"tertiary",onClick:m,__next40pxDefaultSize:!0,children:(0,a.__)("Previous")}),h&&(0,wt.jsx)($x,{className:"components-guide__forward-button",variant:"primary",onClick:g,__next40pxDefaultSize:!0,children:(0,a.__)("Next")}),!h&&(0,wt.jsx)($x,{className:"components-guide__finish-button",variant:"primary",onClick:o,__next40pxDefaultSize:!0,children:r})]})]})})};function gD(e){return(0,c.useEffect)((()=>{Fi()("",{since:"5.5",alternative:"the `pages` prop in "})}),[]),(0,wt.jsx)("div",{...e})}const vD=(0,c.forwardRef)((function({label:e,labelPosition:t,size:n,tooltip:r,...o},i){return Fi()("wp.components.IconButton",{since:"5.4",alternative:"wp.components.Button",version:"6.2"}),(0,wt.jsx)($x,{...o,ref:i,tooltipPosition:t,iconSize:n,showTooltip:void 0!==r?!!r:void 0,label:r||e})}));function bD(e){const{as:t,className:n,onClick:r,role:o="listitem",size:i,...s}=Ya(e,"Item"),{spacedAround:a,size:l}=MP(),u=i||l,d=t||(void 0!==r?"button":"div"),p=qa(),f=(0,c.useMemo)((()=>p(("button"===d||"a"===d)&&(e=>bl("font-size:",wx("default.fontSize"),";font-family:inherit;appearance:none;border:1px solid transparent;cursor:pointer;background:none;text-align:start;text-decoration:","a"===e?"none":void 0,";svg,path{fill:currentColor;}&:hover{color:",kl.theme.accent,";}&:focus{box-shadow:none;outline:none;}&:focus-visible{box-shadow:0 0 0 var( --wp-admin-border-width-focus ) ",kl.theme.accent,";outline:2px solid transparent;outline-offset:0;}",""))(d),IP[u]||IP.medium,wP,a&&kP,n)),[d,n,p,u,a]),h=p(yP);return{as:d,className:f,onClick:r,wrapperClassName:h,role:o,...s}}const xD=Xa((function(e,t){const{role:n,wrapperClassName:r,...o}=bD(e);return(0,wt.jsx)("div",{role:n,className:r,children:(0,wt.jsx)(dl,{...o,ref:t})})}),"Item");function yD({target:e,callback:t,shortcut:n,bindGlobal:r,eventName:o}){return(0,l.useKeyboardShortcut)(n,t,{bindGlobal:r,target:e,eventName:o}),null}const wD=function({children:e,shortcuts:t,bindGlobal:n,eventName:r}){const o=(0,c.useRef)(null),i=Object.entries(null!=t?t:{}).map((([e,t])=>(0,wt.jsx)(yD,{shortcut:e,callback:t,bindGlobal:n,eventName:r,target:o},e)));return c.Children.count(e)?(0,wt.jsxs)("div",{ref:o,children:[i,e]}):(0,wt.jsx)(wt.Fragment,{children:i})};const _D=function e(t){const{children:n,className:r="",label:o,hideSeparator:i}=t,a=(0,l.useInstanceId)(e);if(!c.Children.count(n))return null;const u=`components-menu-group-label-${a}`,d=s(r,"components-menu-group",{"has-hidden-separator":i});return(0,wt.jsxs)("div",{className:d,children:[o&&(0,wt.jsx)("div",{className:"components-menu-group__label",id:u,"aria-hidden":"true",children:o}),(0,wt.jsx)("div",{role:"group","aria-labelledby":o?u:void 0,children:n})]})};const SD=(0,c.forwardRef)((function(e,t){let{children:n,info:r,className:o,icon:i,iconPosition:a="right",shortcut:l,isSelected:u,role:d="menuitem",suffix:p,...f}=e;return o=s("components-menu-item__button",o),r&&(n=(0,wt.jsxs)("span",{className:"components-menu-item__info-wrapper",children:[(0,wt.jsx)("span",{className:"components-menu-item__item",children:n}),(0,wt.jsx)("span",{className:"components-menu-item__info",children:r})]})),i&&"string"!=typeof i&&(i=(0,c.cloneElement)(i,{className:s("components-menu-items__item-icon",{"has-icon-right":"right"===a})})),(0,wt.jsxs)($x,{ref:t,"aria-checked":"menuitemcheckbox"===d||"menuitemradio"===d?u:void 0,role:d,icon:"left"===a?i:void 0,className:o,...f,children:[(0,wt.jsx)("span",{className:"components-menu-item__item",children:n}),!p&&(0,wt.jsx)(Bi,{className:"components-menu-item__shortcut",shortcut:l}),!p&&i&&"right"===a&&(0,wt.jsx)(Fx,{icon:i}),p]})})),CD=SD,kD=()=>{};const jD=function({choices:e=[],onHover:t=kD,onSelect:n,value:r}){return(0,wt.jsx)(wt.Fragment,{children:e.map((e=>{const o=r===e.value;return(0,wt.jsx)(CD,{role:"menuitemradio",disabled:e.disabled,icon:o?tk:null,info:e.info,isSelected:o,shortcut:e.shortcut,className:"components-menu-items-choice",onClick:()=>{o||n(e.value)},onMouseEnter:()=>t(e.value),onMouseLeave:()=>t(null),"aria-label":e["aria-label"],children:e.label},e.value)}))})};const ED=(0,c.forwardRef)((function({eventToOffset:e,...t},n){return(0,wt.jsx)(bT,{ref:n,stopNavigationEvents:!0,onlyBrowserTabstops:!0,eventToOffset:t=>{const{code:n,shiftKey:r}=t;return"Tab"===n?r?-1:1:e?e(t):void 0},...t})})),PD="root",TD=()=>{},RD=()=>{},ID=(0,c.createContext)({activeItem:void 0,activeMenu:PD,setActiveMenu:TD,navigationTree:{items:{},getItem:RD,addItem:TD,removeItem:TD,menus:{},getMenu:RD,addMenu:TD,removeMenu:TD,childMenu:{},traverseMenu:TD,isMenuEmpty:()=>!1}}),ND=()=>(0,c.useContext)(ID);const MD=cl("div",{target:"eeiismy11"})("width:100%;box-sizing:border-box;padding:0 ",yl(4),";overflow:hidden;"),AD=cl("div",{target:"eeiismy10"})("margin-top:",yl(6),";margin-bottom:",yl(6),";display:flex;flex-direction:column;ul{padding:0;margin:0;list-style:none;}.components-navigation__back-button{margin-bottom:",yl(6),";}.components-navigation__group+.components-navigation__group{margin-top:",yl(6),";}"),DD=cl($x,{target:"eeiismy9"})({name:"26l0q2",styles:"&.is-tertiary{color:inherit;opacity:0.7;&:hover:not( :disabled ){opacity:1;box-shadow:none;color:inherit;}&:active:not( :disabled ){background:transparent;opacity:1;color:inherit;}}"}),OD=cl("div",{target:"eeiismy8"})({name:"1aubja5",styles:"overflow:hidden;width:100%"}),zD=cl("div",{target:"eeiismy7"})({name:"rgorny",styles:"margin:11px 0;padding:1px"}),LD=cl("span",{target:"eeiismy6"})("height:",yl(6),";.components-button.is-small{color:inherit;opacity:0.7;margin-right:",yl(1),";padding:0;&:active:not( :disabled ){background:none;opacity:1;color:inherit;}&:hover:not( :disabled ){box-shadow:none;opacity:1;color:inherit;}}"),FD=cl(dk,{target:"eeiismy5"})("min-height:",yl(12),";align-items:center;color:inherit;display:flex;justify-content:space-between;margin-bottom:",yl(2),";padding:",(()=>(0,a.isRTL)()?`${yl(1)} ${yl(4)} ${yl(1)} ${yl(2)}`:`${yl(1)} ${yl(2)} ${yl(1)} ${yl(4)}`),";"),BD=cl("li",{target:"eeiismy4"})("border-radius:",Pl.radiusSmall,";color:inherit;margin-bottom:0;>button,>a.components-button,>a{width:100%;color:inherit;opacity:0.7;padding:",yl(2)," ",yl(4),";",Sg({textAlign:"left"},{textAlign:"right"})," &:hover,&:focus:not( [aria-disabled='true'] ):active,&:active:not( [aria-disabled='true'] ):active{color:inherit;opacity:1;}}&.is-active{background-color:",kl.theme.accent,";color:",kl.white,";>button,>a{color:",kl.white,";opacity:1;}}>svg path{color:",kl.gray[600],";}"),VD=cl("div",{target:"eeiismy3"})("display:flex;align-items:center;height:auto;min-height:40px;margin:0;padding:",yl(1.5)," ",yl(4),";font-weight:400;line-height:20px;width:100%;color:inherit;opacity:0.7;"),$D=cl("span",{target:"eeiismy2"})("display:flex;margin-right:",yl(2),";"),HD=cl("span",{target:"eeiismy1"})("margin-left:",(()=>(0,a.isRTL)()?"0":yl(2)),";margin-right:",(()=>(0,a.isRTL)()?yl(2):"0"),";display:inline-flex;padding:",yl(1)," ",yl(3),";border-radius:",Pl.radiusSmall,";@keyframes fade-in{from{opacity:0;}to{opacity:1;}}@media not ( prefers-reduced-motion ){animation:fade-in 250ms ease-out;}"),WD=cl(Nv,{target:"eeiismy0"})((()=>(0,a.isRTL)()?"margin-left: auto;":"margin-right: auto;")," font-size:14px;line-height:20px;color:inherit;");function UD(){const[e,t]=(0,c.useState)({});return{nodes:e,getNode:t=>e[t],addNode:(e,n)=>{const{children:r,...o}=n;return t((t=>({...t,[e]:o})))},removeNode:e=>t((t=>{const{[e]:n,...r}=t;return r}))}}const GD=()=>{};const KD=function({activeItem:e,activeMenu:t=PD,children:n,className:r,onActivateMenu:o=GD}){const[i,l]=(0,c.useState)(t),[u,d]=(0,c.useState)(),p=(()=>{const{nodes:e,getNode:t,addNode:n,removeNode:r}=UD(),{nodes:o,getNode:i,addNode:s,removeNode:a}=UD(),[l,u]=(0,c.useState)({}),d=e=>l[e]||[],p=(e,t)=>{const n=[];let r,o=[e];for(;o.length>0&&(r=i(o.shift()),!r||n.includes(r.menu)||(n.push(r.menu),o=[...o,...d(r.menu)],!1!==t(r))););};return{items:e,getItem:t,addItem:n,removeItem:r,menus:o,getMenu:i,addMenu:(e,t)=>{u((n=>{const r={...n};return t.parentMenu?(r[t.parentMenu]||(r[t.parentMenu]=[]),r[t.parentMenu].push(e),r):r})),s(e,t)},removeMenu:a,childMenu:l,traverseMenu:p,isMenuEmpty:e=>{let t=!0;return p(e,(e=>{if(!e.isEmpty)return t=!1,!1})),t}}})(),f=(0,a.isRTL)()?"right":"left",h=(e,t=f)=>{p.getMenu(e)&&(d(t),l(e),o(e))},m=(0,c.useRef)(!1);(0,c.useEffect)((()=>{m.current||(m.current=!0)}),[]),(0,c.useEffect)((()=>{t!==i&&h(t)}),[t]);const g={activeItem:e,activeMenu:i,setActiveMenu:h,navigationTree:p},v=s("components-navigation",r),b=Bl({type:"slide-in",origin:u});return(0,wt.jsx)(MD,{className:v,children:(0,wt.jsx)("div",{className:b?s({[b]:m.current&&u}):void 0,children:(0,wt.jsx)(ID.Provider,{value:g,children:n})},i)})},qD=(0,wt.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,wt.jsx)(n.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"})}),YD=(0,wt.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,wt.jsx)(n.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"})});const XD=(0,c.forwardRef)((function({backButtonLabel:e,className:t,href:n,onClick:r,parentMenu:o},i){const{setActiveMenu:l,navigationTree:c}=ND(),u=s("components-navigation__back-button",t),d=void 0!==o?c.getMenu(o)?.title:void 0,p=(0,a.isRTL)()?qD:YD;return(0,wt.jsxs)(DD,{className:u,href:n,variant:"tertiary",ref:i,onClick:e=>{"function"==typeof r&&r(e);const t=(0,a.isRTL)()?"left":"right";o&&!e.defaultPrevented&&l(o,t)},children:[(0,wt.jsx)(J_,{icon:p}),e||d||(0,a.__)("Back")]})})),ZD=XD,QD=(0,c.createContext)({group:void 0});let JD=0;const eO=function({children:e,className:t,title:n}){const[r]=(0,c.useState)("group-"+ ++JD),{navigationTree:{items:o}}=ND(),i={group:r};if(!Object.values(o).some((e=>e.group===r&&e._isVisible)))return(0,wt.jsx)(QD.Provider,{value:i,children:e});const a=`components-navigation__group-title-${r}`,l=s("components-navigation__group",t);return(0,wt.jsx)(QD.Provider,{value:i,children:(0,wt.jsxs)("li",{className:l,children:[n&&(0,wt.jsx)(FD,{className:"components-navigation__group-title",id:a,level:3,children:n}),(0,wt.jsx)("ul",{"aria-labelledby":a,role:"group",children:e})]})})};function tO(e){const{badge:t,title:n}=e;return(0,wt.jsxs)(wt.Fragment,{children:[n&&(0,wt.jsx)(WD,{className:"components-navigation__item-title",as:"span",children:n}),t&&(0,wt.jsx)(HD,{className:"components-navigation__item-badge",children:t})]})}const nO=(0,c.createContext)({menu:void 0,search:""}),rO=()=>(0,c.useContext)(nO),oO=e=>fy()(e).replace(/^\//,"").toLowerCase(),iO=(e,t)=>{const{activeMenu:n,navigationTree:{addItem:r,removeItem:o}}=ND(),{group:i}=(0,c.useContext)(QD),{menu:s,search:a}=rO();(0,c.useEffect)((()=>{const l=n===s,c=!a||void 0!==t.title&&((e,t)=>-1!==oO(e).indexOf(oO(t)))(t.title,a);return r(e,{...t,group:i,menu:s,_isVisible:l&&c}),()=>{o(e)}}),[n,a])};let sO=0;function aO(e){const{children:t,className:n,title:r,href:o,...i}=e,[a]=(0,c.useState)("item-"+ ++sO);iO(a,e);const{navigationTree:l}=ND();if(!l.getItem(a)?._isVisible)return null;const u=s("components-navigation__item",n);return(0,wt.jsx)(BD,{className:u,...i,children:t})}const lO=()=>{};const cO=function(e){const{badge:t,children:n,className:r,href:o,item:i,navigateToMenu:l,onClick:c=lO,title:u,icon:d,hideIfTargetMenuEmpty:p,isText:f,...h}=e,{activeItem:m,setActiveMenu:g,navigationTree:{isMenuEmpty:v}}=ND();if(p&&l&&v(l))return null;const b=i&&m===i,x=s(r,{"is-active":b}),y=(0,a.isRTL)()?YD:qD,w=n?e:{...e,onClick:void 0},_=f?h:{as:$x,href:o,onClick:e=>{l&&g(l),c(e)},"aria-current":b?"page":void 0,...h};return(0,wt.jsx)(aO,{...w,className:x,children:n||(0,wt.jsxs)(VD,{..._,children:[d&&(0,wt.jsx)($D,{children:(0,wt.jsx)(J_,{icon:d})}),(0,wt.jsx)(tO,{title:u,badge:t}),l&&(0,wt.jsx)(J_,{icon:y})]})})},uO=(0,wt.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,wt.jsx)(n.Path,{d:"M13 5c-3.3 0-6 2.7-6 6 0 1.4.5 2.7 1.3 3.7l-3.8 3.8 1.1 1.1 3.8-3.8c1 .8 2.3 1.3 3.7 1.3 3.3 0 6-2.7 6-6S16.3 5 13 5zm0 10.5c-2.5 0-4.5-2-4.5-4.5s2-4.5 4.5-4.5 4.5 2 4.5 4.5-2 4.5-4.5 4.5z"})}),dO=(0,l.createHigherOrderComponent)((e=>t=>(0,wt.jsx)(e,{...t,speak:my.speak,debouncedSpeak:(0,l.useDebounce)(my.speak,500)})),"withSpokenMessages"),pO=({size:e})=>yl("compact"===e?1:2),fO=cl("div",{target:"effl84m1"})("display:flex;padding-inline-end:",pO,";svg{fill:currentColor;}"),hO=cl(zx,{target:"effl84m0"})("input[type='search']{&::-webkit-search-decoration,&::-webkit-search-cancel-button,&::-webkit-search-results-button,&::-webkit-search-results-decoration{-webkit-appearance:none;}}&:not( :focus-within ){--wp-components-color-background:",kl.theme.gray[100],";}");function mO({searchRef:e,value:t,onChange:n,onClose:r}){if(!r&&!t)return(0,wt.jsx)(J_,{icon:uO});return(0,wt.jsx)($x,{size:"small",icon:Ow,label:r?(0,a.__)("Close search"):(0,a.__)("Reset search"),onClick:null!=r?r:()=>{n(""),e.current?.focus()}})}const gO=(0,c.forwardRef)((function({__nextHasNoMarginBottom:e=!1,className:t,onChange:n,value:r,label:o=(0,a.__)("Search"),placeholder:i=(0,a.__)("Search"),hideLabelFromVision:u=!0,onClose:d,size:p="default",...f},h){delete f.disabled;const m=(0,c.useRef)(null),g=(0,l.useInstanceId)(gO,"components-search-control"),v=(0,c.useMemo)((()=>({BaseControl:{_overrides:{__nextHasNoMarginBottom:e},__associatedWPComponentName:"SearchControl"},InputBase:{isBorderless:!0}})),[e]);return(0,wt.jsx)(is,{value:v,children:(0,wt.jsx)(hO,{__next40pxDefaultSize:!0,id:g,hideLabelFromVision:u,label:o,ref:(0,l.useMergeRefs)([m,h]),type:"search",size:p,className:s("components-search-control",t),onChange:e=>n(null!=e?e:""),autoComplete:"off",placeholder:i,value:null!=r?r:"",suffix:(0,wt.jsx)(fO,{size:p,children:(0,wt.jsx)(mO,{searchRef:m,value:r,onChange:n,onClose:d})}),...f})})})),vO=gO;const bO=dO((function({debouncedSpeak:e,onCloseSearch:t,onSearch:n,search:r,title:o}){const{navigationTree:{items:i}}=ND(),{menu:s}=rO(),l=(0,c.useRef)(null);(0,c.useEffect)((()=>{const e=setTimeout((()=>{l.current?.focus()}),100);return()=>{clearTimeout(e)}}),[]),(0,c.useEffect)((()=>{if(!r)return;const t=Object.values(i).filter((e=>e._isVisible)).length,n=(0,a.sprintf)((0,a._n)("%d result found.","%d results found.",t),t);e(n)}),[i,r]);const u=()=>{n?.(""),t()},d=`components-navigation__menu-title-search-${s}`,p=(0,a.sprintf)((0,a.__)("Search %s"),o?.toLowerCase()).trim();return(0,wt.jsx)(zD,{children:(0,wt.jsx)(vO,{__nextHasNoMarginBottom:!0,className:"components-navigation__menu-search-input",id:d,onChange:e=>n?.(e),onKeyDown:e=>{"Escape"!==e.code||e.defaultPrevented||(e.preventDefault(),u())},placeholder:p,onClose:u,ref:l,value:r})})}));function xO({hasSearch:e,onSearch:t,search:n,title:r,titleAction:o}){const[i,s]=(0,c.useState)(!1),{menu:l}=rO(),u=(0,c.useRef)(null);if(!r)return null;const d=`components-navigation__menu-title-${l}`,p=(0,a.sprintf)((0,a.__)("Search in %s"),r);return(0,wt.jsxs)(OD,{className:"components-navigation__menu-title",children:[!i&&(0,wt.jsxs)(FD,{as:"h2",className:"components-navigation__menu-title-heading",level:3,children:[(0,wt.jsx)("span",{id:d,children:r}),(e||o)&&(0,wt.jsxs)(LD,{children:[o,e&&(0,wt.jsx)($x,{size:"small",variant:"tertiary",label:p,onClick:()=>s(!0),ref:u,children:(0,wt.jsx)(J_,{icon:uO})})]})]}),i&&(0,wt.jsx)("div",{className:Bl({type:"slide-in",origin:"left"}),children:(0,wt.jsx)(bO,{onCloseSearch:()=>{s(!1),setTimeout((()=>{u.current?.focus()}),100)},onSearch:t,search:n,title:r})})]})}function yO({search:e}){const{navigationTree:{items:t}}=ND(),n=Object.values(t).filter((e=>e._isVisible)).length;return!e||n?null:(0,wt.jsx)(BD,{children:(0,wt.jsxs)(VD,{children:[(0,a.__)("No results found.")," "]})})}const wO=function(e){const{backButtonLabel:t,children:n,className:r,hasSearch:o,menu:i=PD,onBackButtonClick:a,onSearch:l,parentMenu:u,search:d,isSearchDebouncing:p,title:f,titleAction:h}=e,[m,g]=(0,c.useState)("");(e=>{const{navigationTree:{addMenu:t,removeMenu:n}}=ND(),r=e.menu||PD;(0,c.useEffect)((()=>(t(r,{...e,menu:r}),()=>{n(r)})),[])})(e);const{activeMenu:v}=ND(),b={menu:i,search:m};if(v!==i)return(0,wt.jsx)(nO.Provider,{value:b,children:n});const x=!!l,y=x?d:m,w=x?l:g,_=`components-navigation__menu-title-${i}`,S=s("components-navigation__menu",r);return(0,wt.jsx)(nO.Provider,{value:b,children:(0,wt.jsxs)(AD,{className:S,children:[(u||a)&&(0,wt.jsx)(ZD,{backButtonLabel:t,parentMenu:u,onClick:a}),f&&(0,wt.jsx)(xO,{hasSearch:o,onSearch:w,search:y,title:f,titleAction:h}),(0,wt.jsx)(yT,{children:(0,wt.jsxs)("ul",{"aria-labelledby":_,children:[n,y&&!p&&(0,wt.jsx)(yO,{search:y})]})})]})})};function _O(e,t){void 0===t&&(t={});for(var n=function(e){for(var t=[],n=0;n=48&&l<=57||l>=65&&l<=90||l>=97&&l<=122||95===l))break;s+=e[a++]}if(!s)throw new TypeError("Missing parameter name at ".concat(n));t.push({type:"NAME",index:n,value:s}),n=a}else t.push({type:"CLOSE",index:n,value:e[n++]});else t.push({type:"OPEN",index:n,value:e[n++]});else t.push({type:"ESCAPED_CHAR",index:n++,value:e[n++]});else t.push({type:"MODIFIER",index:n,value:e[n++]})}return t.push({type:"END",index:n,value:""}),t}(e),r=t.prefixes,o=void 0===r?"./":r,i=t.delimiter,s=void 0===i?"/#?":i,a=[],l=0,c=0,u="",d=function(e){if(c-1)return!0}return!1}(n)?"[^".concat(CO(s),"]+?"):"(?:(?!".concat(CO(n),")[^").concat(CO(s),"])+?")};c-1:void 0===S;o||(g+="(?:".concat(m,"(?=").concat(h,"))?")),C||(g+="(?=".concat(m,"|").concat(h,")"))}return new RegExp(g,kO(n))}(_O(e,n),t,n)}function EO(e,t,n){return e instanceof RegExp?function(e,t){if(!t)return e;for(var n=/\((?:\?<(.*?)>)?(?!\?)/g,r=0,o=n.exec(e.source);o;)t.push({name:o[1]||r++,prefix:"",suffix:"",modifier:"",pattern:""}),o=n.exec(e.source);return e}(e,t):Array.isArray(e)?function(e,t,n){var r=e.map((function(e){return EO(e,t,n).source}));return new RegExp("(?:".concat(r.join("|"),")"),kO(n))}(e,t,n):jO(e,t,n)}function PO(e,t){return SO(t,{decode:decodeURIComponent})(e)}const TO=(0,c.createContext)({location:{},goTo:()=>{},goBack:()=>{},goToParent:()=>{},addScreen:()=>{},removeScreen:()=>{},params:{}});const RO={name:"xpkswc",styles:"overflow-x:hidden;contain:content"},IO=xl({"0%":{opacity:0,transform:"translateX( 50px )"},"100%":{opacity:1,transform:"none"}}),NO=xl({"0%":{opacity:0,transform:"translateX( -50px )"},"100%":{opacity:1,transform:"none"}}),MO=e=>bl("overflow-x:auto;max-height:100%;",(({isInitial:e,isBack:t,isRTL:n})=>{if(e&&!t)return;return bl("animation-duration:0.14s;animation-timing-function:ease-in-out;will-change:transform,opacity;animation-name:",n&&t||!n&&!t?IO:NO,";@media ( prefers-reduced-motion ){animation-duration:0s;}","")})(e),";","");function AO(e,t,n={}){var r;const{focusSelectors:o}=e,i={...e.currentLocation},{isBack:s=!1,skipFocus:a=!1,replace:l,focusTargetSelector:c,...u}=n;if(i.path===t)return{currentLocation:i,focusSelectors:o};let d,p;function f(){var t;return d=null!==(t=d)&&void 0!==t?t:new Map(e.focusSelectors),d}return c&&i.path&&f().set(i.path,c),o.get(t)&&(s&&(p=o.get(t)),f().delete(t)),{currentLocation:{...u,isInitial:!1,path:t,isBack:s,hasRestoredFocus:!1,focusTargetSelector:p,skipFocus:a},focusSelectors:null!==(r=d)&&void 0!==r?r:o}}function DO(e,t={}){const{screens:n,focusSelectors:r}=e,o={...e.currentLocation},i=o.path;if(void 0===i)return{currentLocation:o,focusSelectors:r};const s=function(e,t){if(!e.startsWith("/"))return;const n=e.split("/");let r;for(;n.length>1&&void 0===r;){n.pop();const e=""===n.join("/")?"/":n.join("/");t.find((t=>!1!==PO(e,t.path)))&&(r=e)}return r}(i,n);return void 0===s?{currentLocation:o,focusSelectors:r}:AO(e,s,{...t,isBack:!0})}function OO(e,t){let{screens:n,currentLocation:r,matchedPath:o,focusSelectors:i,...s}=e;switch(t.type){case"add":n=function({screens:e},t){return e.some((e=>e.path===t.path))?e:[...e,t]}(e,t.screen);break;case"remove":n=function({screens:e},t){return e.filter((e=>e.id!==t.id))}(e,t.screen);break;case"goto":({currentLocation:r,focusSelectors:i}=AO(e,t.path,t.options));break;case"gotoparent":({currentLocation:r,focusSelectors:i}=DO(e,t.options))}if(n===e.screens&&r===e.currentLocation)return e;const a=r.path;return o=void 0!==a?function(e,t){for(const n of t){const t=PO(e,n.path);if(t)return{params:t.params,id:n.id}}}(a,n):void 0,o&&e.matchedPath&&o.id===e.matchedPath.id&&rw()(o.params,e.matchedPath.params)&&(o=e.matchedPath),{...s,screens:n,currentLocation:r,matchedPath:o,focusSelectors:i}}const zO=Xa((function(e,t){const{initialPath:n,children:r,className:o,...i}=Ya(e,"NavigatorProvider"),[s,a]=(0,c.useReducer)(OO,n,(e=>({screens:[],currentLocation:{path:e,isInitial:!0},matchedPath:void 0,focusSelectors:new Map,initialPath:n}))),l=(0,c.useMemo)((()=>({goBack:e=>a({type:"gotoparent",options:e}),goTo:(e,t)=>a({type:"goto",path:e,options:t}),goToParent:e=>{Fi()("wp.components.useNavigator().goToParent",{since:"6.7",alternative:"wp.components.useNavigator().goBack"}),a({type:"gotoparent",options:e})},addScreen:e=>a({type:"add",screen:e}),removeScreen:e=>a({type:"remove",screen:e})})),[]),{currentLocation:u,matchedPath:d}=s,p=(0,c.useMemo)((()=>{var e;return{location:u,params:null!==(e=d?.params)&&void 0!==e?e:{},match:d?.id,...l}}),[u,d,l]),f=qa(),h=(0,c.useMemo)((()=>f(RO,o)),[o,f]);return(0,wt.jsx)(dl,{ref:t,className:h,...i,children:(0,wt.jsx)(TO.Provider,{value:p,children:r})})}),"NavigatorProvider"),LO=window.wp.escapeHtml;const FO=Xa((function(e,t){/^\//.test(e.path);const n=(0,c.useId)(),{children:r,className:o,path:i,...s}=Ya(e,"NavigatorScreen"),{location:u,match:d,addScreen:p,removeScreen:f}=(0,c.useContext)(TO),h=d===n,m=(0,c.useRef)(null);(0,c.useEffect)((()=>{const e={id:n,path:(0,LO.escapeAttribute)(i)};return p(e),()=>f(e)}),[n,i,p,f]);const g=(0,a.isRTL)(),{isInitial:v,isBack:b}=u,x=qa(),y=(0,c.useMemo)((()=>x(MO({isInitial:v,isBack:b,isRTL:g}),o)),[o,x,v,b,g]),w=(0,c.useRef)(u);(0,c.useEffect)((()=>{w.current=u}),[u]);const _=u.isInitial&&!u.isBack;(0,c.useEffect)((()=>{if(_||!h||!m.current||w.current.hasRestoredFocus||u.skipFocus)return;const e=m.current.ownerDocument.activeElement;if(m.current.contains(e))return;let t=null;if(u.isBack&&u.focusTargetSelector&&(t=m.current.querySelector(u.focusTargetSelector)),!t){const[e]=fT.focus.tabbable.find(m.current);t=null!=e?e:m.current}w.current.hasRestoredFocus=!0,t.focus()}),[_,h,u.isBack,u.focusTargetSelector,u.skipFocus]);const S=(0,l.useMergeRefs)([t,m]);return h?(0,wt.jsx)(dl,{ref:S,className:y,...s,children:r}):null}),"NavigatorScreen");function BO(){const{location:e,params:t,goTo:n,goBack:r,goToParent:o}=(0,c.useContext)(TO);return{location:e,goTo:n,goBack:r,goToParent:o,params:t}}const VO=Xa((function(e,t){const n=function(e){const{path:t,onClick:n,as:r=$x,attributeName:o="id",...i}=Ya(e,"NavigatorButton"),s=(0,LO.escapeAttribute)(t),{goTo:a}=BO();return{as:r,onClick:(0,c.useCallback)((e=>{var t,r;e.preventDefault(),a(s,{focusTargetSelector:(t=o,r=s,`[${t}="${r}"]`)}),n?.(e)}),[a,n,o,s]),...i,[o]:s}}(e);return(0,wt.jsx)(dl,{ref:t,...n})}),"NavigatorButton");const $O=Xa((function(e,t){const n=function(e){const{onClick:t,as:n=$x,...r}=Ya(e,"NavigatorBackButton"),{goBack:o}=BO();return{as:n,onClick:(0,c.useCallback)((e=>{e.preventDefault(),o(),t?.(e)}),[o,t]),...r}}(e);return(0,wt.jsx)(dl,{ref:t,...n})}),"NavigatorBackButton");const HO=Xa((function(e,t){return Fi()("wp.components.NavigatorToParentButton",{since:"6.7",alternative:"wp.components.NavigatorBackButton"}),(0,wt.jsx)($O,{ref:t,...e})}),"NavigatorToParentButton"),WO=()=>{};function UO(e){switch(e){case"success":case"warning":case"info":return"polite";default:return"assertive"}}function GO(e){switch(e){case"warning":return(0,a.__)("Warning notice");case"info":return(0,a.__)("Information notice");case"error":return(0,a.__)("Error notice");default:return(0,a.__)("Notice")}}const KO=function({className:e,status:t="info",children:n,spokenMessage:r=n,onRemove:o=WO,isDismissible:i=!0,actions:l=[],politeness:u=UO(t),__unstableHTML:d,onDismiss:p=WO}){!function(e,t){const n="string"==typeof e?e:(0,c.renderToString)(e);(0,c.useEffect)((()=>{n&&(0,my.speak)(n,t)}),[n,t])}(r,u);const f=s(e,"components-notice","is-"+t,{"is-dismissible":i});return d&&"string"==typeof n&&(n=(0,wt.jsx)(c.RawHTML,{children:n})),(0,wt.jsxs)("div",{className:f,children:[(0,wt.jsx)(pl,{children:GO(t)}),(0,wt.jsxs)("div",{className:"components-notice__content",children:[n,(0,wt.jsx)("div",{className:"components-notice__actions",children:l.map((({className:e,label:t,isPrimary:n,variant:r,noDefaultClasses:o=!1,onClick:i,url:a},l)=>{let c=r;return"primary"===r||o||(c=a?"link":"secondary"),void 0===c&&n&&(c="primary"),(0,wt.jsx)($x,{href:a,variant:c,onClick:a?void 0:i,className:s("components-notice__action",e),children:t},l)}))})]}),i&&(0,wt.jsx)($x,{className:"components-notice__dismiss",icon:Py,label:(0,a.__)("Close"),onClick:()=>{p(),o()}})]})},qO=()=>{};const YO=function({notices:e,onRemove:t=qO,className:n,children:r}){const o=e=>()=>t(e);return n=s("components-notice-list",n),(0,wt.jsxs)("div",{className:n,children:[r,[...e].reverse().map((e=>{const{content:t,...n}=e;return(0,B.createElement)(KO,{...n,key:e.id,onRemove:o(e.id)},e.content)}))]})};const XO=function({label:e,children:t}){return(0,wt.jsxs)("div",{className:"components-panel__header",children:[e&&(0,wt.jsx)("h2",{children:e}),t]})};const ZO=(0,c.forwardRef)((function({header:e,className:t,children:n},r){const o=s(t,"components-panel");return(0,wt.jsxs)("div",{className:o,ref:r,children:[e&&(0,wt.jsx)(XO,{label:e}),n]})})),QO=(0,wt.jsx)(n.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,wt.jsx)(n.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"})}),JO=()=>{};const ez=(0,c.forwardRef)((({isOpened:e,icon:t,title:n,...r},o)=>n?(0,wt.jsx)("h2",{className:"components-panel__body-title",children:(0,wt.jsxs)($x,{className:"components-panel__body-toggle","aria-expanded":e,ref:o,...r,children:[(0,wt.jsx)("span",{"aria-hidden":"true",children:(0,wt.jsx)(Fx,{className:"components-panel__arrow",icon:e?QO:eS})}),n,t&&(0,wt.jsx)(Fx,{icon:t,className:"components-panel__icon",size:20})]})}):null)),tz=(0,c.forwardRef)((function(e,t){const{buttonProps:n={},children:r,className:o,icon:i,initialOpen:a,onToggle:u=JO,opened:d,title:p,scrollAfterOpen:f=!0}=e,[h,m]=sS(d,{initial:void 0===a||a,fallback:!1}),g=(0,c.useRef)(null),v=(0,l.useReducedMotion)()?"auto":"smooth",b=(0,c.useRef)();b.current=f,ns((()=>{h&&b.current&&g.current?.scrollIntoView&&g.current.scrollIntoView({inline:"nearest",block:"nearest",behavior:v})}),[h,v]);const x=s("components-panel__body",o,{"is-opened":h});return(0,wt.jsxs)("div",{className:x,ref:(0,l.useMergeRefs)([g,t]),children:[(0,wt.jsx)(ez,{icon:i,isOpened:Boolean(h),onClick:e=>{e.preventDefault();const t=!h;m(t),u(t)},title:p,...n}),"function"==typeof r?r({opened:Boolean(h)}):h&&r]})})),nz=tz;const rz=(0,c.forwardRef)((function({className:e,children:t},n){return(0,wt.jsx)("div",{className:s("components-panel__row",e),ref:n,children:t})})),oz=(0,wt.jsx)(n.SVG,{className:"components-placeholder__illustration",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 60 60",preserveAspectRatio:"none",children:(0,wt.jsx)(n.Path,{vectorEffect:"non-scaling-stroke",d:"M60 60 0 0"})});const iz=function(e){const{icon:t,children:n,label:r,instructions:o,className:i,notices:a,preview:u,isColumnLayout:d,withIllustration:p,...f}=e,[h,{width:m}]=(0,l.useResizeObserver)();let g;"number"==typeof m&&(g={"is-large":m>=480,"is-medium":m>=160&&m<480,"is-small":m<160});const v=s("components-placeholder",i,g,p?"has-illustration":null),b=s("components-placeholder__fieldset",{"is-column-layout":d});return(0,c.useEffect)((()=>{o&&(0,my.speak)(o)}),[o]),(0,wt.jsxs)("div",{...f,className:v,children:[p?oz:null,h,a,u&&(0,wt.jsx)("div",{className:"components-placeholder__preview",children:u}),(0,wt.jsxs)("div",{className:"components-placeholder__label",children:[(0,wt.jsx)(Fx,{icon:t}),r]}),!!o&&(0,wt.jsx)("div",{className:"components-placeholder__instructions",children:o}),(0,wt.jsx)("div",{className:b,children:n})]})};function sz(e=!1){const t=e?"right":"left";return xl({"0%":{[t]:"-50%"},"100%":{[t]:"100%"}})}const az=cl("div",{target:"e15u147w2"})("position:relative;overflow:hidden;height:",Pl.borderWidthFocus,";background-color:color-mix(\n\t\tin srgb,\n\t\t",kl.theme.foreground,",\n\t\ttransparent 90%\n\t);border-radius:",Pl.radiusFull,";outline:2px solid transparent;outline-offset:2px;:where( & ){width:160px;}");var lz={name:"152sa26",styles:"width:var(--indicator-width);transition:width 0.4s ease-in-out"};const cz=cl("div",{target:"e15u147w1"})("display:inline-block;position:absolute;top:0;height:100%;border-radius:",Pl.radiusFull,";background-color:color-mix(\n\t\tin srgb,\n\t\t",kl.theme.foreground,",\n\t\ttransparent 10%\n\t);outline:2px solid transparent;outline-offset:-2px;",(({isIndeterminate:e})=>e?bl({animationDuration:"1.5s",animationTimingFunction:"ease-in-out",animationIterationCount:"infinite",animationName:sz((0,a.isRTL)()),width:"50%"},"",""):lz),";"),uz=cl("progress",{target:"e15u147w0"})({name:"11fb690",styles:"position:absolute;top:0;left:0;opacity:0;width:100%;height:100%"});const dz=(0,c.forwardRef)((function(e,t){const{className:n,value:r,...o}=e,i=!Number.isFinite(r);return(0,wt.jsxs)(az,{className:n,children:[(0,wt.jsx)(cz,{style:{"--indicator-width":i?void 0:`${r}%`},isIndeterminate:i}),(0,wt.jsx)(uz,{max:100,value:r,"aria-label":(0,a.__)("Loading …"),ref:t,...o})]})}));function pz(e){const t=e.map((e=>({children:[],parent:null,...e,id:String(e.id)})));if(!t.every((e=>null!==e.parent)))return t;const n=t.reduce(((e,t)=>{const{parent:n}=t;return e[n]||(e[n]=[]),e[n].push(t),e}),{}),r=e=>e.map((e=>{const t=n[e.id];return{...e,children:t&&t.length?r(t):[]}}));return r(n[0]||[])}const fz=window.wp.htmlEntities,hz={BaseControl:{_overrides:{__associatedWPComponentName:"TreeSelect"}}};function mz(e,t=0){return e.flatMap((e=>[{value:e.id,label:" ".repeat(3*t)+(0,fz.decodeEntities)(e.name)},...mz(e.children||[],t+1)]))}const gz=function(e){const{label:t,noOptionLabel:n,onChange:r,selectedId:o,tree:i=[],...s}=ob(e),a=(0,c.useMemo)((()=>[n&&{value:"",label:n},...mz(i)].filter((e=>!!e))),[n,i]);return(0,wt.jsx)(is,{value:hz,children:(0,wt.jsx)(rS,{label:t,options:a,onChange:r,value:o,...s})})};function vz({__next40pxDefaultSize:e,label:t,noOptionLabel:n,authorList:r,selectedAuthorId:o,onChange:i}){if(!r)return null;const s=pz(r);return(0,wt.jsx)(gz,{label:t,noOptionLabel:n,onChange:i,tree:s,selectedId:void 0!==o?String(o):void 0,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:e})}function bz({__next40pxDefaultSize:e,label:t,noOptionLabel:n,categoriesList:r,selectedCategoryId:o,onChange:i,...s}){const a=(0,c.useMemo)((()=>pz(r)),[r]);return(0,wt.jsx)(gz,{label:t,noOptionLabel:n,onChange:i,tree:a,selectedId:void 0!==o?String(o):void 0,...s,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:e})}function xz(e){return"categoriesList"in e}function yz(e){return"categorySuggestions"in e}const wz=function({authorList:e,selectedAuthorId:t,numberOfItems:n,order:r,orderBy:o,maxItems:i=100,minItems:s=1,onAuthorChange:l,onNumberOfItemsChange:c,onOrderChange:u,onOrderByChange:d,...p}){return(0,wt.jsx)(lk,{spacing:"4",className:"components-query-controls",children:[u&&d&&(0,wt.jsx)(oS,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,a.__)("Order by"),value:void 0===o||void 0===r?void 0:`${o}/${r}`,options:[{label:(0,a.__)("Newest to oldest"),value:"date/desc"},{label:(0,a.__)("Oldest to newest"),value:"date/asc"},{label:(0,a.__)("A → Z"),value:"title/asc"},{label:(0,a.__)("Z → A"),value:"title/desc"}],onChange:e=>{if("string"!=typeof e)return;const[t,n]=e.split("/");n!==r&&u(n),t!==o&&d(t)}},"query-controls-order-select"),xz(p)&&p.categoriesList&&p.onCategoryChange&&(0,wt.jsx)(bz,{__next40pxDefaultSize:!0,categoriesList:p.categoriesList,label:(0,a.__)("Category"),noOptionLabel:(0,a._x)("All","categories"),selectedCategoryId:p.selectedCategoryId,onChange:p.onCategoryChange},"query-controls-category-select"),yz(p)&&p.categorySuggestions&&p.onCategoryChange&&(0,wt.jsx)(pD,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,a.__)("Categories"),value:p.selectedCategories&&p.selectedCategories.map((e=>({id:e.id,value:e.name||e.value}))),suggestions:Object.keys(p.categorySuggestions),onChange:p.onCategoryChange,maxSuggestions:20},"query-controls-categories-select"),l&&(0,wt.jsx)(vz,{__next40pxDefaultSize:!0,authorList:e,label:(0,a.__)("Author"),noOptionLabel:(0,a._x)("All","authors"),selectedAuthorId:t,onChange:l},"query-controls-author-select"),c&&(0,wt.jsx)(KS,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,a.__)("Number of items"),value:n,onChange:c,min:s,max:i,required:!0},"query-controls-range-control")]})},_z=(0,c.createContext)({store:void 0,disabled:void 0});const Sz=(0,c.forwardRef)((function({value:e,children:t,...n},r){const{store:o,disabled:i}=(0,c.useContext)(_z),s=Qe(o,"value"),a=void 0!==s&&s===e;return(0,wt.jsx)(m_,{disabled:i,store:o,ref:r,value:e,render:(0,wt.jsx)($x,{variant:a?"primary":"secondary",...n}),children:t||e})})),Cz=Sz;const kz=(0,c.forwardRef)((function({label:e,checked:t,defaultChecked:n,disabled:r,onChange:o,children:i,...s},a){const l=Qw({value:t,defaultValue:n,setValue:e=>{o?.(null!=e?e:void 0)}}),u=(0,c.useMemo)((()=>({store:l,disabled:r})),[l,r]);return(0,wt.jsx)(_z.Provider,{value:u,children:(0,wt.jsx)(o_,{store:l,render:(0,wt.jsx)(sE,{children:i}),"aria-label":e,ref:a,...s})})})),jz=kz;function Ez(e,t){return`${e}-${t}-option-description`}function Pz(e,t){return`${e}-${t}`}function Tz(e){return`${e}__help`}const Rz=function e(t){const{label:n,className:r,selected:o,help:i,onChange:a,hideLabelFromVision:c,options:u=[],id:d,...p}=t,f=(0,l.useInstanceId)(e,"inspector-radio-control",d),h=e=>a(e.target.value);return u?.length?(0,wt.jsxs)("fieldset",{id:f,className:s(r,"components-radio-control"),"aria-describedby":i?Tz(f):void 0,children:[c?(0,wt.jsx)(pl,{as:"legend",children:n}):(0,wt.jsx)(Ax.VisualLabel,{as:"legend",children:n}),(0,wt.jsx)(lk,{spacing:3,className:s("components-radio-control__group-wrapper",{"has-help":!!i}),children:u.map(((e,t)=>(0,wt.jsxs)("div",{className:"components-radio-control__option",children:[(0,wt.jsx)("input",{id:Pz(f,t),className:"components-radio-control__input",type:"radio",name:f,value:e.value,onChange:h,checked:e.value===o,"aria-describedby":e.description?Ez(f,t):void 0,...p}),(0,wt.jsx)("label",{className:"components-radio-control__label",htmlFor:Pz(f,t),children:e.label}),e.description?(0,wt.jsx)(Rx,{__nextHasNoMarginBottom:!0,id:Ez(f,t),className:"components-radio-control__option-description",children:e.description}):null]},Pz(f,t))))}),!!i&&(0,wt.jsx)(Rx,{__nextHasNoMarginBottom:!0,id:Tz(f),className:"components-base-control__help",children:i})]}):null};var Iz=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Nz=function(){return Nz=Object.assign||function(e){for(var t,n=1,r=arguments.length;n{},Qz="bottom",Jz="corner";function eL({axis:e,fadeTimeout:t=180,onResize:n=Zz,position:r=Qz,showPx:o=!1}){const[i,s]=(0,l.useResizeObserver)(),a=!!e,[u,d]=(0,c.useState)(!1),[p,f]=(0,c.useState)(!1),{width:h,height:m}=s,g=(0,c.useRef)(m),v=(0,c.useRef)(h),b=(0,c.useRef)(),x=(0,c.useCallback)((()=>{b.current&&window.clearTimeout(b.current),b.current=window.setTimeout((()=>{a||(d(!1),f(!1))}),t)}),[t,a]);(0,c.useEffect)((()=>{if(!(null!==h||null!==m))return;const e=h!==v.current,t=m!==g.current;if(e||t){if(h&&!v.current&&m&&!g.current)return v.current=h,void(g.current=m);e&&(d(!0),v.current=h),t&&(f(!0),g.current=m),n({width:h,height:m}),x()}}),[h,m,n,x]);const y=function({axis:e,height:t,moveX:n=!1,moveY:r=!1,position:o=Qz,showPx:i=!1,width:s}){if(!n&&!r)return;if(o===Jz)return`${s} x ${t}`;const a=i?" px":"";if(e){if("x"===e&&n)return`${s}${a}`;if("y"===e&&r)return`${t}${a}`}if(n&&r)return`${s} x ${t}`;if(n)return`${s}${a}`;if(r)return`${t}${a}`;return}({axis:e,height:m,moveX:u,moveY:p,position:r,showPx:o,width:h});return{label:y,resizeListener:i}}const tL=cl("div",{target:"e1wq7y4k3"})({name:"1cd7zoc",styles:"bottom:0;box-sizing:border-box;left:0;pointer-events:none;position:absolute;right:0;top:0"}),nL=cl("div",{target:"e1wq7y4k2"})({name:"ajymcs",styles:"align-items:center;box-sizing:border-box;display:inline-flex;justify-content:center;opacity:0;pointer-events:none;transition:opacity 120ms linear"}),rL=cl("div",{target:"e1wq7y4k1"})("background:",kl.theme.foreground,";border-radius:",Pl.radiusSmall,";box-sizing:border-box;font-family:",wx("default.fontFamily"),";font-size:12px;color:",kl.theme.foregroundInverted,";padding:4px 8px;position:relative;"),oL=cl(Nv,{target:"e1wq7y4k0"})("&&&{color:",kl.theme.foregroundInverted,";display:block;font-size:13px;line-height:1.4;white-space:nowrap;}");const iL=(0,c.forwardRef)((function({label:e,position:t=Jz,zIndex:n=1e3,...r},o){const i=!!e,s=t===Jz;if(!i)return null;let l={opacity:i?1:void 0,zIndex:n},c={};return t===Qz&&(l={...l,position:"absolute",bottom:-10,left:"50%",transform:"translate(-50%, 0)"},c={transform:"translate(0, 100%)"}),s&&(l={...l,position:"absolute",top:4,right:(0,a.isRTL)()?void 0:4,left:(0,a.isRTL)()?4:void 0}),(0,wt.jsx)(nL,{"aria-hidden":"true",className:"components-resizable-tooltip__tooltip-wrapper",ref:o,style:l,...r,children:(0,wt.jsx)(rL,{className:"components-resizable-tooltip__tooltip",style:c,children:(0,wt.jsx)(oL,{as:"span",children:e})})})})),sL=iL,aL=()=>{};const lL=(0,c.forwardRef)((function({axis:e,className:t,fadeTimeout:n=180,isVisible:r=!0,labelRef:o,onResize:i=aL,position:a=Qz,showPx:l=!0,zIndex:c=1e3,...u},d){const{label:p,resizeListener:f}=eL({axis:e,fadeTimeout:n,onResize:i,showPx:l,position:a});if(!r)return null;const h=s("components-resize-tooltip",t);return(0,wt.jsxs)(tL,{"aria-hidden":"true",className:h,ref:d,...u,children:[f,(0,wt.jsx)(sL,{"aria-hidden":u["aria-hidden"],label:p,position:a,ref:o,zIndex:c})]})})),cL=lL,uL="components-resizable-box__handle",dL="components-resizable-box__side-handle",pL="components-resizable-box__corner-handle",fL={top:s(uL,dL,"components-resizable-box__handle-top"),right:s(uL,dL,"components-resizable-box__handle-right"),bottom:s(uL,dL,"components-resizable-box__handle-bottom"),left:s(uL,dL,"components-resizable-box__handle-left"),topLeft:s(uL,pL,"components-resizable-box__handle-top","components-resizable-box__handle-left"),topRight:s(uL,pL,"components-resizable-box__handle-top","components-resizable-box__handle-right"),bottomRight:s(uL,pL,"components-resizable-box__handle-bottom","components-resizable-box__handle-right"),bottomLeft:s(uL,pL,"components-resizable-box__handle-bottom","components-resizable-box__handle-left")},hL={width:void 0,height:void 0,top:void 0,right:void 0,bottom:void 0,left:void 0},mL={top:hL,right:hL,bottom:hL,left:hL,topLeft:hL,topRight:hL,bottomRight:hL,bottomLeft:hL};const gL=(0,c.forwardRef)((function({className:e,children:t,showHandle:n=!0,__experimentalShowTooltip:r=!1,__experimentalTooltipProps:o={},...i},a){return(0,wt.jsxs)(Xz,{className:s("components-resizable-box__container",n&&"has-show-handle",e),handleClasses:fL,handleStyles:mL,ref:a,...i,children:[t,r&&(0,wt.jsx)(cL,{...o})]})}));const vL=function({naturalWidth:e,naturalHeight:t,children:n,isInline:r=!1}){if(1!==c.Children.count(n))return null;const o=r?"span":"div";let i;return e&&t&&(i=`${e} / ${t}`),(0,wt.jsx)(o,{className:"components-responsive-wrapper",children:(0,wt.jsx)("div",{children:(0,c.cloneElement)(n,{className:s("components-responsive-wrapper__content",n.props.className),style:{...n.props.style,aspectRatio:i}})})})},bL=function(){const{MutationObserver:e}=window;if(!e||!document.body||!window.parent)return;function t(){const e=document.body.getBoundingClientRect();window.parent.postMessage({action:"resize",width:e.width,height:e.height},"*")}function n(e){e.style&&["width","height","minHeight","maxHeight"].forEach((function(t){/^\\d+(vw|vh|svw|lvw|dvw|svh|lvh|dvh|vi|svi|lvi|dvi|vb|svb|lvb|dvb|vmin|svmin|lvmin|dvmin|vmax|svmax|lvmax|dvmax)$/.test(e.style[t])&&(e.style[t]="")}))}new e(t).observe(document.body,{attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0}),window.addEventListener("load",t,!0),Array.prototype.forEach.call(document.querySelectorAll("[style]"),n),Array.prototype.forEach.call(document.styleSheets,(function(e){Array.prototype.forEach.call(e.cssRules||e.rules,n)})),document.body.style.position="absolute",document.body.style.width="100%",document.body.setAttribute("data-resizable-iframe-connected",""),t(),window.addEventListener("resize",t,!0)};const xL=function({html:e="",title:t="",type:n,styles:r=[],scripts:o=[],onFocus:i,tabIndex:s}){const a=(0,c.useRef)(),[u,d]=(0,c.useState)(0),[p,f]=(0,c.useState)(0);function h(i=!1){if(!function(){try{return!!a.current?.contentDocument?.body}catch(e){return!1}}())return;const{contentDocument:s,ownerDocument:l}=a.current;if(!i&&null!==s?.body.getAttribute("data-resizable-iframe-connected"))return;const u=(0,wt.jsxs)("html",{lang:l.documentElement.lang,className:n,children:[(0,wt.jsxs)("head",{children:[(0,wt.jsx)("title",{children:t}),(0,wt.jsx)("style",{dangerouslySetInnerHTML:{__html:"\n\tbody {\n\t\tmargin: 0;\n\t}\n\thtml,\n\tbody,\n\tbody > div {\n\t\twidth: 100%;\n\t}\n\thtml.wp-has-aspect-ratio,\n\tbody.wp-has-aspect-ratio,\n\tbody.wp-has-aspect-ratio > div,\n\tbody.wp-has-aspect-ratio > div iframe {\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\toverflow: hidden; /* If it has an aspect ratio, it shouldn't scroll. */\n\t}\n\tbody > div > * {\n\t\tmargin-top: 0 !important; /* Has to have !important to override inline styles. */\n\t\tmargin-bottom: 0 !important;\n\t}\n"}}),r.map(((e,t)=>(0,wt.jsx)("style",{dangerouslySetInnerHTML:{__html:e}},t)))]}),(0,wt.jsxs)("body",{"data-resizable-iframe-connected":"data-resizable-iframe-connected",className:n,children:[(0,wt.jsx)("div",{dangerouslySetInnerHTML:{__html:e}}),(0,wt.jsx)("script",{type:"text/javascript",dangerouslySetInnerHTML:{__html:`(${bL.toString()})();`}}),o.map((e=>(0,wt.jsx)("script",{src:e},e)))]})]});s.open(),s.write(""+(0,c.renderToString)(u)),s.close()}return(0,c.useEffect)((()=>{function e(){h(!1)}function t(e){const t=a.current;if(!t||t.contentWindow!==e.source)return;let n=e.data||{};if("string"==typeof n)try{n=JSON.parse(n)}catch(e){}"resize"===n.action&&(d(n.width),f(n.height))}h();const n=a.current,r=n?.ownerDocument?.defaultView;return n?.addEventListener("load",e,!1),r?.addEventListener("message",t),()=>{n?.removeEventListener("load",e,!1),r?.removeEventListener("message",t)}}),[]),(0,c.useEffect)((()=>{h()}),[t,r,o]),(0,c.useEffect)((()=>{h(!0)}),[e,n]),(0,wt.jsx)("iframe",{ref:(0,l.useMergeRefs)([a,(0,l.useFocusableIframe)()]),title:t,tabIndex:s,className:"components-sandbox",sandbox:"allow-scripts allow-same-origin allow-presentation",onFocus:i,width:Math.ceil(u),height:Math.ceil(p)})};const yL=(0,c.forwardRef)((function({className:e,children:t,spokenMessage:n=t,politeness:r="polite",actions:o=[],onRemove:i,icon:l=null,explicitDismiss:u=!1,onDismiss:d,listRef:p},f){function h(e){e&&e.preventDefault&&e.preventDefault(),p?.current?.focus(),d?.(),i?.()}!function(e,t){const n="string"==typeof e?e:(0,c.renderToString)(e);(0,c.useEffect)((()=>{n&&(0,my.speak)(n,t)}),[n,t])}(n,r);const m=(0,c.useRef)({onDismiss:d,onRemove:i});(0,c.useLayoutEffect)((()=>{m.current={onDismiss:d,onRemove:i}})),(0,c.useEffect)((()=>{const e=setTimeout((()=>{u||(m.current.onDismiss?.(),m.current.onRemove?.())}),1e4);return()=>clearTimeout(e)}),[u]);const g=s(e,"components-snackbar",{"components-snackbar-explicit-dismiss":!!u});o&&o.length>1&&(o=[o[0]]);const v=s("components-snackbar__content",{"components-snackbar__content-with-icon":!!l});return(0,wt.jsx)("div",{ref:f,className:g,onClick:u?void 0:h,tabIndex:0,role:u?void 0:"button",onKeyPress:u?void 0:h,"aria-label":u?void 0:(0,a.__)("Dismiss this notice"),"data-testid":"snackbar",children:(0,wt.jsxs)("div",{className:v,children:[l&&(0,wt.jsx)("div",{className:"components-snackbar__icon",children:l}),t,o.map((({label:e,onClick:t,url:n},r)=>(0,wt.jsx)($x,{href:n,variant:"tertiary",onClick:e=>function(e,t){e.stopPropagation(),i?.(),t&&t(e)}(e,t),className:"components-snackbar__action",children:e},r))),u&&(0,wt.jsx)("span",{role:"button","aria-label":(0,a.__)("Dismiss this notice"),tabIndex:0,className:"components-snackbar__dismiss-button",onClick:h,onKeyPress:h,children:"✕"})]})})})),wL=yL,_L={init:{height:0,opacity:0},open:{height:"auto",opacity:1,transition:{height:{type:"tween",duration:.3,ease:[0,0,.2,1]},opacity:{type:"tween",duration:.25,delay:.05,ease:[0,0,.2,1]}}},exit:{opacity:0,transition:{type:"tween",duration:.1,ease:[0,0,.2,1]}}};const SL=function({notices:e,className:t,children:n,onRemove:r}){const o=(0,c.useRef)(null),i=(0,l.useReducedMotion)();t=s("components-snackbar-list",t);const a=e=>()=>r?.(e.id);return(0,wt.jsxs)("div",{className:t,tabIndex:-1,ref:o,"data-testid":"snackbar-list",children:[n,(0,wt.jsx)(og,{children:e.map((e=>{const{content:t,...n}=e;return(0,wt.jsx)(Xm.div,{layout:!i,initial:"init",animate:"open",exit:"exit",variants:i?void 0:_L,children:(0,wt.jsx)("div",{className:"components-snackbar-list__notice-container",children:(0,wt.jsx)(wL,{...n,onRemove:a(e),listRef:o,children:e.content})})},e.id)}))})]})};const CL=xl` +function ds(e){return"[object Object]"===Object.prototype.toString.call(e)}function ps(e){var t,n;return!1!==ds(e)&&(void 0===(t=e.constructor)||!1!==ds(n=t.prototype)&&!1!==n.hasOwnProperty("isPrototypeOf"))}const fs=function(e,t){const n=(0,c.useRef)(!1);(0,c.useEffect)((()=>{if(n.current)return e();n.current=!0}),t),(0,c.useEffect)((()=>()=>{n.current=!1}),[])},hs=(0,c.createContext)({}),ms=()=>(0,c.useContext)(hs);const gs=(0,c.memo)((({children:e,value:t})=>{const n=function({value:e}){const t=ms(),n=(0,c.useRef)(e);return fs((()=>{us()(n.current,e)&&n.current}),[e]),(0,c.useMemo)((()=>ls()(null!=t?t:{},null!=e?e:{},{isMergeableObject:ps})),[t,e])}({value:t});return(0,_t.jsx)(hs.Provider,{value:n,children:e})})),vs="data-wp-component",bs="data-wp-c16t",xs="__contextSystemKey__";var ys=function(){return ys=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0?zs(Gs,--Ws):0,$s--,10===Us&&($s=1,Vs--),Us}function Xs(){return Us=Ws2||ea(Us)>3?"":" "}function ia(e,t){for(;--t&&Xs()&&!(Us<48||Us>102||Us>57&&Us<65||Us>70&&Us<97););return Js(e,Qs()+(t<6&&32==Zs()&&32==Xs()))}function sa(e){for(;Xs();)switch(Us){case e:return Ws;case 34:case 39:34!==e&&39!==e&&sa(Us);break;case 40:41===e&&sa(e);break;case 92:Xs()}return Ws}function aa(e,t){for(;Xs()&&e+Us!==57&&(e+Us!==84||47!==Zs()););return"/*"+Js(t,Ws-1)+"*"+Is(47===e?e:Xs())}function la(e){for(;!ea(Zs());)Xs();return Js(e,Ws)}var ca="-ms-",ua="-moz-",da="-webkit-",pa="comm",fa="rule",ha="decl",ma="@keyframes";function ga(e,t){for(var n="",r=Fs(e),o=0;o0&&Ls(S)-d&&Bs(f>32?_a(S+";",r,n,d-1):_a(As(S," ","")+";",r,n,d-2),l);break;case 59:S+=";";default:if(Bs(_=ya(S,t,n,c,u,o,a,x,y=[],w=[],d),i),123===b)if(0===u)xa(S,t,_,_,y,i,d,a,w);else switch(99===p&&110===zs(S,3)?100:p){case 100:case 109:case 115:xa(e,_,_,r&&Bs(ya(e,_,_,0,0,o,a,x,o,y=[],d),w),o,w,d,a,r?y:w);break;default:xa(S,_,_,_,[""],w,0,a,w)}}c=u=f=0,m=v=1,x=S="",d=s;break;case 58:d=1+Ls(S),f=h;default:if(m<1)if(123==b)--m;else if(125==b&&0==m++&&125==Ys())continue;switch(S+=Is(b),b*m){case 38:v=u>0?1:(S+="\f",-1);break;case 44:a[c++]=(Ls(S)-1)*v,v=1;break;case 64:45===Zs()&&(S+=ra(Xs())),p=Zs(),u=d=Ls(x=S+=la(Qs())),b++;break;case 45:45===h&&2==Ls(S)&&(m=0)}}return i}function ya(e,t,n,r,o,i,s,a,l,c,u){for(var d=o-1,p=0===o?i:[""],f=Fs(p),h=0,m=0,g=0;h0?p[v]+" "+b:As(b,/&\f/g,p[v])))&&(l[g++]=x);return Ks(e,t,n,0===o?fa:a,l,c,u)}function wa(e,t,n){return Ks(e,t,n,pa,Is(Us),Os(e,2,-2),0)}function _a(e,t,n,r){return Ks(e,t,n,ha,Os(e,0,r),Os(e,r+1,-1),r)}var Sa=function(e,t,n){for(var r=0,o=0;r=o,o=Zs(),38===r&&12===o&&(t[n]=1),!ea(o);)Xs();return Js(e,Ws)},Ca=function(e,t){return na(function(e,t){var n=-1,r=44;do{switch(ea(r)){case 0:38===r&&12===Zs()&&(t[n]=1),e[n]+=Sa(Ws-1,t,n);break;case 2:e[n]+=ra(r);break;case 4:if(44===r){e[++n]=58===Zs()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=Is(r)}}while(r=Xs());return e}(ta(e),t))},ka=new WeakMap,ja=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,n=e.parent,r=e.column===n.column&&e.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||ka.get(n))&&!r){ka.set(e,!0);for(var o=[],i=Ca(t,o),s=n.props,a=0,l=0;a6)switch(zs(e,t+1)){case 109:if(45!==zs(e,t+4))break;case 102:return As(e,/(.+:)(.+)-([^]+)/,"$1"+da+"$2-$3$1"+ua+(108==zs(e,t+3)?"$3":"$2-$3"))+e;case 115:return~Ds(e,"stretch")?Pa(As(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==zs(e,t+1))break;case 6444:switch(zs(e,Ls(e)-3-(~Ds(e,"!important")&&10))){case 107:return As(e,":",":"+da)+e;case 101:return As(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+da+(45===zs(e,14)?"inline-":"")+"box$3$1"+da+"$2$3$1"+ca+"$2box$3")+e}break;case 5936:switch(zs(e,t+11)){case 114:return da+e+ca+As(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return da+e+ca+As(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return da+e+ca+As(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return da+e+ca+e+e}return e}var Na=[function(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case ha:e.return=Pa(e.value,e.length);break;case ma:return ga([qs(e,{value:As(e.value,"@","@"+da)})],r);case fa:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,(function(t){switch(function(e,t){return(e=t.exec(e))?e[0]:e}(t,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return ga([qs(e,{props:[As(t,/:(read-\w+)/,":-moz-$1")]})],r);case"::placeholder":return ga([qs(e,{props:[As(t,/:(plac\w+)/,":"+da+"input-$1")]}),qs(e,{props:[As(t,/:(plac\w+)/,":-moz-$1")]}),qs(e,{props:[As(t,/:(plac\w+)/,ca+"input-$1")]})],r)}return""}))}}];const Ta=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,(function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))}))}var r=e.stylisPlugins||Na;var o,i,s={},a=[];o=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),(function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n=4;++r,o-=4)t=1540483477*(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(o){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)};const Ra={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function Ma(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var Aa=/[A-Z]|^ms/g,Da=/_EMO_([^_]+?)_([^]*?)_EMO_/g,za=function(e){return 45===e.charCodeAt(1)},Oa=function(e){return null!=e&&"boolean"!=typeof e},La=Ma((function(e){return za(e)?e:e.replace(Aa,"-$&").toLowerCase()})),Fa=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(Da,(function(e,t,n){return Va={name:t,styles:n,next:Va},t}))}return 1===Ra[e]||za(e)||"number"!=typeof t||0===t?t:t+"px"};function Ba(e,t,n){if(null==n)return"";if(void 0!==n.__emotion_styles)return n;switch(typeof n){case"boolean":return"";case"object":if(1===n.anim)return Va={name:n.name,styles:n.styles,next:Va},n.name;if(void 0!==n.styles){var r=n.next;if(void 0!==r)for(;void 0!==r;)Va={name:r.name,styles:r.styles,next:Va},r=r.next;return n.styles+";"}return function(e,t,n){var r="";if(Array.isArray(n))for(var o=0;o{const e=(0,B.useContext)(Ga),t=(0,c.useCallback)(((...t)=>{if(null===e)throw new Error("The `useCx` hook should be only used within a valid Emotion Cache Context");return ol(...t.map((t=>(e=>null!=e&&["name","styles"].every((t=>void 0!==e[t])))(t)?(Qa(e,t,!1),`${e.key}-${t.name}`):t)))}),[e]);return t};function sl(e,t){const n=ms(),r=n?.[t]||{},o={[bs]:!0,...(i=t,{[vs]:i})};var i;const{_overrides:s,...a}=r,l=Object.entries(a).length?Object.assign({},a,e):e,c=il()(Ps(t),e.className),u="function"==typeof l.renderChildren?l.renderChildren(l):l.children;for(const e in l)o[e]=l[e];for(const e in s)o[e]=s[e];return void 0!==u&&(o.children=u),o.className=c,o}function al(e,t){return cl(e,t,{forwardsRef:!0})}function ll(e,t){return cl(e,t)}function cl(e,t,n){const r=n?.forwardsRef?(0,c.forwardRef)(e):e;let o=r[xs]||[t];return Array.isArray(t)&&(o=[...o,...t]),"string"==typeof t&&(o=[...o,t]),Object.assign(r,{[xs]:[...new Set(o)],displayName:t,selector:`.${Ps(t)}`})}function ul(e){if(!e)return[];let t=[];return e[xs]&&(t=e[xs]),e.type&&e.type[xs]&&(t=e.type[xs]),t}function dl(e,t){return!!e&&("string"==typeof t?ul(e).includes(t):!!Array.isArray(t)&&t.some((t=>ul(e).includes(t))))}const pl={border:0,clip:"rect(1px, 1px, 1px, 1px)",WebkitClipPath:"inset( 50% )",clipPath:"inset( 50% )",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",wordWrap:"normal"};function fl(){return fl=Object.assign?Object.assign.bind():function(e){for(var t=1;t96?ml:gl},bl=function(e,t,n){var r;if(t){var o=t.shouldForwardProp;r=e.__emotion_forwardProp&&o?function(t){return e.__emotion_forwardProp(t)&&o(t)}:o}return"function"!=typeof r&&n&&(r=e.__emotion_forwardProp),r},xl=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;Za(t,n,r);Ua((function(){return Qa(t,n,r)}));return null};const yl=function e(t,n){var r,o,i=t.__emotion_real===t,s=i&&t.__emotion_base||t;void 0!==n&&(r=n.label,o=n.target);var a=bl(t,n,i),l=a||vl(s),c=!l("as");return function(){var u=arguments,d=i&&void 0!==t.__emotion_styles?t.__emotion_styles.slice(0):[];if(void 0!==r&&d.push("label:"+r+";"),null==u[0]||void 0===u[0].raw)d.push.apply(d,u);else{0,d.push(u[0][0]);for(var p=u.length,f=1;fNl("direction:ltr;display:grid;grid-template-columns:repeat( 3, 1fr );grid-template-rows:repeat( 3, 1fr );box-sizing:border-box;width:",e,"px;aspect-ratio:1;border-radius:",Fl.radiusMedium,";outline:none;","");var Vl={name:"e0dnmk",styles:"cursor:pointer"};const $l=yl("div",{target:"e1r95csn3"})(Bl," border:1px solid transparent;",(e=>e.disablePointerEvents?Nl("",""):Vl),";"),Hl=yl("div",{target:"e1r95csn2"})({name:"1fbxn64",styles:"grid-column:1/-1;box-sizing:border-box;display:grid;grid-template-columns:repeat( 3, 1fr )"}),Wl=yl("span",{target:"e1r95csn1"})({name:"e2kws5",styles:"position:relative;display:flex;align-items:center;justify-content:center;box-sizing:border-box;margin:0;padding:0;appearance:none;border:none;outline:none"}),Ul=yl("span",{target:"e1r95csn0"})("display:block;contain:strict;box-sizing:border-box;width:",6,"px;aspect-ratio:1;margin:auto;color:",zl.theme.gray[400],";border:",3,"px solid currentColor;",Wl,"[data-active-item] &{color:",zl.gray[900],";transform:scale( calc( 5 / 3 ) );}",Wl,":not([data-active-item]):hover &{color:",zl.theme.accent,";}",Wl,"[data-focus-visible] &{outline:1px solid ",zl.theme.accent,";outline-offset:1px;}@media not ( prefers-reduced-motion ){transition-property:color,transform;transition-duration:120ms;transition-timing-function:linear;}");function Gl({id:e,value:t,...n}){return(0,_t.jsx)(ss,{text:kl[t],children:(0,_t.jsxs)(Gn.Item,{id:e,render:(0,_t.jsx)(Wl,{...n,role:"gridcell"}),children:[(0,_t.jsx)(Sl,{children:t}),(0,_t.jsx)(Ul,{role:"presentation"})]})})}const Kl=function({className:e,disablePointerEvents:t=!0,size:r,width:o,height:i,style:a={},value:l="center",...c}){var u,d;return(0,_t.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:null!==(u=null!=r?r:o)&&void 0!==u?u:24,height:null!==(d=null!=r?r:i)&&void 0!==d?d:24,role:"presentation",className:s("component-alignment-matrix-control-icon",e),style:{pointerEvents:t?"none":void 0,...a},...c,children:jl.map(((e,t)=>{const r=function(e="center"){const t=El(e);if(!t)return;const n=jl.indexOf(t);return n>-1?n:void 0}(l)===t?4:2;return(0,_t.jsx)(n.Rect,{x:1.5+t%3*7+(7-r)/2,y:1.5+7*Math.floor(t/3)+(7-r)/2,width:r,height:r,fill:"currentColor"},e)}))})};const ql=Object.assign((function e({className:t,id:n,label:r=(0,a.__)("Alignment Matrix Control"),defaultValue:o="center center",value:i,onChange:u,width:d=92,...p}){const f=(0,l.useInstanceId)(e,"alignment-matrix-control",n),h=(0,c.useCallback)((e=>{const t=function(e,t){const n=t?.replace(e+"-","");return El(n)}(f,e);t&&u?.(t)}),[f,u]),m=s("component-alignment-matrix-control",t);return(0,_t.jsx)(Gn,{defaultActiveId:Pl(f,o),activeId:Pl(f,i),setActiveId:h,rtl:(0,a.isRTL)(),render:(0,_t.jsx)($l,{...p,"aria-label":r,className:m,id:f,role:"grid",size:d}),children:Cl.map(((e,t)=>(0,_t.jsx)(Gn.Row,{render:(0,_t.jsx)(Hl,{role:"row"}),children:e.map((e=>(0,_t.jsx)(Gl,{id:Pl(f,e),value:e},e)))},t)))})}),{Icon:Object.assign(Kl,{displayName:"AlignmentMatrixControl.Icon"})}),Yl=ql;function Xl(e){return"appear"===e?"top":"left"}function Zl(e){if("loading"===e.type)return"components-animate__loading";const{type:t,origin:n=Xl(t)}=e;if("appear"===t){const[e,t="center"]=n.split(" ");return s("components-animate__appear",{["is-from-"+t]:"center"!==t,["is-from-"+e]:"middle"!==e})}return"slide-in"===t?s("components-animate__slide-in","is-from-"+n):void 0}const Ql=function({type:e,options:t={},children:n}){return n({className:Zl({type:e,...t})})},Jl=(0,B.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),ec=(0,B.createContext)({}),tc=(0,B.createContext)(null),nc="undefined"!=typeof document,rc=nc?B.useLayoutEffect:B.useEffect,oc=(0,B.createContext)({strict:!1}),ic=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),sc="data-"+ic("framerAppearId"),ac=!1,lc=!1;class cc{constructor(){this.order=[],this.scheduled=new Set}add(e){if(!this.scheduled.has(e))return this.scheduled.add(e),this.order.push(e),!0}remove(e){const t=this.order.indexOf(e);-1!==t&&(this.order.splice(t,1),this.scheduled.delete(e))}clear(){this.order.length=0,this.scheduled.clear()}}const uc=["read","resolveKeyframes","update","preRender","render","postRender"];function dc(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},i=uc.reduce(((e,t)=>(e[t]=function(e){let t=new cc,n=new cc,r=0,o=!1,i=!1;const s=new WeakSet,a={schedule:(e,i=!1,a=!1)=>{const l=a&&o,c=l?t:n;return i&&s.add(e),c.add(e)&&l&&o&&(r=t.order.length),e},cancel:e=>{n.remove(e),s.delete(e)},process:l=>{if(o)i=!0;else{if(o=!0,[t,n]=[n,t],n.clear(),r=t.order.length,r)for(let n=0;nn=!0)),e)),{}),s=e=>{i[e].process(o)},a=()=>{const i=lc?o.timestamp:performance.now();n=!1,o.delta=r?1e3/60:Math.max(Math.min(i-o.timestamp,40),1),o.timestamp=i,o.isProcessing=!0,uc.forEach(s),o.isProcessing=!1,n&&t&&(r=!1,e(a))};return{schedule:uc.reduce(((t,s)=>{const l=i[s];return t[s]=(t,i=!1,s=!1)=>(n||(n=!0,r=!0,o.isProcessing||e(a)),l.schedule(t,i,s)),t}),{}),cancel:e=>uc.forEach((t=>i[t].cancel(e))),state:o,steps:i}}const{schedule:pc,cancel:fc}=dc(queueMicrotask,!1);function hc(e){return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}function mc(e,t,n){return(0,B.useCallback)((r=>{r&&e.mount&&e.mount(r),t&&(r?t.mount(r):t.unmount()),n&&("function"==typeof n?n(r):hc(n)&&(n.current=r))}),[t])}function gc(e){return"string"==typeof e||Array.isArray(e)}function vc(e){return null!==e&&"object"==typeof e&&"function"==typeof e.start}const bc=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],xc=["initial",...bc];function yc(e){return vc(e.animate)||xc.some((t=>gc(e[t])))}function wc(e){return Boolean(yc(e)||e.variants)}function _c(e){const{initial:t,animate:n}=function(e,t){if(yc(e)){const{initial:t,animate:n}=e;return{initial:!1===t||gc(t)?t:void 0,animate:gc(n)?n:void 0}}return!1!==e.inherit?t:{}}(e,(0,B.useContext)(ec));return(0,B.useMemo)((()=>({initial:t,animate:n})),[Sc(t),Sc(n)])}function Sc(e){return Array.isArray(e)?e.join(" "):e}const Cc={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},kc={};for(const e in Cc)kc[e]={isEnabled:t=>Cc[e].some((e=>!!t[e]))};const jc=(0,B.createContext)({}),Ec=(0,B.createContext)({}),Pc=Symbol.for("motionComponentSymbol");function Nc({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:o}){e&&function(e){for(const t in e)kc[t]={...kc[t],...e[t]}}(e);const i=(0,B.forwardRef)((function(i,s){let a;const l={...(0,B.useContext)(Jl),...i,layoutId:Tc(i)},{isStatic:c}=l,u=_c(i),d=r(i,c);if(!c&&nc){u.visualElement=function(e,t,n,r){const{visualElement:o}=(0,B.useContext)(ec),i=(0,B.useContext)(oc),s=(0,B.useContext)(tc),a=(0,B.useContext)(Jl).reducedMotion,l=(0,B.useRef)();r=r||i.renderer,!l.current&&r&&(l.current=r(e,{visualState:t,parent:o,props:n,presenceContext:s,blockInitialAnimation:!!s&&!1===s.initial,reducedMotionConfig:a}));const c=l.current;(0,B.useInsertionEffect)((()=>{c&&c.update(n,s)}));const u=(0,B.useRef)(Boolean(n[sc]&&!window.HandoffComplete));return rc((()=>{c&&(pc.render(c.render),u.current&&c.animationState&&c.animationState.animateChanges())})),(0,B.useEffect)((()=>{c&&(c.updateFeatures(),!u.current&&c.animationState&&c.animationState.animateChanges(),u.current&&(u.current=!1,window.HandoffComplete=!0))})),c}(o,d,l,t);const n=(0,B.useContext)(Ec),r=(0,B.useContext)(oc).strict;u.visualElement&&(a=u.visualElement.loadFeatures(l,r,e,n))}return(0,_t.jsxs)(ec.Provider,{value:u,children:[a&&u.visualElement?(0,_t.jsx)(a,{visualElement:u.visualElement,...l}):null,n(o,i,mc(d,u.visualElement,s),d,c,u.visualElement)]})}));return i[Pc]=o,i}function Tc({layoutId:e}){const t=(0,B.useContext)(jc).id;return t&&void 0!==e?t+"-"+e:e}function Ic(e){function t(t,n={}){return Nc(e(t,n))}if("undefined"==typeof Proxy)return t;const n=new Map;return new Proxy(t,{get:(e,r)=>(n.has(r)||n.set(r,t(r)),n.get(r))})}const Rc=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Mc(e){return"string"==typeof e&&!e.includes("-")&&!!(Rc.indexOf(e)>-1||/[A-Z]/u.test(e))}const Ac={};const Dc=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],zc=new Set(Dc);function Oc(e,{layout:t,layoutId:n}){return zc.has(e)||e.startsWith("origin")||(t||void 0!==n)&&(!!Ac[e]||"opacity"===e)}const Lc=e=>Boolean(e&&e.getVelocity),Fc={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Bc=Dc.length;const Vc=e=>t=>"string"==typeof t&&t.startsWith(e),$c=Vc("--"),Hc=Vc("var(--"),Wc=e=>!!Hc(e)&&Uc.test(e.split("/*")[0].trim()),Uc=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Gc=(e,t)=>t&&"number"==typeof e?t.transform(e):e,Kc=(e,t,n)=>n>t?t:n"number"==typeof e,parse:parseFloat,transform:e=>e},Yc={...qc,transform:e=>Kc(0,1,e)},Xc={...qc,default:1},Zc=e=>Math.round(1e5*e)/1e5,Qc=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,Jc=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,eu=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;function tu(e){return"string"==typeof e}const nu=e=>({test:t=>tu(t)&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}),ru=nu("deg"),ou=nu("%"),iu=nu("px"),su=nu("vh"),au=nu("vw"),lu={...ou,parse:e=>ou.parse(e)/100,transform:e=>ou.transform(100*e)},cu={...qc,transform:Math.round},uu={borderWidth:iu,borderTopWidth:iu,borderRightWidth:iu,borderBottomWidth:iu,borderLeftWidth:iu,borderRadius:iu,radius:iu,borderTopLeftRadius:iu,borderTopRightRadius:iu,borderBottomRightRadius:iu,borderBottomLeftRadius:iu,width:iu,maxWidth:iu,height:iu,maxHeight:iu,size:iu,top:iu,right:iu,bottom:iu,left:iu,padding:iu,paddingTop:iu,paddingRight:iu,paddingBottom:iu,paddingLeft:iu,margin:iu,marginTop:iu,marginRight:iu,marginBottom:iu,marginLeft:iu,rotate:ru,rotateX:ru,rotateY:ru,rotateZ:ru,scale:Xc,scaleX:Xc,scaleY:Xc,scaleZ:Xc,skew:ru,skewX:ru,skewY:ru,distance:iu,translateX:iu,translateY:iu,translateZ:iu,x:iu,y:iu,z:iu,perspective:iu,transformPerspective:iu,opacity:Yc,originX:lu,originY:lu,originZ:iu,zIndex:cu,backgroundPositionX:iu,backgroundPositionY:iu,fillOpacity:Yc,strokeOpacity:Yc,numOctaves:cu};function du(e,t,n,r){const{style:o,vars:i,transform:s,transformOrigin:a}=e;let l=!1,c=!1,u=!0;for(const e in t){const n=t[e];if($c(e)){i[e]=n;continue}const r=uu[e],d=Gc(n,r);if(zc.has(e)){if(l=!0,s[e]=d,!u)continue;n!==(r.default||0)&&(u=!1)}else e.startsWith("origin")?(c=!0,a[e]=d):o[e]=d}if(t.transform||(l||r?o.transform=function(e,{enableHardwareAcceleration:t=!0,allowTransformNone:n=!0},r,o){let i="";for(let t=0;t({style:{},transform:{},transformOrigin:{},vars:{}});function fu(e,t,n){for(const r in t)Lc(t[r])||Oc(r,n)||(e[r]=t[r])}function hu(e,t,n){const r={};return fu(r,e.style||{},e),Object.assign(r,function({transformTemplate:e},t,n){return(0,B.useMemo)((()=>{const r={style:{},transform:{},transformOrigin:{},vars:{}};return du(r,t,{enableHardwareAcceleration:!n},e),Object.assign({},r.vars,r.style)}),[t])}(e,t,n)),r}function mu(e,t,n){const r={},o=hu(e,t,n);return e.drag&&!1!==e.dragListener&&(r.draggable=!1,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.touchAction=!0===e.drag?"none":"pan-"+("x"===e.drag?"y":"x")),void 0===e.tabIndex&&(e.onTap||e.onTapStart||e.whileTap)&&(r.tabIndex=0),r.style=o,r}const gu=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function vu(e){return e.startsWith("while")||e.startsWith("drag")&&"draggable"!==e||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||gu.has(e)}let bu=e=>!vu(e);try{(xu=require("@emotion/is-prop-valid").default)&&(bu=e=>e.startsWith("on")?!vu(e):xu(e))}catch(U){}var xu;function yu(e,t,n){return"string"==typeof e?e:iu.transform(t+n*e)}const wu={offset:"stroke-dashoffset",array:"stroke-dasharray"},_u={offset:"strokeDashoffset",array:"strokeDasharray"};function Su(e,{attrX:t,attrY:n,attrScale:r,originX:o,originY:i,pathLength:s,pathSpacing:a=1,pathOffset:l=0,...c},u,d,p){if(du(e,c,u,p),d)return void(e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox));e.attrs=e.style,e.style={};const{attrs:f,style:h,dimensions:m}=e;f.transform&&(m&&(h.transform=f.transform),delete f.transform),m&&(void 0!==o||void 0!==i||h.transform)&&(h.transformOrigin=function(e,t,n){return`${yu(t,e.x,e.width)} ${yu(n,e.y,e.height)}`}(m,void 0!==o?o:.5,void 0!==i?i:.5)),void 0!==t&&(f.x=t),void 0!==n&&(f.y=n),void 0!==r&&(f.scale=r),void 0!==s&&function(e,t,n=1,r=0,o=!0){e.pathLength=1;const i=o?wu:_u;e[i.offset]=iu.transform(-r);const s=iu.transform(t),a=iu.transform(n);e[i.array]=`${s} ${a}`}(f,s,a,l,!1)}const Cu=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}}),ku=e=>"string"==typeof e&&"svg"===e.toLowerCase();function ju(e,t,n,r){const o=(0,B.useMemo)((()=>{const n={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return Su(n,t,{enableHardwareAcceleration:!1},ku(r),e.transformTemplate),{...n.attrs,style:{...n.style}}}),[t]);if(e.style){const t={};fu(t,e.style,e),o.style={...t,...o.style}}return o}function Eu(e=!1){return(t,n,r,{latestValues:o},i)=>{const s=(Mc(t)?ju:mu)(n,o,i,t),a=function(e,t,n){const r={};for(const o in e)"values"===o&&"object"==typeof e.values||(bu(o)||!0===n&&vu(o)||!t&&!vu(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}(n,"string"==typeof t,e),l=t!==B.Fragment?{...a,...s,ref:r}:{},{children:c}=n,u=(0,B.useMemo)((()=>Lc(c)?c.get():c),[c]);return(0,B.createElement)(t,{...l,children:u})}}function Pu(e,{style:t,vars:n},r,o){Object.assign(e.style,t,o&&o.getProjectionStyles(r));for(const t in n)e.style.setProperty(t,n[t])}const Nu=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Tu(e,t,n,r){Pu(e,t,void 0,r);for(const n in t.attrs)e.setAttribute(Nu.has(n)?n:ic(n),t.attrs[n])}function Iu(e,t,n){var r;const{style:o}=e,i={};for(const s in o)(Lc(o[s])||t.style&&Lc(t.style[s])||Oc(s,e)||void 0!==(null===(r=null==n?void 0:n.getValue(s))||void 0===r?void 0:r.liveStyle))&&(i[s]=o[s]);return i}function Ru(e,t,n){const r=Iu(e,t,n);for(const n in e)if(Lc(e[n])||Lc(t[n])){r[-1!==Dc.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=e[n]}return r}function Mu(e){const t=[{},{}];return null==e||e.values.forEach(((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()})),t}function Au(e,t,n,r){if("function"==typeof t){const[o,i]=Mu(r);t=t(void 0!==n?n:e.custom,o,i)}if("string"==typeof t&&(t=e.variants&&e.variants[t]),"function"==typeof t){const[o,i]=Mu(r);t=t(void 0!==n?n:e.custom,o,i)}return t}function Du(e){const t=(0,B.useRef)(null);return null===t.current&&(t.current=e()),t.current}const zu=e=>Array.isArray(e),Ou=e=>zu(e)?e[e.length-1]||0:e;function Lu(e){const t=Lc(e)?e.get():e;return(e=>Boolean(e&&"object"==typeof e&&e.mix&&e.toValue))(t)?t.toValue():t}const Fu=e=>(t,n)=>{const r=(0,B.useContext)(ec),o=(0,B.useContext)(tc),i=()=>function({scrapeMotionValuesFromProps:e,createRenderState:t,onMount:n},r,o,i){const s={latestValues:Bu(r,o,i,e),renderState:t()};return n&&(s.mount=e=>n(r,e,s)),s}(e,t,r,o);return n?i():Du(i)};function Bu(e,t,n,r){const o={},i=r(e,{});for(const e in i)o[e]=Lu(i[e]);let{initial:s,animate:a}=e;const l=yc(e),c=wc(e);t&&c&&!l&&!1!==e.inherit&&(void 0===s&&(s=t.initial),void 0===a&&(a=t.animate));let u=!!n&&!1===n.initial;u=u||!1===s;const d=u?a:s;if(d&&"boolean"!=typeof d&&!vc(d)){(Array.isArray(d)?d:[d]).forEach((t=>{const n=Au(e,t);if(!n)return;const{transitionEnd:r,transition:i,...s}=n;for(const e in s){let t=s[e];if(Array.isArray(t)){t=t[u?t.length-1:0]}null!==t&&(o[e]=t)}for(const e in r)o[e]=r[e]}))}return o}const Vu=e=>e,{schedule:$u,cancel:Hu,state:Wu,steps:Uu}=dc("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:Vu,!0),Gu={useVisualState:Fu({scrapeMotionValuesFromProps:Ru,createRenderState:Cu,onMount:(e,t,{renderState:n,latestValues:r})=>{$u.read((()=>{try{n.dimensions="function"==typeof t.getBBox?t.getBBox():t.getBoundingClientRect()}catch(e){n.dimensions={x:0,y:0,width:0,height:0}}})),$u.render((()=>{Su(n,r,{enableHardwareAcceleration:!1},ku(t.tagName),e.transformTemplate),Tu(t,n)}))}})},Ku={useVisualState:Fu({scrapeMotionValuesFromProps:Iu,createRenderState:pu})};function qu(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const Yu=e=>"mouse"===e.pointerType?"number"!=typeof e.button||e.button<=0:!1!==e.isPrimary;function Xu(e,t="page"){return{point:{x:e[`${t}X`],y:e[`${t}Y`]}}}function Zu(e,t,n,r){return qu(e,t,(e=>t=>Yu(t)&&e(t,Xu(t)))(n),r)}const Qu=(e,t)=>n=>t(e(n)),Ju=(...e)=>e.reduce(Qu);function ed(e){let t=null;return()=>{const n=()=>{t=null};return null===t&&(t=e,n)}}const td=ed("dragHorizontal"),nd=ed("dragVertical");function rd(e){let t=!1;if("y"===e)t=nd();else if("x"===e)t=td();else{const e=td(),n=nd();e&&n?t=()=>{e(),n()}:(e&&e(),n&&n())}return t}function od(){const e=rd(!0);return!e||(e(),!1)}class id{constructor(e){this.isMounted=!1,this.node=e}update(){}}function sd(e,t){const n=t?"pointerenter":"pointerleave",r=t?"onHoverStart":"onHoverEnd";return Zu(e.current,n,((n,o)=>{if("touch"===n.pointerType||od())return;const i=e.getProps();e.animationState&&i.whileHover&&e.animationState.setActive("whileHover",t);const s=i[r];s&&$u.postRender((()=>s(n,o)))}),{passive:!e.getProps()[r]})}const ad=(e,t)=>!!t&&(e===t||ad(e,t.parentElement));function ld(e,t){if(!t)return;const n=new PointerEvent("pointer"+e);t(n,Xu(n))}const cd=new WeakMap,ud=new WeakMap,dd=e=>{const t=cd.get(e.target);t&&t(e)},pd=e=>{e.forEach(dd)};function fd(e,t,n){const r=function({root:e,...t}){const n=e||document;ud.has(n)||ud.set(n,{});const r=ud.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(pd,{root:e,...t})),r[o]}(t);return cd.set(e,n),r.observe(e),()=>{cd.delete(e),r.unobserve(e)}}const hd={some:0,all:1};const md={inView:{Feature:class extends id{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r="some",once:o}=e,i={root:t?t.current:void 0,rootMargin:n,threshold:"number"==typeof r?r:hd[r]};return fd(this.node.current,i,(e=>{const{isIntersecting:t}=e;if(this.isInView===t)return;if(this.isInView=t,o&&!t&&this.hasEnteredView)return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",t);const{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),i=t?n:r;i&&i(e)}))}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:e,prevProps:t}=this.node;["amount","margin","root"].some(function({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}(e,t))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends id{constructor(){super(...arguments),this.removeStartListeners=Vu,this.removeEndListeners=Vu,this.removeAccessibleListeners=Vu,this.startPointerPress=(e,t)=>{if(this.isPressing)return;this.removeEndListeners();const n=this.node.getProps(),r=Zu(window,"pointerup",((e,t)=>{if(!this.checkPressEnd())return;const{onTap:n,onTapCancel:r,globalTapTarget:o}=this.node.getProps(),i=o||ad(this.node.current,e.target)?n:r;i&&$u.update((()=>i(e,t)))}),{passive:!(n.onTap||n.onPointerUp)}),o=Zu(window,"pointercancel",((e,t)=>this.cancelPress(e,t)),{passive:!(n.onTapCancel||n.onPointerCancel)});this.removeEndListeners=Ju(r,o),this.startPress(e,t)},this.startAccessiblePress=()=>{const e=qu(this.node.current,"keydown",(e=>{if("Enter"!==e.key||this.isPressing)return;this.removeEndListeners(),this.removeEndListeners=qu(this.node.current,"keyup",(e=>{"Enter"===e.key&&this.checkPressEnd()&&ld("up",((e,t)=>{const{onTap:n}=this.node.getProps();n&&$u.postRender((()=>n(e,t)))}))})),ld("down",((e,t)=>{this.startPress(e,t)}))})),t=qu(this.node.current,"blur",(()=>{this.isPressing&&ld("cancel",((e,t)=>this.cancelPress(e,t)))}));this.removeAccessibleListeners=Ju(e,t)}}startPress(e,t){this.isPressing=!0;const{onTapStart:n,whileTap:r}=this.node.getProps();r&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),n&&$u.postRender((()=>n(e,t)))}checkPressEnd(){this.removeEndListeners(),this.isPressing=!1;return this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!od()}cancelPress(e,t){if(!this.checkPressEnd())return;const{onTapCancel:n}=this.node.getProps();n&&$u.postRender((()=>n(e,t)))}mount(){const e=this.node.getProps(),t=Zu(e.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(e.onTapStart||e.onPointerStart)}),n=qu(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=Ju(t,n)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}},focus:{Feature:class extends id{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch(t){e=!0}e&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Ju(qu(this.node.current,"focus",(()=>this.onFocus())),qu(this.node.current,"blur",(()=>this.onBlur())))}unmount(){}}},hover:{Feature:class extends id{mount(){this.unmount=Ju(sd(this.node,!0),sd(this.node,!1))}unmount(){}}}};function gd(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r1e3*e,xd=e=>e/1e3,yd={type:"spring",stiffness:500,damping:25,restSpeed:10},wd={type:"keyframes",duration:.8},_d={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Sd=(e,{keyframes:t})=>t.length>2?wd:zc.has(e)?e.startsWith("scale")?{type:"spring",stiffness:550,damping:0===t[1]?2*Math.sqrt(550):30,restSpeed:10}:yd:_d;function Cd(e,t){return e[t]||e.default||e}const kd=!1,jd=e=>null!==e;function Ed(e,{repeat:t,repeatType:n="loop"},r){const o=e.filter(jd),i=t&&"loop"!==n&&t%2==1?0:o.length-1;return i&&void 0!==r?r:o[i]}let Pd;function Nd(){Pd=void 0}const Td={now:()=>(void 0===Pd&&Td.set(Wu.isProcessing||lc?Wu.timestamp:performance.now()),Pd),set:e=>{Pd=e,queueMicrotask(Nd)}},Id=e=>/^0[^.\s]+$/u.test(e);let Rd=Vu,Md=Vu;const Ad=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Dd=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function zd(e,t,n=1){Md(n<=4,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[r,o]=function(e){const t=Dd.exec(e);if(!t)return[,];const[,n,r,o]=t;return[`--${null!=n?n:r}`,o]}(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const e=i.trim();return Ad(e)?parseFloat(e):e}return Wc(o)?zd(o,t,n+1):o}const Od=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),Ld=e=>e===qc||e===iu,Fd=(e,t)=>parseFloat(e.split(", ")[t]),Bd=(e,t)=>(n,{transform:r})=>{if("none"===r||!r)return 0;const o=r.match(/^matrix3d\((.+)\)$/u);if(o)return Fd(o[1],t);{const t=r.match(/^matrix\((.+)\)$/u);return t?Fd(t[1],e):0}},Vd=new Set(["x","y","z"]),$d=Dc.filter((e=>!Vd.has(e)));const Hd={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:Bd(4,13),y:Bd(5,14)};Hd.translateX=Hd.x,Hd.translateY=Hd.y;const Wd=e=>t=>t.test(e),Ud=[qc,iu,ou,ru,au,su,{test:e=>"auto"===e,parse:e=>e}],Gd=e=>Ud.find(Wd(e)),Kd=new Set;let qd=!1,Yd=!1;function Xd(){if(Yd){const e=Array.from(Kd).filter((e=>e.needsMeasurement)),t=new Set(e.map((e=>e.element))),n=new Map;t.forEach((e=>{const t=function(e){const t=[];return $d.forEach((n=>{const r=e.getValue(n);void 0!==r&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))})),t}(e);t.length&&(n.set(e,t),e.render())})),e.forEach((e=>e.measureInitialState())),t.forEach((e=>{e.render();const t=n.get(e);t&&t.forEach((([t,n])=>{var r;null===(r=e.getValue(t))||void 0===r||r.set(n)}))})),e.forEach((e=>e.measureEndState())),e.forEach((e=>{void 0!==e.suspendedScrollY&&window.scrollTo(0,e.suspendedScrollY)}))}Yd=!1,qd=!1,Kd.forEach((e=>e.complete())),Kd.clear()}function Zd(){Kd.forEach((e=>{e.readKeyframes(),e.needsMeasurement&&(Yd=!0)}))}class Qd{constructor(e,t,n,r,o,i=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=o,this.isAsync=i}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Kd.add(this),qd||(qd=!0,$u.read(Zd),$u.resolveKeyframes(Xd))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;for(let o=0;on=>Boolean(tu(n)&&eu.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t)),ep=(e,t,n)=>r=>{if(!tu(r))return r;const[o,i,s,a]=r.match(Qc);return{[e]:parseFloat(o),[t]:parseFloat(i),[n]:parseFloat(s),alpha:void 0!==a?parseFloat(a):1}},tp={...qc,transform:e=>Math.round((e=>Kc(0,255,e))(e))},np={test:Jd("rgb","red"),parse:ep("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+tp.transform(e)+", "+tp.transform(t)+", "+tp.transform(n)+", "+Zc(Yc.transform(r))+")"};const rp={test:Jd("#"),parse:function(e){let t="",n="",r="",o="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),o=e.substring(4,5),t+=t,n+=n,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}},transform:np.transform},op={test:Jd("hsl","hue"),parse:ep("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+ou.transform(Zc(t))+", "+ou.transform(Zc(n))+", "+Zc(Yc.transform(r))+")"},ip={test:e=>np.test(e)||rp.test(e)||op.test(e),parse:e=>np.test(e)?np.parse(e):op.test(e)?op.parse(e):rp.parse(e),transform:e=>tu(e)?e:e.hasOwnProperty("red")?np.transform(e):op.transform(e)};const sp="number",ap="color",lp=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function cp(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},o=[];let i=0;const s=t.replace(lp,(e=>(ip.test(e)?(r.color.push(i),o.push(ap),n.push(ip.parse(e))):e.startsWith("var(")?(r.var.push(i),o.push("var"),n.push(e)):(r.number.push(i),o.push(sp),n.push(parseFloat(e))),++i,"${}"))).split("${}");return{values:n,split:s,indexes:r,types:o}}function up(e){return cp(e).values}function dp(e){const{split:t,types:n}=cp(e),r=t.length;return e=>{let o="";for(let i=0;i"number"==typeof e?0:e;const fp={test:function(e){var t,n;return isNaN(e)&&tu(e)&&((null===(t=e.match(Qc))||void 0===t?void 0:t.length)||0)+((null===(n=e.match(Jc))||void 0===n?void 0:n.length)||0)>0},parse:up,createTransformer:dp,getAnimatableNone:function(e){const t=up(e);return dp(e)(t.map(pp))}},hp=new Set(["brightness","contrast","saturate","opacity"]);function mp(e){const[t,n]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;const[r]=n.match(Qc)||[];if(!r)return e;const o=n.replace(r,"");let i=hp.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+o+")"}const gp=/\b([a-z-]*)\(.*?\)/gu,vp={...fp,getAnimatableNone:e=>{const t=e.match(gp);return t?t.map(mp).join(" "):e}},bp={...uu,color:ip,backgroundColor:ip,outlineColor:ip,fill:ip,stroke:ip,borderColor:ip,borderTopColor:ip,borderRightColor:ip,borderBottomColor:ip,borderLeftColor:ip,filter:vp,WebkitFilter:vp},xp=e=>bp[e];function yp(e,t){let n=xp(e);return n!==vp&&(n=fp),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const wp=new Set(["auto","none","0"]);class _p extends Qd{constructor(e,t,n,r){super(e,t,n,r,null==r?void 0:r.owner,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:t,name:n}=this;if(!t.current)return;super.readKeyframes();for(let n=0;n{t.getValue(e).set(n)})),this.resolveNoneKeyframes()}}const Sp=(e,t)=>"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!fp.test(e)&&"0"!==e||e.startsWith("url(")));class Cp{constructor({autoplay:e=!0,delay:t=0,type:n="keyframes",repeat:r=0,repeatDelay:o=0,repeatType:i="loop",...s}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.options={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:o,repeatType:i,...s},this.updateFinishedPromise()}get resolved(){return this._resolved||this.hasAttemptedResolve||(Zd(),Xd()),this._resolved}onKeyframesResolved(e,t){this.hasAttemptedResolve=!0;const{name:n,type:r,velocity:o,delay:i,onComplete:s,onUpdate:a,isGenerator:l}=this.options;if(!l&&!function(e,t,n,r){const o=e[0];if(null===o)return!1;if("display"===t||"visibility"===t)return!0;const i=e[e.length-1],s=Sp(o,t),a=Sp(i,t);return Rd(s===a,`You are trying to animate ${t} from "${o}" to "${i}". ${o} is not an animatable value - to enable this animation set ${o} to a value animatable to ${i} via the \`style\` property.`),!(!s||!a)&&(function(e){const t=e[0];if(1===e.length)return!0;for(let n=0;n{this.resolveFinishedPromise=e}))}}function kp(e,t){return t?e*(1e3/t):0}function jp(e,t,n){const r=Math.max(t-5,0);return kp(n-e(r),t-r)}const Ep=.001;function Pp({duration:e=800,bounce:t=.25,velocity:n=0,mass:r=1}){let o,i;Rd(e<=bd(10),"Spring duration must be 10 seconds or less");let s=1-t;s=Kc(.05,1,s),e=Kc(.01,10,xd(e)),s<1?(o=t=>{const r=t*s,o=r*e,i=r-n,a=Tp(t,s),l=Math.exp(-o);return Ep-i/a*l},i=t=>{const r=t*s*e,i=r*n+n,a=Math.pow(s,2)*Math.pow(t,2)*e,l=Math.exp(-r),c=Tp(Math.pow(t,2),s);return(-o(t)+Ep>0?-1:1)*((i-a)*l)/c}):(o=t=>Math.exp(-t*e)*((t-n)*e+1)-.001,i=t=>Math.exp(-t*e)*(e*e*(n-t)));const a=function(e,t,n){let r=n;for(let n=1;nvoid 0!==e[t]))}function Ap({keyframes:e,restDelta:t,restSpeed:n,...r}){const o=e[0],i=e[e.length-1],s={done:!1,value:o},{stiffness:a,damping:l,mass:c,duration:u,velocity:d,isResolvedFromDuration:p}=function(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!Mp(e,Rp)&&Mp(e,Ip)){const n=Pp(e);t={...t,...n,mass:1},t.isResolvedFromDuration=!0}return t}({...r,velocity:-xd(r.velocity||0)}),f=d||0,h=l/(2*Math.sqrt(a*c)),m=i-o,g=xd(Math.sqrt(a/c)),v=Math.abs(m)<5;let b;if(n||(n=v?.01:2),t||(t=v?.005:.5),h<1){const e=Tp(g,h);b=t=>{const n=Math.exp(-h*g*t);return i-n*((f+h*g*m)/e*Math.sin(e*t)+m*Math.cos(e*t))}}else if(1===h)b=e=>i-Math.exp(-g*e)*(m+(f+g*m)*e);else{const e=g*Math.sqrt(h*h-1);b=t=>{const n=Math.exp(-h*g*t),r=Math.min(e*t,300);return i-n*((f+h*g*m)*Math.sinh(r)+e*m*Math.cosh(r))/e}}return{calculatedDuration:p&&u||null,next:e=>{const r=b(e);if(p)s.done=e>=u;else{let o=f;0!==e&&(o=h<1?jp(b,e,r):0);const a=Math.abs(o)<=n,l=Math.abs(i-r)<=t;s.done=a&&l}return s.value=s.done?i:r,s}}}function Dp({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:i=500,modifyTarget:s,min:a,max:l,restDelta:c=.5,restSpeed:u}){const d=e[0],p={done:!1,value:d},f=e=>void 0===a?l:void 0===l||Math.abs(a-e)-h*Math.exp(-e/r),b=e=>g+v(e),x=e=>{const t=v(e),n=b(e);p.done=Math.abs(t)<=c,p.value=p.done?g:n};let y,w;const _=e=>{(e=>void 0!==a&&el)(p.value)&&(y=e,w=Ap({keyframes:[p.value,f(p.value)],velocity:jp(b,e,p.value),damping:o,stiffness:i,restDelta:c,restSpeed:u}))};return _(0),{calculatedDuration:null,next:e=>{let t=!1;return w||void 0!==y||(t=!0,x(e),_(e)),void 0!==y&&e>=y?w.next(e-y):(!t&&x(e),p)}}}const zp=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e;function Op(e,t,n,r){if(e===t&&n===r)return Vu;const o=t=>function(e,t,n,r,o){let i,s,a=0;do{s=t+(n-t)/2,i=zp(s,r,o)-e,i>0?n=s:t=s}while(Math.abs(i)>1e-7&&++a<12);return s}(t,0,1,e,n);return e=>0===e||1===e?e:zp(o(e),t,r)}const Lp=Op(.42,0,1,1),Fp=Op(0,0,.58,1),Bp=Op(.42,0,.58,1),Vp=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,$p=e=>t=>1-e(1-t),Hp=e=>1-Math.sin(Math.acos(e)),Wp=$p(Hp),Up=Vp(Hp),Gp=Op(.33,1.53,.69,.99),Kp=$p(Gp),qp=Vp(Kp),Yp={linear:Vu,easeIn:Lp,easeInOut:Bp,easeOut:Fp,circIn:Hp,circInOut:Up,circOut:Wp,backIn:Kp,backInOut:qp,backOut:Gp,anticipate:e=>(e*=2)<1?.5*Kp(e):.5*(2-Math.pow(2,-10*(e-1)))},Xp=e=>{if(Array.isArray(e)){Md(4===e.length,"Cubic bezier arrays must contain four numerical values.");const[t,n,r,o]=e;return Op(t,n,r,o)}return"string"==typeof e?(Md(void 0!==Yp[e],`Invalid easing type '${e}'`),Yp[e]):e},Zp=(e,t,n)=>{const r=t-e;return 0===r?1:(n-e)/r},Qp=(e,t,n)=>e+(t-e)*n;function Jp(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}const ef=(e,t,n)=>{const r=e*e,o=n*(t*t-r)+r;return o<0?0:Math.sqrt(o)},tf=[rp,np,op];function nf(e){const t=(e=>tf.find((t=>t.test(e))))(e);Md(Boolean(t),`'${e}' is not an animatable color. Use the equivalent color code instead.`);let n=t.parse(e);return t===op&&(n=function({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,n/=100;let o=0,i=0,s=0;if(t/=100){const r=n<.5?n*(1+t):n+t-n*t,a=2*n-r;o=Jp(a,r,e+1/3),i=Jp(a,r,e),s=Jp(a,r,e-1/3)}else o=i=s=n;return{red:Math.round(255*o),green:Math.round(255*i),blue:Math.round(255*s),alpha:r}}(n)),n}const rf=(e,t)=>{const n=nf(e),r=nf(t),o={...n};return e=>(o.red=ef(n.red,r.red,e),o.green=ef(n.green,r.green,e),o.blue=ef(n.blue,r.blue,e),o.alpha=Qp(n.alpha,r.alpha,e),np.transform(o))},of=new Set(["none","hidden"]);function sf(e,t){return n=>n>0?t:e}function af(e,t){return n=>Qp(e,t,n)}function lf(e){return"number"==typeof e?af:"string"==typeof e?Wc(e)?sf:ip.test(e)?rf:df:Array.isArray(e)?cf:"object"==typeof e?ip.test(e)?rf:uf:sf}function cf(e,t){const n=[...e],r=n.length,o=e.map(((e,n)=>lf(e)(e,t[n])));return e=>{for(let t=0;t{for(const t in r)n[t]=r[t](e);return n}}const df=(e,t)=>{const n=fp.createTransformer(t),r=cp(e),o=cp(t);return r.indexes.var.length===o.indexes.var.length&&r.indexes.color.length===o.indexes.color.length&&r.indexes.number.length>=o.indexes.number.length?of.has(e)&&!o.values.length||of.has(t)&&!r.values.length?function(e,t){return of.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}(e,t):Ju(cf(function(e,t){var n;const r=[],o={color:0,var:0,number:0};for(let i=0;it[0];if(2===i&&e[0]===e[1])return()=>t[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const s=function(e,t,n){const r=[],o=n||pf,i=e.length-1;for(let n=0;n{let n=0;if(a>1)for(;nl(Kc(e[0],e[i-1],t)):l}function hf(e){const t=[0];return function(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const o=Zp(0,t,r);e.push(Qp(n,1,o))}}(t,e.length-1),t}function mf({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const o=(e=>Array.isArray(e)&&"number"!=typeof e[0])(r)?r.map(Xp):Xp(r),i={done:!1,value:t[0]},s=function(e,t){return e.map((e=>e*t))}(n&&n.length===t.length?n:hf(t),e),a=ff(s,t,{ease:Array.isArray(o)?o:(l=t,c=o,l.map((()=>c||Bp)).splice(0,l.length-1))});var l,c;return{calculatedDuration:e,next:t=>(i.value=a(t),i.done=t>=e,i)}}const gf=e=>{const t=({timestamp:t})=>e(t);return{start:()=>$u.update(t,!0),stop:()=>Hu(t),now:()=>Wu.isProcessing?Wu.timestamp:Td.now()}},vf={decay:Dp,inertia:Dp,tween:mf,keyframes:mf,spring:Ap},bf=e=>e/100;class xf extends Cp{constructor({KeyframeResolver:e=Qd,...t}){super(t),this.holdTime=null,this.startTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.teardown();const{onStop:e}=this.options;e&&e()};const{name:n,motionValue:r,keyframes:o}=this.options,i=(e,t)=>this.onKeyframesResolved(e,t);n&&r&&r.owner?this.resolver=r.owner.resolveKeyframes(o,i,n,r):this.resolver=new e(o,i,n,r),this.resolver.scheduleResolve()}initPlayback(e){const{type:t="keyframes",repeat:n=0,repeatDelay:r=0,repeatType:o,velocity:i=0}=this.options,s=vf[t]||mf;let a,l;s!==mf&&"number"!=typeof e[0]&&(a=Ju(bf,pf(e[0],e[1])),e=[0,100]);const c=s({...this.options,keyframes:e});"mirror"===o&&(l=s({...this.options,keyframes:[...e].reverse(),velocity:-i})),null===c.calculatedDuration&&(c.calculatedDuration=function(e){let t=0,n=e.next(t);for(;!n.done&&t<2e4;)t+=50,n=e.next(t);return t>=2e4?1/0:t}(c));const{calculatedDuration:u}=c,d=u+r;return{generator:c,mirroredGenerator:l,mapPercentToKeyframes:a,calculatedDuration:u,resolvedDuration:d,totalDuration:d*(n+1)-r}}onPostResolved(){const{autoplay:e=!0}=this.options;this.play(),"paused"!==this.pendingPlayState&&e?this.state=this.pendingPlayState:this.pause()}tick(e,t=!1){const{resolved:n}=this;if(!n){const{keyframes:e}=this.options;return{done:!0,value:e[e.length-1]}}const{finalKeyframe:r,generator:o,mirroredGenerator:i,mapPercentToKeyframes:s,keyframes:a,calculatedDuration:l,totalDuration:c,resolvedDuration:u}=n;if(null===this.startTime)return o.next(0);const{delay:d,repeat:p,repeatType:f,repeatDelay:h,onUpdate:m}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-c/this.speed,this.startTime)),t?this.currentTime=e:null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=Math.round(e-this.startTime)*this.speed;const g=this.currentTime-d*(this.speed>=0?1:-1),v=this.speed>=0?g<0:g>c;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=c);let b=this.currentTime,x=o;if(p){const e=Math.min(this.currentTime,c)/u;let t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),1===n&&t--,t=Math.min(t,p+1);Boolean(t%2)&&("reverse"===f?(n=1-n,h&&(n-=h/u)):"mirror"===f&&(x=i)),b=Kc(0,1,n)*u}const y=v?{done:!1,value:a[0]}:x.next(b);s&&(y.value=s(y.value));let{done:w}=y;v||null===l||(w=this.speed>=0?this.currentTime>=c:this.currentTime<=0);const _=null===this.holdTime&&("finished"===this.state||"running"===this.state&&w);return _&&void 0!==r&&(y.value=Ed(a,this.options,r)),m&&m(y.value),_&&this.finish(),y}get duration(){const{resolved:e}=this;return e?xd(e.calculatedDuration):0}get time(){return xd(this.currentTime)}set time(e){e=bd(e),this.currentTime=e,null!==this.holdTime||0===this.speed?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.speed)}get speed(){return this.playbackSpeed}set speed(e){const t=this.playbackSpeed!==e;this.playbackSpeed=e,t&&(this.time=xd(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved)return void(this.pendingPlayState="running");if(this.isStopped)return;const{driver:e=gf,onPlay:t}=this.options;this.driver||(this.driver=e((e=>this.tick(e)))),t&&t();const n=this.driver.now();null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime&&"finished"!==this.state||(this.startTime=n),"finished"===this.state&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var e;this._resolved?(this.state="paused",this.holdTime=null!==(e=this.currentTime)&&void 0!==e?e:0):this.pendingPlayState="paused"}complete(){"running"!==this.state&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:e}=this.options;e&&e()}cancel(){null!==this.cancelTime&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}}const yf=e=>Array.isArray(e)&&"number"==typeof e[0];function wf(e){return Boolean(!e||"string"==typeof e&&e in Sf||yf(e)||Array.isArray(e)&&e.every(wf))}const _f=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Sf={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:_f([0,.65,.55,1]),circOut:_f([.55,0,1,.45]),backIn:_f([.31,.01,.66,-.59]),backOut:_f([.33,1.53,.69,.99])};function Cf(e){return kf(e)||Sf.easeOut}function kf(e){return e?yf(e)?_f(e):Array.isArray(e)?e.map(Cf):Sf[e]:void 0}const jf=function(e){let t;return()=>(void 0===t&&(t=e()),t)}((()=>Object.hasOwnProperty.call(Element.prototype,"animate"))),Ef=new Set(["opacity","clipPath","filter","transform"]);class Pf extends Cp{constructor(e){super(e);const{name:t,motionValue:n,keyframes:r}=this.options;this.resolver=new _p(r,((e,t)=>this.onKeyframesResolved(e,t)),t,n),this.resolver.scheduleResolve()}initPlayback(e,t){var n;let{duration:r=300,times:o,ease:i,type:s,motionValue:a,name:l}=this.options;if(!(null===(n=a.owner)||void 0===n?void 0:n.current))return!1;if(function(e){return"spring"===e.type||"backgroundColor"===e.name||!wf(e.ease)}(this.options)){const{onComplete:t,onUpdate:n,motionValue:a,...l}=this.options,c=function(e,t){const n=new xf({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const o=[];let i=0;for(;!r.done&&i<2e4;)r=n.sample(i),o.push(r.value),i+=10;return{times:void 0,keyframes:o,duration:i-10,ease:"linear"}}(e,l);1===(e=c.keyframes).length&&(e[1]=e[0]),r=c.duration,o=c.times,i=c.ease,s="keyframes"}const c=function(e,t,n,{delay:r=0,duration:o=300,repeat:i=0,repeatType:s="loop",ease:a,times:l}={}){const c={[t]:n};l&&(c.offset=l);const u=kf(a);return Array.isArray(u)&&(c.easing=u),e.animate(c,{delay:r,duration:o,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:i+1,direction:"reverse"===s?"alternate":"normal"})}(a.owner.current,l,e,{...this.options,duration:r,times:o,ease:i});return c.startTime=Td.now(),this.pendingTimeline?(c.timeline=this.pendingTimeline,this.pendingTimeline=void 0):c.onfinish=()=>{const{onComplete:n}=this.options;a.set(Ed(e,this.options,t)),n&&n(),this.cancel(),this.resolveFinishedPromise()},{animation:c,duration:r,times:o,type:s,ease:i,keyframes:e}}get duration(){const{resolved:e}=this;if(!e)return 0;const{duration:t}=e;return xd(t)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:t}=e;return xd(t.currentTime||0)}set time(e){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.currentTime=bd(e)}get speed(){const{resolved:e}=this;if(!e)return 1;const{animation:t}=e;return t.playbackRate}set speed(e){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playbackRate=e}get state(){const{resolved:e}=this;if(!e)return"idle";const{animation:t}=e;return t.playState}attachTimeline(e){if(this._resolved){const{resolved:t}=this;if(!t)return Vu;const{animation:n}=t;n.timeline=e,n.onfinish=null}else this.pendingTimeline=e;return Vu}play(){if(this.isStopped)return;const{resolved:e}=this;if(!e)return;const{animation:t}=e;"finished"===t.playState&&this.updateFinishedPromise(),t.play()}pause(){const{resolved:e}=this;if(!e)return;const{animation:t}=e;t.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;const{resolved:e}=this;if(!e)return;const{animation:t,keyframes:n,duration:r,type:o,ease:i,times:s}=e;if("idle"!==t.playState&&"finished"!==t.playState){if(this.time){const{motionValue:e,onUpdate:t,onComplete:a,...l}=this.options,c=new xf({...l,keyframes:n,duration:r,type:o,ease:i,times:s,isGenerator:!0}),u=bd(this.time);e.setWithVelocity(c.sample(u-10).value,c.sample(u).value,10)}this.cancel()}}complete(){const{resolved:e}=this;e&&e.animation.finish()}cancel(){const{resolved:e}=this;e&&e.animation.cancel()}static supports(e){const{motionValue:t,name:n,repeatDelay:r,repeatType:o,damping:i,type:s}=e;return jf()&&n&&Ef.has(n)&&t&&t.owner&&t.owner.current instanceof HTMLElement&&!t.owner.getProps().onUpdate&&!r&&"mirror"!==o&&0!==i&&"inertia"!==s}}const Nf=(e,t,n,r={},o,i)=>s=>{const a=Cd(r,e)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c-=bd(l);let u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:e=>{t.set(e),a.onUpdate&&a.onUpdate(e)},onComplete:()=>{s(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:i?void 0:o};(function({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:o,repeat:i,repeatType:s,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length})(a)||(u={...u,...Sd(e,u)}),u.duration&&(u.duration=bd(u.duration)),u.repeatDelay&&(u.repeatDelay=bd(u.repeatDelay)),void 0!==u.from&&(u.keyframes[0]=u.from);let d=!1;if((!1===u.type||0===u.duration&&!u.repeatDelay)&&(u.duration=0,0===u.delay&&(d=!0)),(kd||ac)&&(d=!0,u.duration=0,u.delay=0),d&&!i&&void 0!==t.get()){const e=Ed(u.keyframes,a);if(void 0!==e)return void $u.update((()=>{u.onUpdate(e),u.onComplete()}))}return!i&&Pf.supports(u)?new Pf(u):new xf(u)};function Tf(e){return Boolean(Lc(e)&&e.add)}function If(e,t){-1===e.indexOf(t)&&e.push(t)}function Rf(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class Mf{constructor(){this.subscriptions=[]}add(e){return If(this.subscriptions,e),()=>Rf(this.subscriptions,e)}notify(e,t,n){const r=this.subscriptions.length;if(r)if(1===r)this.subscriptions[0](e,t,n);else for(let o=0;o{const n=Td.now();this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),t&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){var t;this.current=e,this.updatedAt=Td.now(),null===this.canTrackVelocity&&void 0!==e&&(this.canTrackVelocity=(t=this.current,!isNaN(parseFloat(t))))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new Mf);const n=this.events[e].add(t);return"change"===e?()=>{n(),$u.read((()=>{this.events.change.getSize()||this.stop()}))}:n}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e,t=!0){t&&this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e,t)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return Af.current&&Af.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const e=Td.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||e-this.updatedAt>30)return 0;const t=Math.min(this.updatedAt-this.prevUpdatedAt,30);return kp(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise((t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()})).then((()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()}))}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function zf(e,t){return new Df(e,t)}function Of(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,zf(n))}function Lf({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&!0!==t[n];return t[n]=!1,r}function Ff(e,t,{delay:n=0,transitionOverride:r,type:o}={}){var i;let{transition:s=e.getDefaultTransition(),transitionEnd:a,...l}=t;const c=e.getValue("willChange");r&&(s=r);const u=[],d=o&&e.animationState&&e.animationState.getState()[o];for(const t in l){const r=e.getValue(t,null!==(i=e.latestValues[t])&&void 0!==i?i:null),o=l[t];if(void 0===o||d&&Lf(d,t))continue;const a={delay:n,elapsed:0,...Cd(s||{},t)};let p=!1;if(window.HandoffAppearAnimations){const n=e.getProps()[sc];if(n){const e=window.HandoffAppearAnimations(n,t,r,$u);null!==e&&(a.elapsed=e,p=!0)}}r.start(Nf(t,r,o,e.shouldReduceMotion&&zc.has(t)?{type:!1}:a,e,p));const f=r.animation;f&&(Tf(c)&&(c.add(t),f.then((()=>c.remove(t)))),u.push(f))}return a&&Promise.all(u).then((()=>{$u.update((()=>{a&&function(e,t){const n=vd(e,t);let{transitionEnd:r={},transition:o={},...i}=n||{};i={...i,...r};for(const t in i)Of(e,t,Ou(i[t]))}(e,a)}))})),u}function Bf(e,t,n={}){var r;const o=vd(e,t,"exit"===n.type?null===(r=e.presenceContext)||void 0===r?void 0:r.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=o||{};n.transitionOverride&&(i=n.transitionOverride);const s=o?()=>Promise.all(Ff(e,o,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(r=0)=>{const{delayChildren:o=0,staggerChildren:s,staggerDirection:a}=i;return function(e,t,n=0,r=0,o=1,i){const s=[],a=(e.variantChildren.size-1)*r,l=1===o?(e=0)=>e*r:(e=0)=>a-e*r;return Array.from(e.variantChildren).sort(Vf).forEach(((e,r)=>{e.notify("AnimationStart",t),s.push(Bf(e,t,{...i,delay:n+l(r)}).then((()=>e.notify("AnimationComplete",t))))})),Promise.all(s)}(e,t,o+r,s,a,n)}:()=>Promise.resolve(),{when:l}=i;if(l){const[e,t]="beforeChildren"===l?[s,a]:[a,s];return e().then((()=>t()))}return Promise.all([s(),a(n.delay)])}function Vf(e,t){return e.sortNodePosition(t)}const $f=[...bc].reverse(),Hf=bc.length;function Wf(e){return t=>Promise.all(t.map((({animation:t,options:n})=>function(e,t,n={}){let r;if(e.notify("AnimationStart",t),Array.isArray(t)){const o=t.map((t=>Bf(e,t,n)));r=Promise.all(o)}else if("string"==typeof t)r=Bf(e,t,n);else{const o="function"==typeof t?vd(e,t,n.custom):t;r=Promise.all(Ff(e,o,n))}return r.then((()=>{$u.postRender((()=>{e.notify("AnimationComplete",t)}))}))}(e,t,n))))}function Uf(e){let t=Wf(e);const n={animate:Kf(!0),whileInView:Kf(),whileHover:Kf(),whileTap:Kf(),whileDrag:Kf(),whileFocus:Kf(),exit:Kf()};let r=!0;const o=t=>(n,r)=>{var o;const i=vd(e,r,"exit"===t?null===(o=e.presenceContext)||void 0===o?void 0:o.custom:void 0);if(i){const{transition:e,transitionEnd:t,...r}=i;n={...n,...r,...t}}return n};function i(i){const s=e.getProps(),a=e.getVariantContext(!0)||{},l=[],c=new Set;let u={},d=1/0;for(let t=0;td&&m,x=!1;const y=Array.isArray(h)?h:[h];let w=y.reduce(o(p),{});!1===g&&(w={});const{prevResolvedValues:_={}}=f,S={..._,...w},C=t=>{b=!0,c.has(t)&&(x=!0,c.delete(t)),f.needsAnimating[t]=!0;const n=e.getValue(t);n&&(n.liveStyle=!1)};for(const e in S){const t=w[e],n=_[e];if(u.hasOwnProperty(e))continue;let r=!1;r=zu(t)&&zu(n)?!gd(t,n):t!==n,r?null!=t?C(e):c.add(e):void 0!==t&&c.has(e)?C(e):f.protectedKeys[e]=!0}f.prevProp=h,f.prevResolvedValues=w,f.isActive&&(u={...u,...w}),r&&e.blockInitialAnimation&&(b=!1),!b||v&&!x||l.push(...y.map((e=>({animation:e,options:{type:p}}))))}if(c.size){const t={};c.forEach((n=>{const r=e.getBaseTarget(n),o=e.getValue(n);o&&(o.liveStyle=!0),t[n]=null!=r?r:null})),l.push({animation:t})}let p=Boolean(l.length);return!r||!1!==s.initial&&s.initial!==s.animate||e.manuallyAnimateOnMount||(p=!1),r=!1,p?t(l):Promise.resolve()}return{animateChanges:i,setActive:function(t,r){var o;if(n[t].isActive===r)return Promise.resolve();null===(o=e.variantChildren)||void 0===o||o.forEach((e=>{var n;return null===(n=e.animationState)||void 0===n?void 0:n.setActive(t,r)})),n[t].isActive=r;const s=i(t);for(const e in n)n[e].protectedKeys={};return s},setAnimateFunction:function(n){t=n(e)},getState:()=>n}}function Gf(e,t){return"string"==typeof t?t!==e:!!Array.isArray(t)&&!gd(t,e)}function Kf(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}let qf=0;const Yf={animation:{Feature:class extends id{constructor(e){super(e),e.animationState||(e.animationState=Uf(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();this.unmount(),vc(e)&&(this.unmount=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){}}},exit:{Feature:class extends id{constructor(){super(...arguments),this.id=qf++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;const r=this.node.animationState.setActive("exit",!e);t&&!e&&r.then((()=>t(this.id)))}mount(){const{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}}},Xf=(e,t)=>Math.abs(e-t);class Zf{constructor(e,t,{transformPagePoint:n,contextWindow:r,dragSnapToOrigin:o=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;const e=eh(this.lastMoveEventInfo,this.history),t=null!==this.startEvent,n=function(e,t){const n=Xf(e.x,t.x),r=Xf(e.y,t.y);return Math.sqrt(n**2+r**2)}(e.offset,{x:0,y:0})>=3;if(!t&&!n)return;const{point:r}=e,{timestamp:o}=Wu;this.history.push({...r,timestamp:o});const{onStart:i,onMove:s}=this.handlers;t||(i&&i(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),s&&s(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastMoveEventInfo=Qf(t,this.transformPagePoint),$u.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();const{onEnd:n,onSessionEnd:r,resumeAnimation:o}=this.handlers;if(this.dragSnapToOrigin&&o&&o(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const i=eh("pointercancel"===e.type?this.lastMoveEventInfo:Qf(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,i),r&&r(e,i)},!Yu(e))return;this.dragSnapToOrigin=o,this.handlers=t,this.transformPagePoint=n,this.contextWindow=r||window;const i=Qf(Xu(e),this.transformPagePoint),{point:s}=i,{timestamp:a}=Wu;this.history=[{...s,timestamp:a}];const{onSessionStart:l}=t;l&&l(e,eh(i,this.history)),this.removeListeners=Ju(Zu(this.contextWindow,"pointermove",this.handlePointerMove),Zu(this.contextWindow,"pointerup",this.handlePointerUp),Zu(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),Hu(this.updatePoint)}}function Qf(e,t){return t?{point:t(e.point)}:e}function Jf(e,t){return{x:e.x-t.x,y:e.y-t.y}}function eh({point:e},t){return{point:e,delta:Jf(e,nh(t)),offset:Jf(e,th(t)),velocity:rh(t,.1)}}function th(e){return e[0]}function nh(e){return e[e.length-1]}function rh(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=nh(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>bd(t)));)n--;if(!r)return{x:0,y:0};const i=xd(o.timestamp-r.timestamp);if(0===i)return{x:0,y:0};const s={x:(o.x-r.x)/i,y:(o.y-r.y)/i};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function oh(e){return e.max-e.min}function ih(e,t=0,n=.01){return Math.abs(e-t)<=n}function sh(e,t,n,r=.5){e.origin=r,e.originPoint=Qp(t.min,t.max,e.origin),e.scale=oh(n)/oh(t),(ih(e.scale,1,1e-4)||isNaN(e.scale))&&(e.scale=1),e.translate=Qp(n.min,n.max,e.origin)-e.originPoint,(ih(e.translate)||isNaN(e.translate))&&(e.translate=0)}function ah(e,t,n,r){sh(e.x,t.x,n.x,r?r.originX:void 0),sh(e.y,t.y,n.y,r?r.originY:void 0)}function lh(e,t,n){e.min=n.min+t.min,e.max=e.min+oh(t)}function ch(e,t,n){e.min=t.min-n.min,e.max=e.min+oh(t)}function uh(e,t,n){ch(e.x,t.x,n.x),ch(e.y,t.y,n.y)}function dh(e,t,n){return{min:void 0!==t?e.min+t:void 0,max:void 0!==n?e.max+n-(e.max-e.min):void 0}}function ph(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min1.0000000000001||e<.999999999999?e:1}function Ph(e,t){e.min=e.min+t,e.max=e.max+t}function Nh(e,t,[n,r,o]){const i=void 0!==t[o]?t[o]:.5,s=Qp(e.min,e.max,i);kh(e,t[n],t[r],s,t.scale)}const Th=["x","scaleX","originX"],Ih=["y","scaleY","originY"];function Rh(e,t){Nh(e.x,t,Th),Nh(e.y,t,Ih)}function Mh(e,t){return vh(function(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}(e.getBoundingClientRect(),t))}const Ah=({current:e})=>e?e.ownerDocument.defaultView:null,Dh=new WeakMap;class zh{constructor(e){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic={x:{min:0,max:0},y:{min:0,max:0}},this.visualElement=e}start(e,{snapToCursor:t=!1}={}){const{presenceContext:n}=this.visualElement;if(n&&!1===n.isPresent)return;const{dragSnapToOrigin:r}=this.getProps();this.panSession=new Zf(e,{onSessionStart:e=>{const{dragSnapToOrigin:n}=this.getProps();n?this.pauseAnimation():this.stopAnimation(),t&&this.snapToCursor(Xu(e,"page").point)},onStart:(e,t)=>{const{drag:n,dragPropagation:r,onDragStart:o}=this.getProps();if(n&&!r&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=rd(n),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),gh((e=>{let t=this.getAxisMotionValue(e).get()||0;if(ou.test(t)){const{projection:n}=this.visualElement;if(n&&n.layout){const r=n.layout.layoutBox[e];if(r){t=oh(r)*(parseFloat(t)/100)}}}this.originPoint[e]=t})),o&&$u.postRender((()=>o(e,t)));const{animationState:i}=this.visualElement;i&&i.setActive("whileDrag",!0)},onMove:(e,t)=>{const{dragPropagation:n,dragDirectionLock:r,onDirectionLock:o,onDrag:i}=this.getProps();if(!n&&!this.openGlobalLock)return;const{offset:s}=t;if(r&&null===this.currentDirection)return this.currentDirection=function(e,t=10){let n=null;Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x");return n}(s),void(null!==this.currentDirection&&o&&o(this.currentDirection));this.updateAxis("x",t.point,s),this.updateAxis("y",t.point,s),this.visualElement.render(),i&&i(e,t)},onSessionEnd:(e,t)=>this.stop(e,t),resumeAnimation:()=>gh((e=>{var t;return"paused"===this.getAnimationState(e)&&(null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.play())}))},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:r,contextWindow:Ah(this.visualElement)})}stop(e,t){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:r}=t;this.startAnimation(r);const{onDragEnd:o}=this.getProps();o&&$u.postRender((()=>o(e,t)))}cancel(){this.isDragging=!1;const{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),t&&t.setActive("whileDrag",!1)}updateAxis(e,t,n){const{drag:r}=this.getProps();if(!n||!Oh(e,r,this.currentDirection))return;const o=this.getAxisMotionValue(e);let i=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(i=function(e,{min:t,max:n},r){return void 0!==t&&en&&(e=r?Qp(n,e,r.max):Math.min(e,n)),e}(i,this.constraints[e],this.elastic[e])),o.set(i)}resolveConstraints(){var e;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):null===(e=this.visualElement.projection)||void 0===e?void 0:e.layout,o=this.constraints;t&&hc(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!r)&&function(e,{top:t,left:n,bottom:r,right:o}){return{x:dh(e.x,n,o),y:dh(e.y,t,r)}}(r.layoutBox,t),this.elastic=function(e=fh){return!1===e?e=0:!0===e&&(e=fh),{x:hh(e,"left","right"),y:hh(e,"top","bottom")}}(n),o!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&gh((e=>{!1!==this.constraints&&this.getAxisMotionValue(e)&&(this.constraints[e]=function(e,t){const n={};return void 0!==t.min&&(n.min=t.min-e.min),void 0!==t.max&&(n.max=t.max-e.min),n}(r.layoutBox[e],this.constraints[e]))}))}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!hc(e))return!1;const n=e.current;Md(null!==n,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const o=function(e,t,n){const r=Mh(e,n),{scroll:o}=t;return o&&(Ph(r.x,o.offset.x),Ph(r.y,o.offset.y)),r}(n,r.root,this.visualElement.getTransformPagePoint());let i=function(e,t){return{x:ph(e.x,t.x),y:ph(e.y,t.y)}}(r.layout.layoutBox,o);if(t){const e=t(function({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}(i));this.hasMutatedConstraints=!!e,e&&(i=vh(e))}return i}startAnimation(e){const{drag:t,dragMomentum:n,dragElastic:r,dragTransition:o,dragSnapToOrigin:i,onDragTransitionEnd:s}=this.getProps(),a=this.constraints||{},l=gh((s=>{if(!Oh(s,t,this.currentDirection))return;let l=a&&a[s]||{};i&&(l={min:0,max:0});const c=r?200:1e6,u=r?40:1e7,d={type:"inertia",velocity:n?e[s]:0,bounceStiffness:c,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...o,...l};return this.startAxisValueAnimation(s,d)}));return Promise.all(l).then(s)}startAxisValueAnimation(e,t){const n=this.getAxisMotionValue(e);return n.start(Nf(e,n,0,t,this.visualElement))}stopAnimation(){gh((e=>this.getAxisMotionValue(e).stop()))}pauseAnimation(){gh((e=>{var t;return null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.pause()}))}getAnimationState(e){var t;return null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.state}getAxisMotionValue(e){const t=`_drag${e.toUpperCase()}`,n=this.visualElement.getProps(),r=n[t];return r||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){gh((t=>{const{drag:n}=this.getProps();if(!Oh(t,n,this.currentDirection))return;const{projection:r}=this.visualElement,o=this.getAxisMotionValue(t);if(r&&r.layout){const{min:n,max:i}=r.layout.layoutBox[t];o.set(e[t]-Qp(n,i,.5))}}))}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!hc(t)||!n||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};gh((e=>{const t=this.getAxisMotionValue(e);if(t&&!1!==this.constraints){const n=t.get();r[e]=function(e,t){let n=.5;const r=oh(e),o=oh(t);return o>r?n=Zp(t.min,t.max-r,e.min):r>o&&(n=Zp(e.min,e.max-o,t.min)),Kc(0,1,n)}({min:n,max:n},this.constraints[e])}}));const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),gh((t=>{if(!Oh(t,e,null))return;const n=this.getAxisMotionValue(t),{min:o,max:i}=this.constraints[t];n.set(Qp(o,i,r[t]))}))}addListeners(){if(!this.visualElement.current)return;Dh.set(this.visualElement,this);const e=Zu(this.visualElement.current,"pointerdown",(e=>{const{drag:t,dragListener:n=!0}=this.getProps();t&&n&&this.start(e)})),t=()=>{const{dragConstraints:e}=this.getProps();hc(e)&&(this.constraints=this.resolveRefConstraints())},{projection:n}=this.visualElement,r=n.addEventListener("measure",t);n&&!n.layout&&(n.root&&n.root.updateScroll(),n.updateLayout()),t();const o=qu(window,"resize",(()=>this.scalePositionWithinConstraints())),i=n.addEventListener("didUpdate",(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(gh((t=>{const n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))})),this.visualElement.render())}));return()=>{o(),e(),r(),i&&i()}}getProps(){const e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:o=!1,dragElastic:i=fh,dragMomentum:s=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:o,dragElastic:i,dragMomentum:s}}}function Oh(e,t,n){return!(!0!==t&&t!==e||null!==n&&n!==e)}const Lh=e=>(t,n)=>{e&&$u.postRender((()=>e(t,n)))};const Fh={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Bh(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Vh={correct:(e,t)=>{if(!t.target)return e;if("string"==typeof e){if(!iu.test(e))return e;e=parseFloat(e)}return`${Bh(e,t.target.x)}% ${Bh(e,t.target.y)}%`}},$h={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=fp.parse(e);if(o.length>5)return r;const i=fp.createTransformer(e),s="number"!=typeof o[0]?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;o[0+s]/=a,o[1+s]/=l;const c=Qp(a,l,.5);return"number"==typeof o[2+s]&&(o[2+s]/=c),"number"==typeof o[3+s]&&(o[3+s]/=c),i(o)}};class Hh extends B.Component{componentDidMount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:o}=e;var i;i=Uh,Object.assign(Ac,i),o&&(t.group&&t.group.add(o),n&&n.register&&r&&n.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",(()=>{this.safeToRemove()})),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),Fh.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:t,visualElement:n,drag:r,isPresent:o}=this.props,i=n.projection;return i?(i.isPresent=o,r||e.layoutDependency!==t||void 0===t?i.willUpdate():this.safeToRemove(),e.isPresent!==o&&(o?i.promote():i.relegate()||$u.postRender((()=>{const e=i.getStack();e&&e.members.length||this.safeToRemove()}))),null):null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),pc.postRender((()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()})))}componentWillUnmount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function Wh(e){const[t,n]=function(){const e=(0,B.useContext)(tc);if(null===e)return[!0,null];const{isPresent:t,onExitComplete:n,register:r}=e,o=(0,B.useId)();return(0,B.useEffect)((()=>r(o)),[]),!t&&n?[!1,()=>n&&n(o)]:[!0]}(),r=(0,B.useContext)(jc);return(0,_t.jsx)(Hh,{...e,layoutGroup:r,switchLayoutGroup:(0,B.useContext)(Ec),isPresent:t,safeToRemove:n})}const Uh={borderRadius:{...Vh,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Vh,borderTopRightRadius:Vh,borderBottomLeftRadius:Vh,borderBottomRightRadius:Vh,boxShadow:$h},Gh=["TopLeft","TopRight","BottomLeft","BottomRight"],Kh=Gh.length,qh=e=>"string"==typeof e?parseFloat(e):e,Yh=e=>"number"==typeof e||iu.test(e);function Xh(e,t){return void 0!==e[t]?e[t]:e.borderRadius}const Zh=Jh(0,.5,Wp),Qh=Jh(.5,.95,Vu);function Jh(e,t,n){return r=>rt?1:n(Zp(e,t,r))}function em(e,t){e.min=t.min,e.max=t.max}function tm(e,t){em(e.x,t.x),em(e.y,t.y)}function nm(e,t,n,r,o){return e=Sh(e-=t,1/n,r),void 0!==o&&(e=Sh(e,1/o,r)),e}function rm(e,t,[n,r,o],i,s){!function(e,t=0,n=1,r=.5,o,i=e,s=e){ou.test(t)&&(t=parseFloat(t),t=Qp(s.min,s.max,t/100)-s.min);if("number"!=typeof t)return;let a=Qp(i.min,i.max,r);e===i&&(a-=t),e.min=nm(e.min,t,n,a,o),e.max=nm(e.max,t,n,a,o)}(e,t[n],t[r],t[o],t.scale,i,s)}const om=["x","scaleX","originX"],im=["y","scaleY","originY"];function sm(e,t,n,r){rm(e.x,t,om,n?n.x:void 0,r?r.x:void 0),rm(e.y,t,im,n?n.y:void 0,r?r.y:void 0)}function am(e){return 0===e.translate&&1===e.scale}function lm(e){return am(e.x)&&am(e.y)}function cm(e,t){return Math.round(e.x.min)===Math.round(t.x.min)&&Math.round(e.x.max)===Math.round(t.x.max)&&Math.round(e.y.min)===Math.round(t.y.min)&&Math.round(e.y.max)===Math.round(t.y.max)}function um(e){return oh(e.x)/oh(e.y)}class dm{constructor(){this.members=[]}add(e){If(this.members,e),e.scheduleRender()}remove(e){if(Rf(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){const t=this.members.findIndex((t=>e===t));if(0===t)return!1;let n;for(let e=t;e>=0;e--){const t=this.members[e];if(!1!==t.isPresent){n=t;break}}return!!n&&(this.promote(n),!0)}promote(e,t){const n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.instance&&n.scheduleRender(),e.scheduleRender(),e.resumeFrom=n,t&&(e.resumeFrom.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:r}=e.options;!1===r&&n.hide()}}exitAnimationComplete(){this.members.forEach((e=>{const{options:t,resumingFrom:n}=e;t.onExitComplete&&t.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()}))}scheduleRender(){this.members.forEach((e=>{e.instance&&e.scheduleRender(!1)}))}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function pm(e,t,n){let r="";const o=e.x.translate/t.x,i=e.y.translate/t.y,s=(null==n?void 0:n.z)||0;if((o||i||s)&&(r=`translate3d(${o}px, ${i}px, ${s}px) `),1===t.x&&1===t.y||(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:e,rotate:t,rotateX:o,rotateY:i,skewX:s,skewY:a}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),o&&(r+=`rotateX(${o}deg) `),i&&(r+=`rotateY(${i}deg) `),s&&(r+=`skewX(${s}deg) `),a&&(r+=`skewY(${a}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return 1===a&&1===l||(r+=`scale(${a}, ${l})`),r||"none"}const fm=(e,t)=>e.depth-t.depth;class hm{constructor(){this.children=[],this.isDirty=!1}add(e){If(this.children,e),this.isDirty=!0}remove(e){Rf(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(fm),this.isDirty=!1,this.children.forEach(e)}}const mm=["","X","Y","Z"],gm={visibility:"hidden"};let vm=0;const bm={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function xm(e,t,n,r){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function ym({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(e={},n=(null==t?void 0:t())){this.id=vm++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{var e;this.projectionUpdateScheduled=!1,bm.totalNodes=bm.resolvedTargetDeltas=bm.recalculatedProjection=0,this.nodes.forEach(Sm),this.nodes.forEach(Tm),this.nodes.forEach(Im),this.nodes.forEach(Cm),e=bm,window.MotionDebug&&window.MotionDebug.record(e)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;ethis.root.updateBlockedByResize=!1;e(t,(()=>{this.root.updateBlockedByResize=!0,n&&n(),n=function(e,t){const n=Td.now(),r=({timestamp:o})=>{const i=o-n;i>=t&&(Hu(r),e(i-t))};return $u.read(r,!0),()=>Hu(r)}(r,250),Fh.hasAnimatedSinceResize&&(Fh.hasAnimatedSinceResize=!1,this.nodes.forEach(Nm))}))}o&&this.root.registerSharedNode(o,this),!1!==this.options.animate&&s&&(o||i)&&this.addEventListener("didUpdate",(({delta:e,hasLayoutChanged:t,hasRelativeTargetChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const o=this.options.transition||s.getDefaultTransition()||Om,{onLayoutAnimationStart:i,onLayoutAnimationComplete:a}=s.getProps(),l=!this.targetLayout||!cm(this.targetLayout,r)||n,c=!t&&n;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||c||t&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(e,c);const t={...Cd(o,"layout"),onPlay:i,onComplete:a};(s.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t)}else t||Nm(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r}))}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Hu(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,window.HandoffCancelAllAnimations&&window.HandoffCancelAllAnimations(),this.nodes&&this.nodes.forEach(Rm),this.animationId++)}getTransformTemplate(){const{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;ethis.update())))}clearAllSnapshots(){this.nodes.forEach(km),this.sharedNodes.forEach(Mm)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,$u.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){$u.postRender((()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()}))}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure())}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e{const n=t/1e3;Am(i.x,e.x,n),Am(i.y,e.y,n),this.setTargetDelta(i),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(uh(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox),function(e,t,n,r){Dm(e.x,t.x,n.x,r),Dm(e.y,t.y,n.y,r)}(this.relativeTarget,this.relativeTargetOrigin,s,n),d&&function(e,t){return e.x.min===t.x.min&&e.x.max===t.x.max&&e.y.min===t.y.min&&e.y.max===t.y.max}(this.relativeTarget,d)&&(this.isProjectionDirty=!1),d||(d={x:{min:0,max:0},y:{min:0,max:0}}),tm(d,this.relativeTarget)),a&&(this.animationValues=o,function(e,t,n,r,o,i){o?(e.opacity=Qp(0,void 0!==n.opacity?n.opacity:1,Zh(r)),e.opacityExit=Qp(void 0!==t.opacity?t.opacity:1,0,Qh(r))):i&&(e.opacity=Qp(void 0!==t.opacity?t.opacity:1,void 0!==n.opacity?n.opacity:1,r));for(let o=0;o{Fh.hasAnimatedSinceResize=!0,this.currentAnimation=function(e,t,n){const r=Lc(e)?e:zf(e);return r.start(Nf("",r,t,n)),r.animation}(0,1e3,{...e,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0}))}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const e=this.getLead();let{targetWithTransforms:t,target:n,layout:r,latestValues:o}=e;if(t&&n&&r){if(this!==e&&this.layout&&r&&Vm(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const t=oh(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;const r=oh(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}tm(t,n),Rh(t,o),ah(this.projectionDeltaWithTransform,this.layoutCorrected,t,o)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new dm);this.sharedNodes.get(e).add(t);const n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){const e=this.getStack();return!e||e.lead===this}getLead(){var e;const{layoutId:t}=this.options;return t&&(null===(e=this.getStack())||void 0===e?void 0:e.lead)||this}getPrevLead(){var e;const{layoutId:t}=this.options;return t?null===(e=this.getStack())||void 0===e?void 0:e.prevLead:void 0}getStack(){const{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){const r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){const e=this.getStack();return!!e&&e.relegate(this)}resetSkewAndRotation(){const{visualElement:e}=this.options;if(!e)return;let t=!1;const{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;const r={};n.z&&xm("z",e,r,this.animationValues);for(let t=0;t{var t;return null===(t=e.currentAnimation)||void 0===t?void 0:t.stop()})),this.root.nodes.forEach(jm),this.root.sharedNodes.clear()}}}function wm(e){e.updateLayout()}function _m(e){var t;const n=(null===(t=e.resumeFrom)||void 0===t?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:t,measuredBox:r}=e.layout,{animationType:o}=e.options,i=n.source!==e.layout.source;"size"===o?gh((e=>{const r=i?n.measuredBox[e]:n.layoutBox[e],o=oh(r);r.min=t[e].min,r.max=r.min+o})):Vm(o,n.layoutBox,t)&&gh((r=>{const o=i?n.measuredBox[r]:n.layoutBox[r],s=oh(t[r]);o.max=o.min+s,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+s)}));const s={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};ah(s,t,n.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};i?ah(a,e.applyTransform(r,!0),n.measuredBox):ah(a,t,n.layoutBox);const l=!lm(s);let c=!1;if(!e.resumeFrom){const r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){const{snapshot:o,layout:i}=r;if(o&&i){const s={x:{min:0,max:0},y:{min:0,max:0}};uh(s,n.layoutBox,o.layoutBox);const a={x:{min:0,max:0},y:{min:0,max:0}};uh(a,t,i.layoutBox),cm(s,a)||(c=!0),r.options.layoutRoot&&(e.relativeTarget=a,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners("didUpdate",{layout:t,snapshot:n,delta:a,layoutDelta:s,hasLayoutChanged:l,hasRelativeTargetChanged:c})}else if(e.isLead()){const{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function Sm(e){bm.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=Boolean(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function Cm(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function km(e){e.clearSnapshot()}function jm(e){e.clearMeasurements()}function Em(e){e.isLayoutDirty=!1}function Pm(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Nm(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Tm(e){e.resolveTargetDelta()}function Im(e){e.calcProjection()}function Rm(e){e.resetSkewAndRotation()}function Mm(e){e.removeLeadSnapshot()}function Am(e,t,n){e.translate=Qp(t.translate,0,n),e.scale=Qp(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Dm(e,t,n,r){e.min=Qp(t.min,n.min,r),e.max=Qp(t.max,n.max,r)}function zm(e){return e.animationValues&&void 0!==e.animationValues.opacityExit}const Om={duration:.45,ease:[.4,0,.1,1]},Lm=e=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Fm=Lm("applewebkit/")&&!Lm("chrome/")?Math.round:Vu;function Bm(e){e.min=Fm(e.min),e.max=Fm(e.max)}function Vm(e,t,n){return"position"===e||"preserve-aspect"===e&&!ih(um(t),um(n),.2)}const $m=ym({attachResizeListener:(e,t)=>qu(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Hm={current:void 0},Wm=ym({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Hm.current){const e=new $m({});e.mount(window),e.setOptions({layoutScroll:!0}),Hm.current=e}return Hm.current},resetTransform:(e,t)=>{e.style.transform=void 0!==t?t:"none"},checkIsScrollRoot:e=>Boolean("fixed"===window.getComputedStyle(e).position)}),Um={pan:{Feature:class extends id{constructor(){super(...arguments),this.removePointerDownListener=Vu}onPointerDown(e){this.session=new Zf(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Ah(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:Lh(e),onStart:Lh(t),onMove:n,onEnd:(e,t)=>{delete this.session,r&&$u.postRender((()=>r(e,t)))}}}mount(){this.removePointerDownListener=Zu(this.node.current,"pointerdown",(e=>this.onPointerDown(e)))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends id{constructor(e){super(e),this.removeGroupControls=Vu,this.removeListeners=Vu,this.controls=new zh(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Vu}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:Wm,MeasureLayout:Wh}},Gm={current:null},Km={current:!1};const qm=new WeakMap,Ym=[...Ud,ip,fp],Xm=Object.keys(kc),Zm=Xm.length,Qm=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],Jm=xc.length;function eg(e){if(e)return!1!==e.options.allowProjection?e.projection:eg(e.parent)}class tg{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,blockInitialAnimation:o,visualState:i},s={}){this.resolveKeyframes=(e,t,n,r)=>new this.KeyframeResolver(e,t,n,r,this),this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Qd,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>$u.render(this.render,!1,!0);const{latestValues:a,renderState:l}=i;this.latestValues=a,this.baseTarget={...a},this.initialValues=t.initial?{...a}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.options=s,this.blockInitialAnimation=Boolean(o),this.isControllingVariants=yc(t),this.isVariantNode=wc(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(e&&e.current);const{willChange:c,...u}=this.scrapeMotionValuesFromProps(t,{},this);for(const e in u){const t=u[e];void 0!==a[e]&&Lc(t)&&(t.set(a[e],!1),Tf(c)&&c.add(e))}}mount(e){this.current=e,qm.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach(((e,t)=>this.bindToMotionValue(t,e))),Km.current||function(){if(Km.current=!0,nc)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Gm.current=e.matches;e.addListener(t),t()}else Gm.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||Gm.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){var e;qm.delete(this.current),this.projection&&this.projection.unmount(),Hu(this.notifyUpdate),Hu(this.render),this.valueSubscriptions.forEach((e=>e())),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const t in this.features)null===(e=this.features[t])||void 0===e||e.unmount();this.current=null}bindToMotionValue(e,t){const n=zc.has(e),r=t.on("change",(t=>{this.latestValues[e]=t,this.props.onUpdate&&$u.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)})),o=t.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(e,(()=>{r(),o(),t.owner&&t.stop()}))}sortNodePosition(e){return this.current&&this.sortInstanceNodePosition&&this.type===e.type?this.sortInstanceNodePosition(this.current,e.current):0}loadFeatures({children:e,...t},n,r,o){let i,s;for(let e=0;ethis.scheduleRender(),animationType:"string"==typeof n?n:"both",initialPromotionConfig:o,layoutScroll:a,layoutRoot:l})}return s}updateFeatures(){for(const e in this.features){const t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;tt.variantChildren.delete(e)}addValue(e,t){const n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);const t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return void 0===n&&void 0!==t&&(n=zf(null===t?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){var n;let r=void 0===this.latestValues[e]&&this.current?null!==(n=this.getBaseTargetFromProps(this.props,e))&&void 0!==n?n:this.readValueFromInstance(this.current,e,this.options):this.latestValues[e];return null!=r&&("string"==typeof r&&(Ad(r)||Id(r))?r=parseFloat(r):!(e=>Ym.find(Wd(e)))(r)&&fp.test(t)&&(r=yp(e,t)),this.setBaseTarget(e,Lc(r)?r.get():r)),Lc(r)?r.get():r}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){var t;const{initial:n}=this.props;let r;if("string"==typeof n||"object"==typeof n){const o=Au(this.props,n,null===(t=this.presenceContext)||void 0===t?void 0:t.custom);o&&(r=o[e])}if(n&&void 0!==r)return r;const o=this.getBaseTargetFromProps(this.props,e);return void 0===o||Lc(o)?void 0!==this.initialValues[e]&&void 0===r?void 0:this.baseTarget[e]:o}on(e,t){return this.events[e]||(this.events[e]=new Mf),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}}class ng extends tg{constructor(){super(...arguments),this.KeyframeResolver=_p}sortInstanceNodePosition(e,t){return 2&e.compareDocumentPosition(t)?1:-1}getBaseTargetFromProps(e,t){return e.style?e.style[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}}class rg extends ng{constructor(){super(...arguments),this.type="html"}readValueFromInstance(e,t){if(zc.has(t)){const e=xp(t);return e&&e.default||0}{const r=(n=e,window.getComputedStyle(n)),o=($c(t)?r.getPropertyValue(t):r[t])||0;return"string"==typeof o?o.trim():o}var n}measureInstanceViewportBox(e,{transformPagePoint:t}){return Mh(e,t)}build(e,t,n,r){du(e,t,n,r.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return Iu(e,t,n)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Lc(e)&&(this.childSubscription=e.on("change",(e=>{this.current&&(this.current.textContent=`${e}`)})))}renderInstance(e,t,n,r){Pu(e,t,n,r)}}class og extends ng{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(zc.has(t)){const e=xp(t);return e&&e.default||0}return t=Nu.has(t)?t:ic(t),e.getAttribute(t)}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}scrapeMotionValuesFromProps(e,t,n){return Ru(e,t,n)}build(e,t,n,r){Su(e,t,n,this.isSVGTag,r.transformTemplate)}renderInstance(e,t,n,r){Tu(e,t,0,r)}mount(e){this.isSVGTag=ku(e.tagName),super.mount(e)}}const ig=(e,t)=>Mc(e)?new og(t,{enableHardwareAcceleration:!1}):new rg(t,{allowProjection:e!==B.Fragment,enableHardwareAcceleration:!0}),sg={...Yf,...md,...Um,...{layout:{ProjectionNode:Wm,MeasureLayout:Wh}}},ag=Ic(((e,t)=>function(e,{forwardMotionProps:t=!1},n,r){return{...Mc(e)?Gu:Ku,preloadedFeatures:n,useRender:Eu(t),createVisualElement:r,Component:e}}(e,t,sg,ig)));function lg(){const e=(0,B.useRef)(!1);return rc((()=>(e.current=!0,()=>{e.current=!1})),[]),e}class cg extends B.Component{getSnapshotBeforeUpdate(e){const t=this.props.childRef.current;if(t&&e.isPresent&&!this.props.isPresent){const e=this.props.sizeRef.current;e.height=t.offsetHeight||0,e.width=t.offsetWidth||0,e.top=t.offsetTop,e.left=t.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function ug({children:e,isPresent:t}){const n=(0,B.useId)(),r=(0,B.useRef)(null),o=(0,B.useRef)({width:0,height:0,top:0,left:0}),{nonce:i}=(0,B.useContext)(Jl);return(0,B.useInsertionEffect)((()=>{const{width:e,height:s,top:a,left:l}=o.current;if(t||!r.current||!e||!s)return;r.current.dataset.motionPopId=n;const c=document.createElement("style");return i&&(c.nonce=i),document.head.appendChild(c),c.sheet&&c.sheet.insertRule(`\n [data-motion-pop-id="${n}"] {\n position: absolute !important;\n width: ${e}px !important;\n height: ${s}px !important;\n top: ${a}px !important;\n left: ${l}px !important;\n }\n `),()=>{document.head.removeChild(c)}}),[t]),(0,_t.jsx)(cg,{isPresent:t,childRef:r,sizeRef:o,children:B.cloneElement(e,{ref:r})})}const dg=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:o,presenceAffectsLayout:i,mode:s})=>{const a=Du(pg),l=(0,B.useId)(),c=(0,B.useMemo)((()=>({id:l,initial:t,isPresent:n,custom:o,onExitComplete:e=>{a.set(e,!0);for(const e of a.values())if(!e)return;r&&r()},register:e=>(a.set(e,!1),()=>a.delete(e))})),i?[Math.random()]:[n]);return(0,B.useMemo)((()=>{a.forEach(((e,t)=>a.set(t,!1)))}),[n]),B.useEffect((()=>{!n&&!a.size&&r&&r()}),[n]),"popLayout"===s&&(e=(0,_t.jsx)(ug,{isPresent:n,children:e})),(0,_t.jsx)(tc.Provider,{value:c,children:e})};function pg(){return new Map}const fg=e=>e.key||"";const hg=({children:e,custom:t,initial:n=!0,onExitComplete:r,exitBeforeEnter:o,presenceAffectsLayout:i=!0,mode:s="sync"})=>{Md(!o,"Replace exitBeforeEnter with mode='wait'");const a=(0,B.useContext)(jc).forceRender||function(){const e=lg(),[t,n]=(0,B.useState)(0),r=(0,B.useCallback)((()=>{e.current&&n(t+1)}),[t]);return[(0,B.useCallback)((()=>$u.postRender(r)),[r]),t]}()[0],l=lg(),c=function(e){const t=[];return B.Children.forEach(e,(e=>{(0,B.isValidElement)(e)&&t.push(e)})),t}(e);let u=c;const d=(0,B.useRef)(new Map).current,p=(0,B.useRef)(u),f=(0,B.useRef)(new Map).current,h=(0,B.useRef)(!0);var m;if(rc((()=>{h.current=!1,function(e,t){e.forEach((e=>{const n=fg(e);t.set(n,e)}))}(c,f),p.current=u})),m=()=>{h.current=!0,f.clear(),d.clear()},(0,B.useEffect)((()=>()=>m()),[]),h.current)return(0,_t.jsx)(_t.Fragment,{children:u.map((e=>(0,_t.jsx)(dg,{isPresent:!0,initial:!!n&&void 0,presenceAffectsLayout:i,mode:s,children:e},fg(e))))});u=[...u];const g=p.current.map(fg),v=c.map(fg),b=g.length;for(let e=0;e{if(-1!==v.indexOf(n))return;const o=f.get(n);if(!o)return;const h=g.indexOf(n);let m=e;if(!m){const e=()=>{d.delete(n);const e=Array.from(f.keys()).filter((e=>!v.includes(e)));if(e.forEach((e=>f.delete(e))),p.current=c.filter((t=>{const r=fg(t);return r===n||e.includes(r)})),!d.size){if(!1===l.current)return;a(),r&&r()}};m=(0,_t.jsx)(dg,{isPresent:!1,onExitComplete:e,custom:t,presenceAffectsLayout:i,mode:s,children:o},fg(o)),d.set(n,m)}u.splice(h,0,m)})),u=u.map((e=>{const t=e.key;return d.has(t)?e:(0,_t.jsx)(dg,{isPresent:!0,presenceAffectsLayout:i,mode:s,children:e},fg(e))})),(0,_t.jsx)(_t.Fragment,{children:d.size?u:u.map((e=>(0,B.cloneElement)(e)))})},mg=["40em","52em","64em"],gg=(e={})=>{const{defaultIndex:t=0}=e;if("number"!=typeof t)throw new TypeError(`Default breakpoint index should be a number. Got: ${t}, ${typeof t}`);if(t<0||t>mg.length-1)throw new RangeError(`Default breakpoint index out of range. Theme has ${mg.length} breakpoints, got index ${t}`);const[n,r]=(0,c.useState)(t);return(0,c.useEffect)((()=>{const e=()=>{const e=mg.filter((e=>"undefined"!=typeof window&&window.matchMedia(`screen and (min-width: ${e})`).matches)).length;n!==e&&r(e)};return e(),"undefined"!=typeof window&&window.addEventListener("resize",e),()=>{"undefined"!=typeof window&&window.removeEventListener("resize",e)}}),[n]),n};function vg(e,t={}){const n=gg(t);if(!Array.isArray(e)&&"function"!=typeof e)return e;const r=e||[];return r[n>=r.length?r.length-1:n]}const bg={name:"zjik7",styles:"display:flex"},xg={name:"qgaee5",styles:"display:block;max-height:100%;max-width:100%;min-height:0;min-width:0"},yg={name:"82a6rk",styles:"flex:1"},wg={name:"13nosa1",styles:">*{min-height:0;}"},_g={name:"1pwxzk4",styles:">*{min-width:0;}"};function Sg(e){const{align:t,className:n,direction:r="row",expanded:o=!0,gap:i=2,justify:s="space-between",wrap:a=!1,...l}=sl(function(e){const{isReversed:t,...n}=e;return void 0!==t?(Xi()("Flex isReversed",{alternative:'Flex direction="row-reverse" or "column-reverse"',since:"5.9"}),{...n,direction:t?"row-reverse":"row"}):n}(e),"Flex"),u=vg(Array.isArray(r)?r:[r]),d="string"==typeof u&&!!u.includes("column"),p=il();return{...l,className:(0,c.useMemo)((()=>{const e=Nl({alignItems:null!=t?t:d?"normal":"center",flexDirection:u,flexWrap:a?"wrap":void 0,gap:Il(i),justifyContent:s,height:d&&o?"100%":void 0,width:!d&&o?"100%":void 0},"","");return p(bg,e,d?wg:_g,n)}),[t,n,p,u,o,i,d,s,a]),isColumn:d}}const Cg=(0,c.createContext)({flexItemDisplay:void 0});const kg=al((function(e,t){const{children:n,isColumn:r,...o}=Sg(e);return(0,_t.jsx)(Cg.Provider,{value:{flexItemDisplay:r?"block":void 0},children:(0,_t.jsx)(_l,{...o,ref:t,children:n})})}),"Flex");function jg(e){const{className:t,display:n,isBlock:r=!1,...o}=sl(e,"FlexItem"),i={},s=(0,c.useContext)(Cg).flexItemDisplay;i.Base=Nl({display:n||s},"","");return{...o,className:il()(xg,i.Base,r&&yg,t)}}const Eg=al((function(e,t){const n=function(e){return jg({isBlock:!0,...sl(e,"FlexBlock")})}(e);return(0,_t.jsx)(_l,{...n,ref:t})}),"FlexBlock"),Pg=new RegExp(/-left/g),Ng=new RegExp(/-right/g),Tg=new RegExp(/Left/g),Ig=new RegExp(/Right/g);function Rg(e){return"left"===e?"right":"right"===e?"left":Pg.test(e)?e.replace(Pg,"-right"):Ng.test(e)?e.replace(Ng,"-left"):Tg.test(e)?e.replace(Tg,"Right"):Ig.test(e)?e.replace(Ig,"Left"):e}function Mg(e={},t){return()=>t?(0,a.isRTL)()?Nl(t,"",""):Nl(e,"",""):(0,a.isRTL)()?Nl(((e={})=>Object.fromEntries(Object.entries(e).map((([e,t])=>[Rg(e),t]))))(e),"",""):Nl(e,"","")}function Ag(e){return null!=e}Mg.watch=()=>(0,a.isRTL)();const Dg=al((function(e,t){const n=function(e){const{className:t,margin:n,marginBottom:r=2,marginLeft:o,marginRight:i,marginTop:s,marginX:a,marginY:l,padding:c,paddingBottom:u,paddingLeft:d,paddingRight:p,paddingTop:f,paddingX:h,paddingY:m,...g}=sl(e,"Spacer");return{...g,className:il()(Ag(n)&&Nl("margin:",Il(n),";",""),Ag(l)&&Nl("margin-bottom:",Il(l),";margin-top:",Il(l),";",""),Ag(a)&&Nl("margin-left:",Il(a),";margin-right:",Il(a),";",""),Ag(s)&&Nl("margin-top:",Il(s),";",""),Ag(r)&&Nl("margin-bottom:",Il(r),";",""),Ag(o)&&Mg({marginLeft:Il(o)})(),Ag(i)&&Mg({marginRight:Il(i)})(),Ag(c)&&Nl("padding:",Il(c),";",""),Ag(m)&&Nl("padding-bottom:",Il(m),";padding-top:",Il(m),";",""),Ag(h)&&Nl("padding-left:",Il(h),";padding-right:",Il(h),";",""),Ag(f)&&Nl("padding-top:",Il(f),";",""),Ag(u)&&Nl("padding-bottom:",Il(u),";",""),Ag(d)&&Mg({paddingLeft:Il(d)})(),Ag(p)&&Mg({paddingRight:Il(p)})(),t)}}(e);return(0,_t.jsx)(_l,{...n,ref:t})}),"Spacer"),zg=Dg,Og=(0,_t.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_t.jsx)(n.Path,{d:"M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z"})}),Lg=(0,_t.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_t.jsx)(n.Path,{d:"M7 11.5h10V13H7z"})});const Fg=al((function(e,t){const n=jg(e);return(0,_t.jsx)(_l,{...n,ref:t})}),"FlexItem");const Bg={name:"hdknak",styles:"display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap"};function Vg(e){return null!=e}const $g=e=>"string"==typeof e?(e=>parseFloat(e))(e):e,Hg="…",Wg={auto:"auto",head:"head",middle:"middle",tail:"tail",none:"none"},Ug={ellipsis:Hg,ellipsizeMode:Wg.auto,limit:0,numberOfLines:0};function Gg(e="",t){const n={...Ug,...t},{ellipsis:r,ellipsizeMode:o,limit:i}=n;if(o===Wg.none)return e;let s,a;switch(o){case Wg.head:s=0,a=i;break;case Wg.middle:s=Math.floor(i/2),a=Math.floor(i/2);break;default:s=i,a=0}const l=o!==Wg.auto?function(e,t,n,r){if("string"!=typeof e)return"";const o=e.length,i=~~t,s=~~n,a=Vg(r)?r:Hg;return 0===i&&0===s||i>=o||s>=o||i+s>=o?e:0===s?e.slice(0,i)+a:e.slice(0,i)+a+e.slice(o-s)}(e,s,a,r):e;return l}function Kg(e){const{className:t,children:n,ellipsis:r=Hg,ellipsizeMode:o=Wg.auto,limit:i=0,numberOfLines:s=0,...a}=sl(e,"Truncate"),l=il();let u;"string"==typeof n?u=n:"number"==typeof n&&(u=n.toString());const d=u?Gg(u,{ellipsis:r,ellipsizeMode:o,limit:i,numberOfLines:s}):n,p=!!u&&o===Wg.auto;return{...a,className:(0,c.useMemo)((()=>l(p&&!s&&Bg,p&&!!s&&Nl(1===s?"word-break: break-all;":""," -webkit-box-orient:vertical;-webkit-line-clamp:",s,";display:-webkit-box;overflow:hidden;",""),t)),[t,l,s,p]),children:d}}var qg={grad:.9,turn:360,rad:360/(2*Math.PI)},Yg=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},Xg=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},Zg=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},Qg=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},Jg=function(e){return{r:Zg(e.r,0,255),g:Zg(e.g,0,255),b:Zg(e.b,0,255),a:Zg(e.a)}},ev=function(e){return{r:Xg(e.r),g:Xg(e.g),b:Xg(e.b),a:Xg(e.a,3)}},tv=/^#([0-9a-f]{3,8})$/i,nv=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},rv=function(e){var t=e.r,n=e.g,r=e.b,o=e.a,i=Math.max(t,n,r),s=i-Math.min(t,n,r),a=s?i===t?(n-r)/s:i===n?2+(r-t)/s:4+(t-n)/s:0;return{h:60*(a<0?a+6:a),s:i?s/i*100:0,v:i/255*100,a:o}},ov=function(e){var t=e.h,n=e.s,r=e.v,o=e.a;t=t/360*6,n/=100,r/=100;var i=Math.floor(t),s=r*(1-n),a=r*(1-(t-i)*n),l=r*(1-(1-t+i)*n),c=i%6;return{r:255*[r,a,s,s,l,r][c],g:255*[l,r,r,a,s,s][c],b:255*[s,s,l,r,r,a][c],a:o}},iv=function(e){return{h:Qg(e.h),s:Zg(e.s,0,100),l:Zg(e.l,0,100),a:Zg(e.a)}},sv=function(e){return{h:Xg(e.h),s:Xg(e.s),l:Xg(e.l),a:Xg(e.a,3)}},av=function(e){return ov((n=(t=e).s,{h:t.h,s:(n*=((r=t.l)<50?r:100-r)/100)>0?2*n/(r+n)*100:0,v:r+n,a:t.a}));var t,n,r},lv=function(e){return{h:(t=rv(e)).h,s:(o=(200-(n=t.s))*(r=t.v)/100)>0&&o<200?n*r/100/(o<=100?o:200-o)*100:0,l:o/2,a:t.a};var t,n,r,o},cv=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,uv=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,dv=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,pv=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,fv={string:[[function(e){var t=tv.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:4===e.length?Xg(parseInt(e[3]+e[3],16)/255,2):1}:6===e.length||8===e.length?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:8===e.length?Xg(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=dv.exec(e)||pv.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:Jg({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=cv.exec(e)||uv.exec(e);if(!t)return null;var n,r,o=iv({h:(n=t[1],r=t[2],void 0===r&&(r="deg"),Number(n)*(qg[r]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return av(o)},"hsl"]],object:[[function(e){var t=e.r,n=e.g,r=e.b,o=e.a,i=void 0===o?1:o;return Yg(t)&&Yg(n)&&Yg(r)?Jg({r:Number(t),g:Number(n),b:Number(r),a:Number(i)}):null},"rgb"],[function(e){var t=e.h,n=e.s,r=e.l,o=e.a,i=void 0===o?1:o;if(!Yg(t)||!Yg(n)||!Yg(r))return null;var s=iv({h:Number(t),s:Number(n),l:Number(r),a:Number(i)});return av(s)},"hsl"],[function(e){var t=e.h,n=e.s,r=e.v,o=e.a,i=void 0===o?1:o;if(!Yg(t)||!Yg(n)||!Yg(r))return null;var s=function(e){return{h:Qg(e.h),s:Zg(e.s,0,100),v:Zg(e.v,0,100),a:Zg(e.a)}}({h:Number(t),s:Number(n),v:Number(r),a:Number(i)});return ov(s)},"hsv"]]},hv=function(e,t){for(var n=0;n=.5},e.prototype.toHex=function(){return t=(e=ev(this.rgba)).r,n=e.g,r=e.b,i=(o=e.a)<1?nv(Xg(255*o)):"","#"+nv(t)+nv(n)+nv(r)+i;var e,t,n,r,o,i},e.prototype.toRgb=function(){return ev(this.rgba)},e.prototype.toRgbString=function(){return t=(e=ev(this.rgba)).r,n=e.g,r=e.b,(o=e.a)<1?"rgba("+t+", "+n+", "+r+", "+o+")":"rgb("+t+", "+n+", "+r+")";var e,t,n,r,o},e.prototype.toHsl=function(){return sv(lv(this.rgba))},e.prototype.toHslString=function(){return t=(e=sv(lv(this.rgba))).h,n=e.s,r=e.l,(o=e.a)<1?"hsla("+t+", "+n+"%, "+r+"%, "+o+")":"hsl("+t+", "+n+"%, "+r+"%)";var e,t,n,r,o},e.prototype.toHsv=function(){return e=rv(this.rgba),{h:Xg(e.h),s:Xg(e.s),v:Xg(e.v),a:Xg(e.a,3)};var e},e.prototype.invert=function(){return yv({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},e.prototype.saturate=function(e){return void 0===e&&(e=.1),yv(gv(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),yv(gv(this.rgba,-e))},e.prototype.grayscale=function(){return yv(gv(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),yv(bv(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),yv(bv(this.rgba,-e))},e.prototype.rotate=function(e){return void 0===e&&(e=15),this.hue(this.hue()+e)},e.prototype.alpha=function(e){return"number"==typeof e?yv({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):Xg(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=lv(this.rgba);return"number"==typeof e?yv({h:e,s:t.s,l:t.l,a:t.a}):Xg(t.h)},e.prototype.isEqual=function(e){return this.toHex()===yv(e).toHex()},e}(),yv=function(e){return e instanceof xv?e:new xv(e)},wv=[],_v=function(e){e.forEach((function(e){wv.indexOf(e)<0&&(e(xv,fv),wv.push(e))}))};function Sv(e,t){var n={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},r={};for(var o in n)r[n[o]]=o;var i={};e.prototype.toName=function(t){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var o,s,a=r[this.toHex()];if(a)return a;if(null==t?void 0:t.closest){var l=this.toRgb(),c=1/0,u="black";if(!i.length)for(var d in n)i[d]=new e(n[d]).toRgb();for(var p in n){var f=(o=l,s=i[p],Math.pow(o.r-s.r,2)+Math.pow(o.g-s.g,2)+Math.pow(o.b-s.b,2));f{const t={};for(const n in e)t[n.toLowerCase()]=e[n];return t}));const zv={body:13,caption:10,footnote:11,largeTitle:28,subheadline:12,title:20},Ov=[1,2,3,4,5,6].flatMap((e=>[e,e.toString()]));function Lv(e=13){if(e in zv)return Lv(zv[e]);if("number"!=typeof e){const t=parseFloat(e);if(Number.isNaN(t))return e;e=t}return`calc(${`(${e} / 13)`} * ${Fl.fontSize})`}function Fv(e=3){if(!Ov.includes(e))return Lv(e);return Fl[`fontSizeH${e}`]}var Bv={name:"50zrmy",styles:"text-transform:uppercase"};function Vv(t){const{adjustLineHeightForInnerControls:n,align:r,children:o,className:i,color:s,ellipsizeMode:a,isDestructive:l=!1,display:u,highlightEscape:d=!1,highlightCaseSensitive:p=!1,highlightWords:f,highlightSanitize:h,isBlock:m=!1,letterSpacing:g,lineHeight:v,optimizeReadabilityFor:b,size:x,truncate:y=!1,upperCase:w=!1,variant:_,weight:S=Fl.fontWeight,...C}=sl(t,"Text");let k=o;const j=Array.isArray(f),E="caption"===x;if(j){if("string"!=typeof o)throw new TypeError("`children` of `Text` must only be `string` types when `highlightWords` is defined");k=function({activeClassName:e="",activeIndex:t=-1,activeStyle:n,autoEscape:r,caseSensitive:o=!1,children:i,findChunks:s,highlightClassName:a="",highlightStyle:l={},highlightTag:u="mark",sanitize:d,searchWords:p=[],unhighlightClassName:f="",unhighlightStyle:h}){if(!i)return null;if("string"!=typeof i)return i;const m=i,g=(0,Av.findAll)({autoEscape:r,caseSensitive:o,findChunks:s,sanitize:d,searchWords:p,textToHighlight:m}),v=u;let b,x=-1,y="";const w=g.map(((r,i)=>{const s=m.substr(r.start,r.end-r.start);if(r.highlight){let r;x++,r="object"==typeof a?o?a[s]:(a=Dv(a))[s.toLowerCase()]:a;const u=x===+t;y=`${r} ${u?e:""}`,b=!0===u&&null!==n?Object.assign({},l,n):l;const d={children:s,className:y,key:i,style:b};return"string"!=typeof v&&(d.highlightIndex=x),(0,c.createElement)(v,d)}return(0,c.createElement)("span",{children:s,className:f,key:i,style:h})}));return w}({autoEscape:d,children:o,caseSensitive:p,searchWords:f,sanitize:h})}const P=il();let N;!0===y&&(N="auto"),!1===y&&(N="none");const T=Kg({...C,className:(0,c.useMemo)((()=>{const t={},o=function(e,t){if(t)return t;if(!e)return;let n=`calc(${Fl.controlHeight} + ${Il(2)})`;switch(e){case"large":n=`calc(${Fl.controlHeightLarge} + ${Il(2)})`;break;case"small":n=`calc(${Fl.controlHeightSmall} + ${Il(2)})`;break;case"xSmall":n=`calc(${Fl.controlHeightXSmall} + ${Il(2)})`}return n}(n,v);if(t.Base=Nl({color:s,display:u,fontSize:Lv(x),fontWeight:S,lineHeight:o,letterSpacing:g,textAlign:r},"",""),t.upperCase=Bv,t.optimalTextColor=null,b){const e="dark"===jv(b);t.optimalTextColor=Nl(e?{color:zl.gray[900]}:{color:zl.white},"","")}return P(Ev,t.Base,t.optimalTextColor,l&&Tv,!!j&&Rv,m&&Pv,E&&Iv,_&&e[_],w&&t.upperCase,i)}),[n,r,i,s,P,u,m,E,l,j,g,v,b,x,w,_,S]),children:o,ellipsizeMode:a||N});return!y&&Array.isArray(o)&&(k=c.Children.map(o,(e=>{if("object"!=typeof e||null===e||!("props"in e))return e;return dl(e,["Link"])?(0,c.cloneElement)(e,{size:e.props.size||"inherit"}):e}))),{...T,children:y?T.children:k}}const $v=al((function(e,t){const n=Vv(e);return(0,_t.jsx)(_l,{as:"span",...n,ref:t})}),"Text");const Hv={name:"9amh4a",styles:"font-size:11px;font-weight:500;line-height:1.4;text-transform:uppercase"};const Wv=yl("span",{target:"em5sgkm8"})({name:"pvvbxf",styles:"box-sizing:border-box;display:block"}),Uv=yl("span",{target:"em5sgkm7"})({name:"jgf79h",styles:"align-items:center;align-self:stretch;box-sizing:border-box;display:flex"}),Gv=({disabled:e,isBorderless:t})=>t?"transparent":e?zl.ui.borderDisabled:zl.ui.border,Kv=yl("div",{target:"em5sgkm6"})("&&&{box-sizing:border-box;border-color:",Gv,";border-radius:inherit;border-style:solid;border-width:1px;bottom:0;left:0;margin:0;padding:0;pointer-events:none;position:absolute;right:0;top:0;",Mg({paddingLeft:2}),";}"),qv=yl(kg,{target:"em5sgkm5"})("box-sizing:border-box;position:relative;border-radius:",Fl.radiusSmall,";padding-top:0;&:focus-within:not( :has( :is( ",Wv,", ",Uv," ):focus-within ) ){",Kv,"{border-color:",zl.ui.borderFocus,";box-shadow:",Fl.controlBoxShadowFocus,";outline:2px solid transparent;outline-offset:-2px;}}"),Yv=({disabled:e})=>Nl({backgroundColor:e?zl.ui.backgroundDisabled:zl.ui.background},"","");var Xv={name:"1d3w5wq",styles:"width:100%"};const Zv=({__unstableInputWidth:e,labelPosition:t})=>e?"side"===t?"":Nl("edge"===t?{flex:`0 0 ${e}`}:{width:e},"",""):Xv,Qv=yl("div",{target:"em5sgkm4"})("align-items:center;box-sizing:border-box;border-radius:inherit;display:flex;flex:1;position:relative;",Yv," ",Zv,";"),Jv=({disabled:e})=>e?Nl({color:zl.ui.textDisabled},"",""):"",eb=({inputSize:e})=>{const t={default:"13px",small:"11px",compact:"13px","__unstable-large":"13px"},n=t[e]||t.default;return n?Nl("font-size:","16px",";@media ( min-width: 600px ){font-size:",n,";}",""):""},tb=({inputSize:e,__next40pxDefaultSize:t})=>{const n={default:{height:40,lineHeight:1,minHeight:40,paddingLeft:Fl.controlPaddingX,paddingRight:Fl.controlPaddingX},small:{height:24,lineHeight:1,minHeight:24,paddingLeft:Fl.controlPaddingXSmall,paddingRight:Fl.controlPaddingXSmall},compact:{height:32,lineHeight:1,minHeight:32,paddingLeft:Fl.controlPaddingXSmall,paddingRight:Fl.controlPaddingXSmall},"__unstable-large":{height:40,lineHeight:1,minHeight:40,paddingLeft:Fl.controlPaddingX,paddingRight:Fl.controlPaddingX}};return t||(n.default=n.compact),n[e]||n.default},nb=e=>Nl(tb(e),"",""),rb=({paddingInlineStart:e,paddingInlineEnd:t})=>Nl({paddingInlineStart:e,paddingInlineEnd:t},"",""),ob=({isDragging:e,dragCursor:t})=>{let n,r;return e&&(n=Nl("cursor:",t,";user-select:none;&::-webkit-outer-spin-button,&::-webkit-inner-spin-button{-webkit-appearance:none!important;margin:0!important;}","")),e&&t&&(r=Nl("&:active{cursor:",t,";}","")),Nl(n," ",r,";","")},ib=yl("input",{target:"em5sgkm3"})("&&&{background-color:transparent;box-sizing:border-box;border:none;box-shadow:none!important;color:",zl.theme.foreground,";display:block;font-family:inherit;margin:0;outline:none;width:100%;",ob," ",Jv," ",eb," ",nb," ",rb," &::-webkit-input-placeholder{line-height:normal;}&[type='email'],&[type='url']{direction:ltr;}}"),sb=yl($v,{target:"em5sgkm2"})("&&&{",Hv,";box-sizing:border-box;display:block;padding-top:0;padding-bottom:0;max-width:100%;z-index:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}"),ab=e=>(0,_t.jsx)(sb,{...e,as:"label"}),lb=yl(Fg,{target:"em5sgkm1"})({name:"1b6uupn",styles:"max-width:calc( 100% - 10px )"}),cb=({variant:e="default",size:t,__next40pxDefaultSize:n,isPrefix:r})=>{const{paddingLeft:o}=tb({inputSize:t,__next40pxDefaultSize:n}),i=r?"paddingInlineStart":"paddingInlineEnd";return Nl("default"===e?{[i]:o}:{display:"flex",[i]:o-4},"","")},ub=yl("div",{target:"em5sgkm0"})(cb,";");const db=(0,c.memo)((function({disabled:e=!1,isBorderless:t=!1}){return(0,_t.jsx)(Kv,{"aria-hidden":"true",className:"components-input-control__backdrop",disabled:e,isBorderless:t})})),pb=db;function fb({children:e,hideLabelFromVision:t,htmlFor:n,...r}){return e?t?(0,_t.jsx)(Sl,{as:"label",htmlFor:n,children:e}):(0,_t.jsx)(lb,{children:(0,_t.jsx)(ab,{htmlFor:n,...r,children:e})}):null}function hb(e){const{__next36pxDefaultSize:t,__next40pxDefaultSize:n,...r}=e;return{...r,__next40pxDefaultSize:null!=n?n:t}}function mb(e){const t={};switch(e){case"top":t.direction="column",t.expanded=!1,t.gap=0;break;case"bottom":t.direction="column-reverse",t.expanded=!1,t.gap=0;break;case"edge":t.justify="space-between"}return t}function gb(e,t){const{__next40pxDefaultSize:n,__unstableInputWidth:r,children:o,className:i,disabled:s=!1,hideLabelFromVision:a=!1,labelPosition:u,id:d,isBorderless:p=!1,label:f,prefix:h,size:m="default",suffix:g,...v}=hb(sl(e,"InputBase")),b=function(e){const t=(0,l.useInstanceId)(gb);return e||`input-base-control-${t}`}(d),x=a||!f,y=(0,c.useMemo)((()=>({InputControlPrefixWrapper:{__next40pxDefaultSize:n,size:m},InputControlSuffixWrapper:{__next40pxDefaultSize:n,size:m}})),[n,m]);return(0,_t.jsxs)(qv,{...v,...mb(u),className:i,gap:2,ref:t,children:[(0,_t.jsx)(fb,{className:"components-input-control__label",hideLabelFromVision:a,labelPosition:u,htmlFor:b,children:f}),(0,_t.jsxs)(Qv,{__unstableInputWidth:r,className:"components-input-control__container",disabled:s,hideLabel:x,labelPosition:u,children:[(0,_t.jsxs)(gs,{value:y,children:[h&&(0,_t.jsx)(Wv,{className:"components-input-control__prefix",children:h}),o,g&&(0,_t.jsx)(Uv,{className:"components-input-control__suffix",children:g})]}),(0,_t.jsx)(pb,{disabled:s,isBorderless:p})]})]})}const vb=al(gb,"InputBase");const bb={toVector:(e,t)=>(void 0===e&&(e=t),Array.isArray(e)?e:[e,e]),add:(e,t)=>[e[0]+t[0],e[1]+t[1]],sub:(e,t)=>[e[0]-t[0],e[1]-t[1]],addTo(e,t){e[0]+=t[0],e[1]+=t[1]},subTo(e,t){e[0]-=t[0],e[1]-=t[1]}};function xb(e,t,n){return 0===t||Math.abs(t)===1/0?Math.pow(e,5*n):e*t*n/(t+n*e)}function yb(e,t,n,r=.15){return 0===r?function(e,t,n){return Math.max(t,Math.min(e,n))}(e,t,n):en?+xb(e-n,n-t,r)+n:e}function wb(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}function _b(e,t,n){return(t=wb(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Sb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Cb(e){for(var t=1;t{var n,r;return t.target===e.currentTarget||(null===(n=e.currentTarget)||void 0===n||null===(r=n.contains)||void 0===r?void 0:r.call(n,t.target))}))}(e).map((e=>e.identifier))}function Db(e){const t=Mb(e);return Ib(e)?t.identifier:t.pointerId}function zb(e){const t=Mb(e);return[t.clientX,t.clientY]}function Ob(e,...t){return"function"==typeof e?e(...t):e}function Lb(){}function Fb(...e){return 0===e.length?Lb:1===e.length?e[0]:function(){let t;for(const n of e)t=n.apply(this,arguments)||t;return t}}function Bb(e,t){return Object.assign({},t,e||{})}class Vb{constructor(e,t,n){this.ctrl=e,this.args=t,this.key=n,this.state||(this.state={},this.computeValues([0,0]),this.computeInitial(),this.init&&this.init(),this.reset())}get state(){return this.ctrl.state[this.key]}set state(e){this.ctrl.state[this.key]=e}get shared(){return this.ctrl.state.shared}get eventStore(){return this.ctrl.gestureEventStores[this.key]}get timeoutStore(){return this.ctrl.gestureTimeoutStores[this.key]}get config(){return this.ctrl.config[this.key]}get sharedConfig(){return this.ctrl.config.shared}get handler(){return this.ctrl.handlers[this.key]}reset(){const{state:e,shared:t,ingKey:n,args:r}=this;t[n]=e._active=e.active=e._blocked=e._force=!1,e._step=[!1,!1],e.intentional=!1,e._movement=[0,0],e._distance=[0,0],e._direction=[0,0],e._delta=[0,0],e._bounds=[[-1/0,1/0],[-1/0,1/0]],e.args=r,e.axis=void 0,e.memo=void 0,e.elapsedTime=e.timeDelta=0,e.direction=[0,0],e.distance=[0,0],e.overflow=[0,0],e._movementBound=[!1,!1],e.velocity=[0,0],e.movement=[0,0],e.delta=[0,0],e.timeStamp=0}start(e){const t=this.state,n=this.config;t._active||(this.reset(),this.computeInitial(),t._active=!0,t.target=e.target,t.currentTarget=e.currentTarget,t.lastOffset=n.from?Ob(n.from,t):t.offset,t.offset=t.lastOffset,t.startTime=t.timeStamp=e.timeStamp)}computeValues(e){const t=this.state;t._values=e,t.values=this.config.transform(e)}computeInitial(){const e=this.state;e._initial=e._values,e.initial=e.values}compute(e){const{state:t,config:n,shared:r}=this;t.args=this.args;let o=0;if(e&&(t.event=e,n.preventDefault&&e.cancelable&&t.event.preventDefault(),t.type=e.type,r.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,r.locked=!!document.pointerLockElement,Object.assign(r,function(e){const t={};if("buttons"in e&&(t.buttons=e.buttons),"shiftKey"in e){const{shiftKey:n,altKey:r,metaKey:o,ctrlKey:i}=e;Object.assign(t,{shiftKey:n,altKey:r,metaKey:o,ctrlKey:i})}return t}(e)),r.down=r.pressed=r.buttons%2==1||r.touches>0,o=e.timeStamp-t.timeStamp,t.timeStamp=e.timeStamp,t.elapsedTime=t.timeStamp-t.startTime),t._active){const e=t._delta.map(Math.abs);bb.addTo(t._distance,e)}this.axisIntent&&this.axisIntent(e);const[i,s]=t._movement,[a,l]=n.threshold,{_step:c,values:u}=t;if(n.hasCustomTransform?(!1===c[0]&&(c[0]=Math.abs(i)>=a&&u[0]),!1===c[1]&&(c[1]=Math.abs(s)>=l&&u[1])):(!1===c[0]&&(c[0]=Math.abs(i)>=a&&Math.sign(i)*a),!1===c[1]&&(c[1]=Math.abs(s)>=l&&Math.sign(s)*l)),t.intentional=!1!==c[0]||!1!==c[1],!t.intentional)return;const d=[0,0];if(n.hasCustomTransform){const[e,t]=u;d[0]=!1!==c[0]?e-c[0]:0,d[1]=!1!==c[1]?t-c[1]:0}else d[0]=!1!==c[0]?i-c[0]:0,d[1]=!1!==c[1]?s-c[1]:0;this.restrictToAxis&&!t._blocked&&this.restrictToAxis(d);const p=t.offset,f=t._active&&!t._blocked||t.active;f&&(t.first=t._active&&!t.active,t.last=!t._active&&t.active,t.active=r[this.ingKey]=t._active,e&&(t.first&&("bounds"in n&&(t._bounds=Ob(n.bounds,t)),this.setup&&this.setup()),t.movement=d,this.computeOffset()));const[h,m]=t.offset,[[g,v],[b,x]]=t._bounds;t.overflow=[hv?1:0,mx?1:0],t._movementBound[0]=!!t.overflow[0]&&(!1===t._movementBound[0]?t._movement[0]:t._movementBound[0]),t._movementBound[1]=!!t.overflow[1]&&(!1===t._movementBound[1]?t._movement[1]:t._movementBound[1]);const y=t._active&&n.rubberband||[0,0];if(t.offset=function(e,[t,n],[r,o]){const[[i,s],[a,l]]=e;return[yb(t,i,s,r),yb(n,a,l,o)]}(t._bounds,t.offset,y),t.delta=bb.sub(t.offset,p),this.computeMovement(),f&&(!t.last||o>32)){t.delta=bb.sub(t.offset,p);const e=t.delta.map(Math.abs);bb.addTo(t.distance,e),t.direction=t.delta.map(Math.sign),t._direction=t._delta.map(Math.sign),!t.first&&o>0&&(t.velocity=[e[0]/o,e[1]/o],t.timeDelta=o)}}emit(){const e=this.state,t=this.shared,n=this.config;if(e._active||this.clean(),(e._blocked||!e.intentional)&&!e._force&&!n.triggerAllEvents)return;const r=this.handler(Cb(Cb(Cb({},t),e),{},{[this.aliasKey]:e.values}));void 0!==r&&(e.memo=r)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}class $b extends Vb{constructor(...e){super(...e),_b(this,"aliasKey","xy")}reset(){super.reset(),this.state.axis=void 0}init(){this.state.offset=[0,0],this.state.lastOffset=[0,0]}computeOffset(){this.state.offset=bb.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=bb.sub(this.state.offset,this.state.lastOffset)}axisIntent(e){const t=this.state,n=this.config;if(!t.axis&&e){const r="object"==typeof n.axisThreshold?n.axisThreshold[Rb(e)]:n.axisThreshold;t.axis=function([e,t],n){const r=Math.abs(e),o=Math.abs(t);return r>o&&r>n?"x":o>r&&o>n?"y":void 0}(t._movement,r)}t._blocked=(n.lockDirection||!!n.axis)&&!t.axis||!!n.axis&&n.axis!==t.axis}restrictToAxis(e){if(this.config.axis||this.config.lockDirection)switch(this.state.axis){case"x":e[1]=0;break;case"y":e[0]=0}}}const Hb=e=>e,Wb={enabled:(e=!0)=>e,eventOptions:(e,t,n)=>Cb(Cb({},n.shared.eventOptions),e),preventDefault:(e=!1)=>e,triggerAllEvents:(e=!1)=>e,rubberband(e=0){switch(e){case!0:return[.15,.15];case!1:return[0,0];default:return bb.toVector(e)}},from:e=>"function"==typeof e?e:null!=e?bb.toVector(e):void 0,transform(e,t,n){const r=e||n.shared.transform;return this.hasCustomTransform=!!r,r||Hb},threshold:e=>bb.toVector(e,0)};const Ub=Cb(Cb({},Wb),{},{axis(e,t,{axis:n}){if(this.lockDirection="lock"===n,!this.lockDirection)return n},axisThreshold:(e=0)=>e,bounds(e={}){if("function"==typeof e)return t=>Ub.bounds(e(t));if("current"in e)return()=>e.current;if("function"==typeof HTMLElement&&e instanceof HTMLElement)return e;const{left:t=-1/0,right:n=1/0,top:r=-1/0,bottom:o=1/0}=e;return[[t,n],[r,o]]}}),Gb={ArrowRight:(e,t=1)=>[e*t,0],ArrowLeft:(e,t=1)=>[-1*e*t,0],ArrowUp:(e,t=1)=>[0,-1*e*t],ArrowDown:(e,t=1)=>[0,e*t]};const Kb="undefined"!=typeof window&&window.document&&window.document.createElement;function qb(){return Kb&&"ontouchstart"in window}const Yb={isBrowser:Kb,gesture:function(){try{return"constructor"in GestureEvent}catch(e){return!1}}(),touch:qb(),touchscreen:qb()||Kb&&window.navigator.maxTouchPoints>1,pointer:Kb&&"onpointerdown"in window,pointerLock:Kb&&"exitPointerLock"in window.document},Xb={mouse:0,touch:0,pen:8},Zb=Cb(Cb({},Ub),{},{device(e,t,{pointer:{touch:n=!1,lock:r=!1,mouse:o=!1}={}}){return this.pointerLock=r&&Yb.pointerLock,Yb.touch&&n?"touch":this.pointerLock?"mouse":Yb.pointer&&!o?"pointer":Yb.touch?"touch":"mouse"},preventScrollAxis(e,t,{preventScroll:n}){if(this.preventScrollDelay="number"==typeof n?n:n||void 0===n&&e?250:void 0,Yb.touchscreen&&!1!==n)return e||(void 0!==n?"y":void 0)},pointerCapture(e,t,{pointer:{capture:n=!0,buttons:r=1,keys:o=!0}={}}){return this.pointerButtons=r,this.keys=o,!this.pointerLock&&"pointer"===this.device&&n},threshold(e,t,{filterTaps:n=!1,tapsThreshold:r=3,axis:o}){const i=bb.toVector(e,n?r:o?1:0);return this.filterTaps=n,this.tapsThreshold=r,i},swipe({velocity:e=.5,distance:t=50,duration:n=250}={}){return{velocity:this.transform(bb.toVector(e)),distance:this.transform(bb.toVector(t)),duration:n}},delay(e=0){switch(e){case!0:return 180;case!1:return 0;default:return e}},axisThreshold:e=>e?Cb(Cb({},Xb),e):Xb,keyboardDisplacement:(e=10)=>e});Cb(Cb({},Wb),{},{device(e,t,{shared:n,pointer:{touch:r=!1}={}}){if(n.target&&!Yb.touch&&Yb.gesture)return"gesture";if(Yb.touch&&r)return"touch";if(Yb.touchscreen){if(Yb.pointer)return"pointer";if(Yb.touch)return"touch"}},bounds(e,t,{scaleBounds:n={},angleBounds:r={}}){const o=e=>{const t=Bb(Ob(n,e),{min:-1/0,max:1/0});return[t.min,t.max]},i=e=>{const t=Bb(Ob(r,e),{min:-1/0,max:1/0});return[t.min,t.max]};return"function"!=typeof n&&"function"!=typeof r?[o(),i()]:e=>[o(e),i(e)]},threshold(e,t,n){this.lockDirection="lock"===n.axis;return bb.toVector(e,this.lockDirection?[.1,3]:0)},modifierKey:e=>void 0===e?"ctrlKey":e,pinchOnWheel:(e=!0)=>e});Cb(Cb({},Ub),{},{mouseOnly:(e=!0)=>e});Cb(Cb({},Ub),{},{mouseOnly:(e=!0)=>e});const Qb=new Map,Jb=new Map;const ex={key:"drag",engine:class extends $b{constructor(...e){super(...e),_b(this,"ingKey","dragging")}reset(){super.reset();const e=this.state;e._pointerId=void 0,e._pointerActive=!1,e._keyboardActive=!1,e._preventScroll=!1,e._delayed=!1,e.swipe=[0,0],e.tap=!1,e.canceled=!1,e.cancel=this.cancel.bind(this)}setup(){const e=this.state;if(e._bounds instanceof HTMLElement){const t=e._bounds.getBoundingClientRect(),n=e.currentTarget.getBoundingClientRect(),r={left:t.left-n.left+e.offset[0],right:t.right-n.right+e.offset[0],top:t.top-n.top+e.offset[1],bottom:t.bottom-n.bottom+e.offset[1]};e._bounds=Ub.bounds(r)}}cancel(){const e=this.state;e.canceled||(e.canceled=!0,e._active=!1,setTimeout((()=>{this.compute(),this.emit()}),0))}setActive(){this.state._active=this.state._pointerActive||this.state._keyboardActive}clean(){this.pointerClean(),this.state._pointerActive=!1,this.state._keyboardActive=!1,super.clean()}pointerDown(e){const t=this.config,n=this.state;if(null!=e.buttons&&(Array.isArray(t.pointerButtons)?!t.pointerButtons.includes(e.buttons):-1!==t.pointerButtons&&t.pointerButtons!==e.buttons))return;const r=this.ctrl.setEventIds(e);t.pointerCapture&&e.target.setPointerCapture(e.pointerId),r&&r.size>1&&n._pointerActive||(this.start(e),this.setupPointer(e),n._pointerId=Db(e),n._pointerActive=!0,this.computeValues(zb(e)),this.computeInitial(),t.preventScrollAxis&&"mouse"!==Rb(e)?(n._active=!1,this.setupScrollPrevention(e)):t.delay>0?(this.setupDelayTrigger(e),t.triggerAllEvents&&(this.compute(e),this.emit())):this.startPointerDrag(e))}startPointerDrag(e){const t=this.state;t._active=!0,t._preventScroll=!0,t._delayed=!1,this.compute(e),this.emit()}pointerMove(e){const t=this.state,n=this.config;if(!t._pointerActive)return;const r=Db(e);if(void 0!==t._pointerId&&r!==t._pointerId)return;const o=zb(e);return document.pointerLockElement===e.target?t._delta=[e.movementX,e.movementY]:(t._delta=bb.sub(o,t._values),this.computeValues(o)),bb.addTo(t._movement,t._delta),this.compute(e),t._delayed&&t.intentional?(this.timeoutStore.remove("dragDelay"),t.active=!1,void this.startPointerDrag(e)):n.preventScrollAxis&&!t._preventScroll?t.axis?t.axis===n.preventScrollAxis||"xy"===n.preventScrollAxis?(t._active=!1,void this.clean()):(this.timeoutStore.remove("startPointerDrag"),void this.startPointerDrag(e)):void 0:void this.emit()}pointerUp(e){this.ctrl.setEventIds(e);try{this.config.pointerCapture&&e.target.hasPointerCapture(e.pointerId)&&e.target.releasePointerCapture(e.pointerId)}catch(e){0}const t=this.state,n=this.config;if(!t._active||!t._pointerActive)return;const r=Db(e);if(void 0!==t._pointerId&&r!==t._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(e);const[o,i]=t._distance;if(t.tap=o<=n.tapsThreshold&&i<=n.tapsThreshold,t.tap&&n.filterTaps)t._force=!0;else{const[e,r]=t._delta,[o,i]=t._movement,[s,a]=n.swipe.velocity,[l,c]=n.swipe.distance,u=n.swipe.duration;if(t.elapsedTimes&&Math.abs(o)>l&&(t.swipe[0]=Math.sign(e)),u>a&&Math.abs(i)>c&&(t.swipe[1]=Math.sign(r))}}this.emit()}pointerClick(e){!this.state.tap&&e.detail>0&&(e.preventDefault(),e.stopPropagation())}setupPointer(e){const t=this.config,n=t.device;t.pointerLock&&e.currentTarget.requestPointerLock(),t.pointerCapture||(this.eventStore.add(this.sharedConfig.window,n,"change",this.pointerMove.bind(this)),this.eventStore.add(this.sharedConfig.window,n,"end",this.pointerUp.bind(this)),this.eventStore.add(this.sharedConfig.window,n,"cancel",this.pointerUp.bind(this)))}pointerClean(){this.config.pointerLock&&document.pointerLockElement===this.state.currentTarget&&document.exitPointerLock()}preventScroll(e){this.state._preventScroll&&e.cancelable&&e.preventDefault()}setupScrollPrevention(e){this.state._preventScroll=!1,function(e){"persist"in e&&"function"==typeof e.persist&&e.persist()}(e);const t=this.eventStore.add(this.sharedConfig.window,"touch","change",this.preventScroll.bind(this),{passive:!1});this.eventStore.add(this.sharedConfig.window,"touch","end",t),this.eventStore.add(this.sharedConfig.window,"touch","cancel",t),this.timeoutStore.add("startPointerDrag",this.startPointerDrag.bind(this),this.config.preventScrollDelay,e)}setupDelayTrigger(e){this.state._delayed=!0,this.timeoutStore.add("dragDelay",(()=>{this.state._step=[0,0],this.startPointerDrag(e)}),this.config.delay)}keyDown(e){const t=Gb[e.key];if(t){const n=this.state,r=e.shiftKey?10:e.altKey?.1:1;this.start(e),n._delta=t(this.config.keyboardDisplacement,r),n._keyboardActive=!0,bb.addTo(n._movement,n._delta),this.compute(e),this.emit()}}keyUp(e){e.key in Gb&&(this.state._keyboardActive=!1,this.setActive(),this.compute(e),this.emit())}bind(e){const t=this.config.device;e(t,"start",this.pointerDown.bind(this)),this.config.pointerCapture&&(e(t,"change",this.pointerMove.bind(this)),e(t,"end",this.pointerUp.bind(this)),e(t,"cancel",this.pointerUp.bind(this)),e("lostPointerCapture","",this.pointerUp.bind(this))),this.config.keys&&(e("key","down",this.keyDown.bind(this)),e("key","up",this.keyUp.bind(this))),this.config.filterTaps&&e("click","",this.pointerClick.bind(this),{capture:!0,passive:!1})}},resolver:Zb};function tx(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}const nx={target(e){if(e)return()=>"current"in e?e.current:e},enabled:(e=!0)=>e,window:(e=(Yb.isBrowser?window:void 0))=>e,eventOptions:({passive:e=!0,capture:t=!1}={})=>({passive:e,capture:t}),transform:e=>e},rx=["target","eventOptions","window","enabled","transform"];function ox(e={},t){const n={};for(const[r,o]of Object.entries(t))switch(typeof o){case"function":n[r]=o.call(n,e[r],r,e);break;case"object":n[r]=ox(e[r],o);break;case"boolean":o&&(n[r]=e[r])}return n}class ix{constructor(e,t){_b(this,"_listeners",new Set),this._ctrl=e,this._gestureKey=t}add(e,t,n,r,o){const i=this._listeners,s=function(e,t=""){const n=kb[e];return e+(n&&n[t]||t)}(t,n),a=Cb(Cb({},this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{}),o);e.addEventListener(s,r,a);const l=()=>{e.removeEventListener(s,r,a),i.delete(l)};return i.add(l),l}clean(){this._listeners.forEach((e=>e())),this._listeners.clear()}}class sx{constructor(){_b(this,"_timeouts",new Map)}add(e,t,n=140,...r){this.remove(e),this._timeouts.set(e,window.setTimeout(t,n,...r))}remove(e){const t=this._timeouts.get(e);t&&window.clearTimeout(t)}clean(){this._timeouts.forEach((e=>{window.clearTimeout(e)})),this._timeouts.clear()}}class ax{constructor(e){_b(this,"gestures",new Set),_b(this,"_targetEventStore",new ix(this)),_b(this,"gestureEventStores",{}),_b(this,"gestureTimeoutStores",{}),_b(this,"handlers",{}),_b(this,"config",{}),_b(this,"pointerIds",new Set),_b(this,"touchIds",new Set),_b(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),function(e,t){t.drag&&lx(e,"drag");t.wheel&&lx(e,"wheel");t.scroll&&lx(e,"scroll");t.move&&lx(e,"move");t.pinch&&lx(e,"pinch");t.hover&&lx(e,"hover")}(this,e)}setEventIds(e){return Ib(e)?(this.touchIds=new Set(Ab(e)),this.touchIds):"pointerId"in e?("pointerup"===e.type||"pointercancel"===e.type?this.pointerIds.delete(e.pointerId):"pointerdown"===e.type&&this.pointerIds.add(e.pointerId),this.pointerIds):void 0}applyHandlers(e,t){this.handlers=e,this.nativeHandlers=t}applyConfig(e,t){this.config=function(e,t,n={}){const r=e,{target:o,eventOptions:i,window:s,enabled:a,transform:l}=r,c=tx(r,rx);if(n.shared=ox({target:o,eventOptions:i,window:s,enabled:a,transform:l},nx),t){const e=Jb.get(t);n[t]=ox(Cb({shared:n.shared},c),e)}else for(const e in c){const t=Jb.get(e);t&&(n[e]=ox(Cb({shared:n.shared},c[e]),t))}return n}(e,t,this.config)}clean(){this._targetEventStore.clean();for(const e of this.gestures)this.gestureEventStores[e].clean(),this.gestureTimeoutStores[e].clean()}effect(){return this.config.shared.target&&this.bind(),()=>this._targetEventStore.clean()}bind(...e){const t=this.config.shared,n={};let r;if(!t.target||(r=t.target(),r)){if(t.enabled){for(const t of this.gestures){const o=this.config[t],i=cx(n,o.eventOptions,!!r);if(o.enabled){new(Qb.get(t))(this,e,t).bind(i)}}const o=cx(n,t.eventOptions,!!r);for(const t in this.nativeHandlers)o(t,"",(n=>this.nativeHandlers[t](Cb(Cb({},this.state.shared),{},{event:n,args:e}))),void 0,!0)}for(const e in n)n[e]=Fb(...n[e]);if(!r)return n;for(const e in n){const{device:t,capture:o,passive:i}=Tb(e);this._targetEventStore.add(r,t,"",n[e],{capture:o,passive:i})}}}}function lx(e,t){e.gestures.add(t),e.gestureEventStores[t]=new ix(e,t),e.gestureTimeoutStores[t]=new sx}const cx=(e,t,n)=>(r,o,i,s={},a=!1)=>{var l,c;const u=null!==(l=s.capture)&&void 0!==l?l:t.capture,d=null!==(c=s.passive)&&void 0!==c?c:t.passive;let p=a?r:Pb(r,o,u);n&&d&&(p+="Passive"),e[p]=e[p]||[],e[p].push(i)};function ux(e,t={},n,r){const o=$().useMemo((()=>new ax(e)),[]);if(o.applyHandlers(e,r),o.applyConfig(t,n),$().useEffect(o.effect.bind(o)),$().useEffect((()=>o.clean.bind(o)),[]),void 0===t.target)return o.bind.bind(o)}function dx(e,t){var n;return n=ex,Qb.set(n.key,n.engine),Jb.set(n.key,n.resolver),ux({drag:e},t||{},"drag")}const px=e=>e,fx={error:null,initialValue:"",isDirty:!1,isDragEnabled:!1,isDragging:!1,isPressEnterToChange:!1,value:""},hx="CHANGE",mx="COMMIT",gx="CONTROL",vx="DRAG_END",bx="DRAG_START",xx="DRAG",yx="INVALIDATE",wx="PRESS_DOWN",_x="PRESS_ENTER",Sx="PRESS_UP",Cx="RESET";function kx(e=px,t=fx,n){const[r,o]=(0,c.useReducer)((i=e,(e,t)=>{const n={...e};switch(t.type){case gx:return n.value=t.payload.value,n.isDirty=!1,n._event=void 0,n;case Sx:case wx:n.isDirty=!1;break;case bx:n.isDragging=!0;break;case vx:n.isDragging=!1;break;case hx:n.error=null,n.value=t.payload.value,e.isPressEnterToChange&&(n.isDirty=!0);break;case mx:n.value=t.payload.value,n.isDirty=!1;break;case Cx:n.error=null,n.isDirty=!1,n.value=t.payload.value||e.initialValue;break;case yx:n.error=t.payload.error}return n._event=t.payload.event,i(n,t)}),function(e=fx){const{value:t}=e;return{...fx,...e,initialValue:t}}(t));var i;const s=e=>(t,n)=>{o({type:e,payload:{value:t,event:n}})},a=e=>t=>{o({type:e,payload:{event:t}})},l=e=>t=>{o({type:e,payload:t})},u=s(hx),d=s(Cx),p=s(mx),f=l(bx),h=l(xx),m=l(vx),g=a(Sx),v=a(wx),b=a(_x),x=(0,c.useRef)(r),y=(0,c.useRef)({value:t.value,onChangeHandler:n});return(0,c.useLayoutEffect)((()=>{x.current=r,y.current={value:t.value,onChangeHandler:n}})),(0,c.useLayoutEffect)((()=>{var e;void 0===x.current._event||r.value===y.current.value||r.isDirty||y.current.onChangeHandler(null!==(e=r.value)&&void 0!==e?e:"",{event:x.current._event})}),[r.value,r.isDirty]),(0,c.useLayoutEffect)((()=>{var e;t.value===x.current.value||x.current.isDirty||o({type:gx,payload:{value:null!==(e=t.value)&&void 0!==e?e:""}})}),[t.value]),{change:u,commit:p,dispatch:o,drag:h,dragEnd:m,dragStart:f,invalidate:(e,t)=>o({type:yx,payload:{error:e,event:t}}),pressDown:v,pressEnter:b,pressUp:g,reset:d,state:r}}function jx(e){return t=>{const{isComposing:n}="nativeEvent"in t?t.nativeEvent:t;n||229===t.keyCode||e(t)}}const Ex=()=>{};const Px=(0,c.forwardRef)((function({disabled:e=!1,dragDirection:t="n",dragThreshold:n=10,id:r,isDragEnabled:o=!1,isPressEnterToChange:i=!1,onBlur:s=Ex,onChange:a=Ex,onDrag:l=Ex,onDragEnd:u=Ex,onDragStart:d=Ex,onKeyDown:p=Ex,onValidate:f=Ex,size:h="default",stateReducer:m=e=>e,value:g,type:v,...b},x){const{state:y,change:w,commit:_,drag:S,dragEnd:C,dragStart:k,invalidate:j,pressDown:E,pressEnter:P,pressUp:N,reset:T}=kx(m,{isDragEnabled:o,value:g,isPressEnterToChange:i},a),{value:I,isDragging:R,isDirty:M}=y,A=(0,c.useRef)(!1),D=function(e,t){const n=function(e){let t="ns-resize";switch(e){case"n":case"s":t="ns-resize";break;case"e":case"w":t="ew-resize"}return t}(t);return(0,c.useEffect)((()=>{document.documentElement.style.cursor=e?n:null}),[e,n]),n}(R,t),z=e=>{const t=e.currentTarget.value;try{f(t),_(t,e)}catch(t){j(t,e)}},O=dx((e=>{const{distance:t,dragging:n,event:r,target:o}=e;if(e.event={...e.event,target:o},t){if(r.stopPropagation(),!n)return u(e),void C(e);l(e),S(e),R||(d(e),k(e))}}),{axis:"e"===t||"w"===t?"x":"y",threshold:n,enabled:o,pointer:{capture:!1}}),L=o?O():{};let F;return"number"===v&&(F=e=>{b.onMouseDown?.(e),e.currentTarget!==e.currentTarget.ownerDocument.activeElement&&e.currentTarget.focus()}),(0,_t.jsx)(ib,{...b,...L,className:"components-input-control__input",disabled:e,dragCursor:D,isDragging:R,id:r,onBlur:e=>{s(e),!M&&e.target.validity.valid||(A.current=!0,z(e))},onChange:e=>{const t=e.target.value;w(t,e)},onKeyDown:jx((e=>{const{key:t}=e;switch(p(e),t){case"ArrowUp":N(e);break;case"ArrowDown":E(e);break;case"Enter":P(e),i&&(e.preventDefault(),z(e));break;case"Escape":i&&M&&(e.preventDefault(),T(g,e))}})),onMouseDown:F,ref:x,inputSize:h,value:null!=I?I:"",type:v})})),Nx=Px,Tx={"default.fontFamily":"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif","default.fontSize":"13px","helpText.fontSize":"12px",mobileTextMinFontSize:"16px"};function Ix(e){var t;return null!==(t=Tx[e])&&void 0!==t?t:""}const Rx={name:"kv6lnz",styles:"box-sizing:border-box;*,*::before,*::after{box-sizing:inherit;}"};const Mx=yl("div",{target:"ej5x27r4"})("font-family:",Ix("default.fontFamily"),";font-size:",Ix("default.fontSize"),";",Rx,";"),Ax=({__nextHasNoMarginBottom:e=!1})=>!e&&Nl("margin-bottom:",Il(2),";",""),Dx=yl("div",{target:"ej5x27r3"})(Ax," .components-panel__row &{margin-bottom:inherit;}"),zx=Nl(Hv,";display:block;margin-bottom:",Il(2),";padding:0;",""),Ox=yl("label",{target:"ej5x27r2"})(zx,";");var Lx={name:"11yad0w",styles:"margin-bottom:revert"};const Fx=({__nextHasNoMarginBottom:e=!1})=>!e&&Lx,Bx=yl("p",{target:"ej5x27r1"})("margin-top:",Il(2),";margin-bottom:0;font-size:",Ix("helpText.fontSize"),";font-style:normal;color:",zl.gray[700],";",Fx,";"),Vx=yl("span",{target:"ej5x27r0"})(zx,";"),$x=(0,c.forwardRef)(((e,t)=>{const{className:n,children:r,...o}=e;return(0,_t.jsx)(Vx,{ref:t,...o,className:s("components-base-control__label",n),children:r})})),Hx=Object.assign(ll((e=>{const{__nextHasNoMarginBottom:t=!1,__associatedWPComponentName:n="BaseControl",id:r,label:o,hideLabelFromVision:i=!1,help:s,className:a,children:l}=sl(e,"BaseControl");return t||Xi()(`Bottom margin styles for wp.components.${n}`,{since:"6.7",version:"7.0",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version."}),(0,_t.jsxs)(Mx,{className:a,children:[(0,_t.jsxs)(Dx,{className:"components-base-control__field",__nextHasNoMarginBottom:t,children:[o&&r&&(i?(0,_t.jsx)(Sl,{as:"label",htmlFor:r,children:o}):(0,_t.jsx)(Ox,{className:"components-base-control__label",htmlFor:r,children:o})),o&&!r&&(i?(0,_t.jsx)(Sl,{as:"label",children:o}):(0,_t.jsx)($x,{children:o})),l]}),!!s&&(0,_t.jsx)(Bx,{id:r?r+"__help":void 0,className:"components-base-control__help",__nextHasNoMarginBottom:t,children:s})]})}),"BaseControl"),{VisualLabel:$x}),Wx=Hx;function Ux({componentName:e,__next40pxDefaultSize:t,size:n,__shouldNotWarnDeprecated36pxSize:r}){r||t||void 0!==n&&"default"!==n||Xi()(`36px default size for wp.components.${e}`,{since:"6.8",version:"7.1",hint:"Set the `__next40pxDefaultSize` prop to true to start opting into the new default size, which will become the default in a future version."})}const Gx=()=>{};const Kx=(0,c.forwardRef)((function(e,t){const{__next40pxDefaultSize:n,__shouldNotWarnDeprecated36pxSize:r,__unstableStateReducer:o=e=>e,__unstableInputWidth:i,className:a,disabled:u=!1,help:d,hideLabelFromVision:p=!1,id:f,isPressEnterToChange:h=!1,label:m,labelPosition:g="top",onChange:v=Gx,onValidate:b=Gx,onKeyDown:x=Gx,prefix:y,size:w="default",style:_,suffix:S,value:C,...k}=hb(e),j=function(e){const t=(0,l.useInstanceId)(Kx);return e||`inspector-input-control-${t}`}(f),E=s("components-input-control",a),P=function(e){const t=(0,c.useRef)(e.value),[n,r]=(0,c.useState)({}),o=void 0!==n.value?n.value:e.value;return(0,c.useLayoutEffect)((()=>{const{current:o}=t;t.current=e.value,void 0===n.value||n.isStale?n.isStale&&e.value!==o&&r({}):r({...n,isStale:!0})}),[e.value,n]),{value:o,onBlur:t=>{r({}),e.onBlur?.(t)},onChange:(t,n)=>{r((e=>Object.assign(e,{value:t,isStale:!1}))),e.onChange(t,n)}}}({value:C,onBlur:k.onBlur,onChange:v}),N=d?{"aria-describedby":`${j}__help`}:{};return Ux({componentName:"InputControl",__next40pxDefaultSize:n,size:w,__shouldNotWarnDeprecated36pxSize:r}),(0,_t.jsx)(Wx,{className:E,help:d,id:j,__nextHasNoMarginBottom:!0,children:(0,_t.jsx)(vb,{__next40pxDefaultSize:n,__unstableInputWidth:i,disabled:u,gap:3,hideLabelFromVision:p,id:j,justify:"left",label:m,labelPosition:g,prefix:y,size:w,style:_,suffix:S,children:(0,_t.jsx)(Nx,{...k,...N,__next40pxDefaultSize:n,className:"components-input-control__input",disabled:u,id:j,isPressEnterToChange:h,onKeyDown:x,onValidate:b,paddingInlineStart:y?Il(1):void 0,paddingInlineEnd:S?Il(1):void 0,ref:t,size:w,stateReducer:o,...P})})})})),qx=Kx;const Yx=function({icon:e,className:t,size:n=20,style:r={},...o}){const i=["dashicon","dashicons","dashicons-"+e,t].filter(Boolean).join(" "),s={...20!=n?{fontSize:`${n}px`,width:`${n}px`,height:`${n}px`}:{},...r};return(0,_t.jsx)("span",{className:i,style:s,...o})};const Xx=function({icon:e=null,size:t=("string"==typeof e?20:24),...r}){if("string"==typeof e)return(0,_t.jsx)(Yx,{icon:e,size:t,...r});if((0,c.isValidElement)(e)&&Yx===e.type)return(0,c.cloneElement)(e,{...r});if("function"==typeof e)return(0,c.createElement)(e,{size:t,...r});if(e&&("svg"===e.type||e.type===n.SVG)){const o={...e.props,width:t,height:t,...r};return(0,_t.jsx)(n.SVG,{...o})}return(0,c.isValidElement)(e)?(0,c.cloneElement)(e,{size:t,...r}):e},Zx=["onMouseDown","onClick"];const Qx=(0,c.forwardRef)((function(e,t){const{__next40pxDefaultSize:n,accessibleWhenDisabled:r,isBusy:o,isDestructive:i,className:a,disabled:c,icon:u,iconPosition:d="left",iconSize:p,showTooltip:f,tooltipPosition:h,shortcut:m,label:g,children:v,size:b="default",text:x,variant:y,description:w,..._}=function({__experimentalIsFocusable:e,isDefault:t,isPrimary:n,isSecondary:r,isTertiary:o,isLink:i,isPressed:s,isSmall:a,size:l,variant:c,describedBy:u,...d}){let p=l,f=c;const h={accessibleWhenDisabled:e,"aria-pressed":s,description:u};var m,g,v,b,x,y;return a&&(null!==(m=p)&&void 0!==m||(p="small")),n&&(null!==(g=f)&&void 0!==g||(f="primary")),o&&(null!==(v=f)&&void 0!==v||(f="tertiary")),r&&(null!==(b=f)&&void 0!==b||(f="secondary")),t&&(Xi()("wp.components.Button `isDefault` prop",{since:"5.4",alternative:'variant="secondary"'}),null!==(x=f)&&void 0!==x||(f="secondary")),i&&(null!==(y=f)&&void 0!==y||(f="link")),{...h,...d,size:p,variant:f}}(e),{href:S,target:C,"aria-checked":k,"aria-pressed":j,"aria-selected":E,...P}="href"in _?_:{href:void 0,target:void 0,..._},N=(0,l.useInstanceId)(Qx,"components-button__description"),T="string"==typeof v&&!!v||Array.isArray(v)&&v?.[0]&&null!==v[0]&&"components-tooltip"!==v?.[0]?.props?.className,I=s("components-button",a,{"is-next-40px-default-size":n,"is-secondary":"secondary"===y,"is-primary":"primary"===y,"is-small":"small"===b,"is-compact":"compact"===b,"is-tertiary":"tertiary"===y,"is-pressed":[!0,"true","mixed"].includes(j),"is-pressed-mixed":"mixed"===j,"is-busy":o,"is-link":"link"===y,"is-destructive":i,"has-text":!!u&&(T||x),"has-icon":!!u}),R=c&&!r,M=void 0===S||c?"button":"a",A="button"===M?{type:"button",disabled:R,"aria-checked":k,"aria-pressed":j,"aria-selected":E}:{},D="a"===M?{href:S,target:C}:{},z={};if(c&&r){A["aria-disabled"]=!0,D["aria-disabled"]=!0;for(const e of Zx)z[e]=e=>{e&&(e.stopPropagation(),e.preventDefault())}}const O=!R&&(f&&!!g||!!m||!!g&&!v?.length&&!1!==f),L=w?N:void 0,F=P["aria-describedby"]||L,B={className:I,"aria-label":P["aria-label"]||g,"aria-describedby":F,ref:t},V=(0,_t.jsxs)(_t.Fragment,{children:[u&&"left"===d&&(0,_t.jsx)(Xx,{icon:u,size:p}),x&&(0,_t.jsx)(_t.Fragment,{children:x}),v,u&&"right"===d&&(0,_t.jsx)(Xx,{icon:u,size:p})]}),$="a"===M?(0,_t.jsx)("a",{...D,...P,...z,...B,children:V}):(0,_t.jsx)("button",{...A,...P,...z,...B,children:V}),H=O?{text:v?.length&&w?w:g,shortcut:m,placement:h&&Ji(h)}:{};return(0,_t.jsxs)(_t.Fragment,{children:[(0,_t.jsx)(ss,{...H,children:$}),w&&(0,_t.jsx)(Sl,{children:(0,_t.jsx)("span",{id:L,children:w})})]})})),Jx=Qx;var ey={name:"euqsgg",styles:"input[type='number']::-webkit-outer-spin-button,input[type='number']::-webkit-inner-spin-button{-webkit-appearance:none!important;margin:0!important;}input[type='number']{-moz-appearance:textfield;}"};const ty=({hideHTMLArrows:e})=>e?ey:"",ny=yl(qx,{target:"ep09it41"})(ty,";"),ry=yl(Jx,{target:"ep09it40"})("&&&&&{color:",zl.theme.accent,";}"),oy={smallSpinButtons:Nl("width:",Il(5),";min-width:",Il(5),";height:",Il(5),";","")};function iy(e){const t=Number(e);return isNaN(t)?0:t}function sy(...e){return e.reduce(((e,t)=>e+iy(t)),0)}function ay(e,t,n){const r=iy(e);return Math.max(t,Math.min(r,n))}function ly(e=0,t=1/0,n=1/0,r=1){const o=iy(e),i=iy(r),s=function(e){const t=(e+"").split(".");return void 0!==t[1]?t[1].length:0}(r),a=ay(Math.round(o/i)*i,t,n);return s?iy(a.toFixed(s)):a}const cy={bottom:{align:"flex-end",justify:"center"},bottomLeft:{align:"flex-end",justify:"flex-start"},bottomRight:{align:"flex-end",justify:"flex-end"},center:{align:"center",justify:"center"},edge:{align:"center",justify:"space-between"},left:{align:"center",justify:"flex-start"},right:{align:"center",justify:"flex-end"},stretch:{align:"stretch"},top:{align:"flex-start",justify:"center"},topLeft:{align:"flex-start",justify:"flex-start"},topRight:{align:"flex-start",justify:"flex-end"}},uy={bottom:{justify:"flex-end",align:"center"},bottomLeft:{justify:"flex-end",align:"flex-start"},bottomRight:{justify:"flex-end",align:"flex-end"},center:{justify:"center",align:"center"},edge:{justify:"space-between",align:"center"},left:{justify:"center",align:"flex-start"},right:{justify:"center",align:"flex-end"},stretch:{align:"stretch"},top:{justify:"flex-start",align:"center"},topLeft:{justify:"flex-start",align:"flex-start"},topRight:{justify:"flex-start",align:"flex-end"}};function dy(e){return"string"==typeof e?[e]:c.Children.toArray(e).filter((e=>(0,c.isValidElement)(e)))}function py(e){const{alignment:t="edge",children:n,direction:r,spacing:o=2,...i}=sl(e,"HStack"),s=function(e,t="row"){if(!Vg(e))return{};const n="column"===t?uy:cy;return e in n?n[e]:{align:e}}(t,r),a=dy(n).map(((e,t)=>{if(dl(e,["Spacer"])){const n=e,r=n.key||`hstack-${t}`;return(0,_t.jsx)(Fg,{isBlock:!0,...n.props},r)}return e})),l={children:a,direction:r,justify:"center",...s,...i,gap:o},{isColumn:c,...u}=Sg(l);return u}const fy=al((function(e,t){const n=py(e);return(0,_t.jsx)(_l,{...n,ref:t})}),"HStack"),hy=()=>{};const my=(0,c.forwardRef)((function(e,t){const{__unstableStateReducer:n,className:r,dragDirection:o="n",hideHTMLArrows:i=!1,spinControls:u=(i?"none":"native"),isDragEnabled:d=!0,isShiftStepEnabled:p=!0,label:f,max:h=1/0,min:m=-1/0,required:g=!1,shiftStep:v=10,step:b=1,spinFactor:x=1,type:y="number",value:w,size:_="default",suffix:S,onChange:C=hy,__shouldNotWarnDeprecated36pxSize:k,...j}=hb(e);Ux({componentName:"NumberControl",size:_,__next40pxDefaultSize:j.__next40pxDefaultSize,__shouldNotWarnDeprecated36pxSize:k}),i&&Xi()("wp.components.NumberControl hideHTMLArrows prop ",{alternative:'spinControls="none"',since:"6.2",version:"6.3"});const E=(0,c.useRef)(),P=(0,l.useMergeRefs)([E,t]),N="any"===b,T=N?1:$g(b),I=$g(x)*T,R=ly(0,m,h,T),M=(e,t)=>N?""+Math.min(h,Math.max(m,$g(e))):""+ly(e,m,h,null!=t?t:T),A="number"===y?"off":void 0,D=s("components-number-control",r),z=il()("small"===_&&oy.smallSpinButtons),O=(e,t,n)=>{n?.preventDefault();const r=n?.shiftKey&&p,o=r?$g(v)*I:I;let i=function(e){const t=""===e;return!Vg(e)||t}(e)?R:e;return"up"===t?i=sy(i,o):"down"===t&&(i=function(...e){return e.reduce(((e,t,n)=>{const r=iy(t);return 0===n?r:e-r}),0)}(i,o)),M(i,r?o:void 0)},L=e=>t=>C(String(O(w,e,t)),{event:{...t,target:E.current}});return(0,_t.jsx)(ny,{autoComplete:A,inputMode:"numeric",...j,className:D,dragDirection:o,hideHTMLArrows:"native"!==u,isDragEnabled:d,label:f,max:h,min:m,ref:P,required:g,step:b,type:y,value:w,__unstableStateReducer:(e,t)=>{var r;const i=((e,t)=>{const n={...e},{type:r,payload:i}=t,s=i.event,l=n.value;if(r!==Sx&&r!==wx||(n.value=O(l,r===Sx?"up":"down",s)),r===xx&&d){const[e,t]=i.delta,r=i.shiftKey&&p,s=r?$g(v)*I:I;let c,u;switch(o){case"n":u=t,c=-1;break;case"e":u=e,c=(0,a.isRTL)()?-1:1;break;case"s":u=t,c=1;break;case"w":u=e,c=(0,a.isRTL)()?1:-1}if(0!==u){u=Math.ceil(Math.abs(u))*Math.sign(u);const e=u*s*c;n.value=M(sy(l,e),r?s:void 0)}}if(r===_x||r===mx){const e=!1===g&&""===l;n.value=e?l:M(l)}return n})(e,t);return null!==(r=n?.(i,t))&&void 0!==r?r:i},size:_,__shouldNotWarnDeprecated36pxSize:!0,suffix:"custom"===u?(0,_t.jsxs)(_t.Fragment,{children:[S,(0,_t.jsx)(zg,{marginBottom:0,marginRight:2,children:(0,_t.jsxs)(fy,{spacing:1,children:[(0,_t.jsx)(ry,{className:z,icon:Og,size:"small",label:(0,a.__)("Increment"),onClick:L("up")}),(0,_t.jsx)(ry,{className:z,icon:Lg,size:"small",label:(0,a.__)("Decrement"),onClick:L("down")})]})})]}):S,onChange:C})})),gy=my;const vy=yl("div",{target:"eln3bjz3"})("border-radius:",Fl.radiusRound,";border:",Fl.borderWidth," solid ",zl.ui.border,";box-sizing:border-box;cursor:grab;height:",32,"px;overflow:hidden;width:",32,"px;:active{cursor:grabbing;}"),by=yl("div",{target:"eln3bjz2"})({name:"1r307gh",styles:"box-sizing:border-box;position:relative;width:100%;height:100%;:focus-visible{outline:none;}"}),xy=yl("div",{target:"eln3bjz1"})("background:",zl.theme.accent,";border-radius:",Fl.radiusRound,";box-sizing:border-box;display:block;left:50%;top:4px;transform:translateX( -50% );position:absolute;width:",6,"px;height:",6,"px;"),yy=yl($v,{target:"eln3bjz0"})("color:",zl.theme.accent,";margin-right:",Il(3),";");const wy=function({value:e,onChange:t,...n}){const r=(0,c.useRef)(null),o=(0,c.useRef)(),i=(0,c.useRef)(),s=e=>{if(void 0!==e&&(e.preventDefault(),e.target?.focus(),void 0!==o.current&&void 0!==t)){const{x:n,y:r}=o.current;t(function(e,t,n,r){const o=r-t,i=n-e,s=Math.atan2(o,i),a=Math.round(s*(180/Math.PI))+90;if(a<0)return 360+a;return a}(n,r,e.clientX,e.clientY))}},{startDrag:a,isDragging:u}=(0,l.__experimentalUseDragging)({onDragStart:e=>{(()=>{if(null===r.current)return;const e=r.current.getBoundingClientRect();o.current={x:e.x+e.width/2,y:e.y+e.height/2}})(),s(e)},onDragMove:s,onDragEnd:s});return(0,c.useEffect)((()=>{u?(void 0===i.current&&(i.current=document.body.style.cursor),document.body.style.cursor="grabbing"):(document.body.style.cursor=i.current||"",i.current=void 0)}),[u]),(0,_t.jsx)(vy,{ref:r,onMouseDown:a,className:"components-angle-picker-control__angle-circle",...n,children:(0,_t.jsx)(by,{style:e?{transform:`rotate(${e}deg)`}:void 0,className:"components-angle-picker-control__angle-circle-indicator-wrapper",tabIndex:-1,children:(0,_t.jsx)(xy,{className:"components-angle-picker-control__angle-circle-indicator"})})})};const _y=(0,c.forwardRef)((function(e,t){const{className:n,label:r=(0,a.__)("Angle"),onChange:o,value:i,...l}=e,c=s("components-angle-picker-control",n),u=(0,_t.jsx)(yy,{children:"°"}),[d,p]=(0,a.isRTL)()?[u,null]:[null,u];return(0,_t.jsxs)(kg,{...l,ref:t,className:c,gap:2,children:[(0,_t.jsx)(Eg,{children:(0,_t.jsx)(gy,{__next40pxDefaultSize:!0,label:r,className:"components-angle-picker-control__input-field",max:360,min:0,onChange:e=>{if(void 0===o)return;const t=void 0!==e&&""!==e?parseInt(e,10):0;o(t)},step:"1",value:i,spinControls:"none",prefix:d,suffix:p})}),(0,_t.jsx)(zg,{marginBottom:"1",marginTop:"auto",children:(0,_t.jsx)(wy,{"aria-hidden":"true",value:i,onChange:o})})]})}));var Sy=o(9681),Cy=o.n(Sy);const ky=window.wp.richText,jy=window.wp.a11y,Ey=window.wp.keycodes,Py=new RegExp(/[\u007e\u00ad\u2053\u207b\u208b\u2212\p{Pd}]/gu),Ny=e=>Cy()(e).toLocaleLowerCase().replace(Py,"-");function Ty(e){var t;let n=null!==(t=e?.toString?.())&&void 0!==t?t:"";return n=n.replace(/['\u2019]/,""),js(n,{splitRegexp:[/(?!(?:1ST|2ND|3RD|[4-9]TH)(?![a-z]))([a-z0-9])([A-Z])/g,/(?!(?:1st|2nd|3rd|[4-9]th)(?![a-z]))([0-9])([a-z])/g,/([A-Za-z])([0-9])/g,/([A-Z])([A-Z][a-z])/g]})}function Iy(e){return e.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&")}function Ry(e){return t=>{const[n,r]=(0,c.useState)([]);return(0,c.useLayoutEffect)((()=>{const{options:n,isDebounced:o}=e,i=(0,l.debounce)((()=>{const o=Promise.resolve("function"==typeof n?n(t):n).then((n=>{if(o.canceled)return;const i=n.map(((t,n)=>({key:`${e.name}-${n}`,value:t,label:e.getOptionLabel(t),keywords:e.getOptionKeywords?e.getOptionKeywords(t):[],isDisabled:!!e.isOptionDisabled&&e.isOptionDisabled(t)}))),s=new RegExp("(?:\\b|\\s|^)"+Iy(t),"i");r(function(e,t=[],n=10){const r=[];for(let o=0;oe.test(Cy()(t))))&&(r.push(i),r.length===n))break}return r}(s,i))}));return o}),o?250:0),s=i();return()=>{i.cancel(),s&&(s.canceled=!0)}}),[t]),[n]}}const My=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(o=n,{}.hasOwnProperty.call(o,"current"))?null!=n.current?Ii({element:n.current,padding:r}).fn(t):{}:n?Ii({element:n,padding:r}).fn(t):{};var o}});var Ay="undefined"!=typeof document?B.useLayoutEffect:B.useEffect;function Dy(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!=r--;)if(!Dy(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!=r--;){const n=o[r];if(("_owner"!==n||!e.$$typeof)&&!Dy(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function zy(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Oy(e,t){const n=zy(e);return Math.round(t*n)/n}function Ly(e){const t=B.useRef(e);return Ay((()=>{t.current=e})),t}const Fy=(0,_t.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_t.jsx)(n.Path,{d:"m13.06 12 6.47-6.47-1.06-1.06L12 10.94 5.53 4.47 4.47 5.53 10.94 12l-6.47 6.47 1.06 1.06L12 13.06l6.47 6.47 1.06-1.06L13.06 12Z"})});let By=0;function Vy(e){const t=document.scrollingElement||document.body;e&&(By=t.scrollTop);const n=e?"add":"remove";t.classList[n]("lockscroll"),document.documentElement.classList[n]("lockscroll"),e||(t.scrollTop=By)}let $y=0;const Hy=function(){return(0,c.useEffect)((()=>(0===$y&&Vy(!0),++$y,()=>{1===$y&&Vy(!1),--$y})),[]),null},Wy={slots:(0,l.observableMap)(),fills:(0,l.observableMap)(),registerSlot:()=>{},updateSlot:()=>{},unregisterSlot:()=>{},registerFill:()=>{},unregisterFill:()=>{},isDefault:!0},Uy=(0,c.createContext)(Wy);function Gy(e){const t=(0,c.useContext)(Uy);return{...(0,l.useObservableValue)(t.slots,e)}}const Ky={slots:(0,l.observableMap)(),fills:(0,l.observableMap)(),registerSlot:()=>{},unregisterSlot:()=>{},registerFill:()=>{},unregisterFill:()=>{},updateFill:()=>{}},qy=(0,c.createContext)(Ky);function Yy({name:e,children:t}){const n=(0,c.useContext)(qy),r=(0,c.useRef)({}),o=(0,c.useRef)(t);return(0,c.useLayoutEffect)((()=>{o.current=t}),[t]),(0,c.useLayoutEffect)((()=>{const t=r.current;return n.registerFill(e,t,o.current),()=>n.unregisterFill(e,t)}),[n,e]),(0,c.useLayoutEffect)((()=>{n.updateFill(e,r.current,o.current)})),null}function Xy(e){return"function"==typeof e}const Zy=function(e){var t;const n=(0,c.useContext)(qy),r=(0,c.useRef)({}),{name:o,children:i,fillProps:s={}}=e;(0,c.useLayoutEffect)((()=>{const e=r.current;return n.registerSlot(o,e),()=>n.unregisterSlot(o,e)}),[n,o]);let a=null!==(t=(0,l.useObservableValue)(n.fills,o))&&void 0!==t?t:[];(0,l.useObservableValue)(n.slots,o)!==r.current&&(a=[]);const u=a.map((e=>function(e){return c.Children.map(e,((e,t)=>{if(!e||"string"==typeof e)return e;let n=t;return"object"==typeof e&&"key"in e&&e?.key&&(n=e.key),(0,c.cloneElement)(e,{key:n})}))}(Xy(e.children)?e.children(s):e.children))).filter((e=>!(0,c.isEmptyElement)(e)));return(0,_t.jsx)(_t.Fragment,{children:Xy(i)?i(u):u})},Qy={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let Jy;const ew=new Uint8Array(16);function tw(){if(!Jy&&(Jy="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Jy))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Jy(ew)}const nw=[];for(let e=0;e<256;++e)nw.push((e+256).toString(16).slice(1));function rw(e,t=0){return nw[e[t+0]]+nw[e[t+1]]+nw[e[t+2]]+nw[e[t+3]]+"-"+nw[e[t+4]]+nw[e[t+5]]+"-"+nw[e[t+6]]+nw[e[t+7]]+"-"+nw[e[t+8]]+nw[e[t+9]]+"-"+nw[e[t+10]]+nw[e[t+11]]+nw[e[t+12]]+nw[e[t+13]]+nw[e[t+14]]+nw[e[t+15]]}const ow=function(e,t,n){if(Qy.randomUUID&&!t&&!e)return Qy.randomUUID();const r=(e=e||{}).random||(e.rng||tw)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=r[e];return t}return rw(r)},iw=new Set,sw=new WeakMap;function aw(e){const{children:t,document:n}=e;if(!n)return null;const r=(e=>{if(sw.has(e))return sw.get(e);let t=ow().replace(/[0-9]/g,"");for(;iw.has(t);)t=ow().replace(/[0-9]/g,"");iw.add(t);const n=Ta({container:e,key:t});return sw.set(e,n),n})(n.head);return(0,_t.jsx)(Ka,{value:r,children:t})}const lw=aw;function cw({name:e,children:t}){var n;const r=(0,c.useContext)(Uy),o=(0,l.useObservableValue)(r.slots,e),i=(0,c.useRef)({});if((0,c.useEffect)((()=>{const t=i.current;return r.registerFill(e,t),()=>r.unregisterFill(e,t)}),[r,e]),!o||!o.ref.current)return null;const s=(0,_t.jsx)(lw,{document:o.ref.current.ownerDocument,children:"function"==typeof t?t(null!==(n=o.fillProps)&&void 0!==n?n:{}):t});return(0,c.createPortal)(s,o.ref.current)}const uw=(0,c.forwardRef)((function(e,t){const{name:n,fillProps:r={},as:o,children:i,...s}=e,a=(0,c.useContext)(Uy),u=(0,c.useRef)(null),d=(0,c.useRef)(r);return(0,c.useLayoutEffect)((()=>{d.current=r}),[r]),(0,c.useLayoutEffect)((()=>(a.registerSlot(n,u,d.current),()=>a.unregisterSlot(n,u))),[a,n]),(0,c.useLayoutEffect)((()=>{a.updateSlot(n,u,d.current)})),(0,_t.jsx)(_l,{as:o,ref:(0,l.useMergeRefs)([t,u]),...s})})),dw=window.wp.isShallowEqual;var pw=o.n(dw);function fw(){const e=(0,l.observableMap)(),t=(0,l.observableMap)();return{slots:e,fills:t,registerSlot:(t,n,r)=>{e.set(t,{ref:n,fillProps:r})},updateSlot:(t,n,r)=>{const o=e.get(t);o&&o.ref===n&&(pw()(o.fillProps,r)||e.set(t,{ref:n,fillProps:r}))},unregisterSlot:(t,n)=>{const r=e.get(t);r&&r.ref===n&&e.delete(t)},registerFill:(e,n)=>{t.set(e,[...t.get(e)||[],n])},unregisterFill:(e,n)=>{const r=t.get(e);r&&t.set(e,r.filter((e=>e!==n)))}}}function hw({children:e}){const[t]=(0,c.useState)(fw);return(0,_t.jsx)(Uy.Provider,{value:t,children:e})}function mw(){const e=(0,l.observableMap)(),t=(0,l.observableMap)();return{slots:e,fills:t,registerSlot:function(t,n){e.set(t,n)},unregisterSlot:function(t,n){e.get(t)===n&&e.delete(t)},registerFill:function(e,n,r){t.set(e,[...t.get(e)||[],{instance:n,children:r}])},unregisterFill:function(e,n){const r=t.get(e);r&&t.set(e,r.filter((e=>e.instance!==n)))},updateFill:function(e,n,r){const o=t.get(e);if(!o)return;const i=o.find((e=>e.instance===n));i&&i.children!==r&&t.set(e,o.map((e=>e.instance===n?{instance:n,children:r}:e)))}}}const gw=function({children:e}){const[t]=(0,c.useState)(mw);return(0,_t.jsx)(qy.Provider,{value:t,children:e})};function vw(e){return(0,_t.jsxs)(_t.Fragment,{children:[(0,_t.jsx)(Yy,{...e}),(0,_t.jsx)(cw,{...e})]})}const bw=(0,c.forwardRef)((function(e,t){const{bubblesVirtually:n,...r}=e;return n?(0,_t.jsx)(uw,{...r,ref:t}):(0,_t.jsx)(Zy,{...r})}));function xw({children:e,passthrough:t=!1}){return!(0,c.useContext)(Uy).isDefault&&t?(0,_t.jsx)(_t.Fragment,{children:e}):(0,_t.jsx)(gw,{children:(0,_t.jsx)(hw,{children:e})})}function yw(e){const t="symbol"==typeof e?e.description:e,n=t=>(0,_t.jsx)(vw,{name:e,...t});n.displayName=`${t}Fill`;const r=t=>(0,_t.jsx)(bw,{name:e,...t});return r.displayName=`${t}Slot`,r.__unstableName=e,{name:e,Fill:n,Slot:r}}xw.displayName="SlotFillProvider";const ww="Popover",_w=()=>(0,_t.jsxs)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 100 100",className:"components-popover__triangle",role:"presentation",children:[(0,_t.jsx)(n.Path,{className:"components-popover__triangle-bg",d:"M 0 0 L 50 50 L 100 0"}),(0,_t.jsx)(n.Path,{className:"components-popover__triangle-border",d:"M 0 0 L 50 50 L 100 0",vectorEffect:"non-scaling-stroke"})]}),Sw=(0,c.createContext)(void 0),Cw="components-popover__fallback-container",kw=al(((e,t)=>{const{animate:n=!0,headerTitle:r,constrainTabbing:o,onClose:i,children:u,className:d,noArrow:p=!0,position:f,placement:h="bottom-start",offset:m=0,focusOnMount:g="firstElement",anchor:v,expandOnMobile:b,onFocusOutside:x,__unstableSlotName:y=ww,flip:w=!0,resize:_=!0,shift:S=!1,inline:C=!1,variant:k,style:j,__unstableForcePosition:E,anchorRef:P,anchorRect:N,getAnchorRect:T,isAlternate:I,...R}=sl(e,"Popover");let M=w,A=_;void 0!==E&&(Xi()("`__unstableForcePosition` prop in wp.components.Popover",{since:"6.1",version:"6.3",alternative:"`flip={ false }` and `resize={ false }`"}),M=!E,A=!E),void 0!==P&&Xi()("`anchorRef` prop in wp.components.Popover",{since:"6.1",alternative:"`anchor` prop"}),void 0!==N&&Xi()("`anchorRect` prop in wp.components.Popover",{since:"6.1",alternative:"`anchor` prop"}),void 0!==T&&Xi()("`getAnchorRect` prop in wp.components.Popover",{since:"6.1",alternative:"`anchor` prop"});const D=I?"toolbar":k;void 0!==I&&Xi()("`isAlternate` prop in wp.components.Popover",{since:"6.2",alternative:"`variant` prop with the `'toolbar'` value"});const z=(0,c.useRef)(null),[O,L]=(0,c.useState)(null),F=(0,c.useCallback)((e=>{L(e)}),[]),V=(0,l.useViewportMatch)("medium","<"),$=b&&V,H=!$&&!p,W=f?Ji(f):h,U=[..."overlay"===h?[{name:"overlay",fn:({rects:e})=>e.reference},Ti({apply({rects:e,elements:t}){var n;const{firstElementChild:r}=null!==(n=t.floating)&&void 0!==n?n:{};r instanceof HTMLElement&&Object.assign(r.style,{width:`${e.reference.width}px`,height:`${e.reference.height}px`})}})]:[],Vo(m),M&&Ni(),A&&Ti({apply(e){var t;const{firstElementChild:n}=null!==(t=J.floating.current)&&void 0!==t?t:{};n instanceof HTMLElement&&Object.assign(n.style,{maxHeight:`${e.availableHeight}px`,overflow:"auto"})}}),S&&Pi({crossAxis:!0,limiter:Ri(),padding:1}),My({element:z})],G=(0,c.useContext)(Sw)||y,K=Gy(G);let q;(i||x)&&(q=(e,t)=>{"focus-outside"===e&&x?x(t):i&&i()});const[Y,X]=(0,l.__experimentalUseDialog)({constrainTabbing:o,focusOnMount:g,__unstableOnClose:q,onClose:q}),{x:Z,y:Q,refs:J,strategy:ee,update:te,placement:ne,middlewareData:{arrow:re}}=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[u,d]=B.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,f]=B.useState(r);Dy(p,r)||f(r);const[h,m]=B.useState(null),[g,v]=B.useState(null),b=B.useCallback((e=>{e!==_.current&&(_.current=e,m(e))}),[]),x=B.useCallback((e=>{e!==S.current&&(S.current=e,v(e))}),[]),y=i||h,w=s||g,_=B.useRef(null),S=B.useRef(null),C=B.useRef(u),k=null!=l,j=Ly(l),E=Ly(o),P=B.useCallback((()=>{if(!_.current||!S.current)return;const e={placement:t,strategy:n,middleware:p};E.current&&(e.platform=E.current),Mi(_.current,S.current,e).then((e=>{const t={...e,isPositioned:!0};N.current&&!Dy(C.current,t)&&(C.current=t,Kr.flushSync((()=>{d(t)})))}))}),[p,t,n,E]);Ay((()=>{!1===c&&C.current.isPositioned&&(C.current.isPositioned=!1,d((e=>({...e,isPositioned:!1}))))}),[c]);const N=B.useRef(!1);Ay((()=>(N.current=!0,()=>{N.current=!1})),[]),Ay((()=>{if(y&&(_.current=y),w&&(S.current=w),y&&w){if(j.current)return j.current(y,w,P);P()}}),[y,w,P,j,k]);const T=B.useMemo((()=>({reference:_,floating:S,setReference:b,setFloating:x})),[b,x]),I=B.useMemo((()=>({reference:y,floating:w})),[y,w]),R=B.useMemo((()=>{const e={position:n,left:0,top:0};if(!I.floating)return e;const t=Oy(I.floating,u.x),r=Oy(I.floating,u.y);return a?{...e,transform:"translate("+t+"px, "+r+"px)",...zy(I.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}}),[n,a,I.floating,u.x,u.y]);return B.useMemo((()=>({...u,update:P,refs:T,elements:I,floatingStyles:R})),[u,P,T,I,R])}({placement:"overlay"===W?void 0:W,middleware:U,whileElementsMounted:(e,t,n)=>Ei(e,t,n,{layoutShift:!1,animationFrame:!0})}),oe=(0,c.useCallback)((e=>{z.current=e,te()}),[te]),ie=P?.top,se=P?.bottom,ae=P?.startContainer,le=P?.current;(0,c.useLayoutEffect)((()=>{const e=(({anchor:e,anchorRef:t,anchorRect:n,getAnchorRect:r,fallbackReferenceElement:o})=>{var i;let s=null;return e?s=e:function(e){return!!e?.top}(t)?s={getBoundingClientRect(){const e=t.top.getBoundingClientRect(),n=t.bottom.getBoundingClientRect();return new window.DOMRect(e.x,e.y,e.width,n.bottom-e.top)}}:function(e){return!!e?.current}(t)?s=t.current:t?s=t:n?s={getBoundingClientRect:()=>n}:r?s={getBoundingClientRect(){var e,t,n,i;const s=r(o);return new window.DOMRect(null!==(e=s.x)&&void 0!==e?e:s.left,null!==(t=s.y)&&void 0!==t?t:s.top,null!==(n=s.width)&&void 0!==n?n:s.right-s.left,null!==(i=s.height)&&void 0!==i?i:s.bottom-s.top)}}:o&&(s=o.parentElement),null!==(i=s)&&void 0!==i?i:null})({anchor:v,anchorRef:P,anchorRect:N,getAnchorRect:T,fallbackReferenceElement:O});J.setReference(e)}),[v,P,ie,se,ae,le,N,T,O,J]);const ce=(0,l.useMergeRefs)([J.setFloating,Y,t]),ue=$?void 0:{position:ee,top:0,left:0,x:ts(Z),y:ts(Q)},de=(0,l.useReducedMotion)(),pe=n&&!$&&!de,[fe,he]=(0,c.useState)(!1),{style:me,...ge}=(0,c.useMemo)((()=>(e=>{const t=e.startsWith("top")||e.startsWith("bottom")?"translateY":"translateX",n=e.startsWith("top")||e.startsWith("left")?1:-1;return{style:es[e],initial:{opacity:0,scale:0,[t]:2*n+"em"},animate:{opacity:1,scale:1,[t]:0},transition:{duration:.1,ease:[0,0,.2,1]}}})(ne)),[ne]),ve=pe?{style:{...j,...me,...ue},onAnimationComplete:()=>he(!0),...ge}:{animate:!1,style:{...j,...ue}},be=(!pe||fe)&&null!==Z&&null!==Q;let xe=(0,_t.jsxs)(ag.div,{className:s(d,{"is-expanded":$,"is-positioned":be,[`is-${"toolbar"===D?"alternate":D}`]:D}),...ve,...R,ref:ce,...X,tabIndex:-1,children:[$&&(0,_t.jsx)(Hy,{}),$&&(0,_t.jsxs)("div",{className:"components-popover__header",children:[(0,_t.jsx)("span",{className:"components-popover__header-title",children:r}),(0,_t.jsx)(Jx,{className:"components-popover__close",size:"small",icon:Fy,onClick:i,label:(0,a.__)("Close")})]}),(0,_t.jsx)("div",{className:"components-popover__content",children:u}),H&&(0,_t.jsx)("div",{ref:oe,className:["components-popover__arrow",`is-${ne.split("-")[0]}`].join(" "),style:{left:void 0!==re?.x&&Number.isFinite(re.x)?`${re.x}px`:"",top:void 0!==re?.y&&Number.isFinite(re.y)?`${re.y}px`:""},children:(0,_t.jsx)(_w,{})})]});const ye=K.ref&&!C,we=P||N||v;return ye?xe=(0,_t.jsx)(vw,{name:G,children:xe}):C||(xe=(0,c.createPortal)((0,_t.jsx)(aw,{document,children:xe}),(()=>{let e=document.body.querySelector("."+Cw);return e||(e=document.createElement("div"),e.className=Cw,document.body.append(e)),e})())),we?xe:(0,_t.jsxs)(_t.Fragment,{children:[(0,_t.jsx)("span",{ref:F}),xe]})}),"Popover");kw.Slot=(0,c.forwardRef)((function({name:e=ww},t){return(0,_t.jsx)(bw,{bubblesVirtually:!0,name:e,className:"popover-slot",ref:t})})),kw.__unstableSlotNameProvider=Sw.Provider;const jw=kw;function Ew({items:e,onSelect:t,selectedIndex:n,instanceId:r,listBoxId:o,className:i,Component:a="div"}){return(0,_t.jsx)(a,{id:o,role:"listbox",className:"components-autocomplete__results",children:e.map(((e,o)=>(0,_t.jsx)(Jx,{id:`components-autocomplete-item-${r}-${e.key}`,role:"option",__next40pxDefaultSize:!0,"aria-selected":o===n,accessibleWhenDisabled:!0,disabled:e.isDisabled,className:s("components-autocomplete__result",i,{"is-selected":o===n}),variant:o===n?"primary":void 0,onClick:()=>t(e),children:e.label},e.key)))})}function Pw(e){var t;const n=null!==(t=e.useItems)&&void 0!==t?t:Ry(e);return function({filterValue:e,instanceId:t,listBoxId:r,className:o,selectedIndex:i,onChangeOptions:s,onSelect:u,onReset:d,reset:p,contentRef:f}){const[h]=n(e),m=(0,ky.useAnchor)({editableContentElement:f.current}),[g,v]=(0,c.useState)(!1),b=(0,c.useRef)(null),x=(0,l.useMergeRefs)([b,(0,l.useRefEffect)((e=>{f.current&&v(e.ownerDocument!==f.current.ownerDocument)}),[f])]);var y,w;y=b,w=p,(0,c.useEffect)((()=>{const e=e=>{y.current&&!y.current.contains(e.target)&&w(e)};return document.addEventListener("mousedown",e),document.addEventListener("touchstart",e),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("touchstart",e)}}),[w,y]);const _=(0,l.useDebounce)(jy.speak,500);return(0,c.useLayoutEffect)((()=>{s(h),function(t){_&&(t.length?_(e?(0,a.sprintf)((0,a._n)("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",t.length),t.length):(0,a.sprintf)((0,a._n)("Initial %d result loaded. Type to filter all available results. Use up and down arrow keys to navigate.","Initial %d results loaded. Type to filter all available results. Use up and down arrow keys to navigate.",t.length),t.length),"assertive"):_((0,a.__)("No results."),"assertive"))}(h)}),[h]),0===h.length?null:(0,_t.jsxs)(_t.Fragment,{children:[(0,_t.jsx)(jw,{focusOnMount:!1,onClose:d,placement:"top-start",className:"components-autocomplete__popover",anchor:m,ref:x,children:(0,_t.jsx)(Ew,{items:h,onSelect:u,selectedIndex:i,instanceId:t,listBoxId:r,className:o})}),f.current&&g&&(0,Kr.createPortal)((0,_t.jsx)(Ew,{items:h,onSelect:u,selectedIndex:i,instanceId:t,listBoxId:r,className:o,Component:Sl}),f.current.ownerDocument.body)]})}}const Nw=e=>{if(null===e)return"";switch(typeof e){case"string":case"number":return e.toString();case"boolean":default:return"";case"object":if(e instanceof Array)return e.map(Nw).join("");if("props"in e)return Nw(e.props.children)}return""},Tw=[],Iw={};function Rw({record:e,onChange:t,onReplace:n,completers:r,contentRef:o}){const i=(0,l.useInstanceId)(Iw),[s,a]=(0,c.useState)(0),[u,d]=(0,c.useState)(Tw),[p,f]=(0,c.useState)(""),[h,m]=(0,c.useState)(null),[g,v]=(0,c.useState)(null),b=(0,c.useRef)(!1);function x(r){const{getOptionCompletion:o}=h||{};if(!r.isDisabled){if(o){const i=o(r.value,p),s=(e=>null!==e&&"object"==typeof e&&"action"in e&&void 0!==e.action&&"value"in e&&void 0!==e.value)(i)?i:{action:"insert-at-caret",value:i};if("replace"===s.action)return void n([s.value]);"insert-at-caret"===s.action&&function(n){if(null===h)return;const r=e.start,o=r-h.triggerPrefix.length-p.length,i=(0,ky.create)({html:(0,c.renderToString)(n)});t((0,ky.insert)(e,i,o,r))}(s.value)}y()}}function y(){a(0),d(Tw),f(""),m(null),v(null)}const w=(0,c.useMemo)((()=>(0,ky.isCollapsed)(e)?(0,ky.getTextContent)((0,ky.slice)(e,0)):""),[e]);(0,c.useEffect)((()=>{if(!w)return void(h&&y());const t=r.reduce(((e,t)=>w.lastIndexOf(t.triggerPrefix)>(null!==e?w.lastIndexOf(e.triggerPrefix):-1)?t:e),null);if(!t)return void(h&&y());const{allowContext:n,triggerPrefix:o}=t,i=w.lastIndexOf(o),s=w.slice(i+o.length);if(s.length>50)return;const a=0===u.length,l=s.split(/\s/),c=1===l.length,d=b.current&&l.length<=3;if(a&&!d&&!c)return void(h&&y());const p=(0,ky.getTextContent)((0,ky.slice)(e,void 0,(0,ky.getTextContent)(e).length));if(n&&!n(w.slice(0,i),p))return void(h&&y());if(/^\s/.test(s)||/\s\s+$/.test(s))return void(h&&y());if(!/[\u0000-\uFFFF]*$/.test(s))return void(h&&y());const x=Iy(t.triggerPrefix),_=Cy()(w),S=_.slice(_.lastIndexOf(t.triggerPrefix)).match(new RegExp(`${x}([\0-￿]*)$`)),C=S&&S[1];m(t),v((()=>t!==h?Pw(t):g)),f(null===C?"":C)}),[w]);const{key:_=""}=u[s]||{},{className:S}=h||{},C=!!h&&u.length>0,k=C?`components-autocomplete-listbox-${i}`:void 0,j=C?`components-autocomplete-item-${i}-${_}`:null,E=void 0!==e.start;return{listBoxId:k,activeId:j,onKeyDown:jx((function(e){if(b.current="Backspace"===e.key,h&&0!==u.length&&!e.defaultPrevented){switch(e.key){case"ArrowUp":{const e=(0===s?u.length:s)-1;a(e),(0,Ey.isAppleOS)()&&(0,jy.speak)(Nw(u[e].label),"assertive");break}case"ArrowDown":{const e=(s+1)%u.length;a(e),(0,Ey.isAppleOS)()&&(0,jy.speak)(Nw(u[e].label),"assertive");break}case"Escape":m(null),v(null),e.preventDefault();break;case"Enter":x(u[s]);break;case"ArrowLeft":case"ArrowRight":return void y();default:return}e.preventDefault()}})),popover:E&&g&&(0,_t.jsx)(g,{className:S,filterValue:p,instanceId:i,listBoxId:k,selectedIndex:s,onChangeOptions:function(e){a(e.length===u.length?s:0),d(e)},onSelect:x,value:e,contentRef:o,reset:y})}}function Mw(e){const t=(0,c.useRef)(null),n=(0,c.useRef)(),{record:r}=e,o=function(e){const t=(0,c.useRef)(new Set);return t.current.add(e),t.current.size>2&&t.current.delete(Array.from(t.current)[0]),Array.from(t.current)[0]}(r),{popover:i,listBoxId:s,activeId:a,onKeyDown:u}=Rw({...e,contentRef:t});n.current=u;const d=(0,l.useMergeRefs)([t,(0,l.useRefEffect)((e=>{function t(e){n.current?.(e)}return e.addEventListener("keydown",t),()=>{e.removeEventListener("keydown",t)}}),[])]);return r.text!==o?.text?{ref:d,children:i,"aria-autocomplete":s?"list":void 0,"aria-owns":s,"aria-activedescendant":a}:{ref:d}}function Aw({children:e,isSelected:t,...n}){const{popover:r,...o}=Rw(n);return(0,_t.jsxs)(_t.Fragment,{children:[e(o),t&&r]})}function Dw(e){const{help:t,id:n,...r}=e,o=(0,l.useInstanceId)(Wx,"wp-components-base-control",n);return{baseControlProps:{id:o,help:t,...r},controlProps:{id:o,...t?{"aria-describedby":`${o}__help`}:{}}}}const zw=(0,_t.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_t.jsx)(n.Path,{d:"M10 17.389H8.444A5.194 5.194 0 1 1 8.444 7H10v1.5H8.444a3.694 3.694 0 0 0 0 7.389H10v1.5ZM14 7h1.556a5.194 5.194 0 0 1 0 10.39H14v-1.5h1.556a3.694 3.694 0 0 0 0-7.39H14V7Zm-4.5 6h5v-1.5h-5V13Z"})}),Ow=(0,_t.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_t.jsx)(n.Path,{d:"M17.031 4.703 15.576 4l-1.56 3H14v.03l-2.324 4.47H9.5V13h1.396l-1.502 2.889h-.95a3.694 3.694 0 0 1 0-7.389H10V7H8.444a5.194 5.194 0 1 0 0 10.389h.17L7.5 19.53l1.416.719L15.049 8.5h.507a3.694 3.694 0 0 1 0 7.39H14v1.5h1.556a5.194 5.194 0 0 0 .273-10.383l1.202-2.304Z"})});const Lw=Nl("",""),Fw={name:"bjn8wh",styles:"position:relative"},Bw=e=>{const{color:t=zl.gray[200],style:n="solid",width:r=Fl.borderWidth}=e||{};return`${t} ${!!r&&"0"!==r||!!t?n||"solid":n} ${r!==Fl.borderWidth?`clamp(1px, ${r}, 10px)`:r}`},Vw={name:"1nwbfnf",styles:"grid-column:span 2;margin:0 auto"};function $w(e){const{className:t,size:n="default",...r}=sl(e,"BorderBoxControlLinkedButton"),o=il();return{...r,className:(0,c.useMemo)((()=>o((e=>Nl("position:absolute;top:","__unstable-large"===e?"8px":"3px",";",Mg({right:0})()," line-height:0;",""))(n),t)),[t,o,n])}}const Hw=al(((e,t)=>{const{className:n,isLinked:r,...o}=$w(e),i=r?(0,a.__)("Unlink sides"):(0,a.__)("Link sides");return(0,_t.jsx)(Jx,{...o,size:"small",icon:r?zw:Ow,iconSize:24,label:i,ref:t,className:n})}),"BorderBoxControlLinkedButton");function Ww(e){const{className:t,value:n,size:r="default",...o}=sl(e,"BorderBoxControlVisualizer"),i=il(),s=(0,c.useMemo)((()=>i(((e,t)=>Nl("position:absolute;top:","__unstable-large"===t?"20px":"15px",";right:","__unstable-large"===t?"39px":"29px",";bottom:","__unstable-large"===t?"20px":"15px",";left:","__unstable-large"===t?"39px":"29px",";border-top:",Bw(e?.top),";border-bottom:",Bw(e?.bottom),";",Mg({borderLeft:Bw(e?.left)})()," ",Mg({borderRight:Bw(e?.right)})(),";",""))(n,r),t)),[i,t,n,r]);return{...o,className:s,value:n}}const Uw=al(((e,t)=>{const{value:n,...r}=Ww(e);return(0,_t.jsx)(_l,{...r,ref:t})}),"BorderBoxControlVisualizer"),Gw=(0,_t.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_t.jsx)(n.Path,{d:"M5 11.25h14v1.5H5z"})}),Kw=(0,_t.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_t.jsx)(n.Path,{fillRule:"evenodd",d:"M5 11.25h3v1.5H5v-1.5zm5.5 0h3v1.5h-3v-1.5zm8.5 0h-3v1.5h3v-1.5z",clipRule:"evenodd"})}),qw=(0,_t.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_t.jsx)(n.Path,{fillRule:"evenodd",d:"M5.25 11.25h1.5v1.5h-1.5v-1.5zm3 0h1.5v1.5h-1.5v-1.5zm4.5 0h-1.5v1.5h1.5v-1.5zm1.5 0h1.5v1.5h-1.5v-1.5zm4.5 0h-1.5v1.5h1.5v-1.5z",clipRule:"evenodd"})});const Yw=e=>{const t=Nl("border-color:",zl.ui.border,";","");return Nl(e&&t," &:hover{border-color:",zl.ui.borderHover,";}&:focus-within{border-color:",zl.ui.borderFocus,";box-shadow:",Fl.controlBoxShadowFocus,";z-index:1;outline:2px solid transparent;outline-offset:-2px;}","")};var Xw={name:"1aqh2c7",styles:"min-height:40px;padding:3px"},Zw={name:"1ndywgm",styles:"min-height:36px;padding:2px"};const Qw=e=>({default:Zw,"__unstable-large":Xw}[e]),Jw={name:"7whenc",styles:"display:flex;width:100%"},e_=yl("div",{target:"eakva830"})({name:"zjik7",styles:"display:flex"});function t_(e={}){var t,n=N(e,[]);const r=null==(t=n.store)?void 0:t.getState(),o=ht(P(E({},n),{focusLoop:F(n.focusLoop,null==r?void 0:r.focusLoop,!0)})),i=He(P(E({},o.getState()),{value:F(n.value,null==r?void 0:r.value,n.defaultValue,null)}),o,n.store);return P(E(E({},o),i),{setValue:e=>i.setState("value",e)})}function n_(e={}){const[t,n]=rt(t_,e);return function(e,t,n){return nt(e=gt(e,t,n),n,"value","setValue"),e}(t,n,e)}var r_=Et([Mt],[At]),o_=r_.useContext,i_=(r_.useScopedContext,r_.useProviderContext),s_=(r_.ContextProvider,r_.ScopedContextProvider),a_=jt((function(e){var t=e,{store:n}=t,r=x(t,["store"]);const o=i_();return D(n=n||o,!1),r=Me(r,(e=>(0,_t.jsx)(s_,{value:n,children:e})),[n]),r=v({role:"radiogroup"},r),r=cn(v({store:n},r))})),l_=St((function(e){return kt("div",a_(e))}));const c_=(0,c.createContext)({}),u_=c_;function d_(e){const t=(0,c.useRef)(!0),n=(0,l.usePrevious)(e),r=(0,c.useRef)(!1);(0,c.useEffect)((()=>{t.current&&(t.current=!1)}),[]);const o=r.current||!t.current&&n!==e;return(0,c.useEffect)((()=>{r.current=o}),[o]),o?{value:null!=e?e:"",defaultValue:void 0}:{value:void 0,defaultValue:e}}const p_=(0,c.forwardRef)((function({children:e,isAdaptiveWidth:t,label:n,onChange:r,size:o,value:i,id:s,setSelectedElement:u,...d},p){const f=(0,l.useInstanceId)(p_,"toggle-group-control-as-radio-group"),h=s||f,{value:m,defaultValue:g}=d_(i),v=r?e=>{r(null!=e?e:void 0)}:void 0,b=n_({defaultValue:g,value:m,setValue:v,rtl:(0,a.isRTL)()}),x=et(b,"value"),y=b.setValue;(0,c.useEffect)((()=>{""===x&&b.setActiveId(void 0)}),[b,x]);const w=(0,c.useMemo)((()=>({activeItemIsNotFirstItem:()=>b.getState().activeId!==b.first(),baseId:h,isBlock:!t,size:o,value:x,setValue:y,setSelectedElement:u})),[h,t,b,x,u,y,o]);return(0,_t.jsx)(u_.Provider,{value:w,children:(0,_t.jsx)(l_,{store:b,"aria-label":n,render:(0,_t.jsx)(_l,{}),...d,id:h,ref:p,children:e})})}));function f_({defaultValue:e,onChange:t,value:n}){const r=void 0!==n,o=r?n:e,[i,s]=(0,c.useState)(o);let a;return a=r&&"function"==typeof t?t:r||"function"!=typeof t?s:e=>{t(e),s(e)},[r?n:i,a]}const h_=(0,c.forwardRef)((function({children:e,isAdaptiveWidth:t,label:n,onChange:r,size:o,value:i,id:s,setSelectedElement:a,...u},d){const p=(0,l.useInstanceId)(h_,"toggle-group-control-as-button-group"),f=s||p,{value:h,defaultValue:m}=d_(i),[g,v]=f_({defaultValue:m,value:h,onChange:r}),b=(0,c.useMemo)((()=>({baseId:f,value:g,setValue:v,isBlock:!t,isDeselectable:!0,size:o,setSelectedElement:a})),[f,g,v,t,o,a]);return(0,_t.jsx)(u_.Provider,{value:b,children:(0,_t.jsx)(_l,{"aria-label":n,...u,ref:d,role:"group",children:e})})})),m_={element:void 0,top:0,right:0,bottom:0,left:0,width:0,height:0};function g_(e,t=[]){const[n,r]=(0,c.useState)(m_),o=(0,c.useRef)(),i=(0,l.useEvent)((()=>{if(e&&e.isConnected){const t=function(e){var t,n,r;const o=e.getBoundingClientRect();if(0===o.width||0===o.height)return;const i=e.offsetParent,s=null!==(t=i?.getBoundingClientRect())&&void 0!==t?t:m_,a=null!==(n=i?.scrollLeft)&&void 0!==n?n:0,l=null!==(r=i?.scrollTop)&&void 0!==r?r:0,c=parseFloat(getComputedStyle(e).width),u=parseFloat(getComputedStyle(e).height),d=c/o.width,p=u/o.height;return{element:e,top:(o.top-s?.top)*p+l,right:(s?.right-o.right)*d-a,bottom:(s?.bottom-o.bottom)*p-l,left:(o.left-s?.left)*d+a,width:c,height:u}}(e);if(t)return r(t),clearInterval(o.current),!0}else clearInterval(o.current);return!1})),s=(0,l.useResizeObserver)((()=>{i()||requestAnimationFrame((()=>{i()||(o.current=setInterval(i,100))}))}));return(0,c.useLayoutEffect)((()=>{s(e),e||r(m_)}),[s,e]),(0,c.useLayoutEffect)((()=>{i()}),t),n}function v_(e,t,{prefix:n="subelement",dataAttribute:r=`${n}-animated`,transitionEndFilter:o=()=>!0,roundRect:i=!1}={}){const s=(0,l.useEvent)((()=>{Object.keys(t).forEach((r=>"element"!==r&&e?.style.setProperty(`--${n}-${r}`,String(i?Math.floor(t[r]):t[r]))))}));(0,c.useLayoutEffect)((()=>{s()}),[t,s]),function(e,t){const n=(0,c.useRef)(e),r=(0,l.useEvent)(t);(0,c.useLayoutEffect)((()=>{n.current!==e&&(r({previousValue:n.current}),n.current=e)}),[r,e])}(t.element,(({previousValue:n})=>{t.element&&n&&e?.setAttribute(`data-${r}`,"")})),(0,c.useLayoutEffect)((()=>{function t(t){o(t)&&e?.removeAttribute(`data-${r}`)}return e?.addEventListener("transitionend",t),()=>e?.removeEventListener("transitionend",t)}),[r,e,o])}const b_=al((function(e,t){const{__nextHasNoMarginBottom:n=!1,__next40pxDefaultSize:r=!1,__shouldNotWarnDeprecated36pxSize:o,className:i,isAdaptiveWidth:s=!1,isBlock:a=!1,isDeselectable:u=!1,label:d,hideLabelFromVision:p=!1,help:f,onChange:h,size:m="default",value:g,children:v,...b}=sl(e,"ToggleGroupControl"),x=r&&"default"===m?"__unstable-large":m,[y,w]=(0,c.useState)(),[_,S]=(0,c.useState)(),C=(0,l.useMergeRefs)([S,t]);v_(_,g_(g||0===g?y:void 0),{prefix:"selected",dataAttribute:"indicator-animated",transitionEndFilter:e=>"::before"===e.pseudoElement,roundRect:!0});const k=il(),j=(0,c.useMemo)((()=>k((({isBlock:e,isDeselectable:t,size:n})=>Nl("background:",zl.ui.background,";border:1px solid transparent;border-radius:",Fl.radiusSmall,";display:inline-flex;min-width:0;position:relative;",Qw(n)," ",!t&&Yw(e),"@media not ( prefers-reduced-motion ){&[data-indicator-animated]::before{transition-property:transform,border-radius;transition-duration:0.2s;transition-timing-function:ease-out;}}&::before{content:'';position:absolute;pointer-events:none;background:",zl.theme.foreground,";outline:2px solid transparent;outline-offset:-3px;--antialiasing-factor:100;border-radius:calc(\n\t\t\t\t",Fl.radiusXSmall," /\n\t\t\t\t\t(\n\t\t\t\t\t\tvar( --selected-width, 0 ) /\n\t\t\t\t\t\t\tvar( --antialiasing-factor )\n\t\t\t\t\t)\n\t\t\t)/",Fl.radiusXSmall,";left:-1px;width:calc( var( --antialiasing-factor ) * 1px );height:calc( var( --selected-height, 0 ) * 1px );transform-origin:left top;transform:translateX( calc( var( --selected-left, 0 ) * 1px ) ) scaleX(\n\t\t\t\tcalc(\n\t\t\t\t\tvar( --selected-width, 0 ) / var( --antialiasing-factor )\n\t\t\t\t)\n\t\t\t);}",""))({isBlock:a,isDeselectable:u,size:x}),a&&Jw,i)),[i,k,a,u,x]),E=u?h_:p_;return Ux({componentName:"ToggleGroupControl",size:m,__next40pxDefaultSize:r,__shouldNotWarnDeprecated36pxSize:o}),(0,_t.jsxs)(Wx,{help:f,__nextHasNoMarginBottom:n,__associatedWPComponentName:"ToggleGroupControl",children:[!p&&(0,_t.jsx)(e_,{children:(0,_t.jsx)(Wx.VisualLabel,{children:d})}),(0,_t.jsx)(E,{...b,setSelectedElement:w,className:j,isAdaptiveWidth:s,label:d,onChange:h,ref:C,size:x,value:g,children:v})]})}),"ToggleGroupControl"),x_=b_;var y_="input";var w_=jt((function(e){var t=e,{store:n,name:r,value:o,checked:i}=t,s=x(t,["store","name","value","checked"]);const a=o_();n=n||a;const l=Pe(s.id),c=(0,B.useRef)(null),u=et(n,(e=>null!=i?i:function(e,t){if(void 0!==t)return null!=e&&null!=t?t===e:!!t}(o,null==e?void 0:e.value)));(0,B.useEffect)((()=>{if(!l)return;if(!u)return;(null==n?void 0:n.getState().activeId)===l||null==n||n.setActiveId(l)}),[n,u,l]);const d=s.onChange,p=function(e,t){return"input"===e&&(!t||"radio"===t)}(Ne(c,y_),s.type),f=O(s),[h,m]=Ie();(0,B.useEffect)((()=>{const e=c.current;e&&(p||(void 0!==u&&(e.checked=u),void 0!==r&&(e.name=r),void 0!==o&&(e.value=`${o}`)))}),[h,p,u,r,o]);const g=ke((e=>{if(f)return e.preventDefault(),void e.stopPropagation();(null==n?void 0:n.getState().value)!==o&&(p||(e.currentTarget.checked=!0,m()),null==d||d(e),e.defaultPrevented||null==n||n.setValue(o))})),y=s.onClick,w=ke((e=>{null==y||y(e),e.defaultPrevented||p||g(e)})),_=s.onFocus,S=ke((e=>{if(null==_||_(e),e.defaultPrevented)return;if(!p)return;if(!n)return;const{moves:t,activeId:r}=n.getState();t&&(l&&r!==l||g(e))}));return s=b(v({id:l,role:p?void 0:"radio",type:p?"radio":void 0,"aria-checked":u},s),{ref:Ee(c,s.ref),onChange:g,onClick:w,onFocus:S}),s=Mn(v({store:n,clickOnEnter:!p},s)),L(v({name:p?r:void 0,value:p?o:void 0,checked:u},s))})),__=Ct(St((function(e){const t=w_(e);return kt(y_,t)})));const S_=yl("div",{target:"et6ln9s1"})({name:"sln1fl",styles:"display:inline-flex;max-width:100%;min-width:0;position:relative"}),C_={name:"82a6rk",styles:"flex:1"},k_=({isDeselectable:e,isIcon:t,isPressed:n,size:r})=>Nl("align-items:center;appearance:none;background:transparent;border:none;border-radius:",Fl.radiusXSmall,";color:",zl.theme.gray[700],";fill:currentColor;cursor:pointer;display:flex;font-family:inherit;height:100%;justify-content:center;line-height:100%;outline:none;padding:0 12px;position:relative;text-align:center;@media not ( prefers-reduced-motion ){transition:background ",Fl.transitionDurationFast," linear,color ",Fl.transitionDurationFast," linear,font-weight 60ms linear;}user-select:none;width:100%;z-index:2;&::-moz-focus-inner{border:0;}&[disabled]{opacity:0.4;cursor:default;}&:active{background:",zl.ui.background,";}",e&&E_," ",t&&N_({size:r})," ",n&&j_,";",""),j_=Nl("color:",zl.theme.foregroundInverted,";&:active{background:transparent;}",""),E_=Nl("color:",zl.theme.foreground,";&:focus{box-shadow:inset 0 0 0 1px ",zl.ui.background,",0 0 0 ",Fl.borderWidthFocus," ",zl.theme.accent,";outline:2px solid transparent;}",""),P_=yl("div",{target:"et6ln9s0"})("display:flex;font-size:",Fl.fontSize,";line-height:1;"),N_=({size:e="default"})=>Nl("color:",zl.theme.foreground,";height:",{default:"30px","__unstable-large":"32px"}[e],";aspect-ratio:1;padding-left:0;padding-right:0;",""),{Rp:T_,y0:I_}=t,R_=({showTooltip:e,text:t,children:n})=>e&&t?(0,_t.jsx)(ss,{text:t,placement:"top",children:n}):(0,_t.jsx)(_t.Fragment,{children:n});const M_=al((function e(t,n){const r=(0,c.useContext)(c_),o=sl({...t,id:(0,l.useInstanceId)(e,r.baseId||"toggle-group-control-option-base")},"ToggleGroupControlOptionBase"),{isBlock:i=!1,isDeselectable:s=!1,size:a="default"}=r,{className:u,isIcon:d=!1,value:p,children:f,showTooltip:h=!1,disabled:m,...g}=o,v=r.value===p,b=il(),x=(0,c.useMemo)((()=>b(i&&C_)),[b,i]),y=(0,c.useMemo)((()=>b(k_({isDeselectable:s,isIcon:d,isPressed:v,size:a}),u)),[b,s,d,v,a,u]),w={...g,className:y,"data-value":p,ref:n},_=(0,c.useRef)(null);return(0,c.useLayoutEffect)((()=>{v&&_.current&&r.setSelectedElement(_.current)}),[v,r]),(0,_t.jsx)(I_,{ref:_,className:x,children:(0,_t.jsx)(R_,{showTooltip:h,text:g["aria-label"],children:s?(0,_t.jsx)("button",{...w,disabled:m,"aria-pressed":v,type:"button",onClick:()=>{s&&v?r.setValue(void 0):r.setValue(p)},children:(0,_t.jsx)(T_,{children:f})}):(0,_t.jsx)(__,{disabled:m,onFocusVisible:()=>{(null===r.value||""===r.value)&&!r.activeItemIsNotFirstItem?.()||r.setValue(p)},render:(0,_t.jsx)("button",{type:"button",...w}),value:p,children:(0,_t.jsx)(T_,{children:f})})})})}),"ToggleGroupControlOptionBase"),A_=M_;const D_=(0,c.forwardRef)((function(e,t){const{icon:n,label:r,...o}=e;return(0,_t.jsx)(A_,{...o,isIcon:!0,"aria-label":r,showTooltip:!0,ref:t,children:(0,_t.jsx)(Xx,{icon:n})})})),z_=D_,O_=[{label:(0,a.__)("Solid"),icon:Gw,value:"solid"},{label:(0,a.__)("Dashed"),icon:Kw,value:"dashed"},{label:(0,a.__)("Dotted"),icon:qw,value:"dotted"}];const L_=al((function({onChange:e,...t},n){return(0,_t.jsx)(x_,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,ref:n,isDeselectable:!0,onChange:t=>{e?.(t)},...t,children:O_.map((e=>(0,_t.jsx)(z_,{value:e.value,icon:e.icon,label:e.label},e.value)))})}),"BorderControlStylePicker");const F_=(0,c.forwardRef)((function(e,t){const{className:n,colorValue:r,...o}=e;return(0,_t.jsx)("span",{className:s("component-color-indicator",n),style:{background:r},ref:t,...o})}));var B_=function(e){var t=e/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},V_=function(e){return.2126*B_(e.r)+.7152*B_(e.g)+.0722*B_(e.b)};function $_(e){e.prototype.luminance=function(){return e=V_(this.rgba),void 0===(t=2)&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0;var e,t,n},e.prototype.contrast=function(t){void 0===t&&(t="#FFF");var n,r,o,i,s,a,l,c=t instanceof e?t:new e(t);return i=this.rgba,s=c.toRgb(),n=(a=V_(i))>(l=V_(s))?(a+.05)/(l+.05):(l+.05)/(a+.05),void 0===(r=2)&&(r=0),void 0===o&&(o=Math.pow(10,r)),Math.floor(o*n)/o+0},e.prototype.isReadable=function(e,t){return void 0===e&&(e="#FFF"),void 0===t&&(t={}),this.contrast(e)>=(s=void 0===(i=(n=t).size)?"normal":i,"AAA"===(o=void 0===(r=n.level)?"AA":r)&&"normal"===s?7:"AA"===o&&"large"===s?3:4.5);var n,r,o,i,s}}const H_=al(((e,t)=>{const{renderContent:n,renderToggle:r,className:o,contentClassName:i,expandOnMobile:a,headerTitle:u,focusOnMount:d,popoverProps:p,onClose:f,onToggle:h,style:m,open:g,defaultOpen:v,position:b,variant:x}=sl(e,"Dropdown");void 0!==b&&Xi()("`position` prop in wp.components.Dropdown",{since:"6.2",alternative:"`popoverProps.placement` prop",hint:"Note that the `position` prop will override any values passed through the `popoverProps.placement` prop."});const[y,w]=(0,c.useState)(null),_=(0,c.useRef)(),[S,C]=f_({defaultValue:v,value:g,onChange:h});function k(){f?.(),C(!1)}const j={isOpen:!!S,onToggle:()=>C(!S),onClose:k},E=!!(p?.anchor||p?.anchorRef||p?.getAnchorRect||p?.anchorRect);return(0,_t.jsxs)("div",{className:o,ref:(0,l.useMergeRefs)([_,t,w]),tabIndex:-1,style:m,children:[r(j),S&&(0,_t.jsx)(jw,{position:b,onClose:k,onFocusOutside:function(){if(!_.current)return;const{ownerDocument:e}=_.current,t=e?.activeElement?.closest('[role="dialog"]');_.current.contains(e.activeElement)||t&&!t.contains(_.current)||k()},expandOnMobile:a,headerTitle:u,focusOnMount:d,offset:13,anchor:E?void 0:y,variant:x,...p,className:s("components-dropdown__content",p?.className,i),children:n(j)})]})}),"Dropdown"),W_=H_;const U_=al((function(e,t){const n=sl(e,"InputControlSuffixWrapper");return(0,_t.jsx)(ub,{...n,ref:t})}),"InputControlSuffixWrapper");const G_=({disabled:e})=>e?Nl("color:",zl.ui.textDisabled,";cursor:default;",""):"";var K_={name:"1lv1yo7",styles:"display:inline-flex"};const q_=({variant:e})=>"minimal"===e?K_:"",Y_=yl(vb,{target:"e1mv6sxx3"})("color:",zl.theme.foreground,";cursor:pointer;",G_," ",q_,";"),X_=({__next40pxDefaultSize:e,multiple:t,selectSize:n="default"})=>{if(t)return;const r={default:{height:40,minHeight:40,paddingTop:0,paddingBottom:0},small:{height:24,minHeight:24,paddingTop:0,paddingBottom:0},compact:{height:32,minHeight:32,paddingTop:0,paddingBottom:0},"__unstable-large":{height:40,minHeight:40,paddingTop:0,paddingBottom:0}};e||(r.default=r.compact);return Nl(r[n]||r.default,"","")},Z_=({__next40pxDefaultSize:e,multiple:t,selectSize:n="default"})=>{const r={default:Fl.controlPaddingX,small:Fl.controlPaddingXSmall,compact:Fl.controlPaddingXSmall,"__unstable-large":Fl.controlPaddingX};e||(r.default=r.compact);const o=r[n]||r.default;return Mg({paddingLeft:o,paddingRight:o+18,...t?{paddingTop:o,paddingBottom:o}:{}})},Q_=({multiple:e})=>({overflow:e?"auto":"hidden"});var J_={name:"n1jncc",styles:"field-sizing:content"};const eS=({variant:e})=>"minimal"===e?J_:"",tS=yl("select",{target:"e1mv6sxx2"})("&&&{appearance:none;background:transparent;box-sizing:border-box;border:none;box-shadow:none!important;color:currentColor;cursor:inherit;display:block;font-family:inherit;margin:0;width:100%;max-width:none;white-space:nowrap;text-overflow:ellipsis;",eb,";",X_,";",Z_,";",Q_," ",eS,";}"),nS=yl("div",{target:"e1mv6sxx1"})("margin-inline-end:",Il(-1),";line-height:0;path{fill:currentColor;}"),rS=yl(U_,{target:"e1mv6sxx0"})("position:absolute;pointer-events:none;",Mg({right:0}),";");const oS=(0,c.forwardRef)((function({icon:e,size:t=24,...n},r){return(0,c.cloneElement)(e,{width:t,height:t,...n,ref:r})})),iS=(0,_t.jsx)(n.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,_t.jsx)(n.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"})}),sS=()=>(0,_t.jsx)(rS,{children:(0,_t.jsx)(nS,{children:(0,_t.jsx)(oS,{icon:iS,size:18})})});function aS({options:e}){return e.map((({id:e,label:t,value:n,...r},o)=>{const i=e||`${t}-${n}-${o}`;return(0,_t.jsx)("option",{value:n,...r,children:t},i)}))}const lS=(0,c.forwardRef)((function(e,t){const{className:n,disabled:r=!1,help:o,hideLabelFromVision:i,id:a,label:c,multiple:u=!1,onChange:d,options:p=[],size:f="default",value:h,labelPosition:m="top",children:g,prefix:v,suffix:b,variant:x="default",__next40pxDefaultSize:y=!1,__nextHasNoMarginBottom:w=!1,__shouldNotWarnDeprecated36pxSize:_,...S}=hb(e),C=function(e){const t=(0,l.useInstanceId)(lS);return e||`inspector-select-control-${t}`}(a),k=o?`${C}__help`:void 0;if(!p?.length&&!g)return null;const j=s("components-select-control",n);return Ux({componentName:"SelectControl",__next40pxDefaultSize:y,size:f,__shouldNotWarnDeprecated36pxSize:_}),(0,_t.jsx)(Wx,{help:o,id:C,__nextHasNoMarginBottom:w,__associatedWPComponentName:"SelectControl",children:(0,_t.jsx)(Y_,{className:j,disabled:r,hideLabelFromVision:i,id:C,isBorderless:"minimal"===x,label:c,size:f,suffix:b||!u&&(0,_t.jsx)(sS,{}),prefix:v,labelPosition:m,__unstableInputWidth:"minimal"===x?"auto":void 0,variant:x,__next40pxDefaultSize:y,children:(0,_t.jsx)(tS,{...S,__next40pxDefaultSize:y,"aria-describedby":k,className:"components-select-control__input",disabled:r,id:C,multiple:u,onChange:t=>{if(e.multiple){const n=Array.from(t.target.options).filter((({selected:e})=>e)).map((({value:e})=>e));e.onChange?.(n,{event:t})}else e.onChange?.(t.target.value,{event:t})},ref:t,selectSize:f,value:h,variant:x,children:g||(0,_t.jsx)(aS,{options:p})})})})})),cS=lS,uS={initial:void 0,fallback:""};const dS=function(e,t=uS){const{initial:n,fallback:r}={...uS,...t},[o,i]=(0,c.useState)(e),s=Vg(e);return(0,c.useEffect)((()=>{s&&o&&i(void 0)}),[s,o]),[function(e=[],t){var n;return null!==(n=e.find(Vg))&&void 0!==n?n:t}([e,o,n],r),(0,c.useCallback)((e=>{s||i(e)}),[s])]};function pS(e,t,n){return"number"!=typeof e?null:parseFloat(`${ay(e,t,n)}`)}const fS=30,hS=()=>Nl({height:fS,minHeight:fS},"",""),mS=12,gS=({__next40pxDefaultSize:e})=>!e&&Nl({minHeight:fS},"",""),vS=yl("div",{target:"e1epgpqk14"})("-webkit-tap-highlight-color:transparent;align-items:center;display:flex;justify-content:flex-start;padding:0;position:relative;touch-action:none;width:100%;min-height:40px;",gS,";"),bS=({color:e=zl.ui.borderFocus})=>Nl({color:e},"",""),xS=({marks:e,__nextHasNoMarginBottom:t})=>t?"":Nl({marginBottom:e?16:void 0},"",""),yS=yl("div",{shouldForwardProp:e=>!["color","__nextHasNoMarginBottom","marks"].includes(e),target:"e1epgpqk13"})("display:block;flex:1;position:relative;width:100%;",bS,";",hS,";",xS,";"),wS=yl("span",{target:"e1epgpqk12"})("display:flex;margin-top:",4,"px;",Mg({marginRight:6}),";"),_S=yl("span",{target:"e1epgpqk11"})("display:flex;margin-top:",4,"px;",Mg({marginLeft:6}),";"),SS=({disabled:e,railColor:t})=>{let n=t||"";return e&&(n=zl.ui.backgroundDisabled),Nl({background:n},"","")},CS=yl("span",{target:"e1epgpqk10"})("background-color:",zl.gray[300],";left:0;pointer-events:none;right:0;display:block;height:",4,"px;position:absolute;margin-top:",13,"px;top:0;border-radius:",Fl.radiusFull,";",SS,";"),kS=({disabled:e,trackColor:t})=>{let n=t||"currentColor";return e&&(n=zl.gray[400]),Nl({background:n},"","")},jS=yl("span",{target:"e1epgpqk9"})("background-color:currentColor;border-radius:",Fl.radiusFull,";height:",4,"px;pointer-events:none;display:block;position:absolute;margin-top:",13,"px;top:0;.is-marked &{@media not ( prefers-reduced-motion ){transition:width ease 0.1s;}}",kS,";"),ES=yl("span",{target:"e1epgpqk8"})({name:"g5kg28",styles:"display:block;pointer-events:none;position:relative;width:100%;user-select:none;margin-top:17px"}),PS=yl("span",{target:"e1epgpqk7"})("position:absolute;left:0;top:-4px;height:4px;width:2px;transform:translateX( -50% );background-color:",zl.ui.background,";z-index:1;"),NS=({isFilled:e})=>Nl({color:e?zl.gray[700]:zl.gray[300]},"",""),TS=yl("span",{target:"e1epgpqk6"})("color:",zl.gray[300],";font-size:11px;position:absolute;top:8px;white-space:nowrap;",Mg({left:0}),";",Mg({transform:"translateX( -50% )"},{transform:"translateX( 50% )"}),";",NS,";"),IS=({disabled:e})=>Nl("background-color:",e?zl.gray[400]:zl.theme.accent,";",""),RS=yl("span",{target:"e1epgpqk5"})("align-items:center;display:flex;height:",mS,"px;justify-content:center;margin-top:",9,"px;outline:0;pointer-events:none;position:absolute;top:0;user-select:none;width:",mS,"px;border-radius:",Fl.radiusRound,";z-index:3;.is-marked &{@media not ( prefers-reduced-motion ){transition:left ease 0.1s;}}",IS,";",Mg({marginLeft:-10}),";",Mg({transform:"translateX( 4.5px )"},{transform:"translateX( -4.5px )"}),";"),MS=({isFocused:e})=>e?Nl("&::before{content:' ';position:absolute;background-color:",zl.theme.accent,";opacity:0.4;border-radius:",Fl.radiusRound,";height:",20,"px;width:",20,"px;top:-4px;left:-4px;}",""):"",AS=yl("span",{target:"e1epgpqk4"})("align-items:center;border-radius:",Fl.radiusRound,";height:100%;outline:0;position:absolute;user-select:none;width:100%;box-shadow:",Fl.elevationXSmall,";",IS,";",MS,";"),DS=yl("input",{target:"e1epgpqk3"})("box-sizing:border-box;cursor:pointer;display:block;height:100%;left:0;margin:0 -",6,"px;opacity:0;outline:none;position:absolute;right:0;top:0;width:calc( 100% + ",mS,"px );"),zS=({show:e})=>Nl("display:",e?"inline-block":"none",";opacity:",e?1:0,";@media not ( prefers-reduced-motion ){transition:opacity 120ms ease,display 120ms ease allow-discrete;}@starting-style{opacity:0;}","");var OS={name:"1cypxip",styles:"top:-80%"},LS={name:"1lr98c4",styles:"bottom:-80%"};const FS=({position:e})=>"bottom"===e?LS:OS,BS=yl("span",{target:"e1epgpqk2"})("background:rgba( 0, 0, 0, 0.8 );border-radius:",Fl.radiusSmall,";color:white;font-size:12px;min-width:32px;padding:4px 8px;pointer-events:none;position:absolute;text-align:center;user-select:none;line-height:1.4;",zS,";",FS,";",Mg({transform:"translateX(-50%)"},{transform:"translateX(50%)"}),";"),VS=yl(gy,{target:"e1epgpqk1"})("display:inline-block;font-size:13px;margin-top:0;input[type='number']&{",hS,";}",Mg({marginLeft:`${Il(4)} !important`}),";"),$S=yl("span",{target:"e1epgpqk0"})("display:block;margin-top:0;button,button.is-small{margin-left:0;",hS,";}",Mg({marginLeft:8}),";");const HS=(0,c.forwardRef)((function(e,t){const{describedBy:n,label:r,value:o,...i}=e;return(0,_t.jsx)(DS,{...i,"aria-describedby":n,"aria-label":r,"aria-hidden":!1,ref:t,tabIndex:0,type:"range",value:o})}));function WS(e){const{className:t,isFilled:n=!1,label:r,style:o={},...i}=e,a=s("components-range-control__mark",n&&"is-filled",t),l=s("components-range-control__mark-label",n&&"is-filled");return(0,_t.jsxs)(_t.Fragment,{children:[(0,_t.jsx)(PS,{...i,"aria-hidden":"true",className:a,style:o}),r&&(0,_t.jsx)(TS,{"aria-hidden":"true",className:l,isFilled:n,style:o,children:r})]})}function US(e){const{disabled:t=!1,marks:n=!1,min:r=0,max:o=100,step:i=1,value:s=0,...a}=e;return(0,_t.jsxs)(_t.Fragment,{children:[(0,_t.jsx)(CS,{disabled:t,...a}),n&&(0,_t.jsx)(GS,{disabled:t,marks:n,min:r,max:o,step:i,value:s})]})}function GS(e){const{disabled:t=!1,marks:n=!1,min:r=0,max:o=100,step:i=1,value:s=0}=e,l=function({marks:e,min:t=0,max:n=100,step:r=1,value:o=0}){if(!e)return[];const i=n-t;if(!Array.isArray(e)){e=[];const n=1+Math.round(i/r);for(;n>e.push({value:r*e.length+t}););}const s=[];return e.forEach(((e,r)=>{if(e.valuen)return;const l=`mark-${r}`,c=e.value<=o,u=(e.value-t)/i*100+"%",d={[(0,a.isRTL)()?"right":"left"]:u};s.push({...e,isFilled:c,key:l,style:d})})),s}({marks:n,min:r,max:o,step:"any"===i?1:i,value:s});return(0,_t.jsx)(ES,{"aria-hidden":"true",className:"components-range-control__marks",children:l.map((e=>(0,B.createElement)(WS,{...e,key:e.key,"aria-hidden":"true",disabled:t})))})}function KS(e){const{className:t,inputRef:n,tooltipPosition:r,show:o=!1,style:i={},value:a=0,renderTooltipContent:l=e=>e,zIndex:u=100,...d}=e,p=function({inputRef:e,tooltipPosition:t}){const[n,r]=(0,c.useState)(),o=(0,c.useCallback)((()=>{e&&e.current&&r(t)}),[t,e]);return(0,c.useEffect)((()=>{o()}),[o]),(0,c.useEffect)((()=>(window.addEventListener("resize",o),()=>{window.removeEventListener("resize",o)}))),n}({inputRef:n,tooltipPosition:r}),f=s("components-simple-tooltip",t),h={...i,zIndex:u};return(0,_t.jsx)(BS,{...d,"aria-hidden":"false",className:f,position:p,show:o,role:"tooltip",style:h,children:l(a)})}const qS=()=>{};function YS({resetFallbackValue:e,initialPosition:t}){return void 0!==e?Number.isNaN(e)?null:e:void 0!==t?Number.isNaN(t)?null:t:null}const XS=(0,c.forwardRef)((function e(t,n){const{__nextHasNoMarginBottom:r=!1,afterIcon:o,allowReset:i=!1,beforeIcon:u,className:d,color:p=zl.theme.accent,currentInput:f,disabled:h=!1,help:m,hideLabelFromVision:g=!1,initialPosition:v,isShiftStepEnabled:b=!0,label:x,marks:y=!1,max:w=100,min:_=0,onBlur:S=qS,onChange:C=qS,onFocus:k=qS,onMouseLeave:j=qS,onMouseMove:E=qS,railColor:P,renderTooltipContent:N=e=>e,resetFallbackValue:T,__next40pxDefaultSize:I=!1,shiftStep:R=10,showTooltip:M,step:A=1,trackColor:D,value:z,withInputField:O=!0,__shouldNotWarnDeprecated36pxSize:L,...F}=t,[B,V]=function(e){const{min:t,max:n,value:r,initial:o}=e,[i,s]=dS(pS(r,t,n),{initial:pS(null!=o?o:null,t,n),fallback:null});return[i,(0,c.useCallback)((e=>{s(null===e?null:pS(e,t,n))}),[t,n,s])]}({min:_,max:w,value:null!=z?z:null,initial:v}),$=(0,c.useRef)(!1);let H=M,W=O;"any"===A&&(H=!1,W=!1);const[U,G]=(0,c.useState)(H),[K,q]=(0,c.useState)(!1),Y=(0,c.useRef)(),X=Y.current?.matches(":focus"),Z=!h&&K,Q=null===B,J=Q?"":void 0!==B?B:f,ee=Q?(w-_)/2+_:B,te=`${ay(Q?50:(B-_)/(w-_)*100,0,100)}%`,ne=s("components-range-control",d),re=s("components-range-control__wrapper",!!y&&"is-marked"),oe=(0,l.useInstanceId)(e,"inspector-range-control"),ie=m?`${oe}__help`:void 0,se=!1!==H&&Number.isFinite(B),ae=()=>{const e=Number.isNaN(T)?null:null!=T?T:null;V(e),C(null!=e?e:void 0)},le={[(0,a.isRTL)()?"right":"left"]:te};return Ux({componentName:"RangeControl",__next40pxDefaultSize:I,size:void 0,__shouldNotWarnDeprecated36pxSize:L}),(0,_t.jsx)(Wx,{__nextHasNoMarginBottom:r,__associatedWPComponentName:"RangeControl",className:ne,label:x,hideLabelFromVision:g,id:`${oe}`,help:m,children:(0,_t.jsxs)(vS,{className:"components-range-control__root",__next40pxDefaultSize:I,children:[u&&(0,_t.jsx)(wS,{children:(0,_t.jsx)(Xx,{icon:u})}),(0,_t.jsxs)(yS,{__nextHasNoMarginBottom:r,className:re,color:p,marks:!!y,children:[(0,_t.jsx)(HS,{...F,className:"components-range-control__slider",describedBy:ie,disabled:h,id:`${oe}`,label:x,max:w,min:_,onBlur:e=>{S(e),q(!1),G(!1)},onChange:e=>{const t=parseFloat(e.target.value);V(t),C(t)},onFocus:e=>{k(e),q(!0),G(!0)},onMouseMove:E,onMouseLeave:j,ref:(0,l.useMergeRefs)([Y,n]),step:A,value:null!=J?J:void 0}),(0,_t.jsx)(US,{"aria-hidden":!0,disabled:h,marks:y,max:w,min:_,railColor:P,step:A,value:ee}),(0,_t.jsx)(jS,{"aria-hidden":!0,className:"components-range-control__track",disabled:h,style:{width:te},trackColor:D}),(0,_t.jsx)(RS,{className:"components-range-control__thumb-wrapper",style:le,disabled:h,children:(0,_t.jsx)(AS,{"aria-hidden":!0,isFocused:Z,disabled:h})}),se&&(0,_t.jsx)(KS,{className:"components-range-control__tooltip",inputRef:Y,tooltipPosition:"bottom",renderTooltipContent:N,show:X||U,style:le,value:B})]}),o&&(0,_t.jsx)(_S,{children:(0,_t.jsx)(Xx,{icon:o})}),W&&(0,_t.jsx)(VS,{"aria-label":x,className:"components-range-control__number",disabled:h,inputMode:"decimal",isShiftStepEnabled:b,max:w,min:_,onBlur:()=>{$.current&&(ae(),$.current=!1)},onChange:e=>{let t=parseFloat(e);V(t),isNaN(t)?i&&($.current=!0):((t<_||t>w)&&(t=pS(t,_,w)),C(t),$.current=!1)},shiftStep:R,size:I?"__unstable-large":"default",__unstableInputWidth:Il(I?20:16),step:A,value:J,__shouldNotWarnDeprecated36pxSize:!0}),i&&(0,_t.jsx)($S,{children:(0,_t.jsx)(Jx,{className:"components-range-control__reset",accessibleWhenDisabled:!h,disabled:h||B===YS({resetFallbackValue:T,initialPosition:v}),variant:"secondary",size:"small",onClick:ae,children:(0,a.__)("Reset")})})]})})})),ZS=XS,QS=yl(gy,{target:"ez9hsf46"})("width:",Il(24),";"),JS=yl(cS,{target:"ez9hsf45"})("margin-left:",Il(-2),";"),eC=yl(ZS,{target:"ez9hsf44"})("flex:1;margin-right:",Il(2),";"),tC=`\n.react-colorful__interactive {\n\twidth: calc( 100% - ${Il(2)} );\n\tmargin-left: ${Il(1)};\n}`,nC=yl("div",{target:"ez9hsf43"})("padding-top:",Il(2),";padding-right:0;padding-left:0;padding-bottom:0;"),rC=yl(fy,{target:"ez9hsf42"})("padding-left:",Il(4),";padding-right:",Il(4),";"),oC=yl(kg,{target:"ez9hsf41"})("padding-top:",Il(4),";padding-left:",Il(4),";padding-right:",Il(3),";padding-bottom:",Il(5),";"),iC=yl("div",{target:"ez9hsf40"})(Rx,";width:216px;.react-colorful{display:flex;flex-direction:column;align-items:center;width:216px;height:auto;}.react-colorful__saturation{width:100%;border-radius:0;height:216px;margin-bottom:",Il(4),";border-bottom:none;}.react-colorful__hue,.react-colorful__alpha{width:184px;height:16px;border-radius:",Fl.radiusFull,";margin-bottom:",Il(2),";}.react-colorful__pointer{height:16px;width:16px;border:none;box-shadow:0 0 2px 0 rgba( 0, 0, 0, 0.25 );outline:2px solid transparent;}.react-colorful__pointer-fill{box-shadow:inset 0 0 0 ",Fl.borderWidthFocus," #fff;}",tC,";"),sC=(0,_t.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_t.jsx)(n.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M5 4.5h11a.5.5 0 0 1 .5.5v11a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V5a.5.5 0 0 1 .5-.5ZM3 5a2 2 0 0 1 2-2h11a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5Zm17 3v10.75c0 .69-.56 1.25-1.25 1.25H6v1.5h12.75a2.75 2.75 0 0 0 2.75-2.75V8H20Z"})}),aC=e=>{const{color:t,colorType:n}=e,[r,o]=(0,c.useState)(null),i=(0,c.useRef)(),s=(0,l.useCopyToClipboard)((()=>{switch(n){case"hsl":return t.toHslString();case"rgb":return t.toRgbString();default:return t.toHex()}}),(()=>{i.current&&clearTimeout(i.current),o(t.toHex()),i.current=setTimeout((()=>{o(null),i.current=void 0}),3e3)}));(0,c.useEffect)((()=>()=>{i.current&&clearTimeout(i.current)}),[]);const u=r===t.toHex()?(0,a.__)("Copied!"):(0,a.__)("Copy");return(0,_t.jsx)(ss,{delay:0,hideOnClick:!1,text:u,children:(0,_t.jsx)(Qx,{size:"compact","aria-label":u,ref:s,icon:sC,showTooltip:!1})})};const lC=al((function(e,t){const n=sl(e,"InputControlPrefixWrapper");return(0,_t.jsx)(ub,{...n,isPrefix:!0,ref:t})}),"InputControlPrefixWrapper"),cC=({min:e,max:t,label:n,abbreviation:r,onChange:o,value:i})=>(0,_t.jsxs)(fy,{spacing:4,children:[(0,_t.jsx)(QS,{__next40pxDefaultSize:!0,min:e,max:t,label:n,hideLabelFromVision:!0,value:i,onChange:e=>{o(e?"string"!=typeof e?e:parseInt(e,10):0)},prefix:(0,_t.jsx)(lC,{children:(0,_t.jsx)($v,{color:zl.theme.accent,lineHeight:1,children:r})}),spinControls:"none"}),(0,_t.jsx)(eC,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:n,hideLabelFromVision:!0,min:e,max:t,value:i,onChange:o,withInputField:!1})]}),uC=({color:e,onChange:t,enableAlpha:n})=>{const{r,g:o,b:i,a:s}=e.toRgb();return(0,_t.jsxs)(_t.Fragment,{children:[(0,_t.jsx)(cC,{min:0,max:255,label:"Red",abbreviation:"R",value:r,onChange:e=>t(yv({r:e,g:o,b:i,a:s}))}),(0,_t.jsx)(cC,{min:0,max:255,label:"Green",abbreviation:"G",value:o,onChange:e=>t(yv({r,g:e,b:i,a:s}))}),(0,_t.jsx)(cC,{min:0,max:255,label:"Blue",abbreviation:"B",value:i,onChange:e=>t(yv({r,g:o,b:e,a:s}))}),n&&(0,_t.jsx)(cC,{min:0,max:100,label:"Alpha",abbreviation:"A",value:Math.trunc(100*s),onChange:e=>t(yv({r,g:o,b:i,a:e/100}))})]})},dC=({color:e,onChange:t,enableAlpha:n})=>{const r=(0,c.useMemo)((()=>e.toHsl()),[e]),[o,i]=(0,c.useState)({...r}),s=e.isEqual(yv(o));(0,c.useEffect)((()=>{s||i(r)}),[r,s]);const a=s?o:r,l=n=>{const r=yv({...a,...n});e.isEqual(r)?i((e=>({...e,...n}))):t(r)};return(0,_t.jsxs)(_t.Fragment,{children:[(0,_t.jsx)(cC,{min:0,max:359,label:"Hue",abbreviation:"H",value:a.h,onChange:e=>{l({h:e})}}),(0,_t.jsx)(cC,{min:0,max:100,label:"Saturation",abbreviation:"S",value:a.s,onChange:e=>{l({s:e})}}),(0,_t.jsx)(cC,{min:0,max:100,label:"Lightness",abbreviation:"L",value:a.l,onChange:e=>{l({l:e})}}),n&&(0,_t.jsx)(cC,{min:0,max:100,label:"Alpha",abbreviation:"A",value:Math.trunc(100*a.a),onChange:e=>{l({a:e/100})}})]})},pC=({color:e,onChange:t,enableAlpha:n})=>(0,_t.jsx)(Kx,{prefix:(0,_t.jsx)(lC,{children:(0,_t.jsx)($v,{color:zl.theme.accent,lineHeight:1,children:"#"})}),value:e.toHex().slice(1).toUpperCase(),onChange:e=>{if(!e)return;const n=e.startsWith("#")?e:"#"+e;t(yv(n))},maxLength:n?9:7,label:(0,a.__)("Hex color"),hideLabelFromVision:!0,size:"__unstable-large",__unstableStateReducer:(e,t)=>{const n=t.payload?.event?.nativeEvent;if("insertFromPaste"!==n?.inputType)return{...e};const r=e.value?.startsWith("#")?e.value.slice(1).toUpperCase():e.value?.toUpperCase();return{...e,value:r}},__unstableInputWidth:"9em"}),fC=({colorType:e,color:t,onChange:n,enableAlpha:r})=>{const o={color:t,onChange:n,enableAlpha:r};switch(e){case"hsl":return(0,_t.jsx)(dC,{...o});case"rgb":return(0,_t.jsx)(uC,{...o});default:return(0,_t.jsx)(pC,{...o})}};function hC(){return(hC=Object.assign||function(e){for(var t=1;t=0||(o[n]=e[n]);return o}function gC(e){var t=(0,B.useRef)(e),n=(0,B.useRef)((function(e){t.current&&t.current(e)}));return t.current=e,n.current}var vC=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e0:e.buttons>0)&&o.current?i(yC(o.current,e,a.current)):n(!1)},t=function(){return n(!1)};function n(n){var r=l.current,i=xC(o.current),s=n?i.addEventListener:i.removeEventListener;s(r?"touchmove":"mousemove",e),s(r?"touchend":"mouseup",t)}return[function(e){var t=e.nativeEvent,r=o.current;if(r&&(wC(t),!function(e,t){return t&&!bC(e)}(t,l.current)&&r)){if(bC(t)){l.current=!0;var s=t.changedTouches||[];s.length&&(a.current=s[0].identifier)}r.focus(),i(yC(r,t,a.current)),n(!0)}},function(e){var t=e.which||e.keyCode;t<37||t>40||(e.preventDefault(),s({left:39===t?.05:37===t?-.05:0,top:40===t?.05:38===t?-.05:0}))},n]}),[s,i]),u=c[0],d=c[1],p=c[2];return(0,B.useEffect)((function(){return p}),[p]),B.createElement("div",hC({},r,{onTouchStart:u,onMouseDown:u,className:"react-colorful__interactive",ref:o,onKeyDown:d,tabIndex:0,role:"slider"}))})),SC=function(e){return e.filter(Boolean).join(" ")},CC=function(e){var t=e.color,n=e.left,r=e.top,o=void 0===r?.5:r,i=SC(["react-colorful__pointer",e.className]);return B.createElement("div",{className:i,style:{top:100*o+"%",left:100*n+"%"}},B.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},kC=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n},jC=(Math.PI,function(e){var t=e.s,n=e.v,r=e.a,o=(200-t)*n/100;return{h:kC(e.h),s:kC(o>0&&o<200?t*n/100/(o<=100?o:200-o)*100:0),l:kC(o/2),a:kC(r,2)}}),EC=function(e){var t=jC(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},PC=function(e){var t=jC(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},NC=function(e){var t=e.h,n=e.s,r=e.v,o=e.a;t=t/360*6,n/=100,r/=100;var i=Math.floor(t),s=r*(1-n),a=r*(1-(t-i)*n),l=r*(1-(1-t+i)*n),c=i%6;return{r:kC(255*[r,a,s,s,l,r][c]),g:kC(255*[l,r,r,a,s,s][c]),b:kC(255*[s,s,l,r,r,a][c]),a:kC(o,2)}},TC=function(e){var t=/rgba?\(?\s*(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return t?RC({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):{h:0,s:0,v:0,a:1}},IC=TC,RC=function(e){var t=e.r,n=e.g,r=e.b,o=e.a,i=Math.max(t,n,r),s=i-Math.min(t,n,r),a=s?i===t?(n-r)/s:i===n?2+(r-t)/s:4+(t-n)/s:0;return{h:kC(60*(a<0?a+6:a)),s:kC(i?s/i*100:0),v:kC(i/255*100),a:o}},MC=B.memo((function(e){var t=e.hue,n=e.onChange,r=SC(["react-colorful__hue",e.className]);return B.createElement("div",{className:r},B.createElement(_C,{onMove:function(e){n({h:360*e.left})},onKey:function(e){n({h:vC(t+360*e.left,0,360)})},"aria-label":"Hue","aria-valuenow":kC(t),"aria-valuemax":"360","aria-valuemin":"0"},B.createElement(CC,{className:"react-colorful__hue-pointer",left:t/360,color:EC({h:t,s:100,v:100,a:1})})))})),AC=B.memo((function(e){var t=e.hsva,n=e.onChange,r={backgroundColor:EC({h:t.h,s:100,v:100,a:1})};return B.createElement("div",{className:"react-colorful__saturation",style:r},B.createElement(_C,{onMove:function(e){n({s:100*e.left,v:100-100*e.top})},onKey:function(e){n({s:vC(t.s+100*e.left,0,100),v:vC(t.v-100*e.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+kC(t.s)+"%, Brightness "+kC(t.v)+"%"},B.createElement(CC,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:EC(t)})))})),DC=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0},zC=function(e,t){return e.replace(/\s/g,"")===t.replace(/\s/g,"")};function OC(e,t,n){var r=gC(n),o=(0,B.useState)((function(){return e.toHsva(t)})),i=o[0],s=o[1],a=(0,B.useRef)({color:t,hsva:i});(0,B.useEffect)((function(){if(!e.equal(t,a.current.color)){var n=e.toHsva(t);a.current={hsva:n,color:t},s(n)}}),[t,e]),(0,B.useEffect)((function(){var t;DC(i,a.current.hsva)||e.equal(t=e.fromHsva(i),a.current.color)||(a.current={hsva:i,color:t},r(t))}),[i,e,r]);var l=(0,B.useCallback)((function(e){s((function(t){return Object.assign({},t,e)}))}),[]);return[i,l]}var LC,FC="undefined"!=typeof window?B.useLayoutEffect:B.useEffect,BC=new Map,VC=function(e){FC((function(){var t=e.current?e.current.ownerDocument:document;if(void 0!==t&&!BC.has(t)){var n=t.createElement("style");n.innerHTML='.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url(\'data:image/svg+xml;charset=utf-8,\')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}',BC.set(t,n);var r=LC||o.nc;r&&n.setAttribute("nonce",r),t.head.appendChild(n)}}),[])},$C=function(e){var t=e.className,n=e.colorModel,r=e.color,o=void 0===r?n.defaultColor:r,i=e.onChange,s=mC(e,["className","colorModel","color","onChange"]),a=(0,B.useRef)(null);VC(a);var l=OC(n,o,i),c=l[0],u=l[1],d=SC(["react-colorful",t]);return B.createElement("div",hC({},s,{ref:a,className:d}),B.createElement(AC,{hsva:c,onChange:u}),B.createElement(MC,{hue:c.h,onChange:u,className:"react-colorful__last-control"}))},HC=function(e){var t=e.className,n=e.hsva,r=e.onChange,o={backgroundImage:"linear-gradient(90deg, "+PC(Object.assign({},n,{a:0}))+", "+PC(Object.assign({},n,{a:1}))+")"},i=SC(["react-colorful__alpha",t]),s=kC(100*n.a);return B.createElement("div",{className:i},B.createElement("div",{className:"react-colorful__alpha-gradient",style:o}),B.createElement(_C,{onMove:function(e){r({a:e.left})},onKey:function(e){r({a:vC(n.a+e.left)})},"aria-label":"Alpha","aria-valuetext":s+"%","aria-valuenow":s,"aria-valuemin":"0","aria-valuemax":"100"},B.createElement(CC,{className:"react-colorful__alpha-pointer",left:n.a,color:PC(n)})))},WC=function(e){var t=e.className,n=e.colorModel,r=e.color,o=void 0===r?n.defaultColor:r,i=e.onChange,s=mC(e,["className","colorModel","color","onChange"]),a=(0,B.useRef)(null);VC(a);var l=OC(n,o,i),c=l[0],u=l[1],d=SC(["react-colorful",t]);return B.createElement("div",hC({},s,{ref:a,className:d}),B.createElement(AC,{hsva:c,onChange:u}),B.createElement(MC,{hue:c.h,onChange:u}),B.createElement(HC,{hsva:c,onChange:u,className:"react-colorful__last-control"}))},UC={defaultColor:"rgba(0, 0, 0, 1)",toHsva:TC,fromHsva:function(e){var t=NC(e);return"rgba("+t.r+", "+t.g+", "+t.b+", "+t.a+")"},equal:zC},GC=function(e){return B.createElement(WC,hC({},e,{colorModel:UC}))},KC={defaultColor:"rgb(0, 0, 0)",toHsva:IC,fromHsva:function(e){var t=NC(e);return"rgb("+t.r+", "+t.g+", "+t.b+")"},equal:zC},qC=function(e){return B.createElement($C,hC({},e,{colorModel:KC}))};const YC=({color:e,enableAlpha:t,onChange:n})=>{const r=t?GC:qC,o=(0,c.useMemo)((()=>e.toRgbString()),[e]);return(0,_t.jsx)(r,{color:o,onChange:e=>{n(yv(e))},onPointerDown:({currentTarget:e,pointerId:t})=>{e.setPointerCapture(t)},onPointerUp:({currentTarget:e,pointerId:t})=>{e.releasePointerCapture(t)}})};_v([Sv]);const XC=[{label:"RGB",value:"rgb"},{label:"HSL",value:"hsl"},{label:"Hex",value:"hex"}],ZC=al(((e,t)=>{const{enableAlpha:n=!1,color:r,onChange:o,defaultValue:i="#fff",copyFormat:s,...u}=sl(e,"ColorPicker"),[d,p]=f_({onChange:o,value:r,defaultValue:i}),f=(0,c.useMemo)((()=>yv(d||"")),[d]),h=(0,l.useDebounce)(p),m=(0,c.useCallback)((e=>{h(e.toHex())}),[h]),[g,v]=(0,c.useState)(s||"hex");return(0,_t.jsxs)(iC,{ref:t,...u,children:[(0,_t.jsx)(YC,{onChange:m,color:f,enableAlpha:n}),(0,_t.jsxs)(nC,{children:[(0,_t.jsxs)(rC,{justify:"space-between",children:[(0,_t.jsx)(JS,{__nextHasNoMarginBottom:!0,size:"compact",options:XC,value:g,onChange:e=>v(e),label:(0,a.__)("Color format"),hideLabelFromVision:!0,variant:"minimal"}),(0,_t.jsx)(aC,{color:f,colorType:s||g})]}),(0,_t.jsx)(oC,{direction:"column",gap:2,children:(0,_t.jsx)(fC,{colorType:g,color:f,onChange:m,enableAlpha:n})})]})]})}),"ColorPicker"),QC=ZC;function JC(e){if(void 0!==e)return"string"==typeof e?e:e.hex?e.hex:void 0}const ek=Es((e=>{const t=yv(e),n=t.toHex(),r=t.toRgb(),o=t.toHsv(),i=t.toHsl();return{hex:n,rgb:r,hsv:o,hsl:i,source:"hex",oldHue:i.h}}));function tk(e){const{onChangeComplete:t}=e,n=(0,c.useCallback)((e=>{t(ek(e))}),[t]);return function(e){return void 0!==e.onChangeComplete||void 0!==e.disableAlpha||"string"==typeof e.color?.hex}(e)?{color:JC(e.color),enableAlpha:!e.disableAlpha,onChange:n}:{...e,color:e.color,enableAlpha:e.enableAlpha,onChange:e.onChange}}const nk=e=>(0,_t.jsx)(QC,{...tk(e)}),rk=(0,c.createContext)({}),ok=(0,_t.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_t.jsx)(n.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})});const ik=(0,c.forwardRef)((function(e,t){const{isPressed:n,label:r,...o}=e;return(0,_t.jsx)(Jx,{...o,"aria-pressed":n,ref:t,label:r})}));const sk=(0,c.forwardRef)((function(e,t){const{id:n,isSelected:r,label:o,...i}=e,{setActiveId:s,activeId:a}=(0,c.useContext)(rk);return(0,c.useEffect)((()=>{r&&!a&&window.setTimeout((()=>s?.(n)),0)}),[r,s,a,n]),(0,_t.jsx)(Gn.Item,{render:(0,_t.jsx)(Jx,{...i,role:"option","aria-selected":!!r,ref:t,label:o}),id:n})}));function ak(e){const{actions:t,options:n,baseId:r,className:o,loop:i=!0,children:s,...l}=e,[u,d]=(0,c.useState)(void 0),p=(0,c.useMemo)((()=>({baseId:r,activeId:u,setActiveId:d})),[r,u,d]);return(0,_t.jsx)("div",{className:o,children:(0,_t.jsxs)(rk.Provider,{value:p,children:[(0,_t.jsx)(Gn,{...l,id:r,focusLoop:i,rtl:(0,a.isRTL)(),role:"listbox",activeId:u,setActiveId:d,children:n}),s,t]})})}function lk(e){const{actions:t,options:n,children:r,baseId:o,...i}=e,s=(0,c.useMemo)((()=>({baseId:o})),[o]);return(0,_t.jsx)("div",{...i,id:o,children:(0,_t.jsxs)(rk.Provider,{value:s,children:[n,r,t]})})}function ck(e){const{asButtons:t,actions:n,options:r,children:o,className:i,...a}=e,c=(0,l.useInstanceId)(ck,"components-circular-option-picker",a.id),u=t?lk:ak,d=n?(0,_t.jsx)("div",{className:"components-circular-option-picker__custom-clear-wrapper",children:n}):void 0,p=(0,_t.jsx)("div",{className:"components-circular-option-picker__swatches",children:r});return(0,_t.jsx)(u,{...a,baseId:c,className:s("components-circular-option-picker",i),actions:d,options:p,children:o})}ck.Option=function e({className:t,isSelected:n,selectedIconProps:r={},tooltipText:o,...i}){const{baseId:a,setActiveId:u}=(0,c.useContext)(rk),d={id:(0,l.useInstanceId)(e,a||"components-circular-option-picker__option"),className:"components-circular-option-picker__option",__next40pxDefaultSize:!0,...i},p=void 0!==u?(0,_t.jsx)(sk,{...d,label:o,isSelected:n}):(0,_t.jsx)(ik,{...d,label:o,isPressed:n});return(0,_t.jsxs)("div",{className:s(t,"components-circular-option-picker__option-wrapper"),children:[p,n&&(0,_t.jsx)(oS,{icon:ok,...r})]})},ck.OptionGroup=function({className:e,options:t,...n}){const r="aria-label"in n||"aria-labelledby"in n?"group":void 0;return(0,_t.jsx)("div",{...n,role:r,className:s("components-circular-option-picker__option-group","components-circular-option-picker__swatches",e),children:t})},ck.ButtonAction=function({className:e,children:t,...n}){return(0,_t.jsx)(Jx,{__next40pxDefaultSize:!0,className:s("components-circular-option-picker__clear",e),variant:"tertiary",...n,children:t})},ck.DropdownLinkAction=function({buttonProps:e,className:t,dropdownProps:n,linkText:r}){return(0,_t.jsx)(W_,{className:s("components-circular-option-picker__dropdown-link-action",t),renderToggle:({isOpen:t,onToggle:n})=>(0,_t.jsx)(Jx,{"aria-expanded":t,"aria-haspopup":"true",onClick:n,variant:"link",...e,children:r}),...n})};const uk=ck;const dk=al((function(e,t){const n=function(e){const{expanded:t=!1,alignment:n="stretch",...r}=sl(e,"VStack");return py({direction:"column",expanded:t,alignment:n,...r})}(e);return(0,_t.jsx)(_l,{...n,ref:t})}),"VStack");const pk=al((function(e,t){const n=Kg(e);return(0,_t.jsx)(_l,{as:"span",...n,ref:t})}),"Truncate");const fk=al((function(e,t){const n=function(e){const{as:t,level:n=2,color:r=zl.theme.foreground,isBlock:o=!0,weight:i=Fl.fontWeightHeading,...s}=sl(e,"Heading"),a=t||`h${n}`,l={};return"string"==typeof a&&"h"!==a[0]&&(l.role="heading",l["aria-level"]="string"==typeof n?parseInt(n):n),{...Vv({color:r,isBlock:o,weight:i,size:Fv(n),...s}),...l,as:a}}(e);return(0,_t.jsx)(_l,{...n,ref:t})}),"Heading"),hk=fk;const mk=yl(hk,{target:"ev9wop70"})({name:"13lxv2o",styles:"text-transform:uppercase;line-height:24px;font-weight:500;&&&{font-size:11px;margin-bottom:0;}"}),gk=({paddingSize:e="small"})=>{if("none"===e)return;const t={small:Il(2),medium:Il(4)};return Nl("padding:",t[e]||t.small,";","")},vk=yl("div",{target:"eovvns30"})("margin-left:",Il(-2),";margin-right:",Il(-2),";&:first-of-type{margin-top:",Il(-2),";}&:last-of-type{margin-bottom:",Il(-2),";}",gk,";");const bk=al((function(e,t){const{paddingSize:n="small",...r}=sl(e,"DropdownContentWrapper");return(0,_t.jsx)(vk,{...r,paddingSize:n,ref:t})}),"DropdownContentWrapper");_v([Sv,$_]);const xk=e=>{const t=/var\(/.test(null!=e?e:""),n=/color-mix\(/.test(null!=e?e:"");return!t&&!n},yk=e=>e.length>0&&e.every((e=>{return t=e,Array.isArray(t.colors)&&!("color"in t);var t}));function wk({className:e,clearColor:t,colors:n,onChange:r,value:o,...i}){const s=(0,c.useMemo)((()=>n.map((({color:e,name:n},i)=>{const s=yv(e),l=o===e;return(0,_t.jsx)(uk.Option,{isSelected:l,selectedIconProps:l?{fill:s.contrast()>s.contrast("#000")?"#fff":"#000"}:{},tooltipText:n||(0,a.sprintf)((0,a.__)("Color code: %s"),e),style:{backgroundColor:e,color:e},onClick:l?t:()=>r(e,i)},`${e}-${i}`)}))),[n,o,r,t]);return(0,_t.jsx)(uk.OptionGroup,{className:e,options:s,...i})}function _k({className:e,clearColor:t,colors:n,onChange:r,value:o,headingLevel:i}){const s=(0,l.useInstanceId)(_k,"color-palette");return 0===n.length?null:(0,_t.jsx)(dk,{spacing:3,className:e,children:n.map((({name:e,colors:n},a)=>{const l=`${s}-${a}`;return(0,_t.jsxs)(dk,{spacing:2,children:[(0,_t.jsx)(mk,{id:l,level:i,children:e}),(0,_t.jsx)(wk,{clearColor:t,colors:n,onChange:e=>r(e,a),value:o,"aria-labelledby":l})]},a)}))})}function Sk({isRenderedInSidebar:e,popoverProps:t,...n}){const r=(0,c.useMemo)((()=>({shift:!0,resize:!1,...e?{placement:"left-start",offset:34}:{placement:"bottom",offset:8},...t})),[e,t]);return(0,_t.jsx)(W_,{contentClassName:"components-color-palette__custom-color-dropdown-content",popoverProps:r,...n})}_v([Sv,$_]);const Ck=(0,c.forwardRef)((function(e,t){const{asButtons:n,loop:r,clearable:o=!0,colors:i=[],disableCustomColors:l=!1,enableAlpha:u=!1,onChange:d,value:p,__experimentalIsRenderedInSidebar:f=!1,headingLevel:h=2,"aria-label":m,"aria-labelledby":g,...v}=e,[b,x]=(0,c.useState)(p),y=(0,c.useCallback)((()=>d(void 0)),[d]),w=(0,c.useCallback)((e=>{x(((e,t)=>{if(!e||!t||xk(e))return e;const{ownerDocument:n}=t,{defaultView:r}=n,o=r?.getComputedStyle(t).backgroundColor;return o?yv(o).toHex():e})(p,e))}),[p]),_=yk(i),S=(0,c.useMemo)((()=>((e,t=[],n=!1)=>{if(!e)return"";const r=!!e&&xk(e),o=r?yv(e).toHex():e,i=n?t:[{colors:t}];for(const{colors:e}of i)for(const{name:t,color:n}of e)if(o===(r?yv(n).toHex():n))return t;return(0,a.__)("Custom")})(p,i,_)),[p,i,_]),C=p?.startsWith("#"),k=p?.replace(/^var\((.+)\)$/,"$1"),j=k?(0,a.sprintf)((0,a.__)('Custom color picker. The currently selected color is called "%1$s" and has a value of "%2$s".'),S,k):(0,a.__)("Custom color picker."),E={clearColor:y,onChange:d,value:p},P=!!o&&(0,_t.jsx)(uk.ButtonAction,{onClick:y,accessibleWhenDisabled:!0,disabled:!p,children:(0,a.__)("Clear")});let N;if(n)N={asButtons:!0};else{const e={asButtons:!1,loop:r};N=m?{...e,"aria-label":m}:g?{...e,"aria-labelledby":g}:{...e,"aria-label":(0,a.__)("Custom color picker.")}}return(0,_t.jsxs)(dk,{spacing:3,ref:t,...v,children:[!l&&(0,_t.jsx)(Sk,{isRenderedInSidebar:f,renderContent:()=>(0,_t.jsx)(bk,{paddingSize:"none",children:(0,_t.jsx)(nk,{color:b,onChange:e=>d(e),enableAlpha:u})}),renderToggle:({isOpen:e,onToggle:t})=>(0,_t.jsxs)(dk,{className:"components-color-palette__custom-color-wrapper",spacing:0,children:[(0,_t.jsx)("button",{ref:w,className:"components-color-palette__custom-color-button","aria-expanded":e,"aria-haspopup":"true",onClick:t,"aria-label":j,style:{background:p},type:"button"}),(0,_t.jsxs)(dk,{className:"components-color-palette__custom-color-text-wrapper",spacing:.5,children:[(0,_t.jsx)(pk,{className:"components-color-palette__custom-color-name",children:p?S:(0,a.__)("No color selected")}),(0,_t.jsx)(pk,{className:s("components-color-palette__custom-color-value",{"components-color-palette__custom-color-value--is-hex":C}),children:k})]})]})}),(i.length>0||P)&&(0,_t.jsx)(uk,{...N,actions:P,options:_?(0,_t.jsx)(_k,{...E,headingLevel:h,colors:i,value:p}):(0,_t.jsx)(wk,{...E,colors:i,value:p})})]})})),kk=Ck,jk=yl(gy,{target:"e1bagdl32"})("&&&{input{display:block;width:100%;}",Kv,"{transition:box-shadow 0.1s linear;}}"),Ek=({selectSize:e})=>({small:Nl("box-sizing:border-box;padding:2px 1px;width:20px;font-size:8px;line-height:1;letter-spacing:-0.5px;text-transform:uppercase;text-align-last:center;&:not( :disabled ){color:",zl.gray[800],";}",""),default:Nl("box-sizing:border-box;min-width:24px;max-width:48px;height:24px;margin-inline-end:",Il(2),";padding:",Il(1),";font-size:13px;line-height:1;text-align-last:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;field-sizing:content;&:not( :disabled ){color:",zl.theme.accent,";}","")}[e]),Pk=yl("div",{target:"e1bagdl31"})("&&&{pointer-events:none;",Ek,";color:",zl.gray[900],";}"),Nk=({selectSize:e="default"})=>({small:Nl("height:100%;border:1px solid transparent;transition:box-shadow 0.1s linear,border 0.1s linear;",Mg({borderTopLeftRadius:0,borderBottomLeftRadius:0})()," &:not(:disabled):hover{background-color:",zl.gray[100],";}&:focus{border:1px solid ",zl.ui.borderFocus,";box-shadow:inset 0 0 0 ",Fl.borderWidth+" "+zl.ui.borderFocus,";outline-offset:0;outline:2px solid transparent;z-index:1;}",""),default:Nl("display:flex;justify-content:center;align-items:center;&:where( :not( :disabled ) ):hover{box-shadow:0 0 0 ",Fl.borderWidth+" "+zl.ui.borderFocus,";outline:",Fl.borderWidth," solid transparent;}&:focus{box-shadow:0 0 0 ",Fl.borderWidthFocus+" "+zl.ui.borderFocus,";outline:",Fl.borderWidthFocus," solid transparent;}","")}[e]),Tk=yl("select",{target:"e1bagdl30"})("&&&{appearance:none;background:transparent;border-radius:",Fl.radiusXSmall,";border:none;display:block;outline:none;margin:0;min-height:auto;font-family:inherit;",Ek,";",Nk,";&:not( :disabled ){cursor:pointer;}}"),Ik=Nl("box-shadow:inset ",Fl.controlBoxShadowFocus,";",""),Rk=Nl("border:0;padding:0;margin:0;",Rx,";",""),Mk=Nl(jk,"{flex:0 0 auto;}",""),Ak=Nl("background:#fff;&&>button{aspect-ratio:1;padding:0;display:flex;align-items:center;justify-content:center;",Mg({borderRadius:"2px 0 0 2px"},{borderRadius:"0 2px 2px 0"})()," border:",Fl.borderWidth," solid ",zl.ui.border,";&:focus,&:hover:not( :disabled ){",Ik," border-color:",zl.ui.borderFocus,";z-index:1;position:relative;}}",""),Dk=(e,t)=>{const{style:n}=e||{};return Nl("border-radius:",Fl.radiusFull,";border:2px solid transparent;",n?(e=>{const{color:t,style:n}=e||{},r=n&&"none"!==n?zl.gray[300]:void 0;return Nl("border-style:","none"===n?"solid":n,";border-color:",t||r,";","")})(e):void 0," width:","__unstable-large"===t?"24px":"22px",";height:","__unstable-large"===t?"24px":"22px",";padding:","__unstable-large"===t?"2px":"1px",";&>span{height:",Il(4),";width:",Il(4),";background:linear-gradient(\n\t\t\t\t-45deg,\n\t\t\t\ttransparent 48%,\n\t\t\t\trgb( 0 0 0 / 20% ) 48%,\n\t\t\t\trgb( 0 0 0 / 20% ) 52%,\n\t\t\t\ttransparent 52%\n\t\t\t);}","")},zk=Nl("width:",228,"px;>div:first-of-type>",Ox,"{margin-bottom:0;}&& ",Ox,"+button:not( .has-text ){min-width:24px;padding:0;}",""),Ok=Nl("",""),Lk=Nl("",""),Fk=Nl("justify-content:center;width:100%;&&{border-top:",Fl.borderWidth," solid ",zl.gray[400],";border-top-left-radius:0;border-top-right-radius:0;}",""),Bk="web"===c.Platform.OS,Vk={px:{value:"px",label:Bk?"px":(0,a.__)("Pixels (px)"),a11yLabel:(0,a.__)("Pixels (px)"),step:1},"%":{value:"%",label:Bk?"%":(0,a.__)("Percentage (%)"),a11yLabel:(0,a.__)("Percent (%)"),step:.1},em:{value:"em",label:Bk?"em":(0,a.__)("Relative to parent font size (em)"),a11yLabel:(0,a._x)("ems","Relative to parent font size (em)"),step:.01},rem:{value:"rem",label:Bk?"rem":(0,a.__)("Relative to root font size (rem)"),a11yLabel:(0,a._x)("rems","Relative to root font size (rem)"),step:.01},vw:{value:"vw",label:Bk?"vw":(0,a.__)("Viewport width (vw)"),a11yLabel:(0,a.__)("Viewport width (vw)"),step:.1},vh:{value:"vh",label:Bk?"vh":(0,a.__)("Viewport height (vh)"),a11yLabel:(0,a.__)("Viewport height (vh)"),step:.1},vmin:{value:"vmin",label:Bk?"vmin":(0,a.__)("Viewport smallest dimension (vmin)"),a11yLabel:(0,a.__)("Viewport smallest dimension (vmin)"),step:.1},vmax:{value:"vmax",label:Bk?"vmax":(0,a.__)("Viewport largest dimension (vmax)"),a11yLabel:(0,a.__)("Viewport largest dimension (vmax)"),step:.1},ch:{value:"ch",label:Bk?"ch":(0,a.__)("Width of the zero (0) character (ch)"),a11yLabel:(0,a.__)("Width of the zero (0) character (ch)"),step:.01},ex:{value:"ex",label:Bk?"ex":(0,a.__)("x-height of the font (ex)"),a11yLabel:(0,a.__)("x-height of the font (ex)"),step:.01},cm:{value:"cm",label:Bk?"cm":(0,a.__)("Centimeters (cm)"),a11yLabel:(0,a.__)("Centimeters (cm)"),step:.001},mm:{value:"mm",label:Bk?"mm":(0,a.__)("Millimeters (mm)"),a11yLabel:(0,a.__)("Millimeters (mm)"),step:.1},in:{value:"in",label:Bk?"in":(0,a.__)("Inches (in)"),a11yLabel:(0,a.__)("Inches (in)"),step:.001},pc:{value:"pc",label:Bk?"pc":(0,a.__)("Picas (pc)"),a11yLabel:(0,a.__)("Picas (pc)"),step:1},pt:{value:"pt",label:Bk?"pt":(0,a.__)("Points (pt)"),a11yLabel:(0,a.__)("Points (pt)"),step:1},svw:{value:"svw",label:Bk?"svw":(0,a.__)("Small viewport width (svw)"),a11yLabel:(0,a.__)("Small viewport width (svw)"),step:.1},svh:{value:"svh",label:Bk?"svh":(0,a.__)("Small viewport height (svh)"),a11yLabel:(0,a.__)("Small viewport height (svh)"),step:.1},svi:{value:"svi",label:Bk?"svi":(0,a.__)("Viewport smallest size in the inline direction (svi)"),a11yLabel:(0,a.__)("Small viewport width or height (svi)"),step:.1},svb:{value:"svb",label:Bk?"svb":(0,a.__)("Viewport smallest size in the block direction (svb)"),a11yLabel:(0,a.__)("Small viewport width or height (svb)"),step:.1},svmin:{value:"svmin",label:Bk?"svmin":(0,a.__)("Small viewport smallest dimension (svmin)"),a11yLabel:(0,a.__)("Small viewport smallest dimension (svmin)"),step:.1},lvw:{value:"lvw",label:Bk?"lvw":(0,a.__)("Large viewport width (lvw)"),a11yLabel:(0,a.__)("Large viewport width (lvw)"),step:.1},lvh:{value:"lvh",label:Bk?"lvh":(0,a.__)("Large viewport height (lvh)"),a11yLabel:(0,a.__)("Large viewport height (lvh)"),step:.1},lvi:{value:"lvi",label:Bk?"lvi":(0,a.__)("Large viewport width or height (lvi)"),a11yLabel:(0,a.__)("Large viewport width or height (lvi)"),step:.1},lvb:{value:"lvb",label:Bk?"lvb":(0,a.__)("Large viewport width or height (lvb)"),a11yLabel:(0,a.__)("Large viewport width or height (lvb)"),step:.1},lvmin:{value:"lvmin",label:Bk?"lvmin":(0,a.__)("Large viewport smallest dimension (lvmin)"),a11yLabel:(0,a.__)("Large viewport smallest dimension (lvmin)"),step:.1},dvw:{value:"dvw",label:Bk?"dvw":(0,a.__)("Dynamic viewport width (dvw)"),a11yLabel:(0,a.__)("Dynamic viewport width (dvw)"),step:.1},dvh:{value:"dvh",label:Bk?"dvh":(0,a.__)("Dynamic viewport height (dvh)"),a11yLabel:(0,a.__)("Dynamic viewport height (dvh)"),step:.1},dvi:{value:"dvi",label:Bk?"dvi":(0,a.__)("Dynamic viewport width or height (dvi)"),a11yLabel:(0,a.__)("Dynamic viewport width or height (dvi)"),step:.1},dvb:{value:"dvb",label:Bk?"dvb":(0,a.__)("Dynamic viewport width or height (dvb)"),a11yLabel:(0,a.__)("Dynamic viewport width or height (dvb)"),step:.1},dvmin:{value:"dvmin",label:Bk?"dvmin":(0,a.__)("Dynamic viewport smallest dimension (dvmin)"),a11yLabel:(0,a.__)("Dynamic viewport smallest dimension (dvmin)"),step:.1},dvmax:{value:"dvmax",label:Bk?"dvmax":(0,a.__)("Dynamic viewport largest dimension (dvmax)"),a11yLabel:(0,a.__)("Dynamic viewport largest dimension (dvmax)"),step:.1},svmax:{value:"svmax",label:Bk?"svmax":(0,a.__)("Small viewport largest dimension (svmax)"),a11yLabel:(0,a.__)("Small viewport largest dimension (svmax)"),step:.1},lvmax:{value:"lvmax",label:Bk?"lvmax":(0,a.__)("Large viewport largest dimension (lvmax)"),a11yLabel:(0,a.__)("Large viewport largest dimension (lvmax)"),step:.1}},$k=Object.values(Vk),Hk=[Vk.px,Vk["%"],Vk.em,Vk.rem,Vk.vw,Vk.vh],Wk=Vk.px;function Uk(e,t,n){return Kk(t?`${null!=e?e:""}${t}`:e,n)}function Gk(e){return Array.isArray(e)&&!!e.length}function Kk(e,t=$k){let n,r;if(void 0!==e||null===e){n=`${e}`.trim();const t=parseFloat(n);r=isFinite(t)?t:void 0}const o=n?.match(/[\d.\-\+]*\s*(.*)/),i=o?.[1]?.toLowerCase();let s;if(Gk(t)){const e=t.find((e=>e.value===i));s=e?.value}else s=Wk.value;return[r,s]}const qk=({units:e=$k,availableUnits:t=[],defaultValues:n})=>{const r=function(e=[],t){return Array.isArray(t)?t.filter((t=>e.includes(t.value))):[]}(t,e);return n&&r.forEach(((e,t)=>{if(n[e.value]){const[o]=Kk(n[e.value]);r[t].default=o}})),r};const Yk=e=>e.replace(/^var\((.+)\)$/,"$1"),Xk=al(((e,t)=>{const{__experimentalIsRenderedInSidebar:n,border:r,colors:o,disableCustomColors:i,enableAlpha:s,enableStyle:l,indicatorClassName:u,indicatorWrapperClassName:d,isStyleSettable:p,onReset:f,onColorChange:h,onStyleChange:m,popoverContentClassName:g,popoverControlsClassName:v,resetButtonClassName:b,size:x,__unstablePopoverProps:y,...w}=function(e){const{border:t,className:n,colors:r=[],enableAlpha:o=!1,enableStyle:i=!0,onChange:s,previousStyleSelection:a,size:l="default",__experimentalIsRenderedInSidebar:u=!1,...d}=sl(e,"BorderControlDropdown"),[p]=Kk(t?.width),f=0===p,h=il(),m=(0,c.useMemo)((()=>h(Ak,n)),[n,h]),g=(0,c.useMemo)((()=>h(Lk)),[h]),v=(0,c.useMemo)((()=>h(Dk(t,l))),[t,h,l]),b=(0,c.useMemo)((()=>h(zk)),[h]),x=(0,c.useMemo)((()=>h(Ok)),[h]),y=(0,c.useMemo)((()=>h(Fk)),[h]);return{...d,border:t,className:m,colors:r,enableAlpha:o,enableStyle:i,indicatorClassName:g,indicatorWrapperClassName:v,onColorChange:e=>{s({color:e,style:"none"===t?.style?a:t?.style,width:f&&e?"1px":t?.width})},onStyleChange:e=>{const n=f&&e?"1px":t?.width;s({...t,style:e,width:n})},onReset:()=>{s({...t,color:void 0,style:void 0})},popoverContentClassName:x,popoverControlsClassName:b,resetButtonClassName:y,size:l,__experimentalIsRenderedInSidebar:u}}(e),{color:_,style:S}=r||{},C=((e,t)=>{if(e&&t){if(yk(t)){let n;return t.some((t=>t.colors.some((t=>t.color===e&&(n=t,!0))))),n}return t.find((t=>t.color===e))}})(_,o),k=((e,t,n,r)=>{if(r){if(t){const e=Yk(t.color);return n?(0,a.sprintf)((0,a.__)('Border color and style picker. The currently selected color is called "%1$s" and has a value of "%2$s". The currently selected style is "%3$s".'),t.name,e,n):(0,a.sprintf)((0,a.__)('Border color and style picker. The currently selected color is called "%1$s" and has a value of "%2$s".'),t.name,e)}if(e){const t=Yk(e);return n?(0,a.sprintf)((0,a.__)('Border color and style picker. The currently selected color has a value of "%1$s". The currently selected style is "%2$s".'),t,n):(0,a.sprintf)((0,a.__)('Border color and style picker. The currently selected color has a value of "%s".'),t)}return(0,a.__)("Border color and style picker.")}return t?(0,a.sprintf)((0,a.__)('Border color picker. The currently selected color is called "%1$s" and has a value of "%2$s".'),t.name,Yk(t.color)):e?(0,a.sprintf)((0,a.__)('Border color picker. The currently selected color has a value of "%s".'),Yk(e)):(0,a.__)("Border color picker.")})(_,C,S,l),j=_||S&&"none"!==S,E=n?"bottom left":void 0;return(0,_t.jsx)(W_,{renderToggle:({onToggle:e})=>(0,_t.jsx)(Jx,{onClick:e,variant:"tertiary","aria-label":k,tooltipPosition:E,label:(0,a.__)("Border color and style picker"),showTooltip:!0,__next40pxDefaultSize:"__unstable-large"===x,children:(0,_t.jsx)("span",{className:d,children:(0,_t.jsx)(F_,{className:u,colorValue:_})})}),renderContent:({onClose:e})=>(0,_t.jsxs)(_t.Fragment,{children:[(0,_t.jsx)(bk,{paddingSize:"medium",children:(0,_t.jsxs)(dk,{className:v,spacing:6,children:[(0,_t.jsx)(kk,{className:g,value:_,onChange:h,colors:o,disableCustomColors:i,__experimentalIsRenderedInSidebar:n,clearable:!1,enableAlpha:s}),l&&p&&(0,_t.jsx)(L_,{label:(0,a.__)("Style"),value:S,onChange:m})]})}),j&&(0,_t.jsx)(bk,{paddingSize:"none",children:(0,_t.jsx)(Jx,{className:b,variant:"tertiary",onClick:()=>{f(),e()},__next40pxDefaultSize:!0,children:(0,a.__)("Reset")})})]}),popoverProps:{...y},...w,ref:t})}),"BorderControlDropdown"),Zk=Xk;const Qk=(0,c.forwardRef)((function({className:e,isUnitSelectTabbable:t=!0,onChange:n,size:r="default",unit:o="px",units:i=Hk,...a},l){if(!Gk(i)||1===i?.length)return(0,_t.jsx)(Pk,{className:"components-unit-control__unit-label",selectSize:r,children:o});const c=s("components-unit-control__select",e);return(0,_t.jsx)(Tk,{ref:l,className:c,onChange:e=>{const{value:t}=e.target,r=i.find((e=>e.value===t));n?.(t,{event:e,data:r})},selectSize:r,tabIndex:t?void 0:-1,value:o,...a,children:i.map((e=>(0,_t.jsx)("option",{value:e.value,children:e.label},e.value)))})}));const Jk=(0,c.forwardRef)((function(e,t){const{__unstableStateReducer:n,autoComplete:r="off",children:o,className:i,disabled:l=!1,disableUnits:u=!1,isPressEnterToChange:d=!1,isResetValueOnUnitChange:p=!1,isUnitSelectTabbable:f=!0,label:h,onChange:m,onUnitChange:g,size:v="default",unit:b,units:x=Hk,value:y,onFocus:w,__shouldNotWarnDeprecated36pxSize:_,...S}=hb(e);Ux({componentName:"UnitControl",__next40pxDefaultSize:S.__next40pxDefaultSize,size:v,__shouldNotWarnDeprecated36pxSize:_}),"unit"in e&&Xi()("UnitControl unit prop",{since:"5.6",hint:"The unit should be provided within the `value` prop.",version:"6.2"});const C=null!=y?y:void 0,[k,j]=(0,c.useMemo)((()=>{const e=function(e,t,n=$k){const r=Array.isArray(n)?[...n]:[],[,o]=Uk(e,t,$k);return o&&!r.some((e=>e.value===o))&&Vk[o]&&r.unshift(Vk[o]),r}(C,b,x),[{value:t=""}={},...n]=e,r=n.reduce(((e,{value:t})=>{const n=Iy(t?.substring(0,1)||"");return e.includes(n)?e:`${e}|${n}`}),Iy(t.substring(0,1)));return[e,new RegExp(`^(?:${r})$`,"i")]}),[C,b,x]),[E,P]=Uk(C,b,k),[N,T]=dS(1===k.length?k[0].value:b,{initial:P,fallback:""});(0,c.useEffect)((()=>{void 0!==P&&T(P)}),[P,T]);const I=s("components-unit-control","components-unit-control-wrapper",i);let R;!u&&f&&k.length&&(R=e=>{S.onKeyDown?.(e),e.metaKey||e.ctrlKey||!j.test(e.key)||M.current?.focus()});const M=(0,c.useRef)(null),A=u?null:(0,_t.jsx)(Qk,{ref:M,"aria-label":(0,a.__)("Select unit"),disabled:l,isUnitSelectTabbable:f,onChange:(e,t)=>{const{data:n}=t;let r=`${null!=E?E:""}${e}`;p&&void 0!==n?.default&&(r=`${n.default}${e}`),m?.(r,t),g?.(e,t),T(e)},size:["small","compact"].includes(v)||"default"===v&&!S.__next40pxDefaultSize?"small":"default",unit:N,units:k,onFocus:w,onBlur:e.onBlur});let D=S.step;if(!D&&k){var z;const e=k.find((e=>e.value===N));D=null!==(z=e?.step)&&void 0!==z?z:1}return(0,_t.jsx)(jk,{...S,__shouldNotWarnDeprecated36pxSize:!0,autoComplete:r,className:I,disabled:l,spinControls:"none",isPressEnterToChange:d,label:h,onKeyDown:R,onChange:(e,t)=>{if(""===e||null==e)return void m?.("",t);const n=function(e,t,n,r){const[o,i]=Kk(e,t),s=null!=o?o:n;let a=i||r;return!a&&Gk(t)&&(a=t[0].value),[s,a]}(e,k,E,N).join("");m?.(n,t)},ref:t,size:v,suffix:A,type:d?"text":"number",value:null!=E?E:"",step:D,onFocus:w,__unstableStateReducer:n})})),ej=Jk,tj=e=>void 0!==e?.width&&""!==e.width||void 0!==e?.color;function nj(e){const{className:t,colors:n=[],isCompact:r,onChange:o,enableAlpha:i=!0,enableStyle:s=!0,shouldSanitizeBorder:a=!0,size:l="default",value:u,width:d,__experimentalIsRenderedInSidebar:p=!1,__next40pxDefaultSize:f,__shouldNotWarnDeprecated36pxSize:h,...m}=sl(e,"BorderControl");Ux({componentName:"BorderControl",__next40pxDefaultSize:f,size:l,__shouldNotWarnDeprecated36pxSize:h});const g="default"===l&&f?"__unstable-large":l,[v,b]=Kk(u?.width),x=b||"px",y=0===v,[w,_]=(0,c.useState)(),[S,C]=(0,c.useState)(),k=!a||tj(u),j=(0,c.useCallback)((e=>{!a||tj(e)?o(e):o(void 0)}),[o,a]),E=(0,c.useCallback)((e=>{const t=""===e?void 0:e,[n]=Kk(e),r=0===n,o={...u,width:t};r&&!y&&(_(u?.color),C(u?.style),o.color=void 0,o.style="none"),!r&&y&&(void 0===o.color&&(o.color=w),"none"===o.style&&(o.style=S)),j(o)}),[u,y,w,S,j]),P=(0,c.useCallback)((e=>{E(`${e}${x}`)}),[E,x]),N=il(),T=(0,c.useMemo)((()=>N(Rk,t)),[t,N]);let I=d;r&&(I="__unstable-large"===l?"116px":"90px");const R=(0,c.useMemo)((()=>{const e=!!I&&Mk,t=(e=>Nl("height:","__unstable-large"===e?"40px":"30px",";",""))(g);return N(Nl(jk,"{flex:1 1 40%;}&& ",Tk,"{min-height:0;}",""),e,t)}),[I,N,g]),M=(0,c.useMemo)((()=>N(Nl("flex:1 1 60%;",Mg({marginRight:Il(3)})(),";",""))),[N]);return{...m,className:T,colors:n,enableAlpha:i,enableStyle:s,innerWrapperClassName:R,inputWidth:I,isStyleSettable:k,onBorderChange:j,onSliderChange:P,onWidthChange:E,previousStyleSelection:S,sliderClassName:M,value:u,widthUnit:x,widthValue:v,size:g,__experimentalIsRenderedInSidebar:p,__next40pxDefaultSize:f}}const rj=e=>{const{label:t,hideLabelFromVision:n}=e;return t?n?(0,_t.jsx)(Sl,{as:"legend",children:t}):(0,_t.jsx)(Ox,{as:"legend",children:t}):null},oj=al(((e,t)=>{const{__next40pxDefaultSize:n=!1,colors:r,disableCustomColors:o,disableUnits:i,enableAlpha:s,enableStyle:l,hideLabelFromVision:c,innerWrapperClassName:u,inputWidth:d,isStyleSettable:p,label:f,onBorderChange:h,onSliderChange:m,onWidthChange:g,placeholder:v,__unstablePopoverProps:b,previousStyleSelection:x,showDropdownHeader:y,size:w,sliderClassName:_,value:S,widthUnit:C,widthValue:k,withSlider:j,__experimentalIsRenderedInSidebar:E,...P}=nj(e);return(0,_t.jsxs)(_l,{as:"fieldset",...P,ref:t,children:[(0,_t.jsx)(rj,{label:f,hideLabelFromVision:c}),(0,_t.jsxs)(fy,{spacing:4,className:u,children:[(0,_t.jsx)(ej,{__next40pxDefaultSize:n,__shouldNotWarnDeprecated36pxSize:!0,prefix:(0,_t.jsx)(zg,{marginRight:1,marginBottom:0,children:(0,_t.jsx)(Zk,{border:S,colors:r,__unstablePopoverProps:b,disableCustomColors:o,enableAlpha:s,enableStyle:l,isStyleSettable:p,onChange:h,previousStyleSelection:x,__experimentalIsRenderedInSidebar:E,size:w})}),label:(0,a.__)("Border width"),hideLabelFromVision:!0,min:0,onChange:g,value:S?.width||"",placeholder:v,disableUnits:i,__unstableInputWidth:d,size:w}),j&&(0,_t.jsx)(ZS,{__nextHasNoMarginBottom:!0,label:(0,a.__)("Border width"),hideLabelFromVision:!0,className:_,initialPosition:0,max:100,min:0,onChange:m,step:["px","%"].includes(C)?1:.1,value:k||void 0,withInputField:!1,__next40pxDefaultSize:n,__shouldNotWarnDeprecated36pxSize:!0})]})]})}),"BorderControl"),ij=oj,sj={bottom:{alignItems:"flex-end",justifyContent:"center"},bottomLeft:{alignItems:"flex-start",justifyContent:"flex-end"},bottomRight:{alignItems:"flex-end",justifyContent:"flex-end"},center:{alignItems:"center",justifyContent:"center"},spaced:{alignItems:"center",justifyContent:"space-between"},left:{alignItems:"center",justifyContent:"flex-start"},right:{alignItems:"center",justifyContent:"flex-end"},stretch:{alignItems:"stretch"},top:{alignItems:"flex-start",justifyContent:"center"},topLeft:{alignItems:"flex-start",justifyContent:"flex-start"},topRight:{alignItems:"flex-start",justifyContent:"flex-end"}};function aj(e){const{align:t,alignment:n,className:r,columnGap:o,columns:i=2,gap:s=3,isInline:a=!1,justify:l,rowGap:u,rows:d,templateColumns:p,templateRows:f,...h}=sl(e,"Grid"),m=vg(Array.isArray(i)?i:[i]),g=vg(Array.isArray(d)?d:[d]),v=p||!!i&&`repeat( ${m}, 1fr )`,b=f||!!d&&`repeat( ${g}, 1fr )`,x=il();return{...h,className:(0,c.useMemo)((()=>{const e=function(e){return e?sj[e]:{}}(n),i=Nl({alignItems:t,display:a?"inline-grid":"grid",gap:`calc( ${Fl.gridBase} * ${s} )`,gridTemplateColumns:v||void 0,gridTemplateRows:b||void 0,gridRowGap:u,gridColumnGap:o,justifyContent:l,verticalAlign:a?"middle":void 0,...e},"","");return x(i,r)}),[t,n,r,o,x,s,v,b,a,l,u])}}const lj=al((function(e,t){const n=aj(e);return(0,_t.jsx)(_l,{...n,ref:t})}),"Grid");function cj(e){const{className:t,colors:n=[],enableAlpha:r=!1,enableStyle:o=!0,size:i="default",__experimentalIsRenderedInSidebar:s=!1,...a}=sl(e,"BorderBoxControlSplitControls"),l=il(),u=(0,c.useMemo)((()=>l((e=>Nl("position:relative;flex:1;width:","__unstable-large"===e?void 0:"80%",";",""))(i),t)),[l,t,i]);return{...a,centeredClassName:(0,c.useMemo)((()=>l(Vw,t)),[l,t]),className:u,colors:n,enableAlpha:r,enableStyle:o,rightAlignedClassName:(0,c.useMemo)((()=>l(Nl(Mg({marginLeft:"auto"})(),";",""),t)),[l,t]),size:i,__experimentalIsRenderedInSidebar:s}}const uj=al(((e,t)=>{const{centeredClassName:n,colors:r,disableCustomColors:o,enableAlpha:i,enableStyle:s,onChange:u,popoverPlacement:d,popoverOffset:p,rightAlignedClassName:f,size:h="default",value:m,__experimentalIsRenderedInSidebar:g,...v}=cj(e),[b,x]=(0,c.useState)(null),y=(0,c.useMemo)((()=>d?{placement:d,offset:p,anchor:b,shift:!0}:void 0),[d,p,b]),w={colors:r,disableCustomColors:o,enableAlpha:i,enableStyle:s,isCompact:!0,__experimentalIsRenderedInSidebar:g,size:h,__shouldNotWarnDeprecated36pxSize:!0},_=(0,l.useMergeRefs)([x,t]);return(0,_t.jsxs)(lj,{...v,ref:_,gap:3,children:[(0,_t.jsx)(Uw,{value:m,size:h}),(0,_t.jsx)(ij,{className:n,hideLabelFromVision:!0,label:(0,a.__)("Top border"),onChange:e=>u(e,"top"),__unstablePopoverProps:y,value:m?.top,...w}),(0,_t.jsx)(ij,{hideLabelFromVision:!0,label:(0,a.__)("Left border"),onChange:e=>u(e,"left"),__unstablePopoverProps:y,value:m?.left,...w}),(0,_t.jsx)(ij,{className:f,hideLabelFromVision:!0,label:(0,a.__)("Right border"),onChange:e=>u(e,"right"),__unstablePopoverProps:y,value:m?.right,...w}),(0,_t.jsx)(ij,{className:n,hideLabelFromVision:!0,label:(0,a.__)("Bottom border"),onChange:e=>u(e,"bottom"),__unstablePopoverProps:y,value:m?.bottom,...w})]})}),"BorderBoxControlSplitControls"),dj=uj,pj=/^([\d.\-+]*)\s*(fr|cm|mm|Q|in|pc|pt|px|em|ex|ch|rem|lh|vw|vh|vmin|vmax|%|cap|ic|rlh|vi|vb|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx|svw|lvw|dvw|svh|lvh|dvh|svi|lvi|dvi|svb|lvb|dvb|svmin|lvmin|dvmin|svmax|lvmax|dvmax)?$/;const fj=["top","right","bottom","left"],hj=["color","style","width"],mj=e=>!e||!hj.some((t=>void 0!==e[t])),gj=e=>{if(!e)return!1;if(vj(e)){return!fj.every((t=>mj(e[t])))}return!mj(e)},vj=(e={})=>Object.keys(e).some((e=>-1!==fj.indexOf(e))),bj=e=>{if(!vj(e))return!1;const t=fj.map((t=>xj(e?.[t])));return!t.every((e=>e===t[0]))},xj=(e,t)=>{if(mj(e))return t;const{color:n,style:r,width:o}=t||{},{color:i=n,style:s=r,width:a=o}=e;return[a,!!a&&"0"!==a||!!i?s||"solid":s,i].filter(Boolean).join(" ")},yj=e=>function(e){if(0===e.length)return;const t={};let n,r=0;return e.forEach((e=>{t[e]=void 0===t[e]?1:t[e]+1,t[e]>r&&(n=e,r=t[e])})),n}(e.map((e=>void 0===e?void 0:function(e){const t=e.trim().match(pj);if(!t)return[void 0,void 0];const[,n,r]=t;let o=parseFloat(n);return o=Number.isNaN(o)?void 0:o,[o,r]}(`${e}`)[1])).filter((e=>void 0!==e)));function wj(e){const{className:t,colors:n=[],onChange:r,enableAlpha:o=!1,enableStyle:i=!0,size:s="default",value:a,__experimentalIsRenderedInSidebar:l=!1,__next40pxDefaultSize:u,...d}=sl(e,"BorderBoxControl");Ux({componentName:"BorderBoxControl",__next40pxDefaultSize:u,size:s});const p="default"===s&&u?"__unstable-large":s,f=bj(a),h=vj(a),m=h?(e=>{if(!e)return;const t=[],n=[],r=[];fj.forEach((o=>{t.push(e[o]?.color),n.push(e[o]?.style),r.push(e[o]?.width)}));const o=t.every((e=>e===t[0])),i=n.every((e=>e===n[0])),s=r.every((e=>e===r[0]));return{color:o?t[0]:void 0,style:i?n[0]:void 0,width:s?r[0]:yj(r)}})(a):a,g=h?a:(e=>{if(e&&!mj(e))return{top:e,right:e,bottom:e,left:e}})(a),v=!isNaN(parseFloat(`${m?.width}`)),[b,x]=(0,c.useState)(!f),y=il(),w=(0,c.useMemo)((()=>y(Lw,t)),[y,t]),_=(0,c.useMemo)((()=>y(Nl("flex:1;",Mg({marginRight:"24px"})(),";",""))),[y]),S=(0,c.useMemo)((()=>y(Fw)),[y]);return{...d,className:w,colors:n,disableUnits:f&&!v,enableAlpha:o,enableStyle:i,hasMixedBorders:f,isLinked:b,linkedControlClassName:_,onLinkedChange:e=>{if(!e)return r(void 0);if(!f||(t=e)&&hj.every((e=>void 0!==t[e])))return r(mj(e)?void 0:e);var t;const n=((e,t)=>{const n={};return e.color!==t.color&&(n.color=t.color),e.style!==t.style&&(n.style=t.style),e.width!==t.width&&(n.width=t.width),n})(m,e),o={top:{...a?.top,...n},right:{...a?.right,...n},bottom:{...a?.bottom,...n},left:{...a?.left,...n}};if(bj(o))return r(o);const i=mj(o.top)?void 0:o.top;r(i)},onSplitChange:(e,t)=>{const n={...g,[t]:e};bj(n)?r(n):r(e)},toggleLinked:()=>x(!b),linkedValue:m,size:p,splitValue:g,wrapperClassName:S,__experimentalIsRenderedInSidebar:l}}const _j=e=>{const{label:t,hideLabelFromVision:n}=e;return t?n?(0,_t.jsx)(Sl,{as:"label",children:t}):(0,_t.jsx)(Ox,{children:t}):null},Sj=al(((e,t)=>{const{className:n,colors:r,disableCustomColors:o,disableUnits:i,enableAlpha:s,enableStyle:u,hasMixedBorders:d,hideLabelFromVision:p,isLinked:f,label:h,linkedControlClassName:m,linkedValue:g,onLinkedChange:v,onSplitChange:b,popoverPlacement:x,popoverOffset:y,size:w,splitValue:_,toggleLinked:S,wrapperClassName:C,__experimentalIsRenderedInSidebar:k,...j}=wj(e),[E,P]=(0,c.useState)(null),N=(0,c.useMemo)((()=>x?{placement:x,offset:y,anchor:E,shift:!0}:void 0),[x,y,E]),T=(0,l.useMergeRefs)([P,t]);return(0,_t.jsxs)(_l,{className:n,...j,ref:T,children:[(0,_t.jsx)(_j,{label:h,hideLabelFromVision:p}),(0,_t.jsxs)(_l,{className:C,children:[f?(0,_t.jsx)(ij,{className:m,colors:r,disableUnits:i,disableCustomColors:o,enableAlpha:s,enableStyle:u,onChange:v,placeholder:d?(0,a.__)("Mixed"):void 0,__unstablePopoverProps:N,shouldSanitizeBorder:!1,value:g,withSlider:!0,width:"__unstable-large"===w?"116px":"110px",__experimentalIsRenderedInSidebar:k,__shouldNotWarnDeprecated36pxSize:!0,size:w}):(0,_t.jsx)(dj,{colors:r,disableCustomColors:o,enableAlpha:s,enableStyle:u,onChange:b,popoverPlacement:x,popoverOffset:y,value:_,__experimentalIsRenderedInSidebar:k,size:w}),(0,_t.jsx)(Hw,{onClick:S,isLinked:f,size:w})]})]})}),"BorderBoxControl"),Cj=Sj,kj=(0,_t.jsxs)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,_t.jsx)(n.Path,{d:"m19 7.5h-7.628c-.3089-.87389-1.1423-1.5-2.122-1.5-.97966 0-1.81309.62611-2.12197 1.5h-2.12803v1.5h2.12803c.30888.87389 1.14231 1.5 2.12197 1.5.9797 0 1.8131-.62611 2.122-1.5h7.628z"}),(0,_t.jsx)(n.Path,{d:"m19 15h-2.128c-.3089-.8739-1.1423-1.5-2.122-1.5s-1.8131.6261-2.122 1.5h-7.628v1.5h7.628c.3089.8739 1.1423 1.5 2.122 1.5s1.8131-.6261 2.122-1.5h2.128z"})]}),jj={px:{max:300,step:1},"%":{max:100,step:1},vw:{max:100,step:1},vh:{max:100,step:1},em:{max:10,step:.1},rm:{max:10,step:.1},svw:{max:100,step:1},lvw:{max:100,step:1},dvw:{max:100,step:1},svh:{max:100,step:1},lvh:{max:100,step:1},dvh:{max:100,step:1},vi:{max:100,step:1},svi:{max:100,step:1},lvi:{max:100,step:1},dvi:{max:100,step:1},vb:{max:100,step:1},svb:{max:100,step:1},lvb:{max:100,step:1},dvb:{max:100,step:1},vmin:{max:100,step:1},svmin:{max:100,step:1},lvmin:{max:100,step:1},dvmin:{max:100,step:1},vmax:{max:100,step:1},svmax:{max:100,step:1},lvmax:{max:100,step:1},dvmax:{max:100,step:1}},Ej={all:(0,a.__)("All sides"),top:(0,a.__)("Top side"),bottom:(0,a.__)("Bottom side"),left:(0,a.__)("Left side"),right:(0,a.__)("Right side"),vertical:(0,a.__)("Top and bottom sides"),horizontal:(0,a.__)("Left and right sides")},Pj={top:void 0,right:void 0,bottom:void 0,left:void 0},Nj=["top","right","bottom","left"];function Tj(e={},t=Nj){const n=Mj(t);return n.some((t=>e[t]!==e[n[0]]))}function Ij(e){return e&&Object.values(e).filter((e=>!!e&&/\d/.test(e))).length>0}function Rj(e,t){let n="all";return e||(n=t?"vertical":"top"),n}function Mj(e){const t=[];if(!e?.length)return Nj;if(e.includes("vertical"))t.push("top","bottom");else if(e.includes("horizontal"))t.push("left","right");else{const n=Nj.filter((t=>e.includes(t)));t.push(...n)}return t}function Aj(e,t,n){Xi()("applyValueToSides",{since:"6.8",version:"7.0"});const r={...e};return n?.length?n.forEach((e=>{"vertical"===e?(r.top=t,r.bottom=t):"horizontal"===e?(r.left=t,r.right=t):r[e]=t})):Nj.forEach((e=>r[e]=t)),r}function Dj(e){const t=new Set(e?[]:Nj);return e?.forEach((e=>{"vertical"===e?(t.add("top"),t.add("bottom")):"horizontal"===e?(t.add("right"),t.add("left")):t.add(e)})),t}function zj(e,t){return e.startsWith(`var:preset|${t}|`)}const Oj=yl("span",{target:"e1j5nr4z8"})({name:"1w884gc",styles:"box-sizing:border-box;display:block;width:24px;height:24px;position:relative;padding:4px"}),Lj=yl("span",{target:"e1j5nr4z7"})({name:"i6vjox",styles:"box-sizing:border-box;display:block;position:relative;width:100%;height:100%"}),Fj=({isFocused:e})=>Nl({backgroundColor:"currentColor",opacity:e?1:.3},"",""),Bj=yl("span",{target:"e1j5nr4z6"})("box-sizing:border-box;display:block;pointer-events:none;position:absolute;",Fj,";"),Vj=yl(Bj,{target:"e1j5nr4z5"})({name:"1k2w39q",styles:"bottom:3px;top:3px;width:2px"}),$j=yl(Bj,{target:"e1j5nr4z4"})({name:"1q9b07k",styles:"height:2px;left:3px;right:3px"}),Hj=yl($j,{target:"e1j5nr4z3"})({name:"abcix4",styles:"top:0"}),Wj=yl(Vj,{target:"e1j5nr4z2"})({name:"1wf8jf",styles:"right:0"}),Uj=yl($j,{target:"e1j5nr4z1"})({name:"8tapst",styles:"bottom:0"}),Gj=yl(Vj,{target:"e1j5nr4z0"})({name:"1ode3cm",styles:"left:0"});function Kj({size:e=24,side:t="all",sides:n,...r}){const o=e=>!(e=>n?.length&&!n.includes(e))(e)&&("all"===t||t===e),i=o("top")||o("vertical"),s=o("right")||o("horizontal"),a=o("bottom")||o("vertical"),l=o("left")||o("horizontal"),c=e/24;return(0,_t.jsx)(Oj,{style:{transform:`scale(${c})`},...r,children:(0,_t.jsxs)(Lj,{children:[(0,_t.jsx)(Hj,{isFocused:i}),(0,_t.jsx)(Wj,{isFocused:s}),(0,_t.jsx)(Uj,{isFocused:a}),(0,_t.jsx)(Gj,{isFocused:l})]})})}const qj=yl(ej,{target:"e1jovhle5"})({name:"1ejyr19",styles:"max-width:90px"}),Yj=yl(fy,{target:"e1jovhle4"})({name:"1j1lmoi",styles:"grid-column:1/span 3"}),Xj=yl(Jx,{target:"e1jovhle3"})({name:"tkya7b",styles:"grid-area:1/2;justify-self:end"}),Zj=yl("div",{target:"e1jovhle2"})({name:"1dfa8al",styles:"grid-area:1/3;justify-self:end"}),Qj=yl(Kj,{target:"e1jovhle1"})({name:"ou8xsw",styles:"flex:0 0 auto"}),Jj=yl(ZS,{target:"e1jovhle0"})("width:100%;margin-inline-end:",Il(2),";"),eE=()=>{};function tE(e,t,n){const r=Dj(t);let o=[];switch(e){case"all":o=["top","bottom","left","right"];break;case"horizontal":o=["left","right"];break;case"vertical":o=["top","bottom"];break;default:o=[e]}if(n)switch(e){case"top":o.push("bottom");break;case"bottom":o.push("top");break;case"left":o.push("left");break;case"right":o.push("right")}return o.filter((e=>r.has(e)))}function nE({__next40pxDefaultSize:e,onChange:t=eE,onFocus:n=eE,values:r,selectedUnits:o,setSelectedUnits:i,sides:s,side:u,min:d=0,presets:p,presetKey:f,...h}){var m,g;const v=tE(u,s),b=e=>{t(e)},x=(e,t)=>{const n={...r},o=void 0!==e&&!isNaN(parseFloat(e))?e:void 0;tE(u,s,!!t?.event.altKey).forEach((e=>{n[e]=o})),b(n)},y=function(e={},t=Nj){const n=Mj(t);if(n.every((t=>e[t]===e[n[0]])))return e[n[0]]}(r,v),w=Ij(r),_=w&&v.length>1&&Tj(r,v),[S,C]=Kk(y),k=w?C:o[v[0]],j=[(0,l.useInstanceId)(nE,"box-control-input"),u].join("-"),E=v.length>1&&void 0===y&&v.some((e=>o[e]!==k)),P=void 0===y&&k?k:y,N=_||E?(0,a.__)("Mixed"):void 0,T=p&&p.length>0&&f,I=T&&void 0!==y&&!_&&zj(y,f),[R,M]=(0,c.useState)(!T||!I&&!_&&void 0!==y),A=I?function(e,t,n){if(!zj(e,t))return;const r=e.match(new RegExp(`^var:preset\\|${t}\\|(.+)$`));if(!r)return;const o=r[1],i=n.findIndex((e=>e.slug===o));return-1!==i?i:void 0}(y,f,p):void 0,D=T?[{value:0,label:"",tooltip:(0,a.__)("None")}].concat(p.map(((e,t)=>{var n;return{value:t+1,label:"",tooltip:null!==(n=e.name)&&void 0!==n?n:e.slug}}))):[];return(0,_t.jsxs)(Yj,{expanded:!0,children:[(0,_t.jsx)(Qj,{side:u,sides:s}),R&&(0,_t.jsxs)(_t.Fragment,{children:[(0,_t.jsx)(ss,{placement:"top-end",text:Ej[u],children:(0,_t.jsx)(qj,{...h,min:d,__shouldNotWarnDeprecated36pxSize:!0,__next40pxDefaultSize:e,className:"component-box-control__unit-control",id:j,isPressEnterToChange:!0,disableUnits:_||E,value:P,onChange:x,onUnitChange:e=>{const t={...o};v.forEach((n=>{t[n]=e})),i(t)},onFocus:e=>{n(e,{side:u})},label:Ej[u],placeholder:N,hideLabelFromVision:!0})}),(0,_t.jsx)(Jj,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:e,__shouldNotWarnDeprecated36pxSize:!0,"aria-controls":j,label:Ej[u],hideLabelFromVision:!0,onChange:e=>{x(void 0!==e?[e,k].join(""):void 0)},min:isFinite(d)?d:0,max:null!==(m=jj[null!=k?k:"px"]?.max)&&void 0!==m?m:10,step:null!==(g=jj[null!=k?k:"px"]?.step)&&void 0!==g?g:.1,value:null!=S?S:0,withInputField:!1})]}),T&&!R&&(0,_t.jsx)(Jj,{__next40pxDefaultSize:!0,className:"spacing-sizes-control__range-control",value:void 0!==A?A+1:0,onChange:e=>{const t=0===e||void 0===e?void 0:function(e,t,n){return`var:preset|${t}|${n[e].slug}`}(e-1,f,p);(e=>{const t={...r};v.forEach((n=>{t[n]=e})),b(t)})(t)},withInputField:!1,"aria-valuenow":void 0!==A?A+1:0,"aria-valuetext":D[void 0!==A?A+1:0].tooltip,renderTooltipContent:e=>D[e||0].tooltip,min:0,max:D.length-1,marks:D,label:Ej[u],hideLabelFromVision:!0,__nextHasNoMarginBottom:!0}),T&&(0,_t.jsx)(Jx,{label:R?(0,a.__)("Use size preset"):(0,a.__)("Set custom size"),icon:kj,onClick:()=>{M(!R)},isPressed:R,size:"small",iconSize:24})]},`box-control-${u}`)}function rE({isLinked:e,...t}){const n=e?(0,a.__)("Unlink sides"):(0,a.__)("Link sides");return(0,_t.jsx)(Jx,{...t,className:"component-box-control__linked-button",size:"small",icon:e?zw:Ow,iconSize:24,label:n})}const oE={min:0},iE=()=>{};function sE({__next40pxDefaultSize:e=!1,id:t,inputProps:n=oE,onChange:r=iE,label:o=(0,a.__)("Box Control"),values:i,units:s,sides:u,splitOnAxis:d=!1,allowReset:p=!0,resetValues:f=Pj,presets:h,presetKey:m,onMouseOver:g,onMouseOut:v}){const[b,x]=dS(i,{fallback:Pj}),y=b||Pj,w=Ij(i),_=1===u?.length,[S,C]=(0,c.useState)(w),[k,j]=(0,c.useState)(!w||!Tj(y)||_),[E,P]=(0,c.useState)(Rj(k,d)),[N,T]=(0,c.useState)({top:Kk(i?.top)[1],right:Kk(i?.right)[1],bottom:Kk(i?.bottom)[1],left:Kk(i?.left)[1]}),I=function(e){const t=(0,l.useInstanceId)(sE,"inspector-box-control");return e||t}(t),R=`${I}-heading`,M={onMouseOver:g,onMouseOut:v,...n,onChange:e=>{r(e),x(e),C(!0)},onFocus:(e,{side:t})=>{P(t)},isLinked:k,units:s,selectedUnits:N,setSelectedUnits:T,sides:u,values:y,__next40pxDefaultSize:e,presets:h,presetKey:m};Ux({componentName:"BoxControl",__next40pxDefaultSize:e,size:void 0});const A=Dj(u);if(h&&!m||!h&&m){}return(0,_t.jsxs)(lj,{id:I,columns:3,templateColumns:"1fr min-content min-content",role:"group","aria-labelledby":R,children:[(0,_t.jsx)(Hx.VisualLabel,{id:R,children:o}),k&&(0,_t.jsx)(Yj,{children:(0,_t.jsx)(nE,{side:"all",...M})}),!_&&(0,_t.jsx)(Zj,{children:(0,_t.jsx)(rE,{onClick:()=>{j(!k),P(Rj(!k,d))},isLinked:k})}),!k&&d&&["vertical","horizontal"].map((e=>(0,_t.jsx)(nE,{side:e,...M},e))),!k&&!d&&Array.from(A).map((e=>(0,_t.jsx)(nE,{side:e,...M},e))),p&&(0,_t.jsx)(Xj,{className:"component-box-control__reset-button",variant:"secondary",size:"small",onClick:()=>{r(f),x(f),T(f),C(!1)},disabled:!S,children:(0,a.__)("Reset")})]})}const aE=sE;const lE=(0,c.forwardRef)((function(e,t){const{className:n,__shouldNotWarnDeprecated:r,...o}=e,i=s("components-button-group",n);return r||Xi()("wp.components.ButtonGroup",{since:"6.8",alternative:"wp.components.__experimentalToggleGroupControl"}),(0,_t.jsx)("div",{ref:t,role:"group",className:i,...o})}));const cE={name:"12ip69d",styles:"background:transparent;display:block;margin:0!important;pointer-events:none;position:absolute;will-change:box-shadow"};function uE(e){return`0 ${e}px ${2*e}px 0\n\t${`rgba(0, 0, 0, ${e/20})`}`}const dE=al((function(e,t){const n=function(e){const{active:t,borderRadius:n="inherit",className:r,focus:o,hover:i,isInteractive:s=!1,offset:a=0,value:l=0,...u}=sl(e,"Elevation"),d=il();return{...u,className:(0,c.useMemo)((()=>{let e=Vg(i)?i:2*l,c=Vg(t)?t:l/2;s||(e=Vg(i)?i:void 0,c=Vg(t)?t:void 0);const u=`box-shadow ${Fl.transitionDuration} ${Fl.transitionTimingFunction}`,p={};return p.Base=Nl({borderRadius:n,bottom:a,boxShadow:uE(l),opacity:Fl.elevationIntensity,left:a,right:a,top:a},Nl("@media not ( prefers-reduced-motion ){transition:",u,";}",""),"",""),Vg(e)&&(p.hover=Nl("*:hover>&{box-shadow:",uE(e),";}","")),Vg(c)&&(p.active=Nl("*:active>&{box-shadow:",uE(c),";}","")),Vg(o)&&(p.focus=Nl("*:focus>&{box-shadow:",uE(o),";}","")),d(cE,p.Base,p.hover,p.focus,p.active,r)}),[t,n,r,d,o,i,s,a,l]),"aria-hidden":!0}}(e);return(0,_t.jsx)(_l,{...n,ref:t})}),"Elevation"),pE=dE;const fE=`calc(${Fl.radiusLarge} - 1px)`,hE=Nl("box-shadow:0 0 0 1px ",Fl.surfaceBorderColor,";outline:none;",""),mE={name:"1showjb",styles:"border-bottom:1px solid;box-sizing:border-box;&:last-child{border-bottom:none;}"},gE={name:"14n5oej",styles:"border-top:1px solid;box-sizing:border-box;&:first-of-type{border-top:none;}"},vE={name:"13udsys",styles:"height:100%"},bE={name:"6ywzd",styles:"box-sizing:border-box;height:auto;max-height:100%"},xE={name:"dq805e",styles:"box-sizing:border-box;overflow:hidden;&>img,&>iframe{display:block;height:auto;max-width:100%;width:100%;}"},yE={name:"c990dr",styles:"box-sizing:border-box;display:block;width:100%"},wE=Nl("&:first-of-type{border-top-left-radius:",fE,";border-top-right-radius:",fE,";}&:last-of-type{border-bottom-left-radius:",fE,";border-bottom-right-radius:",fE,";}",""),_E=Nl("border-color:",Fl.colorDivider,";",""),SE={name:"1t90u8d",styles:"box-shadow:none"},CE={name:"1e1ncky",styles:"border:none"},kE=Nl("border-radius:",fE,";",""),jE=Nl("padding:",Fl.cardPaddingXSmall,";",""),EE={large:Nl("padding:",Fl.cardPaddingLarge,";",""),medium:Nl("padding:",Fl.cardPaddingMedium,";",""),small:Nl("padding:",Fl.cardPaddingSmall,";",""),xSmall:jE,extraSmall:jE},PE=Nl("background-color:",zl.ui.backgroundDisabled,";",""),NE=Nl("background-color:",Fl.surfaceColor,";color:",zl.gray[900],";position:relative;","");Fl.surfaceBackgroundColor;function TE({borderBottom:e,borderLeft:t,borderRight:n,borderTop:r}){const o=`1px solid ${Fl.surfaceBorderColor}`;return Nl({borderBottom:e?o:void 0,borderLeft:t?o:void 0,borderRight:n?o:void 0,borderTop:r?o:void 0},"","")}const IE=Nl("",""),RE=Nl("background:",Fl.surfaceBackgroundTintColor,";",""),ME=Nl("background:",Fl.surfaceBackgroundTertiaryColor,";",""),AE=e=>[e,e].join(" "),DE=e=>["90deg",[Fl.surfaceBackgroundColor,e].join(" "),"transparent 1%"].join(","),zE=e=>[[Fl.surfaceBackgroundColor,e].join(" "),"transparent 1%"].join(","),OE=(e,t)=>Nl("background:",(e=>[`linear-gradient( ${DE(e)} ) center`,`linear-gradient( ${zE(e)} ) center`,Fl.surfaceBorderBoldColor].join(","))(t),";background-size:",AE(e),";",""),LE=[`linear-gradient( ${[`${Fl.surfaceBorderSubtleColor} 1px`,"transparent 1px"].join(",")} )`,`linear-gradient( ${["90deg",`${Fl.surfaceBorderSubtleColor} 1px`,"transparent 1px"].join(",")} )`].join(","),FE=(e,t,n)=>{switch(e){case"dotted":return OE(t,n);case"grid":return(e=>Nl("background:",Fl.surfaceBackgroundColor,";background-image:",LE,";background-size:",AE(e),";",""))(t);case"primary":return IE;case"secondary":return RE;case"tertiary":return ME}};function BE(e){const{backgroundSize:t=12,borderBottom:n=!1,borderLeft:r=!1,borderRight:o=!1,borderTop:i=!1,className:s,variant:a="primary",...l}=sl(e,"Surface"),u=il();return{...l,className:(0,c.useMemo)((()=>{const e={borders:TE({borderBottom:n,borderLeft:r,borderRight:o,borderTop:i})};return u(NE,e.borders,FE(a,`${t}px`,t-1+"px"),s)}),[t,n,r,o,i,s,u,a])}}function VE(e){const{className:t,elevation:n=0,isBorderless:r=!1,isRounded:o=!0,size:i="medium",...s}=sl(function({elevation:e,isElevated:t,...n}){const r={...n};let o=e;var i;return t&&(Xi()("Card isElevated prop",{since:"5.9",alternative:"elevation"}),null!==(i=o)&&void 0!==i||(o=2)),void 0!==o&&(r.elevation=o),r}(e),"Card"),a=il();return{...BE({...s,className:(0,c.useMemo)((()=>a(hE,r&&SE,o&&kE,t)),[t,a,r,o])}),elevation:n,isBorderless:r,isRounded:o,size:i}}const $E=al((function(e,t){const{children:n,elevation:r,isBorderless:o,isRounded:i,size:s,...a}=VE(e),l=i?Fl.radiusLarge:0,u=il(),d=(0,c.useMemo)((()=>u(Nl({borderRadius:l},"",""))),[u,l]),p=(0,c.useMemo)((()=>{const e={size:s,isBorderless:o};return{CardBody:e,CardHeader:e,CardFooter:e}}),[o,s]);return(0,_t.jsx)(gs,{value:p,children:(0,_t.jsxs)(_l,{...a,ref:t,children:[(0,_t.jsx)(_l,{className:u(vE),children:n}),(0,_t.jsx)(pE,{className:d,isInteractive:!1,value:r?1:0}),(0,_t.jsx)(pE,{className:d,isInteractive:!1,value:r})]})})}),"Card"),HE=$E;const WE=Nl("@media only screen and ( min-device-width: 40em ){&::-webkit-scrollbar{height:12px;width:12px;}&::-webkit-scrollbar-track{background-color:transparent;}&::-webkit-scrollbar-track{background:",Fl.colorScrollbarTrack,";border-radius:8px;}&::-webkit-scrollbar-thumb{background-clip:padding-box;background-color:",Fl.colorScrollbarThumb,";border:2px solid rgba( 0, 0, 0, 0 );border-radius:7px;}&:hover::-webkit-scrollbar-thumb{background-color:",Fl.colorScrollbarThumbHover,";}}",""),UE={name:"13udsys",styles:"height:100%"},GE={name:"7zq9w",styles:"scroll-behavior:smooth"},KE={name:"q33xhg",styles:"overflow-x:auto;overflow-y:hidden"},qE={name:"103x71s",styles:"overflow-x:hidden;overflow-y:auto"},YE={name:"umwchj",styles:"overflow-y:auto"};const XE=al((function(e,t){const n=function(e){const{className:t,scrollDirection:n="y",smoothScroll:r=!1,...o}=sl(e,"Scrollable"),i=il();return{...o,className:(0,c.useMemo)((()=>i(UE,WE,r&&GE,"x"===n&&KE,"y"===n&&qE,"auto"===n&&YE,t)),[t,i,n,r])}}(e);return(0,_t.jsx)(_l,{...n,ref:t})}),"Scrollable"),ZE=XE;const QE=al((function(e,t){const{isScrollable:n,...r}=function(e){const{className:t,isScrollable:n=!1,isShady:r=!1,size:o="medium",...i}=sl(e,"CardBody"),s=il();return{...i,className:(0,c.useMemo)((()=>s(bE,wE,EE[o],r&&PE,"components-card__body",t)),[t,s,r,o]),isScrollable:n}}(e);return n?(0,_t.jsx)(ZE,{...r,ref:t}):(0,_t.jsx)(_l,{...r,ref:t})}),"CardBody"),JE=QE;var eP=jt((function(e){var t=e,{orientation:n="horizontal"}=t,r=x(t,["orientation"]);return r=v({role:"separator","aria-orientation":n},r)})),tP=St((function(e){return kt("hr",eP(e))}));const nP={vertical:{start:"marginLeft",end:"marginRight"},horizontal:{start:"marginTop",end:"marginBottom"}},rP=({"aria-orientation":e="horizontal",margin:t,marginStart:n,marginEnd:r})=>Nl(Mg({[nP[e].start]:Il(null!=n?n:t),[nP[e].end]:Il(null!=r?r:t)})(),"","");var oP={name:"1u4hpl4",styles:"display:inline"};const iP=({"aria-orientation":e="horizontal"})=>"vertical"===e?oP:void 0,sP=({"aria-orientation":e="horizontal"})=>Nl({["vertical"===e?"borderRight":"borderBottom"]:"1px solid currentColor"},"",""),aP=({"aria-orientation":e="horizontal"})=>Nl({height:"vertical"===e?"auto":0,width:"vertical"===e?0:"auto"},"",""),lP=yl("hr",{target:"e19on6iw0"})("border:0;margin:0;",iP," ",sP," ",aP," ",rP,";");const cP=al((function(e,t){const n=sl(e,"Divider");return(0,_t.jsx)(tP,{render:(0,_t.jsx)(lP,{}),...n,ref:t})}),"Divider");const uP=al((function(e,t){const n=function(e){const{className:t,...n}=sl(e,"CardDivider"),r=il();return{...n,className:(0,c.useMemo)((()=>r(yE,_E,"components-card__divider",t)),[t,r])}}(e);return(0,_t.jsx)(cP,{...n,ref:t})}),"CardDivider"),dP=uP;const pP=al((function(e,t){const n=function(e){const{className:t,justify:n,isBorderless:r=!1,isShady:o=!1,size:i="medium",...s}=sl(e,"CardFooter"),a=il();return{...s,className:(0,c.useMemo)((()=>a(gE,wE,_E,EE[i],r&&CE,o&&PE,"components-card__footer",t)),[t,a,r,o,i]),justify:n}}(e);return(0,_t.jsx)(kg,{...n,ref:t})}),"CardFooter"),fP=pP;const hP=al((function(e,t){const n=function(e){const{className:t,isBorderless:n=!1,isShady:r=!1,size:o="medium",...i}=sl(e,"CardHeader"),s=il();return{...i,className:(0,c.useMemo)((()=>s(mE,wE,_E,EE[o],n&&CE,r&&PE,"components-card__header",t)),[t,s,n,r,o])}}(e);return(0,_t.jsx)(kg,{...n,ref:t})}),"CardHeader"),mP=hP;const gP=al((function(e,t){const n=function(e){const{className:t,...n}=sl(e,"CardMedia"),r=il();return{...n,className:(0,c.useMemo)((()=>r(xE,wE,"components-card__media",t)),[t,r])}}(e);return(0,_t.jsx)(_l,{...n,ref:t})}),"CardMedia"),vP=gP;const bP=function e(t){const{__nextHasNoMarginBottom:n,label:r,className:o,heading:i,checked:a,indeterminate:u,help:d,id:p,onChange:f,...h}=t;i&&Xi()("`heading` prop in `CheckboxControl`",{alternative:"a separate element to implement a heading",since:"5.8"});const[m,g]=(0,c.useState)(!1),[v,b]=(0,c.useState)(!1),x=(0,l.useRefEffect)((e=>{e&&(e.indeterminate=!!u,g(e.matches(":checked")),b(e.matches(":indeterminate")))}),[a,u]),y=(0,l.useInstanceId)(e,"inspector-checkbox-control",p);return(0,_t.jsx)(Wx,{__nextHasNoMarginBottom:n,__associatedWPComponentName:"CheckboxControl",label:i,id:y,help:d&&(0,_t.jsx)("span",{className:"components-checkbox-control__help",children:d}),className:s("components-checkbox-control",o),children:(0,_t.jsxs)(fy,{spacing:0,justify:"start",alignment:"top",children:[(0,_t.jsxs)("span",{className:"components-checkbox-control__input-container",children:[(0,_t.jsx)("input",{ref:x,id:y,className:"components-checkbox-control__input",type:"checkbox",value:"1",onChange:e=>f(e.target.checked),checked:a,"aria-describedby":d?y+"__help":void 0,...h}),v?(0,_t.jsx)(oS,{icon:Lg,className:"components-checkbox-control__indeterminate",role:"presentation"}):null,m?(0,_t.jsx)(oS,{icon:ok,className:"components-checkbox-control__checked",role:"presentation"}):null]}),r&&(0,_t.jsx)("label",{className:"components-checkbox-control__label",htmlFor:y,children:r})]})})},xP=4e3;function yP({className:e,children:t,onCopy:n,onFinishCopy:r,text:o,...i}){Xi()("wp.components.ClipboardButton",{since:"5.8",alternative:"wp.compose.useCopyToClipboard"});const a=(0,c.useRef)(),u=(0,l.useCopyToClipboard)(o,(()=>{n(),a.current&&clearTimeout(a.current),r&&(a.current=setTimeout((()=>r()),xP))}));(0,c.useEffect)((()=>()=>{a.current&&clearTimeout(a.current)}),[]);const d=s("components-clipboard-button",e);return(0,_t.jsx)(Jx,{...i,className:d,ref:u,onCopy:e=>{e.target.focus()},children:t})}const wP=(0,_t.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_t.jsx)(n.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"})});const _P={name:"1bcj5ek",styles:"width:100%;display:block"},SP={name:"150ruhm",styles:"box-sizing:border-box;width:100%;display:block;margin:0;color:inherit"},CP=Nl("border:1px solid ",Fl.surfaceBorderColor,";",""),kP=Nl(">*:not( marquee )>*{border-bottom:1px solid ",Fl.surfaceBorderColor,";}>*:last-of-type>*:not( :focus ){border-bottom-color:transparent;}",""),jP=Fl.radiusSmall,EP=Nl("border-radius:",jP,";",""),PP=Nl("border-radius:",jP,";>*:first-of-type>*{border-top-left-radius:",jP,";border-top-right-radius:",jP,";}>*:last-of-type>*{border-bottom-left-radius:",jP,";border-bottom-right-radius:",jP,";}",""),NP=`calc(${Fl.fontSize} * ${Fl.fontLineHeightBase})`,TP=`calc((${Fl.controlHeight} - ${NP} - 2px) / 2)`,IP=`calc((${Fl.controlHeightSmall} - ${NP} - 2px) / 2)`,RP=`calc((${Fl.controlHeightLarge} - ${NP} - 2px) / 2)`,MP={small:Nl("padding:",IP," ",Fl.controlPaddingXSmall,"px;",""),medium:Nl("padding:",TP," ",Fl.controlPaddingX,"px;",""),large:Nl("padding:",RP," ",Fl.controlPaddingXLarge,"px;","")},AP=(0,c.createContext)({size:"medium"}),DP=()=>(0,c.useContext)(AP);function zP(e){const{as:t,className:n,onClick:r,role:o="listitem",size:i,...s}=sl(e,"Item"),{spacedAround:a,size:l}=DP(),u=i||l,d=t||(void 0!==r?"button":"div"),p=il(),f=(0,c.useMemo)((()=>p(("button"===d||"a"===d)&&(e=>Nl("font-size:",Ix("default.fontSize"),";font-family:inherit;appearance:none;border:1px solid transparent;cursor:pointer;background:none;text-align:start;text-decoration:","a"===e?"none":void 0,";svg,path{fill:currentColor;}&:hover{color:",zl.theme.accent,";}&:focus{box-shadow:none;outline:none;}&:focus-visible{box-shadow:0 0 0 var( --wp-admin-border-width-focus ) ",zl.theme.accent,";outline:2px solid transparent;outline-offset:0;}",""))(d),MP[u]||MP.medium,SP,a&&EP,n)),[d,n,p,u,a]),h=p(_P);return{as:d,className:f,onClick:r,wrapperClassName:h,role:o,...s}}const OP=al((function(e,t){const{role:n,wrapperClassName:r,...o}=zP(e);return(0,_t.jsx)("div",{role:n,className:r,children:(0,_t.jsx)(_l,{...o,ref:t})})}),"Item");const LP=al((function(e,t){const{isBordered:n,isSeparated:r,size:o,...i}=function(e){const{className:t,isBordered:n=!1,isRounded:r=!0,isSeparated:o=!1,role:i="list",...s}=sl(e,"ItemGroup");return{isBordered:n,className:il()(n&&CP,o&&kP,r&&PP,t),role:i,isSeparated:o,...s}}(e),{size:s}=DP(),a={spacedAround:!n&&!r,size:o||s};return(0,_t.jsx)(AP.Provider,{value:a,children:(0,_t.jsx)(_l,{...i,ref:t})})}),"ItemGroup");function FP(e){return Math.max(0,Math.min(100,e))}function BP(e,t,n){const r=e.slice();return r[t]=n,r}function VP(e,t,n){if(function(e,t,n,r=0){const o=e[t].position,i=Math.min(o,n),s=Math.max(o,n);return e.some((({position:e},o)=>o!==t&&(Math.abs(e-n)({placement:"bottom",offset:8,resize:!1})),[]),o=s("components-custom-gradient-picker__control-point-dropdown",t);return(0,_t.jsx)(Sk,{isRenderedInSidebar:e,popoverProps:r,className:o,...n})}function GP({disableRemove:e,disableAlpha:t,gradientPickerDomRef:n,ignoreMarkerPosition:r,value:o,onChange:i,onStartControlPointChange:s,onStopControlPointChange:l,__experimentalIsRenderedInSidebar:u}){const d=(0,c.useRef)(),p=e=>{if(void 0===d.current||null===n.current)return;const t=HP(e.clientX,n.current),{initialPosition:r,index:s,significantMoveHappened:a}=d.current;!a&&Math.abs(r-t)>=5&&(d.current.significantMoveHappened=!0),i(VP(o,s,t))},f=()=>{window&&window.removeEventListener&&d.current&&d.current.listenersActivated&&(window.removeEventListener("mousemove",p),window.removeEventListener("mouseup",f),l(),d.current.listenersActivated=!1)},h=(0,c.useRef)();return h.current=f,(0,c.useEffect)((()=>()=>{h.current?.()}),[]),(0,_t.jsx)(_t.Fragment,{children:o.map(((n,c)=>{const h=n?.position;return r!==h&&(0,_t.jsx)(UP,{isRenderedInSidebar:u,onClose:l,renderToggle:({isOpen:e,onToggle:t})=>(0,_t.jsx)(WP,{onClick:()=>{d.current&&d.current.significantMoveHappened||(e?l():s(),t())},onMouseDown:()=>{window&&window.addEventListener&&(d.current={initialPosition:h,index:c,significantMoveHappened:!1,listenersActivated:!0},s(),window.addEventListener("mousemove",p),window.addEventListener("mouseup",f))},onKeyDown:e=>{"ArrowLeft"===e.code?(e.stopPropagation(),i(VP(o,c,FP(n.position-10)))):"ArrowRight"===e.code&&(e.stopPropagation(),i(VP(o,c,FP(n.position+10))))},isOpen:e,position:n.position,color:n.color},c),renderContent:({onClose:r})=>(0,_t.jsxs)(bk,{paddingSize:"none",children:[(0,_t.jsx)(nk,{enableAlpha:!t,color:n.color,onChange:e=>{i($P(o,c,yv(e).toRgbString()))}}),!e&&o.length>2&&(0,_t.jsx)(fy,{className:"components-custom-gradient-picker__remove-control-point-wrapper",alignment:"center",children:(0,_t.jsx)(Jx,{onClick:()=>{i(function(e,t){return e.filter(((e,n)=>n!==t))}(o,c)),r()},variant:"link",children:(0,a.__)("Remove Control Point")})})]}),style:{left:`${n.position}%`,transform:"translateX( -50% )"}},c)}))})}GP.InsertPoint=function({value:e,onChange:t,onOpenInserter:n,onCloseInserter:r,insertPosition:o,disableAlpha:i,__experimentalIsRenderedInSidebar:s}){const[a,l]=(0,c.useState)(!1);return(0,_t.jsx)(UP,{isRenderedInSidebar:s,className:"components-custom-gradient-picker__inserter",onClose:()=>{r()},renderToggle:({isOpen:e,onToggle:t})=>(0,_t.jsx)(Jx,{__next40pxDefaultSize:!0,"aria-expanded":e,"aria-haspopup":"true",onClick:()=>{e?r():(l(!1),n()),t()},className:"components-custom-gradient-picker__insert-point-dropdown",icon:Og}),renderContent:()=>(0,_t.jsx)(bk,{paddingSize:"none",children:(0,_t.jsx)(nk,{enableAlpha:!i,onChange:n=>{a?t(function(e,t,n){const r=e.findIndex((e=>e.position===t));return $P(e,r,n)}(e,o,yv(n).toRgbString())):(t(function(e,t,n){const r=e.findIndex((e=>e.position>t)),o={color:n,position:t},i=e.slice();return i.splice(r-1,0,o),i}(e,o,yv(n).toRgbString())),l(!0))}})}),style:null!==o?{left:`${o}%`,transform:"translateX( -50% )"}:void 0})};const KP=GP,qP=(e,t)=>{switch(t.type){case"MOVE_INSERTER":if("IDLE"===e.id||"MOVING_INSERTER"===e.id)return{id:"MOVING_INSERTER",insertPosition:t.insertPosition};break;case"STOP_INSERTER_MOVE":if("MOVING_INSERTER"===e.id)return{id:"IDLE"};break;case"OPEN_INSERTER":if("MOVING_INSERTER"===e.id)return{id:"INSERTING_CONTROL_POINT",insertPosition:e.insertPosition};break;case"CLOSE_INSERTER":if("INSERTING_CONTROL_POINT"===e.id)return{id:"IDLE"};break;case"START_CONTROL_CHANGE":if("IDLE"===e.id)return{id:"MOVING_CONTROL_POINT"};break;case"STOP_CONTROL_CHANGE":if("MOVING_CONTROL_POINT"===e.id)return{id:"IDLE"}}return e},YP={id:"IDLE"};function XP({background:e,hasGradient:t,value:n,onChange:r,disableInserter:o=!1,disableAlpha:i=!1,__experimentalIsRenderedInSidebar:a=!1}){const l=(0,c.useRef)(null),[u,d]=(0,c.useReducer)(qP,YP),p=e=>{if(!l.current)return;const t=HP(e.clientX,l.current);n.some((({position:e})=>Math.abs(t-e)<10))?"MOVING_INSERTER"===u.id&&d({type:"STOP_INSERTER_MOVE"}):d({type:"MOVE_INSERTER",insertPosition:t})},f="MOVING_INSERTER"===u.id,h="INSERTING_CONTROL_POINT"===u.id;return(0,_t.jsxs)("div",{className:s("components-custom-gradient-picker__gradient-bar",{"has-gradient":t}),onMouseEnter:p,onMouseMove:p,onMouseLeave:()=>{d({type:"STOP_INSERTER_MOVE"})},children:[(0,_t.jsx)("div",{className:"components-custom-gradient-picker__gradient-bar-background",style:{background:e,opacity:t?1:.4}}),(0,_t.jsxs)("div",{ref:l,className:"components-custom-gradient-picker__markers-container",children:[!o&&(f||h)&&(0,_t.jsx)(KP.InsertPoint,{__experimentalIsRenderedInSidebar:a,disableAlpha:i,insertPosition:u.insertPosition,value:n,onChange:r,onOpenInserter:()=>{d({type:"OPEN_INSERTER"})},onCloseInserter:()=>{d({type:"CLOSE_INSERTER"})}}),(0,_t.jsx)(KP,{__experimentalIsRenderedInSidebar:a,disableAlpha:i,disableRemove:o,gradientPickerDomRef:l,ignoreMarkerPosition:h?u.insertPosition:void 0,value:n,onChange:r,onStartControlPointChange:()=>{d({type:"START_CONTROL_CHANGE"})},onStopControlPointChange:()=>{d({type:"STOP_CONTROL_CHANGE"})}})]})]})}var ZP=o(8924);const QP="linear-gradient(135deg, rgba(6, 147, 227, 1) 0%, rgb(155, 81, 224) 100%)",JP={type:"angular",value:"90"},eN=[{value:"linear-gradient",label:(0,a.__)("Linear")},{value:"radial-gradient",label:(0,a.__)("Radial")}],tN={top:0,"top right":45,"right top":45,right:90,"right bottom":135,"bottom right":135,bottom:180,"bottom left":225,"left bottom":225,left:270,"top left":315,"left top":315};function nN({type:e,value:t,length:n}){return`${function({type:e,value:t}){return"literal"===e?t:"hex"===e?`#${t}`:`${e}(${t.join(",")})`}({type:e,value:t})} ${function(e){if(!e)return"";const{value:t,type:n}=e;return`${t}${n}`}(n)}`}function rN({type:e,orientation:t,colorStops:n}){const r=function(e){if(!Array.isArray(e)&&e&&"angular"===e.type)return`${e.value}deg`}(t);return`${e}(${[r,...n.sort(((e,t)=>{const n=e=>void 0===e?.length?.value?0:parseInt(e.length.value);return n(e)-n(t)})).map(nN)].filter(Boolean).join(",")})`}function oN(e){return void 0===e.length||"%"!==e.length.type}function iN(e){switch(e.type){case"hex":return`#${e.value}`;case"literal":return e.value;case"rgb":case"rgba":return`${e.type}(${e.value.join(",")})`;default:return"transparent"}}_v([Sv]);const sN=yl(Eg,{target:"e10bzpgi1"})({name:"1gvx10y",styles:"flex-grow:5"}),aN=yl(Eg,{target:"e10bzpgi0"})({name:"1gvx10y",styles:"flex-grow:5"}),lN=({gradientAST:e,hasGradient:t,onChange:n})=>{var r;const o=null!==(r=e?.orientation?.value)&&void 0!==r?r:180;return(0,_t.jsx)(_y,{onChange:t=>{n(rN({...e,orientation:{type:"angular",value:`${t}`}}))},value:t?o:""})},cN=({gradientAST:e,hasGradient:t,onChange:n})=>{const{type:r}=e;return(0,_t.jsx)(cS,{__nextHasNoMarginBottom:!0,className:"components-custom-gradient-picker__type-picker",label:(0,a.__)("Type"),labelPosition:"top",onChange:t=>{"linear-gradient"===t&&n(rN({...e,orientation:e.orientation?void 0:JP,type:"linear-gradient"})),"radial-gradient"===t&&(()=>{const{orientation:t,...r}=e;n(rN({...r,type:"radial-gradient"}))})()},options:eN,size:"__unstable-large",value:t?r:void 0})};const uN=function({value:e,onChange:t,enableAlpha:n=!0,__experimentalIsRenderedInSidebar:r=!1}){const{gradientAST:o,hasGradient:i}=function(e){let t,n=!!e;const r=null!=e?e:QP;try{t=ZP.parse(r)[0]}catch(e){console.warn("wp.components.CustomGradientPicker failed to parse the gradient with error",e),t=ZP.parse(QP)[0],n=!1}if(Array.isArray(t.orientation)||"directional"!==t.orientation?.type||(t.orientation={type:"angular",value:tN[t.orientation.value].toString()}),t.colorStops.some(oN)){const{colorStops:e}=t,n=100/(e.length-1);e.forEach(((e,t)=>{e.length={value:""+n*t,type:"%"}}))}return{gradientAST:t,hasGradient:n}}(e),s=function(e){return rN({type:"linear-gradient",orientation:JP,colorStops:e.colorStops})}(o),a=o.colorStops.map((e=>({color:iN(e),position:parseInt(e.length.value)})));return(0,_t.jsxs)(dk,{spacing:4,className:"components-custom-gradient-picker",children:[(0,_t.jsx)(XP,{__experimentalIsRenderedInSidebar:r,disableAlpha:!n,background:s,hasGradient:i,value:a,onChange:e=>{t(rN(function(e,t){return{...e,colorStops:t.map((({position:e,color:t})=>{const{r:n,g:r,b:o,a:i}=yv(t).toRgb();return{length:{type:"%",value:e?.toString()},type:i<1?"rgba":"rgb",value:i<1?[`${n}`,`${r}`,`${o}`,`${i}`]:[`${n}`,`${r}`,`${o}`]}}))}}(o,e)))}}),(0,_t.jsxs)(kg,{gap:3,className:"components-custom-gradient-picker__ui-line",children:[(0,_t.jsx)(sN,{children:(0,_t.jsx)(cN,{gradientAST:o,hasGradient:i,onChange:t})}),(0,_t.jsx)(aN,{children:"linear-gradient"===o.type&&(0,_t.jsx)(lN,{gradientAST:o,hasGradient:i,onChange:t})})]})]})},dN=e=>e.length>0&&e.every((e=>{return t=e,Array.isArray(t.gradients)&&!("gradient"in t);var t}));function pN({className:e,clearGradient:t,gradients:n,onChange:r,value:o,...i}){const s=(0,c.useMemo)((()=>n.map((({gradient:e,name:n,slug:i},s)=>(0,_t.jsx)(uk.Option,{value:e,isSelected:o===e,tooltipText:n||(0,a.sprintf)((0,a.__)("Gradient code: %s"),e),style:{color:"rgba( 0,0,0,0 )",background:e},onClick:o===e?t:()=>r(e,s),"aria-label":n?(0,a.sprintf)((0,a.__)("Gradient: %s"),n):(0,a.sprintf)((0,a.__)("Gradient code: %s"),e)},i)))),[n,o,r,t]);return(0,_t.jsx)(uk.OptionGroup,{className:e,options:s,...i})}function fN({className:e,clearGradient:t,gradients:n,onChange:r,value:o,headingLevel:i}){const s=(0,l.useInstanceId)(fN);return(0,_t.jsx)(dk,{spacing:3,className:e,children:n.map((({name:e,gradients:n},a)=>{const l=`color-palette-${s}-${a}`;return(0,_t.jsxs)(dk,{spacing:2,children:[(0,_t.jsx)(mk,{level:i,id:l,children:e}),(0,_t.jsx)(pN,{clearGradient:t,gradients:n,onChange:e=>r(e,a),value:o,"aria-labelledby":l})]},a)}))})}function hN(e){const{asButtons:t,loop:n,actions:r,headingLevel:o,"aria-label":i,"aria-labelledby":s,...l}=e,c=dN(e.gradients)?(0,_t.jsx)(fN,{headingLevel:o,...l}):(0,_t.jsx)(pN,{...l});let u;if(t)u={asButtons:!0};else{const e={asButtons:!1,loop:n};u=i?{...e,"aria-label":i}:s?{...e,"aria-labelledby":s}:{...e,"aria-label":(0,a.__)("Custom color picker.")}}return(0,_t.jsx)(uk,{...u,actions:r,options:c})}const mN=function({className:e,gradients:t=[],onChange:n,value:r,clearable:o=!0,enableAlpha:i=!0,disableCustomGradients:s=!1,__experimentalIsRenderedInSidebar:l,headingLevel:u=2,...d}){const p=(0,c.useCallback)((()=>n(void 0)),[n]);return(0,_t.jsxs)(dk,{spacing:t.length?4:0,children:[!s&&(0,_t.jsx)(uN,{__experimentalIsRenderedInSidebar:l,enableAlpha:i,value:r,onChange:n}),(t.length>0||o)&&(0,_t.jsx)(hN,{...d,className:e,clearGradient:p,gradients:t,onChange:n,value:r,actions:o&&!s&&(0,_t.jsx)(uk.ButtonAction,{onClick:p,accessibleWhenDisabled:!0,disabled:!r,children:(0,a.__)("Clear")}),headingLevel:u})]})},gN=(0,_t.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_t.jsx)(n.Path,{d:"M5 5v1.5h14V5H5zm0 7.8h14v-1.5H5v1.5zM5 19h14v-1.5H5V19z"})}),vN=window.wp.dom,bN=()=>{},xN=["menuitem","menuitemradio","menuitemcheckbox"];class yN extends c.Component{constructor(e){super(e),this.onKeyDown=this.onKeyDown.bind(this),this.bindContainer=this.bindContainer.bind(this),this.getFocusableContext=this.getFocusableContext.bind(this),this.getFocusableIndex=this.getFocusableIndex.bind(this)}componentDidMount(){this.container&&this.container.addEventListener("keydown",this.onKeyDown)}componentWillUnmount(){this.container&&this.container.removeEventListener("keydown",this.onKeyDown)}bindContainer(e){const{forwardedRef:t}=this.props;this.container=e,"function"==typeof t?t(e):t&&"current"in t&&(t.current=e)}getFocusableContext(e){if(!this.container)return null;const{onlyBrowserTabstops:t}=this.props,n=(t?vN.focus.tabbable:vN.focus.focusable).find(this.container),r=this.getFocusableIndex(n,e);return r>-1&&e?{index:r,target:e,focusables:n}:null}getFocusableIndex(e,t){return e.indexOf(t)}onKeyDown(e){this.props.onKeyDown&&this.props.onKeyDown(e);const{getFocusableContext:t}=this,{cycle:n=!0,eventToOffset:r,onNavigate:o=bN,stopNavigationEvents:i}=this.props,s=r(e);if(void 0!==s&&i){e.stopImmediatePropagation();const t=e.target?.getAttribute("role");!!t&&xN.includes(t)&&e.preventDefault()}if(!s)return;const a=e.target?.ownerDocument?.activeElement;if(!a)return;const l=t(a);if(!l)return;const{index:c,focusables:u}=l,d=n?function(e,t,n){const r=e+n;return r<0?t+r:r>=t?r-t:r}(c,u.length,s):c+s;d>=0&&d(0,_t.jsx)(yN,{...e,forwardedRef:t});wN.displayName="NavigableContainer";const _N=(0,c.forwardRef)(wN);const SN=(0,c.forwardRef)((function({role:e="menu",orientation:t="vertical",...n},r){return(0,_t.jsx)(_N,{ref:r,stopNavigationEvents:!0,onlyBrowserTabstops:!1,role:e,"aria-orientation":"presentation"===e||"vertical"!==t&&"horizontal"!==t?void 0:t,eventToOffset:e=>{const{code:n}=e;let r=["ArrowDown"],o=["ArrowUp"];return"horizontal"===t&&(r=["ArrowRight"],o=["ArrowLeft"]),"both"===t&&(r=["ArrowRight","ArrowDown"],o=["ArrowLeft","ArrowUp"]),r.includes(n)?1:o.includes(n)?-1:["ArrowDown","ArrowUp","ArrowLeft","ArrowRight"].includes(n)?0:void 0},...n})})),CN=SN;function kN(e={},t={}){const n={...e,...t};return t.className&&e.className&&(n.className=s(t.className,e.className)),n}function jN(e){return"function"==typeof e}const EN=ll((function(e){const{children:t,className:n,controls:r,icon:o=gN,label:i,popoverProps:a,toggleProps:l,menuProps:c,disableOpenOnArrowDown:u=!1,text:d,noIcons:p,open:f,defaultOpen:h,onToggle:m,variant:g}=sl(e,"DropdownMenu");if(!r?.length&&!jN(t))return null;let v;r?.length&&(v=r,Array.isArray(v[0])||(v=[r]));const b=kN({className:"components-dropdown-menu__popover",variant:g},a);return(0,_t.jsx)(W_,{className:n,popoverProps:b,renderToggle:({isOpen:e,onToggle:t})=>{var n;const{as:r=Jx,...a}=null!=l?l:{},c=kN({className:s("components-dropdown-menu__toggle",{"is-opened":e})},a);return(0,_t.jsx)(r,{...c,icon:o,onClick:e=>{t(),c.onClick&&c.onClick(e)},onKeyDown:n=>{(n=>{u||e||"ArrowDown"!==n.code||(n.preventDefault(),t())})(n),c.onKeyDown&&c.onKeyDown(n)},"aria-haspopup":"true","aria-expanded":e,label:i,text:d,showTooltip:null===(n=l?.showTooltip)||void 0===n||n,children:c.children})},renderContent:e=>{const n=kN({"aria-label":i,className:s("components-dropdown-menu__menu",{"no-icons":p})},c);return(0,_t.jsxs)(CN,{...n,role:"menu",children:[jN(t)?t(e):null,v?.flatMap(((t,n)=>t.map(((t,r)=>(0,_t.jsx)(Jx,{__next40pxDefaultSize:!0,onClick:n=>{n.stopPropagation(),e.onClose(),t.onClick&&t.onClick()},className:s("components-dropdown-menu__menu-item",{"has-separator":n>0&&0===r,"is-active":t.isActive,"is-icon-only":!t.title}),icon:t.icon,label:t.label,"aria-checked":"menuitemcheckbox"===t.role||"menuitemradio"===t.role?t.isActive:void 0,role:"menuitemcheckbox"===t.role||"menuitemradio"===t.role?t.role:"menuitem",accessibleWhenDisabled:!0,disabled:t.isDisabled,children:t.title},[n,r].join())))))]})},open:f,defaultOpen:h,onToggle:m})}),"DropdownMenu"),PN=EN;const NN=yl(F_,{target:"e1lpqc908"})("&&{flex-shrink:0;width:",Il(6),";height:",Il(6),";}"),TN=yl(qx,{target:"e1lpqc907"})(Qv,"{background:",zl.gray[100],";border-radius:",Fl.radiusXSmall,";",ib,ib,ib,ib,"{height:",Il(8),";}",Kv,Kv,Kv,"{border-color:transparent;box-shadow:none;}}"),IN=yl("div",{target:"e1lpqc906"})("line-height:",Il(8),";margin-left:",Il(2),";margin-right:",Il(2),";white-space:nowrap;overflow:hidden;"),RN=yl(hk,{target:"e1lpqc905"})("text-transform:uppercase;line-height:",Il(6),";font-weight:500;&&&{font-size:11px;margin-bottom:0;}"),MN=yl(_l,{target:"e1lpqc904"})("height:",Il(6),";display:flex;"),AN=yl(_l,{target:"e1lpqc903"})("margin-top:",Il(2),";"),DN=yl(_l,{target:"e1lpqc902"})({name:"u6wnko",styles:"&&&{.components-button.has-icon{min-width:0;padding:0;}}"}),zN=yl(Jx,{target:"e1lpqc901"})("&&{color:",zl.theme.accent,";}"),ON=yl(Jx,{target:"e1lpqc900"})("&&{margin-top:",Il(1),";}");function LN({value:e,onChange:t,label:n}){return(0,_t.jsx)(TN,{size:"compact",label:n,hideLabelFromVision:!0,value:e,onChange:t})}function FN({isGradient:e,element:t,onChange:n,popoverProps:r,onClose:o=()=>{}}){const i=(0,c.useMemo)((()=>({shift:!0,offset:20,resize:!1,placement:"left-start",...r,className:s("components-palette-edit__popover",r?.className)})),[r]);return(0,_t.jsxs)(jw,{...i,onClose:o,children:[!e&&(0,_t.jsx)(nk,{color:t.color,enableAlpha:!0,onChange:e=>{n({...t,color:e})}}),e&&(0,_t.jsx)("div",{className:"components-palette-edit__popover-gradient-picker",children:(0,_t.jsx)(uN,{__experimentalIsRenderedInSidebar:!0,value:t.gradient,onChange:e=>{n({...t,gradient:e})}})})]})}function BN({canOnlyChangeValues:e,element:t,onChange:n,onRemove:r,popoverProps:o,slugPrefix:i,isGradient:s}){const l=s?t.gradient:t.color,[u,d]=(0,c.useState)(!1),[p,f]=(0,c.useState)(null),h=(0,c.useMemo)((()=>({...o,anchor:p})),[p,o]);return(0,_t.jsxs)(OP,{ref:f,size:"small",children:[(0,_t.jsxs)(fy,{justify:"flex-start",children:[(0,_t.jsx)(Jx,{size:"small",onClick:()=>{d(!0)},"aria-label":(0,a.sprintf)((0,a.__)("Edit: %s"),t.name.trim().length?t.name:l),style:{padding:0},children:(0,_t.jsx)(NN,{colorValue:l})}),(0,_t.jsx)(Fg,{children:e?(0,_t.jsx)(IN,{children:t.name.trim().length?t.name:" "}):(0,_t.jsx)(LN,{label:s?(0,a.__)("Gradient name"):(0,a.__)("Color name"),value:t.name,onChange:e=>n({...t,name:e,slug:i+Ty(null!=e?e:"")})})}),!e&&(0,_t.jsx)(Fg,{children:(0,_t.jsx)(ON,{size:"small",icon:Gw,label:(0,a.sprintf)((0,a.__)("Remove color: %s"),t.name.trim().length?t.name:l),onClick:r})})]}),u&&(0,_t.jsx)(FN,{isGradient:s,onChange:n,element:t,popoverProps:h,onClose:()=>d(!1)})]})}function VN({elements:e,onChange:t,canOnlyChangeValues:n,slugPrefix:r,isGradient:o,popoverProps:i,addColorRef:s}){const a=(0,c.useRef)();(0,c.useEffect)((()=>{a.current=e}),[e]);const u=(0,l.useDebounce)((e=>t(function(e){const t={};return e.map((e=>{var n;let r;const{slug:o}=e;return t[o]=(t[o]||0)+1,t[o]>1&&(r=`${o}-${t[o]-1}`),{...e,slug:null!==(n=r)&&void 0!==n?n:o}}))}(e))),100);return(0,_t.jsx)(dk,{spacing:3,children:(0,_t.jsx)(LP,{isRounded:!0,isBordered:!0,isSeparated:!0,children:e.map(((a,l)=>(0,_t.jsx)(BN,{isGradient:o,canOnlyChangeValues:n,element:a,onChange:t=>{u(e.map(((e,n)=>n===l?t:e)))},onRemove:()=>{const n=e.filter(((e,t)=>t!==l));t(n.length?n:void 0),s.current?.focus()},slugPrefix:r,popoverProps:i},l)))})})}const $N=[];const HN=function({gradients:e,colors:t=$N,onChange:n,paletteLabel:r,paletteLabelHeadingLevel:o=2,emptyMessage:i,canOnlyChangeValues:s,canReset:u,slugPrefix:d="",popoverProps:p}){const f=!!e,h=f?e:t,[m,g]=(0,c.useState)(!1),[v,b]=(0,c.useState)(null),x=m&&!!v&&h[v]&&!h[v].slug,y=h.length>0,w=(0,l.useDebounce)(n,100),_=(0,c.useCallback)(((e,t)=>{const n=void 0===t?void 0:h[t];n&&n[f?"gradient":"color"]===e?b(t):g(!0)}),[f,h]),S=(0,c.useRef)(null);return(0,_t.jsxs)(DN,{children:[(0,_t.jsxs)(fy,{children:[(0,_t.jsx)(RN,{level:o,children:r}),(0,_t.jsxs)(MN,{children:[y&&m&&(0,_t.jsx)(zN,{size:"small",onClick:()=>{g(!1),b(null)},children:(0,a.__)("Done")}),!s&&(0,_t.jsx)(Jx,{ref:S,size:"small",isPressed:x,icon:Og,label:f?(0,a.__)("Add gradient"):(0,a.__)("Add color"),onClick:()=>{const{name:r,slug:o}=function(e,t){const n=new RegExp(`^${t}color-([\\d]+)$`),r=e.reduce(((e,t)=>{if("string"==typeof t?.slug){const r=t?.slug.match(n);if(r){const t=parseInt(r[1],10);if(t>=e)return t+1}}return e}),1);return{name:(0,a.sprintf)((0,a.__)("Color %s"),r),slug:`${t}color-${r}`}}(h,d);n(e?[...e,{gradient:QP,name:r,slug:o}]:[...t,{color:"#000",name:r,slug:o}]),g(!0),b(h.length)}}),y&&(!m||!s||u)&&(0,_t.jsx)(PN,{icon:wP,label:f?(0,a.__)("Gradient options"):(0,a.__)("Color options"),toggleProps:{size:"small"},children:({onClose:e})=>(0,_t.jsx)(_t.Fragment,{children:(0,_t.jsxs)(CN,{role:"menu",children:[!m&&(0,_t.jsx)(Jx,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>{g(!0),e()},className:"components-palette-edit__menu-button",children:(0,a.__)("Show details")}),!s&&(0,_t.jsx)(Jx,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>{b(null),g(!1),n(),e()},className:"components-palette-edit__menu-button",children:f?(0,a.__)("Remove all gradients"):(0,a.__)("Remove all colors")}),u&&(0,_t.jsx)(Jx,{__next40pxDefaultSize:!0,className:"components-palette-edit__menu-button",variant:"tertiary",onClick:()=>{b(null),n(),e()},children:f?(0,a.__)("Reset gradient"):(0,a.__)("Reset colors")})]})})})]})]}),y&&(0,_t.jsxs)(AN,{children:[m&&(0,_t.jsx)(VN,{canOnlyChangeValues:s,elements:h,onChange:n,slugPrefix:d,isGradient:f,popoverProps:p,addColorRef:S}),!m&&null!==v&&(0,_t.jsx)(FN,{isGradient:f,onClose:()=>b(null),onChange:e=>{w(h.map(((t,n)=>n===v?e:t)))},element:h[null!=v?v:-1],popoverProps:p}),!m&&(f?(0,_t.jsx)(mN,{gradients:e,onChange:_,clearable:!1,disableCustomGradients:!0}):(0,_t.jsx)(kk,{colors:t,onChange:_,clearable:!1,disableCustomColors:!0}))]}),!y&&i&&(0,_t.jsx)(AN,{children:i})]})},WN=(0,_t.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_t.jsx)(n.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"})}),UN=({__next40pxDefaultSize:e})=>!e&&Nl("height:28px;padding-left:",Il(1),";padding-right:",Il(1),";",""),GN=yl(kg,{target:"evuatpg0"})("height:38px;padding-left:",Il(2),";padding-right:",Il(2),";",UN,";");const KN=(0,c.forwardRef)((function(e,t){const{value:n,isExpanded:r,instanceId:o,selectedSuggestionIndex:i,className:a,onChange:l,onFocus:u,onBlur:d,...p}=e,[f,h]=(0,c.useState)(!1),m=n?n.length+1:0;return(0,_t.jsx)("input",{ref:t,id:`components-form-token-input-${o}`,type:"text",...p,value:n||"",onChange:e=>{l&&l({value:e.target.value})},onFocus:e=>{h(!0),u?.(e)},onBlur:e=>{h(!1),d?.(e)},size:m,className:s(a,"components-form-token-field__input"),autoComplete:"off",role:"combobox","aria-expanded":r,"aria-autocomplete":"list","aria-owns":r?`components-form-token-suggestions-${o}`:void 0,"aria-activedescendant":f&&-1!==i&&r?`components-form-token-suggestions-${o}-${i}`:void 0,"aria-describedby":`components-form-token-suggestions-howto-${o}`})})),qN=KN,YN=e=>{e.preventDefault()};const XN=function({selectedIndex:e,scrollIntoView:t,match:n,onHover:r,onSelect:o,suggestions:i=[],displayTransform:c,instanceId:u,__experimentalRenderItem:d}){const p=(0,l.useRefEffect)((n=>(e>-1&&t&&n.children[e]&&n.children[e].scrollIntoView({behavior:"instant",block:"nearest",inline:"nearest"}),()=>{0})),[e,t]),f=e=>()=>{r?.(e)},h=e=>()=>{o?.(e)};return(0,_t.jsxs)("ul",{ref:p,className:"components-form-token-field__suggestions-list",id:`components-form-token-suggestions-${u}`,role:"listbox",children:[i.map(((t,r)=>{const o=(e=>{const t=c(n).toLocaleLowerCase();if(0===t.length)return null;const r=c(e),o=r.toLocaleLowerCase().indexOf(t);return{suggestionBeforeMatch:r.substring(0,o),suggestionMatch:r.substring(o,o+t.length),suggestionAfterMatch:r.substring(o+t.length)}})(t),i=r===e,a="object"==typeof t&&t?.disabled,l="object"==typeof t&&"value"in t?t?.value:c(t),p=s("components-form-token-field__suggestion",{"is-selected":i});let m;return m="function"==typeof d?d({item:t}):o?(0,_t.jsxs)("span",{"aria-label":c(t),children:[o.suggestionBeforeMatch,(0,_t.jsx)("strong",{className:"components-form-token-field__suggestion-match",children:o.suggestionMatch}),o.suggestionAfterMatch]}):c(t),(0,_t.jsx)("li",{id:`components-form-token-suggestions-${u}-${r}`,role:"option",className:p,onMouseDown:YN,onClick:h(t),onMouseEnter:f(t),"aria-selected":r===e,"aria-disabled":a,children:m},l)})),0===i.length&&(0,_t.jsx)("li",{className:"components-form-token-field__suggestion is-empty",children:(0,a.__)("No items found")})]})},ZN=(0,l.createHigherOrderComponent)((e=>t=>{const[n,r]=(0,c.useState)(void 0),o=(0,c.useCallback)((e=>r((()=>e?.handleFocusOutside?e.handleFocusOutside.bind(e):void 0))),[]);return(0,_t.jsx)("div",{...(0,l.__experimentalUseFocusOutside)(n),children:(0,_t.jsx)(e,{ref:o,...t})})}),"withFocusOutside"),QN=()=>{},JN=ZN(class extends c.Component{handleFocusOutside(e){this.props.onFocusOutside(e)}render(){return this.props.children}}),eT=(e,t)=>null===e?-1:t.indexOf(e);const tT=function e(t){var n;const{__nextHasNoMarginBottom:r=!1,__next40pxDefaultSize:o=!1,value:i,label:u,options:d,onChange:p,onFilterValueChange:f=QN,hideLabelFromVision:h,help:m,allowReset:g=!0,className:v,messages:b={selected:(0,a.__)("Item selected.")},__experimentalRenderItem:x,expandOnFocus:y=!0,placeholder:w}=hb(t),[_,S]=f_({value:i,onChange:p}),C=d.find((e=>e.value===_)),k=null!==(n=C?.label)&&void 0!==n?n:"",j=(0,l.useInstanceId)(e,"combobox-control"),[E,P]=(0,c.useState)(C||null),[N,T]=(0,c.useState)(!1),[I,R]=(0,c.useState)(!1),[M,A]=(0,c.useState)(""),D=(0,c.useRef)(null),z=(0,c.useMemo)((()=>{const e=[],t=[],n=Ny(M);return d.forEach((r=>{const o=Ny(r.label).indexOf(n);0===o?e.push(r):o>0&&t.push(r)})),e.concat(t)}),[M,d]),O=e=>{e.disabled||(S(e.value),(0,jy.speak)(b.selected,"assertive"),P(e),A(""),T(!1))},L=(e=1)=>{let t=eT(E,z)+e;t<0?t=z.length-1:t>=z.length&&(t=0),P(z[t]),T(!0)},F=jx((e=>{let t=!1;if(!e.defaultPrevented){switch(e.code){case"Enter":E&&(O(E),t=!0);break;case"ArrowUp":L(-1),t=!0;break;case"ArrowDown":L(1),t=!0;break;case"Escape":T(!1),P(null),t=!0}t&&e.preventDefault()}}));return(0,c.useEffect)((()=>{const e=z.length>0,t=eT(E,z)>0;e&&!t&&P(z[0])}),[z,E]),(0,c.useEffect)((()=>{const e=z.length>0;if(N){const t=e?(0,a.sprintf)((0,a._n)("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",z.length),z.length):(0,a.__)("No results.");(0,jy.speak)(t,"polite")}}),[z,N]),Ux({componentName:"ComboboxControl",__next40pxDefaultSize:o,size:void 0}),(0,_t.jsx)(JN,{onFocusOutside:()=>{T(!1)},children:(0,_t.jsx)(Wx,{__nextHasNoMarginBottom:r,__associatedWPComponentName:"ComboboxControl",className:s(v,"components-combobox-control"),label:u,id:`components-form-token-input-${j}`,hideLabelFromVision:h,help:m,children:(0,_t.jsxs)("div",{className:"components-combobox-control__suggestions-container",tabIndex:-1,onKeyDown:F,children:[(0,_t.jsxs)(GN,{__next40pxDefaultSize:o,children:[(0,_t.jsx)(Eg,{children:(0,_t.jsx)(qN,{className:"components-combobox-control__input",instanceId:j,ref:D,placeholder:w,value:N?M:k,onFocus:()=>{R(!0),y&&T(!0),f(""),A("")},onBlur:()=>{R(!1)},onClick:()=>{T(!0)},isExpanded:N,selectedSuggestionIndex:eT(E,z),onChange:e=>{const t=e.value;A(t),f(t),I&&T(!0)}})}),g&&(0,_t.jsx)(Jx,{size:"small",icon:WN,disabled:!_,onClick:()=>{S(null),D.current?.focus()},onKeyDown:e=>{e.stopPropagation()},label:(0,a.__)("Reset")})]}),N&&(0,_t.jsx)(XN,{instanceId:j,match:{label:M,value:""},displayTransform:e=>e.label,suggestions:z,selectedIndex:eT(E,z),onHover:P,onSelect:O,scrollIntoView:!0,__experimentalRenderItem:x})]})})})};function nT(e){if(e.state){const{state:t,...n}=e,{store:r,...o}=nT(t);return{...n,...o,store:r}}return e}const rT={__unstableComposite:"Composite",__unstableCompositeGroup:"Composite.Group or Composite.Row",__unstableCompositeItem:"Composite.Item",__unstableUseCompositeState:"Composite"};function oT(e,t={}){var n;const r=null!==(n=e.displayName)&&void 0!==n?n:"",o=n=>{Xi()(`wp.components.${r}`,{since:"6.7",alternative:rT.hasOwnProperty(r)?rT[r]:void 0});const{store:o,...i}=nT(n);let s=i;return s={...s,id:(0,l.useInstanceId)(o,s.baseId,s.id)},Object.entries(t).forEach((([e,t])=>{s.hasOwnProperty(e)&&(Object.assign(s,{[t]:s[e]}),delete s[e])})),delete s.baseId,(0,_t.jsx)(e,{...s,store:o})};return o.displayName=r,o}const iT=(0,c.forwardRef)((({role:e,...t},n)=>{const r="row"===e?Gn.Row:Gn.Group;return(0,_t.jsx)(r,{ref:n,role:e,...t})})),sT=oT(Object.assign(Gn,{displayName:"__unstableComposite"}),{baseId:"id"}),aT=oT(Object.assign(iT,{displayName:"__unstableCompositeGroup"})),lT=oT(Object.assign(Gn.Item,{displayName:"__unstableCompositeItem"}),{focusable:"accessibleWhenDisabled"});function cT(e={}){Xi()("wp.components.__unstableUseCompositeState",{since:"6.7",alternative:rT.__unstableUseCompositeState});const{baseId:t,currentId:n,orientation:r,rtl:o=!1,loop:i=!1,wrap:s=!1,shift:a=!1,unstable_virtual:c}=e;return{baseId:(0,l.useInstanceId)(sT,"composite",t),store:vt({defaultActiveId:n,rtl:o,orientation:r,focusLoop:i,focusShift:a,focusWrap:s,virtualFocus:c})}}const uT=new Set(["alert","status","log","marquee","timer"]),dT=[];function pT(e){const t=e.getAttribute("role");return!("SCRIPT"===e.tagName||e.hasAttribute("hidden")||e.hasAttribute("aria-hidden")||e.hasAttribute("aria-live")||t&&uT.has(t))}const fT=Fl.transitionDuration,hT=Number.parseInt(Fl.transitionDuration);const mT=(0,c.createContext)(new Set),gT=new Map;const vT=(0,c.forwardRef)((function(e,t){const{bodyOpenClassName:n="modal-open",role:r="dialog",title:o=null,focusOnMount:i=!0,shouldCloseOnEsc:u=!0,shouldCloseOnClickOutside:d=!0,isDismissible:p=!0,aria:f={labelledby:void 0,describedby:void 0},onRequestClose:h,icon:m,closeButtonLabel:g,children:v,style:b,overlayClassName:x,className:y,contentLabel:w,onKeyDown:_,isFullScreen:S=!1,size:C,headerActions:k=null,__experimentalHideHeader:j=!1}=e,E=(0,c.useRef)(),P=(0,l.useInstanceId)(vT),N=o?`components-modal-header-${P}`:f.labelledby,T=(0,l.useFocusOnMount)("firstContentElement"===i?"firstElement":i),I=(0,l.useConstrainedTabbing)(),R=(0,l.useFocusReturn)(),M=(0,c.useRef)(null),A=(0,c.useRef)(null),[D,z]=(0,c.useState)(!1),[O,L]=(0,c.useState)(!1);let F;S||"fill"===C?F="is-full-screen":C&&(F=`has-size-${C}`);const B=(0,c.useCallback)((()=>{if(!M.current)return;const e=(0,vN.getScrollContainer)(M.current);M.current===e?L(!0):L(!1)}),[M]);(0,c.useEffect)((()=>(function(e){const t=Array.from(document.body.children),n=[];dT.push(n);for(const r of t)r!==e&&pT(r)&&(r.setAttribute("aria-hidden","true"),n.push(r))}(E.current),()=>function(){const e=dT.pop();if(e)for(const t of e)t.removeAttribute("aria-hidden")}())),[]);const V=(0,c.useRef)();(0,c.useEffect)((()=>{V.current=h}),[h]);const $=(0,c.useContext)(mT),[H]=(0,c.useState)((()=>new Set));(0,c.useEffect)((()=>{$.add(V);for(const e of $)e!==V&&e.current?.();return()=>{for(const e of H)e.current?.();$.delete(V)}}),[$,H]),(0,c.useEffect)((()=>{var e;const t=n,r=1+(null!==(e=gT.get(t))&&void 0!==e?e:0);return gT.set(t,r),document.body.classList.add(n),()=>{const e=gT.get(t)-1;0===e?(document.body.classList.remove(t),gT.delete(t)):gT.set(t,e)}}),[n]);const{closeModal:W,frameRef:U,frameStyle:G,overlayClassname:K}=function(){const e=(0,c.useRef)(),[t,n]=(0,c.useState)(!1),r=(0,l.useReducedMotion)(),o=(0,c.useCallback)((()=>new Promise((t=>{const o=e.current;if(r)return void t();if(!o)return void t();let i;Promise.race([new Promise((e=>{i=t=>{"components-modal__disappear-animation"===t.animationName&&e()},o.addEventListener("animationend",i),n(!0)})),new Promise((e=>{setTimeout((()=>e()),1.2*hT)}))]).then((()=>{i&&o.removeEventListener("animationend",i),n(!1),t()}))}))),[r]);return{overlayClassname:t?"is-animating-out":void 0,frameRef:e,frameStyle:{"--modal-frame-animation-duration":`${fT}`},closeModal:o}}();(0,c.useLayoutEffect)((()=>{if(!window.ResizeObserver||!A.current)return;const e=new ResizeObserver(B);return e.observe(A.current),B(),()=>{e.disconnect()}}),[B,A]);const q=(0,c.useCallback)((e=>{var t;const n=null!==(t=e?.currentTarget?.scrollTop)&&void 0!==t?t:-1;!D&&n>0?z(!0):D&&n<=0&&z(!1)}),[D]);let Y=null;const X={onPointerDown:e=>{e.target===e.currentTarget&&(Y=e.target,e.preventDefault())},onPointerUp:({target:e,button:t})=>{const n=e===Y;Y=null,0===t&&n&&W().then((()=>h()))}},Z=(0,_t.jsx)("div",{ref:(0,l.useMergeRefs)([E,t]),className:s("components-modal__screen-overlay",K,x),onKeyDown:jx((function(e){!u||"Escape"!==e.code&&"Escape"!==e.key||e.defaultPrevented||(e.preventDefault(),W().then((()=>h(e))))})),...d?X:{},children:(0,_t.jsx)(lw,{document,children:(0,_t.jsx)("div",{className:s("components-modal__frame",F,y),style:{...G,...b},ref:(0,l.useMergeRefs)([U,I,R,"firstContentElement"!==i?T:null]),role:r,"aria-label":w,"aria-labelledby":w?void 0:N,"aria-describedby":f.describedby,tabIndex:-1,onKeyDown:_,children:(0,_t.jsxs)("div",{className:s("components-modal__content",{"hide-header":j,"is-scrollable":O,"has-scrolled-content":D}),role:"document",onScroll:q,ref:M,"aria-label":O?(0,a.__)("Scrollable section"):void 0,tabIndex:O?0:void 0,children:[!j&&(0,_t.jsxs)("div",{className:"components-modal__header",children:[(0,_t.jsxs)("div",{className:"components-modal__header-heading-container",children:[m&&(0,_t.jsx)("span",{className:"components-modal__icon-container","aria-hidden":!0,children:m}),o&&(0,_t.jsx)("h1",{id:N,className:"components-modal__header-heading",children:o})]}),k,p&&(0,_t.jsxs)(_t.Fragment,{children:[(0,_t.jsx)(zg,{marginBottom:0,marginLeft:2}),(0,_t.jsx)(Jx,{size:"compact",onClick:e=>W().then((()=>h(e))),icon:Fy,label:g||(0,a.__)("Close")})]})]}),(0,_t.jsx)("div",{ref:(0,l.useMergeRefs)([A,"firstContentElement"===i?T:null]),children:v})]})})})});return(0,c.createPortal)((0,_t.jsx)(mT.Provider,{value:H,children:Z}),document.body)})),bT=vT;const xT={name:"7g5ii0",styles:"&&{z-index:1000001;}"},yT=al(((e,t)=>{const{isOpen:n,onConfirm:r,onCancel:o,children:i,confirmButtonText:s,cancelButtonText:l,...u}=sl(e,"ConfirmDialog"),d=il()(xT),p=(0,c.useRef)(),f=(0,c.useRef)(),[h,m]=(0,c.useState)(),[g,v]=(0,c.useState)();(0,c.useEffect)((()=>{const e=void 0!==n;m(!e||n),v(!e)}),[n]);const b=(0,c.useCallback)((e=>t=>{e?.(t),g&&m(!1)}),[g,m]),x=(0,c.useCallback)((e=>{e.target===p.current||e.target===f.current||"Enter"!==e.key||b(r)(e)}),[b,r]),y=null!=l?l:(0,a.__)("Cancel"),w=null!=s?s:(0,a.__)("OK");return(0,_t.jsx)(_t.Fragment,{children:h&&(0,_t.jsx)(bT,{onRequestClose:b(o),onKeyDown:x,closeButtonLabel:y,isDismissible:!0,ref:t,overlayClassName:d,__experimentalHideHeader:!0,...u,children:(0,_t.jsxs)(dk,{spacing:8,children:[(0,_t.jsx)($v,{children:i}),(0,_t.jsxs)(kg,{direction:"row",justify:"flex-end",children:[(0,_t.jsx)(Jx,{__next40pxDefaultSize:!0,ref:p,variant:"tertiary",onClick:b(o),children:y}),(0,_t.jsx)(Jx,{__next40pxDefaultSize:!0,ref:f,variant:"primary",onClick:b(r),children:w})]})]})})})}),"ConfirmDialog");(0,B.createContext)(void 0);var wT=Et([gr,Mt],[vr,At]),_T=wT.useContext,ST=(wT.useScopedContext,wT.useProviderContext);wT.ContextProvider,wT.ScopedContextProvider,(0,B.createContext)(void 0),(0,B.createContext)(!1);function CT(e={}){var t=e,{combobox:n}=t,r=N(t,["combobox"]);const o=Xe(r.store,Ye(n,["value","items","renderedItems","baseElement","arrowElement","anchorElement","contentElement","popoverElement","disclosureElement"])),i=o.getState(),s=ht(P(E({},r),{store:o,virtualFocus:F(r.virtualFocus,i.virtualFocus,!0),includesBaseElement:F(r.includesBaseElement,i.includesBaseElement,!1),activeId:F(r.activeId,i.activeId,r.defaultActiveId,null),orientation:F(r.orientation,i.orientation,"vertical")})),a=er(P(E({},r),{store:o,placement:F(r.placement,i.placement,"bottom-start")})),l=new String(""),c=P(E(E({},s.getState()),a.getState()),{value:F(r.value,i.value,r.defaultValue,l),setValueOnMove:F(r.setValueOnMove,i.setValueOnMove,!1),labelElement:F(i.labelElement,null),selectElement:F(i.selectElement,null),listElement:F(i.listElement,null)}),u=He(c,s,a,o);return We(u,(()=>Ke(u,["value","items"],(e=>{if(e.value!==l)return;if(!e.items.length)return;const t=e.items.find((e=>!e.disabled&&null!=e.value));null!=(null==t?void 0:t.value)&&u.setState("value",t.value)})))),We(u,(()=>Ke(u,["mounted"],(e=>{e.mounted||u.setState("activeId",c.activeId)})))),We(u,(()=>Ke(u,["mounted","items","value"],(e=>{if(n)return;if(e.mounted)return;const t=st(e.value),r=t[t.length-1];if(null==r)return;const o=e.items.find((e=>!e.disabled&&e.value===r));o&&u.setState("activeId",o.id)})))),We(u,(()=>qe(u,["setValueOnMove","moves"],(e=>{const{mounted:t,value:n,activeId:r}=u.getState();if(!e.setValueOnMove&&t)return;if(Array.isArray(n))return;if(!e.moves)return;if(!r)return;const o=s.item(r);o&&!o.disabled&&null!=o.value&&u.setState("value",o.value)})))),P(E(E(E({},s),a),u),{combobox:n,setValue:e=>u.setState("value",e),setLabelElement:e=>u.setState("labelElement",e),setSelectElement:e=>u.setState("selectElement",e),setListElement:e=>u.setState("listElement",e)})}function kT(e={}){e=function(e){const t=ST();return mt(e=b(v({},e),{combobox:void 0!==e.combobox?e.combobox:t}))}(e);const[t,n]=rt(CT,e);return function(e,t,n){return Te(t,[n.combobox]),nt(e,n,"value","setValue"),nt(e,n,"setValueOnMove"),Object.assign(Qn(gt(e,t,n),t,n),{combobox:n.combobox})}(t,n,e)}var jT=Et([gr,Mt],[vr,At]),ET=jT.useContext,PT=jT.useScopedContext,NT=jT.useProviderContext,TT=(jT.ContextProvider,jT.ScopedContextProvider),IT=(0,B.createContext)(!1),RT=(0,B.createContext)(null),MT=jt((function(e){var t=e,{store:n}=t,r=x(t,["store"]);const o=NT();D(n=n||o,!1);const i=Pe(r.id),s=r.onClick,a=ke((e=>{null==s||s(e),e.defaultPrevented||queueMicrotask((()=>{const e=null==n?void 0:n.getState().selectElement;null==e||e.focus()}))}));return L(r=b(v({id:i},r),{ref:Ee(n.setLabelElement,r.ref),onClick:a,style:v({cursor:"default"},r.style)}))})),AT=Ct(St((function(e){return kt("div",MT(e))}))),DT="button",zT=jt((function(e){const t=(0,B.useRef)(null),n=Ne(t,DT),[r,o]=(0,B.useState)((()=>!!n&&Q({tagName:n,type:e.type})));return(0,B.useEffect)((()=>{t.current&&o(Q(t.current))}),[]),e=b(v({role:r||"a"===n?void 0:"button"},e),{ref:Ee(t,e.ref)}),e=Tn(e)})),OT=(St((function(e){const t=zT(e);return kt(DT,t)})),Symbol("disclosure")),LT=jt((function(e){var t=e,{store:n,toggleOnClick:r=!0}=t,o=x(t,["store","toggleOnClick"]);const i=sr();D(n=n||i,!1);const s=(0,B.useRef)(null),[a,l]=(0,B.useState)(!1),c=n.useState("disclosureElement"),u=n.useState("open");(0,B.useEffect)((()=>{let e=c===s.current;(null==c?void 0:c.isConnected)||(null==n||n.setDisclosureElement(s.current),e=!0),l(u&&e)}),[c,n,u]);const d=o.onClick,p=Re(r),[f,h]=De(o,OT,!0),m=ke((e=>{null==d||d(e),e.defaultPrevented||f||p(e)&&(null==n||n.setDisclosureElement(e.currentTarget),null==n||n.toggle())})),g=n.useState("contentElement");return o=b(v(v({"aria-expanded":a,"aria-controls":null==g?void 0:g.id},h),o),{ref:Ee(s,o.ref),onClick:m}),o=zT(o)})),FT=(St((function(e){return kt("button",LT(e))})),jt((function(e){var t=e,{store:n}=t,r=x(t,["store"]);const o=lr();D(n=n||o,!1);const i=n.useState("contentElement");return r=v({"aria-haspopup":re(i,"dialog")},r),r=LT(v({store:n},r))}))),BT=(St((function(e){return kt("button",FT(e))})),jt((function(e){var t=e,{store:n}=t,r=x(t,["store"]);const o=mr();return n=n||o,r=b(v({},r),{ref:Ee(null==n?void 0:n.setAnchorElement,r.ref)})}))),VT=(St((function(e){return kt("div",BT(e))})),jt((function(e){var t=e,{store:n}=t,r=x(t,["store"]);const o=mr();D(n=n||o,!1);const i=r.onClick,s=ke((e=>{null==n||n.setAnchorElement(e.currentTarget),null==i||i(e)}));return r=Me(r,(e=>(0,_t.jsx)(vr,{value:n,children:e})),[n]),r=b(v({},r),{onClick:s}),r=BT(v({store:n},r)),r=FT(v({store:n},r))}))),$T=(St((function(e){return kt("button",VT(e))})),{top:"4,10 8,6 12,10",right:"6,4 10,8 6,12",bottom:"4,6 8,10 12,6",left:"10,4 6,8 10,12"}),HT=jt((function(e){var t=e,{store:n,placement:r}=t,o=x(t,["store","placement"]);const i=hr();D(n=n||i,!1);const s=n.useState((e=>r||e.placement)).split("-")[0],a=$T[s],l=(0,B.useMemo)((()=>(0,_t.jsx)("svg",{display:"block",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,viewBox:"0 0 16 16",height:"1em",width:"1em",children:(0,_t.jsx)("polyline",{points:a})})),[a]);return L(o=b(v({children:l,"aria-hidden":!0},o),{style:v({width:"1em",height:"1em",pointerEvents:"none"},o.style)}))})),WT=(St((function(e){return kt("span",HT(e))})),jt((function(e){var t=e,{store:n}=t,r=x(t,["store"]);const o=ET();return r=HT(v({store:n=n||o},r))}))),UT=St((function(e){return kt("span",WT(e))}));function GT(e,t){return()=>{const n=t();if(!n)return;let r=0,o=e.item(n);const i=o;for(;o&&null==o.value;){const n=t(++r);if(!n)return;if(o=e.item(n),o===i)break}return null==o?void 0:o.id}}var KT=jt((function(e){var t=e,{store:n,name:r,form:o,required:i,showOnKeyDown:s=!0,moveOnKeyDown:a=!0,toggleOnPress:l=!0,toggleOnClick:c=l}=t,u=x(t,["store","name","form","required","showOnKeyDown","moveOnKeyDown","toggleOnPress","toggleOnClick"]);const d=NT();D(n=n||d,!1);const p=u.onKeyDown,f=Re(s),h=Re(a),m=n.useState("placement").split("-")[0],g=n.useState("value"),y=Array.isArray(g),w=ke((e=>{var t;if(null==p||p(e),e.defaultPrevented)return;if(!n)return;const{orientation:r,items:o,activeId:i}=n.getState(),s="horizontal"!==r,a="vertical"!==r,l=!!(null==(t=o.find((e=>!e.disabled&&null!=e.value)))?void 0:t.rowId),c={ArrowUp:(l||s)&>(n,n.up),ArrowRight:(l||a)&>(n,n.next),ArrowDown:(l||s)&>(n,n.down),ArrowLeft:(l||a)&>(n,n.previous)}[e.key];c&&h(e)&&(e.preventDefault(),n.move(c()));const u="top"===m||"bottom"===m;({ArrowDown:u,ArrowUp:u,ArrowLeft:"left"===m,ArrowRight:"right"===m})[e.key]&&f(e)&&(e.preventDefault(),n.move(i),ve(e.currentTarget,"keyup",n.show))}));u=Me(u,(e=>(0,_t.jsx)(TT,{value:n,children:e})),[n]);const[_,S]=(0,B.useState)(!1),C=(0,B.useRef)(!1);(0,B.useEffect)((()=>{const e=C.current;C.current=!1,e||S(!1)}),[g]);const k=n.useState((e=>{var t;return null==(t=e.labelElement)?void 0:t.id})),j=u["aria-label"],E=u["aria-labelledby"]||k,P=n.useState((e=>{if(r)return e.items})),N=(0,B.useMemo)((()=>[...new Set(null==P?void 0:P.map((e=>e.value)).filter((e=>null!=e)))]),[P]);u=Me(u,(e=>r?(0,_t.jsxs)(_t.Fragment,{children:[(0,_t.jsxs)("select",{style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"},tabIndex:-1,"aria-hidden":!0,"aria-label":j,"aria-labelledby":E,name:r,form:o,required:i,value:g,multiple:y,onFocus:()=>{var e;return null==(e=null==n?void 0:n.getState().selectElement)?void 0:e.focus()},onChange:e=>{var t;C.current=!0,S(!0),null==n||n.setValue(y?(t=e.target,Array.from(t.selectedOptions).map((e=>e.value))):e.target.value)},children:[st(g).map((e=>null==e||N.includes(e)?null:(0,_t.jsx)("option",{value:e,children:e},e))),N.map((e=>(0,_t.jsx)("option",{value:e,children:e},e)))]}),e]}):e),[n,j,E,r,o,i,g,y,N]);const T=(0,_t.jsxs)(_t.Fragment,{children:[g,(0,_t.jsx)(UT,{})]}),I=n.useState("contentElement");return u=b(v({role:"combobox","aria-autocomplete":"none","aria-labelledby":k,"aria-haspopup":re(I,"listbox"),"data-autofill":_||void 0,"data-name":r,children:T},u),{ref:Ee(n.setSelectElement,u.ref),onKeyDown:w}),u=VT(v({store:n,toggleOnClick:c},u)),u=Hn(v({store:n},u))})),qT=St((function(e){return kt("button",KT(e))})),YT=(0,B.createContext)(null),XT=jt((function(e){var t=e,{store:n,resetOnEscape:r=!0,hideOnEnter:o=!0,focusOnMove:i=!0,composite:s,alwaysVisible:a}=t,l=x(t,["store","resetOnEscape","hideOnEnter","focusOnMove","composite","alwaysVisible"]);const c=ET();D(n=n||c,!1);const u=Pe(l.id),d=n.useState("value"),p=Array.isArray(d),[f,h]=(0,B.useState)(d),m=n.useState("mounted");(0,B.useEffect)((()=>{m||h(d)}),[m,d]),r=r&&!p;const g=l.onKeyDown,y=Re(r),w=Re(o),_=ke((e=>{null==g||g(e),e.defaultPrevented||("Escape"===e.key&&y(e)&&(null==n||n.setValue(f))," "!==e.key&&"Enter"!==e.key||de(e)&&w(e)&&(e.preventDefault(),null==n||n.hide()))})),S=(0,B.useContext)(RT),C=(0,B.useState)(),[k,j]=S||C,E=(0,B.useMemo)((()=>[k,j]),[k]),[P,N]=(0,B.useState)(null),T=(0,B.useContext)(YT);(0,B.useEffect)((()=>{if(T)return T(n),()=>T(null)}),[T,n]),l=Me(l,(e=>(0,_t.jsx)(TT,{value:n,children:(0,_t.jsx)(YT.Provider,{value:N,children:(0,_t.jsx)(RT.Provider,{value:E,children:e})})})),[n,E]);const I=!!n.combobox;s=null!=s?s:!I&&P!==n;const[R,M]=je(s?n.setListElement:null),A=function(e,t,n){const r=Se(n),[o,i]=(0,B.useState)(r);return(0,B.useEffect)((()=>{const n=e&&"current"in e?e.current:e;if(!n)return;const o=()=>{const e=n.getAttribute(t);i(null==e?r:e)},s=new MutationObserver(o);return s.observe(n,{attributeFilter:[t]}),o(),()=>s.disconnect()}),[e,t,r]),o}(R,"role",l.role),z=(s||("listbox"===A||"menu"===A||"tree"===A||"grid"===A))&&p||void 0,O=Xr(m,l.hidden,a),L=O?b(v({},l.style),{display:"none"}):l.style;s&&(l=v({role:"listbox","aria-multiselectable":z},l));const F=n.useState((e=>{var t;return k||(null==(t=e.labelElement)?void 0:t.id)}));return l=b(v({id:u,"aria-labelledby":F,hidden:O},l),{ref:Ee(M,l.ref),style:L,onKeyDown:_}),l=cn(b(v({store:n},l),{composite:s})),l=Hn(v({store:n,typeahead:!I},l))})),ZT=(St((function(e){return kt("div",XT(e))})),jt((function(e){var t=e,{store:n,alwaysVisible:r}=t,o=x(t,["store","alwaysVisible"]);const i=NT();return o=XT(v({store:n=n||i,alwaysVisible:r},o)),o=Hi(v({store:n,alwaysVisible:r},o))}))),QT=_o(St((function(e){return kt("div",ZT(e))})),NT);var JT=jt((function(e){var t,n=e,{store:r,value:o,getItem:i,hideOnClick:s,setValueOnClick:a=null!=o,preventScrollOnKeyDown:l=!0,focusOnHover:c=!0}=n,u=x(n,["store","value","getItem","hideOnClick","setValueOnClick","preventScrollOnKeyDown","focusOnHover"]);const d=PT();D(r=r||d,!1);const p=Pe(u.id),f=O(u),{listElement:h,multiSelectable:m,selected:g,autoFocus:y}=tt(r,{listElement:"listElement",multiSelectable:e=>Array.isArray(e.value),selected:e=>function(e,t){if(null!=t)return null!=e&&(Array.isArray(e)?e.includes(t):e===t)}(e.value,o),autoFocus:e=>null!=o&&(null!=e.value&&((e.activeId===p||!(null==r?void 0:r.item(e.activeId)))&&(Array.isArray(e.value)?e.value[e.value.length-1]===o:e.value===o)))}),w=(0,B.useCallback)((e=>{const t=b(v({},e),{value:f?void 0:o,children:o});return i?i(t):t}),[f,o,i]);s=null!=s?s:null!=o&&!m;const _=u.onClick,S=Re(a),C=Re(s),k=ke((e=>{null==_||_(e),e.defaultPrevented||fe(e)||pe(e)||(S(e)&&null!=o&&(null==r||r.setValue((e=>Array.isArray(e)?e.includes(o)?e.filter((e=>e!==o)):[...e,o]:o))),C(e)&&(null==r||r.hide()))}));u=Me(u,(e=>(0,_t.jsx)(IT.Provider,{value:null!=g&&g,children:e})),[g]),u=b(v({id:p,role:oe(h),"aria-selected":g,children:o},u),{autoFocus:null!=(t=u.autoFocus)?t:y,onClick:k}),u=Mn(v({store:r,getItem:w,preventScrollOnKeyDown:l},u));const j=Re(c);return u=Cn(b(v({store:r},u),{focusOnHover(e){if(!j(e))return!1;const t=null==r?void 0:r.getState();return!!(null==t?void 0:t.open)}}))})),eI=Ct(St((function(e){return kt("div",JT(e))}))),tI=(0,B.createContext)(!1),nI=(0,_t.jsx)("svg",{display:"block",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,viewBox:"0 0 16 16",height:"1em",width:"1em",children:(0,_t.jsx)("polyline",{points:"4,8 7,12 12,4"})});var rI=jt((function(e){var t=e,{store:n,checked:r}=t,o=x(t,["store","checked"]);const i=(0,B.useContext)(tI),s=function(e){return e.checked?e.children||nI:"function"==typeof e.children?e.children:null}({checked:r=null!=r?r:i,children:o.children});return L(o=b(v({"aria-hidden":!0},o),{children:s,style:v({width:"1em",height:"1em",pointerEvents:"none"},o.style)}))})),oI=(St((function(e){return kt("span",rI(e))})),jt((function(e){var t=e,{store:n,checked:r}=t,o=x(t,["store","checked"]);const i=(0,B.useContext)(IT);return r=null!=r?r:i,o=rI(b(v({},o),{checked:r}))}))),iI=St((function(e){return kt("span",oI(e))}));const sI="2px",aI="400ms",lI="cubic-bezier( 0.16, 1, 0.3, 1 )",cI={compact:Fl.controlPaddingXSmall,small:Fl.controlPaddingXSmall,default:Fl.controlPaddingX},uI=yl(qT,{shouldForwardProp:e=>"hasCustomRenderProp"!==e,target:"e1p3eej77"})((({size:e,hasCustomRenderProp:t})=>Nl("display:block;background-color:",zl.theme.background,";border:none;color:",zl.theme.foreground,";cursor:pointer;font-family:inherit;text-align:start;user-select:none;width:100%;&[data-focus-visible]{outline:none;}",((e,t)=>{const n={compact:{[t]:32,paddingInlineStart:cI.compact,paddingInlineEnd:cI.compact+18},default:{[t]:40,paddingInlineStart:cI.default,paddingInlineEnd:cI.default+18},small:{[t]:24,paddingInlineStart:cI.small,paddingInlineEnd:cI.small+18}};return n[e]||n.default})(e,t?"minHeight":"height")," ",!t&&hI," ",eb({inputSize:e}),";","")),""),dI=Tl({"0%":{opacity:0,transform:`translateY(-${sI})`},"100%":{opacity:1,transform:"translateY(0)"}}),pI=yl(QT,{target:"e1p3eej76"})("display:flex;flex-direction:column;background-color:",zl.theme.background,";border-radius:",Fl.radiusSmall,";border:1px solid ",zl.theme.foreground,";box-shadow:",Fl.elevationMedium,";z-index:1000000;max-height:min( var( --popover-available-height, 400px ), 400px );overflow:auto;overscroll-behavior:contain;min-width:min-content;&[data-open]{@media not ( prefers-reduced-motion ){animation-duration:",aI,";animation-timing-function:",lI,";animation-name:",dI,";will-change:transform,opacity;}}&[data-focus-visible]{outline:none;}"),fI=yl(eI,{target:"e1p3eej75"})((({size:e})=>Nl("cursor:default;display:flex;align-items:center;justify-content:space-between;font-size:",Fl.fontSize,";line-height:28px;padding-block:",Il(2),";scroll-margin:",Il(1),";user-select:none;&[aria-disabled='true']{cursor:not-allowed;}&[data-active-item]{background-color:",zl.theme.gray[300],";}",(e=>{const t={compact:{paddingInlineStart:cI.compact,paddingInlineEnd:cI.compact-6},default:{paddingInlineStart:cI.default,paddingInlineEnd:cI.default-6},small:{paddingInlineStart:cI.small,paddingInlineEnd:cI.small-6}};return t[e]||t.default})(e),";","")),""),hI={name:"1h52dri",styles:"overflow:hidden;text-overflow:ellipsis;white-space:nowrap"},mI=yl("div",{target:"e1p3eej74"})(hI,";"),gI=yl("span",{target:"e1p3eej73"})("color:",zl.theme.gray[600],";margin-inline-start:",Il(2),";"),vI=yl("div",{target:"e1p3eej72"})("display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;flex:1;column-gap:",Il(4),";"),bI=yl("span",{target:"e1p3eej71"})("color:",zl.theme.gray[600],";text-align:initial;line-height:",Fl.fontLineHeightBase,";padding-inline-end:",Il(1),";margin-block:",Il(1),";"),xI=yl(iI,{target:"e1p3eej70"})("display:flex;align-items:center;margin-inline-start:",Il(2),";align-self:start;margin-block-start:2px;font-size:0;",vI,"~&,&:not(:empty){font-size:24px;}"),yI=(0,c.createContext)(void 0);function wI(e){return(Array.isArray(e)?0===e.length:null==e)?(0,a.__)("Select an item"):Array.isArray(e)?1===e.length?e[0]:(0,a.sprintf)((0,a.__)("%s items selected"),e.length):e}const _I=({renderSelectedValue:e,size:t="default",store:n,...r})=>{const{value:o}=et(n),i=(0,c.useMemo)((()=>null!=e?e:wI),[e]);return(0,_t.jsx)(uI,{...r,size:t,hasCustomRenderProp:!!e,store:n,children:i(o)})};const SI=function(e){const{children:t,hideLabelFromVision:n=!1,label:r,size:o,store:i,className:s,isLegacy:a=!1,...l}=e,u=(0,c.useCallback)((e=>{a&&e.stopPropagation()}),[a]),d=(0,c.useMemo)((()=>({store:i,size:o})),[i,o]);return(0,_t.jsxs)("div",{className:s,children:[(0,_t.jsx)(AT,{store:i,render:n?(0,_t.jsx)(Sl,{}):(0,_t.jsx)(Wx.VisualLabel,{as:"div"}),children:r}),(0,_t.jsxs)(vb,{__next40pxDefaultSize:!0,size:o,suffix:(0,_t.jsx)(sS,{}),children:[(0,_t.jsx)(_I,{...l,size:o,store:i,showOnKeyDown:!a}),(0,_t.jsx)(pI,{gutter:12,store:i,sameWidth:!0,slide:!1,onKeyDown:u,flip:!a,children:(0,_t.jsx)(yI.Provider,{value:d,children:t})})]})]})};function CI({children:e,...t}){var n;const r=(0,c.useContext)(yI);return(0,_t.jsxs)(fI,{store:r?.store,size:null!==(n=r?.size)&&void 0!==n?n:"default",...t,children:[null!=e?e:t.value,(0,_t.jsx)(xI,{children:(0,_t.jsx)(oS,{icon:ok})})]})}CI.displayName="CustomSelectControlV2.Item";const kI=CI;function jI({__experimentalHint:e,...t}){return{hint:e,...t}}function EI(e,t){return t||(0,a.sprintf)((0,a.__)("Currently selected: %s"),e)}const PI=function e(t){const{__next40pxDefaultSize:n=!1,__shouldNotWarnDeprecated36pxSize:r,describedBy:o,options:i,onChange:a,size:c="default",value:u,className:d,showSelectedHint:p=!1,...f}=function({__experimentalShowSelectedHint:e,...t}){return{showSelectedHint:e,...t}}(t);Ux({componentName:"CustomSelectControl",__next40pxDefaultSize:n,size:c,__shouldNotWarnDeprecated36pxSize:r});const h=(0,l.useInstanceId)(e,"custom-select-control__description"),m=kT({async setValue(e){const t=i.find((t=>t.name===e));if(!a||!t)return;await Promise.resolve();const n=m.getState(),r={highlightedIndex:n.renderedItems.findIndex((t=>t.value===e)),inputValue:"",isOpen:n.open,selectedItem:t,type:""};a(r)},value:u?.name,defaultValue:i[0]?.name}),g=i.map(jI).map((({name:e,key:t,hint:n,style:r,className:o})=>{const i=(0,_t.jsxs)(vI,{children:[(0,_t.jsx)("span",{children:e}),(0,_t.jsx)(bI,{className:"components-custom-select-control__item-hint",children:n})]});return(0,_t.jsx)(kI,{value:e,children:n?i:e,style:r,className:s(o,"components-custom-select-control__item",{"has-hint":n})},t)})),v=et(m,"value"),b=n&&"default"===c||"__unstable-large"===c?"default":n||"default"!==c?c:"compact";return(0,_t.jsxs)(_t.Fragment,{children:[(0,_t.jsx)(SI,{"aria-describedby":h,renderSelectedValue:p?()=>{const e=i?.map(jI)?.find((({name:e})=>v===e))?.hint;return(0,_t.jsxs)(mI,{children:[v,e&&(0,_t.jsx)(gI,{className:"components-custom-select-control__hint",children:e})]})}:void 0,size:b,store:m,className:s("components-custom-select-control",d),isLegacy:!0,...f,children:g}),(0,_t.jsx)(Sl,{children:(0,_t.jsx)("span",{id:h,children:EI(v,o)})})]})};function NI(e){const t=Object.prototype.toString.call(e);return e instanceof Date||"object"==typeof e&&"[object Date]"===t?new e.constructor(+e):"number"==typeof e||"[object Number]"===t||"string"==typeof e||"[object String]"===t?new Date(e):new Date(NaN)}function TI(e){const t=NI(e);return t.setHours(0,0,0,0),t}function II(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function RI(e,t){const n=NI(e);if(isNaN(t))return II(e,NaN);if(!t)return n;const r=n.getDate(),o=II(e,n.getTime());o.setMonth(n.getMonth()+t+1,0);return r>=o.getDate()?o:(n.setFullYear(o.getFullYear(),o.getMonth(),r),n)}function MI(e,t){return RI(e,-t)}const AI={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function DI(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const zI={date:DI({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:DI({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:DI({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},OI={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function LI(e){return(t,n)=>{let r;if("formatting"===(n?.context?String(n.context):"standalone")&&e.formattingValues){const t=e.defaultFormattingWidth||e.defaultWidth,o=n?.width?String(n.width):t;r=e.formattingValues[o]||e.formattingValues[t]}else{const t=e.defaultWidth,o=n?.width?String(n.width):e.defaultWidth;r=e.values[o]||e.values[t]}return r[e.argumentCallback?e.argumentCallback(t):t]}}const FI={ordinalNumber:(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:LI({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:LI({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:LI({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:LI({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:LI({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})};function BI(e){return(t,n={})=>{const r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(o);if(!i)return null;const s=i[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(a)?function(e,t){for(let n=0;ne.test(s))):function(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n;return}(a,(e=>e.test(s)));let c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;return{value:c,rest:t.slice(s.length)}}}const VI={ordinalNumber:($I={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)},(e,t={})=>{const n=e.match($I.matchPattern);if(!n)return null;const r=n[0],o=e.match($I.parsePattern);if(!o)return null;let i=$I.valueCallback?$I.valueCallback(o[0]):o[0];return i=t.valueCallback?t.valueCallback(i):i,{value:i,rest:e.slice(r.length)}}),era:BI({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:BI({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:BI({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:BI({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:BI({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})};var $I;const HI={code:"en-US",formatDistance:(e,t,n)=>{let r;const o=AI[e];return r="string"==typeof o?o:1===t?o.one:o.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},formatLong:zI,formatRelative:(e,t,n,r)=>OI[e],localize:FI,match:VI,options:{weekStartsOn:0,firstWeekContainsDate:1}};let WI={};function UI(){return WI}Math.pow(10,8);const GI=6048e5;function KI(e){const t=NI(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function qI(e,t){const n=TI(e),r=TI(t),o=+n-KI(n),i=+r-KI(r);return Math.round((o-i)/864e5)}function YI(e){const t=NI(e),n=II(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function XI(e){const t=NI(e);return qI(t,YI(t))+1}function ZI(e,t){const n=UI(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=NI(e),i=o.getDay(),s=(i=o.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}function eR(e){const t=JI(e),n=II(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),QI(n)}function tR(e){const t=NI(e),n=+QI(t)-+eR(t);return Math.round(n/GI)+1}function nR(e,t){const n=NI(e),r=n.getFullYear(),o=UI(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,s=II(e,0);s.setFullYear(r+1,0,i),s.setHours(0,0,0,0);const a=ZI(s,t),l=II(e,0);l.setFullYear(r,0,i),l.setHours(0,0,0,0);const c=ZI(l,t);return n.getTime()>=a.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function rR(e,t){const n=UI(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,o=nR(e,t),i=II(e,0);i.setFullYear(o,0,r),i.setHours(0,0,0,0);return ZI(i,t)}function oR(e,t){const n=NI(e),r=+ZI(n,t)-+rR(n,t);return Math.round(r/GI)+1}function iR(e,t){return(e<0?"-":"")+Math.abs(e).toString().padStart(t,"0")}const sR={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return iR("yy"===t?r%100:r,t.length)},M(e,t){const n=e.getMonth();return"M"===t?String(n+1):iR(n+1,2)},d:(e,t)=>iR(e.getDate(),t.length),a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:(e,t)=>iR(e.getHours()%12||12,t.length),H:(e,t)=>iR(e.getHours(),t.length),m:(e,t)=>iR(e.getMinutes(),t.length),s:(e,t)=>iR(e.getSeconds(),t.length),S(e,t){const n=t.length,r=e.getMilliseconds();return iR(Math.trunc(r*Math.pow(10,n-3)),t.length)}},aR="midnight",lR="noon",cR="morning",uR="afternoon",dR="evening",pR="night",fR={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if("yo"===t){const t=e.getFullYear(),r=t>0?t:1-t;return n.ordinalNumber(r,{unit:"year"})}return sR.y(e,t)},Y:function(e,t,n,r){const o=nR(e,r),i=o>0?o:1-o;if("YY"===t){return iR(i%100,2)}return"Yo"===t?n.ordinalNumber(i,{unit:"year"}):iR(i,t.length)},R:function(e,t){return iR(JI(e),t.length)},u:function(e,t){return iR(e.getFullYear(),t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return iR(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return iR(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return sR.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return iR(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const o=oR(e,r);return"wo"===t?n.ordinalNumber(o,{unit:"week"}):iR(o,t.length)},I:function(e,t,n){const r=tR(e);return"Io"===t?n.ordinalNumber(r,{unit:"week"}):iR(r,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getDate(),{unit:"date"}):sR.d(e,t)},D:function(e,t,n){const r=XI(e);return"Do"===t?n.ordinalNumber(r,{unit:"dayOfYear"}):iR(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const o=e.getDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return iR(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const o=e.getDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return iR(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),o=0===r?7:r;switch(t){case"i":return String(o);case"ii":return iR(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let o;switch(o=12===r?lR:0===r?aR:r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let o;switch(o=r>=17?dR:r>=12?uR:r>=4?cR:pR,t){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){let t=e.getHours()%12;return 0===t&&(t=12),n.ordinalNumber(t,{unit:"hour"})}return sR.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getHours(),{unit:"hour"}):sR.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return"Ko"===t?n.ordinalNumber(r,{unit:"hour"}):iR(r,t.length)},k:function(e,t,n){let r=e.getHours();return 0===r&&(r=24),"ko"===t?n.ordinalNumber(r,{unit:"hour"}):iR(r,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):sR.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getSeconds(),{unit:"second"}):sR.s(e,t)},S:function(e,t){return sR.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(0===r)return"Z";switch(t){case"X":return mR(r);case"XXXX":case"XX":return gR(r);default:return gR(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return mR(r);case"xxxx":case"xx":return gR(r);default:return gR(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+hR(r,":");default:return"GMT"+gR(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+hR(r,":");default:return"GMT"+gR(r,":")}},t:function(e,t,n){return iR(Math.trunc(e.getTime()/1e3),t.length)},T:function(e,t,n){return iR(e.getTime(),t.length)}};function hR(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),i=r%60;return 0===i?n+String(o):n+String(o)+t+iR(i,2)}function mR(e,t){if(e%60==0){return(e>0?"-":"+")+iR(Math.abs(e)/60,2)}return gR(e,t)}function gR(e,t=""){const n=e>0?"-":"+",r=Math.abs(e);return n+iR(Math.trunc(r/60),2)+t+iR(r%60,2)}const vR=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},bR=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},xR={p:bR,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return vR(e,t);let i;switch(r){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;default:i=t.dateTime({width:"full"})}return i.replace("{{date}}",vR(r,t)).replace("{{time}}",bR(o,t))}},yR=/^D+$/,wR=/^Y+$/,_R=["D","DD","YY","YYYY"];function SR(e){return e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e)}function CR(e){if(!SR(e)&&"number"!=typeof e)return!1;const t=NI(e);return!isNaN(Number(t))}const kR=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,jR=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ER=/^'([^]*?)'?$/,PR=/''/g,NR=/[a-zA-Z]/;function TR(e,t,n){const r=UI(),o=n?.locale??r.locale??HI,i=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,s=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,a=NI(e);if(!CR(a))throw new RangeError("Invalid time value");let l=t.match(jR).map((e=>{const t=e[0];if("p"===t||"P"===t){return(0,xR[t])(e,o.formatLong)}return e})).join("").match(kR).map((e=>{if("''"===e)return{isToken:!1,value:"'"};const t=e[0];if("'"===t)return{isToken:!1,value:IR(e)};if(fR[t])return{isToken:!0,value:e};if(t.match(NR))throw new RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}}));o.localize.preprocessor&&(l=o.localize.preprocessor(a,l));const c={firstWeekContainsDate:i,weekStartsOn:s,locale:o};return l.map((r=>{if(!r.isToken)return r.value;const i=r.value;(!n?.useAdditionalWeekYearTokens&&function(e){return wR.test(e)}(i)||!n?.useAdditionalDayOfYearTokens&&function(e){return yR.test(e)}(i))&&function(e,t,n){const r=function(e,t,n){const r="Y"===e[0]?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}(e,t,n);if(console.warn(r),_R.includes(e))throw new RangeError(r)}(i,t,String(e));return(0,fR[i[0]])(a,i,o.localize,c)})).join("")}function IR(e){const t=e.match(ER);return t?t[1].replace(PR,"'"):e}function RR(e,t){const n=NI(e),r=NI(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function MR(e,t){return+NI(e)==+NI(t)}function AR(e,t){return+TI(e)==+TI(t)}function DR(e,t){const n=NI(e);return isNaN(t)?II(e,NaN):t?(n.setDate(n.getDate()+t),n):n}function zR(e,t){return DR(e,7*t)}function OR(e,t){return zR(e,-t)}function LR(e,t){const n=UI(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=NI(e),i=o.getDay(),s=6+(ir.getTime()}function HR(e,t){return+NI(e)<+NI(t)}function WR(e){const t=NI(e),n=t.getFullYear(),r=t.getMonth(),o=II(e,0);return o.setFullYear(n,r+1,0),o.setHours(0,0,0,0),o.getDate()}function UR(e,t){const n=NI(e),r=n.getFullYear(),o=n.getDate(),i=II(e,0);i.setFullYear(r,t,15),i.setHours(0,0,0,0);const s=WR(i);return n.setMonth(t,Math.min(o,s)),n}function GR(e,t){let n=NI(e);return isNaN(+n)?II(e,NaN):(null!=t.year&&n.setFullYear(t.year),null!=t.month&&(n=UR(n,t.month)),null!=t.date&&n.setDate(t.date),null!=t.hours&&n.setHours(t.hours),null!=t.minutes&&n.setMinutes(t.minutes),null!=t.seconds&&n.setSeconds(t.seconds),null!=t.milliseconds&&n.setMilliseconds(t.milliseconds),n)}function KR(){return TI(Date.now())}function qR(e,t){const n=NI(e);return isNaN(+n)?II(e,NaN):(n.setFullYear(t),n)}function YR(e,t){return RI(e,12*t)}function XR(e,t){return YR(e,-t)}function ZR(e,t){const n=NI(e.start),r=NI(e.end);let o=+n>+r;const i=o?+n:+r,s=o?r:n;s.setHours(0,0,0,0);let a=t?.step??1;if(!a)return[];a<0&&(a=-a,o=!o);const l=[];for(;+s<=i;)l.push(NI(s)),s.setDate(s.getDate()+a),s.setHours(0,0,0,0);return o?l.reverse():l}function QR(e,t){const n=NI(e.start),r=NI(e.end);let o=+n>+r;const i=o?+n:+r,s=o?r:n;s.setHours(0,0,0,0),s.setDate(1);let a=t?.step??1;if(!a)return[];a<0&&(a=-a,o=!o);const l=[];for(;+s<=i;)l.push(NI(s)),s.setMonth(s.getMonth()+a);return o?l.reverse():l}function JR(e){const t=NI(e);return t.setDate(1),t.setHours(0,0,0,0),t}function eM(e){const t=NI(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function tM(e,t){const n=NI(e.start),r=NI(e.end);let o=+n>+r;const i=ZI(o?r:n,t),s=ZI(o?n:r,t);i.setHours(15),s.setHours(15);const a=+s.getTime();let l=i,c=t?.step??1;if(!c)return[];c<0&&(c=-c,o=!o);const u=[];for(;+l<=a;)l.setHours(0),u.push(NI(l)),l=zR(l,c),l.setHours(15);return o?u.reverse():u}let nM=function(e){return e[e.SUNDAY=0]="SUNDAY",e[e.MONDAY=1]="MONDAY",e[e.TUESDAY=2]="TUESDAY",e[e.WEDNESDAY=3]="WEDNESDAY",e[e.THURSDAY=4]="THURSDAY",e[e.FRIDAY=5]="FRIDAY",e[e.SATURDAY=6]="SATURDAY",e}({});const rM=(e,t,n)=>(MR(e,t)||$R(e,t))&&(MR(e,n)||HR(e,n)),oM=e=>GR(e,{hours:0,minutes:0,seconds:0,milliseconds:0}),iM=yl("div",{target:"e105ri6r5"})(Rx,";"),sM=yl(fy,{target:"e105ri6r4"})("margin-bottom:",Il(4),";"),aM=yl(hk,{target:"e105ri6r3"})("font-size:",Fl.fontSize,";font-weight:",Fl.fontWeight,";strong{font-weight:",Fl.fontWeightHeading,";}"),lM=yl("div",{target:"e105ri6r2"})("column-gap:",Il(2),";display:grid;grid-template-columns:0.5fr repeat( 5, 1fr ) 0.5fr;justify-items:center;row-gap:",Il(2),";"),cM=yl("div",{target:"e105ri6r1"})("color:",zl.theme.gray[700],";font-size:",Fl.fontSize,";line-height:",Fl.fontLineHeightBase,";&:nth-of-type( 1 ){justify-self:start;}&:nth-of-type( 7 ){justify-self:end;}"),uM=yl(Jx,{shouldForwardProp:e=>!["column","isSelected","isToday","hasEvents"].includes(e),target:"e105ri6r0"})("grid-column:",(e=>e.column),";position:relative;justify-content:center;",(e=>1===e.column&&"\n\t\tjustify-self: start;\n\t\t")," ",(e=>7===e.column&&"\n\t\tjustify-self: end;\n\t\t")," ",(e=>e.disabled&&"\n\t\tpointer-events: none;\n\t\t")," &&&{border-radius:",Fl.radiusRound,";height:",Il(7),";width:",Il(7),";",(e=>e.isSelected&&`\n\t\t\t\tbackground: ${zl.theme.accent};\n\n\t\t\t\t&,\n\t\t\t\t&:hover:not(:disabled, [aria-disabled=true]) {\n\t\t\t\t\tcolor: ${zl.theme.accentInverted};\n\t\t\t\t}\n\n\t\t\t\t&:focus:not(:disabled),\n\t\t\t\t&:focus:not(:disabled) {\n\t\t\t\t\tborder: ${Fl.borderWidthFocus} solid currentColor;\n\t\t\t\t}\n\n\t\t\t\t/* Highlight the selected day for high-contrast mode */\n\t\t\t\t&::after {\n\t\t\t\t\tcontent: '';\n\t\t\t\t\tposition: absolute;\n\t\t\t\t\tpointer-events: none;\n\t\t\t\t\tinset: 0;\n\t\t\t\t\tborder-radius: inherit;\n\t\t\t\t\tborder: 1px solid transparent;\n\t\t\t\t}\n\t\t\t`)," ",(e=>!e.isSelected&&e.isToday&&`\n\t\t\tbackground: ${zl.theme.gray[200]};\n\t\t\t`),";}",(e=>e.hasEvents&&`\n\t\t::before {\n\t\t\tborder: 2px solid ${e.isSelected?zl.theme.accentInverted:zl.theme.accent};\n\t\t\tborder-radius: ${Fl.radiusRound};\n\t\t\tcontent: " ";\n\t\t\tleft: 50%;\n\t\t\tposition: absolute;\n\t\t\ttransform: translate(-50%, 9px);\n\t\t}\n\t\t`),";");function dM(e){return"string"==typeof e?new Date(e):NI(e)}function pM(e,t){return t?(e%12+12)%24:e%12}function fM(e){return(t,n)=>{const r={...t};return n.type!==mx&&n.type!==Sx&&n.type!==wx||void 0!==r.value&&(r.value=r.value.toString().padStart(e,"0")),r}}function hM(e){var t;const n=null!==(t=e.target?.ownerDocument.defaultView?.HTMLInputElement)&&void 0!==t?t:HTMLInputElement;return e.target instanceof n&&e.target.validity.valid}const mM="yyyy-MM-dd'T'HH:mm:ss";function gM({day:e,column:t,isSelected:n,isFocusable:r,isFocusAllowed:o,isToday:i,isInvalid:s,numEvents:a,onClick:l,onKeyDown:u}){const d=(0,c.useRef)();return(0,c.useEffect)((()=>{d.current&&r&&o&&d.current.focus()}),[r]),(0,_t.jsx)(uM,{__next40pxDefaultSize:!0,ref:d,className:"components-datetime__date__day",disabled:s,tabIndex:r?0:-1,"aria-label":vM(e,n,a),column:t,isSelected:n,isToday:i,hasEvents:a>0,onClick:l,onKeyDown:u,children:(0,VR.dateI18n)("j",e,-e.getTimezoneOffset())})}function vM(e,t,n){const{formats:r}=(0,VR.getSettings)(),o=(0,VR.dateI18n)(r.date,e,-e.getTimezoneOffset());return t&&n>0?(0,a.sprintf)((0,a._n)("%1$s. Selected. There is %2$d event","%1$s. Selected. There are %2$d events",n),o,n):t?(0,a.sprintf)((0,a.__)("%1$s. Selected"),o):n>0?(0,a.sprintf)((0,a._n)("%1$s. There is %2$d event","%1$s. There are %2$d events",n),o,n):o}const bM=function({currentDate:e,onChange:t,events:n=[],isInvalidDate:r,onMonthPreviewed:o,startOfWeek:i=0}){const s=e?dM(e):new Date,{calendar:l,viewing:u,setSelected:d,setViewing:p,isSelected:f,viewPreviousMonth:h,viewNextMonth:m}=(({weekStartsOn:e=nM.SUNDAY,viewing:t=new Date,selected:n=[],numberOfMonths:r=1}={})=>{const[o,i]=(0,c.useState)(t),s=(0,c.useCallback)((()=>i(KR())),[i]),a=(0,c.useCallback)((e=>i((t=>UR(t,e)))),[]),l=(0,c.useCallback)((()=>i((e=>MI(e,1)))),[]),u=(0,c.useCallback)((()=>i((e=>RI(e,1)))),[]),d=(0,c.useCallback)((e=>i((t=>qR(t,e)))),[]),p=(0,c.useCallback)((()=>i((e=>XR(e,1)))),[]),f=(0,c.useCallback)((()=>i((e=>YR(e,1)))),[]),[h,m]=(0,c.useState)(n.map(oM)),g=(0,c.useCallback)((e=>h.findIndex((t=>MR(t,e)))>-1),[h]),v=(0,c.useCallback)(((e,t)=>{m(t?Array.isArray(e)?e:[e]:t=>t.concat(Array.isArray(e)?e:[e]))}),[]),b=(0,c.useCallback)((e=>m((t=>Array.isArray(e)?t.filter((t=>!e.map((e=>e.getTime())).includes(t.getTime()))):t.filter((t=>!MR(t,e)))))),[]),x=(0,c.useCallback)(((e,t)=>g(e)?b(e):v(e,t)),[b,g,v]),y=(0,c.useCallback)(((e,t,n)=>{m(n?ZR({start:e,end:t}):n=>n.concat(ZR({start:e,end:t})))}),[]),w=(0,c.useCallback)(((e,t)=>{m((n=>n.filter((n=>!ZR({start:e,end:t}).map((e=>e.getTime())).includes(n.getTime())))))}),[]),_=(0,c.useMemo)((()=>QR({start:JR(o),end:eM(RI(o,r-1))}).map((t=>tM({start:JR(t),end:eM(t)},{weekStartsOn:e}).map((t=>ZR({start:ZI(t,{weekStartsOn:e}),end:LR(t,{weekStartsOn:e})})))))),[o,e,r]);return{clearTime:oM,inRange:rM,viewing:o,setViewing:i,viewToday:s,viewMonth:a,viewPreviousMonth:l,viewNextMonth:u,viewYear:d,viewPreviousYear:p,viewNextYear:f,selected:h,setSelected:m,clearSelected:()=>m([]),isSelected:g,select:v,deselect:b,toggle:x,selectRange:y,deselectRange:w,calendar:_}})({selected:[TI(s)],viewing:TI(s),weekStartsOn:i}),[g,v]=(0,c.useState)(TI(s)),[b,x]=(0,c.useState)(!1),[y,w]=(0,c.useState)(e);return e!==y&&(w(e),d([TI(s)]),p(TI(s)),v(TI(s))),(0,_t.jsxs)(iM,{className:"components-datetime__date",role:"application","aria-label":(0,a.__)("Calendar"),children:[(0,_t.jsxs)(sM,{children:[(0,_t.jsx)(Jx,{icon:(0,a.isRTL)()?FR:BR,variant:"tertiary","aria-label":(0,a.__)("View previous month"),onClick:()=>{h(),v(MI(g,1)),o?.(TR(MI(u,1),mM))},size:"compact"}),(0,_t.jsxs)(aM,{level:3,children:[(0,_t.jsx)("strong",{children:(0,VR.dateI18n)("F",u,-u.getTimezoneOffset())})," ",(0,VR.dateI18n)("Y",u,-u.getTimezoneOffset())]}),(0,_t.jsx)(Jx,{icon:(0,a.isRTL)()?BR:FR,variant:"tertiary","aria-label":(0,a.__)("View next month"),onClick:()=>{m(),v(RI(g,1)),o?.(TR(RI(u,1),mM))},size:"compact"})]}),(0,_t.jsxs)(lM,{onFocus:()=>x(!0),onBlur:()=>x(!1),children:[l[0][0].map((e=>(0,_t.jsx)(cM,{children:(0,VR.dateI18n)("D",e,-e.getTimezoneOffset())},e.toString()))),l[0].map((e=>e.map(((e,i)=>RR(e,u)?(0,_t.jsx)(gM,{day:e,column:i+1,isSelected:f(e),isFocusable:MR(e,g),isFocusAllowed:b,isToday:AR(e,new Date),isInvalid:!!r&&r(e),numEvents:n.filter((t=>AR(t.date,e))).length,onClick:()=>{d([e]),v(e),t?.(TR(new Date(e.getFullYear(),e.getMonth(),e.getDate(),s.getHours(),s.getMinutes(),s.getSeconds(),s.getMilliseconds()),mM))},onKeyDown:t=>{let n;"ArrowLeft"===t.key&&(n=DR(e,(0,a.isRTL)()?1:-1)),"ArrowRight"===t.key&&(n=DR(e,(0,a.isRTL)()?-1:1)),"ArrowUp"===t.key&&(n=OR(e,1)),"ArrowDown"===t.key&&(n=zR(e,1)),"PageUp"===t.key&&(n=MI(e,1)),"PageDown"===t.key&&(n=RI(e,1)),"Home"===t.key&&(n=ZI(e)),"End"===t.key&&(n=TI(LR(e))),n&&(t.preventDefault(),v(n),RR(n,u)||(p(n),o?.(TR(n,mM))))}},e.toString()):null))))]})]})};function xM(e){const t=NI(e);return t.setSeconds(0,0),t}const yM=yl("div",{target:"evcr2319"})("box-sizing:border-box;font-size:",Fl.fontSize,";"),wM=yl("fieldset",{target:"evcr2318"})("border:0;margin:0 0 ",Il(4)," 0;padding:0;&:last-child{margin-bottom:0;}"),_M=yl("div",{target:"evcr2317"})({name:"pd0mhc",styles:"direction:ltr;display:flex"}),SM=Nl("&&& ",ib,"{padding-left:",Il(2),";padding-right:",Il(2),";text-align:center;}",""),CM=yl(gy,{target:"evcr2316"})(SM," width:",Il(9),";&&& ",ib,"{padding-right:0;}&&& ",Kv,"{border-right:0;border-top-right-radius:0;border-bottom-right-radius:0;}"),kM=yl("span",{target:"evcr2315"})("border-top:",Fl.borderWidth," solid ",zl.gray[700],";border-bottom:",Fl.borderWidth," solid ",zl.gray[700],";font-size:",Fl.fontSize,";line-height:calc(\n\t\t",Fl.controlHeight," - ",Fl.borderWidth," * 2\n\t);display:inline-block;"),jM=yl(gy,{target:"evcr2314"})(SM," width:",Il(9),";&&& ",ib,"{padding-left:0;}&&& ",Kv,"{border-left:0;border-top-left-radius:0;border-bottom-left-radius:0;}"),EM=yl("div",{target:"evcr2313"})({name:"1ff36h2",styles:"flex-grow:1"}),PM=yl(gy,{target:"evcr2312"})(SM," width:",Il(9),";"),NM=yl(gy,{target:"evcr2311"})(SM," width:",Il(14),";"),TM=yl("div",{target:"evcr2310"})({name:"ebu3jh",styles:"text-decoration:underline dotted"}),IM=()=>{const{timezone:e}=(0,VR.getSettings)(),t=(new Date).getTimezoneOffset()/60*-1;if(Number(e.offset)===t)return null;const n=Number(e.offset)>=0?"+":"",r=""!==e.abbr&&isNaN(Number(e.abbr))?e.abbr:`UTC${n}${e.offsetFormatted}`,o=e.string.replace("_"," "),i="UTC"===e.string?(0,a.__)("Coordinated Universal Time"):`(${r}) ${o}`;return 0===o.trim().length?(0,_t.jsx)(TM,{className:"components-datetime__timezone",children:r}):(0,_t.jsx)(ss,{placement:"top",text:i,children:(0,_t.jsx)(TM,{className:"components-datetime__timezone",children:r})})};const RM=(0,c.forwardRef)((function(e,t){const{label:n,...r}=e,o=r["aria-label"]||n;return(0,_t.jsx)(A_,{...r,"aria-label":o,ref:t,children:n})}));function MM({value:e,defaultValue:t,is12Hour:n,label:r,minutesProps:o,onChange:i}){const[l={hours:(new Date).getHours(),minutes:(new Date).getMinutes()},u]=f_({value:e,onChange:i,defaultValue:t}),d=l.hours<12?"AM":"PM";const p=l.hours%12||12;const f=e=>(t,{event:r})=>{if(!hM(r))return;const o=Number(t);u({...l,[e]:"hours"===e&&n?pM(o,"PM"===d):o})};const h=r?wM:c.Fragment;return(0,_t.jsxs)(h,{children:[r&&(0,_t.jsx)(Wx.VisualLabel,{as:"legend",children:r}),(0,_t.jsxs)(fy,{alignment:"left",expanded:!1,children:[(0,_t.jsxs)(_M,{className:"components-datetime__time-field components-datetime__time-field-time",children:[(0,_t.jsx)(CM,{className:"components-datetime__time-field-hours-input",label:(0,a.__)("Hours"),hideLabelFromVision:!0,__next40pxDefaultSize:!0,value:String(n?p:l.hours).padStart(2,"0"),step:1,min:n?1:0,max:n?12:23,required:!0,spinControls:"none",isPressEnterToChange:!0,isDragEnabled:!1,isShiftStepEnabled:!1,onChange:f("hours"),__unstableStateReducer:fM(2)}),(0,_t.jsx)(kM,{className:"components-datetime__time-separator","aria-hidden":"true",children:":"}),(0,_t.jsx)(jM,{className:s("components-datetime__time-field-minutes-input",o?.className),label:(0,a.__)("Minutes"),hideLabelFromVision:!0,__next40pxDefaultSize:!0,value:String(l.minutes).padStart(2,"0"),step:1,min:0,max:59,required:!0,spinControls:"none",isPressEnterToChange:!0,isDragEnabled:!1,isShiftStepEnabled:!1,onChange:(...e)=>{f("minutes")(...e),o?.onChange?.(...e)},__unstableStateReducer:fM(2),...o})]}),n&&(0,_t.jsxs)(x_,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,isBlock:!0,label:(0,a.__)("Select AM or PM"),hideLabelFromVision:!0,value:d,onChange:e=>{var t;(t=e,()=>{d!==t&&u({...l,hours:pM(p,"PM"===t)})})()},children:[(0,_t.jsx)(RM,{value:"AM",label:(0,a.__)("AM")}),(0,_t.jsx)(RM,{value:"PM",label:(0,a.__)("PM")})]})]})]})}const AM=["dmy","mdy","ymd"];function DM({is12Hour:e,currentTime:t,onChange:n,dateOrder:r,hideLabelFromVision:o=!1}){const[i,s]=(0,c.useState)((()=>t?xM(dM(t)):new Date));(0,c.useEffect)((()=>{s(t?xM(dM(t)):new Date)}),[t]);const l=[{value:"01",label:(0,a.__)("January")},{value:"02",label:(0,a.__)("February")},{value:"03",label:(0,a.__)("March")},{value:"04",label:(0,a.__)("April")},{value:"05",label:(0,a.__)("May")},{value:"06",label:(0,a.__)("June")},{value:"07",label:(0,a.__)("July")},{value:"08",label:(0,a.__)("August")},{value:"09",label:(0,a.__)("September")},{value:"10",label:(0,a.__)("October")},{value:"11",label:(0,a.__)("November")},{value:"12",label:(0,a.__)("December")}],{day:u,month:d,year:p,minutes:f,hours:h}=(0,c.useMemo)((()=>({day:TR(i,"dd"),month:TR(i,"MM"),year:TR(i,"yyyy"),minutes:TR(i,"mm"),hours:TR(i,"HH"),am:TR(i,"a")})),[i]),m=e=>(t,{event:r})=>{if(!hM(r))return;const o=Number(t),a=GR(i,{[e]:o});s(a),n?.(TR(a,mM))},g=(0,_t.jsx)(PM,{className:"components-datetime__time-field components-datetime__time-field-day",label:(0,a.__)("Day"),hideLabelFromVision:!0,__next40pxDefaultSize:!0,value:u,step:1,min:1,max:31,required:!0,spinControls:"none",isPressEnterToChange:!0,isDragEnabled:!1,isShiftStepEnabled:!1,onChange:m("date")},"day"),v=(0,_t.jsx)(EM,{children:(0,_t.jsx)(cS,{className:"components-datetime__time-field components-datetime__time-field-month",label:(0,a.__)("Month"),hideLabelFromVision:!0,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:d,options:l,onChange:e=>{const t=UR(i,Number(e)-1);s(t),n?.(TR(t,mM))}})},"month"),b=(0,_t.jsx)(NM,{className:"components-datetime__time-field components-datetime__time-field-year",label:(0,a.__)("Year"),hideLabelFromVision:!0,__next40pxDefaultSize:!0,value:p,step:1,min:1,max:9999,required:!0,spinControls:"none",isPressEnterToChange:!0,isDragEnabled:!1,isShiftStepEnabled:!1,onChange:m("year"),__unstableStateReducer:fM(4)},"year"),x=e?"mdy":"dmy",y=(r&&AM.includes(r)?r:x).split("").map((e=>{switch(e){case"d":return g;case"m":return v;case"y":return b;default:return null}}));return(0,_t.jsxs)(yM,{className:"components-datetime__time",children:[(0,_t.jsxs)(wM,{children:[o?(0,_t.jsx)(Sl,{as:"legend",children:(0,a.__)("Time")}):(0,_t.jsx)(Wx.VisualLabel,{as:"legend",className:"components-datetime__time-legend",children:(0,a.__)("Time")}),(0,_t.jsxs)(fy,{className:"components-datetime__time-wrapper",children:[(0,_t.jsx)(MM,{value:{hours:Number(h),minutes:Number(f)},is12Hour:e,onChange:({hours:e,minutes:t})=>{const r=GR(i,{hours:e,minutes:t});s(r),n?.(TR(r,mM))}}),(0,_t.jsx)(zg,{}),(0,_t.jsx)(IM,{})]})]}),(0,_t.jsxs)(wM,{children:[o?(0,_t.jsx)(Sl,{as:"legend",children:(0,a.__)("Date")}):(0,_t.jsx)(Wx.VisualLabel,{as:"legend",className:"components-datetime__time-legend",children:(0,a.__)("Date")}),(0,_t.jsx)(fy,{className:"components-datetime__time-wrapper",children:y})]})]})}DM.TimeInput=MM,Object.assign(DM.TimeInput,{displayName:"TimePicker.TimeInput"});const zM=DM;const OM=yl(dk,{target:"e1p5onf00"})({name:"1khn195",styles:"box-sizing:border-box"}),LM=()=>{};const FM=(0,c.forwardRef)((function({currentDate:e,is12Hour:t,dateOrder:n,isInvalidDate:r,onMonthPreviewed:o=LM,onChange:i,events:s,startOfWeek:a},l){return(0,_t.jsx)(OM,{ref:l,className:"components-datetime",spacing:4,children:(0,_t.jsxs)(_t.Fragment,{children:[(0,_t.jsx)(zM,{currentTime:e,onChange:i,is12Hour:t,dateOrder:n}),(0,_t.jsx)(bM,{currentDate:e,onChange:i,isInvalidDate:r,events:s,onMonthPreviewed:o,startOfWeek:a})]})})})),BM=FM,VM=[{name:(0,a._x)("None","Size of a UI element"),slug:"none"},{name:(0,a._x)("Small","Size of a UI element"),slug:"small"},{name:(0,a._x)("Medium","Size of a UI element"),slug:"medium"},{name:(0,a._x)("Large","Size of a UI element"),slug:"large"},{name:(0,a._x)("Extra Large","Size of a UI element"),slug:"xlarge"}],$M={BaseControl:{_overrides:{__associatedWPComponentName:"DimensionControl"}}};const HM=function(e){const{__next40pxDefaultSize:t=!1,__nextHasNoMarginBottom:n=!1,label:r,value:o,sizes:i=VM,icon:l,onChange:c,className:u=""}=e;Xi()("wp.components.DimensionControl",{since:"6.7",version:"7.0"}),Ux({componentName:"DimensionControl",__next40pxDefaultSize:t,size:void 0});const d=(0,_t.jsxs)(_t.Fragment,{children:[l&&(0,_t.jsx)(Xx,{icon:l}),r]});return(0,_t.jsx)(gs,{value:$M,children:(0,_t.jsx)(cS,{__next40pxDefaultSize:t,__shouldNotWarnDeprecated36pxSize:!0,__nextHasNoMarginBottom:n,className:s(u,"block-editor-dimension-control"),label:d,hideLabelFromVision:!1,value:o,onChange:e=>{const t=((e,t)=>e.find((e=>t===e.slug)))(i,e);t&&o!==t.slug?"function"==typeof c&&c(t.slug):c?.(void 0)},options:(e=>{const t=e.map((({name:e,slug:t})=>({label:e,value:t})));return[{label:(0,a.__)("Default"),value:""},...t]})(i)})})};const WM={name:"u2jump",styles:"position:relative;pointer-events:none;&::after{content:'';position:absolute;top:0;right:0;bottom:0;left:0;}*{pointer-events:none;}"},UM=(0,c.createContext)(!1),{Consumer:GM,Provider:KM}=UM;function qM({className:e,children:t,isDisabled:n=!0,...r}){const o=il();return(0,_t.jsx)(KM,{value:n,children:(0,_t.jsx)("div",{inert:n?"true":void 0,className:n?o(WM,e,"components-disabled"):void 0,...r,children:t})})}qM.Context=UM,qM.Consumer=GM;const YM=qM,XM=(0,c.forwardRef)((({visible:e,children:t,...n},r)=>{const o=Yn({open:e});return(0,_t.jsx)(Jr,{store:o,ref:r,...n,children:t})})),ZM="is-dragging-components-draggable";const QM=function({children:e,onDragStart:t,onDragOver:n,onDragEnd:r,appendToOwnerDocument:o=!1,cloneClassname:i,elementId:s,transferData:a,__experimentalTransferDataType:u="text",__experimentalDragComponent:d}){const p=(0,c.useRef)(null),f=(0,c.useRef)((()=>{}));return(0,c.useEffect)((()=>()=>{f.current()}),[]),(0,_t.jsxs)(_t.Fragment,{children:[e({onDraggableStart:function(e){const{ownerDocument:r}=e.target;e.dataTransfer.setData(u,JSON.stringify(a));const c=r.createElement("div");c.style.top="0",c.style.left="0";const d=r.createElement("div");"function"==typeof e.dataTransfer.setDragImage&&(d.classList.add("components-draggable__invisible-drag-image"),r.body.appendChild(d),e.dataTransfer.setDragImage(d,0,0)),c.classList.add("components-draggable__clone"),i&&c.classList.add(i);let h=0,m=0;if(p.current){h=e.clientX,m=e.clientY,c.style.transform=`translate( ${h}px, ${m}px )`;const t=r.createElement("div");t.innerHTML=p.current.innerHTML,c.appendChild(t),r.body.appendChild(c)}else{const e=r.getElementById(s),t=e.getBoundingClientRect(),n=e.parentNode,i=t.top,a=t.left;c.style.width=`${t.width+0}px`;const l=e.cloneNode(!0);l.id=`clone-${s}`,h=a-0,m=i-0,c.style.transform=`translate( ${h}px, ${m}px )`,Array.from(l.querySelectorAll("iframe")).forEach((e=>e.parentNode?.removeChild(e))),c.appendChild(l),o?r.body.appendChild(c):n?.appendChild(c)}let g=e.clientX,v=e.clientY;const b=(0,l.throttle)((function(e){if(g===e.clientX&&v===e.clientY)return;const t=h+e.clientX-g,r=m+e.clientY-v;c.style.transform=`translate( ${t}px, ${r}px )`,g=e.clientX,v=e.clientY,h=t,m=r,n&&n(e)}),16);r.addEventListener("dragover",b),r.body.classList.add(ZM),t&&t(e),f.current=()=>{c&&c.parentNode&&c.parentNode.removeChild(c),d&&d.parentNode&&d.parentNode.removeChild(d),r.body.classList.remove(ZM),r.removeEventListener("dragover",b)}},onDraggableEnd:function(e){e.preventDefault(),f.current(),r&&r(e)}}),d&&(0,_t.jsx)("div",{className:"components-draggable-drag-component-root",style:{display:"none"},ref:p,children:d})]})},JM=(0,_t.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_t.jsx)(n.Path,{d:"M18.5 15v3.5H13V6.7l4.5 4.1 1-1.1-6.2-5.8-5.8 5.8 1 1.1 4-4v11.7h-6V15H4v5h16v-5z"})});const eA=function({className:e,label:t,onFilesDrop:n,onHTMLDrop:r,onDrop:o,isEligible:i=()=>!0,...u}){const[d,p]=(0,c.useState)(),[f,h]=(0,c.useState)(),[m,g]=(0,c.useState)(),v=(0,l.__experimentalUseDropZone)({onDrop(e){if(!e.dataTransfer)return;const t=(0,vN.getFilesFromDataTransfer)(e.dataTransfer),i=e.dataTransfer.getData("text/html");i&&r?r(i):t.length&&n?n(t):o&&o(e)},onDragStart(e){p(!0),e.dataTransfer&&(e.dataTransfer.types.includes("text/html")?g(!!r):e.dataTransfer.types.includes("Files")||(0,vN.getFilesFromDataTransfer)(e.dataTransfer).length>0?g(!!n):g(!!o&&i(e.dataTransfer)))},onDragEnd(){h(!1),p(!1),g(void 0)},onDragEnter(){h(!0)},onDragLeave(){h(!1)}}),b=s("components-drop-zone",e,{"is-active":m,"is-dragging-over-document":d,"is-dragging-over-element":f});return(0,_t.jsx)("div",{...u,ref:v,className:b,children:(0,_t.jsx)("div",{className:"components-drop-zone__content",children:(0,_t.jsxs)("div",{className:"components-drop-zone__content-inner",children:[(0,_t.jsx)(oS,{icon:JM,className:"components-drop-zone__content-icon"}),(0,_t.jsx)("span",{className:"components-drop-zone__content-text",children:t||(0,a.__)("Drop files to upload")})]})})})};function tA({children:e}){return Xi()("wp.components.DropZoneProvider",{since:"5.8",hint:"wp.component.DropZone no longer needs a provider. wp.components.DropZoneProvider is safe to remove from your code."}),e}const nA=(0,_t.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_t.jsx)(n.Path,{d:"M5 17.7c.4.5.8.9 1.2 1.2l1.1-1.4c-.4-.3-.7-.6-1-1L5 17.7zM5 6.3l1.4 1.1c.3-.4.6-.7 1-1L6.3 5c-.5.4-.9.8-1.3 1.3zm.1 7.8l-1.7.5c.2.6.4 1.1.7 1.6l1.5-.8c-.2-.4-.4-.8-.5-1.3zM4.8 12v-.7L3 11.1v1.8l1.7-.2c.1-.2.1-.5.1-.7zm3 7.9c.5.3 1.1.5 1.6.7l.5-1.7c-.5-.1-.9-.3-1.3-.5l-.8 1.5zM19 6.3c-.4-.5-.8-.9-1.2-1.2l-1.1 1.4c.4.3.7.6 1 1L19 6.3zm-.1 3.6l1.7-.5c-.2-.6-.4-1.1-.7-1.6l-1.5.8c.2.4.4.8.5 1.3zM5.6 8.6l-1.5-.8c-.3.5-.5 1-.7 1.6l1.7.5c.1-.5.3-.9.5-1.3zm2.2-4.5l.8 1.5c.4-.2.8-.4 1.3-.5l-.5-1.7c-.6.2-1.1.4-1.6.7zm8.8 13.5l1.1 1.4c.5-.4.9-.8 1.2-1.2l-1.4-1.1c-.2.3-.5.6-.9.9zm1.8-2.2l1.5.8c.3-.5.5-1.1.7-1.6l-1.7-.5c-.1.5-.3.9-.5 1.3zm2.6-4.3l-1.7.2v1.4l1.7.2V12v-.9zM11.1 3l.2 1.7h1.4l.2-1.7h-1.8zm3 2.1c.5.1.9.3 1.3.5l.8-1.5c-.5-.3-1.1-.5-1.6-.7l-.5 1.7zM12 19.2h-.7l-.2 1.8h1.8l-.2-1.7c-.2-.1-.5-.1-.7-.1zm2.1-.3l.5 1.7c.6-.2 1.1-.4 1.6-.7l-.8-1.5c-.4.2-.8.4-1.3.5z"})});function rA(e=[],t="90deg"){const n=100/e.length,r=e.map(((e,t)=>`${e} ${t*n}%, ${e} ${(t+1)*n}%`)).join(", ");return`linear-gradient( ${t}, ${r} )`}_v([Sv]);const oA=function({values:e}){return e?(0,_t.jsx)(F_,{colorValue:rA(e,"135deg")}):(0,_t.jsx)(Xx,{icon:nA})};function iA({label:e,value:t,colors:n,disableCustomColors:r,enableAlpha:o,onChange:i}){const[s,u]=(0,c.useState)(!1),d=(0,l.useInstanceId)(iA,"color-list-picker-option"),p=`${d}__label`,f=`${d}__content`;return(0,_t.jsxs)(_t.Fragment,{children:[(0,_t.jsx)(Jx,{__next40pxDefaultSize:!0,className:"components-color-list-picker__swatch-button",id:p,onClick:()=>u((e=>!e)),"aria-expanded":s,"aria-controls":f,icon:t?(0,_t.jsx)(F_,{colorValue:t,className:"components-color-list-picker__swatch-color"}):(0,_t.jsx)(Xx,{icon:nA}),text:e}),(0,_t.jsx)("div",{role:"group",id:f,"aria-labelledby":p,"aria-hidden":!s,children:s&&(0,_t.jsx)(kk,{"aria-label":(0,a.__)("Color options"),className:"components-color-list-picker__color-picker",colors:n,value:t,clearable:!1,onChange:i,disableCustomColors:r,enableAlpha:o})})]})}const sA=function({colors:e,labels:t,value:n=[],disableCustomColors:r,enableAlpha:o,onChange:i}){return(0,_t.jsx)("div",{className:"components-color-list-picker",children:t.map(((t,s)=>(0,_t.jsx)(iA,{label:t,value:n[s],colors:e,disableCustomColors:r,enableAlpha:o,onChange:e=>{const t=n.slice();t[s]=e,i(t)}},s)))})},aA=["#333","#CCC"];function lA({value:e,onChange:t}){const n=!!e,r=n?e:aA,o=rA(r),i=(s=r).map(((e,t)=>({position:100*t/(s.length-1),color:e})));var s;return(0,_t.jsx)(XP,{disableInserter:!0,background:o,hasGradient:n,value:i,onChange:e=>{const n=function(e=[]){return e.map((({color:e})=>e))}(e);t(n)}})}const cA=function({asButtons:e,loop:t,clearable:n=!0,unsetable:r=!0,colorPalette:o,duotonePalette:i,disableCustomColors:s,disableCustomDuotone:l,value:u,onChange:d,"aria-label":p,"aria-labelledby":f,...h}){const[m,g]=(0,c.useMemo)((()=>{return!(e=o)||e.length<2?["#000","#fff"]:e.map((({color:e})=>({color:e,brightness:yv(e).brightness()}))).reduce((([e,t],n)=>[n.brightness<=e.brightness?n:e,n.brightness>=t.brightness?n:t]),[{brightness:1,color:""},{brightness:0,color:""}]).map((({color:e})=>e));var e}),[o]),v="unset"===u,b=(0,a.__)("Unset"),x=(0,_t.jsx)(uk.Option,{value:"unset",isSelected:v,tooltipText:b,"aria-label":b,className:"components-duotone-picker__color-indicator",onClick:()=>{d(v?void 0:"unset")}},"unset"),y=i.map((({colors:e,slug:t,name:n})=>{const r={background:rA(e,"135deg"),color:"transparent"},o=null!=n?n:(0,a.sprintf)((0,a.__)("Duotone code: %s"),t),i=n?(0,a.sprintf)((0,a.__)("Duotone: %s"),n):o,s=us()(e,u);return(0,_t.jsx)(uk.Option,{value:e,isSelected:s,"aria-label":i,tooltipText:o,style:r,onClick:()=>{d(s?void 0:e)}},t)}));let w;if(e)w={asButtons:!0};else{const e={asButtons:!1,loop:t};w=p?{...e,"aria-label":p}:f?{...e,"aria-labelledby":f}:{...e,"aria-label":(0,a.__)("Custom color picker.")}}const _=r?[x,...y]:y;return(0,_t.jsx)(uk,{...h,...w,options:_,actions:!!n&&(0,_t.jsx)(uk.ButtonAction,{onClick:()=>d(void 0),accessibleWhenDisabled:!0,disabled:!u,children:(0,a.__)("Clear")}),children:(0,_t.jsx)(zg,{paddingTop:0===_.length?0:4,children:(0,_t.jsxs)(dk,{spacing:3,children:[!s&&!l&&(0,_t.jsx)(lA,{value:v?void 0:u,onChange:d}),!l&&(0,_t.jsx)(sA,{labels:[(0,a.__)("Shadows"),(0,a.__)("Highlights")],colors:o,value:v?void 0:u,disableCustomColors:s,enableAlpha:!0,onChange:e=>{e[0]||(e[0]=m),e[1]||(e[1]=g);const t=e.length>=2?e:void 0;d(t)}})]})})})};const uA=(0,c.forwardRef)((function(e,t){const{href:n,children:r,className:o,rel:i="",...l}=e,c=[...new Set([...i.split(" "),"external","noreferrer","noopener"].filter(Boolean))].join(" "),u=s("components-external-link",o),d=!!n?.startsWith("#");return(0,_t.jsxs)("a",{...l,className:u,href:n,onClick:t=>{d&&t.preventDefault(),e.onClick&&e.onClick(t)},target:"_blank",rel:c,ref:t,children:[(0,_t.jsx)("span",{className:"components-external-link__contents",children:r}),(0,_t.jsx)("span",{className:"components-external-link__icon","aria-label":(0,a.__)("(opens in a new tab)"),children:"↗"})]})})),dA={width:200,height:170},pA=["avi","mpg","mpeg","mov","mp4","m4v","ogg","ogv","webm","wmv"];function fA(e){return Math.round(100*e)}const hA=yl("div",{target:"eeew7dm8"})({name:"jqnsxy",styles:"background-color:transparent;display:flex;text-align:center;width:100%"}),mA=yl("div",{target:"eeew7dm7"})("align-items:center;border-radius:",Fl.radiusSmall,";cursor:pointer;display:inline-flex;justify-content:center;margin:auto;position:relative;height:100%;&:after{border-radius:inherit;bottom:0;box-shadow:inset 0 0 0 1px rgba( 0, 0, 0, 0.1 );content:'';left:0;pointer-events:none;position:absolute;right:0;top:0;}img,video{border-radius:inherit;box-sizing:border-box;display:block;height:auto;margin:0;max-height:100%;max-width:100%;pointer-events:none;user-select:none;width:auto;}"),gA=yl("div",{target:"eeew7dm6"})("background:",zl.gray[100],";border-radius:inherit;box-sizing:border-box;height:",dA.height,"px;max-width:280px;min-width:",dA.width,"px;width:100%;"),vA=yl(ej,{target:"eeew7dm5"})({name:"1d3w5wq",styles:"width:100%"});var bA={name:"1mn7kwb",styles:"padding-bottom:1em"};const xA=({__nextHasNoMarginBottom:e})=>e?void 0:bA;var yA={name:"1mn7kwb",styles:"padding-bottom:1em"};const wA=({hasHelpText:e=!1})=>e?yA:void 0,_A=yl(kg,{target:"eeew7dm4"})("max-width:320px;padding-top:1em;",wA," ",xA,";"),SA=yl("div",{target:"eeew7dm3"})("left:50%;overflow:hidden;pointer-events:none;position:absolute;top:50%;transform:translate3d( -50%, -50%, 0 );z-index:1;@media not ( prefers-reduced-motion ){transition:opacity 100ms linear;}opacity:",(({showOverlay:e})=>e?1:0),";"),CA=yl("div",{target:"eeew7dm2"})({name:"1yzbo24",styles:"background:rgba( 255, 255, 255, 0.4 );backdrop-filter:blur( 16px ) saturate( 180% );position:absolute;transform:translateZ( 0 )"}),kA=yl(CA,{target:"eeew7dm1"})({name:"1sw8ur",styles:"height:1px;left:1px;right:1px"}),jA=yl(CA,{target:"eeew7dm0"})({name:"188vg4t",styles:"width:1px;top:1px;bottom:1px"}),EA=()=>{};function PA({__nextHasNoMarginBottom:e,hasHelpText:t,onChange:n=EA,point:r={x:.5,y:.5}}){const o=fA(r.x),i=fA(r.y),s=(e,t)=>{if(void 0===e)return;const o=parseInt(e,10);isNaN(o)||n({...r,[t]:o/100})};return(0,_t.jsxs)(_A,{className:"focal-point-picker__controls",__nextHasNoMarginBottom:e,hasHelpText:t,gap:4,children:[(0,_t.jsx)(NA,{label:(0,a.__)("Left"),"aria-label":(0,a.__)("Focal point left position"),value:[o,"%"].join(""),onChange:e=>s(e,"x"),dragDirection:"e"}),(0,_t.jsx)(NA,{label:(0,a.__)("Top"),"aria-label":(0,a.__)("Focal point top position"),value:[i,"%"].join(""),onChange:e=>s(e,"y"),dragDirection:"s"})]})}function NA(e){return(0,_t.jsx)(vA,{__next40pxDefaultSize:!0,className:"focal-point-picker__controls-position-unit-control",labelPosition:"top",max:100,min:0,units:[{value:"%",label:"%"}],...e})}const TA=yl("div",{target:"e19snlhg0"})("background-color:transparent;cursor:grab;height:40px;margin:-20px 0 0 -20px;position:absolute;user-select:none;width:40px;will-change:transform;z-index:10000;background:rgba( 255, 255, 255, 0.4 );border:1px solid rgba( 255, 255, 255, 0.4 );border-radius:",Fl.radiusRound,";backdrop-filter:blur( 16px ) saturate( 180% );box-shadow:rgb( 0 0 0 / 10% ) 0px 0px 8px;@media not ( prefers-reduced-motion ){transition:transform 100ms linear;}",(({isDragging:e})=>e&&"\n\t\t\tbox-shadow: rgb( 0 0 0 / 12% ) 0px 0px 10px;\n\t\t\ttransform: scale( 1.1 );\n\t\t\tcursor: grabbing;\n\t\t\t"),";");function IA({left:e="50%",top:t="50%",...n}){const r={left:e,top:t};return(0,_t.jsx)(TA,{...n,className:"components-focal-point-picker__icon_container",style:r})}function RA({bounds:e,...t}){return(0,_t.jsxs)(SA,{...t,className:"components-focal-point-picker__grid",style:{width:e.width,height:e.height},children:[(0,_t.jsx)(kA,{style:{top:"33%"}}),(0,_t.jsx)(kA,{style:{top:"66%"}}),(0,_t.jsx)(jA,{style:{left:"33%"}}),(0,_t.jsx)(jA,{style:{left:"66%"}})]})}function MA({alt:e,autoPlay:t,src:n,onLoad:r,mediaRef:o,muted:i=!0,...s}){if(!n)return(0,_t.jsx)(gA,{className:"components-focal-point-picker__media components-focal-point-picker__media--placeholder",ref:o,...s});return function(e=""){return!!e&&(e.startsWith("data:video/")||pA.includes(function(e=""){const t=e.split(".");return t[t.length-1]}(e)))}(n)?(0,_t.jsx)("video",{...s,autoPlay:t,className:"components-focal-point-picker__media components-focal-point-picker__media--video",loop:!0,muted:i,onLoadedData:r,ref:o,src:n}):(0,_t.jsx)("img",{...s,alt:e,className:"components-focal-point-picker__media components-focal-point-picker__media--image",onLoad:r,ref:o,src:n})}const AA=function e({__nextHasNoMarginBottom:t,autoPlay:n=!0,className:r,help:o,label:i,onChange:u,onDrag:d,onDragEnd:p,onDragStart:f,resolvePoint:h,url:m,value:g={x:.5,y:.5},...v}){const[b,x]=(0,c.useState)(g),[y,w]=(0,c.useState)(!1),{startDrag:_,endDrag:S,isDragging:C}=(0,l.__experimentalUseDragging)({onDragStart:e=>{E.current?.focus();const t=I(e);t&&(f?.(t,e),x(t))},onDragMove:e=>{e.preventDefault();const t=I(e);t&&(d?.(t,e),x(t))},onDragEnd:()=>{p?.(),u?.(b)}}),{x:k,y:j}=C?b:g,E=(0,c.useRef)(null),[P,N]=(0,c.useState)(dA),T=(0,c.useRef)((()=>{if(!E.current)return;const{clientWidth:e,clientHeight:t}=E.current;N(e>0&&t>0?{width:e,height:t}:{...dA})}));(0,c.useEffect)((()=>{const e=T.current;if(!E.current)return;const{defaultView:t}=E.current.ownerDocument;return t?.addEventListener("resize",e),()=>t?.removeEventListener("resize",e)}),[]),(0,l.useIsomorphicLayoutEffect)((()=>{T.current()}),[]);const I=({clientX:e,clientY:t,shiftKey:n})=>{if(!E.current)return;const{top:r,left:o}=E.current.getBoundingClientRect();let i=(e-o)/P.width,s=(t-r)/P.height;return n&&(i=.1*Math.round(i/.1),s=.1*Math.round(s/.1)),R({x:i,y:s})},R=e=>{var t;const n=null!==(t=h?.(e))&&void 0!==t?t:e;n.x=Math.max(0,Math.min(n.x,1)),n.y=Math.max(0,Math.min(n.y,1));const r=e=>Math.round(100*e)/100;return{x:r(n.x),y:r(n.y)}},M={left:void 0!==k?k*P.width:.5*P.width,top:void 0!==j?j*P.height:.5*P.height},A=s("components-focal-point-picker-control",r),D=`inspector-focal-point-picker-control-${(0,l.useInstanceId)(e)}`;return fs((()=>{w(!0);const e=window.setTimeout((()=>{w(!1)}),600);return()=>window.clearTimeout(e)}),[k,j]),(0,_t.jsxs)(Wx,{...v,__nextHasNoMarginBottom:t,__associatedWPComponentName:"FocalPointPicker",label:i,id:D,help:o,className:A,children:[(0,_t.jsx)(hA,{className:"components-focal-point-picker-wrapper",children:(0,_t.jsxs)(mA,{className:"components-focal-point-picker",onKeyDown:e=>{const{code:t,shiftKey:n}=e;if(!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(t))return;e.preventDefault();const r={x:k,y:j},o=n?.1:.01,i="ArrowUp"===t||"ArrowLeft"===t?-1*o:o,s="ArrowUp"===t||"ArrowDown"===t?"y":"x";r[s]=r[s]+i,u?.(R(r))},onMouseDown:_,onBlur:()=>{C&&S()},ref:E,role:"button",tabIndex:-1,children:[(0,_t.jsx)(RA,{bounds:P,showOverlay:y}),(0,_t.jsx)(MA,{alt:(0,a.__)("Media preview"),autoPlay:n,onLoad:T.current,src:m}),(0,_t.jsx)(IA,{...M,isDragging:C})]})}),(0,_t.jsx)(PA,{__nextHasNoMarginBottom:t,hasHelpText:!!o,point:{x:k,y:j},onChange:e=>{u?.(R(e))}})]})};function DA({iframeRef:e,...t}){const n=(0,l.useMergeRefs)([e,(0,l.useFocusableIframe)()]);return Xi()("wp.components.FocusableIframe",{since:"5.9",alternative:"wp.compose.useFocusableIframe"}),(0,_t.jsx)("iframe",{ref:n,...t})}function zA(e){const[t,...n]=e;if(!t)return null;const[,r]=Kk(t.size);return n.every((e=>{const[,t]=Kk(e.size);return t===r}))?r:null}const OA=yl("fieldset",{target:"e8tqeku4"})({name:"k2q51s",styles:"border:0;margin:0;padding:0;display:contents"}),LA=yl(fy,{target:"e8tqeku3"})("height:",Il(4),";"),FA=yl(Jx,{target:"e8tqeku2"})("margin-top:",Il(-1),";"),BA=yl(Wx.VisualLabel,{target:"e8tqeku1"})("display:flex;gap:",Il(1),";justify-content:flex-start;margin-bottom:0;"),VA=yl("span",{target:"e8tqeku0"})("color:",zl.gray[700],";"),$A={key:"default",name:(0,a.__)("Default"),value:void 0},HA={key:"custom",name:(0,a.__)("Custom")},WA=e=>{var t;const{__next40pxDefaultSize:n,fontSizes:r,value:o,disableCustomFontSizes:i,size:s,onChange:l,onSelectCustom:c}=e,u=!!zA(r),d=[$A,...r.map((e=>{let t;if(u){const[n]=Kk(e.size);void 0!==n&&(t=String(n))}else(function(e){return/^[\d\.]+(px|em|rem|vw|vh|%|svw|lvw|dvw|svh|lvh|dvh|vi|svi|lvi|dvi|vb|svb|lvb|dvb|vmin|svmin|lvmin|dvmin|vmax|svmax|lvmax|dvmax)?$/i.test(String(e))})(e.size)&&(t=String(e.size));return{key:e.slug,name:e.name||e.slug,value:e.size,hint:t}})),...i?[]:[HA]],p=o?null!==(t=d.find((e=>e.value===o)))&&void 0!==t?t:HA:$A;return(0,_t.jsx)(PI,{__next40pxDefaultSize:n,__shouldNotWarnDeprecated36pxSize:!0,className:"components-font-size-picker__select",label:(0,a.__)("Font size"),hideLabelFromVision:!0,describedBy:(0,a.sprintf)((0,a.__)("Currently selected font size: %s"),p.name),options:d,value:p,showSelectedHint:!0,onChange:({selectedItem:e})=>{e===HA?c():l(e.value)},size:s})},UA=[(0,a.__)("S"),(0,a.__)("M"),(0,a.__)("L"),(0,a.__)("XL"),(0,a.__)("XXL")],GA=[(0,a.__)("Small"),(0,a.__)("Medium"),(0,a.__)("Large"),(0,a.__)("Extra Large"),(0,a.__)("Extra Extra Large")],KA=e=>{const{fontSizes:t,value:n,__next40pxDefaultSize:r,size:o,onChange:i}=e;return(0,_t.jsx)(x_,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:r,__shouldNotWarnDeprecated36pxSize:!0,label:(0,a.__)("Font size"),hideLabelFromVision:!0,value:n,onChange:i,isBlock:!0,size:o,children:t.map(((e,t)=>(0,_t.jsx)(RM,{value:e.size,label:UA[t],"aria-label":e.name||GA[t],showTooltip:!0},e.slug)))})},qA=["px","em","rem","vw","vh"],YA=(0,c.forwardRef)(((e,t)=>{const{__next40pxDefaultSize:n=!1,fallbackFontSize:r,fontSizes:o=[],disableCustomFontSizes:i=!1,onChange:s,size:l="default",units:u=qA,value:d,withSlider:p=!1,withReset:f=!0}=e,h=qk({availableUnits:u}),m=o.find((e=>e.size===d)),g=!!d&&!m,[v,b]=(0,c.useState)(g);let x;x=!i&&v?"custom":o.length>5?"select":"togglegroup";const y=(0,c.useMemo)((()=>{switch(x){case"custom":return(0,a.__)("Custom");case"togglegroup":if(m)return m.name||GA[o.indexOf(m)];break;case"select":const e=zA(o);if(e)return`(${e})`}return""}),[x,m,o]);if(0===o.length&&i)return null;const w="string"==typeof d||"string"==typeof o[0]?.size,[_,S]=Kk(d,h),C=!!S&&["em","rem","vw","vh"].includes(S),k=void 0===d;return Ux({componentName:"FontSizePicker",__next40pxDefaultSize:n,size:l}),(0,_t.jsxs)(OA,{ref:t,className:"components-font-size-picker",children:[(0,_t.jsx)(Sl,{as:"legend",children:(0,a.__)("Font size")}),(0,_t.jsx)(zg,{children:(0,_t.jsxs)(LA,{className:"components-font-size-picker__header",children:[(0,_t.jsxs)(BA,{"aria-label":`${(0,a.__)("Size")} ${y||""}`,children:[(0,a.__)("Size"),y&&(0,_t.jsx)(VA,{className:"components-font-size-picker__header__hint",children:y})]}),!i&&(0,_t.jsx)(FA,{label:"custom"===x?(0,a.__)("Use size preset"):(0,a.__)("Set custom size"),icon:kj,onClick:()=>b(!v),isPressed:"custom"===x,size:"small"})]})}),(0,_t.jsxs)("div",{children:["select"===x&&(0,_t.jsx)(WA,{__next40pxDefaultSize:n,fontSizes:o,value:d,disableCustomFontSizes:i,size:l,onChange:e=>{void 0===e?s?.(void 0):s?.(w?e:Number(e),o.find((t=>t.size===e)))},onSelectCustom:()=>b(!0)}),"togglegroup"===x&&(0,_t.jsx)(KA,{fontSizes:o,value:d,__next40pxDefaultSize:n,size:l,onChange:e=>{void 0===e?s?.(void 0):s?.(w?e:Number(e),o.find((t=>t.size===e)))}}),"custom"===x&&(0,_t.jsxs)(kg,{className:"components-font-size-picker__custom-size-control",children:[(0,_t.jsx)(Fg,{isBlock:!0,children:(0,_t.jsx)(ej,{__next40pxDefaultSize:n,__shouldNotWarnDeprecated36pxSize:!0,label:(0,a.__)("Custom"),labelPosition:"top",hideLabelFromVision:!0,value:d,onChange:e=>{b(!0),s?.(void 0===e?void 0:w?e:parseInt(e,10))},size:l,units:w?h:[],min:0})}),p&&(0,_t.jsx)(Fg,{isBlock:!0,children:(0,_t.jsx)(zg,{marginX:2,marginBottom:0,children:(0,_t.jsx)(ZS,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:n,__shouldNotWarnDeprecated36pxSize:!0,className:"components-font-size-picker__custom-input",label:(0,a.__)("Custom Size"),hideLabelFromVision:!0,value:_,initialPosition:r,withInputField:!1,onChange:e=>{b(!0),s?.(void 0===e?void 0:w?e+(null!=S?S:"px"):e)},min:0,max:C?10:100,step:C?.1:1})})}),f&&(0,_t.jsx)(Fg,{children:(0,_t.jsx)(Qx,{disabled:k,accessibleWhenDisabled:!0,onClick:()=>{s?.(void 0)},variant:"secondary",__next40pxDefaultSize:!0,size:"__unstable-large"===l||e.__next40pxDefaultSize?"default":"small",children:(0,a.__)("Reset")})})]})]})]})})),XA=YA;const ZA=function({accept:e,children:t,multiple:n=!1,onChange:r,onClick:o,render:i,...s}){const a=(0,c.useRef)(null),l=()=>{a.current?.click()};i||Ux({componentName:"FormFileUpload",__next40pxDefaultSize:s.__next40pxDefaultSize,size:s.size});const u=i?i({openFileDialog:l}):(0,_t.jsx)(Jx,{onClick:l,...s,children:t}),d=!(globalThis.window?.navigator.userAgent.includes("Safari")&&!globalThis.window?.navigator.userAgent.includes("Chrome")&&!globalThis.window?.navigator.userAgent.includes("Chromium"))&&e?.includes("image/*")?`${e}, image/heic, image/heif`:e;return(0,_t.jsxs)("div",{className:"components-form-file-upload",children:[u,(0,_t.jsx)("input",{type:"file",ref:a,multiple:n,style:{display:"none"},accept:d,onChange:r,onClick:o,"data-testid":"form-file-upload-input"})]})},QA=()=>{};const JA=(0,c.forwardRef)((function(e,t){const{className:n,checked:r,id:o,disabled:i,onChange:a=QA,...l}=e,c=s("components-form-toggle",n,{"is-checked":r,"is-disabled":i});return(0,_t.jsxs)("span",{className:c,children:[(0,_t.jsx)("input",{className:"components-form-toggle__input",id:o,type:"checkbox",checked:r,onChange:a,disabled:i,...l,ref:t}),(0,_t.jsx)("span",{className:"components-form-toggle__track"}),(0,_t.jsx)("span",{className:"components-form-toggle__thumb"})]})})),eD=JA,tD=()=>{};function nD({value:e,status:t,title:n,displayTransform:r,isBorderless:o=!1,disabled:i=!1,onClickRemove:c=tD,onMouseEnter:u,onMouseLeave:d,messages:p,termPosition:f,termsCount:h}){const m=(0,l.useInstanceId)(nD),g=s("components-form-token-field__token",{"is-error":"error"===t,"is-success":"success"===t,"is-validating":"validating"===t,"is-borderless":o,"is-disabled":i}),v=r(e),b=(0,a.sprintf)((0,a.__)("%1$s (%2$s of %3$s)"),v,f,h);return(0,_t.jsxs)("span",{className:g,onMouseEnter:u,onMouseLeave:d,title:n,children:[(0,_t.jsxs)("span",{className:"components-form-token-field__token-text",id:`components-form-token-field__token-text-${m}`,children:[(0,_t.jsx)(Sl,{as:"span",children:b}),(0,_t.jsx)("span",{"aria-hidden":"true",children:v})]}),(0,_t.jsx)(Jx,{className:"components-form-token-field__remove-token",size:"small",icon:WN,onClick:i?void 0:()=>c({value:e}),disabled:i,label:p.remove,"aria-describedby":`components-form-token-field__token-text-${m}`})]})}const rD=({__next40pxDefaultSize:e,hasTokens:t})=>!e&&Nl("padding-top:",Il(t?1:.5),";padding-bottom:",Il(t?1:.5),";",""),oD=yl(kg,{target:"ehq8nmi0"})("padding:7px;",Rx," ",rD,";"),iD=e=>e;const sD=function e(t){const{autoCapitalize:n,autoComplete:r,maxLength:o,placeholder:i,label:u=(0,a.__)("Add item"),className:d,suggestions:p=[],maxSuggestions:f=100,value:h=[],displayTransform:m=iD,saveTransform:g=e=>e.trim(),onChange:v=()=>{},onInputChange:b=()=>{},onFocus:x,isBorderless:y=!1,disabled:w=!1,tokenizeOnSpace:_=!1,messages:S={added:(0,a.__)("Item added."),removed:(0,a.__)("Item removed."),remove:(0,a.__)("Remove item"),__experimentalInvalid:(0,a.__)("Invalid item")},__experimentalRenderItem:C,__experimentalExpandOnFocus:k=!1,__experimentalValidateInput:j=()=>!0,__experimentalShowHowTo:E=!0,__next40pxDefaultSize:P=!1,__experimentalAutoSelectFirstMatch:N=!1,__nextHasNoMarginBottom:T=!1,tokenizeOnBlur:I=!1}=hb(t);T||Xi()("Bottom margin styles for wp.components.FormTokenField",{since:"6.7",version:"7.0",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version."}),Ux({componentName:"FormTokenField",size:void 0,__next40pxDefaultSize:P});const R=(0,l.useInstanceId)(e),[M,A]=(0,c.useState)(""),[D,z]=(0,c.useState)(0),[O,L]=(0,c.useState)(!1),[F,B]=(0,c.useState)(!1),[V,$]=(0,c.useState)(-1),[H,W]=(0,c.useState)(!1),U=(0,l.usePrevious)(p),G=(0,l.usePrevious)(h),K=(0,c.useRef)(null),q=(0,c.useRef)(null),Y=(0,l.useDebounce)(jy.speak,500);function X(){K.current?.focus()}function Z(){return K.current===K.current?.ownerDocument.activeElement}function Q(e){if(fe()&&j(M))L(!1),I&&fe()&&ae(M);else{if(A(""),z(0),L(!1),k){const t=e.relatedTarget===q.current;B(t)}else B(!1);$(-1),W(!1)}}function J(e){e.target===q.current&&O&&e.preventDefault()}function ee(e){le(e.value),X()}function te(e){const t=e.value,n=_?/[ ,\t]+/:/[,\t]+/,r=t.split(n),o=r[r.length-1]||"";r.length>1&&se(r.slice(0,-1)),A(o),b(o)}function ne(e){let t=!1;return Z()&&pe()&&(e(),t=!0),t}function re(){const e=de()-1;e>-1&&le(h[e])}function oe(){const e=de();e!function(e){return h.some((t=>ce(e)===ce(t)))}(e))))];if(t.length>0){const e=[...h];e.splice(de(),0,...t),v(e)}}function ae(e){j(e)?(se([e]),(0,jy.speak)(S.added,"assertive"),A(""),$(-1),W(!1),B(!k),O&&!I&&X()):(0,jy.speak)(S.__experimentalInvalid,"assertive")}function le(e){const t=h.filter((t=>ce(t)!==ce(e)));v(t),(0,jy.speak)(S.removed,"assertive")}function ce(e){return"object"==typeof e?e.value:e}function ue(e=M,t=p,n=h,r=f,o=g){let i=o(e);const s=[],a=[],l=n.map((e=>"string"==typeof e?e:e.value));return 0===i.length?t=t.filter((e=>!l.includes(e))):(i=i.toLocaleLowerCase(),t.forEach((e=>{const t=e.toLocaleLowerCase().indexOf(i);-1===l.indexOf(e)&&(0===t?s.push(e):t>0&&a.push(e))})),t=s.concat(a)),t.slice(0,r)}function de(){return h.length-D}function pe(){return 0===M.length}function fe(){return g(M).length>0}function he(e=!0){const t=M.trim().length>1,n=ue(M),r=n.length>0,o=Z()&&k;if(B(o||t&&r),e&&(N&&t&&r?($(0),W(!0)):($(-1),W(!1))),t){const e=r?(0,a.sprintf)((0,a._n)("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",n.length),n.length):(0,a.__)("No results.");Y(e,"assertive")}}function me(e,t,n){const r=ce(e),o="string"!=typeof e?e.status:void 0,i=t+1,s=n.length;return(0,_t.jsx)(Fg,{children:(0,_t.jsx)(nD,{value:r,status:o,title:"string"!=typeof e?e.title:void 0,displayTransform:m,onClickRemove:ee,isBorderless:"string"!=typeof e&&e.isBorderless||y,onMouseEnter:"string"!=typeof e?e.onMouseEnter:void 0,onMouseLeave:"string"!=typeof e?e.onMouseLeave:void 0,disabled:"error"!==o&&w,messages:S,termsCount:s,termPosition:i})},"token-"+r)}(0,c.useEffect)((()=>{O&&!Z()&&X()}),[O]),(0,c.useEffect)((()=>{const e=!pw()(p,U||[]);(e||h!==G)&&he(e)}),[p,U,h,G]),(0,c.useEffect)((()=>{he()}),[M]),(0,c.useEffect)((()=>{he()}),[N]),w&&O&&(L(!1),A(""));const ge=s(d,"components-form-token-field__input-container",{"is-active":O,"is-disabled":w});let ve={className:"components-form-token-field",tabIndex:-1};const be=ue();return w||(ve=Object.assign({},ve,{onKeyDown:jx((function(e){let t=!1;if(!e.defaultPrevented){switch(e.key){case"Backspace":t=ne(re);break;case"Enter":t=ie();break;case"ArrowLeft":t=function(){let e=!1;return pe()&&(z((e=>Math.min(e+1,h.length))),e=!0),e}();break;case"ArrowUp":$((e=>(0===e?ue(M,p,h,f,g).length:e)-1)),W(!0),t=!0;break;case"ArrowRight":t=function(){let e=!1;return pe()&&(z((e=>Math.max(e-1,0))),e=!0),e}();break;case"ArrowDown":$((e=>(e+1)%ue(M,p,h,f,g).length)),W(!0),t=!0;break;case"Delete":t=ne(oe);break;case"Space":_&&(t=ie());break;case"Escape":t=function(e){return e.target instanceof HTMLInputElement&&(A(e.target.value),B(!1),$(-1),W(!1)),!0}(e)}t&&e.preventDefault()}})),onKeyPress:function(e){let t=!1;","===e.key&&(fe()&&ae(M),t=!0);t&&e.preventDefault()},onFocus:function(e){Z()||e.target===q.current?(L(!0),B(k||F)):L(!1),"function"==typeof x&&x(e)}})),(0,_t.jsxs)("div",{...ve,children:[u&&(0,_t.jsx)(Ox,{htmlFor:`components-form-token-input-${R}`,className:"components-form-token-field__label",children:u}),(0,_t.jsxs)("div",{ref:q,className:ge,tabIndex:-1,onMouseDown:J,onTouchStart:J,children:[(0,_t.jsx)(oD,{justify:"flex-start",align:"center",gap:1,wrap:!0,__next40pxDefaultSize:P,hasTokens:!!h.length,children:function(){const e=h.map(me);return e.splice(de(),0,function(){const e={instanceId:R,autoCapitalize:n,autoComplete:r,placeholder:0===h.length?i:"",disabled:w,value:M,onBlur:Q,isExpanded:F,selectedSuggestionIndex:V};return(0,_t.jsx)(qN,{...e,onChange:o&&h.length>=o?void 0:te,ref:K},"input")}()),e}()}),F&&(0,_t.jsx)(XN,{instanceId:R,match:g(M),displayTransform:m,suggestions:be,selectedIndex:V,scrollIntoView:H,onHover:function(e){const t=ue().indexOf(e);t>=0&&($(t),W(!1))},onSelect:function(e){ae(e)},__experimentalRenderItem:C})]}),!T&&(0,_t.jsx)(zg,{marginBottom:2}),E&&(0,_t.jsx)(Bx,{id:`components-form-token-suggestions-howto-${R}`,className:"components-form-token-field__help",__nextHasNoMarginBottom:T,children:_?(0,a.__)("Separate with commas, spaces, or the Enter key."):(0,a.__)("Separate with commas or the Enter key.")})]})},aD=()=>(0,_t.jsx)(n.SVG,{width:"8",height:"8",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,_t.jsx)(n.Circle,{cx:"4",cy:"4",r:"4"})});function lD({currentPage:e,numberOfPages:t,setCurrentPage:n}){return(0,_t.jsx)("ul",{className:"components-guide__page-control","aria-label":(0,a.__)("Guide controls"),children:Array.from({length:t}).map(((r,o)=>(0,_t.jsx)("li",{"aria-current":o===e?"step":void 0,children:(0,_t.jsx)(Jx,{size:"small",icon:(0,_t.jsx)(aD,{}),"aria-label":(0,a.sprintf)((0,a.__)("Page %1$d of %2$d"),o+1,t),onClick:()=>n(o)},o)},o)))})}const cD=function({children:e,className:t,contentLabel:n,finishButtonText:r=(0,a.__)("Finish"),onFinish:o,pages:i=[]}){const l=(0,c.useRef)(null),[u,d]=(0,c.useState)(0);var p;(0,c.useEffect)((()=>{const e=l.current?.querySelector(".components-guide");e instanceof HTMLElement&&e.focus()}),[u]),(0,c.useEffect)((()=>{c.Children.count(e)&&Xi()("Passing children to ",{since:"5.5",alternative:"the `pages` prop"})}),[e]),c.Children.count(e)&&(i=null!==(p=c.Children.map(e,(e=>({content:e}))))&&void 0!==p?p:[]);const f=u>0,h=u{f&&d(u-1)},g=()=>{h&&d(u+1)};return 0===i.length?null:(0,_t.jsx)(bT,{className:s("components-guide",t),contentLabel:n,isDismissible:i.length>1,onRequestClose:o,onKeyDown:e=>{"ArrowLeft"===e.code?(m(),e.preventDefault()):"ArrowRight"===e.code&&(g(),e.preventDefault())},ref:l,children:(0,_t.jsxs)("div",{className:"components-guide__container",children:[(0,_t.jsxs)("div",{className:"components-guide__page",children:[i[u].image,i.length>1&&(0,_t.jsx)(lD,{currentPage:u,numberOfPages:i.length,setCurrentPage:d}),i[u].content]}),(0,_t.jsxs)("div",{className:"components-guide__footer",children:[f&&(0,_t.jsx)(Jx,{className:"components-guide__back-button",variant:"tertiary",onClick:m,__next40pxDefaultSize:!0,children:(0,a.__)("Previous")}),h&&(0,_t.jsx)(Jx,{className:"components-guide__forward-button",variant:"primary",onClick:g,__next40pxDefaultSize:!0,children:(0,a.__)("Next")}),!h&&(0,_t.jsx)(Jx,{className:"components-guide__finish-button",variant:"primary",onClick:o,__next40pxDefaultSize:!0,children:r})]})]})})};function uD(e){return(0,c.useEffect)((()=>{Xi()("",{since:"5.5",alternative:"the `pages` prop in "})}),[]),(0,_t.jsx)("div",{...e})}const dD=(0,c.forwardRef)((function({label:e,labelPosition:t,size:n,tooltip:r,...o},i){return Xi()("wp.components.IconButton",{since:"5.4",alternative:"wp.components.Button",version:"6.2"}),(0,_t.jsx)(Jx,{...o,ref:i,tooltipPosition:t,iconSize:n,showTooltip:void 0!==r?!!r:void 0,label:r||e})}));function pD({target:e,callback:t,shortcut:n,bindGlobal:r,eventName:o}){return(0,l.useKeyboardShortcut)(n,t,{bindGlobal:r,target:e,eventName:o}),null}const fD=function({children:e,shortcuts:t,bindGlobal:n,eventName:r}){const o=(0,c.useRef)(null),i=Object.entries(null!=t?t:{}).map((([e,t])=>(0,_t.jsx)(pD,{shortcut:e,callback:t,bindGlobal:n,eventName:r,target:o},e)));return c.Children.count(e)?(0,_t.jsxs)("div",{ref:o,children:[i,e]}):(0,_t.jsx)(_t.Fragment,{children:i})};const hD=function e(t){const{children:n,className:r="",label:o,hideSeparator:i}=t,a=(0,l.useInstanceId)(e);if(!c.Children.count(n))return null;const u=`components-menu-group-label-${a}`,d=s(r,"components-menu-group",{"has-hidden-separator":i});return(0,_t.jsxs)("div",{className:d,children:[o&&(0,_t.jsx)("div",{className:"components-menu-group__label",id:u,"aria-hidden":"true",children:o}),(0,_t.jsx)("div",{role:"group","aria-labelledby":o?u:void 0,children:n})]})};const mD=(0,c.forwardRef)((function(e,t){let{children:n,info:r,className:o,icon:i,iconPosition:a="right",shortcut:l,isSelected:u,role:d="menuitem",suffix:p,...f}=e;return o=s("components-menu-item__button",o),r&&(n=(0,_t.jsxs)("span",{className:"components-menu-item__info-wrapper",children:[(0,_t.jsx)("span",{className:"components-menu-item__item",children:n}),(0,_t.jsx)("span",{className:"components-menu-item__info",children:r})]})),i&&"string"!=typeof i&&(i=(0,c.cloneElement)(i,{className:s("components-menu-items__item-icon",{"has-icon-right":"right"===a})})),(0,_t.jsxs)(Jx,{__next40pxDefaultSize:!0,ref:t,"aria-checked":"menuitemcheckbox"===d||"menuitemradio"===d?u:void 0,role:d,icon:"left"===a?i:void 0,className:o,...f,children:[(0,_t.jsx)("span",{className:"components-menu-item__item",children:n}),!p&&(0,_t.jsx)(Zi,{className:"components-menu-item__shortcut",shortcut:l}),!p&&i&&"right"===a&&(0,_t.jsx)(Xx,{icon:i}),p]})})),gD=mD,vD=()=>{};const bD=function({choices:e=[],onHover:t=vD,onSelect:n,value:r}){return(0,_t.jsx)(_t.Fragment,{children:e.map((e=>{const o=r===e.value;return(0,_t.jsx)(gD,{role:"menuitemradio",disabled:e.disabled,icon:o?ok:null,info:e.info,isSelected:o,shortcut:e.shortcut,className:"components-menu-items-choice",onClick:()=>{o||n(e.value)},onMouseEnter:()=>t(e.value),onMouseLeave:()=>t(null),"aria-label":e["aria-label"],children:e.label},e.value)}))})};const xD=(0,c.forwardRef)((function({eventToOffset:e,...t},n){return(0,_t.jsx)(_N,{ref:n,stopNavigationEvents:!0,onlyBrowserTabstops:!0,eventToOffset:t=>{const{code:n,shiftKey:r}=t;return"Tab"===n?r?-1:1:e?e(t):void 0},...t})})),yD="root",wD=()=>{},_D=()=>{},SD=(0,c.createContext)({activeItem:void 0,activeMenu:yD,setActiveMenu:wD,navigationTree:{items:{},getItem:_D,addItem:wD,removeItem:wD,menus:{},getMenu:_D,addMenu:wD,removeMenu:wD,childMenu:{},traverseMenu:wD,isMenuEmpty:()=>!1}}),CD=()=>(0,c.useContext)(SD);const kD=yl("div",{target:"eeiismy11"})("width:100%;box-sizing:border-box;padding:0 ",Il(4),";overflow:hidden;"),jD=yl("div",{target:"eeiismy10"})("margin-top:",Il(6),";margin-bottom:",Il(6),";display:flex;flex-direction:column;ul{padding:0;margin:0;list-style:none;}.components-navigation__back-button{margin-bottom:",Il(6),";}.components-navigation__group+.components-navigation__group{margin-top:",Il(6),";}"),ED=yl(Jx,{target:"eeiismy9"})({name:"26l0q2",styles:"&.is-tertiary{color:inherit;opacity:0.7;&:hover:not( :disabled ){opacity:1;box-shadow:none;color:inherit;}&:active:not( :disabled ){background:transparent;opacity:1;color:inherit;}}"}),PD=yl("div",{target:"eeiismy8"})({name:"1aubja5",styles:"overflow:hidden;width:100%"}),ND=yl("div",{target:"eeiismy7"})({name:"rgorny",styles:"margin:11px 0;padding:1px"}),TD=yl("span",{target:"eeiismy6"})("height:",Il(6),";.components-button.is-small{color:inherit;opacity:0.7;margin-right:",Il(1),";padding:0;&:active:not( :disabled ){background:none;opacity:1;color:inherit;}&:hover:not( :disabled ){box-shadow:none;opacity:1;color:inherit;}}"),ID=yl(hk,{target:"eeiismy5"})("min-height:",Il(12),";align-items:center;color:inherit;display:flex;justify-content:space-between;margin-bottom:",Il(2),";padding:",(()=>(0,a.isRTL)()?`${Il(1)} ${Il(4)} ${Il(1)} ${Il(2)}`:`${Il(1)} ${Il(2)} ${Il(1)} ${Il(4)}`),";"),RD=yl("li",{target:"eeiismy4"})("border-radius:",Fl.radiusSmall,";color:inherit;margin-bottom:0;>button,>a.components-button,>a{width:100%;color:inherit;opacity:0.7;padding:",Il(2)," ",Il(4),";",Mg({textAlign:"left"},{textAlign:"right"})," &:hover,&:focus:not( [aria-disabled='true'] ):active,&:active:not( [aria-disabled='true'] ):active{color:inherit;opacity:1;}}&.is-active{background-color:",zl.theme.accent,";color:",zl.theme.accentInverted,";>button,.components-button:hover,>a{color:",zl.theme.accentInverted,";opacity:1;}}>svg path{color:",zl.gray[600],";}"),MD=yl("div",{target:"eeiismy3"})("display:flex;align-items:center;height:auto;min-height:40px;margin:0;padding:",Il(1.5)," ",Il(4),";font-weight:400;line-height:20px;width:100%;color:inherit;opacity:0.7;"),AD=yl("span",{target:"eeiismy2"})("display:flex;margin-right:",Il(2),";"),DD=yl("span",{target:"eeiismy1"})("margin-left:",(()=>(0,a.isRTL)()?"0":Il(2)),";margin-right:",(()=>(0,a.isRTL)()?Il(2):"0"),";display:inline-flex;padding:",Il(1)," ",Il(3),";border-radius:",Fl.radiusSmall,";@keyframes fade-in{from{opacity:0;}to{opacity:1;}}@media not ( prefers-reduced-motion ){animation:fade-in 250ms ease-out;}"),zD=yl($v,{target:"eeiismy0"})((()=>(0,a.isRTL)()?"margin-left: auto;":"margin-right: auto;")," font-size:14px;line-height:20px;color:inherit;");function OD(){const[e,t]=(0,c.useState)({});return{nodes:e,getNode:t=>e[t],addNode:(e,n)=>{const{children:r,...o}=n;return t((t=>({...t,[e]:o})))},removeNode:e=>t((t=>{const{[e]:n,...r}=t;return r}))}}const LD=()=>{};const FD=function({activeItem:e,activeMenu:t=yD,children:n,className:r,onActivateMenu:o=LD}){const[i,l]=(0,c.useState)(t),[u,d]=(0,c.useState)(),p=(()=>{const{nodes:e,getNode:t,addNode:n,removeNode:r}=OD(),{nodes:o,getNode:i,addNode:s,removeNode:a}=OD(),[l,u]=(0,c.useState)({}),d=e=>l[e]||[],p=(e,t)=>{const n=[];let r,o=[e];for(;o.length>0&&(r=i(o.shift()),!r||n.includes(r.menu)||(n.push(r.menu),o=[...o,...d(r.menu)],!1!==t(r))););};return{items:e,getItem:t,addItem:n,removeItem:r,menus:o,getMenu:i,addMenu:(e,t)=>{u((n=>{const r={...n};return t.parentMenu?(r[t.parentMenu]||(r[t.parentMenu]=[]),r[t.parentMenu].push(e),r):r})),s(e,t)},removeMenu:a,childMenu:l,traverseMenu:p,isMenuEmpty:e=>{let t=!0;return p(e,(e=>{if(!e.isEmpty)return t=!1,!1})),t}}})(),f=(0,a.isRTL)()?"right":"left";Xi()("wp.components.Navigation (and all subcomponents)",{since:"6.8",version:"7.1",alternative:"wp.components.Navigator"});const h=(e,t=f)=>{p.getMenu(e)&&(d(t),l(e),o(e))},m=(0,c.useRef)(!1);(0,c.useEffect)((()=>{m.current||(m.current=!0)}),[]),(0,c.useEffect)((()=>{t!==i&&h(t)}),[t]);const g={activeItem:e,activeMenu:i,setActiveMenu:h,navigationTree:p},v=s("components-navigation",r),b=Zl({type:"slide-in",origin:u});return(0,_t.jsx)(kD,{className:v,children:(0,_t.jsx)("div",{className:b?s({[b]:m.current&&u}):void 0,children:(0,_t.jsx)(SD.Provider,{value:g,children:n})},i)})},BD=(0,_t.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_t.jsx)(n.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"})}),VD=(0,_t.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_t.jsx)(n.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"})});const $D=(0,c.forwardRef)((function({backButtonLabel:e,className:t,href:n,onClick:r,parentMenu:o},i){const{setActiveMenu:l,navigationTree:c}=CD(),u=s("components-navigation__back-button",t),d=void 0!==o?c.getMenu(o)?.title:void 0,p=(0,a.isRTL)()?BD:VD;return(0,_t.jsxs)(ED,{__next40pxDefaultSize:!0,className:u,href:n,variant:"tertiary",ref:i,onClick:e=>{"function"==typeof r&&r(e);const t=(0,a.isRTL)()?"left":"right";o&&!e.defaultPrevented&&l(o,t)},children:[(0,_t.jsx)(oS,{icon:p}),e||d||(0,a.__)("Back")]})})),HD=$D,WD=(0,c.createContext)({group:void 0});let UD=0;const GD=function({children:e,className:t,title:n}){const[r]=(0,c.useState)("group-"+ ++UD),{navigationTree:{items:o}}=CD(),i={group:r};if(!Object.values(o).some((e=>e.group===r&&e._isVisible)))return(0,_t.jsx)(WD.Provider,{value:i,children:e});const a=`components-navigation__group-title-${r}`,l=s("components-navigation__group",t);return(0,_t.jsx)(WD.Provider,{value:i,children:(0,_t.jsxs)("li",{className:l,children:[n&&(0,_t.jsx)(ID,{className:"components-navigation__group-title",id:a,level:3,children:n}),(0,_t.jsx)("ul",{"aria-labelledby":a,role:"group",children:e})]})})};function KD(e){const{badge:t,title:n}=e;return(0,_t.jsxs)(_t.Fragment,{children:[n&&(0,_t.jsx)(zD,{className:"components-navigation__item-title",as:"span",children:n}),t&&(0,_t.jsx)(DD,{className:"components-navigation__item-badge",children:t})]})}const qD=(0,c.createContext)({menu:void 0,search:""}),YD=()=>(0,c.useContext)(qD),XD=e=>Cy()(e).replace(/^\//,"").toLowerCase(),ZD=(e,t)=>{const{activeMenu:n,navigationTree:{addItem:r,removeItem:o}}=CD(),{group:i}=(0,c.useContext)(WD),{menu:s,search:a}=YD();(0,c.useEffect)((()=>{const l=n===s,c=!a||void 0!==t.title&&((e,t)=>-1!==XD(e).indexOf(XD(t)))(t.title,a);return r(e,{...t,group:i,menu:s,_isVisible:l&&c}),()=>{o(e)}}),[n,a])};let QD=0;function JD(e){const{children:t,className:n,title:r,href:o,...i}=e,[a]=(0,c.useState)("item-"+ ++QD);ZD(a,e);const{navigationTree:l}=CD();if(!l.getItem(a)?._isVisible)return null;const u=s("components-navigation__item",n);return(0,_t.jsx)(RD,{className:u,...i,children:t})}const ez=()=>{};const tz=function(e){const{badge:t,children:n,className:r,href:o,item:i,navigateToMenu:l,onClick:c=ez,title:u,icon:d,hideIfTargetMenuEmpty:p,isText:f,...h}=e,{activeItem:m,setActiveMenu:g,navigationTree:{isMenuEmpty:v}}=CD();if(p&&l&&v(l))return null;const b=i&&m===i,x=s(r,{"is-active":b}),y=(0,a.isRTL)()?VD:BD,w=n?e:{...e,onClick:void 0},_=f?h:{as:Jx,__next40pxDefaultSize:!("as"in h)||void 0===h.as,href:o,onClick:e=>{l&&g(l),c(e)},"aria-current":b?"page":void 0,...h};return(0,_t.jsx)(JD,{...w,className:x,children:n||(0,_t.jsxs)(MD,{..._,children:[d&&(0,_t.jsx)(AD,{children:(0,_t.jsx)(oS,{icon:d})}),(0,_t.jsx)(KD,{title:u,badge:t}),l&&(0,_t.jsx)(oS,{icon:y})]})})},nz=(0,_t.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_t.jsx)(n.Path,{d:"M13 5c-3.3 0-6 2.7-6 6 0 1.4.5 2.7 1.3 3.7l-3.8 3.8 1.1 1.1 3.8-3.8c1 .8 2.3 1.3 3.7 1.3 3.3 0 6-2.7 6-6S16.3 5 13 5zm0 10.5c-2.5 0-4.5-2-4.5-4.5s2-4.5 4.5-4.5 4.5 2 4.5 4.5-2 4.5-4.5 4.5z"})}),rz=(0,l.createHigherOrderComponent)((e=>t=>(0,_t.jsx)(e,{...t,speak:jy.speak,debouncedSpeak:(0,l.useDebounce)(jy.speak,500)})),"withSpokenMessages"),oz=({size:e})=>Il("compact"===e?1:2),iz=yl("div",{target:"effl84m1"})("display:flex;padding-inline-end:",oz,";svg{fill:currentColor;}"),sz=yl(qx,{target:"effl84m0"})("input[type='search']{&::-webkit-search-decoration,&::-webkit-search-cancel-button,&::-webkit-search-results-button,&::-webkit-search-results-decoration{-webkit-appearance:none;}}&:not( :focus-within ){--wp-components-color-background:",zl.theme.gray[100],";}");function az({searchRef:e,value:t,onChange:n,onClose:r}){if(!r&&!t)return(0,_t.jsx)(oS,{icon:nz});r&&Xi()("`onClose` prop in wp.components.SearchControl",{since:"6.8"});return(0,_t.jsx)(Jx,{size:"small",icon:WN,label:r?(0,a.__)("Close search"):(0,a.__)("Reset search"),onClick:null!=r?r:()=>{n(""),e.current?.focus()}})}const lz=(0,c.forwardRef)((function({__nextHasNoMarginBottom:e=!1,className:t,onChange:n,value:r,label:o=(0,a.__)("Search"),placeholder:i=(0,a.__)("Search"),hideLabelFromVision:u=!0,onClose:d,size:p="default",...f},h){const{disabled:m,...g}=f,v=(0,c.useRef)(null),b=(0,l.useInstanceId)(lz,"components-search-control"),x=(0,c.useMemo)((()=>({BaseControl:{_overrides:{__nextHasNoMarginBottom:e},__associatedWPComponentName:"SearchControl"},InputBase:{isBorderless:!0}})),[e]);return(0,_t.jsx)(gs,{value:x,children:(0,_t.jsx)(sz,{__next40pxDefaultSize:!0,id:b,hideLabelFromVision:u,label:o,ref:(0,l.useMergeRefs)([v,h]),type:"search",size:p,className:s("components-search-control",t),onChange:e=>n(null!=e?e:""),autoComplete:"off",placeholder:i,value:null!=r?r:"",suffix:(0,_t.jsx)(iz,{size:p,children:(0,_t.jsx)(az,{searchRef:v,value:r,onChange:n,onClose:d})}),...g})})})),cz=lz;const uz=rz((function({debouncedSpeak:e,onCloseSearch:t,onSearch:n,search:r,title:o}){const{navigationTree:{items:i}}=CD(),{menu:s}=YD(),l=(0,c.useRef)(null);(0,c.useEffect)((()=>{const e=setTimeout((()=>{l.current?.focus()}),100);return()=>{clearTimeout(e)}}),[]),(0,c.useEffect)((()=>{if(!r)return;const t=Object.values(i).filter((e=>e._isVisible)).length,n=(0,a.sprintf)((0,a._n)("%d result found.","%d results found.",t),t);e(n)}),[i,r]);const u=()=>{n?.(""),t()},d=`components-navigation__menu-title-search-${s}`,p=(0,a.sprintf)((0,a.__)("Search %s"),o?.toLowerCase()).trim();return(0,_t.jsx)(ND,{children:(0,_t.jsx)(cz,{__nextHasNoMarginBottom:!0,className:"components-navigation__menu-search-input",id:d,onChange:e=>n?.(e),onKeyDown:e=>{"Escape"!==e.code||e.defaultPrevented||(e.preventDefault(),u())},placeholder:p,onClose:u,ref:l,value:r})})}));function dz({hasSearch:e,onSearch:t,search:n,title:r,titleAction:o}){const[i,s]=(0,c.useState)(!1),{menu:l}=YD(),u=(0,c.useRef)(null);if(!r)return null;const d=`components-navigation__menu-title-${l}`,p=(0,a.sprintf)((0,a.__)("Search in %s"),r);return(0,_t.jsxs)(PD,{className:"components-navigation__menu-title",children:[!i&&(0,_t.jsxs)(ID,{as:"h2",className:"components-navigation__menu-title-heading",level:3,children:[(0,_t.jsx)("span",{id:d,children:r}),(e||o)&&(0,_t.jsxs)(TD,{children:[o,e&&(0,_t.jsx)(Jx,{size:"small",variant:"tertiary",label:p,onClick:()=>s(!0),ref:u,children:(0,_t.jsx)(oS,{icon:nz})})]})]}),i&&(0,_t.jsx)("div",{className:Zl({type:"slide-in",origin:"left"}),children:(0,_t.jsx)(uz,{onCloseSearch:()=>{s(!1),setTimeout((()=>{u.current?.focus()}),100)},onSearch:t,search:n,title:r})})]})}function pz({search:e}){const{navigationTree:{items:t}}=CD(),n=Object.values(t).filter((e=>e._isVisible)).length;return!e||n?null:(0,_t.jsx)(RD,{children:(0,_t.jsxs)(MD,{children:[(0,a.__)("No results found.")," "]})})}const fz=function(e){const{backButtonLabel:t,children:n,className:r,hasSearch:o,menu:i=yD,onBackButtonClick:a,onSearch:l,parentMenu:u,search:d,isSearchDebouncing:p,title:f,titleAction:h}=e,[m,g]=(0,c.useState)("");(e=>{const{navigationTree:{addMenu:t,removeMenu:n}}=CD(),r=e.menu||yD;(0,c.useEffect)((()=>(t(r,{...e,menu:r}),()=>{n(r)})),[])})(e);const{activeMenu:v}=CD(),b={menu:i,search:m};if(v!==i)return(0,_t.jsx)(qD.Provider,{value:b,children:n});const x=!!l,y=x?d:m,w=x?l:g,_=`components-navigation__menu-title-${i}`,S=s("components-navigation__menu",r);return(0,_t.jsx)(qD.Provider,{value:b,children:(0,_t.jsxs)(jD,{className:S,children:[(u||a)&&(0,_t.jsx)(HD,{backButtonLabel:t,parentMenu:u,onClick:a}),f&&(0,_t.jsx)(dz,{hasSearch:o,onSearch:w,search:y,title:f,titleAction:h}),(0,_t.jsx)(CN,{children:(0,_t.jsxs)("ul",{"aria-labelledby":_,children:[n,y&&!p&&(0,_t.jsx)(pz,{search:y})]})})]})})};function hz(e,t){void 0===t&&(t={});for(var n=function(e){for(var t=[],n=0;n=48&&l<=57||l>=65&&l<=90||l>=97&&l<=122||95===l))break;s+=e[a++]}if(!s)throw new TypeError("Missing parameter name at ".concat(n));t.push({type:"NAME",index:n,value:s}),n=a}else t.push({type:"CLOSE",index:n,value:e[n++]});else t.push({type:"OPEN",index:n,value:e[n++]});else t.push({type:"ESCAPED_CHAR",index:n++,value:e[n++]});else t.push({type:"MODIFIER",index:n,value:e[n++]})}return t.push({type:"END",index:n,value:""}),t}(e),r=t.prefixes,o=void 0===r?"./":r,i=t.delimiter,s=void 0===i?"/#?":i,a=[],l=0,c=0,u="",d=function(e){if(c-1)return!0}return!1}(n)?"[^".concat(gz(s),"]+?"):"(?:(?!".concat(gz(n),")[^").concat(gz(s),"])+?")};c-1:void 0===S;o||(g+="(?:".concat(m,"(?=").concat(h,"))?")),C||(g+="(?=".concat(m,"|").concat(h,")"))}return new RegExp(g,vz(n))}(hz(e,n),t,n)}function xz(e,t,n){return e instanceof RegExp?function(e,t){if(!t)return e;for(var n=/\((?:\?<(.*?)>)?(?!\?)/g,r=0,o=n.exec(e.source);o;)t.push({name:o[1]||r++,prefix:"",suffix:"",modifier:"",pattern:""}),o=n.exec(e.source);return e}(e,t):Array.isArray(e)?function(e,t,n){var r=e.map((function(e){return xz(e,t,n).source}));return new RegExp("(?:".concat(r.join("|"),")"),vz(n))}(e,t,n):bz(e,t,n)}function yz(e,t){return mz(t,{decode:decodeURIComponent})(e)}const wz=(0,c.createContext)({location:{},goTo:()=>{},goBack:()=>{},goToParent:()=>{},addScreen:()=>{},removeScreen:()=>{},params:{}});const _z={name:"1br0vvk",styles:"position:relative;overflow-x:clip;contain:layout;display:grid;grid-template-columns:1fr;grid-template-rows:1fr;align-items:start"},Sz=Tl({from:{opacity:0}}),Cz=Tl({to:{opacity:0}}),kz=Tl({from:{transform:"translateX(100px)"}}),jz=Tl({to:{transform:"translateX(-80px)"}}),Ez=Tl({from:{transform:"translateX(-100px)"}}),Pz=Tl({to:{transform:"translateX(80px)"}}),Nz=70,Tz="linear",Iz={IN:70,OUT:40},Rz=300,Mz="cubic-bezier(0.33, 0, 0, 1)",Az=Math.max(Nz+Iz.IN,Rz),Dz=Math.max(Nz+Iz.OUT,Rz),zz={end:{in:kz.name,out:jz.name},start:{in:Ez.name,out:Pz.name}},Oz={end:{in:Nl(Nz,"ms ",Tz," ",Iz.IN,"ms both ",Sz,",",Rz,"ms ",Mz," both ",kz,";",""),out:Nl(Nz,"ms ",Tz," ",Iz.OUT,"ms both ",Cz,",",Rz,"ms ",Mz," both ",jz,";","")},start:{in:Nl(Nz,"ms ",Tz," ",Iz.IN,"ms both ",Sz,",",Rz,"ms ",Mz," both ",Ez,";",""),out:Nl(Nz,"ms ",Tz," ",Iz.OUT,"ms both ",Cz,",",Rz,"ms ",Mz," both ",Pz,";","")}},Lz=Nl("z-index:1;&[data-animation-type='out']{z-index:0;}@media not ( prefers-reduced-motion ){&:not( [data-skip-animation] ){",["start","end"].map((e=>["in","out"].map((t=>Nl("&[data-animation-direction='",e,"'][data-animation-type='",t,"']{animation:",Oz[e][t],";}",""))))),";}}",""),Fz={name:"14di7zd",styles:"overflow-x:auto;max-height:100%;box-sizing:border-box;position:relative;grid-column:1/-1;grid-row:1/-1"};function Bz(e,t,n={}){var r;const{focusSelectors:o}=e,i={...e.currentLocation},{isBack:s=!1,skipFocus:a=!1,replace:l,focusTargetSelector:c,...u}=n;if(i.path===t)return{currentLocation:i,focusSelectors:o};let d,p;function f(){var t;return d=null!==(t=d)&&void 0!==t?t:new Map(e.focusSelectors),d}return c&&i.path&&f().set(i.path,c),o.get(t)&&(s&&(p=o.get(t)),f().delete(t)),{currentLocation:{...u,isInitial:!1,path:t,isBack:s,hasRestoredFocus:!1,focusTargetSelector:p,skipFocus:a},focusSelectors:null!==(r=d)&&void 0!==r?r:o}}function Vz(e,t={}){const{screens:n,focusSelectors:r}=e,o={...e.currentLocation},i=o.path;if(void 0===i)return{currentLocation:o,focusSelectors:r};const s=function(e,t){if(!e.startsWith("/"))return;const n=e.split("/");let r;for(;n.length>1&&void 0===r;){n.pop();const e=""===n.join("/")?"/":n.join("/");t.find((t=>!1!==yz(e,t.path)))&&(r=e)}return r}(i,n);return void 0===s?{currentLocation:o,focusSelectors:r}:Bz(e,s,{...t,isBack:!0})}function $z(e,t){let{screens:n,currentLocation:r,matchedPath:o,focusSelectors:i,...s}=e;switch(t.type){case"add":n=function({screens:e},t){return e.some((e=>e.path===t.path))?e:[...e,t]}(e,t.screen);break;case"remove":n=function({screens:e},t){return e.filter((e=>e.id!==t.id))}(e,t.screen);break;case"goto":({currentLocation:r,focusSelectors:i}=Bz(e,t.path,t.options));break;case"gotoparent":({currentLocation:r,focusSelectors:i}=Vz(e,t.options))}if(n===e.screens&&r===e.currentLocation)return e;const a=r.path;return o=void 0!==a?function(e,t){for(const n of t){const t=yz(e,n.path);if(t)return{params:t.params,id:n.id}}}(a,n):void 0,o&&e.matchedPath&&o.id===e.matchedPath.id&&pw()(o.params,e.matchedPath.params)&&(o=e.matchedPath),{...s,screens:n,currentLocation:r,matchedPath:o,focusSelectors:i}}const Hz=al((function(e,t){const{initialPath:n,children:r,className:o,...i}=sl(e,"Navigator"),[s,a]=(0,c.useReducer)($z,n,(e=>({screens:[],currentLocation:{path:e,isInitial:!0},matchedPath:void 0,focusSelectors:new Map,initialPath:n}))),l=(0,c.useMemo)((()=>({goBack:e=>a({type:"gotoparent",options:e}),goTo:(e,t)=>a({type:"goto",path:e,options:t}),goToParent:e=>{Xi()("wp.components.useNavigator().goToParent",{since:"6.7",alternative:"wp.components.useNavigator().goBack"}),a({type:"gotoparent",options:e})},addScreen:e=>a({type:"add",screen:e}),removeScreen:e=>a({type:"remove",screen:e})})),[]),{currentLocation:u,matchedPath:d}=s,p=(0,c.useMemo)((()=>{var e;return{location:u,params:null!==(e=d?.params)&&void 0!==e?e:{},match:d?.id,...l}}),[u,d,l]),f=il(),h=(0,c.useMemo)((()=>f(_z,o)),[o,f]);return(0,_t.jsx)(_l,{ref:t,className:h,...i,children:(0,_t.jsx)(wz.Provider,{value:p,children:r})})}),"Navigator"),Wz=window.wp.escapeHtml;function Uz({isMatch:e,skipAnimation:t,isBack:n,onAnimationEnd:r}){const o=(0,a.isRTL)(),i=(0,l.useReducedMotion)(),[s,u]=(0,c.useState)("INITIAL"),d="ANIMATING_IN"!==s&&"IN"!==s&&e,p="ANIMATING_OUT"!==s&&"OUT"!==s&&!e;(0,c.useLayoutEffect)((()=>{d?u(t||i?"IN":"ANIMATING_IN"):p&&u(t||i?"OUT":"ANIMATING_OUT")}),[d,p,t,i]);const f=o&&n||!o&&!n?"end":"start",h="ANIMATING_IN"===s,m="ANIMATING_OUT"===s;let g;h?g="in":m&&(g="out");const v=(0,c.useCallback)((e=>{r?.(e),((e,t,n)=>"ANIMATING_OUT"===t&&n===zz[e].out)(f,s,e.animationName)?u("OUT"):((e,t,n)=>"ANIMATING_IN"===t&&n===zz[e].in)(f,s,e.animationName)&&u("IN")}),[r,s,f]);return(0,c.useEffect)((()=>{let e;return m?e=window.setTimeout((()=>{u("OUT"),e=void 0}),1.2*Dz):h&&(e=window.setTimeout((()=>{u("IN"),e=void 0}),1.2*Az)),()=>{e&&(window.clearTimeout(e),e=void 0)}}),[m,h]),{animationStyles:Lz,shouldRenderScreen:e||"IN"===s||"ANIMATING_OUT"===s,screenProps:{onAnimationEnd:v,"data-animation-direction":f,"data-animation-type":g,"data-skip-animation":t||void 0}}}const Gz=al((function(e,t){/^\//.test(e.path);const n=(0,c.useId)(),{children:r,className:o,path:i,onAnimationEnd:s,...a}=sl(e,"Navigator.Screen"),{location:u,match:d,addScreen:p,removeScreen:f}=(0,c.useContext)(wz),{isInitial:h,isBack:m,focusTargetSelector:g,skipFocus:v}=u,b=d===n,x=(0,c.useRef)(null),y=!!h&&!m;(0,c.useEffect)((()=>{const e={id:n,path:(0,Wz.escapeAttribute)(i)};return p(e),()=>f(e)}),[n,i,p,f]);const{animationStyles:w,shouldRenderScreen:_,screenProps:S}=Uz({isMatch:b,isBack:m,onAnimationEnd:s,skipAnimation:y}),C=il(),k=(0,c.useMemo)((()=>C(Fz,w,o)),[o,C,w]),j=(0,c.useRef)(u);(0,c.useEffect)((()=>{j.current=u}),[u]),(0,c.useEffect)((()=>{const e=x.current;if(y||!b||!e||j.current.hasRestoredFocus||v)return;const t=e.ownerDocument.activeElement;if(e.contains(t))return;let n=null;if(m&&g&&(n=e.querySelector(g)),!n){const[t]=vN.focus.tabbable.find(e);n=null!=t?t:e}j.current.hasRestoredFocus=!0,n.focus()}),[y,b,m,g,v]);const E=(0,l.useMergeRefs)([t,x]);return _?(0,_t.jsx)(_l,{ref:E,className:k,...S,...a,children:r}):null}),"Navigator.Screen");function Kz(){const{location:e,params:t,goTo:n,goBack:r,goToParent:o}=(0,c.useContext)(wz);return{location:e,goTo:n,goBack:r,goToParent:o,params:t}}const qz=al((function(e,t){const n=function(e){const{path:t,onClick:n,as:r=Jx,attributeName:o="id",...i}=sl(e,"Navigator.Button"),s=(0,Wz.escapeAttribute)(t),{goTo:a}=Kz();return{as:r,onClick:(0,c.useCallback)((e=>{var t,r;e.preventDefault(),a(s,{focusTargetSelector:(t=o,r=s,`[${t}="${r}"]`)}),n?.(e)}),[a,n,o,s]),...i,[o]:s}}(e);return(0,_t.jsx)(_l,{ref:t,...n})}),"Navigator.Button");const Yz=al((function(e,t){const n=function(e){const{onClick:t,as:n=Jx,...r}=sl(e,"Navigator.BackButton"),{goBack:o}=Kz();return{as:n,onClick:(0,c.useCallback)((e=>{e.preventDefault(),o(),t?.(e)}),[o,t]),...r}}(e);return(0,_t.jsx)(_l,{ref:t,...n})}),"Navigator.BackButton");const Xz=al((function(e,t){return Xi()("wp.components.NavigatorToParentButton",{since:"6.7",alternative:"wp.components.Navigator.BackButton"}),(0,_t.jsx)(Yz,{ref:t,...e})}),"Navigator.ToParentButton"),Zz=Object.assign(Hz,{displayName:"NavigatorProvider"}),Qz=Object.assign(Gz,{displayName:"NavigatorScreen"}),Jz=Object.assign(qz,{displayName:"NavigatorButton"}),eO=Object.assign(Yz,{displayName:"NavigatorBackButton"}),tO=Object.assign(Xz,{displayName:"NavigatorToParentButton"}),nO=Object.assign(Hz,{Screen:Object.assign(Gz,{displayName:"Navigator.Screen"}),Button:Object.assign(qz,{displayName:"Navigator.Button"}),BackButton:Object.assign(Yz,{displayName:"Navigator.BackButton"})}),rO=()=>{};function oO(e){switch(e){case"success":case"warning":case"info":return"polite";default:return"assertive"}}function iO(e){switch(e){case"warning":return(0,a.__)("Warning notice");case"info":return(0,a.__)("Information notice");case"error":return(0,a.__)("Error notice");default:return(0,a.__)("Notice")}}const sO=function({className:e,status:t="info",children:n,spokenMessage:r=n,onRemove:o=rO,isDismissible:i=!0,actions:l=[],politeness:u=oO(t),__unstableHTML:d,onDismiss:p=rO}){!function(e,t){const n="string"==typeof e?e:(0,c.renderToString)(e);(0,c.useEffect)((()=>{n&&(0,jy.speak)(n,t)}),[n,t])}(r,u);const f=s(e,"components-notice","is-"+t,{"is-dismissible":i});return d&&"string"==typeof n&&(n=(0,_t.jsx)(c.RawHTML,{children:n})),(0,_t.jsxs)("div",{className:f,children:[(0,_t.jsx)(Sl,{children:iO(t)}),(0,_t.jsxs)("div",{className:"components-notice__content",children:[n,(0,_t.jsx)("div",{className:"components-notice__actions",children:l.map((({className:e,label:t,isPrimary:n,variant:r,noDefaultClasses:o=!1,onClick:i,url:a},l)=>{let c=r;return"primary"===r||o||(c=a?"link":"secondary"),void 0===c&&n&&(c="primary"),(0,_t.jsx)(Jx,{__next40pxDefaultSize:!0,href:a,variant:c,onClick:a?void 0:i,className:s("components-notice__action",e),children:t},l)}))})]}),i&&(0,_t.jsx)(Jx,{size:"small",className:"components-notice__dismiss",icon:Fy,label:(0,a.__)("Close"),onClick:()=>{p(),o()}})]})},aO=()=>{};const lO=function({notices:e,onRemove:t=aO,className:n,children:r}){const o=e=>()=>t(e);return n=s("components-notice-list",n),(0,_t.jsxs)("div",{className:n,children:[r,[...e].reverse().map((e=>{const{content:t,...n}=e;return(0,B.createElement)(sO,{...n,key:e.id,onRemove:o(e.id)},e.content)}))]})};const cO=function({label:e,children:t}){return(0,_t.jsxs)("div",{className:"components-panel__header",children:[e&&(0,_t.jsx)("h2",{children:e}),t]})};const uO=(0,c.forwardRef)((function({header:e,className:t,children:n},r){const o=s(t,"components-panel");return(0,_t.jsxs)("div",{className:o,ref:r,children:[e&&(0,_t.jsx)(cO,{label:e}),n]})})),dO=(0,_t.jsx)(n.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,_t.jsx)(n.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"})}),pO=()=>{};const fO=(0,c.forwardRef)((({isOpened:e,icon:t,title:n,...r},o)=>n?(0,_t.jsx)("h2",{className:"components-panel__body-title",children:(0,_t.jsxs)(Jx,{__next40pxDefaultSize:!0,className:"components-panel__body-toggle","aria-expanded":e,ref:o,...r,children:[(0,_t.jsx)("span",{"aria-hidden":"true",children:(0,_t.jsx)(Xx,{className:"components-panel__arrow",icon:e?dO:iS})}),n,t&&(0,_t.jsx)(Xx,{icon:t,className:"components-panel__icon",size:20})]})}):null)),hO=(0,c.forwardRef)((function(e,t){const{buttonProps:n={},children:r,className:o,icon:i,initialOpen:a,onToggle:u=pO,opened:d,title:p,scrollAfterOpen:f=!0}=e,[h,m]=dS(d,{initial:void 0===a||a,fallback:!1}),g=(0,c.useRef)(null),v=(0,l.useReducedMotion)()?"auto":"smooth",b=(0,c.useRef)();b.current=f,fs((()=>{h&&b.current&&g.current?.scrollIntoView&&g.current.scrollIntoView({inline:"nearest",block:"nearest",behavior:v})}),[h,v]);const x=s("components-panel__body",o,{"is-opened":h});return(0,_t.jsxs)("div",{className:x,ref:(0,l.useMergeRefs)([g,t]),children:[(0,_t.jsx)(fO,{icon:i,isOpened:Boolean(h),onClick:e=>{e.preventDefault();const t=!h;m(t),u(t)},title:p,...n}),"function"==typeof r?r({opened:Boolean(h)}):h&&r]})})),mO=hO;const gO=(0,c.forwardRef)((function({className:e,children:t},n){return(0,_t.jsx)("div",{className:s("components-panel__row",e),ref:n,children:t})})),vO=(0,_t.jsx)(n.SVG,{className:"components-placeholder__illustration",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 60 60",preserveAspectRatio:"none",children:(0,_t.jsx)(n.Path,{vectorEffect:"non-scaling-stroke",d:"M60 60 0 0"})});const bO=function(e){const{icon:t,children:n,label:r,instructions:o,className:i,notices:a,preview:u,isColumnLayout:d,withIllustration:p,...f}=e,[h,{width:m}]=(0,l.useResizeObserver)();let g;"number"==typeof m&&(g={"is-large":m>=480,"is-medium":m>=160&&m<480,"is-small":m<160});const v=s("components-placeholder",i,g,p?"has-illustration":null),b=s("components-placeholder__fieldset",{"is-column-layout":d});return(0,c.useEffect)((()=>{o&&(0,jy.speak)(o)}),[o]),(0,_t.jsxs)("div",{...f,className:v,children:[p?vO:null,h,a,u&&(0,_t.jsx)("div",{className:"components-placeholder__preview",children:u}),(0,_t.jsxs)("div",{className:"components-placeholder__label",children:[(0,_t.jsx)(Xx,{icon:t}),r]}),!!o&&(0,_t.jsx)("div",{className:"components-placeholder__instructions",children:o}),(0,_t.jsx)("div",{className:b,children:n})]})};function xO(e=!1){const t=e?"right":"left";return Tl({"0%":{[t]:"-50%"},"100%":{[t]:"100%"}})}const yO=yl("div",{target:"e15u147w2"})("position:relative;overflow:hidden;height:",Fl.borderWidthFocus,";background-color:color-mix(\n\t\tin srgb,\n\t\t",zl.theme.foreground,",\n\t\ttransparent 90%\n\t);border-radius:",Fl.radiusFull,";outline:2px solid transparent;outline-offset:2px;:where( & ){width:160px;}");var wO={name:"152sa26",styles:"width:var(--indicator-width);transition:width 0.4s ease-in-out"};const _O=yl("div",{target:"e15u147w1"})("display:inline-block;position:absolute;top:0;height:100%;border-radius:",Fl.radiusFull,";background-color:color-mix(\n\t\tin srgb,\n\t\t",zl.theme.foreground,",\n\t\ttransparent 10%\n\t);outline:2px solid transparent;outline-offset:-2px;",(({isIndeterminate:e})=>e?Nl({animationDuration:"1.5s",animationTimingFunction:"ease-in-out",animationIterationCount:"infinite",animationName:xO((0,a.isRTL)()),width:"50%"},"",""):wO),";"),SO=yl("progress",{target:"e15u147w0"})({name:"11fb690",styles:"position:absolute;top:0;left:0;opacity:0;width:100%;height:100%"});const CO=(0,c.forwardRef)((function(e,t){const{className:n,value:r,...o}=e,i=!Number.isFinite(r);return(0,_t.jsxs)(yO,{className:n,children:[(0,_t.jsx)(_O,{style:{"--indicator-width":i?void 0:`${r}%`},isIndeterminate:i}),(0,_t.jsx)(SO,{max:100,value:r,"aria-label":(0,a.__)("Loading …"),ref:t,...o})]})}));function kO(e){const t=e.map((e=>({children:[],parent:null,...e,id:String(e.id)})));if(!t.every((e=>null!==e.parent)))return t;const n=t.reduce(((e,t)=>{const{parent:n}=t;return e[n]||(e[n]=[]),e[n].push(t),e}),{}),r=e=>e.map((e=>{const t=n[e.id];return{...e,children:t&&t.length?r(t):[]}}));return r(n[0]||[])}const jO=window.wp.htmlEntities,EO={BaseControl:{_overrides:{__associatedWPComponentName:"TreeSelect"}}};function PO(e,t=0){return e.flatMap((e=>[{value:e.id,label:" ".repeat(3*t)+(0,jO.decodeEntities)(e.name)},...PO(e.children||[],t+1)]))}const NO=function(e){const{label:t,noOptionLabel:n,onChange:r,selectedId:o,tree:i=[],...s}=hb(e),a=(0,c.useMemo)((()=>[n&&{value:"",label:n},...PO(i)].filter((e=>!!e))),[n,i]);return Ux({componentName:"TreeSelect",size:s.size,__next40pxDefaultSize:s.__next40pxDefaultSize}),(0,_t.jsx)(gs,{value:EO,children:(0,_t.jsx)(lS,{__shouldNotWarnDeprecated36pxSize:!0,label:t,options:a,onChange:r,value:o,...s})})};function TO({__next40pxDefaultSize:e,label:t,noOptionLabel:n,authorList:r,selectedAuthorId:o,onChange:i}){if(!r)return null;const s=kO(r);return(0,_t.jsx)(NO,{label:t,noOptionLabel:n,onChange:i,tree:s,selectedId:void 0!==o?String(o):void 0,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:e})}function IO({__next40pxDefaultSize:e,label:t,noOptionLabel:n,categoriesList:r,selectedCategoryId:o,onChange:i,...s}){const a=(0,c.useMemo)((()=>kO(r)),[r]);return(0,_t.jsx)(NO,{label:t,noOptionLabel:n,onChange:i,tree:a,selectedId:void 0!==o?String(o):void 0,...s,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:e})}function RO(e){return"categoriesList"in e}function MO(e){return"categorySuggestions"in e}const AO=function({authorList:e,selectedAuthorId:t,numberOfItems:n,order:r,orderBy:o,maxItems:i=100,minItems:s=1,onAuthorChange:l,onNumberOfItemsChange:c,onOrderChange:u,onOrderByChange:d,...p}){return(0,_t.jsx)(dk,{spacing:"4",className:"components-query-controls",children:[u&&d&&(0,_t.jsx)(cS,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,a.__)("Order by"),value:void 0===o||void 0===r?void 0:`${o}/${r}`,options:[{label:(0,a.__)("Newest to oldest"),value:"date/desc"},{label:(0,a.__)("Oldest to newest"),value:"date/asc"},{label:(0,a.__)("A → Z"),value:"title/asc"},{label:(0,a.__)("Z → A"),value:"title/desc"}],onChange:e=>{if("string"!=typeof e)return;const[t,n]=e.split("/");n!==r&&u(n),t!==o&&d(t)}},"query-controls-order-select"),RO(p)&&p.categoriesList&&p.onCategoryChange&&(0,_t.jsx)(IO,{__next40pxDefaultSize:!0,categoriesList:p.categoriesList,label:(0,a.__)("Category"),noOptionLabel:(0,a._x)("All","categories"),selectedCategoryId:p.selectedCategoryId,onChange:p.onCategoryChange},"query-controls-category-select"),MO(p)&&p.categorySuggestions&&p.onCategoryChange&&(0,_t.jsx)(sD,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,a.__)("Categories"),value:p.selectedCategories&&p.selectedCategories.map((e=>({id:e.id,value:e.name||e.value}))),suggestions:Object.keys(p.categorySuggestions),onChange:p.onCategoryChange,maxSuggestions:20},"query-controls-categories-select"),l&&(0,_t.jsx)(TO,{__next40pxDefaultSize:!0,authorList:e,label:(0,a.__)("Author"),noOptionLabel:(0,a._x)("All","authors"),selectedAuthorId:t,onChange:l},"query-controls-author-select"),c&&(0,_t.jsx)(ZS,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,a.__)("Number of items"),value:n,onChange:c,min:s,max:i,required:!0},"query-controls-range-control")]})},DO=(0,c.createContext)({store:void 0,disabled:void 0});const zO=(0,c.forwardRef)((function({value:e,children:t,...n},r){const{store:o,disabled:i}=(0,c.useContext)(DO),s=et(o,"value"),a=void 0!==s&&s===e;return Ux({componentName:"Radio",size:void 0,__next40pxDefaultSize:n.__next40pxDefaultSize}),(0,_t.jsx)(__,{disabled:i,store:o,ref:r,value:e,render:(0,_t.jsx)(Jx,{variant:a?"primary":"secondary",...n}),children:t||e})})),OO=zO;const LO=(0,c.forwardRef)((function({label:e,checked:t,defaultChecked:n,disabled:r,onChange:o,children:i,...s},l){const u=n_({value:t,defaultValue:n,setValue:e=>{o?.(null!=e?e:void 0)},rtl:(0,a.isRTL)()}),d=(0,c.useMemo)((()=>({store:u,disabled:r})),[u,r]);return Xi()("wp.components.__experimentalRadioGroup",{alternative:"wp.components.RadioControl or wp.components.__experimentalToggleGroupControl",since:"6.8"}),(0,_t.jsx)(DO.Provider,{value:d,children:(0,_t.jsx)(l_,{store:u,render:(0,_t.jsx)(lE,{__shouldNotWarnDeprecated:!0,children:i}),"aria-label":e,ref:l,...s})})})),FO=LO;function BO(e,t){return`${e}-${t}-option-description`}function VO(e,t){return`${e}-${t}`}function $O(e){return`${e}__help`}const HO=function e(t){const{label:n,className:r,selected:o,help:i,onChange:a,hideLabelFromVision:c,options:u=[],id:d,...p}=t,f=(0,l.useInstanceId)(e,"inspector-radio-control",d),h=e=>a(e.target.value);return u?.length?(0,_t.jsxs)("fieldset",{id:f,className:s(r,"components-radio-control"),"aria-describedby":i?$O(f):void 0,children:[c?(0,_t.jsx)(Sl,{as:"legend",children:n}):(0,_t.jsx)(Wx.VisualLabel,{as:"legend",children:n}),(0,_t.jsx)(dk,{spacing:3,className:s("components-radio-control__group-wrapper",{"has-help":!!i}),children:u.map(((e,t)=>(0,_t.jsxs)("div",{className:"components-radio-control__option",children:[(0,_t.jsx)("input",{id:VO(f,t),className:"components-radio-control__input",type:"radio",name:f,value:e.value,onChange:h,checked:e.value===o,"aria-describedby":e.description?BO(f,t):void 0,...p}),(0,_t.jsx)("label",{className:"components-radio-control__label",htmlFor:VO(f,t),children:e.label}),e.description?(0,_t.jsx)(Bx,{__nextHasNoMarginBottom:!0,id:BO(f,t),className:"components-radio-control__option-description",children:e.description}):null]},VO(f,t))))}),!!i&&(0,_t.jsx)(Bx,{__nextHasNoMarginBottom:!0,id:$O(f),className:"components-base-control__help",children:i})]}):null};var WO=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),UO=function(){return UO=Object.assign||function(e){for(var t,n=1,r=arguments.length;n{},dL="bottom",pL="corner";function fL({axis:e,fadeTimeout:t=180,onResize:n=uL,position:r=dL,showPx:o=!1}){const[i,s]=(0,l.useResizeObserver)(),a=!!e,[u,d]=(0,c.useState)(!1),[p,f]=(0,c.useState)(!1),{width:h,height:m}=s,g=(0,c.useRef)(m),v=(0,c.useRef)(h),b=(0,c.useRef)(),x=(0,c.useCallback)((()=>{b.current&&window.clearTimeout(b.current),b.current=window.setTimeout((()=>{a||(d(!1),f(!1))}),t)}),[t,a]);(0,c.useEffect)((()=>{if(!(null!==h||null!==m))return;const e=h!==v.current,t=m!==g.current;if(e||t){if(h&&!v.current&&m&&!g.current)return v.current=h,void(g.current=m);e&&(d(!0),v.current=h),t&&(f(!0),g.current=m),n({width:h,height:m}),x()}}),[h,m,n,x]);const y=function({axis:e,height:t,moveX:n=!1,moveY:r=!1,position:o=dL,showPx:i=!1,width:s}){if(!n&&!r)return;if(o===pL)return`${s} x ${t}`;const a=i?" px":"";if(e){if("x"===e&&n)return`${s}${a}`;if("y"===e&&r)return`${t}${a}`}if(n&&r)return`${s} x ${t}`;if(n)return`${s}${a}`;if(r)return`${t}${a}`;return}({axis:e,height:m,moveX:u,moveY:p,position:r,showPx:o,width:h});return{label:y,resizeListener:i}}const hL=yl("div",{target:"e1wq7y4k3"})({name:"1cd7zoc",styles:"bottom:0;box-sizing:border-box;left:0;pointer-events:none;position:absolute;right:0;top:0"}),mL=yl("div",{target:"e1wq7y4k2"})({name:"ajymcs",styles:"align-items:center;box-sizing:border-box;display:inline-flex;justify-content:center;opacity:0;pointer-events:none;transition:opacity 120ms linear"}),gL=yl("div",{target:"e1wq7y4k1"})("background:",zl.theme.foreground,";border-radius:",Fl.radiusSmall,";box-sizing:border-box;font-family:",Ix("default.fontFamily"),";font-size:12px;color:",zl.theme.foregroundInverted,";padding:4px 8px;position:relative;"),vL=yl($v,{target:"e1wq7y4k0"})("&&&{color:",zl.theme.foregroundInverted,";display:block;font-size:13px;line-height:1.4;white-space:nowrap;}");const bL=(0,c.forwardRef)((function({label:e,position:t=pL,zIndex:n=1e3,...r},o){const i=!!e,s=t===pL;if(!i)return null;let l={opacity:i?1:void 0,zIndex:n},c={};return t===dL&&(l={...l,position:"absolute",bottom:-10,left:"50%",transform:"translate(-50%, 0)"},c={transform:"translate(0, 100%)"}),s&&(l={...l,position:"absolute",top:4,right:(0,a.isRTL)()?void 0:4,left:(0,a.isRTL)()?4:void 0}),(0,_t.jsx)(mL,{"aria-hidden":"true",className:"components-resizable-tooltip__tooltip-wrapper",ref:o,style:l,...r,children:(0,_t.jsx)(gL,{className:"components-resizable-tooltip__tooltip",style:c,children:(0,_t.jsx)(vL,{as:"span",children:e})})})})),xL=bL,yL=()=>{};const wL=(0,c.forwardRef)((function({axis:e,className:t,fadeTimeout:n=180,isVisible:r=!0,labelRef:o,onResize:i=yL,position:a=dL,showPx:l=!0,zIndex:c=1e3,...u},d){const{label:p,resizeListener:f}=fL({axis:e,fadeTimeout:n,onResize:i,showPx:l,position:a});if(!r)return null;const h=s("components-resize-tooltip",t);return(0,_t.jsxs)(hL,{"aria-hidden":"true",className:h,ref:d,...u,children:[f,(0,_t.jsx)(xL,{"aria-hidden":u["aria-hidden"],label:p,position:a,ref:o,zIndex:c})]})})),_L=wL,SL="components-resizable-box__handle",CL="components-resizable-box__side-handle",kL="components-resizable-box__corner-handle",jL={top:s(SL,CL,"components-resizable-box__handle-top"),right:s(SL,CL,"components-resizable-box__handle-right"),bottom:s(SL,CL,"components-resizable-box__handle-bottom"),left:s(SL,CL,"components-resizable-box__handle-left"),topLeft:s(SL,kL,"components-resizable-box__handle-top","components-resizable-box__handle-left"),topRight:s(SL,kL,"components-resizable-box__handle-top","components-resizable-box__handle-right"),bottomRight:s(SL,kL,"components-resizable-box__handle-bottom","components-resizable-box__handle-right"),bottomLeft:s(SL,kL,"components-resizable-box__handle-bottom","components-resizable-box__handle-left")},EL={width:void 0,height:void 0,top:void 0,right:void 0,bottom:void 0,left:void 0},PL={top:EL,right:EL,bottom:EL,left:EL,topLeft:EL,topRight:EL,bottomRight:EL,bottomLeft:EL};const NL=(0,c.forwardRef)((function({className:e,children:t,showHandle:n=!0,__experimentalShowTooltip:r=!1,__experimentalTooltipProps:o={},...i},a){return(0,_t.jsxs)(cL,{className:s("components-resizable-box__container",n&&"has-show-handle",e),handleComponent:Object.fromEntries(Object.keys(jL).map((e=>[e,(0,_t.jsx)("div",{tabIndex:-1},e)]))),handleClasses:jL,handleStyles:PL,ref:a,...i,children:[t,r&&(0,_t.jsx)(_L,{...o})]})}));const TL=function({naturalWidth:e,naturalHeight:t,children:n,isInline:r=!1}){if(1!==c.Children.count(n))return null;const o=r?"span":"div";let i;return e&&t&&(i=`${e} / ${t}`),(0,_t.jsx)(o,{className:"components-responsive-wrapper",children:(0,_t.jsx)("div",{children:(0,c.cloneElement)(n,{className:s("components-responsive-wrapper__content",n.props.className),style:{...n.props.style,aspectRatio:i}})})})},IL=function(){const{MutationObserver:e}=window;if(!e||!document.body||!window.parent)return;function t(){const e=document.body.getBoundingClientRect();window.parent.postMessage({action:"resize",width:e.width,height:e.height},"*")}function n(e){e.style&&["width","height","minHeight","maxHeight"].forEach((function(t){/^\\d+(vw|vh|svw|lvw|dvw|svh|lvh|dvh|vi|svi|lvi|dvi|vb|svb|lvb|dvb|vmin|svmin|lvmin|dvmin|vmax|svmax|lvmax|dvmax)$/.test(e.style[t])&&(e.style[t]="")}))}new e(t).observe(document.body,{attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0}),window.addEventListener("load",t,!0),Array.prototype.forEach.call(document.querySelectorAll("[style]"),n),Array.prototype.forEach.call(document.styleSheets,(function(e){Array.prototype.forEach.call(e.cssRules||e.rules,n)})),document.body.style.position="absolute",document.body.style.width="100%",document.body.setAttribute("data-resizable-iframe-connected",""),t(),window.addEventListener("resize",t,!0)};const RL=function({html:e="",title:t="",type:n,styles:r=[],scripts:o=[],onFocus:i,tabIndex:s}){const a=(0,c.useRef)(),[u,d]=(0,c.useState)(0),[p,f]=(0,c.useState)(0);function h(i=!1){if(!function(){try{return!!a.current?.contentDocument?.body}catch(e){return!1}}())return;const{contentDocument:s,ownerDocument:l}=a.current;if(!i&&null!==s?.body.getAttribute("data-resizable-iframe-connected"))return;const u=(0,_t.jsxs)("html",{lang:l.documentElement.lang,className:n,children:[(0,_t.jsxs)("head",{children:[(0,_t.jsx)("title",{children:t}),(0,_t.jsx)("style",{dangerouslySetInnerHTML:{__html:"\n\tbody {\n\t\tmargin: 0;\n\t}\n\thtml,\n\tbody,\n\tbody > div {\n\t\twidth: 100%;\n\t}\n\thtml.wp-has-aspect-ratio,\n\tbody.wp-has-aspect-ratio,\n\tbody.wp-has-aspect-ratio > div,\n\tbody.wp-has-aspect-ratio > div iframe {\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\toverflow: hidden; /* If it has an aspect ratio, it shouldn't scroll. */\n\t}\n\tbody > div > * {\n\t\tmargin-top: 0 !important; /* Has to have !important to override inline styles. */\n\t\tmargin-bottom: 0 !important;\n\t}\n"}}),r.map(((e,t)=>(0,_t.jsx)("style",{dangerouslySetInnerHTML:{__html:e}},t)))]}),(0,_t.jsxs)("body",{"data-resizable-iframe-connected":"data-resizable-iframe-connected",className:n,children:[(0,_t.jsx)("div",{dangerouslySetInnerHTML:{__html:e}}),(0,_t.jsx)("script",{type:"text/javascript",dangerouslySetInnerHTML:{__html:`(${IL.toString()})();`}}),o.map((e=>(0,_t.jsx)("script",{src:e},e)))]})]});s.open(),s.write(""+(0,c.renderToString)(u)),s.close()}return(0,c.useEffect)((()=>{function e(){h(!1)}function t(e){const t=a.current;if(!t||t.contentWindow!==e.source)return;let n=e.data||{};if("string"==typeof n)try{n=JSON.parse(n)}catch(e){}"resize"===n.action&&(d(n.width),f(n.height))}h();const n=a.current,r=n?.ownerDocument?.defaultView;return n?.addEventListener("load",e,!1),r?.addEventListener("message",t),()=>{n?.removeEventListener("load",e,!1),r?.removeEventListener("message",t)}}),[]),(0,c.useEffect)((()=>{h()}),[t,r,o]),(0,c.useEffect)((()=>{h(!0)}),[e,n]),(0,_t.jsx)("iframe",{ref:(0,l.useMergeRefs)([a,(0,l.useFocusableIframe)()]),title:t,tabIndex:s,className:"components-sandbox",sandbox:"allow-scripts allow-same-origin allow-presentation",onFocus:i,width:Math.ceil(u),height:Math.ceil(p)})};const ML=(0,c.forwardRef)((function({className:e,children:t,spokenMessage:n=t,politeness:r="polite",actions:o=[],onRemove:i,icon:l=null,explicitDismiss:u=!1,onDismiss:d,listRef:p},f){function h(e){e&&e.preventDefault&&e.preventDefault(),p?.current?.focus(),d?.(),i?.()}!function(e,t){const n="string"==typeof e?e:(0,c.renderToString)(e);(0,c.useEffect)((()=>{n&&(0,jy.speak)(n,t)}),[n,t])}(n,r);const m=(0,c.useRef)({onDismiss:d,onRemove:i});(0,c.useLayoutEffect)((()=>{m.current={onDismiss:d,onRemove:i}})),(0,c.useEffect)((()=>{const e=setTimeout((()=>{u||(m.current.onDismiss?.(),m.current.onRemove?.())}),1e4);return()=>clearTimeout(e)}),[u]);const g=s(e,"components-snackbar",{"components-snackbar-explicit-dismiss":!!u});o&&o.length>1&&(o=[o[0]]);const v=s("components-snackbar__content",{"components-snackbar__content-with-icon":!!l});return(0,_t.jsx)("div",{ref:f,className:g,onClick:u?void 0:h,tabIndex:0,role:u?void 0:"button",onKeyPress:u?void 0:h,"aria-label":u?void 0:(0,a.__)("Dismiss this notice"),"data-testid":"snackbar",children:(0,_t.jsxs)("div",{className:v,children:[l&&(0,_t.jsx)("div",{className:"components-snackbar__icon",children:l}),t,o.map((({label:e,onClick:t,url:n},r)=>(0,_t.jsx)(Jx,{__next40pxDefaultSize:!0,href:n,variant:"link",onClick:e=>function(e,t){e.stopPropagation(),i?.(),t&&t(e)}(e,t),className:"components-snackbar__action",children:e},r))),u&&(0,_t.jsx)("span",{role:"button","aria-label":(0,a.__)("Dismiss this notice"),tabIndex:0,className:"components-snackbar__dismiss-button",onClick:h,onKeyPress:h,children:"✕"})]})})})),AL=ML,DL={init:{height:0,opacity:0},open:{height:"auto",opacity:1,transition:{height:{type:"tween",duration:.3,ease:[0,0,.2,1]},opacity:{type:"tween",duration:.25,delay:.05,ease:[0,0,.2,1]}}},exit:{opacity:0,transition:{type:"tween",duration:.1,ease:[0,0,.2,1]}}};const zL=function({notices:e,className:t,children:n,onRemove:r}){const o=(0,c.useRef)(null),i=(0,l.useReducedMotion)();t=s("components-snackbar-list",t);const a=e=>()=>r?.(e.id);return(0,_t.jsxs)("div",{className:t,tabIndex:-1,ref:o,"data-testid":"snackbar-list",children:[n,(0,_t.jsx)(hg,{children:e.map((e=>{const{content:t,...n}=e;return(0,_t.jsx)(ag.div,{layout:!i,initial:"init",animate:"open",exit:"exit",variants:i?void 0:DL,children:(0,_t.jsx)("div",{className:"components-snackbar-list__notice-container",children:(0,_t.jsx)(AL,{...n,onRemove:a(e),listRef:o,children:e.content})})},e.id)}))})]})};const OL=Tl` from { transform: rotate(0deg); } to { transform: rotate(360deg); } - `,kL=cl("svg",{target:"ea4tfvq2"})("width:",Pl.spinnerSize,"px;height:",Pl.spinnerSize,"px;display:inline-block;margin:5px 11px 0;position:relative;color:",kl.theme.accent,";overflow:visible;opacity:1;background-color:transparent;"),jL={name:"9s4963",styles:"fill:transparent;stroke-width:1.5px"},EL=cl("circle",{target:"ea4tfvq1"})(jL,";stroke:",kl.gray[300],";"),PL=cl("path",{target:"ea4tfvq0"})(jL,";stroke:currentColor;stroke-linecap:round;transform-origin:50% 50%;animation:1.4s linear infinite both ",CL,";");const TL=(0,c.forwardRef)((function({className:e,...t},n){return(0,wt.jsxs)(kL,{className:s("components-spinner",e),viewBox:"0 0 100 100",width:"16",height:"16",xmlns:"http://www.w3.org/2000/svg",role:"presentation",focusable:"false",...t,ref:n,children:[(0,wt.jsx)(EL,{cx:"50",cy:"50",r:"50",vectorEffect:"non-scaling-stroke"}),(0,wt.jsx)(PL,{d:"m 50 0 a 50 50 0 0 1 50 50",vectorEffect:"non-scaling-stroke"})]})}));const RL=Xa((function(e,t){const n=LE(e);return(0,wt.jsx)(dl,{...n,ref:t})}),"Surface");function IL(e={}){var t=e,{composite:n,combobox:r}=t,o=T(t,["composite","combobox"]);const i=["items","renderedItems","moves","orientation","virtualFocus","includesBaseElement","baseElement","focusLoop","focusShift","focusWrap"],s=qe(o.store,Ke(n,i),Ke(r,i)),a=null==s?void 0:s.getState(),l=ht(P(E({},o),{store:s,includesBaseElement:F(o.includesBaseElement,null==a?void 0:a.includesBaseElement,!1),orientation:F(o.orientation,null==a?void 0:a.orientation,"horizontal"),focusLoop:F(o.focusLoop,null==a?void 0:a.focusLoop,!0)})),c=rt(),u=Ve(P(E({},l.getState()),{selectedId:F(o.selectedId,null==a?void 0:a.selectedId,o.defaultSelectedId),selectOnMove:F(o.selectOnMove,null==a?void 0:a.selectOnMove,!0)}),l,s);$e(u,(()=>Ue(u,["moves"],(()=>{const{activeId:e,selectOnMove:t}=u.getState();if(!t)return;if(!e)return;const n=l.item(e);n&&(n.dimmed||n.disabled||u.setState("selectedId",n.id))}))));let d=!0;$e(u,(()=>Ge(u,["selectedId"],((e,t)=>{d?n&&e.selectedId===t.selectedId||u.setState("activeId",e.selectedId):d=!0})))),$e(u,(()=>Ue(u,["selectedId","renderedItems"],(e=>{if(void 0!==e.selectedId)return;const{activeId:t,renderedItems:n}=u.getState(),r=l.item(t);if(!r||r.disabled||r.dimmed){const e=n.find((e=>!e.disabled&&!e.dimmed));u.setState("selectedId",null==e?void 0:e.id)}else u.setState("selectedId",r.id)})))),$e(u,(()=>Ue(u,["renderedItems"],(e=>{const t=e.renderedItems;if(t.length)return Ue(c,["renderedItems"],(e=>{const n=e.renderedItems,r=n.some((e=>!e.tabId));r&&n.forEach(((e,n)=>{if(e.tabId)return;const r=t[n];r&&c.renderItem(P(E({},e),{tabId:r.id}))}))}))}))));let p=null;return $e(u,(()=>{const e=()=>{p=u.getState().selectedId},t=()=>{d=!1,u.setState("selectedId",p)};return n&&"setSelectElement"in n?M(Ue(n,["value"],e),Ue(n,["mounted"],t)):r?M(Ue(r,["selectedValue"],e),Ue(r,["mounted"],t)):void 0})),P(E(E({},l),u),{panels:c,setSelectedId:e=>u.setState("selectedId",e),select:e=>{u.setState("selectedId",e),l.move(e)}})}function NL(e={}){const t=xR(),n=CR()||t;e=b(v({},e),{composite:void 0!==e.composite?e.composite:n,combobox:void 0!==e.combobox?e.combobox:t});const[r,o]=et(IL,e);return function(e,t,n){Pe(t,[n.composite,n.combobox]),Je(e=mt(e,t,n),n,"selectedId","setSelectedId"),Je(e,n,"selectOnMove");const[r,o]=et((()=>e.panels),{});return Pe(o,[e,o]),Object.assign((0,B.useMemo)((()=>b(v({},e),{panels:r})),[e,r]),{composite:n.composite,combobox:n.combobox})}(r,o,e)}var ML=jt([Nt],[Mt]),AL=(ML.useContext,ML.useScopedContext),DL=ML.useProviderContext,OL=(ML.ContextProvider,ML.ScopedContextProvider),zL=kt((function(e){var t=e,{store:n}=t,r=x(t,["store"]);const o=DL();D(n=n||o,!1);const i=n.useState((e=>"both"===e.orientation?void 0:e.orientation));return r=Ie(r,(e=>(0,wt.jsx)(OL,{value:n,children:e})),[n]),n.composite&&(r=v({focusable:!1},r)),r=v({role:"tablist","aria-orientation":i},r),r=ln(v({store:n},r))})),LL=_t((function(e){return Ct("div",zL(e))})),FL=kt((function(e){var t,n=e,{store:r,getItem:o}=n,i=x(n,["store","getItem"]);const s=AL();D(r=r||s,!1);const a=je(),l=i.id||a,c=z(i),u=(0,B.useCallback)((e=>{const t=b(v({},e),{dimmed:c});return o?o(t):t}),[c,o]),d=i.onClick,p=Se((e=>{null==d||d(e),e.defaultPrevented||null==r||r.setSelectedId(l)})),f=r.panels.useState((e=>{var t;return null==(t=e.items.find((e=>e.tabId===l)))?void 0:t.id})),h=!!a&&i.shouldRegisterItem,m=r.useState((e=>!!l&&e.activeId===l)),g=r.useState((e=>!!l&&e.selectedId===l)),y=r.useState((e=>!!r.item(e.activeId))),w=m||g&&!y,_=g||null==(t=i.accessibleWhenDisabled)||t;if(Qe(r.combobox||r.composite,"virtualFocus")&&(i=b(v({},i),{tabIndex:-1})),i=b(v({id:l,role:"tab","aria-selected":g,"aria-controls":f||void 0},i),{onClick:p}),r.composite){const e={id:l,accessibleWhenDisabled:_,store:r.composite,shouldRegisterItem:w&&h,render:i.render};i=b(v({},i),{render:(0,wt.jsx)(Tn,b(v({},e),{render:r.combobox&&r.composite!==r.combobox?(0,wt.jsx)(Tn,b(v({},e),{store:r.combobox})):e.render}))})}return i=Pn(b(v({store:r},i),{accessibleWhenDisabled:_,getItem:u,shouldRegisterItem:h}))})),BL=St(_t((function(e){return Ct("button",FL(e))}))),VL=kt((function(e){var t=e,{store:n,unmountOnHide:r,tabId:o,getItem:i}=t,s=x(t,["store","unmountOnHide","tabId","getItem"]);const a=DL();D(n=n||a,!1);const l=(0,B.useRef)(null),c=je(s.id),[u,d]=(0,B.useState)(!1);(0,B.useEffect)((()=>{const e=l.current;if(!e)return;const t=Vt(e);d(!!t.length)}),[]);const p=(0,B.useCallback)((e=>{const t=b(v({},e),{id:c||e.id,tabId:o});return i?i(t):t}),[c,o,i]),f=s.onKeyDown,h=Se((e=>{if(null==f||f(e),e.defaultPrevented)return;if(!(null==n?void 0:n.composite))return;const t=n.getState(),r=IL(b(v({},t),{activeId:t.selectedId}));r.setState("renderedItems",t.renderedItems);const o={ArrowLeft:r.previous,ArrowRight:r.next,Home:r.first,End:r.last}[e.key];if(!o)return;const i=o();i&&(e.preventDefault(),n.move(i))}));s=Ie(s,(e=>(0,wt.jsx)(OL,{value:n,children:e})),[n]);const m=n.panels.useState((()=>{var e;return o||(null==(e=null==n?void 0:n.panels.item(c))?void 0:e.tabId)})),g=Ln({open:n.useState((e=>!!m&&e.selectedId===m))}),y=g.useState("mounted");return s=b(v({id:c,role:"tabpanel","aria-labelledby":m||void 0},s),{children:r&&!y?null:s.children,ref:ke(l,s.ref),onKeyDown:h}),s=sn(v({focusable:!n.composite&&!u},s)),s=Br(v({store:g},s)),s=_n(b(v({store:n.panels},s),{getItem:p}))})),$L=_t((function(e){return Ct("div",VL(e))}));const HL=e=>{if(null!=e)return e.match(/^tab-panel-[0-9]*-(.*)/)?.[1]},WL=(0,c.forwardRef)((({className:e,children:t,tabs:n,selectOnMove:r=!0,initialTabName:o,orientation:i="horizontal",activeClass:a="is-active",onSelect:u},d)=>{const p=(0,l.useInstanceId)(WL,"tab-panel"),f=(0,c.useCallback)((e=>{if(void 0!==e)return`${p}-${e}`}),[p]),h=NL({setSelectedId:e=>{if(null==e)return;const t=n.find((t=>f(t.name)===e));if(t?.disabled||t===v)return;const r=HL(e);void 0!==r&&u?.(r)},orientation:i,selectOnMove:r,defaultSelectedId:f(o)}),m=HL(Qe(h,"selectedId")),g=(0,c.useCallback)((e=>{h.setState("selectedId",f(e))}),[f,h]),v=n.find((({name:e})=>e===m)),b=(0,l.usePrevious)(m);return(0,c.useEffect)((()=>{b!==m&&m===o&&m&&u?.(m)}),[m,o,u,b]),(0,c.useLayoutEffect)((()=>{if(v)return;const e=n.find((e=>e.name===o));if(!o||e)if(e&&!e.disabled)g(e.name);else{const e=n.find((e=>!e.disabled));e&&g(e.name)}}),[n,v,o,p,g]),(0,c.useEffect)((()=>{if(!v?.disabled)return;const e=n.find((e=>!e.disabled));e&&g(e.name)}),[n,v?.disabled,g,p]),(0,wt.jsxs)("div",{className:e,ref:d,children:[(0,wt.jsx)(LL,{store:h,className:"components-tab-panel__tabs",children:n.map((e=>(0,wt.jsx)(BL,{id:f(e.name),className:s("components-tab-panel__tabs-item",e.className,{[a]:e.name===m}),disabled:e.disabled,"aria-controls":`${f(e.name)}-view`,render:(0,wt.jsx)($x,{icon:e.icon,label:e.icon&&e.title,showTooltip:!!e.icon}),children:!e.icon&&e.title},e.name)))}),v&&(0,wt.jsx)($L,{id:`${f(v.name)}-view`,store:h,tabId:f(v.name),className:"components-tab-panel__tab-content",children:t(v)})]})})),UL=WL;const GL=(0,c.forwardRef)((function(e,t){const{__nextHasNoMarginBottom:n,__next40pxDefaultSize:r=!1,label:o,hideLabelFromVision:i,value:a,help:c,id:u,className:d,onChange:p,type:f="text",...h}=e,m=(0,l.useInstanceId)(GL,"inspector-text-control",u);return(0,wt.jsx)(Ax,{__nextHasNoMarginBottom:n,__associatedWPComponentName:"TextControl",label:o,hideLabelFromVision:i,id:m,help:c,className:d,children:(0,wt.jsx)("input",{className:s("components-text-control__input",{"is-next-40px-default-size":r}),type:f,id:m,value:a,onChange:e=>p(e.target.value),"aria-describedby":c?m+"__help":void 0,ref:t,...h})})})),KL=GL,qL={huge:"1440px",wide:"1280px","x-large":"1080px",large:"960px",medium:"782px",small:"600px",mobile:"480px","zoomed-in":"280px"},YL=bl("box-shadow:0 0 0 transparent;border-radius:",Pl.radiusSmall,";border:",Pl.borderWidth," solid ",kl.ui.border,";@media not ( prefers-reduced-motion ){transition:box-shadow 0.1s linear;}",""),XL=bl("border-color:",kl.theme.accent,";box-shadow:0 0 0 calc( ",Pl.borderWidthFocus," - ",Pl.borderWidth," ) ",kl.theme.accent,";outline:2px solid transparent;",""),ZL=cl("textarea",{target:"e1w5nnrk0"})("width:100%;display:block;font-family:",wx("default.fontFamily"),";line-height:20px;padding:9px 11px;",YL,";font-size:",wx("mobileTextMinFontSize"),";",`@media (min-width: ${qL["small"]})`,"{font-size:",wx("default.fontSize"),";}&:focus{",XL,";}&::-webkit-input-placeholder{color:",kl.ui.darkGrayPlaceholder,";}&::-moz-placeholder{opacity:1;color:",kl.ui.darkGrayPlaceholder,";}&:-ms-input-placeholder{color:",kl.ui.darkGrayPlaceholder,";}.is-dark-theme &{&::-webkit-input-placeholder{color:",kl.ui.lightGrayPlaceholder,";}&::-moz-placeholder{opacity:1;color:",kl.ui.lightGrayPlaceholder,";}&:-ms-input-placeholder{color:",kl.ui.lightGrayPlaceholder,";}}");const QL=(0,c.forwardRef)((function(e,t){const{__nextHasNoMarginBottom:n,label:r,hideLabelFromVision:o,value:i,help:s,onChange:a,rows:c=4,className:u,...d}=e,p=`inspector-textarea-control-${(0,l.useInstanceId)(QL)}`;return(0,wt.jsx)(Ax,{__nextHasNoMarginBottom:n,__associatedWPComponentName:"TextareaControl",label:r,hideLabelFromVision:o,id:p,help:s,className:u,children:(0,wt.jsx)(ZL,{className:"components-textarea-control__input",id:p,rows:c,onChange:e=>a(e.target.value),"aria-describedby":s?p+"__help":void 0,value:i,ref:t,...d})})})),JL=QL,eF=e=>{const{text:t="",highlight:n=""}=e,r=n.trim();if(!r)return(0,wt.jsx)(wt.Fragment,{children:t});const o=new RegExp(`(${yy(r)})`,"gi");return(0,c.createInterpolateElement)(t.replace(o,"$&"),{mark:(0,wt.jsx)("mark",{})})},tF=(0,wt.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,wt.jsx)(n.Path,{d:"M12 15.8c-3.7 0-6.8-3-6.8-6.8s3-6.8 6.8-6.8c3.7 0 6.8 3 6.8 6.8s-3.1 6.8-6.8 6.8zm0-12C9.1 3.8 6.8 6.1 6.8 9s2.4 5.2 5.2 5.2c2.9 0 5.2-2.4 5.2-5.2S14.9 3.8 12 3.8zM8 17.5h8V19H8zM10 20.5h4V22h-4z"})});const nF=function(e){const{children:t}=e;return(0,wt.jsxs)("div",{className:"components-tip",children:[(0,wt.jsx)(J_,{icon:tF}),(0,wt.jsx)("p",{children:t})]})};const rF=(0,c.forwardRef)((function({__nextHasNoMarginBottom:e,label:t,checked:n,help:r,className:o,onChange:i,disabled:a},c){const u=`inspector-toggle-control-${(0,l.useInstanceId)(rF)}`,d=qa()("components-toggle-control",o,!e&&bl({marginBottom:yl(3)},"",""));let p,f;return e||Fi()("Bottom margin styles for wp.components.ToggleControl",{since:"6.7",version:"7.0",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version."}),r&&("function"==typeof r?void 0!==n&&(f=r(n)):f=r,f&&(p=u+"__help")),(0,wt.jsx)(Ax,{id:u,help:f&&(0,wt.jsx)("span",{className:"components-toggle-control__help",children:f}),className:d,__nextHasNoMarginBottom:!0,children:(0,wt.jsxs)(ny,{justify:"flex-start",spacing:2,children:[(0,wt.jsx)(sD,{id:u,checked:n,onChange:function(e){i(e.target.checked)},"aria-describedby":p,disabled:a,ref:c}),(0,wt.jsx)(vg,{as:"label",htmlFor:u,className:s("components-toggle-control__label",{"is-disabled":a}),children:t})]})})})),oF=rF;var iF=jt([Nt],[Mt]),sF=iF.useContext,aF=(iF.useScopedContext,iF.useProviderContext),lF=(iF.ContextProvider,iF.ScopedContextProvider),cF=kt((function(e){var t=e,{store:n}=t,r=x(t,["store"]);const o=sF();return r=Pn(v({store:n=n||o},r))})),uF=St(_t((function(e){return Ct("button",cF(e))})));const dF=(0,c.createContext)(void 0);const pF=(0,c.forwardRef)((function({children:e,as:t,...n},r){const o=(0,c.useContext)(dF),i="function"==typeof e;if(!i&&!t)return null;const s={...n,ref:r,"data-toolbar-item":!0};if(!o)return t?(0,wt.jsx)(t,{...s,children:e}):i?e(s):null;const a=i?e:t&&(0,wt.jsx)(t,{children:e});return(0,wt.jsx)(uF,{accessibleWhenDisabled:!0,...s,store:o,render:a})})),fF=({children:e,className:t})=>(0,wt.jsx)("div",{className:t,children:e});const hF=(0,c.forwardRef)((function(e,t){const{children:n,className:r,containerClassName:o,extraProps:i,isActive:a,title:l,...u}=function({isDisabled:e,...t}){return{disabled:e,...t}}(e);return(0,c.useContext)(dF)?(0,wt.jsx)(pF,{className:s("components-toolbar-button",r),...i,...u,ref:t,children:e=>(0,wt.jsx)($x,{label:l,isPressed:a,...e,children:n})}):(0,wt.jsx)(fF,{className:o,children:(0,wt.jsx)($x,{ref:t,icon:u.icon,label:l,shortcut:u.shortcut,"data-subscript":u.subscript,onClick:e=>{e.stopPropagation(),u.onClick&&u.onClick(e)},className:s("components-toolbar__control",r),isPressed:a,accessibleWhenDisabled:!0,"data-toolbar-item":!0,...i,...u,children:n})})})),mF=({className:e,children:t,...n})=>(0,wt.jsx)("div",{className:e,...n,children:t});const gF=function({controls:e=[],toggleProps:t,...n}){const r=t=>(0,wt.jsx)(CT,{controls:e,toggleProps:{...t,"data-toolbar-item":!0},...n});return(0,c.useContext)(dF)?(0,wt.jsx)(pF,{...t,children:r}):r(t)};const vF=function({controls:e=[],children:t,className:n,isCollapsed:r,title:o,...i}){const a=(0,c.useContext)(dF);if(!(e&&e.length||t))return null;const l=s(a?"components-toolbar-group":"components-toolbar",n);let u;var d;return d=e,u=Array.isArray(d)&&Array.isArray(d[0])?e:[e],r?(0,wt.jsx)(gF,{label:o,controls:u,className:l,children:t,...i}):(0,wt.jsxs)(mF,{className:l,...i,children:[u?.flatMap(((e,t)=>e.map(((e,n)=>(0,wt.jsx)(hF,{containerClassName:t>0&&0===n?"has-left-divider":void 0,...e},[t,n].join()))))),t]})};function bF(e={}){var t;const n=null==(t=e.store)?void 0:t.getState();return ht(P(E({},e),{orientation:F(e.orientation,null==n?void 0:n.orientation,"horizontal"),focusLoop:F(e.focusLoop,null==n?void 0:n.focusLoop,!0)}))}function xF(e={}){const[t,n]=et(bF,e);return function(e,t,n){return mt(e,t,n)}(t,n,e)}var yF=kt((function(e){var t=e,{store:n,orientation:r,virtualFocus:o,focusLoop:i,rtl:s}=t,a=x(t,["store","orientation","virtualFocus","focusLoop","rtl"]);const l=aF(),c=xF({store:n=n||l,orientation:r,virtualFocus:o,focusLoop:i,rtl:s}),u=c.useState((e=>"both"===e.orientation?void 0:e.orientation));return a=Ie(a,(e=>(0,wt.jsx)(lF,{value:c,children:e})),[c]),a=v({role:"toolbar","aria-orientation":u},a),a=ln(v({store:c},a))})),wF=_t((function(e){return Ct("div",yF(e))}));const _F=(0,c.forwardRef)((function({label:e,...t},n){const r=xF({focusLoop:!0,rtl:(0,a.isRTL)()});return(0,wt.jsx)(dF.Provider,{value:r,children:(0,wt.jsx)(wF,{ref:n,"aria-label":e,store:r,...t})})}));const SF=(0,c.forwardRef)((function({className:e,label:t,variant:n,...r},o){const i=void 0!==n,a=(0,c.useMemo)((()=>i?{}:{DropdownMenu:{variant:"toolbar"},Dropdown:{variant:"toolbar"}}),[i]);if(!t){Fi()("Using Toolbar without label prop",{since:"5.6",alternative:"ToolbarGroup component",link:"https://developer.wordpress.org/block-editor/components/toolbar/"});const{title:t,...n}=r;return(0,wt.jsx)(vF,{isCollapsed:!1,...n,className:e})}const l=s("components-accessible-toolbar",e,n&&`is-${n}`);return(0,wt.jsx)(is,{value:a,children:(0,wt.jsx)(_F,{className:l,label:t,ref:o,...r})})}));const CF=(0,c.forwardRef)((function(e,t){return(0,c.useContext)(dF)?(0,wt.jsx)(pF,{ref:t,...e.toggleProps,children:t=>(0,wt.jsx)(CT,{...e,popoverProps:{...e.popoverProps},toggleProps:t})}):(0,wt.jsx)(CT,{...e})}));const kF={columns:e=>bl("grid-template-columns:",`repeat( ${e}, minmax(0, 1fr) )`,";",""),spacing:bl("column-gap:",yl(4),";row-gap:",yl(4),";",""),item:{fullWidth:{name:"18iuzk9",styles:"grid-column:1/-1"}}},jF={name:"huufmu",styles:">div:not( :first-of-type ){display:none;}"},EF=bl(kF.item.fullWidth," gap:",yl(2),";.components-dropdown-menu{margin:",yl(-1)," 0;line-height:0;}&&&& .components-dropdown-menu__toggle{padding:0;min-width:",yl(6),";}",""),PF={name:"1pmxm02",styles:"font-size:inherit;font-weight:500;line-height:normal;&&{margin:0;}"},TF=bl(kF.item.fullWidth,"&>div,&>fieldset{padding-bottom:0;margin-bottom:0;max-width:100%;}&& ",Sx,"{margin-bottom:0;",kx,":last-child{margin-bottom:0;}}",Rx,"{margin-bottom:0;}&& ",Qv,"{label{line-height:1.4em;}}",""),RF={name:"eivff4",styles:"display:none"},IF={name:"16gsvie",styles:"min-width:200px"},NF=cl("span",{target:"ews648u0"})("color:",kl.theme.accentDarker10,";font-size:11px;font-weight:500;line-height:1.4;",Sg({marginLeft:yl(3)})," text-transform:uppercase;"),MF=bl("color:",kl.gray[900],";&&[aria-disabled='true']{color:",kl.gray[700],";opacity:1;&:hover{color:",kl.gray[700],";}",NF,"{opacity:0.3;}}",""),AF=()=>{},DF=(0,c.createContext)({menuItems:{default:{},optional:{}},hasMenuItems:!1,isResetting:!1,shouldRenderPlaceholderItems:!1,registerPanelItem:AF,deregisterPanelItem:AF,flagItemCustomization:AF,registerResetAllFilter:AF,deregisterResetAllFilter:AF,areAllOptionalControlsHidden:!0}),OF=()=>(0,c.useContext)(DF);const zF=({itemClassName:e,items:t,toggleItem:n})=>{if(!t.length)return null;const r=(0,wt.jsx)(NF,{"aria-hidden":!0,children:(0,a.__)("Reset")});return(0,wt.jsx)(wt.Fragment,{children:t.map((([t,o])=>o?(0,wt.jsx)(CD,{className:e,role:"menuitem",label:(0,a.sprintf)((0,a.__)("Reset %s"),t),onClick:()=>{n(t),(0,my.speak)((0,a.sprintf)((0,a.__)("%s reset to default"),t),"assertive")},suffix:r,children:t},t):(0,wt.jsx)(CD,{icon:tk,className:e,role:"menuitemcheckbox",isSelected:!0,"aria-disabled":!0,children:t},t)))})},LF=({items:e,toggleItem:t})=>e.length?(0,wt.jsx)(wt.Fragment,{children:e.map((([e,n])=>{const r=n?(0,a.sprintf)((0,a.__)("Hide and reset %s"),e):(0,a.sprintf)((0,a._x)("Show %s","input control"),e);return(0,wt.jsx)(CD,{icon:n?tk:null,isSelected:n,label:r,onClick:()=>{n?(0,my.speak)((0,a.sprintf)((0,a.__)("%s hidden and reset to default"),e),"assertive"):(0,my.speak)((0,a.sprintf)((0,a.__)("%s is now visible"),e),"assertive"),t(e)},role:"menuitemcheckbox",children:e},e)}))}):null,FF=Xa(((e,t)=>{const{areAllOptionalControlsHidden:n,defaultControlsItemClassName:r,dropdownMenuClassName:o,hasMenuItems:i,headingClassName:s,headingLevel:l=2,label:u,menuItems:d,resetAll:p,toggleItem:f,dropdownMenuProps:h,...m}=function(e){const{className:t,headingLevel:n=2,...r}=Ya(e,"ToolsPanelHeader"),o=qa(),i=(0,c.useMemo)((()=>o(EF,t)),[t,o]),s=(0,c.useMemo)((()=>o(IF)),[o]),a=(0,c.useMemo)((()=>o(PF)),[o]),l=(0,c.useMemo)((()=>o(MF)),[o]),{menuItems:u,hasMenuItems:d,areAllOptionalControlsHidden:p}=OF();return{...r,areAllOptionalControlsHidden:p,defaultControlsItemClassName:l,dropdownMenuClassName:s,hasMenuItems:d,headingClassName:a,headingLevel:n,menuItems:u,className:i}}(e);if(!u)return null;const g=Object.entries(d?.default||{}),v=Object.entries(d?.optional||{}),b=n?Eg:xP,x=(0,a.sprintf)((0,a._x)("%s options","Button label to reveal tool panel options"),u),y=n?(0,a.__)("All options are currently hidden"):void 0,w=[...g,...v].some((([,e])=>e));return(0,wt.jsxs)(ny,{...m,ref:t,children:[(0,wt.jsx)(dk,{level:l,className:s,children:u}),i&&(0,wt.jsx)(CT,{...h,icon:b,label:x,menuProps:{className:o},toggleProps:{size:"small",description:y},children:()=>(0,wt.jsxs)(wt.Fragment,{children:[(0,wt.jsxs)(_D,{label:u,children:[(0,wt.jsx)(zF,{items:g,toggleItem:f,itemClassName:r}),(0,wt.jsx)(LF,{items:v,toggleItem:f})]}),(0,wt.jsx)(_D,{children:(0,wt.jsx)(CD,{"aria-disabled":!w,variant:"tertiary",onClick:()=>{w&&(p(),(0,my.speak)((0,a.__)("All options reset"),"assertive"))},children:(0,a.__)("Reset all")})})]})})]})}),"ToolsPanelHeader"),BF=FF;function VF(){return{panelItems:[],menuItemOrder:[],menuItems:{default:{},optional:{}}}}const $F=({panelItems:e,shouldReset:t,currentMenuItems:n,menuItemOrder:r})=>{const o={default:{},optional:{}},i={default:{},optional:{}};return e.forEach((({hasValue:e,isShownByDefault:r,label:i})=>{const s=r?"default":"optional",a=n?.[s]?.[i],l=a||e();o[s][i]=!t&&l})),r.forEach((e=>{o.default.hasOwnProperty(e)&&(i.default[e]=o.default[e]),o.optional.hasOwnProperty(e)&&(i.optional[e]=o.optional[e])})),Object.keys(o.default).forEach((e=>{i.default.hasOwnProperty(e)||(i.default[e]=o.default[e])})),Object.keys(o.optional).forEach((e=>{i.optional.hasOwnProperty(e)||(i.optional[e]=o.optional[e])})),i};function HF(e,t){const n=function(e,t){switch(t.type){case"REGISTER_PANEL":{const n=[...e],r=n.findIndex((e=>e.label===t.item.label));return-1!==r&&n.splice(r,1),n.push(t.item),n}case"UNREGISTER_PANEL":{const n=e.findIndex((e=>e.label===t.label));if(-1!==n){const t=[...e];return t.splice(n,1),t}return e}default:return e}}(e.panelItems,t),r=function(e,t){return"REGISTER_PANEL"===t.type?e.includes(t.item.label)?e:[...e,t.item.label]:e}(e.menuItemOrder,t),o=function(e,t){switch(t.type){case"REGISTER_PANEL":case"UNREGISTER_PANEL":return $F({currentMenuItems:e.menuItems,panelItems:e.panelItems,menuItemOrder:e.menuItemOrder,shouldReset:!1});case"RESET_ALL":return $F({panelItems:e.panelItems,menuItemOrder:e.menuItemOrder,shouldReset:!0});case"UPDATE_VALUE":{const n=e.menuItems[t.group][t.label];return t.value===n?e.menuItems:{...e.menuItems,[t.group]:{...e.menuItems[t.group],[t.label]:t.value}}}case"TOGGLE_VALUE":{const n=e.panelItems.find((e=>e.label===t.label));if(!n)return e.menuItems;const r=n.isShownByDefault?"default":"optional";return{...e.menuItems,[r]:{...e.menuItems[r],[t.label]:!e.menuItems[r][t.label]}}}default:return e.menuItems}}({panelItems:n,menuItemOrder:r,menuItems:e.menuItems},t);return{panelItems:n,menuItemOrder:r,menuItems:o}}function WF(e,t){switch(t.type){case"REGISTER":return[...e,t.filter];case"UNREGISTER":return e.filter((e=>e!==t.filter));default:return e}}const UF=e=>0===Object.keys(e).length;function GF(e){const{className:t,headingLevel:n=2,resetAll:r,panelId:o,hasInnerWrapper:i=!1,shouldRenderPlaceholderItems:s=!1,__experimentalFirstVisibleItemClass:a,__experimentalLastVisibleItemClass:l,...u}=Ya(e,"ToolsPanel"),d=(0,c.useRef)(!1),p=d.current;(0,c.useEffect)((()=>{p&&(d.current=!1)}),[p]);const[{panelItems:f,menuItems:h},m]=(0,c.useReducer)(HF,void 0,VF),[g,v]=(0,c.useReducer)(WF,[]),b=(0,c.useCallback)((e=>{m({type:"REGISTER_PANEL",item:e})}),[]),x=(0,c.useCallback)((e=>{m({type:"UNREGISTER_PANEL",label:e})}),[]),y=(0,c.useCallback)((e=>{v({type:"REGISTER",filter:e})}),[]),w=(0,c.useCallback)((e=>{v({type:"UNREGISTER",filter:e})}),[]),_=(0,c.useCallback)(((e,t,n="default")=>{m({type:"UPDATE_VALUE",group:n,label:t,value:e})}),[]),S=(0,c.useMemo)((()=>UF(h.default)&&!UF(h.optional)&&Object.values(h.optional).every((e=>!e))),[h]),C=qa(),k=(0,c.useMemo)((()=>{const e=i&&bl(">div:not( :first-of-type ){display:grid;",kF.columns(2)," ",kF.spacing," ",kF.item.fullWidth,";}","");const n=S&&jF;return C((e=>bl(kF.columns(e)," ",kF.spacing," border-top:",Pl.borderWidth," solid ",kl.gray[300],";margin-top:-1px;padding:",yl(4),";",""))(2),e,n,t)}),[S,t,C,i]),j=(0,c.useCallback)((e=>{m({type:"TOGGLE_VALUE",label:e})}),[]),E=(0,c.useCallback)((()=>{"function"==typeof r&&(d.current=!0,r(g)),m({type:"RESET_ALL"})}),[g,r]),P=e=>{const t=h.optional||{},n=e.find((e=>e.isShownByDefault||t[e.label]));return n?.label},T=P(f),R=P([...f].reverse()),I=f.length>0;return{...u,headingLevel:n,panelContext:(0,c.useMemo)((()=>({areAllOptionalControlsHidden:S,deregisterPanelItem:x,deregisterResetAllFilter:w,firstDisplayedItem:T,flagItemCustomization:_,hasMenuItems:I,isResetting:d.current,lastDisplayedItem:R,menuItems:h,panelId:o,registerPanelItem:b,registerResetAllFilter:y,shouldRenderPlaceholderItems:s,__experimentalFirstVisibleItemClass:a,__experimentalLastVisibleItemClass:l})),[S,x,w,T,_,R,h,o,I,y,b,s,a,l]),resetAllItems:E,toggleItem:j,className:k}}const KF=Xa(((e,t)=>{const{children:n,label:r,panelContext:o,resetAllItems:i,toggleItem:s,headingLevel:a,dropdownMenuProps:l,...c}=GF(e);return(0,wt.jsx)(ij,{...c,columns:2,ref:t,children:(0,wt.jsxs)(DF.Provider,{value:o,children:[(0,wt.jsx)(BF,{label:r,resetAll:i,toggleItem:s,headingLevel:a,dropdownMenuProps:l}),n]})})}),"ToolsPanel"),qF=()=>{};const YF=Xa(((e,t)=>{const{children:n,isShown:r,shouldRenderPlaceholder:o,...i}=function(e){const{className:t,hasValue:n,isShownByDefault:r=!1,label:o,panelId:i,resetAllFilter:s=qF,onDeselect:a,onSelect:u,...d}=Ya(e,"ToolsPanelItem"),{panelId:p,menuItems:f,registerResetAllFilter:h,deregisterResetAllFilter:m,registerPanelItem:g,deregisterPanelItem:v,flagItemCustomization:b,isResetting:x,shouldRenderPlaceholderItems:y,firstDisplayedItem:w,lastDisplayedItem:_,__experimentalFirstVisibleItemClass:S,__experimentalLastVisibleItemClass:C}=OF(),k=(0,c.useCallback)(n,[i]),j=(0,c.useCallback)(s,[i]),E=(0,l.usePrevious)(p),P=p===i||null===p;(0,c.useLayoutEffect)((()=>(P&&null!==E&&g({hasValue:k,isShownByDefault:r,label:o,panelId:i}),()=>{(null===E&&p||p===i)&&v(o)})),[p,P,r,o,k,i,E,g,v]),(0,c.useEffect)((()=>(P&&h(j),()=>{P&&m(j)})),[h,m,j,P]);const T=r?"default":"optional",R=f?.[T]?.[o],I=(0,l.usePrevious)(R),N=void 0!==f?.[T]?.[o],M=n();(0,c.useEffect)((()=>{(r||M)&&b(M,o,T)}),[M,T,o,b,r]),(0,c.useEffect)((()=>{N&&!x&&P&&(!R||M||I||u?.(),!R&&M&&I&&a?.())}),[P,R,N,x,M,I,u,a]);const A=r?void 0!==f?.[T]?.[o]:R,D=qa(),O=(0,c.useMemo)((()=>{const e=y&&!A;return D(TF,e&&RF,!e&&t,w===o&&S,_===o&&C)}),[A,y,t,D,w,_,S,C,o]);return{...d,isShown:A,shouldRenderPlaceholder:y,className:O}}(e);return r?(0,wt.jsx)(dl,{...i,ref:t,children:n}):o?(0,wt.jsx)(dl,{...i,ref:t}):null}),"ToolsPanelItem"),XF=YF,ZF=(0,c.createContext)(void 0),QF=ZF.Provider;function JF({children:e}){const[t,n]=(0,c.useState)(),r=(0,c.useMemo)((()=>({lastFocusedElement:t,setLastFocusedElement:n})),[t]);return(0,wt.jsx)(QF,{value:r,children:e})}function eB(e){return fT.focus.focusable.find(e,{sequential:!0}).filter((t=>t.closest('[role="row"]')===e))}const tB=(0,c.forwardRef)((function({children:e,onExpandRow:t=()=>{},onCollapseRow:n=()=>{},onFocusRow:r=()=>{},applicationAriaLabel:o,...i},s){const a=(0,c.useCallback)((e=>{const{keyCode:o,metaKey:i,ctrlKey:s,altKey:a}=e;if(i||s||a||![gy.UP,gy.DOWN,gy.LEFT,gy.RIGHT,gy.HOME,gy.END].includes(o))return;e.stopPropagation();const{activeElement:l}=document,{currentTarget:c}=e;if(!l||!c.contains(l))return;const u=l.closest('[role="row"]');if(!u)return;const d=eB(u),p=d.indexOf(l),f=0===p,h=f&&("false"===u.getAttribute("data-expanded")||"false"===u.getAttribute("aria-expanded"))&&o===gy.RIGHT;if([gy.LEFT,gy.RIGHT].includes(o)){let r;if(r=o===gy.LEFT?Math.max(0,p-1):Math.min(p+1,d.length-1),f){if(o===gy.LEFT){var m;if("true"===u.getAttribute("data-expanded")||"true"===u.getAttribute("aria-expanded"))return n(u),void e.preventDefault();const t=Math.max(parseInt(null!==(m=u?.getAttribute("aria-level"))&&void 0!==m?m:"1",10)-1,1),r=Array.from(c.querySelectorAll('[role="row"]'));let o=u;for(let e=r.indexOf(u);e>=0;e--){const n=r[e].getAttribute("aria-level");if(null!==n&&parseInt(n,10)===t){o=r[e];break}}eB(o)?.[0]?.focus()}if(o===gy.RIGHT){if("false"===u.getAttribute("data-expanded")||"false"===u.getAttribute("aria-expanded"))return t(u),void e.preventDefault();const n=eB(u);n.length>0&&n[r]?.focus()}return void e.preventDefault()}if(h)return;d[r].focus(),e.preventDefault()}else if([gy.UP,gy.DOWN].includes(o)){const t=Array.from(c.querySelectorAll('[role="row"]')),n=t.indexOf(u);let i;if(i=o===gy.UP?Math.max(0,n-1):Math.min(n+1,t.length-1),i===n)return void e.preventDefault();const s=eB(t[i]);if(!s||!s.length)return void e.preventDefault();s[Math.min(p,s.length-1)].focus(),r(e,u,t[i]),e.preventDefault()}else if([gy.HOME,gy.END].includes(o)){const t=Array.from(c.querySelectorAll('[role="row"]')),n=t.indexOf(u);let i;if(i=o===gy.HOME?0:t.length-1,i===n)return void e.preventDefault();const s=eB(t[i]);if(!s||!s.length)return void e.preventDefault();s[Math.min(p,s.length-1)].focus(),r(e,u,t[i]),e.preventDefault()}}),[t,n,r]);return(0,wt.jsx)(JF,{children:(0,wt.jsx)("div",{role:"application","aria-label":o,children:(0,wt.jsx)("table",{...i,role:"treegrid",onKeyDown:a,ref:s,children:(0,wt.jsx)("tbody",{children:e})})})})})),nB=tB;const rB=(0,c.forwardRef)((function({children:e,level:t,positionInSet:n,setSize:r,isExpanded:o,...i},s){return(0,wt.jsx)("tr",{...i,ref:s,role:"row","aria-level":t,"aria-posinset":n,"aria-setsize":r,"aria-expanded":o,children:e})})),oB=(0,c.forwardRef)((function({children:e,as:t,...n},r){const o=(0,c.useRef)(),i=r||o,{lastFocusedElement:s,setLastFocusedElement:a}=(0,c.useContext)(ZF);let l;s&&(l=s===("current"in i?i.current:void 0)?0:-1);const u={ref:i,tabIndex:l,onFocus:e=>a?.(e.target),...n};return"function"==typeof e?e(u):t?(0,wt.jsx)(t,{...u,children:e}):null})),iB=oB;const sB=(0,c.forwardRef)((function({children:e,...t},n){return(0,wt.jsx)(iB,{ref:n,...t,children:e})}));const aB=(0,c.forwardRef)((function({children:e,withoutGridItem:t=!1,...n},r){return(0,wt.jsx)("td",{...n,role:"gridcell",children:t?(0,wt.jsx)(wt.Fragment,{children:e}):(0,wt.jsx)(sB,{ref:r,children:e})})}));function lB(e){e.stopPropagation()}const cB=(0,c.forwardRef)(((e,t)=>(Fi()("wp.components.IsolatedEventContainer",{since:"5.7"}),(0,wt.jsx)("div",{...e,ref:t,onMouseDown:lB}))));function uB(e){const t=(0,c.useContext)(Ay);return(0,l.useObservableValue)(t.fills,e)}const dB=cl("div",{target:"ebn2ljm1"})("&:not( :first-of-type ){",(({offsetAmount:e})=>bl({marginInlineStart:e},"","")),";}",(({zIndex:e})=>bl({zIndex:e},"","")),";");var pB={name:"rs0gp6",styles:"grid-row-start:1;grid-column-start:1"};const fB=cl("div",{target:"ebn2ljm0"})("display:inline-grid;grid-auto-flow:column;position:relative;&>",dB,"{position:relative;justify-self:start;",(({isLayered:e})=>e?pB:void 0),";}");const hB=Xa((function(e,t){const{children:n,className:r,isLayered:o=!0,isReversed:i=!1,offset:s=0,...a}=Ya(e,"ZStack"),l=ey(n),u=l.length-1,d=l.map(((e,t)=>{const n=i?u-t:t,r=o?s*t:s,a=(0,c.isValidElement)(e)?e.key:t;return(0,wt.jsx)(dB,{offsetAmount:r,zIndex:n,children:e},a)}));return(0,wt.jsx)(fB,{...a,className:r,isLayered:o,ref:t,children:d})}),"ZStack"),mB=hB,gB={previous:[{modifier:"ctrlShift",character:"`"},{modifier:"ctrlShift",character:"~"},{modifier:"access",character:"p"}],next:[{modifier:"ctrl",character:"`"},{modifier:"access",character:"n"}]};function vB(e=gB){const t=(0,c.useRef)(null),[n,r]=(0,c.useState)(!1);function o(e){var n;const o=Array.from(null!==(n=t.current?.querySelectorAll('[role="region"][tabindex="-1"]'))&&void 0!==n?n:[]);if(!o.length)return;let i=o[0];const s=t.current?.ownerDocument?.activeElement?.closest('[role="region"][tabindex="-1"]'),a=s?o.indexOf(s):-1;if(-1!==a){let t=a+e;t=-1===t?o.length-1:t,t=t===o.length?0:t,i=o[t]}i.focus(),r(!0)}const i=(0,l.useRefEffect)((e=>{function t(){r(!1)}return e.addEventListener("click",t),()=>{e.removeEventListener("click",t)}}),[r]);return{ref:(0,l.useMergeRefs)([t,i]),className:n?"is-focusing-regions":"",onKeyDown(t){e.previous.some((({modifier:e,character:n})=>gy.isKeyboardEvent[e](t,n)))?o(-1):e.next.some((({modifier:e,character:n})=>gy.isKeyboardEvent[e](t,n)))&&o(1)}}}const bB=(0,l.createHigherOrderComponent)((e=>({shortcuts:t,...n})=>(0,wt.jsx)("div",{...vB(t),children:(0,wt.jsx)(e,{...n})})),"navigateRegions"),xB=(0,l.createHigherOrderComponent)((e=>function(t){const n=(0,l.useConstrainedTabbing)();return(0,wt.jsx)("div",{ref:n,tabIndex:-1,children:(0,wt.jsx)(e,{...t})})}),"withConstrainedTabbing"),yB=e=>(0,l.createHigherOrderComponent)((t=>class extends c.Component{constructor(e){super(e),this.nodeRef=this.props.node,this.state={fallbackStyles:void 0,grabStylesCompleted:!1},this.bindRef=this.bindRef.bind(this)}bindRef(e){e&&(this.nodeRef=e)}componentDidMount(){this.grabFallbackStyles()}componentDidUpdate(){this.grabFallbackStyles()}grabFallbackStyles(){const{grabStylesCompleted:t,fallbackStyles:n}=this.state;if(this.nodeRef&&!t){const t=e(this.nodeRef,this.props);Ji()(t,n)||this.setState({fallbackStyles:t,grabStylesCompleted:Object.values(t).every(Boolean)})}}render(){const e=(0,wt.jsx)(t,{...this.props,...this.state.fallbackStyles});return this.props.node?e:(0,wt.jsxs)("div",{ref:this.bindRef,children:[" ",e," "]})}}),"withFallbackStyles"),wB=window.wp.hooks,_B=16;function SB(e){return(0,l.createHigherOrderComponent)((t=>{const n="core/with-filters/"+e;let r;class o extends c.Component{constructor(n){super(n),void 0===r&&(r=(0,wB.applyFilters)(e,t))}componentDidMount(){o.instances.push(this),1===o.instances.length&&((0,wB.addAction)("hookRemoved",n,s),(0,wB.addAction)("hookAdded",n,s))}componentWillUnmount(){o.instances=o.instances.filter((e=>e!==this)),0===o.instances.length&&((0,wB.removeAction)("hookRemoved",n),(0,wB.removeAction)("hookAdded",n))}render(){return(0,wt.jsx)(r,{...this.props})}}o.instances=[];const i=(0,l.debounce)((()=>{r=(0,wB.applyFilters)(e,t),o.instances.forEach((e=>{e.forceUpdate()}))}),_B);function s(t){t===e&&i()}return o}),"withFilters")}const CB=(0,l.createHigherOrderComponent)((e=>{const t=({onFocusReturn:e}={})=>t=>n=>{const r=(0,l.useFocusReturn)(e);return(0,wt.jsx)("div",{ref:r,children:(0,wt.jsx)(t,{...n})})};if((n=e)instanceof c.Component||"function"==typeof n){const n=e;return t()(n)}var n;return t(e)}),"withFocusReturn"),kB=({children:e})=>(Fi()("wp.components.FocusReturnProvider component",{since:"5.7",hint:"This provider is not used anymore. You can just remove it from your codebase"}),e),jB=(0,l.createHigherOrderComponent)((e=>{function t(t,r){const[o,i]=(0,c.useState)([]),s=(0,c.useMemo)((()=>{const e=e=>{const t=e.id?e:{...e,id:Yy()};i((e=>[...e,t]))};return{createNotice:e,createErrorNotice:t=>{e({status:"error",content:t})},removeNotice:e=>{i((t=>t.filter((t=>t.id!==e))))},removeAllNotices:()=>{i([])}}}),[]),a={...t,noticeList:o,noticeOperations:s,noticeUI:o.length>0&&(0,wt.jsx)(YO,{className:"components-with-notices-ui",notices:o,onRemove:s.removeNotice})};return n?(0,wt.jsx)(e,{...a,ref:r}):(0,wt.jsx)(e,{...a})}let n;const{render:r}=e;return"function"==typeof r?(n=!0,(0,c.forwardRef)(t)):t}),"withNotices");var EB=jt([Nt,cr],[Mt,ur]),PB=EB.useContext,TB=EB.useScopedContext,RB=EB.useProviderContext,IB=EB.ContextProvider,NB=EB.ScopedContextProvider,MB=(0,B.createContext)(void 0),AB=jt([Nt],[Mt]),DB=AB.useContext,OB=AB.useScopedContext;AB.useProviderContext,AB.ContextProvider,AB.ScopedContextProvider,(0,B.createContext)(void 0);function zB(e={}){var t=e,{combobox:n,parent:r,menubar:o}=t,i=T(t,["combobox","parent","menubar"]);const s=!!o&&!r,a=qe(i.store,function(e,...t){if(e)return Be(e,"pick")(...t)}(r,["values"]),Ke(n,["arrowElement","anchorElement","contentElement","popoverElement","disclosureElement"])),l=a.getState(),c=ht(P(E({},i),{store:a,orientation:F(i.orientation,l.orientation,"vertical")})),u=Wn(P(E({},i),{store:a,placement:F(i.placement,l.placement,"bottom-start"),timeout:F(i.timeout,l.timeout,s?0:150),hideTimeout:F(i.hideTimeout,l.hideTimeout,0)})),d=Ve(P(E(E({},c.getState()),u.getState()),{initialFocus:F(l.initialFocus,"container"),values:F(i.values,l.values,i.defaultValues,{})}),c,u,a);return $e(d,(()=>Ue(d,["mounted"],(e=>{e.mounted||d.setState("activeId",null)})))),$e(d,(()=>Ue(r,["orientation"],(e=>{d.setState("placement","vertical"===e.orientation?"right-start":"bottom-start")})))),P(E(E(E({},c),u),d),{combobox:n,parent:r,menubar:o,hideAll:()=>{u.hide(),null==r||r.hideAll()},setInitialFocus:e=>d.setState("initialFocus",e),setValues:e=>d.setState("values",e),setValue:(e,t)=>{"__proto__"!==e&&"constructor"!==e&&(Array.isArray(e)||d.setState("values",(n=>{const r=n[e],o=I(t,r);return o===r?n:P(E({},n),{[e]:void 0!==o&&o})})))}})}function LB(e={}){const t=PB(),n=DB(),r=yR();e=b(v({},e),{parent:void 0!==e.parent?e.parent:t,menubar:void 0!==e.menubar?e.menubar:n,combobox:void 0!==e.combobox?e.combobox:r});const[o,i]=et(zB,e);return function(e,t,n){return Pe(t,[n.combobox,n.parent,n.menubar]),Je(e,n,"values","setValues"),Object.assign($n(mt(e,t,n),t,n),{combobox:n.combobox,parent:n.parent,menubar:n.menubar})}(o,i,e)}function FB(e,t){return!!(null==e?void 0:e.some((e=>!!e.element&&(e.element!==t&&"true"===e.element.getAttribute("aria-expanded")))))}var BB=kt((function(e){var t=e,{store:n,focusable:r,accessibleWhenDisabled:o,showOnHover:i}=t,s=x(t,["store","focusable","accessibleWhenDisabled","showOnHover"]);const a=RB();D(n=n||a,!1);const l=(0,B.useRef)(null),c=n.parent,u=n.menubar,d=!!c,p=!!u&&!d,f=z(s),h=()=>{const e=l.current;e&&(null==n||n.setDisclosureElement(e),null==n||n.setAnchorElement(e),null==n||n.show())},m=s.onFocus,g=Se((e=>{if(null==m||m(e),f)return;if(e.defaultPrevented)return;if(null==n||n.setAutoFocusOnShow(!1),null==n||n.setActiveId(null),!u)return;if(!p)return;const{items:t}=u.getState();FB(t,e.currentTarget)&&h()})),y=n.useState((e=>e.placement.split("-")[0])),w=s.onKeyDown,_=Se((e=>{if(null==w||w(e),f)return;if(e.defaultPrevented)return;const t=function(e,t){return{ArrowDown:("bottom"===t||"top"===t)&&"first",ArrowUp:("bottom"===t||"top"===t)&&"last",ArrowRight:"right"===t&&"first",ArrowLeft:"left"===t&&"first"}[e.key]}(e,y);t&&(e.preventDefault(),h(),null==n||n.setAutoFocusOnShow(!0),null==n||n.setInitialFocus(t))})),S=s.onClick,C=Se((e=>{if(null==S||S(e),e.defaultPrevented)return;if(!n)return;const t=!e.detail,{open:r}=n.getState();r&&!t||(d&&!t||n.setAutoFocusOnShow(!0),n.setInitialFocus(t?"first":"container")),d&&h()}));s=Ie(s,(e=>(0,wt.jsx)(IB,{value:n,children:e})),[n]),d&&(s=b(v({},s),{render:(0,wt.jsx)(Kn.div,{render:s.render})}));const k=je(s.id),j=Qe((null==c?void 0:c.combobox)||c,"contentElement"),E=d||p?re(j,"menuitem"):void 0,P=n.useState("contentElement");return s=b(v({id:k,role:E,"aria-haspopup":ne(P,"menu")},s),{ref:ke(l,s.ref),onFocus:g,onKeyDown:_,onClick:C}),s=dr(b(v({store:n,focusable:r,accessibleWhenDisabled:o},s),{showOnHover:e=>{if(!(()=>{if("function"==typeof i)return i(e);if(null!=i)return i;if(d)return!0;if(!u)return!1;const{items:t}=u.getState();return p&&FB(t)})())return!1;const t=p?u:c;return!t||(t.setActiveId(e.currentTarget.id),!0)}})),s=LR(v({store:n,toggleOnClick:!d,focusable:r,accessibleWhenDisabled:o},s)),s=KR(v({store:n,typeahead:p},s))})),VB=_t((function(e){return Ct("button",BB(e))}));var $B=kt((function(e){var t=e,{store:n,alwaysVisible:r,composite:o}=t,i=x(t,["store","alwaysVisible","composite"]);const s=RB();D(n=n||s,!1);const a=n.parent,l=n.menubar,c=!!a,u=je(i.id),d=i.onKeyDown,p=n.useState((e=>e.placement.split("-")[0])),f=n.useState((e=>"both"===e.orientation?void 0:e.orientation)),h="vertical"!==f,m=Qe(l,(e=>!!e&&"vertical"!==e.orientation)),g=Se((e=>{if(null==d||d(e),!e.defaultPrevented){if(c||l&&!h){const t={ArrowRight:()=>"left"===p&&!h,ArrowLeft:()=>"right"===p&&!h,ArrowUp:()=>"bottom"===p&&h,ArrowDown:()=>"top"===p&&h}[e.key];if(null==t?void 0:t())return e.stopPropagation(),e.preventDefault(),null==n?void 0:n.hide()}if(l){const t={ArrowRight:()=>{if(m)return l.next()},ArrowLeft:()=>{if(m)return l.previous()},ArrowDown:()=>{if(!m)return l.next()},ArrowUp:()=>{if(!m)return l.previous()}}[e.key],n=null==t?void 0:t();void 0!==n&&(e.stopPropagation(),e.preventDefault(),l.move(n))}}}));i=Ie(i,(e=>(0,wt.jsx)(NB,{value:n,children:e})),[n]);const y=function(e){var t=e,{store:n}=t,r=x(t,["store"]);const[o,i]=(0,B.useState)(void 0),s=r["aria-label"],a=Qe(n,"disclosureElement"),l=Qe(n,"contentElement");return(0,B.useEffect)((()=>{const e=a;e&&l&&(s||l.hasAttribute("aria-label")?i(void 0):e.id&&i(e.id))}),[s,a,l]),o}(v({store:n},i)),w=Fr(n.useState("mounted"),i.hidden,r),_=w?b(v({},i.style),{display:"none"}):i.style;i=b(v({id:u,"aria-labelledby":y,hidden:w},i),{ref:ke(u?n.setContentElement:null,i.ref),style:_,onKeyDown:g});const S=!!n.combobox;return(o=null!=o?o:!S)&&(i=v({role:"menu","aria-orientation":f},i)),i=ln(v({store:n,composite:o},i)),i=KR(v({store:n,typeahead:!S},i))})),HB=(_t((function(e){return Ct("div",$B(e))})),kt((function(e){var t=e,{store:n,modal:r=!1,portal:o=!!r,hideOnEscape:i=!0,autoFocusOnShow:s=!0,hideOnHoverOutside:a,alwaysVisible:l}=t,c=x(t,["store","modal","portal","hideOnEscape","autoFocusOnShow","hideOnHoverOutside","alwaysVisible"]);const u=RB();D(n=n||u,!1);const d=(0,B.useRef)(null),p=n.parent,f=n.menubar,h=!!p,m=!!f&&!h;c=b(v({},c),{ref:ke(d,c.ref)});const g=$B(v({store:n,alwaysVisible:l},c)),{"aria-labelledby":y}=g;c=x(g,["aria-labelledby"]);const[w,_]=(0,B.useState)(),S=n.useState("autoFocusOnShow"),C=n.useState("initialFocus"),k=n.useState("baseElement"),j=n.useState("renderedItems");(0,B.useEffect)((()=>{let e=!1;return _((t=>{var n,r,o;if(e)return;if(!S)return;if(null==(n=null==t?void 0:t.current)?void 0:n.isConnected)return t;const i=(0,B.createRef)();switch(C){case"first":i.current=(null==(r=j.find((e=>!e.disabled&&e.element)))?void 0:r.element)||null;break;case"last":i.current=(null==(o=[...j].reverse().find((e=>!e.disabled&&e.element)))?void 0:o.element)||null;break;default:i.current=k}return i})),()=>{e=!0}}),[n,S,C,j,k]);const E=!h&&r,P=!!s,T=!!w||!!c.initialFocus||!!E,R=Qe(n.combobox||n,"contentElement"),I=Qe((null==p?void 0:p.combobox)||p,"contentElement"),N=(0,B.useMemo)((()=>{if(!I)return;if(!R)return;const e=R.getAttribute("role"),t=I.getAttribute("role");return"menu"!==t&&"menubar"!==t||"menu"!==e?I:void 0}),[R,I]);return void 0!==N&&(c=v({preserveTabOrderAnchor:N},c)),c=Di(b(v({store:n,alwaysVisible:l,initialFocus:w,autoFocusOnShow:P?T&&s:S||!!E},c),{hideOnEscape:e=>!O(i,e)&&(null==n||n.hideAll(),!0),hideOnHoverOutside(e){const t=null==n?void 0:n.getState().disclosureElement;return!!("function"==typeof a?a(e):null!=a?a:h||m&&(!t||!Gt(t)))&&(!!e.defaultPrevented||(!h||(!t||(function(e,t,n){const r=new Event(t,n);e.dispatchEvent(r)}(t,"mouseout",e),!Gt(t)||(requestAnimationFrame((()=>{Gt(t)||null==n||n.hide()})),!1)))))},modal:E,portal:o,backdrop:!h&&c.backdrop})),c=v({"aria-labelledby":y},c)}))),WB=uo(_t((function(e){return Ct("div",HB(e))})),RB);const UB=(0,wt.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,wt.jsx)(n.Path,{d:"M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z"})});var GB=kt((function(e){var t=e,{store:n,hideOnClick:r=!0,preventScrollOnKeyDown:o=!0,focusOnHover:i,blurOnHoverEnd:s}=t,a=x(t,["store","hideOnClick","preventScrollOnKeyDown","focusOnHover","blurOnHoverEnd"]);const l=TB(!0),c=OB();D(n=n||l||c,!1);const u=a.onClick,d=Re(r),p="hideAll"in n?n.hideAll:void 0,f=!!p,h=Se((e=>{if(null==u||u(e),e.defaultPrevented)return;if(de(e))return;if(ue(e))return;if(!p)return;"menu"!==e.currentTarget.getAttribute("aria-haspopup")&&d(e)&&p()})),m=re(Qe(n,(e=>"contentElement"in e?e.contentElement:null)),"menuitem");return a=b(v({role:m},a),{onClick:h}),a=Pn(v({store:n,preventScrollOnKeyDown:o},a)),a=rI(b(v({store:n},a),{focusOnHover(e){if(!n)return!1;if(!("function"==typeof i?i(e):null==i||i))return!1;const{baseElement:t,items:r}=n.getState();return f?(e.currentTarget.hasAttribute("aria-expanded")&&e.currentTarget.focus(),!0):!!function(e,t,n){var r;if(!e)return!1;if(Gt(e))return!0;const o=null==t?void 0:t.find((e=>{var t;return e.element!==n&&"true"===(null==(t=e.element)?void 0:t.getAttribute("aria-expanded"))})),i=null==(r=null==o?void 0:o.element)?void 0:r.getAttribute("aria-controls");if(!i)return!1;const s=K(e).getElementById(i);return!(!s||!Gt(s)&&!s.querySelector("[role=menuitem][aria-expanded=true]"))}(t,r,e.currentTarget)&&(e.currentTarget.focus(),!0)},blurOnHoverEnd:e=>"function"==typeof s?s(e):null!=s?s:f})),a})),KB=St(_t((function(e){return Ct("div",GB(e))}))),qB=jt(),YB=qB.useContext,XB=(qB.useScopedContext,qB.useProviderContext,qB.ContextProvider,qB.ScopedContextProvider,"input");function ZB(e,t){t?e.indeterminate=!0:e.indeterminate&&(e.indeterminate=!1)}function QB(e){return Array.isArray(e)?e.toString():e}var JB=kt((function(e){var t=e,{store:n,name:r,value:o,checked:i,defaultChecked:s}=t,a=x(t,["store","name","value","checked","defaultChecked"]);const l=YB();n=n||l;const[c,u]=(0,B.useState)(null!=s&&s),d=Qe(n,(e=>{if(void 0!==i)return i;if(void 0===(null==e?void 0:e.value))return c;if(null!=o){if(Array.isArray(e.value)){const t=QB(o);return e.value.includes(t)}return e.value===o}return!Array.isArray(e.value)&&("boolean"==typeof e.value&&e.value)})),p=(0,B.useRef)(null),f=function(e,t){return"input"===e&&(!t||"checkbox"===t)}(Ee(p,XB),a.type),h=d?"mixed"===d:void 0,m="mixed"!==d&&d,g=z(a),[y,w]=Te();(0,B.useEffect)((()=>{const e=p.current;e&&(ZB(e,h),f||(e.checked=m,void 0!==r&&(e.name=r),void 0!==o&&(e.value=`${o}`)))}),[y,h,f,m,r,o]);const _=a.onChange,S=Se((e=>{if(g)return e.stopPropagation(),void e.preventDefault();if(ZB(e.currentTarget,h),f||(e.currentTarget.checked=!e.currentTarget.checked,w()),null==_||_(e),e.defaultPrevented)return;const t=e.currentTarget.checked;u(t),null==n||n.setValue((e=>{if(null==o)return t;const n=QB(o);return Array.isArray(e)?t?e.includes(n)?e:[...e,n]:e.filter((e=>e!==n)):e!==n&&n}))})),C=a.onClick,k=Se((e=>{null==C||C(e),e.defaultPrevented||f||S(e)}));return a=Ie(a,(e=>(0,wt.jsx)(sI.Provider,{value:m,children:e})),[m]),a=b(v({role:f?void 0:"checkbox",type:f?"checkbox":void 0,"aria-checked":d},a),{ref:ke(p,a.ref),onChange:S,onClick:k}),a=kn(v({clickOnEnter:!f},a)),L(v({name:f?r:void 0,value:f?o:void 0,checked:m},a))}));_t((function(e){const t=JB(e);return Ct(XB,t)}));function eV(e={}){var t;e.store;const n=null==(t=e.store)?void 0:t.getState(),r=Ve({value:F(e.value,null==n?void 0:n.value,e.defaultValue,!1)},e.store);return P(E({},r),{setValue:e=>r.setState("value",e)})}function tV(e={}){const[t,n]=et(eV,e);return function(e,t,n){return Pe(t,[n.store]),Je(e,n,"value","setValue"),e}(t,n,e)}function nV(e,t,n){if(void 0===t)return Array.isArray(e)?e:!!n;const r=function(e){return Array.isArray(e)?e.toString():e}(t);return Array.isArray(e)?n?e.includes(r)?e:[...e,r]:e.filter((e=>e!==r)):n?r:e!==r&&e}var rV=kt((function(e){var t=e,{store:n,name:r,value:o,checked:i,defaultChecked:s,hideOnClick:a=!1}=t,l=x(t,["store","name","value","checked","defaultChecked","hideOnClick"]);const c=TB();D(n=n||c,!1);const u=we(s);(0,B.useEffect)((()=>{null==n||n.setValue(r,((e=[])=>u?nV(e,o,!0):e))}),[n,r,o,u]),(0,B.useEffect)((()=>{void 0!==i&&(null==n||n.setValue(r,(e=>nV(e,o,i))))}),[n,r,o,i]);const d=tV({value:n.useState((e=>e.values[r])),setValue(e){null==n||n.setValue(r,(()=>{if(void 0===i)return e;const t=nV(e,o,i);return Array.isArray(t)&&Array.isArray(e)&&function(e,t){if(e===t)return!0;if(!e)return!1;if(!t)return!1;if("object"!=typeof e)return!1;if("object"!=typeof t)return!1;const n=Object.keys(e),r=Object.keys(t),{length:o}=n;if(r.length!==o)return!1;for(const r of n)if(e[r]!==t[r])return!1;return!0}(e,t)?e:t}))}});return l=v({role:"menuitemcheckbox"},l),l=JB(v({store:d,name:r,value:o,checked:i},l)),l=GB(v({store:n,hideOnClick:a},l))})),oV=St(_t((function(e){return Ct("div",rV(e))})));function iV(e,t,n){return void 0===n?e:n?t:e}var sV=kt((function(e){var t=e,{store:n,name:r,value:o,checked:i,onChange:s,hideOnClick:a=!1}=t,l=x(t,["store","name","value","checked","onChange","hideOnClick"]);const c=TB();D(n=n||c,!1);const u=we(l.defaultChecked);(0,B.useEffect)((()=>{null==n||n.setValue(r,((e=!1)=>iV(e,o,u)))}),[n,r,o,u]),(0,B.useEffect)((()=>{void 0!==i&&(null==n||n.setValue(r,(e=>iV(e,o,i))))}),[n,r,o,i]);const d=n.useState((e=>e.values[r]===o));return l=Ie(l,(e=>(0,wt.jsx)(MB.Provider,{value:!!d,children:e})),[d]),l=v({role:"menuitemradio"},l),l=h_(v({name:r,value:o,checked:d,onChange(e){if(null==s||s(e),e.defaultPrevented)return;const t=e.currentTarget;null==n||n.setValue(r,(e=>iV(e,o,null!=i?i:t.checked)))}},l)),l=GB(v({store:n,hideOnClick:a},l))})),aV=St(_t((function(e){return Ct("div",sV(e))}))),lV=kt((function(e){return e=hn(e)})),cV=_t((function(e){return Ct("div",lV(e))})),uV=kt((function(e){return e=bn(e)})),dV=_t((function(e){return Ct("div",uV(e))})),pV=kt((function(e){var t=e,{store:n}=t,r=x(t,["store"]);const o=Rt();D(n=n||o,!1);const i=n.useState((e=>"horizontal"===e.orientation?"vertical":"horizontal"));return r=QE(b(v({},r),{orientation:i}))})),fV=(_t((function(e){return Ct("hr",pV(e))})),kt((function(e){var t=e,{store:n}=t,r=x(t,["store"]);const o=PB();return r=pV(v({store:n=n||o},r))}))),hV=_t((function(e){return Ct("hr",fV(e))}));const mV=.82,gV=.9,vV={IN:"400ms",OUT:"200ms"},bV="cubic-bezier(0.33, 0, 0, 1)",xV=yl(1),yV=yl(2),wV=yl(3),_V=kl.theme.gray[300],SV=kl.theme.gray[200],CV=kl.theme.gray[700],kV=kl.theme.gray[100],jV=kl.theme.foreground,EV=`0 0 0 ${Pl.borderWidth} ${_V}, ${Pl.elevationMedium}`,PV=`0 0 0 ${Pl.borderWidth} ${jV}`,TV="minmax( 0, max-content ) 1fr",RV=cl("div",{target:"e1kdzosf14"})("position:relative;background-color:",kl.ui.background,";border-radius:",Pl.radiusMedium,";",(e=>bl("box-shadow:","toolbar"===e.variant?PV:EV,";",""))," overflow:hidden;@media not ( prefers-reduced-motion ){transition-property:transform,opacity;transition-timing-function:",bV,";transition-duration:",vV.IN,";will-change:transform,opacity;opacity:0;&:has( [data-enter] ){opacity:1;}&:has( [data-leave] ){transition-duration:",vV.OUT,";}&:has( [data-side='bottom'] ),&:has( [data-side='top'] ){transform:scaleY( ",mV," );}&:has( [data-side='bottom'] ){transform-origin:top;}&:has( [data-side='top'] ){transform-origin:bottom;}&:has( [data-enter][data-side='bottom'] ),&:has( [data-enter][data-side='top'] ),&:has( [data-leave][data-side='bottom'] ),&:has( [data-leave][data-side='top'] ){transform:scaleY( 1 );}}"),IV=cl("div",{target:"e1kdzosf13"})("position:relative;z-index:1000000;display:grid;grid-template-columns:",TV,";grid-template-rows:auto;box-sizing:border-box;min-width:160px;max-width:320px;max-height:var( --popover-available-height );padding:",xV,";overscroll-behavior:contain;overflow:auto;outline:2px solid transparent!important;@media not ( prefers-reduced-motion ){transition:inherit;transform-origin:inherit;&[data-side='bottom'],&[data-side='top']{transform:scaleY(\n\t\t\t\tcalc(\n\t\t\t\t\t1 / ",mV," *\n\t\t\t\t\t\t",gV,"\n\t\t\t\t)\n\t\t\t);}&[data-enter][data-side='bottom'],&[data-enter][data-side='top'],&[data-leave][data-side='bottom'],&[data-leave][data-side='top']{transform:scaleY( 1 );}}"),NV=bl("all:unset;position:relative;min-height:",yl(10),";box-sizing:border-box;grid-column:1/-1;display:grid;grid-template-columns:",TV,";align-items:center;@supports ( grid-template-columns: subgrid ){grid-template-columns:subgrid;}font-size:",wx("default.fontSize"),";font-family:inherit;font-weight:normal;line-height:20px;color:",kl.theme.foreground,";border-radius:",Pl.radiusSmall,";padding-block:",yV,";padding-inline:",wV,";scroll-margin:",xV,";user-select:none;outline:none;&[aria-disabled='true']{color:",kl.ui.textDisabled,";cursor:not-allowed;}&[data-active-item]:not( [data-focus-visible] ):not(\n\t\t\t[aria-disabled='true']\n\t\t){background-color:",kl.theme.accent,";color:",kl.white,";}&[data-focus-visible]{box-shadow:0 0 0 1.5px ",kl.theme.accent,";outline:2px solid transparent;}&:active,&[data-active]{}",IV,':not(:focus) &:not(:focus)[aria-expanded="true"]{background-color:',kV,";color:",kl.theme.foreground,";}svg{fill:currentColor;}",""),MV=cl(KB,{target:"e1kdzosf12"})(NV,";"),AV=cl(oV,{target:"e1kdzosf11"})(NV,";"),DV=cl(aV,{target:"e1kdzosf10"})(NV,";"),OV=cl("span",{target:"e1kdzosf9"})("grid-column:1;",AV,">&,",DV,">&{min-width:",yl(6),";}",AV,">&,",DV,">&,&:not( :empty ){margin-inline-end:",yl(2),";}display:flex;align-items:center;justify-content:center;color:",CV,";[data-active-item]:not( [data-focus-visible] )>&,[aria-disabled='true']>&{color:inherit;}"),zV=cl("div",{target:"e1kdzosf8"})("grid-column:2;display:flex;align-items:center;justify-content:space-between;gap:",yl(3),";pointer-events:none;"),LV=cl("div",{target:"e1kdzosf7"})("flex:1;display:inline-flex;flex-direction:column;gap:",yl(1),";"),FV=cl("span",{target:"e1kdzosf6"})("flex:0 1 fit-content;min-width:0;width:fit-content;display:flex;align-items:center;justify-content:center;gap:",yl(3),";color:",CV,";[data-active-item]:not( [data-focus-visible] ) *:not(",IV,") &,[aria-disabled='true'] *:not(",IV,") &{color:inherit;}"),BV=cl(cV,{target:"e1kdzosf5"})({name:"49aokf",styles:"display:contents"}),VV=cl(dV,{target:"e1kdzosf4"})("grid-column:1/-1;padding-block-start:",yl(3),";padding-block-end:",yl(2),";padding-inline:",wV,";"),$V=cl(hV,{target:"e1kdzosf3"})("grid-column:1/-1;border:none;height:",Pl.borderWidth,";background-color:",(e=>"toolbar"===e.variant?jV:SV),";margin-block:",yl(2),";margin-inline:",wV,";outline:2px solid transparent;"),HV=cl(Fx,{target:"e1kdzosf2"})("width:",yl(1.5),";",Sg({transform:"scaleX(1)"},{transform:"scaleX(-1)"}),";"),WV=cl(ck,{target:"e1kdzosf1"})("font-size:",wx("default.fontSize"),";line-height:20px;color:inherit;"),UV=cl(ck,{target:"e1kdzosf0"})("font-size:",wx("helpText.fontSize"),";line-height:16px;color:",CV,";word-break:break-all;[data-active-item]:not( [data-focus-visible] ) *:not( ",IV," ) &,[aria-disabled='true'] *:not( ",IV," ) &{color:inherit;}"),GV=(0,c.createContext)(void 0);function KV({onBlur:e}){const[t,n]=(0,c.useState)(!1);return{"data-focus-visible":t||void 0,onFocusVisible:()=>{(0,c.flushSync)((()=>n(!0)))},onBlur:t=>{e?.(t),n(!1)}}}const qV=(0,c.forwardRef)((function({prefix:e,suffix:t,children:n,onBlur:r,hideOnClick:o=!0,...i},s){const a=KV({onBlur:r}),l=(0,c.useContext)(GV);return(0,wt.jsxs)(MV,{ref:s,...i,...a,accessibleWhenDisabled:!0,hideOnClick:o,store:l?.store,children:[(0,wt.jsx)(OV,{children:e}),(0,wt.jsxs)(zV,{children:[(0,wt.jsx)(LV,{children:n}),t&&(0,wt.jsx)(FV,{children:t})]})]})}));var YV=kt((function(e){var t=e,{store:n,checked:r}=t,o=x(t,["store","checked"]);const i=(0,B.useContext)(MB);return r=null!=r?r:i,o=lI(b(v({},o),{checked:r}))})),XV=_t((function(e){return Ct("span",YV(e))}));const ZV=(0,c.forwardRef)((function({suffix:e,children:t,onBlur:n,hideOnClick:r=!1,...o},i){const s=KV({onBlur:n}),a=(0,c.useContext)(GV);return(0,wt.jsxs)(AV,{ref:i,...o,...s,accessibleWhenDisabled:!0,hideOnClick:r,store:a?.store,children:[(0,wt.jsx)(XV,{store:a?.store,render:(0,wt.jsx)(OV,{}),style:{width:"auto",height:"auto"},children:(0,wt.jsx)(J_,{icon:tk,size:24})}),(0,wt.jsxs)(zV,{children:[(0,wt.jsx)(LV,{children:t}),e&&(0,wt.jsx)(FV,{children:e})]})]})})),QV=(0,wt.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,wt.jsx)(n.Circle,{cx:12,cy:12,r:3})}),JV=(0,c.forwardRef)((function({suffix:e,children:t,onBlur:n,hideOnClick:r=!1,...o},i){const s=KV({onBlur:n}),a=(0,c.useContext)(GV);return(0,wt.jsxs)(DV,{ref:i,...o,...s,accessibleWhenDisabled:!0,hideOnClick:r,store:a?.store,children:[(0,wt.jsx)(XV,{store:a?.store,render:(0,wt.jsx)(OV,{}),style:{width:"auto",height:"auto"},children:(0,wt.jsx)(J_,{icon:QV,size:24})}),(0,wt.jsxs)(zV,{children:[(0,wt.jsx)(LV,{children:t}),e&&(0,wt.jsx)(FV,{children:e})]})]})})),e$=(0,c.forwardRef)((function(e,t){const n=(0,c.useContext)(GV);return(0,wt.jsx)(BV,{ref:t,...e,store:n?.store})})),t$=(0,c.forwardRef)((function(e,t){const n=(0,c.useContext)(GV);return(0,wt.jsx)(VV,{ref:t,render:(0,wt.jsx)(Nv,{upperCase:!0,variant:"muted",size:"11px",weight:500,lineHeight:"16px"}),...e,store:n?.store})})),n$=(0,c.forwardRef)((function(e,t){const n=(0,c.useContext)(GV);return(0,wt.jsx)($V,{ref:t,...e,store:n?.store,variant:n?.variant})})),r$=(0,c.forwardRef)((function(e,t){return(0,wt.jsx)(WV,{numberOfLines:1,ref:t,...e})})),o$=(0,c.forwardRef)((function(e,t){return(0,wt.jsx)(UV,{numberOfLines:2,ref:t,...e})})),i$=Object.assign(Xa(((e,t)=>{var n;const{open:r,defaultOpen:o=!1,onOpenChange:i,placement:s,trigger:l,gutter:u,children:d,shift:p,modal:f=!0,variant:h,...m}=Ya(e,"DropdownMenu"),g=(0,c.useContext)(GV),v=(0,a.isRTL)()?"rtl":"ltr";let b=null!==(n=e.placement)&&void 0!==n?n:g?.store?"right-start":"bottom-start";"rtl"===v&&(/right/.test(b)?b=b.replace("right","left"):/left/.test(b)&&(b=b.replace("left","right")));const x=LB({parent:g?.store,open:r,defaultOpen:o,placement:b,focusLoop:!0,setOpen(e){i?.(e)},rtl:"rtl"===v}),y=(0,c.useMemo)((()=>({store:x,variant:h})),[x,h]),w=Qe(x,"currentPlacement").split("-")[0];!x.parent||(0,c.isValidElement)(l)&&qV===l.type||console.warn("For nested DropdownMenus, the `trigger` should always be a `DropdownMenuItem`.");const _=(0,c.useCallback)((e=>(e.preventDefault(),!0)),[]),S=(0,c.useMemo)((()=>({dir:v,style:{direction:v}})),[v]);return(0,wt.jsxs)(wt.Fragment,{children:[(0,wt.jsx)(VB,{ref:t,store:x,render:x.parent?(0,c.cloneElement)(l,{suffix:(0,wt.jsxs)(wt.Fragment,{children:[l.props.suffix,(0,wt.jsx)(HV,{"aria-hidden":"true",icon:UB,size:24,preserveAspectRatio:"xMidYMid slice"})]})}):l}),(0,wt.jsx)(WB,{...m,modal:f,store:x,gutter:null!=u?u:x.parent?0:8,shift:null!=p?p:x.parent?-4:0,hideOnHoverOutside:!1,"data-side":w,wrapperProps:S,hideOnEscape:_,unmountOnHide:!0,render:e=>(0,wt.jsx)(RV,{variant:h,children:(0,wt.jsx)(IV,{...e})}),children:(0,wt.jsx)(GV.Provider,{value:y,children:d})})]})}),"DropdownMenu"),{Context:Object.assign(GV,{displayName:"DropdownMenuV2.Context"}),Item:Object.assign(qV,{displayName:"DropdownMenuV2.Item"}),RadioItem:Object.assign(JV,{displayName:"DropdownMenuV2.RadioItem"}),CheckboxItem:Object.assign(ZV,{displayName:"DropdownMenuV2.CheckboxItem"}),Group:Object.assign(e$,{displayName:"DropdownMenuV2.Group"}),GroupLabel:Object.assign(t$,{displayName:"DropdownMenuV2.GroupLabel"}),Separator:Object.assign(n$,{displayName:"DropdownMenuV2.Separator"}),ItemLabel:Object.assign(r$,{displayName:"DropdownMenuV2.ItemLabel"}),ItemHelpText:Object.assign(o$,{displayName:"DropdownMenuV2.ItemHelpText"})});const s$=cl("div",{target:"e1krjpvb0"})({name:"1a3idx0",styles:"color:var( --wp-components-color-foreground, currentColor )"});function a$(e){!function(e){for(const[t,n]of Object.entries(e))void 0!==n&&uv(n).isValid()}(e);const t={...l$(e.accent),...c$(e.background)};return function(e){for(const t of Object.values(e));}(function(e,t){const n=e.background||kl.white,r=e.accent||"#3858e9",o=t.foreground||kl.gray[900],i=t.gray||kl.gray;return{accent:uv(n).isReadable(r)?void 0:`The background color ("${n}") does not have sufficient contrast against the accent color ("${r}").`,foreground:uv(n).isReadable(o)?void 0:`The background color provided ("${n}") does not have sufficient contrast against the standard foreground colors.`,grays:uv(n).contrast(i[600])>=3&&uv(n).contrast(i[700])>=4.5?void 0:`The background color provided ("${n}") cannot generate a set of grayscale foreground colors with sufficient contrast. Try adjusting the color to be lighter or darker.`}}(e,t)),{colors:t}}function l$(e){return e?{accent:e,accentDarker10:uv(e).darken(.1).toHex(),accentDarker20:uv(e).darken(.2).toHex(),accentInverted:u$(e)}:{}}function c$(e){if(!e)return{};const t=u$(e);return{background:e,foreground:t,foregroundInverted:u$(t),gray:d$(e,t)}}function u$(e){return uv(e).isDark()?kl.white:kl.gray[900]}function d$(e,t){const n=uv(e).isDark()?"lighten":"darken",r=Math.abs(uv(e).toHsl().l-uv(t).toHsl().l)/100,o={};return Object.entries({100:.06,200:.121,300:.132,400:.2,600:.42,700:.543,800:.821}).forEach((([t,i])=>{o[parseInt(t)]=uv(e)[n](i/.884*r).toHex()})),o}pv([fv,z_]);const p$=function({accent:e,background:t,className:n,...r}){const o=qa(),i=(0,c.useMemo)((()=>o(...(({colors:e})=>{const t=Object.entries(e.gray||{}).map((([e,t])=>`--wp-components-color-gray-${e}: ${t};`)).join("");return[bl("--wp-components-color-accent:",e.accent,";--wp-components-color-accent-darker-10:",e.accentDarker10,";--wp-components-color-accent-darker-20:",e.accentDarker20,";--wp-components-color-accent-inverted:",e.accentInverted,";--wp-components-color-background:",e.background,";--wp-components-color-foreground:",e.foreground,";--wp-components-color-foreground-inverted:",e.foregroundInverted,";",t,";","")]})(a$({accent:e,background:t})),n)),[e,t,n,o]);return(0,wt.jsx)(s$,{className:i,...r})},f$=(0,c.createContext)(void 0),h$=()=>(0,c.useContext)(f$),m$=cl("div",{target:"enfox0g2"})("position:relative;display:flex;align-items:stretch;flex-direction:row;text-align:center;&[aria-orientation='vertical']{flex-direction:column;text-align:start;}@media not ( prefers-reduced-motion ){&.is-animation-enabled::after{transition-property:transform;transition-duration:0.2s;transition-timing-function:ease-out;}}--direction-factor:1;--direction-origin-x:left;--indicator-start:var( --indicator-left );&:dir( rtl ){--direction-factor:-1;--direction-origin-x:right;--indicator-start:var( --indicator-right );}&::after{content:'';position:absolute;pointer-events:none;transform-origin:var( --direction-origin-x ) top;outline:2px solid transparent;outline-offset:-1px;}--antialiasing-factor:100;&:not( [aria-orientation='vertical'] ){&::after{bottom:0;height:0;width:calc( var( --antialiasing-factor ) * 1px );transform:translateX(\n\t\t\t\t\tcalc(\n\t\t\t\t\t\tvar( --indicator-start ) * var( --direction-factor ) *\n\t\t\t\t\t\t\t1px\n\t\t\t\t\t)\n\t\t\t\t) scaleX(\n\t\t\t\t\tcalc(\n\t\t\t\t\t\tvar( --indicator-width ) / var( --antialiasing-factor )\n\t\t\t\t\t)\n\t\t\t\t);border-bottom:var( --wp-admin-border-width-focus ) solid ",kl.theme.accent,";}}&[aria-orientation='vertical']::after{z-index:-1;top:0;left:0;width:100%;height:calc( var( --antialiasing-factor ) * 1px );transform:translateY( calc( var( --indicator-top ) * 1px ) ) scaleY(\n\t\t\t\tcalc( var( --indicator-height ) / var( --antialiasing-factor ) )\n\t\t\t);background-color:",kl.theme.gray[100],";}"),g$=cl(BL,{target:"enfox0g1"})("&{display:inline-flex;align-items:center;position:relative;border-radius:0;min-height:",yl(12),";height:auto;background:transparent;border:none;box-shadow:none;cursor:pointer;line-height:1.2;padding:",yl(3)," ",yl(4),";margin-left:0;font-weight:500;text-align:inherit;hyphens:auto;color:",kl.theme.foreground,";&[aria-disabled='true']{cursor:default;color:",kl.ui.textDisabled,";}&:not( [aria-disabled='true'] ):hover{color:",kl.theme.accent,";}&:focus:not( :disabled ){position:relative;box-shadow:none;outline:none;}&::before{content:'';position:absolute;top:",yl(3),";right:",yl(3),";bottom:",yl(3),";left:",yl(3),";pointer-events:none;outline:var( --wp-admin-border-width-focus ) solid ",kl.theme.accent,";border-radius:",Pl.radiusSmall,";opacity:0;@media not ( prefers-reduced-motion ){transition:opacity 0.1s linear;}}&:focus-visible::before{opacity:1;}}[aria-orientation='vertical'] &{min-height:",yl(10),";}"),v$=cl($L,{target:"enfox0g0"})("&:focus{box-shadow:none;outline:none;}&:focus-visible{box-shadow:0 0 0 var( --wp-admin-border-width-focus ) ",kl.theme.accent,";outline:2px solid transparent;outline-offset:0;}"),b$=(0,c.forwardRef)((function({children:e,tabId:t,disabled:n,render:r,...o},i){const s=h$();if(!s)return null;const{store:a,instanceId:l}=s,c=`${l}-${t}`;return(0,wt.jsx)(g$,{ref:i,store:a,id:c,disabled:n,render:r,...o,children:e})}));function x$(e){const t=(0,c.useRef)((()=>{throw new Error("Cannot call an event handler while rendering.")}));return(0,c.useInsertionEffect)((()=>{t.current=e})),(0,c.useCallback)(((...e)=>t.current?.(...e)),[])}const y$={top:0,right:0,bottom:0,left:0,width:0,height:0};function w$(e){const[t,n]=(0,c.useState)(y$),r=(0,c.useRef)(),o=x$((()=>{if(e){const t=function(e){var t;const n=e.getBoundingClientRect();if(0===n.width||0===n.height)return;const r=null!==(t=e.offsetParent?.getBoundingClientRect())&&void 0!==t?t:y$,o=parseFloat(getComputedStyle(e).width),i=parseFloat(getComputedStyle(e).height),s=o/n.width,a=i/n.height;return{top:(n.top-r?.top)*a,right:(r?.right-n.right)*s,bottom:(r?.bottom-n.bottom)*a,left:(n.left-r?.left)*s,width:o,height:i}}(e);if(t)return n(t),clearInterval(r.current),!0}else clearInterval(r.current);return!1})),i=(0,l.useResizeObserver)((()=>{o()||requestAnimationFrame((()=>{o()||(r.current=setInterval(o,100))}))}));return(0,c.useLayoutEffect)((()=>i(e)),[i,e]),t}const _$=(0,c.forwardRef)((function({children:e,...t},n){const r=h$(),o=Qe(r?.store),i=o?.selectedId,a=w$(r?.store.item(i)?.element),[l,u]=(0,c.useState)(!1);if(function(e,t){const n=(0,c.useRef)(e),r=x$(t);(0,c.useEffect)((()=>{n.current!==e&&(r({previousValue:n.current}),n.current=e)}),[r,e])}(i,(({previousValue:e})=>e&&u(!0))),!r||!o)return null;const{store:d}=r,{activeId:p,selectOnMove:f}=o,{setActiveId:h}=d;return(0,wt.jsx)(LL,{ref:n,store:d,render:(0,wt.jsx)(m$,{onTransitionEnd:e=>{"::after"===e.pseudoElement&&u(!1)}}),onBlur:()=>{f&&i!==p&&h(i)},...t,style:{"--indicator-top":a.top,"--indicator-right":a.right,"--indicator-left":a.left,"--indicator-width":a.width,"--indicator-height":a.height,...t.style},className:s(l?"is-animation-enabled":"",t.className),children:e})})),S$=(0,c.forwardRef)((function({children:e,tabId:t,focusable:n=!0,...r},o){const i=h$(),s=Qe(i?.store,"selectedId");if(!i)return null;const{store:a,instanceId:l}=i,c=`${l}-${t}`;return(0,wt.jsx)(v$,{ref:o,store:a,id:`${c}-view`,tabId:c,focusable:n,...r,children:s===c&&e})}));function C$({selectOnMove:e=!0,defaultTabId:t,orientation:n="horizontal",onSelect:r,children:o,selectedTabId:i}){const s=(0,l.useInstanceId)(C$,"tabs"),a=NL({selectOnMove:e,orientation:n,defaultSelectedId:t&&`${s}-${t}`,setSelectedId:e=>{const t="string"==typeof e?e.replace(`${s}-`,""):e;r?.(t)},selectedId:i&&`${s}-${i}`}),u=void 0!==i,{items:d,selectedId:p,activeId:f}=Qe(a),{setSelectedId:h,setActiveId:m}=a,g=(0,c.useRef)(!1);d.length>0&&(g.current=!0);const v=d.find((e=>e.id===p)),b=d.find((e=>!e.dimmed)),x=d.find((e=>e.id===`${s}-${t}`));(0,c.useLayoutEffect)((()=>{if(!u&&(!t||x)&&!d.find((e=>e.id===p))){if(x&&!x.dimmed)return void h(x?.id);b?h(b.id):g.current&&h(null)}}),[b,x,t,u,d,p,h]),(0,c.useLayoutEffect)((()=>{v?.dimmed&&(u?h(null):!x||x.dimmed?b&&h(b.id):h(x.id))}),[b,x,u,v?.dimmed,h]),(0,c.useLayoutEffect)((()=>{u&&g.current&&i&&!v&&h(null)}),[u,v,i,h]),(0,c.useEffect)((()=>{null===i&&!f&&b?.id&&m(b.id)}),[i,f,b?.id,m]),(0,c.useEffect)((()=>{u&&requestAnimationFrame((()=>{const e=d?.[0]?.element?.ownerDocument.activeElement;e&&d.some((t=>e===t.element))&&f!==e.id&&m(e.id)}))}),[f,u,d,m]);const y=(0,c.useMemo)((()=>({store:a,instanceId:s})),[a,s]);return(0,wt.jsx)(f$.Provider,{value:y,children:o})}C$.TabList=_$,C$.Tab=b$,C$.TabPanel=S$,C$.Context=f$;const k$=C$,j$=window.wp.privateApis,{lock:E$,unlock:P$}=(0,j$.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/components"),T$={};E$(T$,{__experimentalPopoverLegacyPositionToPlacement:$i,createPrivateSlotFill:e=>{const t=Symbol(e);return{privateKey:t,...dw(t)}},ComponentsContext:rs,Tabs:k$,Theme:p$,DropdownMenuV2:i$,kebabCase:xy})})(),(window.wp=window.wp||{}).components=i})(); \ No newline at end of file + `,LL=yl("svg",{target:"ea4tfvq2"})("width:",Fl.spinnerSize,"px;height:",Fl.spinnerSize,"px;display:inline-block;margin:5px 11px 0;position:relative;color:",zl.theme.accent,";overflow:visible;opacity:1;background-color:transparent;"),FL={name:"9s4963",styles:"fill:transparent;stroke-width:1.5px"},BL=yl("circle",{target:"ea4tfvq1"})(FL,";stroke:",zl.gray[300],";"),VL=yl("path",{target:"ea4tfvq0"})(FL,";stroke:currentColor;stroke-linecap:round;transform-origin:50% 50%;animation:1.4s linear infinite both ",OL,";");const $L=(0,c.forwardRef)((function({className:e,...t},n){return(0,_t.jsxs)(LL,{className:s("components-spinner",e),viewBox:"0 0 100 100",width:"16",height:"16",xmlns:"http://www.w3.org/2000/svg",role:"presentation",focusable:"false",...t,ref:n,children:[(0,_t.jsx)(BL,{cx:"50",cy:"50",r:"50",vectorEffect:"non-scaling-stroke"}),(0,_t.jsx)(VL,{d:"m 50 0 a 50 50 0 0 1 50 50",vectorEffect:"non-scaling-stroke"})]})}));const HL=al((function(e,t){const n=BE(e);return(0,_t.jsx)(_l,{...n,ref:t})}),"Surface");function WL(e={}){var t=e,{composite:n,combobox:r}=t,o=N(t,["composite","combobox"]);const i=["items","renderedItems","moves","orientation","virtualFocus","includesBaseElement","baseElement","focusLoop","focusShift","focusWrap"],s=Xe(o.store,Ye(n,i),Ye(r,i)),a=null==s?void 0:s.getState(),l=ht(P(E({},o),{store:s,includesBaseElement:F(o.includesBaseElement,null==a?void 0:a.includesBaseElement,!1),orientation:F(o.orientation,null==a?void 0:a.orientation,"horizontal"),focusLoop:F(o.focusLoop,null==a?void 0:a.focusLoop,!0)})),c=it(),u=He(P(E({},l.getState()),{selectedId:F(o.selectedId,null==a?void 0:a.selectedId,o.defaultSelectedId),selectOnMove:F(o.selectOnMove,null==a?void 0:a.selectOnMove,!0)}),l,s);We(u,(()=>Ke(u,["moves"],(()=>{const{activeId:e,selectOnMove:t}=u.getState();if(!t)return;if(!e)return;const n=l.item(e);n&&(n.dimmed||n.disabled||u.setState("selectedId",n.id))}))));let d=!0;We(u,(()=>qe(u,["selectedId"],((e,t)=>{d?n&&e.selectedId===t.selectedId||u.setState("activeId",e.selectedId):d=!0})))),We(u,(()=>Ke(u,["selectedId","renderedItems"],(e=>{if(void 0!==e.selectedId)return;const{activeId:t,renderedItems:n}=u.getState(),r=l.item(t);if(!r||r.disabled||r.dimmed){const e=n.find((e=>!e.disabled&&!e.dimmed));u.setState("selectedId",null==e?void 0:e.id)}else u.setState("selectedId",r.id)})))),We(u,(()=>Ke(u,["renderedItems"],(e=>{const t=e.renderedItems;if(t.length)return Ke(c,["renderedItems"],(e=>{const n=e.renderedItems,r=n.some((e=>!e.tabId));r&&n.forEach(((e,n)=>{if(e.tabId)return;const r=t[n];r&&c.renderItem(P(E({},e),{tabId:r.id}))}))}))}))));let p=null;return We(u,(()=>{const e=()=>{p=u.getState().selectedId},t=()=>{d=!1,u.setState("selectedId",p)};return n&&"setSelectElement"in n?M(Ke(n,["value"],e),Ke(n,["mounted"],t)):r?M(Ke(r,["selectedValue"],e),Ke(r,["mounted"],t)):void 0})),P(E(E({},l),u),{panels:c,setSelectedId:e=>u.setState("selectedId",e),select:e=>{u.setState("selectedId",e),l.move(e)}})}function UL(e={}){const t=_T(),n=ET()||t;e=b(v({},e),{composite:void 0!==e.composite?e.composite:n,combobox:void 0!==e.combobox?e.combobox:t});const[r,o]=rt(WL,e);return function(e,t,n){Te(t,[n.composite,n.combobox]),nt(e=gt(e,t,n),n,"selectedId","setSelectedId"),nt(e,n,"selectOnMove");const[r,o]=rt((()=>e.panels),{});return Te(o,[e,o]),Object.assign((0,B.useMemo)((()=>b(v({},e),{panels:r})),[e,r]),{composite:n.composite,combobox:n.combobox})}(r,o,e)}var GL=Et([Mt],[At]),KL=(GL.useContext,GL.useScopedContext),qL=GL.useProviderContext,YL=(GL.ContextProvider,GL.ScopedContextProvider),XL=jt((function(e){var t=e,{store:n}=t,r=x(t,["store"]);const o=qL();D(n=n||o,!1);const i=n.useState((e=>"both"===e.orientation?void 0:e.orientation));return r=Me(r,(e=>(0,_t.jsx)(YL,{value:n,children:e})),[n]),n.composite&&(r=v({focusable:!1},r)),r=v({role:"tablist","aria-orientation":i},r),r=cn(v({store:n},r))})),ZL=St((function(e){return kt("div",XL(e))})),QL=jt((function(e){var t,n=e,{store:r,getItem:o}=n,i=x(n,["store","getItem"]);const s=KL();D(r=r||s,!1);const a=Pe(),l=i.id||a,c=O(i),u=(0,B.useCallback)((e=>{const t=b(v({},e),{dimmed:c});return o?o(t):t}),[c,o]),d=i.onClick,p=ke((e=>{null==d||d(e),e.defaultPrevented||null==r||r.setSelectedId(l)})),f=r.panels.useState((e=>{var t;return null==(t=e.items.find((e=>e.tabId===l)))?void 0:t.id})),h=!!a&&i.shouldRegisterItem,m=r.useState((e=>!!l&&e.activeId===l)),g=r.useState((e=>!!l&&e.selectedId===l)),y=r.useState((e=>!!r.item(e.activeId))),w=m||g&&!y,_=g||null==(t=i.accessibleWhenDisabled)||t;if(et(r.combobox||r.composite,"virtualFocus")&&(i=b(v({},i),{tabIndex:-1})),i=b(v({id:l,role:"tab","aria-selected":g,"aria-controls":f||void 0},i),{onClick:p}),r.composite){const e={id:l,accessibleWhenDisabled:_,store:r.composite,shouldRegisterItem:w&&h,rowId:i.rowId,render:i.render};i=b(v({},i),{render:(0,_t.jsx)(An,b(v({},e),{render:r.combobox&&r.composite!==r.combobox?(0,_t.jsx)(An,b(v({},e),{store:r.combobox})):e.render}))})}return i=Mn(b(v({store:r},i),{accessibleWhenDisabled:_,getItem:u,shouldRegisterItem:h}))})),JL=Ct(St((function(e){return kt("button",QL(e))}))),eF=jt((function(e){var t=e,{store:n,unmountOnHide:r,tabId:o,getItem:i,scrollRestoration:s,scrollElement:a}=t,l=x(t,["store","unmountOnHide","tabId","getItem","scrollRestoration","scrollElement"]);const c=qL();D(n=n||c,!1);const u=(0,B.useRef)(null),d=Pe(l.id),p=et(n.panels,(()=>{var e;return o||(null==(e=null==n?void 0:n.panels.item(d))?void 0:e.tabId)})),f=Yn({open:et(n,(e=>!!p&&e.selectedId===p))}),h=et(f,"mounted"),m=(0,B.useRef)(new Map),g=ke((()=>{const e=u.current;return e?a?"function"==typeof a?a(e):"current"in a?a.current:a:e:null}));(0,B.useEffect)((()=>{var e,t;if(!s)return;if(!h)return;const n=g();if(!n)return;if("reset"===s)return void n.scroll(0,0);if(!p)return;const r=m.current.get(p);n.scroll(null!=(e=null==r?void 0:r.x)?e:0,null!=(t=null==r?void 0:r.y)?t:0);const o=()=>{m.current.set(p,{x:n.scrollLeft,y:n.scrollTop})};return n.addEventListener("scroll",o),()=>{n.removeEventListener("scroll",o)}}),[s,h,p,g,n]);const[y,w]=(0,B.useState)(!1);(0,B.useEffect)((()=>{const e=u.current;if(!e)return;const t=$t(e);w(!!t.length)}),[]);const _=(0,B.useCallback)((e=>{const t=b(v({},e),{id:d||e.id,tabId:o});return i?i(t):t}),[d,o,i]),S=l.onKeyDown,C=ke((e=>{if(null==S||S(e),e.defaultPrevented)return;if(!(null==n?void 0:n.composite))return;const t={ArrowLeft:n.previous,ArrowRight:n.next,Home:n.first,End:n.last}[e.key];if(!t)return;const{selectedId:r}=n.getState(),o=t({activeId:r});o&&(e.preventDefault(),n.move(o))}));return l=Me(l,(e=>(0,_t.jsx)(YL,{value:n,children:e})),[n]),l=b(v({id:d,role:"tabpanel","aria-labelledby":p||void 0},l),{children:r&&!h?null:l.children,ref:Ee(u,l.ref),onKeyDown:C}),l=an(v({focusable:!n.composite&&!y},l)),l=Zr(v({store:f},l)),l=En(b(v({store:n.panels},l),{getItem:_}))})),tF=St((function(e){return kt("div",eF(e))}));const nF=e=>{if(null!=e)return e.match(/^tab-panel-[0-9]*-(.*)/)?.[1]},rF=(0,c.forwardRef)((({className:e,children:t,tabs:n,selectOnMove:r=!0,initialTabName:o,orientation:i="horizontal",activeClass:u="is-active",onSelect:d},p)=>{const f=(0,l.useInstanceId)(rF,"tab-panel"),h=(0,c.useCallback)((e=>{if(void 0!==e)return`${f}-${e}`}),[f]),m=UL({setSelectedId:e=>{if(null==e)return;const t=n.find((t=>h(t.name)===e));if(t?.disabled||t===b)return;const r=nF(e);void 0!==r&&d?.(r)},orientation:i,selectOnMove:r,defaultSelectedId:h(o),rtl:(0,a.isRTL)()}),g=nF(et(m,"selectedId")),v=(0,c.useCallback)((e=>{m.setState("selectedId",h(e))}),[h,m]),b=n.find((({name:e})=>e===g)),x=(0,l.usePrevious)(g);return(0,c.useEffect)((()=>{x!==g&&g===o&&g&&d?.(g)}),[g,o,d,x]),(0,c.useLayoutEffect)((()=>{if(b)return;const e=n.find((e=>e.name===o));if(!o||e)if(e&&!e.disabled)v(e.name);else{const e=n.find((e=>!e.disabled));e&&v(e.name)}}),[n,b,o,f,v]),(0,c.useEffect)((()=>{if(!b?.disabled)return;const e=n.find((e=>!e.disabled));e&&v(e.name)}),[n,b?.disabled,v,f]),(0,_t.jsxs)("div",{className:e,ref:p,children:[(0,_t.jsx)(ZL,{store:m,className:"components-tab-panel__tabs",children:n.map((e=>(0,_t.jsx)(JL,{id:h(e.name),className:s("components-tab-panel__tabs-item",e.className,{[u]:e.name===g}),disabled:e.disabled,"aria-controls":`${h(e.name)}-view`,render:(0,_t.jsx)(Jx,{__next40pxDefaultSize:!0,icon:e.icon,label:e.icon&&e.title,showTooltip:!!e.icon}),children:!e.icon&&e.title},e.name)))}),b&&(0,_t.jsx)(tF,{id:`${h(b.name)}-view`,store:m,tabId:h(b.name),className:"components-tab-panel__tab-content",children:t(b)})]})})),oF=rF;const iF=(0,c.forwardRef)((function(e,t){const{__nextHasNoMarginBottom:n,__next40pxDefaultSize:r=!1,label:o,hideLabelFromVision:i,value:a,help:c,id:u,className:d,onChange:p,type:f="text",...h}=e,m=(0,l.useInstanceId)(iF,"inspector-text-control",u);return Ux({componentName:"TextControl",size:void 0,__next40pxDefaultSize:r}),(0,_t.jsx)(Wx,{__nextHasNoMarginBottom:n,__associatedWPComponentName:"TextControl",label:o,hideLabelFromVision:i,id:m,help:c,className:d,children:(0,_t.jsx)("input",{className:s("components-text-control__input",{"is-next-40px-default-size":r}),type:f,id:m,value:a,onChange:e=>p(e.target.value),"aria-describedby":c?m+"__help":void 0,ref:t,...h})})})),sF=iF,aF={huge:"1440px",wide:"1280px","x-large":"1080px",large:"960px",medium:"782px",small:"600px",mobile:"480px","zoomed-in":"280px"},lF=Nl("box-shadow:0 0 0 transparent;border-radius:",Fl.radiusSmall,";border:",Fl.borderWidth," solid ",zl.ui.border,";@media not ( prefers-reduced-motion ){transition:box-shadow 0.1s linear;}",""),cF=Nl("border-color:",zl.theme.accent,";box-shadow:0 0 0 calc( ",Fl.borderWidthFocus," - ",Fl.borderWidth," ) ",zl.theme.accent,";outline:2px solid transparent;",""),uF=yl("textarea",{target:"e1w5nnrk0"})("width:100%;display:block;font-family:",Ix("default.fontFamily"),";line-height:20px;padding:9px 11px;",lF,";font-size:",Ix("mobileTextMinFontSize"),";",`@media (min-width: ${aF["small"]})`,"{font-size:",Ix("default.fontSize"),";}&:focus{",cF,";}&::-webkit-input-placeholder{color:",zl.ui.darkGrayPlaceholder,";}&::-moz-placeholder{opacity:1;color:",zl.ui.darkGrayPlaceholder,";}&:-ms-input-placeholder{color:",zl.ui.darkGrayPlaceholder,";}.is-dark-theme &{&::-webkit-input-placeholder{color:",zl.ui.lightGrayPlaceholder,";}&::-moz-placeholder{opacity:1;color:",zl.ui.lightGrayPlaceholder,";}&:-ms-input-placeholder{color:",zl.ui.lightGrayPlaceholder,";}}");const dF=(0,c.forwardRef)((function(e,t){const{__nextHasNoMarginBottom:n,label:r,hideLabelFromVision:o,value:i,help:s,onChange:a,rows:c=4,className:u,...d}=e,p=`inspector-textarea-control-${(0,l.useInstanceId)(dF)}`;return(0,_t.jsx)(Wx,{__nextHasNoMarginBottom:n,__associatedWPComponentName:"TextareaControl",label:r,hideLabelFromVision:o,id:p,help:s,className:u,children:(0,_t.jsx)(uF,{className:"components-textarea-control__input",id:p,rows:c,onChange:e=>a(e.target.value),"aria-describedby":s?p+"__help":void 0,value:i,ref:t,...d})})})),pF=dF,fF=e=>{const{text:t="",highlight:n=""}=e,r=n.trim();if(!r)return(0,_t.jsx)(_t.Fragment,{children:t});const o=new RegExp(`(${Iy(r)})`,"gi");return(0,c.createInterpolateElement)(t.replace(o,"$&"),{mark:(0,_t.jsx)("mark",{})})},hF=(0,_t.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_t.jsx)(n.Path,{d:"M12 15.8c-3.7 0-6.8-3-6.8-6.8s3-6.8 6.8-6.8c3.7 0 6.8 3 6.8 6.8s-3.1 6.8-6.8 6.8zm0-12C9.1 3.8 6.8 6.1 6.8 9s2.4 5.2 5.2 5.2c2.9 0 5.2-2.4 5.2-5.2S14.9 3.8 12 3.8zM8 17.5h8V19H8zM10 20.5h4V22h-4z"})});const mF=function(e){const{children:t}=e;return(0,_t.jsxs)("div",{className:"components-tip",children:[(0,_t.jsx)(oS,{icon:hF}),(0,_t.jsx)("p",{children:t})]})};const gF=(0,c.forwardRef)((function({__nextHasNoMarginBottom:e,label:t,checked:n,help:r,className:o,onChange:i,disabled:a},c){const u=`inspector-toggle-control-${(0,l.useInstanceId)(gF)}`,d=il()("components-toggle-control",o,!e&&Nl({marginBottom:Il(3)},"",""));let p,f;return e||Xi()("Bottom margin styles for wp.components.ToggleControl",{since:"6.7",version:"7.0",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version."}),r&&("function"==typeof r?void 0!==n&&(f=r(n)):f=r,f&&(p=u+"__help")),(0,_t.jsx)(Wx,{id:u,help:f&&(0,_t.jsx)("span",{className:"components-toggle-control__help",children:f}),className:d,__nextHasNoMarginBottom:!0,children:(0,_t.jsxs)(fy,{justify:"flex-start",spacing:2,children:[(0,_t.jsx)(eD,{id:u,checked:n,onChange:function(e){i(e.target.checked)},"aria-describedby":p,disabled:a,ref:c}),(0,_t.jsx)(Eg,{as:"label",htmlFor:u,className:s("components-toggle-control__label",{"is-disabled":a}),children:t})]})})})),vF=gF;var bF=Et([Mt],[At]),xF=bF.useContext,yF=(bF.useScopedContext,bF.useProviderContext),wF=(bF.ContextProvider,bF.ScopedContextProvider),_F=jt((function(e){var t=e,{store:n}=t,r=x(t,["store"]);const o=xF();return r=Mn(v({store:n=n||o},r))})),SF=Ct(St((function(e){return kt("button",_F(e))})));const CF=(0,c.createContext)(void 0);const kF=(0,c.forwardRef)((function({children:e,as:t,...n},r){const o=(0,c.useContext)(CF),i="function"==typeof e;if(!i&&!t)return null;const s={...n,ref:r,"data-toolbar-item":!0};if(!o)return t?(0,_t.jsx)(t,{...s,children:e}):i?e(s):null;const a=i?e:t&&(0,_t.jsx)(t,{children:e});return(0,_t.jsx)(SF,{accessibleWhenDisabled:!0,...s,store:o,render:a})})),jF=({children:e,className:t})=>(0,_t.jsx)("div",{className:t,children:e});const EF=(0,c.forwardRef)((function(e,t){const{children:n,className:r,containerClassName:o,extraProps:i,isActive:a,title:l,...u}=function({isDisabled:e,...t}){return{disabled:e,...t}}(e);return(0,c.useContext)(CF)?(0,_t.jsx)(kF,{className:s("components-toolbar-button",r),...i,...u,ref:t,children:e=>(0,_t.jsx)(Jx,{size:"compact",label:l,isPressed:a,...e,children:n})}):(0,_t.jsx)(jF,{className:o,children:(0,_t.jsx)(Jx,{ref:t,icon:u.icon,size:"compact",label:l,shortcut:u.shortcut,"data-subscript":u.subscript,onClick:e=>{e.stopPropagation(),u.onClick&&u.onClick(e)},className:s("components-toolbar__control",r),isPressed:a,accessibleWhenDisabled:!0,"data-toolbar-item":!0,...i,...u,children:n})})})),PF=({className:e,children:t,...n})=>(0,_t.jsx)("div",{className:e,...n,children:t});const NF=function({controls:e=[],toggleProps:t,...n}){const r=t=>(0,_t.jsx)(PN,{controls:e,toggleProps:{...t,"data-toolbar-item":!0},...n});return(0,c.useContext)(CF)?(0,_t.jsx)(kF,{...t,children:r}):r(t)};const TF=function({controls:e=[],children:t,className:n,isCollapsed:r,title:o,...i}){const a=(0,c.useContext)(CF);if(!(e&&e.length||t))return null;const l=s(a?"components-toolbar-group":"components-toolbar",n);let u;var d;return d=e,u=Array.isArray(d)&&Array.isArray(d[0])?e:[e],r?(0,_t.jsx)(NF,{label:o,controls:u,className:l,children:t,...i}):(0,_t.jsxs)(PF,{className:l,...i,children:[u?.flatMap(((e,t)=>e.map(((e,n)=>(0,_t.jsx)(EF,{containerClassName:t>0&&0===n?"has-left-divider":void 0,...e},[t,n].join()))))),t]})};function IF(e={}){var t;const n=null==(t=e.store)?void 0:t.getState();return ht(P(E({},e),{orientation:F(e.orientation,null==n?void 0:n.orientation,"horizontal"),focusLoop:F(e.focusLoop,null==n?void 0:n.focusLoop,!0)}))}function RF(e={}){const[t,n]=rt(IF,e);return function(e,t,n){return gt(e,t,n)}(t,n,e)}var MF=jt((function(e){var t=e,{store:n,orientation:r,virtualFocus:o,focusLoop:i,rtl:s}=t,a=x(t,["store","orientation","virtualFocus","focusLoop","rtl"]);const l=yF(),c=RF({store:n=n||l,orientation:r,virtualFocus:o,focusLoop:i,rtl:s}),u=c.useState((e=>"both"===e.orientation?void 0:e.orientation));return a=Me(a,(e=>(0,_t.jsx)(wF,{value:c,children:e})),[c]),a=v({role:"toolbar","aria-orientation":u},a),a=cn(v({store:c},a))})),AF=St((function(e){return kt("div",MF(e))}));const DF=(0,c.forwardRef)((function({label:e,...t},n){const r=RF({focusLoop:!0,rtl:(0,a.isRTL)()});return(0,_t.jsx)(CF.Provider,{value:r,children:(0,_t.jsx)(AF,{ref:n,"aria-label":e,store:r,...t})})}));const zF=(0,c.forwardRef)((function({className:e,label:t,variant:n,...r},o){const i=void 0!==n,a=(0,c.useMemo)((()=>i?{}:{DropdownMenu:{variant:"toolbar"},Dropdown:{variant:"toolbar"},Menu:{variant:"toolbar"}}),[i]);if(!t){Xi()("Using Toolbar without label prop",{since:"5.6",alternative:"ToolbarGroup component",link:"https://developer.wordpress.org/block-editor/components/toolbar/"});const{title:t,...n}=r;return(0,_t.jsx)(TF,{isCollapsed:!1,...n,className:e})}const l=s("components-accessible-toolbar",e,n&&`is-${n}`);return(0,_t.jsx)(gs,{value:a,children:(0,_t.jsx)(DF,{className:l,label:t,ref:o,...r})})}));const OF=(0,c.forwardRef)((function(e,t){return(0,c.useContext)(CF)?(0,_t.jsx)(kF,{ref:t,...e.toggleProps,children:t=>(0,_t.jsx)(PN,{...e,popoverProps:{...e.popoverProps},toggleProps:t})}):(0,_t.jsx)(PN,{...e})}));const LF={columns:e=>Nl("grid-template-columns:",`repeat( ${e}, minmax(0, 1fr) )`,";",""),spacing:Nl("column-gap:",Il(4),";row-gap:",Il(4),";",""),item:{fullWidth:{name:"18iuzk9",styles:"grid-column:1/-1"}}},FF={name:"huufmu",styles:">div:not( :first-of-type ){display:none;}"},BF=Nl(LF.item.fullWidth," gap:",Il(2),";.components-dropdown-menu{margin:",Il(-1)," 0;line-height:0;}&&&& .components-dropdown-menu__toggle{padding:0;min-width:",Il(6),";}",""),VF={name:"1pmxm02",styles:"font-size:inherit;font-weight:500;line-height:normal;&&{margin:0;}"},$F=Nl(LF.item.fullWidth,"&>div,&>fieldset{padding-bottom:0;margin-bottom:0;max-width:100%;}&& ",Mx,"{margin-bottom:0;",Dx,":last-child{margin-bottom:0;}}",Bx,"{margin-bottom:0;}&& ",lb,"{label{line-height:1.4em;}}",""),HF={name:"eivff4",styles:"display:none"},WF={name:"16gsvie",styles:"min-width:200px"},UF=yl("span",{target:"ews648u0"})("color:",zl.theme.accentDarker10,";font-size:11px;font-weight:500;line-height:1.4;",Mg({marginLeft:Il(3)})," text-transform:uppercase;"),GF=Nl("color:",zl.gray[900],";&&[aria-disabled='true']{color:",zl.gray[700],";opacity:1;&:hover{color:",zl.gray[700],";}",UF,"{opacity:0.3;}}",""),KF=()=>{},qF=(0,c.createContext)({menuItems:{default:{},optional:{}},hasMenuItems:!1,isResetting:!1,shouldRenderPlaceholderItems:!1,registerPanelItem:KF,deregisterPanelItem:KF,flagItemCustomization:KF,registerResetAllFilter:KF,deregisterResetAllFilter:KF,areAllOptionalControlsHidden:!0}),YF=()=>(0,c.useContext)(qF);const XF=({itemClassName:e,items:t,toggleItem:n})=>{if(!t.length)return null;const r=(0,_t.jsx)(UF,{"aria-hidden":!0,children:(0,a.__)("Reset")});return(0,_t.jsx)(_t.Fragment,{children:t.map((([t,o])=>o?(0,_t.jsx)(gD,{className:e,role:"menuitem",label:(0,a.sprintf)((0,a.__)("Reset %s"),t),onClick:()=>{n(t),(0,jy.speak)((0,a.sprintf)((0,a.__)("%s reset to default"),t),"assertive")},suffix:r,children:t},t):(0,_t.jsx)(gD,{icon:ok,className:e,role:"menuitemcheckbox",isSelected:!0,"aria-disabled":!0,children:t},t)))})},ZF=({items:e,toggleItem:t})=>e.length?(0,_t.jsx)(_t.Fragment,{children:e.map((([e,n])=>{const r=n?(0,a.sprintf)((0,a.__)("Hide and reset %s"),e):(0,a.sprintf)((0,a._x)("Show %s","input control"),e);return(0,_t.jsx)(gD,{icon:n?ok:null,isSelected:n,label:r,onClick:()=>{n?(0,jy.speak)((0,a.sprintf)((0,a.__)("%s hidden and reset to default"),e),"assertive"):(0,jy.speak)((0,a.sprintf)((0,a.__)("%s is now visible"),e),"assertive"),t(e)},role:"menuitemcheckbox",children:e},e)}))}):null,QF=al(((e,t)=>{const{areAllOptionalControlsHidden:n,defaultControlsItemClassName:r,dropdownMenuClassName:o,hasMenuItems:i,headingClassName:s,headingLevel:l=2,label:u,menuItems:d,resetAll:p,toggleItem:f,dropdownMenuProps:h,...m}=function(e){const{className:t,headingLevel:n=2,...r}=sl(e,"ToolsPanelHeader"),o=il(),i=(0,c.useMemo)((()=>o(BF,t)),[t,o]),s=(0,c.useMemo)((()=>o(WF)),[o]),a=(0,c.useMemo)((()=>o(VF)),[o]),l=(0,c.useMemo)((()=>o(GF)),[o]),{menuItems:u,hasMenuItems:d,areAllOptionalControlsHidden:p}=YF();return{...r,areAllOptionalControlsHidden:p,defaultControlsItemClassName:l,dropdownMenuClassName:s,hasMenuItems:d,headingClassName:a,headingLevel:n,menuItems:u,className:i}}(e);if(!u)return null;const g=Object.entries(d?.default||{}),v=Object.entries(d?.optional||{}),b=n?Og:wP,x=(0,a.sprintf)((0,a._x)("%s options","Button label to reveal tool panel options"),u),y=n?(0,a.__)("All options are currently hidden"):void 0,w=[...g,...v].some((([,e])=>e));return(0,_t.jsxs)(fy,{...m,ref:t,children:[(0,_t.jsx)(hk,{level:l,className:s,children:u}),i&&(0,_t.jsx)(PN,{...h,icon:b,label:x,menuProps:{className:o},toggleProps:{size:"small",description:y},children:()=>(0,_t.jsxs)(_t.Fragment,{children:[(0,_t.jsxs)(hD,{label:u,children:[(0,_t.jsx)(XF,{items:g,toggleItem:f,itemClassName:r}),(0,_t.jsx)(ZF,{items:v,toggleItem:f})]}),(0,_t.jsx)(hD,{children:(0,_t.jsx)(gD,{"aria-disabled":!w,variant:"tertiary",onClick:()=>{w&&(p(),(0,jy.speak)((0,a.__)("All options reset"),"assertive"))},children:(0,a.__)("Reset all")})})]})})]})}),"ToolsPanelHeader"),JF=QF;function eB(){return{panelItems:[],menuItemOrder:[],menuItems:{default:{},optional:{}}}}const tB=({panelItems:e,shouldReset:t,currentMenuItems:n,menuItemOrder:r})=>{const o={default:{},optional:{}},i={default:{},optional:{}};return e.forEach((({hasValue:e,isShownByDefault:r,label:i})=>{const s=r?"default":"optional",a=n?.[s]?.[i],l=a||e();o[s][i]=!t&&l})),r.forEach((e=>{o.default.hasOwnProperty(e)&&(i.default[e]=o.default[e]),o.optional.hasOwnProperty(e)&&(i.optional[e]=o.optional[e])})),Object.keys(o.default).forEach((e=>{i.default.hasOwnProperty(e)||(i.default[e]=o.default[e])})),Object.keys(o.optional).forEach((e=>{i.optional.hasOwnProperty(e)||(i.optional[e]=o.optional[e])})),i};function nB(e,t){const n=function(e,t){switch(t.type){case"REGISTER_PANEL":{const n=[...e],r=n.findIndex((e=>e.label===t.item.label));return-1!==r&&n.splice(r,1),n.push(t.item),n}case"UNREGISTER_PANEL":{const n=e.findIndex((e=>e.label===t.label));if(-1!==n){const t=[...e];return t.splice(n,1),t}return e}default:return e}}(e.panelItems,t),r=function(e,t){return"REGISTER_PANEL"===t.type?e.includes(t.item.label)?e:[...e,t.item.label]:e}(e.menuItemOrder,t),o=function(e,t){switch(t.type){case"REGISTER_PANEL":case"UNREGISTER_PANEL":return tB({currentMenuItems:e.menuItems,panelItems:e.panelItems,menuItemOrder:e.menuItemOrder,shouldReset:!1});case"RESET_ALL":return tB({panelItems:e.panelItems,menuItemOrder:e.menuItemOrder,shouldReset:!0});case"UPDATE_VALUE":{const n=e.menuItems[t.group][t.label];return t.value===n?e.menuItems:{...e.menuItems,[t.group]:{...e.menuItems[t.group],[t.label]:t.value}}}case"TOGGLE_VALUE":{const n=e.panelItems.find((e=>e.label===t.label));if(!n)return e.menuItems;const r=n.isShownByDefault?"default":"optional";return{...e.menuItems,[r]:{...e.menuItems[r],[t.label]:!e.menuItems[r][t.label]}}}default:return e.menuItems}}({panelItems:n,menuItemOrder:r,menuItems:e.menuItems},t);return{panelItems:n,menuItemOrder:r,menuItems:o}}function rB(e,t){switch(t.type){case"REGISTER":return[...e,t.filter];case"UNREGISTER":return e.filter((e=>e!==t.filter));default:return e}}const oB=e=>0===Object.keys(e).length;function iB(e){const{className:t,headingLevel:n=2,resetAll:r,panelId:o,hasInnerWrapper:i=!1,shouldRenderPlaceholderItems:s=!1,__experimentalFirstVisibleItemClass:a,__experimentalLastVisibleItemClass:l,...u}=sl(e,"ToolsPanel"),d=(0,c.useRef)(!1),p=d.current;(0,c.useEffect)((()=>{p&&(d.current=!1)}),[p]);const[{panelItems:f,menuItems:h},m]=(0,c.useReducer)(nB,void 0,eB),[g,v]=(0,c.useReducer)(rB,[]),b=(0,c.useCallback)((e=>{m({type:"REGISTER_PANEL",item:e})}),[]),x=(0,c.useCallback)((e=>{m({type:"UNREGISTER_PANEL",label:e})}),[]),y=(0,c.useCallback)((e=>{v({type:"REGISTER",filter:e})}),[]),w=(0,c.useCallback)((e=>{v({type:"UNREGISTER",filter:e})}),[]),_=(0,c.useCallback)(((e,t,n="default")=>{m({type:"UPDATE_VALUE",group:n,label:t,value:e})}),[]),S=(0,c.useMemo)((()=>oB(h.default)&&!oB(h.optional)&&Object.values(h.optional).every((e=>!e))),[h]),C=il(),k=(0,c.useMemo)((()=>{const e=i&&Nl(">div:not( :first-of-type ){display:grid;",LF.columns(2)," ",LF.spacing," ",LF.item.fullWidth,";}","");const n=S&&FF;return C((e=>Nl(LF.columns(e)," ",LF.spacing," border-top:",Fl.borderWidth," solid ",zl.gray[300],";margin-top:-1px;padding:",Il(4),";",""))(2),e,n,t)}),[S,t,C,i]),j=(0,c.useCallback)((e=>{m({type:"TOGGLE_VALUE",label:e})}),[]),E=(0,c.useCallback)((()=>{"function"==typeof r&&(d.current=!0,r(g)),m({type:"RESET_ALL"})}),[g,r]),P=e=>{const t=h.optional||{},n=e.find((e=>e.isShownByDefault||t[e.label]));return n?.label},N=P(f),T=P([...f].reverse()),I=f.length>0;return{...u,headingLevel:n,panelContext:(0,c.useMemo)((()=>({areAllOptionalControlsHidden:S,deregisterPanelItem:x,deregisterResetAllFilter:w,firstDisplayedItem:N,flagItemCustomization:_,hasMenuItems:I,isResetting:d.current,lastDisplayedItem:T,menuItems:h,panelId:o,registerPanelItem:b,registerResetAllFilter:y,shouldRenderPlaceholderItems:s,__experimentalFirstVisibleItemClass:a,__experimentalLastVisibleItemClass:l})),[S,x,w,N,_,T,h,o,I,y,b,s,a,l]),resetAllItems:E,toggleItem:j,className:k}}const sB=al(((e,t)=>{const{children:n,label:r,panelContext:o,resetAllItems:i,toggleItem:s,headingLevel:a,dropdownMenuProps:l,...c}=iB(e);return(0,_t.jsx)(lj,{...c,columns:2,ref:t,children:(0,_t.jsxs)(qF.Provider,{value:o,children:[(0,_t.jsx)(JF,{label:r,resetAll:i,toggleItem:s,headingLevel:a,dropdownMenuProps:l}),n]})})}),"ToolsPanel"),aB=()=>{};const lB=al(((e,t)=>{const{children:n,isShown:r,shouldRenderPlaceholder:o,...i}=function(e){const{className:t,hasValue:n,isShownByDefault:r=!1,label:o,panelId:i,resetAllFilter:s=aB,onDeselect:a,onSelect:u,...d}=sl(e,"ToolsPanelItem"),{panelId:p,menuItems:f,registerResetAllFilter:h,deregisterResetAllFilter:m,registerPanelItem:g,deregisterPanelItem:v,flagItemCustomization:b,isResetting:x,shouldRenderPlaceholderItems:y,firstDisplayedItem:w,lastDisplayedItem:_,__experimentalFirstVisibleItemClass:S,__experimentalLastVisibleItemClass:C}=YF(),k=(0,c.useCallback)(n,[i]),j=(0,c.useCallback)(s,[i]),E=(0,l.usePrevious)(p),P=p===i||null===p;(0,c.useLayoutEffect)((()=>(P&&null!==E&&g({hasValue:k,isShownByDefault:r,label:o,panelId:i}),()=>{(null===E&&p||p===i)&&v(o)})),[p,P,r,o,k,i,E,g,v]),(0,c.useEffect)((()=>(P&&h(j),()=>{P&&m(j)})),[h,m,j,P]);const N=r?"default":"optional",T=f?.[N]?.[o],I=(0,l.usePrevious)(T),R=void 0!==f?.[N]?.[o],M=n();(0,c.useEffect)((()=>{(r||M)&&b(M,o,N)}),[M,N,o,b,r]),(0,c.useEffect)((()=>{R&&!x&&P&&(!T||M||I||u?.(),!T&&M&&I&&a?.())}),[P,T,R,x,M,I,u,a]);const A=r?void 0!==f?.[N]?.[o]:T,D=il(),z=(0,c.useMemo)((()=>{const e=y&&!A;return D($F,e&&HF,!e&&t,w===o&&S,_===o&&C)}),[A,y,t,D,w,_,S,C,o]);return{...d,isShown:A,shouldRenderPlaceholder:y,className:z}}(e);return r?(0,_t.jsx)(_l,{...i,ref:t,children:n}):o?(0,_t.jsx)(_l,{...i,ref:t}):null}),"ToolsPanelItem"),cB=lB,uB=(0,c.createContext)(void 0),dB=uB.Provider;function pB({children:e}){const[t,n]=(0,c.useState)(),r=(0,c.useMemo)((()=>({lastFocusedElement:t,setLastFocusedElement:n})),[t]);return(0,_t.jsx)(dB,{value:r,children:e})}function fB(e){return vN.focus.focusable.find(e,{sequential:!0}).filter((t=>t.closest('[role="row"]')===e))}const hB=(0,c.forwardRef)((function({children:e,onExpandRow:t=()=>{},onCollapseRow:n=()=>{},onFocusRow:r=()=>{},applicationAriaLabel:o,...i},s){const a=(0,c.useCallback)((e=>{const{keyCode:o,metaKey:i,ctrlKey:s,altKey:a}=e;if(i||s||a||![Ey.UP,Ey.DOWN,Ey.LEFT,Ey.RIGHT,Ey.HOME,Ey.END].includes(o))return;e.stopPropagation();const{activeElement:l}=document,{currentTarget:c}=e;if(!l||!c.contains(l))return;const u=l.closest('[role="row"]');if(!u)return;const d=fB(u),p=d.indexOf(l),f=0===p,h=f&&("false"===u.getAttribute("data-expanded")||"false"===u.getAttribute("aria-expanded"))&&o===Ey.RIGHT;if([Ey.LEFT,Ey.RIGHT].includes(o)){let r;if(r=o===Ey.LEFT?Math.max(0,p-1):Math.min(p+1,d.length-1),f){if(o===Ey.LEFT){var m;if("true"===u.getAttribute("data-expanded")||"true"===u.getAttribute("aria-expanded"))return n(u),void e.preventDefault();const t=Math.max(parseInt(null!==(m=u?.getAttribute("aria-level"))&&void 0!==m?m:"1",10)-1,1),r=Array.from(c.querySelectorAll('[role="row"]'));let o=u;for(let e=r.indexOf(u);e>=0;e--){const n=r[e].getAttribute("aria-level");if(null!==n&&parseInt(n,10)===t){o=r[e];break}}fB(o)?.[0]?.focus()}if(o===Ey.RIGHT){if("false"===u.getAttribute("data-expanded")||"false"===u.getAttribute("aria-expanded"))return t(u),void e.preventDefault();const n=fB(u);n.length>0&&n[r]?.focus()}return void e.preventDefault()}if(h)return;d[r].focus(),e.preventDefault()}else if([Ey.UP,Ey.DOWN].includes(o)){const t=Array.from(c.querySelectorAll('[role="row"]')),n=t.indexOf(u);let i;if(i=o===Ey.UP?Math.max(0,n-1):Math.min(n+1,t.length-1),i===n)return void e.preventDefault();const s=fB(t[i]);if(!s||!s.length)return void e.preventDefault();s[Math.min(p,s.length-1)].focus(),r(e,u,t[i]),e.preventDefault()}else if([Ey.HOME,Ey.END].includes(o)){const t=Array.from(c.querySelectorAll('[role="row"]')),n=t.indexOf(u);let i;if(i=o===Ey.HOME?0:t.length-1,i===n)return void e.preventDefault();const s=fB(t[i]);if(!s||!s.length)return void e.preventDefault();s[Math.min(p,s.length-1)].focus(),r(e,u,t[i]),e.preventDefault()}}),[t,n,r]);return(0,_t.jsx)(pB,{children:(0,_t.jsx)("div",{role:"application","aria-label":o,children:(0,_t.jsx)("table",{...i,role:"treegrid",onKeyDown:a,ref:s,children:(0,_t.jsx)("tbody",{children:e})})})})})),mB=hB;const gB=(0,c.forwardRef)((function({children:e,level:t,positionInSet:n,setSize:r,isExpanded:o,...i},s){return(0,_t.jsx)("tr",{...i,ref:s,role:"row","aria-level":t,"aria-posinset":n,"aria-setsize":r,"aria-expanded":o,children:e})})),vB=(0,c.forwardRef)((function({children:e,as:t,...n},r){const o=(0,c.useRef)(),i=r||o,{lastFocusedElement:s,setLastFocusedElement:a}=(0,c.useContext)(uB);let l;s&&(l=s===("current"in i?i.current:void 0)?0:-1);const u={ref:i,tabIndex:l,onFocus:e=>a?.(e.target),...n};return"function"==typeof e?e(u):t?(0,_t.jsx)(t,{...u,children:e}):null})),bB=vB;const xB=(0,c.forwardRef)((function({children:e,...t},n){return(0,_t.jsx)(bB,{ref:n,...t,children:e})}));const yB=(0,c.forwardRef)((function({children:e,withoutGridItem:t=!1,...n},r){return(0,_t.jsx)("td",{...n,role:"gridcell",children:t?(0,_t.jsx)(_t.Fragment,{children:"function"==typeof e?e({...n,ref:r}):e}):(0,_t.jsx)(xB,{ref:r,children:e})})}));function wB(e){e.stopPropagation()}const _B=(0,c.forwardRef)(((e,t)=>(Xi()("wp.components.IsolatedEventContainer",{since:"5.7"}),(0,_t.jsx)("div",{...e,ref:t,onMouseDown:wB}))));function SB(e){const t=(0,c.useContext)(Uy);return(0,l.useObservableValue)(t.fills,e)}const CB=yl("div",{target:"ebn2ljm1"})("&:not( :first-of-type ){",(({offsetAmount:e})=>Nl({marginInlineStart:e},"","")),";}",(({zIndex:e})=>Nl({zIndex:e},"","")),";");var kB={name:"rs0gp6",styles:"grid-row-start:1;grid-column-start:1"};const jB=yl("div",{target:"ebn2ljm0"})("display:inline-grid;grid-auto-flow:column;position:relative;&>",CB,"{position:relative;justify-self:start;",(({isLayered:e})=>e?kB:void 0),";}");const EB=al((function(e,t){const{children:n,className:r,isLayered:o=!0,isReversed:i=!1,offset:s=0,...a}=sl(e,"ZStack"),l=dy(n),u=l.length-1,d=l.map(((e,t)=>{const n=i?u-t:t,r=o?s*t:s,a=(0,c.isValidElement)(e)?e.key:t;return(0,_t.jsx)(CB,{offsetAmount:r,zIndex:n,children:e},a)}));return(0,_t.jsx)(jB,{...a,className:r,isLayered:o,ref:t,children:d})}),"ZStack"),PB=EB,NB={previous:[{modifier:"ctrlShift",character:"`"},{modifier:"ctrlShift",character:"~"},{modifier:"access",character:"p"}],next:[{modifier:"ctrl",character:"`"},{modifier:"access",character:"n"}]};function TB(e=NB){const t=(0,c.useRef)(null),[n,r]=(0,c.useState)(!1);function o(e){var n;const o=Array.from(null!==(n=t.current?.querySelectorAll('[role="region"][tabindex="-1"]'))&&void 0!==n?n:[]);if(!o.length)return;let i=o[0];const s=t.current?.ownerDocument?.activeElement?.closest('[role="region"][tabindex="-1"]'),a=s?o.indexOf(s):-1;if(-1!==a){let t=a+e;t=-1===t?o.length-1:t,t=t===o.length?0:t,i=o[t]}i.focus(),r(!0)}const i=(0,l.useRefEffect)((e=>{function t(){r(!1)}return e.addEventListener("click",t),()=>{e.removeEventListener("click",t)}}),[r]);return{ref:(0,l.useMergeRefs)([t,i]),className:n?"is-focusing-regions":"",onKeyDown(t){e.previous.some((({modifier:e,character:n})=>Ey.isKeyboardEvent[e](t,n)))?o(-1):e.next.some((({modifier:e,character:n})=>Ey.isKeyboardEvent[e](t,n)))&&o(1)}}}const IB=(0,l.createHigherOrderComponent)((e=>({shortcuts:t,...n})=>(0,_t.jsx)("div",{...TB(t),children:(0,_t.jsx)(e,{...n})})),"navigateRegions"),RB=(0,l.createHigherOrderComponent)((e=>function(t){const n=(0,l.useConstrainedTabbing)();return(0,_t.jsx)("div",{ref:n,tabIndex:-1,children:(0,_t.jsx)(e,{...t})})}),"withConstrainedTabbing"),MB=e=>(0,l.createHigherOrderComponent)((t=>class extends c.Component{constructor(e){super(e),this.nodeRef=this.props.node,this.state={fallbackStyles:void 0,grabStylesCompleted:!1},this.bindRef=this.bindRef.bind(this)}bindRef(e){e&&(this.nodeRef=e)}componentDidMount(){this.grabFallbackStyles()}componentDidUpdate(){this.grabFallbackStyles()}grabFallbackStyles(){const{grabStylesCompleted:t,fallbackStyles:n}=this.state;if(this.nodeRef&&!t){const t=e(this.nodeRef,this.props);us()(t,n)||this.setState({fallbackStyles:t,grabStylesCompleted:Object.values(t).every(Boolean)})}}render(){const e=(0,_t.jsx)(t,{...this.props,...this.state.fallbackStyles});return this.props.node?e:(0,_t.jsxs)("div",{ref:this.bindRef,children:[" ",e," "]})}}),"withFallbackStyles"),AB=window.wp.hooks,DB=16;function zB(e){return(0,l.createHigherOrderComponent)((t=>{const n="core/with-filters/"+e;let r;class o extends c.Component{constructor(n){super(n),void 0===r&&(r=(0,AB.applyFilters)(e,t))}componentDidMount(){o.instances.push(this),1===o.instances.length&&((0,AB.addAction)("hookRemoved",n,s),(0,AB.addAction)("hookAdded",n,s))}componentWillUnmount(){o.instances=o.instances.filter((e=>e!==this)),0===o.instances.length&&((0,AB.removeAction)("hookRemoved",n),(0,AB.removeAction)("hookAdded",n))}render(){return(0,_t.jsx)(r,{...this.props})}}o.instances=[];const i=(0,l.debounce)((()=>{r=(0,AB.applyFilters)(e,t),o.instances.forEach((e=>{e.forceUpdate()}))}),DB);function s(t){t===e&&i()}return o}),"withFilters")}const OB=(0,l.createHigherOrderComponent)((e=>{const t=({onFocusReturn:e}={})=>t=>n=>{const r=(0,l.useFocusReturn)(e);return(0,_t.jsx)("div",{ref:r,children:(0,_t.jsx)(t,{...n})})};if((n=e)instanceof c.Component||"function"==typeof n){const n=e;return t()(n)}var n;return t(e)}),"withFocusReturn"),LB=({children:e})=>(Xi()("wp.components.FocusReturnProvider component",{since:"5.7",hint:"This provider is not used anymore. You can just remove it from your codebase"}),e),FB=(0,l.createHigherOrderComponent)((e=>{function t(t,r){const[o,i]=(0,c.useState)([]),s=(0,c.useMemo)((()=>{const e=e=>{const t=e.id?e:{...e,id:ow()};i((e=>[...e,t]))};return{createNotice:e,createErrorNotice:t=>{e({status:"error",content:t})},removeNotice:e=>{i((t=>t.filter((t=>t.id!==e))))},removeAllNotices:()=>{i([])}}}),[]),a={...t,noticeList:o,noticeOperations:s,noticeUI:o.length>0&&(0,_t.jsx)(lO,{className:"components-with-notices-ui",notices:o,onRemove:s.removeNotice})};return n?(0,_t.jsx)(e,{...a,ref:r}):(0,_t.jsx)(e,{...a})}let n;const{render:r}=e;return"function"==typeof r?(n=!0,(0,c.forwardRef)(t)):t}),"withNotices");var BB=Et([Mt,yr],[At,wr]),VB=BB.useContext,$B=BB.useScopedContext,HB=BB.useProviderContext,WB=BB.ContextProvider,UB=BB.ScopedContextProvider,GB=(0,B.createContext)(void 0),KB=Et([Mt],[At]),qB=KB.useContext,YB=KB.useScopedContext;KB.useProviderContext,KB.ContextProvider,KB.ScopedContextProvider,(0,B.createContext)(void 0);function XB(e={}){var t=e,{combobox:n,parent:r,menubar:o}=t,i=N(t,["combobox","parent","menubar"]);const s=!!o&&!r,a=Xe(i.store,function(e,...t){if(e)return $e(e,"pick")(...t)}(r,["values"]),Ye(n,["arrowElement","anchorElement","contentElement","popoverElement","disclosureElement"])),l=a.getState(),c=ht(P(E({},i),{store:a,orientation:F(i.orientation,l.orientation,"vertical")})),u=tr(P(E({},i),{store:a,placement:F(i.placement,l.placement,"bottom-start"),timeout:F(i.timeout,l.timeout,s?0:150),hideTimeout:F(i.hideTimeout,l.hideTimeout,0)})),d=He(P(E(E({},c.getState()),u.getState()),{initialFocus:F(l.initialFocus,"container"),values:F(i.values,l.values,i.defaultValues,{})}),c,u,a);return We(d,(()=>Ke(d,["mounted"],(e=>{e.mounted||d.setState("activeId",null)})))),We(d,(()=>Ke(r,["orientation"],(e=>{d.setState("placement","vertical"===e.orientation?"right-start":"bottom-start")})))),P(E(E(E({},c),u),d),{combobox:n,parent:r,menubar:o,hideAll:()=>{u.hide(),null==r||r.hideAll()},setInitialFocus:e=>d.setState("initialFocus",e),setValues:e=>d.setState("values",e),setValue:(e,t)=>{"__proto__"!==e&&"constructor"!==e&&(Array.isArray(e)||d.setState("values",(n=>{const r=n[e],o=I(t,r);return o===r?n:P(E({},n),{[e]:void 0!==o&&o})})))}})}function ZB(e={}){const t=VB(),n=qB(),r=ST();e=b(v({},e),{parent:void 0!==e.parent?e.parent:t,menubar:void 0!==e.menubar?e.menubar:n,combobox:void 0!==e.combobox?e.combobox:r});const[o,i]=rt(XB,e);return function(e,t,n){return Te(t,[n.combobox,n.parent,n.menubar]),nt(e,n,"values","setValues"),Object.assign(Jn(gt(e,t,n),t,n),{combobox:n.combobox,parent:n.parent,menubar:n.menubar})}(o,i,e)}const QB=(0,c.createContext)(void 0);var JB=jt((function(e){var t=e,{store:n,hideOnClick:r=!0,preventScrollOnKeyDown:o=!0,focusOnHover:i,blurOnHoverEnd:s}=t,a=x(t,["store","hideOnClick","preventScrollOnKeyDown","focusOnHover","blurOnHoverEnd"]);const l=$B(!0),c=YB();D(n=n||l||c,!1);const u=a.onClick,d=Re(r),p="hideAll"in n?n.hideAll:void 0,f=!!p,h=ke((e=>{if(null==u||u(e),e.defaultPrevented)return;if(fe(e))return;if(pe(e))return;if(!p)return;"menu"!==e.currentTarget.getAttribute("aria-haspopup")&&d(e)&&p()})),m=oe(et(n,(e=>"contentElement"in e?e.contentElement:null)),"menuitem");return a=b(v({role:m},a),{onClick:h}),a=Mn(v({store:n,preventScrollOnKeyDown:o},a)),a=Cn(b(v({store:n},a),{focusOnHover(e){if(!n)return!1;if(!("function"==typeof i?i(e):null==i||i))return!1;const{baseElement:t,items:r}=n.getState();return f?(e.currentTarget.hasAttribute("aria-expanded")&&e.currentTarget.focus(),!0):!!function(e,t,n){var r;if(!e)return!1;if(Kt(e))return!0;const o=null==t?void 0:t.find((e=>{var t;return e.element!==n&&"true"===(null==(t=e.element)?void 0:t.getAttribute("aria-expanded"))})),i=null==(r=null==o?void 0:o.element)?void 0:r.getAttribute("aria-controls");if(!i)return!1;const s=K(e).getElementById(i);return!(!s||!Kt(s)&&!s.querySelector("[role=menuitem][aria-expanded=true]"))}(t,r,e.currentTarget)&&(e.currentTarget.focus(),!0)},blurOnHoverEnd:e=>"function"==typeof s?s(e):null!=s?s:f})),a})),eV=Ct(St((function(e){return kt("div",JB(e))}))),tV=Et(),nV=tV.useContext,rV=(tV.useScopedContext,tV.useProviderContext,tV.ContextProvider,tV.ScopedContextProvider,"input");function oV(e,t){t?e.indeterminate=!0:e.indeterminate&&(e.indeterminate=!1)}function iV(e){return Array.isArray(e)?e.toString():e}var sV=jt((function(e){var t=e,{store:n,name:r,value:o,checked:i,defaultChecked:s}=t,a=x(t,["store","name","value","checked","defaultChecked"]);const l=nV();n=n||l;const[c,u]=(0,B.useState)(null!=s&&s),d=et(n,(e=>{if(void 0!==i)return i;if(void 0===(null==e?void 0:e.value))return c;if(null!=o){if(Array.isArray(e.value)){const t=iV(o);return e.value.includes(t)}return e.value===o}return!Array.isArray(e.value)&&("boolean"==typeof e.value&&e.value)})),p=(0,B.useRef)(null),f=function(e,t){return"input"===e&&(!t||"checkbox"===t)}(Ne(p,rV),a.type),h=d?"mixed"===d:void 0,m="mixed"!==d&&d,g=O(a),[y,w]=Ie();(0,B.useEffect)((()=>{const e=p.current;e&&(oV(e,h),f||(e.checked=m,void 0!==r&&(e.name=r),void 0!==o&&(e.value=`${o}`)))}),[y,h,f,m,r,o]);const _=a.onChange,S=ke((e=>{if(g)return e.stopPropagation(),void e.preventDefault();if(oV(e.currentTarget,h),f||(e.currentTarget.checked=!e.currentTarget.checked,w()),null==_||_(e),e.defaultPrevented)return;const t=e.currentTarget.checked;u(t),null==n||n.setValue((e=>{if(null==o)return t;const n=iV(o);return Array.isArray(e)?t?e.includes(n)?e:[...e,n]:e.filter((e=>e!==n)):e!==n&&n}))})),C=a.onClick,k=ke((e=>{null==C||C(e),e.defaultPrevented||f||S(e)}));return a=Me(a,(e=>(0,_t.jsx)(tI.Provider,{value:m,children:e})),[m]),a=b(v({role:f?void 0:"checkbox",type:f?"checkbox":void 0,"aria-checked":d},a),{ref:Ee(p,a.ref),onChange:S,onClick:k}),a=Tn(v({clickOnEnter:!f},a)),L(v({name:f?r:void 0,value:f?o:void 0,checked:m},a))}));St((function(e){const t=sV(e);return kt(rV,t)}));function aV(e={}){var t;e.store;const n=null==(t=e.store)?void 0:t.getState(),r=He({value:F(e.value,null==n?void 0:n.value,e.defaultValue,!1)},e.store);return P(E({},r),{setValue:e=>r.setState("value",e)})}function lV(e={}){const[t,n]=rt(aV,e);return function(e,t,n){return Te(t,[n.store]),nt(e,n,"value","setValue"),e}(t,n,e)}function cV(e,t,n){if(void 0===t)return Array.isArray(e)?e:!!n;const r=function(e){return Array.isArray(e)?e.toString():e}(t);return Array.isArray(e)?n?e.includes(r)?e:[...e,r]:e.filter((e=>e!==r)):n?r:e!==r&&e}var uV=jt((function(e){var t=e,{store:n,name:r,value:o,checked:i,defaultChecked:s,hideOnClick:a=!1}=t,l=x(t,["store","name","value","checked","defaultChecked","hideOnClick"]);const c=$B();D(n=n||c,!1);const u=Se(s);(0,B.useEffect)((()=>{null==n||n.setValue(r,((e=[])=>u?cV(e,o,!0):e))}),[n,r,o,u]),(0,B.useEffect)((()=>{void 0!==i&&(null==n||n.setValue(r,(e=>cV(e,o,i))))}),[n,r,o,i]);const d=lV({value:n.useState((e=>e.values[r])),setValue(e){null==n||n.setValue(r,(()=>{if(void 0===i)return e;const t=cV(e,o,i);return Array.isArray(t)&&Array.isArray(e)&&function(e,t){if(e===t)return!0;if(!e)return!1;if(!t)return!1;if("object"!=typeof e)return!1;if("object"!=typeof t)return!1;const n=Object.keys(e),r=Object.keys(t),{length:o}=n;if(r.length!==o)return!1;for(const r of n)if(e[r]!==t[r])return!1;return!0}(e,t)?e:t}))}});return l=v({role:"menuitemcheckbox"},l),l=sV(v({store:d,name:r,value:o,checked:i},l)),l=JB(v({store:n,hideOnClick:a},l))})),dV=Ct(St((function(e){return kt("div",uV(e))})));function pV(e,t,n){return void 0===n?e:n?t:e}var fV=jt((function(e){var t=e,{store:n,name:r,value:o,checked:i,onChange:s,hideOnClick:a=!1}=t,l=x(t,["store","name","value","checked","onChange","hideOnClick"]);const c=$B();D(n=n||c,!1);const u=Se(l.defaultChecked);(0,B.useEffect)((()=>{null==n||n.setValue(r,((e=!1)=>pV(e,o,u)))}),[n,r,o,u]),(0,B.useEffect)((()=>{void 0!==i&&(null==n||n.setValue(r,(e=>pV(e,o,i))))}),[n,r,o,i]);const d=n.useState((e=>e.values[r]===o));return l=Me(l,(e=>(0,_t.jsx)(GB.Provider,{value:!!d,children:e})),[d]),l=v({role:"menuitemradio"},l),l=w_(v({name:r,value:o,checked:d,onChange(e){if(null==s||s(e),e.defaultPrevented)return;const t=e.currentTarget;null==n||n.setValue(r,(e=>pV(e,o,null!=i?i:t.checked)))}},l)),l=JB(v({store:n,hideOnClick:a},l))})),hV=Ct(St((function(e){return kt("div",fV(e))}))),mV=jt((function(e){return e=mn(e)})),gV=St((function(e){return kt("div",mV(e))})),vV=jt((function(e){return e=xn(e)})),bV=St((function(e){return kt("div",vV(e))})),xV=jt((function(e){var t=e,{store:n}=t,r=x(t,["store"]);const o=It();D(n=n||o,!1);const i=n.useState((e=>"horizontal"===e.orientation?"vertical":"horizontal"));return r=eP(b(v({},r),{orientation:i}))})),yV=(St((function(e){return kt("hr",xV(e))})),jt((function(e){var t=e,{store:n}=t,r=x(t,["store"]);const o=VB();return r=xV(v({store:n=n||o},r))}))),wV=St((function(e){return kt("hr",yV(e))}));const _V=.82,SV=.9,CV={IN:"400ms",OUT:"200ms"},kV="cubic-bezier(0.33, 0, 0, 1)",jV=Il(1),EV=Il(2),PV=Il(3),NV=zl.theme.gray[300],TV=zl.theme.gray[200],IV=zl.theme.gray[700],RV=zl.theme.gray[100],MV=zl.theme.foreground,AV=`0 0 0 ${Fl.borderWidth} ${NV}, ${Fl.elevationMedium}`,DV=`0 0 0 ${Fl.borderWidth} ${MV}`,zV="minmax( 0, max-content ) 1fr",OV=yl("div",{target:"e1wg7tti14"})("position:relative;background-color:",zl.ui.background,";border-radius:",Fl.radiusMedium,";",(e=>Nl("box-shadow:","toolbar"===e.variant?DV:AV,";",""))," overflow:hidden;@media not ( prefers-reduced-motion ){transition-property:transform,opacity;transition-timing-function:",kV,";transition-duration:",CV.IN,";will-change:transform,opacity;opacity:0;&:has( [data-enter] ){opacity:1;}&:has( [data-leave] ){transition-duration:",CV.OUT,";}&:has( [data-side='bottom'] ),&:has( [data-side='top'] ){transform:scaleY( ",_V," );}&:has( [data-side='bottom'] ){transform-origin:top;}&:has( [data-side='top'] ){transform-origin:bottom;}&:has( [data-enter][data-side='bottom'] ),&:has( [data-enter][data-side='top'] ),&:has( [data-leave][data-side='bottom'] ),&:has( [data-leave][data-side='top'] ){transform:scaleY( 1 );}}"),LV=yl("div",{target:"e1wg7tti13"})("position:relative;z-index:1000000;display:grid;grid-template-columns:",zV,";grid-template-rows:auto;box-sizing:border-box;min-width:160px;max-width:320px;max-height:var( --popover-available-height );padding:",jV,";overscroll-behavior:contain;overflow:auto;outline:2px solid transparent!important;@media not ( prefers-reduced-motion ){transition:inherit;transform-origin:inherit;&[data-side='bottom'],&[data-side='top']{transform:scaleY(\n\t\t\t\tcalc(\n\t\t\t\t\t1 / ",_V," *\n\t\t\t\t\t\t",SV,"\n\t\t\t\t)\n\t\t\t);}&[data-enter][data-side='bottom'],&[data-enter][data-side='top'],&[data-leave][data-side='bottom'],&[data-leave][data-side='top']{transform:scaleY( 1 );}}"),FV=Nl("all:unset;position:relative;min-height:",Il(10),";box-sizing:border-box;grid-column:1/-1;display:grid;grid-template-columns:",zV,";align-items:center;@supports ( grid-template-columns: subgrid ){grid-template-columns:subgrid;}font-size:",Ix("default.fontSize"),";font-family:inherit;font-weight:normal;line-height:20px;color:",zl.theme.foreground,";border-radius:",Fl.radiusSmall,";padding-block:",EV,";padding-inline:",PV,";scroll-margin:",jV,";user-select:none;outline:none;&[aria-disabled='true']{color:",zl.ui.textDisabled,";cursor:not-allowed;}&[data-active-item]:not( [data-focus-visible] ):not(\n\t\t\t[aria-disabled='true']\n\t\t){background-color:",zl.theme.accent,";color:",zl.theme.accentInverted,";}&[data-focus-visible]{box-shadow:0 0 0 1.5px ",zl.theme.accent,";outline:2px solid transparent;}&:active,&[data-active]{}",LV,':not(:focus) &:not(:focus)[aria-expanded="true"]{background-color:',RV,";color:",zl.theme.foreground,";}svg{fill:currentColor;}",""),BV=yl(eV,{target:"e1wg7tti12"})(FV,";"),VV=yl(dV,{target:"e1wg7tti11"})(FV,";"),$V=yl(hV,{target:"e1wg7tti10"})(FV,";"),HV=yl("span",{target:"e1wg7tti9"})("grid-column:1;",VV,">&,",$V,">&{min-width:",Il(6),";}",VV,">&,",$V,">&,&:not( :empty ){margin-inline-end:",Il(2),";}display:flex;align-items:center;justify-content:center;color:",IV,";[data-active-item]:not( [data-focus-visible] )>&,[aria-disabled='true']>&{color:inherit;}"),WV=yl("div",{target:"e1wg7tti8"})("grid-column:2;display:flex;align-items:center;justify-content:space-between;gap:",Il(3),";pointer-events:none;"),UV=yl("div",{target:"e1wg7tti7"})("flex:1;display:inline-flex;flex-direction:column;gap:",Il(1),";"),GV=yl("span",{target:"e1wg7tti6"})("flex:0 1 fit-content;min-width:0;width:fit-content;display:flex;align-items:center;justify-content:center;gap:",Il(3),";color:",IV,";[data-active-item]:not( [data-focus-visible] ) *:not(",LV,") &,[aria-disabled='true'] *:not(",LV,") &{color:inherit;}"),KV=yl(gV,{target:"e1wg7tti5"})({name:"49aokf",styles:"display:contents"}),qV=yl(bV,{target:"e1wg7tti4"})("grid-column:1/-1;padding-block-start:",Il(3),";padding-block-end:",Il(2),";padding-inline:",PV,";"),YV=yl(wV,{target:"e1wg7tti3"})("grid-column:1/-1;border:none;height:",Fl.borderWidth,";background-color:",(e=>"toolbar"===e.variant?MV:TV),";margin-block:",Il(2),";margin-inline:",PV,";outline:2px solid transparent;"),XV=yl(Xx,{target:"e1wg7tti2"})("width:",Il(1.5),";",Mg({transform:"scaleX(1)"},{transform:"scaleX(-1)"}),";"),ZV=yl(pk,{target:"e1wg7tti1"})("font-size:",Ix("default.fontSize"),";line-height:20px;color:inherit;"),QV=yl(pk,{target:"e1wg7tti0"})("font-size:",Ix("helpText.fontSize"),";line-height:16px;color:",IV,";overflow-wrap:anywhere;[data-active-item]:not( [data-focus-visible] ) *:not( ",LV," ) &,[aria-disabled='true'] *:not( ",LV," ) &{color:inherit;}"),JV=(0,c.forwardRef)((function({prefix:e,suffix:t,children:n,disabled:r=!1,hideOnClick:o=!0,store:i,...s},a){const l=(0,c.useContext)(QB);if(!l?.store)throw new Error("Menu.Item can only be rendered inside a Menu component");const u=null!=i?i:l.store;return(0,_t.jsxs)(BV,{ref:a,...s,accessibleWhenDisabled:!0,disabled:r,hideOnClick:o,store:u,children:[(0,_t.jsx)(HV,{children:e}),(0,_t.jsxs)(WV,{children:[(0,_t.jsx)(UV,{children:n}),t&&(0,_t.jsx)(GV,{children:t})]})]})}));var e$=jt((function(e){var t=e,{store:n,checked:r}=t,o=x(t,["store","checked"]);const i=(0,B.useContext)(GB);return r=null!=r?r:i,o=rI(b(v({},o),{checked:r}))})),t$=St((function(e){return kt("span",e$(e))}));const n$=(0,c.forwardRef)((function({suffix:e,children:t,disabled:n=!1,hideOnClick:r=!1,...o},i){const s=(0,c.useContext)(QB);if(!s?.store)throw new Error("Menu.CheckboxItem can only be rendered inside a Menu component");return(0,_t.jsxs)(VV,{ref:i,...o,accessibleWhenDisabled:!0,disabled:n,hideOnClick:r,store:s.store,children:[(0,_t.jsx)(t$,{store:s.store,render:(0,_t.jsx)(HV,{}),style:{width:"auto",height:"auto"},children:(0,_t.jsx)(oS,{icon:ok,size:24})}),(0,_t.jsxs)(WV,{children:[(0,_t.jsx)(UV,{children:t}),e&&(0,_t.jsx)(GV,{children:e})]})]})})),r$=(0,_t.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_t.jsx)(n.Circle,{cx:12,cy:12,r:3})}),o$=(0,c.forwardRef)((function({suffix:e,children:t,disabled:n=!1,hideOnClick:r=!1,...o},i){const s=(0,c.useContext)(QB);if(!s?.store)throw new Error("Menu.RadioItem can only be rendered inside a Menu component");return(0,_t.jsxs)($V,{ref:i,...o,accessibleWhenDisabled:!0,disabled:n,hideOnClick:r,store:s.store,children:[(0,_t.jsx)(t$,{store:s.store,render:(0,_t.jsx)(HV,{}),style:{width:"auto",height:"auto"},children:(0,_t.jsx)(oS,{icon:r$,size:24})}),(0,_t.jsxs)(WV,{children:[(0,_t.jsx)(UV,{children:t}),e&&(0,_t.jsx)(GV,{children:e})]})]})})),i$=(0,c.forwardRef)((function(e,t){const n=(0,c.useContext)(QB);if(!n?.store)throw new Error("Menu.Group can only be rendered inside a Menu component");return(0,_t.jsx)(KV,{ref:t,...e,store:n.store})})),s$=(0,c.forwardRef)((function(e,t){const n=(0,c.useContext)(QB);if(!n?.store)throw new Error("Menu.GroupLabel can only be rendered inside a Menu component");return(0,_t.jsx)(qV,{ref:t,render:(0,_t.jsx)($v,{upperCase:!0,variant:"muted",size:"11px",weight:500,lineHeight:"16px"}),...e,store:n.store})})),a$=(0,c.forwardRef)((function(e,t){const n=(0,c.useContext)(QB);if(!n?.store)throw new Error("Menu.Separator can only be rendered inside a Menu component");return(0,_t.jsx)(YV,{ref:t,...e,store:n.store,variant:n.variant})})),l$=(0,c.forwardRef)((function(e,t){const n=(0,c.useContext)(QB);if(!n?.store)throw new Error("Menu.ItemLabel can only be rendered inside a Menu component");return(0,_t.jsx)(ZV,{numberOfLines:1,ref:t,...e})})),c$=(0,c.forwardRef)((function(e,t){const n=(0,c.useContext)(QB);if(!n?.store)throw new Error("Menu.ItemHelpText can only be rendered inside a Menu component");return(0,_t.jsx)(QV,{numberOfLines:2,ref:t,...e})}));function u$(e,t){return!!(null==e?void 0:e.some((e=>!!e.element&&(e.element!==t&&"true"===e.element.getAttribute("aria-expanded")))))}var d$=jt((function(e){var t=e,{store:n,focusable:r,accessibleWhenDisabled:o,showOnHover:i}=t,s=x(t,["store","focusable","accessibleWhenDisabled","showOnHover"]);const a=HB();D(n=n||a,!1);const l=(0,B.useRef)(null),c=n.parent,u=n.menubar,d=!!c,p=!!u&&!d,f=O(s),h=()=>{const e=l.current;e&&(null==n||n.setDisclosureElement(e),null==n||n.setAnchorElement(e),null==n||n.show())},m=s.onFocus,g=ke((e=>{if(null==m||m(e),f)return;if(e.defaultPrevented)return;if(null==n||n.setAutoFocusOnShow(!1),null==n||n.setActiveId(null),!u)return;if(!p)return;const{items:t}=u.getState();u$(t,e.currentTarget)&&h()})),y=et(n,(e=>e.placement.split("-")[0])),w=s.onKeyDown,_=ke((e=>{if(null==w||w(e),f)return;if(e.defaultPrevented)return;const t=function(e,t){return{ArrowDown:("bottom"===t||"top"===t)&&"first",ArrowUp:("bottom"===t||"top"===t)&&"last",ArrowRight:"right"===t&&"first",ArrowLeft:"left"===t&&"first"}[e.key]}(e,y);t&&(e.preventDefault(),h(),null==n||n.setAutoFocusOnShow(!0),null==n||n.setInitialFocus(t))})),S=s.onClick,C=ke((e=>{if(null==S||S(e),e.defaultPrevented)return;if(!n)return;const t=!e.detail,{open:r}=n.getState();r&&!t||(d&&!t||n.setAutoFocusOnShow(!0),n.setInitialFocus(t?"first":"container")),d&&h()}));s=Me(s,(e=>(0,_t.jsx)(WB,{value:n,children:e})),[n]),d&&(s=b(v({},s),{render:(0,_t.jsx)(or.div,{render:s.render})}));const k=Pe(s.id),j=et((null==c?void 0:c.combobox)||c,"contentElement"),E=d||p?oe(j,"menuitem"):void 0,P=n.useState("contentElement");return s=b(v({id:k,role:E,"aria-haspopup":re(P,"menu")},s),{ref:Ee(l,s.ref),onFocus:g,onKeyDown:_,onClick:C}),s=_r(b(v({store:n,focusable:r,accessibleWhenDisabled:o},s),{showOnHover:e=>{if(!(()=>{if("function"==typeof i)return i(e);if(null!=i)return i;if(d)return!0;if(!u)return!1;const{items:t}=u.getState();return p&&u$(t)})())return!1;const t=p?u:c;return!t||(t.setActiveId(e.currentTarget.id),!0)}})),s=VT(v({store:n,toggleOnClick:!d,focusable:r,accessibleWhenDisabled:o},s)),s=Hn(v({store:n,typeahead:p},s))})),p$=St((function(e){return kt("button",d$(e))}));const f$=(0,c.forwardRef)((function({children:e,disabled:t=!1,...n},r){const o=(0,c.useContext)(QB);if(!o?.store)throw new Error("Menu.TriggerButton can only be rendered inside a Menu component");if(o.store.parent)throw new Error("Menu.TriggerButton should not be rendered inside a nested Menu component. Use Menu.SubmenuTriggerItem instead.");return(0,_t.jsx)(p$,{ref:r,...n,disabled:t,store:o.store,children:e})})),h$=(0,_t.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_t.jsx)(n.Path,{d:"M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z"})}),m$=(0,c.forwardRef)((function({suffix:e,...t},n){const r=(0,c.useContext)(QB);if(!r?.store.parent)throw new Error("Menu.SubmenuTriggerItem can only be rendered inside a nested Menu component");return(0,_t.jsx)(p$,{ref:n,accessibleWhenDisabled:!0,store:r.store,render:(0,_t.jsx)(JV,{...t,store:r.store.parent,suffix:(0,_t.jsxs)(_t.Fragment,{children:[e,(0,_t.jsx)(XV,{"aria-hidden":"true",icon:h$,size:24,preserveAspectRatio:"xMidYMid slice"})]})})})}));var g$=jt((function(e){var t=e,{store:n,alwaysVisible:r,composite:o}=t,i=x(t,["store","alwaysVisible","composite"]);const s=HB();D(n=n||s,!1);const a=n.parent,l=n.menubar,c=!!a,u=Pe(i.id),d=i.onKeyDown,p=n.useState((e=>e.placement.split("-")[0])),f=n.useState((e=>"both"===e.orientation?void 0:e.orientation)),h="vertical"!==f,m=et(l,(e=>!!e&&"vertical"!==e.orientation)),g=ke((e=>{if(null==d||d(e),!e.defaultPrevented){if(c||l&&!h){const t={ArrowRight:()=>"left"===p&&!h,ArrowLeft:()=>"right"===p&&!h,ArrowUp:()=>"bottom"===p&&h,ArrowDown:()=>"top"===p&&h}[e.key];if(null==t?void 0:t())return e.stopPropagation(),e.preventDefault(),null==n?void 0:n.hide()}if(l){const t={ArrowRight:()=>{if(m)return l.next()},ArrowLeft:()=>{if(m)return l.previous()},ArrowDown:()=>{if(!m)return l.next()},ArrowUp:()=>{if(!m)return l.previous()}}[e.key],n=null==t?void 0:t();void 0!==n&&(e.stopPropagation(),e.preventDefault(),l.move(n))}}}));i=Me(i,(e=>(0,_t.jsx)(UB,{value:n,children:e})),[n]);const y=function(e){var t=e,{store:n}=t,r=x(t,["store"]);const[o,i]=(0,B.useState)(void 0),s=r["aria-label"],a=et(n,"disclosureElement"),l=et(n,"contentElement");return(0,B.useEffect)((()=>{const e=a;e&&l&&(s||l.hasAttribute("aria-label")?i(void 0):e.id&&i(e.id))}),[s,a,l]),o}(v({store:n},i)),w=Xr(n.useState("mounted"),i.hidden,r),_=w?b(v({},i.style),{display:"none"}):i.style;i=b(v({id:u,"aria-labelledby":y,hidden:w},i),{ref:Ee(u?n.setContentElement:null,i.ref),style:_,onKeyDown:g});const S=!!n.combobox;return(o=null!=o?o:!S)&&(i=v({role:"menu","aria-orientation":f},i)),i=cn(v({store:n,composite:o},i)),i=Hn(v({store:n,typeahead:!S},i))})),v$=(St((function(e){return kt("div",g$(e))})),jt((function(e){var t=e,{store:n,modal:r=!1,portal:o=!!r,hideOnEscape:i=!0,autoFocusOnShow:s=!0,hideOnHoverOutside:a,alwaysVisible:l}=t,c=x(t,["store","modal","portal","hideOnEscape","autoFocusOnShow","hideOnHoverOutside","alwaysVisible"]);const u=HB();D(n=n||u,!1);const d=(0,B.useRef)(null),p=n.parent,f=n.menubar,h=!!p,m=!!f&&!h;c=b(v({},c),{ref:Ee(d,c.ref)});const g=g$(v({store:n,alwaysVisible:l},c)),{"aria-labelledby":y}=g;c=x(g,["aria-labelledby"]);const[w,_]=(0,B.useState)(),S=n.useState("autoFocusOnShow"),C=n.useState("initialFocus"),k=n.useState("baseElement"),j=n.useState("renderedItems");(0,B.useEffect)((()=>{let e=!1;return _((t=>{var n,r,o;if(e)return;if(!S)return;if(null==(n=null==t?void 0:t.current)?void 0:n.isConnected)return t;const i=(0,B.createRef)();switch(C){case"first":i.current=(null==(r=j.find((e=>!e.disabled&&e.element)))?void 0:r.element)||null;break;case"last":i.current=(null==(o=[...j].reverse().find((e=>!e.disabled&&e.element)))?void 0:o.element)||null;break;default:i.current=k}return i})),()=>{e=!0}}),[n,S,C,j,k]);const E=!h&&r,P=!!s,N=!!w||!!c.initialFocus||!!E,T=et(n.combobox||n,"contentElement"),I=et((null==p?void 0:p.combobox)||p,"contentElement"),R=(0,B.useMemo)((()=>{if(!I)return;if(!T)return;const e=T.getAttribute("role"),t=I.getAttribute("role");return"menu"!==t&&"menubar"!==t||"menu"!==e?I:void 0}),[T,I]);return void 0!==R&&(c=v({preserveTabOrderAnchor:R},c)),c=Gi(b(v({store:n,alwaysVisible:l,initialFocus:w,autoFocusOnShow:P?N&&s:S||!!E},c),{hideOnEscape:e=>!z(i,e)&&(null==n||n.hideAll(),!0),hideOnHoverOutside(e){const t=null==n?void 0:n.getState().disclosureElement;return!!("function"==typeof a?a(e):null!=a?a:h||m&&(!t||!Kt(t)))&&(!!e.defaultPrevented||(!h||(!t||(function(e,t,n){const r=new Event(t,n);e.dispatchEvent(r)}(t,"mouseout",e),!Kt(t)||(requestAnimationFrame((()=>{Kt(t)||null==n||n.hide()})),!1)))))},modal:E,portal:o,backdrop:!h&&c.backdrop})),c=v({"aria-labelledby":y},c)}))),b$=_o(St((function(e){return kt("div",v$(e))})),HB);const x$=(0,c.forwardRef)((function({gutter:e,children:t,shift:n,modal:r=!0,...o},i){const s=(0,c.useContext)(QB),a=et(s?.store,"currentPlacement")?.split("-")[0],l=(0,c.useCallback)((e=>(e.preventDefault(),!0)),[]),u=et(s?.store,"rtl")?"rtl":"ltr",d=(0,c.useMemo)((()=>({dir:u,style:{direction:u}})),[u]);if(!s?.store)throw new Error("Menu.Popover can only be rendered inside a Menu component");return(0,_t.jsx)(b$,{...o,ref:i,modal:r,store:s.store,gutter:null!=e?e:s.store.parent?0:8,shift:null!=n?n:s.store.parent?-4:0,hideOnHoverOutside:!1,"data-side":a,wrapperProps:d,hideOnEscape:l,unmountOnHide:!0,render:e=>(0,_t.jsx)(OV,{variant:s.variant,children:(0,_t.jsx)(LV,{...e})}),children:t})})),y$=Object.assign(ll((e=>{const{children:t,defaultOpen:n=!1,open:r,onOpenChange:o,placement:i,variant:s}=sl(e,"Menu"),l=(0,c.useContext)(QB),u=(0,a.isRTL)();let d=null!=i?i:l?.store?"right-start":"bottom-start";u&&(/right/.test(d)?d=d.replace("right","left"):/left/.test(d)&&(d=d.replace("left","right")));const p=ZB({parent:l?.store,open:r,defaultOpen:n,placement:d,focusLoop:!0,setOpen(e){o?.(e)},rtl:u}),f=(0,c.useMemo)((()=>({store:p,variant:s})),[p,s]);return(0,_t.jsx)(QB.Provider,{value:f,children:t})}),"Menu"),{Context:Object.assign(QB,{displayName:"Menu.Context"}),Item:Object.assign(JV,{displayName:"Menu.Item"}),RadioItem:Object.assign(o$,{displayName:"Menu.RadioItem"}),CheckboxItem:Object.assign(n$,{displayName:"Menu.CheckboxItem"}),Group:Object.assign(i$,{displayName:"Menu.Group"}),GroupLabel:Object.assign(s$,{displayName:"Menu.GroupLabel"}),Separator:Object.assign(a$,{displayName:"Menu.Separator"}),ItemLabel:Object.assign(l$,{displayName:"Menu.ItemLabel"}),ItemHelpText:Object.assign(c$,{displayName:"Menu.ItemHelpText"}),Popover:Object.assign(x$,{displayName:"Menu.Popover"}),TriggerButton:Object.assign(f$,{displayName:"Menu.TriggerButton"}),SubmenuTriggerItem:Object.assign(m$,{displayName:"Menu.SubmenuTriggerItem"})});const w$=yl("div",{target:"e1krjpvb0"})({name:"1a3idx0",styles:"color:var( --wp-components-color-foreground, currentColor )"});function _$(e){!function(e){for(const[t,n]of Object.entries(e))void 0!==n&&yv(n).isValid()}(e);const t={...S$(e.accent),...C$(e.background)};return function(e){for(const t of Object.values(e));}(function(e,t){const n=e.background||zl.white,r=e.accent||"#3858e9",o=t.foreground||zl.gray[900],i=t.gray||zl.gray;return{accent:yv(n).isReadable(r)?void 0:`The background color ("${n}") does not have sufficient contrast against the accent color ("${r}").`,foreground:yv(n).isReadable(o)?void 0:`The background color provided ("${n}") does not have sufficient contrast against the standard foreground colors.`,grays:yv(n).contrast(i[600])>=3&&yv(n).contrast(i[700])>=4.5?void 0:`The background color provided ("${n}") cannot generate a set of grayscale foreground colors with sufficient contrast. Try adjusting the color to be lighter or darker.`}}(e,t)),{colors:t}}function S$(e){return e?{accent:e,accentDarker10:yv(e).darken(.1).toHex(),accentDarker20:yv(e).darken(.2).toHex(),accentInverted:k$(e)}:{}}function C$(e){if(!e)return{};const t=k$(e);return{background:e,foreground:t,foregroundInverted:k$(t),gray:j$(e,t)}}function k$(e){return yv(e).isDark()?zl.white:zl.gray[900]}function j$(e,t){const n=yv(e).isDark()?"lighten":"darken",r=Math.abs(yv(e).toHsl().l-yv(t).toHsl().l)/100,o={};return Object.entries({100:.06,200:.121,300:.132,400:.2,600:.42,700:.543,800:.821}).forEach((([t,i])=>{o[parseInt(t)]=yv(e)[n](i/.884*r).toHex()})),o}_v([Sv,$_]);const E$=function({accent:e,background:t,className:n,...r}){const o=il(),i=(0,c.useMemo)((()=>o(...(({colors:e})=>{const t=Object.entries(e.gray||{}).map((([e,t])=>`--wp-components-color-gray-${e}: ${t};`)).join("");return[Nl("--wp-components-color-accent:",e.accent,";--wp-components-color-accent-darker-10:",e.accentDarker10,";--wp-components-color-accent-darker-20:",e.accentDarker20,";--wp-components-color-accent-inverted:",e.accentInverted,";--wp-components-color-background:",e.background,";--wp-components-color-foreground:",e.foreground,";--wp-components-color-foreground-inverted:",e.foregroundInverted,";",t,";","")]})(_$({accent:e,background:t})),n)),[e,t,n,o]);return(0,_t.jsx)(w$,{className:i,...r})},P$=(0,c.createContext)(void 0),N$=()=>(0,c.useContext)(P$);const T$=yl(ZL,{target:"enfox0g4"})("display:flex;align-items:stretch;overflow-x:auto;&[aria-orientation='vertical']{flex-direction:column;}:where( [aria-orientation='horizontal'] ){width:fit-content;}--direction-factor:1;--direction-start:left;--direction-end:right;--selected-start:var( --selected-left, 0 );&:dir( rtl ){--direction-factor:-1;--direction-start:right;--direction-end:left;--selected-start:var( --selected-right, 0 );}@media not ( prefers-reduced-motion ){&[data-indicator-animated]::before{transition-property:transform,border-radius,border-block;transition-duration:0.2s;transition-timing-function:ease-out;}}position:relative;&::before{content:'';position:absolute;pointer-events:none;transform-origin:var( --direction-start ) top;outline:2px solid transparent;outline-offset:-1px;}--antialiasing-factor:100;&[aria-orientation='horizontal']{--fade-width:4rem;--fade-gradient-base:transparent 0%,black var( --fade-width );--fade-gradient-composed:var( --fade-gradient-base ),black 60%,transparent 50%;&.is-overflowing-first{mask-image:linear-gradient(\n\t\t\t\tto var( --direction-end ),\n\t\t\t\tvar( --fade-gradient-base )\n\t\t\t);}&.is-overflowing-last{mask-image:linear-gradient(\n\t\t\t\tto var( --direction-start ),\n\t\t\t\tvar( --fade-gradient-base )\n\t\t\t);}&.is-overflowing-first.is-overflowing-last{mask-image:linear-gradient(\n\t\t\t\t\tto right,\n\t\t\t\t\tvar( --fade-gradient-composed )\n\t\t\t\t),linear-gradient( to left, var( --fade-gradient-composed ) );}&::before{bottom:0;height:0;width:calc( var( --antialiasing-factor ) * 1px );transform:translateX(\n\t\t\t\t\tcalc(\n\t\t\t\t\t\tvar( --selected-start ) * var( --direction-factor ) *\n\t\t\t\t\t\t\t1px\n\t\t\t\t\t)\n\t\t\t\t) scaleX(\n\t\t\t\t\tcalc(\n\t\t\t\t\t\tvar( --selected-width, 0 ) /\n\t\t\t\t\t\t\tvar( --antialiasing-factor )\n\t\t\t\t\t)\n\t\t\t\t);border-bottom:var( --wp-admin-border-width-focus ) solid ",zl.theme.accent,";}}&[aria-orientation='vertical']{&::before{border-radius:",Fl.radiusSmall,"/calc(\n\t\t\t\t\t",Fl.radiusSmall," /\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\tvar( --selected-height, 0 ) /\n\t\t\t\t\t\t\t\tvar( --antialiasing-factor )\n\t\t\t\t\t\t)\n\t\t\t\t);top:0;left:0;width:100%;height:calc( var( --antialiasing-factor ) * 1px );transform:translateY( calc( var( --selected-top, 0 ) * 1px ) ) scaleY(\n\t\t\t\t\tcalc(\n\t\t\t\t\t\tvar( --selected-height, 0 ) /\n\t\t\t\t\t\t\tvar( --antialiasing-factor )\n\t\t\t\t\t)\n\t\t\t\t);background-color:color-mix(\n\t\t\t\tin srgb,\n\t\t\t\t",zl.theme.accent,",\n\t\t\t\ttransparent 96%\n\t\t\t);}&[data-select-on-move='true']:has(\n\t\t\t\t:is( :focus-visible, [data-focus-visible] )\n\t\t\t)::before{box-sizing:border-box;border:var( --wp-admin-border-width-focus ) solid ",zl.theme.accent,";border-block-width:calc(\n\t\t\t\tvar( --wp-admin-border-width-focus, 1px ) /\n\t\t\t\t\t(\n\t\t\t\t\t\tvar( --selected-height, 0 ) /\n\t\t\t\t\t\t\tvar( --antialiasing-factor )\n\t\t\t\t\t)\n\t\t\t);}}"),I$=yl(JL,{target:"enfox0g3"})("&{border-radius:0;background:transparent;border:none;box-shadow:none;flex:1 0 auto;white-space:nowrap;display:flex;align-items:center;cursor:pointer;line-height:1.2;font-weight:400;color:",zl.theme.foreground,";position:relative;&[aria-disabled='true']{cursor:default;color:",zl.ui.textDisabled,";}&:not( [aria-disabled='true'] ):is( :hover, [data-focus-visible] ){color:",zl.theme.accent,";}&:focus:not( :disabled ){box-shadow:none;outline:none;}&::after{position:absolute;pointer-events:none;outline:var( --wp-admin-border-width-focus ) solid ",zl.theme.accent,";border-radius:",Fl.radiusSmall,";opacity:0;@media not ( prefers-reduced-motion ){transition:opacity 0.1s linear;}}&[data-focus-visible]::after{opacity:1;}}[aria-orientation='horizontal'] &{padding-inline:",Il(4),";height:",Il(12),";scroll-margin:24px;&::after{content:'';inset:",Il(3),";}}[aria-orientation='vertical'] &{padding:",Il(2)," ",Il(3),";min-height:",Il(10),";&[aria-selected='true']{color:",zl.theme.accent,";fill:currentColor;}}[aria-orientation='vertical'][data-select-on-move='false'] &::after{content:'';inset:var( --wp-admin-border-width-focus );}"),R$=yl("span",{target:"enfox0g2"})({name:"9at4z3",styles:"flex-grow:1;display:flex;align-items:center;[aria-orientation='horizontal'] &{justify-content:center;}[aria-orientation='vertical'] &{justify-content:start;}"}),M$=yl(Xx,{target:"enfox0g1"})("flex-shrink:0;margin-inline-end:",Il(-1),";[aria-orientation='horizontal'] &{display:none;}opacity:0;[role='tab']:is( [aria-selected='true'], [data-focus-visible], :hover ) &{opacity:1;}@media not ( prefers-reduced-motion ){[data-select-on-move='true'] [role='tab']:is( [aria-selected='true'], ) &{transition:opacity 0.15s 0.15s linear;}}&:dir( rtl ){rotate:180deg;}"),A$=yl(tF,{target:"enfox0g0"})("&:focus{box-shadow:none;outline:none;}&[data-focus-visible]{box-shadow:0 0 0 var( --wp-admin-border-width-focus ) ",zl.theme.accent,";outline:2px solid transparent;outline-offset:0;}"),D$=(0,c.forwardRef)((function({children:e,tabId:t,disabled:n,render:r,...o},i){var s;const{store:a,instanceId:l}=null!==(s=N$())&&void 0!==s?s:{};if(!a)return null;const c=`${l}-${t}`;return(0,_t.jsxs)(I$,{ref:i,store:a,id:c,disabled:n,render:r,...o,children:[(0,_t.jsx)(R$,{children:e}),(0,_t.jsx)(M$,{icon:BD})]})}));const z$=(0,c.forwardRef)((function({children:e,...t},n){var r;const{store:o}=null!==(r=N$())&&void 0!==r?r:{},i=et(o,"selectedId"),a=et(o,"activeId"),u=et(o,"selectOnMove"),d=et(o,"items"),[p,f]=(0,c.useState)(),h=(0,l.useMergeRefs)([n,f]),m=o?.item(i),g=et(o,"renderedItems"),v=g&&m?g.indexOf(m):-1,b=g_(m?.element,[v]),x=function(e,t){const[n,r]=(0,c.useState)(!1),[o,i]=(0,c.useState)(!1),[s,a]=(0,c.useState)(),u=(0,l.useEvent)((e=>{for(const n of e)n.target===t.first&&r(!n.isIntersecting),n.target===t.last&&i(!n.isIntersecting)}));return(0,c.useEffect)((()=>{if(!e||!window.IntersectionObserver)return;const t=new IntersectionObserver(u,{root:e,threshold:.9});return a(t),()=>t.disconnect()}),[u,e]),(0,c.useEffect)((()=>{if(s)return t.first&&s.observe(t.first),t.last&&s.observe(t.last),()=>{t.first&&s.unobserve(t.first),t.last&&s.unobserve(t.last)}}),[t.first,t.last,s]),{first:n,last:o}}(p,{first:d?.at(0)?.element,last:d?.at(-1)?.element});v_(p,b,{prefix:"selected",dataAttribute:"indicator-animated",transitionEndFilter:e=>"::before"===e.pseudoElement,roundRect:!0}),function(e,t,{margin:n=24}={}){(0,c.useLayoutEffect)((()=>{if(!e||!t)return;const{scrollLeft:r}=e,o=e.getBoundingClientRect().width,{left:i,width:s}=t,a=i+s+n-(r+o),l=r-(i-n);let c=null;l>0?c=r-l:a>0&&(c=r+a),null!==c&&e.scroll?.({left:c})}),[n,e,t])}(p,b);return o?(0,_t.jsx)(T$,{ref:h,store:o,render:e=>{var t;return(0,_t.jsx)("div",{...e,tabIndex:null!==(t=e.tabIndex)&&void 0!==t?t:-1})},onBlur:()=>{u&&i!==a&&o?.setActiveId(i)},"data-select-on-move":u?"true":"false",...t,className:s(x.first&&"is-overflowing-first",x.last&&"is-overflowing-last",t.className),children:e}):null})),O$=(0,c.forwardRef)((function({children:e,tabId:t,focusable:n=!0,...r},o){const i=N$(),s=et(i?.store,"selectedId");if(!i)return null;const{store:a,instanceId:l}=i,c=`${l}-${t}`;return(0,_t.jsx)(A$,{ref:o,store:a,id:`${c}-view`,tabId:c,focusable:n,...r,children:s===c&&e})}));function L$(e,t){return e&&`${t}-${e}`}function F$(e,t){return"string"==typeof e?e.replace(`${t}-`,""):e}const B$=Object.assign((function e({selectOnMove:t=!0,defaultTabId:n,orientation:r="horizontal",onSelect:o,children:i,selectedTabId:s,activeTabId:u,defaultActiveTabId:d,onActiveTabIdChange:p}){const f=(0,l.useInstanceId)(e,"tabs"),h=UL({selectOnMove:t,orientation:r,defaultSelectedId:L$(n,f),setSelectedId:e=>{o?.(F$(e,f))},selectedId:L$(s,f),defaultActiveId:L$(d,f),setActiveId:e=>{p?.(F$(e,f))},activeId:L$(u,f),rtl:(0,a.isRTL)()}),{items:m,activeId:g}=et(h),{setActiveId:v}=h;(0,c.useEffect)((()=>{requestAnimationFrame((()=>{const e=m?.[0]?.element?.ownerDocument.activeElement;e&&m.some((t=>e===t.element))&&g!==e.id&&v(e.id)}))}),[g,m,v]);const b=(0,c.useMemo)((()=>({store:h,instanceId:f})),[h,f]);return(0,_t.jsx)(P$.Provider,{value:b,children:i})}),{Tab:Object.assign(D$,{displayName:"Tabs.Tab"}),TabList:Object.assign(z$,{displayName:"Tabs.TabList"}),TabPanel:Object.assign(O$,{displayName:"Tabs.TabPanel"}),Context:Object.assign(P$,{displayName:"Tabs.Context"})}),V$=window.wp.privateApis,{lock:$$,unlock:H$}=(0,V$.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/components"),W$=(0,_t.jsx)(n.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,_t.jsx)(n.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M5.5 12a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0ZM12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm.75 4v1.5h-1.5V8h1.5Zm0 8v-5h-1.5v5h1.5Z"})}),U$=(0,_t.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_t.jsx)(n.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm11.53-1.47-1.06-1.06L11 12.94l-1.47-1.47-1.06 1.06L11 15.06l4.53-4.53Z"})}),G$=(0,_t.jsx)(n.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,_t.jsx)(n.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M5.5 12a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0ZM12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm-.75 12v-1.5h1.5V16h-1.5Zm0-8v5h1.5V8h-1.5Z"})}),K$=(0,_t.jsx)(n.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,_t.jsx)(n.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12.218 5.377a.25.25 0 0 0-.436 0l-7.29 12.96a.25.25 0 0 0 .218.373h14.58a.25.25 0 0 0 .218-.372l-7.29-12.96Zm-1.743-.735c.669-1.19 2.381-1.19 3.05 0l7.29 12.96a1.75 1.75 0 0 1-1.525 2.608H4.71a1.75 1.75 0 0 1-1.525-2.608l7.29-12.96ZM12.75 17.46h-1.5v-1.5h1.5v1.5Zm-1.5-3h1.5v-5h-1.5v5Z"})});const q$=function({className:e,intent:t="default",children:n,...r}){const o=function(e="default"){switch(e){case"info":return W$;case"success":return U$;case"warning":return G$;case"error":return K$;default:return null}}(t),i=!!o;return(0,_t.jsxs)("span",{className:s("components-badge",e,{[`is-${t}`]:t,"has-icon":i}),...r,children:[i&&(0,_t.jsx)(Xx,{icon:o,size:16,fill:"currentColor",className:"components-badge__icon"}),(0,_t.jsx)("span",{className:"components-badge__content",children:n})]})},Y$={};$$(Y$,{__experimentalPopoverLegacyPositionToPlacement:Ji,ComponentsContext:hs,Tabs:B$,Theme:E$,Menu:y$,kebabCase:Ty,Badge:q$})})(),(window.wp=window.wp||{}).components=i})(); \ No newline at end of file diff --git a/wp-includes/js/dist/compose.js b/wp-includes/js/dist/compose.js index 42289fe810..ec3f1dd82d 100644 --- a/wp-includes/js/dist/compose.js +++ b/wp-includes/js/dist/compose.js @@ -1,189 +1,6 @@ /******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ({ -/***/ 6689: -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ createUndoManager: () => (/* binding */ createUndoManager) -/* harmony export */ }); -/* harmony import */ var _wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(923); -/* harmony import */ var _wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_0__); -/** - * WordPress dependencies - */ - - -/** @typedef {import('./types').HistoryRecord} HistoryRecord */ -/** @typedef {import('./types').HistoryChange} HistoryChange */ -/** @typedef {import('./types').HistoryChanges} HistoryChanges */ -/** @typedef {import('./types').UndoManager} UndoManager */ - -/** - * Merge changes for a single item into a record of changes. - * - * @param {Record< string, HistoryChange >} changes1 Previous changes - * @param {Record< string, HistoryChange >} changes2 NextChanges - * - * @return {Record< string, HistoryChange >} Merged changes - */ -function mergeHistoryChanges(changes1, changes2) { - /** - * @type {Record< string, HistoryChange >} - */ - const newChanges = { - ...changes1 - }; - Object.entries(changes2).forEach(([key, value]) => { - if (newChanges[key]) { - newChanges[key] = { - ...newChanges[key], - to: value.to - }; - } else { - newChanges[key] = value; - } - }); - return newChanges; -} - -/** - * Adds history changes for a single item into a record of changes. - * - * @param {HistoryRecord} record The record to merge into. - * @param {HistoryChanges} changes The changes to merge. - */ -const addHistoryChangesIntoRecord = (record, changes) => { - const existingChangesIndex = record?.findIndex(({ - id: recordIdentifier - }) => { - return typeof recordIdentifier === 'string' ? recordIdentifier === changes.id : _wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_0___default()(recordIdentifier, changes.id); - }); - const nextRecord = [...record]; - if (existingChangesIndex !== -1) { - // If the edit is already in the stack leave the initial "from" value. - nextRecord[existingChangesIndex] = { - id: changes.id, - changes: mergeHistoryChanges(nextRecord[existingChangesIndex].changes, changes.changes) - }; - } else { - nextRecord.push(changes); - } - return nextRecord; -}; - -/** - * Creates an undo manager. - * - * @return {UndoManager} Undo manager. - */ -function createUndoManager() { - /** - * @type {HistoryRecord[]} - */ - let history = []; - /** - * @type {HistoryRecord} - */ - let stagedRecord = []; - /** - * @type {number} - */ - let offset = 0; - const dropPendingRedos = () => { - history = history.slice(0, offset || undefined); - offset = 0; - }; - const appendStagedRecordToLatestHistoryRecord = () => { - var _history$index; - const index = history.length === 0 ? 0 : history.length - 1; - let latestRecord = (_history$index = history[index]) !== null && _history$index !== void 0 ? _history$index : []; - stagedRecord.forEach(changes => { - latestRecord = addHistoryChangesIntoRecord(latestRecord, changes); - }); - stagedRecord = []; - history[index] = latestRecord; - }; - - /** - * Checks whether a record is empty. - * A record is considered empty if it the changes keep the same values. - * Also updates to function values are ignored. - * - * @param {HistoryRecord} record - * @return {boolean} Whether the record is empty. - */ - const isRecordEmpty = record => { - const filteredRecord = record.filter(({ - changes - }) => { - return Object.values(changes).some(({ - from, - to - }) => typeof from !== 'function' && typeof to !== 'function' && !_wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_0___default()(from, to)); - }); - return !filteredRecord.length; - }; - return { - /** - * Record changes into the history. - * - * @param {HistoryRecord=} record A record of changes to record. - * @param {boolean} isStaged Whether to immediately create an undo point or not. - */ - addRecord(record, isStaged = false) { - const isEmpty = !record || isRecordEmpty(record); - if (isStaged) { - if (isEmpty) { - return; - } - record.forEach(changes => { - stagedRecord = addHistoryChangesIntoRecord(stagedRecord, changes); - }); - } else { - dropPendingRedos(); - if (stagedRecord.length) { - appendStagedRecordToLatestHistoryRecord(); - } - if (isEmpty) { - return; - } - history.push(record); - } - }, - undo() { - if (stagedRecord.length) { - dropPendingRedos(); - appendStagedRecordToLatestHistoryRecord(); - } - const undoRecord = history[history.length - 1 + offset]; - if (!undoRecord) { - return; - } - offset -= 1; - return undoRecord; - }, - redo() { - const redoRecord = history[history.length + offset]; - if (!redoRecord) { - return; - } - offset += 1; - return redoRecord; - }, - hasUndo() { - return !!history[history.length - 1 + offset]; - }, - hasRedo() { - return !!history[history.length + offset]; - } - }; -} - - -/***/ }), - /***/ 3758: /***/ (function(module) { @@ -2192,14 +2009,6 @@ var __WEBPACK_AMD_DEFINE_RESULT__;/*global define:false */ }) (typeof Mousetrap !== "undefined" ? Mousetrap : undefined); -/***/ }), - -/***/ 923: -/***/ ((module) => { - -"use strict"; -module.exports = window["wp"]["isShallowEqual"]; - /***/ }) /******/ }); @@ -2589,10 +2398,19 @@ var __setModuleDefault = Object.create ? (function(o, v) { o["default"] = v; }; +var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); +}; + function __importStar(mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); __setModuleDefault(result, mod); return result; } @@ -2673,12 +2491,25 @@ function __disposeResources(env) { return next(); } +function __rewriteRelativeImportExtension(path, preserveJsx) { + if (typeof path === "string" && /^\.\.?\//.test(path)) { + return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) { + return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js"); + }); + } + return path; +} + /* harmony default export */ const tslib_es6 = ({ __extends, __assign, __rest, __decorate, __param, + __esDecorate, + __runInitializers, + __propKey, + __setFunctionName, __metadata, __awaiter, __generator, @@ -2701,6 +2532,7 @@ function __disposeResources(env) { __classPrivateFieldIn, __addDisposableResource, __disposeResources, + __rewriteRelativeImportExtension, }); ;// ./node_modules/lower-case/dist.es2015/index.js @@ -3176,6 +3008,7 @@ function observableMap() { } ;// ./node_modules/@wordpress/compose/build-module/higher-order/pipe.js +/* wp:polyfill */ /** * Parts of this source were derived and modified from lodash, * released under the MIT license. @@ -3304,9 +3137,9 @@ function ifCondition(predicate) { } /* harmony default export */ const if_condition = (ifCondition); -// EXTERNAL MODULE: external ["wp","isShallowEqual"] -var external_wp_isShallowEqual_ = __webpack_require__(923); -var external_wp_isShallowEqual_default = /*#__PURE__*/__webpack_require__.n(external_wp_isShallowEqual_); +;// external ["wp","isShallowEqual"] +const external_wp_isShallowEqual_namespaceObject = window["wp"]["isShallowEqual"]; +var external_wp_isShallowEqual_default = /*#__PURE__*/__webpack_require__.n(external_wp_isShallowEqual_namespaceObject); ;// external ["wp","element"] const external_wp_element_namespaceObject = window["wp"]["element"]; ;// ./node_modules/@wordpress/compose/build-module/higher-order/pure/index.js @@ -3357,6 +3190,7 @@ const pure = createHigherOrderComponent(function (WrappedComponent) { const external_wp_deprecated_namespaceObject = window["wp"]["deprecated"]; var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject); ;// ./node_modules/@wordpress/compose/build-module/higher-order/with-global-events/listener.js +/* wp:polyfill */ /** * Class responsible for orchestrating event handling on the global window, * binding a single event to be shared across all handling instances, and @@ -3368,7 +3202,7 @@ class Listener { this.listeners = {}; this.handleEvent = this.handleEvent.bind(this); } - add( /** @type {any} */eventType, /** @type {any} */instance) { + add(/** @type {any} */eventType, /** @type {any} */instance) { if (!this.listeners[eventType]) { // Adding first listener for this type, so bind event. window.addEventListener(eventType, this.handleEvent); @@ -3376,19 +3210,19 @@ class Listener { } this.listeners[eventType].push(instance); } - remove( /** @type {any} */eventType, /** @type {any} */instance) { + remove(/** @type {any} */eventType, /** @type {any} */instance) { if (!this.listeners[eventType]) { return; } - this.listeners[eventType] = this.listeners[eventType].filter(( /** @type {any} */listener) => listener !== instance); + this.listeners[eventType] = this.listeners[eventType].filter((/** @type {any} */listener) => listener !== instance); if (!this.listeners[eventType].length) { // Removing last listener for this type, so unbind event. window.removeEventListener(eventType, this.handleEvent); delete this.listeners[eventType]; } } - handleEvent( /** @type {any} */event) { - this.listeners[event.type]?.forEach(( /** @type {any} */instance) => { + handleEvent(/** @type {any} */event) { + this.listeners[event.type]?.forEach((/** @type {any} */instance) => { instance.handleEvent(event); }); } @@ -3396,6 +3230,7 @@ class Listener { /* harmony default export */ const listener = (Listener); ;// ./node_modules/@wordpress/compose/build-module/higher-order/with-global-events/index.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -3443,7 +3278,7 @@ function withGlobalEvents(eventTypesToHandlers) { // @ts-ignore We don't need to fix the type-related issues because this is deprecated. return createHigherOrderComponent(WrappedComponent => { class Wrapper extends external_wp_element_namespaceObject.Component { - constructor( /** @type {any} */props) { + constructor(/** @type {any} */props) { super(props); this.handleEvent = this.handleEvent.bind(this); this.handleRef = this.handleRef.bind(this); @@ -3458,8 +3293,8 @@ function withGlobalEvents(eventTypesToHandlers) { with_global_events_listener.remove(eventType, this); }); } - handleEvent( /** @type {any} */event) { - const handler = eventTypesToHandlers[( /** @type {keyof GlobalEventHandlersEventMap} */ + handleEvent(/** @type {any} */event) { + const handler = eventTypesToHandlers[(/** @type {keyof GlobalEventHandlersEventMap} */ event.type /* eslint-enable jsdoc/no-undefined-types */)]; @@ -3467,7 +3302,7 @@ function withGlobalEvents(eventTypesToHandlers) { this.wrappedRef[handler](event); } } - handleRef( /** @type {any} */el) { + handleRef(/** @type {any} */el) { this.wrappedRef = el; // Any component using `withGlobalEvents` that is not setting a `ref` // will cause `this.props.forwardedRef` to be `null`, so we need this @@ -3567,6 +3402,7 @@ const withInstanceId = createHigherOrderComponent(WrappedComponent => { /* harmony default export */ const with_instance_id = (withInstanceId); ;// ./node_modules/@wordpress/compose/build-module/higher-order/with-safe-timeout/index.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -3659,7 +3495,7 @@ function withState(initialState = {}) { }); return createHigherOrderComponent(OriginalComponent => { return class WrappedComponent extends external_wp_element_namespaceObject.Component { - constructor( /** @type {any} */props) { + constructor(/** @type {any} */props) { super(props); this.setState = this.setState.bind(this); this.state = initialState; @@ -3750,8 +3586,8 @@ function useRefEffect(callback, dependencies) { * ``` */ function useConstrainedTabbing() { - return useRefEffect(( /** @type {HTMLElement} */node) => { - function onKeyDown( /** @type {KeyboardEvent} */event) { + return useRefEffect((/** @type {HTMLElement} */node) => { + function onKeyDown(/** @type {KeyboardEvent} */event) { const { key, shiftKey, @@ -3761,7 +3597,7 @@ function useConstrainedTabbing() { return; } const action = shiftKey ? 'findPrevious' : 'findNext'; - const nextElement = external_wp_dom_namespaceObject.focus.tabbable[action]( /** @type {HTMLElement} */target) || null; + const nextElement = external_wp_dom_namespaceObject.focus.tabbable[action](/** @type {HTMLElement} */target) || null; // When the target element contains the element that is about to // receive focus, for example when the target is a tabbable @@ -3769,7 +3605,7 @@ function useConstrainedTabbing() { // In this case we can't rely on native browsers behavior. We need // to manage focus instead. // See https://github.com/WordPress/gutenberg/issues/46041. - if ( /** @type {HTMLElement} */target.contains(nextElement)) { + if (/** @type {HTMLElement} */target.contains(nextElement)) { event.preventDefault(); nextElement?.focus(); return; @@ -3908,7 +3744,9 @@ function useCopyOnClick(ref, text, timeout = 4000) { */ function useUpdatedRef(value) { const ref = (0,external_wp_element_namespaceObject.useRef)(value); - ref.current = value; + (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { + ref.current = value; + }, [value]); return ref; } @@ -3954,6 +3792,7 @@ function useCopyToClipboard(text, onSuccess) { ;// external ["wp","keycodes"] const external_wp_keycodes_namespaceObject = window["wp"]["keycodes"]; ;// ./node_modules/@wordpress/compose/build-module/hooks/use-focus-on-mount/index.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -4077,6 +3916,7 @@ function useFocusReturn(onFocusReturn) { }, [onFocusReturn]); return (0,external_wp_element_namespaceObject.useCallback)(node => { if (node) { + var _activeDocument$activ; // Set ref to be used when unmounting. ref.current = node; @@ -4084,7 +3924,8 @@ function useFocusReturn(onFocusReturn) { if (focusedBeforeMount.current) { return; } - focusedBeforeMount.current = node.ownerDocument.activeElement; + const activeDocument = node.ownerDocument.activeElement instanceof window.HTMLIFrameElement ? node.ownerDocument.activeElement.contentDocument : node.ownerDocument; + focusedBeforeMount.current = (_activeDocument$activ = activeDocument?.activeElement) !== null && _activeDocument$activ !== void 0 ? _activeDocument$activ : null; } else if (focusedBeforeMount.current) { const isFocused = ref.current?.contains(ref.current?.ownerDocument.activeElement); if (ref.current?.isConnected && !isFocused) { @@ -4262,6 +4103,7 @@ function useFocusOutside(onFocusOutside) { } ;// ./node_modules/@wordpress/compose/build-module/hooks/use-merge-refs/index.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -4456,6 +4298,7 @@ function useDialog(options) { /* harmony default export */ const use_dialog = (useDialog); ;// ./node_modules/@wordpress/compose/build-module/hooks/use-disabled/index.js +/* wp:polyfill */ /** * Internal dependencies */ @@ -4677,6 +4520,7 @@ var mousetrap_default = /*#__PURE__*/__webpack_require__.n(mousetrap_mousetrap); // EXTERNAL MODULE: ./node_modules/mousetrap/plugins/global-bind/mousetrap-global-bind.js var mousetrap_global_bind = __webpack_require__(5760); ;// ./node_modules/@wordpress/compose/build-module/hooks/use-keyboard-shortcut/index.js +/* wp:polyfill */ /** * External dependencies */ @@ -4710,7 +4554,7 @@ var mousetrap_global_bind = __webpack_require__(5760); * @param {(e: import('mousetrap').ExtendedKeyboardEvent, combo: string) => void} callback Shortcut callback. * @param {WPKeyboardShortcutConfig} options Shortcut options. */ -function useKeyboardShortcut( /* eslint-enable jsdoc/valid-types */ +function useKeyboardShortcut(/* eslint-enable jsdoc/valid-types */ shortcuts, callback, { bindGlobal = false, eventName = 'keydown', @@ -4748,7 +4592,7 @@ shortcuts, callback, { } const bindFn = bindGlobal ? 'bindGlobal' : 'bind'; // @ts-ignore `bindGlobal` is an undocumented property - mousetrap[bindFn](shortcut, ( /* eslint-disable jsdoc/valid-types */ + mousetrap[bindFn](shortcut, (/* eslint-disable jsdoc/valid-types */ /** @type {[e: import('mousetrap').ExtendedKeyboardEvent, combo: string]} */...args) => /* eslint-enable jsdoc/valid-types */ currentCallbackRef.current(...args), eventName); }); @@ -4859,8 +4703,179 @@ function usePrevious(value) { const useReducedMotion = () => useMediaQuery('(prefers-reduced-motion: reduce)'); /* harmony default export */ const use_reduced_motion = (useReducedMotion); -// EXTERNAL MODULE: ./node_modules/@wordpress/undo-manager/build-module/index.js -var build_module = __webpack_require__(6689); +;// ./node_modules/@wordpress/undo-manager/build-module/index.js +/* wp:polyfill */ +/** + * WordPress dependencies + */ + + +/** @typedef {import('./types').HistoryRecord} HistoryRecord */ +/** @typedef {import('./types').HistoryChange} HistoryChange */ +/** @typedef {import('./types').HistoryChanges} HistoryChanges */ +/** @typedef {import('./types').UndoManager} UndoManager */ + +/** + * Merge changes for a single item into a record of changes. + * + * @param {Record< string, HistoryChange >} changes1 Previous changes + * @param {Record< string, HistoryChange >} changes2 NextChanges + * + * @return {Record< string, HistoryChange >} Merged changes + */ +function mergeHistoryChanges(changes1, changes2) { + /** + * @type {Record< string, HistoryChange >} + */ + const newChanges = { + ...changes1 + }; + Object.entries(changes2).forEach(([key, value]) => { + if (newChanges[key]) { + newChanges[key] = { + ...newChanges[key], + to: value.to + }; + } else { + newChanges[key] = value; + } + }); + return newChanges; +} + +/** + * Adds history changes for a single item into a record of changes. + * + * @param {HistoryRecord} record The record to merge into. + * @param {HistoryChanges} changes The changes to merge. + */ +const addHistoryChangesIntoRecord = (record, changes) => { + const existingChangesIndex = record?.findIndex(({ + id: recordIdentifier + }) => { + return typeof recordIdentifier === 'string' ? recordIdentifier === changes.id : external_wp_isShallowEqual_default()(recordIdentifier, changes.id); + }); + const nextRecord = [...record]; + if (existingChangesIndex !== -1) { + // If the edit is already in the stack leave the initial "from" value. + nextRecord[existingChangesIndex] = { + id: changes.id, + changes: mergeHistoryChanges(nextRecord[existingChangesIndex].changes, changes.changes) + }; + } else { + nextRecord.push(changes); + } + return nextRecord; +}; + +/** + * Creates an undo manager. + * + * @return {UndoManager} Undo manager. + */ +function createUndoManager() { + /** + * @type {HistoryRecord[]} + */ + let history = []; + /** + * @type {HistoryRecord} + */ + let stagedRecord = []; + /** + * @type {number} + */ + let offset = 0; + const dropPendingRedos = () => { + history = history.slice(0, offset || undefined); + offset = 0; + }; + const appendStagedRecordToLatestHistoryRecord = () => { + var _history$index; + const index = history.length === 0 ? 0 : history.length - 1; + let latestRecord = (_history$index = history[index]) !== null && _history$index !== void 0 ? _history$index : []; + stagedRecord.forEach(changes => { + latestRecord = addHistoryChangesIntoRecord(latestRecord, changes); + }); + stagedRecord = []; + history[index] = latestRecord; + }; + + /** + * Checks whether a record is empty. + * A record is considered empty if it the changes keep the same values. + * Also updates to function values are ignored. + * + * @param {HistoryRecord} record + * @return {boolean} Whether the record is empty. + */ + const isRecordEmpty = record => { + const filteredRecord = record.filter(({ + changes + }) => { + return Object.values(changes).some(({ + from, + to + }) => typeof from !== 'function' && typeof to !== 'function' && !external_wp_isShallowEqual_default()(from, to)); + }); + return !filteredRecord.length; + }; + return { + /** + * Record changes into the history. + * + * @param {HistoryRecord=} record A record of changes to record. + * @param {boolean} isStaged Whether to immediately create an undo point or not. + */ + addRecord(record, isStaged = false) { + const isEmpty = !record || isRecordEmpty(record); + if (isStaged) { + if (isEmpty) { + return; + } + record.forEach(changes => { + stagedRecord = addHistoryChangesIntoRecord(stagedRecord, changes); + }); + } else { + dropPendingRedos(); + if (stagedRecord.length) { + appendStagedRecordToLatestHistoryRecord(); + } + if (isEmpty) { + return; + } + history.push(record); + } + }, + undo() { + if (stagedRecord.length) { + dropPendingRedos(); + appendStagedRecordToLatestHistoryRecord(); + } + const undoRecord = history[history.length - 1 + offset]; + if (!undoRecord) { + return; + } + offset -= 1; + return undoRecord; + }, + redo() { + const redoRecord = history[history.length + offset]; + if (!redoRecord) { + return; + } + offset += 1; + return redoRecord; + }, + hasUndo() { + return !!history[history.length - 1 + offset]; + }, + hasRedo() { + return !!history[history.length + offset]; + } + }; +} + ;// ./node_modules/@wordpress/compose/build-module/hooks/use-state-with-history/index.js /** * WordPress dependencies @@ -4912,7 +4927,7 @@ function undoRedoReducer(state, action) { } function initReducer(value) { return { - manager: (0,build_module.createUndoManager)(), + manager: createUndoManager(), value }; } @@ -5005,7 +5020,7 @@ const OPERATOR_EVALUATORS = { '>=': (breakpointValue, width) => width >= breakpointValue, '<': (breakpointValue, width) => width < breakpointValue }; -const ViewportMatchWidthContext = (0,external_wp_element_namespaceObject.createContext)( /** @type {null | number} */null); +const ViewportMatchWidthContext = (0,external_wp_element_namespaceObject.createContext)(/** @type {null | number} */null); /** * Returns true if the viewport matches the given query, or false otherwise. @@ -5079,6 +5094,7 @@ function useResizeObserver(callback, resizeObserverOptions = {}) { } ;// ./node_modules/@wordpress/compose/build-module/hooks/use-resize-observer/legacy/index.js +/* wp:polyfill */ /** * External dependencies */ @@ -5286,7 +5302,7 @@ const external_wp_priorityQueue_namespaceObject = window["wp"]["priorityQueue"]; * * @param list New array. * @param state Current state. - * @return First items present iin state. + * @return First items present in state. */ function getFirstItemsPresentInState(list, state) { const firstItems = []; @@ -5338,12 +5354,13 @@ function useAsyncList(list, config = { /* harmony default export */ const use_async_list = (useAsyncList); ;// ./node_modules/@wordpress/compose/build-module/hooks/use-warn-on-change/index.js +/* wp:polyfill */ /** * Internal dependencies */ -// Disable reason: Object and object are distinctly different types in TypeScript and we mean the lowercase object in thise case +// Disable reason: Object and object are distinctly different types in TypeScript and we mean the lowercase object in this case // but eslint wants to force us to use `Object`. See https://stackoverflow.com/questions/49464634/difference-between-object-and-object-in-typescript /* eslint-disable jsdoc/check-types */ /** @@ -5367,9 +5384,9 @@ function useAsyncList(list, config = { function useWarnOnChange(object, prefix = 'Change detection') { const previousValues = usePrevious(object); Object.entries(previousValues !== null && previousValues !== void 0 ? previousValues : []).forEach(([key, value]) => { - if (value !== object[( /** @type {keyof typeof object} */key)]) { + if (value !== object[(/** @type {keyof typeof object} */key)]) { // eslint-disable-next-line no-console - console.warn(`${prefix}: ${key} key changed:`, value, object[( /** @type {keyof typeof object} */key)] + console.warn(`${prefix}: ${key} key changed:`, value, object[(/** @type {keyof typeof object} */key)] /* eslint-enable jsdoc/check-types */); } }); @@ -5527,37 +5544,11 @@ function useThrottle(fn, wait, options) { } ;// ./node_modules/@wordpress/compose/build-module/hooks/use-drop-zone/index.js -/** - * WordPress dependencies - */ - - /** * Internal dependencies */ -/* eslint-disable jsdoc/valid-types */ -/** - * @template T - * @param {T} value - * @return {import('react').MutableRefObject} A ref with the value. - */ -function useFreshRef(value) { - /* eslint-enable jsdoc/valid-types */ - /* eslint-disable jsdoc/no-undefined-types */ - /** @type {import('react').MutableRefObject} */ - /* eslint-enable jsdoc/no-undefined-types */ - // Disable reason: We're doing something pretty JavaScript-y here where the - // ref will always have a current value that is not null or undefined but it - // needs to start as undefined. We don't want to change the return type so - // it's easier to just ts-ignore this specific line that's complaining about - // undefined not being part of T. - // @ts-ignore - const ref = (0,external_wp_element_namespaceObject.useRef)(); - ref.current = value; - return ref; -} /** * A hook to facilitate drag and drop handling. @@ -5584,12 +5575,12 @@ function useDropZone({ onDragEnd: _onDragEnd, onDragOver: _onDragOver }) { - const onDropRef = useFreshRef(_onDrop); - const onDragStartRef = useFreshRef(_onDragStart); - const onDragEnterRef = useFreshRef(_onDragEnter); - const onDragLeaveRef = useFreshRef(_onDragLeave); - const onDragEndRef = useFreshRef(_onDragEnd); - const onDragOverRef = useFreshRef(_onDragOver); + const onDropEvent = useEvent(_onDrop); + const onDragStartEvent = useEvent(_onDragStart); + const onDragEnterEvent = useEvent(_onDragEnter); + const onDragLeaveEvent = useEvent(_onDragLeave); + const onDragEndEvent = useEvent(_onDragEnd); + const onDragOverEvent = useEvent(_onDragOver); return useRefEffect(elem => { if (isDisabled) { return; @@ -5628,7 +5619,7 @@ function useDropZone({ } while (elementToCheck = elementToCheck.parentElement); return false; } - function maybeDragStart( /** @type {DragEvent} */event) { + function maybeDragStart(/** @type {DragEvent} */event) { if (isDragging) { return; } @@ -5640,35 +5631,35 @@ function useDropZone({ // node is removed. ownerDocument.addEventListener('dragend', maybeDragEnd); ownerDocument.addEventListener('mousemove', maybeDragEnd); - if (onDragStartRef.current) { - onDragStartRef.current(event); + if (_onDragStart) { + onDragStartEvent(event); } } - function onDragEnter( /** @type {DragEvent} */event) { + function onDragEnter(/** @type {DragEvent} */event) { event.preventDefault(); // The `dragenter` event will also fire when entering child // elements, but we only want to call `onDragEnter` when // entering the drop zone, which means the `relatedTarget` // (element that has been left) should be outside the drop zone. - if (element.contains( /** @type {Node} */event.relatedTarget)) { + if (element.contains(/** @type {Node} */event.relatedTarget)) { return; } - if (onDragEnterRef.current) { - onDragEnterRef.current(event); + if (_onDragEnter) { + onDragEnterEvent(event); } } - function onDragOver( /** @type {DragEvent} */event) { + function onDragOver(/** @type {DragEvent} */event) { // Only call onDragOver for the innermost hovered drop zones. - if (!event.defaultPrevented && onDragOverRef.current) { - onDragOverRef.current(event); + if (!event.defaultPrevented && _onDragOver) { + onDragOverEvent(event); } // Prevent the browser default while also signalling to parent // drop zones that `onDragOver` is already handled. event.preventDefault(); } - function onDragLeave( /** @type {DragEvent} */event) { + function onDragLeave(/** @type {DragEvent} */event) { // The `dragleave` event will also fire when leaving child // elements, but we only want to call `onDragLeave` when // leaving the drop zone, which means the `relatedTarget` @@ -5680,11 +5671,11 @@ function useDropZone({ if (isElementInZone(event.relatedTarget)) { return; } - if (onDragLeaveRef.current) { - onDragLeaveRef.current(event); + if (_onDragLeave) { + onDragLeaveEvent(event); } } - function onDrop( /** @type {DragEvent} */event) { + function onDrop(/** @type {DragEvent} */event) { // Don't handle drop if an inner drop zone already handled it. if (event.defaultPrevented) { return; @@ -5699,23 +5690,23 @@ function useDropZone({ // not recognized. // eslint-disable-next-line no-unused-expressions event.dataTransfer && event.dataTransfer.files.length; - if (onDropRef.current) { - onDropRef.current(event); + if (_onDrop) { + onDropEvent(event); } maybeDragEnd(event); } - function maybeDragEnd( /** @type {MouseEvent} */event) { + function maybeDragEnd(/** @type {MouseEvent} */event) { if (!isDragging) { return; } isDragging = false; ownerDocument.removeEventListener('dragend', maybeDragEnd); ownerDocument.removeEventListener('mousemove', maybeDragEnd); - if (onDragEndRef.current) { - onDragEndRef.current(event); + if (_onDragEnd) { + onDragEndEvent(event); } } - element.dataset.isDropZone = 'true'; + element.setAttribute('data-is-drop-zone', 'true'); element.addEventListener('drop', onDrop); element.addEventListener('dragenter', onDragEnter); element.addEventListener('dragover', onDragOver); @@ -5724,7 +5715,7 @@ function useDropZone({ // the document. ownerDocument.addEventListener('dragenter', maybeDragStart); return () => { - delete element.dataset.isDropZone; + element.removeAttribute('data-is-drop-zone'); element.removeEventListener('drop', onDrop); element.removeEventListener('dragenter', onDragEnter); element.removeEventListener('dragover', onDragOver); @@ -5832,7 +5823,7 @@ function useFixedWindowList(elementRef, itemHeight, totalItems, options) { visibleItems: initWindowSize, start: 0, end: initWindowSize, - itemInView: ( /** @type {number} */index) => { + itemInView: (/** @type {number} */index) => { return index >= 0 && index <= initWindowSize; } }); @@ -5841,7 +5832,7 @@ function useFixedWindowList(elementRef, itemHeight, totalItems, options) { return; } const scrollContainer = (0,external_wp_dom_namespaceObject.getScrollContainer)(elementRef.current); - const measureWindow = ( /** @type {boolean | undefined} */initRender) => { + const measureWindow = (/** @type {boolean | undefined} */initRender) => { var _options$windowOversc; if (!scrollContainer) { return; @@ -5857,7 +5848,7 @@ function useFixedWindowList(elementRef, itemHeight, totalItems, options) { visibleItems, start, end, - itemInView: ( /** @type {number} */index) => { + itemInView: (/** @type {number} */index) => { return start <= index && index <= end; } }; @@ -5884,7 +5875,7 @@ function useFixedWindowList(elementRef, itemHeight, totalItems, options) { return; } const scrollContainer = (0,external_wp_dom_namespaceObject.getScrollContainer)(elementRef.current); - const handleKeyDown = ( /** @type {KeyboardEvent} */event) => { + const handleKeyDown = (/** @type {KeyboardEvent} */event) => { switch (event.keyCode) { case external_wp_keycodes_namespaceObject.HOME: { diff --git a/wp-includes/js/dist/compose.min.js b/wp-includes/js/dist/compose.min.js index 8b65a5525a..6d9dc920ca 100644 --- a/wp-includes/js/dist/compose.min.js +++ b/wp-includes/js/dist/compose.min.js @@ -1,9 +1,9 @@ /*! This file is auto-generated */ -(()=>{var e={6689:(e,t,n)=>{"use strict";n.d(t,{createUndoManager:()=>c});var r=n(923),o=n.n(r);function u(e,t){const n={...e};return Object.entries(t).forEach((([e,t])=>{n[e]?n[e]={...n[e],to:t.to}:n[e]=t})),n}const i=(e,t)=>{const n=e?.findIndex((({id:e})=>"string"==typeof e?e===t.id:o()(e,t.id))),r=[...e];return-1!==n?r[n]={id:t.id,changes:u(r[n].changes,t.changes)}:r.push(t),r};function c(){let e=[],t=[],n=0;const r=()=>{e=e.slice(0,n||void 0),n=0},u=()=>{var n;const r=0===e.length?0:e.length-1;let o=null!==(n=e[r])&&void 0!==n?n:[];t.forEach((e=>{o=i(o,e)})),t=[],e[r]=o};return{addRecord(n,c=!1){const s=!n||(e=>!e.filter((({changes:e})=>Object.values(e).some((({from:e,to:t})=>"function"!=typeof e&&"function"!=typeof t&&!o()(e,t))))).length)(n);if(c){if(s)return;n.forEach((e=>{t=i(t,e)}))}else{if(r(),t.length&&u(),s)return;e.push(n)}},undo(){t.length&&(r(),u());const o=e[e.length-1+n];if(o)return n-=1,o},redo(){const t=e[e.length+n];if(t)return n+=1,t},hasUndo:()=>!!e[e.length-1+n],hasRedo:()=>!!e[e.length+n]}}},3758:function(e){ +(()=>{var e={3758:function(e){ /*! * clipboard.js v2.0.11 * https://clipboardjs.com/ * * Licensed MIT © Zeno Rocha */ -var t;t=function(){return function(){var e={686:function(e,t,n){"use strict";n.d(t,{default:function(){return S}});var r=n(279),o=n.n(r),u=n(370),i=n.n(u),c=n(817),s=n.n(c);function a(e){try{return document.execCommand(e)}catch(e){return!1}}var l=function(e){var t=s()(e);return a("cut"),t},f=function(e,t){var n=function(e){var t="rtl"===document.documentElement.getAttribute("dir"),n=document.createElement("textarea");n.style.fontSize="12pt",n.style.border="0",n.style.padding="0",n.style.margin="0",n.style.position="absolute",n.style[t?"right":"left"]="-9999px";var r=window.pageYOffset||document.documentElement.scrollTop;return n.style.top="".concat(r,"px"),n.setAttribute("readonly",""),n.value=e,n}(e);t.container.appendChild(n);var r=s()(n);return a("copy"),n.remove(),r},d=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{container:document.body},n="";return"string"==typeof e?n=f(e,t):e instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(null==e?void 0:e.type)?n=f(e.value,t):(n=s()(e),a("copy")),n};function p(e){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p(e)}var h=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.action,n=void 0===t?"copy":t,r=e.container,o=e.target,u=e.text;if("copy"!==n&&"cut"!==n)throw new Error('Invalid "action" value, use either "copy" or "cut"');if(void 0!==o){if(!o||"object"!==p(o)||1!==o.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===n&&o.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===n&&(o.hasAttribute("readonly")||o.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes')}return u?d(u,{container:r}):o?"cut"===n?l(o):d(o,{container:r}):void 0};function v(e){return v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},v(e)}function m(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof e.action?e.action:this.defaultAction,this.target="function"==typeof e.target?e.target:this.defaultTarget,this.text="function"==typeof e.text?e.text:this.defaultText,this.container="object"===v(e.container)?e.container:document.body}},{key:"listenClick",value:function(e){var t=this;this.listener=i()(e,"click",(function(e){return t.onClick(e)}))}},{key:"onClick",value:function(e){var t=e.delegateTarget||e.currentTarget,n=this.action(t)||"copy",r=h({action:n,container:this.container,target:this.target(t),text:this.text(t)});this.emit(r?"success":"error",{action:n,text:r,trigger:t,clearSelection:function(){t&&t.focus(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(e){return w("action",e)}},{key:"defaultTarget",value:function(e){var t=w("target",e);if(t)return document.querySelector(t)}},{key:"defaultText",value:function(e){return w("text",e)}},{key:"destroy",value:function(){this.listener.destroy()}}],r=[{key:"copy",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{container:document.body};return d(e,t)}},{key:"cut",value:function(e){return l(e)}},{key:"isSupported",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],t="string"==typeof e?[e]:e,n=!!document.queryCommandSupported;return t.forEach((function(e){n=n&&!!document.queryCommandSupported(e)})),n}}],n&&m(t.prototype,n),r&&m(t,r),u}(o()),S=E},828:function(e){if("undefined"!=typeof Element&&!Element.prototype.matches){var t=Element.prototype;t.matches=t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector}e.exports=function(e,t){for(;e&&9!==e.nodeType;){if("function"==typeof e.matches&&e.matches(t))return e;e=e.parentNode}}},438:function(e,t,n){var r=n(828);function o(e,t,n,r,o){var i=u.apply(this,arguments);return e.addEventListener(n,i,o),{destroy:function(){e.removeEventListener(n,i,o)}}}function u(e,t,n,o){return function(n){n.delegateTarget=r(n.target,t),n.delegateTarget&&o.call(e,n)}}e.exports=function(e,t,n,r,u){return"function"==typeof e.addEventListener?o.apply(null,arguments):"function"==typeof n?o.bind(null,document).apply(null,arguments):("string"==typeof e&&(e=document.querySelectorAll(e)),Array.prototype.map.call(e,(function(e){return o(e,t,n,r,u)})))}},879:function(e,t){t.node=function(e){return void 0!==e&&e instanceof HTMLElement&&1===e.nodeType},t.nodeList=function(e){var n=Object.prototype.toString.call(e);return void 0!==e&&("[object NodeList]"===n||"[object HTMLCollection]"===n)&&"length"in e&&(0===e.length||t.node(e[0]))},t.string=function(e){return"string"==typeof e||e instanceof String},t.fn=function(e){return"[object Function]"===Object.prototype.toString.call(e)}},370:function(e,t,n){var r=n(879),o=n(438);e.exports=function(e,t,n){if(!e&&!t&&!n)throw new Error("Missing required arguments");if(!r.string(t))throw new TypeError("Second argument must be a String");if(!r.fn(n))throw new TypeError("Third argument must be a Function");if(r.node(e))return function(e,t,n){return e.addEventListener(t,n),{destroy:function(){e.removeEventListener(t,n)}}}(e,t,n);if(r.nodeList(e))return function(e,t,n){return Array.prototype.forEach.call(e,(function(e){e.addEventListener(t,n)})),{destroy:function(){Array.prototype.forEach.call(e,(function(e){e.removeEventListener(t,n)}))}}}(e,t,n);if(r.string(e))return function(e,t,n){return o(document.body,e,t,n)}(e,t,n);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}},817:function(e){e.exports=function(e){var t;if("SELECT"===e.nodeName)e.focus(),t=e.value;else if("INPUT"===e.nodeName||"TEXTAREA"===e.nodeName){var n=e.hasAttribute("readonly");n||e.setAttribute("readonly",""),e.select(),e.setSelectionRange(0,e.value.length),n||e.removeAttribute("readonly"),t=e.value}else{e.hasAttribute("contenteditable")&&e.focus();var r=window.getSelection(),o=document.createRange();o.selectNodeContents(e),r.removeAllRanges(),r.addRange(o),t=r.toString()}return t}},279:function(e){function t(){}t.prototype={on:function(e,t,n){var r=this.e||(this.e={});return(r[e]||(r[e]=[])).push({fn:t,ctx:n}),this},once:function(e,t,n){var r=this;function o(){r.off(e,o),t.apply(n,arguments)}return o._=t,this.on(e,o,n)},emit:function(e){for(var t=[].slice.call(arguments,1),n=((this.e||(this.e={}))[e]||[]).slice(),r=0,o=n.length;r{var r;!function(o,u){if(o){for(var i,c={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta"},s={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},a={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},l={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},f=1;f<20;++f)c[111+f]="f"+f;for(f=0;f<=9;++f)c[f+96]=f.toString();g.prototype.bind=function(e,t,n){var r=this;return e=e instanceof Array?e:[e],r._bindMultiple.call(r,e,t,n),r},g.prototype.unbind=function(e,t){return this.bind.call(this,e,(function(){}),t)},g.prototype.trigger=function(e,t){var n=this;return n._directMap[e+":"+t]&&n._directMap[e+":"+t]({},e),n},g.prototype.reset=function(){var e=this;return e._callbacks={},e._directMap={},e},g.prototype.stopCallback=function(e,t){if((" "+t.className+" ").indexOf(" mousetrap ")>-1)return!1;if(y(t,this.target))return!1;if("composedPath"in e&&"function"==typeof e.composedPath){var n=e.composedPath()[0];n!==e.target&&(t=n)}return"INPUT"==t.tagName||"SELECT"==t.tagName||"TEXTAREA"==t.tagName||t.isContentEditable},g.prototype.handleKey=function(){return this._handleKey.apply(this,arguments)},g.addKeycodes=function(e){for(var t in e)e.hasOwnProperty(t)&&(c[t]=e[t]);i=null},g.init=function(){var e=g(u);for(var t in e)"_"!==t.charAt(0)&&(g[t]=function(t){return function(){return e[t].apply(e,arguments)}}(t))},g.init(),o.Mousetrap=g,e.exports&&(e.exports=g),void 0===(r=function(){return g}.call(t,n,t,e))||(e.exports=r)}function d(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent("on"+t,n)}function p(e){if("keypress"==e.type){var t=String.fromCharCode(e.which);return e.shiftKey||(t=t.toLowerCase()),t}return c[e.which]?c[e.which]:s[e.which]?s[e.which]:String.fromCharCode(e.which).toLowerCase()}function h(e){return"shift"==e||"ctrl"==e||"alt"==e||"meta"==e}function v(e,t,n){return n||(n=function(){if(!i)for(var e in i={},c)e>95&&e<112||c.hasOwnProperty(e)&&(i[c[e]]=e);return i}()[e]?"keydown":"keypress"),"keypress"==n&&t.length&&(n="keydown"),n}function m(e,t){var n,r,o,u=[];for(n=function(e){return"+"===e?["+"]:(e=e.replace(/\+{2}/g,"+plus")).split("+")}(e),o=0;o1?v(e,c,n,r):(i=m(e,r),t._callbacks[i.key]=t._callbacks[i.key]||[],a(i.key,i.modifiers,{type:i.action},o,e,u),t._callbacks[i.key][o?"unshift":"push"]({callback:n,modifiers:i.modifiers,action:i.action,seq:o,level:u,combo:e}))}t._handleKey=function(e,t,n){var r,o=a(e,t,n),u={},f=0,d=!1;for(r=0;r{!function(e){if(e){var t={},n=e.prototype.stopCallback;e.prototype.stopCallback=function(e,r,o,u){return!!this.paused||!t[o]&&!t[u]&&n.call(this,e,r,o)},e.prototype.bindGlobal=function(e,n,r){if(this.bind(e,n,r),e instanceof Array)for(var o=0;o{"use strict";e.exports=window.wp.isShallowEqual}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var u=t[r]={exports:{}};return e[r].call(u.exports,u,u.exports,n),u.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};(()=>{"use strict";n.r(r),n.d(r,{__experimentalUseDialog:()=>B,__experimentalUseDragging:()=>Y,__experimentalUseDropZone:()=>Oe,__experimentalUseFixedWindowList:()=>je,__experimentalUseFocusOutside:()=>$,compose:()=>m,createHigherOrderComponent:()=>a,debounce:()=>f,ifCondition:()=>g,observableMap:()=>p,pipe:()=>v,pure:()=>S,throttle:()=>d,useAsyncList:()=>xe,useConstrainedTabbing:()=>j,useCopyOnClick:()=>N,useCopyToClipboard:()=>U,useDebounce:()=>Re,useDebouncedInput:()=>Le,useDisabled:()=>G,useEvent:()=>Q,useFocusOnMount:()=>q,useFocusReturn:()=>W,useFocusableIframe:()=>_e,useInstanceId:()=>L,useIsomorphicLayoutEffect:()=>X,useKeyboardShortcut:()=>te,useMediaQuery:()=>re,useMergeRefs:()=>Z,useObservableValue:()=>Pe,usePrevious:()=>oe,useReducedMotion:()=>ue,useRefEffect:()=>A,useResizeObserver:()=>Ee,useStateWithHistory:()=>ae,useThrottle:()=>De,useViewportMatch:()=>ve,useWarnOnChange:()=>ke,withGlobalEvents:()=>C,withInstanceId:()=>D,withSafeTimeout:()=>M,withState:()=>O});var e=function(){return e=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&n>="0"&&n<="9"?"_"+n+r:""+n.toUpperCase()+r}function s(n,r){return void 0===r&&(r={}),function(e,n){void 0===n&&(n={});for(var r=n.splitRegexp,c=void 0===r?o:r,s=n.stripRegexp,a=void 0===s?u:s,l=n.transform,f=void 0===l?t:l,d=n.delimiter,p=void 0===d?" ":d,h=i(i(e,c,"$1\0$2"),a,"\0"),v=0,m=h.length;"\0"===h.charAt(v);)v++;for(;"\0"===h.charAt(m-1);)m--;return h.slice(v,m).split("\0").map(f).join(p)}(n,e({delimiter:"",transform:c},r))}function a(e,t){return n=>{const r=e(n);return r.displayName=l(t,n),r}}const l=(e,t)=>{const n=t.displayName||t.name||"Component";return`${s(null!=e?e:"")}(${n})`},f=(e,t,n)=>{let r,o,u,i,c,s=0,a=0,l=!1,f=!1,d=!0;function p(t){const n=r,i=o;return r=void 0,o=void 0,a=t,u=e.apply(i,n),u}function h(e,t){i=setTimeout(e,t)}function v(e){return e-(c||0)}function m(e){const n=v(e);return void 0===c||n>=t||n<0||f&&e-a>=s}function y(){const e=Date.now();if(m(e))return b(e);h(y,function(e){const n=v(e),r=e-a,o=t-n;return f?Math.min(o,s-r):o}(e))}function g(){i=void 0}function b(e){return g(),d&&r?p(e):(r=o=void 0,u)}function w(){return void 0!==i}function E(...e){const n=Date.now(),i=m(n);if(r=e,o=this,c=n,i){if(!w())return function(e){return a=e,h(y,t),l?p(e):u}(c);if(f)return h(y,t),p(c)}return w()||h(y,t),u}return n&&(l=!!n.leading,f="maxWait"in n,void 0!==n.maxWait&&(s=Math.max(n.maxWait,t)),d="trailing"in n?!!n.trailing:d),E.cancel=function(){void 0!==i&&clearTimeout(i),a=0,g(),r=c=o=void 0},E.flush=function(){return w()?b(Date.now()):u},E.pending=w,E},d=(e,t,n)=>{let r=!0,o=!0;return n&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),f(e,t,{leading:r,trailing:o,maxWait:t})};function p(){const e=new Map,t=new Map;function n(e){const n=t.get(e);if(n)for(const e of n)e()}return{get:t=>e.get(t),set(t,r){e.set(t,r),n(t)},delete(t){e.delete(t),n(t)},subscribe(e,n){let r=t.get(e);return r||(r=new Set,t.set(e,r)),r.add(n),()=>{r.delete(n),0===r.size&&t.delete(e)}}}}const h=(e=!1)=>(...t)=>(...n)=>{const r=t.flat();return e&&r.reverse(),r.reduce(((e,t)=>[t(...e)]),n)[0]},v=h(),m=h(!0),y=window.ReactJSXRuntime;const g=function(e){return a((t=>n=>e(n)?(0,y.jsx)(t,{...n}):null),"ifCondition")};var b=n(923),w=n.n(b);const E=window.wp.element,S=a((function(e){return e.prototype instanceof E.Component?class extends e{shouldComponentUpdate(e,t){return!w()(e,this.props)||!w()(t,this.state)}}:class extends E.Component{shouldComponentUpdate(e){return!w()(e,this.props)}render(){return(0,y.jsx)(e,{...this.props})}}}),"pure"),x=window.wp.deprecated;var k=n.n(x);const T=new class{constructor(){this.listeners={},this.handleEvent=this.handleEvent.bind(this)}add(e,t){this.listeners[e]||(window.addEventListener(e,this.handleEvent),this.listeners[e]=[]),this.listeners[e].push(t)}remove(e,t){this.listeners[e]&&(this.listeners[e]=this.listeners[e].filter((e=>e!==t)),this.listeners[e].length||(window.removeEventListener(e,this.handleEvent),delete this.listeners[e]))}handleEvent(e){this.listeners[e.type]?.forEach((t=>{t.handleEvent(e)}))}};function C(e){return k()("wp.compose.withGlobalEvents",{since:"5.7",alternative:"useEffect"}),a((t=>{class n extends E.Component{constructor(e){super(e),this.handleEvent=this.handleEvent.bind(this),this.handleRef=this.handleRef.bind(this)}componentDidMount(){Object.keys(e).forEach((e=>{T.add(e,this)}))}componentWillUnmount(){Object.keys(e).forEach((e=>{T.remove(e,this)}))}handleEvent(t){const n=e[t.type];"function"==typeof this.wrappedRef[n]&&this.wrappedRef[n](t)}handleRef(e){this.wrappedRef=e,this.props.forwardedRef&&this.props.forwardedRef(e)}render(){return(0,y.jsx)(t,{...this.props.ownProps,ref:this.handleRef})}}return(0,E.forwardRef)(((e,t)=>(0,y.jsx)(n,{ownProps:e,forwardedRef:t})))}),"withGlobalEvents")}const R=new WeakMap;const L=function(e,t,n){return(0,E.useMemo)((()=>{if(n)return n;const r=function(e){const t=R.get(e)||0;return R.set(e,t+1),t}(e);return t?`${t}-${r}`:r}),[e,n,t])},D=a((e=>t=>{const n=L(e);return(0,y.jsx)(e,{...t,instanceId:n})}),"instanceId"),M=a((e=>class extends E.Component{constructor(e){super(e),this.timeouts=[],this.setTimeout=this.setTimeout.bind(this),this.clearTimeout=this.clearTimeout.bind(this)}componentWillUnmount(){this.timeouts.forEach(clearTimeout)}setTimeout(e,t){const n=setTimeout((()=>{e(),this.clearTimeout(n)}),t);return this.timeouts.push(n),n}clearTimeout(e){clearTimeout(e),this.timeouts=this.timeouts.filter((t=>t!==e))}render(){return(0,y.jsx)(e,{...this.props,setTimeout:this.setTimeout,clearTimeout:this.clearTimeout})}}),"withSafeTimeout");function O(e={}){return k()("wp.compose.withState",{since:"5.8",alternative:"wp.element.useState"}),a((t=>class extends E.Component{constructor(t){super(t),this.setState=this.setState.bind(this),this.state=e}render(){return(0,y.jsx)(t,{...this.props,...this.state,setState:this.setState})}}),"withState")}const _=window.wp.dom;function A(e,t){const n=(0,E.useRef)();return(0,E.useCallback)((t=>{t?n.current=e(t):n.current&&n.current()}),t)}const j=function(){return A((e=>{function t(t){const{key:n,shiftKey:r,target:o}=t;if("Tab"!==n)return;const u=r?"findPrevious":"findNext",i=_.focus.tabbable[u](o)||null;if(o.contains(i))return t.preventDefault(),void i?.focus();if(e.contains(i))return;const c=r?"append":"prepend",{ownerDocument:s}=e,a=s.createElement("div");a.tabIndex=-1,e[c](a),a.addEventListener("blur",(()=>e.removeChild(a))),a.focus()}return e.addEventListener("keydown",t),()=>{e.removeEventListener("keydown",t)}}),[])};var P=n(3758),I=n.n(P);function N(e,t,n=4e3){k()("wp.compose.useCopyOnClick",{since:"5.8",alternative:"wp.compose.useCopyToClipboard"});const r=(0,E.useRef)(),[o,u]=(0,E.useState)(!1);return(0,E.useEffect)((()=>{let o;if(e.current)return r.current=new(I())(e.current,{text:()=>"function"==typeof t?t():t}),r.current.on("success",(({clearSelection:e,trigger:t})=>{e(),t&&t.focus(),n&&(u(!0),clearTimeout(o),o=setTimeout((()=>u(!1)),n))})),()=>{r.current&&r.current.destroy(),clearTimeout(o)}}),[t,n,u]),o}function z(e){const t=(0,E.useRef)(e);return t.current=e,t}function U(e,t){const n=z(e),r=z(t);return A((e=>{const t=new(I())(e,{text:()=>"function"==typeof n.current?n.current():n.current||""});return t.on("success",(({clearSelection:e})=>{e(),r.current&&r.current()})),()=>{t.destroy()}}),[])}const V=window.wp.keycodes;function q(e="firstElement"){const t=(0,E.useRef)(e),n=e=>{e.focus({preventScroll:!0})},r=(0,E.useRef)();return(0,E.useEffect)((()=>{t.current=e}),[e]),A((e=>{var o;if(e&&!1!==t.current&&!e.contains(null!==(o=e.ownerDocument?.activeElement)&&void 0!==o?o:null)){if("firstElement"===t.current)return r.current=setTimeout((()=>{const t=_.focus.tabbable.find(e)[0];t&&n(t)}),0),()=>{r.current&&clearTimeout(r.current)};n(e)}}),[])}let K=null;const W=function(e){const t=(0,E.useRef)(null),n=(0,E.useRef)(null),r=(0,E.useRef)(e);return(0,E.useEffect)((()=>{r.current=e}),[e]),(0,E.useCallback)((e=>{if(e){if(t.current=e,n.current)return;n.current=e.ownerDocument.activeElement}else if(n.current){const e=t.current?.contains(t.current?.ownerDocument.activeElement);var o;if(t.current?.isConnected&&!e)return void(null!==(o=K)&&void 0!==o||(K=n.current));r.current?r.current():(n.current.isConnected?n.current:K)?.focus(),K=null}}),[])},H=["button","submit"];function $(e){const t=(0,E.useRef)(e);(0,E.useEffect)((()=>{t.current=e}),[e]);const n=(0,E.useRef)(!1),r=(0,E.useRef)(),o=(0,E.useCallback)((()=>{clearTimeout(r.current)}),[]);(0,E.useEffect)((()=>()=>o()),[]),(0,E.useEffect)((()=>{e||o()}),[e,o]);const u=(0,E.useCallback)((e=>{const{type:t,target:r}=e;["mouseup","touchend"].includes(t)?n.current=!1:function(e){if(!(e instanceof window.HTMLElement))return!1;switch(e.nodeName){case"A":case"BUTTON":return!0;case"INPUT":return H.includes(e.type)}return!1}(r)&&(n.current=!0)}),[]),i=(0,E.useCallback)((e=>{if(e.persist(),n.current)return;const o=e.target.getAttribute("data-unstable-ignore-focus-outside-for-relatedtarget");o&&e.relatedTarget?.closest(o)||(r.current=setTimeout((()=>{document.hasFocus()?"function"==typeof t.current&&t.current(e):e.preventDefault()}),0))}),[]);return{onFocus:o,onMouseDown:u,onMouseUp:u,onTouchStart:u,onTouchEnd:u,onBlur:i}}function F(e,t){"function"==typeof e?e(t):e&&e.hasOwnProperty("current")&&(e.current=t)}function Z(e){const t=(0,E.useRef)(),n=(0,E.useRef)(!1),r=(0,E.useRef)(!1),o=(0,E.useRef)([]),u=(0,E.useRef)(e);return u.current=e,(0,E.useLayoutEffect)((()=>{!1===r.current&&!0===n.current&&e.forEach(((e,n)=>{const r=o.current[n];e!==r&&(F(r,null),F(e,t.current))})),o.current=e}),e),(0,E.useLayoutEffect)((()=>{r.current=!1})),(0,E.useCallback)((e=>{F(t,e),r.current=!0,n.current=null!==e;const i=e?u.current:o.current;for(const t of i)F(t,e)}),[])}const B=function(e){const t=(0,E.useRef)(),{constrainTabbing:n=!1!==e.focusOnMount}=e;(0,E.useEffect)((()=>{t.current=e}),Object.values(e));const r=j(),o=q(e.focusOnMount),u=W(),i=$((e=>{t.current?.__unstableOnClose?t.current.__unstableOnClose("focus-outside",e):t.current?.onClose&&t.current.onClose()})),c=(0,E.useCallback)((e=>{e&&e.addEventListener("keydown",(e=>{e.keyCode===V.ESCAPE&&!e.defaultPrevented&&t.current?.onClose&&(e.preventDefault(),t.current.onClose())}))}),[]);return[Z([n?r:null,!1!==e.focusOnMount?u:null,!1!==e.focusOnMount?o:null,c]),{...i,tabIndex:-1}]};function G({isDisabled:e=!1}={}){return A((t=>{if(e)return;const n=t?.ownerDocument?.defaultView;if(!n)return;const r=[],o=()=>{t.childNodes.forEach((e=>{e instanceof n.HTMLElement&&(e.getAttribute("inert")||(e.setAttribute("inert","true"),r.push((()=>{e.removeAttribute("inert")}))))}))},u=f(o,0,{leading:!0});o();const i=new window.MutationObserver(u);return i.observe(t,{childList:!0}),()=>{i&&i.disconnect(),u.cancel(),r.forEach((e=>e()))}}),[e])}function Q(e){const t=(0,E.useRef)((()=>{throw new Error("Callbacks created with `useEvent` cannot be called during rendering.")}));return(0,E.useInsertionEffect)((()=>{t.current=e})),(0,E.useCallback)(((...e)=>t.current?.(...e)),[])}const X="undefined"!=typeof window?E.useLayoutEffect:E.useEffect;function Y({onDragStart:e,onDragMove:t,onDragEnd:n}){const[r,o]=(0,E.useState)(!1),u=(0,E.useRef)({onDragStart:e,onDragMove:t,onDragEnd:n});X((()=>{u.current.onDragStart=e,u.current.onDragMove=t,u.current.onDragEnd=n}),[e,t,n]);const i=(0,E.useCallback)((e=>u.current.onDragMove&&u.current.onDragMove(e)),[]),c=(0,E.useCallback)((e=>{u.current.onDragEnd&&u.current.onDragEnd(e),document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",c),o(!1)}),[]),s=(0,E.useCallback)((e=>{u.current.onDragStart&&u.current.onDragStart(e),document.addEventListener("mousemove",i),document.addEventListener("mouseup",c),o(!0)}),[]);return(0,E.useEffect)((()=>()=>{r&&(document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",c))}),[r]),{startDrag:s,endDrag:c,isDragging:r}}var J=n(1933),ee=n.n(J);n(5760);const te=function(e,t,{bindGlobal:n=!1,eventName:r="keydown",isDisabled:o=!1,target:u}={}){const i=(0,E.useRef)(t);(0,E.useEffect)((()=>{i.current=t}),[t]),(0,E.useEffect)((()=>{if(o)return;const t=new(ee())(u&&u.current?u.current:document);return(Array.isArray(e)?e:[e]).forEach((e=>{const o=e.split("+"),u=new Set(o.filter((e=>e.length>1))),c=u.has("alt"),s=u.has("shift");if((0,V.isAppleOS)()&&(1===u.size&&c||2===u.size&&c&&s))throw new Error(`Cannot bind ${e}. Alt and Shift+Alt modifiers are reserved for character input.`);t[n?"bindGlobal":"bind"](e,((...e)=>i.current(...e)),r)})),()=>{t.reset()}}),[e,n,r,u,o])},ne=new Map;function re(e){const t=(0,E.useMemo)((()=>{const t=function(e){if(!e)return null;let t=ne.get(e);return t||("undefined"!=typeof window&&"function"==typeof window.matchMedia?(t=window.matchMedia(e),ne.set(e,t),t):null)}(e);return{subscribe:e=>t?(t.addEventListener?.("change",e),()=>{t.removeEventListener?.("change",e)}):()=>{},getValue(){var e;return null!==(e=t?.matches)&&void 0!==e&&e}}}),[e]);return(0,E.useSyncExternalStore)(t.subscribe,t.getValue,(()=>!1))}function oe(e){const t=(0,E.useRef)();return(0,E.useEffect)((()=>{t.current=e}),[e]),t.current}const ue=()=>re("(prefers-reduced-motion: reduce)");var ie=n(6689);function ce(e,t){switch(t.type){case"UNDO":{const t=e.manager.undo();return t?{...e,value:t[0].changes.prop.from}:e}case"REDO":{const t=e.manager.redo();return t?{...e,value:t[0].changes.prop.to}:e}case"RECORD":return e.manager.addRecord([{id:"object",changes:{prop:{from:e.value,to:t.value}}}],t.isStaged),{...e,value:t.value}}return e}function se(e){return{manager:(0,ie.createUndoManager)(),value:e}}function ae(e){const[t,n]=(0,E.useReducer)(ce,e,se);return{value:t.value,setValue:(0,E.useCallback)(((e,t)=>{n({type:"RECORD",value:e,isStaged:t})}),[]),hasUndo:t.manager.hasUndo(),hasRedo:t.manager.hasRedo(),undo:(0,E.useCallback)((()=>{n({type:"UNDO"})}),[]),redo:(0,E.useCallback)((()=>{n({type:"REDO"})}),[])}}const le={xhuge:1920,huge:1440,wide:1280,xlarge:1080,large:960,medium:782,small:600,mobile:480},fe={">=":"min-width","<":"max-width"},de={">=":(e,t)=>t>=e,"<":(e,t)=>t=")=>{const n=(0,E.useContext)(pe),r=re(!n&&`(${fe[t]}: ${le[e]}px)`||void 0);return n?de[t](le[e],n):r};he.__experimentalWidthProvider=pe.Provider;const ve=he;function me(e,t={}){const n=Q(e),r=(0,E.useRef)(),o=(0,E.useRef)();return Q((e=>{var u;if(e===r.current)return;null!==(u=o.current)&&void 0!==u||(o.current=new ResizeObserver(n));const{current:i}=o;r.current&&i.unobserve(r.current),r.current=e,e&&i.observe(e,t)}))}const ye=e=>{let t;if(e.contentBoxSize)if(e.contentBoxSize[0]){const n=e.contentBoxSize[0];t=[n.inlineSize,n.blockSize]}else{const n=e.contentBoxSize;t=[n.inlineSize,n.blockSize]}else t=[e.contentRect.width,e.contentRect.height];const[n,r]=t.map((e=>Math.round(e)));return{width:n,height:r}},ge={position:"absolute",top:0,left:0,right:0,bottom:0,pointerEvents:"none",opacity:0,overflow:"hidden",zIndex:-1};function be({onResize:e}){const t=me((t=>{const n=ye(t.at(-1));e(n)}));return(0,y.jsx)("div",{ref:t,style:ge,"aria-hidden":"true"})}const we={width:null,height:null};function Ee(e,t={}){return e?me(e,t):function(){const[e,t]=(0,E.useState)(we),n=(0,E.useRef)(we),r=(0,E.useCallback)((e=>{var r,o;o=e,((r=n.current).width!==o.width||r.height!==o.height)&&(n.current=e,t(e))}),[]);return[(0,y.jsx)(be,{onResize:r}),e]}()}const Se=window.wp.priorityQueue;const xe=function(e,t={step:1}){const{step:n=1}=t,[r,o]=(0,E.useState)([]);return(0,E.useEffect)((()=>{let t=function(e,t){const n=[];for(let r=0;r{(0,E.flushSync)((()=>{o((t=>[...t,...e.slice(r,r+n)]))}))}));return()=>u.reset()}),[e]),r};const ke=function(e,t="Change detection"){const n=oe(e);Object.entries(null!=n?n:[]).forEach((([n,r])=>{r!==e[n]&&console.warn(`${t}: ${n} key changed:`,r,e[n])}))},Te=window.React;function Ce(e,t){var n=(0,Te.useState)((function(){return{inputs:t,result:e()}}))[0],r=(0,Te.useRef)(!0),o=(0,Te.useRef)(n),u=r.current||Boolean(t&&o.current.inputs&&function(e,t){if(e.length!==t.length)return!1;for(var n=0;nf(e,null!=t?t:0,n)),[e,t,n]);return(0,E.useEffect)((()=>()=>r.cancel()),[r]),r}function Le(e=""){const[t,n]=(0,E.useState)(e),[r,o]=(0,E.useState)(e),u=Re(o,250);return(0,E.useEffect)((()=>{u(t)}),[t,u]),[t,n,r]}function De(e,t,n){const r=Ce((()=>d(e,null!=t?t:0,n)),[e,t,n]);return(0,E.useEffect)((()=>()=>r.cancel()),[r]),r}function Me(e){const t=(0,E.useRef)();return t.current=e,t}function Oe({dropZoneElement:e,isDisabled:t,onDrop:n,onDragStart:r,onDragEnter:o,onDragLeave:u,onDragEnd:i,onDragOver:c}){const s=Me(n),a=Me(r),l=Me(o),f=Me(u),d=Me(i),p=Me(c);return A((n=>{if(t)return;const r=null!=e?e:n;let o=!1;const{ownerDocument:u}=r;function i(e){o||(o=!0,u.addEventListener("dragend",y),u.addEventListener("mousemove",y),a.current&&a.current(e))}function c(e){e.preventDefault(),r.contains(e.relatedTarget)||l.current&&l.current(e)}function h(e){!e.defaultPrevented&&p.current&&p.current(e),e.preventDefault()}function v(e){(function(e){const{defaultView:t}=u;if(!(e&&t&&e instanceof t.HTMLElement&&r.contains(e)))return!1;let n=e;do{if(n.dataset.isDropZone)return n===r}while(n=n.parentElement);return!1})(e.relatedTarget)||f.current&&f.current(e)}function m(e){e.defaultPrevented||(e.preventDefault(),e.dataTransfer&&e.dataTransfer.files.length,s.current&&s.current(e),y(e))}function y(e){o&&(o=!1,u.removeEventListener("dragend",y),u.removeEventListener("mousemove",y),d.current&&d.current(e))}return r.dataset.isDropZone="true",r.addEventListener("drop",m),r.addEventListener("dragenter",c),r.addEventListener("dragover",h),r.addEventListener("dragleave",v),u.addEventListener("dragenter",i),()=>{delete r.dataset.isDropZone,r.removeEventListener("drop",m),r.removeEventListener("dragenter",c),r.removeEventListener("dragover",h),r.removeEventListener("dragleave",v),u.removeEventListener("dragend",y),u.removeEventListener("mousemove",y),u.removeEventListener("dragenter",i)}}),[t,e])}function _e(){return A((e=>{const{ownerDocument:t}=e;if(!t)return;const{defaultView:n}=t;if(n)return n.addEventListener("blur",r),()=>{n.removeEventListener("blur",r)};function r(){t&&t.activeElement===e&&e.focus()}}),[])}const Ae=30;function je(e,t,n,r){var o,u;const i=null!==(o=r?.initWindowSize)&&void 0!==o?o:Ae,c=null===(u=r?.useWindowing)||void 0===u||u,[s,a]=(0,E.useState)({visibleItems:i,start:0,end:i,itemInView:e=>e>=0&&e<=i});return(0,E.useLayoutEffect)((()=>{if(!c)return;const o=(0,_.getScrollContainer)(e.current),u=e=>{var u;if(!o)return;const i=Math.ceil(o.clientHeight/t),c=e?i:null!==(u=r?.windowOverscan)&&void 0!==u?u:i,s=Math.floor(o.scrollTop/t),l=Math.max(0,s-c),f=Math.min(n-1,s+i+c);a((e=>{const t={visibleItems:i,start:l,end:f,itemInView:e=>l<=e&&e<=f};return e.start!==t.start||e.end!==t.end||e.visibleItems!==t.visibleItems?t:e}))};u(!0);const i=f((()=>{u()}),16);return o?.addEventListener("scroll",i),o?.ownerDocument?.defaultView?.addEventListener("resize",i),o?.ownerDocument?.defaultView?.addEventListener("resize",i),()=>{o?.removeEventListener("scroll",i),o?.ownerDocument?.defaultView?.removeEventListener("resize",i)}}),[t,e,n,r?.expandedState,r?.windowOverscan,c]),(0,E.useLayoutEffect)((()=>{if(!c)return;const r=(0,_.getScrollContainer)(e.current),o=e=>{switch(e.keyCode){case V.HOME:return r?.scrollTo({top:0});case V.END:return r?.scrollTo({top:n*t});case V.PAGEUP:return r?.scrollTo({top:r.scrollTop-s.visibleItems*t});case V.PAGEDOWN:return r?.scrollTo({top:r.scrollTop+s.visibleItems*t})}};return r?.ownerDocument?.defaultView?.addEventListener("keydown",o),()=>{r?.ownerDocument?.defaultView?.removeEventListener("keydown",o)}}),[n,t,e,s.visibleItems,c,r?.expandedState]),[s,a]}function Pe(e,t){const[n,r]=(0,E.useMemo)((()=>[n=>e.subscribe(t,n),()=>e.get(t)]),[e,t]);return(0,E.useSyncExternalStore)(n,r,r)}})(),(window.wp=window.wp||{}).compose=r})(); \ No newline at end of file +var t;t=function(){return function(){var e={686:function(e,t,n){"use strict";n.d(t,{default:function(){return S}});var r=n(279),o=n.n(r),i=n(370),u=n.n(i),c=n(817),s=n.n(c);function a(e){try{return document.execCommand(e)}catch(e){return!1}}var l=function(e){var t=s()(e);return a("cut"),t},f=function(e,t){var n=function(e){var t="rtl"===document.documentElement.getAttribute("dir"),n=document.createElement("textarea");n.style.fontSize="12pt",n.style.border="0",n.style.padding="0",n.style.margin="0",n.style.position="absolute",n.style[t?"right":"left"]="-9999px";var r=window.pageYOffset||document.documentElement.scrollTop;return n.style.top="".concat(r,"px"),n.setAttribute("readonly",""),n.value=e,n}(e);t.container.appendChild(n);var r=s()(n);return a("copy"),n.remove(),r},d=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{container:document.body},n="";return"string"==typeof e?n=f(e,t):e instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(null==e?void 0:e.type)?n=f(e.value,t):(n=s()(e),a("copy")),n};function p(e){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p(e)}var h=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.action,n=void 0===t?"copy":t,r=e.container,o=e.target,i=e.text;if("copy"!==n&&"cut"!==n)throw new Error('Invalid "action" value, use either "copy" or "cut"');if(void 0!==o){if(!o||"object"!==p(o)||1!==o.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===n&&o.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===n&&(o.hasAttribute("readonly")||o.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes')}return i?d(i,{container:r}):o?"cut"===n?l(o):d(o,{container:r}):void 0};function v(e){return v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},v(e)}function m(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof e.action?e.action:this.defaultAction,this.target="function"==typeof e.target?e.target:this.defaultTarget,this.text="function"==typeof e.text?e.text:this.defaultText,this.container="object"===v(e.container)?e.container:document.body}},{key:"listenClick",value:function(e){var t=this;this.listener=u()(e,"click",(function(e){return t.onClick(e)}))}},{key:"onClick",value:function(e){var t=e.delegateTarget||e.currentTarget,n=this.action(t)||"copy",r=h({action:n,container:this.container,target:this.target(t),text:this.text(t)});this.emit(r?"success":"error",{action:n,text:r,trigger:t,clearSelection:function(){t&&t.focus(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(e){return w("action",e)}},{key:"defaultTarget",value:function(e){var t=w("target",e);if(t)return document.querySelector(t)}},{key:"defaultText",value:function(e){return w("text",e)}},{key:"destroy",value:function(){this.listener.destroy()}}],r=[{key:"copy",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{container:document.body};return d(e,t)}},{key:"cut",value:function(e){return l(e)}},{key:"isSupported",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],t="string"==typeof e?[e]:e,n=!!document.queryCommandSupported;return t.forEach((function(e){n=n&&!!document.queryCommandSupported(e)})),n}}],n&&m(t.prototype,n),r&&m(t,r),i}(o()),S=E},828:function(e){if("undefined"!=typeof Element&&!Element.prototype.matches){var t=Element.prototype;t.matches=t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector}e.exports=function(e,t){for(;e&&9!==e.nodeType;){if("function"==typeof e.matches&&e.matches(t))return e;e=e.parentNode}}},438:function(e,t,n){var r=n(828);function o(e,t,n,r,o){var u=i.apply(this,arguments);return e.addEventListener(n,u,o),{destroy:function(){e.removeEventListener(n,u,o)}}}function i(e,t,n,o){return function(n){n.delegateTarget=r(n.target,t),n.delegateTarget&&o.call(e,n)}}e.exports=function(e,t,n,r,i){return"function"==typeof e.addEventListener?o.apply(null,arguments):"function"==typeof n?o.bind(null,document).apply(null,arguments):("string"==typeof e&&(e=document.querySelectorAll(e)),Array.prototype.map.call(e,(function(e){return o(e,t,n,r,i)})))}},879:function(e,t){t.node=function(e){return void 0!==e&&e instanceof HTMLElement&&1===e.nodeType},t.nodeList=function(e){var n=Object.prototype.toString.call(e);return void 0!==e&&("[object NodeList]"===n||"[object HTMLCollection]"===n)&&"length"in e&&(0===e.length||t.node(e[0]))},t.string=function(e){return"string"==typeof e||e instanceof String},t.fn=function(e){return"[object Function]"===Object.prototype.toString.call(e)}},370:function(e,t,n){var r=n(879),o=n(438);e.exports=function(e,t,n){if(!e&&!t&&!n)throw new Error("Missing required arguments");if(!r.string(t))throw new TypeError("Second argument must be a String");if(!r.fn(n))throw new TypeError("Third argument must be a Function");if(r.node(e))return function(e,t,n){return e.addEventListener(t,n),{destroy:function(){e.removeEventListener(t,n)}}}(e,t,n);if(r.nodeList(e))return function(e,t,n){return Array.prototype.forEach.call(e,(function(e){e.addEventListener(t,n)})),{destroy:function(){Array.prototype.forEach.call(e,(function(e){e.removeEventListener(t,n)}))}}}(e,t,n);if(r.string(e))return function(e,t,n){return o(document.body,e,t,n)}(e,t,n);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}},817:function(e){e.exports=function(e){var t;if("SELECT"===e.nodeName)e.focus(),t=e.value;else if("INPUT"===e.nodeName||"TEXTAREA"===e.nodeName){var n=e.hasAttribute("readonly");n||e.setAttribute("readonly",""),e.select(),e.setSelectionRange(0,e.value.length),n||e.removeAttribute("readonly"),t=e.value}else{e.hasAttribute("contenteditable")&&e.focus();var r=window.getSelection(),o=document.createRange();o.selectNodeContents(e),r.removeAllRanges(),r.addRange(o),t=r.toString()}return t}},279:function(e){function t(){}t.prototype={on:function(e,t,n){var r=this.e||(this.e={});return(r[e]||(r[e]=[])).push({fn:t,ctx:n}),this},once:function(e,t,n){var r=this;function o(){r.off(e,o),t.apply(n,arguments)}return o._=t,this.on(e,o,n)},emit:function(e){for(var t=[].slice.call(arguments,1),n=((this.e||(this.e={}))[e]||[]).slice(),r=0,o=n.length;r{var r;!function(o,i){if(o){for(var u,c={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta"},s={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},a={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},l={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},f=1;f<20;++f)c[111+f]="f"+f;for(f=0;f<=9;++f)c[f+96]=f.toString();g.prototype.bind=function(e,t,n){var r=this;return e=e instanceof Array?e:[e],r._bindMultiple.call(r,e,t,n),r},g.prototype.unbind=function(e,t){return this.bind.call(this,e,(function(){}),t)},g.prototype.trigger=function(e,t){var n=this;return n._directMap[e+":"+t]&&n._directMap[e+":"+t]({},e),n},g.prototype.reset=function(){var e=this;return e._callbacks={},e._directMap={},e},g.prototype.stopCallback=function(e,t){if((" "+t.className+" ").indexOf(" mousetrap ")>-1)return!1;if(y(t,this.target))return!1;if("composedPath"in e&&"function"==typeof e.composedPath){var n=e.composedPath()[0];n!==e.target&&(t=n)}return"INPUT"==t.tagName||"SELECT"==t.tagName||"TEXTAREA"==t.tagName||t.isContentEditable},g.prototype.handleKey=function(){return this._handleKey.apply(this,arguments)},g.addKeycodes=function(e){for(var t in e)e.hasOwnProperty(t)&&(c[t]=e[t]);u=null},g.init=function(){var e=g(i);for(var t in e)"_"!==t.charAt(0)&&(g[t]=function(t){return function(){return e[t].apply(e,arguments)}}(t))},g.init(),o.Mousetrap=g,e.exports&&(e.exports=g),void 0===(r=function(){return g}.call(t,n,t,e))||(e.exports=r)}function d(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent("on"+t,n)}function p(e){if("keypress"==e.type){var t=String.fromCharCode(e.which);return e.shiftKey||(t=t.toLowerCase()),t}return c[e.which]?c[e.which]:s[e.which]?s[e.which]:String.fromCharCode(e.which).toLowerCase()}function h(e){return"shift"==e||"ctrl"==e||"alt"==e||"meta"==e}function v(e,t,n){return n||(n=function(){if(!u)for(var e in u={},c)e>95&&e<112||c.hasOwnProperty(e)&&(u[c[e]]=e);return u}()[e]?"keydown":"keypress"),"keypress"==n&&t.length&&(n="keydown"),n}function m(e,t){var n,r,o,i=[];for(n=function(e){return"+"===e?["+"]:(e=e.replace(/\+{2}/g,"+plus")).split("+")}(e),o=0;o1?v(e,c,n,r):(u=m(e,r),t._callbacks[u.key]=t._callbacks[u.key]||[],a(u.key,u.modifiers,{type:u.action},o,e,i),t._callbacks[u.key][o?"unshift":"push"]({callback:n,modifiers:u.modifiers,action:u.action,seq:o,level:i,combo:e}))}t._handleKey=function(e,t,n){var r,o=a(e,t,n),i={},f=0,d=!1;for(r=0;r{!function(e){if(e){var t={},n=e.prototype.stopCallback;e.prototype.stopCallback=function(e,r,o,i){return!!this.paused||!t[o]&&!t[i]&&n.call(this,e,r,o)},e.prototype.bindGlobal=function(e,n,r){if(this.bind(e,n,r),e instanceof Array)for(var o=0;o{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};(()=>{"use strict";n.r(r),n.d(r,{__experimentalUseDialog:()=>G,__experimentalUseDragging:()=>Y,__experimentalUseDropZone:()=>_e,__experimentalUseFixedWindowList:()=>Pe,__experimentalUseFocusOutside:()=>$,compose:()=>m,createHigherOrderComponent:()=>a,debounce:()=>f,ifCondition:()=>g,observableMap:()=>p,pipe:()=>v,pure:()=>S,throttle:()=>d,useAsyncList:()=>Te,useConstrainedTabbing:()=>j,useCopyOnClick:()=>z,useCopyToClipboard:()=>U,useDebounce:()=>De,useDebouncedInput:()=>Oe,useDisabled:()=>Z,useEvent:()=>Q,useFocusOnMount:()=>q,useFocusReturn:()=>W,useFocusableIframe:()=>Ae,useInstanceId:()=>R,useIsomorphicLayoutEffect:()=>X,useKeyboardShortcut:()=>te,useMediaQuery:()=>re,useMergeRefs:()=>B,useObservableValue:()=>Ie,usePrevious:()=>oe,useReducedMotion:()=>ie,useRefEffect:()=>A,useResizeObserver:()=>xe,useStateWithHistory:()=>fe,useThrottle:()=>Me,useViewportMatch:()=>ye,useWarnOnChange:()=>Ce,withGlobalEvents:()=>C,withInstanceId:()=>D,withSafeTimeout:()=>O,withState:()=>M});var e=function(){return e=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&n>="0"&&n<="9"?"_"+n+r:""+n.toUpperCase()+r}function s(n,r){return void 0===r&&(r={}),function(e,n){void 0===n&&(n={});for(var r=n.splitRegexp,c=void 0===r?o:r,s=n.stripRegexp,a=void 0===s?i:s,l=n.transform,f=void 0===l?t:l,d=n.delimiter,p=void 0===d?" ":d,h=u(u(e,c,"$1\0$2"),a,"\0"),v=0,m=h.length;"\0"===h.charAt(v);)v++;for(;"\0"===h.charAt(m-1);)m--;return h.slice(v,m).split("\0").map(f).join(p)}(n,e({delimiter:"",transform:c},r))}function a(e,t){return n=>{const r=e(n);return r.displayName=l(t,n),r}}const l=(e,t)=>{const n=t.displayName||t.name||"Component";return`${s(null!=e?e:"")}(${n})`},f=(e,t,n)=>{let r,o,i,u,c,s=0,a=0,l=!1,f=!1,d=!0;function p(t){const n=r,u=o;return r=void 0,o=void 0,a=t,i=e.apply(u,n),i}function h(e,t){u=setTimeout(e,t)}function v(e){return e-(c||0)}function m(e){const n=v(e);return void 0===c||n>=t||n<0||f&&e-a>=s}function y(){const e=Date.now();if(m(e))return b(e);h(y,function(e){const n=v(e),r=e-a,o=t-n;return f?Math.min(o,s-r):o}(e))}function g(){u=void 0}function b(e){return g(),d&&r?p(e):(r=o=void 0,i)}function w(){return void 0!==u}function E(...e){const n=Date.now(),u=m(n);if(r=e,o=this,c=n,u){if(!w())return function(e){return a=e,h(y,t),l?p(e):i}(c);if(f)return h(y,t),p(c)}return w()||h(y,t),i}return n&&(l=!!n.leading,f="maxWait"in n,void 0!==n.maxWait&&(s=Math.max(n.maxWait,t)),d="trailing"in n?!!n.trailing:d),E.cancel=function(){void 0!==u&&clearTimeout(u),a=0,g(),r=c=o=void 0},E.flush=function(){return w()?b(Date.now()):i},E.pending=w,E},d=(e,t,n)=>{let r=!0,o=!0;return n&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),f(e,t,{leading:r,trailing:o,maxWait:t})};function p(){const e=new Map,t=new Map;function n(e){const n=t.get(e);if(n)for(const e of n)e()}return{get:t=>e.get(t),set(t,r){e.set(t,r),n(t)},delete(t){e.delete(t),n(t)},subscribe(e,n){let r=t.get(e);return r||(r=new Set,t.set(e,r)),r.add(n),()=>{r.delete(n),0===r.size&&t.delete(e)}}}}const h=(e=!1)=>(...t)=>(...n)=>{const r=t.flat();return e&&r.reverse(),r.reduce(((e,t)=>[t(...e)]),n)[0]},v=h(),m=h(!0),y=window.ReactJSXRuntime;const g=function(e){return a((t=>n=>e(n)?(0,y.jsx)(t,{...n}):null),"ifCondition")},b=window.wp.isShallowEqual;var w=n.n(b);const E=window.wp.element,S=a((function(e){return e.prototype instanceof E.Component?class extends e{shouldComponentUpdate(e,t){return!w()(e,this.props)||!w()(t,this.state)}}:class extends E.Component{shouldComponentUpdate(e){return!w()(e,this.props)}render(){return(0,y.jsx)(e,{...this.props})}}}),"pure"),x=window.wp.deprecated;var k=n.n(x);const T=new class{constructor(){this.listeners={},this.handleEvent=this.handleEvent.bind(this)}add(e,t){this.listeners[e]||(window.addEventListener(e,this.handleEvent),this.listeners[e]=[]),this.listeners[e].push(t)}remove(e,t){this.listeners[e]&&(this.listeners[e]=this.listeners[e].filter((e=>e!==t)),this.listeners[e].length||(window.removeEventListener(e,this.handleEvent),delete this.listeners[e]))}handleEvent(e){this.listeners[e.type]?.forEach((t=>{t.handleEvent(e)}))}};function C(e){return k()("wp.compose.withGlobalEvents",{since:"5.7",alternative:"useEffect"}),a((t=>{class n extends E.Component{constructor(e){super(e),this.handleEvent=this.handleEvent.bind(this),this.handleRef=this.handleRef.bind(this)}componentDidMount(){Object.keys(e).forEach((e=>{T.add(e,this)}))}componentWillUnmount(){Object.keys(e).forEach((e=>{T.remove(e,this)}))}handleEvent(t){const n=e[t.type];"function"==typeof this.wrappedRef[n]&&this.wrappedRef[n](t)}handleRef(e){this.wrappedRef=e,this.props.forwardedRef&&this.props.forwardedRef(e)}render(){return(0,y.jsx)(t,{...this.props.ownProps,ref:this.handleRef})}}return(0,E.forwardRef)(((e,t)=>(0,y.jsx)(n,{ownProps:e,forwardedRef:t})))}),"withGlobalEvents")}const L=new WeakMap;const R=function(e,t,n){return(0,E.useMemo)((()=>{if(n)return n;const r=function(e){const t=L.get(e)||0;return L.set(e,t+1),t}(e);return t?`${t}-${r}`:r}),[e,n,t])},D=a((e=>t=>{const n=R(e);return(0,y.jsx)(e,{...t,instanceId:n})}),"instanceId"),O=a((e=>class extends E.Component{constructor(e){super(e),this.timeouts=[],this.setTimeout=this.setTimeout.bind(this),this.clearTimeout=this.clearTimeout.bind(this)}componentWillUnmount(){this.timeouts.forEach(clearTimeout)}setTimeout(e,t){const n=setTimeout((()=>{e(),this.clearTimeout(n)}),t);return this.timeouts.push(n),n}clearTimeout(e){clearTimeout(e),this.timeouts=this.timeouts.filter((t=>t!==e))}render(){return(0,y.jsx)(e,{...this.props,setTimeout:this.setTimeout,clearTimeout:this.clearTimeout})}}),"withSafeTimeout");function M(e={}){return k()("wp.compose.withState",{since:"5.8",alternative:"wp.element.useState"}),a((t=>class extends E.Component{constructor(t){super(t),this.setState=this.setState.bind(this),this.state=e}render(){return(0,y.jsx)(t,{...this.props,...this.state,setState:this.setState})}}),"withState")}const _=window.wp.dom;function A(e,t){const n=(0,E.useRef)();return(0,E.useCallback)((t=>{t?n.current=e(t):n.current&&n.current()}),t)}const j=function(){return A((e=>{function t(t){const{key:n,shiftKey:r,target:o}=t;if("Tab"!==n)return;const i=r?"findPrevious":"findNext",u=_.focus.tabbable[i](o)||null;if(o.contains(u))return t.preventDefault(),void u?.focus();if(e.contains(u))return;const c=r?"append":"prepend",{ownerDocument:s}=e,a=s.createElement("div");a.tabIndex=-1,e[c](a),a.addEventListener("blur",(()=>e.removeChild(a))),a.focus()}return e.addEventListener("keydown",t),()=>{e.removeEventListener("keydown",t)}}),[])};var P=n(3758),I=n.n(P);function z(e,t,n=4e3){k()("wp.compose.useCopyOnClick",{since:"5.8",alternative:"wp.compose.useCopyToClipboard"});const r=(0,E.useRef)(),[o,i]=(0,E.useState)(!1);return(0,E.useEffect)((()=>{let o;if(e.current)return r.current=new(I())(e.current,{text:()=>"function"==typeof t?t():t}),r.current.on("success",(({clearSelection:e,trigger:t})=>{e(),t&&t.focus(),n&&(i(!0),clearTimeout(o),o=setTimeout((()=>i(!1)),n))})),()=>{r.current&&r.current.destroy(),clearTimeout(o)}}),[t,n,i]),o}function N(e){const t=(0,E.useRef)(e);return(0,E.useLayoutEffect)((()=>{t.current=e}),[e]),t}function U(e,t){const n=N(e),r=N(t);return A((e=>{const t=new(I())(e,{text:()=>"function"==typeof n.current?n.current():n.current||""});return t.on("success",(({clearSelection:e})=>{e(),r.current&&r.current()})),()=>{t.destroy()}}),[])}const V=window.wp.keycodes;function q(e="firstElement"){const t=(0,E.useRef)(e),n=e=>{e.focus({preventScroll:!0})},r=(0,E.useRef)();return(0,E.useEffect)((()=>{t.current=e}),[e]),A((e=>{var o;if(e&&!1!==t.current&&!e.contains(null!==(o=e.ownerDocument?.activeElement)&&void 0!==o?o:null)){if("firstElement"===t.current)return r.current=setTimeout((()=>{const t=_.focus.tabbable.find(e)[0];t&&n(t)}),0),()=>{r.current&&clearTimeout(r.current)};n(e)}}),[])}let K=null;const W=function(e){const t=(0,E.useRef)(null),n=(0,E.useRef)(null),r=(0,E.useRef)(e);return(0,E.useEffect)((()=>{r.current=e}),[e]),(0,E.useCallback)((e=>{if(e){var o;if(t.current=e,n.current)return;const r=e.ownerDocument.activeElement instanceof window.HTMLIFrameElement?e.ownerDocument.activeElement.contentDocument:e.ownerDocument;n.current=null!==(o=r?.activeElement)&&void 0!==o?o:null}else if(n.current){const e=t.current?.contains(t.current?.ownerDocument.activeElement);var i;if(t.current?.isConnected&&!e)return void(null!==(i=K)&&void 0!==i||(K=n.current));r.current?r.current():(n.current.isConnected?n.current:K)?.focus(),K=null}}),[])},H=["button","submit"];function $(e){const t=(0,E.useRef)(e);(0,E.useEffect)((()=>{t.current=e}),[e]);const n=(0,E.useRef)(!1),r=(0,E.useRef)(),o=(0,E.useCallback)((()=>{clearTimeout(r.current)}),[]);(0,E.useEffect)((()=>()=>o()),[]),(0,E.useEffect)((()=>{e||o()}),[e,o]);const i=(0,E.useCallback)((e=>{const{type:t,target:r}=e;["mouseup","touchend"].includes(t)?n.current=!1:function(e){if(!(e instanceof window.HTMLElement))return!1;switch(e.nodeName){case"A":case"BUTTON":return!0;case"INPUT":return H.includes(e.type)}return!1}(r)&&(n.current=!0)}),[]),u=(0,E.useCallback)((e=>{if(e.persist(),n.current)return;const o=e.target.getAttribute("data-unstable-ignore-focus-outside-for-relatedtarget");o&&e.relatedTarget?.closest(o)||(r.current=setTimeout((()=>{document.hasFocus()?"function"==typeof t.current&&t.current(e):e.preventDefault()}),0))}),[]);return{onFocus:o,onMouseDown:i,onMouseUp:i,onTouchStart:i,onTouchEnd:i,onBlur:u}}function F(e,t){"function"==typeof e?e(t):e&&e.hasOwnProperty("current")&&(e.current=t)}function B(e){const t=(0,E.useRef)(),n=(0,E.useRef)(!1),r=(0,E.useRef)(!1),o=(0,E.useRef)([]),i=(0,E.useRef)(e);return i.current=e,(0,E.useLayoutEffect)((()=>{!1===r.current&&!0===n.current&&e.forEach(((e,n)=>{const r=o.current[n];e!==r&&(F(r,null),F(e,t.current))})),o.current=e}),e),(0,E.useLayoutEffect)((()=>{r.current=!1})),(0,E.useCallback)((e=>{F(t,e),r.current=!0,n.current=null!==e;const u=e?i.current:o.current;for(const t of u)F(t,e)}),[])}const G=function(e){const t=(0,E.useRef)(),{constrainTabbing:n=!1!==e.focusOnMount}=e;(0,E.useEffect)((()=>{t.current=e}),Object.values(e));const r=j(),o=q(e.focusOnMount),i=W(),u=$((e=>{t.current?.__unstableOnClose?t.current.__unstableOnClose("focus-outside",e):t.current?.onClose&&t.current.onClose()})),c=(0,E.useCallback)((e=>{e&&e.addEventListener("keydown",(e=>{e.keyCode===V.ESCAPE&&!e.defaultPrevented&&t.current?.onClose&&(e.preventDefault(),t.current.onClose())}))}),[]);return[B([n?r:null,!1!==e.focusOnMount?i:null,!1!==e.focusOnMount?o:null,c]),{...u,tabIndex:-1}]};function Z({isDisabled:e=!1}={}){return A((t=>{if(e)return;const n=t?.ownerDocument?.defaultView;if(!n)return;const r=[],o=()=>{t.childNodes.forEach((e=>{e instanceof n.HTMLElement&&(e.getAttribute("inert")||(e.setAttribute("inert","true"),r.push((()=>{e.removeAttribute("inert")}))))}))},i=f(o,0,{leading:!0});o();const u=new window.MutationObserver(i);return u.observe(t,{childList:!0}),()=>{u&&u.disconnect(),i.cancel(),r.forEach((e=>e()))}}),[e])}function Q(e){const t=(0,E.useRef)((()=>{throw new Error("Callbacks created with `useEvent` cannot be called during rendering.")}));return(0,E.useInsertionEffect)((()=>{t.current=e})),(0,E.useCallback)(((...e)=>t.current?.(...e)),[])}const X="undefined"!=typeof window?E.useLayoutEffect:E.useEffect;function Y({onDragStart:e,onDragMove:t,onDragEnd:n}){const[r,o]=(0,E.useState)(!1),i=(0,E.useRef)({onDragStart:e,onDragMove:t,onDragEnd:n});X((()=>{i.current.onDragStart=e,i.current.onDragMove=t,i.current.onDragEnd=n}),[e,t,n]);const u=(0,E.useCallback)((e=>i.current.onDragMove&&i.current.onDragMove(e)),[]),c=(0,E.useCallback)((e=>{i.current.onDragEnd&&i.current.onDragEnd(e),document.removeEventListener("mousemove",u),document.removeEventListener("mouseup",c),o(!1)}),[]),s=(0,E.useCallback)((e=>{i.current.onDragStart&&i.current.onDragStart(e),document.addEventListener("mousemove",u),document.addEventListener("mouseup",c),o(!0)}),[]);return(0,E.useEffect)((()=>()=>{r&&(document.removeEventListener("mousemove",u),document.removeEventListener("mouseup",c))}),[r]),{startDrag:s,endDrag:c,isDragging:r}}var J=n(1933),ee=n.n(J);n(5760);const te=function(e,t,{bindGlobal:n=!1,eventName:r="keydown",isDisabled:o=!1,target:i}={}){const u=(0,E.useRef)(t);(0,E.useEffect)((()=>{u.current=t}),[t]),(0,E.useEffect)((()=>{if(o)return;const t=new(ee())(i&&i.current?i.current:document);return(Array.isArray(e)?e:[e]).forEach((e=>{const o=e.split("+"),i=new Set(o.filter((e=>e.length>1))),c=i.has("alt"),s=i.has("shift");if((0,V.isAppleOS)()&&(1===i.size&&c||2===i.size&&c&&s))throw new Error(`Cannot bind ${e}. Alt and Shift+Alt modifiers are reserved for character input.`);t[n?"bindGlobal":"bind"](e,((...e)=>u.current(...e)),r)})),()=>{t.reset()}}),[e,n,r,i,o])},ne=new Map;function re(e){const t=(0,E.useMemo)((()=>{const t=function(e){if(!e)return null;let t=ne.get(e);return t||("undefined"!=typeof window&&"function"==typeof window.matchMedia?(t=window.matchMedia(e),ne.set(e,t),t):null)}(e);return{subscribe:e=>t?(t.addEventListener?.("change",e),()=>{t.removeEventListener?.("change",e)}):()=>{},getValue(){var e;return null!==(e=t?.matches)&&void 0!==e&&e}}}),[e]);return(0,E.useSyncExternalStore)(t.subscribe,t.getValue,(()=>!1))}function oe(e){const t=(0,E.useRef)();return(0,E.useEffect)((()=>{t.current=e}),[e]),t.current}const ie=()=>re("(prefers-reduced-motion: reduce)");function ue(e,t){const n={...e};return Object.entries(t).forEach((([e,t])=>{n[e]?n[e]={...n[e],to:t.to}:n[e]=t})),n}const ce=(e,t)=>{const n=e?.findIndex((({id:e})=>"string"==typeof e?e===t.id:w()(e,t.id))),r=[...e];return-1!==n?r[n]={id:t.id,changes:ue(r[n].changes,t.changes)}:r.push(t),r};function se(){let e=[],t=[],n=0;const r=()=>{e=e.slice(0,n||void 0),n=0},o=()=>{var n;const r=0===e.length?0:e.length-1;let o=null!==(n=e[r])&&void 0!==n?n:[];t.forEach((e=>{o=ce(o,e)})),t=[],e[r]=o};return{addRecord(n,i=!1){const u=!n||(e=>!e.filter((({changes:e})=>Object.values(e).some((({from:e,to:t})=>"function"!=typeof e&&"function"!=typeof t&&!w()(e,t))))).length)(n);if(i){if(u)return;n.forEach((e=>{t=ce(t,e)}))}else{if(r(),t.length&&o(),u)return;e.push(n)}},undo(){t.length&&(r(),o());const i=e[e.length-1+n];if(i)return n-=1,i},redo(){const t=e[e.length+n];if(t)return n+=1,t},hasUndo:()=>!!e[e.length-1+n],hasRedo:()=>!!e[e.length+n]}}function ae(e,t){switch(t.type){case"UNDO":{const t=e.manager.undo();return t?{...e,value:t[0].changes.prop.from}:e}case"REDO":{const t=e.manager.redo();return t?{...e,value:t[0].changes.prop.to}:e}case"RECORD":return e.manager.addRecord([{id:"object",changes:{prop:{from:e.value,to:t.value}}}],t.isStaged),{...e,value:t.value}}return e}function le(e){return{manager:se(),value:e}}function fe(e){const[t,n]=(0,E.useReducer)(ae,e,le);return{value:t.value,setValue:(0,E.useCallback)(((e,t)=>{n({type:"RECORD",value:e,isStaged:t})}),[]),hasUndo:t.manager.hasUndo(),hasRedo:t.manager.hasRedo(),undo:(0,E.useCallback)((()=>{n({type:"UNDO"})}),[]),redo:(0,E.useCallback)((()=>{n({type:"REDO"})}),[])}}const de={xhuge:1920,huge:1440,wide:1280,xlarge:1080,large:960,medium:782,small:600,mobile:480},pe={">=":"min-width","<":"max-width"},he={">=":(e,t)=>t>=e,"<":(e,t)=>t=")=>{const n=(0,E.useContext)(ve),r=re(!n&&`(${pe[t]}: ${de[e]}px)`||void 0);return n?he[t](de[e],n):r};me.__experimentalWidthProvider=ve.Provider;const ye=me;function ge(e,t={}){const n=Q(e),r=(0,E.useRef)(),o=(0,E.useRef)();return Q((e=>{var i;if(e===r.current)return;null!==(i=o.current)&&void 0!==i||(o.current=new ResizeObserver(n));const{current:u}=o;r.current&&u.unobserve(r.current),r.current=e,e&&u.observe(e,t)}))}const be=e=>{let t;if(e.contentBoxSize)if(e.contentBoxSize[0]){const n=e.contentBoxSize[0];t=[n.inlineSize,n.blockSize]}else{const n=e.contentBoxSize;t=[n.inlineSize,n.blockSize]}else t=[e.contentRect.width,e.contentRect.height];const[n,r]=t.map((e=>Math.round(e)));return{width:n,height:r}},we={position:"absolute",top:0,left:0,right:0,bottom:0,pointerEvents:"none",opacity:0,overflow:"hidden",zIndex:-1};function Ee({onResize:e}){const t=ge((t=>{const n=be(t.at(-1));e(n)}));return(0,y.jsx)("div",{ref:t,style:we,"aria-hidden":"true"})}const Se={width:null,height:null};function xe(e,t={}){return e?ge(e,t):function(){const[e,t]=(0,E.useState)(Se),n=(0,E.useRef)(Se),r=(0,E.useCallback)((e=>{var r,o;o=e,((r=n.current).width!==o.width||r.height!==o.height)&&(n.current=e,t(e))}),[]);return[(0,y.jsx)(Ee,{onResize:r}),e]}()}const ke=window.wp.priorityQueue;const Te=function(e,t={step:1}){const{step:n=1}=t,[r,o]=(0,E.useState)([]);return(0,E.useEffect)((()=>{let t=function(e,t){const n=[];for(let r=0;r{(0,E.flushSync)((()=>{o((t=>[...t,...e.slice(r,r+n)]))}))}));return()=>i.reset()}),[e]),r};const Ce=function(e,t="Change detection"){const n=oe(e);Object.entries(null!=n?n:[]).forEach((([n,r])=>{r!==e[n]&&console.warn(`${t}: ${n} key changed:`,r,e[n])}))},Le=window.React;function Re(e,t){var n=(0,Le.useState)((function(){return{inputs:t,result:e()}}))[0],r=(0,Le.useRef)(!0),o=(0,Le.useRef)(n),i=r.current||Boolean(t&&o.current.inputs&&function(e,t){if(e.length!==t.length)return!1;for(var n=0;nf(e,null!=t?t:0,n)),[e,t,n]);return(0,E.useEffect)((()=>()=>r.cancel()),[r]),r}function Oe(e=""){const[t,n]=(0,E.useState)(e),[r,o]=(0,E.useState)(e),i=De(o,250);return(0,E.useEffect)((()=>{i(t)}),[t,i]),[t,n,r]}function Me(e,t,n){const r=Re((()=>d(e,null!=t?t:0,n)),[e,t,n]);return(0,E.useEffect)((()=>()=>r.cancel()),[r]),r}function _e({dropZoneElement:e,isDisabled:t,onDrop:n,onDragStart:r,onDragEnter:o,onDragLeave:i,onDragEnd:u,onDragOver:c}){const s=Q(n),a=Q(r),l=Q(o),f=Q(i),d=Q(u),p=Q(c);return A((h=>{if(t)return;const v=null!=e?e:h;let m=!1;const{ownerDocument:y}=v;function g(e){m||(m=!0,y.addEventListener("dragend",x),y.addEventListener("mousemove",x),r&&a(e))}function b(e){e.preventDefault(),v.contains(e.relatedTarget)||o&&l(e)}function w(e){!e.defaultPrevented&&c&&p(e),e.preventDefault()}function E(e){(function(e){const{defaultView:t}=y;if(!(e&&t&&e instanceof t.HTMLElement&&v.contains(e)))return!1;let n=e;do{if(n.dataset.isDropZone)return n===v}while(n=n.parentElement);return!1})(e.relatedTarget)||i&&f(e)}function S(e){e.defaultPrevented||(e.preventDefault(),e.dataTransfer&&e.dataTransfer.files.length,n&&s(e),x(e))}function x(e){m&&(m=!1,y.removeEventListener("dragend",x),y.removeEventListener("mousemove",x),u&&d(e))}return v.setAttribute("data-is-drop-zone","true"),v.addEventListener("drop",S),v.addEventListener("dragenter",b),v.addEventListener("dragover",w),v.addEventListener("dragleave",E),y.addEventListener("dragenter",g),()=>{v.removeAttribute("data-is-drop-zone"),v.removeEventListener("drop",S),v.removeEventListener("dragenter",b),v.removeEventListener("dragover",w),v.removeEventListener("dragleave",E),y.removeEventListener("dragend",x),y.removeEventListener("mousemove",x),y.removeEventListener("dragenter",g)}}),[t,e])}function Ae(){return A((e=>{const{ownerDocument:t}=e;if(!t)return;const{defaultView:n}=t;if(n)return n.addEventListener("blur",r),()=>{n.removeEventListener("blur",r)};function r(){t&&t.activeElement===e&&e.focus()}}),[])}const je=30;function Pe(e,t,n,r){var o,i;const u=null!==(o=r?.initWindowSize)&&void 0!==o?o:je,c=null===(i=r?.useWindowing)||void 0===i||i,[s,a]=(0,E.useState)({visibleItems:u,start:0,end:u,itemInView:e=>e>=0&&e<=u});return(0,E.useLayoutEffect)((()=>{if(!c)return;const o=(0,_.getScrollContainer)(e.current),i=e=>{var i;if(!o)return;const u=Math.ceil(o.clientHeight/t),c=e?u:null!==(i=r?.windowOverscan)&&void 0!==i?i:u,s=Math.floor(o.scrollTop/t),l=Math.max(0,s-c),f=Math.min(n-1,s+u+c);a((e=>{const t={visibleItems:u,start:l,end:f,itemInView:e=>l<=e&&e<=f};return e.start!==t.start||e.end!==t.end||e.visibleItems!==t.visibleItems?t:e}))};i(!0);const u=f((()=>{i()}),16);return o?.addEventListener("scroll",u),o?.ownerDocument?.defaultView?.addEventListener("resize",u),o?.ownerDocument?.defaultView?.addEventListener("resize",u),()=>{o?.removeEventListener("scroll",u),o?.ownerDocument?.defaultView?.removeEventListener("resize",u)}}),[t,e,n,r?.expandedState,r?.windowOverscan,c]),(0,E.useLayoutEffect)((()=>{if(!c)return;const r=(0,_.getScrollContainer)(e.current),o=e=>{switch(e.keyCode){case V.HOME:return r?.scrollTo({top:0});case V.END:return r?.scrollTo({top:n*t});case V.PAGEUP:return r?.scrollTo({top:r.scrollTop-s.visibleItems*t});case V.PAGEDOWN:return r?.scrollTo({top:r.scrollTop+s.visibleItems*t})}};return r?.ownerDocument?.defaultView?.addEventListener("keydown",o),()=>{r?.ownerDocument?.defaultView?.removeEventListener("keydown",o)}}),[n,t,e,s.visibleItems,c,r?.expandedState]),[s,a]}function Ie(e,t){const[n,r]=(0,E.useMemo)((()=>[n=>e.subscribe(t,n),()=>e.get(t)]),[e,t]);return(0,E.useSyncExternalStore)(n,r,r)}})(),(window.wp=window.wp||{}).compose=r})(); \ No newline at end of file diff --git a/wp-includes/js/dist/core-commands.js b/wp-includes/js/dist/core-commands.js index ed66527d0f..5bfd1e5f94 100644 --- a/wp-includes/js/dist/core-commands.js +++ b/wp-includes/js/dist/core-commands.js @@ -110,7 +110,7 @@ const { const { useHistory } = unlock(external_wp_router_namespaceObject.privateApis); -function useAddNewPageCommand() { +const getAddNewPageCommand = () => function useAddNewPageCommand() { const isSiteEditor = (0,external_wp_url_namespaceObject.getPath)(window.location.href)?.includes('site-editor.php'); const history = useHistory(); const isBlockBasedTheme = (0,external_wp_data_namespaceObject.useSelect)(select => { @@ -132,11 +132,7 @@ function useAddNewPageCommand() { throwOnError: true }); if (page?.id) { - history.push({ - postId: page.id, - postType: 'page', - canvas: 'edit' - }); + history.navigate(`/page/${page.id}?canvas=edit`); } } catch (error) { const errorMessage = error.message && error.code !== 'unknown_error' ? error.message : (0,external_wp_i18n_namespaceObject.__)('An error occurred while creating the item.'); @@ -160,19 +156,19 @@ function useAddNewPageCommand() { isLoading: false, commands }; -} +}; function useAdminNavigationCommands() { (0,external_wp_commands_namespaceObject.useCommand)({ name: 'core/add-new-post', label: (0,external_wp_i18n_namespaceObject.__)('Add new post'), icon: library_plus, callback: () => { - document.location.href = 'post-new.php'; + document.location.assign('post-new.php'); } }); (0,external_wp_commands_namespaceObject.useCommandLoader)({ name: 'core/add-new-page', - hook: useAddNewPageCommand + hook: getAddNewPageCommand() }); } @@ -197,7 +193,6 @@ const post = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(exter */ - const page = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", @@ -312,6 +307,7 @@ function orderEntityRecordsBySearch(records = [], search = '') { } ;// ./node_modules/@wordpress/core-commands/build-module/site-editor-navigation-commands.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -416,16 +412,13 @@ const getNavigationCommandLoaderPerPostType = postType => function useNavigation callback: ({ close }) => { - const args = { - postType, - postId: record.id, - canvas: 'edit' - }; - const targetUrl = (0,external_wp_url_namespaceObject.addQueryArgs)('site-editor.php', args); if (isSiteEditor) { - history.push(args); + history.navigate(`/${postType}/${record.id}?canvas=edit`); } else { - document.location = targetUrl; + document.location = (0,external_wp_url_namespaceObject.addQueryArgs)('site-editor.php', { + p: `/${postType}/${record.id}`, + canvas: 'edit' + }); } close(); } @@ -492,16 +485,13 @@ const getNavigationCommandLoaderPerTemplate = templateType => function useNaviga callback: ({ close }) => { - const args = { - postType: templateType, - postId: record.id, - canvas: 'edit' - }; - const targetUrl = (0,external_wp_url_namespaceObject.addQueryArgs)('site-editor.php', args); if (isSiteEditor) { - history.push(args); + history.navigate(`/${templateType}/${record.id}?canvas=edit`); } else { - document.location = targetUrl; + document.location = (0,external_wp_url_namespaceObject.addQueryArgs)('site-editor.php', { + p: `/${templateType}/${record.id}`, + canvas: 'edit' + }); } close(); } @@ -515,15 +505,14 @@ const getNavigationCommandLoaderPerTemplate = templateType => function useNaviga callback: ({ close }) => { - const args = { - postType: 'wp_template_part', - categoryId: 'all-parts' - }; - const targetUrl = (0,external_wp_url_namespaceObject.addQueryArgs)('site-editor.php', args); if (isSiteEditor) { - history.push(args); + history.navigate('/pattern?postType=wp_template_part&categoryId=all-parts'); } else { - document.location = targetUrl; + document.location = (0,external_wp_url_namespaceObject.addQueryArgs)('site-editor.php', { + p: '/pattern', + postType: 'wp_template_part', + categoryId: 'all-parts' + }); } close(); } @@ -536,11 +525,7 @@ const getNavigationCommandLoaderPerTemplate = templateType => function useNaviga isLoading }; }; -const usePageNavigationCommandLoader = getNavigationCommandLoaderPerPostType('page'); -const usePostNavigationCommandLoader = getNavigationCommandLoaderPerPostType('post'); -const useTemplateNavigationCommandLoader = getNavigationCommandLoaderPerTemplate('wp_template'); -const useTemplatePartNavigationCommandLoader = getNavigationCommandLoaderPerTemplate('wp_template_part'); -function useSiteEditorBasicNavigationCommands() { +const getSiteEditorBasicNavigationCommands = () => function useSiteEditorBasicNavigationCommands() { const history = site_editor_navigation_commands_useHistory(); const isSiteEditor = (0,external_wp_url_namespaceObject.getPath)(window.location.href)?.includes('site-editor.php'); const { @@ -565,14 +550,12 @@ function useSiteEditorBasicNavigationCommands() { callback: ({ close }) => { - const args = { - postType: 'wp_navigation' - }; - const targetUrl = (0,external_wp_url_namespaceObject.addQueryArgs)('site-editor.php', args); if (isSiteEditor) { - history.push(args); + history.navigate('/navigation'); } else { - document.location = targetUrl; + document.location = (0,external_wp_url_namespaceObject.addQueryArgs)('site-editor.php', { + p: '/navigation' + }); } close(); } @@ -584,14 +567,12 @@ function useSiteEditorBasicNavigationCommands() { callback: ({ close }) => { - const args = { - path: '/wp_global_styles' - }; - const targetUrl = (0,external_wp_url_namespaceObject.addQueryArgs)('site-editor.php', args); if (isSiteEditor) { - history.push(args); + history.navigate('/styles'); } else { - document.location = targetUrl; + document.location = (0,external_wp_url_namespaceObject.addQueryArgs)('site-editor.php', { + p: '/styles' + }); } close(); } @@ -603,14 +584,12 @@ function useSiteEditorBasicNavigationCommands() { callback: ({ close }) => { - const args = { - postType: 'page' - }; - const targetUrl = (0,external_wp_url_namespaceObject.addQueryArgs)('site-editor.php', args); if (isSiteEditor) { - history.push(args); + history.navigate('/page'); } else { - document.location = targetUrl; + document.location = (0,external_wp_url_namespaceObject.addQueryArgs)('site-editor.php', { + p: '/page' + }); } close(); } @@ -622,14 +601,12 @@ function useSiteEditorBasicNavigationCommands() { callback: ({ close }) => { - const args = { - postType: 'wp_template' - }; - const targetUrl = (0,external_wp_url_namespaceObject.addQueryArgs)('site-editor.php', args); if (isSiteEditor) { - history.push(args); + history.navigate('/template'); } else { - document.location = targetUrl; + document.location = (0,external_wp_url_namespaceObject.addQueryArgs)('site-editor.php', { + p: '/template' + }); } close(); } @@ -643,14 +620,12 @@ function useSiteEditorBasicNavigationCommands() { close }) => { if (canCreateTemplate) { - const args = { - postType: 'wp_block' - }; - const targetUrl = (0,external_wp_url_namespaceObject.addQueryArgs)('site-editor.php', args); if (isSiteEditor) { - history.push(args); + history.navigate('/pattern'); } else { - document.location = targetUrl; + document.location = (0,external_wp_url_namespaceObject.addQueryArgs)('site-editor.php', { + p: '/pattern' + }); } close(); } else { @@ -665,27 +640,27 @@ function useSiteEditorBasicNavigationCommands() { commands, isLoading: false }; -} +}; function useSiteEditorNavigationCommands() { (0,external_wp_commands_namespaceObject.useCommandLoader)({ name: 'core/edit-site/navigate-pages', - hook: usePageNavigationCommandLoader + hook: getNavigationCommandLoaderPerPostType('page') }); (0,external_wp_commands_namespaceObject.useCommandLoader)({ name: 'core/edit-site/navigate-posts', - hook: usePostNavigationCommandLoader + hook: getNavigationCommandLoaderPerPostType('post') }); (0,external_wp_commands_namespaceObject.useCommandLoader)({ name: 'core/edit-site/navigate-templates', - hook: useTemplateNavigationCommandLoader + hook: getNavigationCommandLoaderPerTemplate('wp_template') }); (0,external_wp_commands_namespaceObject.useCommandLoader)({ name: 'core/edit-site/navigate-template-parts', - hook: useTemplatePartNavigationCommandLoader + hook: getNavigationCommandLoaderPerTemplate('wp_template_part') }); (0,external_wp_commands_namespaceObject.useCommandLoader)({ name: 'core/edit-site/basic-navigation', - hook: useSiteEditorBasicNavigationCommands, + hook: getSiteEditorBasicNavigationCommands(), context: 'site-editor' }); } diff --git a/wp-includes/js/dist/core-commands.min.js b/wp-includes/js/dist/core-commands.min.js index 4d6830cb72..4cd6d86359 100644 --- a/wp-includes/js/dist/core-commands.min.js +++ b/wp-includes/js/dist/core-commands.min.js @@ -1,2 +1,2 @@ /*! This file is auto-generated */ -(()=>{"use strict";var e={d:(t,o)=>{for(var s in o)e.o(o,s)&&!e.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:o[s]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{privateApis:()=>R});const o=window.wp.commands,s=window.wp.i18n,a=window.wp.primitives,n=window.ReactJSXRuntime,r=(0,n.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,n.jsx)(a.Path,{d:"M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z"})}),i=window.wp.url,c=window.wp.coreData,p=window.wp.data,d=window.wp.element,l=window.wp.notices,m=window.wp.router,h=window.wp.privateApis,{lock:u,unlock:w}=(0,h.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/core-commands"),{useHistory:g}=w(m.privateApis);function _(){const e=(0,i.getPath)(window.location.href)?.includes("site-editor.php"),t=g(),o=(0,p.useSelect)((e=>e(c.store).getCurrentTheme()?.is_block_theme),[]),{saveEntityRecord:a}=(0,p.useDispatch)(c.store),{createErrorNotice:n}=(0,p.useDispatch)(l.store),m=(0,d.useCallback)((async({close:e})=>{try{const e=await a("postType","page",{status:"draft"},{throwOnError:!0});e?.id&&t.push({postId:e.id,postType:"page",canvas:"edit"})}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,s.__)("An error occurred while creating the item.");n(t,{type:"snackbar"})}finally{e()}}),[n,t,a]);return{isLoading:!1,commands:(0,d.useMemo)((()=>{const t=e&&o?m:()=>document.location.href="post-new.php?post_type=page";return[{name:"core/add-new-page",label:(0,s.__)("Add new page"),icon:r,callback:t}]}),[m,e,o])}}const v=(0,n.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,n.jsx)(a.Path,{d:"m7.3 9.7 1.4 1.4c.2-.2.3-.3.4-.5 0 0 0-.1.1-.1.3-.5.4-1.1.3-1.6L12 7 9 4 7.2 6.5c-.6-.1-1.1 0-1.6.3 0 0-.1 0-.1.1-.3.1-.4.2-.6.4l1.4 1.4L4 11v1h1l2.3-2.3zM4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4z"})}),y=(0,n.jsxs)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,n.jsx)(a.Path,{d:"M15.5 7.5h-7V9h7V7.5Zm-7 3.5h7v1.5h-7V11Zm7 3.5h-7V16h7v-1.5Z"}),(0,n.jsx)(a.Path,{d:"M17 4H7a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2ZM7 5.5h10a.5.5 0 0 1 .5.5v12a.5.5 0 0 1-.5.5H7a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .5-.5Z"})]}),b=(0,n.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,n.jsx)(a.Path,{d:"M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"})}),k=(0,n.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,n.jsx)(a.Path,{d:"M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-17.6 1L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"})}),f=(0,n.jsx)(a.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,n.jsx)(a.Path,{d:"M12 4c-4.4 0-8 3.6-8 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8zm0 14.5c-3.6 0-6.5-2.9-6.5-6.5S8.4 5.5 12 5.5s6.5 2.9 6.5 6.5-2.9 6.5-6.5 6.5zM9 16l4.5-3L15 8.4l-4.5 3L9 16z"})}),T=(0,n.jsx)(a.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,n.jsx)(a.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M20 12a8 8 0 1 1-16 0 8 8 0 0 1 16 0Zm-1.5 0a6.5 6.5 0 0 1-6.5 6.5v-13a6.5 6.5 0 0 1 6.5 6.5Z"})}),x=(0,n.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,n.jsx)(a.Path,{d:"M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-1 1.4l-5.6 5.6c-.1.1-.3.1-.4 0l-5.6-5.6c-.1-.1-.1-.3 0-.4l5.6-5.6s.1-.1.2-.1.1 0 .2.1l5.6 5.6c.1.1.1.3 0 .4zm-16.6-.4L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"})}),L=window.wp.compose,V=window.wp.htmlEntities;const{useHistory:C}=w(m.privateApis),S={post:v,page:y,wp_template:b,wp_template_part:k};const j=e=>function({search:t}){const o=C(),{isBlockBasedTheme:a,canCreateTemplate:n}=(0,p.useSelect)((e=>({isBlockBasedTheme:e(c.store).getCurrentTheme()?.is_block_theme,canCreateTemplate:e(c.store).canUser("create",{kind:"postType",name:"wp_template"})})),[]),r=function(e){const[t,o]=(0,d.useState)(""),s=(0,L.useDebounce)(o,250);return(0,d.useEffect)((()=>(s(e),()=>s.cancel())),[s,e]),t}(t),{records:l,isLoading:m}=(0,p.useSelect)((t=>{if(!r)return{isLoading:!1};const o={search:r,per_page:10,orderby:"relevance",status:["publish","future","draft","pending","private"]};return{records:t(c.store).getEntityRecords("postType",e,o),isLoading:!t(c.store).hasFinishedResolution("getEntityRecords",["postType",e,o])}}),[r]);return{commands:(0,d.useMemo)((()=>(null!=l?l:[]).map((t=>{const r={name:e+"-"+t.id,searchLabel:t.title?.rendered+" "+t.id,label:t.title?.rendered?(0,V.decodeEntities)(t.title?.rendered):(0,s.__)("(no title)"),icon:S[e]};if(!n||"post"===e||"page"===e&&!a)return{...r,callback:({close:e})=>{const o={post:t.id,action:"edit"},s=(0,i.addQueryArgs)("post.php",o);document.location=s,e()}};const c=(0,i.getPath)(window.location.href)?.includes("site-editor.php");return{...r,callback:({close:s})=>{const a={postType:e,postId:t.id,canvas:"edit"},n=(0,i.addQueryArgs)("site-editor.php",a);c?o.push(a):document.location=n,s()}}}))),[n,l,a,o]),isLoading:m}},P=e=>function({search:t}){const o=C(),{isBlockBasedTheme:a,canCreateTemplate:n}=(0,p.useSelect)((t=>({isBlockBasedTheme:t(c.store).getCurrentTheme()?.is_block_theme,canCreateTemplate:t(c.store).canUser("create",{kind:"postType",name:e})})),[]),{records:r,isLoading:l}=(0,p.useSelect)((t=>{const{getEntityRecords:o}=t(c.store),s={per_page:-1};return{records:o("postType",e,s),isLoading:!t(c.store).hasFinishedResolution("getEntityRecords",["postType",e,s])}}),[]),m=(0,d.useMemo)((()=>function(e=[],t=""){if(!Array.isArray(e)||!e.length)return[];if(!t)return e;const o=[],s=[];for(let a=0;a{if(!n||!a&&"wp_template_part"===!e)return[];const t=(0,i.getPath)(window.location.href)?.includes("site-editor.php"),r=[];return r.push(...m.map((a=>({name:e+"-"+a.id,searchLabel:a.title?.rendered+" "+a.id,label:a.title?.rendered?a.title?.rendered:(0,s.__)("(no title)"),icon:S[e],callback:({close:s})=>{const n={postType:e,postId:a.id,canvas:"edit"},r=(0,i.addQueryArgs)("site-editor.php",n);t?o.push(n):document.location=r,s()}})))),m?.length>0&&"wp_template_part"===e&&r.push({name:"core/edit-site/open-template-parts",label:(0,s.__)("Template parts"),icon:k,callback:({close:e})=>{const s={postType:"wp_template_part",categoryId:"all-parts"},a=(0,i.addQueryArgs)("site-editor.php",s);t?o.push(s):document.location=a,e()}}),r}),[n,a,m,o]),isLoading:l}},B=j("page"),M=j("post"),A=P("wp_template"),z=P("wp_template_part");function H(){const e=C(),t=(0,i.getPath)(window.location.href)?.includes("site-editor.php"),{isBlockBasedTheme:o,canCreateTemplate:a}=(0,p.useSelect)((e=>({isBlockBasedTheme:e(c.store).getCurrentTheme()?.is_block_theme,canCreateTemplate:e(c.store).canUser("create",{kind:"postType",name:"wp_template"})})),[]);return{commands:(0,d.useMemo)((()=>{const n=[];return a&&o&&(n.push({name:"core/edit-site/open-navigation",label:(0,s.__)("Navigation"),icon:f,callback:({close:o})=>{const s={postType:"wp_navigation"},a=(0,i.addQueryArgs)("site-editor.php",s);t?e.push(s):document.location=a,o()}}),n.push({name:"core/edit-site/open-styles",label:(0,s.__)("Styles"),icon:T,callback:({close:o})=>{const s={path:"/wp_global_styles"},a=(0,i.addQueryArgs)("site-editor.php",s);t?e.push(s):document.location=a,o()}}),n.push({name:"core/edit-site/open-pages",label:(0,s.__)("Pages"),icon:y,callback:({close:o})=>{const s={postType:"page"},a=(0,i.addQueryArgs)("site-editor.php",s);t?e.push(s):document.location=a,o()}}),n.push({name:"core/edit-site/open-templates",label:(0,s.__)("Templates"),icon:b,callback:({close:o})=>{const s={postType:"wp_template"},a=(0,i.addQueryArgs)("site-editor.php",s);t?e.push(s):document.location=a,o()}})),n.push({name:"core/edit-site/open-patterns",label:(0,s.__)("Patterns"),icon:x,callback:({close:o})=>{if(a){const s={postType:"wp_block"},a=(0,i.addQueryArgs)("site-editor.php",s);t?e.push(s):document.location=a,o()}else document.location.href="edit.php?post_type=wp_block"}}),n}),[e,t,a,o]),isLoading:!1}}const R={};u(R,{useCommands:function(){(0,o.useCommand)({name:"core/add-new-post",label:(0,s.__)("Add new post"),icon:r,callback:()=>{document.location.href="post-new.php"}}),(0,o.useCommandLoader)({name:"core/add-new-page",hook:_}),(0,o.useCommandLoader)({name:"core/edit-site/navigate-pages",hook:B}),(0,o.useCommandLoader)({name:"core/edit-site/navigate-posts",hook:M}),(0,o.useCommandLoader)({name:"core/edit-site/navigate-templates",hook:A}),(0,o.useCommandLoader)({name:"core/edit-site/navigate-template-parts",hook:z}),(0,o.useCommandLoader)({name:"core/edit-site/basic-navigation",hook:H,context:"site-editor"})}}),(window.wp=window.wp||{}).coreCommands=t})(); \ No newline at end of file +(()=>{"use strict";var e={d:(t,a)=>{for(var o in a)e.o(a,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:a[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{privateApis:()=>P});const a=window.wp.commands,o=window.wp.i18n,s=window.wp.primitives,n=window.ReactJSXRuntime,i=(0,n.jsx)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,n.jsx)(s.Path,{d:"M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z"})}),r=window.wp.url,c=window.wp.coreData,d=window.wp.data,l=window.wp.element,p=window.wp.notices,m=window.wp.router,w=window.wp.privateApis,{lock:h,unlock:u}=(0,w.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/core-commands"),{useHistory:g}=u(m.privateApis);const v=(0,n.jsx)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,n.jsx)(s.Path,{d:"m7.3 9.7 1.4 1.4c.2-.2.3-.3.4-.5 0 0 0-.1.1-.1.3-.5.4-1.1.3-1.6L12 7 9 4 7.2 6.5c-.6-.1-1.1 0-1.6.3 0 0-.1 0-.1.1-.3.1-.4.2-.6.4l1.4 1.4L4 11v1h1l2.3-2.3zM4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4z"})}),_=(0,n.jsxs)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,n.jsx)(s.Path,{d:"M15.5 7.5h-7V9h7V7.5Zm-7 3.5h7v1.5h-7V11Zm7 3.5h-7V16h7v-1.5Z"}),(0,n.jsx)(s.Path,{d:"M17 4H7a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2ZM7 5.5h10a.5.5 0 0 1 .5.5v12a.5.5 0 0 1-.5.5H7a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .5-.5Z"})]}),y=(0,n.jsx)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,n.jsx)(s.Path,{d:"M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"})}),b=(0,n.jsx)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,n.jsx)(s.Path,{d:"M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-17.6 1L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"})}),k=(0,n.jsx)(s.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,n.jsx)(s.Path,{d:"M12 4c-4.4 0-8 3.6-8 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8zm0 14.5c-3.6 0-6.5-2.9-6.5-6.5S8.4 5.5 12 5.5s6.5 2.9 6.5 6.5-2.9 6.5-6.5 6.5zM9 16l4.5-3L15 8.4l-4.5 3L9 16z"})}),f=(0,n.jsx)(s.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,n.jsx)(s.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M20 12a8 8 0 1 1-16 0 8 8 0 0 1 16 0Zm-1.5 0a6.5 6.5 0 0 1-6.5 6.5v-13a6.5 6.5 0 0 1 6.5 6.5Z"})}),x=(0,n.jsx)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,n.jsx)(s.Path,{d:"M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-1 1.4l-5.6 5.6c-.1.1-.3.1-.4 0l-5.6-5.6c-.1-.1-.1-.3 0-.4l5.6-5.6s.1-.1.2-.1.1 0 .2.1l5.6 5.6c.1.1.1.3 0 .4zm-16.6-.4L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"})}),T=window.wp.compose,L=window.wp.htmlEntities;const{useHistory:V}=u(m.privateApis),C={post:v,page:_,wp_template:y,wp_template_part:b};const S=e=>function({search:t}){const a=V(),{isBlockBasedTheme:s,canCreateTemplate:n}=(0,d.useSelect)((e=>({isBlockBasedTheme:e(c.store).getCurrentTheme()?.is_block_theme,canCreateTemplate:e(c.store).canUser("create",{kind:"postType",name:"wp_template"})})),[]),i=function(e){const[t,a]=(0,l.useState)(""),o=(0,T.useDebounce)(a,250);return(0,l.useEffect)((()=>(o(e),()=>o.cancel())),[o,e]),t}(t),{records:p,isLoading:m}=(0,d.useSelect)((t=>{if(!i)return{isLoading:!1};const a={search:i,per_page:10,orderby:"relevance",status:["publish","future","draft","pending","private"]};return{records:t(c.store).getEntityRecords("postType",e,a),isLoading:!t(c.store).hasFinishedResolution("getEntityRecords",["postType",e,a])}}),[i]);return{commands:(0,l.useMemo)((()=>(null!=p?p:[]).map((t=>{const i={name:e+"-"+t.id,searchLabel:t.title?.rendered+" "+t.id,label:t.title?.rendered?(0,L.decodeEntities)(t.title?.rendered):(0,o.__)("(no title)"),icon:C[e]};if(!n||"post"===e||"page"===e&&!s)return{...i,callback:({close:e})=>{const a={post:t.id,action:"edit"},o=(0,r.addQueryArgs)("post.php",a);document.location=o,e()}};const c=(0,r.getPath)(window.location.href)?.includes("site-editor.php");return{...i,callback:({close:o})=>{c?a.navigate(`/${e}/${t.id}?canvas=edit`):document.location=(0,r.addQueryArgs)("site-editor.php",{p:`/${e}/${t.id}`,canvas:"edit"}),o()}}}))),[n,p,s,a]),isLoading:m}},j=e=>function({search:t}){const a=V(),{isBlockBasedTheme:s,canCreateTemplate:n}=(0,d.useSelect)((t=>({isBlockBasedTheme:t(c.store).getCurrentTheme()?.is_block_theme,canCreateTemplate:t(c.store).canUser("create",{kind:"postType",name:e})})),[]),{records:i,isLoading:p}=(0,d.useSelect)((t=>{const{getEntityRecords:a}=t(c.store),o={per_page:-1};return{records:a("postType",e,o),isLoading:!t(c.store).hasFinishedResolution("getEntityRecords",["postType",e,o])}}),[]),m=(0,l.useMemo)((()=>function(e=[],t=""){if(!Array.isArray(e)||!e.length)return[];if(!t)return e;const a=[],o=[];for(let s=0;s{if(!n||!s&&"wp_template_part"===!e)return[];const t=(0,r.getPath)(window.location.href)?.includes("site-editor.php"),i=[];return i.push(...m.map((s=>({name:e+"-"+s.id,searchLabel:s.title?.rendered+" "+s.id,label:s.title?.rendered?s.title?.rendered:(0,o.__)("(no title)"),icon:C[e],callback:({close:o})=>{t?a.navigate(`/${e}/${s.id}?canvas=edit`):document.location=(0,r.addQueryArgs)("site-editor.php",{p:`/${e}/${s.id}`,canvas:"edit"}),o()}})))),m?.length>0&&"wp_template_part"===e&&i.push({name:"core/edit-site/open-template-parts",label:(0,o.__)("Template parts"),icon:b,callback:({close:e})=>{t?a.navigate("/pattern?postType=wp_template_part&categoryId=all-parts"):document.location=(0,r.addQueryArgs)("site-editor.php",{p:"/pattern",postType:"wp_template_part",categoryId:"all-parts"}),e()}}),i}),[n,s,m,a]),isLoading:p}};const P={};h(P,{useCommands:function(){(0,a.useCommand)({name:"core/add-new-post",label:(0,o.__)("Add new post"),icon:i,callback:()=>{document.location.assign("post-new.php")}}),(0,a.useCommandLoader)({name:"core/add-new-page",hook:function(){const e=(0,r.getPath)(window.location.href)?.includes("site-editor.php"),t=g(),a=(0,d.useSelect)((e=>e(c.store).getCurrentTheme()?.is_block_theme),[]),{saveEntityRecord:s}=(0,d.useDispatch)(c.store),{createErrorNotice:n}=(0,d.useDispatch)(p.store),m=(0,l.useCallback)((async({close:e})=>{try{const e=await s("postType","page",{status:"draft"},{throwOnError:!0});e?.id&&t.navigate(`/page/${e.id}?canvas=edit`)}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,o.__)("An error occurred while creating the item.");n(t,{type:"snackbar"})}finally{e()}}),[n,t,s]);return{isLoading:!1,commands:(0,l.useMemo)((()=>{const t=e&&a?m:()=>document.location.href="post-new.php?post_type=page";return[{name:"core/add-new-page",label:(0,o.__)("Add new page"),icon:i,callback:t}]}),[m,e,a])}}}),(0,a.useCommandLoader)({name:"core/edit-site/navigate-pages",hook:S("page")}),(0,a.useCommandLoader)({name:"core/edit-site/navigate-posts",hook:S("post")}),(0,a.useCommandLoader)({name:"core/edit-site/navigate-templates",hook:j("wp_template")}),(0,a.useCommandLoader)({name:"core/edit-site/navigate-template-parts",hook:j("wp_template_part")}),(0,a.useCommandLoader)({name:"core/edit-site/basic-navigation",hook:function(){const e=V(),t=(0,r.getPath)(window.location.href)?.includes("site-editor.php"),{isBlockBasedTheme:a,canCreateTemplate:s}=(0,d.useSelect)((e=>({isBlockBasedTheme:e(c.store).getCurrentTheme()?.is_block_theme,canCreateTemplate:e(c.store).canUser("create",{kind:"postType",name:"wp_template"})})),[]);return{commands:(0,l.useMemo)((()=>{const n=[];return s&&a&&(n.push({name:"core/edit-site/open-navigation",label:(0,o.__)("Navigation"),icon:k,callback:({close:a})=>{t?e.navigate("/navigation"):document.location=(0,r.addQueryArgs)("site-editor.php",{p:"/navigation"}),a()}}),n.push({name:"core/edit-site/open-styles",label:(0,o.__)("Styles"),icon:f,callback:({close:a})=>{t?e.navigate("/styles"):document.location=(0,r.addQueryArgs)("site-editor.php",{p:"/styles"}),a()}}),n.push({name:"core/edit-site/open-pages",label:(0,o.__)("Pages"),icon:_,callback:({close:a})=>{t?e.navigate("/page"):document.location=(0,r.addQueryArgs)("site-editor.php",{p:"/page"}),a()}}),n.push({name:"core/edit-site/open-templates",label:(0,o.__)("Templates"),icon:y,callback:({close:a})=>{t?e.navigate("/template"):document.location=(0,r.addQueryArgs)("site-editor.php",{p:"/template"}),a()}})),n.push({name:"core/edit-site/open-patterns",label:(0,o.__)("Patterns"),icon:x,callback:({close:a})=>{s?(t?e.navigate("/pattern"):document.location=(0,r.addQueryArgs)("site-editor.php",{p:"/pattern"}),a()):document.location.href="edit.php?post_type=wp_block"}}),n}),[e,t,s,a]),isLoading:!1}},context:"site-editor"})}}),(window.wp=window.wp||{}).coreCommands=t})(); \ No newline at end of file diff --git a/wp-includes/js/dist/core-data.js b/wp-includes/js/dist/core-data.js index 38b327ebc2..3103eebb97 100644 --- a/wp-includes/js/dist/core-data.js +++ b/wp-includes/js/dist/core-data.js @@ -2,188 +2,6 @@ /******/ "use strict"; /******/ var __webpack_modules__ = ({ -/***/ 6689: -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ createUndoManager: () => (/* binding */ createUndoManager) -/* harmony export */ }); -/* harmony import */ var _wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(923); -/* harmony import */ var _wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_0__); -/** - * WordPress dependencies - */ - - -/** @typedef {import('./types').HistoryRecord} HistoryRecord */ -/** @typedef {import('./types').HistoryChange} HistoryChange */ -/** @typedef {import('./types').HistoryChanges} HistoryChanges */ -/** @typedef {import('./types').UndoManager} UndoManager */ - -/** - * Merge changes for a single item into a record of changes. - * - * @param {Record< string, HistoryChange >} changes1 Previous changes - * @param {Record< string, HistoryChange >} changes2 NextChanges - * - * @return {Record< string, HistoryChange >} Merged changes - */ -function mergeHistoryChanges(changes1, changes2) { - /** - * @type {Record< string, HistoryChange >} - */ - const newChanges = { - ...changes1 - }; - Object.entries(changes2).forEach(([key, value]) => { - if (newChanges[key]) { - newChanges[key] = { - ...newChanges[key], - to: value.to - }; - } else { - newChanges[key] = value; - } - }); - return newChanges; -} - -/** - * Adds history changes for a single item into a record of changes. - * - * @param {HistoryRecord} record The record to merge into. - * @param {HistoryChanges} changes The changes to merge. - */ -const addHistoryChangesIntoRecord = (record, changes) => { - const existingChangesIndex = record?.findIndex(({ - id: recordIdentifier - }) => { - return typeof recordIdentifier === 'string' ? recordIdentifier === changes.id : _wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_0___default()(recordIdentifier, changes.id); - }); - const nextRecord = [...record]; - if (existingChangesIndex !== -1) { - // If the edit is already in the stack leave the initial "from" value. - nextRecord[existingChangesIndex] = { - id: changes.id, - changes: mergeHistoryChanges(nextRecord[existingChangesIndex].changes, changes.changes) - }; - } else { - nextRecord.push(changes); - } - return nextRecord; -}; - -/** - * Creates an undo manager. - * - * @return {UndoManager} Undo manager. - */ -function createUndoManager() { - /** - * @type {HistoryRecord[]} - */ - let history = []; - /** - * @type {HistoryRecord} - */ - let stagedRecord = []; - /** - * @type {number} - */ - let offset = 0; - const dropPendingRedos = () => { - history = history.slice(0, offset || undefined); - offset = 0; - }; - const appendStagedRecordToLatestHistoryRecord = () => { - var _history$index; - const index = history.length === 0 ? 0 : history.length - 1; - let latestRecord = (_history$index = history[index]) !== null && _history$index !== void 0 ? _history$index : []; - stagedRecord.forEach(changes => { - latestRecord = addHistoryChangesIntoRecord(latestRecord, changes); - }); - stagedRecord = []; - history[index] = latestRecord; - }; - - /** - * Checks whether a record is empty. - * A record is considered empty if it the changes keep the same values. - * Also updates to function values are ignored. - * - * @param {HistoryRecord} record - * @return {boolean} Whether the record is empty. - */ - const isRecordEmpty = record => { - const filteredRecord = record.filter(({ - changes - }) => { - return Object.values(changes).some(({ - from, - to - }) => typeof from !== 'function' && typeof to !== 'function' && !_wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_0___default()(from, to)); - }); - return !filteredRecord.length; - }; - return { - /** - * Record changes into the history. - * - * @param {HistoryRecord=} record A record of changes to record. - * @param {boolean} isStaged Whether to immediately create an undo point or not. - */ - addRecord(record, isStaged = false) { - const isEmpty = !record || isRecordEmpty(record); - if (isStaged) { - if (isEmpty) { - return; - } - record.forEach(changes => { - stagedRecord = addHistoryChangesIntoRecord(stagedRecord, changes); - }); - } else { - dropPendingRedos(); - if (stagedRecord.length) { - appendStagedRecordToLatestHistoryRecord(); - } - if (isEmpty) { - return; - } - history.push(record); - } - }, - undo() { - if (stagedRecord.length) { - dropPendingRedos(); - appendStagedRecordToLatestHistoryRecord(); - } - const undoRecord = history[history.length - 1 + offset]; - if (!undoRecord) { - return; - } - offset -= 1; - return undoRecord; - }, - redo() { - const redoRecord = history[history.length + offset]; - if (!redoRecord) { - return; - } - offset += 1; - return redoRecord; - }, - hasUndo() { - return !!history[history.length - 1 + offset]; - }, - hasRedo() { - return !!history[history.length + offset]; - } - }; -} - - -/***/ }), - /***/ 3249: /***/ ((module) => { @@ -575,13 +393,6 @@ module.exports = function equal(a, b) { }; -/***/ }), - -/***/ 923: -/***/ ((module) => { - -module.exports = window["wp"]["isShallowEqual"]; - /***/ }) /******/ }); @@ -675,39 +486,6 @@ __webpack_require__.d(__webpack_exports__, { useResourcePermissions: () => (/* reexport */ use_resource_permissions) }); -// NAMESPACE OBJECT: ./node_modules/@wordpress/core-data/build-module/actions.js -var build_module_actions_namespaceObject = {}; -__webpack_require__.r(build_module_actions_namespaceObject); -__webpack_require__.d(build_module_actions_namespaceObject, { - __experimentalBatch: () => (__experimentalBatch), - __experimentalReceiveCurrentGlobalStylesId: () => (__experimentalReceiveCurrentGlobalStylesId), - __experimentalReceiveThemeBaseGlobalStyles: () => (__experimentalReceiveThemeBaseGlobalStyles), - __experimentalReceiveThemeGlobalStyleVariations: () => (__experimentalReceiveThemeGlobalStyleVariations), - __experimentalSaveSpecifiedEntityEdits: () => (__experimentalSaveSpecifiedEntityEdits), - __unstableCreateUndoLevel: () => (__unstableCreateUndoLevel), - addEntities: () => (addEntities), - deleteEntityRecord: () => (deleteEntityRecord), - editEntityRecord: () => (editEntityRecord), - receiveAutosaves: () => (receiveAutosaves), - receiveCurrentTheme: () => (receiveCurrentTheme), - receiveCurrentUser: () => (receiveCurrentUser), - receiveDefaultTemplateId: () => (receiveDefaultTemplateId), - receiveEmbedPreview: () => (receiveEmbedPreview), - receiveEntityRecords: () => (receiveEntityRecords), - receiveNavigationFallbackId: () => (receiveNavigationFallbackId), - receiveRevisions: () => (receiveRevisions), - receiveThemeGlobalStyleRevisions: () => (receiveThemeGlobalStyleRevisions), - receiveThemeSupports: () => (receiveThemeSupports), - receiveUploadPermissions: () => (receiveUploadPermissions), - receiveUserPermission: () => (receiveUserPermission), - receiveUserPermissions: () => (receiveUserPermissions), - receiveUserQuery: () => (receiveUserQuery), - redo: () => (redo), - saveEditedEntityRecord: () => (saveEditedEntityRecord), - saveEntityRecord: () => (saveEntityRecord), - undo: () => (undo) -}); - // NAMESPACE OBJECT: ./node_modules/@wordpress/core-data/build-module/selectors.js var build_module_selectors_namespaceObject = {}; __webpack_require__.r(build_module_selectors_namespaceObject); @@ -718,7 +496,6 @@ __webpack_require__.d(build_module_selectors_namespaceObject, { __experimentalGetDirtyEntityRecords: () => (__experimentalGetDirtyEntityRecords), __experimentalGetEntitiesBeingSaved: () => (__experimentalGetEntitiesBeingSaved), __experimentalGetEntityRecordNoResolver: () => (__experimentalGetEntityRecordNoResolver), - __experimentalGetTemplateForLink: () => (__experimentalGetTemplateForLink), canUser: () => (canUser), canUserEditEntityRecord: () => (canUserEditEntityRecord), getAuthors: () => (getAuthors), @@ -772,11 +549,47 @@ __webpack_require__.d(private_selectors_namespaceObject, { getBlockPatternsForPostType: () => (getBlockPatternsForPostType), getEntityRecordPermissions: () => (getEntityRecordPermissions), getEntityRecordsPermissions: () => (getEntityRecordsPermissions), + getHomePage: () => (getHomePage), getNavigationFallbackId: () => (getNavigationFallbackId), + getPostsPageId: () => (getPostsPageId), getRegisteredPostMeta: () => (getRegisteredPostMeta), + getTemplateId: () => (getTemplateId), getUndoManager: () => (getUndoManager) }); +// NAMESPACE OBJECT: ./node_modules/@wordpress/core-data/build-module/actions.js +var build_module_actions_namespaceObject = {}; +__webpack_require__.r(build_module_actions_namespaceObject); +__webpack_require__.d(build_module_actions_namespaceObject, { + __experimentalBatch: () => (__experimentalBatch), + __experimentalReceiveCurrentGlobalStylesId: () => (__experimentalReceiveCurrentGlobalStylesId), + __experimentalReceiveThemeBaseGlobalStyles: () => (__experimentalReceiveThemeBaseGlobalStyles), + __experimentalReceiveThemeGlobalStyleVariations: () => (__experimentalReceiveThemeGlobalStyleVariations), + __experimentalSaveSpecifiedEntityEdits: () => (__experimentalSaveSpecifiedEntityEdits), + __unstableCreateUndoLevel: () => (__unstableCreateUndoLevel), + addEntities: () => (addEntities), + deleteEntityRecord: () => (deleteEntityRecord), + editEntityRecord: () => (editEntityRecord), + receiveAutosaves: () => (receiveAutosaves), + receiveCurrentTheme: () => (receiveCurrentTheme), + receiveCurrentUser: () => (receiveCurrentUser), + receiveDefaultTemplateId: () => (receiveDefaultTemplateId), + receiveEmbedPreview: () => (receiveEmbedPreview), + receiveEntityRecords: () => (receiveEntityRecords), + receiveNavigationFallbackId: () => (receiveNavigationFallbackId), + receiveRevisions: () => (receiveRevisions), + receiveThemeGlobalStyleRevisions: () => (receiveThemeGlobalStyleRevisions), + receiveThemeSupports: () => (receiveThemeSupports), + receiveUploadPermissions: () => (receiveUploadPermissions), + receiveUserPermission: () => (receiveUserPermission), + receiveUserPermissions: () => (receiveUserPermissions), + receiveUserQuery: () => (receiveUserQuery), + redo: () => (redo), + saveEditedEntityRecord: () => (saveEditedEntityRecord), + saveEntityRecord: () => (saveEntityRecord), + undo: () => (undo) +}); + // NAMESPACE OBJECT: ./node_modules/@wordpress/core-data/build-module/private-actions.js var private_actions_namespaceObject = {}; __webpack_require__.r(private_actions_namespaceObject); @@ -791,7 +604,6 @@ __webpack_require__.d(resolvers_namespaceObject, { __experimentalGetCurrentGlobalStylesId: () => (resolvers_experimentalGetCurrentGlobalStylesId), __experimentalGetCurrentThemeBaseGlobalStyles: () => (resolvers_experimentalGetCurrentThemeBaseGlobalStyles), __experimentalGetCurrentThemeGlobalStylesVariations: () => (resolvers_experimentalGetCurrentThemeGlobalStylesVariations), - __experimentalGetTemplateForLink: () => (resolvers_experimentalGetTemplateForLink), canUser: () => (resolvers_canUser), canUserEditEntityRecord: () => (resolvers_canUserEditEntityRecord), getAuthors: () => (resolvers_getAuthors), @@ -805,6 +617,7 @@ __webpack_require__.d(resolvers_namespaceObject, { getDefaultTemplateId: () => (resolvers_getDefaultTemplateId), getEditedEntityRecord: () => (resolvers_getEditedEntityRecord), getEmbedPreview: () => (resolvers_getEmbedPreview), + getEntitiesConfig: () => (resolvers_getEntitiesConfig), getEntityRecord: () => (resolvers_getEntityRecord), getEntityRecords: () => (resolvers_getEntityRecords), getNavigationFallbackId: () => (resolvers_getNavigationFallbackId), @@ -823,8 +636,182 @@ var es6 = __webpack_require__(7734); var es6_default = /*#__PURE__*/__webpack_require__.n(es6); ;// external ["wp","compose"] const external_wp_compose_namespaceObject = window["wp"]["compose"]; -// EXTERNAL MODULE: ./node_modules/@wordpress/undo-manager/build-module/index.js -var build_module = __webpack_require__(6689); +;// external ["wp","isShallowEqual"] +const external_wp_isShallowEqual_namespaceObject = window["wp"]["isShallowEqual"]; +var external_wp_isShallowEqual_default = /*#__PURE__*/__webpack_require__.n(external_wp_isShallowEqual_namespaceObject); +;// ./node_modules/@wordpress/undo-manager/build-module/index.js +/* wp:polyfill */ +/** + * WordPress dependencies + */ + + +/** @typedef {import('./types').HistoryRecord} HistoryRecord */ +/** @typedef {import('./types').HistoryChange} HistoryChange */ +/** @typedef {import('./types').HistoryChanges} HistoryChanges */ +/** @typedef {import('./types').UndoManager} UndoManager */ + +/** + * Merge changes for a single item into a record of changes. + * + * @param {Record< string, HistoryChange >} changes1 Previous changes + * @param {Record< string, HistoryChange >} changes2 NextChanges + * + * @return {Record< string, HistoryChange >} Merged changes + */ +function mergeHistoryChanges(changes1, changes2) { + /** + * @type {Record< string, HistoryChange >} + */ + const newChanges = { + ...changes1 + }; + Object.entries(changes2).forEach(([key, value]) => { + if (newChanges[key]) { + newChanges[key] = { + ...newChanges[key], + to: value.to + }; + } else { + newChanges[key] = value; + } + }); + return newChanges; +} + +/** + * Adds history changes for a single item into a record of changes. + * + * @param {HistoryRecord} record The record to merge into. + * @param {HistoryChanges} changes The changes to merge. + */ +const addHistoryChangesIntoRecord = (record, changes) => { + const existingChangesIndex = record?.findIndex(({ + id: recordIdentifier + }) => { + return typeof recordIdentifier === 'string' ? recordIdentifier === changes.id : external_wp_isShallowEqual_default()(recordIdentifier, changes.id); + }); + const nextRecord = [...record]; + if (existingChangesIndex !== -1) { + // If the edit is already in the stack leave the initial "from" value. + nextRecord[existingChangesIndex] = { + id: changes.id, + changes: mergeHistoryChanges(nextRecord[existingChangesIndex].changes, changes.changes) + }; + } else { + nextRecord.push(changes); + } + return nextRecord; +}; + +/** + * Creates an undo manager. + * + * @return {UndoManager} Undo manager. + */ +function createUndoManager() { + /** + * @type {HistoryRecord[]} + */ + let history = []; + /** + * @type {HistoryRecord} + */ + let stagedRecord = []; + /** + * @type {number} + */ + let offset = 0; + const dropPendingRedos = () => { + history = history.slice(0, offset || undefined); + offset = 0; + }; + const appendStagedRecordToLatestHistoryRecord = () => { + var _history$index; + const index = history.length === 0 ? 0 : history.length - 1; + let latestRecord = (_history$index = history[index]) !== null && _history$index !== void 0 ? _history$index : []; + stagedRecord.forEach(changes => { + latestRecord = addHistoryChangesIntoRecord(latestRecord, changes); + }); + stagedRecord = []; + history[index] = latestRecord; + }; + + /** + * Checks whether a record is empty. + * A record is considered empty if it the changes keep the same values. + * Also updates to function values are ignored. + * + * @param {HistoryRecord} record + * @return {boolean} Whether the record is empty. + */ + const isRecordEmpty = record => { + const filteredRecord = record.filter(({ + changes + }) => { + return Object.values(changes).some(({ + from, + to + }) => typeof from !== 'function' && typeof to !== 'function' && !external_wp_isShallowEqual_default()(from, to)); + }); + return !filteredRecord.length; + }; + return { + /** + * Record changes into the history. + * + * @param {HistoryRecord=} record A record of changes to record. + * @param {boolean} isStaged Whether to immediately create an undo point or not. + */ + addRecord(record, isStaged = false) { + const isEmpty = !record || isRecordEmpty(record); + if (isStaged) { + if (isEmpty) { + return; + } + record.forEach(changes => { + stagedRecord = addHistoryChangesIntoRecord(stagedRecord, changes); + }); + } else { + dropPendingRedos(); + if (stagedRecord.length) { + appendStagedRecordToLatestHistoryRecord(); + } + if (isEmpty) { + return; + } + history.push(record); + } + }, + undo() { + if (stagedRecord.length) { + dropPendingRedos(); + appendStagedRecordToLatestHistoryRecord(); + } + const undoRecord = history[history.length - 1 + offset]; + if (!undoRecord) { + return; + } + offset -= 1; + return undoRecord; + }, + redo() { + const redoRecord = history[history.length + offset]; + if (!redoRecord) { + return; + } + offset += 1; + return redoRecord; + }, + hasUndo() { + return !!history[history.length - 1 + offset]; + }, + hasRedo() { + return !!history[history.length + offset]; + } + }; +} + ;// ./node_modules/@wordpress/core-data/build-module/utils/if-matching-action.js /** @typedef {import('../types').AnyFunction} AnyFunction */ @@ -1205,10 +1192,19 @@ var __setModuleDefault = Object.create ? (function(o, v) { o["default"] = v; }; +var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); +}; + function __importStar(mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); __setModuleDefault(result, mod); return result; } @@ -1289,12 +1285,25 @@ function __disposeResources(env) { return next(); } +function __rewriteRelativeImportExtension(path, preserveJsx) { + if (typeof path === "string" && /^\.\.?\//.test(path)) { + return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) { + return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js"); + }); + } + return path; +} + /* harmony default export */ const tslib_es6 = ({ __extends, __assign, __rest, __decorate, __param, + __esDecorate, + __runInitializers, + __propKey, + __setFunctionName, __metadata, __awaiter, __generator, @@ -1317,6 +1326,7 @@ function __disposeResources(env) { __classPrivateFieldIn, __addDisposableResource, __disposeResources, + __rewriteRelativeImportExtension, }); ;// ./node_modules/lower-case/dist.es2015/index.js @@ -1446,1317 +1456,8 @@ var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_w const external_wp_i18n_namespaceObject = window["wp"]["i18n"]; ;// external ["wp","richText"] const external_wp_richText_namespaceObject = window["wp"]["richText"]; -;// ./node_modules/@wordpress/core-data/node_modules/uuid/dist/esm-browser/native.js -const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto); -/* harmony default export */ const esm_browser_native = ({ - randomUUID -}); -;// ./node_modules/@wordpress/core-data/node_modules/uuid/dist/esm-browser/rng.js -// Unique ID creation requires a high quality random # generator. In the browser we therefore -// require the crypto API and do not support built-in fallback to lower quality random number -// generators (like Math.random()). -let getRandomValues; -const rnds8 = new Uint8Array(16); -function rng() { - // lazy load so that environments that need to polyfill have a chance to do so - if (!getRandomValues) { - // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. - getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto); - - if (!getRandomValues) { - throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported'); - } - } - - return getRandomValues(rnds8); -} -;// ./node_modules/@wordpress/core-data/node_modules/uuid/dist/esm-browser/stringify.js - -/** - * Convert array of 16 byte values to UUID string format of the form: - * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX - */ - -const byteToHex = []; - -for (let i = 0; i < 256; ++i) { - byteToHex.push((i + 0x100).toString(16).slice(1)); -} - -function unsafeStringify(arr, offset = 0) { - // Note: Be careful editing this code! It's been tuned for performance - // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434 - return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]; -} - -function stringify(arr, offset = 0) { - const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one - // of the following: - // - One or more input array values don't map to a hex octet (leading to - // "undefined" in the uuid) - // - Invalid input values for the RFC `version` or `variant` fields - - if (!validate(uuid)) { - throw TypeError('Stringified UUID is invalid'); - } - - return uuid; -} - -/* harmony default export */ const esm_browser_stringify = ((/* unused pure expression or super */ null && (stringify))); -;// ./node_modules/@wordpress/core-data/node_modules/uuid/dist/esm-browser/v4.js - - - - -function v4(options, buf, offset) { - if (esm_browser_native.randomUUID && !buf && !options) { - return esm_browser_native.randomUUID(); - } - - options = options || {}; - const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` - - rnds[6] = rnds[6] & 0x0f | 0x40; - rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided - - if (buf) { - offset = offset || 0; - - for (let i = 0; i < 16; ++i) { - buf[offset + i] = rnds[i]; - } - - return buf; - } - - return unsafeStringify(rnds); -} - -/* harmony default export */ const esm_browser_v4 = (v4); -;// external ["wp","url"] -const external_wp_url_namespaceObject = window["wp"]["url"]; -;// external ["wp","deprecated"] -const external_wp_deprecated_namespaceObject = window["wp"]["deprecated"]; -var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject); -;// ./node_modules/@wordpress/core-data/build-module/utils/set-nested-value.js -/** - * Sets the value at path of object. - * If a portion of path doesn’t exist, it’s created. - * Arrays are created for missing index properties while objects are created - * for all other missing properties. - * - * Path is specified as either: - * - a string of properties, separated by dots, for example: "x.y". - * - an array of properties, for example `[ 'x', 'y' ]`. - * - * This function intentionally mutates the input object. - * - * Inspired by _.set(). - * - * @see https://lodash.com/docs/4.17.15#set - * - * @todo Needs to be deduplicated with its copy in `@wordpress/edit-site`. - * - * @param {Object} object Object to modify - * @param {Array|string} path Path of the property to set. - * @param {*} value Value to set. - */ -function setNestedValue(object, path, value) { - if (!object || typeof object !== 'object') { - return object; - } - const normalizedPath = Array.isArray(path) ? path : path.split('.'); - normalizedPath.reduce((acc, key, idx) => { - if (acc[key] === undefined) { - if (Number.isInteger(normalizedPath[idx + 1])) { - acc[key] = []; - } else { - acc[key] = {}; - } - } - if (idx === normalizedPath.length - 1) { - acc[key] = value; - } - return acc[key]; - }, object); - return object; -} - -;// ./node_modules/@wordpress/core-data/build-module/utils/get-nested-value.js -/** - * Helper util to return a value from a certain path of the object. - * Path is specified as either: - * - a string of properties, separated by dots, for example: "x.y". - * - an array of properties, for example `[ 'x', 'y' ]`. - * You can also specify a default value in case the result is nullish. - * - * @param {Object} object Input object. - * @param {string|Array} path Path to the object property. - * @param {*} defaultValue Default value if the value at the specified path is undefined. - * @return {*} Value of the object property at the specified path. - */ -function getNestedValue(object, path, defaultValue) { - if (!object || typeof object !== 'object' || typeof path !== 'string' && !Array.isArray(path)) { - return object; - } - const normalizedPath = Array.isArray(path) ? path : path.split('.'); - let value = object; - normalizedPath.forEach(fieldName => { - value = value?.[fieldName]; - }); - return value !== undefined ? value : defaultValue; -} - -;// ./node_modules/@wordpress/core-data/build-module/queried-data/actions.js -/** - * Returns an action object used in signalling that items have been received. - * - * @param {Array} items Items received. - * @param {?Object} edits Optional edits to reset. - * @param {?Object} meta Meta information about pagination. - * - * @return {Object} Action object. - */ -function receiveItems(items, edits, meta) { - return { - type: 'RECEIVE_ITEMS', - items: Array.isArray(items) ? items : [items], - persistedEdits: edits, - meta - }; -} - -/** - * Returns an action object used in signalling that entity records have been - * deleted and they need to be removed from entities state. - * - * @param {string} kind Kind of the removed entities. - * @param {string} name Name of the removed entities. - * @param {Array|number|string} records Record IDs of the removed entities. - * @param {boolean} invalidateCache Controls whether we want to invalidate the cache. - * @return {Object} Action object. - */ -function removeItems(kind, name, records, invalidateCache = false) { - return { - type: 'REMOVE_ITEMS', - itemIds: Array.isArray(records) ? records : [records], - kind, - name, - invalidateCache - }; -} - -/** - * Returns an action object used in signalling that queried data has been - * received. - * - * @param {Array} items Queried items received. - * @param {?Object} query Optional query object. - * @param {?Object} edits Optional edits to reset. - * @param {?Object} meta Meta information about pagination. - * - * @return {Object} Action object. - */ -function receiveQueriedItems(items, query = {}, edits, meta) { - return { - ...receiveItems(items, edits, meta), - query - }; -} - -;// ./node_modules/@wordpress/core-data/build-module/batch/default-processor.js -/** - * WordPress dependencies - */ - - -/** - * Maximum number of requests to place in a single batch request. Obtained by - * sending a preflight OPTIONS request to /batch/v1/. - * - * @type {number?} - */ -let maxItems = null; -function chunk(arr, chunkSize) { - const tmp = [...arr]; - const cache = []; - while (tmp.length) { - cache.push(tmp.splice(0, chunkSize)); - } - return cache; -} - -/** - * Default batch processor. Sends its input requests to /batch/v1. - * - * @param {Array} requests List of API requests to perform at once. - * - * @return {Promise} Promise that resolves to a list of objects containing - * either `output` (if that request was successful) or `error` - * (if not ). - */ -async function defaultProcessor(requests) { - if (maxItems === null) { - const preflightResponse = await external_wp_apiFetch_default()({ - path: '/batch/v1', - method: 'OPTIONS' - }); - maxItems = preflightResponse.endpoints[0].args.requests.maxItems; - } - const results = []; - - // @ts-ignore We would have crashed or never gotten to this point if we hadn't received the maxItems count. - for (const batchRequests of chunk(requests, maxItems)) { - const batchResponse = await external_wp_apiFetch_default()({ - path: '/batch/v1', - method: 'POST', - data: { - validation: 'require-all-validate', - requests: batchRequests.map(request => ({ - path: request.path, - body: request.data, - // Rename 'data' to 'body'. - method: request.method, - headers: request.headers - })) - } - }); - let batchResults; - if (batchResponse.failed) { - batchResults = batchResponse.responses.map(response => ({ - error: response?.body - })); - } else { - batchResults = batchResponse.responses.map(response => { - const result = {}; - if (response.status >= 200 && response.status < 300) { - result.output = response.body; - } else { - result.error = response.body; - } - return result; - }); - } - results.push(...batchResults); - } - return results; -} - -;// ./node_modules/@wordpress/core-data/build-module/batch/create-batch.js -/** - * Internal dependencies - */ - - -/** - * Creates a batch, which can be used to combine multiple API requests into one - * API request using the WordPress batch processing API (/v1/batch). - * - * ``` - * const batch = createBatch(); - * const dunePromise = batch.add( { - * path: '/v1/books', - * method: 'POST', - * data: { title: 'Dune' } - * } ); - * const lotrPromise = batch.add( { - * path: '/v1/books', - * method: 'POST', - * data: { title: 'Lord of the Rings' } - * } ); - * const isSuccess = await batch.run(); // Sends one POST to /v1/batch. - * if ( isSuccess ) { - * console.log( - * 'Saved two books:', - * await dunePromise, - * await lotrPromise - * ); - * } - * ``` - * - * @param {Function} [processor] Processor function. Can be used to replace the - * default functionality which is to send an API - * request to /v1/batch. Is given an array of - * inputs and must return a promise that - * resolves to an array of objects containing - * either `output` or `error`. - */ -function createBatch(processor = defaultProcessor) { - let lastId = 0; - /** @type {Array<{ input: any; resolve: ( value: any ) => void; reject: ( error: any ) => void }>} */ - let queue = []; - const pending = new ObservableSet(); - return { - /** - * Adds an input to the batch and returns a promise that is resolved or - * rejected when the input is processed by `batch.run()`. - * - * You may also pass a thunk which allows inputs to be added - * asychronously. - * - * ``` - * // Both are allowed: - * batch.add( { path: '/v1/books', ... } ); - * batch.add( ( add ) => add( { path: '/v1/books', ... } ) ); - * ``` - * - * If a thunk is passed, `batch.run()` will pause until either: - * - * - The thunk calls its `add` argument, or; - * - The thunk returns a promise and that promise resolves, or; - * - The thunk returns a non-promise. - * - * @param {any|Function} inputOrThunk Input to add or thunk to execute. - * - * @return {Promise|any} If given an input, returns a promise that - * is resolved or rejected when the batch is - * processed. If given a thunk, returns the return - * value of that thunk. - */ - add(inputOrThunk) { - const id = ++lastId; - pending.add(id); - const add = input => new Promise((resolve, reject) => { - queue.push({ - input, - resolve, - reject - }); - pending.delete(id); - }); - if (typeof inputOrThunk === 'function') { - return Promise.resolve(inputOrThunk(add)).finally(() => { - pending.delete(id); - }); - } - return add(inputOrThunk); - }, - /** - * Runs the batch. This calls `batchProcessor` and resolves or rejects - * all promises returned by `add()`. - * - * @return {Promise} A promise that resolves to a boolean that is true - * if the processor returned no errors. - */ - async run() { - if (pending.size) { - await new Promise(resolve => { - const unsubscribe = pending.subscribe(() => { - if (!pending.size) { - unsubscribe(); - resolve(undefined); - } - }); - }); - } - let results; - try { - results = await processor(queue.map(({ - input - }) => input)); - if (results.length !== queue.length) { - throw new Error('run: Array returned by processor must be same size as input array.'); - } - } catch (error) { - for (const { - reject - } of queue) { - reject(error); - } - throw error; - } - let isSuccess = true; - results.forEach((result, key) => { - const queueItem = queue[key]; - if (result?.error) { - queueItem?.reject(result.error); - isSuccess = false; - } else { - var _result$output; - queueItem?.resolve((_result$output = result?.output) !== null && _result$output !== void 0 ? _result$output : result); - } - }); - queue = []; - return isSuccess; - } - }; -} -class ObservableSet { - constructor(...args) { - this.set = new Set(...args); - this.subscribers = new Set(); - } - get size() { - return this.set.size; - } - add(value) { - this.set.add(value); - this.subscribers.forEach(subscriber => subscriber()); - return this; - } - delete(value) { - const isSuccess = this.set.delete(value); - this.subscribers.forEach(subscriber => subscriber()); - return isSuccess; - } - subscribe(subscriber) { - this.subscribers.add(subscriber); - return () => { - this.subscribers.delete(subscriber); - }; - } -} - -;// ./node_modules/@wordpress/core-data/build-module/name.js -/** - * The reducer key used by core data in store registration. - * This is defined in a separate file to avoid cycle-dependency - * - * @type {string} - */ -const STORE_NAME = 'core'; - -;// ./node_modules/@wordpress/core-data/build-module/actions.js -/** - * External dependencies - */ - - - -/** - * WordPress dependencies - */ - - - - -/** - * Internal dependencies - */ - - - - - - - -/** - * Returns an action object used in signalling that authors have been received. - * Ignored from documentation as it's internal to the data store. - * - * @ignore - * - * @param {string} queryID Query ID. - * @param {Array|Object} users Users received. - * - * @return {Object} Action object. - */ -function receiveUserQuery(queryID, users) { - return { - type: 'RECEIVE_USER_QUERY', - users: Array.isArray(users) ? users : [users], - queryID - }; -} - -/** - * Returns an action used in signalling that the current user has been received. - * Ignored from documentation as it's internal to the data store. - * - * @ignore - * - * @param {Object} currentUser Current user object. - * - * @return {Object} Action object. - */ -function receiveCurrentUser(currentUser) { - return { - type: 'RECEIVE_CURRENT_USER', - currentUser - }; -} - -/** - * Returns an action object used in adding new entities. - * - * @param {Array} entities Entities received. - * - * @return {Object} Action object. - */ -function addEntities(entities) { - return { - type: 'ADD_ENTITIES', - entities - }; -} - -/** - * Returns an action object used in signalling that entity records have been received. - * - * @param {string} kind Kind of the received entity record. - * @param {string} name Name of the received entity record. - * @param {Array|Object} records Records received. - * @param {?Object} query Query Object. - * @param {?boolean} invalidateCache Should invalidate query caches. - * @param {?Object} edits Edits to reset. - * @param {?Object} meta Meta information about pagination. - * @return {Object} Action object. - */ -function receiveEntityRecords(kind, name, records, query, invalidateCache = false, edits, meta) { - // Auto drafts should not have titles, but some plugins rely on them so we can't filter this - // on the server. - if (kind === 'postType') { - records = (Array.isArray(records) ? records : [records]).map(record => record.status === 'auto-draft' ? { - ...record, - title: '' - } : record); - } - let action; - if (query) { - action = receiveQueriedItems(records, query, edits, meta); - } else { - action = receiveItems(records, edits, meta); - } - return { - ...action, - kind, - name, - invalidateCache - }; -} - -/** - * Returns an action object used in signalling that the current theme has been received. - * Ignored from documentation as it's internal to the data store. - * - * @ignore - * - * @param {Object} currentTheme The current theme. - * - * @return {Object} Action object. - */ -function receiveCurrentTheme(currentTheme) { - return { - type: 'RECEIVE_CURRENT_THEME', - currentTheme - }; -} - -/** - * Returns an action object used in signalling that the current global styles id has been received. - * Ignored from documentation as it's internal to the data store. - * - * @ignore - * - * @param {string} currentGlobalStylesId The current global styles id. - * - * @return {Object} Action object. - */ -function __experimentalReceiveCurrentGlobalStylesId(currentGlobalStylesId) { - return { - type: 'RECEIVE_CURRENT_GLOBAL_STYLES_ID', - id: currentGlobalStylesId - }; -} - -/** - * Returns an action object used in signalling that the theme base global styles have been received - * Ignored from documentation as it's internal to the data store. - * - * @ignore - * - * @param {string} stylesheet The theme's identifier - * @param {Object} globalStyles The global styles object. - * - * @return {Object} Action object. - */ -function __experimentalReceiveThemeBaseGlobalStyles(stylesheet, globalStyles) { - return { - type: 'RECEIVE_THEME_GLOBAL_STYLES', - stylesheet, - globalStyles - }; -} - -/** - * Returns an action object used in signalling that the theme global styles variations have been received. - * Ignored from documentation as it's internal to the data store. - * - * @ignore - * - * @param {string} stylesheet The theme's identifier - * @param {Array} variations The global styles variations. - * - * @return {Object} Action object. - */ -function __experimentalReceiveThemeGlobalStyleVariations(stylesheet, variations) { - return { - type: 'RECEIVE_THEME_GLOBAL_STYLE_VARIATIONS', - stylesheet, - variations - }; -} - -/** - * Returns an action object used in signalling that the index has been received. - * - * @deprecated since WP 5.9, this is not useful anymore, use the selector directly. - * - * @return {Object} Action object. - */ -function receiveThemeSupports() { - external_wp_deprecated_default()("wp.data.dispatch( 'core' ).receiveThemeSupports", { - since: '5.9' - }); - return { - type: 'DO_NOTHING' - }; -} - -/** - * Returns an action object used in signalling that the theme global styles CPT post revisions have been received. - * Ignored from documentation as it's internal to the data store. - * - * @deprecated since WordPress 6.5.0. Callers should use `dispatch( 'core' ).receiveRevision` instead. - * - * @ignore - * - * @param {number} currentId The post id. - * @param {Array} revisions The global styles revisions. - * - * @return {Object} Action object. - */ -function receiveThemeGlobalStyleRevisions(currentId, revisions) { - external_wp_deprecated_default()("wp.data.dispatch( 'core' ).receiveThemeGlobalStyleRevisions()", { - since: '6.5.0', - alternative: "wp.data.dispatch( 'core' ).receiveRevisions" - }); - return { - type: 'RECEIVE_THEME_GLOBAL_STYLE_REVISIONS', - currentId, - revisions - }; -} - -/** - * Returns an action object used in signalling that the preview data for - * a given URl has been received. - * Ignored from documentation as it's internal to the data store. - * - * @ignore - * - * @param {string} url URL to preview the embed for. - * @param {*} preview Preview data. - * - * @return {Object} Action object. - */ -function receiveEmbedPreview(url, preview) { - return { - type: 'RECEIVE_EMBED_PREVIEW', - url, - preview - }; -} - -/** - * Action triggered to delete an entity record. - * - * @param {string} kind Kind of the deleted entity. - * @param {string} name Name of the deleted entity. - * @param {number|string} recordId Record ID of the deleted entity. - * @param {?Object} query Special query parameters for the - * DELETE API call. - * @param {Object} [options] Delete options. - * @param {Function} [options.__unstableFetch] Internal use only. Function to - * call instead of `apiFetch()`. - * Must return a promise. - * @param {boolean} [options.throwOnError=false] If false, this action suppresses all - * the exceptions. Defaults to false. - */ -const deleteEntityRecord = (kind, name, recordId, query, { - __unstableFetch = (external_wp_apiFetch_default()), - throwOnError = false -} = {}) => async ({ - dispatch -}) => { - const configs = await dispatch(getOrLoadEntitiesConfig(kind, name)); - const entityConfig = configs.find(config => config.kind === kind && config.name === name); - let error; - let deletedRecord = false; - if (!entityConfig) { - return; - } - const lock = await dispatch.__unstableAcquireStoreLock(STORE_NAME, ['entities', 'records', kind, name, recordId], { - exclusive: true - }); - try { - dispatch({ - type: 'DELETE_ENTITY_RECORD_START', - kind, - name, - recordId - }); - let hasError = false; - try { - let path = `${entityConfig.baseURL}/${recordId}`; - if (query) { - path = (0,external_wp_url_namespaceObject.addQueryArgs)(path, query); - } - deletedRecord = await __unstableFetch({ - path, - method: 'DELETE' - }); - await dispatch(removeItems(kind, name, recordId, true)); - } catch (_error) { - hasError = true; - error = _error; - } - dispatch({ - type: 'DELETE_ENTITY_RECORD_FINISH', - kind, - name, - recordId, - error - }); - if (hasError && throwOnError) { - throw error; - } - return deletedRecord; - } finally { - dispatch.__unstableReleaseStoreLock(lock); - } -}; - -/** - * Returns an action object that triggers an - * edit to an entity record. - * - * @param {string} kind Kind of the edited entity record. - * @param {string} name Name of the edited entity record. - * @param {number|string} recordId Record ID of the edited entity record. - * @param {Object} edits The edits. - * @param {Object} options Options for the edit. - * @param {boolean} [options.undoIgnore] Whether to ignore the edit in undo history or not. - * - * @return {Object} Action object. - */ -const editEntityRecord = (kind, name, recordId, edits, options = {}) => ({ - select, - dispatch -}) => { - const entityConfig = select.getEntityConfig(kind, name); - if (!entityConfig) { - throw new Error(`The entity being edited (${kind}, ${name}) does not have a loaded config.`); - } - const { - mergedEdits = {} - } = entityConfig; - const record = select.getRawEntityRecord(kind, name, recordId); - const editedRecord = select.getEditedEntityRecord(kind, name, recordId); - const edit = { - kind, - name, - recordId, - // Clear edits when they are equal to their persisted counterparts - // so that the property is not considered dirty. - edits: Object.keys(edits).reduce((acc, key) => { - const recordValue = record[key]; - const editedRecordValue = editedRecord[key]; - const value = mergedEdits[key] ? { - ...editedRecordValue, - ...edits[key] - } : edits[key]; - acc[key] = es6_default()(recordValue, value) ? undefined : value; - return acc; - }, {}) - }; - if (window.__experimentalEnableSync && entityConfig.syncConfig) { - if (false) {} - } else { - if (!options.undoIgnore) { - select.getUndoManager().addRecord([{ - id: { - kind, - name, - recordId - }, - changes: Object.keys(edits).reduce((acc, key) => { - acc[key] = { - from: editedRecord[key], - to: edits[key] - }; - return acc; - }, {}) - }], options.isCached); - } - dispatch({ - type: 'EDIT_ENTITY_RECORD', - ...edit - }); - } -}; - -/** - * Action triggered to undo the last edit to - * an entity record, if any. - */ -const undo = () => ({ - select, - dispatch -}) => { - const undoRecord = select.getUndoManager().undo(); - if (!undoRecord) { - return; - } - dispatch({ - type: 'UNDO', - record: undoRecord - }); -}; - -/** - * Action triggered to redo the last undoed - * edit to an entity record, if any. - */ -const redo = () => ({ - select, - dispatch -}) => { - const redoRecord = select.getUndoManager().redo(); - if (!redoRecord) { - return; - } - dispatch({ - type: 'REDO', - record: redoRecord - }); -}; - -/** - * Forces the creation of a new undo level. - * - * @return {Object} Action object. - */ -const __unstableCreateUndoLevel = () => ({ - select -}) => { - select.getUndoManager().addRecord(); -}; - -/** - * Action triggered to save an entity record. - * - * @param {string} kind Kind of the received entity. - * @param {string} name Name of the received entity. - * @param {Object} record Record to be saved. - * @param {Object} options Saving options. - * @param {boolean} [options.isAutosave=false] Whether this is an autosave. - * @param {Function} [options.__unstableFetch] Internal use only. Function to - * call instead of `apiFetch()`. - * Must return a promise. - * @param {boolean} [options.throwOnError=false] If false, this action suppresses all - * the exceptions. Defaults to false. - */ -const saveEntityRecord = (kind, name, record, { - isAutosave = false, - __unstableFetch = (external_wp_apiFetch_default()), - throwOnError = false -} = {}) => async ({ - select, - resolveSelect, - dispatch -}) => { - const configs = await dispatch(getOrLoadEntitiesConfig(kind, name)); - const entityConfig = configs.find(config => config.kind === kind && config.name === name); - if (!entityConfig) { - return; - } - const entityIdKey = entityConfig.key || DEFAULT_ENTITY_KEY; - const recordId = record[entityIdKey]; - const lock = await dispatch.__unstableAcquireStoreLock(STORE_NAME, ['entities', 'records', kind, name, recordId || esm_browser_v4()], { - exclusive: true - }); - try { - // Evaluate optimized edits. - // (Function edits that should be evaluated on save to avoid expensive computations on every edit.) - for (const [key, value] of Object.entries(record)) { - if (typeof value === 'function') { - const evaluatedValue = value(select.getEditedEntityRecord(kind, name, recordId)); - dispatch.editEntityRecord(kind, name, recordId, { - [key]: evaluatedValue - }, { - undoIgnore: true - }); - record[key] = evaluatedValue; - } - } - dispatch({ - type: 'SAVE_ENTITY_RECORD_START', - kind, - name, - recordId, - isAutosave - }); - let updatedRecord; - let error; - let hasError = false; - try { - const path = `${entityConfig.baseURL}${recordId ? '/' + recordId : ''}`; - const persistedRecord = select.getRawEntityRecord(kind, name, recordId); - if (isAutosave) { - // Most of this autosave logic is very specific to posts. - // This is fine for now as it is the only supported autosave, - // but ideally this should all be handled in the back end, - // so the client just sends and receives objects. - const currentUser = select.getCurrentUser(); - const currentUserId = currentUser ? currentUser.id : undefined; - const autosavePost = await resolveSelect.getAutosave(persistedRecord.type, persistedRecord.id, currentUserId); - // Autosaves need all expected fields to be present. - // So we fallback to the previous autosave and then - // to the actual persisted entity if the edits don't - // have a value. - let data = { - ...persistedRecord, - ...autosavePost, - ...record - }; - data = Object.keys(data).reduce((acc, key) => { - if (['title', 'excerpt', 'content', 'meta'].includes(key)) { - acc[key] = data[key]; - } - return acc; - }, { - // Do not update the `status` if we have edited it when auto saving. - // It's very important to let the user explicitly save this change, - // because it can lead to unexpected results. An example would be to - // have a draft post and change the status to publish. - status: data.status === 'auto-draft' ? 'draft' : undefined - }); - updatedRecord = await __unstableFetch({ - path: `${path}/autosaves`, - method: 'POST', - data - }); - - // An autosave may be processed by the server as a regular save - // when its update is requested by the author and the post had - // draft or auto-draft status. - if (persistedRecord.id === updatedRecord.id) { - let newRecord = { - ...persistedRecord, - ...data, - ...updatedRecord - }; - newRecord = Object.keys(newRecord).reduce((acc, key) => { - // These properties are persisted in autosaves. - if (['title', 'excerpt', 'content'].includes(key)) { - acc[key] = newRecord[key]; - } else if (key === 'status') { - // Status is only persisted in autosaves when going from - // "auto-draft" to "draft". - acc[key] = persistedRecord.status === 'auto-draft' && newRecord.status === 'draft' ? newRecord.status : persistedRecord.status; - } else { - // These properties are not persisted in autosaves. - acc[key] = persistedRecord[key]; - } - return acc; - }, {}); - dispatch.receiveEntityRecords(kind, name, newRecord, undefined, true); - } else { - dispatch.receiveAutosaves(persistedRecord.id, updatedRecord); - } - } else { - let edits = record; - if (entityConfig.__unstablePrePersist) { - edits = { - ...edits, - ...entityConfig.__unstablePrePersist(persistedRecord, edits) - }; - } - updatedRecord = await __unstableFetch({ - path, - method: recordId ? 'PUT' : 'POST', - data: edits - }); - dispatch.receiveEntityRecords(kind, name, updatedRecord, undefined, true, edits); - } - } catch (_error) { - hasError = true; - error = _error; - } - dispatch({ - type: 'SAVE_ENTITY_RECORD_FINISH', - kind, - name, - recordId, - error, - isAutosave - }); - if (hasError && throwOnError) { - throw error; - } - return updatedRecord; - } finally { - dispatch.__unstableReleaseStoreLock(lock); - } -}; - -/** - * Runs multiple core-data actions at the same time using one API request. - * - * Example: - * - * ``` - * const [ savedRecord, updatedRecord, deletedRecord ] = - * await dispatch( 'core' ).__experimentalBatch( [ - * ( { saveEntityRecord } ) => saveEntityRecord( 'root', 'widget', widget ), - * ( { saveEditedEntityRecord } ) => saveEntityRecord( 'root', 'widget', 123 ), - * ( { deleteEntityRecord } ) => deleteEntityRecord( 'root', 'widget', 123, null ), - * ] ); - * ``` - * - * @param {Array} requests Array of functions which are invoked simultaneously. - * Each function is passed an object containing - * `saveEntityRecord`, `saveEditedEntityRecord`, and - * `deleteEntityRecord`. - * - * @return {(thunkArgs: Object) => Promise} A promise that resolves to an array containing the return - * values of each function given in `requests`. - */ -const __experimentalBatch = requests => async ({ - dispatch -}) => { - const batch = createBatch(); - const api = { - saveEntityRecord(kind, name, record, options) { - return batch.add(add => dispatch.saveEntityRecord(kind, name, record, { - ...options, - __unstableFetch: add - })); - }, - saveEditedEntityRecord(kind, name, recordId, options) { - return batch.add(add => dispatch.saveEditedEntityRecord(kind, name, recordId, { - ...options, - __unstableFetch: add - })); - }, - deleteEntityRecord(kind, name, recordId, query, options) { - return batch.add(add => dispatch.deleteEntityRecord(kind, name, recordId, query, { - ...options, - __unstableFetch: add - })); - } - }; - const resultPromises = requests.map(request => request(api)); - const [, ...results] = await Promise.all([batch.run(), ...resultPromises]); - return results; -}; - -/** - * Action triggered to save an entity record's edits. - * - * @param {string} kind Kind of the entity. - * @param {string} name Name of the entity. - * @param {Object} recordId ID of the record. - * @param {Object=} options Saving options. - */ -const saveEditedEntityRecord = (kind, name, recordId, options) => async ({ - select, - dispatch -}) => { - if (!select.hasEditsForEntityRecord(kind, name, recordId)) { - return; - } - const configs = await dispatch(getOrLoadEntitiesConfig(kind, name)); - const entityConfig = configs.find(config => config.kind === kind && config.name === name); - if (!entityConfig) { - return; - } - const entityIdKey = entityConfig.key || DEFAULT_ENTITY_KEY; - const edits = select.getEntityRecordNonTransientEdits(kind, name, recordId); - const record = { - [entityIdKey]: recordId, - ...edits - }; - return await dispatch.saveEntityRecord(kind, name, record, options); -}; - -/** - * Action triggered to save only specified properties for the entity. - * - * @param {string} kind Kind of the entity. - * @param {string} name Name of the entity. - * @param {number|string} recordId ID of the record. - * @param {Array} itemsToSave List of entity properties or property paths to save. - * @param {Object} options Saving options. - */ -const __experimentalSaveSpecifiedEntityEdits = (kind, name, recordId, itemsToSave, options) => async ({ - select, - dispatch -}) => { - if (!select.hasEditsForEntityRecord(kind, name, recordId)) { - return; - } - const edits = select.getEntityRecordNonTransientEdits(kind, name, recordId); - const editsToSave = {}; - for (const item of itemsToSave) { - setNestedValue(editsToSave, item, getNestedValue(edits, item)); - } - const configs = await dispatch(getOrLoadEntitiesConfig(kind, name)); - const entityConfig = configs.find(config => config.kind === kind && config.name === name); - const entityIdKey = entityConfig?.key || DEFAULT_ENTITY_KEY; - - // If a record key is provided then update the existing record. - // This necessitates providing `recordKey` to saveEntityRecord as part of the - // `record` argument (here called `editsToSave`) to stop that action creating - // a new record and instead cause it to update the existing record. - if (recordId) { - editsToSave[entityIdKey] = recordId; - } - return await dispatch.saveEntityRecord(kind, name, editsToSave, options); -}; - -/** - * Returns an action object used in signalling that Upload permissions have been received. - * - * @deprecated since WP 5.9, use receiveUserPermission instead. - * - * @param {boolean} hasUploadPermissions Does the user have permission to upload files? - * - * @return {Object} Action object. - */ -function receiveUploadPermissions(hasUploadPermissions) { - external_wp_deprecated_default()("wp.data.dispatch( 'core' ).receiveUploadPermissions", { - since: '5.9', - alternative: 'receiveUserPermission' - }); - return receiveUserPermission('create/media', hasUploadPermissions); -} - -/** - * Returns an action object used in signalling that the current user has - * permission to perform an action on a REST resource. - * Ignored from documentation as it's internal to the data store. - * - * @ignore - * - * @param {string} key A key that represents the action and REST resource. - * @param {boolean} isAllowed Whether or not the user can perform the action. - * - * @return {Object} Action object. - */ -function receiveUserPermission(key, isAllowed) { - return { - type: 'RECEIVE_USER_PERMISSION', - key, - isAllowed - }; -} - -/** - * Returns an action object used in signalling that the current user has - * permission to perform an action on a REST resource. Ignored from - * documentation as it's internal to the data store. - * - * @ignore - * - * @param {Object} permissions An object where keys represent - * actions and REST resources, and - * values indicate whether the user - * is allowed to perform the - * action. - * - * @return {Object} Action object. - */ -function receiveUserPermissions(permissions) { - return { - type: 'RECEIVE_USER_PERMISSIONS', - permissions - }; -} - -/** - * Returns an action object used in signalling that the autosaves for a - * post have been received. - * Ignored from documentation as it's internal to the data store. - * - * @ignore - * - * @param {number} postId The id of the post that is parent to the autosave. - * @param {Array|Object} autosaves An array of autosaves or singular autosave object. - * - * @return {Object} Action object. - */ -function receiveAutosaves(postId, autosaves) { - return { - type: 'RECEIVE_AUTOSAVES', - postId, - autosaves: Array.isArray(autosaves) ? autosaves : [autosaves] - }; -} - -/** - * Returns an action object signalling that the fallback Navigation - * Menu id has been received. - * - * @param {integer} fallbackId the id of the fallback Navigation Menu - * @return {Object} Action object. - */ -function receiveNavigationFallbackId(fallbackId) { - return { - type: 'RECEIVE_NAVIGATION_FALLBACK_ID', - fallbackId - }; -} - -/** - * Returns an action object used to set the template for a given query. - * - * @param {Object} query The lookup query. - * @param {string} templateId The resolved template id. - * - * @return {Object} Action object. - */ -function receiveDefaultTemplateId(query, templateId) { - return { - type: 'RECEIVE_DEFAULT_TEMPLATE', - query, - templateId - }; -} - -/** - * Action triggered to receive revision items. - * - * @param {string} kind Kind of the received entity record revisions. - * @param {string} name Name of the received entity record revisions. - * @param {number|string} recordKey The key of the entity record whose revisions you want to fetch. - * @param {Array|Object} records Revisions received. - * @param {?Object} query Query Object. - * @param {?boolean} invalidateCache Should invalidate query caches. - * @param {?Object} meta Meta information about pagination. - */ -const receiveRevisions = (kind, name, recordKey, records, query, invalidateCache = false, meta) => async ({ - dispatch -}) => { - const configs = await dispatch(getOrLoadEntitiesConfig(kind, name)); - const entityConfig = configs.find(config => config.kind === kind && config.name === name); - const key = entityConfig && entityConfig?.revisionKey ? entityConfig.revisionKey : DEFAULT_ENTITY_KEY; - dispatch({ - type: 'RECEIVE_ITEM_REVISIONS', - key, - items: Array.isArray(records) ? records : [records], - recordKey, - meta, - query, - kind, - name, - invalidateCache - }); -}; - ;// ./node_modules/@wordpress/core-data/build-module/entities.js +/* wp:polyfill */ /** * External dependencies */ @@ -2768,12 +1469,6 @@ const receiveRevisions = (kind, name, recordKey, records, query, invalidateCache - -/** - * Internal dependencies - */ - - const DEFAULT_ENTITY_KEY = 'id'; const POST_RAW_ATTRIBUTES = ['title', 'excerpt', 'content']; const rootEntitiesConfig = [{ @@ -2782,7 +1477,9 @@ const rootEntitiesConfig = [{ name: '__unstableBase', baseURL: '/', baseURLParams: { - _fields: ['description', 'gmt_offset', 'home', 'name', 'site_icon', 'site_icon_url', 'site_logo', 'timezone_string', 'url'].join(',') + // Please also change the preload path when changing this. + // @see lib/compat/wordpress-6.8/preload.php + _fields: ['description', 'gmt_offset', 'home', 'name', 'site_icon', 'site_icon_url', 'site_logo', 'timezone_string', 'default_template_part_areas', 'default_template_types', 'url'].join(',') }, // The entity doesn't support selecting multiple records. // The property is maintained for backward compatibility. @@ -3214,58 +1911,9 @@ const getMethodName = (kind, name, prefix = 'get') => { const suffix = pascalCase(name); return `${prefix}${kindPrefix}${suffix}`; }; -function registerSyncConfigs(configs) { - configs.forEach(({ - syncObjectType, - syncConfig - }) => { - getSyncProvider().register(syncObjectType, syncConfig); - const editSyncConfig = { - ...syncConfig - }; - delete editSyncConfig.fetch; - getSyncProvider().register(syncObjectType + '--edit', editSyncConfig); - }); -} - -/** - * Loads the entities into the store. - * - * Note: The `name` argument is used for `root` entities requiring additional server data. - * - * @param {string} kind Kind - * @param {string} name Name - * @return {(thunkArgs: object) => Promise} Entities - */ -const getOrLoadEntitiesConfig = (kind, name) => async ({ - select, - dispatch -}) => { - let configs = select.getEntitiesConfig(kind); - const hasConfig = !!select.getEntityConfig(kind, name); - if (configs?.length > 0 && hasConfig) { - if (window.__experimentalEnableSync) { - if (false) {} - } - return configs; - } - const loader = additionalEntityConfigLoaders.find(l => { - if (!name || !l.name) { - return l.kind === kind; - } - return l.kind === kind && l.name === name; - }); - if (!loader) { - return []; - } - configs = await loader.loadEntities(); - if (window.__experimentalEnableSync) { - if (false) {} - } - dispatch(addEntities(configs)); - return configs; -}; +;// external ["wp","url"] +const external_wp_url_namespaceObject = window["wp"]["url"]; ;// ./node_modules/@wordpress/core-data/build-module/utils/get-normalized-comma-separable.js /** * Given a value which can be specified as one or the other of a comma-separated @@ -3318,6 +1966,7 @@ function withWeakMapCache(fn) { /* harmony default export */ const with_weak_map_cache = (withWeakMapCache); ;// ./node_modules/@wordpress/core-data/build-module/queried-data/get-query-parts.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -3422,6 +2071,7 @@ function getQueryParts(query) { /* harmony default export */ const get_query_parts = (with_weak_map_cache(getQueryParts)); ;// ./node_modules/@wordpress/core-data/build-module/queried-data/reducer.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -3658,6 +2308,7 @@ const queries = (state = {}, action) => { })); ;// ./node_modules/@wordpress/core-data/build-module/reducer.js +/* wp:polyfill */ /** * External dependencies */ @@ -4066,7 +2717,7 @@ const entities = (state = {}, action) => { /** * @type {UndoManager} */ -function undoManager(state = (0,build_module.createUndoManager)()) { +function undoManager(state = createUndoManager()) { return state; } function editsReference(state = {}, action) { @@ -4258,10 +2909,68 @@ function registeredPostMeta(state = {}, action) { registeredPostMeta })); +;// external ["wp","deprecated"] +const external_wp_deprecated_namespaceObject = window["wp"]["deprecated"]; +var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject); +;// ./node_modules/@wordpress/core-data/build-module/name.js +/** + * The reducer key used by core data in store registration. + * This is defined in a separate file to avoid cycle-dependency + * + * @type {string} + */ +const STORE_NAME = 'core'; + // EXTERNAL MODULE: ./node_modules/equivalent-key-map/equivalent-key-map.js var equivalent_key_map = __webpack_require__(3249); var equivalent_key_map_default = /*#__PURE__*/__webpack_require__.n(equivalent_key_map); +;// ./node_modules/@wordpress/core-data/build-module/utils/set-nested-value.js +/* wp:polyfill */ +/** + * Sets the value at path of object. + * If a portion of path doesn’t exist, it’s created. + * Arrays are created for missing index properties while objects are created + * for all other missing properties. + * + * Path is specified as either: + * - a string of properties, separated by dots, for example: "x.y". + * - an array of properties, for example `[ 'x', 'y' ]`. + * + * This function intentionally mutates the input object. + * + * Inspired by _.set(). + * + * @see https://lodash.com/docs/4.17.15#set + * + * @todo Needs to be deduplicated with its copy in `@wordpress/edit-site`. + * + * @param {Object} object Object to modify + * @param {Array|string} path Path of the property to set. + * @param {*} value Value to set. + */ +function setNestedValue(object, path, value) { + if (!object || typeof object !== 'object') { + return object; + } + const normalizedPath = Array.isArray(path) ? path : path.split('.'); + normalizedPath.reduce((acc, key, idx) => { + if (acc[key] === undefined) { + if (Number.isInteger(normalizedPath[idx + 1])) { + acc[key] = []; + } else { + acc[key] = {}; + } + } + if (idx === normalizedPath.length - 1) { + acc[key] = value; + } + return acc[key]; + }, object); + return object; +} + ;// ./node_modules/@wordpress/core-data/build-module/queried-data/selectors.js +/* wp:polyfill */ /** * External dependencies */ @@ -4422,6 +3131,7 @@ function isRawAttribute(entity, attribute) { } ;// ./node_modules/@wordpress/core-data/build-module/utils/user-permissions.js +/* wp:polyfill */ const ALLOWED_RESOURCE_ACTIONS = ['create', 'read', 'update', 'delete']; function getUserPermissionsFromAllowHeader(allowedMethods) { const permissions = {}; @@ -4445,6 +3155,7 @@ function getUserPermissionCacheKey(action, resource, id) { } ;// ./node_modules/@wordpress/core-data/build-module/selectors.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -4631,7 +3342,7 @@ function getEntityConfig(state, kind, name) { * @param state State tree * @param kind Entity kind. * @param name Entity name. - * @param key Record's key + * @param key Optional record's key. If requesting a global record (e.g. site settings), the key can be omitted. If requesting a specific item, the key must always be included. * @param query Optional query. If requesting specific * fields, fields must always include the ID. For valid query parameters see the [Reference](https://developer.wordpress.org/rest-api/reference/) in the REST API Handbook and select the entity kind. Then see the arguments available "Retrieve a [Entity kind]". * @@ -5327,24 +4038,6 @@ function getReferenceByDistinctEdits(state) { return state.editsReference; } -/** - * Retrieve the frontend template used for a given link. - * - * @param state Editor state. - * @param link Link. - * - * @return The template record. - */ -function __experimentalGetTemplateForLink(state, link) { - const records = getEntityRecords(state, 'postType', 'wp_template', { - 'find-template': link - }); - if (records?.length) { - return getEditedEntityRecord(state, 'postType', 'wp_template', records[0].id); - } - return null; -} - /** * Retrieve the current theme's base global styles * @@ -5511,7 +4204,20 @@ const getRevision = (0,external_wp_data_namespaceObject.createSelector)((state, return [state.entities.records?.[kind]?.[name]?.revisions?.[recordKey]?.items?.[context]?.[revisionKey], state.entities.records?.[kind]?.[name]?.revisions?.[recordKey]?.itemIsComplete?.[context]?.[revisionKey]]; }); +;// external ["wp","privateApis"] +const external_wp_privateApis_namespaceObject = window["wp"]["privateApis"]; +;// ./node_modules/@wordpress/core-data/build-module/lock-unlock.js +/** + * WordPress dependencies + */ + +const { + lock, + unlock +} = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/core-data'); + ;// ./node_modules/@wordpress/core-data/build-module/private-selectors.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -5522,6 +4228,7 @@ const getRevision = (0,external_wp_data_namespaceObject.createSelector)((state, */ + /** * Returns the previous edit from the current undo offset * for the entity records edits history, if any. @@ -5592,6 +4299,1386 @@ function getRegisteredPostMeta(state, postType) { var _state$registeredPost; return (_state$registeredPost = state.registeredPostMeta?.[postType]) !== null && _state$registeredPost !== void 0 ? _state$registeredPost : {}; } +function normalizePageId(value) { + if (!value || !['number', 'string'].includes(typeof value)) { + return null; + } + + // We also need to check if it's not zero (`'0'`). + if (Number(value) === 0) { + return null; + } + return value.toString(); +} +const getHomePage = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (0,external_wp_data_namespaceObject.createSelector)(() => { + const canReadSiteData = select(STORE_NAME).canUser('read', { + kind: 'root', + name: 'site' + }); + if (!canReadSiteData) { + return null; + } + const siteData = select(STORE_NAME).getEntityRecord('root', 'site'); + if (!siteData) { + return null; + } + const homepageId = siteData?.show_on_front === 'page' ? normalizePageId(siteData.page_on_front) : null; + if (homepageId) { + return { + postType: 'page', + postId: homepageId + }; + } + const frontPageTemplateId = select(STORE_NAME).getDefaultTemplateId({ + slug: 'front-page' + }); + return { + postType: 'wp_template', + postId: frontPageTemplateId + }; +}, state => [canUser(state, 'read', { + kind: 'root', + name: 'site' +}) && getEntityRecord(state, 'root', 'site'), getDefaultTemplateId(state, { + slug: 'front-page' +})])); +const getPostsPageId = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => { + const canReadSiteData = select(STORE_NAME).canUser('read', { + kind: 'root', + name: 'site' + }); + if (!canReadSiteData) { + return null; + } + const siteData = select(STORE_NAME).getEntityRecord('root', 'site'); + return siteData?.show_on_front === 'page' ? normalizePageId(siteData.page_for_posts) : null; +}); +const getTemplateId = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, postType, postId) => { + const homepage = unlock(select(STORE_NAME)).getHomePage(); + if (!homepage) { + return; + } + + // For the front page, we always use the front page template if existing. + if (postType === 'page' && postType === homepage?.postType && postId.toString() === homepage?.postId) { + // The /lookup endpoint cannot currently handle a lookup + // when a page is set as the front page, so specifically in + // that case, we want to check if there is a front page + // template, and instead of falling back to the home + // template, we want to fall back to the page template. + const templates = select(STORE_NAME).getEntityRecords('postType', 'wp_template', { + per_page: -1 + }); + if (!templates) { + return; + } + const id = templates.find(({ + slug + }) => slug === 'front-page')?.id; + if (id) { + return id; + } + // If no front page template is found, continue with the + // logic below (fetching the page template). + } + const editedEntity = select(STORE_NAME).getEditedEntityRecord('postType', postType, postId); + if (!editedEntity) { + return; + } + const postsPageId = unlock(select(STORE_NAME)).getPostsPageId(); + // Check if the current page is the posts page. + if (postType === 'page' && postsPageId === postId.toString()) { + return select(STORE_NAME).getDefaultTemplateId({ + slug: 'home' + }); + } + // First see if the post/page has an assigned template and fetch it. + const currentTemplateSlug = editedEntity.template; + if (currentTemplateSlug) { + const currentTemplate = select(STORE_NAME).getEntityRecords('postType', 'wp_template', { + per_page: -1 + })?.find(({ + slug + }) => slug === currentTemplateSlug); + if (currentTemplate) { + return currentTemplate.id; + } + } + // If no template is assigned, use the default template. + let slugToCheck; + // In `draft` status we might not have a slug available, so we use the `single` + // post type templates slug(ex page, single-post, single-product etc..). + // Pages do not need the `single` prefix in the slug to be prioritized + // through template hierarchy. + if (editedEntity.slug) { + slugToCheck = postType === 'page' ? `${postType}-${editedEntity.slug}` : `single-${postType}-${editedEntity.slug}`; + } else { + slugToCheck = postType === 'page' ? 'page' : `single-${postType}`; + } + return select(STORE_NAME).getDefaultTemplateId({ + slug: slugToCheck + }); +}); + +;// ./node_modules/@wordpress/core-data/node_modules/uuid/dist/esm-browser/native.js +const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto); +/* harmony default export */ const esm_browser_native = ({ + randomUUID +}); +;// ./node_modules/@wordpress/core-data/node_modules/uuid/dist/esm-browser/rng.js +// Unique ID creation requires a high quality random # generator. In the browser we therefore +// require the crypto API and do not support built-in fallback to lower quality random number +// generators (like Math.random()). +let getRandomValues; +const rnds8 = new Uint8Array(16); +function rng() { + // lazy load so that environments that need to polyfill have a chance to do so + if (!getRandomValues) { + // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. + getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto); + + if (!getRandomValues) { + throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported'); + } + } + + return getRandomValues(rnds8); +} +;// ./node_modules/@wordpress/core-data/node_modules/uuid/dist/esm-browser/stringify.js + +/** + * Convert array of 16 byte values to UUID string format of the form: + * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX + */ + +const byteToHex = []; + +for (let i = 0; i < 256; ++i) { + byteToHex.push((i + 0x100).toString(16).slice(1)); +} + +function unsafeStringify(arr, offset = 0) { + // Note: Be careful editing this code! It's been tuned for performance + // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434 + return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]; +} + +function stringify(arr, offset = 0) { + const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one + // of the following: + // - One or more input array values don't map to a hex octet (leading to + // "undefined" in the uuid) + // - Invalid input values for the RFC `version` or `variant` fields + + if (!validate(uuid)) { + throw TypeError('Stringified UUID is invalid'); + } + + return uuid; +} + +/* harmony default export */ const esm_browser_stringify = ((/* unused pure expression or super */ null && (stringify))); +;// ./node_modules/@wordpress/core-data/node_modules/uuid/dist/esm-browser/v4.js + + + + +function v4(options, buf, offset) { + if (esm_browser_native.randomUUID && !buf && !options) { + return esm_browser_native.randomUUID(); + } + + options = options || {}; + const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` + + rnds[6] = rnds[6] & 0x0f | 0x40; + rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided + + if (buf) { + offset = offset || 0; + + for (let i = 0; i < 16; ++i) { + buf[offset + i] = rnds[i]; + } + + return buf; + } + + return unsafeStringify(rnds); +} + +/* harmony default export */ const esm_browser_v4 = (v4); +;// ./node_modules/@wordpress/core-data/build-module/utils/get-nested-value.js +/* wp:polyfill */ +/** + * Helper util to return a value from a certain path of the object. + * Path is specified as either: + * - a string of properties, separated by dots, for example: "x.y". + * - an array of properties, for example `[ 'x', 'y' ]`. + * You can also specify a default value in case the result is nullish. + * + * @param {Object} object Input object. + * @param {string|Array} path Path to the object property. + * @param {*} defaultValue Default value if the value at the specified path is undefined. + * @return {*} Value of the object property at the specified path. + */ +function getNestedValue(object, path, defaultValue) { + if (!object || typeof object !== 'object' || typeof path !== 'string' && !Array.isArray(path)) { + return object; + } + const normalizedPath = Array.isArray(path) ? path : path.split('.'); + let value = object; + normalizedPath.forEach(fieldName => { + value = value?.[fieldName]; + }); + return value !== undefined ? value : defaultValue; +} + +;// ./node_modules/@wordpress/core-data/build-module/queried-data/actions.js +/** + * Returns an action object used in signalling that items have been received. + * + * @param {Array} items Items received. + * @param {?Object} edits Optional edits to reset. + * @param {?Object} meta Meta information about pagination. + * + * @return {Object} Action object. + */ +function receiveItems(items, edits, meta) { + return { + type: 'RECEIVE_ITEMS', + items: Array.isArray(items) ? items : [items], + persistedEdits: edits, + meta + }; +} + +/** + * Returns an action object used in signalling that entity records have been + * deleted and they need to be removed from entities state. + * + * @param {string} kind Kind of the removed entities. + * @param {string} name Name of the removed entities. + * @param {Array|number|string} records Record IDs of the removed entities. + * @param {boolean} invalidateCache Controls whether we want to invalidate the cache. + * @return {Object} Action object. + */ +function removeItems(kind, name, records, invalidateCache = false) { + return { + type: 'REMOVE_ITEMS', + itemIds: Array.isArray(records) ? records : [records], + kind, + name, + invalidateCache + }; +} + +/** + * Returns an action object used in signalling that queried data has been + * received. + * + * @param {Array} items Queried items received. + * @param {?Object} query Optional query object. + * @param {?Object} edits Optional edits to reset. + * @param {?Object} meta Meta information about pagination. + * + * @return {Object} Action object. + */ +function receiveQueriedItems(items, query = {}, edits, meta) { + return { + ...receiveItems(items, edits, meta), + query + }; +} + +;// ./node_modules/@wordpress/core-data/build-module/batch/default-processor.js +/* wp:polyfill */ +/** + * WordPress dependencies + */ + + +/** + * Maximum number of requests to place in a single batch request. Obtained by + * sending a preflight OPTIONS request to /batch/v1/. + * + * @type {number?} + */ +let maxItems = null; +function chunk(arr, chunkSize) { + const tmp = [...arr]; + const cache = []; + while (tmp.length) { + cache.push(tmp.splice(0, chunkSize)); + } + return cache; +} + +/** + * Default batch processor. Sends its input requests to /batch/v1. + * + * @param {Array} requests List of API requests to perform at once. + * + * @return {Promise} Promise that resolves to a list of objects containing + * either `output` (if that request was successful) or `error` + * (if not ). + */ +async function defaultProcessor(requests) { + if (maxItems === null) { + const preflightResponse = await external_wp_apiFetch_default()({ + path: '/batch/v1', + method: 'OPTIONS' + }); + maxItems = preflightResponse.endpoints[0].args.requests.maxItems; + } + const results = []; + + // @ts-ignore We would have crashed or never gotten to this point if we hadn't received the maxItems count. + for (const batchRequests of chunk(requests, maxItems)) { + const batchResponse = await external_wp_apiFetch_default()({ + path: '/batch/v1', + method: 'POST', + data: { + validation: 'require-all-validate', + requests: batchRequests.map(request => ({ + path: request.path, + body: request.data, + // Rename 'data' to 'body'. + method: request.method, + headers: request.headers + })) + } + }); + let batchResults; + if (batchResponse.failed) { + batchResults = batchResponse.responses.map(response => ({ + error: response?.body + })); + } else { + batchResults = batchResponse.responses.map(response => { + const result = {}; + if (response.status >= 200 && response.status < 300) { + result.output = response.body; + } else { + result.error = response.body; + } + return result; + }); + } + results.push(...batchResults); + } + return results; +} + +;// ./node_modules/@wordpress/core-data/build-module/batch/create-batch.js +/* wp:polyfill */ +/** + * Internal dependencies + */ + + +/** + * Creates a batch, which can be used to combine multiple API requests into one + * API request using the WordPress batch processing API (/v1/batch). + * + * ``` + * const batch = createBatch(); + * const dunePromise = batch.add( { + * path: '/v1/books', + * method: 'POST', + * data: { title: 'Dune' } + * } ); + * const lotrPromise = batch.add( { + * path: '/v1/books', + * method: 'POST', + * data: { title: 'Lord of the Rings' } + * } ); + * const isSuccess = await batch.run(); // Sends one POST to /v1/batch. + * if ( isSuccess ) { + * console.log( + * 'Saved two books:', + * await dunePromise, + * await lotrPromise + * ); + * } + * ``` + * + * @param {Function} [processor] Processor function. Can be used to replace the + * default functionality which is to send an API + * request to /v1/batch. Is given an array of + * inputs and must return a promise that + * resolves to an array of objects containing + * either `output` or `error`. + */ +function createBatch(processor = defaultProcessor) { + let lastId = 0; + /** @type {Array<{ input: any; resolve: ( value: any ) => void; reject: ( error: any ) => void }>} */ + let queue = []; + const pending = new ObservableSet(); + return { + /** + * Adds an input to the batch and returns a promise that is resolved or + * rejected when the input is processed by `batch.run()`. + * + * You may also pass a thunk which allows inputs to be added + * asynchronously. + * + * ``` + * // Both are allowed: + * batch.add( { path: '/v1/books', ... } ); + * batch.add( ( add ) => add( { path: '/v1/books', ... } ) ); + * ``` + * + * If a thunk is passed, `batch.run()` will pause until either: + * + * - The thunk calls its `add` argument, or; + * - The thunk returns a promise and that promise resolves, or; + * - The thunk returns a non-promise. + * + * @param {any|Function} inputOrThunk Input to add or thunk to execute. + * + * @return {Promise|any} If given an input, returns a promise that + * is resolved or rejected when the batch is + * processed. If given a thunk, returns the return + * value of that thunk. + */ + add(inputOrThunk) { + const id = ++lastId; + pending.add(id); + const add = input => new Promise((resolve, reject) => { + queue.push({ + input, + resolve, + reject + }); + pending.delete(id); + }); + if (typeof inputOrThunk === 'function') { + return Promise.resolve(inputOrThunk(add)).finally(() => { + pending.delete(id); + }); + } + return add(inputOrThunk); + }, + /** + * Runs the batch. This calls `batchProcessor` and resolves or rejects + * all promises returned by `add()`. + * + * @return {Promise} A promise that resolves to a boolean that is true + * if the processor returned no errors. + */ + async run() { + if (pending.size) { + await new Promise(resolve => { + const unsubscribe = pending.subscribe(() => { + if (!pending.size) { + unsubscribe(); + resolve(undefined); + } + }); + }); + } + let results; + try { + results = await processor(queue.map(({ + input + }) => input)); + if (results.length !== queue.length) { + throw new Error('run: Array returned by processor must be same size as input array.'); + } + } catch (error) { + for (const { + reject + } of queue) { + reject(error); + } + throw error; + } + let isSuccess = true; + results.forEach((result, key) => { + const queueItem = queue[key]; + if (result?.error) { + queueItem?.reject(result.error); + isSuccess = false; + } else { + var _result$output; + queueItem?.resolve((_result$output = result?.output) !== null && _result$output !== void 0 ? _result$output : result); + } + }); + queue = []; + return isSuccess; + } + }; +} +class ObservableSet { + constructor(...args) { + this.set = new Set(...args); + this.subscribers = new Set(); + } + get size() { + return this.set.size; + } + add(value) { + this.set.add(value); + this.subscribers.forEach(subscriber => subscriber()); + return this; + } + delete(value) { + const isSuccess = this.set.delete(value); + this.subscribers.forEach(subscriber => subscriber()); + return isSuccess; + } + subscribe(subscriber) { + this.subscribers.add(subscriber); + return () => { + this.subscribers.delete(subscriber); + }; + } +} + +;// ./node_modules/@wordpress/core-data/build-module/actions.js +/* wp:polyfill */ +/** + * External dependencies + */ + + + +/** + * WordPress dependencies + */ + + + + +/** + * Internal dependencies + */ + + + + + + + +/** + * Returns an action object used in signalling that authors have been received. + * Ignored from documentation as it's internal to the data store. + * + * @ignore + * + * @param {string} queryID Query ID. + * @param {Array|Object} users Users received. + * + * @return {Object} Action object. + */ +function receiveUserQuery(queryID, users) { + return { + type: 'RECEIVE_USER_QUERY', + users: Array.isArray(users) ? users : [users], + queryID + }; +} + +/** + * Returns an action used in signalling that the current user has been received. + * Ignored from documentation as it's internal to the data store. + * + * @ignore + * + * @param {Object} currentUser Current user object. + * + * @return {Object} Action object. + */ +function receiveCurrentUser(currentUser) { + return { + type: 'RECEIVE_CURRENT_USER', + currentUser + }; +} + +/** + * Returns an action object used in adding new entities. + * + * @param {Array} entities Entities received. + * + * @return {Object} Action object. + */ +function addEntities(entities) { + return { + type: 'ADD_ENTITIES', + entities + }; +} + +/** + * Returns an action object used in signalling that entity records have been received. + * + * @param {string} kind Kind of the received entity record. + * @param {string} name Name of the received entity record. + * @param {Array|Object} records Records received. + * @param {?Object} query Query Object. + * @param {?boolean} invalidateCache Should invalidate query caches. + * @param {?Object} edits Edits to reset. + * @param {?Object} meta Meta information about pagination. + * @return {Object} Action object. + */ +function receiveEntityRecords(kind, name, records, query, invalidateCache = false, edits, meta) { + // Auto drafts should not have titles, but some plugins rely on them so we can't filter this + // on the server. + if (kind === 'postType') { + records = (Array.isArray(records) ? records : [records]).map(record => record.status === 'auto-draft' ? { + ...record, + title: '' + } : record); + } + let action; + if (query) { + action = receiveQueriedItems(records, query, edits, meta); + } else { + action = receiveItems(records, edits, meta); + } + return { + ...action, + kind, + name, + invalidateCache + }; +} + +/** + * Returns an action object used in signalling that the current theme has been received. + * Ignored from documentation as it's internal to the data store. + * + * @ignore + * + * @param {Object} currentTheme The current theme. + * + * @return {Object} Action object. + */ +function receiveCurrentTheme(currentTheme) { + return { + type: 'RECEIVE_CURRENT_THEME', + currentTheme + }; +} + +/** + * Returns an action object used in signalling that the current global styles id has been received. + * Ignored from documentation as it's internal to the data store. + * + * @ignore + * + * @param {string} currentGlobalStylesId The current global styles id. + * + * @return {Object} Action object. + */ +function __experimentalReceiveCurrentGlobalStylesId(currentGlobalStylesId) { + return { + type: 'RECEIVE_CURRENT_GLOBAL_STYLES_ID', + id: currentGlobalStylesId + }; +} + +/** + * Returns an action object used in signalling that the theme base global styles have been received + * Ignored from documentation as it's internal to the data store. + * + * @ignore + * + * @param {string} stylesheet The theme's identifier + * @param {Object} globalStyles The global styles object. + * + * @return {Object} Action object. + */ +function __experimentalReceiveThemeBaseGlobalStyles(stylesheet, globalStyles) { + return { + type: 'RECEIVE_THEME_GLOBAL_STYLES', + stylesheet, + globalStyles + }; +} + +/** + * Returns an action object used in signalling that the theme global styles variations have been received. + * Ignored from documentation as it's internal to the data store. + * + * @ignore + * + * @param {string} stylesheet The theme's identifier + * @param {Array} variations The global styles variations. + * + * @return {Object} Action object. + */ +function __experimentalReceiveThemeGlobalStyleVariations(stylesheet, variations) { + return { + type: 'RECEIVE_THEME_GLOBAL_STYLE_VARIATIONS', + stylesheet, + variations + }; +} + +/** + * Returns an action object used in signalling that the index has been received. + * + * @deprecated since WP 5.9, this is not useful anymore, use the selector directly. + * + * @return {Object} Action object. + */ +function receiveThemeSupports() { + external_wp_deprecated_default()("wp.data.dispatch( 'core' ).receiveThemeSupports", { + since: '5.9' + }); + return { + type: 'DO_NOTHING' + }; +} + +/** + * Returns an action object used in signalling that the theme global styles CPT post revisions have been received. + * Ignored from documentation as it's internal to the data store. + * + * @deprecated since WordPress 6.5.0. Callers should use `dispatch( 'core' ).receiveRevision` instead. + * + * @ignore + * + * @param {number} currentId The post id. + * @param {Array} revisions The global styles revisions. + * + * @return {Object} Action object. + */ +function receiveThemeGlobalStyleRevisions(currentId, revisions) { + external_wp_deprecated_default()("wp.data.dispatch( 'core' ).receiveThemeGlobalStyleRevisions()", { + since: '6.5.0', + alternative: "wp.data.dispatch( 'core' ).receiveRevisions" + }); + return { + type: 'RECEIVE_THEME_GLOBAL_STYLE_REVISIONS', + currentId, + revisions + }; +} + +/** + * Returns an action object used in signalling that the preview data for + * a given URl has been received. + * Ignored from documentation as it's internal to the data store. + * + * @ignore + * + * @param {string} url URL to preview the embed for. + * @param {*} preview Preview data. + * + * @return {Object} Action object. + */ +function receiveEmbedPreview(url, preview) { + return { + type: 'RECEIVE_EMBED_PREVIEW', + url, + preview + }; +} + +/** + * Action triggered to delete an entity record. + * + * @param {string} kind Kind of the deleted entity. + * @param {string} name Name of the deleted entity. + * @param {number|string} recordId Record ID of the deleted entity. + * @param {?Object} query Special query parameters for the + * DELETE API call. + * @param {Object} [options] Delete options. + * @param {Function} [options.__unstableFetch] Internal use only. Function to + * call instead of `apiFetch()`. + * Must return a promise. + * @param {boolean} [options.throwOnError=false] If false, this action suppresses all + * the exceptions. Defaults to false. + */ +const deleteEntityRecord = (kind, name, recordId, query, { + __unstableFetch = (external_wp_apiFetch_default()), + throwOnError = false +} = {}) => async ({ + dispatch, + resolveSelect +}) => { + const configs = await resolveSelect.getEntitiesConfig(kind); + const entityConfig = configs.find(config => config.kind === kind && config.name === name); + let error; + let deletedRecord = false; + if (!entityConfig) { + return; + } + const lock = await dispatch.__unstableAcquireStoreLock(STORE_NAME, ['entities', 'records', kind, name, recordId], { + exclusive: true + }); + try { + dispatch({ + type: 'DELETE_ENTITY_RECORD_START', + kind, + name, + recordId + }); + let hasError = false; + try { + let path = `${entityConfig.baseURL}/${recordId}`; + if (query) { + path = (0,external_wp_url_namespaceObject.addQueryArgs)(path, query); + } + deletedRecord = await __unstableFetch({ + path, + method: 'DELETE' + }); + await dispatch(removeItems(kind, name, recordId, true)); + } catch (_error) { + hasError = true; + error = _error; + } + dispatch({ + type: 'DELETE_ENTITY_RECORD_FINISH', + kind, + name, + recordId, + error + }); + if (hasError && throwOnError) { + throw error; + } + return deletedRecord; + } finally { + dispatch.__unstableReleaseStoreLock(lock); + } +}; + +/** + * Returns an action object that triggers an + * edit to an entity record. + * + * @param {string} kind Kind of the edited entity record. + * @param {string} name Name of the edited entity record. + * @param {number|string} recordId Record ID of the edited entity record. + * @param {Object} edits The edits. + * @param {Object} options Options for the edit. + * @param {boolean} [options.undoIgnore] Whether to ignore the edit in undo history or not. + * + * @return {Object} Action object. + */ +const editEntityRecord = (kind, name, recordId, edits, options = {}) => ({ + select, + dispatch +}) => { + const entityConfig = select.getEntityConfig(kind, name); + if (!entityConfig) { + throw new Error(`The entity being edited (${kind}, ${name}) does not have a loaded config.`); + } + const { + mergedEdits = {} + } = entityConfig; + const record = select.getRawEntityRecord(kind, name, recordId); + const editedRecord = select.getEditedEntityRecord(kind, name, recordId); + const edit = { + kind, + name, + recordId, + // Clear edits when they are equal to their persisted counterparts + // so that the property is not considered dirty. + edits: Object.keys(edits).reduce((acc, key) => { + const recordValue = record[key]; + const editedRecordValue = editedRecord[key]; + const value = mergedEdits[key] ? { + ...editedRecordValue, + ...edits[key] + } : edits[key]; + acc[key] = es6_default()(recordValue, value) ? undefined : value; + return acc; + }, {}) + }; + if (window.__experimentalEnableSync && entityConfig.syncConfig) { + if (false) {} + } else { + if (!options.undoIgnore) { + select.getUndoManager().addRecord([{ + id: { + kind, + name, + recordId + }, + changes: Object.keys(edits).reduce((acc, key) => { + acc[key] = { + from: editedRecord[key], + to: edits[key] + }; + return acc; + }, {}) + }], options.isCached); + } + dispatch({ + type: 'EDIT_ENTITY_RECORD', + ...edit + }); + } +}; + +/** + * Action triggered to undo the last edit to + * an entity record, if any. + */ +const undo = () => ({ + select, + dispatch +}) => { + const undoRecord = select.getUndoManager().undo(); + if (!undoRecord) { + return; + } + dispatch({ + type: 'UNDO', + record: undoRecord + }); +}; + +/** + * Action triggered to redo the last undone + * edit to an entity record, if any. + */ +const redo = () => ({ + select, + dispatch +}) => { + const redoRecord = select.getUndoManager().redo(); + if (!redoRecord) { + return; + } + dispatch({ + type: 'REDO', + record: redoRecord + }); +}; + +/** + * Forces the creation of a new undo level. + * + * @return {Object} Action object. + */ +const __unstableCreateUndoLevel = () => ({ + select +}) => { + select.getUndoManager().addRecord(); +}; + +/** + * Action triggered to save an entity record. + * + * @param {string} kind Kind of the received entity. + * @param {string} name Name of the received entity. + * @param {Object} record Record to be saved. + * @param {Object} options Saving options. + * @param {boolean} [options.isAutosave=false] Whether this is an autosave. + * @param {Function} [options.__unstableFetch] Internal use only. Function to + * call instead of `apiFetch()`. + * Must return a promise. + * @param {boolean} [options.throwOnError=false] If false, this action suppresses all + * the exceptions. Defaults to false. + */ +const saveEntityRecord = (kind, name, record, { + isAutosave = false, + __unstableFetch = (external_wp_apiFetch_default()), + throwOnError = false +} = {}) => async ({ + select, + resolveSelect, + dispatch +}) => { + const configs = await resolveSelect.getEntitiesConfig(kind); + const entityConfig = configs.find(config => config.kind === kind && config.name === name); + if (!entityConfig) { + return; + } + const entityIdKey = entityConfig.key || DEFAULT_ENTITY_KEY; + const recordId = record[entityIdKey]; + const lock = await dispatch.__unstableAcquireStoreLock(STORE_NAME, ['entities', 'records', kind, name, recordId || esm_browser_v4()], { + exclusive: true + }); + try { + // Evaluate optimized edits. + // (Function edits that should be evaluated on save to avoid expensive computations on every edit.) + for (const [key, value] of Object.entries(record)) { + if (typeof value === 'function') { + const evaluatedValue = value(select.getEditedEntityRecord(kind, name, recordId)); + dispatch.editEntityRecord(kind, name, recordId, { + [key]: evaluatedValue + }, { + undoIgnore: true + }); + record[key] = evaluatedValue; + } + } + dispatch({ + type: 'SAVE_ENTITY_RECORD_START', + kind, + name, + recordId, + isAutosave + }); + let updatedRecord; + let error; + let hasError = false; + try { + const path = `${entityConfig.baseURL}${recordId ? '/' + recordId : ''}`; + const persistedRecord = select.getRawEntityRecord(kind, name, recordId); + if (isAutosave) { + // Most of this autosave logic is very specific to posts. + // This is fine for now as it is the only supported autosave, + // but ideally this should all be handled in the back end, + // so the client just sends and receives objects. + const currentUser = select.getCurrentUser(); + const currentUserId = currentUser ? currentUser.id : undefined; + const autosavePost = await resolveSelect.getAutosave(persistedRecord.type, persistedRecord.id, currentUserId); + // Autosaves need all expected fields to be present. + // So we fallback to the previous autosave and then + // to the actual persisted entity if the edits don't + // have a value. + let data = { + ...persistedRecord, + ...autosavePost, + ...record + }; + data = Object.keys(data).reduce((acc, key) => { + if (['title', 'excerpt', 'content', 'meta'].includes(key)) { + acc[key] = data[key]; + } + return acc; + }, { + // Do not update the `status` if we have edited it when auto saving. + // It's very important to let the user explicitly save this change, + // because it can lead to unexpected results. An example would be to + // have a draft post and change the status to publish. + status: data.status === 'auto-draft' ? 'draft' : undefined + }); + updatedRecord = await __unstableFetch({ + path: `${path}/autosaves`, + method: 'POST', + data + }); + + // An autosave may be processed by the server as a regular save + // when its update is requested by the author and the post had + // draft or auto-draft status. + if (persistedRecord.id === updatedRecord.id) { + let newRecord = { + ...persistedRecord, + ...data, + ...updatedRecord + }; + newRecord = Object.keys(newRecord).reduce((acc, key) => { + // These properties are persisted in autosaves. + if (['title', 'excerpt', 'content'].includes(key)) { + acc[key] = newRecord[key]; + } else if (key === 'status') { + // Status is only persisted in autosaves when going from + // "auto-draft" to "draft". + acc[key] = persistedRecord.status === 'auto-draft' && newRecord.status === 'draft' ? newRecord.status : persistedRecord.status; + } else { + // These properties are not persisted in autosaves. + acc[key] = persistedRecord[key]; + } + return acc; + }, {}); + dispatch.receiveEntityRecords(kind, name, newRecord, undefined, true); + } else { + dispatch.receiveAutosaves(persistedRecord.id, updatedRecord); + } + } else { + let edits = record; + if (entityConfig.__unstablePrePersist) { + edits = { + ...edits, + ...entityConfig.__unstablePrePersist(persistedRecord, edits) + }; + } + updatedRecord = await __unstableFetch({ + path, + method: recordId ? 'PUT' : 'POST', + data: edits + }); + dispatch.receiveEntityRecords(kind, name, updatedRecord, undefined, true, edits); + } + } catch (_error) { + hasError = true; + error = _error; + } + dispatch({ + type: 'SAVE_ENTITY_RECORD_FINISH', + kind, + name, + recordId, + error, + isAutosave + }); + if (hasError && throwOnError) { + throw error; + } + return updatedRecord; + } finally { + dispatch.__unstableReleaseStoreLock(lock); + } +}; + +/** + * Runs multiple core-data actions at the same time using one API request. + * + * Example: + * + * ``` + * const [ savedRecord, updatedRecord, deletedRecord ] = + * await dispatch( 'core' ).__experimentalBatch( [ + * ( { saveEntityRecord } ) => saveEntityRecord( 'root', 'widget', widget ), + * ( { saveEditedEntityRecord } ) => saveEntityRecord( 'root', 'widget', 123 ), + * ( { deleteEntityRecord } ) => deleteEntityRecord( 'root', 'widget', 123, null ), + * ] ); + * ``` + * + * @param {Array} requests Array of functions which are invoked simultaneously. + * Each function is passed an object containing + * `saveEntityRecord`, `saveEditedEntityRecord`, and + * `deleteEntityRecord`. + * + * @return {(thunkArgs: Object) => Promise} A promise that resolves to an array containing the return + * values of each function given in `requests`. + */ +const __experimentalBatch = requests => async ({ + dispatch +}) => { + const batch = createBatch(); + const api = { + saveEntityRecord(kind, name, record, options) { + return batch.add(add => dispatch.saveEntityRecord(kind, name, record, { + ...options, + __unstableFetch: add + })); + }, + saveEditedEntityRecord(kind, name, recordId, options) { + return batch.add(add => dispatch.saveEditedEntityRecord(kind, name, recordId, { + ...options, + __unstableFetch: add + })); + }, + deleteEntityRecord(kind, name, recordId, query, options) { + return batch.add(add => dispatch.deleteEntityRecord(kind, name, recordId, query, { + ...options, + __unstableFetch: add + })); + } + }; + const resultPromises = requests.map(request => request(api)); + const [, ...results] = await Promise.all([batch.run(), ...resultPromises]); + return results; +}; + +/** + * Action triggered to save an entity record's edits. + * + * @param {string} kind Kind of the entity. + * @param {string} name Name of the entity. + * @param {Object} recordId ID of the record. + * @param {Object=} options Saving options. + */ +const saveEditedEntityRecord = (kind, name, recordId, options) => async ({ + select, + dispatch, + resolveSelect +}) => { + if (!select.hasEditsForEntityRecord(kind, name, recordId)) { + return; + } + const configs = await resolveSelect.getEntitiesConfig(kind); + const entityConfig = configs.find(config => config.kind === kind && config.name === name); + if (!entityConfig) { + return; + } + const entityIdKey = entityConfig.key || DEFAULT_ENTITY_KEY; + const edits = select.getEntityRecordNonTransientEdits(kind, name, recordId); + const record = { + [entityIdKey]: recordId, + ...edits + }; + return await dispatch.saveEntityRecord(kind, name, record, options); +}; + +/** + * Action triggered to save only specified properties for the entity. + * + * @param {string} kind Kind of the entity. + * @param {string} name Name of the entity. + * @param {number|string} recordId ID of the record. + * @param {Array} itemsToSave List of entity properties or property paths to save. + * @param {Object} options Saving options. + */ +const __experimentalSaveSpecifiedEntityEdits = (kind, name, recordId, itemsToSave, options) => async ({ + select, + dispatch, + resolveSelect +}) => { + if (!select.hasEditsForEntityRecord(kind, name, recordId)) { + return; + } + const edits = select.getEntityRecordNonTransientEdits(kind, name, recordId); + const editsToSave = {}; + for (const item of itemsToSave) { + setNestedValue(editsToSave, item, getNestedValue(edits, item)); + } + const configs = await resolveSelect.getEntitiesConfig(kind); + const entityConfig = configs.find(config => config.kind === kind && config.name === name); + const entityIdKey = entityConfig?.key || DEFAULT_ENTITY_KEY; + + // If a record key is provided then update the existing record. + // This necessitates providing `recordKey` to saveEntityRecord as part of the + // `record` argument (here called `editsToSave`) to stop that action creating + // a new record and instead cause it to update the existing record. + if (recordId) { + editsToSave[entityIdKey] = recordId; + } + return await dispatch.saveEntityRecord(kind, name, editsToSave, options); +}; + +/** + * Returns an action object used in signalling that Upload permissions have been received. + * + * @deprecated since WP 5.9, use receiveUserPermission instead. + * + * @param {boolean} hasUploadPermissions Does the user have permission to upload files? + * + * @return {Object} Action object. + */ +function receiveUploadPermissions(hasUploadPermissions) { + external_wp_deprecated_default()("wp.data.dispatch( 'core' ).receiveUploadPermissions", { + since: '5.9', + alternative: 'receiveUserPermission' + }); + return receiveUserPermission('create/media', hasUploadPermissions); +} + +/** + * Returns an action object used in signalling that the current user has + * permission to perform an action on a REST resource. + * Ignored from documentation as it's internal to the data store. + * + * @ignore + * + * @param {string} key A key that represents the action and REST resource. + * @param {boolean} isAllowed Whether or not the user can perform the action. + * + * @return {Object} Action object. + */ +function receiveUserPermission(key, isAllowed) { + return { + type: 'RECEIVE_USER_PERMISSION', + key, + isAllowed + }; +} + +/** + * Returns an action object used in signalling that the current user has + * permission to perform an action on a REST resource. Ignored from + * documentation as it's internal to the data store. + * + * @ignore + * + * @param {Object} permissions An object where keys represent + * actions and REST resources, and + * values indicate whether the user + * is allowed to perform the + * action. + * + * @return {Object} Action object. + */ +function receiveUserPermissions(permissions) { + return { + type: 'RECEIVE_USER_PERMISSIONS', + permissions + }; +} + +/** + * Returns an action object used in signalling that the autosaves for a + * post have been received. + * Ignored from documentation as it's internal to the data store. + * + * @ignore + * + * @param {number} postId The id of the post that is parent to the autosave. + * @param {Array|Object} autosaves An array of autosaves or singular autosave object. + * + * @return {Object} Action object. + */ +function receiveAutosaves(postId, autosaves) { + return { + type: 'RECEIVE_AUTOSAVES', + postId, + autosaves: Array.isArray(autosaves) ? autosaves : [autosaves] + }; +} + +/** + * Returns an action object signalling that the fallback Navigation + * Menu id has been received. + * + * @param {integer} fallbackId the id of the fallback Navigation Menu + * @return {Object} Action object. + */ +function receiveNavigationFallbackId(fallbackId) { + return { + type: 'RECEIVE_NAVIGATION_FALLBACK_ID', + fallbackId + }; +} + +/** + * Returns an action object used to set the template for a given query. + * + * @param {Object} query The lookup query. + * @param {string} templateId The resolved template id. + * + * @return {Object} Action object. + */ +function receiveDefaultTemplateId(query, templateId) { + return { + type: 'RECEIVE_DEFAULT_TEMPLATE', + query, + templateId + }; +} + +/** + * Action triggered to receive revision items. + * + * @param {string} kind Kind of the received entity record revisions. + * @param {string} name Name of the received entity record revisions. + * @param {number|string} recordKey The key of the entity record whose revisions you want to fetch. + * @param {Array|Object} records Revisions received. + * @param {?Object} query Query Object. + * @param {?boolean} invalidateCache Should invalidate query caches. + * @param {?Object} meta Meta information about pagination. + */ +const receiveRevisions = (kind, name, recordKey, records, query, invalidateCache = false, meta) => async ({ + dispatch, + resolveSelect +}) => { + const configs = await resolveSelect.getEntitiesConfig(kind); + const entityConfig = configs.find(config => config.kind === kind && config.name === name); + const key = entityConfig && entityConfig?.revisionKey ? entityConfig.revisionKey : DEFAULT_ENTITY_KEY; + dispatch({ + type: 'RECEIVE_ITEM_REVISIONS', + key, + items: Array.isArray(records) ? records : [records], + recordKey, + meta, + query, + kind, + name, + invalidateCache + }); +}; ;// ./node_modules/@wordpress/core-data/build-module/private-actions.js /** @@ -5646,7 +5733,11 @@ const forwardResolver = resolverName => (...args) => async ({ }; /* harmony default export */ const forward_resolver = (forwardResolver); +;// ./node_modules/@wordpress/core-data/build-module/utils/receive-intermediate-results.js +const RECEIVE_INTERMEDIATE_RESULTS = Symbol('RECEIVE_INTERMEDIATE_RESULTS'); + ;// ./node_modules/@wordpress/core-data/build-module/fetch/__experimental-fetch-link-suggestions.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -5807,8 +5898,16 @@ function sortResults(results, search) { for (const result of results) { if (result.title) { const titleTokens = tokenize(result.title); - const matchingTokens = titleTokens.filter(titleToken => searchTokens.some(searchToken => titleToken.includes(searchToken))); - scores[result.id] = matchingTokens.length / titleTokens.length; + const exactMatchingTokens = titleTokens.filter(titleToken => searchTokens.some(searchToken => titleToken === searchToken)); + const subMatchingTokens = titleTokens.filter(titleToken => searchTokens.some(searchToken => titleToken !== searchToken && titleToken.includes(searchToken))); + + // The score is a combination of exact matches and sub-matches. + // More weight is given to exact matches, as they are more relevant (e.g. "cat" vs "caterpillar"). + // Diving by the total number of tokens in the title normalizes the score and skews + // the results towards shorter titles. + const exactMatchScore = exactMatchingTokens.length / titleTokens.length * 10; + const subMatchScore = subMatchingTokens.length / titleTokens.length; + scores[result.id] = exactMatchScore + subMatchScore; } else { scores[result.id] = 0; } @@ -5855,7 +5954,7 @@ const CACHE = new Map(); * * @async * @param {string} url the URL to request details from. - * @param {Object?} options any options to pass to the underlying fetch. + * @param {?Object} options any options to pass to the underlying fetch. * @example * ```js * import { __experimentalFetchUrlData as fetchUrlData } from '@wordpress/core-data'; @@ -5899,6 +5998,7 @@ const fetchUrlData = async (url, options = {}) => { /* harmony default export */ const _experimental_fetch_url_data = (fetchUrlData); ;// ./node_modules/@wordpress/core-data/build-module/fetch/index.js +/* wp:polyfill */ /** * External dependencies */ @@ -5921,6 +6021,7 @@ async function fetchBlockPatterns() { } ;// ./node_modules/@wordpress/core-data/build-module/resolvers.js +/* wp:polyfill */ /** * External dependencies */ @@ -5983,9 +6084,10 @@ const resolvers_getCurrentUser = () => async ({ const resolvers_getEntityRecord = (kind, name, key = '', query) => async ({ select, dispatch, - registry + registry, + resolveSelect }) => { - const configs = await dispatch(getOrLoadEntitiesConfig(kind, name)); + const configs = await resolveSelect.getEntitiesConfig(kind); const entityConfig = configs.find(config => config.name === name && config.kind === kind); if (!entityConfig) { return; @@ -6080,14 +6182,15 @@ const resolvers_getEditedEntityRecord = forward_resolver('getEntityRecord'); * * @param {string} kind Entity kind. * @param {string} name Entity name. - * @param {Object?} query Query Object. If requesting specific fields, fields + * @param {?Object} query Query Object. If requesting specific fields, fields * must always include the ID. */ const resolvers_getEntityRecords = (kind, name, query = {}) => async ({ dispatch, - registry + registry, + resolveSelect }) => { - const configs = await dispatch(getOrLoadEntitiesConfig(kind, name)); + const configs = await resolveSelect.getEntitiesConfig(kind); const entityConfig = configs.find(config => config.name === name && config.kind === kind); if (!entityConfig) { return; @@ -6095,6 +6198,10 @@ const resolvers_getEntityRecords = (kind, name, query = {}) => async ({ const lock = await dispatch.__unstableAcquireStoreLock(STORE_NAME, ['entities', 'records', kind, name], { exclusive: false }); + const key = entityConfig.key || DEFAULT_ENTITY_KEY; + function getResolutionsArgs(records) { + return records.filter(record => record?.[key]).map(record => [kind, name, record[key]]); + } try { if (query._fields) { // If requesting specific fields, items and query association to said @@ -6109,7 +6216,8 @@ const resolvers_getEntityRecords = (kind, name, query = {}) => async ({ ...entityConfig.baseURLParams, ...query }); - let records, meta; + let records = [], + meta; if (entityConfig.supportsPagination && query.per_page !== -1) { const response = await external_wp_apiFetch_default()({ path, @@ -6120,6 +6228,30 @@ const resolvers_getEntityRecords = (kind, name, query = {}) => async ({ totalItems: parseInt(response.headers.get('X-WP-Total')), totalPages: parseInt(response.headers.get('X-WP-TotalPages')) }; + } else if (query.per_page === -1 && query[RECEIVE_INTERMEDIATE_RESULTS] === true) { + let page = 1; + let totalPages; + do { + const response = await external_wp_apiFetch_default()({ + path: (0,external_wp_url_namespaceObject.addQueryArgs)(path, { + page, + per_page: 100 + }), + parse: false + }); + const pageRecords = Object.values(await response.json()); + totalPages = parseInt(response.headers.get('X-WP-TotalPages')); + records.push(...pageRecords); + registry.batch(() => { + dispatch.receiveEntityRecords(kind, name, records, query); + dispatch.finishResolutions('getEntityRecord', getResolutionsArgs(pageRecords)); + }); + page++; + } while (page <= totalPages); + meta = { + totalItems: records.length, + totalPages: 1 + }; } else { records = Object.values(await external_wp_apiFetch_default()({ path @@ -6151,8 +6283,6 @@ const resolvers_getEntityRecords = (kind, name, query = {}) => async ({ // See https://github.com/WordPress/gutenberg/pull/26575 // See https://github.com/WordPress/gutenberg/pull/64504 if (!query?._fields && !query.context) { - const key = entityConfig.key || DEFAULT_ENTITY_KEY; - const resolutionsArgs = records.filter(record => record?.[key]).map(record => [kind, name, record[key]]); const targetHints = records.filter(record => record?.[key]).map(record => ({ id: record[key], permissions: getUserPermissionsFromAllowHeader(record?._links?.self?.[0].targetHints.allow) @@ -6174,7 +6304,7 @@ const resolvers_getEntityRecords = (kind, name, query = {}) => async ({ } } dispatch.receiveUserPermissions(receiveUserPermissionArgs); - dispatch.finishResolutions('getEntityRecord', resolutionsArgs); + dispatch.finishResolutions('getEntityRecord', getResolutionsArgs(records)); dispatch.finishResolutions('canUser', canUserResolutionsArgs); } dispatch.__unstableReleaseStoreLock(lock); @@ -6238,25 +6368,12 @@ const resolvers_getEmbedPreview = url => async ({ */ const resolvers_canUser = (requestedAction, resource, id) => async ({ dispatch, - registry + registry, + resolveSelect }) => { if (!ALLOWED_RESOURCE_ACTIONS.includes(requestedAction)) { throw new Error(`'${requestedAction}' is not a valid action.`); } - let resourcePath = null; - if (typeof resource === 'object') { - if (!resource.kind || !resource.name) { - throw new Error('The entity resource object is not valid.'); - } - const configs = await dispatch(getOrLoadEntitiesConfig(resource.kind, resource.name)); - const entityConfig = configs.find(config => config.name === resource.name && config.kind === resource.kind); - if (!entityConfig) { - return; - } - resourcePath = entityConfig.baseURL + (resource.id ? '/' + resource.id : ''); - } else { - resourcePath = `/wp/v2/${resource}` + (id ? '/' + id : ''); - } const { hasStartedResolution } = registry.select(STORE_NAME); @@ -6271,6 +6388,20 @@ const resolvers_canUser = (requestedAction, resource, id) => async ({ return; } } + let resourcePath = null; + if (typeof resource === 'object') { + if (!resource.kind || !resource.name) { + throw new Error('The entity resource object is not valid.'); + } + const configs = await resolveSelect.getEntitiesConfig(resource.kind); + const entityConfig = configs.find(config => config.name === resource.name && config.kind === resource.kind); + if (!entityConfig) { + return; + } + resourcePath = entityConfig.baseURL + (resource.id ? '/' + resource.id : ''); + } else { + resourcePath = `/wp/v2/${resource}` + (id ? '/' + id : ''); + } let response; try { response = await external_wp_apiFetch_default()({ @@ -6331,8 +6462,12 @@ const resolvers_getAutosaves = (postType, postId) => async ({ }) => { const { rest_base: restBase, - rest_namespace: restNamespace = 'wp/v2' + rest_namespace: restNamespace = 'wp/v2', + supports } = await resolveSelect.getPostType(postType); + if (!supports?.autosave) { + return; + } const autosaves = await external_wp_apiFetch_default()({ path: `/${restNamespace}/${restBase}/${postId}/autosaves?context=edit` }); @@ -6355,43 +6490,6 @@ const resolvers_getAutosave = (postType, postId) => async ({ }) => { await resolveSelect.getAutosaves(postType, postId); }; - -/** - * Retrieve the frontend template used for a given link. - * - * @param {string} link Link. - */ -const resolvers_experimentalGetTemplateForLink = link => async ({ - dispatch, - resolveSelect -}) => { - let template; - try { - // This is NOT calling a REST endpoint but rather ends up with a response from - // an Ajax function which has a different shape from a WP_REST_Response. - template = await external_wp_apiFetch_default()({ - url: (0,external_wp_url_namespaceObject.addQueryArgs)(link, { - '_wp-find-template': true - }) - }).then(({ - data - }) => data); - } catch (e) { - // For non-FSE themes, it is possible that this request returns an error. - } - if (!template) { - return; - } - const record = await resolveSelect.getEntityRecord('postType', 'wp_template', template.id); - if (record) { - dispatch.receiveEntityRecords('postType', 'wp_template', [record], { - 'find-template': link - }); - } -}; -resolvers_experimentalGetTemplateForLink.shouldInvalidate = action => { - return (action.type === 'RECEIVE_ITEMS' || action.type === 'REMOVE_ITEMS') && action.invalidateCache && action.kind === 'postType' && action.name === 'wp_template'; -}; const resolvers_experimentalGetCurrentGlobalStylesId = () => async ({ dispatch, resolveSelect @@ -6524,14 +6622,24 @@ const resolvers_getNavigationFallbackId = () => async ({ }); }; const resolvers_getDefaultTemplateId = query => async ({ - dispatch + dispatch, + registry, + resolveSelect }) => { const template = await external_wp_apiFetch_default()({ path: (0,external_wp_url_namespaceObject.addQueryArgs)('/wp/v2/templates/lookup', query) }); + // Wait for the the entities config to be loaded, otherwise receiving + // the template as an entity will not work. + await resolveSelect.getEntitiesConfig('postType'); // Endpoint may return an empty object if no template is found. if (template?.id) { - dispatch.receiveDefaultTemplateId(query, template.id); + registry.batch(() => { + dispatch.receiveDefaultTemplateId(query, template.id); + dispatch.receiveEntityRecords('postType', 'wp_template', [template]); + // Avoid further network requests. + dispatch.finishResolution('getEntityRecord', ['postType', 'wp_template', template.id]); + }); } }; @@ -6547,9 +6655,10 @@ const resolvers_getDefaultTemplateId = query => async ({ */ const resolvers_getRevisions = (kind, name, recordKey, query = {}) => async ({ dispatch, - registry + registry, + resolveSelect }) => { - const configs = await dispatch(getOrLoadEntitiesConfig(kind, name)); + const configs = await resolveSelect.getEntitiesConfig(kind); const entityConfig = configs.find(config => config.name === name && config.kind === kind); if (!entityConfig) { return; @@ -6626,9 +6735,10 @@ resolvers_getRevisions.shouldInvalidate = (action, kind, name, recordKey) => act * fields, fields must always include the ID. */ const resolvers_getRevision = (kind, name, recordKey, revisionKey, query) => async ({ - dispatch + dispatch, + resolveSelect }) => { - const configs = await dispatch(getOrLoadEntitiesConfig(kind, name)); + const configs = await resolveSelect.getEntitiesConfig(kind); const entityConfig = configs.find(config => config.name === name && config.kind === kind); if (!entityConfig) { return; @@ -6685,7 +6795,31 @@ const resolvers_getRegisteredPostMeta = postType => async ({ } }; +/** + * Requests entity configs for the given kind from the REST API. + * + * @param {string} kind Entity kind. + */ +const resolvers_getEntitiesConfig = kind => async ({ + dispatch +}) => { + const loader = additionalEntityConfigLoaders.find(l => l.kind === kind); + if (!loader) { + return; + } + try { + const configs = await loader.loadEntities(); + if (!configs.length) { + return; + } + dispatch.addEntities(configs); + } catch { + // Do nothing if the request comes back with an API error. + } +}; + ;// ./node_modules/@wordpress/core-data/build-module/locks/utils.js +/* wp:polyfill */ function deepCopyLocksTreePath(tree, path) { const newTree = { ...tree @@ -6748,6 +6882,7 @@ function hasConflictingLock({ } ;// ./node_modules/@wordpress/core-data/build-module/locks/reducer.js +/* wp:polyfill */ /** * Internal dependencies */ @@ -6942,17 +7077,34 @@ function createLocksActions() { }; } -;// external ["wp","privateApis"] -const external_wp_privateApis_namespaceObject = window["wp"]["privateApis"]; -;// ./node_modules/@wordpress/core-data/build-module/lock-unlock.js +;// ./node_modules/@wordpress/core-data/build-module/dynamic-entities.js /** - * WordPress dependencies + * Internal dependencies */ -const { - lock, - unlock -} = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/core-data'); +/** + * A simple utility that pluralizes a string. + * Converts: + * - "post" to "posts" + * - "taxonomy" to "taxonomies" + * - "media" to "mediaItems" + * - "status" to "statuses" + * + * It does not pluralize "GlobalStyles" due to lack of clarity about it at time of writing. + */ + +/** + * A simple utility that singularizes a string. + * + * Converts: + * - "posts" to "post" + * - "taxonomies" to "taxonomy" + * - "mediaItems" to "media" + * - "statuses" to "status" + */ + +let dynamicActions; +let dynamicSelectors; ;// external ["wp","element"] const external_wp_element_namespaceObject = window["wp"]["element"]; @@ -7379,6 +7531,8 @@ const use_entity_record_EMPTY_OBJECT = {}; * return ( *
    * updateFootnotesFromMeta(_blocks, meta), [meta]); const onChange = (0,external_wp_element_namespaceObject.useCallback)((newBlocks, options) => { const noChange = blocks === newBlocks; if (noChange) { @@ -8078,19 +8233,19 @@ function useEntityBlockEditor(kind, name, { content: ({ blocks: blocksForSerialization = [] }) => (0,external_wp_blocks_namespaceObject.__unstableSerializeAndClean)(blocksForSerialization), - ...updateFootnotes(newBlocks) + ...updateFootnotesFromMeta(newBlocks, meta) }; editEntityRecord(kind, name, id, edits, { isCached: false, ...rest }); - }, [kind, name, id, blocks, updateFootnotes, __unstableCreateUndoLevel, editEntityRecord]); + }, [kind, name, id, blocks, meta, __unstableCreateUndoLevel, editEntityRecord]); const onInput = (0,external_wp_element_namespaceObject.useCallback)((newBlocks, options) => { const { selection, ...rest } = options; - const footnotesChanges = updateFootnotes(newBlocks); + const footnotesChanges = updateFootnotesFromMeta(newBlocks, meta); const edits = { selection, ...footnotesChanges @@ -8099,7 +8254,7 @@ function useEntityBlockEditor(kind, name, { isCached: true, ...rest }); - }, [kind, name, id, updateFootnotes, editEntityRecord]); + }, [kind, name, id, meta, editEntityRecord]); return [blocks, onInput, onChange]; } @@ -8176,12 +8331,15 @@ function useEntityProp(kind, name, prop, _id) { */ + const privateApis = {}; lock(privateApis, { - useEntityRecordsWithPermissions: useEntityRecordsWithPermissions + useEntityRecordsWithPermissions: useEntityRecordsWithPermissions, + RECEIVE_INTERMEDIATE_RESULTS: RECEIVE_INTERMEDIATE_RESULTS }); ;// ./node_modules/@wordpress/core-data/build-module/index.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -8201,6 +8359,7 @@ lock(privateApis, { + // The entity selectors/resolvers and actions are shortcuts to their generic equivalents // (getEntityRecord, getEntityRecords, updateEntityRecord, updateEntityRecords) // Instead of getEntityRecord, the consumer could use more user-friendly named selector: getPostType, getTaxonomy... @@ -8244,11 +8403,13 @@ const entityActions = build_module_entitiesConfig.reduce((result, entity) => { const storeConfig = () => ({ reducer: build_module_reducer, actions: { + ...dynamicActions, ...build_module_actions_namespaceObject, ...entityActions, ...createLocksActions() }, selectors: { + ...dynamicSelectors, ...build_module_selectors_namespaceObject, ...entitySelectors }, diff --git a/wp-includes/js/dist/core-data.min.js b/wp-includes/js/dist/core-data.min.js index 4a6eba0cc8..d6aae16788 100644 --- a/wp-includes/js/dist/core-data.min.js +++ b/wp-includes/js/dist/core-data.min.js @@ -1,2 +1,2 @@ /*! This file is auto-generated */ -(()=>{"use strict";var e={6689:(e,t,n)=>{n.d(t,{createUndoManager:()=>a});var r=n(923),s=n.n(r);function i(e,t){const n={...e};return Object.entries(t).forEach((([e,t])=>{n[e]?n[e]={...n[e],to:t.to}:n[e]=t})),n}const o=(e,t)=>{const n=e?.findIndex((({id:e})=>"string"==typeof e?e===t.id:s()(e,t.id))),r=[...e];return-1!==n?r[n]={id:t.id,changes:i(r[n].changes,t.changes)}:r.push(t),r};function a(){let e=[],t=[],n=0;const r=()=>{e=e.slice(0,n||void 0),n=0},i=()=>{var n;const r=0===e.length?0:e.length-1;let s=null!==(n=e[r])&&void 0!==n?n:[];t.forEach((e=>{s=o(s,e)})),t=[],e[r]=s};return{addRecord(n,a=!1){const c=!n||(e=>!e.filter((({changes:e})=>Object.values(e).some((({from:e,to:t})=>"function"!=typeof e&&"function"!=typeof t&&!s()(e,t))))).length)(n);if(a){if(c)return;n.forEach((e=>{t=o(t,e)}))}else{if(r(),t.length&&i(),c)return;e.push(n)}},undo(){t.length&&(r(),i());const s=e[e.length-1+n];if(s)return n-=1,s},redo(){const t=e[e.length+n];if(t)return n+=1,t},hasUndo:()=>!!e[e.length-1+n],hasRedo:()=>!!e[e.length+n]}}},3249:e=>{function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}function n(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:this;this._map.forEach((function(s,i){null!==i&&"object"===t(i)&&(s=s[1]),e.call(r,s,i,n)}))}},{key:"clear",value:function(){this._map=new Map,this._arrayTreeMap=new Map,this._objectTreeMap=new Map}},{key:"size",get:function(){return this._map.size}}],i&&n(s.prototype,i),o&&n(s,o),e}();e.exports=s},7734:e=>{e.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var r,s,i;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(s=r;0!=s--;)if(!e(t[s],n[s]))return!1;return!0}if(t instanceof Map&&n instanceof Map){if(t.size!==n.size)return!1;for(s of t.entries())if(!n.has(s[0]))return!1;for(s of t.entries())if(!e(s[1],n.get(s[0])))return!1;return!0}if(t instanceof Set&&n instanceof Set){if(t.size!==n.size)return!1;for(s of t.entries())if(!n.has(s[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(n)){if((r=t.length)!=n.length)return!1;for(s=r;0!=s--;)if(t[s]!==n[s])return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(i=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(s=r;0!=s--;)if(!Object.prototype.hasOwnProperty.call(n,i[s]))return!1;for(s=r;0!=s--;){var o=i[s];if(!e(t[o],n[o]))return!1}return!0}return t!=t&&n!=n}},923:e=>{e.exports=window.wp.isShallowEqual}},t={};function n(r){var s=t[r];if(void 0!==s)return s.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};n.r(r),n.d(r,{EntityProvider:()=>Jn,__experimentalFetchLinkSuggestions:()=>on,__experimentalFetchUrlData:()=>ln,__experimentalUseEntityRecord:()=>ir,__experimentalUseEntityRecords:()=>cr,__experimentalUseResourcePermissions:()=>dr,fetchBlockPatterns:()=>un,privateApis:()=>Tr,store:()=>Ar,useEntityBlockEditor:()=>wr,useEntityId:()=>fr,useEntityProp:()=>Sr,useEntityRecord:()=>sr,useEntityRecords:()=>ar,useResourcePermissions:()=>ur});var s={};n.r(s),n.d(s,{__experimentalBatch:()=>de,__experimentalReceiveCurrentGlobalStylesId:()=>Z,__experimentalReceiveThemeBaseGlobalStyles:()=>ee,__experimentalReceiveThemeGlobalStyleVariations:()=>te,__experimentalSaveSpecifiedEntityEdits:()=>fe,__unstableCreateUndoLevel:()=>le,addEntities:()=>W,deleteEntityRecord:()=>ie,editEntityRecord:()=>oe,receiveAutosaves:()=>ge,receiveCurrentTheme:()=>X,receiveCurrentUser:()=>z,receiveDefaultTemplateId:()=>ve,receiveEmbedPreview:()=>se,receiveEntityRecords:()=>J,receiveNavigationFallbackId:()=>he,receiveRevisions:()=>_e,receiveThemeGlobalStyleRevisions:()=>re,receiveThemeSupports:()=>ne,receiveUploadPermissions:()=>ye,receiveUserPermission:()=>Ee,receiveUserPermissions:()=>me,receiveUserQuery:()=>H,redo:()=>ce,saveEditedEntityRecord:()=>pe,saveEntityRecord:()=>ue,undo:()=>ae});var i={};n.r(i),n.d(i,{__experimentalGetCurrentGlobalStylesId:()=>Ot,__experimentalGetCurrentThemeBaseGlobalStyles:()=>Vt,__experimentalGetCurrentThemeGlobalStylesVariations:()=>Gt,__experimentalGetDirtyEntityRecords:()=>pt,__experimentalGetEntitiesBeingSaved:()=>ft,__experimentalGetEntityRecordNoResolver:()=>ot,__experimentalGetTemplateForLink:()=>Nt,canUser:()=>Ut,canUserEditEntityRecord:()=>xt,getAuthors:()=>Xe,getAutosave:()=>jt,getAutosaves:()=>Lt,getBlockPatternCategories:()=>Bt,getBlockPatterns:()=>qt,getCurrentTheme:()=>kt,getCurrentThemeGlobalStylesRevisions:()=>Ft,getCurrentUser:()=>Ze,getDefaultTemplateId:()=>Kt,getEditedEntityRecord:()=>gt,getEmbedPreview:()=>At,getEntitiesByKind:()=>tt,getEntitiesConfig:()=>nt,getEntity:()=>rt,getEntityConfig:()=>st,getEntityRecord:()=>it,getEntityRecordEdits:()=>yt,getEntityRecordNonTransientEdits:()=>Et,getEntityRecords:()=>lt,getEntityRecordsTotalItems:()=>ut,getEntityRecordsTotalPages:()=>dt,getLastEntityDeleteError:()=>bt,getLastEntitySaveError:()=>Rt,getRawEntityRecord:()=>at,getRedoEdit:()=>St,getReferenceByDistinctEdits:()=>Dt,getRevision:()=>Yt,getRevisions:()=>Qt,getThemeSupports:()=>Ct,getUndoEdit:()=>wt,getUserPatternCategories:()=>$t,getUserQueryResults:()=>et,hasEditsForEntityRecord:()=>mt,hasEntityRecords:()=>ct,hasFetchedAutosaves:()=>Mt,hasRedo:()=>It,hasUndo:()=>Tt,isAutosavingEntityRecord:()=>ht,isDeletingEntityRecord:()=>_t,isPreviewEmbedFallback:()=>Pt,isRequestingEmbedPreview:()=>Je,isSavingEntityRecord:()=>vt});var o={};n.r(o),n.d(o,{getBlockPatternsForPostType:()=>Wt,getEntityRecordPermissions:()=>Xt,getEntityRecordsPermissions:()=>Jt,getNavigationFallbackId:()=>zt,getRegisteredPostMeta:()=>Zt,getUndoManager:()=>Ht});var a={};n.r(a),n.d(a,{receiveRegisteredPostMeta:()=>en});var c={};n.r(c),n.d(c,{__experimentalGetCurrentGlobalStylesId:()=>Tn,__experimentalGetCurrentThemeBaseGlobalStyles:()=>In,__experimentalGetCurrentThemeGlobalStylesVariations:()=>kn,__experimentalGetTemplateForLink:()=>Sn,canUser:()=>_n,canUserEditEntityRecord:()=>Rn,getAuthors:()=>dn,getAutosave:()=>wn,getAutosaves:()=>bn,getBlockPatternCategories:()=>An,getBlockPatterns:()=>Cn,getCurrentTheme:()=>gn,getCurrentThemeGlobalStylesRevisions:()=>On,getCurrentUser:()=>pn,getDefaultTemplateId:()=>xn,getEditedEntityRecord:()=>En,getEmbedPreview:()=>vn,getEntityRecord:()=>fn,getEntityRecords:()=>mn,getNavigationFallbackId:()=>Un,getRawEntityRecord:()=>yn,getRegisteredPostMeta:()=>Mn,getRevision:()=>jn,getRevisions:()=>Ln,getThemeSupports:()=>hn,getUserPatternCategories:()=>Pn});const l=window.wp.data;var u=n(7734),d=n.n(u);const p=window.wp.compose;var f=n(6689);const y=e=>t=>(n,r)=>void 0===n||e(r)?t(n,r):n,E=e=>t=>(n,r)=>t(n,e(r));const m=e=>t=>(n={},r)=>{const s=r[e];if(void 0===s)return n;const i=t(n[s],r);return i===n[s]?n:{...n,[s]:i}};var g=function(){return g=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&n>="0"&&n<="9"?"_"+n+r:""+n.toUpperCase()+r}function T(e,t){return void 0===t&&(t={}),R(e,g({delimiter:"",transform:S},t))}const I=window.wp.apiFetch;var k=n.n(I);const O=window.wp.i18n,C=window.wp.richText,A={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let P;const U=new Uint8Array(16);function x(){if(!P&&(P="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!P))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return P(U)}const L=[];for(let e=0;e<256;++e)L.push((e+256).toString(16).slice(1));function j(e,t=0){return L[e[t+0]]+L[e[t+1]]+L[e[t+2]]+L[e[t+3]]+"-"+L[e[t+4]]+L[e[t+5]]+"-"+L[e[t+6]]+L[e[t+7]]+"-"+L[e[t+8]]+L[e[t+9]]+"-"+L[e[t+10]]+L[e[t+11]]+L[e[t+12]]+L[e[t+13]]+L[e[t+14]]+L[e[t+15]]}const M=function(e,t,n){if(A.randomUUID&&!t&&!e)return A.randomUUID();const r=(e=e||{}).random||(e.rng||x)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=r[e];return t}return j(r)},D=window.wp.url,N=window.wp.deprecated;var V=n.n(N);function G(e,t,n){if(!e||"object"!=typeof e)return e;const r=Array.isArray(t)?t:t.split(".");return r.reduce(((e,t,s)=>(void 0===e[t]&&(Number.isInteger(r[s+1])?e[t]=[]:e[t]={}),s===r.length-1&&(e[t]=n),e[t])),e),e}function q(e,t,n){if(!e||"object"!=typeof e||"string"!=typeof t&&!Array.isArray(t))return e;const r=Array.isArray(t)?t:t.split(".");let s=e;return r.forEach((e=>{s=s?.[e]})),void 0!==s?s:n}function B(e,t,n){return{type:"RECEIVE_ITEMS",items:Array.isArray(e)?e:[e],persistedEdits:t,meta:n}}let $=null;async function F(e){if(null===$){const e=await k()({path:"/batch/v1",method:"OPTIONS"});$=e.endpoints[0].args.requests.maxItems}const t=[];for(const n of function(e,t){const n=[...e],r=[];for(;n.length;)r.push(n.splice(0,t));return r}(e,$)){const e=await k()({path:"/batch/v1",method:"POST",data:{validation:"require-all-validate",requests:n.map((e=>({path:e.path,body:e.data,method:e.method,headers:e.headers})))}});let r;r=e.failed?e.responses.map((e=>({error:e?.body}))):e.responses.map((e=>{const t={};return e.status>=200&&e.status<300?t.output=e.body:t.error=e.body,t})),t.push(...r)}return t}function K(e=F){let t=0,n=[];const r=new Q;return{add(e){const s=++t;r.add(s);const i=e=>new Promise(((t,i)=>{n.push({input:e,resolve:t,reject:i}),r.delete(s)}));return"function"==typeof e?Promise.resolve(e(i)).finally((()=>{r.delete(s)})):i(e)},async run(){let t;r.size&&await new Promise((e=>{const t=r.subscribe((()=>{r.size||(t(),e(void 0))}))}));try{if(t=await e(n.map((({input:e})=>e))),t.length!==n.length)throw new Error("run: Array returned by processor must be same size as input array.")}catch(e){for(const{reject:t}of n)t(e);throw e}let s=!0;return t.forEach(((e,t)=>{const r=n[t];var i;e?.error?(r?.reject(e.error),s=!1):r?.resolve(null!==(i=e?.output)&&void 0!==i?i:e)})),n=[],s}}}class Q{constructor(...e){this.set=new Set(...e),this.subscribers=new Set}get size(){return this.set.size}add(e){return this.set.add(e),this.subscribers.forEach((e=>e())),this}delete(e){const t=this.set.delete(e);return this.subscribers.forEach((e=>e())),t}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}}const Y="core";function H(e,t){return{type:"RECEIVE_USER_QUERY",users:Array.isArray(t)?t:[t],queryID:e}}function z(e){return{type:"RECEIVE_CURRENT_USER",currentUser:e}}function W(e){return{type:"ADD_ENTITIES",entities:e}}function J(e,t,n,r,s=!1,i,o){let a;return"postType"===e&&(n=(Array.isArray(n)?n:[n]).map((e=>"auto-draft"===e.status?{...e,title:""}:e))),a=r?function(e,t={},n,r){return{...B(e,n,r),query:t}}(n,r,i,o):B(n,i,o),{...a,kind:e,name:t,invalidateCache:s}}function X(e){return{type:"RECEIVE_CURRENT_THEME",currentTheme:e}}function Z(e){return{type:"RECEIVE_CURRENT_GLOBAL_STYLES_ID",id:e}}function ee(e,t){return{type:"RECEIVE_THEME_GLOBAL_STYLES",stylesheet:e,globalStyles:t}}function te(e,t){return{type:"RECEIVE_THEME_GLOBAL_STYLE_VARIATIONS",stylesheet:e,variations:t}}function ne(){return V()("wp.data.dispatch( 'core' ).receiveThemeSupports",{since:"5.9"}),{type:"DO_NOTHING"}}function re(e,t){return V()("wp.data.dispatch( 'core' ).receiveThemeGlobalStyleRevisions()",{since:"6.5.0",alternative:"wp.data.dispatch( 'core' ).receiveRevisions"}),{type:"RECEIVE_THEME_GLOBAL_STYLE_REVISIONS",currentId:e,revisions:t}}function se(e,t){return{type:"RECEIVE_EMBED_PREVIEW",url:e,preview:t}}const ie=(e,t,n,r,{__unstableFetch:s=k(),throwOnError:i=!1}={})=>async({dispatch:o})=>{const a=(await o(Ae(e,t))).find((n=>n.kind===e&&n.name===t));let c,l=!1;if(!a)return;const u=await o.__unstableAcquireStoreLock(Y,["entities","records",e,t,n],{exclusive:!0});try{o({type:"DELETE_ENTITY_RECORD_START",kind:e,name:t,recordId:n});let u=!1;try{let i=`${a.baseURL}/${n}`;r&&(i=(0,D.addQueryArgs)(i,r)),l=await s({path:i,method:"DELETE"}),await o(function(e,t,n,r=!1){return{type:"REMOVE_ITEMS",itemIds:Array.isArray(n)?n:[n],kind:e,name:t,invalidateCache:r}}(e,t,n,!0))}catch(e){u=!0,c=e}if(o({type:"DELETE_ENTITY_RECORD_FINISH",kind:e,name:t,recordId:n,error:c}),u&&i)throw c;return l}finally{o.__unstableReleaseStoreLock(u)}},oe=(e,t,n,r,s={})=>({select:i,dispatch:o})=>{const a=i.getEntityConfig(e,t);if(!a)throw new Error(`The entity being edited (${e}, ${t}) does not have a loaded config.`);const{mergedEdits:c={}}=a,l=i.getRawEntityRecord(e,t,n),u=i.getEditedEntityRecord(e,t,n),p={kind:e,name:t,recordId:n,edits:Object.keys(r).reduce(((e,t)=>{const n=l[t],s=u[t],i=c[t]?{...s,...r[t]}:r[t];return e[t]=d()(n,i)?void 0:i,e}),{})};window.__experimentalEnableSync&&a.syncConfig||(s.undoIgnore||i.getUndoManager().addRecord([{id:{kind:e,name:t,recordId:n},changes:Object.keys(r).reduce(((e,t)=>(e[t]={from:u[t],to:r[t]},e)),{})}],s.isCached),o({type:"EDIT_ENTITY_RECORD",...p}))},ae=()=>({select:e,dispatch:t})=>{const n=e.getUndoManager().undo();n&&t({type:"UNDO",record:n})},ce=()=>({select:e,dispatch:t})=>{const n=e.getUndoManager().redo();n&&t({type:"REDO",record:n})},le=()=>({select:e})=>{e.getUndoManager().addRecord()},ue=(e,t,n,{isAutosave:r=!1,__unstableFetch:s=k(),throwOnError:i=!1}={})=>async({select:o,resolveSelect:a,dispatch:c})=>{const l=(await c(Ae(e,t))).find((n=>n.kind===e&&n.name===t));if(!l)return;const u=l.key||Re,d=n[u],p=await c.__unstableAcquireStoreLock(Y,["entities","records",e,t,d||M()],{exclusive:!0});try{for(const[r,s]of Object.entries(n))if("function"==typeof s){const i=s(o.getEditedEntityRecord(e,t,d));c.editEntityRecord(e,t,d,{[r]:i},{undoIgnore:!0}),n[r]=i}let u,p;c({type:"SAVE_ENTITY_RECORD_START",kind:e,name:t,recordId:d,isAutosave:r});let f=!1;try{const i=`${l.baseURL}${d?"/"+d:""}`,p=o.getRawEntityRecord(e,t,d);if(r){const r=o.getCurrentUser(),l=r?r.id:void 0,d=await a.getAutosave(p.type,p.id,l);let f={...p,...d,...n};if(f=Object.keys(f).reduce(((e,t)=>(["title","excerpt","content","meta"].includes(t)&&(e[t]=f[t]),e)),{status:"auto-draft"===f.status?"draft":void 0}),u=await s({path:`${i}/autosaves`,method:"POST",data:f}),p.id===u.id){let n={...p,...f,...u};n=Object.keys(n).reduce(((e,t)=>(["title","excerpt","content"].includes(t)?e[t]=n[t]:e[t]="status"===t?"auto-draft"===p.status&&"draft"===n.status?n.status:p.status:p[t],e)),{}),c.receiveEntityRecords(e,t,n,void 0,!0)}else c.receiveAutosaves(p.id,u)}else{let r=n;l.__unstablePrePersist&&(r={...r,...l.__unstablePrePersist(p,r)}),u=await s({path:i,method:d?"PUT":"POST",data:r}),c.receiveEntityRecords(e,t,u,void 0,!0,r)}}catch(e){f=!0,p=e}if(c({type:"SAVE_ENTITY_RECORD_FINISH",kind:e,name:t,recordId:d,error:p,isAutosave:r}),f&&i)throw p;return u}finally{c.__unstableReleaseStoreLock(p)}},de=e=>async({dispatch:t})=>{const n=K(),r={saveEntityRecord:(e,r,s,i)=>n.add((n=>t.saveEntityRecord(e,r,s,{...i,__unstableFetch:n}))),saveEditedEntityRecord:(e,r,s,i)=>n.add((n=>t.saveEditedEntityRecord(e,r,s,{...i,__unstableFetch:n}))),deleteEntityRecord:(e,r,s,i,o)=>n.add((n=>t.deleteEntityRecord(e,r,s,i,{...o,__unstableFetch:n})))},s=e.map((e=>e(r))),[,...i]=await Promise.all([n.run(),...s]);return i},pe=(e,t,n,r)=>async({select:s,dispatch:i})=>{if(!s.hasEditsForEntityRecord(e,t,n))return;const o=(await i(Ae(e,t))).find((n=>n.kind===e&&n.name===t));if(!o)return;const a=o.key||Re,c=s.getEntityRecordNonTransientEdits(e,t,n),l={[a]:n,...c};return await i.saveEntityRecord(e,t,l,r)},fe=(e,t,n,r,s)=>async({select:i,dispatch:o})=>{if(!i.hasEditsForEntityRecord(e,t,n))return;const a=i.getEntityRecordNonTransientEdits(e,t,n),c={};for(const e of r)G(c,e,q(a,e));const l=(await o(Ae(e,t))).find((n=>n.kind===e&&n.name===t));return n&&(c[l?.key||Re]=n),await o.saveEntityRecord(e,t,c,s)};function ye(e){return V()("wp.data.dispatch( 'core' ).receiveUploadPermissions",{since:"5.9",alternative:"receiveUserPermission"}),Ee("create/media",e)}function Ee(e,t){return{type:"RECEIVE_USER_PERMISSION",key:e,isAllowed:t}}function me(e){return{type:"RECEIVE_USER_PERMISSIONS",permissions:e}}function ge(e,t){return{type:"RECEIVE_AUTOSAVES",postId:e,autosaves:Array.isArray(t)?t:[t]}}function he(e){return{type:"RECEIVE_NAVIGATION_FALLBACK_ID",fallbackId:e}}function ve(e,t){return{type:"RECEIVE_DEFAULT_TEMPLATE",query:e,templateId:t}}const _e=(e,t,n,r,s,i=!1,o)=>async({dispatch:a})=>{const c=(await a(Ae(e,t))).find((n=>n.kind===e&&n.name===t));a({type:"RECEIVE_ITEM_REVISIONS",key:c&&c?.revisionKey?c.revisionKey:Re,items:Array.isArray(r)?r:[r],recordKey:n,meta:o,query:s,kind:e,name:t,invalidateCache:i})},Re="id",be=["title","excerpt","content"],we=[{label:(0,O.__)("Base"),kind:"root",name:"__unstableBase",baseURL:"/",baseURLParams:{_fields:["description","gmt_offset","home","name","site_icon","site_icon_url","site_logo","timezone_string","url"].join(",")},plural:"__unstableBases",syncConfig:{fetch:async()=>k()({path:"/"}),applyChangesToDoc:(e,t)=>{const n=e.getMap("document");Object.entries(t).forEach((([e,t])=>{n.get(e)!==t&&n.set(e,t)}))},fromCRDTDoc:e=>e.getMap("document").toJSON()},syncObjectType:"root/base",getSyncObjectId:()=>"index"},{label:(0,O.__)("Post Type"),name:"postType",kind:"root",key:"slug",baseURL:"/wp/v2/types",baseURLParams:{context:"edit"},plural:"postTypes",syncConfig:{fetch:async e=>k()({path:`/wp/v2/types/${e}?context=edit`}),applyChangesToDoc:(e,t)=>{const n=e.getMap("document");Object.entries(t).forEach((([e,t])=>{n.get(e)!==t&&n.set(e,t)}))},fromCRDTDoc:e=>e.getMap("document").toJSON()},syncObjectType:"root/postType",getSyncObjectId:e=>e},{name:"media",kind:"root",baseURL:"/wp/v2/media",baseURLParams:{context:"edit"},plural:"mediaItems",label:(0,O.__)("Media"),rawAttributes:["caption","title","description"],supportsPagination:!0},{name:"taxonomy",kind:"root",key:"slug",baseURL:"/wp/v2/taxonomies",baseURLParams:{context:"edit"},plural:"taxonomies",label:(0,O.__)("Taxonomy")},{name:"sidebar",kind:"root",baseURL:"/wp/v2/sidebars",baseURLParams:{context:"edit"},plural:"sidebars",transientEdits:{blocks:!0},label:(0,O.__)("Widget areas")},{name:"widget",kind:"root",baseURL:"/wp/v2/widgets",baseURLParams:{context:"edit"},plural:"widgets",transientEdits:{blocks:!0},label:(0,O.__)("Widgets")},{name:"widgetType",kind:"root",baseURL:"/wp/v2/widget-types",baseURLParams:{context:"edit"},plural:"widgetTypes",label:(0,O.__)("Widget types")},{label:(0,O.__)("User"),name:"user",kind:"root",baseURL:"/wp/v2/users",baseURLParams:{context:"edit"},plural:"users"},{name:"comment",kind:"root",baseURL:"/wp/v2/comments",baseURLParams:{context:"edit"},plural:"comments",label:(0,O.__)("Comment")},{name:"menu",kind:"root",baseURL:"/wp/v2/menus",baseURLParams:{context:"edit"},plural:"menus",label:(0,O.__)("Menu")},{name:"menuItem",kind:"root",baseURL:"/wp/v2/menu-items",baseURLParams:{context:"edit"},plural:"menuItems",label:(0,O.__)("Menu Item"),rawAttributes:["title"]},{name:"menuLocation",kind:"root",baseURL:"/wp/v2/menu-locations",baseURLParams:{context:"edit"},plural:"menuLocations",label:(0,O.__)("Menu Location"),key:"name"},{label:(0,O.__)("Global Styles"),name:"globalStyles",kind:"root",baseURL:"/wp/v2/global-styles",baseURLParams:{context:"edit"},plural:"globalStylesVariations",getTitle:e=>e?.title?.rendered||e?.title,getRevisionsUrl:(e,t)=>`/wp/v2/global-styles/${e}/revisions${t?"/"+t:""}`,supportsPagination:!0},{label:(0,O.__)("Themes"),name:"theme",kind:"root",baseURL:"/wp/v2/themes",baseURLParams:{context:"edit"},plural:"themes",key:"stylesheet"},{label:(0,O.__)("Plugins"),name:"plugin",kind:"root",baseURL:"/wp/v2/plugins",baseURLParams:{context:"edit"},plural:"plugins",key:"plugin"},{label:(0,O.__)("Status"),name:"status",kind:"root",baseURL:"/wp/v2/statuses",baseURLParams:{context:"edit"},plural:"statuses",key:"slug"}],Se=[{kind:"postType",loadEntities:async function(){const e=await k()({path:"/wp/v2/types?context=view"});return Object.entries(null!=e?e:{}).map((([e,t])=>{var n;const r=["wp_template","wp_template_part"].includes(e),s=null!==(n=t?.rest_namespace)&&void 0!==n?n:"wp/v2";return{kind:"postType",baseURL:`/${s}/${t.rest_base}`,baseURLParams:{context:"edit"},name:e,label:t.name,transientEdits:{blocks:!0,selection:!0},mergedEdits:{meta:!0},rawAttributes:be,getTitle:e=>{var t,n,s;return e?.title?.rendered||e?.title||(r?(n=null!==(t=e.slug)&&void 0!==t?t:"",void 0===s&&(s={}),R(n,g({delimiter:" ",transform:w},s))):String(e.id))},__unstablePrePersist:r?void 0:Te,__unstable_rest_base:t.rest_base,syncConfig:{fetch:async e=>k()({path:`/${s}/${t.rest_base}/${e}?context=edit`}),applyChangesToDoc:(e,t)=>{const n=e.getMap("document");Object.entries(t).forEach((([e,t])=>{"function"!=typeof t&&("blocks"===e&&(Ie.has(t)||Ie.set(t,Oe(t)),t=Ie.get(t)),n.get(e)!==t&&n.set(e,t))}))},fromCRDTDoc:e=>e.getMap("document").toJSON()},syncObjectType:"postType/"+t.name,getSyncObjectId:e=>e,supportsPagination:!0,getRevisionsUrl:(e,n)=>`/${s}/${t.rest_base}/${e}/revisions${n?"/"+n:""}`,revisionKey:r?"wp_id":Re}}))}},{kind:"taxonomy",loadEntities:async function(){const e=await k()({path:"/wp/v2/taxonomies?context=view"});return Object.entries(null!=e?e:{}).map((([e,t])=>{var n;return{kind:"taxonomy",baseURL:`/${null!==(n=t?.rest_namespace)&&void 0!==n?n:"wp/v2"}/${t.rest_base}`,baseURLParams:{context:"edit"},name:e,label:t.name}}))}},{kind:"root",name:"site",plural:"sites",loadEntities:async function(){var e;const t={label:(0,O.__)("Site"),name:"site",kind:"root",baseURL:"/wp/v2/settings",syncConfig:{fetch:async()=>k()({path:"/wp/v2/settings"}),applyChangesToDoc:(e,t)=>{const n=e.getMap("document");Object.entries(t).forEach((([e,t])=>{n.get(e)!==t&&n.set(e,t)}))},fromCRDTDoc:e=>e.getMap("document").toJSON()},syncObjectType:"root/site",getSyncObjectId:()=>"index",meta:{}},n=await k()({path:t.baseURL,method:"OPTIONS"}),r={};return Object.entries(null!==(e=n?.schema?.properties)&&void 0!==e?e:{}).forEach((([e,t])=>{"object"==typeof t&&t.title&&(r[e]=t.title)})),[{...t,meta:{labels:r}}]}}],Te=(e,t)=>{const n={};return"auto-draft"===e?.status&&(t.status||n.status||(n.status="draft"),t.title&&"Auto Draft"!==t.title||n.title||e?.title&&"Auto Draft"!==e?.title||(n.title="")),n},Ie=new WeakMap;function ke(e){const t={...e};for(const[n,r]of Object.entries(e))r instanceof C.RichTextData&&(t[n]=r.valueOf());return t}function Oe(e){return e.map((e=>{const{innerBlocks:t,attributes:n,...r}=e;return{...r,attributes:ke(n),innerBlocks:Oe(t)}}))}const Ce=(e,t,n="get")=>`${n}${"root"===e?"":T(e)}${T(t)}`;const Ae=(e,t)=>async({select:n,dispatch:r})=>{let s=n.getEntitiesConfig(e);const i=!!n.getEntityConfig(e,t);if(s?.length>0&&i)return window.__experimentalEnableSync,s;const o=Se.find((n=>t&&n.name?n.kind===e&&n.name===t:n.kind===e));return o?(s=await o.loadEntities(),window.__experimentalEnableSync,r(W(s)),s):[]};const Pe=function(e){return"string"==typeof e?e.split(","):Array.isArray(e)?e:null};const Ue=function(e){const t=new WeakMap;return n=>{let r;return t.has(n)?r=t.get(n):(r=e(n),null!==n&&"object"==typeof n&&t.set(n,r)),r}};const xe=Ue((function(e){const t={stableKey:"",page:1,perPage:10,fields:null,include:null,context:"default"},n=Object.keys(e).sort();for(let i=0;i=i&&n!t.some((t=>Number.isInteger(t)?t===+e:t===e)))))}const De=(0,p.compose)([y((e=>"query"in e)),E((e=>e.query?{...e,...xe(e.query)}:e)),m("context"),m("stableKey")])(((e={},t)=>{const{type:n,page:r,perPage:s,key:i=Re}=t;return"RECEIVE_ITEMS"!==n?e:{itemIds:je(e?.itemIds||[],t.items.map((e=>e?.[i])).filter(Boolean),r,s),meta:t.meta}})),Ne=(0,l.combineReducers)({items:function(e={},t){switch(t.type){case"RECEIVE_ITEMS":{const n=Le(t),r=t.key||Re;return{...e,[n]:{...e[n],...t.items.reduce(((t,s)=>{const i=s?.[r];return t[i]=function(e,t){if(!e)return t;let n=!1;const r={};for(const s in t)d()(e[s],t[s])?r[s]=e[s]:(n=!0,r[s]=t[s]);if(!n)return e;for(const t in e)r.hasOwnProperty(t)||(r[t]=e[t]);return r}(e?.[n]?.[i],s),t}),{})}}}case"REMOVE_ITEMS":return Object.fromEntries(Object.entries(e).map((([e,n])=>[e,Me(n,t.itemIds)])))}return e},itemIsComplete:function(e={},t){switch(t.type){case"RECEIVE_ITEMS":{const n=Le(t),{query:r,key:s=Re}=t,i=r?xe(r):{},o=!r||!Array.isArray(i.fields);return{...e,[n]:{...e[n],...t.items.reduce(((t,r)=>{const i=r?.[s];return t[i]=e?.[n]?.[i]||o,t}),{})}}}case"REMOVE_ITEMS":return Object.fromEntries(Object.entries(e).map((([e,n])=>[e,Me(n,t.itemIds)])))}return e},queries:(e={},t)=>{switch(t.type){case"RECEIVE_ITEMS":return De(e,t);case"REMOVE_ITEMS":const n=t.itemIds.reduce(((e,t)=>(e[t]=!0,e)),{});return Object.fromEntries(Object.entries(e).map((([e,t])=>[e,Object.fromEntries(Object.entries(t).map((([e,t])=>[e,{...t,itemIds:t.itemIds.filter((e=>!n[e]))}])))])));default:return e}}});const Ve=e=>(t,n)=>{if("UNDO"===n.type||"REDO"===n.type){const{record:r}=n;let s=t;return r.forEach((({id:{kind:t,name:r,recordId:i},changes:o})=>{s=e(s,{type:"EDIT_ENTITY_RECORD",kind:t,name:r,recordId:i,edits:Object.entries(o).reduce(((e,[t,r])=>(e[t]="UNDO"===n.type?r.from:r.to,e)),{})})})),s}return e(t,n)};function Ge(e){return(0,p.compose)([Ve,y((t=>t.name&&t.kind&&t.name===e.name&&t.kind===e.kind)),E((t=>({key:e.key||Re,...t})))])((0,l.combineReducers)({queriedData:Ne,edits:(e={},t)=>{var n;switch(t.type){case"RECEIVE_ITEMS":if("default"!==(null!==(n=t?.query?.context)&&void 0!==n?n:"default"))return e;const r={...e};for(const e of t.items){const n=e?.[t.key],s=r[n];if(!s)continue;const i=Object.keys(s).reduce(((n,r)=>{var i;return d()(s[r],null!==(i=e[r]?.raw)&&void 0!==i?i:e[r])||t.persistedEdits&&d()(s[r],t.persistedEdits[r])||(n[r]=s[r]),n}),{});Object.keys(i).length?r[n]=i:delete r[n]}return r;case"EDIT_ENTITY_RECORD":const s={...e[t.recordId],...t.edits};return Object.keys(s).forEach((e=>{void 0===s[e]&&delete s[e]})),{...e,[t.recordId]:s}}return e},saving:(e={},t)=>{switch(t.type){case"SAVE_ENTITY_RECORD_START":case"SAVE_ENTITY_RECORD_FINISH":return{...e,[t.recordId]:{pending:"SAVE_ENTITY_RECORD_START"===t.type,error:t.error,isAutosave:t.isAutosave}}}return e},deleting:(e={},t)=>{switch(t.type){case"DELETE_ENTITY_RECORD_START":case"DELETE_ENTITY_RECORD_FINISH":return{...e,[t.recordId]:{pending:"DELETE_ENTITY_RECORD_START"===t.type,error:t.error}}}return e},revisions:(e={},t)=>{if("RECEIVE_ITEM_REVISIONS"===t.type){const n=t.recordKey;delete t.recordKey;const r=Ne(e[n],{...t,type:"RECEIVE_ITEMS"});return{...e,[n]:r}}return"REMOVE_ITEMS"===t.type?Object.fromEntries(Object.entries(e).filter((([e])=>!t.itemIds.some((t=>Number.isInteger(t)?t===+e:t===e))))):e}}))}const qe=(0,l.combineReducers)({terms:function(e={},t){return"RECEIVE_TERMS"===t.type?{...e,[t.taxonomy]:t.terms}:e},users:function(e={byId:{},queries:{}},t){return"RECEIVE_USER_QUERY"===t.type?{byId:{...e.byId,...t.users.reduce(((e,t)=>({...e,[t.id]:t})),{})},queries:{...e.queries,[t.queryID]:t.users.map((e=>e.id))}}:e},currentTheme:function(e=void 0,t){return"RECEIVE_CURRENT_THEME"===t.type?t.currentTheme.stylesheet:e},currentGlobalStylesId:function(e=void 0,t){return"RECEIVE_CURRENT_GLOBAL_STYLES_ID"===t.type?t.id:e},currentUser:function(e={},t){return"RECEIVE_CURRENT_USER"===t.type?t.currentUser:e},themeGlobalStyleVariations:function(e={},t){return"RECEIVE_THEME_GLOBAL_STYLE_VARIATIONS"===t.type?{...e,[t.stylesheet]:t.variations}:e},themeBaseGlobalStyles:function(e={},t){return"RECEIVE_THEME_GLOBAL_STYLES"===t.type?{...e,[t.stylesheet]:t.globalStyles}:e},themeGlobalStyleRevisions:function(e={},t){return"RECEIVE_THEME_GLOBAL_STYLE_REVISIONS"===t.type?{...e,[t.currentId]:t.revisions}:e},taxonomies:function(e=[],t){return"RECEIVE_TAXONOMIES"===t.type?t.taxonomies:e},entities:(e={},t)=>{const n=function(e=we,t){return"ADD_ENTITIES"===t.type?[...e,...t.entities]:e}(e.config,t);let r=e.reducer;if(!r||n!==e.config){const e=n.reduce(((e,t)=>{const{kind:n}=t;return e[n]||(e[n]=[]),e[n].push(t),e}),{});r=(0,l.combineReducers)(Object.entries(e).reduce(((e,[t,n])=>{const r=(0,l.combineReducers)(n.reduce(((e,t)=>({...e,[t.name]:Ge(t)})),{}));return e[t]=r,e}),{}))}const s=r(e.records,t);return s===e.records&&n===e.config&&r===e.reducer?e:{reducer:r,records:s,config:n}},editsReference:function(e={},t){switch(t.type){case"EDIT_ENTITY_RECORD":case"UNDO":case"REDO":return{}}return e},undoManager:function(e=(0,f.createUndoManager)()){return e},embedPreviews:function(e={},t){if("RECEIVE_EMBED_PREVIEW"===t.type){const{url:n,preview:r}=t;return{...e,[n]:r}}return e},userPermissions:function(e={},t){switch(t.type){case"RECEIVE_USER_PERMISSION":return{...e,[t.key]:t.isAllowed};case"RECEIVE_USER_PERMISSIONS":return{...e,...t.permissions}}return e},autosaves:function(e={},t){if("RECEIVE_AUTOSAVES"===t.type){const{postId:n,autosaves:r}=t;return{...e,[n]:r}}return e},blockPatterns:function(e=[],t){return"RECEIVE_BLOCK_PATTERNS"===t.type?t.patterns:e},blockPatternCategories:function(e=[],t){return"RECEIVE_BLOCK_PATTERN_CATEGORIES"===t.type?t.categories:e},userPatternCategories:function(e=[],t){return"RECEIVE_USER_PATTERN_CATEGORIES"===t.type?t.patternCategories:e},navigationFallbackId:function(e=null,t){return"RECEIVE_NAVIGATION_FALLBACK_ID"===t.type?t.fallbackId:e},defaultTemplates:function(e={},t){return"RECEIVE_DEFAULT_TEMPLATE"===t.type?{...e,[JSON.stringify(t.query)]:t.templateId}:e},registeredPostMeta:function(e={},t){return"RECEIVE_REGISTERED_POST_META"===t.type?{...e,[t.postType]:t.registeredPostMeta}:e}});var Be=n(3249),$e=n.n(Be);const Fe=new WeakMap;const Ke=(0,l.createSelector)(((e,t={})=>{let n=Fe.get(e);if(n){const e=n.get(t);if(void 0!==e)return e}else n=new($e()),Fe.set(e,n);const r=function(e,t){const{stableKey:n,page:r,perPage:s,include:i,fields:o,context:a}=xe(t);let c;if(e.queries?.[a]?.[n]&&(c=e.queries[a][n].itemIds),!c)return null;const l=-1===s?0:(r-1)*s,u=-1===s?c.length:Math.min(l+s,c.length),d=[];for(let t=l;t{n=n?.[e]})),G(s,t,n)}}else{if(!e.itemIsComplete[a]?.[n])return null;s=r}d.push(s)}return d}(e,t);return n.set(t,r),r}));function Qe(e,t={}){var n;const{stableKey:r,context:s}=xe(t);return null!==(n=e.queries?.[s]?.[r]?.meta?.totalItems)&&void 0!==n?n:null}const Ye=["create","read","update","delete"];function He(e){const t={};if(!e)return t;const n={create:"POST",read:"GET",update:"PUT",delete:"DELETE"};for(const[r,s]of Object.entries(n))t[r]=e.includes(s);return t}function ze(e,t,n){return("object"==typeof t?[e,t.kind,t.name,t.id]:[e,t,n]).filter(Boolean).join("/")}const We={},Je=(0,l.createRegistrySelector)((e=>(t,n)=>e(Y).isResolving("getEmbedPreview",[n])));function Xe(e,t){V()("select( 'core' ).getAuthors()",{since:"5.9",alternative:"select( 'core' ).getUsers({ who: 'authors' })"});const n=(0,D.addQueryArgs)("/wp/v2/users/?who=authors&per_page=100",t);return et(e,n)}function Ze(e){return e.currentUser}const et=(0,l.createSelector)(((e,t)=>{var n;return(null!==(n=e.users.queries[t])&&void 0!==n?n:[]).map((t=>e.users.byId[t]))}),((e,t)=>[e.users.queries[t],e.users.byId]));function tt(e,t){return V()("wp.data.select( 'core' ).getEntitiesByKind()",{since:"6.0",alternative:"wp.data.select( 'core' ).getEntitiesConfig()"}),nt(e,t)}const nt=(0,l.createSelector)(((e,t)=>e.entities.config.filter((e=>e.kind===t))),((e,t)=>e.entities.config));function rt(e,t,n){return V()("wp.data.select( 'core' ).getEntity()",{since:"6.0",alternative:"wp.data.select( 'core' ).getEntityConfig()"}),st(e,t,n)}function st(e,t,n){return e.entities.config?.find((e=>e.kind===t&&e.name===n))}const it=(0,l.createSelector)(((e,t,n,r,s)=>{var i;const o=e.entities.records?.[t]?.[n]?.queriedData;if(!o)return;const a=null!==(i=s?.context)&&void 0!==i?i:"default";if(void 0===s){if(!o.itemIsComplete[a]?.[r])return;return o.items[a][r]}const c=o.items[a]?.[r];if(c&&s._fields){var l;const e={},t=null!==(l=Pe(s._fields))&&void 0!==l?l:[];for(let n=0;n{s=s?.[e]})),G(e,r,s)}return e}return c}),((e,t,n,r,s)=>{var i;const o=null!==(i=s?.context)&&void 0!==i?i:"default";return[e.entities.records?.[t]?.[n]?.queriedData?.items[o]?.[r],e.entities.records?.[t]?.[n]?.queriedData?.itemIsComplete[o]?.[r]]}));function ot(e,t,n,r){return it(e,t,n,r)}it.__unstableNormalizeArgs=e=>{const t=[...e],n=t?.[2];return t[2]=/^\s*\d+\s*$/.test(n)?Number(n):n,t};const at=(0,l.createSelector)(((e,t,n,r)=>{const s=it(e,t,n,r);return s&&Object.keys(s).reduce(((r,i)=>{var o;(function(e,t){return(e.rawAttributes||[]).includes(t)})(st(e,t,n),i)?r[i]=null!==(o=s[i]?.raw)&&void 0!==o?o:s[i]:r[i]=s[i];return r}),{})}),((e,t,n,r,s)=>{var i;const o=null!==(i=s?.context)&&void 0!==i?i:"default";return[e.entities.config,e.entities.records?.[t]?.[n]?.queriedData?.items[o]?.[r],e.entities.records?.[t]?.[n]?.queriedData?.itemIsComplete[o]?.[r]]}));function ct(e,t,n,r){return Array.isArray(lt(e,t,n,r))}const lt=(e,t,n,r)=>{const s=e.entities.records?.[t]?.[n]?.queriedData;return s?Ke(s,r):null},ut=(e,t,n,r)=>{const s=e.entities.records?.[t]?.[n]?.queriedData;return s?Qe(s,r):null},dt=(e,t,n,r)=>{const s=e.entities.records?.[t]?.[n]?.queriedData;if(!s)return null;if(-1===r.per_page)return 1;const i=Qe(s,r);return i?r.per_page?Math.ceil(i/r.per_page):function(e,t={}){var n;const{stableKey:r,context:s}=xe(t);return null!==(n=e.queries?.[s]?.[r]?.meta?.totalPages)&&void 0!==n?n:null}(s,r):i},pt=(0,l.createSelector)((e=>{const{entities:{records:t}}=e,n=[];return Object.keys(t).forEach((r=>{Object.keys(t[r]).forEach((s=>{const i=Object.keys(t[r][s].edits).filter((t=>it(e,r,s,t)&&mt(e,r,s,t)));if(i.length){const t=st(e,r,s);i.forEach((i=>{const o=gt(e,r,s,i);n.push({key:o?o[t.key||Re]:void 0,title:t?.getTitle?.(o)||"",name:s,kind:r})}))}}))})),n}),(e=>[e.entities.records])),ft=(0,l.createSelector)((e=>{const{entities:{records:t}}=e,n=[];return Object.keys(t).forEach((r=>{Object.keys(t[r]).forEach((s=>{const i=Object.keys(t[r][s].saving).filter((t=>vt(e,r,s,t)));if(i.length){const t=st(e,r,s);i.forEach((i=>{const o=gt(e,r,s,i);n.push({key:o?o[t.key||Re]:void 0,title:t?.getTitle?.(o)||"",name:s,kind:r})}))}}))})),n}),(e=>[e.entities.records]));function yt(e,t,n,r){return e.entities.records?.[t]?.[n]?.edits?.[r]}const Et=(0,l.createSelector)(((e,t,n,r)=>{const{transientEdits:s}=st(e,t,n)||{},i=yt(e,t,n,r)||{};return s?Object.keys(i).reduce(((e,t)=>(s[t]||(e[t]=i[t]),e)),{}):i}),((e,t,n,r)=>[e.entities.config,e.entities.records?.[t]?.[n]?.edits?.[r]]));function mt(e,t,n,r){return vt(e,t,n,r)||Object.keys(Et(e,t,n,r)).length>0}const gt=(0,l.createSelector)(((e,t,n,r)=>{const s=at(e,t,n,r),i=yt(e,t,n,r);return!(!s&&!i)&&{...s,...i}}),((e,t,n,r,s)=>{var i;const o=null!==(i=s?.context)&&void 0!==i?i:"default";return[e.entities.config,e.entities.records?.[t]?.[n]?.queriedData.items[o]?.[r],e.entities.records?.[t]?.[n]?.queriedData.itemIsComplete[o]?.[r],e.entities.records?.[t]?.[n]?.edits?.[r]]}));function ht(e,t,n,r){var s;const{pending:i,isAutosave:o}=null!==(s=e.entities.records?.[t]?.[n]?.saving?.[r])&&void 0!==s?s:{};return Boolean(i&&o)}function vt(e,t,n,r){var s;return null!==(s=e.entities.records?.[t]?.[n]?.saving?.[r]?.pending)&&void 0!==s&&s}function _t(e,t,n,r){var s;return null!==(s=e.entities.records?.[t]?.[n]?.deleting?.[r]?.pending)&&void 0!==s&&s}function Rt(e,t,n,r){return e.entities.records?.[t]?.[n]?.saving?.[r]?.error}function bt(e,t,n,r){return e.entities.records?.[t]?.[n]?.deleting?.[r]?.error}function wt(e){V()("select( 'core' ).getUndoEdit()",{since:"6.3"})}function St(e){V()("select( 'core' ).getRedoEdit()",{since:"6.3"})}function Tt(e){return e.undoManager.hasUndo()}function It(e){return e.undoManager.hasRedo()}function kt(e){return e.currentTheme?it(e,"root","theme",e.currentTheme):null}function Ot(e){return e.currentGlobalStylesId}function Ct(e){var t;return null!==(t=kt(e)?.theme_supports)&&void 0!==t?t:We}function At(e,t){return e.embedPreviews[t]}function Pt(e,t){const n=e.embedPreviews[t],r=''+t+"";return!!n&&n.html===r}function Ut(e,t,n,r){if("object"==typeof n&&(!n.kind||!n.name))return!1;const s=ze(t,n,r);return e.userPermissions[s]}function xt(e,t,n,r){return V()("wp.data.select( 'core' ).canUserEditEntityRecord()",{since:"6.7",alternative:"wp.data.select( 'core' ).canUser( 'update', { kind, name, id } )"}),Ut(e,"update",{kind:t,name:n,id:r})}function Lt(e,t,n){return e.autosaves[n]}function jt(e,t,n,r){if(void 0===r)return;const s=e.autosaves[n];return s?.find((e=>e.author===r))}const Mt=(0,l.createRegistrySelector)((e=>(t,n,r)=>e(Y).hasFinishedResolution("getAutosaves",[n,r])));function Dt(e){return e.editsReference}function Nt(e,t){const n=lt(e,"postType","wp_template",{"find-template":t});return n?.length?gt(e,"postType","wp_template",n[0].id):null}function Vt(e){const t=kt(e);return t?e.themeBaseGlobalStyles[t.stylesheet]:null}function Gt(e){const t=kt(e);return t?e.themeGlobalStyleVariations[t.stylesheet]:null}function qt(e){return e.blockPatterns}function Bt(e){return e.blockPatternCategories}function $t(e){return e.userPatternCategories}function Ft(e){V()("select( 'core' ).getCurrentThemeGlobalStylesRevisions()",{since:"6.5.0",alternative:"select( 'core' ).getRevisions( 'root', 'globalStyles', ${ recordKey } )"});const t=Ot(e);return t?e.themeGlobalStyleRevisions[t]:null}function Kt(e,t){return e.defaultTemplates[JSON.stringify(t)]}const Qt=(e,t,n,r,s)=>{const i=e.entities.records?.[t]?.[n]?.revisions?.[r];return i?Ke(i,s):null},Yt=(0,l.createSelector)(((e,t,n,r,s,i)=>{var o;const a=e.entities.records?.[t]?.[n]?.revisions?.[r];if(!a)return;const c=null!==(o=i?.context)&&void 0!==o?o:"default";if(void 0===i){if(!a.itemIsComplete[c]?.[s])return;return a.items[c][s]}const l=a.items[c]?.[s];if(l&&i._fields){var u;const e={},t=null!==(u=Pe(i._fields))&&void 0!==u?u:[];for(let n=0;n{s=s?.[e]})),G(e,r,s)}return e}return l}),((e,t,n,r,s,i)=>{var o;const a=null!==(o=i?.context)&&void 0!==o?o:"default";return[e.entities.records?.[t]?.[n]?.revisions?.[r]?.items?.[a]?.[s],e.entities.records?.[t]?.[n]?.revisions?.[r]?.itemIsComplete?.[a]?.[s]]}));function Ht(e){return e.undoManager}function zt(e){return e.navigationFallbackId}const Wt=(0,l.createRegistrySelector)((e=>(0,l.createSelector)(((t,n)=>e(Y).getBlockPatterns().filter((({postTypes:e})=>!e||Array.isArray(e)&&e.includes(n)))),(()=>[e(Y).getBlockPatterns()])))),Jt=(0,l.createRegistrySelector)((e=>(0,l.createSelector)(((t,n,r,s)=>(Array.isArray(s)?s:[s]).map((t=>({delete:e(Y).canUser("delete",{kind:n,name:r,id:t}),update:e(Y).canUser("update",{kind:n,name:r,id:t})})))),(e=>[e.userPermissions]))));function Xt(e,t,n,r){return Jt(e,t,n,r)[0]}function Zt(e,t){var n;return null!==(n=e.registeredPostMeta?.[t])&&void 0!==n?n:{}}function en(e,t){return{type:"RECEIVE_REGISTERED_POST_META",postType:e,registeredPostMeta:t}}function tn(e,t){return 0===t?e.toLowerCase():S(e,t)}function nn(e,t){return void 0===t&&(t={}),T(e,g({transform:tn},t))}const rn=window.wp.htmlEntities,sn=e=>(...t)=>async({resolveSelect:n})=>{await n[e](...t)};async function on(e,t={},n={}){const r=t.isInitialSuggestions&&t.initialSuggestionsSearchOptions?{...t,...t.initialSuggestionsSearchOptions}:t,{type:s,subtype:i,page:o,perPage:a=(t.isInitialSuggestions?3:20)}=r,{disablePostFormats:c=!1}=n,l=[];s&&"post"!==s||l.push(k()({path:(0,D.addQueryArgs)("/wp/v2/search",{search:e,page:o,per_page:a,type:"post",subtype:i})}).then((e=>e.map((e=>({id:e.id,url:e.url,title:(0,rn.decodeEntities)(e.title||"")||(0,O.__)("(no title)"),type:e.subtype||e.type,kind:"post-type"}))))).catch((()=>[]))),s&&"term"!==s||l.push(k()({path:(0,D.addQueryArgs)("/wp/v2/search",{search:e,page:o,per_page:a,type:"term",subtype:i})}).then((e=>e.map((e=>({id:e.id,url:e.url,title:(0,rn.decodeEntities)(e.title||"")||(0,O.__)("(no title)"),type:e.subtype||e.type,kind:"taxonomy"}))))).catch((()=>[]))),c||s&&"post-format"!==s||l.push(k()({path:(0,D.addQueryArgs)("/wp/v2/search",{search:e,page:o,per_page:a,type:"post-format",subtype:i})}).then((e=>e.map((e=>({id:e.id,url:e.url,title:(0,rn.decodeEntities)(e.title||"")||(0,O.__)("(no title)"),type:e.subtype||e.type,kind:"taxonomy"}))))).catch((()=>[]))),s&&"attachment"!==s||l.push(k()({path:(0,D.addQueryArgs)("/wp/v2/media",{search:e,page:o,per_page:a})}).then((e=>e.map((e=>({id:e.id,url:e.source_url,title:(0,rn.decodeEntities)(e.title.rendered||"")||(0,O.__)("(no title)"),type:e.type,kind:"media"}))))).catch((()=>[])));let u=(await Promise.all(l)).flat();return u=u.filter((e=>!!e.id)),u=function(e,t){const n=an(t),r={};for(const t of e)if(t.title){const e=an(t.title),s=e.filter((e=>n.some((t=>e.includes(t)))));r[t.id]=s.length/e.length}else r[t.id]=0;return e.sort(((e,t)=>r[t.id]-r[e.id]))}(u,e),u=u.slice(0,a),u}function an(e){return e.toLowerCase().match(/[\p{L}\p{N}]+/gu)||[]}const cn=new Map,ln=async(e,t={})=>{const n={url:(0,D.prependHTTP)(e)};if(!(0,D.isURL)(e))return Promise.reject(`${e} is not a valid URL.`);const r=(0,D.getProtocol)(e);return r&&(0,D.isValidProtocol)(r)&&r.startsWith("http")&&/^https?:\/\/[^\/\s]/i.test(e)?cn.has(e)?cn.get(e):k()({path:(0,D.addQueryArgs)("/wp-block-editor/v1/url-details",n),...t}).then((t=>(cn.set(e,t),t))):Promise.reject(`${e} does not have a valid protocol. URLs must be "http" based`)};async function un(){const e=await k()({path:"/wp/v2/block-patterns/patterns"});return e?e.map((e=>Object.fromEntries(Object.entries(e).map((([e,t])=>[nn(e),t]))))):[]}const dn=e=>async({dispatch:t})=>{const n=(0,D.addQueryArgs)("/wp/v2/users/?who=authors&per_page=100",e),r=await k()({path:n});t.receiveUserQuery(n,r)},pn=()=>async({dispatch:e})=>{const t=await k()({path:"/wp/v2/users/me"});e.receiveCurrentUser(t)},fn=(e,t,n="",r)=>async({select:s,dispatch:i,registry:o})=>{const a=(await i(Ae(e,t))).find((n=>n.name===t&&n.kind===e));if(!a)return;const c=await i.__unstableAcquireStoreLock(Y,["entities","records",e,t,n],{exclusive:!1});try{if(window.__experimentalEnableSync&&a.syncConfig&&!r)0;else{void 0!==r&&r._fields&&(r={...r,_fields:[...new Set([...Pe(r._fields)||[],a.key||Re])].join()});const c=(0,D.addQueryArgs)(a.baseURL+(n?"/"+n:""),{...a.baseURLParams,...r});if(void 0!==r&&r._fields){r={...r,include:[n]};if(s.hasEntityRecords(e,t,r))return}const l=await k()({path:c,parse:!1}),u=await l.json(),d=He(l.headers?.get("allow")),p=[],f={};for(const r of Ye)f[ze(r,{kind:e,name:t,id:n})]=d[r],p.push([r,{kind:e,name:t,id:n}]);o.batch((()=>{i.receiveEntityRecords(e,t,u,r),i.receiveUserPermissions(f),i.finishResolutions("canUser",p)}))}}finally{i.__unstableReleaseStoreLock(c)}},yn=sn("getEntityRecord"),En=sn("getEntityRecord"),mn=(e,t,n={})=>async({dispatch:r,registry:s})=>{const i=(await r(Ae(e,t))).find((n=>n.name===t&&n.kind===e));if(!i)return;const o=await r.__unstableAcquireStoreLock(Y,["entities","records",e,t],{exclusive:!1});try{n._fields&&(n={...n,_fields:[...new Set([...Pe(n._fields)||[],i.key||Re])].join()});const a=(0,D.addQueryArgs)(i.baseURL,{...i.baseURLParams,...n});let c,l;if(i.supportsPagination&&-1!==n.per_page){const e=await k()({path:a,parse:!1});c=Object.values(await e.json()),l={totalItems:parseInt(e.headers.get("X-WP-Total")),totalPages:parseInt(e.headers.get("X-WP-TotalPages"))}}else c=Object.values(await k()({path:a})),l={totalItems:c.length,totalPages:1};n._fields&&(c=c.map((e=>(n._fields.split(",").forEach((t=>{e.hasOwnProperty(t)||(e[t]=void 0)})),e)))),s.batch((()=>{if(r.receiveEntityRecords(e,t,c,n,!1,void 0,l),!n?._fields&&!n.context){const n=i.key||Re,s=c.filter((e=>e?.[n])).map((r=>[e,t,r[n]])),o=c.filter((e=>e?.[n])).map((e=>({id:e[n],permissions:He(e?._links?.self?.[0].targetHints.allow)}))),a=[],l={};for(const n of o)for(const r of Ye)a.push([r,{kind:e,name:t,id:n.id}]),l[ze(r,{kind:e,name:t,id:n.id})]=n.permissions[r];r.receiveUserPermissions(l),r.finishResolutions("getEntityRecord",s),r.finishResolutions("canUser",a)}r.__unstableReleaseStoreLock(o)}))}catch(e){r.__unstableReleaseStoreLock(o)}};mn.shouldInvalidate=(e,t,n)=>("RECEIVE_ITEMS"===e.type||"REMOVE_ITEMS"===e.type)&&e.invalidateCache&&t===e.kind&&n===e.name;const gn=()=>async({dispatch:e,resolveSelect:t})=>{const n=await t.getEntityRecords("root","theme",{status:"active"});e.receiveCurrentTheme(n[0])},hn=sn("getCurrentTheme"),vn=e=>async({dispatch:t})=>{try{const n=await k()({path:(0,D.addQueryArgs)("/oembed/1.0/proxy",{url:e})});t.receiveEmbedPreview(e,n)}catch(n){t.receiveEmbedPreview(e,!1)}},_n=(e,t,n)=>async({dispatch:r,registry:s})=>{if(!Ye.includes(e))throw new Error(`'${e}' is not a valid action.`);let i=null;if("object"==typeof t){if(!t.kind||!t.name)throw new Error("The entity resource object is not valid.");const e=(await r(Ae(t.kind,t.name))).find((e=>e.name===t.name&&e.kind===t.kind));if(!e)return;i=e.baseURL+(t.id?"/"+t.id:"")}else i=`/wp/v2/${t}`+(n?"/"+n:"");const{hasStartedResolution:o}=s.select(Y);for(const r of Ye){if(r===e)continue;if(o("canUser",[r,t,n]))return}let a;try{a=await k()({path:i,method:"OPTIONS",parse:!1})}catch(e){return}const c=He(a.headers?.get("allow"));s.batch((()=>{for(const s of Ye){const i=ze(s,t,n);r.receiveUserPermission(i,c[s]),s!==e&&r.finishResolution("canUser",[s,t,n])}}))},Rn=(e,t,n)=>async({dispatch:r})=>{await r(_n("update",{kind:e,name:t,id:n}))},bn=(e,t)=>async({dispatch:n,resolveSelect:r})=>{const{rest_base:s,rest_namespace:i="wp/v2"}=await r.getPostType(e),o=await k()({path:`/${i}/${s}/${t}/autosaves?context=edit`});o&&o.length&&n.receiveAutosaves(t,o)},wn=(e,t)=>async({resolveSelect:n})=>{await n.getAutosaves(e,t)},Sn=e=>async({dispatch:t,resolveSelect:n})=>{let r;try{r=await k()({url:(0,D.addQueryArgs)(e,{"_wp-find-template":!0})}).then((({data:e})=>e))}catch(e){}if(!r)return;const s=await n.getEntityRecord("postType","wp_template",r.id);s&&t.receiveEntityRecords("postType","wp_template",[s],{"find-template":e})};Sn.shouldInvalidate=e=>("RECEIVE_ITEMS"===e.type||"REMOVE_ITEMS"===e.type)&&e.invalidateCache&&"postType"===e.kind&&"wp_template"===e.name;const Tn=()=>async({dispatch:e,resolveSelect:t})=>{const n=await t.getEntityRecords("root","theme",{status:"active"}),r=n?.[0]?._links?.["wp:user-global-styles"]?.[0]?.href;if(!r)return;const s=r.match(/\/(\d+)(?:\?|$)/),i=s?Number(s[1]):null;i&&e.__experimentalReceiveCurrentGlobalStylesId(i)},In=()=>async({resolveSelect:e,dispatch:t})=>{const n=await e.getCurrentTheme(),r=await k()({path:`/wp/v2/global-styles/themes/${n.stylesheet}?context=view`});t.__experimentalReceiveThemeBaseGlobalStyles(n.stylesheet,r)},kn=()=>async({resolveSelect:e,dispatch:t})=>{const n=await e.getCurrentTheme(),r=await k()({path:`/wp/v2/global-styles/themes/${n.stylesheet}/variations?context=view`});t.__experimentalReceiveThemeGlobalStyleVariations(n.stylesheet,r)},On=()=>async({resolveSelect:e,dispatch:t})=>{const n=await e.__experimentalGetCurrentGlobalStylesId(),r=n?await e.getEntityRecord("root","globalStyles",n):void 0,s=r?._links?.["version-history"]?.[0]?.href;if(s){const e=await k()({url:s}),r=e?.map((e=>Object.fromEntries(Object.entries(e).map((([e,t])=>[nn(e),t])))));t.receiveThemeGlobalStyleRevisions(n,r)}};On.shouldInvalidate=e=>"SAVE_ENTITY_RECORD_FINISH"===e.type&&"root"===e.kind&&!e.error&&"globalStyles"===e.name;const Cn=()=>async({dispatch:e})=>{e({type:"RECEIVE_BLOCK_PATTERNS",patterns:await un()})},An=()=>async({dispatch:e})=>{e({type:"RECEIVE_BLOCK_PATTERN_CATEGORIES",categories:await k()({path:"/wp/v2/block-patterns/categories"})})},Pn=()=>async({dispatch:e,resolveSelect:t})=>{const n=await t.getEntityRecords("taxonomy","wp_pattern_category",{per_page:-1,_fields:"id,name,description,slug",context:"view"});e({type:"RECEIVE_USER_PATTERN_CATEGORIES",patternCategories:n?.map((e=>({...e,label:(0,rn.decodeEntities)(e.name),name:e.slug})))||[]})},Un=()=>async({dispatch:e,select:t,registry:n})=>{const r=await k()({path:(0,D.addQueryArgs)("/wp-block-editor/v1/navigation-fallback",{_embed:!0})}),s=r?._embedded?.self;n.batch((()=>{if(e.receiveNavigationFallbackId(r?.id),!s)return;const n=!t.getEntityRecord("postType","wp_navigation",r.id);e.receiveEntityRecords("postType","wp_navigation",s,void 0,n),e.finishResolution("getEntityRecord",["postType","wp_navigation",r.id])}))},xn=e=>async({dispatch:t})=>{const n=await k()({path:(0,D.addQueryArgs)("/wp/v2/templates/lookup",e)});n?.id&&t.receiveDefaultTemplateId(e,n.id)},Ln=(e,t,n,r={})=>async({dispatch:s,registry:i})=>{const o=(await s(Ae(e,t))).find((n=>n.name===t&&n.kind===e));if(!o)return;r._fields&&(r={...r,_fields:[...new Set([...Pe(r._fields)||[],o.revisionKey||Re])].join()});const a=(0,D.addQueryArgs)(o.getRevisionsUrl(n),r);let c,l;const u={},d=o.supportsPagination&&-1!==r.per_page;try{l=await k()({path:a,parse:!d})}catch(e){return}l&&(d?(c=Object.values(await l.json()),u.totalItems=parseInt(l.headers.get("X-WP-Total"))):c=Object.values(l),r._fields&&(c=c.map((e=>(r._fields.split(",").forEach((t=>{e.hasOwnProperty(t)||(e[t]=void 0)})),e)))),i.batch((()=>{if(s.receiveRevisions(e,t,n,c,r,!1,u),!r?._fields&&!r.context){const r=o.key||Re,i=c.filter((e=>e[r])).map((s=>[e,t,n,s[r]]));s.finishResolutions("getRevision",i)}})))};Ln.shouldInvalidate=(e,t,n,r)=>"SAVE_ENTITY_RECORD_FINISH"===e.type&&n===e.name&&t===e.kind&&!e.error&&r===e.recordId;const jn=(e,t,n,r,s)=>async({dispatch:i})=>{const o=(await i(Ae(e,t))).find((n=>n.name===t&&n.kind===e));if(!o)return;void 0!==s&&s._fields&&(s={...s,_fields:[...new Set([...Pe(s._fields)||[],o.revisionKey||Re])].join()});const a=(0,D.addQueryArgs)(o.getRevisionsUrl(n,r),s);let c;try{c=await k()({path:a})}catch(e){return}c&&i.receiveRevisions(e,t,n,c,s)},Mn=e=>async({dispatch:t,resolveSelect:n})=>{let r;try{const{rest_namespace:t="wp/v2",rest_base:s}=await n.getPostType(e)||{};r=await k()({path:`${t}/${s}/?context=edit`,method:"OPTIONS"})}catch(e){return}r&&t.receiveRegisteredPostMeta(e,r?.schema?.properties?.meta?.properties)};function Dn(e,t){const n={...e};let r=n;for(const e of t)r.children={...r.children,[e]:{locks:[],children:{},...r.children[e]}},r=r.children[e];return n}function Nn(e,t){let n=e;for(const e of t){const t=n.children[e];if(!t)return null;n=t}return n}function Vn({exclusive:e},t){return!(!e||!t.length)||!(e||!t.filter((e=>e.exclusive)).length)}const Gn={requests:[],tree:{locks:[],children:{}}};function qn(e=Gn,t){switch(t.type){case"ENQUEUE_LOCK_REQUEST":{const{request:n}=t;return{...e,requests:[n,...e.requests]}}case"GRANT_LOCK_REQUEST":{const{lock:n,request:r}=t,{store:s,path:i}=r,o=[s,...i],a=Dn(e.tree,o),c=Nn(a,o);return c.locks=[...c.locks,n],{...e,requests:e.requests.filter((e=>e!==r)),tree:a}}case"RELEASE_LOCK":{const{lock:n}=t,r=[n.store,...n.path],s=Dn(e.tree,r),i=Nn(s,r);return i.locks=i.locks.filter((e=>e!==n)),{...e,tree:s}}}return e}function Bn(e,t,n,{exclusive:r}){const s=[t,...n],i=e.tree;for(const e of function*(e,t){let n=e;yield n;for(const e of t){const t=n.children[e];if(!t)break;yield t,n=t}}(i,s))if(Vn({exclusive:r},e.locks))return!1;const o=Nn(i,s);if(!o)return!0;for(const e of function*(e){const t=Object.values(e.children);for(;t.length;){const e=t.pop();yield e,t.push(...Object.values(e.children))}}(o))if(Vn({exclusive:r},e.locks))return!1;return!0}function $n(){let e=qn(void 0,{type:"@@INIT"});function t(){for(const t of function(e){return e.requests}(e)){const{store:n,path:r,exclusive:s,notifyAcquired:i}=t;if(Bn(e,n,r,{exclusive:s})){const o={store:n,path:r,exclusive:s};e=qn(e,{type:"GRANT_LOCK_REQUEST",lock:o,request:t}),i(o)}}}return{acquire:function(n,r,s){return new Promise((i=>{e=qn(e,{type:"ENQUEUE_LOCK_REQUEST",request:{store:n,path:r,exclusive:s,notifyAcquired:i}}),t()}))},release:function(n){e=qn(e,{type:"RELEASE_LOCK",lock:n}),t()}}}function Fn(){const e=$n();return{__unstableAcquireStoreLock:function(t,n,{exclusive:r}){return()=>e.acquire(t,n,r)},__unstableReleaseStoreLock:function(t){return()=>e.release(t)}}}const Kn=window.wp.privateApis,{lock:Qn,unlock:Yn}=(0,Kn.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/core-data"),Hn=window.wp.element,zn=(0,Hn.createContext)({}),Wn=window.ReactJSXRuntime;function Jn({kind:e,type:t,id:n,children:r}){const s=(0,Hn.useContext)(zn),i=(0,Hn.useMemo)((()=>({...s,[e]:{...s?.[e],[t]:n}})),[s,e,t,n]);return(0,Wn.jsx)(zn.Provider,{value:i,children:r})}const Xn=function(e,t){var n,r,s=0;function i(){var i,o,a=n,c=arguments.length;e:for(;a;){if(a.args.length===arguments.length){for(o=0;oe((e=>nr(t(e))),n)),t)}const nr=Xn((e=>{const t={};for(const n in e)er.includes(n)||Object.defineProperty(t,n,{get:()=>(...t)=>{const r=e[n](...t),s=e.getResolutionState(n,t)?.status;let i;switch(s){case"resolving":i=Zn.Resolving;break;case"finished":i=Zn.Success;break;case"error":i=Zn.Error;break;case void 0:i=Zn.Idle}return{data:r,status:i,isResolving:i===Zn.Resolving,hasStarted:i!==Zn.Idle,hasResolved:i===Zn.Success||i===Zn.Error}}});return t})),rr={};function sr(e,t,n,r={enabled:!0}){const{editEntityRecord:s,saveEditedEntityRecord:i}=(0,l.useDispatch)(Ar),o=(0,Hn.useMemo)((()=>({edit:(r,i={})=>s(e,t,n,r,i),save:(r={})=>i(e,t,n,{throwOnError:!0,...r})})),[s,e,t,n,i]),{editedRecord:a,hasEdits:c,edits:u}=(0,l.useSelect)((s=>r.enabled?{editedRecord:s(Ar).getEditedEntityRecord(e,t,n),hasEdits:s(Ar).hasEditsForEntityRecord(e,t,n),edits:s(Ar).getEntityRecordNonTransientEdits(e,t,n)}:{editedRecord:rr,hasEdits:!1,edits:rr}),[e,t,n,r.enabled]),{data:d,...p}=tr((s=>r.enabled?s(Ar).getEntityRecord(e,t,n):{data:null}),[e,t,n,r.enabled]);return{record:d,editedRecord:a,hasEdits:c,edits:u,...p,...o}}function ir(e,t,n,r){return V()("wp.data.__experimentalUseEntityRecord",{alternative:"wp.data.useEntityRecord",since:"6.1"}),sr(e,t,n,r)}const or=[];function ar(e,t,n={},r={enabled:!0}){const s=(0,D.addQueryArgs)("",n),{data:i,...o}=tr((s=>r.enabled?s(Ar).getEntityRecords(e,t,n):{data:or}),[e,t,s,r.enabled]),{totalItems:a,totalPages:c}=(0,l.useSelect)((s=>r.enabled?{totalItems:s(Ar).getEntityRecordsTotalItems(e,t,n),totalPages:s(Ar).getEntityRecordsTotalPages(e,t,n)}:{totalItems:null,totalPages:null}),[e,t,s,r.enabled]);return{records:i,totalItems:a,totalPages:c,...o}}function cr(e,t,n,r){return V()("wp.data.__experimentalUseEntityRecords",{alternative:"wp.data.useEntityRecords",since:"6.1"}),ar(e,t,n,r)}window.wp.warning;function lr(e,t){const n="object"==typeof e;return tr((r=>{const s=n?!!e.id:!!t,{canUser:i}=r(Ar),o=i("create",n?{kind:e.kind,name:e.name}:e);if(!s){const t=i("read",e),n=o.isResolving||t.isResolving,r=o.hasResolved&&t.hasResolved;let s=Zn.Idle;return n?s=Zn.Resolving:r&&(s=Zn.Success),{status:s,isResolving:n,hasResolved:r,canCreate:o.hasResolved&&o.data,canRead:t.hasResolved&&t.data}}const a=i("read",e,t),c=i("update",e,t),l=i("delete",e,t),u=a.isResolving||o.isResolving||c.isResolving||l.isResolving,d=a.hasResolved&&o.hasResolved&&c.hasResolved&&l.hasResolved;let p=Zn.Idle;return u?p=Zn.Resolving:d&&(p=Zn.Success),{status:p,isResolving:u,hasResolved:d,canRead:d&&a.data,canCreate:d&&o.data,canUpdate:d&&c.data,canDelete:d&&l.data}}),[n?JSON.stringify(e):e,t])}const ur=lr;function dr(e,t){return V()("wp.data.__experimentalUseResourcePermissions",{alternative:"wp.data.useResourcePermissions",since:"6.1"}),lr(e,t)}const pr=window.wp.blocks;function fr(e,t){const n=(0,Hn.useContext)(zn);return n?.[e]?.[t]}const yr=window.wp.blockEditor;let Er;const mr=new WeakMap;const gr=new WeakMap;function hr(e){if(!gr.has(e)){const t=[];for(const n of function(e){if(Er||(Er=Yn(yr.privateApis)),!mr.has(e)){const t=Er.getRichTextValues([e]);mr.set(e,t)}return mr.get(e)}(e))n&&n.replacements.forEach((({type:e,attributes:n})=>{"core/footnote"===e&&t.push(n["data-fn"])}));gr.set(e,t)}return gr.get(e)}let vr={};function _r(e,t){const n={blocks:e};if(!t)return n;if(void 0===t.footnotes)return n;const r=function(e){return e.flatMap(hr)}(e),s=t.footnotes?JSON.parse(t.footnotes):[];if(s.map((e=>e.id)).join("")===r.join(""))return n;const i=r.map((e=>s.find((t=>t.id===e))||vr[e]||{id:e,content:""}));function o(e){if(!e||Array.isArray(e)||"object"!=typeof e)return e;e={...e};for(const t in e){const n=e[t];if(Array.isArray(n)){e[t]=n.map(o);continue}if("string"!=typeof n&&!(n instanceof C.RichTextData))continue;const s="string"==typeof n?C.RichTextData.fromHTMLString(n):new C.RichTextData(n);let i=!1;s.replacements.forEach((e=>{if("core/footnote"===e.type){const t=e.attributes["data-fn"],n=r.indexOf(t),s=(0,C.create)({html:e.innerHTML});s.text=String(n+1),s.formats=Array.from({length:s.text.length},(()=>s.formats[0])),s.replacements=Array.from({length:s.text.length},(()=>s.replacements[0])),e.innerHTML=(0,C.toHTMLString)({value:s}),i=!0}})),i&&(e[t]="string"==typeof n?s.toHTMLString():s)}return e}const a=function e(t){return t.map((t=>({...t,attributes:o(t.attributes),innerBlocks:e(t.innerBlocks)})))}(e);return vr={...vr,...s.reduce(((e,t)=>(r.includes(t.id)||(e[t.id]=t),e)),{})},{meta:{...t,footnotes:JSON.stringify(i)},blocks:a}}const Rr=[],br=new WeakMap;function wr(e,t,{id:n}={}){const r=fr(e,t),s=null!=n?n:r,{getEntityRecord:i,getEntityRecordEdits:o}=(0,l.useSelect)(Y),{content:a,editedBlocks:c,meta:u}=(0,l.useSelect)((n=>{if(!s)return{};const{getEditedEntityRecord:r}=n(Y),i=r(e,t,s);return{editedBlocks:i.blocks,content:i.content,meta:i.meta}}),[e,t,s]),{__unstableCreateUndoLevel:d,editEntityRecord:p}=(0,l.useDispatch)(Y),f=(0,Hn.useMemo)((()=>{if(!s)return;if(c)return c;if(!a||"string"!=typeof a)return Rr;const n=o(e,t,s),r=!n||!Object.keys(n).length?i(e,t,s):n;let l=br.get(r);return l||(l=(0,pr.parse)(a),br.set(r,l)),l}),[e,t,s,c,a,i,o]),y=(0,Hn.useCallback)((e=>_r(e,u)),[u]),E=(0,Hn.useCallback)(((n,r)=>{if(f===n)return d(e,t,s);const{selection:i,...o}=r,a={selection:i,content:({blocks:e=[]})=>(0,pr.__unstableSerializeAndClean)(e),...y(n)};p(e,t,s,a,{isCached:!1,...o})}),[e,t,s,f,y,d,p]),m=(0,Hn.useCallback)(((n,r)=>{const{selection:i,...o}=r,a={selection:i,...y(n)};p(e,t,s,a,{isCached:!0,...o})}),[e,t,s,y,p]);return[f,m,E]}function Sr(e,t,n,r){const s=fr(e,t),i=null!=r?r:s,{value:o,fullValue:a}=(0,l.useSelect)((r=>{const{getEntityRecord:s,getEditedEntityRecord:o}=r(Y),a=s(e,t,i),c=o(e,t,i);return a&&c?{value:c[n],fullValue:a[n]}:{}}),[e,t,i,n]),{editEntityRecord:c}=(0,l.useDispatch)(Y);return[o,(0,Hn.useCallback)((r=>{c(e,t,i,{[n]:r})}),[c,e,t,i,n]),a]}const Tr={};Qn(Tr,{useEntityRecordsWithPermissions:function(e,t,n={},r={enabled:!0}){const s=(0,l.useSelect)((n=>n(Ar).getEntityConfig(e,t)),[e,t]),{records:i,...o}=ar(e,t,n,r),a=(0,Hn.useMemo)((()=>{var e;return null!==(e=i?.map((e=>{var t;return e[null!==(t=s?.key)&&void 0!==t?t:"id"]})))&&void 0!==e?e:[]}),[i,s?.key]),c=(0,l.useSelect)((n=>{const{getEntityRecordsPermissions:r}=Yn(n(Ar));return r(e,t,a)}),[a,e,t]);return{records:(0,Hn.useMemo)((()=>{var e;return null!==(e=i?.map(((e,t)=>({...e,permissions:c[t]}))))&&void 0!==e?e:[]}),[i,c]),...o}}});const Ir=[...we,...Se.filter((e=>!!e.name))],kr=Ir.reduce(((e,t)=>{const{kind:n,name:r,plural:s}=t;return e[Ce(n,r)]=(e,t,s)=>it(e,n,r,t,s),s&&(e[Ce(n,s,"get")]=(e,t)=>lt(e,n,r,t)),e}),{}),Or=Ir.reduce(((e,t)=>{const{kind:n,name:r,plural:s}=t;if(e[Ce(n,r)]=(e,t)=>fn(n,r,e,t),s){const t=Ce(n,s,"get");e[t]=(...e)=>mn(n,r,...e),e[t].shouldInvalidate=e=>mn.shouldInvalidate(e,n,r)}return e}),{}),Cr=Ir.reduce(((e,t)=>{const{kind:n,name:r}=t;return e[Ce(n,r,"save")]=(e,t)=>ue(n,r,e,t),e[Ce(n,r,"delete")]=(e,t,s)=>ie(n,r,e,t,s),e}),{}),Ar=(0,l.createReduxStore)(Y,{reducer:qe,actions:{...s,...Cr,...Fn()},selectors:{...i,...kr},resolvers:{...c,...Or}});Yn(Ar).registerPrivateSelectors(o),Yn(Ar).registerPrivateActions(a),(0,l.register)(Ar),(window.wp=window.wp||{}).coreData=r})(); \ No newline at end of file +(()=>{"use strict";var e={3249:e=>{function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}function r(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:this;this._map.forEach((function(s,i){null!==i&&"object"===t(i)&&(s=s[1]),e.call(n,s,i,r)}))}},{key:"clear",value:function(){this._map=new Map,this._arrayTreeMap=new Map,this._objectTreeMap=new Map}},{key:"size",get:function(){return this._map.size}}],i&&r(s.prototype,i),o&&r(s,o),e}();e.exports=s},7734:e=>{e.exports=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;var n,s,i;if(Array.isArray(t)){if((n=t.length)!=r.length)return!1;for(s=n;0!=s--;)if(!e(t[s],r[s]))return!1;return!0}if(t instanceof Map&&r instanceof Map){if(t.size!==r.size)return!1;for(s of t.entries())if(!r.has(s[0]))return!1;for(s of t.entries())if(!e(s[1],r.get(s[0])))return!1;return!0}if(t instanceof Set&&r instanceof Set){if(t.size!==r.size)return!1;for(s of t.entries())if(!r.has(s[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(r)){if((n=t.length)!=r.length)return!1;for(s=n;0!=s--;)if(t[s]!==r[s])return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((n=(i=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(s=n;0!=s--;)if(!Object.prototype.hasOwnProperty.call(r,i[s]))return!1;for(s=n;0!=s--;){var o=i[s];if(!e(t[o],r[o]))return!1}return!0}return t!=t&&r!=r}}},t={};function r(n){var s=t[n];if(void 0!==s)return s.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};r.r(n),r.d(n,{EntityProvider:()=>nn,__experimentalFetchLinkSuggestions:()=>Er,__experimentalFetchUrlData:()=>hr,__experimentalUseEntityRecord:()=>pn,__experimentalUseEntityRecords:()=>En,__experimentalUseResourcePermissions:()=>hn,fetchBlockPatterns:()=>vr,privateApis:()=>Un,store:()=>Dn,useEntityBlockEditor:()=>An,useEntityId:()=>Rn,useEntityProp:()=>Pn,useEntityRecord:()=>dn,useEntityRecords:()=>yn,useResourcePermissions:()=>mn});var s={};r.r(s),r.d(s,{__experimentalGetCurrentGlobalStylesId:()=>Ke,__experimentalGetCurrentThemeBaseGlobalStyles:()=>tt,__experimentalGetCurrentThemeGlobalStylesVariations:()=>rt,__experimentalGetDirtyEntityRecords:()=>Ce,__experimentalGetEntitiesBeingSaved:()=>Ae,__experimentalGetEntityRecordNoResolver:()=>we,canUser:()=>We,canUserEditEntityRecord:()=>ze,getAuthors:()=>Ee,getAutosave:()=>Xe,getAutosaves:()=>Je,getBlockPatternCategories:()=>st,getBlockPatterns:()=>nt,getCurrentTheme:()=>Fe,getCurrentThemeGlobalStylesRevisions:()=>ot,getCurrentUser:()=>ge,getDefaultTemplateId:()=>at,getEditedEntityRecord:()=>Le,getEmbedPreview:()=>Ye,getEntitiesByKind:()=>he,getEntitiesConfig:()=>ve,getEntity:()=>Re,getEntityConfig:()=>_e,getEntityRecord:()=>be,getEntityRecordEdits:()=>Pe,getEntityRecordNonTransientEdits:()=>Ue,getEntityRecords:()=>Ie,getEntityRecordsTotalItems:()=>ke,getEntityRecordsTotalPages:()=>Oe,getLastEntityDeleteError:()=>Ve,getLastEntitySaveError:()=>Ne,getRawEntityRecord:()=>Se,getRedoEdit:()=>qe,getReferenceByDistinctEdits:()=>et,getRevision:()=>lt,getRevisions:()=>ct,getThemeSupports:()=>Qe,getUndoEdit:()=>Ge,getUserPatternCategories:()=>it,getUserQueryResults:()=>me,hasEditsForEntityRecord:()=>xe,hasEntityRecords:()=>Te,hasFetchedAutosaves:()=>Ze,hasRedo:()=>$e,hasUndo:()=>Be,isAutosavingEntityRecord:()=>je,isDeletingEntityRecord:()=>De,isPreviewEmbedFallback:()=>He,isRequestingEmbedPreview:()=>ye,isSavingEntityRecord:()=>Me});var i={};r.r(i),r.d(i,{getBlockPatternsForPostType:()=>Et,getEntityRecordPermissions:()=>mt,getEntityRecordsPermissions:()=>gt,getHomePage:()=>Rt,getNavigationFallbackId:()=>yt,getPostsPageId:()=>_t,getRegisteredPostMeta:()=>ht,getTemplateId:()=>bt,getUndoManager:()=>ft});var o={};r.r(o),r.d(o,{__experimentalBatch:()=>Zt,__experimentalReceiveCurrentGlobalStylesId:()=>qt,__experimentalReceiveThemeBaseGlobalStyles:()=>Bt,__experimentalReceiveThemeGlobalStyleVariations:()=>$t,__experimentalSaveSpecifiedEntityEdits:()=>tr,__unstableCreateUndoLevel:()=>Jt,addEntities:()=>Nt,deleteEntityRecord:()=>Yt,editEntityRecord:()=>Ht,receiveAutosaves:()=>ir,receiveCurrentTheme:()=>Gt,receiveCurrentUser:()=>Dt,receiveDefaultTemplateId:()=>ar,receiveEmbedPreview:()=>Qt,receiveEntityRecords:()=>Vt,receiveNavigationFallbackId:()=>or,receiveRevisions:()=>cr,receiveThemeGlobalStyleRevisions:()=>Kt,receiveThemeSupports:()=>Ft,receiveUploadPermissions:()=>rr,receiveUserPermission:()=>nr,receiveUserPermissions:()=>sr,receiveUserQuery:()=>Mt,redo:()=>zt,saveEditedEntityRecord:()=>er,saveEntityRecord:()=>Xt,undo:()=>Wt});var a={};r.r(a),r.d(a,{receiveRegisteredPostMeta:()=>lr});var c={};r.r(c),r.d(c,{__experimentalGetCurrentGlobalStylesId:()=>xr,__experimentalGetCurrentThemeBaseGlobalStyles:()=>Lr,__experimentalGetCurrentThemeGlobalStylesVariations:()=>jr,canUser:()=>Cr,canUserEditEntityRecord:()=>Ar,getAuthors:()=>Rr,getAutosave:()=>Ur,getAutosaves:()=>Pr,getBlockPatternCategories:()=>Nr,getBlockPatterns:()=>Dr,getCurrentTheme:()=>Ir,getCurrentThemeGlobalStylesRevisions:()=>Mr,getCurrentUser:()=>_r,getDefaultTemplateId:()=>qr,getEditedEntityRecord:()=>Sr,getEmbedPreview:()=>Or,getEntitiesConfig:()=>Kr,getEntityRecord:()=>br,getEntityRecords:()=>Tr,getNavigationFallbackId:()=>Gr,getRawEntityRecord:()=>wr,getRegisteredPostMeta:()=>Fr,getRevision:()=>$r,getRevisions:()=>Br,getThemeSupports:()=>kr,getUserPatternCategories:()=>Vr});const l=window.wp.data;var u=r(7734),d=r.n(u);const p=window.wp.compose,f=window.wp.isShallowEqual;var y=r.n(f);function E(e,t){const r={...e};return Object.entries(t).forEach((([e,t])=>{r[e]?r[e]={...r[e],to:t.to}:r[e]=t})),r}const g=(e,t)=>{const r=e?.findIndex((({id:e})=>"string"==typeof e?e===t.id:y()(e,t.id))),n=[...e];return-1!==r?n[r]={id:t.id,changes:E(n[r].changes,t.changes)}:n.push(t),n};function m(){let e=[],t=[],r=0;const n=()=>{e=e.slice(0,r||void 0),r=0},s=()=>{var r;const n=0===e.length?0:e.length-1;let s=null!==(r=e[n])&&void 0!==r?r:[];t.forEach((e=>{s=g(s,e)})),t=[],e[n]=s};return{addRecord(r,i=!1){const o=!r||(e=>!e.filter((({changes:e})=>Object.values(e).some((({from:e,to:t})=>"function"!=typeof e&&"function"!=typeof t&&!y()(e,t))))).length)(r);if(i){if(o)return;r.forEach((e=>{t=g(t,e)}))}else{if(n(),t.length&&s(),o)return;e.push(r)}},undo(){t.length&&(n(),s());const i=e[e.length-1+r];if(i)return r-=1,i},redo(){const t=e[e.length+r];if(t)return r+=1,t},hasUndo:()=>!!e[e.length-1+r],hasRedo:()=>!!e[e.length+r]}}const h=e=>t=>(r,n)=>void 0===r||e(n)?t(r,n):r,v=e=>t=>(r,n)=>t(r,e(n));const R=e=>t=>(r={},n)=>{const s=n[e];if(void 0===s)return r;const i=t(r[s],n);return i===r[s]?r:{...r,[s]:i}};var _=function(){return _=Object.assign||function(e){for(var t,r=1,n=arguments.length;r0&&r>="0"&&r<="9"?"_"+r+n:""+r.toUpperCase()+n}function C(e,t){return void 0===t&&(t={}),T(e,_({delimiter:"",transform:O},t))}const A=window.wp.apiFetch;var P=r.n(A);const U=window.wp.i18n,x=window.wp.richText,L="id",j=["title","excerpt","content"],M=[{label:(0,U.__)("Base"),kind:"root",name:"__unstableBase",baseURL:"/",baseURLParams:{_fields:["description","gmt_offset","home","name","site_icon","site_icon_url","site_logo","timezone_string","default_template_part_areas","default_template_types","url"].join(",")},plural:"__unstableBases",syncConfig:{fetch:async()=>P()({path:"/"}),applyChangesToDoc:(e,t)=>{const r=e.getMap("document");Object.entries(t).forEach((([e,t])=>{r.get(e)!==t&&r.set(e,t)}))},fromCRDTDoc:e=>e.getMap("document").toJSON()},syncObjectType:"root/base",getSyncObjectId:()=>"index"},{label:(0,U.__)("Post Type"),name:"postType",kind:"root",key:"slug",baseURL:"/wp/v2/types",baseURLParams:{context:"edit"},plural:"postTypes",syncConfig:{fetch:async e=>P()({path:`/wp/v2/types/${e}?context=edit`}),applyChangesToDoc:(e,t)=>{const r=e.getMap("document");Object.entries(t).forEach((([e,t])=>{r.get(e)!==t&&r.set(e,t)}))},fromCRDTDoc:e=>e.getMap("document").toJSON()},syncObjectType:"root/postType",getSyncObjectId:e=>e},{name:"media",kind:"root",baseURL:"/wp/v2/media",baseURLParams:{context:"edit"},plural:"mediaItems",label:(0,U.__)("Media"),rawAttributes:["caption","title","description"],supportsPagination:!0},{name:"taxonomy",kind:"root",key:"slug",baseURL:"/wp/v2/taxonomies",baseURLParams:{context:"edit"},plural:"taxonomies",label:(0,U.__)("Taxonomy")},{name:"sidebar",kind:"root",baseURL:"/wp/v2/sidebars",baseURLParams:{context:"edit"},plural:"sidebars",transientEdits:{blocks:!0},label:(0,U.__)("Widget areas")},{name:"widget",kind:"root",baseURL:"/wp/v2/widgets",baseURLParams:{context:"edit"},plural:"widgets",transientEdits:{blocks:!0},label:(0,U.__)("Widgets")},{name:"widgetType",kind:"root",baseURL:"/wp/v2/widget-types",baseURLParams:{context:"edit"},plural:"widgetTypes",label:(0,U.__)("Widget types")},{label:(0,U.__)("User"),name:"user",kind:"root",baseURL:"/wp/v2/users",baseURLParams:{context:"edit"},plural:"users"},{name:"comment",kind:"root",baseURL:"/wp/v2/comments",baseURLParams:{context:"edit"},plural:"comments",label:(0,U.__)("Comment")},{name:"menu",kind:"root",baseURL:"/wp/v2/menus",baseURLParams:{context:"edit"},plural:"menus",label:(0,U.__)("Menu")},{name:"menuItem",kind:"root",baseURL:"/wp/v2/menu-items",baseURLParams:{context:"edit"},plural:"menuItems",label:(0,U.__)("Menu Item"),rawAttributes:["title"]},{name:"menuLocation",kind:"root",baseURL:"/wp/v2/menu-locations",baseURLParams:{context:"edit"},plural:"menuLocations",label:(0,U.__)("Menu Location"),key:"name"},{label:(0,U.__)("Global Styles"),name:"globalStyles",kind:"root",baseURL:"/wp/v2/global-styles",baseURLParams:{context:"edit"},plural:"globalStylesVariations",getTitle:e=>e?.title?.rendered||e?.title,getRevisionsUrl:(e,t)=>`/wp/v2/global-styles/${e}/revisions${t?"/"+t:""}`,supportsPagination:!0},{label:(0,U.__)("Themes"),name:"theme",kind:"root",baseURL:"/wp/v2/themes",baseURLParams:{context:"edit"},plural:"themes",key:"stylesheet"},{label:(0,U.__)("Plugins"),name:"plugin",kind:"root",baseURL:"/wp/v2/plugins",baseURLParams:{context:"edit"},plural:"plugins",key:"plugin"},{label:(0,U.__)("Status"),name:"status",kind:"root",baseURL:"/wp/v2/statuses",baseURLParams:{context:"edit"},plural:"statuses",key:"slug"}],D=[{kind:"postType",loadEntities:async function(){const e=await P()({path:"/wp/v2/types?context=view"});return Object.entries(null!=e?e:{}).map((([e,t])=>{var r;const n=["wp_template","wp_template_part"].includes(e),s=null!==(r=t?.rest_namespace)&&void 0!==r?r:"wp/v2";return{kind:"postType",baseURL:`/${s}/${t.rest_base}`,baseURLParams:{context:"edit"},name:e,label:t.name,transientEdits:{blocks:!0,selection:!0},mergedEdits:{meta:!0},rawAttributes:j,getTitle:e=>{var t,r,s;return e?.title?.rendered||e?.title||(n?(r=null!==(t=e.slug)&&void 0!==t?t:"",void 0===s&&(s={}),T(r,_({delimiter:" ",transform:k},s))):String(e.id))},__unstablePrePersist:n?void 0:N,__unstable_rest_base:t.rest_base,syncConfig:{fetch:async e=>P()({path:`/${s}/${t.rest_base}/${e}?context=edit`}),applyChangesToDoc:(e,t)=>{const r=e.getMap("document");Object.entries(t).forEach((([e,t])=>{"function"!=typeof t&&("blocks"===e&&(V.has(t)||V.set(t,q(t)),t=V.get(t)),r.get(e)!==t&&r.set(e,t))}))},fromCRDTDoc:e=>e.getMap("document").toJSON()},syncObjectType:"postType/"+t.name,getSyncObjectId:e=>e,supportsPagination:!0,getRevisionsUrl:(e,r)=>`/${s}/${t.rest_base}/${e}/revisions${r?"/"+r:""}`,revisionKey:n?"wp_id":L}}))}},{kind:"taxonomy",loadEntities:async function(){const e=await P()({path:"/wp/v2/taxonomies?context=view"});return Object.entries(null!=e?e:{}).map((([e,t])=>{var r;return{kind:"taxonomy",baseURL:`/${null!==(r=t?.rest_namespace)&&void 0!==r?r:"wp/v2"}/${t.rest_base}`,baseURLParams:{context:"edit"},name:e,label:t.name}}))}},{kind:"root",name:"site",plural:"sites",loadEntities:async function(){var e;const t={label:(0,U.__)("Site"),name:"site",kind:"root",baseURL:"/wp/v2/settings",syncConfig:{fetch:async()=>P()({path:"/wp/v2/settings"}),applyChangesToDoc:(e,t)=>{const r=e.getMap("document");Object.entries(t).forEach((([e,t])=>{r.get(e)!==t&&r.set(e,t)}))},fromCRDTDoc:e=>e.getMap("document").toJSON()},syncObjectType:"root/site",getSyncObjectId:()=>"index",meta:{}},r=await P()({path:t.baseURL,method:"OPTIONS"}),n={};return Object.entries(null!==(e=r?.schema?.properties)&&void 0!==e?e:{}).forEach((([e,t])=>{"object"==typeof t&&t.title&&(n[e]=t.title)})),[{...t,meta:{labels:n}}]}}],N=(e,t)=>{const r={};return"auto-draft"===e?.status&&(t.status||r.status||(r.status="draft"),t.title&&"Auto Draft"!==t.title||r.title||e?.title&&"Auto Draft"!==e?.title||(r.title="")),r},V=new WeakMap;function G(e){const t={...e};for(const[r,n]of Object.entries(e))n instanceof x.RichTextData&&(t[r]=n.valueOf());return t}function q(e){return e.map((e=>{const{innerBlocks:t,attributes:r,...n}=e;return{...n,attributes:G(r),innerBlocks:q(t)}}))}const B=(e,t,r="get")=>`${r}${"root"===e?"":C(e)}${C(t)}`,$=window.wp.url;const F=function(e){return"string"==typeof e?e.split(","):Array.isArray(e)?e:null};const K=function(e){const t=new WeakMap;return r=>{let n;return t.has(r)?n=t.get(r):(n=e(r),null!==r&&"object"==typeof r&&t.set(r,n)),n}};const Q=K((function(e){const t={stableKey:"",page:1,perPage:10,fields:null,include:null,context:"default"},r=Object.keys(e).sort();for(let i=0;i=i&&r!t.some((t=>Number.isInteger(t)?t===+e:t===e)))))}const z=(0,p.compose)([h((e=>"query"in e)),v((e=>e.query?{...e,...Q(e.query)}:e)),R("context"),R("stableKey")])(((e={},t)=>{const{type:r,page:n,perPage:s,key:i=L}=t;return"RECEIVE_ITEMS"!==r?e:{itemIds:H(e?.itemIds||[],t.items.map((e=>e?.[i])).filter(Boolean),n,s),meta:t.meta}})),J=(0,l.combineReducers)({items:function(e={},t){switch(t.type){case"RECEIVE_ITEMS":{const r=Y(t),n=t.key||L;return{...e,[r]:{...e[r],...t.items.reduce(((t,s)=>{const i=s?.[n];return t[i]=function(e,t){if(!e)return t;let r=!1;const n={};for(const s in t)d()(e[s],t[s])?n[s]=e[s]:(r=!0,n[s]=t[s]);if(!r)return e;for(const t in e)n.hasOwnProperty(t)||(n[t]=e[t]);return n}(e?.[r]?.[i],s),t}),{})}}}case"REMOVE_ITEMS":return Object.fromEntries(Object.entries(e).map((([e,r])=>[e,W(r,t.itemIds)])))}return e},itemIsComplete:function(e={},t){switch(t.type){case"RECEIVE_ITEMS":{const r=Y(t),{query:n,key:s=L}=t,i=n?Q(n):{},o=!n||!Array.isArray(i.fields);return{...e,[r]:{...e[r],...t.items.reduce(((t,n)=>{const i=n?.[s];return t[i]=e?.[r]?.[i]||o,t}),{})}}}case"REMOVE_ITEMS":return Object.fromEntries(Object.entries(e).map((([e,r])=>[e,W(r,t.itemIds)])))}return e},queries:(e={},t)=>{switch(t.type){case"RECEIVE_ITEMS":return z(e,t);case"REMOVE_ITEMS":const r=t.itemIds.reduce(((e,t)=>(e[t]=!0,e)),{});return Object.fromEntries(Object.entries(e).map((([e,t])=>[e,Object.fromEntries(Object.entries(t).map((([e,t])=>[e,{...t,itemIds:t.itemIds.filter((e=>!r[e]))}])))])));default:return e}}});const X=e=>(t,r)=>{if("UNDO"===r.type||"REDO"===r.type){const{record:n}=r;let s=t;return n.forEach((({id:{kind:t,name:n,recordId:i},changes:o})=>{s=e(s,{type:"EDIT_ENTITY_RECORD",kind:t,name:n,recordId:i,edits:Object.entries(o).reduce(((e,[t,n])=>(e[t]="UNDO"===r.type?n.from:n.to,e)),{})})})),s}return e(t,r)};function Z(e){return(0,p.compose)([X,h((t=>t.name&&t.kind&&t.name===e.name&&t.kind===e.kind)),v((t=>({key:e.key||L,...t})))])((0,l.combineReducers)({queriedData:J,edits:(e={},t)=>{var r;switch(t.type){case"RECEIVE_ITEMS":if("default"!==(null!==(r=t?.query?.context)&&void 0!==r?r:"default"))return e;const n={...e};for(const e of t.items){const r=e?.[t.key],s=n[r];if(!s)continue;const i=Object.keys(s).reduce(((r,n)=>{var i;return d()(s[n],null!==(i=e[n]?.raw)&&void 0!==i?i:e[n])||t.persistedEdits&&d()(s[n],t.persistedEdits[n])||(r[n]=s[n]),r}),{});Object.keys(i).length?n[r]=i:delete n[r]}return n;case"EDIT_ENTITY_RECORD":const s={...e[t.recordId],...t.edits};return Object.keys(s).forEach((e=>{void 0===s[e]&&delete s[e]})),{...e,[t.recordId]:s}}return e},saving:(e={},t)=>{switch(t.type){case"SAVE_ENTITY_RECORD_START":case"SAVE_ENTITY_RECORD_FINISH":return{...e,[t.recordId]:{pending:"SAVE_ENTITY_RECORD_START"===t.type,error:t.error,isAutosave:t.isAutosave}}}return e},deleting:(e={},t)=>{switch(t.type){case"DELETE_ENTITY_RECORD_START":case"DELETE_ENTITY_RECORD_FINISH":return{...e,[t.recordId]:{pending:"DELETE_ENTITY_RECORD_START"===t.type,error:t.error}}}return e},revisions:(e={},t)=>{if("RECEIVE_ITEM_REVISIONS"===t.type){const r=t.recordKey;delete t.recordKey;const n=J(e[r],{...t,type:"RECEIVE_ITEMS"});return{...e,[r]:n}}return"REMOVE_ITEMS"===t.type?Object.fromEntries(Object.entries(e).filter((([e])=>!t.itemIds.some((t=>Number.isInteger(t)?t===+e:t===e))))):e}}))}const ee=(0,l.combineReducers)({terms:function(e={},t){return"RECEIVE_TERMS"===t.type?{...e,[t.taxonomy]:t.terms}:e},users:function(e={byId:{},queries:{}},t){return"RECEIVE_USER_QUERY"===t.type?{byId:{...e.byId,...t.users.reduce(((e,t)=>({...e,[t.id]:t})),{})},queries:{...e.queries,[t.queryID]:t.users.map((e=>e.id))}}:e},currentTheme:function(e=void 0,t){return"RECEIVE_CURRENT_THEME"===t.type?t.currentTheme.stylesheet:e},currentGlobalStylesId:function(e=void 0,t){return"RECEIVE_CURRENT_GLOBAL_STYLES_ID"===t.type?t.id:e},currentUser:function(e={},t){return"RECEIVE_CURRENT_USER"===t.type?t.currentUser:e},themeGlobalStyleVariations:function(e={},t){return"RECEIVE_THEME_GLOBAL_STYLE_VARIATIONS"===t.type?{...e,[t.stylesheet]:t.variations}:e},themeBaseGlobalStyles:function(e={},t){return"RECEIVE_THEME_GLOBAL_STYLES"===t.type?{...e,[t.stylesheet]:t.globalStyles}:e},themeGlobalStyleRevisions:function(e={},t){return"RECEIVE_THEME_GLOBAL_STYLE_REVISIONS"===t.type?{...e,[t.currentId]:t.revisions}:e},taxonomies:function(e=[],t){return"RECEIVE_TAXONOMIES"===t.type?t.taxonomies:e},entities:(e={},t)=>{const r=function(e=M,t){return"ADD_ENTITIES"===t.type?[...e,...t.entities]:e}(e.config,t);let n=e.reducer;if(!n||r!==e.config){const e=r.reduce(((e,t)=>{const{kind:r}=t;return e[r]||(e[r]=[]),e[r].push(t),e}),{});n=(0,l.combineReducers)(Object.entries(e).reduce(((e,[t,r])=>{const n=(0,l.combineReducers)(r.reduce(((e,t)=>({...e,[t.name]:Z(t)})),{}));return e[t]=n,e}),{}))}const s=n(e.records,t);return s===e.records&&r===e.config&&n===e.reducer?e:{reducer:n,records:s,config:r}},editsReference:function(e={},t){switch(t.type){case"EDIT_ENTITY_RECORD":case"UNDO":case"REDO":return{}}return e},undoManager:function(e=m()){return e},embedPreviews:function(e={},t){if("RECEIVE_EMBED_PREVIEW"===t.type){const{url:r,preview:n}=t;return{...e,[r]:n}}return e},userPermissions:function(e={},t){switch(t.type){case"RECEIVE_USER_PERMISSION":return{...e,[t.key]:t.isAllowed};case"RECEIVE_USER_PERMISSIONS":return{...e,...t.permissions}}return e},autosaves:function(e={},t){if("RECEIVE_AUTOSAVES"===t.type){const{postId:r,autosaves:n}=t;return{...e,[r]:n}}return e},blockPatterns:function(e=[],t){return"RECEIVE_BLOCK_PATTERNS"===t.type?t.patterns:e},blockPatternCategories:function(e=[],t){return"RECEIVE_BLOCK_PATTERN_CATEGORIES"===t.type?t.categories:e},userPatternCategories:function(e=[],t){return"RECEIVE_USER_PATTERN_CATEGORIES"===t.type?t.patternCategories:e},navigationFallbackId:function(e=null,t){return"RECEIVE_NAVIGATION_FALLBACK_ID"===t.type?t.fallbackId:e},defaultTemplates:function(e={},t){return"RECEIVE_DEFAULT_TEMPLATE"===t.type?{...e,[JSON.stringify(t.query)]:t.templateId}:e},registeredPostMeta:function(e={},t){return"RECEIVE_REGISTERED_POST_META"===t.type?{...e,[t.postType]:t.registeredPostMeta}:e}}),te=window.wp.deprecated;var re=r.n(te);const ne="core";var se=r(3249),ie=r.n(se);function oe(e,t,r){if(!e||"object"!=typeof e)return e;const n=Array.isArray(t)?t:t.split(".");return n.reduce(((e,t,s)=>(void 0===e[t]&&(Number.isInteger(n[s+1])?e[t]=[]:e[t]={}),s===n.length-1&&(e[t]=r),e[t])),e),e}const ae=new WeakMap;const ce=(0,l.createSelector)(((e,t={})=>{let r=ae.get(e);if(r){const e=r.get(t);if(void 0!==e)return e}else r=new(ie()),ae.set(e,r);const n=function(e,t){const{stableKey:r,page:n,perPage:s,include:i,fields:o,context:a}=Q(t);let c;if(e.queries?.[a]?.[r]&&(c=e.queries[a][r].itemIds),!c)return null;const l=-1===s?0:(n-1)*s,u=-1===s?c.length:Math.min(l+s,c.length),d=[];for(let t=l;t{r=r?.[e]})),oe(s,t,r)}}else{if(!e.itemIsComplete[a]?.[r])return null;s=n}d.push(s)}return d}(e,t);return r.set(t,n),n}));function le(e,t={}){var r;const{stableKey:n,context:s}=Q(t);return null!==(r=e.queries?.[s]?.[n]?.meta?.totalItems)&&void 0!==r?r:null}const ue=["create","read","update","delete"];function de(e){const t={};if(!e)return t;const r={create:"POST",read:"GET",update:"PUT",delete:"DELETE"};for(const[n,s]of Object.entries(r))t[n]=e.includes(s);return t}function pe(e,t,r){return("object"==typeof t?[e,t.kind,t.name,t.id]:[e,t,r]).filter(Boolean).join("/")}const fe={},ye=(0,l.createRegistrySelector)((e=>(t,r)=>e(ne).isResolving("getEmbedPreview",[r])));function Ee(e,t){re()("select( 'core' ).getAuthors()",{since:"5.9",alternative:"select( 'core' ).getUsers({ who: 'authors' })"});const r=(0,$.addQueryArgs)("/wp/v2/users/?who=authors&per_page=100",t);return me(e,r)}function ge(e){return e.currentUser}const me=(0,l.createSelector)(((e,t)=>{var r;return(null!==(r=e.users.queries[t])&&void 0!==r?r:[]).map((t=>e.users.byId[t]))}),((e,t)=>[e.users.queries[t],e.users.byId]));function he(e,t){return re()("wp.data.select( 'core' ).getEntitiesByKind()",{since:"6.0",alternative:"wp.data.select( 'core' ).getEntitiesConfig()"}),ve(e,t)}const ve=(0,l.createSelector)(((e,t)=>e.entities.config.filter((e=>e.kind===t))),((e,t)=>e.entities.config));function Re(e,t,r){return re()("wp.data.select( 'core' ).getEntity()",{since:"6.0",alternative:"wp.data.select( 'core' ).getEntityConfig()"}),_e(e,t,r)}function _e(e,t,r){return e.entities.config?.find((e=>e.kind===t&&e.name===r))}const be=(0,l.createSelector)(((e,t,r,n,s)=>{var i;const o=e.entities.records?.[t]?.[r]?.queriedData;if(!o)return;const a=null!==(i=s?.context)&&void 0!==i?i:"default";if(void 0===s){if(!o.itemIsComplete[a]?.[n])return;return o.items[a][n]}const c=o.items[a]?.[n];if(c&&s._fields){var l;const e={},t=null!==(l=F(s._fields))&&void 0!==l?l:[];for(let r=0;r{s=s?.[e]})),oe(e,n,s)}return e}return c}),((e,t,r,n,s)=>{var i;const o=null!==(i=s?.context)&&void 0!==i?i:"default";return[e.entities.records?.[t]?.[r]?.queriedData?.items[o]?.[n],e.entities.records?.[t]?.[r]?.queriedData?.itemIsComplete[o]?.[n]]}));function we(e,t,r,n){return be(e,t,r,n)}be.__unstableNormalizeArgs=e=>{const t=[...e],r=t?.[2];return t[2]=/^\s*\d+\s*$/.test(r)?Number(r):r,t};const Se=(0,l.createSelector)(((e,t,r,n)=>{const s=be(e,t,r,n);return s&&Object.keys(s).reduce(((n,i)=>{var o;(function(e,t){return(e.rawAttributes||[]).includes(t)})(_e(e,t,r),i)?n[i]=null!==(o=s[i]?.raw)&&void 0!==o?o:s[i]:n[i]=s[i];return n}),{})}),((e,t,r,n,s)=>{var i;const o=null!==(i=s?.context)&&void 0!==i?i:"default";return[e.entities.config,e.entities.records?.[t]?.[r]?.queriedData?.items[o]?.[n],e.entities.records?.[t]?.[r]?.queriedData?.itemIsComplete[o]?.[n]]}));function Te(e,t,r,n){return Array.isArray(Ie(e,t,r,n))}const Ie=(e,t,r,n)=>{const s=e.entities.records?.[t]?.[r]?.queriedData;return s?ce(s,n):null},ke=(e,t,r,n)=>{const s=e.entities.records?.[t]?.[r]?.queriedData;return s?le(s,n):null},Oe=(e,t,r,n)=>{const s=e.entities.records?.[t]?.[r]?.queriedData;if(!s)return null;if(-1===n.per_page)return 1;const i=le(s,n);return i?n.per_page?Math.ceil(i/n.per_page):function(e,t={}){var r;const{stableKey:n,context:s}=Q(t);return null!==(r=e.queries?.[s]?.[n]?.meta?.totalPages)&&void 0!==r?r:null}(s,n):i},Ce=(0,l.createSelector)((e=>{const{entities:{records:t}}=e,r=[];return Object.keys(t).forEach((n=>{Object.keys(t[n]).forEach((s=>{const i=Object.keys(t[n][s].edits).filter((t=>be(e,n,s,t)&&xe(e,n,s,t)));if(i.length){const t=_e(e,n,s);i.forEach((i=>{const o=Le(e,n,s,i);r.push({key:o?o[t.key||L]:void 0,title:t?.getTitle?.(o)||"",name:s,kind:n})}))}}))})),r}),(e=>[e.entities.records])),Ae=(0,l.createSelector)((e=>{const{entities:{records:t}}=e,r=[];return Object.keys(t).forEach((n=>{Object.keys(t[n]).forEach((s=>{const i=Object.keys(t[n][s].saving).filter((t=>Me(e,n,s,t)));if(i.length){const t=_e(e,n,s);i.forEach((i=>{const o=Le(e,n,s,i);r.push({key:o?o[t.key||L]:void 0,title:t?.getTitle?.(o)||"",name:s,kind:n})}))}}))})),r}),(e=>[e.entities.records]));function Pe(e,t,r,n){return e.entities.records?.[t]?.[r]?.edits?.[n]}const Ue=(0,l.createSelector)(((e,t,r,n)=>{const{transientEdits:s}=_e(e,t,r)||{},i=Pe(e,t,r,n)||{};return s?Object.keys(i).reduce(((e,t)=>(s[t]||(e[t]=i[t]),e)),{}):i}),((e,t,r,n)=>[e.entities.config,e.entities.records?.[t]?.[r]?.edits?.[n]]));function xe(e,t,r,n){return Me(e,t,r,n)||Object.keys(Ue(e,t,r,n)).length>0}const Le=(0,l.createSelector)(((e,t,r,n)=>{const s=Se(e,t,r,n),i=Pe(e,t,r,n);return!(!s&&!i)&&{...s,...i}}),((e,t,r,n,s)=>{var i;const o=null!==(i=s?.context)&&void 0!==i?i:"default";return[e.entities.config,e.entities.records?.[t]?.[r]?.queriedData.items[o]?.[n],e.entities.records?.[t]?.[r]?.queriedData.itemIsComplete[o]?.[n],e.entities.records?.[t]?.[r]?.edits?.[n]]}));function je(e,t,r,n){var s;const{pending:i,isAutosave:o}=null!==(s=e.entities.records?.[t]?.[r]?.saving?.[n])&&void 0!==s?s:{};return Boolean(i&&o)}function Me(e,t,r,n){var s;return null!==(s=e.entities.records?.[t]?.[r]?.saving?.[n]?.pending)&&void 0!==s&&s}function De(e,t,r,n){var s;return null!==(s=e.entities.records?.[t]?.[r]?.deleting?.[n]?.pending)&&void 0!==s&&s}function Ne(e,t,r,n){return e.entities.records?.[t]?.[r]?.saving?.[n]?.error}function Ve(e,t,r,n){return e.entities.records?.[t]?.[r]?.deleting?.[n]?.error}function Ge(e){re()("select( 'core' ).getUndoEdit()",{since:"6.3"})}function qe(e){re()("select( 'core' ).getRedoEdit()",{since:"6.3"})}function Be(e){return e.undoManager.hasUndo()}function $e(e){return e.undoManager.hasRedo()}function Fe(e){return e.currentTheme?be(e,"root","theme",e.currentTheme):null}function Ke(e){return e.currentGlobalStylesId}function Qe(e){var t;return null!==(t=Fe(e)?.theme_supports)&&void 0!==t?t:fe}function Ye(e,t){return e.embedPreviews[t]}function He(e,t){const r=e.embedPreviews[t],n=''+t+"";return!!r&&r.html===n}function We(e,t,r,n){if("object"==typeof r&&(!r.kind||!r.name))return!1;const s=pe(t,r,n);return e.userPermissions[s]}function ze(e,t,r,n){return re()("wp.data.select( 'core' ).canUserEditEntityRecord()",{since:"6.7",alternative:"wp.data.select( 'core' ).canUser( 'update', { kind, name, id } )"}),We(e,"update",{kind:t,name:r,id:n})}function Je(e,t,r){return e.autosaves[r]}function Xe(e,t,r,n){if(void 0===n)return;const s=e.autosaves[r];return s?.find((e=>e.author===n))}const Ze=(0,l.createRegistrySelector)((e=>(t,r,n)=>e(ne).hasFinishedResolution("getAutosaves",[r,n])));function et(e){return e.editsReference}function tt(e){const t=Fe(e);return t?e.themeBaseGlobalStyles[t.stylesheet]:null}function rt(e){const t=Fe(e);return t?e.themeGlobalStyleVariations[t.stylesheet]:null}function nt(e){return e.blockPatterns}function st(e){return e.blockPatternCategories}function it(e){return e.userPatternCategories}function ot(e){re()("select( 'core' ).getCurrentThemeGlobalStylesRevisions()",{since:"6.5.0",alternative:"select( 'core' ).getRevisions( 'root', 'globalStyles', ${ recordKey } )"});const t=Ke(e);return t?e.themeGlobalStyleRevisions[t]:null}function at(e,t){return e.defaultTemplates[JSON.stringify(t)]}const ct=(e,t,r,n,s)=>{const i=e.entities.records?.[t]?.[r]?.revisions?.[n];return i?ce(i,s):null},lt=(0,l.createSelector)(((e,t,r,n,s,i)=>{var o;const a=e.entities.records?.[t]?.[r]?.revisions?.[n];if(!a)return;const c=null!==(o=i?.context)&&void 0!==o?o:"default";if(void 0===i){if(!a.itemIsComplete[c]?.[s])return;return a.items[c][s]}const l=a.items[c]?.[s];if(l&&i._fields){var u;const e={},t=null!==(u=F(i._fields))&&void 0!==u?u:[];for(let r=0;r{s=s?.[e]})),oe(e,n,s)}return e}return l}),((e,t,r,n,s,i)=>{var o;const a=null!==(o=i?.context)&&void 0!==o?o:"default";return[e.entities.records?.[t]?.[r]?.revisions?.[n]?.items?.[a]?.[s],e.entities.records?.[t]?.[r]?.revisions?.[n]?.itemIsComplete?.[a]?.[s]]})),ut=window.wp.privateApis,{lock:dt,unlock:pt}=(0,ut.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/core-data");function ft(e){return e.undoManager}function yt(e){return e.navigationFallbackId}const Et=(0,l.createRegistrySelector)((e=>(0,l.createSelector)(((t,r)=>e(ne).getBlockPatterns().filter((({postTypes:e})=>!e||Array.isArray(e)&&e.includes(r)))),(()=>[e(ne).getBlockPatterns()])))),gt=(0,l.createRegistrySelector)((e=>(0,l.createSelector)(((t,r,n,s)=>(Array.isArray(s)?s:[s]).map((t=>({delete:e(ne).canUser("delete",{kind:r,name:n,id:t}),update:e(ne).canUser("update",{kind:r,name:n,id:t})})))),(e=>[e.userPermissions]))));function mt(e,t,r,n){return gt(e,t,r,n)[0]}function ht(e,t){var r;return null!==(r=e.registeredPostMeta?.[t])&&void 0!==r?r:{}}function vt(e){return e&&["number","string"].includes(typeof e)?0===Number(e)?null:e.toString():null}const Rt=(0,l.createRegistrySelector)((e=>(0,l.createSelector)((()=>{if(!e(ne).canUser("read",{kind:"root",name:"site"}))return null;const t=e(ne).getEntityRecord("root","site");if(!t)return null;const r="page"===t?.show_on_front?vt(t.page_on_front):null;if(r)return{postType:"page",postId:r};return{postType:"wp_template",postId:e(ne).getDefaultTemplateId({slug:"front-page"})}}),(e=>[We(e,"read",{kind:"root",name:"site"})&&be(e,"root","site"),at(e,{slug:"front-page"})])))),_t=(0,l.createRegistrySelector)((e=>()=>{if(!e(ne).canUser("read",{kind:"root",name:"site"}))return null;const t=e(ne).getEntityRecord("root","site");return"page"===t?.show_on_front?vt(t.page_for_posts):null})),bt=(0,l.createRegistrySelector)((e=>(t,r,n)=>{const s=pt(e(ne)).getHomePage();if(!s)return;if("page"===r&&r===s?.postType&&n.toString()===s?.postId){const t=e(ne).getEntityRecords("postType","wp_template",{per_page:-1});if(!t)return;const r=t.find((({slug:e})=>"front-page"===e))?.id;if(r)return r}const i=e(ne).getEditedEntityRecord("postType",r,n);if(!i)return;const o=pt(e(ne)).getPostsPageId();if("page"===r&&o===n.toString())return e(ne).getDefaultTemplateId({slug:"home"});const a=i.template;if(a){const t=e(ne).getEntityRecords("postType","wp_template",{per_page:-1})?.find((({slug:e})=>e===a));if(t)return t.id}let c;return c=i.slug?"page"===r?`${r}-${i.slug}`:`single-${r}-${i.slug}`:"page"===r?"page":`single-${r}`,e(ne).getDefaultTemplateId({slug:c})})),wt={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let St;const Tt=new Uint8Array(16);function It(){if(!St&&(St="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!St))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return St(Tt)}const kt=[];for(let e=0;e<256;++e)kt.push((e+256).toString(16).slice(1));function Ot(e,t=0){return kt[e[t+0]]+kt[e[t+1]]+kt[e[t+2]]+kt[e[t+3]]+"-"+kt[e[t+4]]+kt[e[t+5]]+"-"+kt[e[t+6]]+kt[e[t+7]]+"-"+kt[e[t+8]]+kt[e[t+9]]+"-"+kt[e[t+10]]+kt[e[t+11]]+kt[e[t+12]]+kt[e[t+13]]+kt[e[t+14]]+kt[e[t+15]]}const Ct=function(e,t,r){if(wt.randomUUID&&!t&&!e)return wt.randomUUID();const n=(e=e||{}).random||(e.rng||It)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(let e=0;e<16;++e)t[r+e]=n[e];return t}return Ot(n)};function At(e,t,r){if(!e||"object"!=typeof e||"string"!=typeof t&&!Array.isArray(t))return e;const n=Array.isArray(t)?t:t.split(".");let s=e;return n.forEach((e=>{s=s?.[e]})),void 0!==s?s:r}function Pt(e,t,r){return{type:"RECEIVE_ITEMS",items:Array.isArray(e)?e:[e],persistedEdits:t,meta:r}}let Ut=null;async function xt(e){if(null===Ut){const e=await P()({path:"/batch/v1",method:"OPTIONS"});Ut=e.endpoints[0].args.requests.maxItems}const t=[];for(const r of function(e,t){const r=[...e],n=[];for(;r.length;)n.push(r.splice(0,t));return n}(e,Ut)){const e=await P()({path:"/batch/v1",method:"POST",data:{validation:"require-all-validate",requests:r.map((e=>({path:e.path,body:e.data,method:e.method,headers:e.headers})))}});let n;n=e.failed?e.responses.map((e=>({error:e?.body}))):e.responses.map((e=>{const t={};return e.status>=200&&e.status<300?t.output=e.body:t.error=e.body,t})),t.push(...n)}return t}function Lt(e=xt){let t=0,r=[];const n=new jt;return{add(e){const s=++t;n.add(s);const i=e=>new Promise(((t,i)=>{r.push({input:e,resolve:t,reject:i}),n.delete(s)}));return"function"==typeof e?Promise.resolve(e(i)).finally((()=>{n.delete(s)})):i(e)},async run(){let t;n.size&&await new Promise((e=>{const t=n.subscribe((()=>{n.size||(t(),e(void 0))}))}));try{if(t=await e(r.map((({input:e})=>e))),t.length!==r.length)throw new Error("run: Array returned by processor must be same size as input array.")}catch(e){for(const{reject:t}of r)t(e);throw e}let s=!0;return t.forEach(((e,t)=>{const n=r[t];var i;e?.error?(n?.reject(e.error),s=!1):n?.resolve(null!==(i=e?.output)&&void 0!==i?i:e)})),r=[],s}}}class jt{constructor(...e){this.set=new Set(...e),this.subscribers=new Set}get size(){return this.set.size}add(e){return this.set.add(e),this.subscribers.forEach((e=>e())),this}delete(e){const t=this.set.delete(e);return this.subscribers.forEach((e=>e())),t}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}}function Mt(e,t){return{type:"RECEIVE_USER_QUERY",users:Array.isArray(t)?t:[t],queryID:e}}function Dt(e){return{type:"RECEIVE_CURRENT_USER",currentUser:e}}function Nt(e){return{type:"ADD_ENTITIES",entities:e}}function Vt(e,t,r,n,s=!1,i,o){let a;return"postType"===e&&(r=(Array.isArray(r)?r:[r]).map((e=>"auto-draft"===e.status?{...e,title:""}:e))),a=n?function(e,t={},r,n){return{...Pt(e,r,n),query:t}}(r,n,i,o):Pt(r,i,o),{...a,kind:e,name:t,invalidateCache:s}}function Gt(e){return{type:"RECEIVE_CURRENT_THEME",currentTheme:e}}function qt(e){return{type:"RECEIVE_CURRENT_GLOBAL_STYLES_ID",id:e}}function Bt(e,t){return{type:"RECEIVE_THEME_GLOBAL_STYLES",stylesheet:e,globalStyles:t}}function $t(e,t){return{type:"RECEIVE_THEME_GLOBAL_STYLE_VARIATIONS",stylesheet:e,variations:t}}function Ft(){return re()("wp.data.dispatch( 'core' ).receiveThemeSupports",{since:"5.9"}),{type:"DO_NOTHING"}}function Kt(e,t){return re()("wp.data.dispatch( 'core' ).receiveThemeGlobalStyleRevisions()",{since:"6.5.0",alternative:"wp.data.dispatch( 'core' ).receiveRevisions"}),{type:"RECEIVE_THEME_GLOBAL_STYLE_REVISIONS",currentId:e,revisions:t}}function Qt(e,t){return{type:"RECEIVE_EMBED_PREVIEW",url:e,preview:t}}const Yt=(e,t,r,n,{__unstableFetch:s=P(),throwOnError:i=!1}={})=>async({dispatch:o,resolveSelect:a})=>{const c=(await a.getEntitiesConfig(e)).find((r=>r.kind===e&&r.name===t));let l,u=!1;if(!c)return;const d=await o.__unstableAcquireStoreLock(ne,["entities","records",e,t,r],{exclusive:!0});try{o({type:"DELETE_ENTITY_RECORD_START",kind:e,name:t,recordId:r});let a=!1;try{let i=`${c.baseURL}/${r}`;n&&(i=(0,$.addQueryArgs)(i,n)),u=await s({path:i,method:"DELETE"}),await o(function(e,t,r,n=!1){return{type:"REMOVE_ITEMS",itemIds:Array.isArray(r)?r:[r],kind:e,name:t,invalidateCache:n}}(e,t,r,!0))}catch(e){a=!0,l=e}if(o({type:"DELETE_ENTITY_RECORD_FINISH",kind:e,name:t,recordId:r,error:l}),a&&i)throw l;return u}finally{o.__unstableReleaseStoreLock(d)}},Ht=(e,t,r,n,s={})=>({select:i,dispatch:o})=>{const a=i.getEntityConfig(e,t);if(!a)throw new Error(`The entity being edited (${e}, ${t}) does not have a loaded config.`);const{mergedEdits:c={}}=a,l=i.getRawEntityRecord(e,t,r),u=i.getEditedEntityRecord(e,t,r),p={kind:e,name:t,recordId:r,edits:Object.keys(n).reduce(((e,t)=>{const r=l[t],s=u[t],i=c[t]?{...s,...n[t]}:n[t];return e[t]=d()(r,i)?void 0:i,e}),{})};window.__experimentalEnableSync&&a.syncConfig||(s.undoIgnore||i.getUndoManager().addRecord([{id:{kind:e,name:t,recordId:r},changes:Object.keys(n).reduce(((e,t)=>(e[t]={from:u[t],to:n[t]},e)),{})}],s.isCached),o({type:"EDIT_ENTITY_RECORD",...p}))},Wt=()=>({select:e,dispatch:t})=>{const r=e.getUndoManager().undo();r&&t({type:"UNDO",record:r})},zt=()=>({select:e,dispatch:t})=>{const r=e.getUndoManager().redo();r&&t({type:"REDO",record:r})},Jt=()=>({select:e})=>{e.getUndoManager().addRecord()},Xt=(e,t,r,{isAutosave:n=!1,__unstableFetch:s=P(),throwOnError:i=!1}={})=>async({select:o,resolveSelect:a,dispatch:c})=>{const l=(await a.getEntitiesConfig(e)).find((r=>r.kind===e&&r.name===t));if(!l)return;const u=l.key||L,d=r[u],p=await c.__unstableAcquireStoreLock(ne,["entities","records",e,t,d||Ct()],{exclusive:!0});try{for(const[n,s]of Object.entries(r))if("function"==typeof s){const i=s(o.getEditedEntityRecord(e,t,d));c.editEntityRecord(e,t,d,{[n]:i},{undoIgnore:!0}),r[n]=i}let u,p;c({type:"SAVE_ENTITY_RECORD_START",kind:e,name:t,recordId:d,isAutosave:n});let f=!1;try{const i=`${l.baseURL}${d?"/"+d:""}`,p=o.getRawEntityRecord(e,t,d);if(n){const n=o.getCurrentUser(),l=n?n.id:void 0,d=await a.getAutosave(p.type,p.id,l);let f={...p,...d,...r};if(f=Object.keys(f).reduce(((e,t)=>(["title","excerpt","content","meta"].includes(t)&&(e[t]=f[t]),e)),{status:"auto-draft"===f.status?"draft":void 0}),u=await s({path:`${i}/autosaves`,method:"POST",data:f}),p.id===u.id){let r={...p,...f,...u};r=Object.keys(r).reduce(((e,t)=>(["title","excerpt","content"].includes(t)?e[t]=r[t]:e[t]="status"===t?"auto-draft"===p.status&&"draft"===r.status?r.status:p.status:p[t],e)),{}),c.receiveEntityRecords(e,t,r,void 0,!0)}else c.receiveAutosaves(p.id,u)}else{let n=r;l.__unstablePrePersist&&(n={...n,...l.__unstablePrePersist(p,n)}),u=await s({path:i,method:d?"PUT":"POST",data:n}),c.receiveEntityRecords(e,t,u,void 0,!0,n)}}catch(e){f=!0,p=e}if(c({type:"SAVE_ENTITY_RECORD_FINISH",kind:e,name:t,recordId:d,error:p,isAutosave:n}),f&&i)throw p;return u}finally{c.__unstableReleaseStoreLock(p)}},Zt=e=>async({dispatch:t})=>{const r=Lt(),n={saveEntityRecord:(e,n,s,i)=>r.add((r=>t.saveEntityRecord(e,n,s,{...i,__unstableFetch:r}))),saveEditedEntityRecord:(e,n,s,i)=>r.add((r=>t.saveEditedEntityRecord(e,n,s,{...i,__unstableFetch:r}))),deleteEntityRecord:(e,n,s,i,o)=>r.add((r=>t.deleteEntityRecord(e,n,s,i,{...o,__unstableFetch:r})))},s=e.map((e=>e(n))),[,...i]=await Promise.all([r.run(),...s]);return i},er=(e,t,r,n)=>async({select:s,dispatch:i,resolveSelect:o})=>{if(!s.hasEditsForEntityRecord(e,t,r))return;const a=(await o.getEntitiesConfig(e)).find((r=>r.kind===e&&r.name===t));if(!a)return;const c=a.key||L,l=s.getEntityRecordNonTransientEdits(e,t,r),u={[c]:r,...l};return await i.saveEntityRecord(e,t,u,n)},tr=(e,t,r,n,s)=>async({select:i,dispatch:o,resolveSelect:a})=>{if(!i.hasEditsForEntityRecord(e,t,r))return;const c=i.getEntityRecordNonTransientEdits(e,t,r),l={};for(const e of n)oe(l,e,At(c,e));const u=(await a.getEntitiesConfig(e)).find((r=>r.kind===e&&r.name===t));return r&&(l[u?.key||L]=r),await o.saveEntityRecord(e,t,l,s)};function rr(e){return re()("wp.data.dispatch( 'core' ).receiveUploadPermissions",{since:"5.9",alternative:"receiveUserPermission"}),nr("create/media",e)}function nr(e,t){return{type:"RECEIVE_USER_PERMISSION",key:e,isAllowed:t}}function sr(e){return{type:"RECEIVE_USER_PERMISSIONS",permissions:e}}function ir(e,t){return{type:"RECEIVE_AUTOSAVES",postId:e,autosaves:Array.isArray(t)?t:[t]}}function or(e){return{type:"RECEIVE_NAVIGATION_FALLBACK_ID",fallbackId:e}}function ar(e,t){return{type:"RECEIVE_DEFAULT_TEMPLATE",query:e,templateId:t}}const cr=(e,t,r,n,s,i=!1,o)=>async({dispatch:a,resolveSelect:c})=>{const l=(await c.getEntitiesConfig(e)).find((r=>r.kind===e&&r.name===t));a({type:"RECEIVE_ITEM_REVISIONS",key:l&&l?.revisionKey?l.revisionKey:L,items:Array.isArray(n)?n:[n],recordKey:r,meta:o,query:s,kind:e,name:t,invalidateCache:i})};function lr(e,t){return{type:"RECEIVE_REGISTERED_POST_META",postType:e,registeredPostMeta:t}}function ur(e,t){return 0===t?e.toLowerCase():O(e,t)}function dr(e,t){return void 0===t&&(t={}),C(e,_({transform:ur},t))}const pr=window.wp.htmlEntities,fr=e=>(...t)=>async({resolveSelect:r})=>{await r[e](...t)},yr=Symbol("RECEIVE_INTERMEDIATE_RESULTS");async function Er(e,t={},r={}){const n=t.isInitialSuggestions&&t.initialSuggestionsSearchOptions?{...t,...t.initialSuggestionsSearchOptions}:t,{type:s,subtype:i,page:o,perPage:a=(t.isInitialSuggestions?3:20)}=n,{disablePostFormats:c=!1}=r,l=[];s&&"post"!==s||l.push(P()({path:(0,$.addQueryArgs)("/wp/v2/search",{search:e,page:o,per_page:a,type:"post",subtype:i})}).then((e=>e.map((e=>({id:e.id,url:e.url,title:(0,pr.decodeEntities)(e.title||"")||(0,U.__)("(no title)"),type:e.subtype||e.type,kind:"post-type"}))))).catch((()=>[]))),s&&"term"!==s||l.push(P()({path:(0,$.addQueryArgs)("/wp/v2/search",{search:e,page:o,per_page:a,type:"term",subtype:i})}).then((e=>e.map((e=>({id:e.id,url:e.url,title:(0,pr.decodeEntities)(e.title||"")||(0,U.__)("(no title)"),type:e.subtype||e.type,kind:"taxonomy"}))))).catch((()=>[]))),c||s&&"post-format"!==s||l.push(P()({path:(0,$.addQueryArgs)("/wp/v2/search",{search:e,page:o,per_page:a,type:"post-format",subtype:i})}).then((e=>e.map((e=>({id:e.id,url:e.url,title:(0,pr.decodeEntities)(e.title||"")||(0,U.__)("(no title)"),type:e.subtype||e.type,kind:"taxonomy"}))))).catch((()=>[]))),s&&"attachment"!==s||l.push(P()({path:(0,$.addQueryArgs)("/wp/v2/media",{search:e,page:o,per_page:a})}).then((e=>e.map((e=>({id:e.id,url:e.source_url,title:(0,pr.decodeEntities)(e.title.rendered||"")||(0,U.__)("(no title)"),type:e.type,kind:"media"}))))).catch((()=>[])));let u=(await Promise.all(l)).flat();return u=u.filter((e=>!!e.id)),u=function(e,t){const r=gr(t),n={};for(const t of e)if(t.title){const e=gr(t.title),s=e.filter((e=>r.some((t=>e===t)))),i=e.filter((e=>r.some((t=>e!==t&&e.includes(t))))),o=s.length/e.length*10,a=i.length/e.length;n[t.id]=o+a}else n[t.id]=0;return e.sort(((e,t)=>n[t.id]-n[e.id]))}(u,e),u=u.slice(0,a),u}function gr(e){return e.toLowerCase().match(/[\p{L}\p{N}]+/gu)||[]}const mr=new Map,hr=async(e,t={})=>{const r={url:(0,$.prependHTTP)(e)};if(!(0,$.isURL)(e))return Promise.reject(`${e} is not a valid URL.`);const n=(0,$.getProtocol)(e);return n&&(0,$.isValidProtocol)(n)&&n.startsWith("http")&&/^https?:\/\/[^\/\s]/i.test(e)?mr.has(e)?mr.get(e):P()({path:(0,$.addQueryArgs)("/wp-block-editor/v1/url-details",r),...t}).then((t=>(mr.set(e,t),t))):Promise.reject(`${e} does not have a valid protocol. URLs must be "http" based`)};async function vr(){const e=await P()({path:"/wp/v2/block-patterns/patterns"});return e?e.map((e=>Object.fromEntries(Object.entries(e).map((([e,t])=>[dr(e),t]))))):[]}const Rr=e=>async({dispatch:t})=>{const r=(0,$.addQueryArgs)("/wp/v2/users/?who=authors&per_page=100",e),n=await P()({path:r});t.receiveUserQuery(r,n)},_r=()=>async({dispatch:e})=>{const t=await P()({path:"/wp/v2/users/me"});e.receiveCurrentUser(t)},br=(e,t,r="",n)=>async({select:s,dispatch:i,registry:o,resolveSelect:a})=>{const c=(await a.getEntitiesConfig(e)).find((r=>r.name===t&&r.kind===e));if(!c)return;const l=await i.__unstableAcquireStoreLock(ne,["entities","records",e,t,r],{exclusive:!1});try{if(window.__experimentalEnableSync&&c.syncConfig&&!n)0;else{void 0!==n&&n._fields&&(n={...n,_fields:[...new Set([...F(n._fields)||[],c.key||L])].join()});const a=(0,$.addQueryArgs)(c.baseURL+(r?"/"+r:""),{...c.baseURLParams,...n});if(void 0!==n&&n._fields){n={...n,include:[r]};if(s.hasEntityRecords(e,t,n))return}const l=await P()({path:a,parse:!1}),u=await l.json(),d=de(l.headers?.get("allow")),p=[],f={};for(const n of ue)f[pe(n,{kind:e,name:t,id:r})]=d[n],p.push([n,{kind:e,name:t,id:r}]);o.batch((()=>{i.receiveEntityRecords(e,t,u,n),i.receiveUserPermissions(f),i.finishResolutions("canUser",p)}))}}finally{i.__unstableReleaseStoreLock(l)}},wr=fr("getEntityRecord"),Sr=fr("getEntityRecord"),Tr=(e,t,r={})=>async({dispatch:n,registry:s,resolveSelect:i})=>{const o=(await i.getEntitiesConfig(e)).find((r=>r.name===t&&r.kind===e));if(!o)return;const a=await n.__unstableAcquireStoreLock(ne,["entities","records",e,t],{exclusive:!1}),c=o.key||L;function l(r){return r.filter((e=>e?.[c])).map((r=>[e,t,r[c]]))}try{r._fields&&(r={...r,_fields:[...new Set([...F(r._fields)||[],o.key||L])].join()});const i=(0,$.addQueryArgs)(o.baseURL,{...o.baseURLParams,...r});let u,d=[];if(o.supportsPagination&&-1!==r.per_page){const e=await P()({path:i,parse:!1});d=Object.values(await e.json()),u={totalItems:parseInt(e.headers.get("X-WP-Total")),totalPages:parseInt(e.headers.get("X-WP-TotalPages"))}}else if(-1===r.per_page&&!0===r[yr]){let o,a=1;do{const c=await P()({path:(0,$.addQueryArgs)(i,{page:a,per_page:100}),parse:!1}),u=Object.values(await c.json());o=parseInt(c.headers.get("X-WP-TotalPages")),d.push(...u),s.batch((()=>{n.receiveEntityRecords(e,t,d,r),n.finishResolutions("getEntityRecord",l(u))})),a++}while(a<=o);u={totalItems:d.length,totalPages:1}}else d=Object.values(await P()({path:i})),u={totalItems:d.length,totalPages:1};r._fields&&(d=d.map((e=>(r._fields.split(",").forEach((t=>{e.hasOwnProperty(t)||(e[t]=void 0)})),e)))),s.batch((()=>{if(n.receiveEntityRecords(e,t,d,r,!1,void 0,u),!r?._fields&&!r.context){const r=d.filter((e=>e?.[c])).map((e=>({id:e[c],permissions:de(e?._links?.self?.[0].targetHints.allow)}))),s=[],i={};for(const n of r)for(const r of ue)s.push([r,{kind:e,name:t,id:n.id}]),i[pe(r,{kind:e,name:t,id:n.id})]=n.permissions[r];n.receiveUserPermissions(i),n.finishResolutions("getEntityRecord",l(d)),n.finishResolutions("canUser",s)}n.__unstableReleaseStoreLock(a)}))}catch(e){n.__unstableReleaseStoreLock(a)}};Tr.shouldInvalidate=(e,t,r)=>("RECEIVE_ITEMS"===e.type||"REMOVE_ITEMS"===e.type)&&e.invalidateCache&&t===e.kind&&r===e.name;const Ir=()=>async({dispatch:e,resolveSelect:t})=>{const r=await t.getEntityRecords("root","theme",{status:"active"});e.receiveCurrentTheme(r[0])},kr=fr("getCurrentTheme"),Or=e=>async({dispatch:t})=>{try{const r=await P()({path:(0,$.addQueryArgs)("/oembed/1.0/proxy",{url:e})});t.receiveEmbedPreview(e,r)}catch(r){t.receiveEmbedPreview(e,!1)}},Cr=(e,t,r)=>async({dispatch:n,registry:s,resolveSelect:i})=>{if(!ue.includes(e))throw new Error(`'${e}' is not a valid action.`);const{hasStartedResolution:o}=s.select(ne);for(const n of ue){if(n===e)continue;if(o("canUser",[n,t,r]))return}let a,c=null;if("object"==typeof t){if(!t.kind||!t.name)throw new Error("The entity resource object is not valid.");const e=(await i.getEntitiesConfig(t.kind)).find((e=>e.name===t.name&&e.kind===t.kind));if(!e)return;c=e.baseURL+(t.id?"/"+t.id:"")}else c=`/wp/v2/${t}`+(r?"/"+r:"");try{a=await P()({path:c,method:"OPTIONS",parse:!1})}catch(e){return}const l=de(a.headers?.get("allow"));s.batch((()=>{for(const s of ue){const i=pe(s,t,r);n.receiveUserPermission(i,l[s]),s!==e&&n.finishResolution("canUser",[s,t,r])}}))},Ar=(e,t,r)=>async({dispatch:n})=>{await n(Cr("update",{kind:e,name:t,id:r}))},Pr=(e,t)=>async({dispatch:r,resolveSelect:n})=>{const{rest_base:s,rest_namespace:i="wp/v2",supports:o}=await n.getPostType(e);if(!o?.autosave)return;const a=await P()({path:`/${i}/${s}/${t}/autosaves?context=edit`});a&&a.length&&r.receiveAutosaves(t,a)},Ur=(e,t)=>async({resolveSelect:r})=>{await r.getAutosaves(e,t)},xr=()=>async({dispatch:e,resolveSelect:t})=>{const r=await t.getEntityRecords("root","theme",{status:"active"}),n=r?.[0]?._links?.["wp:user-global-styles"]?.[0]?.href;if(!n)return;const s=n.match(/\/(\d+)(?:\?|$)/),i=s?Number(s[1]):null;i&&e.__experimentalReceiveCurrentGlobalStylesId(i)},Lr=()=>async({resolveSelect:e,dispatch:t})=>{const r=await e.getCurrentTheme(),n=await P()({path:`/wp/v2/global-styles/themes/${r.stylesheet}?context=view`});t.__experimentalReceiveThemeBaseGlobalStyles(r.stylesheet,n)},jr=()=>async({resolveSelect:e,dispatch:t})=>{const r=await e.getCurrentTheme(),n=await P()({path:`/wp/v2/global-styles/themes/${r.stylesheet}/variations?context=view`});t.__experimentalReceiveThemeGlobalStyleVariations(r.stylesheet,n)},Mr=()=>async({resolveSelect:e,dispatch:t})=>{const r=await e.__experimentalGetCurrentGlobalStylesId(),n=r?await e.getEntityRecord("root","globalStyles",r):void 0,s=n?._links?.["version-history"]?.[0]?.href;if(s){const e=await P()({url:s}),n=e?.map((e=>Object.fromEntries(Object.entries(e).map((([e,t])=>[dr(e),t])))));t.receiveThemeGlobalStyleRevisions(r,n)}};Mr.shouldInvalidate=e=>"SAVE_ENTITY_RECORD_FINISH"===e.type&&"root"===e.kind&&!e.error&&"globalStyles"===e.name;const Dr=()=>async({dispatch:e})=>{e({type:"RECEIVE_BLOCK_PATTERNS",patterns:await vr()})},Nr=()=>async({dispatch:e})=>{e({type:"RECEIVE_BLOCK_PATTERN_CATEGORIES",categories:await P()({path:"/wp/v2/block-patterns/categories"})})},Vr=()=>async({dispatch:e,resolveSelect:t})=>{const r=await t.getEntityRecords("taxonomy","wp_pattern_category",{per_page:-1,_fields:"id,name,description,slug",context:"view"});e({type:"RECEIVE_USER_PATTERN_CATEGORIES",patternCategories:r?.map((e=>({...e,label:(0,pr.decodeEntities)(e.name),name:e.slug})))||[]})},Gr=()=>async({dispatch:e,select:t,registry:r})=>{const n=await P()({path:(0,$.addQueryArgs)("/wp-block-editor/v1/navigation-fallback",{_embed:!0})}),s=n?._embedded?.self;r.batch((()=>{if(e.receiveNavigationFallbackId(n?.id),!s)return;const r=!t.getEntityRecord("postType","wp_navigation",n.id);e.receiveEntityRecords("postType","wp_navigation",s,void 0,r),e.finishResolution("getEntityRecord",["postType","wp_navigation",n.id])}))},qr=e=>async({dispatch:t,registry:r,resolveSelect:n})=>{const s=await P()({path:(0,$.addQueryArgs)("/wp/v2/templates/lookup",e)});await n.getEntitiesConfig("postType"),s?.id&&r.batch((()=>{t.receiveDefaultTemplateId(e,s.id),t.receiveEntityRecords("postType","wp_template",[s]),t.finishResolution("getEntityRecord",["postType","wp_template",s.id])}))},Br=(e,t,r,n={})=>async({dispatch:s,registry:i,resolveSelect:o})=>{const a=(await o.getEntitiesConfig(e)).find((r=>r.name===t&&r.kind===e));if(!a)return;n._fields&&(n={...n,_fields:[...new Set([...F(n._fields)||[],a.revisionKey||L])].join()});const c=(0,$.addQueryArgs)(a.getRevisionsUrl(r),n);let l,u;const d={},p=a.supportsPagination&&-1!==n.per_page;try{u=await P()({path:c,parse:!p})}catch(e){return}u&&(p?(l=Object.values(await u.json()),d.totalItems=parseInt(u.headers.get("X-WP-Total"))):l=Object.values(u),n._fields&&(l=l.map((e=>(n._fields.split(",").forEach((t=>{e.hasOwnProperty(t)||(e[t]=void 0)})),e)))),i.batch((()=>{if(s.receiveRevisions(e,t,r,l,n,!1,d),!n?._fields&&!n.context){const n=a.key||L,i=l.filter((e=>e[n])).map((s=>[e,t,r,s[n]]));s.finishResolutions("getRevision",i)}})))};Br.shouldInvalidate=(e,t,r,n)=>"SAVE_ENTITY_RECORD_FINISH"===e.type&&r===e.name&&t===e.kind&&!e.error&&n===e.recordId;const $r=(e,t,r,n,s)=>async({dispatch:i,resolveSelect:o})=>{const a=(await o.getEntitiesConfig(e)).find((r=>r.name===t&&r.kind===e));if(!a)return;void 0!==s&&s._fields&&(s={...s,_fields:[...new Set([...F(s._fields)||[],a.revisionKey||L])].join()});const c=(0,$.addQueryArgs)(a.getRevisionsUrl(r,n),s);let l;try{l=await P()({path:c})}catch(e){return}l&&i.receiveRevisions(e,t,r,l,s)},Fr=e=>async({dispatch:t,resolveSelect:r})=>{let n;try{const{rest_namespace:t="wp/v2",rest_base:s}=await r.getPostType(e)||{};n=await P()({path:`${t}/${s}/?context=edit`,method:"OPTIONS"})}catch(e){return}n&&t.receiveRegisteredPostMeta(e,n?.schema?.properties?.meta?.properties)},Kr=e=>async({dispatch:t})=>{const r=D.find((t=>t.kind===e));if(r)try{const e=await r.loadEntities();if(!e.length)return;t.addEntities(e)}catch{}};function Qr(e,t){const r={...e};let n=r;for(const e of t)n.children={...n.children,[e]:{locks:[],children:{},...n.children[e]}},n=n.children[e];return r}function Yr(e,t){let r=e;for(const e of t){const t=r.children[e];if(!t)return null;r=t}return r}function Hr({exclusive:e},t){return!(!e||!t.length)||!(e||!t.filter((e=>e.exclusive)).length)}const Wr={requests:[],tree:{locks:[],children:{}}};function zr(e=Wr,t){switch(t.type){case"ENQUEUE_LOCK_REQUEST":{const{request:r}=t;return{...e,requests:[r,...e.requests]}}case"GRANT_LOCK_REQUEST":{const{lock:r,request:n}=t,{store:s,path:i}=n,o=[s,...i],a=Qr(e.tree,o),c=Yr(a,o);return c.locks=[...c.locks,r],{...e,requests:e.requests.filter((e=>e!==n)),tree:a}}case"RELEASE_LOCK":{const{lock:r}=t,n=[r.store,...r.path],s=Qr(e.tree,n),i=Yr(s,n);return i.locks=i.locks.filter((e=>e!==r)),{...e,tree:s}}}return e}function Jr(e,t,r,{exclusive:n}){const s=[t,...r],i=e.tree;for(const e of function*(e,t){let r=e;yield r;for(const e of t){const t=r.children[e];if(!t)break;yield t,r=t}}(i,s))if(Hr({exclusive:n},e.locks))return!1;const o=Yr(i,s);if(!o)return!0;for(const e of function*(e){const t=Object.values(e.children);for(;t.length;){const e=t.pop();yield e,t.push(...Object.values(e.children))}}(o))if(Hr({exclusive:n},e.locks))return!1;return!0}function Xr(){let e=zr(void 0,{type:"@@INIT"});function t(){for(const t of function(e){return e.requests}(e)){const{store:r,path:n,exclusive:s,notifyAcquired:i}=t;if(Jr(e,r,n,{exclusive:s})){const o={store:r,path:n,exclusive:s};e=zr(e,{type:"GRANT_LOCK_REQUEST",lock:o,request:t}),i(o)}}}return{acquire:function(r,n,s){return new Promise((i=>{e=zr(e,{type:"ENQUEUE_LOCK_REQUEST",request:{store:r,path:n,exclusive:s,notifyAcquired:i}}),t()}))},release:function(r){e=zr(e,{type:"RELEASE_LOCK",lock:r}),t()}}}function Zr(){const e=Xr();return{__unstableAcquireStoreLock:function(t,r,{exclusive:n}){return()=>e.acquire(t,r,n)},__unstableReleaseStoreLock:function(t){return()=>e.release(t)}}}const en=window.wp.element,tn=(0,en.createContext)({}),rn=window.ReactJSXRuntime;function nn({kind:e,type:t,id:r,children:n}){const s=(0,en.useContext)(tn),i=(0,en.useMemo)((()=>({...s,[e]:{...s?.[e],[t]:r}})),[s,e,t,r]);return(0,rn.jsx)(tn.Provider,{value:i,children:n})}const sn=function(e,t){var r,n,s=0;function i(){var i,o,a=r,c=arguments.length;e:for(;a;){if(a.args.length===arguments.length){for(o=0;oe((e=>ln(t(e))),r)),t)}const ln=sn((e=>{const t={};for(const r in e)an.includes(r)||Object.defineProperty(t,r,{get:()=>(...t)=>{const n=e[r](...t),s=e.getResolutionState(r,t)?.status;let i;switch(s){case"resolving":i=on.Resolving;break;case"finished":i=on.Success;break;case"error":i=on.Error;break;case void 0:i=on.Idle}return{data:n,status:i,isResolving:i===on.Resolving,hasStarted:i!==on.Idle,hasResolved:i===on.Success||i===on.Error}}});return t})),un={};function dn(e,t,r,n={enabled:!0}){const{editEntityRecord:s,saveEditedEntityRecord:i}=(0,l.useDispatch)(Dn),o=(0,en.useMemo)((()=>({edit:(n,i={})=>s(e,t,r,n,i),save:(n={})=>i(e,t,r,{throwOnError:!0,...n})})),[s,e,t,r,i]),{editedRecord:a,hasEdits:c,edits:u}=(0,l.useSelect)((s=>n.enabled?{editedRecord:s(Dn).getEditedEntityRecord(e,t,r),hasEdits:s(Dn).hasEditsForEntityRecord(e,t,r),edits:s(Dn).getEntityRecordNonTransientEdits(e,t,r)}:{editedRecord:un,hasEdits:!1,edits:un}),[e,t,r,n.enabled]),{data:d,...p}=cn((s=>n.enabled?s(Dn).getEntityRecord(e,t,r):{data:null}),[e,t,r,n.enabled]);return{record:d,editedRecord:a,hasEdits:c,edits:u,...p,...o}}function pn(e,t,r,n){return re()("wp.data.__experimentalUseEntityRecord",{alternative:"wp.data.useEntityRecord",since:"6.1"}),dn(e,t,r,n)}const fn=[];function yn(e,t,r={},n={enabled:!0}){const s=(0,$.addQueryArgs)("",r),{data:i,...o}=cn((s=>n.enabled?s(Dn).getEntityRecords(e,t,r):{data:fn}),[e,t,s,n.enabled]),{totalItems:a,totalPages:c}=(0,l.useSelect)((s=>n.enabled?{totalItems:s(Dn).getEntityRecordsTotalItems(e,t,r),totalPages:s(Dn).getEntityRecordsTotalPages(e,t,r)}:{totalItems:null,totalPages:null}),[e,t,s,n.enabled]);return{records:i,totalItems:a,totalPages:c,...o}}function En(e,t,r,n){return re()("wp.data.__experimentalUseEntityRecords",{alternative:"wp.data.useEntityRecords",since:"6.1"}),yn(e,t,r,n)}window.wp.warning;function gn(e,t){const r="object"==typeof e;return cn((n=>{const s=r?!!e.id:!!t,{canUser:i}=n(Dn),o=i("create",r?{kind:e.kind,name:e.name}:e);if(!s){const t=i("read",e),r=o.isResolving||t.isResolving,n=o.hasResolved&&t.hasResolved;let s=on.Idle;return r?s=on.Resolving:n&&(s=on.Success),{status:s,isResolving:r,hasResolved:n,canCreate:o.hasResolved&&o.data,canRead:t.hasResolved&&t.data}}const a=i("read",e,t),c=i("update",e,t),l=i("delete",e,t),u=a.isResolving||o.isResolving||c.isResolving||l.isResolving,d=a.hasResolved&&o.hasResolved&&c.hasResolved&&l.hasResolved;let p=on.Idle;return u?p=on.Resolving:d&&(p=on.Success),{status:p,isResolving:u,hasResolved:d,canRead:d&&a.data,canCreate:d&&o.data,canUpdate:d&&c.data,canDelete:d&&l.data}}),[r?JSON.stringify(e):e,t])}const mn=gn;function hn(e,t){return re()("wp.data.__experimentalUseResourcePermissions",{alternative:"wp.data.useResourcePermissions",since:"6.1"}),gn(e,t)}const vn=window.wp.blocks;function Rn(e,t){const r=(0,en.useContext)(tn);return r?.[e]?.[t]}const _n=window.wp.blockEditor;let bn;const wn=new WeakMap;const Sn=new WeakMap;function Tn(e){if(!Sn.has(e)){const t=[];for(const r of function(e){if(bn||(bn=pt(_n.privateApis)),!wn.has(e)){const t=bn.getRichTextValues([e]);wn.set(e,t)}return wn.get(e)}(e))r&&r.replacements.forEach((({type:e,attributes:r})=>{"core/footnote"===e&&t.push(r["data-fn"])}));Sn.set(e,t)}return Sn.get(e)}let In={};function kn(e,t){const r={blocks:e};if(!t)return r;if(void 0===t.footnotes)return r;const n=function(e){return e.flatMap(Tn)}(e),s=t.footnotes?JSON.parse(t.footnotes):[];if(s.map((e=>e.id)).join("")===n.join(""))return r;const i=n.map((e=>s.find((t=>t.id===e))||In[e]||{id:e,content:""}));function o(e){if(!e||Array.isArray(e)||"object"!=typeof e)return e;e={...e};for(const t in e){const r=e[t];if(Array.isArray(r)){e[t]=r.map(o);continue}if("string"!=typeof r&&!(r instanceof x.RichTextData))continue;const s="string"==typeof r?x.RichTextData.fromHTMLString(r):new x.RichTextData(r);let i=!1;s.replacements.forEach((e=>{if("core/footnote"===e.type){const t=e.attributes["data-fn"],r=n.indexOf(t),s=(0,x.create)({html:e.innerHTML});s.text=String(r+1),s.formats=Array.from({length:s.text.length},(()=>s.formats[0])),s.replacements=Array.from({length:s.text.length},(()=>s.replacements[0])),e.innerHTML=(0,x.toHTMLString)({value:s}),i=!0}})),i&&(e[t]="string"==typeof r?s.toHTMLString():s)}return e}const a=function e(t){return t.map((t=>({...t,attributes:o(t.attributes),innerBlocks:e(t.innerBlocks)})))}(e);return In={...In,...s.reduce(((e,t)=>(n.includes(t.id)||(e[t.id]=t),e)),{})},{meta:{...t,footnotes:JSON.stringify(i)},blocks:a}}const On=[],Cn=new WeakMap;function An(e,t,{id:r}={}){const n=Rn(e,t),s=null!=r?r:n,{getEntityRecord:i,getEntityRecordEdits:o}=(0,l.useSelect)(ne),{content:a,editedBlocks:c,meta:u}=(0,l.useSelect)((r=>{if(!s)return{};const{getEditedEntityRecord:n}=r(ne),i=n(e,t,s);return{editedBlocks:i.blocks,content:i.content,meta:i.meta}}),[e,t,s]),{__unstableCreateUndoLevel:d,editEntityRecord:p}=(0,l.useDispatch)(ne),f=(0,en.useMemo)((()=>{if(!s)return;if(c)return c;if(!a||"string"!=typeof a)return On;const r=o(e,t,s),n=!r||!Object.keys(r).length?i(e,t,s):r;let l=Cn.get(n);return l||(l=(0,vn.parse)(a),Cn.set(n,l)),l}),[e,t,s,c,a,i,o]),y=(0,en.useCallback)(((r,n)=>{if(f===r)return d(e,t,s);const{selection:i,...o}=n,a={selection:i,content:({blocks:e=[]})=>(0,vn.__unstableSerializeAndClean)(e),...kn(r,u)};p(e,t,s,a,{isCached:!1,...o})}),[e,t,s,f,u,d,p]),E=(0,en.useCallback)(((r,n)=>{const{selection:i,...o}=n,a={selection:i,...kn(r,u)};p(e,t,s,a,{isCached:!0,...o})}),[e,t,s,u,p]);return[f,E,y]}function Pn(e,t,r,n){const s=Rn(e,t),i=null!=n?n:s,{value:o,fullValue:a}=(0,l.useSelect)((n=>{const{getEntityRecord:s,getEditedEntityRecord:o}=n(ne),a=s(e,t,i),c=o(e,t,i);return a&&c?{value:c[r],fullValue:a[r]}:{}}),[e,t,i,r]),{editEntityRecord:c}=(0,l.useDispatch)(ne);return[o,(0,en.useCallback)((n=>{c(e,t,i,{[r]:n})}),[c,e,t,i,r]),a]}const Un={};dt(Un,{useEntityRecordsWithPermissions:function(e,t,r={},n={enabled:!0}){const s=(0,l.useSelect)((r=>r(Dn).getEntityConfig(e,t)),[e,t]),{records:i,...o}=yn(e,t,r,n),a=(0,en.useMemo)((()=>{var e;return null!==(e=i?.map((e=>{var t;return e[null!==(t=s?.key)&&void 0!==t?t:"id"]})))&&void 0!==e?e:[]}),[i,s?.key]),c=(0,l.useSelect)((r=>{const{getEntityRecordsPermissions:n}=pt(r(Dn));return n(e,t,a)}),[a,e,t]);return{records:(0,en.useMemo)((()=>{var e;return null!==(e=i?.map(((e,t)=>({...e,permissions:c[t]}))))&&void 0!==e?e:[]}),[i,c]),...o}},RECEIVE_INTERMEDIATE_RESULTS:yr});const xn=[...M,...D.filter((e=>!!e.name))],Ln=xn.reduce(((e,t)=>{const{kind:r,name:n,plural:s}=t;return e[B(r,n)]=(e,t,s)=>be(e,r,n,t,s),s&&(e[B(r,s,"get")]=(e,t)=>Ie(e,r,n,t)),e}),{}),jn=xn.reduce(((e,t)=>{const{kind:r,name:n,plural:s}=t;if(e[B(r,n)]=(e,t)=>br(r,n,e,t),s){const t=B(r,s,"get");e[t]=(...e)=>Tr(r,n,...e),e[t].shouldInvalidate=e=>Tr.shouldInvalidate(e,r,n)}return e}),{}),Mn=xn.reduce(((e,t)=>{const{kind:r,name:n}=t;return e[B(r,n,"save")]=(e,t)=>Xt(r,n,e,t),e[B(r,n,"delete")]=(e,t,s)=>Yt(r,n,e,t,s),e}),{}),Dn=(0,l.createReduxStore)(ne,{reducer:ee,actions:{...o,...Mn,...Zr()},selectors:{...s,...Ln},resolvers:{...c,...jn}});pt(Dn).registerPrivateSelectors(i),pt(Dn).registerPrivateActions(a),(0,l.register)(Dn),(window.wp=window.wp||{}).coreData=n})(); \ No newline at end of file diff --git a/wp-includes/js/dist/customize-widgets.js b/wp-includes/js/dist/customize-widgets.js index 40adbce49c..6748707318 100644 --- a/wp-includes/js/dist/customize-widgets.js +++ b/wp-includes/js/dist/customize-widgets.js @@ -214,10 +214,8 @@ function CopyButton({ children }) { const ref = (0,external_wp_compose_namespaceObject.useCopyToClipboard)(text); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button - // TODO: Switch to `true` (40px size) if possible - , { - __next40pxDefaultSize: false, + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + size: "compact", variant: "secondary", ref: ref, children: children @@ -532,7 +530,6 @@ const store = (0,external_wp_data_namespaceObject.createReduxStore)(STORE_NAME, */ - function Inserter({ setIsOpened }) { @@ -547,11 +544,8 @@ function Inserter({ id: inserterTitleId, className: "customize-widgets-layout__inserter-panel-header-title", children: (0,external_wp_i18n_namespaceObject.__)('Add a block') - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button - // TODO: Switch to `true` (40px size) if possible - , { - __next40pxDefaultSize: false, - className: "customize-widgets-layout__inserter-panel-header-close-button", + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + size: "small", icon: close_small, onClick: () => setIsOpened(false), "aria-label": (0,external_wp_i18n_namespaceObject.__)('Close inserter') @@ -678,14 +672,13 @@ const textFormattingShortcuts = [{ }]; ;// ./node_modules/@wordpress/customize-widgets/build-module/components/keyboard-shortcut-help-modal/shortcut.js +/* wp:polyfill */ /** * WordPress dependencies */ - - function KeyCombination({ keyCombination, forceAriaLabel @@ -775,6 +768,7 @@ function DynamicShortcut({ /* harmony default export */ const dynamic_shortcut = (DynamicShortcut); ;// ./node_modules/@wordpress/customize-widgets/build-module/components/keyboard-shortcut-help-modal/index.js +/* wp:polyfill */ /** * External dependencies */ @@ -795,7 +789,6 @@ function DynamicShortcut({ - const ShortcutList = ({ shortcuts }) => @@ -912,8 +905,6 @@ function KeyboardShortcutHelpModal({ */ - - function MoreMenu() { const [isKeyboardShortcutsModalActive, setIsKeyboardShortcutsModalVisible] = (0,external_wp_element_namespaceObject.useState)(false); const toggleKeyboardShortcutsModal = () => setIsKeyboardShortcutsModalVisible(!isKeyboardShortcutsModalActive); @@ -1006,8 +997,6 @@ function MoreMenu() { - - function Header({ sidebar, inserter, @@ -1057,7 +1046,7 @@ function Header({ } }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MoreMenu, {})] }) - }), (0,external_wp_element_namespaceObject.createPortal)( /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(components_inserter, { + }), (0,external_wp_element_namespaceObject.createPortal)(/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(components_inserter, { setIsOpened: setIsInserterOpened }), inserter.contentContainer[0])] }); @@ -1237,6 +1226,7 @@ function widgetToBlock({ } ;// ./node_modules/@wordpress/customize-widgets/build-module/components/sidebar-block-editor/use-sidebar-block-editor.js +/* wp:polyfill */ /** * External dependencies */ @@ -1395,6 +1385,7 @@ function FocusControl({ const useFocusControl = () => (0,external_wp_element_namespaceObject.useContext)(FocusControlContext); ;// ./node_modules/@wordpress/customize-widgets/build-module/components/focus-control/use-blocks-focus-control.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -1477,6 +1468,7 @@ function SidebarEditorProvider({ } ;// ./node_modules/@wordpress/customize-widgets/build-module/components/welcome-guide/index.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -1485,7 +1477,6 @@ function SidebarEditorProvider({ - function WelcomeGuide({ sidebar }) { @@ -1515,11 +1506,8 @@ function WelcomeGuide({ }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "customize-widgets-welcome-guide__text", children: isEntirelyBlockWidgets ? (0,external_wp_i18n_namespaceObject.__)('Your theme provides different “block” areas for you to add and edit content. Try adding a search bar, social icons, or other types of blocks here and see how they’ll look on your site.') : (0,external_wp_i18n_namespaceObject.__)('You can now add any block to your site’s widget areas. Don’t worry, all of your favorite widgets still work flawlessly.') - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button - // TODO: Switch to `true` (40px size) if possible - , { - __next40pxDefaultSize: false, - className: "customize-widgets-welcome-guide__button", + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + size: "compact", variant: "primary", onClick: () => toggle('core/customize-widgets', 'welcomeGuide'), children: (0,external_wp_i18n_namespaceObject.__)('Got it') @@ -1676,8 +1664,6 @@ function BlockAppender(props) { - - const { ExperimentalBlockCanvas: BlockCanvas } = unlock(external_wp_blockEditor_namespaceObject.privateApis); @@ -1734,6 +1720,7 @@ function SidebarBlockEditor({ mediaUpload: mediaUploadBlockEditor, hasFixedToolbar: isFixedToolbarActive || !isMediumViewport, keepCaretInsideBlock, + editorTool: 'edit', __unstableHasCustomAppender: true }; }, [hasUploadPermissions, blockEditorSettings, isFixedToolbarActive, isMediumViewport, keepCaretInsideBlock, setIsInserterOpened]); @@ -1889,6 +1876,7 @@ function useClearSelectedBlock(sidebarControl, popoverRef) { } ;// ./node_modules/@wordpress/customize-widgets/build-module/components/customize-widgets/index.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -1904,7 +1892,6 @@ function useClearSelectedBlock(sidebarControl, popoverRef) { - function CustomizeWidgets({ api, sidebarControls, @@ -1924,7 +1911,7 @@ function CustomizeWidgets({ unsubscribers.forEach(unsubscriber => unsubscriber()); }; }, [sidebarControls]); - const activeSidebar = activeSidebarControl && (0,external_wp_element_namespaceObject.createPortal)( /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ErrorBoundary, { + const activeSidebar = activeSidebarControl && (0,external_wp_element_namespaceObject.createPortal)(/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ErrorBoundary, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarBlockEditor, { blockEditorSettings: blockEditorSettings, sidebar: activeSidebarControl.sidebarAdapter, @@ -1935,7 +1922,7 @@ function CustomizeWidgets({ // We have to portal this to the parent of both the editor and the inspector, // so that the popovers will appear above both of them. - const popover = parentContainer && (0,external_wp_element_namespaceObject.createPortal)( /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + const popover = parentContainer && (0,external_wp_element_namespaceObject.createPortal)(/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "customize-widgets-popover", ref: popoverRef, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Popover.Slot, {}) @@ -2046,6 +2033,7 @@ function getInspectorSection() { } ;// ./node_modules/@wordpress/customize-widgets/build-module/controls/sidebar-section.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -2119,6 +2107,7 @@ function getSidebarSection() { } ;// ./node_modules/@wordpress/customize-widgets/build-module/components/sidebar-block-editor/sidebar-adapter.js +/* wp:polyfill */ /** * Internal dependencies */ @@ -2385,6 +2374,7 @@ class SidebarAdapter { ;// external ["wp","dom"] const external_wp_dom_namespaceObject = window["wp"]["dom"]; ;// ./node_modules/@wordpress/customize-widgets/build-module/controls/inserter-outer-section.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -2499,6 +2489,7 @@ function getInserterOuterSection() { } ;// ./node_modules/@wordpress/customize-widgets/build-module/controls/sidebar-control.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -2549,6 +2540,7 @@ function getSidebarControl() { } ;// ./node_modules/@wordpress/customize-widgets/build-module/filters/move-to-sidebar.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -2565,8 +2557,6 @@ function getSidebarControl() { - - const withMoveToSidebarToolbarItem = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(BlockEdit => props => { let widgetId = (0,external_wp_widgets_namespaceObject.getWidgetIdFromBlock)(props); const sidebarControls = useSidebarControls(); @@ -2638,6 +2628,7 @@ const replaceMediaUpload = () => external_wp_mediaUtils_namespaceObject.MediaUpl (0,external_wp_hooks_namespaceObject.addFilter)('editor.MediaUpload', 'core/edit-widgets/replace-media-upload', replaceMediaUpload); ;// ./node_modules/@wordpress/customize-widgets/build-module/filters/wide-widget-display.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -2669,6 +2660,7 @@ const withWideWidgetDisplay = (0,external_wp_compose_namespaceObject.createHighe ;// ./node_modules/@wordpress/customize-widgets/build-module/index.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -2731,7 +2723,7 @@ function initialize(editorName, blockEditorSettings) { sidebarControls.push(control); } }); - (0,external_wp_element_namespaceObject.createRoot)(container).render( /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.StrictMode, { + (0,external_wp_element_namespaceObject.createRoot)(container).render(/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.StrictMode, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CustomizeWidgets, { api: build_module_wp.customize, sidebarControls: sidebarControls, diff --git a/wp-includes/js/dist/customize-widgets.min.js b/wp-includes/js/dist/customize-widgets.min.js index 43c70867d4..dc933f83a6 100644 --- a/wp-includes/js/dist/customize-widgets.min.js +++ b/wp-includes/js/dist/customize-widgets.min.js @@ -1,2 +1,2 @@ /*! This file is auto-generated */ -(()=>{"use strict";var e={7734:e=>{e.exports=function e(t,s){if(t===s)return!0;if(t&&s&&"object"==typeof t&&"object"==typeof s){if(t.constructor!==s.constructor)return!1;var i,r,o;if(Array.isArray(t)){if((i=t.length)!=s.length)return!1;for(r=i;0!=r--;)if(!e(t[r],s[r]))return!1;return!0}if(t instanceof Map&&s instanceof Map){if(t.size!==s.size)return!1;for(r of t.entries())if(!s.has(r[0]))return!1;for(r of t.entries())if(!e(r[1],s.get(r[0])))return!1;return!0}if(t instanceof Set&&s instanceof Set){if(t.size!==s.size)return!1;for(r of t.entries())if(!s.has(r[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(s)){if((i=t.length)!=s.length)return!1;for(r=i;0!=r--;)if(t[r]!==s[r])return!1;return!0}if(t.constructor===RegExp)return t.source===s.source&&t.flags===s.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===s.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===s.toString();if((i=(o=Object.keys(t)).length)!==Object.keys(s).length)return!1;for(r=i;0!=r--;)if(!Object.prototype.hasOwnProperty.call(s,o[r]))return!1;for(r=i;0!=r--;){var n=o[r];if(!e(t[n],s[n]))return!1}return!0}return t!=t&&s!=s}}},t={};function s(i){var r=t[i];if(void 0!==r)return r.exports;var o=t[i]={exports:{}};return e[i](o,o.exports,s),o.exports}s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.d=(e,t)=>{for(var i in t)s.o(t,i)&&!s.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};s.r(i),s.d(i,{initialize:()=>Fe,store:()=>N});var r={};s.r(r),s.d(r,{__experimentalGetInsertionPoint:()=>O,isInserterOpened:()=>M});var o={};s.r(o),s.d(o,{setIsInserterOpened:()=>T});const n=window.wp.element,c=window.wp.blockLibrary,a=window.wp.widgets,d=window.wp.blocks,l=window.wp.data,u=window.wp.preferences,h=window.wp.components,p=window.wp.i18n,m=window.wp.blockEditor,g=window.wp.compose,b=window.wp.hooks,w=window.ReactJSXRuntime;function f({text:e,children:t}){const s=(0,g.useCopyToClipboard)(e);return(0,w.jsx)(h.Button,{__next40pxDefaultSize:!1,variant:"secondary",ref:s,children:t})}class _ extends n.Component{constructor(){super(...arguments),this.state={error:null}}componentDidCatch(e){this.setState({error:e}),(0,b.doAction)("editor.ErrorBoundary.errorLogged",e)}render(){const{error:e}=this.state;return e?(0,w.jsx)(m.Warning,{className:"customize-widgets-error-boundary",actions:[(0,w.jsx)(f,{text:e.stack,children:(0,p.__)("Copy Error")},"copy-error")],children:(0,p.__)("The editor has encountered an unexpected error.")}):this.props.children}}const x=window.wp.coreData,y=window.wp.mediaUtils;const k=function({inspector:e,closeMenu:t,...s}){const i=(0,l.useSelect)((e=>e(m.store).getSelectedBlockClientId()),[]),r=(0,n.useMemo)((()=>document.getElementById(`block-${i}`)),[i]);return(0,w.jsx)(h.MenuItem,{onClick:()=>{e.open({returnFocusWhenClose:r}),t()},...s,children:(0,p.__)("Show more settings")})};function v(e){var t,s,i="";if("string"==typeof e||"number"==typeof e)i+=e;else if("object"==typeof e)if(Array.isArray(e)){var r=e.length;for(t=0;te(N).__experimentalGetInsertionPoint()),[]);return(0,w.jsxs)("div",{className:"customize-widgets-layout__inserter-panel","aria-labelledby":s,children:[(0,w.jsxs)("div",{className:"customize-widgets-layout__inserter-panel-header",children:[(0,w.jsx)("h2",{id:s,className:"customize-widgets-layout__inserter-panel-header-title",children:(0,p.__)("Add a block")}),(0,w.jsx)(h.Button,{__next40pxDefaultSize:!1,className:"customize-widgets-layout__inserter-panel-header-close-button",icon:B,onClick:()=>t(!1),"aria-label":(0,p.__)("Close inserter")})]}),(0,w.jsx)("div",{className:"customize-widgets-layout__inserter-panel-content",children:(0,w.jsx)(m.__experimentalLibrary,{rootClientId:i.rootClientId,__experimentalInsertionIndex:i.insertionIndex,showInserterHelpPanel:!0,onSelect:()=>t(!1)})})]})},D=(0,w.jsx)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,w.jsx)(j.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"})}),L=(0,w.jsx)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,w.jsx)(j.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"})}),H=window.wp.keyboardShortcuts,R=[{keyCombination:{modifier:"primary",character:"b"},description:(0,p.__)("Make the selected text bold.")},{keyCombination:{modifier:"primary",character:"i"},description:(0,p.__)("Make the selected text italic.")},{keyCombination:{modifier:"primary",character:"k"},description:(0,p.__)("Convert the selected text into a link.")},{keyCombination:{modifier:"primaryShift",character:"k"},description:(0,p.__)("Remove a link.")},{keyCombination:{character:"[["},description:(0,p.__)("Insert a link to a post or page.")},{keyCombination:{modifier:"primary",character:"u"},description:(0,p.__)("Underline the selected text.")},{keyCombination:{modifier:"access",character:"d"},description:(0,p.__)("Strikethrough the selected text.")},{keyCombination:{modifier:"access",character:"x"},description:(0,p.__)("Make the selected text inline code.")},{keyCombination:{modifier:"access",character:"0"},aliases:[{modifier:"access",character:"7"}],description:(0,p.__)("Convert the current heading to a paragraph.")},{keyCombination:{modifier:"access",character:"1-6"},description:(0,p.__)("Convert the current paragraph or heading to a heading of level 1 to 6.")},{keyCombination:{modifier:"primaryShift",character:"SPACE"},description:(0,p.__)("Add non breaking space.")}];function G({keyCombination:e,forceAriaLabel:t}){const s=e.modifier?S.displayShortcutList[e.modifier](e.character):e.character,i=e.modifier?S.shortcutAriaLabel[e.modifier](e.character):e.character;return(0,w.jsx)("kbd",{className:"customize-widgets-keyboard-shortcut-help-modal__shortcut-key-combination","aria-label":t||i,children:(Array.isArray(s)?s:[s]).map(((e,t)=>"+"===e?(0,w.jsx)(n.Fragment,{children:e},t):(0,w.jsx)("kbd",{className:"customize-widgets-keyboard-shortcut-help-modal__shortcut-key",children:e},t)))})}const V=function({description:e,keyCombination:t,aliases:s=[],ariaLabel:i}){return(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)("div",{className:"customize-widgets-keyboard-shortcut-help-modal__shortcut-description",children:e}),(0,w.jsxs)("div",{className:"customize-widgets-keyboard-shortcut-help-modal__shortcut-term",children:[(0,w.jsx)(G,{keyCombination:t,forceAriaLabel:i}),s.map(((e,t)=>(0,w.jsx)(G,{keyCombination:e,forceAriaLabel:i},t)))]})]})};const U=function({name:e}){const{keyCombination:t,description:s,aliases:i}=(0,l.useSelect)((t=>{const{getShortcutKeyCombination:s,getShortcutDescription:i,getShortcutAliases:r}=t(H.store);return{keyCombination:s(e),aliases:r(e),description:i(e)}}),[e]);return t?(0,w.jsx)(V,{keyCombination:t,description:s,aliases:i}):null},$=({shortcuts:e})=>(0,w.jsx)("ul",{className:"customize-widgets-keyboard-shortcut-help-modal__shortcut-list",role:"list",children:e.map(((e,t)=>(0,w.jsx)("li",{className:"customize-widgets-keyboard-shortcut-help-modal__shortcut",children:"string"==typeof e?(0,w.jsx)(U,{name:e}):(0,w.jsx)(V,{...e})},t)))}),q=({title:e,shortcuts:t,className:s})=>(0,w.jsxs)("section",{className:C("customize-widgets-keyboard-shortcut-help-modal__section",s),children:[!!e&&(0,w.jsx)("h2",{className:"customize-widgets-keyboard-shortcut-help-modal__section-title",children:e}),(0,w.jsx)($,{shortcuts:t})]}),K=({title:e,categoryName:t,additionalShortcuts:s=[]})=>{const i=(0,l.useSelect)((e=>e(H.store).getCategoryShortcuts(t)),[t]);return(0,w.jsx)(q,{title:e,shortcuts:i.concat(s)})};function Z({isModalActive:e,toggleModal:t}){const{registerShortcut:s}=(0,l.useDispatch)(H.store);return s({name:"core/customize-widgets/keyboard-shortcuts",category:"main",description:(0,p.__)("Display these keyboard shortcuts."),keyCombination:{modifier:"access",character:"h"}}),(0,H.useShortcut)("core/customize-widgets/keyboard-shortcuts",t),e?(0,w.jsxs)(h.Modal,{className:"customize-widgets-keyboard-shortcut-help-modal",title:(0,p.__)("Keyboard shortcuts"),onRequestClose:t,children:[(0,w.jsx)(q,{className:"customize-widgets-keyboard-shortcut-help-modal__main-shortcuts",shortcuts:["core/customize-widgets/keyboard-shortcuts"]}),(0,w.jsx)(K,{title:(0,p.__)("Global shortcuts"),categoryName:"global"}),(0,w.jsx)(K,{title:(0,p.__)("Selection shortcuts"),categoryName:"selection"}),(0,w.jsx)(K,{title:(0,p.__)("Block shortcuts"),categoryName:"block",additionalShortcuts:[{keyCombination:{character:"/"},description:(0,p.__)("Change the block type after adding a new paragraph."),ariaLabel:(0,p.__)("Forward-slash")}]}),(0,w.jsx)(q,{title:(0,p.__)("Text formatting"),shortcuts:R})]}):null}function Y(){const[e,t]=(0,n.useState)(!1),s=()=>t(!e);return(0,H.useShortcut)("core/customize-widgets/keyboard-shortcuts",s),(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(h.ToolbarDropdownMenu,{icon:D,label:(0,p.__)("Options"),popoverProps:{placement:"bottom-end",className:"more-menu-dropdown__content"},toggleProps:{tooltipPosition:"bottom",size:"compact"},children:()=>(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(h.MenuGroup,{label:(0,p._x)("View","noun"),children:(0,w.jsx)(u.PreferenceToggleMenuItem,{scope:"core/customize-widgets",name:"fixedToolbar",label:(0,p.__)("Top toolbar"),info:(0,p.__)("Access all block and document tools in a single place"),messageActivated:(0,p.__)("Top toolbar activated"),messageDeactivated:(0,p.__)("Top toolbar deactivated")})}),(0,w.jsxs)(h.MenuGroup,{label:(0,p.__)("Tools"),children:[(0,w.jsx)(h.MenuItem,{onClick:()=>{t(!0)},shortcut:S.displayShortcut.access("h"),children:(0,p.__)("Keyboard shortcuts")}),(0,w.jsx)(u.PreferenceToggleMenuItem,{scope:"core/customize-widgets",name:"welcomeGuide",label:(0,p.__)("Welcome Guide")}),(0,w.jsxs)(h.MenuItem,{role:"menuitem",icon:L,href:(0,p.__)("https://wordpress.org/documentation/article/block-based-widgets-editor/"),target:"_blank",rel:"noopener noreferrer",children:[(0,p.__)("Help"),(0,w.jsx)(h.VisuallyHidden,{as:"span",children:(0,p.__)("(opens in a new tab)")})]})]}),(0,w.jsx)(h.MenuGroup,{label:(0,p.__)("Preferences"),children:(0,w.jsx)(u.PreferenceToggleMenuItem,{scope:"core/customize-widgets",name:"keepCaretInsideBlock",label:(0,p.__)("Contain text cursor inside block"),info:(0,p.__)("Aids screen readers by stopping text caret from leaving blocks."),messageActivated:(0,p.__)("Contain text cursor inside block activated"),messageDeactivated:(0,p.__)("Contain text cursor inside block deactivated")})})]})}),(0,w.jsx)(Z,{isModalActive:e,toggleModal:s})]})}const J=function({sidebar:e,inserter:t,isInserterOpened:s,setIsInserterOpened:i,isFixedToolbarActive:r}){const[[o,c],a]=(0,n.useState)([e.hasUndo(),e.hasRedo()]),d=(0,S.isAppleOS)()?S.displayShortcut.primaryShift("z"):S.displayShortcut.primary("y");return(0,n.useEffect)((()=>e.subscribeHistory((()=>{a([e.hasUndo(),e.hasRedo()])}))),[e]),(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)("div",{className:C("customize-widgets-header",{"is-fixed-toolbar-active":r}),children:(0,w.jsxs)(m.NavigableToolbar,{className:"customize-widgets-header-toolbar","aria-label":(0,p.__)("Document tools"),children:[(0,w.jsx)(h.ToolbarButton,{icon:(0,p.isRTL)()?z:I,label:(0,p.__)("Undo"),shortcut:S.displayShortcut.primary("z"),disabled:!o,onClick:e.undo,className:"customize-widgets-editor-history-button undo-button"}),(0,w.jsx)(h.ToolbarButton,{icon:(0,p.isRTL)()?I:z,label:(0,p.__)("Redo"),shortcut:d,disabled:!c,onClick:e.redo,className:"customize-widgets-editor-history-button redo-button"}),(0,w.jsx)(h.ToolbarButton,{className:"customize-widgets-header-toolbar__inserter-toggle",isPressed:s,variant:"primary",icon:W,label:(0,p._x)("Add block","Generic label for block inserter button"),onClick:()=>{i((e=>!e))}}),(0,w.jsx)(Y,{})]})}),(0,n.createPortal)((0,w.jsx)(F,{setIsOpened:i}),t.contentContainer[0])]})};var X=s(7734),Q=s.n(X);const ee=window.wp.isShallowEqual;var te=s.n(ee);function se(e){const t=e.match(/^widget_(.+)(?:\[(\d+)\])$/);if(t){return`${t[1]}-${parseInt(t[2],10)}`}return e}function ie(e,t=null){let s;if("core/legacy-widget"===e.name&&(e.attributes.id||e.attributes.instance))if(e.attributes.id)s={id:e.attributes.id};else{const{encoded:i,hash:r,raw:o,...n}=e.attributes.instance;s={idBase:e.attributes.idBase,instance:{...t?.instance,is_widget_customizer_js_value:!0,encoded_serialized_instance:i,instance_hash_key:r,raw_instance:o,...n}}}else{s={idBase:"block",widgetClass:"WP_Widget_Block",instance:{raw_instance:{content:(0,d.serialize)(e)}}}}const{form:i,rendered:r,...o}=t||{};return{...o,...s}}function re({id:e,idBase:t,number:s,instance:i}){let r;const{encoded_serialized_instance:o,instance_hash_key:n,raw_instance:c,...l}=i;if("block"===t){var u;const e=(0,d.parse)(null!==(u=c.content)&&void 0!==u?u:"",{__unstableSkipAutop:!0});r=e.length?e[0]:(0,d.createBlock)("core/paragraph",{})}else r=s?(0,d.createBlock)("core/legacy-widget",{idBase:t,instance:{encoded:o,hash:n,raw:c,...l}}):(0,d.createBlock)("core/legacy-widget",{id:e});return(0,a.addWidgetIdToBlock)(r,e)}function oe(e){const[t,s]=(0,n.useState)((()=>e.getWidgets().map((e=>re(e)))));(0,n.useEffect)((()=>e.subscribe(((e,t)=>{s((s=>{const i=new Map(e.map((e=>[e.id,e]))),r=new Map(s.map((e=>[(0,a.getWidgetIdFromBlock)(e),e]))),o=t.map((e=>{const t=i.get(e.id);return t&&t===e?r.get(e.id):re(e)}));return te()(s,o)?s:o}))}))),[e]);const i=(0,n.useCallback)((t=>{s((s=>{if(te()(s,t))return s;const i=new Map(s.map((e=>[(0,a.getWidgetIdFromBlock)(e),e]))),r=t.map((t=>{const s=(0,a.getWidgetIdFromBlock)(t);if(s&&i.has(s)){const r=i.get(s),o=e.getWidget(s);return Q()(t,r)&&o?o:ie(t,o)}return ie(t)}));if(te()(e.getWidgets(),r))return s;const o=e.setWidgets(r);return t.reduce(((e,s,i)=>{const r=o[i];return null!==r&&(e===t&&(e=t.slice()),e[i]=(0,a.addWidgetIdToBlock)(s,r)),e}),t)}))}),[e]);return[t,i,i]}const ne=(0,n.createContext)();function ce({api:e,sidebarControls:t,children:s}){const[i,r]=(0,n.useState)({current:null}),o=(0,n.useCallback)((e=>{for(const s of t){if(s.setting.get().includes(e)){s.sectionInstance.expand({completeCallback(){r({current:e})}});break}}}),[t]);(0,n.useEffect)((()=>{function t(e){const t=se(e);o(t)}let s=!1;function i(){e.previewer.preview.bind("focus-control-for-setting",t),s=!0}return e.previewer.bind("ready",i),()=>{e.previewer.unbind("ready",i),s&&e.previewer.preview.unbind("focus-control-for-setting",t)}}),[e,o]);const c=(0,n.useMemo)((()=>[i,o]),[i,o]);return(0,w.jsx)(ne.Provider,{value:c,children:s})}const ae=()=>(0,n.useContext)(ne);const de=window.wp.privateApis,{lock:le,unlock:ue}=(0,de.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/customize-widgets"),{ExperimentalBlockEditorProvider:he}=ue(m.privateApis);function pe({sidebar:e,settings:t,children:s}){const[i,r,o]=oe(e);return function(e){const{selectBlock:t}=(0,l.useDispatch)(m.store),[s]=ae(),i=(0,n.useRef)(e);(0,n.useEffect)((()=>{i.current=e}),[e]),(0,n.useEffect)((()=>{if(s.current){const e=i.current.find((e=>(0,a.getWidgetIdFromBlock)(e)===s.current));if(e){t(e.clientId);const s=document.querySelector(`[data-block="${e.clientId}"]`);s?.focus()}}}),[s,t])}(i),(0,w.jsx)(he,{value:i,onInput:r,onChange:o,settings:t,useSubRegistry:!1,children:s})}function me({sidebar:e}){const{toggle:t}=(0,l.useDispatch)(u.store),s=e.getWidgets().every((e=>e.id.startsWith("block-")));return(0,w.jsxs)("div",{className:"customize-widgets-welcome-guide",children:[(0,w.jsx)("div",{className:"customize-widgets-welcome-guide__image__wrapper",children:(0,w.jsxs)("picture",{children:[(0,w.jsx)("source",{srcSet:"https://s.w.org/images/block-editor/welcome-editor.svg",media:"(prefers-reduced-motion: reduce)"}),(0,w.jsx)("img",{className:"customize-widgets-welcome-guide__image",src:"https://s.w.org/images/block-editor/welcome-editor.gif",width:"312",height:"240",alt:""})]})}),(0,w.jsx)("h1",{className:"customize-widgets-welcome-guide__heading",children:(0,p.__)("Welcome to block Widgets")}),(0,w.jsx)("p",{className:"customize-widgets-welcome-guide__text",children:s?(0,p.__)("Your theme provides different “block” areas for you to add and edit content. Try adding a search bar, social icons, or other types of blocks here and see how they’ll look on your site."):(0,p.__)("You can now add any block to your site’s widget areas. Don’t worry, all of your favorite widgets still work flawlessly.")}),(0,w.jsx)(h.Button,{__next40pxDefaultSize:!1,className:"customize-widgets-welcome-guide__button",variant:"primary",onClick:()=>t("core/customize-widgets","welcomeGuide"),children:(0,p.__)("Got it")}),(0,w.jsx)("hr",{className:"customize-widgets-welcome-guide__separator"}),!s&&(0,w.jsxs)("p",{className:"customize-widgets-welcome-guide__more-info",children:[(0,p.__)("Want to stick with the old widgets?"),(0,w.jsx)("br",{}),(0,w.jsx)(h.ExternalLink,{href:(0,p.__)("https://wordpress.org/plugins/classic-widgets/"),children:(0,p.__)("Get the Classic Widgets plugin.")})]}),(0,w.jsxs)("p",{className:"customize-widgets-welcome-guide__more-info",children:[(0,p.__)("New to the block editor?"),(0,w.jsx)("br",{}),(0,w.jsx)(h.ExternalLink,{href:(0,p.__)("https://wordpress.org/documentation/article/wordpress-block-editor/"),children:(0,p.__)("Here's a detailed guide.")})]})]})}function ge({undo:e,redo:t,save:s}){return(0,H.useShortcut)("core/customize-widgets/undo",(t=>{e(),t.preventDefault()})),(0,H.useShortcut)("core/customize-widgets/redo",(e=>{t(),e.preventDefault()})),(0,H.useShortcut)("core/customize-widgets/save",(e=>{e.preventDefault(),s()})),null}ge.Register=function(){const{registerShortcut:e,unregisterShortcut:t}=(0,l.useDispatch)(H.store);return(0,n.useEffect)((()=>(e({name:"core/customize-widgets/undo",category:"global",description:(0,p.__)("Undo your last changes."),keyCombination:{modifier:"primary",character:"z"}}),e({name:"core/customize-widgets/redo",category:"global",description:(0,p.__)("Redo your last undo."),keyCombination:{modifier:"primaryShift",character:"z"},aliases:(0,S.isAppleOS)()?[]:[{modifier:"primary",character:"y"}]}),e({name:"core/customize-widgets/save",category:"global",description:(0,p.__)("Save your changes."),keyCombination:{modifier:"primary",character:"s"}}),()=>{t("core/customize-widgets/undo"),t("core/customize-widgets/redo"),t("core/customize-widgets/save")})),[e]),null};const be=ge;function we(e){const t=(0,n.useRef)(),s=(0,l.useSelect)((e=>0===e(m.store).getBlockCount()));return(0,n.useEffect)((()=>{if(s&&t.current){const{ownerDocument:e}=t.current;e.activeElement&&e.activeElement!==e.body||t.current.focus()}}),[s]),(0,w.jsx)(m.ButtonBlockAppender,{...e,ref:t})}const{ExperimentalBlockCanvas:fe}=ue(m.privateApis),{BlockKeyboardShortcuts:_e}=ue(c.privateApis);function xe({blockEditorSettings:e,sidebar:t,inserter:s,inspector:i}){const[r,o]=function(e){const t=(0,l.useSelect)((e=>e(N).isInserterOpened()),[]),{setIsInserterOpened:s}=(0,l.useDispatch)(N);return(0,n.useEffect)((()=>{t?e.open():e.close()}),[e,t]),[t,(0,n.useCallback)((e=>{let t=e;"function"==typeof e&&(t=e((0,l.select)(N).isInserterOpened())),s(t)}),[s])]}(s),c=(0,g.useViewportMatch)("small"),{hasUploadPermissions:a,isFixedToolbarActive:d,keepCaretInsideBlock:h,isWelcomeGuideActive:p}=(0,l.useSelect)((e=>{var t;const{get:s}=e(u.store);return{hasUploadPermissions:null===(t=e(x.store).canUser("create",{kind:"root",name:"media"}))||void 0===t||t,isFixedToolbarActive:!!s("core/customize-widgets","fixedToolbar"),keepCaretInsideBlock:!!s("core/customize-widgets","keepCaretInsideBlock"),isWelcomeGuideActive:!!s("core/customize-widgets","welcomeGuide")}}),[]),b=(0,n.useMemo)((()=>{let t;return a&&(t=({onError:t,...s})=>{(0,y.uploadMedia)({wpAllowedMimeTypes:e.allowedMimeTypes,onError:({message:e})=>t(e),...s})}),{...e,__experimentalSetIsInserterOpened:o,mediaUpload:t,hasFixedToolbar:d||!c,keepCaretInsideBlock:h,__unstableHasCustomAppender:!0}}),[a,e,d,c,h,o]);return p?(0,w.jsx)(me,{sidebar:t}):(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(be.Register,{}),(0,w.jsx)(_e,{}),(0,w.jsxs)(pe,{sidebar:t,settings:b,children:[(0,w.jsx)(be,{undo:t.undo,redo:t.redo,save:t.save}),(0,w.jsx)(J,{sidebar:t,inserter:s,isInserterOpened:r,setIsInserterOpened:o,isFixedToolbarActive:d||!c}),(d||!c)&&(0,w.jsx)(m.BlockToolbar,{hideDragHandle:!0}),(0,w.jsx)(fe,{shouldIframe:!1,styles:b.defaultEditorStyles,height:"100%",children:(0,w.jsx)(m.BlockList,{renderAppender:we})}),(0,n.createPortal)((0,w.jsx)("form",{onSubmit:e=>e.preventDefault(),children:(0,w.jsx)(m.BlockInspector,{})}),i.contentContainer[0])]}),(0,w.jsx)(m.__unstableBlockSettingsMenuFirstItem,{children:({onClose:e})=>(0,w.jsx)(k,{inspector:i,closeMenu:e})})]})}const ye=(0,n.createContext)();function ke({sidebarControls:e,activeSidebarControl:t,children:s}){const i=(0,n.useMemo)((()=>({sidebarControls:e,activeSidebarControl:t})),[e,t]);return(0,w.jsx)(ye.Provider,{value:i,children:s})}function ve({api:e,sidebarControls:t,blockEditorSettings:s}){const[i,r]=(0,n.useState)(null),o=document.getElementById("customize-theme-controls"),c=(0,n.useRef)();!function(e,t){const{hasSelectedBlock:s,hasMultiSelection:i}=(0,l.useSelect)(m.store),{clearSelectedBlock:r}=(0,l.useDispatch)(m.store);(0,n.useEffect)((()=>{if(t.current&&e){const o=e.inspector,n=e.container[0],c=n.ownerDocument,a=c.defaultView;function d(e){!s()&&!i()||!e||!c.contains(e)||n.contains(e)||t.current.contains(e)||e.closest('[role="dialog"]')||o.expanded()||r()}function l(e){d(e.target)}function u(){d(c.activeElement)}return c.addEventListener("mousedown",l),a.addEventListener("blur",u),()=>{c.removeEventListener("mousedown",l),a.removeEventListener("blur",u)}}}),[t,e,s,i,r])}(i,c),(0,n.useEffect)((()=>{const e=t.map((e=>e.subscribe((t=>{t&&r(e)}))));return()=>{e.forEach((e=>e()))}}),[t]);const a=i&&(0,n.createPortal)((0,w.jsx)(_,{children:(0,w.jsx)(xe,{blockEditorSettings:s,sidebar:i.sidebarAdapter,inserter:i.inserter,inspector:i.inspector},i.id)}),i.container[0]),d=o&&(0,n.createPortal)((0,w.jsx)("div",{className:"customize-widgets-popover",ref:c,children:(0,w.jsx)(h.Popover.Slot,{})}),o);return(0,w.jsx)(h.SlotFillProvider,{children:(0,w.jsx)(ke,{sidebarControls:t,activeSidebarControl:i,children:(0,w.jsxs)(ce,{api:e,sidebarControls:t,children:[a,d]})})})}const Ce=e=>`widgets-inspector-${e}`;function Se(){const{wp:{customize:e}}=window,t=window.matchMedia("(prefers-reduced-motion: reduce)");let s=t.matches;return t.addEventListener("change",(e=>{s=e.matches})),class extends e.Section{ready(){const t=function(){const{wp:{customize:e}}=window;return class extends e.Section{constructor(e,t){super(e,t),this.parentSection=t.parentSection,this.returnFocusWhenClose=null,this._isOpen=!1}get isOpen(){return this._isOpen}set isOpen(e){this._isOpen=e,this.triggerActiveCallbacks()}ready(){this.contentContainer[0].classList.add("customize-widgets-layout__inspector")}isContextuallyActive(){return this.isOpen}onChangeExpanded(e,t){super.onChangeExpanded(e,t),this.parentSection&&!t.unchanged&&(e?this.parentSection.collapse({manualTransition:!0}):this.parentSection.expand({manualTransition:!0,completeCallback:()=>{this.returnFocusWhenClose&&!this.contentContainer[0].contains(this.returnFocusWhenClose)&&this.returnFocusWhenClose.focus()}}))}open({returnFocusWhenClose:e}={}){this.isOpen=!0,this.returnFocusWhenClose=e,this.expand({allowMultiple:!0})}close(){this.collapse({allowMultiple:!0})}collapse(e){this.isOpen=!1,super.collapse(e)}triggerActiveCallbacks(){this.active.callbacks.fireWith(this.active,[!1,!0])}}}();this.inspector=new t(Ce(this.id),{title:(0,p.__)("Block Settings"),parentSection:this,customizeAction:[(0,p.__)("Customizing"),(0,p.__)("Widgets"),this.params.title].join(" ▸ ")}),e.section.add(this.inspector),this.contentContainer[0].classList.add("customize-widgets__sidebar-section")}hasSubSectionOpened(){return this.inspector.expanded()}onChangeExpanded(e,t){const i=this.controls(),r={...t,completeCallback(){i.forEach((t=>{t.onChangeSectionExpanded?.(e,r)})),t.completeCallback?.()}};if(r.manualTransition){e?(this.contentContainer.addClass(["busy","open"]),this.contentContainer.removeClass("is-sub-section-open"),this.contentContainer.closest(".wp-full-overlay").addClass("section-open")):(this.contentContainer.addClass(["busy","is-sub-section-open"]),this.contentContainer.closest(".wp-full-overlay").addClass("section-open"),this.contentContainer.removeClass("open"));const t=()=>{this.contentContainer.removeClass("busy"),r.completeCallback()};s?t():this.contentContainer.one("transitionend",t)}else super.onChangeExpanded(e,r)}}}const{wp:je}=window;function Ie(e){const t=e.match(/^(.+)-(\d+)$/);return t?{idBase:t[1],number:parseInt(t[2],10)}:{idBase:e}}function ze(e){const{idBase:t,number:s}=Ie(e);return s?`widget_${t}[${s}]`:`widget_${t}`}class We{constructor(e,t){this.setting=e,this.api=t,this.locked=!1,this.widgetsCache=new WeakMap,this.subscribers=new Set,this.history=[this._getWidgetIds().map((e=>this.getWidget(e)))],this.historyIndex=0,this.historySubscribers=new Set,this._debounceSetHistory=function(e,t,s){let i,r=!1;function o(...o){const n=(r?t:e).apply(this,o);return r=!0,clearTimeout(i),i=setTimeout((()=>{r=!1}),s),n}return o.cancel=()=>{r=!1,clearTimeout(i)},o}(this._pushHistory,this._replaceHistory,1e3),this.setting.bind(this._handleSettingChange.bind(this)),this.api.bind("change",this._handleAllSettingsChange.bind(this)),this.undo=this.undo.bind(this),this.redo=this.redo.bind(this),this.save=this.save.bind(this)}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}getWidgets(){return this.history[this.historyIndex]}_emit(...e){for(const t of this.subscribers)t(...e)}_getWidgetIds(){return this.setting.get()}_pushHistory(){this.history=[...this.history.slice(0,this.historyIndex+1),this._getWidgetIds().map((e=>this.getWidget(e)))],this.historyIndex+=1,this.historySubscribers.forEach((e=>e()))}_replaceHistory(){this.history[this.historyIndex]=this._getWidgetIds().map((e=>this.getWidget(e)))}_handleSettingChange(){if(this.locked)return;const e=this.getWidgets();this._pushHistory(),this._emit(e,this.getWidgets())}_handleAllSettingsChange(e){if(this.locked)return;if(!e.id.startsWith("widget_"))return;const t=se(e.id);if(!this.setting.get().includes(t))return;const s=this.getWidgets();this._pushHistory(),this._emit(s,this.getWidgets())}_createWidget(e){const t=je.customize.Widgets.availableWidgets.findWhere({id_base:e.idBase});let s=e.number;t.get("is_multi")&&!s&&(t.set("multi_number",t.get("multi_number")+1),s=t.get("multi_number"));const i=s?`widget_${e.idBase}[${s}]`:`widget_${e.idBase}`,r={transport:je.customize.Widgets.data.selectiveRefreshableWidgets[t.get("id_base")]?"postMessage":"refresh",previewer:this.setting.previewer};this.api.create(i,i,"",r).set(e.instance);return se(i)}_removeWidget(e){const t=ze(e.id),s=this.api(t);if(s){const e=s.get();this.widgetsCache.delete(e)}this.api.remove(t)}_updateWidget(e){const t=this.getWidget(e.id);if(t===e)return e.id;if(t.idBase&&e.idBase&&t.idBase===e.idBase){const t=ze(e.id);return this.api(t).set(e.instance),e.id}return this._removeWidget(e),this._createWidget(e)}getWidget(e){if(!e)return null;const{idBase:t,number:s}=Ie(e),i=ze(e),r=this.api(i);if(!r)return null;const o=r.get();if(this.widgetsCache.has(o))return this.widgetsCache.get(o);const n={id:e,idBase:t,number:s,instance:o};return this.widgetsCache.set(o,n),n}_updateWidgets(e){this.locked=!0;const t=[],s=e.map((e=>{if(e.id&&this.getWidget(e.id))return t.push(null),this._updateWidget(e);const s=this._createWidget(e);return t.push(s),s}));return this.getWidgets().filter((e=>!s.includes(e.id))).forEach((e=>this._removeWidget(e))),this.setting.set(s),this.locked=!1,t}setWidgets(e){const t=this._updateWidgets(e);return this._debounceSetHistory(),t}hasUndo(){return this.historyIndex>0}hasRedo(){return this.historyIndexe())),this._debounceSetHistory.cancel()}undo(){this.hasUndo()&&this._seek(this.historyIndex-1)}redo(){this.hasRedo()&&this._seek(this.historyIndex+1)}subscribeHistory(e){return this.historySubscribers.add(e),()=>{this.historySubscribers.delete(e)}}save(){this.api.previewer.save()}}const Be=window.wp.dom;const Ee=e=>`widgets-inserter-${e}`;function Ae(){const{wp:{customize:e}}=window;return class extends e.Control{constructor(...e){super(...e),this.subscribers=new Set}ready(){const t=function(){const{wp:{customize:e}}=window,t=e.OuterSection;return e.OuterSection=class extends t{onChangeExpanded(t,s){return t&&e.section.each((e=>{"outer"===e.params.type&&e.id!==this.id&&e.expanded()&&e.collapse()})),super.onChangeExpanded(t,s)}},e.sectionConstructor.outer=e.OuterSection,class extends e.OuterSection{constructor(...e){super(...e),this.params.type="outer",this.activeElementBeforeExpanded=null,this.contentContainer[0].ownerDocument.defaultView.addEventListener("keydown",(e=>{!this.expanded()||e.keyCode!==S.ESCAPE&&"Escape"!==e.code||e.defaultPrevented||(e.preventDefault(),e.stopPropagation(),(0,l.dispatch)(N).setIsInserterOpened(!1))}),!0),this.contentContainer.addClass("widgets-inserter"),this.isFromInternalAction=!1,this.expanded.bind((()=>{this.isFromInternalAction||(0,l.dispatch)(N).setIsInserterOpened(this.expanded()),this.isFromInternalAction=!1}))}open(){if(!this.expanded()){const e=this.contentContainer[0];this.activeElementBeforeExpanded=e.ownerDocument.activeElement,this.isFromInternalAction=!0,this.expand({completeCallback(){const t=Be.focus.tabbable.find(e)[1];t&&t.focus()}})}}close(){if(this.expanded()){const e=this.contentContainer[0],t=e.ownerDocument.activeElement;this.isFromInternalAction=!0,this.collapse({completeCallback(){e.contains(t)&&this.activeElementBeforeExpanded&&this.activeElementBeforeExpanded.focus()}})}}}}();this.inserter=new t(Ee(this.id),{}),e.section.add(this.inserter),this.sectionInstance=e.section(this.section()),this.inspector=this.sectionInstance.inspector,this.sidebarAdapter=new We(this.setting,e)}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}onChangeSectionExpanded(e,t){t.unchanged||(e||(0,l.dispatch)(N).setIsInserterOpened(!1),this.subscribers.forEach((s=>s(e,t))))}}}const Me=(0,g.createHigherOrderComponent)((e=>t=>{let s=(0,a.getWidgetIdFromBlock)(t);const i=function(){const{sidebarControls:e}=(0,n.useContext)(ye);return e}(),r=function(){const{activeSidebarControl:e}=(0,n.useContext)(ye);return e}(),o=i?.length>1,c=t.name,d=t.clientId,u=(0,l.useSelect)((e=>e(m.store).canInsertBlockType(c,"")),[c]),h=(0,l.useSelect)((e=>e(m.store).getBlock(d)),[d]),{removeBlock:p}=(0,l.useDispatch)(m.store),[,g]=ae();return(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(e,{...t},"edit"),o&&u&&(0,w.jsx)(m.BlockControls,{children:(0,w.jsx)(a.MoveToWidgetArea,{widgetAreas:i.map((e=>({id:e.id,name:e.params.label,description:e.params.description}))),currentWidgetAreaId:r?.id,onSelect:function(e){const t=i.find((t=>t.id===e));if(s){const e=r.setting,i=t.setting;e(e().filter((e=>e!==s))),i([...i(),s])}else{const e=t.sidebarAdapter;p(d);const i=e.setWidgets([...e.getWidgets(),ie(h)]);s=i.reverse().find((e=>!!e))}g(s)}})})]})}),"withMoveToSidebarToolbarItem");(0,b.addFilter)("editor.BlockEdit","core/customize-widgets/block-edit",Me);(0,b.addFilter)("editor.MediaUpload","core/edit-widgets/replace-media-upload",(()=>y.MediaUpload));const{wp:Oe}=window,Te=(0,g.createHigherOrderComponent)((e=>t=>{var s;const{idBase:i}=t.attributes,r=null!==(s=Oe.customize.Widgets.data.availableWidgets.find((e=>e.id_base===i))?.is_wide)&&void 0!==s&&s;return(0,w.jsx)(e,{...t,isWide:r},"edit")}),"withWideWidgetDisplay");(0,b.addFilter)("editor.BlockEdit","core/customize-widgets/wide-widget-display",Te);const{wp:Pe}=window,Ne=["core/more","core/block","core/freeform","core/template-part"];function Fe(e,t){(0,l.dispatch)(u.store).setDefaults("core/customize-widgets",{fixedToolbar:!1,welcomeGuide:!0}),(0,l.dispatch)(d.store).reapplyBlockTypeFilters();const s=(0,c.__experimentalGetCoreBlocks)().filter((e=>!(Ne.includes(e.name)||e.name.startsWith("core/post")||e.name.startsWith("core/query")||e.name.startsWith("core/site")||e.name.startsWith("core/navigation"))));(0,c.registerCoreBlocks)(s),(0,a.registerLegacyWidgetBlock)(),(0,a.registerLegacyWidgetVariations)(t),(0,a.registerWidgetGroupBlock)(),(0,d.setFreeformContentHandlerName)("core/html");const i=Ae();Pe.customize.sectionConstructor.sidebar=Se(),Pe.customize.controlConstructor.sidebar_block_editor=i;const r=document.createElement("div");document.body.appendChild(r),Pe.customize.bind("ready",(()=>{const e=[];Pe.customize.control.each((t=>{t instanceof i&&e.push(t)})),(0,n.createRoot)(r).render((0,w.jsx)(n.StrictMode,{children:(0,w.jsx)(ve,{api:Pe.customize,sidebarControls:e,blockEditorSettings:t})}))}))}(window.wp=window.wp||{}).customizeWidgets=i})(); \ No newline at end of file +(()=>{"use strict";var e={7734:e=>{e.exports=function e(t,s){if(t===s)return!0;if(t&&s&&"object"==typeof t&&"object"==typeof s){if(t.constructor!==s.constructor)return!1;var i,r,o;if(Array.isArray(t)){if((i=t.length)!=s.length)return!1;for(r=i;0!=r--;)if(!e(t[r],s[r]))return!1;return!0}if(t instanceof Map&&s instanceof Map){if(t.size!==s.size)return!1;for(r of t.entries())if(!s.has(r[0]))return!1;for(r of t.entries())if(!e(r[1],s.get(r[0])))return!1;return!0}if(t instanceof Set&&s instanceof Set){if(t.size!==s.size)return!1;for(r of t.entries())if(!s.has(r[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(s)){if((i=t.length)!=s.length)return!1;for(r=i;0!=r--;)if(t[r]!==s[r])return!1;return!0}if(t.constructor===RegExp)return t.source===s.source&&t.flags===s.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===s.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===s.toString();if((i=(o=Object.keys(t)).length)!==Object.keys(s).length)return!1;for(r=i;0!=r--;)if(!Object.prototype.hasOwnProperty.call(s,o[r]))return!1;for(r=i;0!=r--;){var n=o[r];if(!e(t[n],s[n]))return!1}return!0}return t!=t&&s!=s}}},t={};function s(i){var r=t[i];if(void 0!==r)return r.exports;var o=t[i]={exports:{}};return e[i](o,o.exports,s),o.exports}s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.d=(e,t)=>{for(var i in t)s.o(t,i)&&!s.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};s.r(i),s.d(i,{initialize:()=>Fe,store:()=>N});var r={};s.r(r),s.d(r,{__experimentalGetInsertionPoint:()=>O,isInserterOpened:()=>M});var o={};s.r(o),s.d(o,{setIsInserterOpened:()=>T});const n=window.wp.element,c=window.wp.blockLibrary,a=window.wp.widgets,d=window.wp.blocks,l=window.wp.data,u=window.wp.preferences,h=window.wp.components,p=window.wp.i18n,m=window.wp.blockEditor,g=window.wp.compose,b=window.wp.hooks,w=window.ReactJSXRuntime;function f({text:e,children:t}){const s=(0,g.useCopyToClipboard)(e);return(0,w.jsx)(h.Button,{size:"compact",variant:"secondary",ref:s,children:t})}class _ extends n.Component{constructor(){super(...arguments),this.state={error:null}}componentDidCatch(e){this.setState({error:e}),(0,b.doAction)("editor.ErrorBoundary.errorLogged",e)}render(){const{error:e}=this.state;return e?(0,w.jsx)(m.Warning,{className:"customize-widgets-error-boundary",actions:[(0,w.jsx)(f,{text:e.stack,children:(0,p.__)("Copy Error")},"copy-error")],children:(0,p.__)("The editor has encountered an unexpected error.")}):this.props.children}}const x=window.wp.coreData,y=window.wp.mediaUtils;const k=function({inspector:e,closeMenu:t,...s}){const i=(0,l.useSelect)((e=>e(m.store).getSelectedBlockClientId()),[]),r=(0,n.useMemo)((()=>document.getElementById(`block-${i}`)),[i]);return(0,w.jsx)(h.MenuItem,{onClick:()=>{e.open({returnFocusWhenClose:r}),t()},...s,children:(0,p.__)("Show more settings")})};function v(e){var t,s,i="";if("string"==typeof e||"number"==typeof e)i+=e;else if("object"==typeof e)if(Array.isArray(e)){var r=e.length;for(t=0;te(N).__experimentalGetInsertionPoint()),[]);return(0,w.jsxs)("div",{className:"customize-widgets-layout__inserter-panel","aria-labelledby":s,children:[(0,w.jsxs)("div",{className:"customize-widgets-layout__inserter-panel-header",children:[(0,w.jsx)("h2",{id:s,className:"customize-widgets-layout__inserter-panel-header-title",children:(0,p.__)("Add a block")}),(0,w.jsx)(h.Button,{size:"small",icon:B,onClick:()=>t(!1),"aria-label":(0,p.__)("Close inserter")})]}),(0,w.jsx)("div",{className:"customize-widgets-layout__inserter-panel-content",children:(0,w.jsx)(m.__experimentalLibrary,{rootClientId:i.rootClientId,__experimentalInsertionIndex:i.insertionIndex,showInserterHelpPanel:!0,onSelect:()=>t(!1)})})]})},L=(0,w.jsx)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,w.jsx)(j.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"})}),D=(0,w.jsx)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,w.jsx)(j.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"})}),H=window.wp.keyboardShortcuts,R=[{keyCombination:{modifier:"primary",character:"b"},description:(0,p.__)("Make the selected text bold.")},{keyCombination:{modifier:"primary",character:"i"},description:(0,p.__)("Make the selected text italic.")},{keyCombination:{modifier:"primary",character:"k"},description:(0,p.__)("Convert the selected text into a link.")},{keyCombination:{modifier:"primaryShift",character:"k"},description:(0,p.__)("Remove a link.")},{keyCombination:{character:"[["},description:(0,p.__)("Insert a link to a post or page.")},{keyCombination:{modifier:"primary",character:"u"},description:(0,p.__)("Underline the selected text.")},{keyCombination:{modifier:"access",character:"d"},description:(0,p.__)("Strikethrough the selected text.")},{keyCombination:{modifier:"access",character:"x"},description:(0,p.__)("Make the selected text inline code.")},{keyCombination:{modifier:"access",character:"0"},aliases:[{modifier:"access",character:"7"}],description:(0,p.__)("Convert the current heading to a paragraph.")},{keyCombination:{modifier:"access",character:"1-6"},description:(0,p.__)("Convert the current paragraph or heading to a heading of level 1 to 6.")},{keyCombination:{modifier:"primaryShift",character:"SPACE"},description:(0,p.__)("Add non breaking space.")}];function G({keyCombination:e,forceAriaLabel:t}){const s=e.modifier?S.displayShortcutList[e.modifier](e.character):e.character,i=e.modifier?S.shortcutAriaLabel[e.modifier](e.character):e.character;return(0,w.jsx)("kbd",{className:"customize-widgets-keyboard-shortcut-help-modal__shortcut-key-combination","aria-label":t||i,children:(Array.isArray(s)?s:[s]).map(((e,t)=>"+"===e?(0,w.jsx)(n.Fragment,{children:e},t):(0,w.jsx)("kbd",{className:"customize-widgets-keyboard-shortcut-help-modal__shortcut-key",children:e},t)))})}const V=function({description:e,keyCombination:t,aliases:s=[],ariaLabel:i}){return(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)("div",{className:"customize-widgets-keyboard-shortcut-help-modal__shortcut-description",children:e}),(0,w.jsxs)("div",{className:"customize-widgets-keyboard-shortcut-help-modal__shortcut-term",children:[(0,w.jsx)(G,{keyCombination:t,forceAriaLabel:i}),s.map(((e,t)=>(0,w.jsx)(G,{keyCombination:e,forceAriaLabel:i},t)))]})]})};const U=function({name:e}){const{keyCombination:t,description:s,aliases:i}=(0,l.useSelect)((t=>{const{getShortcutKeyCombination:s,getShortcutDescription:i,getShortcutAliases:r}=t(H.store);return{keyCombination:s(e),aliases:r(e),description:i(e)}}),[e]);return t?(0,w.jsx)(V,{keyCombination:t,description:s,aliases:i}):null},$=({shortcuts:e})=>(0,w.jsx)("ul",{className:"customize-widgets-keyboard-shortcut-help-modal__shortcut-list",role:"list",children:e.map(((e,t)=>(0,w.jsx)("li",{className:"customize-widgets-keyboard-shortcut-help-modal__shortcut",children:"string"==typeof e?(0,w.jsx)(U,{name:e}):(0,w.jsx)(V,{...e})},t)))}),q=({title:e,shortcuts:t,className:s})=>(0,w.jsxs)("section",{className:C("customize-widgets-keyboard-shortcut-help-modal__section",s),children:[!!e&&(0,w.jsx)("h2",{className:"customize-widgets-keyboard-shortcut-help-modal__section-title",children:e}),(0,w.jsx)($,{shortcuts:t})]}),K=({title:e,categoryName:t,additionalShortcuts:s=[]})=>{const i=(0,l.useSelect)((e=>e(H.store).getCategoryShortcuts(t)),[t]);return(0,w.jsx)(q,{title:e,shortcuts:i.concat(s)})};function Z({isModalActive:e,toggleModal:t}){const{registerShortcut:s}=(0,l.useDispatch)(H.store);return s({name:"core/customize-widgets/keyboard-shortcuts",category:"main",description:(0,p.__)("Display these keyboard shortcuts."),keyCombination:{modifier:"access",character:"h"}}),(0,H.useShortcut)("core/customize-widgets/keyboard-shortcuts",t),e?(0,w.jsxs)(h.Modal,{className:"customize-widgets-keyboard-shortcut-help-modal",title:(0,p.__)("Keyboard shortcuts"),onRequestClose:t,children:[(0,w.jsx)(q,{className:"customize-widgets-keyboard-shortcut-help-modal__main-shortcuts",shortcuts:["core/customize-widgets/keyboard-shortcuts"]}),(0,w.jsx)(K,{title:(0,p.__)("Global shortcuts"),categoryName:"global"}),(0,w.jsx)(K,{title:(0,p.__)("Selection shortcuts"),categoryName:"selection"}),(0,w.jsx)(K,{title:(0,p.__)("Block shortcuts"),categoryName:"block",additionalShortcuts:[{keyCombination:{character:"/"},description:(0,p.__)("Change the block type after adding a new paragraph."),ariaLabel:(0,p.__)("Forward-slash")}]}),(0,w.jsx)(q,{title:(0,p.__)("Text formatting"),shortcuts:R})]}):null}function Y(){const[e,t]=(0,n.useState)(!1),s=()=>t(!e);return(0,H.useShortcut)("core/customize-widgets/keyboard-shortcuts",s),(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(h.ToolbarDropdownMenu,{icon:L,label:(0,p.__)("Options"),popoverProps:{placement:"bottom-end",className:"more-menu-dropdown__content"},toggleProps:{tooltipPosition:"bottom",size:"compact"},children:()=>(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(h.MenuGroup,{label:(0,p._x)("View","noun"),children:(0,w.jsx)(u.PreferenceToggleMenuItem,{scope:"core/customize-widgets",name:"fixedToolbar",label:(0,p.__)("Top toolbar"),info:(0,p.__)("Access all block and document tools in a single place"),messageActivated:(0,p.__)("Top toolbar activated"),messageDeactivated:(0,p.__)("Top toolbar deactivated")})}),(0,w.jsxs)(h.MenuGroup,{label:(0,p.__)("Tools"),children:[(0,w.jsx)(h.MenuItem,{onClick:()=>{t(!0)},shortcut:S.displayShortcut.access("h"),children:(0,p.__)("Keyboard shortcuts")}),(0,w.jsx)(u.PreferenceToggleMenuItem,{scope:"core/customize-widgets",name:"welcomeGuide",label:(0,p.__)("Welcome Guide")}),(0,w.jsxs)(h.MenuItem,{role:"menuitem",icon:D,href:(0,p.__)("https://wordpress.org/documentation/article/block-based-widgets-editor/"),target:"_blank",rel:"noopener noreferrer",children:[(0,p.__)("Help"),(0,w.jsx)(h.VisuallyHidden,{as:"span",children:(0,p.__)("(opens in a new tab)")})]})]}),(0,w.jsx)(h.MenuGroup,{label:(0,p.__)("Preferences"),children:(0,w.jsx)(u.PreferenceToggleMenuItem,{scope:"core/customize-widgets",name:"keepCaretInsideBlock",label:(0,p.__)("Contain text cursor inside block"),info:(0,p.__)("Aids screen readers by stopping text caret from leaving blocks."),messageActivated:(0,p.__)("Contain text cursor inside block activated"),messageDeactivated:(0,p.__)("Contain text cursor inside block deactivated")})})]})}),(0,w.jsx)(Z,{isModalActive:e,toggleModal:s})]})}const J=function({sidebar:e,inserter:t,isInserterOpened:s,setIsInserterOpened:i,isFixedToolbarActive:r}){const[[o,c],a]=(0,n.useState)([e.hasUndo(),e.hasRedo()]),d=(0,S.isAppleOS)()?S.displayShortcut.primaryShift("z"):S.displayShortcut.primary("y");return(0,n.useEffect)((()=>e.subscribeHistory((()=>{a([e.hasUndo(),e.hasRedo()])}))),[e]),(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)("div",{className:C("customize-widgets-header",{"is-fixed-toolbar-active":r}),children:(0,w.jsxs)(m.NavigableToolbar,{className:"customize-widgets-header-toolbar","aria-label":(0,p.__)("Document tools"),children:[(0,w.jsx)(h.ToolbarButton,{icon:(0,p.isRTL)()?z:I,label:(0,p.__)("Undo"),shortcut:S.displayShortcut.primary("z"),disabled:!o,onClick:e.undo,className:"customize-widgets-editor-history-button undo-button"}),(0,w.jsx)(h.ToolbarButton,{icon:(0,p.isRTL)()?I:z,label:(0,p.__)("Redo"),shortcut:d,disabled:!c,onClick:e.redo,className:"customize-widgets-editor-history-button redo-button"}),(0,w.jsx)(h.ToolbarButton,{className:"customize-widgets-header-toolbar__inserter-toggle",isPressed:s,variant:"primary",icon:W,label:(0,p._x)("Add block","Generic label for block inserter button"),onClick:()=>{i((e=>!e))}}),(0,w.jsx)(Y,{})]})}),(0,n.createPortal)((0,w.jsx)(F,{setIsOpened:i}),t.contentContainer[0])]})};var X=s(7734),Q=s.n(X);const ee=window.wp.isShallowEqual;var te=s.n(ee);function se(e){const t=e.match(/^widget_(.+)(?:\[(\d+)\])$/);if(t){return`${t[1]}-${parseInt(t[2],10)}`}return e}function ie(e,t=null){let s;if("core/legacy-widget"===e.name&&(e.attributes.id||e.attributes.instance))if(e.attributes.id)s={id:e.attributes.id};else{const{encoded:i,hash:r,raw:o,...n}=e.attributes.instance;s={idBase:e.attributes.idBase,instance:{...t?.instance,is_widget_customizer_js_value:!0,encoded_serialized_instance:i,instance_hash_key:r,raw_instance:o,...n}}}else{s={idBase:"block",widgetClass:"WP_Widget_Block",instance:{raw_instance:{content:(0,d.serialize)(e)}}}}const{form:i,rendered:r,...o}=t||{};return{...o,...s}}function re({id:e,idBase:t,number:s,instance:i}){let r;const{encoded_serialized_instance:o,instance_hash_key:n,raw_instance:c,...l}=i;if("block"===t){var u;const e=(0,d.parse)(null!==(u=c.content)&&void 0!==u?u:"",{__unstableSkipAutop:!0});r=e.length?e[0]:(0,d.createBlock)("core/paragraph",{})}else r=s?(0,d.createBlock)("core/legacy-widget",{idBase:t,instance:{encoded:o,hash:n,raw:c,...l}}):(0,d.createBlock)("core/legacy-widget",{id:e});return(0,a.addWidgetIdToBlock)(r,e)}function oe(e){const[t,s]=(0,n.useState)((()=>e.getWidgets().map((e=>re(e)))));(0,n.useEffect)((()=>e.subscribe(((e,t)=>{s((s=>{const i=new Map(e.map((e=>[e.id,e]))),r=new Map(s.map((e=>[(0,a.getWidgetIdFromBlock)(e),e]))),o=t.map((e=>{const t=i.get(e.id);return t&&t===e?r.get(e.id):re(e)}));return te()(s,o)?s:o}))}))),[e]);const i=(0,n.useCallback)((t=>{s((s=>{if(te()(s,t))return s;const i=new Map(s.map((e=>[(0,a.getWidgetIdFromBlock)(e),e]))),r=t.map((t=>{const s=(0,a.getWidgetIdFromBlock)(t);if(s&&i.has(s)){const r=i.get(s),o=e.getWidget(s);return Q()(t,r)&&o?o:ie(t,o)}return ie(t)}));if(te()(e.getWidgets(),r))return s;const o=e.setWidgets(r);return t.reduce(((e,s,i)=>{const r=o[i];return null!==r&&(e===t&&(e=t.slice()),e[i]=(0,a.addWidgetIdToBlock)(s,r)),e}),t)}))}),[e]);return[t,i,i]}const ne=(0,n.createContext)();function ce({api:e,sidebarControls:t,children:s}){const[i,r]=(0,n.useState)({current:null}),o=(0,n.useCallback)((e=>{for(const s of t){if(s.setting.get().includes(e)){s.sectionInstance.expand({completeCallback(){r({current:e})}});break}}}),[t]);(0,n.useEffect)((()=>{function t(e){const t=se(e);o(t)}let s=!1;function i(){e.previewer.preview.bind("focus-control-for-setting",t),s=!0}return e.previewer.bind("ready",i),()=>{e.previewer.unbind("ready",i),s&&e.previewer.preview.unbind("focus-control-for-setting",t)}}),[e,o]);const c=(0,n.useMemo)((()=>[i,o]),[i,o]);return(0,w.jsx)(ne.Provider,{value:c,children:s})}const ae=()=>(0,n.useContext)(ne);const de=window.wp.privateApis,{lock:le,unlock:ue}=(0,de.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/customize-widgets"),{ExperimentalBlockEditorProvider:he}=ue(m.privateApis);function pe({sidebar:e,settings:t,children:s}){const[i,r,o]=oe(e);return function(e){const{selectBlock:t}=(0,l.useDispatch)(m.store),[s]=ae(),i=(0,n.useRef)(e);(0,n.useEffect)((()=>{i.current=e}),[e]),(0,n.useEffect)((()=>{if(s.current){const e=i.current.find((e=>(0,a.getWidgetIdFromBlock)(e)===s.current));if(e){t(e.clientId);const s=document.querySelector(`[data-block="${e.clientId}"]`);s?.focus()}}}),[s,t])}(i),(0,w.jsx)(he,{value:i,onInput:r,onChange:o,settings:t,useSubRegistry:!1,children:s})}function me({sidebar:e}){const{toggle:t}=(0,l.useDispatch)(u.store),s=e.getWidgets().every((e=>e.id.startsWith("block-")));return(0,w.jsxs)("div",{className:"customize-widgets-welcome-guide",children:[(0,w.jsx)("div",{className:"customize-widgets-welcome-guide__image__wrapper",children:(0,w.jsxs)("picture",{children:[(0,w.jsx)("source",{srcSet:"https://s.w.org/images/block-editor/welcome-editor.svg",media:"(prefers-reduced-motion: reduce)"}),(0,w.jsx)("img",{className:"customize-widgets-welcome-guide__image",src:"https://s.w.org/images/block-editor/welcome-editor.gif",width:"312",height:"240",alt:""})]})}),(0,w.jsx)("h1",{className:"customize-widgets-welcome-guide__heading",children:(0,p.__)("Welcome to block Widgets")}),(0,w.jsx)("p",{className:"customize-widgets-welcome-guide__text",children:s?(0,p.__)("Your theme provides different “block” areas for you to add and edit content. Try adding a search bar, social icons, or other types of blocks here and see how they’ll look on your site."):(0,p.__)("You can now add any block to your site’s widget areas. Don’t worry, all of your favorite widgets still work flawlessly.")}),(0,w.jsx)(h.Button,{size:"compact",variant:"primary",onClick:()=>t("core/customize-widgets","welcomeGuide"),children:(0,p.__)("Got it")}),(0,w.jsx)("hr",{className:"customize-widgets-welcome-guide__separator"}),!s&&(0,w.jsxs)("p",{className:"customize-widgets-welcome-guide__more-info",children:[(0,p.__)("Want to stick with the old widgets?"),(0,w.jsx)("br",{}),(0,w.jsx)(h.ExternalLink,{href:(0,p.__)("https://wordpress.org/plugins/classic-widgets/"),children:(0,p.__)("Get the Classic Widgets plugin.")})]}),(0,w.jsxs)("p",{className:"customize-widgets-welcome-guide__more-info",children:[(0,p.__)("New to the block editor?"),(0,w.jsx)("br",{}),(0,w.jsx)(h.ExternalLink,{href:(0,p.__)("https://wordpress.org/documentation/article/wordpress-block-editor/"),children:(0,p.__)("Here's a detailed guide.")})]})]})}function ge({undo:e,redo:t,save:s}){return(0,H.useShortcut)("core/customize-widgets/undo",(t=>{e(),t.preventDefault()})),(0,H.useShortcut)("core/customize-widgets/redo",(e=>{t(),e.preventDefault()})),(0,H.useShortcut)("core/customize-widgets/save",(e=>{e.preventDefault(),s()})),null}ge.Register=function(){const{registerShortcut:e,unregisterShortcut:t}=(0,l.useDispatch)(H.store);return(0,n.useEffect)((()=>(e({name:"core/customize-widgets/undo",category:"global",description:(0,p.__)("Undo your last changes."),keyCombination:{modifier:"primary",character:"z"}}),e({name:"core/customize-widgets/redo",category:"global",description:(0,p.__)("Redo your last undo."),keyCombination:{modifier:"primaryShift",character:"z"},aliases:(0,S.isAppleOS)()?[]:[{modifier:"primary",character:"y"}]}),e({name:"core/customize-widgets/save",category:"global",description:(0,p.__)("Save your changes."),keyCombination:{modifier:"primary",character:"s"}}),()=>{t("core/customize-widgets/undo"),t("core/customize-widgets/redo"),t("core/customize-widgets/save")})),[e]),null};const be=ge;function we(e){const t=(0,n.useRef)(),s=(0,l.useSelect)((e=>0===e(m.store).getBlockCount()));return(0,n.useEffect)((()=>{if(s&&t.current){const{ownerDocument:e}=t.current;e.activeElement&&e.activeElement!==e.body||t.current.focus()}}),[s]),(0,w.jsx)(m.ButtonBlockAppender,{...e,ref:t})}const{ExperimentalBlockCanvas:fe}=ue(m.privateApis),{BlockKeyboardShortcuts:_e}=ue(c.privateApis);function xe({blockEditorSettings:e,sidebar:t,inserter:s,inspector:i}){const[r,o]=function(e){const t=(0,l.useSelect)((e=>e(N).isInserterOpened()),[]),{setIsInserterOpened:s}=(0,l.useDispatch)(N);return(0,n.useEffect)((()=>{t?e.open():e.close()}),[e,t]),[t,(0,n.useCallback)((e=>{let t=e;"function"==typeof e&&(t=e((0,l.select)(N).isInserterOpened())),s(t)}),[s])]}(s),c=(0,g.useViewportMatch)("small"),{hasUploadPermissions:a,isFixedToolbarActive:d,keepCaretInsideBlock:h,isWelcomeGuideActive:p}=(0,l.useSelect)((e=>{var t;const{get:s}=e(u.store);return{hasUploadPermissions:null===(t=e(x.store).canUser("create",{kind:"root",name:"media"}))||void 0===t||t,isFixedToolbarActive:!!s("core/customize-widgets","fixedToolbar"),keepCaretInsideBlock:!!s("core/customize-widgets","keepCaretInsideBlock"),isWelcomeGuideActive:!!s("core/customize-widgets","welcomeGuide")}}),[]),b=(0,n.useMemo)((()=>{let t;return a&&(t=({onError:t,...s})=>{(0,y.uploadMedia)({wpAllowedMimeTypes:e.allowedMimeTypes,onError:({message:e})=>t(e),...s})}),{...e,__experimentalSetIsInserterOpened:o,mediaUpload:t,hasFixedToolbar:d||!c,keepCaretInsideBlock:h,editorTool:"edit",__unstableHasCustomAppender:!0}}),[a,e,d,c,h,o]);return p?(0,w.jsx)(me,{sidebar:t}):(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(be.Register,{}),(0,w.jsx)(_e,{}),(0,w.jsxs)(pe,{sidebar:t,settings:b,children:[(0,w.jsx)(be,{undo:t.undo,redo:t.redo,save:t.save}),(0,w.jsx)(J,{sidebar:t,inserter:s,isInserterOpened:r,setIsInserterOpened:o,isFixedToolbarActive:d||!c}),(d||!c)&&(0,w.jsx)(m.BlockToolbar,{hideDragHandle:!0}),(0,w.jsx)(fe,{shouldIframe:!1,styles:b.defaultEditorStyles,height:"100%",children:(0,w.jsx)(m.BlockList,{renderAppender:we})}),(0,n.createPortal)((0,w.jsx)("form",{onSubmit:e=>e.preventDefault(),children:(0,w.jsx)(m.BlockInspector,{})}),i.contentContainer[0])]}),(0,w.jsx)(m.__unstableBlockSettingsMenuFirstItem,{children:({onClose:e})=>(0,w.jsx)(k,{inspector:i,closeMenu:e})})]})}const ye=(0,n.createContext)();function ke({sidebarControls:e,activeSidebarControl:t,children:s}){const i=(0,n.useMemo)((()=>({sidebarControls:e,activeSidebarControl:t})),[e,t]);return(0,w.jsx)(ye.Provider,{value:i,children:s})}function ve({api:e,sidebarControls:t,blockEditorSettings:s}){const[i,r]=(0,n.useState)(null),o=document.getElementById("customize-theme-controls"),c=(0,n.useRef)();!function(e,t){const{hasSelectedBlock:s,hasMultiSelection:i}=(0,l.useSelect)(m.store),{clearSelectedBlock:r}=(0,l.useDispatch)(m.store);(0,n.useEffect)((()=>{if(t.current&&e){const o=e.inspector,n=e.container[0],c=n.ownerDocument,a=c.defaultView;function d(e){!s()&&!i()||!e||!c.contains(e)||n.contains(e)||t.current.contains(e)||e.closest('[role="dialog"]')||o.expanded()||r()}function l(e){d(e.target)}function u(){d(c.activeElement)}return c.addEventListener("mousedown",l),a.addEventListener("blur",u),()=>{c.removeEventListener("mousedown",l),a.removeEventListener("blur",u)}}}),[t,e,s,i,r])}(i,c),(0,n.useEffect)((()=>{const e=t.map((e=>e.subscribe((t=>{t&&r(e)}))));return()=>{e.forEach((e=>e()))}}),[t]);const a=i&&(0,n.createPortal)((0,w.jsx)(_,{children:(0,w.jsx)(xe,{blockEditorSettings:s,sidebar:i.sidebarAdapter,inserter:i.inserter,inspector:i.inspector},i.id)}),i.container[0]),d=o&&(0,n.createPortal)((0,w.jsx)("div",{className:"customize-widgets-popover",ref:c,children:(0,w.jsx)(h.Popover.Slot,{})}),o);return(0,w.jsx)(h.SlotFillProvider,{children:(0,w.jsx)(ke,{sidebarControls:t,activeSidebarControl:i,children:(0,w.jsxs)(ce,{api:e,sidebarControls:t,children:[a,d]})})})}const Ce=e=>`widgets-inspector-${e}`;function Se(){const{wp:{customize:e}}=window,t=window.matchMedia("(prefers-reduced-motion: reduce)");let s=t.matches;return t.addEventListener("change",(e=>{s=e.matches})),class extends e.Section{ready(){const t=function(){const{wp:{customize:e}}=window;return class extends e.Section{constructor(e,t){super(e,t),this.parentSection=t.parentSection,this.returnFocusWhenClose=null,this._isOpen=!1}get isOpen(){return this._isOpen}set isOpen(e){this._isOpen=e,this.triggerActiveCallbacks()}ready(){this.contentContainer[0].classList.add("customize-widgets-layout__inspector")}isContextuallyActive(){return this.isOpen}onChangeExpanded(e,t){super.onChangeExpanded(e,t),this.parentSection&&!t.unchanged&&(e?this.parentSection.collapse({manualTransition:!0}):this.parentSection.expand({manualTransition:!0,completeCallback:()=>{this.returnFocusWhenClose&&!this.contentContainer[0].contains(this.returnFocusWhenClose)&&this.returnFocusWhenClose.focus()}}))}open({returnFocusWhenClose:e}={}){this.isOpen=!0,this.returnFocusWhenClose=e,this.expand({allowMultiple:!0})}close(){this.collapse({allowMultiple:!0})}collapse(e){this.isOpen=!1,super.collapse(e)}triggerActiveCallbacks(){this.active.callbacks.fireWith(this.active,[!1,!0])}}}();this.inspector=new t(Ce(this.id),{title:(0,p.__)("Block Settings"),parentSection:this,customizeAction:[(0,p.__)("Customizing"),(0,p.__)("Widgets"),this.params.title].join(" ▸ ")}),e.section.add(this.inspector),this.contentContainer[0].classList.add("customize-widgets__sidebar-section")}hasSubSectionOpened(){return this.inspector.expanded()}onChangeExpanded(e,t){const i=this.controls(),r={...t,completeCallback(){i.forEach((t=>{t.onChangeSectionExpanded?.(e,r)})),t.completeCallback?.()}};if(r.manualTransition){e?(this.contentContainer.addClass(["busy","open"]),this.contentContainer.removeClass("is-sub-section-open"),this.contentContainer.closest(".wp-full-overlay").addClass("section-open")):(this.contentContainer.addClass(["busy","is-sub-section-open"]),this.contentContainer.closest(".wp-full-overlay").addClass("section-open"),this.contentContainer.removeClass("open"));const t=()=>{this.contentContainer.removeClass("busy"),r.completeCallback()};s?t():this.contentContainer.one("transitionend",t)}else super.onChangeExpanded(e,r)}}}const{wp:je}=window;function Ie(e){const t=e.match(/^(.+)-(\d+)$/);return t?{idBase:t[1],number:parseInt(t[2],10)}:{idBase:e}}function ze(e){const{idBase:t,number:s}=Ie(e);return s?`widget_${t}[${s}]`:`widget_${t}`}class We{constructor(e,t){this.setting=e,this.api=t,this.locked=!1,this.widgetsCache=new WeakMap,this.subscribers=new Set,this.history=[this._getWidgetIds().map((e=>this.getWidget(e)))],this.historyIndex=0,this.historySubscribers=new Set,this._debounceSetHistory=function(e,t,s){let i,r=!1;function o(...o){const n=(r?t:e).apply(this,o);return r=!0,clearTimeout(i),i=setTimeout((()=>{r=!1}),s),n}return o.cancel=()=>{r=!1,clearTimeout(i)},o}(this._pushHistory,this._replaceHistory,1e3),this.setting.bind(this._handleSettingChange.bind(this)),this.api.bind("change",this._handleAllSettingsChange.bind(this)),this.undo=this.undo.bind(this),this.redo=this.redo.bind(this),this.save=this.save.bind(this)}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}getWidgets(){return this.history[this.historyIndex]}_emit(...e){for(const t of this.subscribers)t(...e)}_getWidgetIds(){return this.setting.get()}_pushHistory(){this.history=[...this.history.slice(0,this.historyIndex+1),this._getWidgetIds().map((e=>this.getWidget(e)))],this.historyIndex+=1,this.historySubscribers.forEach((e=>e()))}_replaceHistory(){this.history[this.historyIndex]=this._getWidgetIds().map((e=>this.getWidget(e)))}_handleSettingChange(){if(this.locked)return;const e=this.getWidgets();this._pushHistory(),this._emit(e,this.getWidgets())}_handleAllSettingsChange(e){if(this.locked)return;if(!e.id.startsWith("widget_"))return;const t=se(e.id);if(!this.setting.get().includes(t))return;const s=this.getWidgets();this._pushHistory(),this._emit(s,this.getWidgets())}_createWidget(e){const t=je.customize.Widgets.availableWidgets.findWhere({id_base:e.idBase});let s=e.number;t.get("is_multi")&&!s&&(t.set("multi_number",t.get("multi_number")+1),s=t.get("multi_number"));const i=s?`widget_${e.idBase}[${s}]`:`widget_${e.idBase}`,r={transport:je.customize.Widgets.data.selectiveRefreshableWidgets[t.get("id_base")]?"postMessage":"refresh",previewer:this.setting.previewer};this.api.create(i,i,"",r).set(e.instance);return se(i)}_removeWidget(e){const t=ze(e.id),s=this.api(t);if(s){const e=s.get();this.widgetsCache.delete(e)}this.api.remove(t)}_updateWidget(e){const t=this.getWidget(e.id);if(t===e)return e.id;if(t.idBase&&e.idBase&&t.idBase===e.idBase){const t=ze(e.id);return this.api(t).set(e.instance),e.id}return this._removeWidget(e),this._createWidget(e)}getWidget(e){if(!e)return null;const{idBase:t,number:s}=Ie(e),i=ze(e),r=this.api(i);if(!r)return null;const o=r.get();if(this.widgetsCache.has(o))return this.widgetsCache.get(o);const n={id:e,idBase:t,number:s,instance:o};return this.widgetsCache.set(o,n),n}_updateWidgets(e){this.locked=!0;const t=[],s=e.map((e=>{if(e.id&&this.getWidget(e.id))return t.push(null),this._updateWidget(e);const s=this._createWidget(e);return t.push(s),s}));return this.getWidgets().filter((e=>!s.includes(e.id))).forEach((e=>this._removeWidget(e))),this.setting.set(s),this.locked=!1,t}setWidgets(e){const t=this._updateWidgets(e);return this._debounceSetHistory(),t}hasUndo(){return this.historyIndex>0}hasRedo(){return this.historyIndexe())),this._debounceSetHistory.cancel()}undo(){this.hasUndo()&&this._seek(this.historyIndex-1)}redo(){this.hasRedo()&&this._seek(this.historyIndex+1)}subscribeHistory(e){return this.historySubscribers.add(e),()=>{this.historySubscribers.delete(e)}}save(){this.api.previewer.save()}}const Be=window.wp.dom;const Ee=e=>`widgets-inserter-${e}`;function Ae(){const{wp:{customize:e}}=window;return class extends e.Control{constructor(...e){super(...e),this.subscribers=new Set}ready(){const t=function(){const{wp:{customize:e}}=window,t=e.OuterSection;return e.OuterSection=class extends t{onChangeExpanded(t,s){return t&&e.section.each((e=>{"outer"===e.params.type&&e.id!==this.id&&e.expanded()&&e.collapse()})),super.onChangeExpanded(t,s)}},e.sectionConstructor.outer=e.OuterSection,class extends e.OuterSection{constructor(...e){super(...e),this.params.type="outer",this.activeElementBeforeExpanded=null,this.contentContainer[0].ownerDocument.defaultView.addEventListener("keydown",(e=>{!this.expanded()||e.keyCode!==S.ESCAPE&&"Escape"!==e.code||e.defaultPrevented||(e.preventDefault(),e.stopPropagation(),(0,l.dispatch)(N).setIsInserterOpened(!1))}),!0),this.contentContainer.addClass("widgets-inserter"),this.isFromInternalAction=!1,this.expanded.bind((()=>{this.isFromInternalAction||(0,l.dispatch)(N).setIsInserterOpened(this.expanded()),this.isFromInternalAction=!1}))}open(){if(!this.expanded()){const e=this.contentContainer[0];this.activeElementBeforeExpanded=e.ownerDocument.activeElement,this.isFromInternalAction=!0,this.expand({completeCallback(){const t=Be.focus.tabbable.find(e)[1];t&&t.focus()}})}}close(){if(this.expanded()){const e=this.contentContainer[0],t=e.ownerDocument.activeElement;this.isFromInternalAction=!0,this.collapse({completeCallback(){e.contains(t)&&this.activeElementBeforeExpanded&&this.activeElementBeforeExpanded.focus()}})}}}}();this.inserter=new t(Ee(this.id),{}),e.section.add(this.inserter),this.sectionInstance=e.section(this.section()),this.inspector=this.sectionInstance.inspector,this.sidebarAdapter=new We(this.setting,e)}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}onChangeSectionExpanded(e,t){t.unchanged||(e||(0,l.dispatch)(N).setIsInserterOpened(!1),this.subscribers.forEach((s=>s(e,t))))}}}const Me=(0,g.createHigherOrderComponent)((e=>t=>{let s=(0,a.getWidgetIdFromBlock)(t);const i=function(){const{sidebarControls:e}=(0,n.useContext)(ye);return e}(),r=function(){const{activeSidebarControl:e}=(0,n.useContext)(ye);return e}(),o=i?.length>1,c=t.name,d=t.clientId,u=(0,l.useSelect)((e=>e(m.store).canInsertBlockType(c,"")),[c]),h=(0,l.useSelect)((e=>e(m.store).getBlock(d)),[d]),{removeBlock:p}=(0,l.useDispatch)(m.store),[,g]=ae();return(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(e,{...t},"edit"),o&&u&&(0,w.jsx)(m.BlockControls,{children:(0,w.jsx)(a.MoveToWidgetArea,{widgetAreas:i.map((e=>({id:e.id,name:e.params.label,description:e.params.description}))),currentWidgetAreaId:r?.id,onSelect:function(e){const t=i.find((t=>t.id===e));if(s){const e=r.setting,i=t.setting;e(e().filter((e=>e!==s))),i([...i(),s])}else{const e=t.sidebarAdapter;p(d);const i=e.setWidgets([...e.getWidgets(),ie(h)]);s=i.reverse().find((e=>!!e))}g(s)}})})]})}),"withMoveToSidebarToolbarItem");(0,b.addFilter)("editor.BlockEdit","core/customize-widgets/block-edit",Me);(0,b.addFilter)("editor.MediaUpload","core/edit-widgets/replace-media-upload",(()=>y.MediaUpload));const{wp:Oe}=window,Te=(0,g.createHigherOrderComponent)((e=>t=>{var s;const{idBase:i}=t.attributes,r=null!==(s=Oe.customize.Widgets.data.availableWidgets.find((e=>e.id_base===i))?.is_wide)&&void 0!==s&&s;return(0,w.jsx)(e,{...t,isWide:r},"edit")}),"withWideWidgetDisplay");(0,b.addFilter)("editor.BlockEdit","core/customize-widgets/wide-widget-display",Te);const{wp:Pe}=window,Ne=["core/more","core/block","core/freeform","core/template-part"];function Fe(e,t){(0,l.dispatch)(u.store).setDefaults("core/customize-widgets",{fixedToolbar:!1,welcomeGuide:!0}),(0,l.dispatch)(d.store).reapplyBlockTypeFilters();const s=(0,c.__experimentalGetCoreBlocks)().filter((e=>!(Ne.includes(e.name)||e.name.startsWith("core/post")||e.name.startsWith("core/query")||e.name.startsWith("core/site")||e.name.startsWith("core/navigation"))));(0,c.registerCoreBlocks)(s),(0,a.registerLegacyWidgetBlock)(),(0,a.registerLegacyWidgetVariations)(t),(0,a.registerWidgetGroupBlock)(),(0,d.setFreeformContentHandlerName)("core/html");const i=Ae();Pe.customize.sectionConstructor.sidebar=Se(),Pe.customize.controlConstructor.sidebar_block_editor=i;const r=document.createElement("div");document.body.appendChild(r),Pe.customize.bind("ready",(()=>{const e=[];Pe.customize.control.each((t=>{t instanceof i&&e.push(t)})),(0,n.createRoot)(r).render((0,w.jsx)(n.StrictMode,{children:(0,w.jsx)(ve,{api:Pe.customize,sidebarControls:e,blockEditorSettings:t})}))}))}(window.wp=window.wp||{}).customizeWidgets=i})(); \ No newline at end of file diff --git a/wp-includes/js/dist/data-controls.js b/wp-includes/js/dist/data-controls.js index bd39f88aba..6bd75961f8 100644 --- a/wp-includes/js/dist/data-controls.js +++ b/wp-includes/js/dist/data-controls.js @@ -202,9 +202,11 @@ const __unstableAwaitPromise = function (promise) { * store. */ const controls = { - AWAIT_PROMISE: ({ + AWAIT_PROMISE({ promise - }) => promise, + }) { + return promise; + }, API_FETCH({ request }) { diff --git a/wp-includes/js/dist/data.js b/wp-includes/js/dist/data.js index 65c6a2bef0..d55f7b115c 100644 --- a/wp-includes/js/dist/data.js +++ b/wp-includes/js/dist/data.js @@ -600,767 +600,381 @@ __webpack_require__.d(plugins_namespaceObject, { ;// external ["wp","deprecated"] const external_wp_deprecated_namespaceObject = window["wp"]["deprecated"]; var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject); -;// ./node_modules/@babel/runtime/helpers/esm/typeof.js -function _typeof(o) { - "@babel/helpers - typeof"; - - return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { - return typeof o; - } : function (o) { - return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; - }, _typeof(o); -} -;// ./node_modules/@babel/runtime/helpers/esm/toPrimitive.js - -function _toPrimitive(input, hint) { - if (_typeof(input) !== "object" || input === null) return input; - var prim = input[Symbol.toPrimitive]; - if (prim !== undefined) { - var res = prim.call(input, hint || "default"); - if (_typeof(res) !== "object") return res; - throw new TypeError("@@toPrimitive must return a primitive value."); - } - return (hint === "string" ? String : Number)(input); -} -;// ./node_modules/@babel/runtime/helpers/esm/toPropertyKey.js - - -function _toPropertyKey(arg) { - var key = _toPrimitive(arg, "string"); - return _typeof(key) === "symbol" ? key : String(key); -} -;// ./node_modules/@babel/runtime/helpers/esm/defineProperty.js - -function _defineProperty(obj, key, value) { - key = _toPropertyKey(key); - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - return obj; -} -;// ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js - -function ownKeys(e, r) { - var t = Object.keys(e); - if (Object.getOwnPropertySymbols) { - var o = Object.getOwnPropertySymbols(e); - r && (o = o.filter(function (r) { - return Object.getOwnPropertyDescriptor(e, r).enumerable; - })), t.push.apply(t, o); - } - return t; -} -function _objectSpread2(e) { - for (var r = 1; r < arguments.length; r++) { - var t = null != arguments[r] ? arguments[r] : {}; - r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { - _defineProperty(e, r, t[r]); - }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { - Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); - }); - } - return e; -} -;// ./node_modules/redux/es/redux.js - - -/** - * Adapted from React: https://github.com/facebook/react/blob/master/packages/shared/formatProdErrorMessage.js - * - * Do not require this module directly! Use normal throw error calls. These messages will be replaced with error codes - * during build. - * @param {number} code - */ +;// ./node_modules/redux/dist/redux.mjs +// src/utils/formatProdErrorMessage.ts function formatProdErrorMessage(code) { - return "Minified Redux error #" + code + "; visit https://redux.js.org/Errors?code=" + code + " for the full message or " + 'use the non-minified dev environment for full errors. '; + return `Minified Redux error #${code}; visit https://redux.js.org/Errors?code=${code} for the full message or use the non-minified dev environment for full errors. `; } -// Inlined version of the `symbol-observable` polyfill -var $$observable = (function () { - return typeof Symbol === 'function' && Symbol.observable || '@@observable'; -})(); - -/** - * These are private action types reserved by Redux. - * For any unknown actions, you must return the current state. - * If the current state is undefined, you must return the initial state. - * Do not reference these action types directly in your code. - */ -var randomString = function randomString() { - return Math.random().toString(36).substring(7).split('').join('.'); -}; +// src/utils/symbol-observable.ts +var $$observable = /* @__PURE__ */ (() => typeof Symbol === "function" && Symbol.observable || "@@observable")(); +var symbol_observable_default = $$observable; +// src/utils/actionTypes.ts +var randomString = () => Math.random().toString(36).substring(7).split("").join("."); var ActionTypes = { - INIT: "@@redux/INIT" + randomString(), - REPLACE: "@@redux/REPLACE" + randomString(), - PROBE_UNKNOWN_ACTION: function PROBE_UNKNOWN_ACTION() { - return "@@redux/PROBE_UNKNOWN_ACTION" + randomString(); - } + INIT: `@@redux/INIT${/* @__PURE__ */ randomString()}`, + REPLACE: `@@redux/REPLACE${/* @__PURE__ */ randomString()}`, + PROBE_UNKNOWN_ACTION: () => `@@redux/PROBE_UNKNOWN_ACTION${randomString()}` }; +var actionTypes_default = ActionTypes; -/** - * @param {any} obj The object to inspect. - * @returns {boolean} True if the argument appears to be a plain object. - */ +// src/utils/isPlainObject.ts function isPlainObject(obj) { - if (typeof obj !== 'object' || obj === null) return false; - var proto = obj; - + if (typeof obj !== "object" || obj === null) + return false; + let proto = obj; while (Object.getPrototypeOf(proto) !== null) { proto = Object.getPrototypeOf(proto); } - - return Object.getPrototypeOf(obj) === proto; + return Object.getPrototypeOf(obj) === proto || Object.getPrototypeOf(obj) === null; } -// Inlined / shortened version of `kindOf` from https://github.com/jonschlinkert/kind-of +// src/utils/kindOf.ts function miniKindOf(val) { - if (val === void 0) return 'undefined'; - if (val === null) return 'null'; - var type = typeof val; - + if (val === void 0) + return "undefined"; + if (val === null) + return "null"; + const type = typeof val; switch (type) { - case 'boolean': - case 'string': - case 'number': - case 'symbol': - case 'function': - { - return type; - } + case "boolean": + case "string": + case "number": + case "symbol": + case "function": { + return type; + } } - - if (Array.isArray(val)) return 'array'; - if (isDate(val)) return 'date'; - if (isError(val)) return 'error'; - var constructorName = ctorName(val); - + if (Array.isArray(val)) + return "array"; + if (isDate(val)) + return "date"; + if (isError(val)) + return "error"; + const constructorName = ctorName(val); switch (constructorName) { - case 'Symbol': - case 'Promise': - case 'WeakMap': - case 'WeakSet': - case 'Map': - case 'Set': + case "Symbol": + case "Promise": + case "WeakMap": + case "WeakSet": + case "Map": + case "Set": return constructorName; - } // other - - - return type.slice(8, -1).toLowerCase().replace(/\s/g, ''); + } + return Object.prototype.toString.call(val).slice(8, -1).toLowerCase().replace(/\s/g, ""); } - function ctorName(val) { - return typeof val.constructor === 'function' ? val.constructor.name : null; + return typeof val.constructor === "function" ? val.constructor.name : null; } - function isError(val) { - return val instanceof Error || typeof val.message === 'string' && val.constructor && typeof val.constructor.stackTraceLimit === 'number'; + return val instanceof Error || typeof val.message === "string" && val.constructor && typeof val.constructor.stackTraceLimit === "number"; } - function isDate(val) { - if (val instanceof Date) return true; - return typeof val.toDateString === 'function' && typeof val.getDate === 'function' && typeof val.setDate === 'function'; + if (val instanceof Date) + return true; + return typeof val.toDateString === "function" && typeof val.getDate === "function" && typeof val.setDate === "function"; } - function kindOf(val) { - var typeOfVal = typeof val; - + let typeOfVal = typeof val; if (false) {} - return typeOfVal; } -/** - * @deprecated - * - * **We recommend using the `configureStore` method - * of the `@reduxjs/toolkit` package**, which replaces `createStore`. - * - * Redux Toolkit is our recommended approach for writing Redux logic today, - * including store setup, reducers, data fetching, and more. - * - * **For more details, please read this Redux docs page:** - * **https://redux.js.org/introduction/why-rtk-is-redux-today** - * - * `configureStore` from Redux Toolkit is an improved version of `createStore` that - * simplifies setup and helps avoid common bugs. - * - * You should not be using the `redux` core package by itself today, except for learning purposes. - * The `createStore` method from the core `redux` package will not be removed, but we encourage - * all users to migrate to using Redux Toolkit for all Redux code. - * - * If you want to use `createStore` without this visual deprecation warning, use - * the `legacy_createStore` import instead: - * - * `import { legacy_createStore as createStore} from 'redux'` - * - */ - +// src/createStore.ts function createStore(reducer, preloadedState, enhancer) { - var _ref2; - - if (typeof preloadedState === 'function' && typeof enhancer === 'function' || typeof enhancer === 'function' && typeof arguments[3] === 'function') { - throw new Error( true ? formatProdErrorMessage(0) : 0); - } - - if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') { - enhancer = preloadedState; - preloadedState = undefined; - } - - if (typeof enhancer !== 'undefined') { - if (typeof enhancer !== 'function') { - throw new Error( true ? formatProdErrorMessage(1) : 0); - } - - return enhancer(createStore)(reducer, preloadedState); - } - - if (typeof reducer !== 'function') { + if (typeof reducer !== "function") { throw new Error( true ? formatProdErrorMessage(2) : 0); } - - var currentReducer = reducer; - var currentState = preloadedState; - var currentListeners = []; - var nextListeners = currentListeners; - var isDispatching = false; - /** - * This makes a shallow copy of currentListeners so we can use - * nextListeners as a temporary list while dispatching. - * - * This prevents any bugs around consumers calling - * subscribe/unsubscribe in the middle of a dispatch. - */ - + if (typeof preloadedState === "function" && typeof enhancer === "function" || typeof enhancer === "function" && typeof arguments[3] === "function") { + throw new Error( true ? formatProdErrorMessage(0) : 0); + } + if (typeof preloadedState === "function" && typeof enhancer === "undefined") { + enhancer = preloadedState; + preloadedState = void 0; + } + if (typeof enhancer !== "undefined") { + if (typeof enhancer !== "function") { + throw new Error( true ? formatProdErrorMessage(1) : 0); + } + return enhancer(createStore)(reducer, preloadedState); + } + let currentReducer = reducer; + let currentState = preloadedState; + let currentListeners = /* @__PURE__ */ new Map(); + let nextListeners = currentListeners; + let listenerIdCounter = 0; + let isDispatching = false; function ensureCanMutateNextListeners() { if (nextListeners === currentListeners) { - nextListeners = currentListeners.slice(); + nextListeners = /* @__PURE__ */ new Map(); + currentListeners.forEach((listener, key) => { + nextListeners.set(key, listener); + }); } } - /** - * Reads the state tree managed by the store. - * - * @returns {any} The current state tree of your application. - */ - - function getState() { if (isDispatching) { throw new Error( true ? formatProdErrorMessage(3) : 0); } - return currentState; } - /** - * Adds a change listener. It will be called any time an action is dispatched, - * and some part of the state tree may potentially have changed. You may then - * call `getState()` to read the current state tree inside the callback. - * - * You may call `dispatch()` from a change listener, with the following - * caveats: - * - * 1. The subscriptions are snapshotted just before every `dispatch()` call. - * If you subscribe or unsubscribe while the listeners are being invoked, this - * will not have any effect on the `dispatch()` that is currently in progress. - * However, the next `dispatch()` call, whether nested or not, will use a more - * recent snapshot of the subscription list. - * - * 2. The listener should not expect to see all state changes, as the state - * might have been updated multiple times during a nested `dispatch()` before - * the listener is called. It is, however, guaranteed that all subscribers - * registered before the `dispatch()` started will be called with the latest - * state by the time it exits. - * - * @param {Function} listener A callback to be invoked on every dispatch. - * @returns {Function} A function to remove this change listener. - */ - - function subscribe(listener) { - if (typeof listener !== 'function') { + if (typeof listener !== "function") { throw new Error( true ? formatProdErrorMessage(4) : 0); } - if (isDispatching) { throw new Error( true ? formatProdErrorMessage(5) : 0); } - - var isSubscribed = true; + let isSubscribed = true; ensureCanMutateNextListeners(); - nextListeners.push(listener); + const listenerId = listenerIdCounter++; + nextListeners.set(listenerId, listener); return function unsubscribe() { if (!isSubscribed) { return; } - if (isDispatching) { throw new Error( true ? formatProdErrorMessage(6) : 0); } - isSubscribed = false; ensureCanMutateNextListeners(); - var index = nextListeners.indexOf(listener); - nextListeners.splice(index, 1); + nextListeners.delete(listenerId); currentListeners = null; }; } - /** - * Dispatches an action. It is the only way to trigger a state change. - * - * The `reducer` function, used to create the store, will be called with the - * current state tree and the given `action`. Its return value will - * be considered the **next** state of the tree, and the change listeners - * will be notified. - * - * The base implementation only supports plain object actions. If you want to - * dispatch a Promise, an Observable, a thunk, or something else, you need to - * wrap your store creating function into the corresponding middleware. For - * example, see the documentation for the `redux-thunk` package. Even the - * middleware will eventually dispatch plain object actions using this method. - * - * @param {Object} action A plain object representing “what changed”. It is - * a good idea to keep actions serializable so you can record and replay user - * sessions, or use the time travelling `redux-devtools`. An action must have - * a `type` property which may not be `undefined`. It is a good idea to use - * string constants for action types. - * - * @returns {Object} For convenience, the same action object you dispatched. - * - * Note that, if you use a custom middleware, it may wrap `dispatch()` to - * return something else (for example, a Promise you can await). - */ - - function dispatch(action) { if (!isPlainObject(action)) { throw new Error( true ? formatProdErrorMessage(7) : 0); } - - if (typeof action.type === 'undefined') { + if (typeof action.type === "undefined") { throw new Error( true ? formatProdErrorMessage(8) : 0); } - + if (typeof action.type !== "string") { + throw new Error( true ? formatProdErrorMessage(17) : 0); + } if (isDispatching) { throw new Error( true ? formatProdErrorMessage(9) : 0); } - try { isDispatching = true; currentState = currentReducer(currentState, action); } finally { isDispatching = false; } - - var listeners = currentListeners = nextListeners; - - for (var i = 0; i < listeners.length; i++) { - var listener = listeners[i]; + const listeners = currentListeners = nextListeners; + listeners.forEach((listener) => { listener(); - } - + }); return action; } - /** - * Replaces the reducer currently used by the store to calculate the state. - * - * You might need this if your app implements code splitting and you want to - * load some of the reducers dynamically. You might also need this if you - * implement a hot reloading mechanism for Redux. - * - * @param {Function} nextReducer The reducer for the store to use instead. - * @returns {void} - */ - - function replaceReducer(nextReducer) { - if (typeof nextReducer !== 'function') { + if (typeof nextReducer !== "function") { throw new Error( true ? formatProdErrorMessage(10) : 0); } - - currentReducer = nextReducer; // This action has a similiar effect to ActionTypes.INIT. - // Any reducers that existed in both the new and old rootReducer - // will receive the previous state. This effectively populates - // the new state tree with any relevant data from the old one. - + currentReducer = nextReducer; dispatch({ - type: ActionTypes.REPLACE + type: actionTypes_default.REPLACE }); } - /** - * Interoperability point for observable/reactive libraries. - * @returns {observable} A minimal observable of state changes. - * For more information, see the observable proposal: - * https://github.com/tc39/proposal-observable - */ - - function observable() { - var _ref; - - var outerSubscribe = subscribe; - return _ref = { + const outerSubscribe = subscribe; + return { /** * The minimal observable subscription method. - * @param {Object} observer Any object that can be used as an observer. + * @param observer Any object that can be used as an observer. * The observer object should have a `next` method. - * @returns {subscription} An object with an `unsubscribe` method that can + * @returns An object with an `unsubscribe` method that can * be used to unsubscribe the observable from the store, and prevent further * emission of values from the observable. */ - subscribe: function subscribe(observer) { - if (typeof observer !== 'object' || observer === null) { + subscribe(observer) { + if (typeof observer !== "object" || observer === null) { throw new Error( true ? formatProdErrorMessage(11) : 0); } - function observeState() { - if (observer.next) { - observer.next(getState()); + const observerAsObserver = observer; + if (observerAsObserver.next) { + observerAsObserver.next(getState()); } } - observeState(); - var unsubscribe = outerSubscribe(observeState); + const unsubscribe = outerSubscribe(observeState); return { - unsubscribe: unsubscribe + unsubscribe }; + }, + [symbol_observable_default]() { + return this; } - }, _ref[$$observable] = function () { - return this; - }, _ref; - } // When a store is created, an "INIT" action is dispatched so that every - // reducer returns their initial state. This effectively populates - // the initial state tree. - - + }; + } dispatch({ - type: ActionTypes.INIT + type: actionTypes_default.INIT }); - return _ref2 = { - dispatch: dispatch, - subscribe: subscribe, - getState: getState, - replaceReducer: replaceReducer - }, _ref2[$$observable] = observable, _ref2; + const store = { + dispatch, + subscribe, + getState, + replaceReducer, + [symbol_observable_default]: observable + }; + return store; +} +function legacy_createStore(reducer, preloadedState, enhancer) { + return createStore(reducer, preloadedState, enhancer); } -/** - * Creates a Redux store that holds the state tree. - * - * **We recommend using `configureStore` from the - * `@reduxjs/toolkit` package**, which replaces `createStore`: - * **https://redux.js.org/introduction/why-rtk-is-redux-today** - * - * The only way to change the data in the store is to call `dispatch()` on it. - * - * There should only be a single store in your app. To specify how different - * parts of the state tree respond to actions, you may combine several reducers - * into a single reducer function by using `combineReducers`. - * - * @param {Function} reducer A function that returns the next state tree, given - * the current state tree and the action to handle. - * - * @param {any} [preloadedState] The initial state. You may optionally specify it - * to hydrate the state from the server in universal apps, or to restore a - * previously serialized user session. - * If you use `combineReducers` to produce the root reducer function, this must be - * an object with the same shape as `combineReducers` keys. - * - * @param {Function} [enhancer] The store enhancer. You may optionally specify it - * to enhance the store with third-party capabilities such as middleware, - * time travel, persistence, etc. The only store enhancer that ships with Redux - * is `applyMiddleware()`. - * - * @returns {Store} A Redux store that lets you read the state, dispatch actions - * and subscribe to changes. - */ -var legacy_createStore = (/* unused pure expression or super */ null && (createStore)); - -/** - * Prints a warning in the console if it exists. - * - * @param {String} message The warning message. - * @returns {void} - */ +// src/utils/warning.ts function warning(message) { - /* eslint-disable no-console */ - if (typeof console !== 'undefined' && typeof console.error === 'function') { + if (typeof console !== "undefined" && typeof console.error === "function") { console.error(message); } - /* eslint-enable no-console */ - - try { - // This error was thrown as a convenience so that if you enable - // "break on all exceptions" in your console, - // it would pause the execution at this line. throw new Error(message); - } catch (e) {} // eslint-disable-line no-empty - + } catch (e) { + } } +// src/combineReducers.ts function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) { - var reducerKeys = Object.keys(reducers); - var argumentName = action && action.type === ActionTypes.INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer'; - + const reducerKeys = Object.keys(reducers); + const argumentName = action && action.type === actionTypes_default.INIT ? "preloadedState argument passed to createStore" : "previous state received by the reducer"; if (reducerKeys.length === 0) { - return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.'; + return "Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers."; } - if (!isPlainObject(inputState)) { - return "The " + argumentName + " has unexpected type of \"" + kindOf(inputState) + "\". Expected argument to be an object with the following " + ("keys: \"" + reducerKeys.join('", "') + "\""); + return `The ${argumentName} has unexpected type of "${kindOf(inputState)}". Expected argument to be an object with the following keys: "${reducerKeys.join('", "')}"`; } - - var unexpectedKeys = Object.keys(inputState).filter(function (key) { - return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key]; - }); - unexpectedKeys.forEach(function (key) { + const unexpectedKeys = Object.keys(inputState).filter((key) => !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key]); + unexpectedKeys.forEach((key) => { unexpectedKeyCache[key] = true; }); - if (action && action.type === ActionTypes.REPLACE) return; - + if (action && action.type === actionTypes_default.REPLACE) + return; if (unexpectedKeys.length > 0) { - return "Unexpected " + (unexpectedKeys.length > 1 ? 'keys' : 'key') + " " + ("\"" + unexpectedKeys.join('", "') + "\" found in " + argumentName + ". ") + "Expected to find one of the known reducer keys instead: " + ("\"" + reducerKeys.join('", "') + "\". Unexpected keys will be ignored."); + return `Unexpected ${unexpectedKeys.length > 1 ? "keys" : "key"} "${unexpectedKeys.join('", "')}" found in ${argumentName}. Expected to find one of the known reducer keys instead: "${reducerKeys.join('", "')}". Unexpected keys will be ignored.`; } } - function assertReducerShape(reducers) { - Object.keys(reducers).forEach(function (key) { - var reducer = reducers[key]; - var initialState = reducer(undefined, { - type: ActionTypes.INIT + Object.keys(reducers).forEach((key) => { + const reducer = reducers[key]; + const initialState = reducer(void 0, { + type: actionTypes_default.INIT }); - - if (typeof initialState === 'undefined') { + if (typeof initialState === "undefined") { throw new Error( true ? formatProdErrorMessage(12) : 0); } - - if (typeof reducer(undefined, { - type: ActionTypes.PROBE_UNKNOWN_ACTION() - }) === 'undefined') { + if (typeof reducer(void 0, { + type: actionTypes_default.PROBE_UNKNOWN_ACTION() + }) === "undefined") { throw new Error( true ? formatProdErrorMessage(13) : 0); } }); } -/** - * Turns an object whose values are different reducer functions, into a single - * reducer function. It will call every child reducer, and gather their results - * into a single state object, whose keys correspond to the keys of the passed - * reducer functions. - * - * @param {Object} reducers An object whose values correspond to different - * reducer functions that need to be combined into one. One handy way to obtain - * it is to use ES6 `import * as reducers` syntax. The reducers may never return - * undefined for any action. Instead, they should return their initial state - * if the state passed to them was undefined, and the current state for any - * unrecognized action. - * - * @returns {Function} A reducer function that invokes every reducer inside the - * passed object, and builds a state object with the same shape. - */ - - function combineReducers(reducers) { - var reducerKeys = Object.keys(reducers); - var finalReducers = {}; - - for (var i = 0; i < reducerKeys.length; i++) { - var key = reducerKeys[i]; - + const reducerKeys = Object.keys(reducers); + const finalReducers = {}; + for (let i = 0; i < reducerKeys.length; i++) { + const key = reducerKeys[i]; if (false) {} - - if (typeof reducers[key] === 'function') { + if (typeof reducers[key] === "function") { finalReducers[key] = reducers[key]; } } - - var finalReducerKeys = Object.keys(finalReducers); // This is used to make sure we don't warn about the same - // keys multiple times. - - var unexpectedKeyCache; - + const finalReducerKeys = Object.keys(finalReducers); + let unexpectedKeyCache; if (false) {} - - var shapeAssertionError; - + let shapeAssertionError; try { assertReducerShape(finalReducers); } catch (e) { shapeAssertionError = e; } - - return function combination(state, action) { - if (state === void 0) { - state = {}; - } - + return function combination(state = {}, action) { if (shapeAssertionError) { throw shapeAssertionError; } - - if (false) { var warningMessage; } - - var hasChanged = false; - var nextState = {}; - - for (var _i = 0; _i < finalReducerKeys.length; _i++) { - var _key = finalReducerKeys[_i]; - var reducer = finalReducers[_key]; - var previousStateForKey = state[_key]; - var nextStateForKey = reducer(previousStateForKey, action); - - if (typeof nextStateForKey === 'undefined') { - var actionType = action && action.type; + if (false) {} + let hasChanged = false; + const nextState = {}; + for (let i = 0; i < finalReducerKeys.length; i++) { + const key = finalReducerKeys[i]; + const reducer = finalReducers[key]; + const previousStateForKey = state[key]; + const nextStateForKey = reducer(previousStateForKey, action); + if (typeof nextStateForKey === "undefined") { + const actionType = action && action.type; throw new Error( true ? formatProdErrorMessage(14) : 0); } - - nextState[_key] = nextStateForKey; + nextState[key] = nextStateForKey; hasChanged = hasChanged || nextStateForKey !== previousStateForKey; } - hasChanged = hasChanged || finalReducerKeys.length !== Object.keys(state).length; return hasChanged ? nextState : state; }; } +// src/bindActionCreators.ts function bindActionCreator(actionCreator, dispatch) { - return function () { - return dispatch(actionCreator.apply(this, arguments)); + return function(...args) { + return dispatch(actionCreator.apply(this, args)); }; } -/** - * Turns an object whose values are action creators, into an object with the - * same keys, but with every function wrapped into a `dispatch` call so they - * may be invoked directly. This is just a convenience method, as you can call - * `store.dispatch(MyActionCreators.doSomething())` yourself just fine. - * - * For convenience, you can also pass an action creator as the first argument, - * and get a dispatch wrapped function in return. - * - * @param {Function|Object} actionCreators An object whose values are action - * creator functions. One handy way to obtain it is to use ES6 `import * as` - * syntax. You may also pass a single function. - * - * @param {Function} dispatch The `dispatch` function available on your Redux - * store. - * - * @returns {Function|Object} The object mimicking the original object, but with - * every action creator wrapped into the `dispatch` call. If you passed a - * function as `actionCreators`, the return value will also be a single - * function. - */ - - function bindActionCreators(actionCreators, dispatch) { - if (typeof actionCreators === 'function') { + if (typeof actionCreators === "function") { return bindActionCreator(actionCreators, dispatch); } - - if (typeof actionCreators !== 'object' || actionCreators === null) { + if (typeof actionCreators !== "object" || actionCreators === null) { throw new Error( true ? formatProdErrorMessage(16) : 0); } - - var boundActionCreators = {}; - - for (var key in actionCreators) { - var actionCreator = actionCreators[key]; - - if (typeof actionCreator === 'function') { + const boundActionCreators = {}; + for (const key in actionCreators) { + const actionCreator = actionCreators[key]; + if (typeof actionCreator === "function") { boundActionCreators[key] = bindActionCreator(actionCreator, dispatch); } } - return boundActionCreators; } -/** - * Composes single-argument functions from right to left. The rightmost - * function can take multiple arguments as it provides the signature for - * the resulting composite function. - * - * @param {...Function} funcs The functions to compose. - * @returns {Function} A function obtained by composing the argument functions - * from right to left. For example, compose(f, g, h) is identical to doing - * (...args) => f(g(h(...args))). - */ -function compose() { - for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) { - funcs[_key] = arguments[_key]; - } - +// src/compose.ts +function compose(...funcs) { if (funcs.length === 0) { - return function (arg) { - return arg; - }; + return (arg) => arg; } - if (funcs.length === 1) { return funcs[0]; } - - return funcs.reduce(function (a, b) { - return function () { - return a(b.apply(void 0, arguments)); - }; - }); + return funcs.reduce((a, b) => (...args) => a(b(...args))); } -/** - * Creates a store enhancer that applies middleware to the dispatch method - * of the Redux store. This is handy for a variety of tasks, such as expressing - * asynchronous actions in a concise manner, or logging every action payload. - * - * See `redux-thunk` package as an example of the Redux middleware. - * - * Because middleware is potentially asynchronous, this should be the first - * store enhancer in the composition chain. - * - * Note that each middleware will be given the `dispatch` and `getState` functions - * as named arguments. - * - * @param {...Function} middlewares The middleware chain to be applied. - * @returns {Function} A store enhancer applying the middleware. - */ - -function applyMiddleware() { - for (var _len = arguments.length, middlewares = new Array(_len), _key = 0; _key < _len; _key++) { - middlewares[_key] = arguments[_key]; - } - - return function (createStore) { - return function () { - var store = createStore.apply(void 0, arguments); - - var _dispatch = function dispatch() { - throw new Error( true ? formatProdErrorMessage(15) : 0); - }; - - var middlewareAPI = { - getState: store.getState, - dispatch: function dispatch() { - return _dispatch.apply(void 0, arguments); - } - }; - var chain = middlewares.map(function (middleware) { - return middleware(middlewareAPI); - }); - _dispatch = compose.apply(void 0, chain)(store.dispatch); - return _objectSpread2(_objectSpread2({}, store), {}, { - dispatch: _dispatch - }); +// src/applyMiddleware.ts +function applyMiddleware(...middlewares) { + return (createStore2) => (reducer, preloadedState) => { + const store = createStore2(reducer, preloadedState); + let dispatch = () => { + throw new Error( true ? formatProdErrorMessage(15) : 0); + }; + const middlewareAPI = { + getState: store.getState, + dispatch: (action, ...args) => dispatch(action, ...args) + }; + const chain = middlewares.map((middleware) => middleware(middlewareAPI)); + dispatch = compose(...chain)(store.dispatch); + return { + ...store, + dispatch }; }; } +// src/utils/isAction.ts +function isAction(action) { + return isPlainObject(action) && "type" in action && typeof action.type === "string"; +} - +//# sourceMappingURL=redux.mjs.map // EXTERNAL MODULE: ./node_modules/equivalent-key-map/equivalent-key-map.js var equivalent_key_map = __webpack_require__(3249); var equivalent_key_map_default = /*#__PURE__*/__webpack_require__.n(equivalent_key_map); @@ -1387,6 +1001,10 @@ function combine_reducers_combineReducers(reducers) { } ;// ./node_modules/@wordpress/data/build-module/factory.js +/** + * Internal dependencies + */ + /** * Creates a selector function that takes additional curried argument with the * registry `select` function. While a regular selector has signature @@ -1422,10 +1040,10 @@ function combine_reducers_combineReducers(reducers) { * registry as argument. The registry binding happens automatically when registering the selector * with a store. * - * @param {Function} registrySelector Function receiving a registry `select` - * function and returning a state selector. + * @param registrySelector Function receiving a registry `select` + * function and returning a state selector. * - * @return {Function} Registry selector that can be registered with a store. + * @return Registry selector that can be registered with a store. */ function createRegistrySelector(registrySelector) { const selectorsByRegistry = new WeakMap(); @@ -1449,8 +1067,6 @@ function createRegistrySelector(registrySelector) { * Flag indicating that the selector is a registry selector that needs the correct registry * reference to be assigned to `selector.registry` to make it work correctly. * be mapped as a registry selector. - * - * @type {boolean} */ wrappedSelector.isRegistrySelector = true; return wrappedSelector; @@ -1472,9 +1088,9 @@ function createRegistrySelector(registrySelector) { * When registering a control created with `createRegistryControl` with a store, the store * knows which calling convention to use when executing the control. * - * @param {Function} registryControl Function receiving a registry object and returning a control. + * @param registryControl Function receiving a registry object and returning a control. * - * @return {Function} Registry control that can be registered with a store. + * @return Registry control that can be registered with a store. */ function createRegistryControl(registryControl) { registryControl.isRegistryControl = true; @@ -1656,6 +1272,7 @@ const promiseMiddleware = () => next => action => { /* harmony default export */ const promise_middleware = (promiseMiddleware); ;// ./node_modules/@wordpress/data/build-module/resolvers-cache-middleware.js +/* wp:polyfill */ /** @typedef {import('./registry').WPDataRegistry} WPDataRegistry */ /** @@ -1761,6 +1378,7 @@ function selectorArgsToStateKey(args) { } ;// ./node_modules/@wordpress/data/build-module/redux-store/metadata/reducer.js +/* wp:polyfill */ /** * External dependencies */ @@ -2185,6 +1803,7 @@ function isShallowEqual(a, b, fromIndex) { } ;// ./node_modules/@wordpress/data/build-module/redux-store/metadata/selectors.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -2534,6 +2153,7 @@ function invalidateResolutionForStoreSelector(selectorName) { } ;// ./node_modules/@wordpress/data/build-module/redux-store/index.js +/* wp:polyfill */ /** * External dependencies */ @@ -2750,7 +2370,7 @@ function createReduxStore(key, options) { }; // Expose normalization method on the bound selector - // in order that it can be called when fullfilling + // in order that it can be called when fulfilling // the resolver. boundSelector.__unstableNormalizeArgs = selector.__unstableNormalizeArgs; const resolver = resolvers[selectorName]; @@ -3095,10 +2715,11 @@ const coreDataStore = { /* harmony default export */ const store = (coreDataStore); ;// ./node_modules/@wordpress/data/build-module/utils/emitter.js +/* wp:polyfill */ /** * Create an event emitter. * - * @return {import("../types").DataEmitter} Emitter. + * @return The event emitter. */ function createEmitter() { let isPaused = false; @@ -3138,6 +2759,7 @@ function createEmitter() { } ;// ./node_modules/@wordpress/data/build-module/registry.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -3187,7 +2809,7 @@ function getStoreName(storeNameOrDescriptor) { * configurations. * * @param {Object} storeConfigs Initial store configurations. - * @param {Object?} parent Parent registry. + * @param {?Object} parent Parent registry. * * @return {WPDataRegistry} Data registry. */ @@ -3584,6 +3206,7 @@ try { /* harmony default export */ const storage_default = (default_storage); ;// ./node_modules/@wordpress/data/build-module/plugins/persistence/index.js +/* wp:polyfill */ /** * External dependencies */ @@ -3973,6 +3596,7 @@ function useAsyncMode() { } ;// ./node_modules/@wordpress/data/build-module/components/use-select/index.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -3986,6 +3610,15 @@ function useAsyncMode() { const renderQueue = (0,external_wp_priorityQueue_namespaceObject.createQueue)(); +function warnOnUnstableReference(a, b) { + if (!a || !b) { + return; + } + const keys = typeof a === 'object' && typeof b === 'object' ? Object.keys(a).filter(k => a[k] !== b[k]) : []; + + // eslint-disable-next-line no-console + console.warn('The `useSelect` hook returns different values when called with the same state and parameters.\n' + 'This can lead to unnecessary re-renders and performance issues if not fixed.\n\n' + 'Non-equal value keys: %s\n\n', keys.join(', ')); +} /** * @typedef {import('../../types').StoreDescriptor} StoreDescriptor @@ -4109,7 +3742,15 @@ function Store(registry, suspense) { current: null }; const mapResult = registry.__unstableMarkListeningStores(() => mapSelect(select, registry), listeningStores); - if (false) {} + if (true) { + if (!didWarnUnstableReference) { + const secondMapResult = mapSelect(select, registry); + if (!external_wp_isShallowEqual_default()(mapResult, secondMapResult)) { + warnOnUnstableReference(mapResult, secondMapResult); + didWarnUnstableReference = true; + } + } + } if (!subscriber) { for (const name of listeningStores.current) { storeStatesOnMount.set(name, getStoreState(name)); @@ -4150,17 +3791,16 @@ function Store(registry, suspense) { }; }; } -function useStaticSelect(storeName) { +function _useStaticSelect(storeName) { return useRegistry().select(storeName); } -function useMappingSelect(suspense, mapSelect, deps) { +function _useMappingSelect(suspense, mapSelect, deps) { const registry = useRegistry(); const isAsync = useAsyncMode(); const store = (0,external_wp_element_namespaceObject.useMemo)(() => Store(registry, suspense), [registry, suspense]); // These are "pass-through" dependencies from the parent hook, // and the parent should catch any hook rule violations. - // eslint-disable-next-line react-hooks/exhaustive-deps const selector = (0,external_wp_element_namespaceObject.useCallback)(mapSelect, deps); const { subscribe, @@ -4246,11 +3886,9 @@ function useSelect(mapSelect, deps) { throw new Error(`Switching useSelect from ${prevMode} to ${nextMode} is not allowed`); } - /* eslint-disable react-hooks/rules-of-hooks */ // `staticSelectMode` is not allowed to change during the hook instance's, // lifetime, so the rules of hooks are not really violated. - return staticSelectMode ? useStaticSelect(mapSelect) : useMappingSelect(false, mapSelect, deps); - /* eslint-enable react-hooks/rules-of-hooks */ + return staticSelectMode ? _useStaticSelect(mapSelect) : _useMappingSelect(false, mapSelect, deps); } /** @@ -4273,7 +3911,7 @@ function useSelect(mapSelect, deps) { * @return {ReturnType} Data object returned by the `mapSelect` function. */ function useSuspenseSelect(mapSelect, deps) { - return useMappingSelect(true, mapSelect, deps); + return _useMappingSelect(true, mapSelect, deps); } ;// external "ReactJSXRuntime" @@ -4343,6 +3981,7 @@ const withSelect = mapSelectToProps => (0,external_wp_compose_namespaceObject.cr /* harmony default export */ const with_select = (withSelect); ;// ./node_modules/@wordpress/data/build-module/components/use-dispatch/use-dispatch-with-map.js +/* wp:polyfill */ /** * WordPress dependencies */ diff --git a/wp-includes/js/dist/data.min.js b/wp-includes/js/dist/data.min.js index 02ca945b8c..dcfa2b20e5 100644 --- a/wp-includes/js/dist/data.min.js +++ b/wp-includes/js/dist/data.min.js @@ -1,9 +1,9 @@ /*! This file is auto-generated */ -(()=>{"use strict";var e={66:e=>{var t=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===r}(e)}(e)};var r="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function n(e,t){return!1!==t.clone&&t.isMergeableObject(e)?u((r=e,Array.isArray(r)?[]:{}),e,t):e;var r}function o(e,t,r){return e.concat(t).map((function(e){return n(e,r)}))}function s(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return Object.propertyIsEnumerable.call(e,t)})):[]}(e))}function i(e,t){try{return t in e}catch(e){return!1}}function c(e,t,r){var o={};return r.isMergeableObject(e)&&s(e).forEach((function(t){o[t]=n(e[t],r)})),s(t).forEach((function(s){(function(e,t){return i(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,s)||(i(e,s)&&r.isMergeableObject(t[s])?o[s]=function(e,t){if(!t.customMerge)return u;var r=t.customMerge(e);return"function"==typeof r?r:u}(s,r)(e[s],t[s],r):o[s]=n(t[s],r))})),o}function u(e,r,s){(s=s||{}).arrayMerge=s.arrayMerge||o,s.isMergeableObject=s.isMergeableObject||t,s.cloneUnlessOtherwiseSpecified=n;var i=Array.isArray(r);return i===Array.isArray(e)?i?s.arrayMerge(e,r,s):c(e,r,s):n(r,s)}u.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,r){return u(e,r,t)}),{})};var a=u;e.exports=a},3249:e=>{function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}function r(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:this;this._map.forEach((function(o,s){null!==s&&"object"===t(s)&&(o=o[1]),e.call(n,o,s,r)}))}},{key:"clear",value:function(){this._map=new Map,this._arrayTreeMap=new Map,this._objectTreeMap=new Map}},{key:"size",get:function(){return this._map.size}}],s&&r(o.prototype,s),i&&r(o,i),e}();e.exports=o}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var s=t[n]={exports:{}};return e[n](s,s.exports,r),s.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};r.r(n),r.d(n,{AsyncModeProvider:()=>Je,RegistryConsumer:()=>Ke,RegistryProvider:()=>ze,combineReducers:()=>lt,controls:()=>x,createReduxStore:()=>he,createRegistry:()=>Re,createRegistryControl:()=>j,createRegistrySelector:()=>T,createSelector:()=>$,dispatch:()=>ut,plugins:()=>i,register:()=>vt,registerGenericStore:()=>yt,registerStore:()=>dt,resolveSelect:()=>ft,select:()=>at,subscribe:()=>gt,suspendSelect:()=>pt,use:()=>bt,useDispatch:()=>ct,useRegistry:()=>Be,useSelect:()=>et,useSuspenseSelect:()=>tt,withDispatch:()=>st,withRegistry:()=>it,withSelect:()=>nt});var o={};r.r(o),r.d(o,{countSelectorsByStatus:()=>oe,getCachedResolvers:()=>re,getIsResolving:()=>J,getResolutionError:()=>ee,getResolutionState:()=>q,hasFinishedResolution:()=>Y,hasResolutionFailed:()=>Z,hasResolvingSelectors:()=>ne,hasStartedResolution:()=>Q,isResolving:()=>te});var s={};r.r(s),r.d(s,{failResolution:()=>ce,failResolutions:()=>le,finishResolution:()=>ie,finishResolutions:()=>ae,invalidateResolution:()=>fe,invalidateResolutionForStore:()=>pe,invalidateResolutionForStoreSelector:()=>ge,startResolution:()=>se,startResolutions:()=>ue});var i={};r.r(i),r.d(i,{persistence:()=>Ue});const c=window.wp.deprecated;var u=r.n(c);function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function l(e){var t=function(e,t){if("object"!==a(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==a(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===a(t)?t:String(t)}function f(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function p(e){for(var t=1;t{let o=t.get(r.registry);return o||(o=e(r.registry.select),t.set(r.registry,o)),o(...n)};return r.isRegistrySelector=!0,r}function j(e){return e.isRegistryControl=!0,e}const N="@@data/SELECT",A="@@data/RESOLVE_SELECT",L="@@data/DISPATCH";function P(e){return null!==e&&"object"==typeof e}const x={select:function(e,t,...r){return{type:N,storeKey:P(e)?e.name:e,selectorName:t,args:r}},resolveSelect:function(e,t,...r){return{type:A,storeKey:P(e)?e.name:e,selectorName:t,args:r}},dispatch:function(e,t,...r){return{type:L,storeKey:P(e)?e.name:e,actionName:t,args:r}}},M={[N]:j((e=>({storeKey:t,selectorName:r,args:n})=>e.select(t)[r](...n))),[A]:j((e=>({storeKey:t,selectorName:r,args:n})=>{const o=e.select(t)[r].hasResolver?"resolveSelect":"select";return e[o](t)[r](...n)})),[L]:j((e=>({storeKey:t,actionName:r,args:n})=>e.dispatch(t)[r](...n)))},F=window.wp.privateApis,{lock:U,unlock:D}=(0,F.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/data");const k=()=>e=>t=>{return!(r=t)||"object"!=typeof r&&"function"!=typeof r||"function"!=typeof r.then?e(t):t.then((t=>{if(t)return e(t)}));var r},C=(e,t)=>()=>r=>n=>{const o=e.select(t).getCachedResolvers();return Object.entries(o).forEach((([r,o])=>{const s=e.stores[t]?.resolvers?.[r];s&&s.shouldInvalidate&&o.forEach(((o,i)=>{void 0!==o&&("finished"!==o.status&&"error"!==o.status||s.shouldInvalidate(n,...i)&&e.dispatch(t).invalidateResolution(r,i))}))})),r(n)};function V(e){return()=>t=>r=>"function"==typeof r?r(e):t(r)}function G(e){if(null==e)return[];const t=e.length;let r=t;for(;r>0&&void 0===e[r-1];)r--;return r===t?e:e.slice(0,r)}const H=(W="selectorName",e=>(t={},r)=>{const n=r[W];if(void 0===n)return t;const o=e(t[n],r);return o===t[n]?t:{...t,[n]:o}})(((e=new(w()),t)=>{switch(t.type){case"START_RESOLUTION":{const r=new(w())(e);return r.set(G(t.args),{status:"resolving"}),r}case"FINISH_RESOLUTION":{const r=new(w())(e);return r.set(G(t.args),{status:"finished"}),r}case"FAIL_RESOLUTION":{const r=new(w())(e);return r.set(G(t.args),{status:"error",error:t.error}),r}case"START_RESOLUTIONS":{const r=new(w())(e);for(const e of t.args)r.set(G(e),{status:"resolving"});return r}case"FINISH_RESOLUTIONS":{const r=new(w())(e);for(const e of t.args)r.set(G(e),{status:"finished"});return r}case"FAIL_RESOLUTIONS":{const r=new(w())(e);return t.args.forEach(((e,n)=>{const o={status:"error",error:void 0},s=t.errors[n];s&&(o.error=s),r.set(G(e),o)})),r}case"INVALIDATE_RESOLUTION":{const r=new(w())(e);return r.delete(G(t.args)),r}}return e}));var W;const K=(e={},t)=>{switch(t.type){case"INVALIDATE_RESOLUTION_FOR_STORE":return{};case"INVALIDATE_RESOLUTION_FOR_STORE_SELECTOR":if(t.selectorName in e){const{[t.selectorName]:r,...n}=e;return n}return e;case"START_RESOLUTION":case"FINISH_RESOLUTION":case"FAIL_RESOLUTION":case"START_RESOLUTIONS":case"FINISH_RESOLUTIONS":case"FAIL_RESOLUTIONS":case"INVALIDATE_RESOLUTION":return H(e,t)}return e};var z={};function B(e){return[e]}function X(e,t,r){var n;if(e.length!==t.length)return!1;for(n=r;nArray.from(e._map.values()).some((e=>"resolving"===e[1]?.status))))}const oe=$((e=>{const t={};return Object.values(e).forEach((e=>Array.from(e._map.values()).forEach((e=>{var r;const n=null!==(r=e[1]?.status)&&void 0!==r?r:"error";t[n]||(t[n]=0),t[n]++})))),t}),(e=>[e]));function se(e,t){return{type:"START_RESOLUTION",selectorName:e,args:t}}function ie(e,t){return{type:"FINISH_RESOLUTION",selectorName:e,args:t}}function ce(e,t,r){return{type:"FAIL_RESOLUTION",selectorName:e,args:t,error:r}}function ue(e,t){return{type:"START_RESOLUTIONS",selectorName:e,args:t}}function ae(e,t){return{type:"FINISH_RESOLUTIONS",selectorName:e,args:t}}function le(e,t,r){return{type:"FAIL_RESOLUTIONS",selectorName:e,args:t,errors:r}}function fe(e,t){return{type:"INVALIDATE_RESOLUTION",selectorName:e,args:t}}function pe(){return{type:"INVALIDATE_RESOLUTION_FOR_STORE"}}function ge(e){return{type:"INVALIDATE_RESOLUTION_FOR_STORE_SELECTOR",selectorName:e}}const ye=e=>{const t=[...e];for(let e=t.length-1;e>=0;e--)void 0===t[e]&&t.splice(e,1);return t},de=(e,t)=>Object.fromEntries(Object.entries(null!=e?e:{}).map((([e,r])=>[e,t(r,e)]))),be=(e,t)=>t instanceof Map?Object.fromEntries(t):t instanceof window.HTMLElement?null:t;function ve(e){const t=new WeakMap;return{get(r,n){let o=t.get(r);return o||(o=e(r,n),t.set(r,o)),o}}}function he(e,t){const r={},n={},i={privateActions:r,registerPrivateActions:e=>{Object.assign(r,e)},privateSelectors:n,registerPrivateSelectors:e=>{Object.assign(n,e)}},c={name:e,instantiate:c=>{const u=new Set,a=t.reducer,l=function(e,t,r,n){const o={...t.controls,...M},s=de(o,(e=>e.isRegistryControl?e(r):e)),i=[C(r,e),k,E()(s),V(n)],c=[O(...i)];"undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__&&c.push(window.__REDUX_DEVTOOLS_EXTENSION__({name:e,instanceId:e,serialize:{replacer:be}}));const{reducer:u,initialState:a}=t,l=I({metadata:K,root:u});return h(l,{root:a},(0,_.compose)(c))}(e,t,c,{registry:c,get dispatch(){return b},get select(){return j},get resolveSelect(){return L()}});U(l,i);const f=function(){const e={};return{isRunning:(t,r)=>e[t]&&e[t].get(ye(r)),clear(t,r){e[t]&&e[t].delete(ye(r))},markAsRunning(t,r){e[t]||(e[t]=new(w())),e[t].set(ye(r),!0)}}}();function p(e){return(...t)=>Promise.resolve(l.dispatch(e(...t)))}const g={...de(s,p),...de(t.actions,p)},y=ve(p),d=new Proxy((()=>{}),{get:(e,t)=>{const n=r[t];return n?y.get(n,t):g[t]}}),b=new Proxy(d,{apply:(e,t,[r])=>l.dispatch(r)});U(g,d);const v=t.resolvers?function(e){return de(e,(e=>e.fulfill?e:{...e,fulfill:e}))}(t.resolvers):{};function S(e,t){e.isRegistrySelector&&(e.registry=c);const r=(...t)=>{t=Se(e,t);const r=l.__unstableOriginalGetState();return e.isRegistrySelector&&(e.registry=c),e(r.root,...t)};r.__unstableNormalizeArgs=e.__unstableNormalizeArgs;const n=v[t];return n?function(e,t,r,n,o){function s(e){const s=n.getState();if(o.isRunning(t,e)||"function"==typeof r.isFulfilled&&r.isFulfilled(s,...e))return;const{metadata:i}=n.__unstableOriginalGetState();Q(i,t,e)||(o.markAsRunning(t,e),setTimeout((async()=>{o.clear(t,e),n.dispatch(se(t,e));try{const o=r.fulfill(...e);o&&await n.dispatch(o),n.dispatch(ie(t,e))}catch(r){n.dispatch(ce(t,e,r))}}),0))}const i=(...t)=>(s(t=Se(e,t)),e(...t));return i.hasResolver=!0,i}(r,t,n,l,f):(r.hasResolver=!1,r)}const m={...de(o,(function(e){const r=(...r)=>{const n=l.__unstableOriginalGetState(),o=r&&r[0],s=r&&r[1],i=t?.selectors?.[o];return o&&i&&(r[1]=Se(i,s)),e(n.metadata,...r)};return r.hasResolver=!1,r})),...de(t.selectors,S)},R=ve(S);for(const[e,t]of Object.entries(n))R.get(t,e);const T=new Proxy((()=>{}),{get:(e,t)=>{const r=n[t];return r?R.get(r,t):m[t]}}),j=new Proxy(T,{apply:(e,t,[r])=>r(l.__unstableOriginalGetState())});U(m,T);const N=function(e,t){const{getIsResolving:r,hasStartedResolution:n,hasFinishedResolution:o,hasResolutionFailed:s,isResolving:i,getCachedResolvers:c,getResolutionState:u,getResolutionError:a,hasResolvingSelectors:l,countSelectorsByStatus:f,...p}=e;return de(p,((r,n)=>r.hasResolver?(...o)=>new Promise(((s,i)=>{const c=()=>e.hasFinishedResolution(n,o),u=t=>{if(e.hasResolutionFailed(n,o)){const t=e.getResolutionError(n,o);i(t)}else s(t)},a=()=>r.apply(null,o),l=a();if(c())return u(l);const f=t.subscribe((()=>{c()&&(f(),u(a()))}))})):async(...e)=>r.apply(null,e)))}(m,l),A=function(e,t){return de(e,((r,n)=>r.hasResolver?(...o)=>{const s=r.apply(null,o);if(e.hasFinishedResolution(n,o)){if(e.hasResolutionFailed(n,o))throw e.getResolutionError(n,o);return s}throw new Promise((r=>{const s=t.subscribe((()=>{e.hasFinishedResolution(n,o)&&(r(),s())}))}))}:r))}(m,l),L=()=>N;l.__unstableOriginalGetState=l.getState,l.getState=()=>l.__unstableOriginalGetState().root;const P=l&&(e=>(u.add(e),()=>u.delete(e)));let x=l.__unstableOriginalGetState();return l.subscribe((()=>{const e=l.__unstableOriginalGetState(),t=e!==x;if(x=e,t)for(const e of u)e()})),{reducer:a,store:l,actions:g,selectors:m,resolvers:v,getSelectors:()=>m,getResolveSelectors:L,getSuspendSelectors:()=>A,getActions:()=>g,subscribe:P}}};return U(c,i),c}function Se(e,t){return e.__unstableNormalizeArgs&&"function"==typeof e.__unstableNormalizeArgs&&t?.length?e.__unstableNormalizeArgs(t):t}const Oe={name:"core/data",instantiate(e){const t=t=>(r,...n)=>e.select(r)[t](...n),r=t=>(r,...n)=>e.dispatch(r)[t](...n);return{getSelectors:()=>Object.fromEntries(["getIsResolving","hasStartedResolution","hasFinishedResolution","isResolving","getCachedResolvers"].map((e=>[e,t(e)]))),getActions:()=>Object.fromEntries(["startResolution","finishResolution","invalidateResolution","invalidateResolutionForStore","invalidateResolutionForStoreSelector"].map((e=>[e,r(e)]))),subscribe:()=>()=>()=>{}}}};function me(){let e=!1,t=!1;const r=new Set,n=()=>Array.from(r).forEach((e=>e()));return{get isPaused(){return e},subscribe:e=>(r.add(e),()=>r.delete(e)),pause(){e=!0},resume(){e=!1,t&&(t=!1,n())},emit(){e?t=!0:n()}}}function we(e){return"string"==typeof e?e:e.name}function Re(e={},t=null){const r={},n=me();let o=null;function s(){n.emit()}function i(e,n){if(r[e])return console.error('Store "'+e+'" is already registered.'),r[e];const o=n();if("function"!=typeof o.getSelectors)throw new TypeError("store.getSelectors must be a function");if("function"!=typeof o.getActions)throw new TypeError("store.getActions must be a function");if("function"!=typeof o.subscribe)throw new TypeError("store.subscribe must be a function");o.emitter=me();const i=o.subscribe;if(o.subscribe=e=>{const t=o.emitter.subscribe(e),r=i((()=>{o.emitter.isPaused?o.emitter.emit():e()}));return()=>{r?.(),t?.()}},r[e]=o,o.subscribe(s),t)try{D(o.store).registerPrivateActions(D(t).privateActionsOf(e)),D(o.store).registerPrivateSelectors(D(t).privateSelectorsOf(e))}catch(e){}return o}let c={batch:function(e){if(n.isPaused)e();else{n.pause(),Object.values(r).forEach((e=>e.emitter.pause()));try{e()}finally{n.resume(),Object.values(r).forEach((e=>e.emitter.resume()))}}},stores:r,namespaces:r,subscribe:(e,o)=>{if(!o)return n.subscribe(e);const s=we(o),i=r[s];return i?i.subscribe(e):t?t.subscribe(e,o):n.subscribe(e)},select:function(e){const n=we(e);o?.add(n);const s=r[n];return s?s.getSelectors():t?.select(n)},resolveSelect:function(e){const n=we(e);o?.add(n);const s=r[n];return s?s.getResolveSelectors():t&&t.resolveSelect(n)},suspendSelect:function(e){const n=we(e);o?.add(n);const s=r[n];return s?s.getSuspendSelectors():t&&t.suspendSelect(n)},dispatch:function(e){const n=we(e),o=r[n];return o?o.getActions():t&&t.dispatch(n)},use:function(e,t){if(!e)return;return c={...c,...e(c,t)},c},register:function(e){i(e.name,(()=>e.instantiate(c)))},registerGenericStore:function(e,t){u()("wp.data.registerGenericStore",{since:"5.9",alternative:"wp.data.register( storeDescriptor )"}),i(e,(()=>t))},registerStore:function(e,t){if(!t.reducer)throw new TypeError("Must specify store reducer");return i(e,(()=>he(e,t).instantiate(c))).store},__unstableMarkListeningStores:function(e,t){o=new Set;try{return e.call(this)}finally{t.current=Array.from(o),o=null}}};c.register(Oe);for(const[t,r]of Object.entries(e))c.register(he(t,r));t&&t.subscribe(s);const a=(l=c,Object.fromEntries(Object.entries(l).map((([e,t])=>"function"!=typeof t?[e,t]:[e,function(){return c[e].apply(null,arguments)}]))));var l;return U(a,{privateActionsOf:e=>{try{return D(r[e].store).privateActions}catch(e){return{}}},privateSelectorsOf:e=>{try{return D(r[e].store).privateSelectors}catch(e){return{}}}}),a}const Ee=Re(); +(()=>{"use strict";var e={66:e=>{var t=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===r}(e)}(e)};var r="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function n(e,t){return!1!==t.clone&&t.isMergeableObject(e)?a((r=e,Array.isArray(r)?[]:{}),e,t):e;var r}function o(e,t,r){return e.concat(t).map((function(e){return n(e,r)}))}function s(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return Object.propertyIsEnumerable.call(e,t)})):[]}(e))}function i(e,t){try{return t in e}catch(e){return!1}}function c(e,t,r){var o={};return r.isMergeableObject(e)&&s(e).forEach((function(t){o[t]=n(e[t],r)})),s(t).forEach((function(s){(function(e,t){return i(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,s)||(i(e,s)&&r.isMergeableObject(t[s])?o[s]=function(e,t){if(!t.customMerge)return a;var r=t.customMerge(e);return"function"==typeof r?r:a}(s,r)(e[s],t[s],r):o[s]=n(t[s],r))})),o}function a(e,r,s){(s=s||{}).arrayMerge=s.arrayMerge||o,s.isMergeableObject=s.isMergeableObject||t,s.cloneUnlessOtherwiseSpecified=n;var i=Array.isArray(r);return i===Array.isArray(e)?i?s.arrayMerge(e,r,s):c(e,r,s):n(r,s)}a.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,r){return a(e,r,t)}),{})};var u=a;e.exports=u},3249:e=>{function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}function r(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:this;this._map.forEach((function(o,s){null!==s&&"object"===t(s)&&(o=o[1]),e.call(n,o,s,r)}))}},{key:"clear",value:function(){this._map=new Map,this._arrayTreeMap=new Map,this._objectTreeMap=new Map}},{key:"size",get:function(){return this._map.size}}],s&&r(o.prototype,s),i&&r(o,i),e}();e.exports=o}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var s=t[n]={exports:{}};return e[n](s,s.exports,r),s.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};r.r(n),r.d(n,{AsyncModeProvider:()=>Ke,RegistryConsumer:()=>De,RegistryProvider:()=>Ve,combineReducers:()=>st,controls:()=>N,createReduxStore:()=>ge,createRegistry:()=>be,createRegistryControl:()=>R,createRegistrySelector:()=>w,createSelector:()=>W,dispatch:()=>nt,plugins:()=>i,register:()=>pt,registerGenericStore:()=>ut,registerStore:()=>lt,resolveSelect:()=>it,select:()=>ot,subscribe:()=>at,suspendSelect:()=>ct,use:()=>ft,useDispatch:()=>rt,useRegistry:()=>Ge,useSelect:()=>qe,useSuspenseSelect:()=>Je,withDispatch:()=>et,withRegistry:()=>tt,withSelect:()=>Ye});var o={};r.r(o),r.d(o,{countSelectorsByStatus:()=>Z,getCachedResolvers:()=>Q,getIsResolving:()=>K,getResolutionError:()=>q,getResolutionState:()=>$,hasFinishedResolution:()=>B,hasResolutionFailed:()=>X,hasResolvingSelectors:()=>Y,hasStartedResolution:()=>z,isResolving:()=>J});var s={};r.r(s),r.d(s,{failResolution:()=>re,failResolutions:()=>se,finishResolution:()=>te,finishResolutions:()=>oe,invalidateResolution:()=>ie,invalidateResolutionForStore:()=>ce,invalidateResolutionForStoreSelector:()=>ae,startResolution:()=>ee,startResolutions:()=>ne});var i={};r.r(i),r.d(i,{persistence:()=>Le});const c=window.wp.deprecated;var a=r.n(c);function u(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var l=(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")(),f=()=>Math.random().toString(36).substring(7).split("").join("."),p={INIT:`@@redux/INIT${f()}`,REPLACE:`@@redux/REPLACE${f()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${f()}`};function g(e){if("object"!=typeof e||null===e)return!1;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||null===Object.getPrototypeOf(e)}function d(e,t,r){if("function"!=typeof e)throw new Error(u(2));if("function"==typeof t&&"function"==typeof r||"function"==typeof r&&"function"==typeof arguments[3])throw new Error(u(0));if("function"==typeof t&&void 0===r&&(r=t,t=void 0),void 0!==r){if("function"!=typeof r)throw new Error(u(1));return r(d)(e,t)}let n=e,o=t,s=new Map,i=s,c=0,a=!1;function f(){i===s&&(i=new Map,s.forEach(((e,t)=>{i.set(t,e)})))}function y(){if(a)throw new Error(u(3));return o}function h(e){if("function"!=typeof e)throw new Error(u(4));if(a)throw new Error(u(5));let t=!0;f();const r=c++;return i.set(r,e),function(){if(t){if(a)throw new Error(u(6));t=!1,f(),i.delete(r),s=null}}}function S(e){if(!g(e))throw new Error(u(7));if(void 0===e.type)throw new Error(u(8));if("string"!=typeof e.type)throw new Error(u(17));if(a)throw new Error(u(9));try{a=!0,o=n(o,e)}finally{a=!1}return(s=i).forEach((e=>{e()})),e}S({type:p.INIT});return{dispatch:S,subscribe:h,getState:y,replaceReducer:function(e){if("function"!=typeof e)throw new Error(u(10));n=e,S({type:p.REPLACE})},[l]:function(){const e=h;return{subscribe(t){if("object"!=typeof t||null===t)throw new Error(u(11));function r(){const e=t;e.next&&e.next(y())}r();return{unsubscribe:e(r)}},[l](){return this}}}}}function y(...e){return t=>(r,n)=>{const o=t(r,n);let s=()=>{throw new Error(u(15))};const i={getState:o.getState,dispatch:(e,...t)=>s(e,...t)},c=e.map((e=>e(i)));return s=function(...e){return 0===e.length?e=>e:1===e.length?e[0]:e.reduce(((e,t)=>(...r)=>e(t(...r))))}(...c)(o.dispatch),{...o,dispatch:s}}}var h=r(3249),S=r.n(h);const b=window.wp.reduxRoutine;var v=r.n(b);const O=window.wp.compose;function m(e){const t=Object.keys(e);return function(r={},n){const o={};let s=!1;for(const i of t){const t=e[i],c=r[i],a=t(c,n);o[i]=a,s=s||a!==c}return s?o:r}}function w(e){const t=new WeakMap,r=(...n)=>{let o=t.get(r.registry);return o||(o=e(r.registry.select),t.set(r.registry,o)),o(...n)};return r.isRegistrySelector=!0,r}function R(e){return e.isRegistryControl=!0,e}const E="@@data/SELECT",_="@@data/RESOLVE_SELECT",I="@@data/DISPATCH";function T(e){return null!==e&&"object"==typeof e}const N={select:function(e,t,...r){return{type:E,storeKey:T(e)?e.name:e,selectorName:t,args:r}},resolveSelect:function(e,t,...r){return{type:_,storeKey:T(e)?e.name:e,selectorName:t,args:r}},dispatch:function(e,t,...r){return{type:I,storeKey:T(e)?e.name:e,actionName:t,args:r}}},A={[E]:R((e=>({storeKey:t,selectorName:r,args:n})=>e.select(t)[r](...n))),[_]:R((e=>({storeKey:t,selectorName:r,args:n})=>{const o=e.select(t)[r].hasResolver?"resolveSelect":"select";return e[o](t)[r](...n)})),[I]:R((e=>({storeKey:t,actionName:r,args:n})=>e.dispatch(t)[r](...n)))},j=window.wp.privateApis,{lock:L,unlock:M}=(0,j.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/data");const P=()=>e=>t=>{return!(r=t)||"object"!=typeof r&&"function"!=typeof r||"function"!=typeof r.then?e(t):t.then((t=>{if(t)return e(t)}));var r},x=(e,t)=>()=>r=>n=>{const o=e.select(t).getCachedResolvers();return Object.entries(o).forEach((([r,o])=>{const s=e.stores[t]?.resolvers?.[r];s&&s.shouldInvalidate&&o.forEach(((o,i)=>{void 0!==o&&("finished"!==o.status&&"error"!==o.status||s.shouldInvalidate(n,...i)&&e.dispatch(t).invalidateResolution(r,i))}))})),r(n)};function F(e){return()=>t=>r=>"function"==typeof r?r(e):t(r)}function U(e){if(null==e)return[];const t=e.length;let r=t;for(;r>0&&void 0===e[r-1];)r--;return r===t?e:e.slice(0,r)}const C=(k="selectorName",e=>(t={},r)=>{const n=r[k];if(void 0===n)return t;const o=e(t[n],r);return o===t[n]?t:{...t,[n]:o}})(((e=new(S()),t)=>{switch(t.type){case"START_RESOLUTION":{const r=new(S())(e);return r.set(U(t.args),{status:"resolving"}),r}case"FINISH_RESOLUTION":{const r=new(S())(e);return r.set(U(t.args),{status:"finished"}),r}case"FAIL_RESOLUTION":{const r=new(S())(e);return r.set(U(t.args),{status:"error",error:t.error}),r}case"START_RESOLUTIONS":{const r=new(S())(e);for(const e of t.args)r.set(U(e),{status:"resolving"});return r}case"FINISH_RESOLUTIONS":{const r=new(S())(e);for(const e of t.args)r.set(U(e),{status:"finished"});return r}case"FAIL_RESOLUTIONS":{const r=new(S())(e);return t.args.forEach(((e,n)=>{const o={status:"error",error:void 0},s=t.errors[n];s&&(o.error=s),r.set(U(e),o)})),r}case"INVALIDATE_RESOLUTION":{const r=new(S())(e);return r.delete(U(t.args)),r}}return e}));var k;const D=(e={},t)=>{switch(t.type){case"INVALIDATE_RESOLUTION_FOR_STORE":return{};case"INVALIDATE_RESOLUTION_FOR_STORE_SELECTOR":if(t.selectorName in e){const{[t.selectorName]:r,...n}=e;return n}return e;case"START_RESOLUTION":case"FINISH_RESOLUTION":case"FAIL_RESOLUTION":case"START_RESOLUTIONS":case"FINISH_RESOLUTIONS":case"FAIL_RESOLUTIONS":case"INVALIDATE_RESOLUTION":return C(e,t)}return e};var V={};function G(e){return[e]}function H(e,t,r){var n;if(e.length!==t.length)return!1;for(n=r;nArray.from(e._map.values()).some((e=>"resolving"===e[1]?.status))))}const Z=W((e=>{const t={};return Object.values(e).forEach((e=>Array.from(e._map.values()).forEach((e=>{var r;const n=null!==(r=e[1]?.status)&&void 0!==r?r:"error";t[n]||(t[n]=0),t[n]++})))),t}),(e=>[e]));function ee(e,t){return{type:"START_RESOLUTION",selectorName:e,args:t}}function te(e,t){return{type:"FINISH_RESOLUTION",selectorName:e,args:t}}function re(e,t,r){return{type:"FAIL_RESOLUTION",selectorName:e,args:t,error:r}}function ne(e,t){return{type:"START_RESOLUTIONS",selectorName:e,args:t}}function oe(e,t){return{type:"FINISH_RESOLUTIONS",selectorName:e,args:t}}function se(e,t,r){return{type:"FAIL_RESOLUTIONS",selectorName:e,args:t,errors:r}}function ie(e,t){return{type:"INVALIDATE_RESOLUTION",selectorName:e,args:t}}function ce(){return{type:"INVALIDATE_RESOLUTION_FOR_STORE"}}function ae(e){return{type:"INVALIDATE_RESOLUTION_FOR_STORE_SELECTOR",selectorName:e}}const ue=e=>{const t=[...e];for(let e=t.length-1;e>=0;e--)void 0===t[e]&&t.splice(e,1);return t},le=(e,t)=>Object.fromEntries(Object.entries(null!=e?e:{}).map((([e,r])=>[e,t(r,e)]))),fe=(e,t)=>t instanceof Map?Object.fromEntries(t):t instanceof window.HTMLElement?null:t;function pe(e){const t=new WeakMap;return{get(r,n){let o=t.get(r);return o||(o=e(r,n),t.set(r,o)),o}}}function ge(e,t){const r={},n={},i={privateActions:r,registerPrivateActions:e=>{Object.assign(r,e)},privateSelectors:n,registerPrivateSelectors:e=>{Object.assign(n,e)}},c={name:e,instantiate:c=>{const a=new Set,u=t.reducer,l=function(e,t,r,n){const o={...t.controls,...A},s=le(o,(e=>e.isRegistryControl?e(r):e)),i=[x(r,e),P,v()(s),F(n)],c=[y(...i)];"undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__&&c.push(window.__REDUX_DEVTOOLS_EXTENSION__({name:e,instanceId:e,serialize:{replacer:fe}}));const{reducer:a,initialState:u}=t,l=m({metadata:D,root:a});return d(l,{root:u},(0,O.compose)(c))}(e,t,c,{registry:c,get dispatch(){return w},get select(){return N},get resolveSelect(){return U()}});L(l,i);const f=function(){const e={};return{isRunning:(t,r)=>e[t]&&e[t].get(ue(r)),clear(t,r){e[t]&&e[t].delete(ue(r))},markAsRunning(t,r){e[t]||(e[t]=new(S())),e[t].set(ue(r),!0)}}}();function p(e){return(...t)=>Promise.resolve(l.dispatch(e(...t)))}const g={...le(s,p),...le(t.actions,p)},h=pe(p),b=new Proxy((()=>{}),{get:(e,t)=>{const n=r[t];return n?h.get(n,t):g[t]}}),w=new Proxy(b,{apply:(e,t,[r])=>l.dispatch(r)});L(g,b);const R=t.resolvers?function(e){return le(e,(e=>e.fulfill?e:{...e,fulfill:e}))}(t.resolvers):{};function E(e,t){e.isRegistrySelector&&(e.registry=c);const r=(...t)=>{t=de(e,t);const r=l.__unstableOriginalGetState();return e.isRegistrySelector&&(e.registry=c),e(r.root,...t)};r.__unstableNormalizeArgs=e.__unstableNormalizeArgs;const n=R[t];return n?function(e,t,r,n,o){function s(e){const s=n.getState();if(o.isRunning(t,e)||"function"==typeof r.isFulfilled&&r.isFulfilled(s,...e))return;const{metadata:i}=n.__unstableOriginalGetState();z(i,t,e)||(o.markAsRunning(t,e),setTimeout((async()=>{o.clear(t,e),n.dispatch(ee(t,e));try{const o=r.fulfill(...e);o&&await n.dispatch(o),n.dispatch(te(t,e))}catch(r){n.dispatch(re(t,e,r))}}),0))}const i=(...t)=>(s(t=de(e,t)),e(...t));return i.hasResolver=!0,i}(r,t,n,l,f):(r.hasResolver=!1,r)}const _={...le(o,(function(e){const r=(...r)=>{const n=l.__unstableOriginalGetState(),o=r&&r[0],s=r&&r[1],i=t?.selectors?.[o];return o&&i&&(r[1]=de(i,s)),e(n.metadata,...r)};return r.hasResolver=!1,r})),...le(t.selectors,E)},I=pe(E);for(const[e,t]of Object.entries(n))I.get(t,e);const T=new Proxy((()=>{}),{get:(e,t)=>{const r=n[t];return r?I.get(r,t):_[t]}}),N=new Proxy(T,{apply:(e,t,[r])=>r(l.__unstableOriginalGetState())});L(_,T);const j=function(e,t){const{getIsResolving:r,hasStartedResolution:n,hasFinishedResolution:o,hasResolutionFailed:s,isResolving:i,getCachedResolvers:c,getResolutionState:a,getResolutionError:u,hasResolvingSelectors:l,countSelectorsByStatus:f,...p}=e;return le(p,((r,n)=>r.hasResolver?(...o)=>new Promise(((s,i)=>{const c=()=>e.hasFinishedResolution(n,o),a=t=>{if(e.hasResolutionFailed(n,o)){const t=e.getResolutionError(n,o);i(t)}else s(t)},u=()=>r.apply(null,o),l=u();if(c())return a(l);const f=t.subscribe((()=>{c()&&(f(),a(u()))}))})):async(...e)=>r.apply(null,e)))}(_,l),M=function(e,t){return le(e,((r,n)=>r.hasResolver?(...o)=>{const s=r.apply(null,o);if(e.hasFinishedResolution(n,o)){if(e.hasResolutionFailed(n,o))throw e.getResolutionError(n,o);return s}throw new Promise((r=>{const s=t.subscribe((()=>{e.hasFinishedResolution(n,o)&&(r(),s())}))}))}:r))}(_,l),U=()=>j;l.__unstableOriginalGetState=l.getState,l.getState=()=>l.__unstableOriginalGetState().root;const C=l&&(e=>(a.add(e),()=>a.delete(e)));let k=l.__unstableOriginalGetState();return l.subscribe((()=>{const e=l.__unstableOriginalGetState(),t=e!==k;if(k=e,t)for(const e of a)e()})),{reducer:u,store:l,actions:g,selectors:_,resolvers:R,getSelectors:()=>_,getResolveSelectors:U,getSuspendSelectors:()=>M,getActions:()=>g,subscribe:C}}};return L(c,i),c}function de(e,t){return e.__unstableNormalizeArgs&&"function"==typeof e.__unstableNormalizeArgs&&t?.length?e.__unstableNormalizeArgs(t):t}const ye={name:"core/data",instantiate(e){const t=t=>(r,...n)=>e.select(r)[t](...n),r=t=>(r,...n)=>e.dispatch(r)[t](...n);return{getSelectors:()=>Object.fromEntries(["getIsResolving","hasStartedResolution","hasFinishedResolution","isResolving","getCachedResolvers"].map((e=>[e,t(e)]))),getActions:()=>Object.fromEntries(["startResolution","finishResolution","invalidateResolution","invalidateResolutionForStore","invalidateResolutionForStoreSelector"].map((e=>[e,r(e)]))),subscribe:()=>()=>()=>{}}}};function he(){let e=!1,t=!1;const r=new Set,n=()=>Array.from(r).forEach((e=>e()));return{get isPaused(){return e},subscribe:e=>(r.add(e),()=>r.delete(e)),pause(){e=!0},resume(){e=!1,t&&(t=!1,n())},emit(){e?t=!0:n()}}}function Se(e){return"string"==typeof e?e:e.name}function be(e={},t=null){const r={},n=he();let o=null;function s(){n.emit()}function i(e,n){if(r[e])return console.error('Store "'+e+'" is already registered.'),r[e];const o=n();if("function"!=typeof o.getSelectors)throw new TypeError("store.getSelectors must be a function");if("function"!=typeof o.getActions)throw new TypeError("store.getActions must be a function");if("function"!=typeof o.subscribe)throw new TypeError("store.subscribe must be a function");o.emitter=he();const i=o.subscribe;if(o.subscribe=e=>{const t=o.emitter.subscribe(e),r=i((()=>{o.emitter.isPaused?o.emitter.emit():e()}));return()=>{r?.(),t?.()}},r[e]=o,o.subscribe(s),t)try{M(o.store).registerPrivateActions(M(t).privateActionsOf(e)),M(o.store).registerPrivateSelectors(M(t).privateSelectorsOf(e))}catch(e){}return o}let c={batch:function(e){if(n.isPaused)e();else{n.pause(),Object.values(r).forEach((e=>e.emitter.pause()));try{e()}finally{n.resume(),Object.values(r).forEach((e=>e.emitter.resume()))}}},stores:r,namespaces:r,subscribe:(e,o)=>{if(!o)return n.subscribe(e);const s=Se(o),i=r[s];return i?i.subscribe(e):t?t.subscribe(e,o):n.subscribe(e)},select:function(e){const n=Se(e);o?.add(n);const s=r[n];return s?s.getSelectors():t?.select(n)},resolveSelect:function(e){const n=Se(e);o?.add(n);const s=r[n];return s?s.getResolveSelectors():t&&t.resolveSelect(n)},suspendSelect:function(e){const n=Se(e);o?.add(n);const s=r[n];return s?s.getSuspendSelectors():t&&t.suspendSelect(n)},dispatch:function(e){const n=Se(e),o=r[n];return o?o.getActions():t&&t.dispatch(n)},use:function(e,t){if(!e)return;return c={...c,...e(c,t)},c},register:function(e){i(e.name,(()=>e.instantiate(c)))},registerGenericStore:function(e,t){a()("wp.data.registerGenericStore",{since:"5.9",alternative:"wp.data.register( storeDescriptor )"}),i(e,(()=>t))},registerStore:function(e,t){if(!t.reducer)throw new TypeError("Must specify store reducer");return i(e,(()=>ge(e,t).instantiate(c))).store},__unstableMarkListeningStores:function(e,t){o=new Set;try{return e.call(this)}finally{t.current=Array.from(o),o=null}}};c.register(ye);for(const[t,r]of Object.entries(e))c.register(ge(t,r));t&&t.subscribe(s);const u=(l=c,Object.fromEntries(Object.entries(l).map((([e,t])=>"function"!=typeof t?[e,t]:[e,function(){return c[e].apply(null,arguments)}]))));var l;return L(u,{privateActionsOf:e=>{try{return M(r[e].store).privateActions}catch(e){return{}}},privateSelectorsOf:e=>{try{return M(r[e].store).privateSelectors}catch(e){return{}}}}),u}const ve=be(); /*! * is-plain-object * * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. */ -function _e(e){return"[object Object]"===Object.prototype.toString.call(e)}function Ie(e){var t,r;return!1!==_e(e)&&(void 0===(t=e.constructor)||!1!==_e(r=t.prototype)&&!1!==r.hasOwnProperty("isPrototypeOf"))}var Te=r(66),je=r.n(Te);let Ne;const Ae={getItem:e=>Ne&&Ne[e]?Ne[e]:null,setItem(e,t){Ne||Ae.clear(),Ne[e]=String(t)},clear(){Ne=Object.create(null)}},Le=Ae;let Pe;try{Pe=window.localStorage,Pe.setItem("__wpDataTestLocalStorage",""),Pe.removeItem("__wpDataTestLocalStorage")}catch(e){Pe=Le}const xe=Pe,Me="WP_DATA";function Fe(e,t){const r=function(e){const{storage:t=xe,storageKey:r=Me}=e;let n;return{get:function(){if(void 0===n){const e=t.getItem(r);if(null===e)n={};else try{n=JSON.parse(e)}catch(e){n={}}}return n},set:function(e,o){n={...n,[e]:o},t.setItem(r,JSON.stringify(n))}}}(t);return{registerStore(t,n){if(!n.persist)return e.registerStore(t,n);const o=r.get()[t];if(void 0!==o){let e=n.reducer(n.initialState,{type:"@@WP/PERSISTENCE_RESTORE"});e=Ie(e)&&Ie(o)?je()(e,o,{isMergeableObject:Ie}):o,n={...n,initialState:e}}const s=e.registerStore(t,n);return s.subscribe(function(e,t,n){let o;if(Array.isArray(n)){const e=n.reduce(((e,t)=>Object.assign(e,{[t]:(e,r)=>r.nextState[t]})),{});s=lt(e),o=(e,t)=>t.nextState===e?e:s(e,t)}else o=(e,t)=>t.nextState;var s;let i=o(void 0,{nextState:e()});return()=>{const n=o(i,{nextState:e()});n!==i&&(r.set(t,n),i=n)}}(s.getState,t,n.persist)),s}}}Fe.__unstableMigrate=()=>{};const Ue=Fe,De=window.wp.priorityQueue,ke=window.wp.element,Ce=window.wp.isShallowEqual;var Ve=r.n(Ce);const Ge=(0,ke.createContext)(Ee),{Consumer:He,Provider:We}=Ge,Ke=He,ze=We;function Be(){return(0,ke.useContext)(Ge)}const Xe=(0,ke.createContext)(!1),{Consumer:$e,Provider:qe}=Xe,Je=qe;const Qe=(0,De.createQueue)();function Ye(e,t){const r=t?e.suspendSelect:e.select,n={};let o,s,i,c,u=!1;const a=new Map;function l(t){var r;return null!==(r=e.stores[t]?.store?.getState?.())&&void 0!==r?r:{}}return(t,f)=>{function p(){if(u&&t===o)return s;const f={current:null},p=e.__unstableMarkListeningStores((()=>t(r,e)),f);if(c)c.updateStores(f.current);else{for(const e of f.current)a.set(e,l(e));c=(t=>{const r=[...t],o=new Set;return{subscribe:function(t){if(u)for(const e of r)a.get(e)!==l(e)&&(u=!1);a.clear();const s=()=>{u=!1,t()},c=()=>{i?Qe.add(n,s):s()},f=[];function p(t){f.push(e.subscribe(c,t))}for(const e of r)p(e);return o.add(p),()=>{o.delete(p);for(const e of f.values())e?.();Qe.cancel(n)}},updateStores:function(e){for(const t of e)if(!r.includes(t)){r.push(t);for(const e of o)e(t)}}}})(f.current)}Ve()(s,p)||(s=p),o=t,u=!0}return i&&!f&&(u=!1,Qe.cancel(n)),p(),i=f,{subscribe:c.subscribe,getValue:function(){return p(),s}}}}function Ze(e,t,r){const n=Be(),o=(0,ke.useContext)(Xe),s=(0,ke.useMemo)((()=>Ye(n,e)),[n,e]),i=(0,ke.useCallback)(t,r),{subscribe:c,getValue:u}=s(i,o),a=(0,ke.useSyncExternalStore)(c,u,u);return(0,ke.useDebugValue)(a),a}function et(e,t){const r="function"!=typeof e,n=(0,ke.useRef)(r);if(r!==n.current){const e=n.current?"static":"mapping";throw new Error(`Switching useSelect from ${e} to ${r?"static":"mapping"} is not allowed`)}return r?(o=e,Be().select(o)):Ze(!1,e,t);var o}function tt(e,t){return Ze(!0,e,t)}const rt=window.ReactJSXRuntime,nt=e=>(0,_.createHigherOrderComponent)((t=>(0,_.pure)((r=>{const n=et(((t,n)=>e(t,r,n)));return(0,rt.jsx)(t,{...r,...n})}))),"withSelect"),ot=(e,t)=>{const r=Be(),n=(0,ke.useRef)(e);return(0,_.useIsomorphicLayoutEffect)((()=>{n.current=e})),(0,ke.useMemo)((()=>{const e=n.current(r.dispatch,r);return Object.fromEntries(Object.entries(e).map((([e,t])=>("function"!=typeof t&&console.warn(`Property ${e} returned from dispatchMap in useDispatchWithMap must be a function.`),[e,(...t)=>n.current(r.dispatch,r)[e](...t)]))))}),[r,...t])},st=e=>(0,_.createHigherOrderComponent)((t=>r=>{const n=ot(((t,n)=>e(t,r,n)),[]);return(0,rt.jsx)(t,{...r,...n})}),"withDispatch"),it=(0,_.createHigherOrderComponent)((e=>t=>(0,rt.jsx)(Ke,{children:r=>(0,rt.jsx)(e,{...t,registry:r})})),"withRegistry"),ct=e=>{const{dispatch:t}=Be();return void 0===e?t:t(e)};function ut(e){return Ee.dispatch(e)}function at(e){return Ee.select(e)}const lt=I,ft=Ee.resolveSelect,pt=Ee.suspendSelect,gt=Ee.subscribe,yt=Ee.registerGenericStore,dt=Ee.registerStore,bt=Ee.use,vt=Ee.register;(window.wp=window.wp||{}).data=n})(); \ No newline at end of file +function Oe(e){return"[object Object]"===Object.prototype.toString.call(e)}function me(e){var t,r;return!1!==Oe(e)&&(void 0===(t=e.constructor)||!1!==Oe(r=t.prototype)&&!1!==r.hasOwnProperty("isPrototypeOf"))}var we=r(66),Re=r.n(we);let Ee;const _e={getItem:e=>Ee&&Ee[e]?Ee[e]:null,setItem(e,t){Ee||_e.clear(),Ee[e]=String(t)},clear(){Ee=Object.create(null)}},Ie=_e;let Te;try{Te=window.localStorage,Te.setItem("__wpDataTestLocalStorage",""),Te.removeItem("__wpDataTestLocalStorage")}catch(e){Te=Ie}const Ne=Te,Ae="WP_DATA";function je(e,t){const r=function(e){const{storage:t=Ne,storageKey:r=Ae}=e;let n;return{get:function(){if(void 0===n){const e=t.getItem(r);if(null===e)n={};else try{n=JSON.parse(e)}catch(e){n={}}}return n},set:function(e,o){n={...n,[e]:o},t.setItem(r,JSON.stringify(n))}}}(t);return{registerStore(t,n){if(!n.persist)return e.registerStore(t,n);const o=r.get()[t];if(void 0!==o){let e=n.reducer(n.initialState,{type:"@@WP/PERSISTENCE_RESTORE"});e=me(e)&&me(o)?Re()(e,o,{isMergeableObject:me}):o,n={...n,initialState:e}}const s=e.registerStore(t,n);return s.subscribe(function(e,t,n){let o;if(Array.isArray(n)){const e=n.reduce(((e,t)=>Object.assign(e,{[t]:(e,r)=>r.nextState[t]})),{});s=st(e),o=(e,t)=>t.nextState===e?e:s(e,t)}else o=(e,t)=>t.nextState;var s;let i=o(void 0,{nextState:e()});return()=>{const n=o(i,{nextState:e()});n!==i&&(r.set(t,n),i=n)}}(s.getState,t,n.persist)),s}}}je.__unstableMigrate=()=>{};const Le=je,Me=window.wp.priorityQueue,Pe=window.wp.element,xe=window.wp.isShallowEqual;var Fe=r.n(xe);const Ue=(0,Pe.createContext)(ve),{Consumer:Ce,Provider:ke}=Ue,De=Ce,Ve=ke;function Ge(){return(0,Pe.useContext)(Ue)}const He=(0,Pe.createContext)(!1),{Consumer:We,Provider:$e}=He,Ke=$e;const ze=(0,Me.createQueue)();function Be(e,t){const r=t?e.suspendSelect:e.select,n={};let o,s,i,c,a=!1;const u=new Map;function l(t){var r;return null!==(r=e.stores[t]?.store?.getState?.())&&void 0!==r?r:{}}return(t,f)=>{function p(){if(a&&t===o)return s;const f={current:null},p=e.__unstableMarkListeningStores((()=>t(r,e)),f);if(c)c.updateStores(f.current);else{for(const e of f.current)u.set(e,l(e));c=(t=>{const r=[...t],o=new Set;return{subscribe:function(t){if(a)for(const e of r)u.get(e)!==l(e)&&(a=!1);u.clear();const s=()=>{a=!1,t()},c=()=>{i?ze.add(n,s):s()},f=[];function p(t){f.push(e.subscribe(c,t))}for(const e of r)p(e);return o.add(p),()=>{o.delete(p);for(const e of f.values())e?.();ze.cancel(n)}},updateStores:function(e){for(const t of e)if(!r.includes(t)){r.push(t);for(const e of o)e(t)}}}})(f.current)}Fe()(s,p)||(s=p),o=t,a=!0}return i&&!f&&(a=!1,ze.cancel(n)),p(),i=f,{subscribe:c.subscribe,getValue:function(){return p(),s}}}}function Xe(e,t,r){const n=Ge(),o=(0,Pe.useContext)(He),s=(0,Pe.useMemo)((()=>Be(n,e)),[n,e]),i=(0,Pe.useCallback)(t,r),{subscribe:c,getValue:a}=s(i,o),u=(0,Pe.useSyncExternalStore)(c,a,a);return(0,Pe.useDebugValue)(u),u}function qe(e,t){const r="function"!=typeof e,n=(0,Pe.useRef)(r);if(r!==n.current){const e=n.current?"static":"mapping";throw new Error(`Switching useSelect from ${e} to ${r?"static":"mapping"} is not allowed`)}return r?(o=e,Ge().select(o)):Xe(!1,e,t);var o}function Je(e,t){return Xe(!0,e,t)}const Qe=window.ReactJSXRuntime,Ye=e=>(0,O.createHigherOrderComponent)((t=>(0,O.pure)((r=>{const n=qe(((t,n)=>e(t,r,n)));return(0,Qe.jsx)(t,{...r,...n})}))),"withSelect"),Ze=(e,t)=>{const r=Ge(),n=(0,Pe.useRef)(e);return(0,O.useIsomorphicLayoutEffect)((()=>{n.current=e})),(0,Pe.useMemo)((()=>{const e=n.current(r.dispatch,r);return Object.fromEntries(Object.entries(e).map((([e,t])=>("function"!=typeof t&&console.warn(`Property ${e} returned from dispatchMap in useDispatchWithMap must be a function.`),[e,(...t)=>n.current(r.dispatch,r)[e](...t)]))))}),[r,...t])},et=e=>(0,O.createHigherOrderComponent)((t=>r=>{const n=Ze(((t,n)=>e(t,r,n)),[]);return(0,Qe.jsx)(t,{...r,...n})}),"withDispatch"),tt=(0,O.createHigherOrderComponent)((e=>t=>(0,Qe.jsx)(De,{children:r=>(0,Qe.jsx)(e,{...t,registry:r})})),"withRegistry"),rt=e=>{const{dispatch:t}=Ge();return void 0===e?t:t(e)};function nt(e){return ve.dispatch(e)}function ot(e){return ve.select(e)}const st=m,it=ve.resolveSelect,ct=ve.suspendSelect,at=ve.subscribe,ut=ve.registerGenericStore,lt=ve.registerStore,ft=ve.use,pt=ve.register;(window.wp=window.wp||{}).data=n})(); \ No newline at end of file diff --git a/wp-includes/js/dist/date.js b/wp-includes/js/dist/date.js index 16e9aaafe6..feac50253a 100644 --- a/wp-includes/js/dist/date.js +++ b/wp-includes/js/dist/date.js @@ -1178,6 +1178,7 @@ var moment_timezone_utils = __webpack_require__(1685); const external_wp_deprecated_namespaceObject = window["wp"]["deprecated"]; var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject); ;// ./node_modules/@wordpress/date/build-module/index.js +/* wp:polyfill */ /** * External dependencies */ @@ -1585,7 +1586,7 @@ function format(dateFormat, dateValue = new Date()) { continue; } if (char in formatMap) { - const formatter = formatMap[( /** @type {keyof formatMap} */char)]; + const formatter = formatMap[(/** @type {keyof formatMap} */char)]; if (typeof formatter !== 'string') { // If the format is a function, call it. newFormat.push('[' + formatter(momentDate) + ']'); @@ -1644,15 +1645,15 @@ function gmdate(dateFormat, dateValue = new Date()) { * Backward Compatibility Notice: if `timezone` is set to `true`, the function * behaves like `gmdateI18n`. * - * @param {string} dateFormat PHP-style formatting string. - * See php.net/date. - * @param {Moment | Date | string | undefined} dateValue Date object or string, parsable by - * moment.js. - * @param {string | number | boolean | undefined} timezone Timezone to output result in or a - * UTC offset. Defaults to timezone from - * site. Notice: `boolean` is effectively - * deprecated, but still supported for - * backward compatibility reasons. + * @param {string} dateFormat PHP-style formatting string. + * See php.net/date. + * @param {Moment | Date | string | undefined} dateValue Date object or string, parsable by + * moment.js. + * @param {string | number | boolean | undefined=} timezone Timezone to output result in or a + * UTC offset. Defaults to timezone from + * site. Notice: `boolean` is effectively + * deprecated, but still supported for + * backward compatibility reasons. * * @see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones * @see https://en.wikipedia.org/wiki/ISO_8601#Time_offsets_from_UTC @@ -1704,7 +1705,7 @@ function isInTheFuture(dateValue) { /** * Create and return a JavaScript Date Object from a date string in the WP timezone. * - * @param {string?} dateString Date formatted in the WP timezone. + * @param {?string} dateString Date formatted in the WP timezone. * * @return {Date} Date */ @@ -1747,7 +1748,7 @@ function buildMoment(dateValue, timezone = '') { const dateMoment = external_moment_default()(dateValue); if (timezone && !isUTCOffset(timezone)) { // The ! isUTCOffset() check guarantees that timezone is a string. - return dateMoment.tz( /** @type {string} */timezone); + return dateMoment.tz(/** @type {string} */timezone); } if (timezone && isUTCOffset(timezone)) { return dateMoment.utcOffset(timezone); diff --git a/wp-includes/js/dist/dom.js b/wp-includes/js/dist/dom.js index c417293605..849e8630e8 100644 --- a/wp-includes/js/dist/dom.js +++ b/wp-includes/js/dist/dom.js @@ -103,6 +103,7 @@ __webpack_require__.d(tabbable_namespaceObject, { }); ;// ./node_modules/@wordpress/dom/build-module/focusable.js +/* wp:polyfill */ /** * References: * @@ -197,13 +198,14 @@ function find(context, { nodeName } = element; if ('AREA' === nodeName) { - return isValidFocusableArea( /** @type {HTMLAreaElement} */element); + return isValidFocusableArea(/** @type {HTMLAreaElement} */element); } return true; }); } ;// ./node_modules/@wordpress/dom/build-module/tabbable.js +/* wp:polyfill */ /** * Internal dependencies */ @@ -250,7 +252,7 @@ function isTabbableIndex(element) { function createStatefulCollapseRadioGroup() { /** @type {Record} */ const CHOSEN_RADIO_BY_NAME = {}; - return function collapseRadioGroup( /** @type {MaybeHTMLInputElement[]} */result, /** @type {MaybeHTMLInputElement} */element) { + return function collapseRadioGroup(/** @type {MaybeHTMLInputElement[]} */result, /** @type {MaybeHTMLInputElement} */element) { const { nodeName, type, @@ -384,6 +386,7 @@ function assertIsDefined(val, name) { } ;// ./node_modules/@wordpress/dom/build-module/dom/get-rectangle-from-range.js +/* wp:polyfill */ /** * Internal dependencies */ @@ -733,7 +736,7 @@ function getScrollContainer(node, direction = 'vertical') { } // Continue traversing. - return getScrollContainer( /** @type {Element} */node.parentNode, direction); + return getScrollContainer(/** @type {Element} */node.parentNode, direction); } ;// ./node_modules/@wordpress/dom/build-module/dom/get-offset-parent.js @@ -768,7 +771,7 @@ function getOffsetParent(node) { // If the closest element is already positioned, return it, as offsetParent // does not otherwise consider the node itself. - if (getComputedStyle( /** @type {Element} */closestElement).position !== 'static') { + if (getComputedStyle(/** @type {Element} */closestElement).position !== 'static') { return closestElement; } @@ -902,6 +905,7 @@ function isRTL(element) { } ;// ./node_modules/@wordpress/dom/build-module/dom/get-range-height.js +/* wp:polyfill */ /** * Gets the height of the range without ignoring zero width rectangles, which * some browsers ignore when creating a union. @@ -1550,6 +1554,7 @@ function stripHTML(html) { } ;// ./node_modules/@wordpress/dom/build-module/dom/is-empty.js +/* wp:polyfill */ /** * Recursively checks if an element is empty. An element is not empty if it * contains text or contains elements with attributes such as images. @@ -1577,6 +1582,7 @@ function isEmpty(element) { } ;// ./node_modules/@wordpress/dom/build-module/phrasing-content.js +/* wp:polyfill */ /** * All phrasing content elements. * @@ -1784,6 +1790,7 @@ function isElement(node) { } ;// ./node_modules/@wordpress/dom/build-module/dom/clean-node-list.js +/* wp:polyfill */ /** * Internal dependencies */ @@ -1819,7 +1826,7 @@ const noop = () => {}; * @param {boolean} inline Whether to clean for inline mode. */ function cleanNodeList(nodeList, doc, schema, inline) { - Array.from(nodeList).forEach(( /** @type {Node & { nextElementSibling?: unknown }} */node) => { + Array.from(nodeList).forEach((/** @type {Node & { nextElementSibling?: unknown }} */node) => { const tag = node.nodeName.toLowerCase(); // It's a valid child, if the tag exists in the schema without an isMatch @@ -1855,10 +1862,13 @@ function cleanNodeList(nodeList, doc, schema, inline) { // TODO: Explore patching this in jsdom-jscore. if (node.classList && node.classList.length) { const mattchers = classes.map(item => { - if (typeof item === 'string') { - return ( /** @type {string} */className) => className === item; + if (item === '*') { + // Keep all classes. + return () => true; + } else if (typeof item === 'string') { + return (/** @type {string} */className) => className === item; } else if (item instanceof RegExp) { - return ( /** @type {string} */className) => item.test(className); + return (/** @type {string} */className) => item.test(className); } return noop; }); @@ -1970,6 +1980,7 @@ function removeInvalidHTML(HTML, schema, inline) { ;// ./node_modules/@wordpress/dom/build-module/data-transfer.js +/* wp:polyfill */ /** * Gets all files from a DataTransfer object. * diff --git a/wp-includes/js/dist/dom.min.js b/wp-includes/js/dist/dom.min.js index 7869e182fc..3c503d1561 100644 --- a/wp-includes/js/dist/dom.min.js +++ b/wp-includes/js/dist/dom.min.js @@ -1,2 +1,2 @@ /*! This file is auto-generated */ -(()=>{"use strict";var t={n:e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return t.d(n,{a:n}),n},d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{__unstableStripHTML:()=>J,computeCaretRect:()=>b,documentHasSelection:()=>w,documentHasTextSelection:()=>N,documentHasUncollapsedSelection:()=>C,focus:()=>ct,getFilesFromDataTransfer:()=>st,getOffsetParent:()=>S,getPhrasingContentSchema:()=>et,getRectangleFromRange:()=>g,getScrollContainer:()=>v,insertAfter:()=>q,isEmpty:()=>K,isEntirelySelected:()=>A,isFormElement:()=>D,isHorizontalEdge:()=>H,isNumberInput:()=>V,isPhrasingContent:()=>nt,isRTL:()=>P,isSelectionForward:()=>L,isTextContent:()=>rt,isTextField:()=>E,isVerticalEdge:()=>B,placeCaretAtHorizontalEdge:()=>U,placeCaretAtVerticalEdge:()=>z,remove:()=>W,removeInvalidHTML:()=>at,replace:()=>k,replaceTag:()=>G,safeHTML:()=>$,unwrap:()=>X,wrap:()=>Y});var n={};t.r(n),t.d(n,{find:()=>i});var r={};function o(t){return t.offsetWidth>0||t.offsetHeight>0||t.getClientRects().length>0}function i(t,{sequential:e=!1}={}){const n=t.querySelectorAll(function(t){return[t?'[tabindex]:not([tabindex^="-"])':"[tabindex]","a[href]","button:not([disabled])",'input:not([type="hidden"]):not([disabled])',"select:not([disabled])","textarea:not([disabled])",'iframe:not([tabindex^="-"])',"object","embed","area[href]","[contenteditable]:not([contenteditable=false])"].join(",")}(e));return Array.from(n).filter((t=>{if(!o(t))return!1;const{nodeName:e}=t;return"AREA"!==e||function(t){const e=t.closest("map[name]");if(!e)return!1;const n=t.ownerDocument.querySelector('img[usemap="#'+e.name+'"]');return!!n&&o(n)}(t)}))}function a(t){const e=t.getAttribute("tabindex");return null===e?0:parseInt(e,10)}function s(t){return-1!==a(t)}function c(t,e){return{element:t,index:e}}function u(t){return t.element}function l(t,e){const n=a(t.element),r=a(e.element);return n===r?t.index-e.index:n-r}function d(t){return t.filter(s).map(c).sort(l).map(u).reduce(function(){const t={};return function(e,n){const{nodeName:r,type:o,checked:i,name:a}=n;if("INPUT"!==r||"radio"!==o||!a)return e.concat(n);const s=t.hasOwnProperty(a);if(!i&&s)return e;if(s){const n=t[a];e=e.filter((t=>t!==n))}return t[a]=n,e.concat(n)}}(),[])}function f(t){return d(i(t))}function m(t){return d(i(t.ownerDocument.body)).reverse().find((e=>t.compareDocumentPosition(e)&t.DOCUMENT_POSITION_PRECEDING))}function h(t){return d(i(t.ownerDocument.body)).find((e=>t.compareDocumentPosition(e)&t.DOCUMENT_POSITION_FOLLOWING))}function p(t,e){0}function g(t){if(!t.collapsed){const e=Array.from(t.getClientRects());if(1===e.length)return e[0];const n=e.filter((({width:t})=>t>1));if(0===n.length)return t.getBoundingClientRect();if(1===n.length)return n[0];let{top:r,bottom:o,left:i,right:a}=n[0];for(const{top:t,bottom:e,left:s,right:c}of n)to&&(o=e),sa&&(a=c);return new window.DOMRect(i,r,a-i,o-r)}const{startContainer:e}=t,{ownerDocument:n}=e;if("BR"===e.nodeName){const{parentNode:r}=e;p();const o=Array.from(r.childNodes).indexOf(e);p(),(t=n.createRange()).setStart(r,o),t.setEnd(r,o)}const r=t.getClientRects();if(r.length>1)return null;let o=r[0];if(!o||0===o.height){p();const e=n.createTextNode("​");(t=t.cloneRange()).insertNode(e),o=t.getClientRects()[0],p(e.parentNode),e.parentNode.removeChild(e)}return o}function b(t){const e=t.getSelection();p();const n=e.rangeCount?e.getRangeAt(0):null;return n?g(n):null}function N(t){p(t.defaultView);const e=t.defaultView.getSelection();p();const n=e.rangeCount?e.getRangeAt(0):null;return!!n&&!n.collapsed}function y(t){return"INPUT"===t?.nodeName}function E(t){return y(t)&&t.type&&!["button","checkbox","hidden","file","radio","image","range","reset","submit","number","email","time"].includes(t.type)||"TEXTAREA"===t.nodeName||"true"===t.contentEditable}function C(t){return N(t)||!!t.activeElement&&function(t){if(!y(t)&&!E(t))return!1;try{const{selectionStart:e,selectionEnd:n}=t;return null===e||e!==n}catch(t){return!0}}(t.activeElement)}function w(t){return!!t.activeElement&&(y(t.activeElement)||E(t.activeElement)||N(t))}function T(t){return p(t.ownerDocument.defaultView),t.ownerDocument.defaultView.getComputedStyle(t)}function v(t,e="vertical"){if(t){if(("vertical"===e||"all"===e)&&t.scrollHeight>t.clientHeight){const{overflowY:e}=T(t);if(/(auto|scroll)/.test(e))return t}if(("horizontal"===e||"all"===e)&&t.scrollWidth>t.clientWidth){const{overflowX:e}=T(t);if(/(auto|scroll)/.test(e))return t}return t.ownerDocument===t.parentNode?t:v(t.parentNode,e)}}function S(t){let e;for(;(e=t.parentNode)&&e.nodeType!==e.ELEMENT_NODE;);return e?"static"!==T(e).position?e:e.offsetParent:null}function O(t){return"INPUT"===t.tagName||"TEXTAREA"===t.tagName}function A(t){if(O(t))return 0===t.selectionStart&&t.value.length===t.selectionEnd;if(!t.isContentEditable)return!0;const{ownerDocument:e}=t,{defaultView:n}=e;p();const r=n.getSelection();p();const o=r.rangeCount?r.getRangeAt(0):null;if(!o)return!0;const{startContainer:i,endContainer:a,startOffset:s,endOffset:c}=o;if(i===t&&a===t&&0===s&&c===t.childNodes.length)return!0;t.lastChild;p();const u=a.nodeType===a.TEXT_NODE?a.data.length:a.childNodes.length;return R(i,t,"firstChild")&&R(a,t,"lastChild")&&0===s&&c===u}function R(t,e,n){let r=e;do{if(t===r)return!0;r=r[n]}while(r);return!1}function D(t){if(!t)return!1;const{tagName:e}=t;return O(t)||"BUTTON"===e||"SELECT"===e}function P(t){return"rtl"===T(t).direction}function L(t){const{anchorNode:e,focusNode:n,anchorOffset:r,focusOffset:o}=t;p(),p();const i=e.compareDocumentPosition(n);return!(i&e.DOCUMENT_POSITION_PRECEDING)&&(!!(i&e.DOCUMENT_POSITION_FOLLOWING)||(0!==i||r<=o))}function M(t,e,n,r){const o=r.style.zIndex,i=r.style.position,{position:a="static"}=T(r);"static"===a&&(r.style.position="relative"),r.style.zIndex="10000";const s=function(t,e,n){if(t.caretRangeFromPoint)return t.caretRangeFromPoint(e,n);if(!t.caretPositionFromPoint)return null;const r=t.caretPositionFromPoint(e,n);if(!r)return null;const o=t.createRange();return o.setStart(r.offsetNode,r.offset),o.collapse(!0),o}(t,e,n);return r.style.zIndex=o,r.style.position=i,s}function x(t,e,n){let r=n();return r&&r.startContainer&&t.contains(r.startContainer)||(t.scrollIntoView(e),r=n(),r&&r.startContainer&&t.contains(r.startContainer))?r:null}function I(t,e,n=!1){if(O(t)&&"number"==typeof t.selectionStart)return t.selectionStart===t.selectionEnd&&(e?0===t.selectionStart:t.value.length===t.selectionStart);if(!t.isContentEditable)return!0;const{ownerDocument:r}=t,{defaultView:o}=r;p();const i=o.getSelection();if(!i||!i.rangeCount)return!1;const a=i.getRangeAt(0),s=a.cloneRange(),c=L(i),u=i.isCollapsed;u||s.collapse(!c);const l=g(s),d=g(a);if(!l||!d)return!1;const f=function(t){const e=Array.from(t.getClientRects());if(!e.length)return;const n=Math.min(...e.map((({top:t})=>t)));return Math.max(...e.map((({bottom:t})=>t)))-n}(a);if(!u&&f&&f>l.height&&c===e)return!1;const m=P(t)?!e:e,h=t.getBoundingClientRect(),b=m?h.left+1:h.right-1,N=e?h.top+1:h.bottom-1,y=x(t,e,(()=>M(r,b,N,t)));if(!y)return!1;const E=g(y);if(!E)return!1;const C=e?"top":"bottom",w=m?"left":"right",T=E[C]-d[C],v=E[w]-l[w],S=Math.abs(T)<=1,A=Math.abs(v)<=1;return n?S:S&&A}function H(t,e){return I(t,e)}t.r(r),t.d(r,{find:()=>f,findNext:()=>h,findPrevious:()=>m,isTabbableIndex:()=>s});const _=window.wp.deprecated;var F=t.n(_);function V(t){return F()("wp.dom.isNumberInput",{since:"6.1",version:"6.5"}),y(t)&&"number"===t.type&&!isNaN(t.valueAsNumber)}function B(t,e){return I(t,e,!0)}function j(t,e,n){if(!t)return;if(t.focus(),O(t)){if("number"!=typeof t.selectionStart)return;return void(e?(t.selectionStart=t.value.length,t.selectionEnd=t.value.length):(t.selectionStart=0,t.selectionEnd=0))}if(!t.isContentEditable)return;const r=x(t,e,(()=>function(t,e,n){const{ownerDocument:r}=t,o=P(t)?!e:e,i=t.getBoundingClientRect();return void 0===n?n=e?i.right-1:i.left+1:n<=i.left?n=i.left+1:n>=i.right&&(n=i.right-1),M(r,n,o?i.bottom-1:i.top+1,t)}(t,e,n)));if(!r)return;const{ownerDocument:o}=t,{defaultView:i}=o;p();const a=i.getSelection();p(),a.removeAllRanges(),a.addRange(r)}function U(t,e){return j(t,e,void 0)}function z(t,e,n){return j(t,e,n?.left)}function q(t,e){p(e.parentNode),e.parentNode.insertBefore(t,e.nextSibling)}function W(t){p(t.parentNode),t.parentNode.removeChild(t)}function k(t,e){p(t.parentNode),q(e,t.parentNode),W(t)}function X(t){const e=t.parentNode;for(p();t.firstChild;)e.insertBefore(t.firstChild,t);e.removeChild(t)}function G(t,e){const n=t.ownerDocument.createElement(e);for(;t.firstChild;)n.appendChild(t.firstChild);return p(t.parentNode),t.parentNode.replaceChild(n,t),n}function Y(t,e){p(e.parentNode),e.parentNode.insertBefore(t,e),t.appendChild(e)}function $(t){const{body:e}=document.implementation.createHTMLDocument("");e.innerHTML=t;const n=e.getElementsByTagName("*");let r=n.length;for(;r--;){const t=n[r];if("SCRIPT"===t.tagName)W(t);else{let e=t.attributes.length;for(;e--;){const{name:n}=t.attributes[e];n.startsWith("on")&&t.removeAttribute(n)}}}return e.innerHTML}function J(t){t=$(t);const e=document.implementation.createHTMLDocument("");return e.body.innerHTML=t,e.body.textContent||""}function K(t){switch(t.nodeType){case t.TEXT_NODE:return/^[ \f\n\r\t\v\u00a0]*$/.test(t.nodeValue||"");case t.ELEMENT_NODE:return!t.hasAttributes()&&(!t.hasChildNodes()||Array.from(t.childNodes).every(K));default:return!0}}const Q={strong:{},em:{},s:{},del:{},ins:{},a:{attributes:["href","target","rel","id"]},code:{},abbr:{attributes:["title"]},sub:{},sup:{},br:{},small:{},q:{attributes:["cite"]},dfn:{attributes:["title"]},data:{attributes:["value"]},time:{attributes:["datetime"]},var:{},samp:{},kbd:{},i:{},b:{},u:{},mark:{},ruby:{},rt:{},rp:{},bdi:{attributes:["dir"]},bdo:{attributes:["dir"]},wbr:{},"#text":{}},Z=["#text","br"];Object.keys(Q).filter((t=>!Z.includes(t))).forEach((t=>{const{[t]:e,...n}=Q;Q[t].children=n}));const tt={...Q,audio:{attributes:["src","preload","autoplay","mediagroup","loop","muted"]},canvas:{attributes:["width","height"]},embed:{attributes:["src","type","width","height"]},img:{attributes:["alt","src","srcset","usemap","ismap","width","height"]},object:{attributes:["data","type","name","usemap","form","width","height"]},video:{attributes:["src","poster","preload","playsinline","autoplay","mediagroup","loop","muted","controls","width","height"]}};function et(t){if("paste"!==t)return tt;const{u:e,abbr:n,data:r,time:o,wbr:i,bdi:a,bdo:s,...c}={...tt,ins:{children:tt.ins.children},del:{children:tt.del.children}};return c}function nt(t){const e=t.nodeName.toLowerCase();return et().hasOwnProperty(e)||"span"===e}function rt(t){const e=t.nodeName.toLowerCase();return Q.hasOwnProperty(e)||"span"===e}const ot=()=>{};function it(t,e,n,r){Array.from(t).forEach((t=>{const o=t.nodeName.toLowerCase();if(!n.hasOwnProperty(o)||n[o].isMatch&&!n[o].isMatch?.(t))it(t.childNodes,e,n,r),r&&!nt(t)&&t.nextElementSibling&&q(e.createElement("br"),t),X(t);else if(function(t){return!!t&&t.nodeType===t.ELEMENT_NODE}(t)){const{attributes:i=[],classes:a=[],children:s,require:c=[],allowEmpty:u}=n[o];if(s&&!u&&K(t))return void W(t);if(t.hasAttributes()&&(Array.from(t.attributes).forEach((({name:e})=>{"class"===e||i.includes(e)||t.removeAttribute(e)})),t.classList&&t.classList.length)){const e=a.map((t=>"string"==typeof t?e=>e===t:t instanceof RegExp?e=>t.test(e):ot));Array.from(t.classList).forEach((n=>{e.some((t=>t(n)))||t.classList.remove(n)})),t.classList.length||t.removeAttribute("class")}if(t.hasChildNodes()){if("*"===s)return;if(s)c.length&&!t.querySelector(c.join(","))?(it(t.childNodes,e,n,r),X(t)):t.parentNode&&"BODY"===t.parentNode.nodeName&&nt(t)?(it(t.childNodes,e,n,r),Array.from(t.childNodes).some((t=>!nt(t)))&&X(t)):it(t.childNodes,e,s,r);else for(;t.firstChild;)W(t.firstChild)}}}))}function at(t,e,n){const r=document.implementation.createHTMLDocument("");return r.body.innerHTML=t,it(r.body.childNodes,r,e,n),r.body.innerHTML}function st(t){const e=Array.from(t.files);return Array.from(t.items).forEach((t=>{const n=t.getAsFile();n&&!e.find((({name:t,type:e,size:r})=>t===n.name&&e===n.type&&r===n.size))&&e.push(n)})),e}const ct={focusable:n,tabbable:r};(window.wp=window.wp||{}).dom=e})(); \ No newline at end of file +(()=>{"use strict";var t={n:e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return t.d(n,{a:n}),n},d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{__unstableStripHTML:()=>J,computeCaretRect:()=>b,documentHasSelection:()=>w,documentHasTextSelection:()=>N,documentHasUncollapsedSelection:()=>C,focus:()=>ct,getFilesFromDataTransfer:()=>st,getOffsetParent:()=>S,getPhrasingContentSchema:()=>et,getRectangleFromRange:()=>g,getScrollContainer:()=>v,insertAfter:()=>q,isEmpty:()=>K,isEntirelySelected:()=>A,isFormElement:()=>D,isHorizontalEdge:()=>H,isNumberInput:()=>V,isPhrasingContent:()=>nt,isRTL:()=>P,isSelectionForward:()=>L,isTextContent:()=>rt,isTextField:()=>E,isVerticalEdge:()=>B,placeCaretAtHorizontalEdge:()=>U,placeCaretAtVerticalEdge:()=>z,remove:()=>W,removeInvalidHTML:()=>at,replace:()=>k,replaceTag:()=>G,safeHTML:()=>$,unwrap:()=>X,wrap:()=>Y});var n={};t.r(n),t.d(n,{find:()=>i});var r={};function o(t){return t.offsetWidth>0||t.offsetHeight>0||t.getClientRects().length>0}function i(t,{sequential:e=!1}={}){const n=t.querySelectorAll(function(t){return[t?'[tabindex]:not([tabindex^="-"])':"[tabindex]","a[href]","button:not([disabled])",'input:not([type="hidden"]):not([disabled])',"select:not([disabled])","textarea:not([disabled])",'iframe:not([tabindex^="-"])',"object","embed","area[href]","[contenteditable]:not([contenteditable=false])"].join(",")}(e));return Array.from(n).filter((t=>{if(!o(t))return!1;const{nodeName:e}=t;return"AREA"!==e||function(t){const e=t.closest("map[name]");if(!e)return!1;const n=t.ownerDocument.querySelector('img[usemap="#'+e.name+'"]');return!!n&&o(n)}(t)}))}function a(t){const e=t.getAttribute("tabindex");return null===e?0:parseInt(e,10)}function s(t){return-1!==a(t)}function c(t,e){return{element:t,index:e}}function u(t){return t.element}function l(t,e){const n=a(t.element),r=a(e.element);return n===r?t.index-e.index:n-r}function d(t){return t.filter(s).map(c).sort(l).map(u).reduce(function(){const t={};return function(e,n){const{nodeName:r,type:o,checked:i,name:a}=n;if("INPUT"!==r||"radio"!==o||!a)return e.concat(n);const s=t.hasOwnProperty(a);if(!i&&s)return e;if(s){const n=t[a];e=e.filter((t=>t!==n))}return t[a]=n,e.concat(n)}}(),[])}function f(t){return d(i(t))}function m(t){return d(i(t.ownerDocument.body)).reverse().find((e=>t.compareDocumentPosition(e)&t.DOCUMENT_POSITION_PRECEDING))}function h(t){return d(i(t.ownerDocument.body)).find((e=>t.compareDocumentPosition(e)&t.DOCUMENT_POSITION_FOLLOWING))}function p(t,e){0}function g(t){if(!t.collapsed){const e=Array.from(t.getClientRects());if(1===e.length)return e[0];const n=e.filter((({width:t})=>t>1));if(0===n.length)return t.getBoundingClientRect();if(1===n.length)return n[0];let{top:r,bottom:o,left:i,right:a}=n[0];for(const{top:t,bottom:e,left:s,right:c}of n)to&&(o=e),sa&&(a=c);return new window.DOMRect(i,r,a-i,o-r)}const{startContainer:e}=t,{ownerDocument:n}=e;if("BR"===e.nodeName){const{parentNode:r}=e;p();const o=Array.from(r.childNodes).indexOf(e);p(),(t=n.createRange()).setStart(r,o),t.setEnd(r,o)}const r=t.getClientRects();if(r.length>1)return null;let o=r[0];if(!o||0===o.height){p();const e=n.createTextNode("​");(t=t.cloneRange()).insertNode(e),o=t.getClientRects()[0],p(e.parentNode),e.parentNode.removeChild(e)}return o}function b(t){const e=t.getSelection();p();const n=e.rangeCount?e.getRangeAt(0):null;return n?g(n):null}function N(t){p(t.defaultView);const e=t.defaultView.getSelection();p();const n=e.rangeCount?e.getRangeAt(0):null;return!!n&&!n.collapsed}function y(t){return"INPUT"===t?.nodeName}function E(t){return y(t)&&t.type&&!["button","checkbox","hidden","file","radio","image","range","reset","submit","number","email","time"].includes(t.type)||"TEXTAREA"===t.nodeName||"true"===t.contentEditable}function C(t){return N(t)||!!t.activeElement&&function(t){if(!y(t)&&!E(t))return!1;try{const{selectionStart:e,selectionEnd:n}=t;return null===e||e!==n}catch(t){return!0}}(t.activeElement)}function w(t){return!!t.activeElement&&(y(t.activeElement)||E(t.activeElement)||N(t))}function T(t){return p(t.ownerDocument.defaultView),t.ownerDocument.defaultView.getComputedStyle(t)}function v(t,e="vertical"){if(t){if(("vertical"===e||"all"===e)&&t.scrollHeight>t.clientHeight){const{overflowY:e}=T(t);if(/(auto|scroll)/.test(e))return t}if(("horizontal"===e||"all"===e)&&t.scrollWidth>t.clientWidth){const{overflowX:e}=T(t);if(/(auto|scroll)/.test(e))return t}return t.ownerDocument===t.parentNode?t:v(t.parentNode,e)}}function S(t){let e;for(;(e=t.parentNode)&&e.nodeType!==e.ELEMENT_NODE;);return e?"static"!==T(e).position?e:e.offsetParent:null}function O(t){return"INPUT"===t.tagName||"TEXTAREA"===t.tagName}function A(t){if(O(t))return 0===t.selectionStart&&t.value.length===t.selectionEnd;if(!t.isContentEditable)return!0;const{ownerDocument:e}=t,{defaultView:n}=e;p();const r=n.getSelection();p();const o=r.rangeCount?r.getRangeAt(0):null;if(!o)return!0;const{startContainer:i,endContainer:a,startOffset:s,endOffset:c}=o;if(i===t&&a===t&&0===s&&c===t.childNodes.length)return!0;t.lastChild;p();const u=a.nodeType===a.TEXT_NODE?a.data.length:a.childNodes.length;return R(i,t,"firstChild")&&R(a,t,"lastChild")&&0===s&&c===u}function R(t,e,n){let r=e;do{if(t===r)return!0;r=r[n]}while(r);return!1}function D(t){if(!t)return!1;const{tagName:e}=t;return O(t)||"BUTTON"===e||"SELECT"===e}function P(t){return"rtl"===T(t).direction}function L(t){const{anchorNode:e,focusNode:n,anchorOffset:r,focusOffset:o}=t;p(),p();const i=e.compareDocumentPosition(n);return!(i&e.DOCUMENT_POSITION_PRECEDING)&&(!!(i&e.DOCUMENT_POSITION_FOLLOWING)||(0!==i||r<=o))}function M(t,e,n,r){const o=r.style.zIndex,i=r.style.position,{position:a="static"}=T(r);"static"===a&&(r.style.position="relative"),r.style.zIndex="10000";const s=function(t,e,n){if(t.caretRangeFromPoint)return t.caretRangeFromPoint(e,n);if(!t.caretPositionFromPoint)return null;const r=t.caretPositionFromPoint(e,n);if(!r)return null;const o=t.createRange();return o.setStart(r.offsetNode,r.offset),o.collapse(!0),o}(t,e,n);return r.style.zIndex=o,r.style.position=i,s}function x(t,e,n){let r=n();return r&&r.startContainer&&t.contains(r.startContainer)||(t.scrollIntoView(e),r=n(),r&&r.startContainer&&t.contains(r.startContainer))?r:null}function I(t,e,n=!1){if(O(t)&&"number"==typeof t.selectionStart)return t.selectionStart===t.selectionEnd&&(e?0===t.selectionStart:t.value.length===t.selectionStart);if(!t.isContentEditable)return!0;const{ownerDocument:r}=t,{defaultView:o}=r;p();const i=o.getSelection();if(!i||!i.rangeCount)return!1;const a=i.getRangeAt(0),s=a.cloneRange(),c=L(i),u=i.isCollapsed;u||s.collapse(!c);const l=g(s),d=g(a);if(!l||!d)return!1;const f=function(t){const e=Array.from(t.getClientRects());if(!e.length)return;const n=Math.min(...e.map((({top:t})=>t)));return Math.max(...e.map((({bottom:t})=>t)))-n}(a);if(!u&&f&&f>l.height&&c===e)return!1;const m=P(t)?!e:e,h=t.getBoundingClientRect(),b=m?h.left+1:h.right-1,N=e?h.top+1:h.bottom-1,y=x(t,e,(()=>M(r,b,N,t)));if(!y)return!1;const E=g(y);if(!E)return!1;const C=e?"top":"bottom",w=m?"left":"right",T=E[C]-d[C],v=E[w]-l[w],S=Math.abs(T)<=1,A=Math.abs(v)<=1;return n?S:S&&A}function H(t,e){return I(t,e)}t.r(r),t.d(r,{find:()=>f,findNext:()=>h,findPrevious:()=>m,isTabbableIndex:()=>s});const _=window.wp.deprecated;var F=t.n(_);function V(t){return F()("wp.dom.isNumberInput",{since:"6.1",version:"6.5"}),y(t)&&"number"===t.type&&!isNaN(t.valueAsNumber)}function B(t,e){return I(t,e,!0)}function j(t,e,n){if(!t)return;if(t.focus(),O(t)){if("number"!=typeof t.selectionStart)return;return void(e?(t.selectionStart=t.value.length,t.selectionEnd=t.value.length):(t.selectionStart=0,t.selectionEnd=0))}if(!t.isContentEditable)return;const r=x(t,e,(()=>function(t,e,n){const{ownerDocument:r}=t,o=P(t)?!e:e,i=t.getBoundingClientRect();return void 0===n?n=e?i.right-1:i.left+1:n<=i.left?n=i.left+1:n>=i.right&&(n=i.right-1),M(r,n,o?i.bottom-1:i.top+1,t)}(t,e,n)));if(!r)return;const{ownerDocument:o}=t,{defaultView:i}=o;p();const a=i.getSelection();p(),a.removeAllRanges(),a.addRange(r)}function U(t,e){return j(t,e,void 0)}function z(t,e,n){return j(t,e,n?.left)}function q(t,e){p(e.parentNode),e.parentNode.insertBefore(t,e.nextSibling)}function W(t){p(t.parentNode),t.parentNode.removeChild(t)}function k(t,e){p(t.parentNode),q(e,t.parentNode),W(t)}function X(t){const e=t.parentNode;for(p();t.firstChild;)e.insertBefore(t.firstChild,t);e.removeChild(t)}function G(t,e){const n=t.ownerDocument.createElement(e);for(;t.firstChild;)n.appendChild(t.firstChild);return p(t.parentNode),t.parentNode.replaceChild(n,t),n}function Y(t,e){p(e.parentNode),e.parentNode.insertBefore(t,e),t.appendChild(e)}function $(t){const{body:e}=document.implementation.createHTMLDocument("");e.innerHTML=t;const n=e.getElementsByTagName("*");let r=n.length;for(;r--;){const t=n[r];if("SCRIPT"===t.tagName)W(t);else{let e=t.attributes.length;for(;e--;){const{name:n}=t.attributes[e];n.startsWith("on")&&t.removeAttribute(n)}}}return e.innerHTML}function J(t){t=$(t);const e=document.implementation.createHTMLDocument("");return e.body.innerHTML=t,e.body.textContent||""}function K(t){switch(t.nodeType){case t.TEXT_NODE:return/^[ \f\n\r\t\v\u00a0]*$/.test(t.nodeValue||"");case t.ELEMENT_NODE:return!t.hasAttributes()&&(!t.hasChildNodes()||Array.from(t.childNodes).every(K));default:return!0}}const Q={strong:{},em:{},s:{},del:{},ins:{},a:{attributes:["href","target","rel","id"]},code:{},abbr:{attributes:["title"]},sub:{},sup:{},br:{},small:{},q:{attributes:["cite"]},dfn:{attributes:["title"]},data:{attributes:["value"]},time:{attributes:["datetime"]},var:{},samp:{},kbd:{},i:{},b:{},u:{},mark:{},ruby:{},rt:{},rp:{},bdi:{attributes:["dir"]},bdo:{attributes:["dir"]},wbr:{},"#text":{}},Z=["#text","br"];Object.keys(Q).filter((t=>!Z.includes(t))).forEach((t=>{const{[t]:e,...n}=Q;Q[t].children=n}));const tt={...Q,audio:{attributes:["src","preload","autoplay","mediagroup","loop","muted"]},canvas:{attributes:["width","height"]},embed:{attributes:["src","type","width","height"]},img:{attributes:["alt","src","srcset","usemap","ismap","width","height"]},object:{attributes:["data","type","name","usemap","form","width","height"]},video:{attributes:["src","poster","preload","playsinline","autoplay","mediagroup","loop","muted","controls","width","height"]}};function et(t){if("paste"!==t)return tt;const{u:e,abbr:n,data:r,time:o,wbr:i,bdi:a,bdo:s,...c}={...tt,ins:{children:tt.ins.children},del:{children:tt.del.children}};return c}function nt(t){const e=t.nodeName.toLowerCase();return et().hasOwnProperty(e)||"span"===e}function rt(t){const e=t.nodeName.toLowerCase();return Q.hasOwnProperty(e)||"span"===e}const ot=()=>{};function it(t,e,n,r){Array.from(t).forEach((t=>{const o=t.nodeName.toLowerCase();if(!n.hasOwnProperty(o)||n[o].isMatch&&!n[o].isMatch?.(t))it(t.childNodes,e,n,r),r&&!nt(t)&&t.nextElementSibling&&q(e.createElement("br"),t),X(t);else if(function(t){return!!t&&t.nodeType===t.ELEMENT_NODE}(t)){const{attributes:i=[],classes:a=[],children:s,require:c=[],allowEmpty:u}=n[o];if(s&&!u&&K(t))return void W(t);if(t.hasAttributes()&&(Array.from(t.attributes).forEach((({name:e})=>{"class"===e||i.includes(e)||t.removeAttribute(e)})),t.classList&&t.classList.length)){const e=a.map((t=>"*"===t?()=>!0:"string"==typeof t?e=>e===t:t instanceof RegExp?e=>t.test(e):ot));Array.from(t.classList).forEach((n=>{e.some((t=>t(n)))||t.classList.remove(n)})),t.classList.length||t.removeAttribute("class")}if(t.hasChildNodes()){if("*"===s)return;if(s)c.length&&!t.querySelector(c.join(","))?(it(t.childNodes,e,n,r),X(t)):t.parentNode&&"BODY"===t.parentNode.nodeName&&nt(t)?(it(t.childNodes,e,n,r),Array.from(t.childNodes).some((t=>!nt(t)))&&X(t)):it(t.childNodes,e,s,r);else for(;t.firstChild;)W(t.firstChild)}}}))}function at(t,e,n){const r=document.implementation.createHTMLDocument("");return r.body.innerHTML=t,it(r.body.childNodes,r,e,n),r.body.innerHTML}function st(t){const e=Array.from(t.files);return Array.from(t.items).forEach((t=>{const n=t.getAsFile();n&&!e.find((({name:t,type:e,size:r})=>t===n.name&&e===n.type&&r===n.size))&&e.push(n)})),e}const ct={focusable:n,tabbable:r};(window.wp=window.wp||{}).dom=e})(); \ No newline at end of file diff --git a/wp-includes/js/dist/edit-post.js b/wp-includes/js/dist/edit-post.js index 153c056028..1deddc4bff 100644 --- a/wp-includes/js/dist/edit-post.js +++ b/wp-includes/js/dist/edit-post.js @@ -95,18 +95,12 @@ __webpack_require__.d(actions_namespaceObject, { toggleEditorPanelEnabled: () => (toggleEditorPanelEnabled), toggleEditorPanelOpened: () => (toggleEditorPanelOpened), toggleFeature: () => (toggleFeature), + toggleFullscreenMode: () => (toggleFullscreenMode), togglePinnedPluginItem: () => (togglePinnedPluginItem), togglePublishSidebar: () => (togglePublishSidebar), updatePreferredStyleVariations: () => (updatePreferredStyleVariations) }); -// NAMESPACE OBJECT: ./node_modules/@wordpress/edit-post/build-module/store/private-selectors.js -var private_selectors_namespaceObject = {}; -__webpack_require__.r(private_selectors_namespaceObject); -__webpack_require__.d(private_selectors_namespaceObject, { - getEditedPostTemplateId: () => (getEditedPostTemplateId) -}); - // NAMESPACE OBJECT: ./node_modules/@wordpress/edit-post/build-module/store/selectors.js var selectors_namespaceObject = {}; __webpack_require__.r(selectors_namespaceObject); @@ -322,10 +316,8 @@ function FullscreenModeClose({ const buttonLabel = (_postType$labels$view = postType?.labels?.view_items) !== null && _postType$labels$view !== void 0 ? _postType$labels$view : (0,external_wp_i18n_namespaceObject.__)('Back'); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableMotion.div, { whileHover: "expand", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button - // TODO: Switch to `true` (40px size) if possible - , { - __next40pxDefaultSize: false, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + __next40pxDefaultSize: true, className: classes, href: buttonHref, label: buttonLabel, @@ -588,6 +580,7 @@ const getMetaBoxContainer = location => { }; ;// ./node_modules/@wordpress/edit-post/build-module/store/actions.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -598,6 +591,8 @@ const getMetaBoxContainer = location => { + + /** * Internal dependencies */ @@ -1063,63 +1058,28 @@ const toggleDistractionFree = () => ({ registry.dispatch(external_wp_editor_namespaceObject.store).toggleDistractionFree(); }; -;// ./node_modules/@wordpress/edit-post/build-module/store/private-selectors.js /** - * WordPress dependencies + * Action that toggles the Fullscreen Mode view option. */ - - - -const getEditedPostTemplateId = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => { - const { - id: postId, - type: postType, - slug - } = select(external_wp_editor_namespaceObject.store).getCurrentPost(); - const { - getEntityRecord, - getEntityRecords, - canUser - } = select(external_wp_coreData_namespaceObject.store); - const siteSettings = canUser('read', { - kind: 'root', - name: 'site' - }) ? getEntityRecord('root', 'site') : undefined; - // First check if the current page is set as the posts page. - const isPostsPage = +postId === siteSettings?.page_for_posts; - if (isPostsPage) { - return select(external_wp_coreData_namespaceObject.store).getDefaultTemplateId({ - slug: 'home' - }); - } - const currentTemplate = select(external_wp_editor_namespaceObject.store).getEditedPostAttribute('template'); - if (currentTemplate) { - const templateWithSameSlug = getEntityRecords('postType', 'wp_template', { - per_page: -1 - })?.find(template => template.slug === currentTemplate); - if (!templateWithSameSlug) { - return templateWithSameSlug; - } - return templateWithSameSlug.id; - } - let slugToCheck; - // In `draft` status we might not have a slug available, so we use the `single` - // post type templates slug(ex page, single-post, single-product etc..). - // Pages do not need the `single` prefix in the slug to be prioritized - // through template hierarchy. - if (slug) { - slugToCheck = postType === 'page' ? `${postType}-${slug}` : `single-${postType}-${slug}`; - } else { - slugToCheck = postType === 'page' ? 'page' : `single-${postType}`; - } - if (postType) { - return select(external_wp_coreData_namespaceObject.store).getDefaultTemplateId({ - slug: slugToCheck - }); - } -}); +const toggleFullscreenMode = () => ({ + registry +}) => { + const isFullscreen = registry.select(external_wp_preferences_namespaceObject.store).get('core/edit-post', 'fullscreenMode'); + registry.dispatch(external_wp_preferences_namespaceObject.store).toggle('core/edit-post', 'fullscreenMode'); + registry.dispatch(external_wp_notices_namespaceObject.store).createInfoNotice(isFullscreen ? (0,external_wp_i18n_namespaceObject.__)('Fullscreen mode activated.') : (0,external_wp_i18n_namespaceObject.__)('Fullscreen mode deactivated.'), { + id: 'core/edit-post/toggle-fullscreen-mode/notice', + type: 'snackbar', + actions: [{ + label: (0,external_wp_i18n_namespaceObject.__)('Undo'), + onClick: () => { + registry.dispatch(external_wp_preferences_namespaceObject.store).toggle('core/edit-post', 'fullscreenMode'); + } + }] + }); +}; ;// ./node_modules/@wordpress/edit-post/build-module/store/selectors.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -1133,7 +1093,6 @@ const getEditedPostTemplateId = (0,external_wp_data_namespaceObject.createRegist * Internal dependencies */ - const { interfaceStore: selectors_interfaceStore } = unlock(external_wp_editor_namespaceObject.privateApis); @@ -1559,7 +1518,7 @@ const __experimentalGetInsertionPoint = (0,external_wp_data_namespaceObject.crea since: '6.5', version: '6.7' }); - return unlock(select(external_wp_editor_namespaceObject.store)).getInsertionPoint(); + return unlock(select(external_wp_editor_namespaceObject.store)).getInserter(); }); /** @@ -1604,10 +1563,14 @@ function areMetaBoxesInitialized(state) { /** * Retrieves the template of the currently edited post. * - * @return {Object?} Post Template. + * @return {?Object} Post Template. */ -const getEditedPostTemplate = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => state => { - const templateId = getEditedPostTemplateId(state); +const getEditedPostTemplate = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => { + const { + id: postId, + type: postType + } = select(external_wp_editor_namespaceObject.store).getCurrentPost(); + const templateId = unlock(select(external_wp_coreData_namespaceObject.store)).getTemplateId(postType, postId); if (!templateId) { return undefined; } @@ -1628,8 +1591,6 @@ const getEditedPostTemplate = (0,external_wp_data_namespaceObject.createRegistry - - /** * Store definition for the edit post namespace. * @@ -1643,7 +1604,6 @@ const store = (0,external_wp_data_namespaceObject.createReduxStore)(STORE_NAME, selectors: selectors_namespaceObject }); (0,external_wp_data_namespaceObject.register)(store); -unlock(store).registerPrivateSelectors(private_selectors_namespaceObject); ;// ./node_modules/@wordpress/edit-post/build-module/components/keyboard-shortcuts/index.js /** @@ -1660,7 +1620,7 @@ unlock(store).registerPrivateSelectors(private_selectors_namespaceObject); function KeyboardShortcuts() { const { - toggleFeature + toggleFullscreenMode } = (0,external_wp_data_namespaceObject.useDispatch)(store); const { registerShortcut @@ -1669,7 +1629,7 @@ function KeyboardShortcuts() { registerShortcut({ name: 'core/edit-post/toggle-fullscreen', category: 'global', - description: (0,external_wp_i18n_namespaceObject.__)('Toggle fullscreen mode.'), + description: (0,external_wp_i18n_namespaceObject.__)('Enable or disable fullscreen mode.'), keyCombination: { modifier: 'secondary', character: 'f' @@ -1677,7 +1637,7 @@ function KeyboardShortcuts() { }); }, []); (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/edit-post/toggle-fullscreen', () => { - toggleFeature('fullscreenMode'); + toggleFullscreenMode(); }); return null; } @@ -1693,13 +1653,10 @@ function KeyboardShortcuts() { - - function InitPatternModal() { const { editPost } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_editor_namespaceObject.store); - const [isModalOpen, setIsModalOpen] = (0,external_wp_element_namespaceObject.useState)(false); const [syncType, setSyncType] = (0,external_wp_element_namespaceObject.useState)(undefined); const [title, setTitle] = (0,external_wp_element_namespaceObject.useState)(''); const { @@ -1715,13 +1672,7 @@ function InitPatternModal() { isNewPost: isCleanNewPost() }; }, []); - (0,external_wp_element_namespaceObject.useEffect)(() => { - if (isNewPost && postType === 'wp_block') { - setIsModalOpen(true); - } - // We only want the modal to open when the page is first loaded. - // eslint-disable-next-line react-hooks/exhaustive-deps - }, []); + const [isModalOpen, setIsModalOpen] = (0,external_wp_element_namespaceObject.useState)(() => isNewPost && postType === 'wp_block'); if (postType !== 'wp_block' || !isNewPost) { return null; } @@ -1763,10 +1714,8 @@ function InitPatternModal() { } }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "right", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button - // TODO: Switch to `true` (40px size) if possible - , { - __next40pxDefaultSize: false, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + __next40pxDefaultSize: true, variant: "primary", type: "submit", disabled: !title, @@ -1812,13 +1761,12 @@ class BrowserURL extends external_wp_element_namespaceObject.Component { componentDidUpdate(prevProps) { const { postId, - postStatus, - hasHistory + postStatus } = this.props; const { historyId } = this.state; - if ((postId !== prevProps.postId || postId !== historyId) && postStatus !== 'auto-draft' && postId && !hasHistory) { + if ((postId !== prevProps.postId || postId !== historyId) && postStatus !== 'auto-draft' && postId) { this.setBrowserURL(postId); } } @@ -1890,7 +1838,6 @@ class BrowserURL extends external_wp_element_namespaceObject.Component { * @return {Component} The component to be rendered. */ - function MetaBoxesArea({ location }) { @@ -1932,20 +1879,13 @@ function MetaBoxesArea({ -class MetaBoxVisibility extends external_wp_element_namespaceObject.Component { - componentDidMount() { - this.updateDOM(); - } - componentDidUpdate(prevProps) { - if (this.props.isVisible !== prevProps.isVisible) { - this.updateDOM(); - } - } - updateDOM() { - const { - id, - isVisible - } = this.props; +function MetaBoxVisibility({ + id +}) { + const isVisible = (0,external_wp_data_namespaceObject.useSelect)(select => { + return select(external_wp_editor_namespaceObject.store).isEditorPanelEnabled(`meta-box-${id}`); + }, [id]); + (0,external_wp_element_namespaceObject.useEffect)(() => { const element = document.getElementById(id); if (!element) { return; @@ -1955,25 +1895,17 @@ class MetaBoxVisibility extends external_wp_element_namespaceObject.Component { } else { element.classList.add('is-hidden'); } - } - render() { - return null; - } + }, [id, isVisible]); + return null; } -/* harmony default export */ const meta_box_visibility = ((0,external_wp_data_namespaceObject.withSelect)((select, { - id -}) => ({ - isVisible: select(external_wp_editor_namespaceObject.store).isEditorPanelEnabled(`meta-box-${id}`) -}))(MetaBoxVisibility)); ;// ./node_modules/@wordpress/edit-post/build-module/components/meta-boxes/index.js +/* wp:polyfill */ /** * WordPress dependencies */ - - /** * Internal dependencies */ @@ -1981,47 +1913,14 @@ class MetaBoxVisibility extends external_wp_element_namespaceObject.Component { - - function MetaBoxes({ location }) { - const registry = (0,external_wp_data_namespaceObject.useRegistry)(); - const { - metaBoxes, - areMetaBoxesInitialized, - isEditorReady - } = (0,external_wp_data_namespaceObject.useSelect)(select => { - const { - __unstableIsEditorReady - } = select(external_wp_editor_namespaceObject.store); - const { - getMetaBoxesPerLocation, - areMetaBoxesInitialized: _areMetaBoxesInitialized - } = select(store); - return { - metaBoxes: getMetaBoxesPerLocation(location), - areMetaBoxesInitialized: _areMetaBoxesInitialized(), - isEditorReady: __unstableIsEditorReady() - }; - }, [location]); - const hasMetaBoxes = !!metaBoxes?.length; - - // When editor is ready, initialize postboxes (wp core script) and metabox - // saving. This initializes all meta box locations, not just this specific - // one. - (0,external_wp_element_namespaceObject.useEffect)(() => { - if (isEditorReady && hasMetaBoxes && !areMetaBoxesInitialized) { - registry.dispatch(store).initializeMetaBoxes(); - } - }, [isEditorReady, hasMetaBoxes, areMetaBoxesInitialized]); - if (!areMetaBoxesInitialized) { - return null; - } + const metaBoxes = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).getMetaBoxesPerLocation(location), [location]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [(metaBoxes !== null && metaBoxes !== void 0 ? metaBoxes : []).map(({ id - }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(meta_box_visibility, { + }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MetaBoxVisibility, { id: id }, id)), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(meta_boxes_area, { location: location @@ -2104,8 +2003,6 @@ function WelcomeGuideMenuItem() { */ - - const { PreferenceBaseOption } = unlock(external_wp_preferences_namespaceObject.privateApis); @@ -2124,11 +2021,8 @@ function CustomFieldsConfirmation({ children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "edit-post-preferences-modal__custom-fields-confirmation-message", children: (0,external_wp_i18n_namespaceObject.__)('A page reload is required for this change. Make sure your content is saved before reloading.') - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button - // TODO: Switch to `true` (40px size) if possible - , { - __next40pxDefaultSize: false, - className: "edit-post-preferences-modal__custom-fields-confirmation-button", + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + __next40pxDefaultSize: true, variant: "secondary", isBusy: isReloading, accessibleWhenDisabled: true, @@ -2142,9 +2036,11 @@ function CustomFieldsConfirmation({ }); } function EnableCustomFieldsOption({ - label, - areCustomFieldsEnabled + label }) { + const areCustomFieldsEnabled = (0,external_wp_data_namespaceObject.useSelect)(select => { + return !!select(external_wp_editor_namespaceObject.store).getEditorSettings().enableCustomFields; + }, []); const [isChecked, setIsChecked] = (0,external_wp_element_namespaceObject.useState)(areCustomFieldsEnabled); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreferenceBaseOption, { label: label, @@ -2155,9 +2051,6 @@ function EnableCustomFieldsOption({ }) }); } -/* harmony default export */ const enable_custom_fields = ((0,external_wp_data_namespaceObject.withSelect)(select => ({ - areCustomFieldsEnabled: !!select(external_wp_editor_namespaceObject.store).getEditorSettings().enableCustomFields -}))(EnableCustomFieldsOption)); ;// ./node_modules/@wordpress/edit-post/build-module/components/preferences-modal/enable-panel.js /** @@ -2167,34 +2060,43 @@ function EnableCustomFieldsOption({ - /** * Internal dependencies */ + const { PreferenceBaseOption: enable_panel_PreferenceBaseOption } = unlock(external_wp_preferences_namespaceObject.privateApis); -/* harmony default export */ const enable_panel = ((0,external_wp_compose_namespaceObject.compose)((0,external_wp_data_namespaceObject.withSelect)((select, { - panelName -}) => { +function EnablePanelOption(props) { const { - isEditorPanelEnabled, - isEditorPanelRemoved - } = select(external_wp_editor_namespaceObject.store); - return { - isRemoved: isEditorPanelRemoved(panelName), - isChecked: isEditorPanelEnabled(panelName) - }; -}), (0,external_wp_compose_namespaceObject.ifCondition)(({ - isRemoved -}) => !isRemoved), (0,external_wp_data_namespaceObject.withDispatch)((dispatch, { - panelName -}) => ({ - onChange: () => dispatch(external_wp_editor_namespaceObject.store).toggleEditorPanelEnabled(panelName) -})))(enable_panel_PreferenceBaseOption)); + toggleEditorPanelEnabled + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_editor_namespaceObject.store); + const { + isChecked, + isRemoved + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + isEditorPanelEnabled, + isEditorPanelRemoved + } = select(external_wp_editor_namespaceObject.store); + return { + isChecked: isEditorPanelEnabled(props.panelName), + isRemoved: isEditorPanelRemoved(props.panelName) + }; + }, [props.panelName]); + if (isRemoved) { + return null; + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(enable_panel_PreferenceBaseOption, { + isChecked: isChecked, + onChange: () => toggleEditorPanelEnabled(props.panelName), + ...props + }); +} ;// ./node_modules/@wordpress/edit-post/build-module/components/preferences-modal/meta-boxes-section.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -2211,7 +2113,6 @@ const { - const { PreferencesModalSection } = unlock(external_wp_preferences_namespaceObject.privateApis); @@ -2229,12 +2130,12 @@ function MetaBoxesSection({ } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(PreferencesModalSection, { ...sectionProps, - children: [areCustomFieldsRegistered && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(enable_custom_fields, { + children: [areCustomFieldsRegistered && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EnableCustomFieldsOption, { label: (0,external_wp_i18n_namespaceObject.__)('Custom fields') }), thirdPartyMetaBoxes.map(({ id, title - }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(enable_panel, { + }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EnablePanelOption, { label: title, panelName: `meta-box-${id}` }, id))] @@ -2310,8 +2211,6 @@ function EditPostPreferencesModal() { - - const { ToolsMoreMenuGroup, ViewMoreMenuGroup @@ -2325,8 +2224,8 @@ const MoreMenu = () => { name: "fullscreenMode", label: (0,external_wp_i18n_namespaceObject.__)('Fullscreen mode'), info: (0,external_wp_i18n_namespaceObject.__)('Show and hide the admin user interface'), - messageActivated: (0,external_wp_i18n_namespaceObject.__)('Fullscreen mode activated'), - messageDeactivated: (0,external_wp_i18n_namespaceObject.__)('Fullscreen mode deactivated'), + messageActivated: (0,external_wp_i18n_namespaceObject.__)('Fullscreen mode activated.'), + messageDeactivated: (0,external_wp_i18n_namespaceObject.__)('Fullscreen mode deactivated.'), shortcut: external_wp_keycodes_namespaceObject.displayShortcut.secondary('f') }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(ToolsMoreMenuGroup, { @@ -2338,7 +2237,6 @@ const MoreMenu = () => { ;// ./node_modules/@wordpress/edit-post/build-module/components/welcome-guide/image.js - function WelcomeGuideImage({ nonAnimatedSrc, animatedSrc @@ -2372,15 +2270,13 @@ function WelcomeGuideImage({ - - function WelcomeGuideDefault() { const { toggleFeature } = (0,external_wp_data_namespaceObject.useDispatch)(store); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Guide, { className: "edit-post-welcome-guide", - contentLabel: (0,external_wp_i18n_namespaceObject.__)('Welcome to the block editor'), + contentLabel: (0,external_wp_i18n_namespaceObject.__)('Welcome to the editor'), finishButtonText: (0,external_wp_i18n_namespaceObject.__)('Get started'), onFinish: () => toggleFeature('welcomeGuide'), pages: [{ @@ -2391,7 +2287,7 @@ function WelcomeGuideDefault() { content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h1", { className: "edit-post-welcome-guide__heading", - children: (0,external_wp_i18n_namespaceObject.__)('Welcome to the block editor') + children: (0,external_wp_i18n_namespaceObject.__)('Welcome to the editor') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "edit-post-welcome-guide__text", children: (0,external_wp_i18n_namespaceObject.__)('In the WordPress editor, each paragraph, image, or video is presented as a distinct “block” of content.') @@ -2405,7 +2301,7 @@ function WelcomeGuideDefault() { content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h1", { className: "edit-post-welcome-guide__heading", - children: (0,external_wp_i18n_namespaceObject.__)('Make each block your own') + children: (0,external_wp_i18n_namespaceObject.__)('Customize each block') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "edit-post-welcome-guide__text", children: (0,external_wp_i18n_namespaceObject.__)('Each block comes with its own set of controls for changing things like color, width, and alignment. These will show and hide automatically when you have a block selected.') @@ -2419,7 +2315,7 @@ function WelcomeGuideDefault() { content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h1", { className: "edit-post-welcome-guide__heading", - children: (0,external_wp_i18n_namespaceObject.__)('Get to know the block library') + children: (0,external_wp_i18n_namespaceObject.__)('Explore all blocks') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "edit-post-welcome-guide__text", children: (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.__)('All of the blocks available to you live in the block library. You’ll find it wherever you see the icon.'), { @@ -2438,7 +2334,7 @@ function WelcomeGuideDefault() { content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h1", { className: "edit-post-welcome-guide__heading", - children: (0,external_wp_i18n_namespaceObject.__)('Learn how to use the block editor') + children: (0,external_wp_i18n_namespaceObject.__)('Learn more') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "edit-post-welcome-guide__text", children: (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.__)("New to the block editor? Want to learn more about using it? Here's a detailed guide."), { @@ -2466,8 +2362,6 @@ function WelcomeGuideDefault() { - - function WelcomeGuideTemplate() { const { toggleFeature @@ -2604,9 +2498,13 @@ function useCommands() { -function usePaddingAppender() { + +// Ruleset to add space for the typewriter effect. When typing in the last +// block, there needs to be room to scroll up. +const CSS = ':root :where(.editor-styles-wrapper)::after {content: ""; display: block; height: 40vh;}'; +function usePaddingAppender(enabled) { const registry = (0,external_wp_data_namespaceObject.useRegistry)(); - return (0,external_wp_compose_namespaceObject.useRefEffect)(node => { + const effect = (0,external_wp_compose_namespaceObject.useRefEffect)(node => { function onMouseDown(event) { if (event.target !== node && // Tests for the parent element because in the iframed editor if the click is @@ -2615,16 +2513,6 @@ function usePaddingAppender() { event.target !== node.parentElement) { return; } - const { - ownerDocument - } = node; - const { - defaultView - } = ownerDocument; - const pseudoHeight = defaultView.parseInt(defaultView.getComputedStyle(node, ':after').height, 10); - if (!pseudoHeight) { - return; - } // Only handle clicks under the last child. const lastChild = node.lastElementChild; @@ -2659,9 +2547,11 @@ function usePaddingAppender() { ownerDocument.removeEventListener('mousedown', onMouseDown); }; }, [registry]); + return enabled ? [effect, CSS] : []; } ;// ./node_modules/@wordpress/edit-post/build-module/components/layout/use-should-iframe.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -2669,35 +2559,33 @@ function usePaddingAppender() { -const isGutenbergPlugin = false ? 0 : false; + +/** + * Internal dependencies + */ + function useShouldIframe() { - const { - isBlockBasedTheme, - hasV3BlocksOnly, - isEditingTemplate, - isZoomOutMode - } = (0,external_wp_data_namespaceObject.useSelect)(select => { + return (0,external_wp_data_namespaceObject.useSelect)(select => { const { getEditorSettings, - getCurrentPostType + getCurrentPostType, + getDeviceType } = select(external_wp_editor_namespaceObject.store); - const { - __unstableGetEditorMode - } = select(external_wp_blockEditor_namespaceObject.store); - const { - getBlockTypes - } = select(external_wp_blocks_namespaceObject.store); - const editorSettings = getEditorSettings(); - return { - isBlockBasedTheme: editorSettings.__unstableIsBlockBasedTheme, - hasV3BlocksOnly: getBlockTypes().every(type => { - return type.apiVersion >= 3; - }), - isEditingTemplate: getCurrentPostType() === 'wp_template', - isZoomOutMode: __unstableGetEditorMode() === 'zoom-out' - }; + return ( + // If the theme is block based, we ALWAYS use the iframe for + // consistency across the post and site editor. The iframe was + // introduced long before the sited editor and block themes, so + // these themes are expecting it. + getEditorSettings().__unstableIsBlockBasedTheme || + // For classic themes, we also still want to iframe all the special + // editor features and modes such as device previews, zoom out, and + // template/pattern editing. + getDeviceType() !== 'Desktop' || ['wp_template', 'wp_block'].includes(getCurrentPostType()) || unlock(select(external_wp_blockEditor_namespaceObject.store)).isZoomOut() || + // Finally, still iframe the editor for classic themes if all blocks + // are v3 (which means they are marked as iframe-compatible). + select(external_wp_blocks_namespaceObject.store).getBlockTypes().every(type => type.apiVersion >= 3) + ); }, []); - return hasV3BlocksOnly || isGutenbergPlugin && isBlockBasedTheme || isEditingTemplate || isZoomOutMode; } ;// ./node_modules/@wordpress/edit-post/build-module/hooks/use-navigate-to-entity-record.js @@ -2785,6 +2673,38 @@ function useNavigateToEntityRecord(initialPostId, initialPostType, defaultRender }; } +;// ./node_modules/@wordpress/edit-post/build-module/components/meta-boxes/use-meta-box-initialization.js +/** + * WordPress dependencies + */ + + + + +/** + * Internal dependencies + */ + + +/** + * Initializes WordPress `postboxes` script and the logic for saving meta boxes. + * + * @param { boolean } enabled + */ +const useMetaBoxInitialization = enabled => { + const isEnabledAndEditorReady = (0,external_wp_data_namespaceObject.useSelect)(select => enabled && select(external_wp_editor_namespaceObject.store).__unstableIsEditorReady(), [enabled]); + const { + initializeMetaBoxes + } = (0,external_wp_data_namespaceObject.useDispatch)(store); + // The effect has to rerun when the editor is ready because initializeMetaBoxes + // will noop until then. + (0,external_wp_element_namespaceObject.useEffect)(() => { + if (isEnabledAndEditorReady) { + initializeMetaBoxes(); + } + }, [isEnabledAndEditorReady, initializeMetaBoxes]); +}; + ;// ./node_modules/@wordpress/edit-post/build-module/components/layout/index.js /** * External dependencies @@ -2831,7 +2751,6 @@ function useNavigateToEntityRecord(initialPostId, initialPostType, defaultRender - const { getLayoutStyles } = unlock(external_wp_blockEditor_namespaceObject.privateApis); @@ -2850,30 +2769,17 @@ const { BlockKeyboardShortcuts } = unlock(external_wp_blockLibrary_namespaceObject.privateApis); const DESIGN_POST_TYPES = ['wp_template', 'wp_template_part', 'wp_block', 'wp_navigation']; -function useEditorStyles() { +function useEditorStyles(...additionalStyles) { const { hasThemeStyleSupport, - editorSettings, - isZoomedOutView, - renderingMode, - postType + editorSettings } = (0,external_wp_data_namespaceObject.useSelect)(select => { - const { - __unstableGetEditorMode - } = select(external_wp_blockEditor_namespaceObject.store); - const { - getCurrentPostType, - getRenderingMode - } = select(external_wp_editor_namespaceObject.store); - const _postType = getCurrentPostType(); return { hasThemeStyleSupport: select(store).isFeatureActive('themeStyles'), - editorSettings: select(external_wp_editor_namespaceObject.store).getEditorSettings(), - isZoomedOutView: __unstableGetEditorMode() === 'zoom-out', - renderingMode: getRenderingMode(), - postType: _postType + editorSettings: select(external_wp_editor_namespaceObject.store).getEditorSettings() }; }, []); + const addedStyles = additionalStyles.join('\n'); // Compute the default styles. return (0,external_wp_element_namespaceObject.useMemo)(() => { @@ -2898,25 +2804,15 @@ function useEditorStyles() { }); } const baseStyles = hasThemeStyles ? (_editorSettings$style3 = editorSettings.styles) !== null && _editorSettings$style3 !== void 0 ? _editorSettings$style3 : [] : defaultEditorStyles; - - // Add a space for the typewriter effect. When typing in the last block, - // there needs to be room to scroll up. - if (!isZoomedOutView && renderingMode === 'post-only' && !DESIGN_POST_TYPES.includes(postType)) { + if (addedStyles) { return [...baseStyles, { - css: ':root :where(.editor-styles-wrapper)::after {content: ""; display: block; height: 40vh;}' + css: addedStyles }]; } return baseStyles; - }, [editorSettings.defaultEditorStyles, editorSettings.disableLayoutStyles, editorSettings.styles, hasThemeStyleSupport, postType]); + }, [editorSettings.defaultEditorStyles, editorSettings.disableLayoutStyles, editorSettings.styles, hasThemeStyleSupport, addedStyles]); } - -/** - * @param {Object} props - * @param {boolean} props.isLegacy True when the editor canvas is not in an iframe. - */ -function MetaBoxesMain({ - isLegacy -}) { +function MetaBoxesMain() { const [isOpen, openHeight, hasAnyVisible] = (0,external_wp_data_namespaceObject.useSelect)(select => { const { get @@ -2937,7 +2833,7 @@ function MetaBoxesMain({ }, setHeightConstraints] = (0,external_wp_element_namespaceObject.useState)(() => ({})); // Keeps the resizable area’s size constraints updated taking into account // editor notices. The constraints are also used to derive the value for the - // aria-valuenow attribute on the seperator. + // aria-valuenow attribute on the separator. const effectSizeConstraints = (0,external_wp_compose_namespaceObject.useRefEffect)(node => { const container = node.closest('.interface-interface-skeleton__content'); const noticeLists = container.querySelectorAll(':scope > .components-notice-list'); @@ -2986,19 +2882,15 @@ function MetaBoxesMain({ return; } const contents = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { - className: dist_clsx( // The class name 'edit-post-layout__metaboxes' is retained because some plugins use it. - 'edit-post-layout__metaboxes', !isLegacy && 'edit-post-meta-boxes-main__liner'), - hidden: !isLegacy && isShort && !isOpen, + className: "edit-post-layout__metaboxes edit-post-meta-boxes-main__liner", + hidden: isShort && !isOpen, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MetaBoxes, { location: "normal" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MetaBoxes, { location: "advanced" })] }); - if (isLegacy) { - return contents; - } const isAutoHeight = openHeight === undefined; let usedMax = '50%'; // Approximation before max has a value. if (max !== undefined) { @@ -3083,7 +2975,9 @@ function MetaBoxesMain({ pointerId, target }) => { - target.setPointerCapture(pointerId); + if (separatorRef.current.parentElement.contains(target)) { + target.setPointerCapture(pointerId); + } }, onResizeStart: (event, direction, elementRef) => { if (isAutoHeight) { @@ -3120,7 +3014,6 @@ function Layout({ }) { layout_useCommands(); useCommands(); - const paddingAppenderRef = usePaddingAppender(); const shouldIframe = useShouldIframe(); const { createErrorNotice @@ -3142,44 +3035,53 @@ function Layout({ showIconLabels, isDistractionFree, showMetaBoxes, - hasHistory, isWelcomeGuideVisible, - templateId + templateId, + enablePaddingAppender } = (0,external_wp_data_namespaceObject.useSelect)(select => { var _getPostType$viewable; const { get } = select(external_wp_preferences_namespaceObject.store); const { - isFeatureActive, - getEditedPostTemplateId - } = unlock(select(store)); + isFeatureActive + } = select(store); const { canUser, - getPostType - } = select(external_wp_coreData_namespaceObject.store); - const { - __unstableGetEditorMode - } = unlock(select(external_wp_blockEditor_namespaceObject.store)); + getPostType, + getTemplateId + } = unlock(select(external_wp_coreData_namespaceObject.store)); const supportsTemplateMode = settings.supportsTemplateMode; const isViewable = (_getPostType$viewable = getPostType(currentPostType)?.viewable) !== null && _getPostType$viewable !== void 0 ? _getPostType$viewable : false; const canViewTemplate = canUser('read', { kind: 'postType', name: 'wp_template' }); - const isZoomOut = __unstableGetEditorMode() === 'zoom-out'; + const { + isZoomOut + } = unlock(select(external_wp_blockEditor_namespaceObject.store)); + const { + getEditorMode, + getRenderingMode + } = select(external_wp_editor_namespaceObject.store); + const isRenderingPostOnly = getRenderingMode() === 'post-only'; + const isNotDesignPostType = !DESIGN_POST_TYPES.includes(currentPostType); + const isDirectlyEditingPattern = currentPostType === 'wp_block' && !onNavigateToPreviousEntityRecord; return { - mode: select(external_wp_editor_namespaceObject.store).getEditorMode(), + mode: getEditorMode(), isFullscreenActive: select(store).isFeatureActive('fullscreenMode'), hasActiveMetaboxes: select(store).hasMetaBoxes(), hasBlockSelected: !!select(external_wp_blockEditor_namespaceObject.store).getBlockSelectionStart(), showIconLabels: get('core', 'showIconLabels'), isDistractionFree: get('core', 'distractionFree'), - showMetaBoxes: !DESIGN_POST_TYPES.includes(currentPostType) && select(external_wp_editor_namespaceObject.store).getRenderingMode() === 'post-only' && !isZoomOut, + showMetaBoxes: isNotDesignPostType && !isZoomOut() || isDirectlyEditingPattern, isWelcomeGuideVisible: isFeatureActive('welcomeGuide'), - templateId: supportsTemplateMode && isViewable && canViewTemplate && !isEditingTemplate ? getEditedPostTemplateId() : null + templateId: supportsTemplateMode && isViewable && canViewTemplate && !isEditingTemplate ? getTemplateId(currentPostType, currentPostId) : null, + enablePaddingAppender: !isZoomOut() && isRenderingPostOnly && isNotDesignPostType }; - }, [currentPostType, isEditingTemplate, settings.supportsTemplateMode]); + }, [currentPostType, currentPostId, isEditingTemplate, settings.supportsTemplateMode, onNavigateToPreviousEntityRecord]); + useMetaBoxInitialization(hasActiveMetaboxes); + const [paddingAppenderRef, paddingStyle] = usePaddingAppender(enablePaddingAppender); // Set the right context for the command palette const commandContext = hasBlockSelected ? 'block-selection-edit' : 'entity-edit'; @@ -3190,7 +3092,7 @@ function Layout({ onNavigateToPreviousEntityRecord, defaultRenderingMode: 'post-only' }), [settings, onNavigateToEntityRecord, onNavigateToPreviousEntityRecord]); - const styles = useEditorStyles(); + const styles = useEditorStyles(paddingStyle); // We need to add the show-icon-labels class to the body element so it is applied to modals. if (showIconLabels) { @@ -3203,7 +3105,7 @@ function Layout({ 'has-metaboxes': hasActiveMetaboxes }); function onPluginAreaError(name) { - createErrorNotice((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: plugin name */ + createErrorNotice((0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: plugin name */ (0,external_wp_i18n_namespaceObject.__)('The "%s" plugin has encountered an error and cannot be rendered.'), name)); } const { @@ -3255,6 +3157,7 @@ function Layout({ }) : null; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SlotFillProvider, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_editor_namespaceObject.ErrorBoundary, { + canCopyContent: true, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_commands_namespaceObject.CommandMenu, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuide, { postType: currentPostType }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { @@ -3280,14 +3183,10 @@ function Layout({ extraSidebarPanels: showMetaBoxes && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MetaBoxes, { location: "side" }), - extraContent: !isDistractionFree && showMetaBoxes && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MetaBoxesMain, { - isLegacy: !shouldIframe - }), + extraContent: !isDistractionFree && showMetaBoxes && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MetaBoxesMain, {}), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.PostLockedModal, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditorInitialization, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(FullscreenMode, { isActive: isFullscreenActive - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(browser_url, { - hasHistory: hasHistory - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.UnsavedChangesWarning, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.AutosaveMonitor, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.LocalAutosaveMonitor, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(keyboard_shortcuts, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.EditorKeyboardShortcutsRegister, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockKeyboardShortcuts, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(InitPatternModal, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_plugins_namespaceObject.PluginArea, { + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(browser_url, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.UnsavedChangesWarning, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.AutosaveMonitor, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.LocalAutosaveMonitor, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(keyboard_shortcuts, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.EditorKeyboardShortcutsRegister, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockKeyboardShortcuts, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(InitPatternModal, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_plugins_namespaceObject.PluginArea, { onError: onPluginAreaError }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(more_menu, {}), backButton, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.EditorSnackbars, {})] }) @@ -3491,6 +3390,7 @@ function initializeEditor(id, postType, postId, settings, initialEdits) { (0,external_wp_data_namespaceObject.dispatch)(external_wp_preferences_namespaceObject.store).setDefaults('core', { allowRightClickOverrides: true, editorMode: 'visual', + editorTool: 'edit', fixedToolbar: false, hiddenBlockTypes: [], inactivePanels: [], @@ -3560,7 +3460,7 @@ function initializeEditor(id, postType, postId, settings, initialEdits) { // Prevent the default browser action for files dropped outside of dropzones. window.addEventListener('dragover', e => e.preventDefault(), false); window.addEventListener('drop', e => e.preventDefault(), false); - root.render( /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.StrictMode, { + root.render(/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.StrictMode, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(layout, { settings: settings, postId: postId, diff --git a/wp-includes/js/dist/edit-post.min.js b/wp-includes/js/dist/edit-post.min.js index 2167fa4a77..fd0af8c1fd 100644 --- a/wp-includes/js/dist/edit-post.min.js +++ b/wp-includes/js/dist/edit-post.min.js @@ -1,2 +1,2 @@ /*! This file is auto-generated */ -(()=>{"use strict";var e={n:t=>{var o=t&&t.__esModule?()=>t.default:()=>t;return e.d(o,{a:o}),o},d:(t,o)=>{for(var s in o)e.o(o,s)&&!e.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:o[s]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{PluginBlockSettingsMenuItem:()=>Ut,PluginDocumentSettingPanel:()=>Ht,PluginMoreMenuItem:()=>qt,PluginPostPublishPanel:()=>Qt,PluginPostStatusInfo:()=>$t,PluginPrePublishPanel:()=>Wt,PluginSidebar:()=>Xt,PluginSidebarMoreMenuItem:()=>Zt,__experimentalFullscreenModeClose:()=>A,__experimentalMainDashboardButton:()=>Kt,__experimentalPluginPostExcerpt:()=>Yt,initializeEditor:()=>eo,reinitializeEditor:()=>to,store:()=>et});var o={};e.r(o),e.d(o,{__experimentalSetPreviewDeviceType:()=>me,__unstableCreateTemplate:()=>ye,closeGeneralSidebar:()=>X,closeModal:()=>Y,closePublishSidebar:()=>J,hideBlockTypes:()=>le,initializeMetaBoxes:()=>be,metaBoxUpdatesFailure:()=>ge,metaBoxUpdatesSuccess:()=>ue,openGeneralSidebar:()=>$,openModal:()=>Z,openPublishSidebar:()=>K,removeEditorPanel:()=>se,requestMetaBoxUpdates:()=>pe,setAvailableMetaBoxesPerLocation:()=>de,setIsEditingTemplate:()=>_e,setIsInserterOpened:()=>he,setIsListViewOpened:()=>we,showBlockTypes:()=>ce,switchEditorMode:()=>re,toggleDistractionFree:()=>xe,toggleEditorPanelEnabled:()=>te,toggleEditorPanelOpened:()=>oe,toggleFeature:()=>ie,togglePinnedPluginItem:()=>ne,togglePublishSidebar:()=>ee,updatePreferredStyleVariations:()=>ae});var s={};e.r(s),e.d(s,{getEditedPostTemplateId:()=>ve});var i={};e.r(i),e.d(i,{__experimentalGetInsertionPoint:()=>Xe,__experimentalGetPreviewDeviceType:()=>Qe,areMetaBoxesInitialized:()=>Ke,getActiveGeneralSidebarName:()=>Be,getActiveMetaBoxLocations:()=>Ve,getAllMetaBoxes:()=>He,getEditedPostTemplate:()=>Je,getEditorMode:()=>Me,getHiddenBlockTypes:()=>Ae,getMetaBoxesPerLocation:()=>Ue,getPreference:()=>Ie,getPreferences:()=>ke,hasMetaBoxes:()=>qe,isEditingTemplate:()=>Ye,isEditorPanelEnabled:()=>Oe,isEditorPanelOpened:()=>De,isEditorPanelRemoved:()=>Ce,isEditorSidebarOpened:()=>Te,isFeatureActive:()=>Le,isInserterOpened:()=>$e,isListViewOpened:()=>Ze,isMetaBoxLocationActive:()=>Ge,isMetaBoxLocationVisible:()=>ze,isModalActive:()=>Ne,isPluginItemPinned:()=>Fe,isPluginSidebarOpened:()=>je,isPublishSidebarOpened:()=>Re,isSavingMetaBoxes:()=>We});const r=window.wp.blocks,n=window.wp.blockLibrary,a=window.wp.deprecated;var c=e.n(a);const l=window.wp.element,d=window.wp.data,p=window.wp.preferences,u=window.wp.widgets,g=window.wp.editor;function m(e){var t,o,s="";if("string"==typeof e||"number"==typeof e)s+=e;else if("object"==typeof e)if(Array.isArray(e)){var i=e.length;for(t=0;t{const{getCurrentPostType:t}=e(g.store),{getEntityRecord:o,getPostType:i,isResolving:r}=e(j.store),n=o("root","__unstableBase",void 0)||{},a=s?.type||t();return{isRequestingSiteIcon:r("getEntityRecord",["root","__unstableBase",void 0]),postType:i(a),siteIconUrl:n.site_icon_url}}),[]),c=(0,k.useReducedMotion)();if(!n)return null;let l=(0,b.jsx)(B.Icon,{size:"36px",icon:I});const p={expand:{scale:1.25,transition:{type:"tween",duration:"0.3"}}};a&&(l=(0,b.jsx)(B.__unstableMotion.img,{variants:!c&&p,alt:(0,y.__)("Site Icon"),className:"edit-post-fullscreen-mode-close_site-icon",src:a})),r&&(l=null),t&&(l=(0,b.jsx)(B.Icon,{size:"36px",icon:t}));const u=h("edit-post-fullscreen-mode-close",{"has-icon":a}),m=null!=o?o:(0,M.addQueryArgs)("edit.php",{post_type:n.slug}),w=null!==(i=n?.labels?.view_items)&&void 0!==i?i:(0,y.__)("Back");return(0,b.jsx)(B.__unstableMotion.div,{whileHover:"expand",children:(0,b.jsx)(B.Button,{__next40pxDefaultSize:!1,className:u,href:m,label:w,showTooltip:e,children:l})})},R=window.wp.privateApis,{lock:C,unlock:O}=(0,R.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/edit-post"),{BackButton:D}=O(g.privateApis),N={hidden:{x:"-100%"},distractionFreeInactive:{x:0},hover:{x:0,transition:{type:"tween",delay:.2}}};const L=function({initialPost:e}){return(0,b.jsx)(D,{children:({length:t})=>t<=1&&(0,b.jsx)(B.__unstableMotion.div,{variants:N,transition:{type:"tween",delay:.8},children:(0,b.jsx)(A,{showTooltip:!0,initialPost:e})})})};function F(){return(()=>{const{newPermalink:e}=(0,d.useSelect)((e=>({newPermalink:e(g.store).getCurrentPost().link})),[]),t=(0,l.useRef)();(0,l.useEffect)((()=>{t.current=document.querySelector("#wp-admin-bar-preview a")||document.querySelector("#wp-admin-bar-view a")}),[]),(0,l.useEffect)((()=>{e&&t.current&&t.current.setAttribute("href",e)}),[e])})(),null}const V=window.wp.keyboardShortcuts;function z(e=[],t){const o=[...e];for(const e of t){const t=o.findIndex((t=>t.id===e.id));-1!==t?o[t]=e:o.push(e)}return o}const G=(0,d.combineReducers)({isSaving:function(e=!1,t){switch(t.type){case"REQUEST_META_BOX_UPDATES":return!0;case"META_BOX_UPDATES_SUCCESS":case"META_BOX_UPDATES_FAILURE":return!1;default:return e}},locations:function(e={},t){if("SET_META_BOXES_PER_LOCATIONS"===t.type){const o={...e};for(const[e,s]of Object.entries(t.metaBoxesPerLocation))o[e]=z(o[e],s);return o}return e},initialized:function(e=!1,t){return"META_BOXES_INITIALIZED"===t.type||e}}),U=(0,d.combineReducers)({metaBoxes:G}),H=window.wp.apiFetch;var q=e.n(H);const W=window.wp.hooks,{interfaceStore:Q}=O(g.privateApis),$=e=>({registry:t})=>{t.dispatch(Q).enableComplementaryArea("core",e)},X=()=>({registry:e})=>e.dispatch(Q).disableComplementaryArea("core"),Z=e=>({registry:t})=>(c()("select( 'core/edit-post' ).openModal( name )",{since:"6.3",alternative:"select( 'core/interface').openModal( name )"}),t.dispatch(Q).openModal(e)),Y=()=>({registry:e})=>(c()("select( 'core/edit-post' ).closeModal()",{since:"6.3",alternative:"select( 'core/interface').closeModal()"}),e.dispatch(Q).closeModal()),K=()=>({registry:e})=>{c()("dispatch( 'core/edit-post' ).openPublishSidebar",{since:"6.6",alternative:"dispatch( 'core/editor').openPublishSidebar"}),e.dispatch(g.store).openPublishSidebar()},J=()=>({registry:e})=>{c()("dispatch( 'core/edit-post' ).closePublishSidebar",{since:"6.6",alternative:"dispatch( 'core/editor').closePublishSidebar"}),e.dispatch(g.store).closePublishSidebar()},ee=()=>({registry:e})=>{c()("dispatch( 'core/edit-post' ).togglePublishSidebar",{since:"6.6",alternative:"dispatch( 'core/editor').togglePublishSidebar"}),e.dispatch(g.store).togglePublishSidebar()},te=e=>({registry:t})=>{c()("dispatch( 'core/edit-post' ).toggleEditorPanelEnabled",{since:"6.5",alternative:"dispatch( 'core/editor').toggleEditorPanelEnabled"}),t.dispatch(g.store).toggleEditorPanelEnabled(e)},oe=e=>({registry:t})=>{c()("dispatch( 'core/edit-post' ).toggleEditorPanelOpened",{since:"6.5",alternative:"dispatch( 'core/editor').toggleEditorPanelOpened"}),t.dispatch(g.store).toggleEditorPanelOpened(e)},se=e=>({registry:t})=>{c()("dispatch( 'core/edit-post' ).removeEditorPanel",{since:"6.5",alternative:"dispatch( 'core/editor').removeEditorPanel"}),t.dispatch(g.store).removeEditorPanel(e)},ie=e=>({registry:t})=>t.dispatch(p.store).toggle("core/edit-post",e),re=e=>({registry:t})=>{c()("dispatch( 'core/edit-post' ).switchEditorMode",{since:"6.6",alternative:"dispatch( 'core/editor').switchEditorMode"}),t.dispatch(g.store).switchEditorMode(e)},ne=e=>({registry:t})=>{const o=t.select(Q).isItemPinned("core",e);t.dispatch(Q)[o?"unpinItem":"pinItem"]("core",e)};function ae(){return c()("dispatch( 'core/edit-post' ).updatePreferredStyleVariations",{since:"6.6",hint:"Preferred Style Variations are not supported anymore."}),{type:"NOTHING"}}const ce=e=>({registry:t})=>{O(t.dispatch(g.store)).showBlockTypes(e)},le=e=>({registry:t})=>{O(t.dispatch(g.store)).hideBlockTypes(e)};function de(e){return{type:"SET_META_BOXES_PER_LOCATIONS",metaBoxesPerLocation:e}}const pe=()=>async({registry:e,select:t,dispatch:o})=>{o({type:"REQUEST_META_BOX_UPDATES"}),window.tinyMCE&&window.tinyMCE.triggerSave();const s=new window.FormData(document.querySelector(".metabox-base-form")),i=s.get("post_ID"),r=s.get("post_type"),n=e.select(j.store).getEditedEntityRecord("postType",r,i),a=[!!n.comment_status&&["comment_status",n.comment_status],!!n.ping_status&&["ping_status",n.ping_status],!!n.sticky&&["sticky",n.sticky],!!n.author&&["post_author",n.author]].filter(Boolean),c=[s,...t.getActiveMetaBoxLocations().map((e=>new window.FormData((e=>{const t=document.querySelector(`.edit-post-meta-boxes-area.is-${e} .metabox-location-${e}`);return t||document.querySelector("#metaboxes .metabox-location-"+e)})(e))))].reduce(((e,t)=>{for(const[o,s]of t)e.append(o,s);return e}),new window.FormData);a.forEach((([e,t])=>c.append(e,t)));try{await q()({url:window._wpMetaBoxUrl,method:"POST",body:c,parse:!1}),o.metaBoxUpdatesSuccess()}catch{o.metaBoxUpdatesFailure()}};function ue(){return{type:"META_BOX_UPDATES_SUCCESS"}}function ge(){return{type:"META_BOX_UPDATES_FAILURE"}}const me=e=>({registry:t})=>{c()("dispatch( 'core/edit-post' ).__experimentalSetPreviewDeviceType",{since:"6.5",version:"6.7",hint:"registry.dispatch( editorStore ).setDeviceType"}),t.dispatch(g.store).setDeviceType(e)},he=e=>({registry:t})=>{c()("dispatch( 'core/edit-post' ).setIsInserterOpened",{since:"6.5",alternative:"dispatch( 'core/editor').setIsInserterOpened"}),t.dispatch(g.store).setIsInserterOpened(e)},we=e=>({registry:t})=>{c()("dispatch( 'core/edit-post' ).setIsListViewOpened",{since:"6.5",alternative:"dispatch( 'core/editor').setIsListViewOpened"}),t.dispatch(g.store).setIsListViewOpened(e)};function _e(){return c()("dispatch( 'core/edit-post' ).setIsEditingTemplate",{since:"6.5",alternative:"dispatch( 'core/editor').setRenderingMode"}),{type:"NOTHING"}}function ye(){return c()("dispatch( 'core/edit-post' ).__unstableCreateTemplate",{since:"6.5"}),{type:"NOTHING"}}let fe=!1;const be=()=>({registry:e,select:t,dispatch:o})=>{if(!e.select(g.store).__unstableIsEditorReady())return;if(fe)return;const s=e.select(g.store).getCurrentPostType();window.postboxes.page!==s&&window.postboxes.add_postbox_toggles(s),fe=!0,(0,W.addAction)("editor.savePost","core/edit-post/save-metaboxes",(async(e,s)=>{!s.isAutosave&&t.hasMetaBoxes()&&await o.requestMetaBoxUpdates()})),o({type:"META_BOXES_INITIALIZED"})},xe=()=>({registry:e})=>{c()("dispatch( 'core/edit-post' ).toggleDistractionFree",{since:"6.6",alternative:"dispatch( 'core/editor').toggleDistractionFree"}),e.dispatch(g.store).toggleDistractionFree()},ve=(0,d.createRegistrySelector)((e=>()=>{const{id:t,type:o,slug:s}=e(g.store).getCurrentPost(),{getEntityRecord:i,getEntityRecords:r,canUser:n}=e(j.store),a=n("read",{kind:"root",name:"site"})?i("root","site"):void 0;if(+t===a?.page_for_posts)return e(j.store).getDefaultTemplateId({slug:"home"});const c=e(g.store).getEditedPostAttribute("template");if(c){const e=r("postType","wp_template",{per_page:-1})?.find((e=>e.slug===c));return e?e.id:e}let l;return l=s?"page"===o?`${o}-${s}`:`single-${o}-${s}`:"page"===o?"page":`single-${o}`,o?e(j.store).getDefaultTemplateId({slug:l}):void 0})),{interfaceStore:Se}=O(g.privateApis),Pe=[],Ee={},Me=(0,d.createRegistrySelector)((e=>()=>{var t;return null!==(t=e(p.store).get("core","editorMode"))&&void 0!==t?t:"visual"})),Te=(0,d.createRegistrySelector)((e=>()=>{const t=e(Se).getActiveComplementaryArea("core");return["edit-post/document","edit-post/block"].includes(t)})),je=(0,d.createRegistrySelector)((e=>()=>{const t=e(Se).getActiveComplementaryArea("core");return!!t&&!["edit-post/document","edit-post/block"].includes(t)})),Be=(0,d.createRegistrySelector)((e=>()=>e(Se).getActiveComplementaryArea("core")));const ke=(0,d.createRegistrySelector)((e=>()=>{c()("select( 'core/edit-post' ).getPreferences",{since:"6.0",alternative:"select( 'core/preferences' ).get"});const t=["editorMode","hiddenBlockTypes"].reduce(((t,o)=>{const s=e(p.store).get("core",o);return{...t,[o]:s}}),{}),o=function(e,t){var o;const s=e?.reduce(((e,t)=>({...e,[t]:{enabled:!1}})),{}),i=t?.reduce(((e,t)=>{const o=e?.[t];return{...e,[t]:{...o,opened:!0}}}),null!=s?s:{});return null!==(o=null!=i?i:s)&&void 0!==o?o:Ee}(e(p.store).get("core","inactivePanels"),e(p.store).get("core","openPanels"));return{...t,panels:o}}));function Ie(e,t,o){c()("select( 'core/edit-post' ).getPreference",{since:"6.0",alternative:"select( 'core/preferences' ).get"});const s=ke(e)[t];return void 0===s?o:s}const Ae=(0,d.createRegistrySelector)((e=>()=>{var t;return null!==(t=e(p.store).get("core","hiddenBlockTypes"))&&void 0!==t?t:Pe})),Re=(0,d.createRegistrySelector)((e=>()=>(c()("select( 'core/edit-post' ).isPublishSidebarOpened",{since:"6.6",alternative:"select( 'core/editor' ).isPublishSidebarOpened"}),e(g.store).isPublishSidebarOpened()))),Ce=(0,d.createRegistrySelector)((e=>(t,o)=>(c()("select( 'core/edit-post' ).isEditorPanelRemoved",{since:"6.5",alternative:"select( 'core/editor' ).isEditorPanelRemoved"}),e(g.store).isEditorPanelRemoved(o)))),Oe=(0,d.createRegistrySelector)((e=>(t,o)=>(c()("select( 'core/edit-post' ).isEditorPanelEnabled",{since:"6.5",alternative:"select( 'core/editor' ).isEditorPanelEnabled"}),e(g.store).isEditorPanelEnabled(o)))),De=(0,d.createRegistrySelector)((e=>(t,o)=>(c()("select( 'core/edit-post' ).isEditorPanelOpened",{since:"6.5",alternative:"select( 'core/editor' ).isEditorPanelOpened"}),e(g.store).isEditorPanelOpened(o)))),Ne=(0,d.createRegistrySelector)((e=>(t,o)=>(c()("select( 'core/edit-post' ).isModalActive",{since:"6.3",alternative:"select( 'core/interface' ).isModalActive"}),!!e(Se).isModalActive(o)))),Le=(0,d.createRegistrySelector)((e=>(t,o)=>!!e(p.store).get("core/edit-post",o))),Fe=(0,d.createRegistrySelector)((e=>(t,o)=>e(Se).isItemPinned("core",o))),Ve=(0,d.createSelector)((e=>Object.keys(e.metaBoxes.locations).filter((t=>Ge(e,t)))),(e=>[e.metaBoxes.locations])),ze=(0,d.createRegistrySelector)((e=>(t,o)=>Ge(t,o)&&Ue(t,o)?.some((({id:t})=>e(g.store).isEditorPanelEnabled(`meta-box-${t}`)))));function Ge(e,t){const o=Ue(e,t);return!!o&&0!==o.length}function Ue(e,t){return e.metaBoxes.locations[t]}const He=(0,d.createSelector)((e=>Object.values(e.metaBoxes.locations).flat()),(e=>[e.metaBoxes.locations]));function qe(e){return Ve(e).length>0}function We(e){return e.metaBoxes.isSaving}const Qe=(0,d.createRegistrySelector)((e=>()=>(c()("select( 'core/edit-site' ).__experimentalGetPreviewDeviceType",{since:"6.5",version:"6.7",alternative:"select( 'core/editor' ).getDeviceType"}),e(g.store).getDeviceType()))),$e=(0,d.createRegistrySelector)((e=>()=>(c()("select( 'core/edit-post' ).isInserterOpened",{since:"6.5",alternative:"select( 'core/editor' ).isInserterOpened"}),e(g.store).isInserterOpened()))),Xe=(0,d.createRegistrySelector)((e=>()=>(c()("select( 'core/edit-post' ).__experimentalGetInsertionPoint",{since:"6.5",version:"6.7"}),O(e(g.store)).getInsertionPoint()))),Ze=(0,d.createRegistrySelector)((e=>()=>(c()("select( 'core/edit-post' ).isListViewOpened",{since:"6.5",alternative:"select( 'core/editor' ).isListViewOpened"}),e(g.store).isListViewOpened()))),Ye=(0,d.createRegistrySelector)((e=>()=>(c()("select( 'core/edit-post' ).isEditingTemplate",{since:"6.5",alternative:"select( 'core/editor' ).getRenderingMode"}),"wp_template"===e(g.store).getCurrentPostType())));function Ke(e){return e.metaBoxes.initialized}const Je=(0,d.createRegistrySelector)((e=>t=>{const o=ve(t);if(o)return e(j.store).getEditedEntityRecord("postType","wp_template",o)})),et=(0,d.createReduxStore)("core/edit-post",{reducer:U,actions:o,selectors:i});(0,d.register)(et),O(et).registerPrivateSelectors(s);const tt=function(){const{toggleFeature:e}=(0,d.useDispatch)(et),{registerShortcut:t}=(0,d.useDispatch)(V.store);return(0,l.useEffect)((()=>{t({name:"core/edit-post/toggle-fullscreen",category:"global",description:(0,y.__)("Toggle fullscreen mode."),keyCombination:{modifier:"secondary",character:"f"}})}),[]),(0,V.useShortcut)("core/edit-post/toggle-fullscreen",(()=>{e("fullscreenMode")})),null};function ot(){const{editPost:e}=(0,d.useDispatch)(g.store),[t,o]=(0,l.useState)(!1),[s,i]=(0,l.useState)(void 0),[r,n]=(0,l.useState)(""),{postType:a,isNewPost:c}=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t,isCleanNewPost:o}=e(g.store);return{postType:t("type"),isNewPost:o()}}),[]);return(0,l.useEffect)((()=>{c&&"wp_block"===a&&o(!0)}),[]),"wp_block"===a&&c?(0,b.jsx)(b.Fragment,{children:t&&(0,b.jsx)(B.Modal,{title:(0,y.__)("Create pattern"),onRequestClose:()=>{o(!1)},overlayClassName:"reusable-blocks-menu-items__convert-modal",children:(0,b.jsx)("form",{onSubmit:t=>{t.preventDefault(),o(!1),e({title:r,meta:{wp_pattern_sync_status:s}})},children:(0,b.jsxs)(B.__experimentalVStack,{spacing:"5",children:[(0,b.jsx)(B.TextControl,{label:(0,y.__)("Name"),value:r,onChange:n,placeholder:(0,y.__)("My pattern"),className:"patterns-create-modal__name-input",__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0}),(0,b.jsx)(B.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,y._x)("Synced","pattern (singular)"),help:(0,y.__)("Sync this pattern across multiple locations."),checked:!s,onChange:()=>{i(s?void 0:"unsynced")}}),(0,b.jsx)(B.__experimentalHStack,{justify:"right",children:(0,b.jsx)(B.Button,{__next40pxDefaultSize:!1,variant:"primary",type:"submit",disabled:!r,accessibleWhenDisabled:!0,children:(0,y.__)("Create")})})]})})})}):null}class st extends l.Component{constructor(){super(...arguments),this.state={historyId:null}}componentDidUpdate(e){const{postId:t,postStatus:o,hasHistory:s}=this.props,{historyId:i}=this.state;t===e.postId&&t===i||"auto-draft"===o||!t||s||this.setBrowserURL(t)}setBrowserURL(e){window.history.replaceState({id:e},"Post "+e,function(e){return(0,M.addQueryArgs)("post.php",{post:e,action:"edit"})}(e)),this.setState((()=>({historyId:e})))}render(){return null}}const it=(0,d.withSelect)((e=>{const{getCurrentPost:t}=e(g.store),o=t();let{id:s,status:i,type:r}=o;return["wp_template","wp_template_part"].includes(r)&&(s=o.wp_id),{postId:s,postStatus:i}}))(st);const rt=function({location:e}){const t=(0,l.useRef)(null),o=(0,l.useRef)(null);(0,l.useEffect)((()=>(o.current=document.querySelector(".metabox-location-"+e),o.current&&t.current.appendChild(o.current),()=>{o.current&&document.querySelector("#metaboxes").appendChild(o.current)})),[e]);const s=(0,d.useSelect)((e=>e(et).isSavingMetaBoxes()),[]),i=h("edit-post-meta-boxes-area",`is-${e}`,{"is-loading":s});return(0,b.jsxs)("div",{className:i,children:[s&&(0,b.jsx)(B.Spinner,{}),(0,b.jsx)("div",{className:"edit-post-meta-boxes-area__container",ref:t}),(0,b.jsx)("div",{className:"edit-post-meta-boxes-area__clear"})]})};class nt extends l.Component{componentDidMount(){this.updateDOM()}componentDidUpdate(e){this.props.isVisible!==e.isVisible&&this.updateDOM()}updateDOM(){const{id:e,isVisible:t}=this.props,o=document.getElementById(e);o&&(t?o.classList.remove("is-hidden"):o.classList.add("is-hidden"))}render(){return null}}const at=(0,d.withSelect)(((e,{id:t})=>({isVisible:e(g.store).isEditorPanelEnabled(`meta-box-${t}`)})))(nt);function ct({location:e}){const t=(0,d.useRegistry)(),{metaBoxes:o,areMetaBoxesInitialized:s,isEditorReady:i}=(0,d.useSelect)((t=>{const{__unstableIsEditorReady:o}=t(g.store),{getMetaBoxesPerLocation:s,areMetaBoxesInitialized:i}=t(et);return{metaBoxes:s(e),areMetaBoxesInitialized:i(),isEditorReady:o()}}),[e]),r=!!o?.length;return(0,l.useEffect)((()=>{i&&r&&!s&&t.dispatch(et).initializeMetaBoxes()}),[i,r,s]),s?(0,b.jsxs)(b.Fragment,{children:[(null!=o?o:[]).map((({id:e})=>(0,b.jsx)(at,{id:e},e))),(0,b.jsx)(rt,{location:e})]}):null}const lt=window.wp.keycodes;const dt=function(){const e=(0,d.useSelect)((e=>{const{canUser:t}=e(j.store),o=(0,M.addQueryArgs)("edit.php",{post_type:"wp_block"}),s=(0,M.addQueryArgs)("site-editor.php",{path:"/patterns"});return t("create",{kind:"postType",name:"wp_template"})?s:o}),[]);return(0,b.jsx)(B.MenuItem,{role:"menuitem",href:e,children:(0,y.__)("Manage patterns")})};function pt(){const e=(0,d.useSelect)((e=>"wp_template"===e(g.store).getCurrentPostType()),[]);return(0,b.jsx)(p.PreferenceToggleMenuItem,{scope:"core/edit-post",name:e?"welcomeGuideTemplate":"welcomeGuide",label:(0,y.__)("Welcome Guide")})}const{PreferenceBaseOption:ut}=O(p.privateApis);function gt({willEnable:e}){const[t,o]=(0,l.useState)(!1);return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("p",{className:"edit-post-preferences-modal__custom-fields-confirmation-message",children:(0,y.__)("A page reload is required for this change. Make sure your content is saved before reloading.")}),(0,b.jsx)(B.Button,{__next40pxDefaultSize:!1,className:"edit-post-preferences-modal__custom-fields-confirmation-button",variant:"secondary",isBusy:t,accessibleWhenDisabled:!0,disabled:t,onClick:()=>{o(!0),function(){const e=document.getElementById("toggle-custom-fields-form");e.querySelector('[name="_wp_http_referer"]').setAttribute("value",(0,M.getPathAndQueryString)(window.location.href)),e.submit()}()},children:e?(0,y.__)("Show & Reload Page"):(0,y.__)("Hide & Reload Page")})]})}const mt=(0,d.withSelect)((e=>({areCustomFieldsEnabled:!!e(g.store).getEditorSettings().enableCustomFields})))((function({label:e,areCustomFieldsEnabled:t}){const[o,s]=(0,l.useState)(t);return(0,b.jsx)(ut,{label:e,isChecked:o,onChange:s,children:o!==t&&(0,b.jsx)(gt,{willEnable:o})})})),{PreferenceBaseOption:ht}=O(p.privateApis),wt=(0,k.compose)((0,d.withSelect)(((e,{panelName:t})=>{const{isEditorPanelEnabled:o,isEditorPanelRemoved:s}=e(g.store);return{isRemoved:s(t),isChecked:o(t)}})),(0,k.ifCondition)((({isRemoved:e})=>!e)),(0,d.withDispatch)(((e,{panelName:t})=>({onChange:()=>e(g.store).toggleEditorPanelEnabled(t)}))))(ht),{PreferencesModalSection:_t}=O(p.privateApis);const yt=(0,d.withSelect)((e=>{const{getEditorSettings:t}=e(g.store),{getAllMetaBoxes:o}=e(et);return{areCustomFieldsRegistered:void 0!==t().enableCustomFields,metaBoxes:o()}}))((function({areCustomFieldsRegistered:e,metaBoxes:t,...o}){const s=t.filter((({id:e})=>"postcustom"!==e));return e||0!==s.length?(0,b.jsxs)(_t,{...o,children:[e&&(0,b.jsx)(mt,{label:(0,y.__)("Custom fields")}),s.map((({id:e,title:t})=>(0,b.jsx)(wt,{label:t,panelName:`meta-box-${e}`},e)))]}):null})),{PreferenceToggleControl:ft}=O(p.privateApis),{PreferencesModal:bt}=O(g.privateApis);function xt(){const e={general:(0,b.jsx)(yt,{title:(0,y.__)("Advanced")}),appearance:(0,b.jsx)(ft,{scope:"core/edit-post",featureName:"themeStyles",help:(0,y.__)("Make the editor look like your theme."),label:(0,y.__)("Use theme styles")})};return(0,b.jsx)(bt,{extraSections:e})}const{ToolsMoreMenuGroup:vt,ViewMoreMenuGroup:St}=O(g.privateApis),Pt=()=>{const e=(0,k.useViewportMatch)("large");return(0,b.jsxs)(b.Fragment,{children:[e&&(0,b.jsx)(St,{children:(0,b.jsx)(p.PreferenceToggleMenuItem,{scope:"core/edit-post",name:"fullscreenMode",label:(0,y.__)("Fullscreen mode"),info:(0,y.__)("Show and hide the admin user interface"),messageActivated:(0,y.__)("Fullscreen mode activated"),messageDeactivated:(0,y.__)("Fullscreen mode deactivated"),shortcut:lt.displayShortcut.secondary("f")})}),(0,b.jsxs)(vt,{children:[(0,b.jsx)(dt,{}),(0,b.jsx)(pt,{})]}),(0,b.jsx)(xt,{})]})};function Et({nonAnimatedSrc:e,animatedSrc:t}){return(0,b.jsxs)("picture",{className:"edit-post-welcome-guide__image",children:[(0,b.jsx)("source",{srcSet:e,media:"(prefers-reduced-motion: reduce)"}),(0,b.jsx)("img",{src:t,width:"312",height:"240",alt:""})]})}function Mt(){const{toggleFeature:e}=(0,d.useDispatch)(et);return(0,b.jsx)(B.Guide,{className:"edit-post-welcome-guide",contentLabel:(0,y.__)("Welcome to the block editor"),finishButtonText:(0,y.__)("Get started"),onFinish:()=>e("welcomeGuide"),pages:[{image:(0,b.jsx)(Et,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-canvas.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-canvas.gif"}),content:(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("h1",{className:"edit-post-welcome-guide__heading",children:(0,y.__)("Welcome to the block editor")}),(0,b.jsx)("p",{className:"edit-post-welcome-guide__text",children:(0,y.__)("In the WordPress editor, each paragraph, image, or video is presented as a distinct “block” of content.")})]})},{image:(0,b.jsx)(Et,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-editor.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-editor.gif"}),content:(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("h1",{className:"edit-post-welcome-guide__heading",children:(0,y.__)("Make each block your own")}),(0,b.jsx)("p",{className:"edit-post-welcome-guide__text",children:(0,y.__)("Each block comes with its own set of controls for changing things like color, width, and alignment. These will show and hide automatically when you have a block selected.")})]})},{image:(0,b.jsx)(Et,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-library.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-library.gif"}),content:(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("h1",{className:"edit-post-welcome-guide__heading",children:(0,y.__)("Get to know the block library")}),(0,b.jsx)("p",{className:"edit-post-welcome-guide__text",children:(0,l.createInterpolateElement)((0,y.__)("All of the blocks available to you live in the block library. You’ll find it wherever you see the icon."),{InserterIconImage:(0,b.jsx)("img",{alt:(0,y.__)("inserter"),src:"data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='18' height='18' rx='2' fill='%231E1E1E'/%3E%3Cpath d='M9.22727 4V14M4 8.77273H14' stroke='white' stroke-width='1.5'/%3E%3C/svg%3E%0A"})})})]})},{image:(0,b.jsx)(Et,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-documentation.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-documentation.gif"}),content:(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("h1",{className:"edit-post-welcome-guide__heading",children:(0,y.__)("Learn how to use the block editor")}),(0,b.jsx)("p",{className:"edit-post-welcome-guide__text",children:(0,l.createInterpolateElement)((0,y.__)("New to the block editor? Want to learn more about using it? Here's a detailed guide."),{a:(0,b.jsx)(B.ExternalLink,{href:(0,y.__)("https://wordpress.org/documentation/article/wordpress-block-editor/")})})})]})}]})}function Tt(){const{toggleFeature:e}=(0,d.useDispatch)(et);return(0,b.jsx)(B.Guide,{className:"edit-template-welcome-guide",contentLabel:(0,y.__)("Welcome to the template editor"),finishButtonText:(0,y.__)("Get started"),onFinish:()=>e("welcomeGuideTemplate"),pages:[{image:(0,b.jsx)(Et,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-template-editor.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-template-editor.gif"}),content:(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("h1",{className:"edit-post-welcome-guide__heading",children:(0,y.__)("Welcome to the template editor")}),(0,b.jsx)("p",{className:"edit-post-welcome-guide__text",children:(0,y.__)("Templates help define the layout of the site. You can customize all aspects of your posts and pages using blocks and patterns in this editor.")})]})}]})}function jt({postType:e}){const{isActive:t,isEditingTemplate:o}=(0,d.useSelect)((t=>{const{isFeatureActive:o}=t(et),s="wp_template"===e;return{isActive:o(s?"welcomeGuideTemplate":"welcomeGuide"),isEditingTemplate:s}}),[e]);return t?o?(0,b.jsx)(Tt,{}):(0,b.jsx)(Mt,{}):null}const Bt=(0,b.jsx)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,b.jsx)(f.Path,{d:"M6 4a2 2 0 0 0-2 2v3h1.5V6a.5.5 0 0 1 .5-.5h3V4H6Zm3 14.5H6a.5.5 0 0 1-.5-.5v-3H4v3a2 2 0 0 0 2 2h3v-1.5Zm6 1.5v-1.5h3a.5.5 0 0 0 .5-.5v-3H20v3a2 2 0 0 1-2 2h-3Zm3-16a2 2 0 0 1 2 2v3h-1.5V6a.5.5 0 0 0-.5-.5h-3V4h3Z"})});const{getLayoutStyles:kt}=O(w.privateApis),{useCommands:It}=O(E.privateApis),{useCommandContext:At}=O(P.privateApis),{Editor:Rt,FullscreenMode:Ct,NavigableRegion:Ot}=O(g.privateApis),{BlockKeyboardShortcuts:Dt}=O(n.privateApis),Nt=["wp_template","wp_template_part","wp_block","wp_navigation"];function Lt({isLegacy:e}){const[t,o,s]=(0,d.useSelect)((e=>{const{get:t}=e(p.store),{isMetaBoxLocationVisible:o}=e(et);return[t("core/edit-post","metaBoxesMainIsOpen"),t("core/edit-post","metaBoxesMainOpenHeight"),o("normal")||o("advanced")||o("side")]}),[]),{set:i}=(0,d.useDispatch)(p.store),r=(0,l.useRef)(),n=(0,k.useMediaQuery)("(max-height: 549px)"),[{min:a,max:c},u]=(0,l.useState)((()=>({}))),g=(0,k.useRefEffect)((e=>{const t=e.closest(".interface-interface-skeleton__content"),o=t.querySelectorAll(":scope > .components-notice-list"),s=t.querySelector(".edit-post-meta-boxes-main__presenter"),i=new window.ResizeObserver((()=>{let e=t.offsetHeight;for(const t of o)e-=t.offsetHeight;const i=s.offsetHeight;u({min:i,max:e})}));i.observe(t);for(const e of o)i.observe(e);return()=>i.disconnect()}),[]),m=(0,l.useRef)(),w=(0,l.useId)(),[_,f]=(0,l.useState)(!0),S=(e,t,o)=>{const s=Math.min(c,Math.max(a,e));t?i("core/edit-post","metaBoxesMainOpenHeight",s):m.current.ariaValueNow=T(s),o&&r.current.updateSize({height:s,width:"auto"})};if(!s)return;const P=(0,b.jsxs)("div",{className:h("edit-post-layout__metaboxes",!e&&"edit-post-meta-boxes-main__liner"),hidden:!e&&n&&!t,children:[(0,b.jsx)(ct,{location:"normal"}),(0,b.jsx)(ct,{location:"advanced"})]});if(e)return P;const E=void 0===o;let M="50%";void 0!==c&&(M=E&&_?c/2:c);const T=e=>Math.round((e-a)/(c-a)*100),j=void 0===c||E?50:T(o),I=e=>{const t={ArrowUp:20,ArrowDown:-20}[e.key];if(t){const s=r.current.resizable,i=E?s.offsetHeight:o;S(t+i,!0,!0),e.preventDefault()}},A="edit-post-meta-boxes-main",R=(0,y.__)("Meta Boxes");let C,O;return n?(C=Ot,O={className:h(A,"is-toggle-only")}):(C=B.ResizableBox,O={as:Ot,ref:r,className:h(A,"is-resizable"),defaultSize:{height:o},minHeight:a,maxHeight:M,enable:{top:!0,right:!1,bottom:!1,left:!1,topLeft:!1,topRight:!1,bottomRight:!1,bottomLeft:!1},handleClasses:{top:"edit-post-meta-boxes-main__presenter"},handleComponent:{top:(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(B.Tooltip,{text:(0,y.__)("Drag to resize"),children:(0,b.jsx)("button",{ref:m,role:"separator","aria-valuenow":j,"aria-label":(0,y.__)("Drag to resize"),"aria-describedby":w,onKeyDown:I})}),(0,b.jsx)(B.VisuallyHidden,{id:w,children:(0,y.__)("Use up and down arrow keys to resize the meta box panel.")})]})},onPointerDown:({pointerId:e,target:t})=>{t.setPointerCapture(e)},onResizeStart:(e,t,o)=>{E&&(S(o.offsetHeight,!1,!0),f(!1))},onResize:()=>S(r.current.state.height),onResizeStop:()=>S(r.current.state.height,!0)}),(0,b.jsxs)(C,{"aria-label":R,...O,children:[n?(0,b.jsxs)("button",{"aria-expanded":t,className:"edit-post-meta-boxes-main__presenter",onClick:()=>i("core/edit-post","metaBoxesMainIsOpen",!t),children:[R,(0,b.jsx)(B.Icon,{icon:t?x:v})]}):(0,b.jsx)("meta",{ref:g}),P]})}const Ft=function({postId:e,postType:t,settings:o,initialEdits:s}){It(),function(){const{isFullscreen:e}=(0,d.useSelect)((e=>{const{get:t}=e(p.store);return{isFullscreen:t("core/edit-post","fullscreenMode")}}),[]),{toggle:t}=(0,d.useDispatch)(p.store),{createInfoNotice:o}=(0,d.useDispatch)(S.store);(0,P.useCommand)({name:"core/toggle-fullscreen-mode",label:e?(0,y.__)("Exit fullscreen"):(0,y.__)("Enter fullscreen"),icon:Bt,callback:({close:s})=>{t("core/edit-post","fullscreenMode"),s(),o(e?(0,y.__)("Fullscreen off."):(0,y.__)("Fullscreen on."),{id:"core/edit-post/toggle-fullscreen-mode/notice",type:"snackbar",actions:[{label:(0,y.__)("Undo"),onClick:()=>{t("core/edit-post","fullscreenMode")}}]})}})}();const i=function(){const e=(0,d.useRegistry)();return(0,k.useRefEffect)((t=>{function o(o){if(o.target!==t&&o.target!==t.parentElement)return;const{ownerDocument:s}=t,{defaultView:i}=s;if(!i.parseInt(i.getComputedStyle(t,":after").height,10))return;const n=t.lastElementChild;if(!n)return;const a=n.getBoundingClientRect();if(o.clientY{s.removeEventListener("mousedown",o)}}),[e])}(),n=function(){const{isBlockBasedTheme:e,hasV3BlocksOnly:t,isEditingTemplate:o,isZoomOutMode:s}=(0,d.useSelect)((e=>{const{getEditorSettings:t,getCurrentPostType:o}=e(g.store),{__unstableGetEditorMode:s}=e(w.store),{getBlockTypes:i}=e(r.store);return{isBlockBasedTheme:t().__unstableIsBlockBasedTheme,hasV3BlocksOnly:i().every((e=>e.apiVersion>=3)),isEditingTemplate:"wp_template"===o(),isZoomOutMode:"zoom-out"===s()}}),[]);return t||o||s}(),{createErrorNotice:a}=(0,d.useDispatch)(S.store),{currentPost:{postId:c,postType:u},onNavigateToEntityRecord:m,onNavigateToPreviousEntityRecord:f}=function(e,t,o){const[s,i]=(0,l.useReducer)(((e,{type:t,post:o,previousRenderingMode:s})=>"push"===t?[...e,{post:o,previousRenderingMode:s}]:"pop"===t&&e.length>1?e.slice(0,-1):e),[{post:{postId:e,postType:t}}]),{post:r,previousRenderingMode:n}=s[s.length-1],{getRenderingMode:a}=(0,d.useSelect)(g.store),{setRenderingMode:c}=(0,d.useDispatch)(g.store),p=(0,l.useCallback)((e=>{i({type:"push",post:{postId:e.postId,postType:e.postType},previousRenderingMode:a()}),c(o)}),[a,c,o]),u=(0,l.useCallback)((()=>{i({type:"pop"}),n&&c(n)}),[c,n]);return{currentPost:r,onNavigateToEntityRecord:p,onNavigateToPreviousEntityRecord:s.length>1?u:void 0}}(e,t,"post-only"),x="wp_template"===u,{mode:v,isFullscreenActive:E,hasActiveMetaboxes:I,hasBlockSelected:A,showIconLabels:R,isDistractionFree:C,showMetaBoxes:D,hasHistory:N,isWelcomeGuideVisible:V,templateId:z}=(0,d.useSelect)((e=>{var t;const{get:s}=e(p.store),{isFeatureActive:i,getEditedPostTemplateId:r}=O(e(et)),{canUser:n,getPostType:a}=e(j.store),{__unstableGetEditorMode:c}=O(e(w.store)),l=o.supportsTemplateMode,d=null!==(t=a(u)?.viewable)&&void 0!==t&&t,m=n("read",{kind:"postType",name:"wp_template"}),h="zoom-out"===c();return{mode:e(g.store).getEditorMode(),isFullscreenActive:e(et).isFeatureActive("fullscreenMode"),hasActiveMetaboxes:e(et).hasMetaBoxes(),hasBlockSelected:!!e(w.store).getBlockSelectionStart(),showIconLabels:s("core","showIconLabels"),isDistractionFree:s("core","distractionFree"),showMetaBoxes:!Nt.includes(u)&&"post-only"===e(g.store).getRenderingMode()&&!h,isWelcomeGuideVisible:i("welcomeGuide"),templateId:l&&d&&m&&!x?r():null}}),[u,x,o.supportsTemplateMode]);At(A?"block-selection-edit":"entity-edit");const G=(0,l.useMemo)((()=>({...o,onNavigateToEntityRecord:m,onNavigateToPreviousEntityRecord:f,defaultRenderingMode:"post-only"})),[o,m,f]),U=function(){const{hasThemeStyleSupport:e,editorSettings:t,isZoomedOutView:o,renderingMode:s,postType:i}=(0,d.useSelect)((e=>{const{__unstableGetEditorMode:t}=e(w.store),{getCurrentPostType:o,getRenderingMode:s}=e(g.store),i=o();return{hasThemeStyleSupport:e(et).isFeatureActive("themeStyles"),editorSettings:e(g.store).getEditorSettings(),isZoomedOutView:"zoom-out"===t(),renderingMode:s(),postType:i}}),[]);return(0,l.useMemo)((()=>{var r,n,a,c;const l=null!==(r=t.styles?.filter((e=>e.__unstableType&&"theme"!==e.__unstableType)))&&void 0!==r?r:[],d=[...null!==(n=t?.defaultEditorStyles)&&void 0!==n?n:[],...l],p=e&&l.length!==(null!==(a=t.styles?.length)&&void 0!==a?a:0);t.disableLayoutStyles||p||d.push({css:kt({style:{},selector:"body",hasBlockGapSupport:!1,hasFallbackGapSupport:!0,fallbackGapValue:"0.5em"})});const u=p?null!==(c=t.styles)&&void 0!==c?c:[]:d;return o||"post-only"!==s||Nt.includes(i)?u:[...u,{css:':root :where(.editor-styles-wrapper)::after {content: ""; display: block; height: 40vh;}'}]}),[t.defaultEditorStyles,t.disableLayoutStyles,t.styles,e,i])}();R?document.body.classList.add("show-icon-labels"):document.body.classList.remove("show-icon-labels");const H=(0,B.__unstableUseNavigateRegions)(),q=h("edit-post-layout","is-mode-"+v,{"has-metaboxes":I}),{createSuccessNotice:W}=(0,d.useDispatch)(S.store),Q=(0,l.useCallback)(((e,t)=>{switch(e){case"move-to-trash":document.location.href=(0,M.addQueryArgs)("edit.php",{trashed:1,post_type:t[0].type,ids:t[0].id});break;case"duplicate-post":{const e=t[0],o="string"==typeof e.title?e.title:e.title?.rendered;W((0,y.sprintf)((0,y.__)('"%s" successfully created.'),(0,T.decodeEntities)(o)),{type:"snackbar",id:"duplicate-post-action",actions:[{label:(0,y.__)("Edit"),onClick:()=>{const t=e.id;document.location.href=(0,M.addQueryArgs)("post.php",{post:t,action:"edit"})}}]})}}}),[W]),$=(0,l.useMemo)((()=>({type:t,id:e})),[t,e]),X=(0,k.useViewportMatch)("medium")&&E?(0,b.jsx)(L,{initialPost:$}):null;return(0,b.jsx)(B.SlotFillProvider,{children:(0,b.jsxs)(g.ErrorBoundary,{children:[(0,b.jsx)(P.CommandMenu,{}),(0,b.jsx)(jt,{postType:u}),(0,b.jsx)("div",{className:H.className,...H,ref:H.ref,children:(0,b.jsxs)(Rt,{settings:G,initialEdits:s,postType:u,postId:c,templateId:z,className:q,styles:U,forceIsDirty:I,contentRef:i,disableIframe:!n,autoFocus:!V,onActionPerformed:Q,extraSidebarPanels:D&&(0,b.jsx)(ct,{location:"side"}),extraContent:!C&&D&&(0,b.jsx)(Lt,{isLegacy:!n}),children:[(0,b.jsx)(g.PostLockedModal,{}),(0,b.jsx)(F,{}),(0,b.jsx)(Ct,{isActive:E}),(0,b.jsx)(it,{hasHistory:N}),(0,b.jsx)(g.UnsavedChangesWarning,{}),(0,b.jsx)(g.AutosaveMonitor,{}),(0,b.jsx)(g.LocalAutosaveMonitor,{}),(0,b.jsx)(tt,{}),(0,b.jsx)(g.EditorKeyboardShortcutsRegister,{}),(0,b.jsx)(Dt,{}),(0,b.jsx)(ot,{}),(0,b.jsx)(_.PluginArea,{onError:function(e){a((0,y.sprintf)((0,y.__)('The "%s" plugin has encountered an error and cannot be rendered.'),e))}}),(0,b.jsx)(Pt,{}),X,(0,b.jsx)(g.EditorSnackbars,{})]})})]})})},{PluginPostExcerpt:Vt}=O(g.privateApis),zt=(0,M.getPath)(window.location.href)?.includes("site-editor.php"),Gt=e=>{c()(`wp.editPost.${e}`,{since:"6.6",alternative:`wp.editor.${e}`})};function Ut(e){return zt?null:(Gt("PluginBlockSettingsMenuItem"),(0,b.jsx)(g.PluginBlockSettingsMenuItem,{...e}))}function Ht(e){return zt?null:(Gt("PluginDocumentSettingPanel"),(0,b.jsx)(g.PluginDocumentSettingPanel,{...e}))}function qt(e){return zt?null:(Gt("PluginMoreMenuItem"),(0,b.jsx)(g.PluginMoreMenuItem,{...e}))}function Wt(e){return zt?null:(Gt("PluginPrePublishPanel"),(0,b.jsx)(g.PluginPrePublishPanel,{...e}))}function Qt(e){return zt?null:(Gt("PluginPostPublishPanel"),(0,b.jsx)(g.PluginPostPublishPanel,{...e}))}function $t(e){return zt?null:(Gt("PluginPostStatusInfo"),(0,b.jsx)(g.PluginPostStatusInfo,{...e}))}function Xt(e){return zt?null:(Gt("PluginSidebar"),(0,b.jsx)(g.PluginSidebar,{...e}))}function Zt(e){return zt?null:(Gt("PluginSidebarMoreMenuItem"),(0,b.jsx)(g.PluginSidebarMoreMenuItem,{...e}))}function Yt(){return zt?null:(c()("wp.editPost.__experimentalPluginPostExcerpt",{since:"6.6",hint:"Core and custom panels can be access programmatically using their panel name.",link:"https://developer.wordpress.org/block-editor/reference-guides/slotfills/plugin-document-setting-panel/#accessing-a-panel-programmatically"}),Vt)}const{BackButton:Kt,registerCoreBlockBindingsSources:Jt}=O(g.privateApis);function eo(e,t,o,s,i){const a=window.matchMedia("(min-width: 782px)").matches,c=document.getElementById(e),m=(0,l.createRoot)(c);(0,d.dispatch)(p.store).setDefaults("core/edit-post",{fullscreenMode:!0,themeStyles:!0,welcomeGuide:!0,welcomeGuideTemplate:!0}),(0,d.dispatch)(p.store).setDefaults("core",{allowRightClickOverrides:!0,editorMode:"visual",fixedToolbar:!1,hiddenBlockTypes:[],inactivePanels:[],openPanels:["post-status"],showBlockBreadcrumbs:!0,showIconLabels:!1,showListViewByDefault:!1,enableChoosePatternModal:!0,isPublishSidebarEnabled:!0}),window.__experimentalMediaProcessing&&(0,d.dispatch)(p.store).setDefaults("core/media",{requireApproval:!0,optimizeOnUpload:!0}),(0,d.dispatch)(r.store).reapplyBlockTypeFilters(),a&&(0,d.select)(p.store).get("core","showListViewByDefault")&&!(0,d.select)(p.store).get("core","distractionFree")&&(0,d.dispatch)(g.store).setIsListViewOpened(!0),(0,n.registerCoreBlocks)(),Jt(),(0,u.registerLegacyWidgetBlock)({inserter:!1}),(0,u.registerWidgetGroupBlock)({inserter:!1});"Standards"!==("CSS1Compat"===document.compatMode?"Standards":"Quirks")&&console.warn("Your browser is using Quirks Mode. \nThis can cause rendering issues such as blocks overlaying meta boxes in the editor. Quirks Mode can be triggered by PHP errors or HTML code appearing before the opening . Try checking the raw page source or your site's PHP error log and resolving errors there, removing any HTML before the doctype, or disabling plugins.");return-1!==window.navigator.userAgent.indexOf("iPhone")&&window.addEventListener("scroll",(e=>{const t=document.getElementsByClassName("interface-interface-skeleton__body")[0];e.target===document&&(window.scrollY>100&&(t.scrollTop=t.scrollTop+window.scrollY),document.getElementsByClassName("is-mode-visual")[0]&&window.scrollTo(0,0))})),window.addEventListener("dragover",(e=>e.preventDefault()),!1),window.addEventListener("drop",(e=>e.preventDefault()),!1),m.render((0,b.jsx)(l.StrictMode,{children:(0,b.jsx)(Ft,{settings:s,postId:o,postType:t,initialEdits:i})})),m}function to(){c()("wp.editPost.reinitializeEditor",{since:"6.2",version:"6.3"})}(window.wp=window.wp||{}).editPost=t})(); \ No newline at end of file +(()=>{"use strict";var e={n:t=>{var o=t&&t.__esModule?()=>t.default:()=>t;return e.d(o,{a:o}),o},d:(t,o)=>{for(var s in o)e.o(o,s)&&!e.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:o[s]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{PluginBlockSettingsMenuItem:()=>Gt,PluginDocumentSettingPanel:()=>Ut,PluginMoreMenuItem:()=>Vt,PluginPostPublishPanel:()=>qt,PluginPostStatusInfo:()=>Wt,PluginPrePublishPanel:()=>Ht,PluginSidebar:()=>Qt,PluginSidebarMoreMenuItem:()=>Xt,__experimentalFullscreenModeClose:()=>I,__experimentalMainDashboardButton:()=>$t,__experimentalPluginPostExcerpt:()=>Zt,initializeEditor:()=>Kt,reinitializeEditor:()=>Jt,store:()=>Je});var o={};e.r(o),e.d(o,{__experimentalSetPreviewDeviceType:()=>ge,__unstableCreateTemplate:()=>_e,closeGeneralSidebar:()=>X,closeModal:()=>$,closePublishSidebar:()=>K,hideBlockTypes:()=>ce,initializeMetaBoxes:()=>ye,metaBoxUpdatesFailure:()=>ue,metaBoxUpdatesSuccess:()=>pe,openGeneralSidebar:()=>Q,openModal:()=>Z,openPublishSidebar:()=>Y,removeEditorPanel:()=>oe,requestMetaBoxUpdates:()=>de,setAvailableMetaBoxesPerLocation:()=>le,setIsEditingTemplate:()=>we,setIsInserterOpened:()=>me,setIsListViewOpened:()=>he,showBlockTypes:()=>ae,switchEditorMode:()=>ie,toggleDistractionFree:()=>be,toggleEditorPanelEnabled:()=>ee,toggleEditorPanelOpened:()=>te,toggleFeature:()=>se,toggleFullscreenMode:()=>xe,togglePinnedPluginItem:()=>re,togglePublishSidebar:()=>J,updatePreferredStyleVariations:()=>ne});var s={};e.r(s),e.d(s,{__experimentalGetInsertionPoint:()=>Xe,__experimentalGetPreviewDeviceType:()=>We,areMetaBoxesInitialized:()=>Ye,getActiveGeneralSidebarName:()=>ke,getActiveMetaBoxLocations:()=>Fe,getAllMetaBoxes:()=>Ve,getEditedPostTemplate:()=>Ke,getEditorMode:()=>Ee,getHiddenBlockTypes:()=>Ie,getMetaBoxesPerLocation:()=>Ue,getPreference:()=>Be,getPreferences:()=>Te,hasMetaBoxes:()=>He,isEditingTemplate:()=>$e,isEditorPanelEnabled:()=>Ce,isEditorPanelOpened:()=>De,isEditorPanelRemoved:()=>Re,isEditorSidebarOpened:()=>Me,isFeatureActive:()=>Ne,isInserterOpened:()=>Qe,isListViewOpened:()=>Ze,isMetaBoxLocationActive:()=>Ge,isMetaBoxLocationVisible:()=>ze,isModalActive:()=>Oe,isPluginItemPinned:()=>Le,isPluginSidebarOpened:()=>je,isPublishSidebarOpened:()=>Ae,isSavingMetaBoxes:()=>qe});const i=window.wp.blocks,r=window.wp.blockLibrary,n=window.wp.deprecated;var a=e.n(n);const c=window.wp.element,l=window.wp.data,d=window.wp.preferences,p=window.wp.widgets,u=window.wp.editor;function g(e){var t,o,s="";if("string"==typeof e||"number"==typeof e)s+=e;else if("object"==typeof e)if(Array.isArray(e)){var i=e.length;for(t=0;t{const{getCurrentPostType:t}=e(u.store),{getEntityRecord:o,getPostType:i,isResolving:r}=e(j.store),n=o("root","__unstableBase",void 0)||{},a=s?.type||t();return{isRequestingSiteIcon:r("getEntityRecord",["root","__unstableBase",void 0]),postType:i(a),siteIconUrl:n.site_icon_url}}),[]),c=(0,T.useReducedMotion)();if(!n)return null;let d=(0,y.jsx)(k.Icon,{size:"36px",icon:B});const p={expand:{scale:1.25,transition:{type:"tween",duration:"0.3"}}};a&&(d=(0,y.jsx)(k.__unstableMotion.img,{variants:!c&&p,alt:(0,_.__)("Site Icon"),className:"edit-post-fullscreen-mode-close_site-icon",src:a})),r&&(d=null),t&&(d=(0,y.jsx)(k.Icon,{size:"36px",icon:t}));const g=m("edit-post-fullscreen-mode-close",{"has-icon":a}),h=null!=o?o:(0,E.addQueryArgs)("edit.php",{post_type:n.slug}),w=null!==(i=n?.labels?.view_items)&&void 0!==i?i:(0,_.__)("Back");return(0,y.jsx)(k.__unstableMotion.div,{whileHover:"expand",children:(0,y.jsx)(k.Button,{__next40pxDefaultSize:!0,className:g,href:h,label:w,showTooltip:e,children:d})})},A=window.wp.privateApis,{lock:R,unlock:C}=(0,A.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/edit-post"),{BackButton:D}=C(u.privateApis),O={hidden:{x:"-100%"},distractionFreeInactive:{x:0},hover:{x:0,transition:{type:"tween",delay:.2}}};const N=function({initialPost:e}){return(0,y.jsx)(D,{children:({length:t})=>t<=1&&(0,y.jsx)(k.__unstableMotion.div,{variants:O,transition:{type:"tween",delay:.8},children:(0,y.jsx)(I,{showTooltip:!0,initialPost:e})})})};function L(){return(()=>{const{newPermalink:e}=(0,l.useSelect)((e=>({newPermalink:e(u.store).getCurrentPost().link})),[]),t=(0,c.useRef)();(0,c.useEffect)((()=>{t.current=document.querySelector("#wp-admin-bar-preview a")||document.querySelector("#wp-admin-bar-view a")}),[]),(0,c.useEffect)((()=>{e&&t.current&&t.current.setAttribute("href",e)}),[e])})(),null}const F=window.wp.keyboardShortcuts;function z(e=[],t){const o=[...e];for(const e of t){const t=o.findIndex((t=>t.id===e.id));-1!==t?o[t]=e:o.push(e)}return o}const G=(0,l.combineReducers)({isSaving:function(e=!1,t){switch(t.type){case"REQUEST_META_BOX_UPDATES":return!0;case"META_BOX_UPDATES_SUCCESS":case"META_BOX_UPDATES_FAILURE":return!1;default:return e}},locations:function(e={},t){if("SET_META_BOXES_PER_LOCATIONS"===t.type){const o={...e};for(const[e,s]of Object.entries(t.metaBoxesPerLocation))o[e]=z(o[e],s);return o}return e},initialized:function(e=!1,t){return"META_BOXES_INITIALIZED"===t.type||e}}),U=(0,l.combineReducers)({metaBoxes:G}),V=window.wp.apiFetch;var H=e.n(V);const q=window.wp.hooks,{interfaceStore:W}=C(u.privateApis),Q=e=>({registry:t})=>{t.dispatch(W).enableComplementaryArea("core",e)},X=()=>({registry:e})=>e.dispatch(W).disableComplementaryArea("core"),Z=e=>({registry:t})=>(a()("select( 'core/edit-post' ).openModal( name )",{since:"6.3",alternative:"select( 'core/interface').openModal( name )"}),t.dispatch(W).openModal(e)),$=()=>({registry:e})=>(a()("select( 'core/edit-post' ).closeModal()",{since:"6.3",alternative:"select( 'core/interface').closeModal()"}),e.dispatch(W).closeModal()),Y=()=>({registry:e})=>{a()("dispatch( 'core/edit-post' ).openPublishSidebar",{since:"6.6",alternative:"dispatch( 'core/editor').openPublishSidebar"}),e.dispatch(u.store).openPublishSidebar()},K=()=>({registry:e})=>{a()("dispatch( 'core/edit-post' ).closePublishSidebar",{since:"6.6",alternative:"dispatch( 'core/editor').closePublishSidebar"}),e.dispatch(u.store).closePublishSidebar()},J=()=>({registry:e})=>{a()("dispatch( 'core/edit-post' ).togglePublishSidebar",{since:"6.6",alternative:"dispatch( 'core/editor').togglePublishSidebar"}),e.dispatch(u.store).togglePublishSidebar()},ee=e=>({registry:t})=>{a()("dispatch( 'core/edit-post' ).toggleEditorPanelEnabled",{since:"6.5",alternative:"dispatch( 'core/editor').toggleEditorPanelEnabled"}),t.dispatch(u.store).toggleEditorPanelEnabled(e)},te=e=>({registry:t})=>{a()("dispatch( 'core/edit-post' ).toggleEditorPanelOpened",{since:"6.5",alternative:"dispatch( 'core/editor').toggleEditorPanelOpened"}),t.dispatch(u.store).toggleEditorPanelOpened(e)},oe=e=>({registry:t})=>{a()("dispatch( 'core/edit-post' ).removeEditorPanel",{since:"6.5",alternative:"dispatch( 'core/editor').removeEditorPanel"}),t.dispatch(u.store).removeEditorPanel(e)},se=e=>({registry:t})=>t.dispatch(d.store).toggle("core/edit-post",e),ie=e=>({registry:t})=>{a()("dispatch( 'core/edit-post' ).switchEditorMode",{since:"6.6",alternative:"dispatch( 'core/editor').switchEditorMode"}),t.dispatch(u.store).switchEditorMode(e)},re=e=>({registry:t})=>{const o=t.select(W).isItemPinned("core",e);t.dispatch(W)[o?"unpinItem":"pinItem"]("core",e)};function ne(){return a()("dispatch( 'core/edit-post' ).updatePreferredStyleVariations",{since:"6.6",hint:"Preferred Style Variations are not supported anymore."}),{type:"NOTHING"}}const ae=e=>({registry:t})=>{C(t.dispatch(u.store)).showBlockTypes(e)},ce=e=>({registry:t})=>{C(t.dispatch(u.store)).hideBlockTypes(e)};function le(e){return{type:"SET_META_BOXES_PER_LOCATIONS",metaBoxesPerLocation:e}}const de=()=>async({registry:e,select:t,dispatch:o})=>{o({type:"REQUEST_META_BOX_UPDATES"}),window.tinyMCE&&window.tinyMCE.triggerSave();const s=new window.FormData(document.querySelector(".metabox-base-form")),i=s.get("post_ID"),r=s.get("post_type"),n=e.select(j.store).getEditedEntityRecord("postType",r,i),a=[!!n.comment_status&&["comment_status",n.comment_status],!!n.ping_status&&["ping_status",n.ping_status],!!n.sticky&&["sticky",n.sticky],!!n.author&&["post_author",n.author]].filter(Boolean),c=[s,...t.getActiveMetaBoxLocations().map((e=>new window.FormData((e=>{const t=document.querySelector(`.edit-post-meta-boxes-area.is-${e} .metabox-location-${e}`);return t||document.querySelector("#metaboxes .metabox-location-"+e)})(e))))].reduce(((e,t)=>{for(const[o,s]of t)e.append(o,s);return e}),new window.FormData);a.forEach((([e,t])=>c.append(e,t)));try{await H()({url:window._wpMetaBoxUrl,method:"POST",body:c,parse:!1}),o.metaBoxUpdatesSuccess()}catch{o.metaBoxUpdatesFailure()}};function pe(){return{type:"META_BOX_UPDATES_SUCCESS"}}function ue(){return{type:"META_BOX_UPDATES_FAILURE"}}const ge=e=>({registry:t})=>{a()("dispatch( 'core/edit-post' ).__experimentalSetPreviewDeviceType",{since:"6.5",version:"6.7",hint:"registry.dispatch( editorStore ).setDeviceType"}),t.dispatch(u.store).setDeviceType(e)},me=e=>({registry:t})=>{a()("dispatch( 'core/edit-post' ).setIsInserterOpened",{since:"6.5",alternative:"dispatch( 'core/editor').setIsInserterOpened"}),t.dispatch(u.store).setIsInserterOpened(e)},he=e=>({registry:t})=>{a()("dispatch( 'core/edit-post' ).setIsListViewOpened",{since:"6.5",alternative:"dispatch( 'core/editor').setIsListViewOpened"}),t.dispatch(u.store).setIsListViewOpened(e)};function we(){return a()("dispatch( 'core/edit-post' ).setIsEditingTemplate",{since:"6.5",alternative:"dispatch( 'core/editor').setRenderingMode"}),{type:"NOTHING"}}function _e(){return a()("dispatch( 'core/edit-post' ).__unstableCreateTemplate",{since:"6.5"}),{type:"NOTHING"}}let fe=!1;const ye=()=>({registry:e,select:t,dispatch:o})=>{if(!e.select(u.store).__unstableIsEditorReady())return;if(fe)return;const s=e.select(u.store).getCurrentPostType();window.postboxes.page!==s&&window.postboxes.add_postbox_toggles(s),fe=!0,(0,q.addAction)("editor.savePost","core/edit-post/save-metaboxes",(async(e,s)=>{!s.isAutosave&&t.hasMetaBoxes()&&await o.requestMetaBoxUpdates()})),o({type:"META_BOXES_INITIALIZED"})},be=()=>({registry:e})=>{a()("dispatch( 'core/edit-post' ).toggleDistractionFree",{since:"6.6",alternative:"dispatch( 'core/editor').toggleDistractionFree"}),e.dispatch(u.store).toggleDistractionFree()},xe=()=>({registry:e})=>{const t=e.select(d.store).get("core/edit-post","fullscreenMode");e.dispatch(d.store).toggle("core/edit-post","fullscreenMode"),e.dispatch(v.store).createInfoNotice(t?(0,_.__)("Fullscreen mode activated."):(0,_.__)("Fullscreen mode deactivated."),{id:"core/edit-post/toggle-fullscreen-mode/notice",type:"snackbar",actions:[{label:(0,_.__)("Undo"),onClick:()=>{e.dispatch(d.store).toggle("core/edit-post","fullscreenMode")}}]})},{interfaceStore:ve}=C(u.privateApis),Se=[],Pe={},Ee=(0,l.createRegistrySelector)((e=>()=>{var t;return null!==(t=e(d.store).get("core","editorMode"))&&void 0!==t?t:"visual"})),Me=(0,l.createRegistrySelector)((e=>()=>{const t=e(ve).getActiveComplementaryArea("core");return["edit-post/document","edit-post/block"].includes(t)})),je=(0,l.createRegistrySelector)((e=>()=>{const t=e(ve).getActiveComplementaryArea("core");return!!t&&!["edit-post/document","edit-post/block"].includes(t)})),ke=(0,l.createRegistrySelector)((e=>()=>e(ve).getActiveComplementaryArea("core")));const Te=(0,l.createRegistrySelector)((e=>()=>{a()("select( 'core/edit-post' ).getPreferences",{since:"6.0",alternative:"select( 'core/preferences' ).get"});const t=["editorMode","hiddenBlockTypes"].reduce(((t,o)=>{const s=e(d.store).get("core",o);return{...t,[o]:s}}),{}),o=function(e,t){var o;const s=e?.reduce(((e,t)=>({...e,[t]:{enabled:!1}})),{}),i=t?.reduce(((e,t)=>{const o=e?.[t];return{...e,[t]:{...o,opened:!0}}}),null!=s?s:{});return null!==(o=null!=i?i:s)&&void 0!==o?o:Pe}(e(d.store).get("core","inactivePanels"),e(d.store).get("core","openPanels"));return{...t,panels:o}}));function Be(e,t,o){a()("select( 'core/edit-post' ).getPreference",{since:"6.0",alternative:"select( 'core/preferences' ).get"});const s=Te(e)[t];return void 0===s?o:s}const Ie=(0,l.createRegistrySelector)((e=>()=>{var t;return null!==(t=e(d.store).get("core","hiddenBlockTypes"))&&void 0!==t?t:Se})),Ae=(0,l.createRegistrySelector)((e=>()=>(a()("select( 'core/edit-post' ).isPublishSidebarOpened",{since:"6.6",alternative:"select( 'core/editor' ).isPublishSidebarOpened"}),e(u.store).isPublishSidebarOpened()))),Re=(0,l.createRegistrySelector)((e=>(t,o)=>(a()("select( 'core/edit-post' ).isEditorPanelRemoved",{since:"6.5",alternative:"select( 'core/editor' ).isEditorPanelRemoved"}),e(u.store).isEditorPanelRemoved(o)))),Ce=(0,l.createRegistrySelector)((e=>(t,o)=>(a()("select( 'core/edit-post' ).isEditorPanelEnabled",{since:"6.5",alternative:"select( 'core/editor' ).isEditorPanelEnabled"}),e(u.store).isEditorPanelEnabled(o)))),De=(0,l.createRegistrySelector)((e=>(t,o)=>(a()("select( 'core/edit-post' ).isEditorPanelOpened",{since:"6.5",alternative:"select( 'core/editor' ).isEditorPanelOpened"}),e(u.store).isEditorPanelOpened(o)))),Oe=(0,l.createRegistrySelector)((e=>(t,o)=>(a()("select( 'core/edit-post' ).isModalActive",{since:"6.3",alternative:"select( 'core/interface' ).isModalActive"}),!!e(ve).isModalActive(o)))),Ne=(0,l.createRegistrySelector)((e=>(t,o)=>!!e(d.store).get("core/edit-post",o))),Le=(0,l.createRegistrySelector)((e=>(t,o)=>e(ve).isItemPinned("core",o))),Fe=(0,l.createSelector)((e=>Object.keys(e.metaBoxes.locations).filter((t=>Ge(e,t)))),(e=>[e.metaBoxes.locations])),ze=(0,l.createRegistrySelector)((e=>(t,o)=>Ge(t,o)&&Ue(t,o)?.some((({id:t})=>e(u.store).isEditorPanelEnabled(`meta-box-${t}`)))));function Ge(e,t){const o=Ue(e,t);return!!o&&0!==o.length}function Ue(e,t){return e.metaBoxes.locations[t]}const Ve=(0,l.createSelector)((e=>Object.values(e.metaBoxes.locations).flat()),(e=>[e.metaBoxes.locations]));function He(e){return Fe(e).length>0}function qe(e){return e.metaBoxes.isSaving}const We=(0,l.createRegistrySelector)((e=>()=>(a()("select( 'core/edit-site' ).__experimentalGetPreviewDeviceType",{since:"6.5",version:"6.7",alternative:"select( 'core/editor' ).getDeviceType"}),e(u.store).getDeviceType()))),Qe=(0,l.createRegistrySelector)((e=>()=>(a()("select( 'core/edit-post' ).isInserterOpened",{since:"6.5",alternative:"select( 'core/editor' ).isInserterOpened"}),e(u.store).isInserterOpened()))),Xe=(0,l.createRegistrySelector)((e=>()=>(a()("select( 'core/edit-post' ).__experimentalGetInsertionPoint",{since:"6.5",version:"6.7"}),C(e(u.store)).getInserter()))),Ze=(0,l.createRegistrySelector)((e=>()=>(a()("select( 'core/edit-post' ).isListViewOpened",{since:"6.5",alternative:"select( 'core/editor' ).isListViewOpened"}),e(u.store).isListViewOpened()))),$e=(0,l.createRegistrySelector)((e=>()=>(a()("select( 'core/edit-post' ).isEditingTemplate",{since:"6.5",alternative:"select( 'core/editor' ).getRenderingMode"}),"wp_template"===e(u.store).getCurrentPostType())));function Ye(e){return e.metaBoxes.initialized}const Ke=(0,l.createRegistrySelector)((e=>()=>{const{id:t,type:o}=e(u.store).getCurrentPost(),s=C(e(j.store)).getTemplateId(o,t);if(s)return e(j.store).getEditedEntityRecord("postType","wp_template",s)})),Je=(0,l.createReduxStore)("core/edit-post",{reducer:U,actions:o,selectors:s});(0,l.register)(Je);const et=function(){const{toggleFullscreenMode:e}=(0,l.useDispatch)(Je),{registerShortcut:t}=(0,l.useDispatch)(F.store);return(0,c.useEffect)((()=>{t({name:"core/edit-post/toggle-fullscreen",category:"global",description:(0,_.__)("Enable or disable fullscreen mode."),keyCombination:{modifier:"secondary",character:"f"}})}),[]),(0,F.useShortcut)("core/edit-post/toggle-fullscreen",(()=>{e()})),null};function tt(){const{editPost:e}=(0,l.useDispatch)(u.store),[t,o]=(0,c.useState)(void 0),[s,i]=(0,c.useState)(""),{postType:r,isNewPost:n}=(0,l.useSelect)((e=>{const{getEditedPostAttribute:t,isCleanNewPost:o}=e(u.store);return{postType:t("type"),isNewPost:o()}}),[]),[a,d]=(0,c.useState)((()=>n&&"wp_block"===r));return"wp_block"===r&&n?(0,y.jsx)(y.Fragment,{children:a&&(0,y.jsx)(k.Modal,{title:(0,_.__)("Create pattern"),onRequestClose:()=>{d(!1)},overlayClassName:"reusable-blocks-menu-items__convert-modal",children:(0,y.jsx)("form",{onSubmit:o=>{o.preventDefault(),d(!1),e({title:s,meta:{wp_pattern_sync_status:t}})},children:(0,y.jsxs)(k.__experimentalVStack,{spacing:"5",children:[(0,y.jsx)(k.TextControl,{label:(0,_.__)("Name"),value:s,onChange:i,placeholder:(0,_.__)("My pattern"),className:"patterns-create-modal__name-input",__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0}),(0,y.jsx)(k.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,_._x)("Synced","pattern (singular)"),help:(0,_.__)("Sync this pattern across multiple locations."),checked:!t,onChange:()=>{o(t?void 0:"unsynced")}}),(0,y.jsx)(k.__experimentalHStack,{justify:"right",children:(0,y.jsx)(k.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",disabled:!s,accessibleWhenDisabled:!0,children:(0,_.__)("Create")})})]})})})}):null}class ot extends c.Component{constructor(){super(...arguments),this.state={historyId:null}}componentDidUpdate(e){const{postId:t,postStatus:o}=this.props,{historyId:s}=this.state;t===e.postId&&t===s||"auto-draft"===o||!t||this.setBrowserURL(t)}setBrowserURL(e){window.history.replaceState({id:e},"Post "+e,function(e){return(0,E.addQueryArgs)("post.php",{post:e,action:"edit"})}(e)),this.setState((()=>({historyId:e})))}render(){return null}}const st=(0,l.withSelect)((e=>{const{getCurrentPost:t}=e(u.store),o=t();let{id:s,status:i,type:r}=o;return["wp_template","wp_template_part"].includes(r)&&(s=o.wp_id),{postId:s,postStatus:i}}))(ot);const it=function({location:e}){const t=(0,c.useRef)(null),o=(0,c.useRef)(null);(0,c.useEffect)((()=>(o.current=document.querySelector(".metabox-location-"+e),o.current&&t.current.appendChild(o.current),()=>{o.current&&document.querySelector("#metaboxes").appendChild(o.current)})),[e]);const s=(0,l.useSelect)((e=>e(Je).isSavingMetaBoxes()),[]),i=m("edit-post-meta-boxes-area",`is-${e}`,{"is-loading":s});return(0,y.jsxs)("div",{className:i,children:[s&&(0,y.jsx)(k.Spinner,{}),(0,y.jsx)("div",{className:"edit-post-meta-boxes-area__container",ref:t}),(0,y.jsx)("div",{className:"edit-post-meta-boxes-area__clear"})]})};function rt({id:e}){const t=(0,l.useSelect)((t=>t(u.store).isEditorPanelEnabled(`meta-box-${e}`)),[e]);return(0,c.useEffect)((()=>{const o=document.getElementById(e);o&&(t?o.classList.remove("is-hidden"):o.classList.add("is-hidden"))}),[e,t]),null}function nt({location:e}){const t=(0,l.useSelect)((t=>t(Je).getMetaBoxesPerLocation(e)),[e]);return(0,y.jsxs)(y.Fragment,{children:[(null!=t?t:[]).map((({id:e})=>(0,y.jsx)(rt,{id:e},e))),(0,y.jsx)(it,{location:e})]})}const at=window.wp.keycodes;const ct=function(){const e=(0,l.useSelect)((e=>{const{canUser:t}=e(j.store),o=(0,E.addQueryArgs)("edit.php",{post_type:"wp_block"}),s=(0,E.addQueryArgs)("site-editor.php",{path:"/patterns"});return t("create",{kind:"postType",name:"wp_template"})?s:o}),[]);return(0,y.jsx)(k.MenuItem,{role:"menuitem",href:e,children:(0,_.__)("Manage patterns")})};function lt(){const e=(0,l.useSelect)((e=>"wp_template"===e(u.store).getCurrentPostType()),[]);return(0,y.jsx)(d.PreferenceToggleMenuItem,{scope:"core/edit-post",name:e?"welcomeGuideTemplate":"welcomeGuide",label:(0,_.__)("Welcome Guide")})}const{PreferenceBaseOption:dt}=C(d.privateApis);function pt({willEnable:e}){const[t,o]=(0,c.useState)(!1);return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("p",{className:"edit-post-preferences-modal__custom-fields-confirmation-message",children:(0,_.__)("A page reload is required for this change. Make sure your content is saved before reloading.")}),(0,y.jsx)(k.Button,{__next40pxDefaultSize:!0,variant:"secondary",isBusy:t,accessibleWhenDisabled:!0,disabled:t,onClick:()=>{o(!0),function(){const e=document.getElementById("toggle-custom-fields-form");e.querySelector('[name="_wp_http_referer"]').setAttribute("value",(0,E.getPathAndQueryString)(window.location.href)),e.submit()}()},children:e?(0,_.__)("Show & Reload Page"):(0,_.__)("Hide & Reload Page")})]})}function ut({label:e}){const t=(0,l.useSelect)((e=>!!e(u.store).getEditorSettings().enableCustomFields),[]),[o,s]=(0,c.useState)(t);return(0,y.jsx)(dt,{label:e,isChecked:o,onChange:s,children:o!==t&&(0,y.jsx)(pt,{willEnable:o})})}const{PreferenceBaseOption:gt}=C(d.privateApis);function mt(e){const{toggleEditorPanelEnabled:t}=(0,l.useDispatch)(u.store),{isChecked:o,isRemoved:s}=(0,l.useSelect)((t=>{const{isEditorPanelEnabled:o,isEditorPanelRemoved:s}=t(u.store);return{isChecked:o(e.panelName),isRemoved:s(e.panelName)}}),[e.panelName]);return s?null:(0,y.jsx)(gt,{isChecked:o,onChange:()=>t(e.panelName),...e})}const{PreferencesModalSection:ht}=C(d.privateApis);const wt=(0,l.withSelect)((e=>{const{getEditorSettings:t}=e(u.store),{getAllMetaBoxes:o}=e(Je);return{areCustomFieldsRegistered:void 0!==t().enableCustomFields,metaBoxes:o()}}))((function({areCustomFieldsRegistered:e,metaBoxes:t,...o}){const s=t.filter((({id:e})=>"postcustom"!==e));return e||0!==s.length?(0,y.jsxs)(ht,{...o,children:[e&&(0,y.jsx)(ut,{label:(0,_.__)("Custom fields")}),s.map((({id:e,title:t})=>(0,y.jsx)(mt,{label:t,panelName:`meta-box-${e}`},e)))]}):null})),{PreferenceToggleControl:_t}=C(d.privateApis),{PreferencesModal:ft}=C(u.privateApis);function yt(){const e={general:(0,y.jsx)(wt,{title:(0,_.__)("Advanced")}),appearance:(0,y.jsx)(_t,{scope:"core/edit-post",featureName:"themeStyles",help:(0,_.__)("Make the editor look like your theme."),label:(0,_.__)("Use theme styles")})};return(0,y.jsx)(ft,{extraSections:e})}const{ToolsMoreMenuGroup:bt,ViewMoreMenuGroup:xt}=C(u.privateApis),vt=()=>{const e=(0,T.useViewportMatch)("large");return(0,y.jsxs)(y.Fragment,{children:[e&&(0,y.jsx)(xt,{children:(0,y.jsx)(d.PreferenceToggleMenuItem,{scope:"core/edit-post",name:"fullscreenMode",label:(0,_.__)("Fullscreen mode"),info:(0,_.__)("Show and hide the admin user interface"),messageActivated:(0,_.__)("Fullscreen mode activated."),messageDeactivated:(0,_.__)("Fullscreen mode deactivated."),shortcut:at.displayShortcut.secondary("f")})}),(0,y.jsxs)(bt,{children:[(0,y.jsx)(ct,{}),(0,y.jsx)(lt,{})]}),(0,y.jsx)(yt,{})]})};function St({nonAnimatedSrc:e,animatedSrc:t}){return(0,y.jsxs)("picture",{className:"edit-post-welcome-guide__image",children:[(0,y.jsx)("source",{srcSet:e,media:"(prefers-reduced-motion: reduce)"}),(0,y.jsx)("img",{src:t,width:"312",height:"240",alt:""})]})}function Pt(){const{toggleFeature:e}=(0,l.useDispatch)(Je);return(0,y.jsx)(k.Guide,{className:"edit-post-welcome-guide",contentLabel:(0,_.__)("Welcome to the editor"),finishButtonText:(0,_.__)("Get started"),onFinish:()=>e("welcomeGuide"),pages:[{image:(0,y.jsx)(St,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-canvas.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-canvas.gif"}),content:(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("h1",{className:"edit-post-welcome-guide__heading",children:(0,_.__)("Welcome to the editor")}),(0,y.jsx)("p",{className:"edit-post-welcome-guide__text",children:(0,_.__)("In the WordPress editor, each paragraph, image, or video is presented as a distinct “block” of content.")})]})},{image:(0,y.jsx)(St,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-editor.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-editor.gif"}),content:(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("h1",{className:"edit-post-welcome-guide__heading",children:(0,_.__)("Customize each block")}),(0,y.jsx)("p",{className:"edit-post-welcome-guide__text",children:(0,_.__)("Each block comes with its own set of controls for changing things like color, width, and alignment. These will show and hide automatically when you have a block selected.")})]})},{image:(0,y.jsx)(St,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-library.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-library.gif"}),content:(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("h1",{className:"edit-post-welcome-guide__heading",children:(0,_.__)("Explore all blocks")}),(0,y.jsx)("p",{className:"edit-post-welcome-guide__text",children:(0,c.createInterpolateElement)((0,_.__)("All of the blocks available to you live in the block library. You’ll find it wherever you see the icon."),{InserterIconImage:(0,y.jsx)("img",{alt:(0,_.__)("inserter"),src:"data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='18' height='18' rx='2' fill='%231E1E1E'/%3E%3Cpath d='M9.22727 4V14M4 8.77273H14' stroke='white' stroke-width='1.5'/%3E%3C/svg%3E%0A"})})})]})},{image:(0,y.jsx)(St,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-documentation.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-documentation.gif"}),content:(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("h1",{className:"edit-post-welcome-guide__heading",children:(0,_.__)("Learn more")}),(0,y.jsx)("p",{className:"edit-post-welcome-guide__text",children:(0,c.createInterpolateElement)((0,_.__)("New to the block editor? Want to learn more about using it? Here's a detailed guide."),{a:(0,y.jsx)(k.ExternalLink,{href:(0,_.__)("https://wordpress.org/documentation/article/wordpress-block-editor/")})})})]})}]})}function Et(){const{toggleFeature:e}=(0,l.useDispatch)(Je);return(0,y.jsx)(k.Guide,{className:"edit-template-welcome-guide",contentLabel:(0,_.__)("Welcome to the template editor"),finishButtonText:(0,_.__)("Get started"),onFinish:()=>e("welcomeGuideTemplate"),pages:[{image:(0,y.jsx)(St,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-template-editor.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-template-editor.gif"}),content:(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("h1",{className:"edit-post-welcome-guide__heading",children:(0,_.__)("Welcome to the template editor")}),(0,y.jsx)("p",{className:"edit-post-welcome-guide__text",children:(0,_.__)("Templates help define the layout of the site. You can customize all aspects of your posts and pages using blocks and patterns in this editor.")})]})}]})}function Mt({postType:e}){const{isActive:t,isEditingTemplate:o}=(0,l.useSelect)((t=>{const{isFeatureActive:o}=t(Je),s="wp_template"===e;return{isActive:o(s?"welcomeGuideTemplate":"welcomeGuide"),isEditingTemplate:s}}),[e]);return t?o?(0,y.jsx)(Et,{}):(0,y.jsx)(Pt,{}):null}const jt=(0,y.jsx)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,y.jsx)(f.Path,{d:"M6 4a2 2 0 0 0-2 2v3h1.5V6a.5.5 0 0 1 .5-.5h3V4H6Zm3 14.5H6a.5.5 0 0 1-.5-.5v-3H4v3a2 2 0 0 0 2 2h3v-1.5Zm6 1.5v-1.5h3a.5.5 0 0 0 .5-.5v-3H20v3a2 2 0 0 1-2 2h-3Zm3-16a2 2 0 0 1 2 2v3h-1.5V6a.5.5 0 0 0-.5-.5h-3V4h3Z"})});const{getLayoutStyles:kt}=C(h.privateApis),{useCommands:Tt}=C(P.privateApis),{useCommandContext:Bt}=C(S.privateApis),{Editor:It,FullscreenMode:At,NavigableRegion:Rt}=C(u.privateApis),{BlockKeyboardShortcuts:Ct}=C(r.privateApis),Dt=["wp_template","wp_template_part","wp_block","wp_navigation"];function Ot(){const[e,t,o]=(0,l.useSelect)((e=>{const{get:t}=e(d.store),{isMetaBoxLocationVisible:o}=e(Je);return[t("core/edit-post","metaBoxesMainIsOpen"),t("core/edit-post","metaBoxesMainOpenHeight"),o("normal")||o("advanced")||o("side")]}),[]),{set:s}=(0,l.useDispatch)(d.store),i=(0,c.useRef)(),r=(0,T.useMediaQuery)("(max-height: 549px)"),[{min:n,max:a},p]=(0,c.useState)((()=>({}))),u=(0,T.useRefEffect)((e=>{const t=e.closest(".interface-interface-skeleton__content"),o=t.querySelectorAll(":scope > .components-notice-list"),s=t.querySelector(".edit-post-meta-boxes-main__presenter"),i=new window.ResizeObserver((()=>{let e=t.offsetHeight;for(const t of o)e-=t.offsetHeight;const i=s.offsetHeight;p({min:i,max:e})}));i.observe(t);for(const e of o)i.observe(e);return()=>i.disconnect()}),[]),g=(0,c.useRef)(),h=(0,c.useId)(),[w,f]=(0,c.useState)(!0),v=(e,t,o)=>{const r=Math.min(a,Math.max(n,e));t?s("core/edit-post","metaBoxesMainOpenHeight",r):g.current.ariaValueNow=M(r),o&&i.current.updateSize({height:r,width:"auto"})};if(!o)return;const S=(0,y.jsxs)("div",{className:"edit-post-layout__metaboxes edit-post-meta-boxes-main__liner",hidden:r&&!e,children:[(0,y.jsx)(nt,{location:"normal"}),(0,y.jsx)(nt,{location:"advanced"})]}),P=void 0===t;let E="50%";void 0!==a&&(E=P&&w?a/2:a);const M=e=>Math.round((e-n)/(a-n)*100),j=void 0===a||P?50:M(t),B=e=>{const o={ArrowUp:20,ArrowDown:-20}[e.key];if(o){const s=i.current.resizable,r=P?s.offsetHeight:t;v(o+r,!0,!0),e.preventDefault()}},I="edit-post-meta-boxes-main",A=(0,_.__)("Meta Boxes");let R,C;return r?(R=Rt,C={className:m(I,"is-toggle-only")}):(R=k.ResizableBox,C={as:Rt,ref:i,className:m(I,"is-resizable"),defaultSize:{height:t},minHeight:n,maxHeight:E,enable:{top:!0,right:!1,bottom:!1,left:!1,topLeft:!1,topRight:!1,bottomRight:!1,bottomLeft:!1},handleClasses:{top:"edit-post-meta-boxes-main__presenter"},handleComponent:{top:(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(k.Tooltip,{text:(0,_.__)("Drag to resize"),children:(0,y.jsx)("button",{ref:g,role:"separator","aria-valuenow":j,"aria-label":(0,_.__)("Drag to resize"),"aria-describedby":h,onKeyDown:B})}),(0,y.jsx)(k.VisuallyHidden,{id:h,children:(0,_.__)("Use up and down arrow keys to resize the meta box panel.")})]})},onPointerDown:({pointerId:e,target:t})=>{g.current.parentElement.contains(t)&&t.setPointerCapture(e)},onResizeStart:(e,t,o)=>{P&&(v(o.offsetHeight,!1,!0),f(!1))},onResize:()=>v(i.current.state.height),onResizeStop:()=>v(i.current.state.height,!0)}),(0,y.jsxs)(R,{"aria-label":A,...C,children:[r?(0,y.jsxs)("button",{"aria-expanded":e,className:"edit-post-meta-boxes-main__presenter",onClick:()=>s("core/edit-post","metaBoxesMainIsOpen",!e),children:[A,(0,y.jsx)(k.Icon,{icon:e?b:x})]}):(0,y.jsx)("meta",{ref:u}),S]})}const Nt=function({postId:e,postType:t,settings:o,initialEdits:s}){Tt(),function(){const{isFullscreen:e}=(0,l.useSelect)((e=>{const{get:t}=e(d.store);return{isFullscreen:t("core/edit-post","fullscreenMode")}}),[]),{toggle:t}=(0,l.useDispatch)(d.store),{createInfoNotice:o}=(0,l.useDispatch)(v.store);(0,S.useCommand)({name:"core/toggle-fullscreen-mode",label:e?(0,_.__)("Exit fullscreen"):(0,_.__)("Enter fullscreen"),icon:jt,callback:({close:s})=>{t("core/edit-post","fullscreenMode"),s(),o(e?(0,_.__)("Fullscreen off."):(0,_.__)("Fullscreen on."),{id:"core/edit-post/toggle-fullscreen-mode/notice",type:"snackbar",actions:[{label:(0,_.__)("Undo"),onClick:()=>{t("core/edit-post","fullscreenMode")}}]})}})}();const r=(0,l.useSelect)((e=>{const{getEditorSettings:t,getCurrentPostType:o,getDeviceType:s}=e(u.store);return t().__unstableIsBlockBasedTheme||"Desktop"!==s()||["wp_template","wp_block"].includes(o())||C(e(h.store)).isZoomOut()||e(i.store).getBlockTypes().every((e=>e.apiVersion>=3))}),[]),{createErrorNotice:n}=(0,l.useDispatch)(v.store),{currentPost:{postId:a,postType:p},onNavigateToEntityRecord:g,onNavigateToPreviousEntityRecord:f}=function(e,t,o){const[s,i]=(0,c.useReducer)(((e,{type:t,post:o,previousRenderingMode:s})=>"push"===t?[...e,{post:o,previousRenderingMode:s}]:"pop"===t&&e.length>1?e.slice(0,-1):e),[{post:{postId:e,postType:t}}]),{post:r,previousRenderingMode:n}=s[s.length-1],{getRenderingMode:a}=(0,l.useSelect)(u.store),{setRenderingMode:d}=(0,l.useDispatch)(u.store),p=(0,c.useCallback)((e=>{i({type:"push",post:{postId:e.postId,postType:e.postType},previousRenderingMode:a()}),d(o)}),[a,d,o]),g=(0,c.useCallback)((()=>{i({type:"pop"}),n&&d(n)}),[d,n]);return{currentPost:r,onNavigateToEntityRecord:p,onNavigateToPreviousEntityRecord:s.length>1?g:void 0}}(e,t,"post-only"),b="wp_template"===p,{mode:x,isFullscreenActive:P,hasActiveMetaboxes:B,hasBlockSelected:I,showIconLabels:A,isDistractionFree:R,showMetaBoxes:D,isWelcomeGuideVisible:O,templateId:F,enablePaddingAppender:z}=(0,l.useSelect)((e=>{var t;const{get:s}=e(d.store),{isFeatureActive:i}=e(Je),{canUser:r,getPostType:n,getTemplateId:c}=C(e(j.store)),l=o.supportsTemplateMode,g=null!==(t=n(p)?.viewable)&&void 0!==t&&t,m=r("read",{kind:"postType",name:"wp_template"}),{isZoomOut:w}=C(e(h.store)),{getEditorMode:_,getRenderingMode:y}=e(u.store),x="post-only"===y(),v=!Dt.includes(p),S="wp_block"===p&&!f;return{mode:_(),isFullscreenActive:e(Je).isFeatureActive("fullscreenMode"),hasActiveMetaboxes:e(Je).hasMetaBoxes(),hasBlockSelected:!!e(h.store).getBlockSelectionStart(),showIconLabels:s("core","showIconLabels"),isDistractionFree:s("core","distractionFree"),showMetaBoxes:v&&!w()||S,isWelcomeGuideVisible:i("welcomeGuide"),templateId:l&&g&&m&&!b?c(p,a):null,enablePaddingAppender:!w()&&x&&v}}),[p,a,b,o.supportsTemplateMode,f]);(e=>{const t=(0,l.useSelect)((t=>e&&t(u.store).__unstableIsEditorReady()),[e]),{initializeMetaBoxes:o}=(0,l.useDispatch)(Je);(0,c.useEffect)((()=>{t&&o()}),[t,o])})(B);const[G,U]=function(e){const t=(0,l.useRegistry)(),o=(0,T.useRefEffect)((e=>{function o(o){if(o.target!==e&&o.target!==e.parentElement)return;const s=e.lastElementChild;if(!s)return;const r=s.getBoundingClientRect();if(o.clientY{s.removeEventListener("mousedown",o)}}),[t]);return e?[o,':root :where(.editor-styles-wrapper)::after {content: ""; display: block; height: 40vh;}']:[]}(z);Bt(I?"block-selection-edit":"entity-edit");const V=(0,c.useMemo)((()=>({...o,onNavigateToEntityRecord:g,onNavigateToPreviousEntityRecord:f,defaultRenderingMode:"post-only"})),[o,g,f]),H=function(...e){const{hasThemeStyleSupport:t,editorSettings:o}=(0,l.useSelect)((e=>({hasThemeStyleSupport:e(Je).isFeatureActive("themeStyles"),editorSettings:e(u.store).getEditorSettings()})),[]),s=e.join("\n");return(0,c.useMemo)((()=>{var e,i,r,n;const a=null!==(e=o.styles?.filter((e=>e.__unstableType&&"theme"!==e.__unstableType)))&&void 0!==e?e:[],c=[...null!==(i=o?.defaultEditorStyles)&&void 0!==i?i:[],...a],l=t&&a.length!==(null!==(r=o.styles?.length)&&void 0!==r?r:0);o.disableLayoutStyles||l||c.push({css:kt({style:{},selector:"body",hasBlockGapSupport:!1,hasFallbackGapSupport:!0,fallbackGapValue:"0.5em"})});const d=l?null!==(n=o.styles)&&void 0!==n?n:[]:c;return s?[...d,{css:s}]:d}),[o.defaultEditorStyles,o.disableLayoutStyles,o.styles,t,s])}(U);A?document.body.classList.add("show-icon-labels"):document.body.classList.remove("show-icon-labels");const q=(0,k.__unstableUseNavigateRegions)(),W=m("edit-post-layout","is-mode-"+x,{"has-metaboxes":B}),{createSuccessNotice:Q}=(0,l.useDispatch)(v.store),X=(0,c.useCallback)(((e,t)=>{switch(e){case"move-to-trash":document.location.href=(0,E.addQueryArgs)("edit.php",{trashed:1,post_type:t[0].type,ids:t[0].id});break;case"duplicate-post":{const e=t[0],o="string"==typeof e.title?e.title:e.title?.rendered;Q((0,_.sprintf)((0,_.__)('"%s" successfully created.'),(0,M.decodeEntities)(o)),{type:"snackbar",id:"duplicate-post-action",actions:[{label:(0,_.__)("Edit"),onClick:()=>{const t=e.id;document.location.href=(0,E.addQueryArgs)("post.php",{post:t,action:"edit"})}}]})}}}),[Q]),Z=(0,c.useMemo)((()=>({type:t,id:e})),[t,e]),$=(0,T.useViewportMatch)("medium")&&P?(0,y.jsx)(N,{initialPost:Z}):null;return(0,y.jsx)(k.SlotFillProvider,{children:(0,y.jsxs)(u.ErrorBoundary,{canCopyContent:!0,children:[(0,y.jsx)(S.CommandMenu,{}),(0,y.jsx)(Mt,{postType:p}),(0,y.jsx)("div",{className:q.className,...q,ref:q.ref,children:(0,y.jsxs)(It,{settings:V,initialEdits:s,postType:p,postId:a,templateId:F,className:W,styles:H,forceIsDirty:B,contentRef:G,disableIframe:!r,autoFocus:!O,onActionPerformed:X,extraSidebarPanels:D&&(0,y.jsx)(nt,{location:"side"}),extraContent:!R&&D&&(0,y.jsx)(Ot,{}),children:[(0,y.jsx)(u.PostLockedModal,{}),(0,y.jsx)(L,{}),(0,y.jsx)(At,{isActive:P}),(0,y.jsx)(st,{}),(0,y.jsx)(u.UnsavedChangesWarning,{}),(0,y.jsx)(u.AutosaveMonitor,{}),(0,y.jsx)(u.LocalAutosaveMonitor,{}),(0,y.jsx)(et,{}),(0,y.jsx)(u.EditorKeyboardShortcutsRegister,{}),(0,y.jsx)(Ct,{}),(0,y.jsx)(tt,{}),(0,y.jsx)(w.PluginArea,{onError:function(e){n((0,_.sprintf)((0,_.__)('The "%s" plugin has encountered an error and cannot be rendered.'),e))}}),(0,y.jsx)(vt,{}),$,(0,y.jsx)(u.EditorSnackbars,{})]})})]})})},{PluginPostExcerpt:Lt}=C(u.privateApis),Ft=(0,E.getPath)(window.location.href)?.includes("site-editor.php"),zt=e=>{a()(`wp.editPost.${e}`,{since:"6.6",alternative:`wp.editor.${e}`})};function Gt(e){return Ft?null:(zt("PluginBlockSettingsMenuItem"),(0,y.jsx)(u.PluginBlockSettingsMenuItem,{...e}))}function Ut(e){return Ft?null:(zt("PluginDocumentSettingPanel"),(0,y.jsx)(u.PluginDocumentSettingPanel,{...e}))}function Vt(e){return Ft?null:(zt("PluginMoreMenuItem"),(0,y.jsx)(u.PluginMoreMenuItem,{...e}))}function Ht(e){return Ft?null:(zt("PluginPrePublishPanel"),(0,y.jsx)(u.PluginPrePublishPanel,{...e}))}function qt(e){return Ft?null:(zt("PluginPostPublishPanel"),(0,y.jsx)(u.PluginPostPublishPanel,{...e}))}function Wt(e){return Ft?null:(zt("PluginPostStatusInfo"),(0,y.jsx)(u.PluginPostStatusInfo,{...e}))}function Qt(e){return Ft?null:(zt("PluginSidebar"),(0,y.jsx)(u.PluginSidebar,{...e}))}function Xt(e){return Ft?null:(zt("PluginSidebarMoreMenuItem"),(0,y.jsx)(u.PluginSidebarMoreMenuItem,{...e}))}function Zt(){return Ft?null:(a()("wp.editPost.__experimentalPluginPostExcerpt",{since:"6.6",hint:"Core and custom panels can be access programmatically using their panel name.",link:"https://developer.wordpress.org/block-editor/reference-guides/slotfills/plugin-document-setting-panel/#accessing-a-panel-programmatically"}),Lt)}const{BackButton:$t,registerCoreBlockBindingsSources:Yt}=C(u.privateApis);function Kt(e,t,o,s,n){const a=window.matchMedia("(min-width: 782px)").matches,g=document.getElementById(e),m=(0,c.createRoot)(g);(0,l.dispatch)(d.store).setDefaults("core/edit-post",{fullscreenMode:!0,themeStyles:!0,welcomeGuide:!0,welcomeGuideTemplate:!0}),(0,l.dispatch)(d.store).setDefaults("core",{allowRightClickOverrides:!0,editorMode:"visual",editorTool:"edit",fixedToolbar:!1,hiddenBlockTypes:[],inactivePanels:[],openPanels:["post-status"],showBlockBreadcrumbs:!0,showIconLabels:!1,showListViewByDefault:!1,enableChoosePatternModal:!0,isPublishSidebarEnabled:!0}),window.__experimentalMediaProcessing&&(0,l.dispatch)(d.store).setDefaults("core/media",{requireApproval:!0,optimizeOnUpload:!0}),(0,l.dispatch)(i.store).reapplyBlockTypeFilters(),a&&(0,l.select)(d.store).get("core","showListViewByDefault")&&!(0,l.select)(d.store).get("core","distractionFree")&&(0,l.dispatch)(u.store).setIsListViewOpened(!0),(0,r.registerCoreBlocks)(),Yt(),(0,p.registerLegacyWidgetBlock)({inserter:!1}),(0,p.registerWidgetGroupBlock)({inserter:!1});"Standards"!==("CSS1Compat"===document.compatMode?"Standards":"Quirks")&&console.warn("Your browser is using Quirks Mode. \nThis can cause rendering issues such as blocks overlaying meta boxes in the editor. Quirks Mode can be triggered by PHP errors or HTML code appearing before the opening . Try checking the raw page source or your site's PHP error log and resolving errors there, removing any HTML before the doctype, or disabling plugins.");return-1!==window.navigator.userAgent.indexOf("iPhone")&&window.addEventListener("scroll",(e=>{const t=document.getElementsByClassName("interface-interface-skeleton__body")[0];e.target===document&&(window.scrollY>100&&(t.scrollTop=t.scrollTop+window.scrollY),document.getElementsByClassName("is-mode-visual")[0]&&window.scrollTo(0,0))})),window.addEventListener("dragover",(e=>e.preventDefault()),!1),window.addEventListener("drop",(e=>e.preventDefault()),!1),m.render((0,y.jsx)(c.StrictMode,{children:(0,y.jsx)(Nt,{settings:s,postId:o,postType:t,initialEdits:n})})),m}function Jt(){a()("wp.editPost.reinitializeEditor",{since:"6.2",version:"6.3"})}(window.wp=window.wp||{}).editPost=t})(); \ No newline at end of file diff --git a/wp-includes/js/dist/edit-site.js b/wp-includes/js/dist/edit-site.js index fdb23a1172..ae43f90189 100644 --- a/wp-includes/js/dist/edit-site.js +++ b/wp-includes/js/dist/edit-site.js @@ -5875,21 +5875,76 @@ module.exports.remove = removeAccents; /***/ }), -/***/ 8477: +/***/ 83: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * @license React - * use-sync-external-store-shim.production.min.js + * use-sync-external-store-shim.production.js * - * Copyright (c) Facebook, Inc. and its affiliates. + * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ -var e=__webpack_require__(1609);function h(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}var k="function"===typeof Object.is?Object.is:h,l=e.useState,m=e.useEffect,n=e.useLayoutEffect,p=e.useDebugValue;function q(a,b){var d=b(),f=l({inst:{value:d,getSnapshot:b}}),c=f[0].inst,g=f[1];n(function(){c.value=d;c.getSnapshot=b;r(c)&&g({inst:c})},[a,d,b]);m(function(){r(c)&&g({inst:c});return a(function(){r(c)&&g({inst:c})})},[a]);p(d);return d} -function r(a){var b=a.getSnapshot;a=a.value;try{var d=b();return!k(a,d)}catch(f){return!0}}function t(a,b){return b()}var u="undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement?t:q;exports.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:u; + + +var React = __webpack_require__(1609); +function is(x, y) { + return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y); +} +var objectIs = "function" === typeof Object.is ? Object.is : is, + useState = React.useState, + useEffect = React.useEffect, + useLayoutEffect = React.useLayoutEffect, + useDebugValue = React.useDebugValue; +function useSyncExternalStore$2(subscribe, getSnapshot) { + var value = getSnapshot(), + _useState = useState({ inst: { value: value, getSnapshot: getSnapshot } }), + inst = _useState[0].inst, + forceUpdate = _useState[1]; + useLayoutEffect( + function () { + inst.value = value; + inst.getSnapshot = getSnapshot; + checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst }); + }, + [subscribe, value, getSnapshot] + ); + useEffect( + function () { + checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst }); + return subscribe(function () { + checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst }); + }); + }, + [subscribe] + ); + useDebugValue(value); + return value; +} +function checkIfSnapshotChanged(inst) { + var latestGetSnapshot = inst.getSnapshot; + inst = inst.value; + try { + var nextValue = latestGetSnapshot(); + return !objectIs(inst, nextValue); + } catch (error) { + return !0; + } +} +function useSyncExternalStore$1(subscribe, getSnapshot) { + return getSnapshot(); +} +var shim = + "undefined" === typeof window || + "undefined" === typeof window.document || + "undefined" === typeof window.document.createElement + ? useSyncExternalStore$1 + : useSyncExternalStore$2; +exports.useSyncExternalStore = + void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim; /***/ }), @@ -5901,7 +5956,7 @@ function r(a){var b=a.getSnapshot;a=a.value;try{var d=b();return!k(a,d)}catch(f) if (true) { - module.exports = __webpack_require__(8477); + module.exports = __webpack_require__(83); } else {} @@ -6066,8 +6121,9 @@ __webpack_require__.d(actions_namespaceObject, { var private_actions_namespaceObject = {}; __webpack_require__.r(private_actions_namespaceObject); __webpack_require__.d(private_actions_namespaceObject, { - setCanvasMode: () => (setCanvasMode), - setEditorCanvasContainerView: () => (setEditorCanvasContainerView) + registerRoute: () => (registerRoute), + setEditorCanvasContainerView: () => (setEditorCanvasContainerView), + unregisterRoute: () => (unregisterRoute) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/edit-site/build-module/store/selectors.js @@ -6101,8 +6157,8 @@ __webpack_require__.d(selectors_namespaceObject, { var private_selectors_namespaceObject = {}; __webpack_require__.r(private_selectors_namespaceObject); __webpack_require__.d(private_selectors_namespaceObject, { - getCanvasMode: () => (getCanvasMode), - getEditorCanvasContainerView: () => (getEditorCanvasContainerView) + getEditorCanvasContainerView: () => (getEditorCanvasContainerView), + getRoutes: () => (getRoutes) }); ;// external ["wp","blocks"] @@ -6155,6 +6211,7 @@ const { } = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/edit-site'); ;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/hooks.js +/* wp:polyfill */ /** * External dependencies */ @@ -6238,6 +6295,7 @@ function useSupportedStyles(name, element) { } ;// ./node_modules/@wordpress/edit-site/build-module/utils/set-nested-value.js +/* wp:polyfill */ /** * Sets the value at path of object. * If a portion of path doesn’t exist, it’s created. @@ -6301,8 +6359,6 @@ const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"]; - - const { cleanEmptyObject, GlobalStylesContext @@ -6618,6 +6674,7 @@ const withPushChangesToGlobalStyles = (0,external_wp_compose_namespaceObject.cre ;// ./node_modules/@wordpress/edit-site/build-module/store/reducer.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -6678,22 +6735,6 @@ function saveViewPanel(state = false, action) { switch (action.type) { case 'SET_IS_SAVE_VIEW_OPENED': return action.isOpen; - case 'SET_CANVAS_MODE': - return false; - } - return state; -} - -/** - * Reducer used to track the site editor canvas mode (edit or view). - * - * @param {Object} state Current state. - * @param {Object} action Dispatched action. - */ -function canvasMode(state = 'init', action) { - switch (action.type) { - case 'SET_CANVAS_MODE': - return action.mode; } return state; } @@ -6713,12 +6754,21 @@ function editorCanvasContainerView(state = undefined, action) { } return state; } +function routes(state = [], action) { + switch (action.type) { + case 'REGISTER_ROUTE': + return [...state, action.route]; + case 'UNREGISTER_ROUTE': + return state.filter(route => route.name !== action.name); + } + return state; +} /* harmony default export */ const reducer = ((0,external_wp_data_namespaceObject.combineReducers)({ settings, editedPost, saveViewPanel, - canvasMode, - editorCanvasContainerView + editorCanvasContainerView, + routes })); ;// external ["wp","patterns"] @@ -6896,11 +6946,15 @@ const removeTemplate = template => ({ /** * Action that sets a template part. * + * @deprecated * @param {string} templatePartId The template part ID. * * @return {Object} Action object. */ function setTemplatePart(templatePartId) { + external_wp_deprecated_default()("dispatch( 'core/edit-site' ).setTemplatePart", { + since: '6.8' + }); return { type: 'SET_EDITED_POST', postType: TEMPLATE_PART_POST_TYPE, @@ -6911,11 +6965,15 @@ function setTemplatePart(templatePartId) { /** * Action that sets a navigation menu. * + * @deprecated * @param {string} navigationMenuId The Navigation Menu Post ID. * * @return {Object} Action object. */ function setNavigationMenu(navigationMenuId) { + external_wp_deprecated_default()("dispatch( 'core/edit-site' ).setNavigationMenu", { + since: '6.8' + }); return { type: 'SET_EDITED_POST', postType: NAVIGATION_POST_TYPE, @@ -6926,6 +6984,7 @@ function setNavigationMenu(navigationMenuId) { /** * Action that sets an edited entity. * + * @deprecated * @param {string} postType The entity's post type. * @param {string} postId The entity's ID. * @param {Object} context The entity's context. @@ -6957,11 +7016,15 @@ function setHomeTemplateId() { /** * Set's the current block editor context. * + * @deprecated * @param {Object} context The context object. * * @return {Object} Action object. */ function setEditedPostContext(context) { + external_wp_deprecated_default()("dispatch( 'core/edit-site' ).setEditedPostContext", { + since: '6.8' + }); return { type: 'SET_EDITED_POST_CONTEXT', context @@ -7187,65 +7250,6 @@ const toggleDistractionFree = () => ({ }; ;// ./node_modules/@wordpress/edit-site/build-module/store/private-actions.js -/** - * WordPress dependencies - */ - - - - -/** - * Action that switches the canvas mode. - * - * @param {?string} mode Canvas mode. - */ -const setCanvasMode = mode => ({ - registry, - dispatch -}) => { - const isMediumOrBigger = window.matchMedia('(min-width: 782px)').matches; - const switchCanvasMode = () => { - registry.batch(() => { - registry.dispatch(external_wp_blockEditor_namespaceObject.store).clearSelectedBlock(); - registry.dispatch(external_wp_editor_namespaceObject.store).setDeviceType('Desktop'); - registry.dispatch(external_wp_blockEditor_namespaceObject.store).__unstableSetEditorMode('edit'); - const isPublishSidebarOpened = registry.select(external_wp_editor_namespaceObject.store).isPublishSidebarOpened(); - dispatch({ - type: 'SET_CANVAS_MODE', - mode - }); - const isEditMode = mode === 'edit'; - if (isPublishSidebarOpened && !isEditMode) { - registry.dispatch(external_wp_editor_namespaceObject.store).closePublishSidebar(); - } - - // Check if the block list view should be open by default. - // If `distractionFree` mode is enabled, the block list view should not be open. - // This behavior is disabled for small viewports. - if (isMediumOrBigger && isEditMode && registry.select(external_wp_preferences_namespaceObject.store).get('core', 'showListViewByDefault') && !registry.select(external_wp_preferences_namespaceObject.store).get('core', 'distractionFree')) { - registry.dispatch(external_wp_editor_namespaceObject.store).setIsListViewOpened(true); - } else { - registry.dispatch(external_wp_editor_namespaceObject.store).setIsListViewOpened(false); - } - registry.dispatch(external_wp_editor_namespaceObject.store).setIsInserterOpened(false); - }); - }; - - /* - * Skip transition in mobile, otherwise it crashes the browser. - * See: https://github.com/WordPress/gutenberg/pull/63002. - */ - if (!isMediumOrBigger || !document.startViewTransition) { - switchCanvasMode(); - } else { - document.documentElement.classList.add(`canvas-mode-${mode}-transition`); - const transition = document.startViewTransition(() => switchCanvasMode()); - transition.finished.finally(() => { - document.documentElement.classList.remove(`canvas-mode-${mode}-transition`); - }); - } -}; - /** * Action that switches the editor canvas container view. * @@ -7259,8 +7263,21 @@ const setEditorCanvasContainerView = view => ({ view }); }; +function registerRoute(route) { + return { + type: 'REGISTER_ROUTE', + route + }; +} +function unregisterRoute(name) { + return { + type: 'UNREGISTER_ROUTE', + name + }; +} ;// ./node_modules/@wordpress/edit-site/build-module/utils/get-filtered-template-parts.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -7437,22 +7454,32 @@ function getHomeTemplateId() { /** * Returns the current edited post type (wp_template or wp_template_part). * + * @deprecated * @param {Object} state Global application state. * * @return {?TemplateType} Template type. */ function getEditedPostType(state) { + external_wp_deprecated_default()("select( 'core/edit-site' ).getEditedPostType", { + since: '6.8', + alternative: "select( 'core/editor' ).getCurrentPostType" + }); return state.editedPost.postType; } /** * Returns the ID of the currently edited template or template part. * + * @deprecated * @param {Object} state Global application state. * * @return {?string} Post ID. */ function getEditedPostId(state) { + external_wp_deprecated_default()("select( 'core/edit-site' ).getEditedPostId", { + since: '6.8', + alternative: "select( 'core/editor' ).getCurrentPostId" + }); return state.editedPost.id; } @@ -7465,6 +7492,9 @@ function getEditedPostId(state) { * @return {Object} Page. */ function getEditedPostContext(state) { + external_wp_deprecated_default()("select( 'core/edit-site' ).getEditedPostContext", { + since: '6.8' + }); return state.editedPost.context; } @@ -7477,6 +7507,9 @@ function getEditedPostContext(state) { * @return {Object} Page. */ function getPage(state) { + external_wp_deprecated_default()("select( 'core/edit-site' ).getPage", { + since: '6.8' + }); return { context: state.editedPost.context }; @@ -7513,7 +7546,7 @@ const __experimentalGetInsertionPoint = (0,external_wp_data_namespaceObject.crea since: '6.5', version: '6.7' }); - return unlock(select(external_wp_editor_namespaceObject.store)).getInsertionPoint(); + return unlock(select(external_wp_editor_namespaceObject.store)).getInserter(); }); /** @@ -7615,12 +7648,16 @@ function isNavigationOpened() { * Whether or not the editor has a page loaded into it. * * @see setPage - * + * @deprecated * @param {Object} state Global application state. * * @return {boolean} Whether or not the editor has a page loaded into it. */ function isPage(state) { + external_wp_deprecated_default()("select( 'core/edit-site' ).isPage", { + since: '6.8', + alternative: "select( 'core/editor' ).getCurrentPostType" + }); return !!state.editedPost.context?.postId; } @@ -7639,17 +7676,6 @@ function hasPageContentFocus() { } ;// ./node_modules/@wordpress/edit-site/build-module/store/private-selectors.js -/** - * Returns the current canvas mode. - * - * @param {Object} state Global application state. - * - * @return {string} Canvas mode. - */ -function getCanvasMode(state) { - return state.canvasMode; -} - /** * Returns the editor canvas container view. * @@ -7660,6 +7686,9 @@ function getCanvasMode(state) { function getEditorCanvasContainerView(state) { return state.editorCanvasContainerView; } +function getRoutes(state) { + return state.routes; +} ;// ./node_modules/@wordpress/edit-site/build-module/store/constants.js /** @@ -7695,8 +7724,6 @@ const store = (0,external_wp_data_namespaceObject.createReduxStore)(STORE_NAME, unlock(store).registerPrivateSelectors(private_selectors_namespaceObject); unlock(store).registerPrivateActions(private_actions_namespaceObject); -;// external ["wp","plugins"] -const external_wp_plugins_namespaceObject = window["wp"]["plugins"]; ;// external ["wp","router"] const external_wp_router_namespaceObject = window["wp"]["router"]; ;// ./node_modules/clsx/dist/clsx.mjs @@ -7705,81 +7732,8 @@ function clsx_r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;e const external_wp_commands_namespaceObject = window["wp"]["commands"]; ;// external ["wp","coreCommands"] const external_wp_coreCommands_namespaceObject = window["wp"]["coreCommands"]; -;// ./node_modules/@wordpress/edit-site/build-module/components/error-boundary/warning.js -/** - * WordPress dependencies - */ - - - - - -function CopyButton({ - text, - children -}) { - const ref = (0,external_wp_compose_namespaceObject.useCopyToClipboard)(text); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - __next40pxDefaultSize: true, - variant: "secondary", - ref: ref, - children: children - }); -} -function ErrorBoundaryWarning({ - message, - error -}) { - const actions = [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CopyButton, { - text: error.stack, - children: (0,external_wp_i18n_namespaceObject.__)('Copy Error') - }, "copy-error")]; - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.Warning, { - className: "editor-error-boundary", - actions: actions, - children: message - }); -} - -;// ./node_modules/@wordpress/edit-site/build-module/components/error-boundary/index.js -/** - * WordPress dependencies - */ - - - - -/** - * Internal dependencies - */ - - -class ErrorBoundary extends external_wp_element_namespaceObject.Component { - constructor() { - super(...arguments); - this.state = { - error: null - }; - } - componentDidCatch(error) { - (0,external_wp_hooks_namespaceObject.doAction)('editor.ErrorBoundary.errorLogged', error); - } - static getDerivedStateFromError(error) { - return { - error - }; - } - render() { - if (!this.state.error) { - return this.props.children; - } - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ErrorBoundaryWarning, { - message: (0,external_wp_i18n_namespaceObject.__)('The editor has encountered an unexpected error.'), - error: this.state.error - }); - } -} - +;// external ["wp","plugins"] +const external_wp_plugins_namespaceObject = window["wp"]["plugins"]; ;// external ["wp","htmlEntities"] const external_wp_htmlEntities_namespaceObject = window["wp"]["htmlEntities"]; ;// external ["wp","primitives"] @@ -7873,6 +7827,7 @@ function SiteIcon({ ;// external ["wp","dom"] const external_wp_dom_namespaceObject = window["wp"]["dom"]; ;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar/index.js +/* wp:polyfill */ /** * External dependencies */ @@ -7920,7 +7875,8 @@ function createNavState() { }; } function SidebarContentWrapper({ - children + children, + shouldAnimate }) { const navState = (0,external_wp_element_namespaceObject.useContext)(SidebarNavigationContext); const wrapperRef = (0,external_wp_element_namespaceObject.useRef)(); @@ -7933,10 +7889,15 @@ function SidebarContentWrapper({ focusSidebarElement(wrapperRef.current, direction, focusSelector); setNavAnimation(direction); }, [navState]); - const wrapperCls = dist_clsx('edit-site-sidebar__screen-wrapper', { + const wrapperCls = dist_clsx('edit-site-sidebar__screen-wrapper', + /* + * Some panes do not have sub-panes and therefore + * should not animate when clicked on. + */ + shouldAnimate ? { 'slide-from-left': navAnimation === 'back', 'slide-from-right': navAnimation === 'forward' - }); + } : {}); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ref: wrapperRef, className: wrapperCls, @@ -7945,6 +7906,7 @@ function SidebarContentWrapper({ } function SidebarContent({ routeKey, + shouldAnimate, children }) { const [navState] = (0,external_wp_element_namespaceObject.useState)(createNavState); @@ -7953,6 +7915,7 @@ function SidebarContent({ children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "edit-site-sidebar__content", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarContentWrapper, { + shouldAnimate: shouldAnimate, children: children }, routeKey) }) @@ -7991,7 +7954,6 @@ const { } = unlock(external_wp_router_namespaceObject.privateApis); - const SiteHub = (0,external_wp_element_namespaceObject.memo)((0,external_wp_element_namespaceObject.forwardRef)(({ isTransparent }, ref) => { @@ -8008,7 +7970,7 @@ const SiteHub = (0,external_wp_element_namespaceObject.memo)((0,external_wp_elem } = select(external_wp_coreData_namespaceObject.store); const _site = getEntityRecord('root', 'site'); return { - dashboardLink: getSettings().__experimentalDashboardLink || 'index.php', + dashboardLink: getSettings().__experimentalDashboardLink, homeUrl: getEntityRecord('root', '__unstableBase')?.home, siteTitle: !_site?.title && !!_site?.url ? (0,external_wp_url_namespaceObject.filterURLForDisplay)(_site?.url) : _site?.title }; @@ -8080,14 +8042,22 @@ const SiteHubMobile = (0,external_wp_element_namespaceObject.memo)((0,external_w navigate } = (0,external_wp_element_namespaceObject.useContext)(SidebarNavigationContext); const { + dashboardLink, + isBlockTheme, homeUrl, siteTitle } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { - getEntityRecord + getSettings + } = unlock(select(store)); + const { + getEntityRecord, + getCurrentTheme } = select(external_wp_coreData_namespaceObject.store); const _site = getEntityRecord('root', 'site'); return { + dashboardLink: getSettings().__experimentalDashboardLink, + isBlockTheme: getCurrentTheme()?.is_block_theme, homeUrl: getEntityRecord('root', '__unstableBase')?.home, siteTitle: !_site?.title && !!_site?.url ? (0,external_wp_url_namespaceObject.filterURLForDisplay)(_site?.url) : _site?.title }; @@ -8107,16 +8077,21 @@ const SiteHubMobile = (0,external_wp_element_namespaceObject.memo)((0,external_w children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, ref: ref, - label: (0,external_wp_i18n_namespaceObject.__)('Go to Site Editor'), className: "edit-site-layout__view-mode-toggle", style: { transform: 'scale(0.5)', borderRadius: 4 }, - onClick: () => { - history.push({}); - navigate('back'); - }, + ...(!isBlockTheme ? { + href: dashboardLink, + label: (0,external_wp_i18n_namespaceObject.__)('Go to the Dashboard') + } : { + onClick: () => { + history.navigate('/'); + navigate('back'); + }, + label: (0,external_wp_i18n_namespaceObject.__)('Go to Site Editor') + }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(site_icon, { className: "edit-site-layout__view-mode-toggle-icon" }) @@ -8165,16 +8140,20 @@ const SiteHubMobile = (0,external_wp_element_namespaceObject.memo)((0,external_w + + /** * Internal dependencies */ +const { + useLocation, + useHistory: resizable_frame_useHistory +} = unlock(external_wp_router_namespaceObject.privateApis); + // Removes the inline styles in the drag handles. - - - const HANDLE_STYLES_OVERRIDE = { position: undefined, userSelect: undefined, @@ -8221,10 +8200,18 @@ function ResizableFrame({ setIsOversized, isReady, children, - /** The default (unresized) width/height of the frame, based on the space availalbe in the viewport. */ + /** The default (unresized) width/height of the frame, based on the space available in the viewport. */ defaultSize, innerContentStyle }) { + const history = resizable_frame_useHistory(); + const { + path, + query + } = useLocation(); + const { + canvas = 'view' + } = query; const disableMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)(); const [frameSize, setFrameSize] = (0,external_wp_element_namespaceObject.useState)(INITIAL_FRAME_SIZE); // The width of the resizable frame when a new resize gesture starts. @@ -8232,10 +8219,6 @@ function ResizableFrame({ const [isResizing, setIsResizing] = (0,external_wp_element_namespaceObject.useState)(false); const [shouldShowHandle, setShouldShowHandle] = (0,external_wp_element_namespaceObject.useState)(false); const [resizeRatio, setResizeRatio] = (0,external_wp_element_namespaceObject.useState)(1); - const canvasMode = (0,external_wp_data_namespaceObject.useSelect)(select => unlock(select(store)).getCanvasMode(), []); - const { - setCanvasMode - } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store)); const FRAME_TRANSITION = { type: 'tween', duration: isResizing ? 0 : 0.5 @@ -8243,6 +8226,12 @@ function ResizableFrame({ const frameRef = (0,external_wp_element_namespaceObject.useRef)(null); const resizableHandleHelpId = (0,external_wp_compose_namespaceObject.useInstanceId)(ResizableFrame, 'edit-site-resizable-frame-handle-help'); const defaultAspectRatio = defaultSize.width / defaultSize.height; + const isBlockTheme = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getCurrentTheme + } = select(external_wp_coreData_namespaceObject.store); + return getCurrentTheme()?.is_block_theme; + }, []); const handleResizeStart = (_event, _direction, ref) => { // Remember the starting width so we don't have to get `ref.offsetWidth` on // every resize event thereafter, which will cause layout thrashing. @@ -8276,13 +8265,17 @@ function ResizableFrame({ } setIsOversized(false); const remainingWidth = ref.ownerDocument.documentElement.offsetWidth - ref.offsetWidth; - if (remainingWidth > SNAP_TO_EDIT_CANVAS_MODE_THRESHOLD) { + if (remainingWidth > SNAP_TO_EDIT_CANVAS_MODE_THRESHOLD || !isBlockTheme) { // Reset the initial aspect ratio if the frame is resized slightly // above the sidebar but not far enough to trigger full screen. setFrameSize(INITIAL_FRAME_SIZE); } else { // Trigger full screen if the frame is resized far enough to the left. - setCanvasMode('edit'); + history.navigate((0,external_wp_url_namespaceObject.addQueryArgs)(path, { + canvas: 'edit' + }), { + transition: 'canvas-mode-edit-transition' + }); } }; @@ -8293,7 +8286,7 @@ function ResizableFrame({ } event.preventDefault(); const step = 20 * (event.shiftKey ? 5 : 1); - const delta = step * (event.key === 'ArrowLeft' ? 1 : -1); + const delta = step * (event.key === 'ArrowLeft' ? 1 : -1) * ((0,external_wp_i18n_namespaceObject.isRTL)() ? -1 : 1); const newWidth = Math.min(Math.max(FRAME_MIN_WIDTH, frameRef.current.resizable.offsetWidth + delta), defaultSize.width); setFrameSize({ width: newWidth, @@ -8313,16 +8306,29 @@ function ResizableFrame({ const resizeHandleVariants = { hidden: { opacity: 0, - left: 0 + ...((0,external_wp_i18n_namespaceObject.isRTL)() ? { + right: 0 + } : { + left: 0 + }) }, visible: { opacity: 1, - left: -14 // Account for the handle's width. + // Account for the handle's width. + ...((0,external_wp_i18n_namespaceObject.isRTL)() ? { + right: -14 + } : { + left: -14 + }) }, active: { opacity: 1, - left: -14, // Account for the handle's width. + ...((0,external_wp_i18n_namespaceObject.isRTL)() ? { + right: -14 + } : { + left: -14 + }), scaleY: 1.3 } }; @@ -8346,7 +8352,7 @@ function ResizableFrame({ }); } }, - whileHover: canvasMode === 'view' ? { + whileHover: canvas === 'view' ? { scale: 1.005, transition: { duration: disableMotion ? 0 : 0.5, @@ -8357,10 +8363,15 @@ function ResizableFrame({ size: frameSize, enable: { top: false, - right: false, bottom: false, // Resizing will be disabled until the editor content is loaded. - left: isReady, + ...((0,external_wp_i18n_namespaceObject.isRTL)() ? { + right: isReady, + left: false + } : { + left: isReady, + right: false + }), topRight: false, bottomRight: false, bottomLeft: false, @@ -8380,7 +8391,7 @@ function ResizableFrame({ onMouseOver: () => setShouldShowHandle(true), onMouseOut: () => setShouldShowHandle(false), handleComponent: { - left: canvasMode === 'view' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + [(0,external_wp_i18n_namespaceObject.isRTL)() ? 'right' : 'left']: canvas === 'view' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Tooltip, { text: (0,external_wp_i18n_namespaceObject.__)('Drag to resize'), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableMotion.button, { @@ -8428,7 +8439,8 @@ function ResizableFrame({ ;// external ["wp","keyboardShortcuts"] const external_wp_keyboardShortcuts_namespaceObject = window["wp"]["keyboardShortcuts"]; -;// ./node_modules/@wordpress/edit-site/build-module/components/keyboard-shortcuts/register.js +;// ./node_modules/@wordpress/edit-site/build-module/components/save-keyboard-shortcut/index.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -8436,14 +8448,42 @@ const external_wp_keyboardShortcuts_namespaceObject = window["wp"]["keyboardShor -function KeyboardShortcutsRegister() { - // Registering the shortcuts. + + + +/** + * Internal dependencies + */ + +const shortcutName = 'core/edit-site/save'; + +/** + * Register the save keyboard shortcut in view mode. + * + * @return {null} Returns null. + */ +function SaveKeyboardShortcut() { const { - registerShortcut + __experimentalGetDirtyEntityRecords, + isSavingEntityRecord + } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_coreData_namespaceObject.store); + const { + hasNonPostEntityChanges, + isPostSavingLocked + } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_editor_namespaceObject.store); + const { + savePost + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_editor_namespaceObject.store); + const { + setIsSaveViewOpened + } = (0,external_wp_data_namespaceObject.useDispatch)(store); + const { + registerShortcut, + unregisterShortcut } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_keyboardShortcuts_namespaceObject.store); (0,external_wp_element_namespaceObject.useEffect)(() => { registerShortcut({ - name: 'core/edit-site/save', + name: shortcutName, category: 'global', description: (0,external_wp_i18n_namespaceObject.__)('Save your changes.'), keyCombination: { @@ -8451,111 +8491,26 @@ function KeyboardShortcutsRegister() { character: 's' } }); - }, [registerShortcut]); - return null; -} -/* harmony default export */ const register = (KeyboardShortcutsRegister); - -;// ./node_modules/@wordpress/edit-site/build-module/components/keyboard-shortcuts/global.js -/** - * WordPress dependencies - */ - - - - - -/** - * Internal dependencies - */ - - -function KeyboardShortcutsGlobal() { - const { - __experimentalGetDirtyEntityRecords, - isSavingEntityRecord - } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_coreData_namespaceObject.store); - const { - hasNonPostEntityChanges - } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_editor_namespaceObject.store); - const { - getCanvasMode - } = unlock((0,external_wp_data_namespaceObject.useSelect)(store)); - const { - setIsSaveViewOpened - } = (0,external_wp_data_namespaceObject.useDispatch)(store); + return () => { + unregisterShortcut(shortcutName); + }; + }, [registerShortcut, unregisterShortcut]); (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/edit-site/save', event => { event.preventDefault(); const dirtyEntityRecords = __experimentalGetDirtyEntityRecords(); const hasDirtyEntities = !!dirtyEntityRecords.length; const isSaving = dirtyEntityRecords.some(record => isSavingEntityRecord(record.kind, record.name, record.key)); - const _hasNonPostEntityChanges = hasNonPostEntityChanges(); - const isViewMode = getCanvasMode() === 'view'; - if ((!hasDirtyEntities || !_hasNonPostEntityChanges || isSaving) && !isViewMode) { + if (!hasDirtyEntities || isSaving) { return; } - // At this point, we know that there are dirty entities, other than - // the edited post, and we're not in the process of saving, so open - // save view. - setIsSaveViewOpened(true); + if (hasNonPostEntityChanges()) { + setIsSaveViewOpened(true); + } else if (!isPostSavingLocked()) { + savePost(); + } }); return null; } -/* harmony default export */ const global = (KeyboardShortcutsGlobal); - -;// ./node_modules/@wordpress/edit-site/build-module/components/use-edited-entity-record/index.js -/** - * WordPress dependencies - */ - - - - - -/** - * Internal dependencies - */ - -function useEditedEntityRecord(postType, postId) { - const { - record, - title, - description, - isLoaded, - icon - } = (0,external_wp_data_namespaceObject.useSelect)(select => { - const { - getEditedPostType, - getEditedPostId - } = select(store); - const { - getEditedEntityRecord, - hasFinishedResolution - } = select(external_wp_coreData_namespaceObject.store); - const { - __experimentalGetTemplateInfo: getTemplateInfo - } = select(external_wp_editor_namespaceObject.store); - const usedPostType = postType !== null && postType !== void 0 ? postType : getEditedPostType(); - const usedPostId = postId !== null && postId !== void 0 ? postId : getEditedPostId(); - const _record = getEditedEntityRecord('postType', usedPostType, usedPostId); - const _isLoaded = usedPostId && hasFinishedResolution('getEditedEntityRecord', ['postType', usedPostType, usedPostId]); - const templateInfo = getTemplateInfo(_record); - return { - record: _record, - title: templateInfo.title, - description: templateInfo.description, - isLoaded: _isLoaded, - icon: templateInfo.icon - }; - }, [postType, postId]); - return { - isLoaded, - icon, - record, - getTitle: () => title ? (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title) : null, - getDescription: () => description ? (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(description) : null - }; -} ;// ./node_modules/@wordpress/edit-site/build-module/components/layout/hooks.js /** @@ -8564,17 +8519,9 @@ function useEditedEntityRecord(postType, postId) { - -/** - * Internal dependencies - */ - const MAX_LOADING_TIME = 10000; // 10 seconds function useIsSiteEditorLoading() { - const { - isLoaded: hasLoadedPost - } = useEditedEntityRecord(); const [loaded, setLoaded] = (0,external_wp_element_namespaceObject.useState)(false); const inLoadingPause = (0,external_wp_data_namespaceObject.useSelect)(select => { const hasResolvingSelectors = select(external_wp_coreData_namespaceObject.store).hasResolvingSelectors(); @@ -8616,7 +8563,7 @@ function useIsSiteEditorLoading() { }; } }, [inLoadingPause]); - return !loaded || !hasLoadedPost; + return !loaded; } ;// ./node_modules/@react-spring/rafz/dist/esm/index.js @@ -8684,9 +8631,7 @@ function useMovingAnimation({ } = (0,external_wp_element_namespaceObject.useMemo)(() => ({ previous: ref.current && getAbsolutePosition(ref.current), prevRect: ref.current && ref.current.getBoundingClientRect() - }), - // eslint-disable-next-line react-hooks/exhaustive-deps - [triggerAnimationOnChange]); + }), [triggerAnimationOnChange]); (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { if (!previous || !ref.current) { return; @@ -8784,7 +8729,7 @@ const check = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(exte */ function isPreviewingTheme() { - return (0,external_wp_url_namespaceObject.getQueryArg)(window.location.href, 'wp_theme_preview') !== undefined; + return !!(0,external_wp_url_namespaceObject.getQueryArg)(window.location.href, 'wp_theme_preview'); } function currentlyPreviewingTheme() { if (isPreviewingTheme()) { @@ -8794,6 +8739,7 @@ function currentlyPreviewingTheme() { } ;// ./node_modules/@wordpress/edit-site/build-module/components/save-button/index.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -8813,7 +8759,7 @@ function currentlyPreviewingTheme() { const { - useLocation + useLocation: save_button_useLocation } = unlock(external_wp_router_namespaceObject.privateApis); function SaveButton({ className = 'edit-site-save-button__button', @@ -8826,7 +8772,7 @@ function SaveButton({ }) { const { params - } = useLocation(); + } = save_button_useLocation(); const { setIsSaveViewOpened } = (0,external_wp_data_namespaceObject.useDispatch)(store); @@ -8874,15 +8820,15 @@ function SaveButton({ const getLabel = () => { if (isPreviewingTheme()) { if (isSaving) { - return (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: The name of theme to be activated. */ + return (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: The name of theme to be activated. */ (0,external_wp_i18n_namespaceObject.__)('Activating %s'), previewingThemeName); } else if (disabled) { return (0,external_wp_i18n_namespaceObject.__)('Saved'); } else if (hasDirtyEntities) { - return (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: The name of theme to be activated. */ + return (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: The name of theme to be activated. */ (0,external_wp_i18n_namespaceObject.__)('Activate %s & Save'), previewingThemeName); } - return (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: The name of theme to be activated. */ + return (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: The name of theme to be activated. */ (0,external_wp_i18n_namespaceObject.__)('Activate %s'), previewingThemeName); } if (isSaving) { @@ -8930,6 +8876,7 @@ function SaveButton({ } ;// ./node_modules/@wordpress/edit-site/build-module/components/save-hub/index.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -8983,13 +8930,15 @@ function SaveHub() { + /** * Internal dependencies */ const { - useHistory: use_activate_theme_useHistory + useHistory: use_activate_theme_useHistory, + useLocation: use_activate_theme_useLocation } = unlock(external_wp_router_namespaceObject.privateApis); /** @@ -8999,6 +8948,9 @@ const { */ function useActivateTheme() { const history = use_activate_theme_useHistory(); + const { + path + } = use_activate_theme_useLocation(); const { startResolution, finishResolution @@ -9011,13 +8963,9 @@ function useActivateTheme() { finishResolution('activateTheme'); // Remove the wp_theme_preview query param: we've finished activating // the queue and are switching to normal Site Editor. - const { - params - } = history.getLocationWithParams(); - history.replace({ - ...params, - wp_theme_preview: undefined - }); + history.navigate((0,external_wp_url_namespaceObject.addQueryArgs)(path, { + wp_theme_preview: '' + })); } }; } @@ -9051,6 +8999,7 @@ function useActualCurrentTheme() { } ;// ./node_modules/@wordpress/edit-site/build-module/components/save-panel/index.js +/* wp:polyfill */ /** * External dependencies */ @@ -9065,6 +9014,8 @@ function useActualCurrentTheme() { + + /** * Internal dependencies */ @@ -9074,13 +9025,16 @@ function useActualCurrentTheme() { - const { EntitiesSavedStatesExtensible, NavigableRegion } = unlock(external_wp_editor_namespaceObject.privateApis); +const { + useLocation: save_panel_useLocation +} = unlock(external_wp_router_namespaceObject.privateApis); const EntitiesSavedStatesForPreview = ({ - onClose + onClose, + renderDialog }) => { var _currentTheme$name$re, _previewingTheme$name; const isDirtyProps = (0,external_wp_editor_namespaceObject.useEntitiesSavedStatesIsDirty)(); @@ -9093,7 +9047,7 @@ const EntitiesSavedStatesForPreview = ({ const currentTheme = useActualCurrentTheme(); const previewingTheme = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getCurrentTheme(), []); const additionalPrompt = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { - children: (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: 1: The name of active theme, 2: The name of theme to be activated. */ + children: (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: 1: The name of active theme, 2: The name of theme to be activated. */ (0,external_wp_i18n_namespaceObject.__)('Saving your changes will change your active theme from %1$s to %2$s.'), (_currentTheme$name$re = currentTheme?.name?.rendered) !== null && _currentTheme$name$re !== void 0 ? _currentTheme$name$re : '...', (_previewingTheme$name = previewingTheme?.name?.rendered) !== null && _previewingTheme$name !== void 0 ? _previewingTheme$name : '...') }); const activateTheme = useActivateTheme(); @@ -9107,16 +9061,18 @@ const EntitiesSavedStatesForPreview = ({ close: onClose, onSave, saveEnabled: true, - saveLabel: activateSaveLabel + saveLabel: activateSaveLabel, + renderDialog }); }; const _EntitiesSavedStates = ({ onClose, - renderDialog = undefined + renderDialog }) => { if (isPreviewingTheme()) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EntitiesSavedStatesForPreview, { - onClose: onClose + onClose: onClose, + renderDialog: renderDialog }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.EntitiesSavedStates, { @@ -9125,9 +9081,14 @@ const _EntitiesSavedStates = ({ }); }; function SavePanel() { + const { + query + } = save_panel_useLocation(); + const { + canvas = 'view' + } = query; const { isSaveViewOpen, - canvasMode, isDirty, isSaving } = (0,external_wp_data_namespaceObject.useSelect)(select => { @@ -9139,15 +9100,13 @@ function SavePanel() { const dirtyEntityRecords = __experimentalGetDirtyEntityRecords(); const isActivatingTheme = isResolving('activateTheme'); const { - isSaveViewOpened, - getCanvasMode + isSaveViewOpened } = unlock(select(store)); // The currently selected entity to display. // Typically template or template part in the site editor. return { isSaveViewOpen: isSaveViewOpened(), - canvasMode: getCanvasMode(), isDirty: dirtyEntityRecords.length > 0, isSaving: dirtyEntityRecords.some(record => isSavingEntityRecord(record.kind, record.name, record.key)) || isActivatingTheme }; @@ -9156,7 +9115,10 @@ function SavePanel() { setIsSaveViewOpened } = (0,external_wp_data_namespaceObject.useDispatch)(store); const onClose = () => setIsSaveViewOpened(false); - if (canvasMode === 'view') { + (0,external_wp_element_namespaceObject.useEffect)(() => { + setIsSaveViewOpened(false); + }, [canvas, setIsSaveViewOpened]); + if (canvas === 'view') { return isSaveViewOpen ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Modal, { className: "edit-site-save-panel__modal", onRequestClose: onClose, @@ -9195,69 +9157,6 @@ function SavePanel() { }); } -;// ./node_modules/@wordpress/edit-site/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js -/** - * WordPress dependencies - */ - - - - -/** - * Internal dependencies - */ - - -const { - useLocation: use_sync_canvas_mode_with_url_useLocation, - useHistory: use_sync_canvas_mode_with_url_useHistory -} = unlock(external_wp_router_namespaceObject.privateApis); -function useSyncCanvasModeWithURL() { - const history = use_sync_canvas_mode_with_url_useHistory(); - const { - params - } = use_sync_canvas_mode_with_url_useLocation(); - const canvasMode = (0,external_wp_data_namespaceObject.useSelect)(select => unlock(select(store)).getCanvasMode(), []); - const { - setCanvasMode - } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store)); - const currentCanvasModeRef = (0,external_wp_element_namespaceObject.useRef)(canvasMode); - const { - canvas: canvasInUrl - } = params; - const currentCanvasInUrlRef = (0,external_wp_element_namespaceObject.useRef)(canvasInUrl); - const currentUrlParamsRef = (0,external_wp_element_namespaceObject.useRef)(params); - (0,external_wp_element_namespaceObject.useEffect)(() => { - currentUrlParamsRef.current = params; - }, [params]); - (0,external_wp_element_namespaceObject.useEffect)(() => { - currentCanvasModeRef.current = canvasMode; - if (canvasMode === 'init') { - return; - } - if (canvasMode === 'edit' && currentCanvasInUrlRef.current !== canvasMode) { - history.push({ - ...currentUrlParamsRef.current, - canvas: 'edit' - }); - } - if (canvasMode === 'view' && currentCanvasInUrlRef.current !== undefined) { - history.push({ - ...currentUrlParamsRef.current, - canvas: undefined - }); - } - }, [canvasMode, history]); - (0,external_wp_element_namespaceObject.useEffect)(() => { - currentCanvasInUrlRef.current = canvasInUrl; - if (canvasInUrl !== 'edit' && currentCanvasModeRef.current !== 'view') { - setCanvasMode('view'); - } else if (canvasInUrl === 'edit' && currentCanvasModeRef.current !== 'edit') { - setCanvasMode('edit'); - } - }, [canvasInUrl, setCanvasMode]); -} - ;// ./node_modules/@wordpress/edit-site/build-module/components/layout/index.js /** * External dependencies @@ -9277,6 +9176,10 @@ function useSyncCanvasModeWithURL() { + + + + /** * Internal dependencies */ @@ -9290,12 +9193,6 @@ function useSyncCanvasModeWithURL() { - - - - - - const { useCommands } = unlock(external_wp_coreCommands_namespaceObject.privateApis); @@ -9303,62 +9200,57 @@ const { useGlobalStyle: layout_useGlobalStyle } = unlock(external_wp_blockEditor_namespaceObject.privateApis); const { - NavigableRegion: layout_NavigableRegion + NavigableRegion: layout_NavigableRegion, + GlobalStylesProvider } = unlock(external_wp_editor_namespaceObject.privateApis); +const { + useLocation: layout_useLocation +} = unlock(external_wp_router_namespaceObject.privateApis); const layout_ANIMATION_DURATION = 0.3; -function Layout({ - route -}) { - useSyncCanvasModeWithURL(); +function Layout() { + const { + query, + name: routeKey, + areas, + widths + } = layout_useLocation(); + const { + canvas = 'view' + } = query; useCommands(); const isMobileViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<'); const toggleRef = (0,external_wp_element_namespaceObject.useRef)(); - const { - canvasMode - } = (0,external_wp_data_namespaceObject.useSelect)(select => { - const { - getCanvasMode - } = unlock(select(store)); - return { - canvasMode: getCanvasMode() - }; - }, []); const navigateRegionsProps = (0,external_wp_components_namespaceObject.__unstableUseNavigateRegions)(); const disableMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)(); const [canvasResizer, canvasSize] = (0,external_wp_compose_namespaceObject.useResizeObserver)(); const isEditorLoading = useIsSiteEditorLoading(); const [isResizableFrameOversized, setIsResizableFrameOversized] = (0,external_wp_element_namespaceObject.useState)(false); - const { - key: routeKey, - areas, - widths - } = route; const animationRef = animation({ - triggerAnimationOnChange: canvasMode + '__' + routeKey + triggerAnimationOnChange: routeKey + '-' + canvas + }); + const { + showIconLabels + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + return { + showIconLabels: select(external_wp_preferences_namespaceObject.store).get('core', 'showIconLabels') + }; }); const [backgroundColor] = layout_useGlobalStyle('color.background'); const [gradientValue] = layout_useGlobalStyle('color.gradient'); - const previousCanvaMode = (0,external_wp_compose_namespaceObject.usePrevious)(canvasMode); + const previousCanvaMode = (0,external_wp_compose_namespaceObject.usePrevious)(canvas); (0,external_wp_element_namespaceObject.useEffect)(() => { if (previousCanvaMode === 'edit') { toggleRef.current?.focus(); } // Should not depend on the previous canvas mode value but the next. - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [canvasMode]); - - // Synchronizing the URL with the store value of canvasMode happens in an effect - // This condition ensures the component is only rendered after the synchronization happens - // which prevents any animations due to potential canvasMode value change. - if (canvasMode === 'init') { - return null; - } + }, [canvas]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_commands_namespaceObject.CommandMenu, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(register, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(global, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.UnsavedChangesWarning, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_commands_namespaceObject.CommandMenu, {}), canvas === 'view' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SaveKeyboardShortcut, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...navigateRegionsProps, ref: navigateRegionsProps.ref, className: dist_clsx('edit-site-layout', navigateRegionsProps.className, { - 'is-full-canvas': canvasMode === 'edit' + 'is-full-canvas': canvas === 'edit', + 'show-icon-labels': showIconLabels }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "edit-site-layout__content", @@ -9366,7 +9258,7 @@ function Layout({ ariaLabel: (0,external_wp_i18n_namespaceObject.__)('Navigation'), className: "edit-site-layout__sidebar-region", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableAnimatePresence, { - children: canvasMode === 'view' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__unstableMotion.div, { + children: canvas === 'view' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__unstableMotion.div, { initial: { opacity: 0 }, @@ -9388,32 +9280,41 @@ function Layout({ ref: toggleRef, isTransparent: isResizableFrameOversized }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarContent, { + shouldAnimate: routeKey !== 'styles', routeKey: routeKey, - children: areas.sidebar + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.ErrorBoundary, { + children: areas.sidebar + }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SaveHub, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SavePanel, {})] }) }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.EditorSnackbars, {}), isMobileViewport && areas.mobile && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "edit-site-layout__mobile", - children: [canvasMode !== 'edit' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarContent, { + children: [canvas !== 'edit' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarContent, { routeKey: routeKey, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SiteHubMobile, { ref: toggleRef, isTransparent: isResizableFrameOversized }) - }), areas.mobile] - }), !isMobileViewport && areas.content && canvasMode !== 'edit' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.ErrorBoundary, { + children: areas.mobile + })] + }), !isMobileViewport && areas.content && canvas !== 'edit' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "edit-site-layout__area", style: { maxWidth: widths?.content }, - children: areas.content - }), !isMobileViewport && areas.edit && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.ErrorBoundary, { + children: areas.content + }) + }), !isMobileViewport && areas.edit && canvas !== 'edit' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "edit-site-layout__area", style: { maxWidth: widths?.edit }, - children: areas.edit + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.ErrorBoundary, { + children: areas.edit + }) }), !isMobileViewport && areas.preview && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "edit-site-layout__canvas-container", children: [canvasResizer, !!canvasSize.width && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { @@ -9421,10 +9322,10 @@ function Layout({ 'is-right-aligned': isResizableFrameOversized }), ref: animationRef, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ErrorBoundary, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.ErrorBoundary, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(resizable_frame, { isReady: !isEditorLoading, - isFullWidth: canvasMode === 'edit', + isFullWidth: canvas === 'edit', defaultSize: { width: canvasSize.width - 24 /* $canvas-padding */, height: canvasSize.height @@ -9443,6 +9344,24 @@ function Layout({ })] }); } +function LayoutWithGlobalStylesProvider(props) { + const { + createErrorNotice + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); + function onPluginAreaError(name) { + createErrorNotice((0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: plugin name */ + (0,external_wp_i18n_namespaceObject.__)('The "%s" plugin has encountered an error and cannot be rendered.'), name)); + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SlotFillProvider, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(GlobalStylesProvider, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_plugins_namespaceObject.PluginArea, { + onError: onPluginAreaError + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Layout, { + ...props + })] + }) + }); +} ;// ./node_modules/@wordpress/icons/build-module/library/styles.js /** @@ -9577,17 +9496,16 @@ const { useHistory: use_common_commands_useHistory, useLocation: use_common_commands_useLocation } = unlock(external_wp_router_namespaceObject.privateApis); -function useGlobalStylesOpenStylesCommands() { +const getGlobalStylesOpenStylesCommands = () => function useGlobalStylesOpenStylesCommands() { const { - openGeneralSidebar, - setCanvasMode + openGeneralSidebar } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store)); const { params } = use_common_commands_useLocation(); const { - getCanvasMode - } = unlock((0,external_wp_data_namespaceObject.useSelect)(store)); + canvas = 'view' + } = params; const history = use_common_commands_useHistory(); const isBlockBasedTheme = (0,external_wp_data_namespaceObject.useSelect)(select => { return select(external_wp_coreData_namespaceObject.store).getCurrentTheme().is_block_theme; @@ -9603,36 +9521,31 @@ function useGlobalStylesOpenStylesCommands() { close }) => { close(); - if (!params.postId) { - history.push({ - path: '/wp_global_styles', - canvas: 'edit' + if (canvas !== 'edit') { + history.navigate('/styles?canvas=edit', { + transition: 'canvas-mode-edit-transition' }); } - if (params.postId && getCanvasMode() !== 'edit') { - setCanvasMode('edit'); - } openGeneralSidebar('edit-site/global-styles'); }, icon: library_styles }]; - }, [history, openGeneralSidebar, setCanvasMode, getCanvasMode, isBlockBasedTheme, params.postId]); + }, [history, openGeneralSidebar, canvas, isBlockBasedTheme]); return { isLoading: false, commands }; -} -function useGlobalStylesToggleWelcomeGuideCommands() { +}; +const getGlobalStylesToggleWelcomeGuideCommands = () => function useGlobalStylesToggleWelcomeGuideCommands() { const { - openGeneralSidebar, - setCanvasMode + openGeneralSidebar } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store)); const { params } = use_common_commands_useLocation(); const { - getCanvasMode - } = unlock((0,external_wp_data_namespaceObject.useSelect)(store)); + canvas = 'view' + } = params; const { set } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_preferences_namespaceObject.store); @@ -9651,15 +9564,11 @@ function useGlobalStylesToggleWelcomeGuideCommands() { close }) => { close(); - if (!params.postId) { - history.push({ - path: '/wp_global_styles', - canvas: 'edit' + if (canvas !== 'edit') { + history.navigate('/styles?canvas=edit', { + transition: 'canvas-mode-edit-transition' }); } - if (params.postId && getCanvasMode() !== 'edit') { - setCanvasMode('edit'); - } openGeneralSidebar('edit-site/global-styles'); set('core/edit-site', 'welcomeGuideStyles', true); // sometimes there's a focus loss that happens after some time @@ -9670,13 +9579,13 @@ function useGlobalStylesToggleWelcomeGuideCommands() { }, icon: library_help }]; - }, [history, openGeneralSidebar, setCanvasMode, getCanvasMode, isBlockBasedTheme, set, params.postId]); + }, [history, openGeneralSidebar, canvas, isBlockBasedTheme, set]); return { isLoading: false, commands }; -} -function useGlobalStylesResetCommands() { +}; +const getGlobalStylesResetCommands = () => function useGlobalStylesResetCommands() { const [canReset, onReset] = useGlobalStylesReset(); const commands = (0,external_wp_element_namespaceObject.useMemo)(() => { if (!canReset) { @@ -9698,16 +9607,18 @@ function useGlobalStylesResetCommands() { isLoading: false, commands }; -} -function useGlobalStylesOpenCssCommands() { +}; +const getGlobalStylesOpenCssCommands = () => function useGlobalStylesOpenCssCommands() { const { openGeneralSidebar, - setEditorCanvasContainerView, - setCanvasMode + setEditorCanvasContainerView } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store)); const { params } = use_common_commands_useLocation(); + const { + canvas = 'view' + } = params; const history = use_common_commands_useHistory(); const { canEditCSS @@ -9722,9 +9633,6 @@ function useGlobalStylesOpenCssCommands() { canEditCSS: !!globalStyles?._links?.['wp:action-edit-css'] }; }, []); - const { - getCanvasMode - } = unlock((0,external_wp_data_namespaceObject.useSelect)(store)); const commands = (0,external_wp_element_namespaceObject.useMemo)(() => { if (!canEditCSS) { return []; @@ -9737,37 +9645,32 @@ function useGlobalStylesOpenCssCommands() { close }) => { close(); - if (!params.postId) { - history.push({ - path: '/wp_global_styles', - canvas: 'edit' + if (canvas !== 'edit') { + history.navigate('/styles?canvas=edit', { + transition: 'canvas-mode-edit-transition' }); } - if (params.postId && getCanvasMode() !== 'edit') { - setCanvasMode('edit'); - } openGeneralSidebar('edit-site/global-styles'); setEditorCanvasContainerView('global-styles-css'); } }]; - }, [history, openGeneralSidebar, setEditorCanvasContainerView, canEditCSS, getCanvasMode, setCanvasMode, params.postId]); + }, [history, openGeneralSidebar, setEditorCanvasContainerView, canEditCSS, canvas]); return { isLoading: false, commands }; -} -function useGlobalStylesOpenRevisionsCommands() { +}; +const getGlobalStylesOpenRevisionsCommands = () => function useGlobalStylesOpenRevisionsCommands() { const { openGeneralSidebar, - setEditorCanvasContainerView, - setCanvasMode + setEditorCanvasContainerView } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store)); - const { - getCanvasMode - } = unlock((0,external_wp_data_namespaceObject.useSelect)(store)); const { params } = use_common_commands_useLocation(); + const { + canvas = 'view' + } = params; const history = use_common_commands_useHistory(); const hasRevisions = (0,external_wp_data_namespaceObject.useSelect)(select => { const { @@ -9790,25 +9693,21 @@ function useGlobalStylesOpenRevisionsCommands() { close }) => { close(); - if (!params.postId) { - history.push({ - path: '/wp_global_styles', - canvas: 'edit' + if (canvas !== 'edit') { + history.navigate('/styles?canvas=edit', { + transition: 'canvas-mode-edit-transition' }); } - if (params.postId && getCanvasMode() !== 'edit') { - setCanvasMode('edit'); - } openGeneralSidebar('edit-site/global-styles'); setEditorCanvasContainerView('global-styles-revisions'); } }]; - }, [hasRevisions, history, openGeneralSidebar, setEditorCanvasContainerView, getCanvasMode, setCanvasMode, params.postId]); + }, [hasRevisions, history, openGeneralSidebar, setEditorCanvasContainerView, canvas]); return { isLoading: false, commands }; -} +}; function useCommonCommands() { const homeUrl = (0,external_wp_data_namespaceObject.useSelect)(select => { // Site index. @@ -9827,26 +9726,251 @@ function useCommonCommands() { }); (0,external_wp_commands_namespaceObject.useCommandLoader)({ name: 'core/edit-site/open-styles', - hook: useGlobalStylesOpenStylesCommands + hook: getGlobalStylesOpenStylesCommands() }); (0,external_wp_commands_namespaceObject.useCommandLoader)({ name: 'core/edit-site/toggle-styles-welcome-guide', - hook: useGlobalStylesToggleWelcomeGuideCommands + hook: getGlobalStylesToggleWelcomeGuideCommands() }); (0,external_wp_commands_namespaceObject.useCommandLoader)({ name: 'core/edit-site/reset-global-styles', - hook: useGlobalStylesResetCommands + hook: getGlobalStylesResetCommands() }); (0,external_wp_commands_namespaceObject.useCommandLoader)({ name: 'core/edit-site/open-styles-css', - hook: useGlobalStylesOpenCssCommands + hook: getGlobalStylesOpenCssCommands() }); (0,external_wp_commands_namespaceObject.useCommandLoader)({ name: 'core/edit-site/open-styles-revisions', - hook: useGlobalStylesOpenRevisionsCommands + hook: getGlobalStylesOpenRevisionsCommands() }); } +;// ./node_modules/@wordpress/icons/build-module/library/close-small.js +/** + * WordPress dependencies + */ + + +const closeSmall = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.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" + }) +}); +/* harmony default export */ const close_small = (closeSmall); + +;// ./node_modules/@wordpress/edit-site/build-module/components/editor-canvas-container/index.js +/* wp:polyfill */ +/** + * WordPress dependencies + */ + + + + + + + + + + +/** + * Internal dependencies + */ + + + +const { + EditorContentSlotFill, + ResizableEditor +} = unlock(external_wp_editor_namespaceObject.privateApis); + +/** + * Returns a translated string for the title of the editor canvas container. + * + * @param {string} view Editor canvas container view. + * + * @return {Object} Translated string for the view title and associated icon, both defaulting to ''. + */ +function getEditorCanvasContainerTitle(view) { + switch (view) { + case 'style-book': + return (0,external_wp_i18n_namespaceObject.__)('Style Book'); + case 'global-styles-revisions': + case 'global-styles-revisions:style-book': + return (0,external_wp_i18n_namespaceObject.__)('Style Revisions'); + default: + return ''; + } +} +function EditorCanvasContainer({ + children, + closeButtonLabel, + onClose, + enableResizing = false +}) { + const { + editorCanvasContainerView, + showListViewByDefault + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const _editorCanvasContainerView = unlock(select(store)).getEditorCanvasContainerView(); + const _showListViewByDefault = select(external_wp_preferences_namespaceObject.store).get('core', 'showListViewByDefault'); + return { + editorCanvasContainerView: _editorCanvasContainerView, + showListViewByDefault: _showListViewByDefault + }; + }, []); + const [isClosed, setIsClosed] = (0,external_wp_element_namespaceObject.useState)(false); + const { + setEditorCanvasContainerView + } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store)); + const { + setIsListViewOpened + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_editor_namespaceObject.store); + const focusOnMountRef = (0,external_wp_compose_namespaceObject.useFocusOnMount)('firstElement'); + const sectionFocusReturnRef = (0,external_wp_compose_namespaceObject.useFocusReturn)(); + function onCloseContainer() { + setIsListViewOpened(showListViewByDefault); + setEditorCanvasContainerView(undefined); + setIsClosed(true); + if (typeof onClose === 'function') { + onClose(); + } + } + function closeOnEscape(event) { + if (event.keyCode === external_wp_keycodes_namespaceObject.ESCAPE && !event.defaultPrevented) { + event.preventDefault(); + onCloseContainer(); + } + } + const childrenWithProps = Array.isArray(children) ? external_wp_element_namespaceObject.Children.map(children, (child, index) => index === 0 ? (0,external_wp_element_namespaceObject.cloneElement)(child, { + ref: sectionFocusReturnRef + }) : child) : (0,external_wp_element_namespaceObject.cloneElement)(children, { + ref: sectionFocusReturnRef + }); + if (isClosed) { + return null; + } + const title = getEditorCanvasContainerTitle(editorCanvasContainerView); + const shouldShowCloseButton = onClose || closeButtonLabel; + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditorContentSlotFill.Fill, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: "edit-site-editor-canvas-container", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ResizableEditor, { + enableResizing: enableResizing, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("section", { + className: "edit-site-editor-canvas-container__section", + ref: shouldShowCloseButton ? focusOnMountRef : null, + onKeyDown: closeOnEscape, + "aria-label": title, + children: [shouldShowCloseButton && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + size: "compact", + className: "edit-site-editor-canvas-container__close-button", + icon: close_small, + label: closeButtonLabel || (0,external_wp_i18n_namespaceObject.__)('Close'), + onClick: onCloseContainer + }), childrenWithProps] + }) + }) + }) + }); +} +function useHasEditorCanvasContainer() { + const fills = (0,external_wp_components_namespaceObject.__experimentalUseSlotFills)(EditorContentSlotFill.name); + return !!fills?.length; +} +/* harmony default export */ const editor_canvas_container = (EditorCanvasContainer); + + +;// ./node_modules/@wordpress/edit-site/build-module/hooks/commands/use-set-command-context.js +/** + * WordPress dependencies + */ + + + + + +/** + * Internal dependencies + */ + + +const { + useCommandContext +} = unlock(external_wp_commands_namespaceObject.privateApis); +const { + useLocation: use_set_command_context_useLocation +} = unlock(external_wp_router_namespaceObject.privateApis); + +/** + * React hook used to set the correct command context based on the current state. + */ +function useSetCommandContext() { + const { + query = {} + } = use_set_command_context_useLocation(); + const { + canvas = 'view' + } = query; + const hasBlockSelected = (0,external_wp_data_namespaceObject.useSelect)(select => { + return select(external_wp_blockEditor_namespaceObject.store).getBlockSelectionStart(); + }, []); + const hasEditorCanvasContainer = useHasEditorCanvasContainer(); + + // Sets the right context for the command palette + let commandContext = 'site-editor'; + if (canvas === 'edit') { + commandContext = 'entity-edit'; + } + if (hasBlockSelected) { + commandContext = 'block-selection-edit'; + } + if (hasEditorCanvasContainer) { + /* + * The editor canvas overlay will likely be deprecated in the future, so for now we clear the command context + * to remove the suggested commands that may not make sense with Style Book or Style Revisions open. + * See https://github.com/WordPress/gutenberg/issues/62216. + */ + commandContext = ''; + } + useCommandContext(commandContext); +} + +;// ./node_modules/@wordpress/icons/build-module/library/navigation.js +/** + * WordPress dependencies + */ + + +const navigation = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + viewBox: "0 0 24 24", + xmlns: "http://www.w3.org/2000/svg", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "M12 4c-4.4 0-8 3.6-8 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8zm0 14.5c-3.6 0-6.5-2.9-6.5-6.5S8.4 5.5 12 5.5s6.5 2.9 6.5 6.5-2.9 6.5-6.5 6.5zM9 16l4.5-3L15 8.4l-4.5 3L9 16z" + }) +}); +/* harmony default export */ const library_navigation = (navigation); + +;// ./node_modules/@wordpress/icons/build-module/library/page.js +/** + * WordPress dependencies + */ + + +const page = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "M15.5 7.5h-7V9h7V7.5Zm-7 3.5h7v1.5h-7V11Zm7 3.5h-7V16h7v-1.5Z" + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "M17 4H7a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2ZM7 5.5h10a.5.5 0 0 1 .5.5v12a.5.5 0 0 1-.5.5H7a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .5-.5Z" + })] +}); +/* harmony default export */ const library_page = (page); + ;// ./node_modules/@wordpress/icons/build-module/library/layout.js /** * WordPress dependencies @@ -9862,141 +9986,76 @@ const layout = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ext }); /* harmony default export */ const library_layout = (layout); -;// ./node_modules/@wordpress/icons/build-module/library/page.js +;// ./node_modules/@wordpress/icons/build-module/library/symbol.js /** * WordPress dependencies */ - -const page = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - d: "M15.5 7.5h-7V9h7V7.5Zm-7 3.5h7v1.5h-7V11Zm7 3.5h-7V16h7v-1.5Z" - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - d: "M17 4H7a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2ZM7 5.5h10a.5.5 0 0 1 .5.5v12a.5.5 0 0 1-.5.5H7a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .5-.5Z" - })] -}); -/* harmony default export */ const library_page = (page); - -;// ./node_modules/@wordpress/icons/build-module/library/trash.js -/** - * WordPress dependencies - */ - - -const trash = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { +const symbol = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M12 5.5A2.25 2.25 0 0 0 9.878 7h4.244A2.251 2.251 0 0 0 12 5.5ZM12 4a3.751 3.751 0 0 0-3.675 3H5v1.5h1.27l.818 8.997a2.75 2.75 0 0 0 2.739 2.501h4.347a2.75 2.75 0 0 0 2.738-2.5L17.73 8.5H19V7h-3.325A3.751 3.751 0 0 0 12 4Zm4.224 4.5H7.776l.806 8.861a1.25 1.25 0 0 0 1.245 1.137h4.347a1.25 1.25 0 0 0 1.245-1.137l.805-8.861Z" + d: "M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-1 1.4l-5.6 5.6c-.1.1-.3.1-.4 0l-5.6-5.6c-.1-.1-.1-.3 0-.4l5.6-5.6s.1-.1.2-.1.1 0 .2.1l5.6 5.6c.1.1.1.3 0 .4zm-16.6-.4L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z" }) }); -/* harmony default export */ const library_trash = (trash); +/* harmony default export */ const library_symbol = (symbol); -;// ./node_modules/@wordpress/edit-site/build-module/utils/is-template-removable.js -/** - * Internal dependencies - */ - - -/** - * Check if a template is removable. - * - * @param {Object} template The template entity to check. - * @return {boolean} Whether the template is removable. - */ -function isTemplateRemovable(template) { - if (!template) { - return false; - } - return template.source === TEMPLATE_ORIGINS.custom && !Boolean(template.plugin) && !template.has_theme_file; -} - -;// ./node_modules/@wordpress/edit-site/build-module/utils/is-template-revertable.js -/** - * Internal dependencies - */ - - -/** - * Check if a template is revertable to its original theme-provided template file. - * - * @param {Object} template The template entity to check. - * @return {boolean} Whether the template is revertable. - */ -function isTemplateRevertable(template) { - if (!template) { - return false; - } - /* eslint-disable camelcase */ - return template?.source === TEMPLATE_ORIGINS.custom && (Boolean(template?.plugin) || template?.has_theme_file); - /* eslint-enable camelcase */ -} - -;// ./node_modules/@wordpress/edit-site/build-module/components/routes/link.js +;// ./node_modules/@wordpress/icons/build-module/library/chevron-right.js /** * WordPress dependencies */ +const chevronRight = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z" + }) +}); +/* harmony default export */ const chevron_right = (chevronRight); +;// ./node_modules/@wordpress/icons/build-module/library/chevron-left.js /** - * Internal dependencies + * WordPress dependencies */ +const chevronLeft = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z" + }) +}); +/* harmony default export */ const chevron_left = (chevronLeft); -const { - useHistory: link_useHistory -} = unlock(external_wp_router_namespaceObject.privateApis); -function useLink(params, state, shouldReplace = false) { - const history = link_useHistory(); - function onClick(event) { - event?.preventDefault(); - if (shouldReplace) { - history.replace(params, state); - } else { - history.push(params, state); - } - } - const currentArgs = (0,external_wp_url_namespaceObject.getQueryArgs)(window.location.href); - const currentUrlWithoutArgs = (0,external_wp_url_namespaceObject.removeQueryArgs)(window.location.href, ...Object.keys(currentArgs)); - if (isPreviewingTheme()) { - params = { - ...params, - wp_theme_preview: currentlyPreviewingTheme() - }; - } - const newUrl = (0,external_wp_url_namespaceObject.addQueryArgs)(currentUrlWithoutArgs, params); - return { - href: newUrl, - onClick - }; -} -function Link({ - params = {}, - state, - replace: shouldReplace = false, - children, - ...props -}) { - const { - href, - onClick - } = useLink(params, state, shouldReplace); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { - href: href, - onClick: onClick, +;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-button/index.js +/** + * External dependencies + */ + + +/** + * WordPress dependencies + */ + + +function SidebarButton(props) { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + size: "compact", ...props, - children: children + className: dist_clsx('edit-site-sidebar-button', props.className) }); } -;// ./node_modules/@wordpress/edit-site/build-module/hooks/commands/use-edit-mode-commands.js +;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen/index.js +/** + * External dependencies + */ + + /** * WordPress dependencies */ @@ -10017,366 +10076,95 @@ function Link({ - const { - useHistory: use_edit_mode_commands_useHistory + useHistory: sidebar_navigation_screen_useHistory, + useLocation: sidebar_navigation_screen_useLocation } = unlock(external_wp_router_namespaceObject.privateApis); -function usePageContentFocusCommands() { - const { - record: template - } = useEditedEntityRecord(); - const { - isPage, - canvasMode, - templateId, - currentPostType - } = (0,external_wp_data_namespaceObject.useSelect)(select => { - const { - isPage: _isPage, - getCanvasMode - } = unlock(select(store)); - const { - getCurrentPostType, - getCurrentTemplateId - } = select(external_wp_editor_namespaceObject.store); - return { - isPage: _isPage(), - canvasMode: getCanvasMode(), - templateId: getCurrentTemplateId(), - currentPostType: getCurrentPostType() - }; - }, []); - const { - onClick: editTemplate - } = useLink({ - postType: 'wp_template', - postId: templateId - }); - const { - setRenderingMode - } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_editor_namespaceObject.store); - if (!isPage || canvasMode !== 'edit') { - return { - isLoading: false, - commands: [] - }; - } - const commands = []; - if (currentPostType !== 'wp_template') { - commands.push({ - name: 'core/switch-to-template-focus', - label: (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: template title */ - (0,external_wp_i18n_namespaceObject.__)('Edit template: %s'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(template.title)), - icon: library_layout, - callback: ({ - close - }) => { - editTemplate(); - close(); - } - }); - } else { - commands.push({ - name: 'core/switch-to-page-focus', - label: (0,external_wp_i18n_namespaceObject.__)('Back to page'), - icon: library_page, - callback: ({ - close - }) => { - setRenderingMode('template-locked'); - close(); - } - }); - } - return { - isLoading: false, - commands - }; -} -function useManipulateDocumentCommands() { - const { - isLoaded, - record: template - } = useEditedEntityRecord(); - const { - removeTemplate, - revertTemplate - } = (0,external_wp_data_namespaceObject.useDispatch)(store); - const history = use_edit_mode_commands_useHistory(); - const isEditingPage = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).isPage() && select(external_wp_editor_namespaceObject.store).getCurrentPostType() !== 'wp_template', []); - if (!isLoaded) { - return { - isLoading: true, - commands: [] - }; - } - const commands = []; - if (isTemplateRevertable(template) && !isEditingPage) { - const label = template.type === TEMPLATE_POST_TYPE ? (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: template title */ - (0,external_wp_i18n_namespaceObject.__)('Reset template: %s'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(template.title)) : (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: template part title */ - (0,external_wp_i18n_namespaceObject.__)('Reset template part: %s'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(template.title)); - commands.push({ - name: 'core/reset-template', - label, - icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? rotate_right : rotate_left, - callback: ({ - close - }) => { - revertTemplate(template); - close(); - } - }); - } - if (isTemplateRemovable(template) && !isEditingPage) { - const label = template.type === TEMPLATE_POST_TYPE ? (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: template title */ - (0,external_wp_i18n_namespaceObject.__)('Delete template: %s'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(template.title)) : (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: template part title */ - (0,external_wp_i18n_namespaceObject.__)('Delete template part: %s'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(template.title)); - commands.push({ - name: 'core/remove-template', - label, - icon: library_trash, - callback: ({ - close - }) => { - removeTemplate(template); - // Navigate to the template list - history.push({ - postType: template.type - }); - close(); - } - }); - } - return { - isLoading: !isLoaded, - commands - }; -} -function useEditModeCommands() { - (0,external_wp_commands_namespaceObject.useCommandLoader)({ - name: 'core/edit-site/page-content-focus', - hook: usePageContentFocusCommands, - context: 'entity-edit' - }); - (0,external_wp_commands_namespaceObject.useCommandLoader)({ - name: 'core/edit-site/manipulate-document', - hook: useManipulateDocumentCommands - }); -} - -;// ./node_modules/@wordpress/edit-site/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js -/** - * WordPress dependencies - */ - - - - - - -/** - * Internal dependencies - */ - - - -const { - useLocation: use_init_edited_entity_from_url_useLocation -} = unlock(external_wp_router_namespaceObject.privateApis); -const postTypesWithoutParentTemplate = [TEMPLATE_POST_TYPE, TEMPLATE_PART_POST_TYPE, NAVIGATION_POST_TYPE, PATTERN_TYPES.user]; -const authorizedPostTypes = ['page', 'post']; -function useResolveEditedEntityAndContext({ - postId, - postType +function SidebarNavigationScreen({ + isRoot, + title, + actions, + meta, + content, + footer, + description, + backPath: backPathProp }) { const { - hasLoadedAllDependencies, - homepageId, - postsPageId, - url, - frontPageTemplateId + dashboardLink, + dashboardLinkText, + previewingThemeName } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { - getEntityRecord, - getEntityRecords - } = select(external_wp_coreData_namespaceObject.store); - const siteData = getEntityRecord('root', 'site'); - const base = getEntityRecord('root', '__unstableBase'); - const templates = getEntityRecords('postType', TEMPLATE_POST_TYPE, { - per_page: -1 - }); - const _homepageId = siteData?.show_on_front === 'page' && ['number', 'string'].includes(typeof siteData.page_on_front) && !!+siteData.page_on_front // We also need to check if it's not zero(`0`). - ? siteData.page_on_front.toString() : null; - const _postsPageId = siteData?.show_on_front === 'page' && ['number', 'string'].includes(typeof siteData.page_for_posts) ? siteData.page_for_posts.toString() : null; - let _frontPageTemplateId; - if (templates) { - const frontPageTemplate = templates.find(t => t.slug === 'front-page'); - _frontPageTemplateId = frontPageTemplate ? frontPageTemplate.id : false; - } + getSettings + } = unlock(select(store)); + const currentlyPreviewingThemeId = currentlyPreviewingTheme(); return { - hasLoadedAllDependencies: !!base && !!siteData, - homepageId: _homepageId, - postsPageId: _postsPageId, - url: base?.home, - frontPageTemplateId: _frontPageTemplateId + dashboardLink: getSettings().__experimentalDashboardLink, + dashboardLinkText: getSettings().__experimentalDashboardLinkText, + // Do not call `getTheme` with null, it will cause a request to + // the server. + previewingThemeName: currentlyPreviewingThemeId ? select(external_wp_coreData_namespaceObject.store).getTheme(currentlyPreviewingThemeId)?.name?.rendered : undefined }; }, []); - - /** - * This is a hook that recreates the logic to resolve a template for a given WordPress postID postTypeId - * in order to match the frontend as closely as possible in the site editor. - * - * It is not possible to rely on the server logic because there maybe unsaved changes that impact the template resolution. - */ - const resolvedTemplateId = (0,external_wp_data_namespaceObject.useSelect)(select => { - // If we're rendering a post type that doesn't have a template - // no need to resolve its template. - if (postTypesWithoutParentTemplate.includes(postType) && postId) { - return undefined; - } - - // Don't trigger resolution for multi-selected posts. - if (postId && postId.includes(',')) { - return undefined; - } - const { - getEditedEntityRecord, - getEntityRecords, - getDefaultTemplateId, - __experimentalGetTemplateForLink - } = select(external_wp_coreData_namespaceObject.store); - function resolveTemplateForPostTypeAndId(postTypeToResolve, postIdToResolve) { - // For the front page, we always use the front page template if existing. - if (postTypeToResolve === 'page' && homepageId === postIdToResolve) { - // We're still checking whether the front page template exists. - // Don't resolve the template yet. - if (frontPageTemplateId === undefined) { - return undefined; - } - if (!!frontPageTemplateId) { - return frontPageTemplateId; - } - } - const editedEntity = getEditedEntityRecord('postType', postTypeToResolve, postIdToResolve); - if (!editedEntity) { - return undefined; - } - // Check if the current page is the posts page. - if (postTypeToResolve === 'page' && postsPageId === postIdToResolve) { - return __experimentalGetTemplateForLink(editedEntity.link)?.id; - } - // First see if the post/page has an assigned template and fetch it. - const currentTemplateSlug = editedEntity.template; - if (currentTemplateSlug) { - const currentTemplate = getEntityRecords('postType', TEMPLATE_POST_TYPE, { - per_page: -1 - })?.find(({ - slug - }) => slug === currentTemplateSlug); - if (currentTemplate) { - return currentTemplate.id; - } - } - // If no template is assigned, use the default template. - let slugToCheck; - // In `draft` status we might not have a slug available, so we use the `single` - // post type templates slug(ex page, single-post, single-product etc..). - // Pages do not need the `single` prefix in the slug to be prioritized - // through template hierarchy. - if (editedEntity.slug) { - slugToCheck = postTypeToResolve === 'page' ? `${postTypeToResolve}-${editedEntity.slug}` : `single-${postTypeToResolve}-${editedEntity.slug}`; - } else { - slugToCheck = postTypeToResolve === 'page' ? 'page' : `single-${postTypeToResolve}`; - } - return getDefaultTemplateId({ - slug: slugToCheck - }); - } - if (!hasLoadedAllDependencies) { - return undefined; - } - - // If we're rendering a specific page, we need to resolve its template. - // The site editor only supports pages for now, not other CPTs. - if (postType && postId && authorizedPostTypes.includes(postType)) { - return resolveTemplateForPostTypeAndId(postType, postId); - } - - // If we're rendering the home page, and we have a static home page, resolve its template. - if (homepageId) { - return resolveTemplateForPostTypeAndId('page', homepageId); - } - - // If we're not rendering a specific page, use the front page template. - if (url) { - const template = __experimentalGetTemplateForLink(url); - return template?.id; - } - }, [homepageId, postsPageId, hasLoadedAllDependencies, url, postId, postType, frontPageTemplateId]); - const context = (0,external_wp_element_namespaceObject.useMemo)(() => { - if (postTypesWithoutParentTemplate.includes(postType) && postId) { - return {}; - } - if (postType && postId && authorizedPostTypes.includes(postType)) { - return { - postType, - postId - }; - } - // TODO: for post types lists we should probably not render the front page, but maybe a placeholder - // with a message like "Select a page" or something similar. - if (homepageId) { - return { - postType: 'page', - postId: homepageId - }; - } - return {}; - }, [homepageId, postType, postId]); - if (postTypesWithoutParentTemplate.includes(postType) && postId) { - return { - isReady: true, - postType, - postId, - context - }; - } - if (hasLoadedAllDependencies) { - return { - isReady: resolvedTemplateId !== undefined, - postType: TEMPLATE_POST_TYPE, - postId: resolvedTemplateId, - context - }; - } - return { - isReady: false - }; -} -function useInitEditedEntityFromURL() { + const location = sidebar_navigation_screen_useLocation(); + const history = sidebar_navigation_screen_useHistory(); const { - params = {} - } = use_init_edited_entity_from_url_useLocation(); - const { - postType, - postId, - context, - isReady - } = useResolveEditedEntityAndContext(params); - const { - setEditedEntity - } = (0,external_wp_data_namespaceObject.useDispatch)(store); - const { - __unstableSetEditorMode, - resetZoomLevel - } = unlock((0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store)); - (0,external_wp_element_namespaceObject.useEffect)(() => { - if (isReady) { - __unstableSetEditorMode('edit'); - resetZoomLevel(); - setEditedEntity(postType, postId, context); - } - }, [isReady, postType, postId, context, setEditedEntity]); + navigate + } = (0,external_wp_element_namespaceObject.useContext)(SidebarNavigationContext); + const backPath = backPathProp !== null && backPathProp !== void 0 ? backPathProp : location.state?.backPath; + const icon = (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_right : chevron_left; + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { + className: dist_clsx('edit-site-sidebar-navigation-screen__main', { + 'has-footer': !!footer + }), + spacing: 0, + justify: "flex-start", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { + spacing: 3, + alignment: "flex-start", + className: "edit-site-sidebar-navigation-screen__title-icon", + children: [!isRoot && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarButton, { + onClick: () => { + history.navigate(backPath); + navigate('back'); + }, + icon: icon, + label: (0,external_wp_i18n_namespaceObject.__)('Back'), + showTooltip: false + }), isRoot && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarButton, { + icon: icon, + label: dashboardLinkText || (0,external_wp_i18n_namespaceObject.__)('Go to the Dashboard'), + href: dashboardLink + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHeading, { + className: "edit-site-sidebar-navigation-screen__title", + color: '#e0e0e0' /* $gray-200 */, + level: 1, + size: 20, + children: !isPreviewingTheme() ? title : (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: 1: theme name. 2: title */ + (0,external_wp_i18n_namespaceObject.__)('Previewing %1$s: %2$s'), previewingThemeName, title) + }), actions && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: "edit-site-sidebar-navigation-screen__actions", + children: actions + })] + }), meta && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: "edit-site-sidebar-navigation-screen__meta", + children: meta + }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { + className: "edit-site-sidebar-navigation-screen__content", + children: [description && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { + className: "edit-site-sidebar-navigation-screen__description", + children: description + }), content] + })] + }), footer && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("footer", { + className: "edit-site-sidebar-navigation-screen__footer", + children: footer + })] + }); } ;// ./node_modules/@wordpress/icons/build-module/icon/index.js @@ -10391,7 +10179,7 @@ function useInitEditedEntityFromURL() { * Return an SVG icon. * * @param {IconProps} props icon is the SVG component to render - * size is a number specifiying the icon size in pixels + * size is a number specifying the icon size in pixels * Other props will be passed to wrapped SVG component * @param {import('react').ForwardedRef} ref The forwarded ref to the SVG element. * @@ -10411,6 +10199,479 @@ function Icon({ } /* harmony default export */ const build_module_icon = ((0,external_wp_element_namespaceObject.forwardRef)(Icon)); +;// ./node_modules/@wordpress/icons/build-module/library/chevron-left-small.js +/** + * WordPress dependencies + */ + + +const chevronLeftSmall = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "m13.1 16-3.4-4 3.4-4 1.1 1-2.6 3 2.6 3-1.1 1z" + }) +}); +/* harmony default export */ const chevron_left_small = (chevronLeftSmall); + +;// ./node_modules/@wordpress/icons/build-module/library/chevron-right-small.js +/** + * WordPress dependencies + */ + + +const chevronRightSmall = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z" + }) +}); +/* harmony default export */ const chevron_right_small = (chevronRightSmall); + +;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-item/index.js +/** + * External dependencies + */ + + +/** + * WordPress dependencies + */ + + + + + + +/** + * Internal dependencies + */ + + + +const { + useHistory: sidebar_navigation_item_useHistory, + useLink +} = unlock(external_wp_router_namespaceObject.privateApis); +function SidebarNavigationItem({ + className, + icon, + withChevron = false, + suffix, + uid, + to, + onClick, + children, + ...props +}) { + const history = sidebar_navigation_item_useHistory(); + const { + navigate + } = (0,external_wp_element_namespaceObject.useContext)(SidebarNavigationContext); + // If there is no custom click handler, create one that navigates to `params`. + function handleClick(e) { + if (onClick) { + onClick(e); + navigate('forward'); + } else if (to) { + e.preventDefault(); + history.navigate(to); + navigate('forward', `[id="${uid}"]`); + } + } + const linkProps = useLink(to); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalItem, { + className: dist_clsx('edit-site-sidebar-navigation-item', { + 'with-suffix': !withChevron && suffix + }, className), + id: uid, + onClick: handleClick, + href: to ? linkProps.href : undefined, + ...props, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { + justify: "flex-start", + children: [icon && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, { + style: { + fill: 'currentcolor' + }, + icon: icon, + size: 24 + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexBlock, { + children: children + }), withChevron && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, { + icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_left_small : chevron_right_small, + className: "edit-site-sidebar-navigation-item__drilldown-indicator", + size: 24 + }), !withChevron && suffix] + }) + }); +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js +/* wp:polyfill */ +/** + * WordPress dependencies + */ + + + + + +/** + * Internal dependencies + */ + +const SITE_EDITOR_AUTHORS_QUERY = { + per_page: -1, + _fields: 'id,name,avatar_urls', + context: 'view', + capabilities: ['edit_theme_options'] +}; +const DEFAULT_QUERY = { + per_page: 100, + page: 1 +}; +const use_global_styles_revisions_EMPTY_ARRAY = []; +const { + GlobalStylesContext: use_global_styles_revisions_GlobalStylesContext +} = unlock(external_wp_blockEditor_namespaceObject.privateApis); +function useGlobalStylesRevisions({ + query +} = {}) { + const { + user: userConfig + } = (0,external_wp_element_namespaceObject.useContext)(use_global_styles_revisions_GlobalStylesContext); + const _query = { + ...DEFAULT_QUERY, + ...query + }; + const { + authors, + currentUser, + isDirty, + revisions, + isLoadingGlobalStylesRevisions, + revisionsCount + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + var _globalStyles$_links$; + const { + __experimentalGetDirtyEntityRecords, + getCurrentUser, + getUsers, + getRevisions, + __experimentalGetCurrentGlobalStylesId, + getEntityRecord, + isResolving + } = select(external_wp_coreData_namespaceObject.store); + const dirtyEntityRecords = __experimentalGetDirtyEntityRecords(); + const _currentUser = getCurrentUser(); + const _isDirty = dirtyEntityRecords.length > 0; + const globalStylesId = __experimentalGetCurrentGlobalStylesId(); + const globalStyles = globalStylesId ? getEntityRecord('root', 'globalStyles', globalStylesId) : undefined; + const _revisionsCount = (_globalStyles$_links$ = globalStyles?._links?.['version-history']?.[0]?.count) !== null && _globalStyles$_links$ !== void 0 ? _globalStyles$_links$ : 0; + const globalStylesRevisions = getRevisions('root', 'globalStyles', globalStylesId, _query) || use_global_styles_revisions_EMPTY_ARRAY; + const _authors = getUsers(SITE_EDITOR_AUTHORS_QUERY) || use_global_styles_revisions_EMPTY_ARRAY; + const _isResolving = isResolving('getRevisions', ['root', 'globalStyles', globalStylesId, _query]); + return { + authors: _authors, + currentUser: _currentUser, + isDirty: _isDirty, + revisions: globalStylesRevisions, + isLoadingGlobalStylesRevisions: _isResolving, + revisionsCount: _revisionsCount + }; + }, [query]); + return (0,external_wp_element_namespaceObject.useMemo)(() => { + if (!authors.length || isLoadingGlobalStylesRevisions) { + return { + revisions: use_global_styles_revisions_EMPTY_ARRAY, + hasUnsavedChanges: isDirty, + isLoading: true, + revisionsCount + }; + } + + // Adds author details to each revision. + const _modifiedRevisions = revisions.map(revision => { + return { + ...revision, + author: authors.find(author => author.id === revision.author) + }; + }); + const fetchedRevisionsCount = revisions.length; + if (fetchedRevisionsCount) { + // Flags the most current saved revision. + if (_modifiedRevisions[0].id !== 'unsaved' && _query.page === 1) { + _modifiedRevisions[0].isLatest = true; + } + + // Adds an item for unsaved changes. + if (isDirty && userConfig && Object.keys(userConfig).length > 0 && currentUser && _query.page === 1) { + const unsavedRevision = { + id: 'unsaved', + styles: userConfig?.styles, + settings: userConfig?.settings, + _links: userConfig?._links, + author: { + name: currentUser?.name, + avatar_urls: currentUser?.avatar_urls + }, + modified: new Date() + }; + _modifiedRevisions.unshift(unsavedRevision); + } + if (_query.page === Math.ceil(revisionsCount / _query.per_page)) { + // Adds an item for the default theme styles. + _modifiedRevisions.push({ + id: 'parent', + styles: {}, + settings: {} + }); + } + } + return { + revisions: _modifiedRevisions, + hasUnsavedChanges: isDirty, + isLoading: false, + revisionsCount + }; + }, [isDirty, revisions, currentUser, authors, userConfig, isLoadingGlobalStylesRevisions]); +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-details-footer/index.js +/** + * WordPress dependencies + */ + + + + + +/** + * Internal dependencies + */ + + +function SidebarNavigationScreenDetailsFooter({ + record, + revisionsCount, + ...otherProps +}) { + var _record$_links$predec; + /* + * There might be other items in the future, + * but for now it's just modified date. + * Later we might render a list of items and isolate + * the following logic. + */ + const hrefProps = {}; + const lastRevisionId = (_record$_links$predec = record?._links?.['predecessor-version']?.[0]?.id) !== null && _record$_links$predec !== void 0 ? _record$_links$predec : null; + + // Use incoming prop first, then the record's version history, if available. + revisionsCount = revisionsCount || record?._links?.['version-history']?.[0]?.count || 0; + + /* + * Enable the revisions link if there is a last revision and there is more than one revision. + * This link is used for theme assets, e.g., templates, which have no database record until they're edited. + * For these files there's only a "revision" after they're edited twice, + * which means the revision.php page won't display a proper diff. + * See: https://github.com/WordPress/gutenberg/issues/49164. + */ + if (lastRevisionId && revisionsCount > 1) { + hrefProps.href = (0,external_wp_url_namespaceObject.addQueryArgs)('revision.php', { + revision: record?._links['predecessor-version'][0].id + }); + hrefProps.as = 'a'; + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalItemGroup, { + size: "large", + className: "edit-site-sidebar-navigation-screen-details-footer", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationItem, { + icon: library_backup, + ...hrefProps, + ...otherProps, + children: (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %d: Number of Styles revisions. */ + (0,external_wp_i18n_namespaceObject._n)('%d Revision', '%d Revisions', revisionsCount), revisionsCount) + }) + }); +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-global-styles/index.js +/** + * WordPress dependencies + */ + + + + + + + +/** + * Internal dependencies + */ + + + + + + + + +const { + useLocation: sidebar_navigation_screen_global_styles_useLocation, + useHistory: sidebar_navigation_screen_global_styles_useHistory +} = unlock(external_wp_router_namespaceObject.privateApis); +function SidebarNavigationItemGlobalStyles(props) { + const { + name + } = sidebar_navigation_screen_global_styles_useLocation(); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationItem, { + ...props, + "aria-current": name === 'styles' + }); +} +function SidebarNavigationScreenGlobalStyles() { + const history = sidebar_navigation_screen_global_styles_useHistory(); + const { + path + } = sidebar_navigation_screen_global_styles_useLocation(); + const { + revisions, + isLoading: isLoadingRevisions, + revisionsCount + } = useGlobalStylesRevisions(); + const { + openGeneralSidebar + } = (0,external_wp_data_namespaceObject.useDispatch)(store); + const { + setEditorCanvasContainerView + } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store)); + const { + set: setPreference + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_preferences_namespaceObject.store); + const openGlobalStyles = (0,external_wp_element_namespaceObject.useCallback)(async () => { + history.navigate((0,external_wp_url_namespaceObject.addQueryArgs)(path, { + canvas: 'edit' + }), { + transition: 'canvas-mode-edit-transition' + }); + return Promise.all([setPreference('core', 'distractionFree', false), openGeneralSidebar('edit-site/global-styles')]); + }, [path, history, openGeneralSidebar, setPreference]); + const openRevisions = (0,external_wp_element_namespaceObject.useCallback)(async () => { + await openGlobalStyles(); + // Open the global styles revisions once the canvas mode is set to edit, + // and the global styles sidebar is open. The global styles UI is responsible + // for redirecting to the revisions screen once the editor canvas container + // has been set to 'global-styles-revisions'. + setEditorCanvasContainerView('global-styles-revisions'); + }, [openGlobalStyles, setEditorCanvasContainerView]); + + // If there are no revisions, do not render a footer. + const shouldShowGlobalStylesFooter = !!revisionsCount && !isLoadingRevisions; + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreen, { + title: (0,external_wp_i18n_namespaceObject.__)('Design'), + isRoot: true, + description: (0,external_wp_i18n_namespaceObject.__)('Customize the appearance of your website using the block editor.'), + content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MainSidebarNavigationContent, { + activeItem: "styles-navigation-item" + }), + footer: shouldShowGlobalStylesFooter && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenDetailsFooter, { + record: revisions?.[0], + revisionsCount: revisionsCount, + onClick: openRevisions + }) + }) + }); +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-main/index.js +/** + * WordPress dependencies + */ + + + + + + + +/** + * Internal dependencies + */ + + + + + + +function MainSidebarNavigationContent({ + isBlockBasedTheme = true +}) { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalItemGroup, { + className: "edit-site-sidebar-navigation-screen-main", + children: [isBlockBasedTheme && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationItem, { + uid: "navigation-navigation-item", + to: "/navigation", + withChevron: true, + icon: library_navigation, + children: (0,external_wp_i18n_namespaceObject.__)('Navigation') + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationItemGlobalStyles, { + to: "/styles", + uid: "global-styles-navigation-item", + icon: library_styles, + children: (0,external_wp_i18n_namespaceObject.__)('Styles') + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationItem, { + uid: "page-navigation-item", + to: "/page", + withChevron: true, + icon: library_page, + children: (0,external_wp_i18n_namespaceObject.__)('Pages') + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationItem, { + uid: "template-navigation-item", + to: "/template", + withChevron: true, + icon: library_layout, + children: (0,external_wp_i18n_namespaceObject.__)('Templates') + })] + }), !isBlockBasedTheme && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationItem, { + uid: "stylebook-navigation-item", + to: "/stylebook", + withChevron: true, + icon: library_styles, + children: (0,external_wp_i18n_namespaceObject.__)('Styles') + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationItem, { + uid: "patterns-navigation-item", + to: "/pattern", + withChevron: true, + icon: library_symbol, + children: (0,external_wp_i18n_namespaceObject.__)('Patterns') + })] + }); +} +function SidebarNavigationScreenMain() { + const isBlockBasedTheme = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getCurrentTheme()?.is_block_theme, []); + const { + setEditorCanvasContainerView + } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store)); + + // Clear the editor canvas container view when accessing the main navigation screen. + (0,external_wp_element_namespaceObject.useEffect)(() => { + setEditorCanvasContainerView(undefined); + }, [setEditorCanvasContainerView]); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreen, { + isRoot: true, + title: (0,external_wp_i18n_namespaceObject.__)('Design'), + description: isBlockBasedTheme ? (0,external_wp_i18n_namespaceObject.__)('Customize the appearance of your website using the block editor.') : (0,external_wp_i18n_namespaceObject.__)('Explore block styles and patterns to refine your site'), + content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MainSidebarNavigationContent, { + isBlockBasedTheme: isBlockBasedTheme + }) + }); +} + ;// ./node_modules/@wordpress/icons/build-module/library/arrow-up-left.js /** * WordPress dependencies @@ -10430,7 +10691,6 @@ const arrowUpLeft = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx ;// ./node_modules/@wordpress/edit-site/build-module/components/welcome-guide/image.js - function WelcomeGuideImage({ nonAnimatedSrc, animatedSrc @@ -10465,8 +10725,6 @@ function WelcomeGuideImage({ */ - - function WelcomeGuideEditor() { const { toggle @@ -10530,8 +10788,6 @@ function WelcomeGuideEditor() { - - const { interfaceStore: styles_interfaceStore } = unlock(external_wp_editor_namespaceObject.privateApis); @@ -10630,13 +10886,6 @@ function WelcomeGuideStyles() { -/** - * Internal dependencies - */ - - - - function WelcomeGuidePage() { const { toggle @@ -10644,10 +10893,7 @@ function WelcomeGuidePage() { const isVisible = (0,external_wp_data_namespaceObject.useSelect)(select => { const isPageActive = !!select(external_wp_preferences_namespaceObject.store).get('core/edit-site', 'welcomeGuidePage'); const isEditorActive = !!select(external_wp_preferences_namespaceObject.store).get('core/edit-site', 'welcomeGuide'); - const { - isPage - } = select(store); - return isPageActive && !isEditorActive && isPage(); + return isPageActive && !isEditorActive; }, []); if (!isVisible) { return null; @@ -10694,22 +10940,10 @@ function WelcomeGuidePage() { -/** - * Internal dependencies - */ - - - - function WelcomeGuideTemplate() { const { toggle } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_preferences_namespaceObject.store); - const { - isLoaded, - record - } = useEditedEntityRecord(); - const isPostTypeTemplate = isLoaded && record.type === 'wp_template'; const { isActive, hasPreviousEntity @@ -10725,7 +10959,7 @@ function WelcomeGuideTemplate() { hasPreviousEntity: !!getEditorSettings().onNavigateToPreviousEntityRecord }; }, []); - const isVisible = isActive && isPostTypeTemplate && hasPreviousEntity; + const isVisible = isActive && hasPreviousEntity; if (!isVisible) { return null; } @@ -10770,15 +11004,16 @@ function WelcomeGuideTemplate() { - - -function WelcomeGuide() { +function WelcomeGuide({ + postType +}) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuideEditor, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuideStyles, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuidePage, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuideTemplate, {})] + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuideEditor, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuideStyles, {}), postType === 'page' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuidePage, {}), postType === 'wp_template' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuideTemplate, {})] }); } ;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles-renderer/index.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -10791,15 +11026,11 @@ function WelcomeGuide() { */ - const { useGlobalStylesOutput } = unlock(external_wp_blockEditor_namespaceObject.privateApis); -function useGlobalStylesRenderer() { - const postType = (0,external_wp_data_namespaceObject.useSelect)(select => { - return select(store).getEditedPostType(); - }); - const [styles, settings] = useGlobalStylesOutput(postType !== TEMPLATE_POST_TYPE); +function useGlobalStylesRenderer(disableRootPadding) { + const [styles, settings] = useGlobalStylesOutput(disableRootPadding); const { getSettings } = (0,external_wp_data_namespaceObject.useSelect)(store); @@ -10820,8 +11051,10 @@ function useGlobalStylesRenderer() { }); }, [styles, settings, updateSettings, getSettings]); } -function GlobalStylesRenderer() { - useGlobalStylesRenderer(); +function GlobalStylesRenderer({ + disableRootPadding +}) { + useGlobalStylesRenderer(disableRootPadding); return null; } @@ -10900,11 +11133,7 @@ const { function useNavigateToEntityRecord() { const history = use_navigate_to_entity_record_useHistory(); const onNavigateToEntityRecord = (0,external_wp_element_namespaceObject.useCallback)(params => { - history.push({ - ...params, - focusMode: true, - canvas: 'edit' - }); + history.navigate(`/${params.postType}/${params.postId}?canvas=edit&focusMode=true`); }, [history]); return onNavigateToEntityRecord; } @@ -10934,52 +11163,46 @@ function useNavigateToPreviousEntityRecord() { const previousLocation = (0,external_wp_compose_namespaceObject.usePrevious)(location); const history = use_site_editor_settings_useHistory(); const goBack = (0,external_wp_element_namespaceObject.useMemo)(() => { - const isFocusMode = location.params.focusMode || location.params.postId && FOCUSABLE_ENTITIES.includes(location.params.postType); - const didComeFromEditorCanvas = previousLocation?.params.canvas === 'edit'; + const isFocusMode = location.query.focusMode || location?.params?.postId && FOCUSABLE_ENTITIES.includes(location?.params?.postType); + const didComeFromEditorCanvas = previousLocation?.query.canvas === 'edit'; const showBackButton = isFocusMode && didComeFromEditorCanvas; return showBackButton ? () => history.back() : undefined; - // Disable reason: previousLocation changes when the component updates for any reason, not + // `previousLocation` changes when the component updates for any reason, not // just when location changes. Until this is fixed we can't add it to deps. See // https://github.com/WordPress/gutenberg/pull/58710#discussion_r1479219465. - // eslint-disable-next-line react-hooks/exhaustive-deps }, [location, history]); return goBack; } function useSpecificEditorSettings() { + const { + query + } = use_site_editor_settings_useLocation(); + const { + canvas = 'view' + } = query; const onNavigateToEntityRecord = useNavigateToEntityRecord(); const { - canvasMode, - settings, - shouldUseTemplateAsDefaultRenderingMode + settings } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { - getEditedPostContext, - getCanvasMode, getSettings - } = unlock(select(store)); - const _context = getEditedPostContext(); + } = select(store); return { - canvasMode: getCanvasMode(), - settings: getSettings(), - // TODO: The `postType` check should be removed when the default rendering mode per post type is merged. - // @see https://github.com/WordPress/gutenberg/pull/62304/ - shouldUseTemplateAsDefaultRenderingMode: _context?.postId && _context?.postType !== 'post' + settings: getSettings() }; }, []); - const defaultRenderingMode = shouldUseTemplateAsDefaultRenderingMode ? 'template-locked' : 'post-only'; const onNavigateToPreviousEntityRecord = useNavigateToPreviousEntityRecord(); const defaultEditorSettings = (0,external_wp_element_namespaceObject.useMemo)(() => { return { ...settings, richEditingEnabled: true, supportsTemplateMode: true, - focusMode: canvasMode !== 'view', - defaultRenderingMode, + focusMode: canvas !== 'view', onNavigateToEntityRecord, onNavigateToPreviousEntityRecord, - __unstableIsPreviewMode: canvasMode === 'view' + isPreviewMode: canvas === 'view' }; - }, [settings, canvasMode, defaultRenderingMode, onNavigateToEntityRecord, onNavigateToPreviousEntityRecord]); + }, [settings, canvas, onNavigateToEntityRecord, onNavigateToPreviousEntityRecord]); return defaultEditorSettings; } @@ -11070,36 +11293,6 @@ const moreVertical = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.js }); /* harmony default export */ const more_vertical = (moreVertical); -;// ./node_modules/@wordpress/icons/build-module/library/chevron-left.js -/** - * WordPress dependencies - */ - - -const chevronLeft = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - d: "M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z" - }) -}); -/* harmony default export */ const chevron_left = (chevronLeft); - -;// ./node_modules/@wordpress/icons/build-module/library/chevron-right.js -/** - * WordPress dependencies - */ - - -const chevronRight = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - d: "M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z" - }) -}); -/* harmony default export */ const chevron_right = (chevronRight); - ;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/icon-with-current-color.js /** * External dependencies @@ -11132,7 +11325,6 @@ function IconWithCurrentColor({ */ - function GenericNavigationButton({ icon, children, @@ -11152,13 +11344,13 @@ function GenericNavigationButton({ }); } function NavigationButtonAsItem(props) { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalNavigatorButton, { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Navigator.Button, { as: GenericNavigationButton, ...props }); } function NavigationBackButtonAsItem(props) { - return /*#__PURE__*/_jsx(NavigatorBackButton, { + return /*#__PURE__*/_jsx(Navigator.BackButton, { as: GenericNavigationButton, ...props }); @@ -11244,8 +11436,6 @@ const shadow = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ext - - const { useHasDimensionsPanel, useHasTypographyPanel, @@ -11272,12 +11462,10 @@ function RootMenu() { children: [hasTypographyPanel && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationButtonAsItem, { icon: library_typography, path: "/typography", - "aria-label": (0,external_wp_i18n_namespaceObject.__)('Typography styles'), children: (0,external_wp_i18n_namespaceObject.__)('Typography') }), hasColorPanel && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationButtonAsItem, { icon: library_color, path: "/colors", - "aria-label": (0,external_wp_i18n_namespaceObject.__)('Colors styles'), children: (0,external_wp_i18n_namespaceObject.__)('Colors') }), hasBackgroundPanel && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationButtonAsItem, { icon: library_background, @@ -11287,12 +11475,10 @@ function RootMenu() { }), hasShadowPanel && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationButtonAsItem, { icon: library_shadow, path: "/shadows", - "aria-label": (0,external_wp_i18n_namespaceObject.__)('Shadow styles'), children: (0,external_wp_i18n_namespaceObject.__)('Shadows') }), hasLayoutPanel && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationButtonAsItem, { icon: library_layout, path: "/layout", - "aria-label": (0,external_wp_i18n_namespaceObject.__)('Layout styles'), children: (0,external_wp_i18n_namespaceObject.__)('Layout') })] }) @@ -11301,6 +11487,7 @@ function RootMenu() { /* harmony default export */ const root_menu = (RootMenu); ;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-library-modal/utils/preview-styles.js +/* wp:polyfill */ function findNearest(input, numbers) { // If the numbers array is empty, return null if (numbers.length === 0) { @@ -11429,6 +11616,7 @@ function getFacePreviewStyle(face) { } ;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/utils.js +/* wp:polyfill */ /** * * @param {string} variation The variation name. @@ -11516,8 +11704,8 @@ function getFontFamilies(themeJson) { - const { + useGlobalStyle: typography_example_useGlobalStyle, GlobalStylesContext: typography_example_GlobalStylesContext } = unlock(external_wp_blockEditor_namespaceObject.privateApis); const { @@ -11534,9 +11722,14 @@ function PreviewTypography({ if (variation) { config = mergeBaseAndUserConfigs(base, variation); } + const [textColor] = typography_example_useGlobalStyle('color.text'); const [bodyFontFamilies, headingFontFamilies] = getFontFamilies(config); const bodyPreviewStyle = bodyFontFamilies ? getFamilyPreviewStyle(bodyFontFamilies) : {}; const headingPreviewStyle = headingFontFamilies ? getFamilyPreviewStyle(headingFontFamilies) : {}; + if (textColor) { + bodyPreviewStyle.color = textColor; + headingPreviewStyle.color = textColor; + } if (fontSize) { bodyPreviewStyle.fontSize = fontSize; headingPreviewStyle.fontSize = fontSize; @@ -11555,7 +11748,8 @@ function PreviewTypography({ type: 'tween' }, style: { - textAlign: 'center' + textAlign: 'center', + lineHeight: 1 }, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { style: headingPreviewStyle, @@ -11568,6 +11762,7 @@ function PreviewTypography({ } ;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/highlighted-colors.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -11610,7 +11805,8 @@ function HighlightedColors({ }, `${slug}-${index}`)); } -;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/preview-iframe.js +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/preview-wrapper.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -11624,11 +11820,8 @@ function HighlightedColors({ */ - - const { - useGlobalStyle: preview_iframe_useGlobalStyle, - useGlobalStylesOutput: preview_iframe_useGlobalStylesOutput + useGlobalStyle: preview_wrapper_useGlobalStyle } = unlock(external_wp_blockEditor_namespaceObject.privateApis); const normalizedWidth = 248; const normalizedHeight = 152; @@ -11639,15 +11832,14 @@ const THROTTLE_OPTIONS = { leading: true, trailing: true }; -function PreviewIframe({ +function PreviewWrapper({ children, label, isFocused, withHoverView }) { - const [backgroundColor = 'white'] = preview_iframe_useGlobalStyle('color.background'); - const [gradientValue] = preview_iframe_useGlobalStyle('color.gradient'); - const [styles] = preview_iframe_useGlobalStylesOutput(); + const [backgroundColor = 'white'] = preview_wrapper_useGlobalStyle('color.background'); + const [gradientValue] = preview_wrapper_useGlobalStyle('color.gradient'); const disableMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)(); const [isHovered, setIsHovered] = (0,external_wp_element_namespaceObject.useState)(false); const [containerResizeListener, { @@ -11657,7 +11849,7 @@ function PreviewIframe({ const [ratioState, setRatioState] = (0,external_wp_element_namespaceObject.useState)(); const setThrottledWidth = (0,external_wp_compose_namespaceObject.useThrottle)(setThrottledWidthState, 250, THROTTLE_OPTIONS); - // Must use useLayoutEffect to avoid a flash of the iframe at the wrong + // Must use useLayoutEffect to avoid a flash of the container at the wrong // size before the width is set. (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { if (width) { @@ -11665,7 +11857,7 @@ function PreviewIframe({ } }, [width, setThrottledWidth]); - // Must use useLayoutEffect to avoid a flash of the iframe at the wrong + // Must use useLayoutEffect to avoid a flash of the container at the wrong // size before the width is set. (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { const newRatio = throttledWidth ? throttledWidth / normalizedWidth : 1; @@ -11690,21 +11882,6 @@ function PreviewIframe({ * See: https://github.com/WordPress/gutenberg/issues/55112 */ const ratio = ratioState ? ratioState : fallbackRatio; - - /* - * Reset leaked styles from WP common.css and remove main content layout padding and border. - * Add pointer cursor to the body to indicate the iframe is interactive, - * similar to Typography variation previews. - */ - const editorStyles = (0,external_wp_element_namespaceObject.useMemo)(() => { - if (styles) { - return [...styles, { - css: 'html{overflow:hidden}body{min-width: 0;padding: 0;border: none;cursor: pointer;}', - isGlobalStyles: true - }]; - } - return styles; - }, [styles]); const isReady = !!width; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { @@ -11712,17 +11889,15 @@ function PreviewIframe({ position: 'relative' }, children: containerResizeListener - }), isReady && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.__unstableIframe, { - className: "edit-site-global-styles-preview__iframe", + }), isReady && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: "edit-site-global-styles-preview__wrapper", style: { height: normalizedHeight * ratio }, onMouseEnter: () => setIsHovered(true), onMouseLeave: () => setIsHovered(false), tabIndex: -1, - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__unstableEditorStyles, { - styles: editorStyles - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableMotion.div, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableMotion.div, { style: { height: normalizedHeight * ratio, width: '100%', @@ -11736,12 +11911,13 @@ function PreviewIframe({ ratio, key })) - })] + }) })] }); } ;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/preview-styles.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -11757,7 +11933,6 @@ function PreviewIframe({ - const { useGlobalStyle: preview_styles_useGlobalStyle } = unlock(external_wp_blockEditor_namespaceObject.privateApis); @@ -11804,7 +11979,7 @@ const PreviewStyles = ({ const { paletteColors } = useStylesPreviewColors(); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(PreviewIframe, { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(PreviewWrapper, { label: label, isFocused: isFocused, withHoverView: withHoverView, @@ -11923,8 +12098,6 @@ const PreviewStyles = ({ - - const { useGlobalStyle: screen_root_useGlobalStyle } = unlock(external_wp_blockEditor_namespaceObject.privateApis); @@ -11962,7 +12135,6 @@ function ScreenRoot() { }), hasVariations && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalItemGroup, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationButtonAsItem, { path: "/variations", - "aria-label": (0,external_wp_i18n_namespaceObject.__)('Browse styles'), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "space-between", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { @@ -11980,7 +12152,7 @@ function ScreenRoot() { paddingTop: 2 /* * 13px matches the text inset of the NavigationButton (12px padding, plus the width of the button's border). - * This is an ad hoc override for this instance and the Addtional CSS option below. Other options for matching the + * This is an ad hoc override for this instance and the Additional CSS option below. Other options for matching the * the nav button inset should be looked at before reusing further. */, paddingX: "13px", @@ -11989,7 +12161,6 @@ function ScreenRoot() { }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalItemGroup, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationButtonAsItem, { path: "/blocks", - "aria-label": (0,external_wp_i18n_namespaceObject.__)('Blocks styles'), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "space-between", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { @@ -12011,7 +12182,6 @@ function ScreenRoot() { }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalItemGroup, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationButtonAsItem, { path: "/css", - "aria-label": (0,external_wp_i18n_namespaceObject.__)('Additional CSS'), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "space-between", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { @@ -12031,6 +12201,7 @@ function ScreenRoot() { ;// external ["wp","a11y"] const external_wp_a11y_namespaceObject = window["wp"]["a11y"]; ;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/variations/variations-panel.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -12078,7 +12249,6 @@ function VariationsPanel({ } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationButtonAsItem, { path: '/blocks/' + encodeURIComponent(name) + '/variations/' + encodeURIComponent(style.name), - "aria-label": style.label, children: style.label }, index); }) @@ -12093,7 +12263,6 @@ function VariationsPanel({ - function ScreenHeader({ title, description, @@ -12108,7 +12277,7 @@ function ScreenHeader({ paddingY: 3, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { spacing: 2, - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalNavigatorBackButton, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Navigator.BackButton, { icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_right : chevron_left, size: "small", label: (0,external_wp_i18n_namespaceObject.__)('Back'), @@ -12132,6 +12301,7 @@ function ScreenHeader({ /* harmony default export */ const header = (ScreenHeader); ;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-block-list.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -12152,8 +12322,6 @@ function ScreenHeader({ - - const { useHasDimensionsPanel: screen_block_list_useHasDimensionsPanel, useHasTypographyPanel: screen_block_list_useHasTypographyPanel, @@ -12206,12 +12374,8 @@ function BlockMenuItem({ if (!hasBlockMenuItem) { return null; } - const navigationButtonLabel = (0,external_wp_i18n_namespaceObject.sprintf)( - // translators: %s: is the name of a block e.g., 'Image' or 'Table'. - (0,external_wp_i18n_namespaceObject.__)('%s block styles'), block.title); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationButtonAsItem, { path: '/blocks/' + encodeURIComponent(block.name), - "aria-label": navigationButtonLabel, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "flex-start", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockIcon, { @@ -12247,7 +12411,7 @@ function BlockList({ // which is now one. // @see https://github.com/WordPress/gutenberg/pull/39117#discussion_r816022116 const count = blockTypesListRef.current.childElementCount; - const resultsFoundMessage = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %d: number of results. */ + const resultsFoundMessage = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %d: number of results. */ (0,external_wp_i18n_namespaceObject._n)('%d result found.', '%d results found.', count), count); debouncedSpeak(resultsFoundMessage, count); }, [filterValue, debouncedSpeak]); @@ -12272,7 +12436,7 @@ function ScreenBlockList() { className: "edit-site-block-types-search", onChange: setFilterValue, value: filterValue, - label: (0,external_wp_i18n_namespaceObject.__)('Search for blocks'), + label: (0,external_wp_i18n_namespaceObject.__)('Search'), placeholder: (0,external_wp_i18n_namespaceObject.__)('Search') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MemoizedBlockList, { filterValue: deferredFilterValue @@ -12305,16 +12469,14 @@ const BlockPreviewPanel = ({ if (!blockExample) { return null; } - let example = blockExample; - if (variation) { - example = { - ...example, - attributes: { - ...example.attributes, - className: getVariationClassName(variation) - } - }; - } + const example = { + ...blockExample, + attributes: { + ...blockExample.attributes, + style: undefined, + className: variation ? getVariationClassName(variation) : blockExample.attributes?.className + } + }; return (0,external_wp_blocks_namespaceObject.getBlockFromExample)(name, example); }, [name, blockExample, variation]); const viewportWidth = (_blockExample$viewpor = blockExample?.viewportWidth) !== null && _blockExample$viewpor !== void 0 ? _blockExample$viewpor : 500; @@ -12377,6 +12539,7 @@ function Subtitle({ /* harmony default export */ const subtitle = (Subtitle); ;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-block.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -12399,8 +12562,6 @@ function Subtitle({ // Initial control values. - - const BACKGROUND_BLOCK_DEFAULT_VALUES = { backgroundSize: 'cover', backgroundPosition: '50% 50%' // used only when backgroundSize is 'contain'. @@ -12472,12 +12633,13 @@ function ScreenBlock({ }); const [userSettings] = screen_block_useGlobalSetting('', name, 'user'); const [rawSettings, setSettings] = screen_block_useGlobalSetting('', name); - const settings = screen_block_useSettingsForBlockElement(rawSettings, name); + const settingsForBlockElement = screen_block_useSettingsForBlockElement(rawSettings, name); const blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(name); // Only allow `blockGap` support if serialization has not been skipped, to be sure global spacing can be applied. - if (settings?.spacing?.blockGap && blockType?.supports?.spacing?.blockGap && (blockType?.supports?.spacing?.__experimentalSkipSerialization === true || blockType?.supports?.spacing?.__experimentalSkipSerialization?.some?.(spacingType => spacingType === 'blockGap'))) { - settings.spacing.blockGap = false; + let disableBlockGap = false; + if (settingsForBlockElement?.spacing?.blockGap && blockType?.supports?.spacing?.blockGap && (blockType?.supports?.spacing?.__experimentalSkipSerialization === true || blockType?.supports?.spacing?.__experimentalSkipSerialization?.some?.(spacingType => spacingType === 'blockGap'))) { + disableBlockGap = true; } // Only allow `aspectRatio` support if the block is not the grouping block. @@ -12486,9 +12648,20 @@ function ScreenBlock({ // for all three at once. Until there is the ability to set a different aspect // ratio for each variation, we disable the aspect ratio controls for the // grouping block in global styles. - if (settings?.dimensions?.aspectRatio && name === 'core/group') { - settings.dimensions.aspectRatio = false; + let disableAspectRatio = false; + if (settingsForBlockElement?.dimensions?.aspectRatio && name === 'core/group') { + disableAspectRatio = true; } + const settings = (0,external_wp_element_namespaceObject.useMemo)(() => { + const updatedSettings = structuredClone(settingsForBlockElement); + if (disableBlockGap) { + updatedSettings.spacing.blockGap = false; + } + if (disableAspectRatio) { + updatedSettings.dimensions.aspectRatio = false; + } + return updatedSettings; + }, [settingsForBlockElement, disableBlockGap, disableAspectRatio]); const blockVariations = useBlockVariations(name); const hasBackgroundPanel = screen_block_useHasBackgroundPanel(settings); const hasTypographyPanel = screen_block_useHasTypographyPanel(settings); @@ -12687,7 +12860,6 @@ function ScreenBlock({ - const { useGlobalStyle: typography_elements_useGlobalStyle } = unlock(external_wp_blockEditor_namespaceObject.privateApis); @@ -12708,12 +12880,8 @@ function ElementItem({ const [fallbackBackgroundColor] = typography_elements_useGlobalStyle('color.background'); const [gradientValue] = typography_elements_useGlobalStyle(prefix + 'color.gradient'); const [color] = typography_elements_useGlobalStyle(prefix + 'color.text'); - const navigationButtonLabel = (0,external_wp_i18n_namespaceObject.sprintf)( - // translators: %s: is a subset of Typography, e.g., 'text' or 'links'. - (0,external_wp_i18n_namespaceObject.__)('Typography %s styles'), label); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationButtonAsItem, { path: parentMenu + '/typography/' + element, - "aria-label": navigationButtonLabel, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "flex-start", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { @@ -12726,6 +12894,7 @@ function ElementItem({ fontWeight, ...extraStyles }, + "aria-hidden": "true", children: (0,external_wp_i18n_namespaceObject.__)('Aa') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { children: label @@ -12786,7 +12955,7 @@ const StylesPreviewTypography = ({ isFocused, withHoverView }) => { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreviewIframe, { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreviewWrapper, { label: variation.title, isFocused: isFocused, withHoverView: withHoverView, @@ -12825,6 +12994,7 @@ const StylesPreviewTypography = ({ * Internal dependencies */ +const use_theme_style_variations_by_property_EMPTY_ARRAY = []; const { GlobalStylesContext: use_theme_style_variations_by_property_GlobalStylesContext, areGlobalStyleConfigsEqual @@ -12889,7 +13059,7 @@ function useCurrentMergeThemeStyleVariationsWithUserConfig(properties = []) { } = (0,external_wp_data_namespaceObject.useSelect)(select => { const _variationsFromTheme = select(external_wp_coreData_namespaceObject.store).__experimentalGetCurrentThemeGlobalStylesVariations(); return { - variationsFromTheme: _variationsFromTheme || [] + variationsFromTheme: _variationsFromTheme || use_theme_style_variations_by_property_EMPTY_ARRAY }; }, []); const { @@ -13021,7 +13191,7 @@ function Variation({ const isActive = (0,external_wp_element_namespaceObject.useMemo)(() => variation_areGlobalStyleConfigsEqual(user, variation), [user, variation]); let label = variation?.title; if (variation?.description) { - label = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: 1: variation title. 2: variation description. */ + label = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: 1: variation title. 2: variation description. */ (0,external_wp_i18n_namespaceObject._x)('%1$s (%2$s)', 'variation label'), variation?.title, variation?.description); } const content = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { @@ -13053,6 +13223,7 @@ function Variation({ } ;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/variations/variations-typography.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -13066,7 +13237,6 @@ function Variation({ - function TypographyVariations({ title, gap = 2 @@ -13115,7 +13285,6 @@ function TypographyVariations({ - function FontSizes() { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 2, @@ -13129,8 +13298,7 @@ function FontSizes() { isBordered: true, isSeparated: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationButtonAsItem, { - path: "/typography/font-sizes/", - "aria-label": (0,external_wp_i18n_namespaceObject.__)('Edit font size presets'), + path: "/typography/font-sizes", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { direction: "row", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { @@ -13151,7 +13319,6 @@ function FontSizes() { */ - const settings_settings = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", @@ -13256,6 +13423,7 @@ const FONT_STYLES = { }; ;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-library-modal/utils/index.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -13550,6 +13718,7 @@ function checkFontFaceInstalled(fontFace, collection) { } ;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-library-modal/utils/toggleFont.js +/* wp:polyfill */ /** * Toggles the activation of a given font or font variant within a list of custom fonts. * @@ -13637,6 +13806,7 @@ function toggleFont(font, face, initialfonts) { } ;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-library-modal/context.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -14030,6 +14200,7 @@ function FontLibraryProvider({ /* harmony default export */ const context = (FontLibraryProvider); ;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-library-modal/font-demo.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -14140,7 +14311,6 @@ function FontDemo({ - function FontCard({ font, onClick, @@ -14151,7 +14321,7 @@ function FontCard({ const style = { cursor: !!onClick ? 'pointer' : 'default' }; - const navigator = (0,external_wp_components_namespaceObject.__experimentalUseNavigator)(); + const navigator = (0,external_wp_components_namespaceObject.useNavigator)(); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, onClick: () => { @@ -14172,7 +14342,7 @@ function FontCard({ children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { className: "font-library-modal__font-card__count", - children: variantsText || (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %d: Number of font variants. */ + children: variantsText || (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %d: Number of font variants. */ (0,external_wp_i18n_namespaceObject._n)('%d variant', '%d variants', variantsCount), variantsCount) }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { @@ -14201,7 +14371,6 @@ function FontCard({ - const { kebabCase: library_font_variant_kebabCase } = unlock(external_wp_components_namespaceObject.privateApis); @@ -14283,6 +14452,7 @@ function sortFontFaces(faces) { } ;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-library-modal/installed-fonts.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -14304,8 +14474,6 @@ function sortFontFaces(faces) { - - const { useGlobalSetting: installed_fonts_useGlobalSetting } = unlock(external_wp_blockEditor_namespaceObject.privateApis); @@ -14367,7 +14535,7 @@ function InstalledFonts() { } catch (error) { setNotice({ type: 'error', - message: (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: error message */ + message: (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: error message */ (0,external_wp_i18n_namespaceObject.__)('There was an error updating the font family. %s'), error.message) }); } @@ -14388,7 +14556,7 @@ function InstalledFonts() { const getFontCardVariantsText = font => { const variantsInstalled = font?.fontFace?.length > 0 ? font.fontFace.length : 1; const variantsActive = getFontFacesActivated(font.slug, font.source).length; - return (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: 1: Active font variants, 2: Total font variants. */ + return (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: 1: Active font variants, 2: Total font variants. */ (0,external_wp_i18n_namespaceObject.__)('%1$s/%2$s variants active'), variantsActive, variantsInstalled); }; (0,external_wp_element_namespaceObject.useEffect)(() => { @@ -14432,9 +14600,9 @@ function InstalledFonts() { className: "font-library-modal__loading", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ProgressBar, {}) }), !isResolvingLibrary && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalNavigatorProvider, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Navigator, { initialPath: libraryFontSelected ? '/fontFamily' : '/', - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalNavigatorScreen, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Navigator.Screen, { path: "/", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: "8", @@ -14489,7 +14657,7 @@ function InstalledFonts() { })] })] }) - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalNavigatorScreen, { + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Navigator.Screen, { path: "/fontFamily", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ConfirmDeleteDialog, { font: libraryFontSelected, @@ -14500,7 +14668,7 @@ function InstalledFonts() { handleSetLibraryFontSelected: handleSetLibraryFontSelected }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Flex, { justify: "flex-start", - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalNavigatorBackButton, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Navigator.BackButton, { icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_right : chevron_left, size: "small", onClick: () => { @@ -14583,7 +14751,7 @@ function ConfirmDeleteDialog({ uninstallFontFamily, handleSetLibraryFontSelected }) { - const navigator = (0,external_wp_components_namespaceObject.__experimentalUseNavigator)(); + const navigator = (0,external_wp_components_namespaceObject.useNavigator)(); const handleConfirmUninstall = async () => { setNotice(null); setIsOpen(false); @@ -14612,13 +14780,44 @@ function ConfirmDeleteDialog({ onCancel: handleCancelUninstall, onConfirm: handleConfirmUninstall, size: "medium", - children: font && (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: Name of the font. */ + children: font && (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: Name of the font. */ (0,external_wp_i18n_namespaceObject.__)('Are you sure you want to delete "%s" font and all its variants and assets?'), font.name) }); } /* harmony default export */ const installed_fonts = (InstalledFonts); +;// ./node_modules/@wordpress/icons/build-module/library/next.js +/** + * WordPress dependencies + */ + + +const next = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "M6.6 6L5.4 7l4.5 5-4.5 5 1.1 1 5.5-6-5.4-6zm6 0l-1.1 1 4.5 5-4.5 5 1.1 1 5.5-6-5.5-6z" + }) +}); +/* harmony default export */ const library_next = (next); + +;// ./node_modules/@wordpress/icons/build-module/library/previous.js +/** + * WordPress dependencies + */ + + +const previous = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "M11.6 7l-1.1-1L5 12l5.5 6 1.1-1L7 12l4.6-5zm6 0l-1.1-1-5.5 6 5.5 6 1.1-1-4.6-5 4.6-5z" + }) +}); +/* harmony default export */ const library_previous = (previous); + ;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-library-modal/utils/filter-fonts.js +/* wp:polyfill */ /** * Filters a list of fonts based on the specified filters. * @@ -14650,6 +14849,7 @@ function filterFonts(fonts, filters) { } ;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-library-modal/utils/fonts-outline.js +/* wp:polyfill */ function getFontsOutline(fonts) { return fonts.reduce((acc, font) => ({ ...acc, @@ -14673,7 +14873,6 @@ function isFontFontFaceInOutline(slug, face, outline) { - function GoogleFontsConfirmDialog() { const handleConfirm = () => { // eslint-disable-next-line no-undef @@ -14724,7 +14923,6 @@ function GoogleFontsConfirmDialog() { - const { kebabCase: collection_font_variant_kebabCase } = unlock(external_wp_components_namespaceObject.privateApis); @@ -14768,6 +14966,7 @@ function CollectionFontVariant({ /* harmony default export */ const collection_font_variant = (CollectionFontVariant); ;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-library-modal/font-collection.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -14790,8 +14989,6 @@ function CollectionFontVariant({ - - const DEFAULT_CATEGORY = { slug: 'all', name: (0,external_wp_i18n_namespaceObject._x)('All', 'font categories') @@ -14983,10 +15180,10 @@ function FontCollection({ className: "font-library-modal__loading", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ProgressBar, {}) }), !isLoading && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalNavigatorProvider, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Navigator, { initialPath: "/", className: "font-library-modal__tabpanel-layout", - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalNavigatorScreen, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Navigator.Screen, { path: "/", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "space-between", @@ -15046,11 +15243,11 @@ function FontCollection({ }, font.font_family_settings.slug)) }) })] - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalNavigatorScreen, { + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Navigator.Screen, { path: "/fontFamily", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Flex, { justify: "flex-start", - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalNavigatorBackButton, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Navigator.BackButton, { icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_right : chevron_left, size: "small", onClick: () => { @@ -15121,27 +15318,22 @@ function FontCollection({ children: (0,external_wp_i18n_namespaceObject.__)('Install') }) }), !selectedFont && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { - spacing: 4, - justify: "center", + expanded: false, className: "font-library-modal__footer", - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - label: (0,external_wp_i18n_namespaceObject.__)('Previous page'), - size: "compact", - onClick: () => setPage(page - 1), - disabled: page === 1, - showTooltip: true, - accessibleWhenDisabled: true, - icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_right : chevron_left, - tooltipPosition: "top" - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHStack, { + justify: "end", + spacing: 6, + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "flex-start", expanded: false, - spacing: 2, + spacing: 1, className: "font-library-modal__page-selection", children: (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)( - // translators: %s: Total number of pages. - (0,external_wp_i18n_namespaceObject._x)('Page of %s', 'paging'), totalPages), { - CurrentPageControl: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { + // translators: 1: Current page number, 2: Total number of pages. + (0,external_wp_i18n_namespaceObject._x)('
    Page
    %1$s
    of %2$s
    ', 'paging'), '', totalPages), { + div: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + "aria-hidden": true + }), + CurrentPage: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { "aria-label": (0,external_wp_i18n_namespaceObject.__)('Current page'), value: page, options: [...Array(totalPages)].map((e, i) => { @@ -15151,18 +15343,33 @@ function FontCollection({ }; }), onChange: newPage => setPage(parseInt(newPage)), - size: "compact", - __nextHasNoMarginBottom: true + size: "small", + __nextHasNoMarginBottom: true, + variant: "minimal" }) }) - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - label: (0,external_wp_i18n_namespaceObject.__)('Next page'), - size: "compact", - onClick: () => setPage(page + 1), - disabled: page === totalPages, - accessibleWhenDisabled: true, - icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_left : chevron_right, - tooltipPosition: "top" + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { + expanded: false, + spacing: 1, + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + onClick: () => setPage(page - 1), + disabled: page === 1, + accessibleWhenDisabled: true, + label: (0,external_wp_i18n_namespaceObject.__)('Previous page'), + icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? library_next : library_previous, + showTooltip: true, + size: "compact", + tooltipPosition: "top" + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + onClick: () => setPage(page + 1), + disabled: page === totalPages, + accessibleWhenDisabled: true, + label: (0,external_wp_i18n_namespaceObject.__)('Next page'), + icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? library_previous : library_next, + showTooltip: true, + size: "compact", + tooltipPosition: "top" + })] })] })] })] @@ -19040,6 +19247,7 @@ var vmtx$1 = Object.freeze( { __proto__: null, vmtx: vmtx } ); /* eslint-enable */ ;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-library-modal/utils/make-families-from-faces.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -19069,6 +19277,7 @@ function makeFamiliesFromFaces(fontFaces) { } ;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-library-modal/upload-fonts.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -19085,7 +19294,6 @@ function makeFamiliesFromFaces(fontFaces) { - function UploadFonts() { const { installFonts @@ -19280,6 +19488,7 @@ function UploadFonts() { /* harmony default export */ const upload_fonts = (UploadFonts); ;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-library-modal/index.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -19298,7 +19507,6 @@ function UploadFonts() { - const { Tabs } = unlock(external_wp_components_namespaceObject.privateApis); @@ -19308,7 +19516,7 @@ const DEFAULT_TAB = { }; const UPLOAD_TAB = { id: 'upload-fonts', - title: (0,external_wp_i18n_namespaceObject.__)('Upload') + title: (0,external_wp_i18n_namespaceObject._x)('Upload', 'noun') }; const tabsFromCollections = collections => collections.map(({ slug, @@ -19343,7 +19551,7 @@ function FontLibraryModal({ children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(Tabs, { defaultTabId: defaultTabId, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { - className: "font-library-modal__tablist", + className: "font-library-modal__tablist-container", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tabs.TabList, { children: tabs.map(({ id, @@ -19394,7 +19602,6 @@ function FontLibraryModal({ - function FontFamilyItem({ font }) { @@ -19417,7 +19624,7 @@ function FontFamilyItem({ children: font.name }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { className: "edit-site-global-styles-screen-typography__font-variants-count", - children: (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %d: Number of font variants. */ + children: (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %d: Number of font variants. */ (0,external_wp_i18n_namespaceObject._n)('%d variant', '%d variants', variantsCount), variantsCount) })] }) @@ -19426,6 +19633,7 @@ function FontFamilyItem({ /* harmony default export */ const font_family_item = (FontFamilyItem); ;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-families.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -19445,8 +19653,6 @@ function FontFamilyItem({ - - const { useGlobalSetting: font_families_useGlobalSetting } = unlock(external_wp_blockEditor_namespaceObject.privateApis); @@ -19545,8 +19751,6 @@ function FontFamilies() { - - function ScreenTypography() { const fontLibraryEnabled = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_editor_namespaceObject.store).getEditorSettings().fontLibraryEnabled, []); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { @@ -19680,8 +19884,6 @@ function TypographyPreview({ - - const screen_typography_element_elements = { text: { description: (0,external_wp_i18n_namespaceObject.__)('Manage the fonts used on the site.'), @@ -19839,7 +20041,7 @@ function ConfirmDeleteFontSizeDialog({ onCancel: handleCancel, onConfirm: handleConfirm, size: "medium", - children: fontSize && (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: Name of the font size preset. */ + children: fontSize && (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: Name of the font size preset. */ (0,external_wp_i18n_namespaceObject.__)('Are you sure you want to delete "%s" font size preset?'), fontSize.name) }); } @@ -19853,7 +20055,6 @@ function ConfirmDeleteFontSizeDialog({ - function RenameFontSizeDialog({ fontSize, toggleOpen, @@ -19917,7 +20118,6 @@ function RenameFontSizeDialog({ */ - const DEFAULT_UNITS = ['px', 'em', 'rem', 'vw', 'vh']; function SizeControl({ // Do not allow manipulation of margin bottom @@ -19993,6 +20193,7 @@ function SizeControl({ /* harmony default export */ const size_control = (SizeControl); ;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-sizes/font-size.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -20012,10 +20213,8 @@ function SizeControl({ - - const { - DropdownMenuV2 + Menu } = unlock(external_wp_components_namespaceObject.privateApis); const { useGlobalSetting: font_size_useGlobalSetting @@ -20029,8 +20228,8 @@ function FontSize() { origin, slug }, - goTo - } = (0,external_wp_components_namespaceObject.__experimentalUseNavigator)(); + goBack + } = (0,external_wp_components_namespaceObject.useNavigator)(); const [fontSizes, setFontSizes] = font_size_useGlobalSetting('typography.fontSizes'); const [globalFluid] = font_size_useGlobalSetting('typography.fluid'); @@ -20040,6 +20239,16 @@ function FontSize() { // Get the font size by slug. const fontSize = sizes.find(size => size.slug === slug); + // Navigate to the font sizes list if the font size is not available. + (0,external_wp_element_namespaceObject.useEffect)(() => { + if (!!slug && !fontSize) { + goBack(); + } + }, [slug, fontSize, goBack]); + if (!origin || !slug || !fontSize) { + return null; + } + // Whether the font size is fluid. If not defined, use the global fluid value of the theme. const isFluid = fontSize?.fluid !== undefined ? !!fontSize.fluid : !!globalFluid; @@ -20106,20 +20315,6 @@ function FontSize() { const toggleRenameDialog = () => { setIsRenameDialogOpen(!isRenameDialogOpen); }; - - // Navigate to the font sizes list if the font size is not available. - (0,external_wp_element_namespaceObject.useEffect)(() => { - if (!fontSize) { - goTo('/typography/font-sizes/', { - isBack: true - }); - } - }, [fontSize, goTo]); - - // Avoid rendering if the font size is not available. - if (!fontSize) { - return null; - } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(confirm_delete_font_size_dialog, { fontSize: fontSize, @@ -20137,30 +20332,32 @@ function FontSize() { align: "flex-start", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(header, { title: fontSize.name, - description: (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: font size preset name. */ - (0,external_wp_i18n_namespaceObject.__)('Manage the font size %s.'), fontSize.name), - onBack: () => goTo('/typography/font-sizes/') + description: (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: font size preset name. */ + (0,external_wp_i18n_namespaceObject.__)('Manage the font size %s.'), fontSize.name) }), origin === 'custom' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalSpacer, { marginTop: 3, marginBottom: 0, paddingX: 4, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(DropdownMenuV2, { - trigger: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - size: "small", - icon: more_vertical, - label: (0,external_wp_i18n_namespaceObject.__)('Font size options') - }), - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DropdownMenuV2.Item, { - onClick: toggleRenameDialog, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DropdownMenuV2.ItemLabel, { - children: (0,external_wp_i18n_namespaceObject.__)('Rename') - }) - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DropdownMenuV2.Item, { - onClick: toggleDeleteConfirm, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DropdownMenuV2.ItemLabel, { - children: (0,external_wp_i18n_namespaceObject.__)('Delete') + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(Menu, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Menu.TriggerButton, { + render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + size: "small", + icon: more_vertical, + label: (0,external_wp_i18n_namespaceObject.__)('Font size options') }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(Menu.Popover, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Menu.Item, { + onClick: toggleRenameDialog, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Menu.ItemLabel, { + children: (0,external_wp_i18n_namespaceObject.__)('Rename') + }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Menu.Item, { + onClick: toggleDeleteConfirm, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Menu.ItemLabel, { + children: (0,external_wp_i18n_namespaceObject.__)('Delete') + }) + })] })] }) }) @@ -20168,6 +20365,8 @@ function FontSize() { }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalView, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalSpacer, { paddingX: 4, + marginBottom: 0, + paddingBottom: 6, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 4, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { @@ -20259,6 +20458,7 @@ function ConfirmResetFontSizesDialog({ /* harmony default export */ const confirm_reset_font_sizes_dialog = (ConfirmResetFontSizesDialog); ;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-sizes/font-sizes.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -20272,20 +20472,18 @@ function ConfirmResetFontSizesDialog({ * Internal dependencies */ + + + + + + const { - DropdownMenuV2: font_sizes_DropdownMenuV2 + Menu: font_sizes_Menu } = unlock(external_wp_components_namespaceObject.privateApis); const { useGlobalSetting: font_sizes_useGlobalSetting } = unlock(external_wp_blockEditor_namespaceObject.privateApis); - - - - - - - - function FontSizeGroup({ label, origin, @@ -20317,18 +20515,21 @@ function FontSizeGroup({ icon: library_plus, size: "small", onClick: handleAddFontSize - }), !!handleResetFontSizes && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(font_sizes_DropdownMenuV2, { - trigger: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - size: "small", - icon: more_vertical, - label: (0,external_wp_i18n_namespaceObject.__)('Font size presets options') - }), - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(font_sizes_DropdownMenuV2.Item, { - onClick: toggleResetDialog, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(font_sizes_DropdownMenuV2.ItemLabel, { - children: origin === 'custom' ? (0,external_wp_i18n_namespaceObject.__)('Remove font size presets') : (0,external_wp_i18n_namespaceObject.__)('Reset font size presets') + }), !!handleResetFontSizes && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(font_sizes_Menu, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(font_sizes_Menu.TriggerButton, { + render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + size: "small", + icon: more_vertical, + label: (0,external_wp_i18n_namespaceObject.__)('Font size presets options') }) - }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(font_sizes_Menu.Popover, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(font_sizes_Menu.Item, { + onClick: toggleResetDialog, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(font_sizes_Menu.ItemLabel, { + children: origin === 'custom' ? (0,external_wp_i18n_namespaceObject.__)('Remove font size presets') : (0,external_wp_i18n_namespaceObject.__)('Reset font size presets') + }) + }) + })] })] })] }), !!sizes.length && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalItemGroup, { @@ -20337,19 +20538,13 @@ function FontSizeGroup({ children: sizes.map(size => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationButtonAsItem, { path: `/typography/font-sizes/${origin}/${size.slug}`, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { - direction: "row", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { className: "edit-site-font-size__item", children: size.name }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { - justify: "flex-end", - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexBlock, { - className: "edit-site-font-size__item edit-site-font-size__item-value", - children: size.size - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, { - icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_left : chevron_right - })] + display: "flex", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, { + icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_left : chevron_right }) })] }) @@ -20452,6 +20647,7 @@ function ColorIndicatorWrapper({ /* harmony default export */ const color_indicator_wrapper = (ColorIndicatorWrapper); ;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/palette.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -20470,7 +20666,6 @@ function ColorIndicatorWrapper({ - const { useGlobalSetting: palette_useGlobalSetting } = unlock(external_wp_blockEditor_namespaceObject.privateApis); @@ -20485,7 +20680,6 @@ function Palette({ const [randomizeThemeColors] = useColorRandomizer(); const colors = (0,external_wp_element_namespaceObject.useMemo)(() => [...(customColors || EMPTY_COLORS), ...(themeColors || EMPTY_COLORS), ...(defaultColors && defaultPaletteEnabled ? defaultColors : EMPTY_COLORS)], [customColors, themeColors, defaultColors, defaultPaletteEnabled]); const screenPath = !name ? '/colors/palette' : '/blocks/' + encodeURIComponent(name) + '/colors/palette'; - const paletteButtonText = colors.length > 0 ? (0,external_wp_i18n_namespaceObject.__)('Edit palette') : (0,external_wp_i18n_namespaceObject.__)('Add colors'); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 3, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(subtitle, { @@ -20496,21 +20690,25 @@ function Palette({ isSeparated: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationButtonAsItem, { path: screenPath, - "aria-label": paletteButtonText, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { direction: "row", - children: [colors.length <= 0 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { + children: [colors.length > 0 ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalZStack, { + isLayered: false, + offset: -8, + children: colors.slice(0, 5).map(({ + color + }, index) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(color_indicator_wrapper, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ColorIndicator, { + colorValue: color + }) + }, `${color}-${index}`)) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { + isBlock: true, + children: (0,external_wp_i18n_namespaceObject.__)('Edit palette') + })] + }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { children: (0,external_wp_i18n_namespaceObject.__)('Add colors') - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalZStack, { - isLayered: false, - offset: -8, - children: colors.slice(0, 5).map(({ - color - }, index) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(color_indicator_wrapper, { - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ColorIndicator, { - colorValue: color - }) - }, `${color}-${index}`)) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, { icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_left : chevron_right })] @@ -20542,8 +20740,6 @@ function Palette({ - - const { useGlobalStyle: screen_colors_useGlobalStyle, useGlobalSetting: screen_colors_useGlobalSetting, @@ -20580,6 +20776,7 @@ function ScreenColors() { /* harmony default export */ const screen_colors = (ScreenColors); ;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/preset-colors.js +/* wp:polyfill */ /** * Internal dependencies */ @@ -20628,7 +20825,7 @@ const StylesPreviewColors = ({ isFocused, withHoverView }) => { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreviewIframe, { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreviewWrapper, { label: label, isFocused: isFocused, withHoverView: withHoverView, @@ -20655,6 +20852,7 @@ const StylesPreviewColors = ({ /* harmony default export */ const preview_colors = (StylesPreviewColors); ;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/variations/variations-color.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -20668,7 +20866,6 @@ const StylesPreviewColors = ({ - function ColorVariations({ title, gap = 2 @@ -20713,7 +20910,6 @@ function ColorVariations({ - const { useGlobalSetting: color_palette_panel_useGlobalSetting } = unlock(external_wp_blockEditor_namespaceObject.privateApis); @@ -20779,7 +20975,6 @@ function ColorPalettePanel({ - const { useGlobalSetting: gradients_palette_panel_useGlobalSetting } = unlock(external_wp_blockEditor_namespaceObject.privateApis); @@ -20862,8 +21057,6 @@ function GradientPalettePanel({ - - const { Tabs: screen_color_palette_Tabs } = unlock(external_wp_components_namespaceObject.privateApis); @@ -20965,8 +21158,6 @@ function BackgroundPanel() { - - const { useHasBackgroundPanel: screen_background_useHasBackgroundPanel, useGlobalSetting: screen_background_useGlobalSetting @@ -20985,7 +21176,41 @@ function ScreenBackground() { } /* harmony default export */ const screen_background = (ScreenBackground); +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/confirm-reset-shadow-dialog.js +/** + * WordPress dependencies + */ + + + +function ConfirmResetShadowDialog({ + text, + confirmButtonText, + isOpen, + toggleOpen, + onConfirm +}) { + const handleConfirm = async () => { + toggleOpen(); + onConfirm(); + }; + const handleCancel = () => { + toggleOpen(); + }; + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalConfirmDialog, { + isOpen: isOpen, + cancelButtonText: (0,external_wp_i18n_namespaceObject.__)('Cancel'), + confirmButtonText: confirmButtonText, + onCancel: handleCancel, + onConfirm: handleConfirm, + size: "medium", + children: text + }); +} +/* harmony default export */ const confirm_reset_shadow_dialog = (ConfirmResetShadowDialog); + ;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/shadows-panel.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -21008,6 +21233,9 @@ function ScreenBackground() { const { useGlobalSetting: shadows_panel_useGlobalSetting } = unlock(external_wp_blockEditor_namespaceObject.privateApis); +const { + Menu: shadows_panel_Menu +} = unlock(external_wp_components_namespaceObject.privateApis); const defaultShadow = '6px 6px 9px rgba(0, 0, 0, 0.2)'; function ShadowsPanel() { const [defaultShadows] = shadows_panel_useGlobalSetting('shadow.presets.default'); @@ -21017,8 +21245,19 @@ function ShadowsPanel() { const onCreateShadow = shadow => { setCustomShadows([...(customShadows || []), shadow]); }; + const handleResetShadows = () => { + setCustomShadows([]); + }; + const [isResetDialogOpen, setIsResetDialogOpen] = (0,external_wp_element_namespaceObject.useState)(false); + const toggleResetDialog = () => setIsResetDialogOpen(!isResetDialogOpen); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(header, { + children: [isResetDialogOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(confirm_reset_shadow_dialog, { + text: (0,external_wp_i18n_namespaceObject.__)('Are you sure you want to remove all custom shadows?'), + confirmButtonText: (0,external_wp_i18n_namespaceObject.__)('Remove'), + isOpen: isResetDialogOpen, + toggleOpen: toggleResetDialog, + onConfirm: handleResetShadows + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(header, { title: (0,external_wp_i18n_namespaceObject.__)('Shadows'), description: (0,external_wp_i18n_namespaceObject.__)('Manage and create shadow styles for use across the site.') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { @@ -21039,7 +21278,8 @@ function ShadowsPanel() { shadows: customShadows || [], category: "custom", canCreate: true, - onCreate: onCreateShadow + onCreate: onCreateShadow, + onReset: toggleResetDialog })] }) })] @@ -21050,12 +21290,13 @@ function ShadowList({ shadows, category, canCreate, - onCreate + onCreate, + onReset }) { const handleAddShadow = () => { const newIndex = getNewIndexFromPresets(shadows, 'shadow-'); onCreate({ - name: (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: is an index for a preset */ + name: (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: is an index for a preset */ (0,external_wp_i18n_namespaceObject.__)('Shadow %s'), newIndex), shadow: defaultShadow, slug: `shadow-${newIndex}` @@ -21082,6 +21323,21 @@ function ShadowList({ handleAddShadow(); } }) + }), !!shadows?.length && category === 'custom' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(shadows_panel_Menu, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(shadows_panel_Menu.TriggerButton, { + render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + size: "small", + icon: more_vertical, + label: (0,external_wp_i18n_namespaceObject.__)('Shadow options') + }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(shadows_panel_Menu.Popover, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(shadows_panel_Menu.Item, { + onClick: onReset, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(shadows_panel_Menu.ItemLabel, { + children: (0,external_wp_i18n_namespaceObject.__)('Remove all custom shadows') + }) + }) + })] })] }), shadows.length > 0 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalItemGroup, { isBordered: true, @@ -21099,11 +21355,13 @@ function ShadowItem({ }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationButtonAsItem, { path: `/shadows/edit/${category}/${shadow.slug}`, - "aria-label": - // translators: %s: name of the shadow - (0,external_wp_i18n_namespaceObject.sprintf)('Edit shadow %s', shadow.name), - icon: library_shadow, - children: shadow.name + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { + children: shadow.name + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, { + icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_left : chevron_right + })] + }) }); } @@ -21123,6 +21381,7 @@ const reset_reset = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx /* harmony default export */ const library_reset = (reset_reset); ;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/shadow-utils.js +/* wp:polyfill */ const CUSTOM_VALUE_SETTINGS = { px: { max: 20, @@ -21345,6 +21604,7 @@ function shadowObjectToString(shadowObj) { } ;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/shadows-edit-panel.js +/* wp:polyfill */ /** * External dependencies */ @@ -21368,13 +21628,11 @@ function shadowObjectToString(shadowObj) { - - const { useGlobalSetting: shadows_edit_panel_useGlobalSetting } = unlock(external_wp_blockEditor_namespaceObject.privateApis); const { - DropdownMenuV2: shadows_edit_panel_DropdownMenuV2 + Menu: shadows_edit_panel_Menu } = unlock(external_wp_components_namespaceObject.privateApis); const customShadowMenuItems = [{ label: (0,external_wp_i18n_namespaceObject.__)('Rename'), @@ -21394,7 +21652,7 @@ function ShadowsEditPanel() { category, slug } - } = (0,external_wp_components_namespaceObject.__experimentalUseNavigator)(); + } = (0,external_wp_components_namespaceObject.useNavigator)(); const [shadows, setShadows] = shadows_edit_panel_useGlobalSetting(`shadow.presets.${category}`); (0,external_wp_element_namespaceObject.useEffect)(() => { const hasCurrentShadow = shadows?.some(shadow => shadow.slug === slug); @@ -21416,6 +21674,9 @@ function ShadowsEditPanel() { const [isConfirmDialogVisible, setIsConfirmDialogVisible] = (0,external_wp_element_namespaceObject.useState)(false); const [isRenameModalVisible, setIsRenameModalVisible] = (0,external_wp_element_namespaceObject.useState)(false); const [shadowName, setShadowName] = (0,external_wp_element_namespaceObject.useState)(selectedShadow.name); + if (!category || !slug) { + return null; + } const onShadowChange = shadow => { setSelectedShadow({ ...selectedShadow, @@ -21467,19 +21728,22 @@ function ShadowsEditPanel() { marginTop: 2, marginBottom: 0, paddingX: 4, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(shadows_edit_panel_DropdownMenuV2, { - trigger: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - size: "small", - icon: more_vertical, - label: (0,external_wp_i18n_namespaceObject.__)('Menu') - }), - children: (category === 'custom' ? customShadowMenuItems : presetShadowMenuItems).map(item => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(shadows_edit_panel_DropdownMenuV2.Item, { - onClick: () => onMenuClick(item.action), - disabled: item.action === 'reset' && selectedShadow.shadow === baseSelectedShadow.shadow, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(shadows_edit_panel_DropdownMenuV2.ItemLabel, { - children: item.label + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(shadows_edit_panel_Menu, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(shadows_edit_panel_Menu.TriggerButton, { + render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + size: "small", + icon: more_vertical, + label: (0,external_wp_i18n_namespaceObject.__)('Menu') }) - }, item.action)) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(shadows_edit_panel_Menu.Popover, { + children: (category === 'custom' ? customShadowMenuItems : presetShadowMenuItems).map(item => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(shadows_edit_panel_Menu.Item, { + onClick: () => onMenuClick(item.action), + disabled: item.action === 'reset' && selectedShadow.shadow === baseSelectedShadow.shadow, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(shadows_edit_panel_Menu.ItemLabel, { + children: item.label + }) + }, item.action)) + })] }) }) })] @@ -21502,9 +21766,8 @@ function ShadowsEditPanel() { }, confirmButtonText: (0,external_wp_i18n_namespaceObject.__)('Delete'), size: "medium", - children: (0,external_wp_i18n_namespaceObject.sprintf)( - // translators: %s: name of the shadow - 'Are you sure you want to delete "%s"?', selectedShadow.name) + children: (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: Name of the shadow preset. */ + (0,external_wp_i18n_namespaceObject.__)('Are you sure you want to delete "%s" shadow preset?'), selectedShadow.name) }), isRenameModalVisible && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Modal, { title: (0,external_wp_i18n_namespaceObject.__)('Rename'), onRequestClose: () => setIsRenameModalVisible(false), @@ -21572,18 +21835,19 @@ function ShadowEditor({ shadow, onChange }) { + const addShadowButtonRef = (0,external_wp_element_namespaceObject.useRef)(); const shadowParts = (0,external_wp_element_namespaceObject.useMemo)(() => getShadowParts(shadow), [shadow]); const onChangeShadowPart = (index, part) => { - shadowParts[index] = part; - onChange(shadowParts.join(', ')); + const newShadowParts = [...shadowParts]; + newShadowParts[index] = part; + onChange(newShadowParts.join(', ')); }; const onAddShadowPart = () => { - shadowParts.push(defaultShadow); - onChange(shadowParts.join(', ')); + onChange([...shadowParts, defaultShadow].join(', ')); }; const onRemoveShadowPart = index => { - shadowParts.splice(index, 1); - onChange(shadowParts.join(', ')); + onChange(shadowParts.filter((p, i) => i !== index).join(', ')); + addShadowButtonRef.current.focus(); }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalVStack, { @@ -21605,7 +21869,8 @@ function ShadowEditor({ label: (0,external_wp_i18n_namespaceObject.__)('Add shadow'), onClick: () => { onAddShadowPart(); - } + }, + ref: addShadowButtonRef }) })] }) @@ -21651,32 +21916,27 @@ function shadows_edit_panel_ShadowItem({ 'aria-expanded': isOpen }; const removeButtonProps = { - onClick: onRemove, + onClick: () => { + if (isOpen) { + onToggle(); + } + onRemove(); + }, className: dist_clsx('edit-site-global-styles__shadow-editor__remove-button', { 'is-open': isOpen }), label: (0,external_wp_i18n_namespaceObject.__)('Remove shadow') }; - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { - align: "center", - justify: "flex-start", - spacing: 0, - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { - style: { - flexGrow: 1 - }, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - __next40pxDefaultSize: true, - icon: library_shadow, - ...toggleProps, - children: shadowObj.inset ? (0,external_wp_i18n_namespaceObject.__)('Inner shadow') : (0,external_wp_i18n_namespaceObject.__)('Drop shadow') - }) - }), canRemove && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - __next40pxDefaultSize: true, - icon: library_reset, - ...removeButtonProps - }) + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + __next40pxDefaultSize: true, + icon: library_shadow, + ...toggleProps, + children: shadowObj.inset ? (0,external_wp_i18n_namespaceObject.__)('Inner shadow') : (0,external_wp_i18n_namespaceObject.__)('Drop shadow') + }), canRemove && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + size: "small", + icon: library_reset, + ...removeButtonProps })] }); }, @@ -21876,8 +22136,6 @@ function DimensionsPanel() { - - const { useHasDimensionsPanel: screen_layout_useHasDimensionsPanel, useGlobalSetting: screen_layout_useGlobalSetting, @@ -21896,6 +22154,7 @@ function ScreenLayout() { /* harmony default export */ const screen_layout = (ScreenLayout); ;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/style-variations-container.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -21923,11 +22182,7 @@ function StyleVariationsContainer({ const { user } = (0,external_wp_element_namespaceObject.useContext)(style_variations_container_GlobalStylesContext); - const [currentUserStyles, setCurrentUserStyles] = (0,external_wp_element_namespaceObject.useState)(user); - const userStyles = currentUserStyles?.styles; - (0,external_wp_element_namespaceObject.useEffect)(() => { - setCurrentUserStyles(user); - }, [user]); + const userStyles = user?.styles; const variations = (0,external_wp_data_namespaceObject.useSelect)(select => { return select(external_wp_coreData_namespaceObject.store).__experimentalGetCurrentThemeGlobalStylesVariations(); }, []); @@ -22011,8 +22266,6 @@ function StyleVariationsContainer({ - - /** * Internal dependencies */ @@ -22020,45 +22273,20 @@ function StyleVariationsContainer({ - - - -const content_noop = () => {}; function SidebarNavigationScreenGlobalStylesContent() { - const { - storedSettings - } = (0,external_wp_data_namespaceObject.useSelect)(select => { - const { - getSettings - } = unlock(select(store)); - return { - storedSettings: getSettings() - }; - }, []); const gap = 3; - - // Wrap in a BlockEditorProvider to ensure that the Iframe's dependencies are - // loaded. This is necessary because the Iframe component waits until - // the block editor store's `__internalIsInitialized` is true before - // rendering the iframe. Without this, the iframe previews will not render - // in mobile viewport sizes, where the editor canvas is hidden. - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockEditorProvider, { - settings: storedSettings, - onChange: content_noop, - onInput: content_noop, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { - spacing: 10, - className: "edit-site-global-styles-variation-container", - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(StyleVariationsContainer, { - gap: gap - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ColorVariations, { - title: (0,external_wp_i18n_namespaceObject.__)('Palettes'), - gap: gap - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TypographyVariations, { - title: (0,external_wp_i18n_namespaceObject.__)('Typography'), - gap: gap - })] - }) + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { + spacing: 10, + className: "edit-site-global-styles-variation-container", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(StyleVariationsContainer, { + gap: gap + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ColorVariations, { + title: (0,external_wp_i18n_namespaceObject.__)('Palettes'), + gap: gap + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TypographyVariations, { + title: (0,external_wp_i18n_namespaceObject.__)('Typography'), + gap: gap + })] }); } @@ -22072,6 +22300,7 @@ function SidebarNavigationScreenGlobalStylesContent() { + /** * Internal dependencies */ @@ -22079,20 +22308,23 @@ function SidebarNavigationScreenGlobalStylesContent() { - - const { useZoomOut } = unlock(external_wp_blockEditor_namespaceObject.privateApis); function ScreenStyleVariations() { // Style Variations should only be previewed in with - // - a "zoomed out" editor + // - a "zoomed out" editor (but not when in preview mode) // - "Desktop" device preview + const isPreviewMode = (0,external_wp_data_namespaceObject.useSelect)(select => { + return select(external_wp_blockEditor_namespaceObject.store).getSettings().isPreviewMode; + }, []); const { setDeviceType } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_editor_namespaceObject.store); - useZoomOut(); - setDeviceType('desktop'); + useZoomOut(!isPreviewMode); + (0,external_wp_element_namespaceObject.useEffect)(() => { + setDeviceType('desktop'); + }, [setDeviceType]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(header, { title: (0,external_wp_i18n_namespaceObject.__)('Browse styles'), @@ -22109,33 +22341,255 @@ function ScreenStyleVariations() { } /* harmony default export */ const screen_style_variations = (ScreenStyleVariations); -;// ./node_modules/@wordpress/icons/build-module/library/close-small.js +;// external ["wp","mediaUtils"] +const external_wp_mediaUtils_namespaceObject = window["wp"]["mediaUtils"]; +;// ./node_modules/@wordpress/edit-site/build-module/components/style-book/constants.js /** * WordPress dependencies */ -const closeSmall = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.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" - }) -}); -/* harmony default export */ const close_small = (closeSmall); +/** + * Internal dependencies + */ -;// ./node_modules/@wordpress/edit-site/build-module/components/editor-canvas-container/index.js +const STYLE_BOOK_COLOR_GROUPS = [{ + slug: 'theme-colors', + title: (0,external_wp_i18n_namespaceObject.__)('Theme Colors'), + origin: 'theme', + type: 'colors' +}, { + slug: 'theme-gradients', + title: (0,external_wp_i18n_namespaceObject.__)('Theme Gradients'), + origin: 'theme', + type: 'gradients' +}, { + slug: 'custom-colors', + title: (0,external_wp_i18n_namespaceObject.__)('Custom Colors'), + origin: 'custom', + type: 'colors' +}, { + slug: 'custom-gradients', + title: (0,external_wp_i18n_namespaceObject.__)('Custom Gradients'), + origin: 'custom', + // User. + type: 'gradients' +}, { + slug: 'duotones', + title: (0,external_wp_i18n_namespaceObject.__)('Duotones'), + origin: 'theme', + type: 'duotones' +}, { + slug: 'default-colors', + title: (0,external_wp_i18n_namespaceObject.__)('Default Colors'), + origin: 'default', + type: 'colors' +}, { + slug: 'default-gradients', + title: (0,external_wp_i18n_namespaceObject.__)('Default Gradients'), + origin: 'default', + type: 'gradients' +}]; +const STYLE_BOOK_THEME_SUBCATEGORIES = [{ + slug: 'site-identity', + title: (0,external_wp_i18n_namespaceObject.__)('Site Identity'), + blocks: ['core/site-logo', 'core/site-title', 'core/site-tagline'] +}, { + slug: 'design', + title: (0,external_wp_i18n_namespaceObject.__)('Design'), + blocks: ['core/navigation', 'core/avatar', 'core/post-time-to-read'], + exclude: ['core/home-link', 'core/navigation-link'] +}, { + slug: 'posts', + title: (0,external_wp_i18n_namespaceObject.__)('Posts'), + blocks: ['core/post-title', 'core/post-excerpt', 'core/post-author', 'core/post-author-name', 'core/post-author-biography', 'core/post-date', 'core/post-terms', 'core/term-description', 'core/query-title', 'core/query-no-results', 'core/query-pagination', 'core/query-numbers'] +}, { + slug: 'comments', + title: (0,external_wp_i18n_namespaceObject.__)('Comments'), + blocks: ['core/comments-title', 'core/comments-pagination', 'core/comments-pagination-numbers', 'core/comments', 'core/comments-author-name', 'core/comment-content', 'core/comment-date', 'core/comment-edit-link', 'core/comment-reply-link', 'core/comment-template', 'core/post-comments-count', 'core/post-comments-link'] +}]; +const STYLE_BOOK_CATEGORIES = [{ + slug: 'overview', + title: (0,external_wp_i18n_namespaceObject.__)('Overview'), + blocks: [] +}, { + slug: 'text', + title: (0,external_wp_i18n_namespaceObject.__)('Text'), + blocks: ['core/post-content', 'core/home-link', 'core/navigation-link'] +}, { + slug: 'colors', + title: (0,external_wp_i18n_namespaceObject.__)('Colors'), + blocks: [] +}, { + slug: 'theme', + title: (0,external_wp_i18n_namespaceObject.__)('Theme'), + subcategories: STYLE_BOOK_THEME_SUBCATEGORIES +}, { + slug: 'media', + title: (0,external_wp_i18n_namespaceObject.__)('Media'), + blocks: ['core/post-featured-image'] +}, { + slug: 'widgets', + title: (0,external_wp_i18n_namespaceObject.__)('Widgets'), + blocks: [] +}, { + slug: 'embed', + title: (0,external_wp_i18n_namespaceObject.__)('Embeds'), + include: [] +}]; + +// Style book preview subcategories for all blocks section. +const STYLE_BOOK_ALL_BLOCKS_SUBCATEGORIES = [...STYLE_BOOK_THEME_SUBCATEGORIES, { + slug: 'media', + title: (0,external_wp_i18n_namespaceObject.__)('Media'), + blocks: ['core/post-featured-image'] +}, { + slug: 'widgets', + title: (0,external_wp_i18n_namespaceObject.__)('Widgets'), + blocks: [] +}, { + slug: 'embed', + title: (0,external_wp_i18n_namespaceObject.__)('Embeds'), + include: [] +}]; + +// Style book preview categories are organized slightly differently to the editor ones. +const STYLE_BOOK_PREVIEW_CATEGORIES = [{ + slug: 'overview', + title: (0,external_wp_i18n_namespaceObject.__)('Overview'), + blocks: [] +}, { + slug: 'text', + title: (0,external_wp_i18n_namespaceObject.__)('Text'), + blocks: ['core/post-content', 'core/home-link', 'core/navigation-link'] +}, { + slug: 'colors', + title: (0,external_wp_i18n_namespaceObject.__)('Colors'), + blocks: [] +}, { + slug: 'blocks', + title: (0,external_wp_i18n_namespaceObject.__)('All Blocks'), + blocks: [], + subcategories: STYLE_BOOK_ALL_BLOCKS_SUBCATEGORIES +}]; + +// Forming a "block formatting context" to prevent margin collapsing. +// @see https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context +const ROOT_CONTAINER = ` + .is-root-container { + display: flow-root; + } +`; +// The content area of the Style Book is rendered within an iframe so that global styles +// are applied to elements within the entire content area. To support elements that are +// not part of the block previews, such as headings and layout for the block previews, +// additional CSS rules need to be passed into the iframe. These are hard-coded below. +// Note that button styles are unset, and then focus rules from the `Button` component are +// applied to the `button` element, targeted via `.edit-site-style-book__example`. +// This is to ensure that browser default styles for buttons are not applied to the previews. +const STYLE_BOOK_IFRAME_STYLES = ` + body { + position: relative; + padding: 32px !important; + } + + ${ROOT_CONTAINER} + + .edit-site-style-book__examples { + max-width: 1200px; + margin: 0 auto; + } + + .edit-site-style-book__example { + max-width: 900px; + border-radius: 2px; + cursor: pointer; + display: flex; + flex-direction: column; + gap: 40px; + padding: 16px; + width: 100%; + box-sizing: border-box; + scroll-margin-top: 32px; + scroll-margin-bottom: 32px; + margin: 0 auto 40px auto; + } + + .edit-site-style-book__example.is-selected { + box-shadow: 0 0 0 1px var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba)); + } + + .edit-site-style-book__example.is-disabled-example { + pointer-events: none; + } + + .edit-site-style-book__example:focus:not(:disabled) { + box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba)); + outline: 3px solid transparent; + } + + .edit-site-style-book__duotone-example > div:first-child { + display: flex; + aspect-ratio: 16 / 9; + grid-row: span 1; + grid-column: span 2; + } + .edit-site-style-book__duotone-example img { + width: 100%; + height: 100%; + object-fit: cover; + } + .edit-site-style-book__duotone-example > div:not(:first-child) { + height: 20px; + border: 1px solid color-mix( in srgb, currentColor 10%, transparent ); + } + + .edit-site-style-book__color-example { + border: 1px solid color-mix( in srgb, currentColor 10%, transparent ); + } + + .edit-site-style-book__subcategory-title, + .edit-site-style-book__example-title { + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; + font-size: 13px; + font-weight: normal; + line-height: normal; + margin: 0; + text-align: left; + padding-top: 8px; + border-top: 1px solid color-mix( in srgb, currentColor 10%, transparent ); + color: color-mix( in srgb, currentColor 60%, transparent ); + } + + .edit-site-style-book__subcategory-title { + font-size: 16px; + margin-bottom: 40px; + padding-bottom: 8px; + } + + .edit-site-style-book__example-preview { + width: 100%; + } + + .edit-site-style-book__example-preview .block-editor-block-list__insertion-point, + .edit-site-style-book__example-preview .block-list-appender { + display: none; + } + :where(.is-root-container > .wp-block:first-child) { + margin-top: 0; + } + :where(.is-root-container > .wp-block:last-child) { + margin-bottom: 0; + } +`; + +;// ./node_modules/@wordpress/edit-site/build-module/components/style-book/categories.js +/* wp:polyfill */ /** * WordPress dependencies */ - - - - - - - - +// @wordpress/blocks imports are not typed. +// @ts-expect-error /** @@ -22144,110 +22598,66 @@ const closeSmall = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx) - -const { - EditorContentSlotFill, - ResizableEditor -} = unlock(external_wp_editor_namespaceObject.privateApis); +/** + * Returns category examples for a given category definition and list of examples. + * @param {StyleBookCategory} categoryDefinition The category definition. + * @param {BlockExample[]} examples An array of block examples. + * @return {CategoryExamples|undefined} An object containing the category examples. + */ +function getExamplesByCategory(categoryDefinition, examples) { + var _categoryDefinition$s; + if (!categoryDefinition?.slug || !examples?.length) { + return; + } + const categories = (_categoryDefinition$s = categoryDefinition?.subcategories) !== null && _categoryDefinition$s !== void 0 ? _categoryDefinition$s : []; + if (categories.length) { + return categories.reduce((acc, subcategoryDefinition) => { + const subcategoryExamples = getExamplesByCategory(subcategoryDefinition, examples); + if (subcategoryExamples) { + if (!acc.subcategories) { + acc.subcategories = []; + } + acc.subcategories = [...acc.subcategories, subcategoryExamples]; + } + return acc; + }, { + title: categoryDefinition.title, + slug: categoryDefinition.slug + }); + } + const blocksToInclude = categoryDefinition?.blocks || []; + const blocksToExclude = categoryDefinition?.exclude || []; + const categoryExamples = examples.filter(example => { + return !blocksToExclude.includes(example.name) && (example.category === categoryDefinition.slug || blocksToInclude.includes(example.name)); + }); + if (!categoryExamples.length) { + return; + } + return { + title: categoryDefinition.title, + slug: categoryDefinition.slug, + examples: categoryExamples + }; +} /** - * Returns a translated string for the title of the editor canvas container. + * Returns category examples for a given category definition and list of examples. * - * @param {string} view Editor canvas container view. - * - * @return {Object} Translated string for the view title and associated icon, both defaulting to ''. + * @return {StyleBookCategory[]} An array of top-level category definitions. */ -function getEditorCanvasContainerTitle(view) { - switch (view) { - case 'style-book': - return (0,external_wp_i18n_namespaceObject.__)('Style Book'); - case 'global-styles-revisions': - case 'global-styles-revisions:style-book': - return (0,external_wp_i18n_namespaceObject.__)('Style Revisions'); - default: - return ''; - } +function getTopLevelStyleBookCategories() { + const reservedCategories = [...STYLE_BOOK_THEME_SUBCATEGORIES, ...STYLE_BOOK_CATEGORIES].map(({ + slug + }) => slug); + const extraCategories = (0,external_wp_blocks_namespaceObject.getCategories)(); + const extraCategoriesFiltered = extraCategories.filter(({ + slug + }) => !reservedCategories.includes(slug)); + return [...STYLE_BOOK_CATEGORIES, ...extraCategoriesFiltered]; } -function EditorCanvasContainer({ - children, - closeButtonLabel, - onClose, - enableResizing = false -}) { - const { - editorCanvasContainerView, - showListViewByDefault - } = (0,external_wp_data_namespaceObject.useSelect)(select => { - const _editorCanvasContainerView = unlock(select(store)).getEditorCanvasContainerView(); - const _showListViewByDefault = select(external_wp_preferences_namespaceObject.store).get('core', 'showListViewByDefault'); - return { - editorCanvasContainerView: _editorCanvasContainerView, - showListViewByDefault: _showListViewByDefault - }; - }, []); - const [isClosed, setIsClosed] = (0,external_wp_element_namespaceObject.useState)(false); - const { - setEditorCanvasContainerView - } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store)); - const { - setIsListViewOpened - } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_editor_namespaceObject.store); - const focusOnMountRef = (0,external_wp_compose_namespaceObject.useFocusOnMount)('firstElement'); - const sectionFocusReturnRef = (0,external_wp_compose_namespaceObject.useFocusReturn)(); - function onCloseContainer() { - setIsListViewOpened(showListViewByDefault); - setEditorCanvasContainerView(undefined); - setIsClosed(true); - if (typeof onClose === 'function') { - onClose(); - } - } - function closeOnEscape(event) { - if (event.keyCode === external_wp_keycodes_namespaceObject.ESCAPE && !event.defaultPrevented) { - event.preventDefault(); - onCloseContainer(); - } - } - const childrenWithProps = Array.isArray(children) ? external_wp_element_namespaceObject.Children.map(children, (child, index) => index === 0 ? (0,external_wp_element_namespaceObject.cloneElement)(child, { - ref: sectionFocusReturnRef - }) : child) : (0,external_wp_element_namespaceObject.cloneElement)(children, { - ref: sectionFocusReturnRef - }); - if (isClosed) { - return null; - } - const title = getEditorCanvasContainerTitle(editorCanvasContainerView); - const shouldShowCloseButton = onClose || closeButtonLabel; - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditorContentSlotFill.Fill, { - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { - className: "edit-site-editor-canvas-container", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ResizableEditor, { - enableResizing: enableResizing, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("section", { - className: "edit-site-editor-canvas-container__section", - ref: shouldShowCloseButton ? focusOnMountRef : null, - onKeyDown: closeOnEscape, - "aria-label": title, - children: [shouldShowCloseButton && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - __next40pxDefaultSize: true, - className: "edit-site-editor-canvas-container__close-button", - icon: close_small, - label: closeButtonLabel || (0,external_wp_i18n_namespaceObject.__)('Close'), - onClick: onCloseContainer - }), childrenWithProps] - }) - }) - }) - }); -} -function useHasEditorCanvasContainer() { - const fills = (0,external_wp_components_namespaceObject.__experimentalUseSlotFills)(EditorContentSlotFill.privateKey); - return !!fills?.length; -} -/* harmony default export */ const editor_canvas_container = (EditorCanvasContainer); - -;// ./node_modules/@wordpress/edit-site/build-module/components/style-book/index.js +;// ./node_modules/@wordpress/edit-site/build-module/components/style-book/color-examples.js +/* wp:polyfill */ /** * External dependencies */ @@ -22260,9 +22670,92 @@ function useHasEditorCanvasContainer() { +/** + * Internal dependencies + */ + +const ColorExamples = ({ + colors, + type, + templateColumns = '1fr 1fr', + itemHeight = '52px' +}) => { + if (!colors) { + return null; + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalGrid, { + templateColumns: templateColumns, + rowGap: 8, + columnGap: 16, + children: colors.map(color => { + const className = type === 'gradients' ? (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(color.slug) : (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', color.slug); + const classes = dist_clsx('edit-site-style-book__color-example', className); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.View, { + className: classes, + style: { + height: itemHeight + } + }, color.slug); + }) + }); +}; +/* harmony default export */ const color_examples = (ColorExamples); + +;// ./node_modules/@wordpress/edit-site/build-module/components/style-book/duotone-examples.js +/* wp:polyfill */ +/** + * WordPress dependencies + */ +/** + * Internal dependencies + */ + +const DuotoneExamples = ({ + duotones +}) => { + if (!duotones) { + return null; + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalGrid, { + columns: 2, + rowGap: 16, + columnGap: 16, + children: duotones.map(duotone => { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalGrid, { + className: "edit-site-style-book__duotone-example", + columns: 2, + rowGap: 8, + columnGap: 8, + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.View, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { + alt: `Duotone example: ${duotone.slug}`, + src: "https://s.w.org/images/core/5.3/MtBlanc1.jpg", + style: { + filter: `url(#wp-duotone-${duotone.slug})` + } + }) + }), duotone.colors.map(color => { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.View, { + className: "edit-site-style-book__color-example", + style: { + backgroundColor: color + } + }, color); + })] + }, duotone.slug); + }) + }); +}; +/* harmony default export */ const duotone_examples = (DuotoneExamples); + +;// ./node_modules/@wordpress/edit-site/build-module/components/style-book/examples.js +/* wp:polyfill */ +/** + * WordPress dependencies + */ @@ -22273,106 +22766,173 @@ function useHasEditorCanvasContainer() { -const { - ExperimentalBlockEditorProvider, - useGlobalStyle: style_book_useGlobalStyle, - GlobalStylesContext: style_book_GlobalStylesContext, - useGlobalStylesOutputWithConfig -} = unlock(external_wp_blockEditor_namespaceObject.privateApis); -const { - mergeBaseAndUserConfigs: style_book_mergeBaseAndUserConfigs -} = unlock(external_wp_editor_namespaceObject.privateApis); -const { - Tabs: style_book_Tabs -} = unlock(external_wp_components_namespaceObject.privateApis); -// The content area of the Style Book is rendered within an iframe so that global styles -// are applied to elements within the entire content area. To support elements that are -// not part of the block previews, such as headings and layout for the block previews, -// additional CSS rules need to be passed into the iframe. These are hard-coded below. -// Note that button styles are unset, and then focus rules from the `Button` component are -// applied to the `button` element, targeted via `.edit-site-style-book__example`. -// This is to ensure that browser default styles for buttons are not applied to the previews. -const STYLE_BOOK_IFRAME_STYLES = ` - .edit-site-style-book__examples { - max-width: 900px; - margin: 0 auto; - } +/** + * Returns examples color examples for each origin + * e.g. Core (Default), Theme, and User. + * + * @param {MultiOriginPalettes} colors Global Styles color palettes per origin. + * @return {BlockExample[]} An array of color block examples. + */ - .edit-site-style-book__example { - border-radius: 2px; - cursor: pointer; - display: flex; - flex-direction: column; - gap: 40px; - margin-bottom: 40px; - padding: 16px; - width: 100%; - box-sizing: border-box; - scroll-margin-top: 32px; - scroll-margin-bottom: 32px; - } - - .edit-site-style-book__example.is-selected { - box-shadow: 0 0 0 1px var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba)); - } - - .edit-site-style-book__example:focus:not(:disabled) { - box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba)); - outline: 3px solid transparent; - } - - .edit-site-style-book__examples.is-wide .edit-site-style-book__example { - flex-direction: row; - } - - .edit-site-style-book__example-title { - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; - font-size: 11px; - font-weight: 500; - line-height: normal; - margin: 0; - text-align: left; - text-transform: uppercase; - } - - .edit-site-style-book__examples.is-wide .edit-site-style-book__example-title { - text-align: right; - width: 120px; - } - - .edit-site-style-book__example-preview { - width: 100%; - } - - .edit-site-style-book__example-preview .block-editor-block-list__insertion-point, - .edit-site-style-book__example-preview .block-list-appender { - display: none; - } - - .edit-site-style-book__example-preview .is-root-container > .wp-block:first-child { - margin-top: 0; - } - .edit-site-style-book__example-preview .is-root-container > .wp-block:last-child { - margin-bottom: 0; - } -`; -function isObjectEmpty(object) { - return !object || Object.keys(object).length === 0; +function getColorExamples(colors) { + if (!colors) { + return []; + } + const examples = []; + STYLE_BOOK_COLOR_GROUPS.forEach(group => { + const palette = colors[group.type]; + const paletteFiltered = Array.isArray(palette) ? palette.find(origin => origin.slug === group.origin) : undefined; + if (paletteFiltered?.[group.type]) { + const example = { + name: group.slug, + title: group.title, + category: 'colors' + }; + if (group.type === 'duotones') { + example.content = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(duotone_examples, { + duotones: paletteFiltered[group.type] + }); + examples.push(example); + } else { + example.content = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(color_examples, { + colors: paletteFiltered[group.type], + type: group.type + }); + examples.push(example); + } + } + }); + return examples; } -function getExamples() { + +/** + * Returns examples for the overview page. + * + * @param {MultiOriginPalettes} colors Global Styles color palettes per origin. + * @return {BlockExample[]} An array of block examples. + */ +function getOverviewBlockExamples(colors) { + const examples = []; + + // Get theme palette from colors if they exist. + const themePalette = Array.isArray(colors?.colors) ? colors.colors.find(origin => origin.slug === 'theme') : undefined; + if (themePalette) { + const themeColorexample = { + name: 'theme-colors', + title: (0,external_wp_i18n_namespaceObject.__)('Colors'), + category: 'overview', + content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(color_examples, { + colors: themePalette.colors, + type: "colors", + templateColumns: "repeat(auto-fill, minmax( 200px, 1fr ))", + itemHeight: "32px" + }) + }; + examples.push(themeColorexample); + } + + // Get examples for typography blocks. + const typographyBlockExamples = []; + if ((0,external_wp_blocks_namespaceObject.getBlockType)('core/heading')) { + const headingBlock = (0,external_wp_blocks_namespaceObject.createBlock)('core/heading', { + content: (0,external_wp_i18n_namespaceObject.__)(`AaBbCcDdEeFfGgHhiiJjKkLIMmNnOoPpQakRrssTtUuVVWwXxxYyZzOl23356789X{(…)},2!*&:/A@HELFO™`), + level: 1 + }); + typographyBlockExamples.push(headingBlock); + } + if ((0,external_wp_blocks_namespaceObject.getBlockType)('core/paragraph')) { + const firstParagraphBlock = (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { + content: (0,external_wp_i18n_namespaceObject.__)(`A paragraph in a website refers to a distinct block of text that is used to present and organize information. It is a fundamental unit of content in web design and is typically composed of a group of related sentences or thoughts focused on a particular topic or idea. Paragraphs play a crucial role in improving the readability and user experience of a website. They break down the text into smaller, manageable chunks, allowing readers to scan the content more easily.`) + }); + const secondParagraphBlock = (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { + content: (0,external_wp_i18n_namespaceObject.__)(`Additionally, paragraphs help structure the flow of information and provide logical breaks between different concepts or pieces of information. In terms of formatting, paragraphs in websites are commonly denoted by a vertical gap or indentation between each block of text. This visual separation helps visually distinguish one paragraph from another, creating a clear and organized layout that guides the reader through the content smoothly.`) + }); + if ((0,external_wp_blocks_namespaceObject.getBlockType)('core/group')) { + const groupBlock = (0,external_wp_blocks_namespaceObject.createBlock)('core/group', { + layout: { + type: 'grid', + columnCount: 2, + minimumColumnWidth: '12rem' + }, + style: { + spacing: { + blockGap: '1.5rem' + } + } + }, [firstParagraphBlock, secondParagraphBlock]); + typographyBlockExamples.push(groupBlock); + } else { + typographyBlockExamples.push(firstParagraphBlock); + } + } + if (!!typographyBlockExamples.length) { + examples.push({ + name: 'typography', + title: (0,external_wp_i18n_namespaceObject.__)('Typography'), + category: 'overview', + blocks: typographyBlockExamples + }); + } + const otherBlockExamples = ['core/image', 'core/separator', 'core/buttons', 'core/pullquote', 'core/search']; + + // Get examples for other blocks and put them in order of above array. + otherBlockExamples.forEach(blockName => { + const blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(blockName); + if (blockType && blockType.example) { + const blockExample = { + name: blockName, + title: blockType.title, + category: 'overview', + /* + * CSS generated from style attributes will take precedence over global styles CSS, + * so remove the style attribute from the example to ensure the example + * demonstrates changes to global styles. + */ + blocks: (0,external_wp_blocks_namespaceObject.getBlockFromExample)(blockName, { + ...blockType.example, + attributes: { + ...blockType.example.attributes, + style: undefined + } + }) + }; + examples.push(blockExample); + } + }); + return examples; +} + +/** + * Returns a list of examples for registered block types. + * + * @param {MultiOriginPalettes} colors Global styles colors grouped by origin e.g. Core, Theme, and User. + * @return {BlockExample[]} An array of block examples. + */ +function getExamples(colors) { const nonHeadingBlockExamples = (0,external_wp_blocks_namespaceObject.getBlockTypes)().filter(blockType => { const { name, example, supports } = blockType; - return name !== 'core/heading' && !!example && supports.inserter !== false; + return name !== 'core/heading' && !!example && supports?.inserter !== false; }).map(blockType => ({ name: blockType.name, title: blockType.title, category: blockType.category, - blocks: (0,external_wp_blocks_namespaceObject.getBlockFromExample)(blockType.name, blockType.example) + /* + * CSS generated from style attributes will take precedence over global styles CSS, + * so remove the style attribute from the example to ensure the example + * demonstrates changes to global styles. + */ + blocks: (0,external_wp_blocks_namespaceObject.getBlockFromExample)(blockType.name, { + ...blockType.example, + attributes: { + ...blockType.example.attributes, + style: undefined + } + }) })); const isHeadingBlockRegistered = !!(0,external_wp_blocks_namespaceObject.getBlockType)('core/heading'); if (!isHeadingBlockRegistered) { @@ -22394,7 +22954,333 @@ function getExamples() { }); }) }; - return [headingsExample, ...nonHeadingBlockExamples]; + const colorExamples = getColorExamples(colors); + const overviewBlockExamples = getOverviewBlockExamples(colors); + return [headingsExample, ...colorExamples, ...nonHeadingBlockExamples, ...overviewBlockExamples]; +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/page/header.js +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + +function Header({ + title, + subTitle, + actions +}) { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { + className: "edit-site-page-header", + as: "header", + spacing: 0, + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { + className: "edit-site-page-header__page-title", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHeading, { + as: "h2", + level: 3, + weight: 500, + className: "edit-site-page-header__title", + truncate: true, + children: title + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { + className: "edit-site-page-header__actions", + children: actions + })] + }), subTitle && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { + variant: "muted", + as: "p", + className: "edit-site-page-header__sub-title", + children: subTitle + })] + }); +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/page/index.js +/** + * External dependencies + */ + + +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + + +const { + NavigableRegion: page_NavigableRegion +} = unlock(external_wp_editor_namespaceObject.privateApis); +function Page({ + title, + subTitle, + actions, + children, + className, + hideTitleFromUI = false +}) { + const classes = dist_clsx('edit-site-page', className); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(page_NavigableRegion, { + className: classes, + ariaLabel: title, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { + className: "edit-site-page-content", + children: [!hideTitleFromUI && title && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Header, { + title: title, + subTitle: subTitle, + actions: actions + }), children] + }) + }); +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-global-styles-wrapper/index.js +/** + * WordPress dependencies + */ + + + + + + + + +/** + * Internal dependencies + */ + + + + +const { + useLocation: sidebar_global_styles_wrapper_useLocation, + useHistory: sidebar_global_styles_wrapper_useHistory +} = unlock(external_wp_router_namespaceObject.privateApis); +const GlobalStylesPageActions = ({ + isStyleBookOpened, + setIsStyleBookOpened, + path +}) => { + const history = sidebar_global_styles_wrapper_useHistory(); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + isPressed: isStyleBookOpened, + icon: library_seen, + label: (0,external_wp_i18n_namespaceObject.__)('Style Book'), + onClick: () => { + setIsStyleBookOpened(!isStyleBookOpened); + const updatedPath = !isStyleBookOpened ? (0,external_wp_url_namespaceObject.addQueryArgs)(path, { + preview: 'stylebook' + }) : (0,external_wp_url_namespaceObject.removeQueryArgs)(path, 'preview'); + // Navigate to the updated path. + history.navigate(updatedPath); + }, + size: "compact" + }); +}; + +/** + * Hook to deal with navigation and location state. + * + * @return {Array} The current section and a function to update it. + */ +const useSection = () => { + const { + path, + query + } = sidebar_global_styles_wrapper_useLocation(); + const history = sidebar_global_styles_wrapper_useHistory(); + return (0,external_wp_element_namespaceObject.useMemo)(() => { + var _query$section; + return [(_query$section = query.section) !== null && _query$section !== void 0 ? _query$section : '/', updatedSection => { + history.navigate((0,external_wp_url_namespaceObject.addQueryArgs)(path, { + section: updatedSection + })); + }]; + }, [path, query.section, history]); +}; +function GlobalStylesUIWrapper() { + const { + path + } = sidebar_global_styles_wrapper_useLocation(); + const [isStyleBookOpened, setIsStyleBookOpened] = (0,external_wp_element_namespaceObject.useState)(path.includes('preview=stylebook')); + const isMobileViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<'); + const [section, onChangeSection] = useSection(); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Page, { + actions: !isMobileViewport ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(GlobalStylesPageActions, { + isStyleBookOpened: isStyleBookOpened, + setIsStyleBookOpened: setIsStyleBookOpened, + path: path + }) : null, + className: "edit-site-styles", + title: (0,external_wp_i18n_namespaceObject.__)('Styles'), + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(global_styles_ui, { + path: section, + onPathChange: onChangeSection + }) + }) + }); +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/style-book/index.js +/* wp:polyfill */ +/** + * External dependencies + */ + + +/** + * WordPress dependencies + */ + + + + + + + + + + + +/** + * Internal dependencies + */ + + + + + + + + + + +const { + ExperimentalBlockEditorProvider, + useGlobalStyle: style_book_useGlobalStyle, + GlobalStylesContext: style_book_GlobalStylesContext, + useGlobalStylesOutputWithConfig +} = unlock(external_wp_blockEditor_namespaceObject.privateApis); +const { + mergeBaseAndUserConfigs: style_book_mergeBaseAndUserConfigs +} = unlock(external_wp_editor_namespaceObject.privateApis); +const { + Tabs: style_book_Tabs +} = unlock(external_wp_components_namespaceObject.privateApis); +function isObjectEmpty(object) { + return !object || Object.keys(object).length === 0; +} + +/** + * Scrolls to a section within an iframe. + * + * @param {string} anchorId The id of the element to scroll to. + * @param {HTMLIFrameElement} iframe The target iframe. + */ +const scrollToSection = (anchorId, iframe) => { + if (!anchorId || !iframe || !iframe?.contentDocument) { + return; + } + const element = anchorId === 'top' ? iframe.contentDocument.body : iframe.contentDocument.getElementById(anchorId); + if (element) { + element.scrollIntoView({ + behavior: 'smooth' + }); + } +}; + +/** + * Parses a Block Editor navigation path to build a style book navigation path. + * The object can be extended to include a category, representing a style book tab/section. + * + * @param {string} path An internal Block Editor navigation path. + * @return {null|{block: string}} An object containing the example to navigate to. + */ +const getStyleBookNavigationFromPath = path => { + if (path && typeof path === 'string') { + if (path === '/' || path.startsWith('/typography') || path.startsWith('/colors') || path.startsWith('/blocks')) { + return { + top: true + }; + } + } + return null; +}; + +/** + * Retrieves colors, gradients, and duotone filters from Global Styles. + * The inclusion of default (Core) palettes is controlled by the relevant + * theme.json property e.g. defaultPalette, defaultGradients, defaultDuotone. + * + * @return {Object} Object containing properties for each type of palette. + */ +function useMultiOriginPalettes() { + const { + colors, + gradients + } = (0,external_wp_blockEditor_namespaceObject.__experimentalUseMultipleOriginColorsAndGradients)(); + + // Add duotone filters to the palettes data. + const [shouldDisplayDefaultDuotones, customDuotones, themeDuotones, defaultDuotones] = (0,external_wp_blockEditor_namespaceObject.useSettings)('color.defaultDuotone', 'color.duotone.custom', 'color.duotone.theme', 'color.duotone.default'); + const palettes = (0,external_wp_element_namespaceObject.useMemo)(() => { + const result = { + colors, + gradients, + duotones: [] + }; + if (themeDuotones && themeDuotones.length) { + result.duotones.push({ + name: (0,external_wp_i18n_namespaceObject._x)('Theme', 'Indicates these duotone filters come from the theme.'), + slug: 'theme', + duotones: themeDuotones + }); + } + if (shouldDisplayDefaultDuotones && defaultDuotones && defaultDuotones.length) { + result.duotones.push({ + name: (0,external_wp_i18n_namespaceObject._x)('Default', 'Indicates these duotone filters come from WordPress.'), + slug: 'default', + duotones: defaultDuotones + }); + } + if (customDuotones && customDuotones.length) { + result.duotones.push({ + name: (0,external_wp_i18n_namespaceObject._x)('Custom', 'Indicates these doutone filters are created by the user.'), + slug: 'custom', + duotones: customDuotones + }); + } + return result; + }, [colors, gradients, customDuotones, themeDuotones, defaultDuotones, shouldDisplayDefaultDuotones]); + return palettes; +} + +/** + * Get deduped examples for single page stylebook. + * @param {Array} examples Array of examples. + * @return {Array} Deduped examples. + */ +function getExamplesForSinglePageUse(examples) { + const examplesForSinglePageUse = []; + const overviewCategoryExamples = getExamplesByCategory({ + slug: 'overview' + }, examples); + examplesForSinglePageUse.push(...overviewCategoryExamples.examples); + const otherExamples = examples.filter(example => { + return example.category !== 'overview' && !overviewCategoryExamples.examples.find(overviewExample => overviewExample.name === example.name); + }); + examplesForSinglePageUse.push(...otherExamples); + return examplesForSinglePageUse; } function StyleBook({ enableResizing = true, @@ -22404,20 +23290,20 @@ function StyleBook({ showCloseButton = true, onClose, showTabs = true, - userConfig = {} + userConfig = {}, + path = '' }) { const [resizeObserver, sizes] = (0,external_wp_compose_namespaceObject.useResizeObserver)(); const [textColor] = style_book_useGlobalStyle('color.text'); const [backgroundColor] = style_book_useGlobalStyle('color.background'); - const [examples] = (0,external_wp_element_namespaceObject.useState)(getExamples); - const tabs = (0,external_wp_element_namespaceObject.useMemo)(() => (0,external_wp_blocks_namespaceObject.getCategories)().filter(category => examples.some(example => example.category === category.slug)).map(category => ({ - name: category.slug, - title: category.title, - icon: category.icon - })), [examples]); + const colors = useMultiOriginPalettes(); + const examples = (0,external_wp_element_namespaceObject.useMemo)(() => getExamples(colors), [colors]); + const tabs = (0,external_wp_element_namespaceObject.useMemo)(() => getTopLevelStyleBookCategories().filter(category => examples.some(example => example.category === category.slug)), [examples]); + const examplesForSinglePageUse = getExamplesForSinglePageUse(examples); const { base: baseConfig } = (0,external_wp_element_namespaceObject.useContext)(style_book_GlobalStylesContext); + const goTo = getStyleBookNavigationFromPath(path); const mergedConfig = (0,external_wp_element_namespaceObject.useMemo)(() => { if (!isObjectEmpty(userConfig) && !isObjectEmpty(baseConfig)) { return style_book_mergeBaseAndUserConfigs(baseConfig, userConfig); @@ -22428,12 +23314,12 @@ function StyleBook({ // Copied from packages/edit-site/src/components/revisions/index.js // could we create a shared hook? const originalSettings = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getSettings(), []); + const [globalStyles] = useGlobalStylesOutputWithConfig(mergedConfig); const settings = (0,external_wp_element_namespaceObject.useMemo)(() => ({ ...originalSettings, - __unstableIsPreviewMode: true - }), [originalSettings]); - const [globalStyles] = useGlobalStylesOutputWithConfig(mergedConfig); - settings.styles = !isObjectEmpty(globalStyles) && !isObjectEmpty(userConfig) ? globalStyles : settings.styles; + styles: !isObjectEmpty(globalStyles) && !isObjectEmpty(userConfig) ? globalStyles : originalSettings.styles, + isPreviewMode: true + }), [globalStyles, originalSettings, userConfig]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(editor_canvas_container, { onClose: onClose, enableResizing: enableResizing, @@ -22447,51 +23333,173 @@ function StyleBook({ color: textColor, background: backgroundColor }, - children: [resizeObserver, showTabs ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { - className: "edit-site-style-book__tabs", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(style_book_Tabs, { - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(style_book_Tabs.TabList, { + children: [resizeObserver, showTabs ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(style_book_Tabs, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: "edit-site-style-book__tablist-container", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(style_book_Tabs.TabList, { children: tabs.map(tab => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(style_book_Tabs.Tab, { - tabId: tab.name, + tabId: tab.slug, children: tab.title - }, tab.name)) - }), tabs.map(tab => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(style_book_Tabs.TabPanel, { - tabId: tab.name, + }, tab.slug)) + }) + }), tabs.map(tab => { + const categoryDefinition = tab.slug ? getTopLevelStyleBookCategories().find(_category => _category.slug === tab.slug) : null; + const filteredExamples = categoryDefinition ? getExamplesByCategory(categoryDefinition, examples) : { + examples + }; + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(style_book_Tabs.TabPanel, { + tabId: tab.slug, focusable: false, + className: "edit-site-style-book__tabpanel", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(StyleBookBody, { - category: tab.name, - examples: examples, + category: tab.slug, + examples: filteredExamples, isSelected: isSelected, onSelect: onSelect, settings: settings, sizes: sizes, - title: tab.title + title: tab.title, + goTo: goTo }) - }, tab.name))] - }) + }, tab.slug); + })] }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(StyleBookBody, { - examples: examples, + examples: { + examples: examplesForSinglePageUse + }, isSelected: isSelected, onClick: onClick, onSelect: onSelect, settings: settings, - sizes: sizes + sizes: sizes, + goTo: goTo })] }) }); } + +/** + * Style Book Preview component renders the stylebook without the Editor dependency. + * + * @param {Object} props Component props. + * @param {Object} props.userConfig User configuration. + * @param {boolean} props.isStatic Whether the stylebook is static or clickable. + * @return {Object} Style Book Preview component. + */ +const StyleBookPreview = ({ + userConfig = {}, + isStatic = false +}) => { + const siteEditorSettings = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).getSettings(), []); + const canUserUploadMedia = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).canUser('create', { + kind: 'root', + name: 'media' + }), []); + + // Update block editor settings because useMultipleOriginColorsAndGradients fetch colours from there. + (0,external_wp_element_namespaceObject.useEffect)(() => { + (0,external_wp_data_namespaceObject.dispatch)(external_wp_blockEditor_namespaceObject.store).updateSettings({ + ...siteEditorSettings, + mediaUpload: canUserUploadMedia ? external_wp_mediaUtils_namespaceObject.uploadMedia : undefined + }); + }, [siteEditorSettings, canUserUploadMedia]); + const [section, onChangeSection] = useSection(); + const isSelected = blockName => { + // Match '/blocks/core%2Fbutton' and + // '/blocks/core%2Fbutton/typography', but not + // '/blocks/core%2Fbuttons'. + return section === `/blocks/${encodeURIComponent(blockName)}` || section.startsWith(`/blocks/${encodeURIComponent(blockName)}/`); + }; + const onSelect = blockName => { + if (STYLE_BOOK_COLOR_GROUPS.find(group => group.slug === blockName)) { + // Go to color palettes Global Styles. + onChangeSection('/colors/palette'); + return; + } + if (blockName === 'typography') { + // Go to typography Global Styles. + onChangeSection('/typography'); + return; + } + + // Now go to the selected block. + onChangeSection(`/blocks/${encodeURIComponent(blockName)}`); + }; + const [resizeObserver, sizes] = (0,external_wp_compose_namespaceObject.useResizeObserver)(); + const colors = useMultiOriginPalettes(); + const examples = getExamples(colors); + const examplesForSinglePageUse = getExamplesForSinglePageUse(examples); + let previewCategory = null; + if (section.includes('/colors')) { + previewCategory = 'colors'; + } else if (section.includes('/typography')) { + previewCategory = 'text'; + } else if (section.includes('/blocks')) { + previewCategory = 'blocks'; + const blockName = decodeURIComponent(section).split('/blocks/')[1]; + if (blockName && examples.find(example => example.name === blockName)) { + previewCategory = blockName; + } + } else if (!isStatic) { + previewCategory = 'overview'; + } + const categoryDefinition = STYLE_BOOK_PREVIEW_CATEGORIES.find(category => category.slug === previewCategory); + + // If there's no category definition there may be a single block. + const filteredExamples = categoryDefinition ? getExamplesByCategory(categoryDefinition, examples) : { + examples: [examples.find(example => example.name === previewCategory)] + }; + + // If there's no preview category, show all examples. + const displayedExamples = previewCategory ? filteredExamples : { + examples: examplesForSinglePageUse + }; + const { + base: baseConfig + } = (0,external_wp_element_namespaceObject.useContext)(style_book_GlobalStylesContext); + const goTo = getStyleBookNavigationFromPath(section); + const mergedConfig = (0,external_wp_element_namespaceObject.useMemo)(() => { + if (!isObjectEmpty(userConfig) && !isObjectEmpty(baseConfig)) { + return style_book_mergeBaseAndUserConfigs(baseConfig, userConfig); + } + return {}; + }, [baseConfig, userConfig]); + const [globalStyles] = useGlobalStylesOutputWithConfig(mergedConfig); + const settings = (0,external_wp_element_namespaceObject.useMemo)(() => ({ + ...siteEditorSettings, + styles: !isObjectEmpty(globalStyles) && !isObjectEmpty(userConfig) ? globalStyles : siteEditorSettings.styles, + isPreviewMode: true + }), [globalStyles, siteEditorSettings, userConfig]); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { + className: "edit-site-style-book", + children: [resizeObserver, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.BlockEditorProvider, { + settings: settings, + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(GlobalStylesRenderer, { + disableRootPadding: true + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(StyleBookBody, { + examples: displayedExamples, + settings: settings, + goTo: goTo, + sizes: sizes, + isSelected: !isStatic ? isSelected : null, + onSelect: !isStatic ? onSelect : null + })] + })] + }); +}; const StyleBookBody = ({ - category, examples, isSelected, onClick, onSelect, settings, sizes, - title + title, + goTo }) => { const [isFocused, setIsFocused] = (0,external_wp_element_namespaceObject.useState)(false); - + const [hasIframeLoaded, setHasIframeLoaded] = (0,external_wp_element_namespaceObject.useState)(false); + const iframeRef = (0,external_wp_element_namespaceObject.useRef)(null); // The presence of an `onClick` prop indicates that the Style Book is being used as a button. // In this case, add additional props to the iframe to make it behave like a button. const buttonModeProps = { @@ -22521,8 +23529,17 @@ const StyleBookBody = ({ }, readonly: true }; - const buttonModeStyles = onClick ? 'body { cursor: pointer; } body * { pointer-events: none; }' : ''; + const handleLoad = () => setHasIframeLoaded(true); + (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { + if (hasIframeLoaded && iframeRef?.current) { + if (goTo?.top) { + scrollToSection('top', iframeRef?.current); + } + } + }, [iframeRef?.current, goTo, scrollToSection, hasIframeLoaded]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.__unstableIframe, { + onLoad: handleLoad, + ref: iframeRef, className: dist_clsx('edit-site-style-book__iframe', { 'is-focused': isFocused && !!onClick, 'is-button': !!onClick @@ -22532,82 +23549,109 @@ const StyleBookBody = ({ ...(onClick ? buttonModeProps : {}), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__unstableEditorStyles, { styles: settings.styles - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("style", { - children: - // Forming a "block formatting context" to prevent margin collapsing. - // @see https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context - `.is-root-container { display: flow-root; } - body { position: relative; padding: 32px !important; }` + STYLE_BOOK_IFRAME_STYLES + buttonModeStyles + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("style", { + children: [STYLE_BOOK_IFRAME_STYLES, !!onClick && 'body { cursor: pointer; } body * { pointer-events: none; }'] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Examples, { className: dist_clsx('edit-site-style-book__examples', { 'is-wide': sizes.width > 600 }), - examples: examples, - category: category, + filteredExamples: examples, label: title ? (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: Category of blocks, e.g. Text. (0,external_wp_i18n_namespaceObject.__)('Examples of blocks in the %s category'), title) : (0,external_wp_i18n_namespaceObject.__)('Examples of blocks'), isSelected: isSelected, onSelect: onSelect - }, category)] + }, title)] }); }; const Examples = (0,external_wp_element_namespaceObject.memo)(({ className, - examples, - category, + filteredExamples, label, isSelected, onSelect }) => { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Composite, { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Composite, { orientation: "vertical", className: className, "aria-label": label, role: "grid", - children: examples.filter(example => category ? example.category === category : true).map(example => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Example, { + children: [!!filteredExamples?.examples?.length && filteredExamples.examples.map(example => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Example, { id: `example-${example.name}`, title: example.title, + content: example.content, blocks: example.blocks, - isSelected: isSelected(example.name), - onClick: () => { - onSelect?.(example.name); - } - }, example.name)) + isSelected: isSelected?.(example.name), + onClick: !!onSelect ? () => onSelect(example.name) : null + }, example.name)), !!filteredExamples?.subcategories?.length && filteredExamples.subcategories.map(subcategory => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Composite.Group, { + className: "edit-site-style-book__subcategory", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Composite.GroupLabel, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h2", { + className: "edit-site-style-book__subcategory-title", + children: subcategory.title + }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Subcategory, { + examples: subcategory.examples, + isSelected: isSelected, + onSelect: onSelect + })] + }, `subcategory-${subcategory.slug}`))] }); }); +const Subcategory = ({ + examples, + isSelected, + onSelect +}) => { + return !!examples?.length && examples.map(example => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Example, { + id: `example-${example.name}`, + title: example.title, + content: example.content, + blocks: example.blocks, + isSelected: isSelected?.(example.name), + onClick: !!onSelect ? () => onSelect(example.name) : null + }, example.name)); +}; +const disabledExamples = ['example-duotones']; const Example = ({ id, title, blocks, isSelected, - onClick + onClick, + content }) => { const originalSettings = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getSettings(), []); const settings = (0,external_wp_element_namespaceObject.useMemo)(() => ({ ...originalSettings, focusMode: false, // Disable "Spotlight mode". - __unstableIsPreviewMode: true + isPreviewMode: true }), [originalSettings]); // Cache the list of blocks to avoid additional processing when the component is re-rendered. const renderedBlocks = (0,external_wp_element_namespaceObject.useMemo)(() => Array.isArray(blocks) ? blocks : [blocks], [blocks]); + const disabledProps = disabledExamples.includes(id) || !onClick ? { + disabled: true, + accessibleWhenDisabled: !!onClick + } : {}; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { role: "row", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { role: "gridcell", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Composite.Item, { className: dist_clsx('edit-site-style-book__example', { - 'is-selected': isSelected + 'is-selected': isSelected, + 'is-disabled-example': !!disabledProps?.disabled }), id: id, - "aria-label": (0,external_wp_i18n_namespaceObject.sprintf)( + "aria-label": !!onClick ? (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: Title of a block, e.g. Heading. - (0,external_wp_i18n_namespaceObject.__)('Open %s styles in Styles panel'), title), + (0,external_wp_i18n_namespaceObject.__)('Open %s styles in Styles panel'), title) : undefined, render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {}), - role: "button", + role: !!onClick ? 'button' : null, onClick: onClick, + ...disabledProps, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "edit-site-style-book__example-title", children: title @@ -22616,12 +23660,12 @@ const Example = ({ "aria-hidden": true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Disabled, { className: "edit-site-style-book__example-preview__content", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ExperimentalBlockEditorProvider, { + children: content ? content : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(ExperimentalBlockEditorProvider, { value: renderedBlocks, settings: settings, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockList, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__unstableEditorStyles, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockList, { renderAppender: false - }) + })] }) }) })] @@ -22645,8 +23689,6 @@ const Example = ({ - - const { useGlobalStyle: screen_css_useGlobalStyle, AdvancedPanel: screen_css_StylesAdvancedPanel @@ -22663,7 +23705,7 @@ function ScreenCSS() { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(header, { title: (0,external_wp_i18n_namespaceObject.__)('CSS'), description: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: [description, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, { + children: [description, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("br", {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, { href: (0,external_wp_i18n_namespaceObject.__)('https://developer.wordpress.org/advanced-administration/wordpress/css/'), className: "edit-site-global-styles-screen-css-help-link", children: (0,external_wp_i18n_namespaceObject.__)('Learn more about CSS') @@ -22699,7 +23741,6 @@ function ScreenCSS() { - const { ExperimentalBlockEditorProvider: revisions_ExperimentalBlockEditorProvider, GlobalStylesContext: revisions_GlobalStylesContext, @@ -22729,7 +23770,7 @@ function Revisions({ const originalSettings = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getSettings(), []); const settings = (0,external_wp_element_namespaceObject.useMemo)(() => ({ ...originalSettings, - __unstableIsPreviewMode: true + isPreviewMode: true }), [originalSettings]); const [globalStyles] = revisions_useGlobalStylesOutputWithConfig(mergedConfig); const editorStyles = !revisions_isObjectEmpty(globalStyles) && !revisions_isObjectEmpty(userConfig) ? globalStyles : settings.styles; @@ -22765,144 +23806,10 @@ function Revisions({ } /* harmony default export */ const components_revisions = (Revisions); -;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js -/** - * WordPress dependencies - */ - - - - - -/** - * Internal dependencies - */ - -const SITE_EDITOR_AUTHORS_QUERY = { - per_page: -1, - _fields: 'id,name,avatar_urls', - context: 'view', - capabilities: ['edit_theme_options'] -}; -const DEFAULT_QUERY = { - per_page: 100, - page: 1 -}; -const use_global_styles_revisions_EMPTY_ARRAY = []; -const { - GlobalStylesContext: use_global_styles_revisions_GlobalStylesContext -} = unlock(external_wp_blockEditor_namespaceObject.privateApis); -function useGlobalStylesRevisions({ - query -} = {}) { - const { - user: userConfig - } = (0,external_wp_element_namespaceObject.useContext)(use_global_styles_revisions_GlobalStylesContext); - const _query = { - ...DEFAULT_QUERY, - ...query - }; - const { - authors, - currentUser, - isDirty, - revisions, - isLoadingGlobalStylesRevisions, - revisionsCount - } = (0,external_wp_data_namespaceObject.useSelect)(select => { - var _globalStyles$_links$; - const { - __experimentalGetDirtyEntityRecords, - getCurrentUser, - getUsers, - getRevisions, - __experimentalGetCurrentGlobalStylesId, - getEntityRecord, - isResolving - } = select(external_wp_coreData_namespaceObject.store); - const dirtyEntityRecords = __experimentalGetDirtyEntityRecords(); - const _currentUser = getCurrentUser(); - const _isDirty = dirtyEntityRecords.length > 0; - const globalStylesId = __experimentalGetCurrentGlobalStylesId(); - const globalStyles = globalStylesId ? getEntityRecord('root', 'globalStyles', globalStylesId) : undefined; - const _revisionsCount = (_globalStyles$_links$ = globalStyles?._links?.['version-history']?.[0]?.count) !== null && _globalStyles$_links$ !== void 0 ? _globalStyles$_links$ : 0; - const globalStylesRevisions = getRevisions('root', 'globalStyles', globalStylesId, _query) || use_global_styles_revisions_EMPTY_ARRAY; - const _authors = getUsers(SITE_EDITOR_AUTHORS_QUERY) || use_global_styles_revisions_EMPTY_ARRAY; - const _isResolving = isResolving('getRevisions', ['root', 'globalStyles', globalStylesId, _query]); - return { - authors: _authors, - currentUser: _currentUser, - isDirty: _isDirty, - revisions: globalStylesRevisions, - isLoadingGlobalStylesRevisions: _isResolving, - revisionsCount: _revisionsCount - }; - }, [query]); - return (0,external_wp_element_namespaceObject.useMemo)(() => { - if (!authors.length || isLoadingGlobalStylesRevisions) { - return { - revisions: use_global_styles_revisions_EMPTY_ARRAY, - hasUnsavedChanges: isDirty, - isLoading: true, - revisionsCount - }; - } - - // Adds author details to each revision. - const _modifiedRevisions = revisions.map(revision => { - return { - ...revision, - author: authors.find(author => author.id === revision.author) - }; - }); - const fetchedRevisionsCount = revisions.length; - if (fetchedRevisionsCount) { - // Flags the most current saved revision. - if (_modifiedRevisions[0].id !== 'unsaved' && _query.page === 1) { - _modifiedRevisions[0].isLatest = true; - } - - // Adds an item for unsaved changes. - if (isDirty && userConfig && Object.keys(userConfig).length > 0 && currentUser && _query.page === 1) { - const unsavedRevision = { - id: 'unsaved', - styles: userConfig?.styles, - settings: userConfig?.settings, - _links: userConfig?._links, - author: { - name: currentUser?.name, - avatar_urls: currentUser?.avatar_urls - }, - modified: new Date() - }; - _modifiedRevisions.unshift(unsavedRevision); - } - if (_query.page === Math.ceil(revisionsCount / _query.per_page)) { - // Adds an item for the default theme styles. - _modifiedRevisions.push({ - id: 'parent', - styles: {}, - settings: {} - }); - } - } - return { - revisions: _modifiedRevisions, - hasUnsavedChanges: isDirty, - isLoading: false, - revisionsCount - }; - }, [isDirty, revisions, currentUser, authors, userConfig, isLoadingGlobalStylesRevisions]); -} - ;// external ["wp","date"] const external_wp_date_namespaceObject = window["wp"]["date"]; ;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-revisions/revisions-buttons.js -/** - * External dependencies - */ - - +/* wp:polyfill */ /** * WordPress dependencies */ @@ -22918,7 +23825,6 @@ const external_wp_date_namespaceObject = window["wp"]["date"]; */ - const DAY_IN_MILLISECONDS = 60 * 60 * 1000 * 24; const { getGlobalStylesChanges @@ -22956,7 +23862,7 @@ function getRevisionLabel(id, authorDisplayName, formattedModifiedDate, areStyle return (0,external_wp_i18n_namespaceObject.__)('Reset the styles to the theme defaults'); } if ('unsaved' === id) { - return (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: author display name */ + return (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: author display name */ (0,external_wp_i18n_namespaceObject.__)('Unsaved changes by %s'), authorDisplayName); } return areStylesEqual ? (0,external_wp_i18n_namespaceObject.sprintf)( @@ -23002,10 +23908,11 @@ function RevisionsButtons({ const { datetimeAbbreviated } = (0,external_wp_date_namespaceObject.getSettings)().formats; - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ol", { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Composite, { + orientation: "vertical", className: "edit-site-global-styles-screen-revisions__revisions-list", "aria-label": (0,external_wp_i18n_namespaceObject.__)('Global styles revisions list'), - role: "group", + role: "listbox", children: userRevisions.map((revision, index) => { const { id, @@ -23024,22 +23931,27 @@ function RevisionsButtons({ const modifiedDate = (0,external_wp_date_namespaceObject.getDate)(modified); const displayDate = modified && dateNowInMs - modifiedDate.getTime() > DAY_IN_MILLISECONDS ? (0,external_wp_date_namespaceObject.dateI18n)(datetimeAbbreviated, modifiedDate) : (0,external_wp_date_namespaceObject.humanTimeDiff)(modified); const revisionLabel = getRevisionLabel(id, authorDisplayName, (0,external_wp_date_namespaceObject.dateI18n)(datetimeAbbreviated, modifiedDate), areStylesEqual); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("li", { - className: dist_clsx('edit-site-global-styles-screen-revisions__revision-item', { - 'is-selected': isSelected, - 'is-active': areStylesEqual, - 'is-reset': isReset - }), + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Composite.Item, { + className: "edit-site-global-styles-screen-revisions__revision-item", "aria-current": isSelected, - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - __next40pxDefaultSize: true, - className: "edit-site-global-styles-screen-revisions__revision-button", - accessibleWhenDisabled: true, - disabled: isSelected, - onClick: () => { + role: "option", + onKeyDown: event => { + const { + keyCode + } = event; + if (keyCode === external_wp_keycodes_namespaceObject.ENTER || keyCode === external_wp_keycodes_namespaceObject.SPACE) { onChange(revision); - }, - "aria-label": revisionLabel, + } + }, + onClick: event => { + event.preventDefault(); + onChange(revision); + }, + "aria-selected": isSelected, + "aria-label": revisionLabel, + render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {}), + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { + className: "edit-site-global-styles-screen-revisions__revision-item-wrapper", children: isReset ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("span", { className: "edit-site-global-styles-screen-revisions__description", children: [(0,external_wp_i18n_namespaceObject.__)('Default styles'), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { @@ -23074,6 +23986,7 @@ function RevisionsButtons({ variant: "primary", className: "edit-site-global-styles-screen-revisions__apply-button", onClick: onApplyRevision, + "aria-label": (0,external_wp_i18n_namespaceObject.__)('Apply the selected revision to your site.'), children: isReset ? (0,external_wp_i18n_namespaceObject.__)('Reset to defaults') : (0,external_wp_i18n_namespaceObject.__)('Apply') }))] }, id); @@ -23082,36 +23995,6 @@ function RevisionsButtons({ } /* harmony default export */ const revisions_buttons = (RevisionsButtons); -;// ./node_modules/@wordpress/icons/build-module/library/next.js -/** - * WordPress dependencies - */ - - -const next = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - d: "M6.6 6L5.4 7l4.5 5-4.5 5 1.1 1 5.5-6-5.4-6zm6 0l-1.1 1 4.5 5-4.5 5 1.1 1 5.5-6-5.5-6z" - }) -}); -/* harmony default export */ const library_next = (next); - -;// ./node_modules/@wordpress/icons/build-module/library/previous.js -/** - * WordPress dependencies - */ - - -const previous = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - d: "M11.6 7l-1.1-1L5 12l5.5 6 1.1-1L7 12l4.6-5zm6 0l-1.1-1-5.5 6 5.5 6 1.1-1-4.6-5 4.6-5z" - }) -}); -/* harmony default export */ const library_previous = (previous); - ;// ./node_modules/@wordpress/edit-site/build-module/components/pagination/index.js /** * External dependencies @@ -23125,7 +24008,6 @@ const previous = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(e - function Pagination({ currentPage, numPages, @@ -23134,7 +24016,7 @@ function Pagination({ className, disabled = false, buttonVariant = 'tertiary', - label = (0,external_wp_i18n_namespaceObject.__)('Pagination Navigation') + label = (0,external_wp_i18n_namespaceObject.__)('Pagination') }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { expanded: false, @@ -23222,17 +24104,12 @@ function Pagination({ - - const { GlobalStylesContext: screen_revisions_GlobalStylesContext, areGlobalStyleConfigsEqual: screen_revisions_areGlobalStyleConfigsEqual } = unlock(external_wp_blockEditor_namespaceObject.privateApis); const PAGE_SIZE = 10; function ScreenRevisions() { - const { - goTo - } = (0,external_wp_components_namespaceObject.__experimentalUseNavigator)(); const { user: currentEditorGlobalStyles, setUserConfig @@ -23264,8 +24141,10 @@ function ScreenRevisions() { setEditorCanvasContainerView } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store)); const selectedRevisionMatchesEditorStyles = screen_revisions_areGlobalStyleConfigsEqual(currentlySelectedRevision, currentEditorGlobalStyles); + + // The actual code that triggers the revisions screen to navigate back + // to the home screen in in `packages/edit-site/src/components/global-styles/ui.js`. const onCloseRevisions = () => { - goTo('/'); // Return to global styles main panel. const canvasContainerView = editorCanvasContainerView === 'global-styles-revisions:style-book' ? 'style-book' : undefined; setEditorCanvasContainerView(canvasContainerView); }; @@ -23274,11 +24153,6 @@ function ScreenRevisions() { setIsLoadingRevisionWithUnsavedChanges(false); onCloseRevisions(); }; - (0,external_wp_element_namespaceObject.useEffect)(() => { - if (!editorCanvasContainerView || !editorCanvasContainerView.startsWith('global-styles-revisions')) { - goTo('/'); // Return to global styles main panel. - } - }, [editorCanvasContainerView]); (0,external_wp_element_namespaceObject.useEffect)(() => { if (!isLoading && revisions.length) { setCurrentRevisions(revisions); @@ -23338,7 +24212,7 @@ function ScreenRevisions() { changePage: setCurrentPage, totalItems: revisionsCount, disabled: isLoading, - label: (0,external_wp_i18n_namespaceObject.__)('Global Styles pagination navigation') + label: (0,external_wp_i18n_namespaceObject.__)('Global Styles pagination') }) }), isLoadingRevisionWithUnsavedChanges && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalConfirmDialog, { isOpen: isLoadingRevisionWithUnsavedChanges, @@ -23353,6 +24227,7 @@ function ScreenRevisions() { /* harmony default export */ const screen_revisions = (ScreenRevisions); ;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/ui.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -23366,6 +24241,7 @@ function ScreenRevisions() { + /** * Internal dependencies */ @@ -23388,7 +24264,6 @@ function ScreenRevisions() { - const SLOT_FILL_NAME = 'GlobalStylesMenu'; const { @@ -23419,12 +24294,8 @@ function GlobalStylesActionMenu() { const { setEditorCanvasContainerView } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store)); - const { - goTo - } = (0,external_wp_components_namespaceObject.__experimentalUseNavigator)(); const loadCustomCSS = () => { setEditorCanvasContainerView('global-styles-css'); - goTo('/css'); }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(GlobalStylesMenuFill, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.DropdownMenu, { @@ -23465,7 +24336,7 @@ function GlobalStylesNavigationScreen({ className, ...props }) { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalNavigatorScreen, { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Navigator.Screen, { className: ['edit-site-global-styles-sidebar__navigator-screen', className].filter(Boolean).join(' '), ...props }); @@ -23507,7 +24378,7 @@ function ContextScreens({ }); } function GlobalStylesStyleBook() { - const navigator = (0,external_wp_components_namespaceObject.__experimentalUseNavigator)(); + const navigator = (0,external_wp_components_namespaceObject.useNavigator)(); const { path } = navigator.location; @@ -23518,13 +24389,24 @@ function GlobalStylesStyleBook() { // '/blocks/core%2Fbuttons'. path === `/blocks/${encodeURIComponent(blockName)}` || path.startsWith(`/blocks/${encodeURIComponent(blockName)}/`), onSelect: blockName => { + if (STYLE_BOOK_COLOR_GROUPS.find(group => group.slug === blockName)) { + // Go to color palettes Global Styles. + navigator.goTo('/colors/palette'); + return; + } + if (blockName === 'typography') { + // Go to typography Global Styles. + navigator.goTo('/typography'); + return; + } + // Now go to the selected block. navigator.goTo('/blocks/' + encodeURIComponent(blockName)); } }); } function GlobalStylesBlockLink() { - const navigator = (0,external_wp_components_namespaceObject.__experimentalUseNavigator)(); + const navigator = (0,external_wp_components_namespaceObject.useNavigator)(); const { selectedBlockName, selectedBlockClientId @@ -23563,7 +24445,7 @@ function GlobalStylesEditorCanvasContainerLink() { const { goTo, location - } = (0,external_wp_components_namespaceObject.__experimentalUseNavigator)(); + } = (0,external_wp_components_namespaceObject.useNavigator)(); const editorCanvasContainerView = (0,external_wp_data_namespaceObject.useSelect)(select => unlock(select(store)).getEditorCanvasContainerView(), []); const path = location?.path; const isRevisionsOpen = path === '/revisions'; @@ -23575,33 +24457,77 @@ function GlobalStylesEditorCanvasContainerLink() { switch (editorCanvasContainerView) { case 'global-styles-revisions': case 'global-styles-revisions:style-book': - goTo('/revisions'); + if (!isRevisionsOpen) { + goTo('/revisions'); + } break; case 'global-styles-css': goTo('/css'); break; + // The stand-alone style book is open + // and the revisions panel is open, + // close the revisions panel. + // Otherwise keep the style book open while + // browsing global styles panel. + // + // Falling through as it matches the default scenario. case 'style-book': - /* - * The stand-alone style book is open - * and the revisions panel is open, - * close the revisions panel. - * Otherwise keep the style book open while - * browsing global styles panel. - */ + default: + // In general, if the revision screen is in view but the + // `editorCanvasContainerView` is not a revision view, close it. + // This also includes the scenario when the stand-alone style + // book is open, in which case we want the user to close the + // revisions screen and browse global styles. if (isRevisionsOpen) { - goTo('/'); + goTo('/', { + isBack: true + }); } break; } }, [editorCanvasContainerView, isRevisionsOpen, goTo]); } -function GlobalStylesUI() { +function useNavigatorSync(parentPath, onPathChange) { + const navigator = (0,external_wp_components_namespaceObject.useNavigator)(); + const { + path: childPath + } = navigator.location; + const previousParentPath = (0,external_wp_compose_namespaceObject.usePrevious)(parentPath); + const previousChildPath = (0,external_wp_compose_namespaceObject.usePrevious)(childPath); + (0,external_wp_element_namespaceObject.useEffect)(() => { + if (parentPath !== childPath) { + if (parentPath !== previousParentPath) { + navigator.goTo(parentPath); + } else if (childPath !== previousChildPath) { + onPathChange(childPath); + } + } + }, [onPathChange, parentPath, previousChildPath, previousParentPath, childPath, navigator]); +} + +// This component is used to wrap the hook in order to conditionally execute it +// when the parent component is used on controlled mode. +function NavigationSync({ + path: parentPath, + onPathChange, + children +}) { + useNavigatorSync(parentPath, onPathChange); + return children; +} +function GlobalStylesUI({ + path, + onPathChange +}) { const blocks = (0,external_wp_blocks_namespaceObject.getBlockTypes)(); const editorCanvasContainerView = (0,external_wp_data_namespaceObject.useSelect)(select => unlock(select(store)).getEditorCanvasContainerView(), []); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalNavigatorProvider, { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Navigator, { className: "edit-site-global-styles-sidebar__navigator-provider", initialPath: "/", - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(GlobalStylesNavigationScreen, { + children: [path && onPathChange && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationSync, { + path: path, + onPathChange: onPathChange + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(GlobalStylesNavigationScreen, { path: "/", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(screen_root, {}) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(GlobalStylesNavigationScreen, { @@ -23614,7 +24540,7 @@ function GlobalStylesUI() { path: "/typography", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(screen_typography, {}) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(GlobalStylesNavigationScreen, { - path: "/typography/font-sizes/", + path: "/typography/font-sizes", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(font_sizes, {}) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(GlobalStylesNavigationScreen, { path: "/typography/font-sizes/:origin/:slug", @@ -23693,8 +24619,6 @@ function GlobalStylesUI() { */ - - const { ComplementaryArea, ComplementaryAreaMoreMenuItem @@ -23717,7 +24641,6 @@ function DefaultSidebar({ scope: "core", identifier: identifier, title: title, - smallScreenTitle: title, icon: icon, closeLabel: closeLabel, header: header, @@ -23746,6 +24669,8 @@ function DefaultSidebar({ + + /** * Internal dependencies */ @@ -23756,11 +24681,20 @@ function DefaultSidebar({ - const { interfaceStore: global_styles_sidebar_interfaceStore } = unlock(external_wp_editor_namespaceObject.privateApis); +const { + useLocation: global_styles_sidebar_useLocation +} = unlock(external_wp_router_namespaceObject.privateApis); function GlobalStylesSidebar() { + const { + query + } = global_styles_sidebar_useLocation(); + const { + canvas = 'view', + name + } = query; const { shouldClearCanvasContainerView, isStyleBookOpened, @@ -23773,12 +24707,11 @@ function GlobalStylesSidebar() { getActiveComplementaryArea } = select(global_styles_sidebar_interfaceStore); const { - getEditorCanvasContainerView, - getCanvasMode + getEditorCanvasContainerView } = unlock(select(store)); const canvasContainerView = getEditorCanvasContainerView(); const _isVisualEditorMode = 'visual' === select(external_wp_editor_namespaceObject.store).getEditorMode(); - const _isEditCanvasMode = 'edit' === getCanvasMode(); + const _isEditCanvasMode = 'edit' === canvas; const _showListViewByDefault = select(external_wp_preferences_namespaceObject.store).get('core', 'showListViewByDefault'); const { getEntityRecord, @@ -23794,34 +24727,29 @@ function GlobalStylesSidebar() { isRevisionsStyleBookOpened: 'global-styles-revisions:style-book' === canvasContainerView, isRevisionsOpened: 'global-styles-revisions' === canvasContainerView }; - }, []); + }, [canvas]); const { setEditorCanvasContainerView } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store)); + const isMobileViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<'); (0,external_wp_element_namespaceObject.useEffect)(() => { if (shouldClearCanvasContainerView) { setEditorCanvasContainerView(undefined); } - }, [shouldClearCanvasContainerView]); + }, [shouldClearCanvasContainerView, setEditorCanvasContainerView]); const { setIsListViewOpened } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_editor_namespaceObject.store); - const { - goTo - } = (0,external_wp_components_namespaceObject.__experimentalUseNavigator)(); const toggleRevisions = () => { setIsListViewOpened(false); if (isRevisionsStyleBookOpened) { - goTo('/'); setEditorCanvasContainerView('style-book'); return; } if (isRevisionsOpened) { - goTo('/'); setEditorCanvasContainerView(undefined); return; } - goTo('/revisions'); if (isStyleBookOpened) { setEditorCanvasContainerView('global-styles-revisions:style-book'); } else { @@ -23840,6 +24768,21 @@ function GlobalStylesSidebar() { setIsListViewOpened(isStyleBookOpened && showListViewByDefault); setEditorCanvasContainerView(isStyleBookOpened ? undefined : 'style-book'); }; + const { + getActiveComplementaryArea + } = (0,external_wp_data_namespaceObject.useSelect)(global_styles_sidebar_interfaceStore); + const { + enableComplementaryArea + } = (0,external_wp_data_namespaceObject.useDispatch)(global_styles_sidebar_interfaceStore); + const previousActiveAreaRef = (0,external_wp_element_namespaceObject.useRef)(null); + (0,external_wp_element_namespaceObject.useEffect)(() => { + if (name === 'styles' && canvas === 'edit') { + previousActiveAreaRef.current = getActiveComplementaryArea('core'); + enableComplementaryArea('core', 'edit-site/global-styles'); + } else if (previousActiveAreaRef.current) { + enableComplementaryArea('core', previousActiveAreaRef.current); + } + }, [name, enableComplementaryArea, canvas, getActiveComplementaryArea]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DefaultSidebar, { className: "edit-site-global-styles-sidebar", identifier: "edit-site/global-styles", @@ -23850,35 +24793,37 @@ function GlobalStylesSidebar() { header: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Flex, { className: "edit-site-global-styles-sidebar__header", gap: 1, - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexBlock, { - style: { - minWidth: 'min-content' - }, + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h2", { className: "edit-site-global-styles-sidebar__header-title", children: (0,external_wp_i18n_namespaceObject.__)('Styles') }) - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - icon: library_seen, - label: (0,external_wp_i18n_namespaceObject.__)('Style Book'), - isPressed: isStyleBookOpened || isRevisionsStyleBookOpened, - accessibleWhenDisabled: true, - disabled: shouldClearCanvasContainerView, - onClick: toggleStyleBook, - size: "compact" - }) - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - label: (0,external_wp_i18n_namespaceObject.__)('Revisions'), - icon: library_backup, - onClick: toggleRevisions, - accessibleWhenDisabled: true, - disabled: !hasRevisions, - isPressed: isRevisionsOpened || isRevisionsStyleBookOpened, - size: "compact" - }) - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(GlobalStylesMenuSlot, {})] + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Flex, { + justify: "flex-end", + gap: 1, + className: "edit-site-global-styles-sidebar__header-actions", + children: [!isMobileViewport && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + icon: library_seen, + label: (0,external_wp_i18n_namespaceObject.__)('Style Book'), + isPressed: isStyleBookOpened || isRevisionsStyleBookOpened, + accessibleWhenDisabled: true, + disabled: shouldClearCanvasContainerView, + onClick: toggleStyleBook, + size: "compact" + }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + label: (0,external_wp_i18n_namespaceObject.__)('Revisions'), + icon: library_backup, + onClick: toggleRevisions, + accessibleWhenDisabled: true, + disabled: !hasRevisions, + isPressed: isRevisionsOpened || isRevisionsStyleBookOpened, + size: "compact" + }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(GlobalStylesMenuSlot, {})] + })] }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(global_styles_ui, {}) }); @@ -23985,8 +24930,6 @@ function WelcomeGuideMenuItem() { - - const { ToolsMoreMenuGroup, PreferencesModal @@ -24017,33 +24960,34 @@ function MoreMenu() { + + /** * Internal dependencies */ - +const { + useLocation: use_editor_iframe_props_useLocation, + useHistory: use_editor_iframe_props_useHistory +} = unlock(external_wp_router_namespaceObject.privateApis); function useEditorIframeProps() { const { - canvasMode, - currentPostIsTrashed - } = (0,external_wp_data_namespaceObject.useSelect)(select => { - const { - getCanvasMode - } = unlock(select(store)); - return { - canvasMode: getCanvasMode(), - currentPostIsTrashed: select(external_wp_editor_namespaceObject.store).getCurrentPostAttribute('status') === 'trash' - }; - }, []); + query, + path + } = use_editor_iframe_props_useLocation(); + const history = use_editor_iframe_props_useHistory(); const { - setCanvasMode - } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store)); + canvas = 'view' + } = query; + const currentPostIsTrashed = (0,external_wp_data_namespaceObject.useSelect)(select => { + return select(external_wp_editor_namespaceObject.store).getCurrentPostAttribute('status') === 'trash'; + }, []); const [isFocused, setIsFocused] = (0,external_wp_element_namespaceObject.useState)(false); (0,external_wp_element_namespaceObject.useEffect)(() => { - if (canvasMode === 'edit') { + if (canvas === 'edit') { setIsFocused(false); } - }, [canvasMode]); + }, [canvas]); // In view mode, make the canvas iframe be perceived and behave as a button // to switch to edit mode, with a meaningful label and no title attribute. @@ -24061,12 +25005,18 @@ function useEditorIframeProps() { } = event; if ((keyCode === external_wp_keycodes_namespaceObject.ENTER || keyCode === external_wp_keycodes_namespaceObject.SPACE) && !currentPostIsTrashed) { event.preventDefault(); - setCanvasMode('edit'); + history.navigate((0,external_wp_url_namespaceObject.addQueryArgs)(path, { + canvas: 'edit' + }), { + transition: 'canvas-mode-edit-transition' + }); } }, - onClick: () => { - setCanvasMode('edit'); - }, + onClick: () => history.navigate((0,external_wp_url_namespaceObject.addQueryArgs)(path, { + canvas: 'edit' + }), { + transition: 'canvas-mode-edit-transition' + }), onClickCapture: event => { if (currentPostIsTrashed) { event.preventDefault(); @@ -24077,9 +25027,9 @@ function useEditorIframeProps() { }; return { className: dist_clsx('edit-site-visual-editor__editor-canvas', { - 'is-focused': isFocused && canvasMode === 'view' + 'is-focused': isFocused && canvas === 'view' }), - ...(canvasMode === 'view' ? viewModeIframeProps : {}) + ...(canvas === 'view' ? viewModeIframeProps : {}) }; } @@ -24116,7 +25066,7 @@ function useTitle(title) { } if (title && siteTitle) { // @see https://github.com/WordPress/wordpress-develop/blob/94849898192d271d533e09756007e176feb80697/src/wp-admin/admin-header.php#L67-L68 - const formattedTitle = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: Admin document title. 1: Admin screen name, 2: Network or site name. */ + const formattedTitle = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: Admin document title. 1: Admin screen name, 2: Network or site name. */ (0,external_wp_i18n_namespaceObject.__)('%1$s ‹ %2$s ‹ Editor — WordPress'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(siteTitle)); document.title = formattedTitle; @@ -24132,32 +25082,246 @@ function useTitle(title) { */ + + + + /** * Internal dependencies */ -function useEditorTitle() { +const { + getTemplateInfo +} = unlock(external_wp_editor_namespaceObject.privateApis); +function useEditorTitle(postType, postId) { const { - record: editedPost, - getTitle, - isLoaded: hasLoadedPost - } = useEditedEntityRecord(); - let title; - if (hasLoadedPost) { - var _POST_TYPE_LABELS$edi; - title = (0,external_wp_i18n_namespaceObject.sprintf)( + title, + isLoaded + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + var _select$getEntityReco; + const { + getEditedEntityRecord, + hasFinishedResolution + } = select(external_wp_coreData_namespaceObject.store); + if (!postId) { + return { + isLoaded: false + }; + } + const _record = getEditedEntityRecord('postType', postType, postId); + const { + default_template_types: templateTypes = [] + } = (_select$getEntityReco = select(external_wp_coreData_namespaceObject.store).getEntityRecord('root', '__unstableBase')) !== null && _select$getEntityReco !== void 0 ? _select$getEntityReco : {}; + const templateInfo = getTemplateInfo({ + template: _record, + templateTypes + }); + const _isLoaded = hasFinishedResolution('getEditedEntityRecord', ['postType', postType, postId]); + return { + title: templateInfo.title, + isLoaded: _isLoaded + }; + }, [postType, postId]); + let editorTitle; + if (isLoaded) { + var _POST_TYPE_LABELS$pos; + editorTitle = (0,external_wp_i18n_namespaceObject.sprintf)( // translators: A breadcrumb trail for the Admin document title. 1: title of template being edited, 2: type of template (Template or Template Part). - (0,external_wp_i18n_namespaceObject._x)('%1$s ‹ %2$s', 'breadcrumb trail'), getTitle(), (_POST_TYPE_LABELS$edi = POST_TYPE_LABELS[editedPost.type]) !== null && _POST_TYPE_LABELS$edi !== void 0 ? _POST_TYPE_LABELS$edi : POST_TYPE_LABELS[TEMPLATE_POST_TYPE]); + (0,external_wp_i18n_namespaceObject._x)('%1$s ‹ %2$s', 'breadcrumb trail'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title), (_POST_TYPE_LABELS$pos = POST_TYPE_LABELS[postType]) !== null && _POST_TYPE_LABELS$pos !== void 0 ? _POST_TYPE_LABELS$pos : POST_TYPE_LABELS[TEMPLATE_POST_TYPE]); } // Only announce the title once the editor is ready to prevent "Replace" // action in from double-announcing. - useTitle(hasLoadedPost && title); + useTitle(isLoaded && editorTitle); } /* harmony default export */ const use_editor_title = (useEditorTitle); +;// ./node_modules/@wordpress/edit-site/build-module/components/editor/use-adapt-editor-to-canvas.js +/** + * WordPress dependencies + */ + + + + + +function useAdaptEditorToCanvas(canvas) { + const { + clearSelectedBlock + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); + const { + setDeviceType, + closePublishSidebar, + setIsListViewOpened, + setIsInserterOpened + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_editor_namespaceObject.store); + const { + get: getPreference + } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_preferences_namespaceObject.store); + const registry = (0,external_wp_data_namespaceObject.useRegistry)(); + (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { + const isMediumOrBigger = window.matchMedia('(min-width: 782px)').matches; + registry.batch(() => { + clearSelectedBlock(); + setDeviceType('Desktop'); + closePublishSidebar(); + setIsInserterOpened(false); + + // Check if the block list view should be open by default. + // If `distractionFree` mode is enabled, the block list view should not be open. + // This behavior is disabled for small viewports. + if (isMediumOrBigger && canvas === 'edit' && getPreference('core', 'showListViewByDefault') && !getPreference('core', 'distractionFree')) { + setIsListViewOpened(true); + } else { + setIsListViewOpened(false); + } + }); + }, [canvas, registry, clearSelectedBlock, setDeviceType, closePublishSidebar, setIsInserterOpened, setIsListViewOpened, getPreference]); +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/editor/use-resolve-edited-entity.js +/** + * WordPress dependencies + */ + + + + + +/** + * Internal dependencies + */ + + + +const { + useLocation: use_resolve_edited_entity_useLocation +} = unlock(external_wp_router_namespaceObject.privateApis); +const postTypesWithoutParentTemplate = [TEMPLATE_POST_TYPE, TEMPLATE_PART_POST_TYPE, NAVIGATION_POST_TYPE, PATTERN_TYPES.user]; +const authorizedPostTypes = ['page', 'post']; +function useResolveEditedEntity() { + const { + name, + params = {}, + query + } = use_resolve_edited_entity_useLocation(); + const { + postId = query?.postId + } = params; // Fallback to query param for postId for list view routes. + let postType; + if (name === 'navigation-item') { + postType = NAVIGATION_POST_TYPE; + } else if (name === 'pattern-item') { + postType = PATTERN_TYPES.user; + } else if (name === 'template-part-item') { + postType = TEMPLATE_PART_POST_TYPE; + } else if (name === 'template-item' || name === 'templates') { + postType = TEMPLATE_POST_TYPE; + } else if (name === 'page-item' || name === 'pages') { + postType = 'page'; + } else if (name === 'post-item' || name === 'posts') { + postType = 'post'; + } + const homePage = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getHomePage + } = unlock(select(external_wp_coreData_namespaceObject.store)); + return getHomePage(); + }, []); + + /** + * This is a hook that recreates the logic to resolve a template for a given WordPress postID postTypeId + * in order to match the frontend as closely as possible in the site editor. + * + * It is not possible to rely on the server logic because there maybe unsaved changes that impact the template resolution. + */ + const resolvedTemplateId = (0,external_wp_data_namespaceObject.useSelect)(select => { + // If we're rendering a post type that doesn't have a template + // no need to resolve its template. + if (postTypesWithoutParentTemplate.includes(postType) && postId) { + return; + } + + // Don't trigger resolution for multi-selected posts. + if (postId && postId.includes(',')) { + return; + } + const { + getTemplateId + } = unlock(select(external_wp_coreData_namespaceObject.store)); + + // If we're rendering a specific page, we need to resolve its template. + // The site editor only supports pages for now, not other CPTs. + if (postType && postId && authorizedPostTypes.includes(postType)) { + return getTemplateId(postType, postId); + } + + // If we're rendering the home page, and we have a static home page, resolve its template. + if (homePage?.postType === 'page') { + return getTemplateId('page', homePage?.postId); + } + if (homePage?.postType === 'wp_template') { + return homePage?.postId; + } + }, [homePage, postId, postType]); + const context = (0,external_wp_element_namespaceObject.useMemo)(() => { + if (postTypesWithoutParentTemplate.includes(postType) && postId) { + return {}; + } + if (postType && postId && authorizedPostTypes.includes(postType)) { + return { + postType, + postId + }; + } + // TODO: for post types lists we should probably not render the front page, but maybe a placeholder + // with a message like "Select a page" or something similar. + if (homePage?.postType === 'page') { + return { + postType: 'page', + postId: homePage?.postId + }; + } + return {}; + }, [homePage, postType, postId]); + if (postTypesWithoutParentTemplate.includes(postType) && postId) { + return { + isReady: true, + postType, + postId, + context + }; + } + if (!!homePage) { + return { + isReady: resolvedTemplateId !== undefined, + postType: TEMPLATE_POST_TYPE, + postId: resolvedTemplateId, + context + }; + } + return { + isReady: false + }; +} +function useSyncDeprecatedEntityIntoState({ + postType, + postId, + context, + isReady +}) { + const { + setEditedEntity + } = (0,external_wp_data_namespaceObject.useDispatch)(store); + (0,external_wp_element_namespaceObject.useEffect)(() => { + if (isReady) { + setEditedEntity(postType, postId, context); + } + }, [isReady, postType, postId, context, setEditedEntity]); +} + ;// ./node_modules/@wordpress/edit-site/build-module/components/editor/index.js /** * External dependencies @@ -24181,7 +25345,6 @@ function useEditorTitle() { - /** * Internal dependencies */ @@ -24203,6 +25366,8 @@ function useEditorTitle() { + + const { @@ -24238,79 +25403,88 @@ const siteIconVariants = { clipPath: 'inset(0% round 0px)' } }; +function getListPathForPostType(postType) { + switch (postType) { + case 'navigation': + return '/navigation'; + case 'wp_block': + return '/pattern?postType=wp_block'; + case 'wp_template_part': + return '/pattern?postType=wp_template_part'; + case 'wp_template': + return '/template'; + case 'page': + return '/page'; + case 'post': + return '/'; + } + throw 'Unknown post type'; +} +function getNavigationPath(location, postType) { + const { + path, + name + } = location; + if (['pattern-item', 'template-part-item', 'page-item', 'template-item', 'post-item'].includes(name)) { + return getListPathForPostType(postType); + } + return (0,external_wp_url_namespaceObject.addQueryArgs)(path, { + canvas: undefined + }); +} function EditSiteEditor({ isPostsList = false }) { const disableMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)(); + const location = editor_useLocation(); const { - params - } = editor_useLocation(); + canvas = 'view' + } = location.query; const isLoading = useIsSiteEditorLoading(); + useAdaptEditorToCanvas(canvas); + const entity = useResolveEditedEntity(); + // deprecated sync state with url + useSyncDeprecatedEntityIntoState(entity); + const { + postType, + postId, + context + } = entity; const { - editedPostType, - editedPostId, - contextPostType, - contextPostId, - canvasMode, - isEditingPage, supportsGlobalStyles, - showIconLabels, editorCanvasView, currentPostIsTrashed, hasSiteIcon } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { - getEditorCanvasContainerView, - getEditedPostContext, - getCanvasMode, - isPage, - getEditedPostType, - getEditedPostId + getEditorCanvasContainerView } = unlock(select(store)); - const { - get - } = select(external_wp_preferences_namespaceObject.store); const { getCurrentTheme, getEntityRecord } = select(external_wp_coreData_namespaceObject.store); - const _context = getEditedPostContext(); const siteData = getEntityRecord('root', '__unstableBase', undefined); - - // The currently selected entity to display. - // Typically template or template part in the site editor. return { - editedPostType: getEditedPostType(), - editedPostId: getEditedPostId(), - contextPostType: _context?.postId ? _context.postType : undefined, - contextPostId: _context?.postId ? _context.postId : undefined, - canvasMode: getCanvasMode(), - isEditingPage: isPage(), supportsGlobalStyles: getCurrentTheme()?.is_block_theme, - showIconLabels: get('core', 'showIconLabels'), editorCanvasView: getEditorCanvasContainerView(), currentPostIsTrashed: select(external_wp_editor_namespaceObject.store).getCurrentPostAttribute('status') === 'trash', hasSiteIcon: !!siteData?.site_icon_url }; }, []); - use_editor_title(); + const postWithTemplate = !!context?.postId; + use_editor_title(postWithTemplate ? context.postType : postType, postWithTemplate ? context.postId : postId); const _isPreviewingTheme = isPreviewingTheme(); const hasDefaultEditorCanvasView = !useHasEditorCanvasContainer(); const iframeProps = useEditorIframeProps(); - const isEditMode = canvasMode === 'edit'; - const postWithTemplate = !!contextPostId; + const isEditMode = canvas === 'edit'; const loadingProgressId = (0,external_wp_compose_namespaceObject.useInstanceId)(CanvasLoader, 'edit-site-editor__loading-progress'); const settings = useSpecificEditorSettings(); const styles = (0,external_wp_element_namespaceObject.useMemo)(() => [...settings.styles, { // Forming a "block formatting context" to prevent margin collapsing. // @see https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context - css: canvasMode === 'view' ? `body{min-height: 100vh; ${currentPostIsTrashed ? '' : 'cursor: pointer;'}}` : undefined - }], [settings.styles, canvasMode, currentPostIsTrashed]); + css: canvas === 'view' ? `body{min-height: 100vh; ${currentPostIsTrashed ? '' : 'cursor: pointer;'}}` : undefined + }], [settings.styles, canvas, currentPostIsTrashed]); const { - setCanvasMode - } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store)); - const { - __unstableSetEditorMode, resetZoomLevel } = unlock((0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store)); const { @@ -24322,9 +25496,7 @@ function EditSiteEditor({ case 'move-to-trash': case 'delete-post': { - history.push({ - postType: items[0].type - }); + history.navigate(getListPathForPostType(postWithTemplate ? context.postType : postType)); } break; case 'duplicate-post': @@ -24339,18 +25511,14 @@ function EditSiteEditor({ actions: [{ label: (0,external_wp_i18n_namespaceObject.__)('Edit'), onClick: () => { - history.push({ - postId: newItem.id, - postType: newItem.type, - canvas: 'edit' - }); + history.navigate(`/${newItem.type}/${newItem.id}?canvas=edit`); } }] }); } break; } - }, [history, createSuccessNotice]); + }, [postType, context?.postType, postWithTemplate, history, createSuccessNotice]); // Replace the title and icon displayed in the DocumentBar when there's an overlay visible. const title = getEditorCanvasContainerTitle(editorCanvasView); @@ -24359,16 +25527,18 @@ function EditSiteEditor({ duration: disableMotion ? 0 : 0.2 }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(GlobalStylesRenderer, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.EditorKeyboardShortcutsRegister, {}), isEditMode && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockKeyboardShortcuts, {}), !isReady ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CanvasLoader, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(GlobalStylesRenderer, { + disableRootPadding: postType !== TEMPLATE_POST_TYPE + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.EditorKeyboardShortcutsRegister, {}), isEditMode && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockKeyboardShortcuts, {}), !isReady ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CanvasLoader, { id: loadingProgressId - }) : null, isEditMode && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuide, {}), isReady && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(Editor, { - postType: postWithTemplate ? contextPostType : editedPostType, - postId: postWithTemplate ? contextPostId : editedPostId, - templateId: postWithTemplate ? editedPostId : undefined, + }) : null, isEditMode && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuide, { + postType: postWithTemplate ? context.postType : postType + }), isReady && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(Editor, { + postType: postWithTemplate ? context.postType : postType, + postId: postWithTemplate ? context.postId : postId, + templateId: postWithTemplate ? postId : undefined, settings: settings, - className: dist_clsx('edit-site-editor__editor-interface', { - 'show-icon-labels': showIconLabels - }), + className: "edit-site-editor__editor-interface", styles: styles, customSaveButton: _isPreviewingTheme && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SaveButton, { size: "compact" @@ -24378,7 +25548,7 @@ function EditSiteEditor({ title: title, iframeProps: iframeProps, onActionPerformed: onActionPerformed, - extraSidebarPanels: !isEditingPage && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(plugin_template_setting_panel.Slot, {}), + extraSidebarPanels: !postWithTemplate && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(plugin_template_setting_panel.Slot, {}), children: [isEditMode && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BackButton, { children: ({ length @@ -24395,16 +25565,17 @@ function EditSiteEditor({ showTooltip: true, tooltipPosition: "middle right", onClick: () => { - setCanvasMode('view'); - __unstableSetEditorMode('edit'); resetZoomLevel(); // TODO: this is a temporary solution to navigate to the posts list if we are // come here through `posts list` and are in focus mode editing a template, template part etc.. - if (isPostsList && params?.focusMode) { - history.push({ - page: 'gutenberg-posts-dashboard', - postType: 'post' + if (isPostsList && location.query?.focusMode) { + history.navigate('/', { + transition: 'canvas-mode-view-transition' + }); + } else { + history.navigate(getNavigationPath(location, postWithTemplate ? context.postType : postType), { + transition: 'canvas-mode-view-transition' }); } }, @@ -24429,6 +25600,1854 @@ function EditSiteEditor({ }); } +;// ./node_modules/@wordpress/edit-site/build-module/components/maybe-editor/index.js +/* wp:polyfill */ +/** + * WordPress dependencies + */ + + + + + +/** + * Internal dependencies + */ + + + +function MaybeEditor({ + showEditor = true +}) { + const { + isBlockBasedTheme, + siteUrl + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getEntityRecord, + getCurrentTheme + } = select(external_wp_coreData_namespaceObject.store); + const siteData = getEntityRecord('root', '__unstableBase'); + return { + isBlockBasedTheme: getCurrentTheme()?.is_block_theme, + siteUrl: siteData?.home + }; + }, []); + + // If theme is block based, return the Editor, otherwise return the site preview. + return isBlockBasedTheme || showEditor ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, {}) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("iframe", { + src: siteUrl, + title: (0,external_wp_i18n_namespaceObject.__)('Site Preview'), + style: { + display: 'block', + width: '100%', + height: '100%', + backgroundColor: '#fff' + }, + onLoad: event => { + // Hide the admin bar in the front-end preview. + const document = event.target.contentDocument; + document.getElementById('wpadminbar').remove(); + document.getElementsByTagName('html')[0].setAttribute('style', 'margin-top: 0 !important;'); + document.getElementsByTagName('body')[0].classList.remove('admin-bar'); + // Make interactive elements unclickable. + const interactiveElements = document.querySelectorAll('a, button, input, details, audio'); + interactiveElements.forEach(element => { + element.style.pointerEvents = 'none'; + element.tabIndex = -1; + element.setAttribute('aria-hidden', 'true'); + }); + } + }); +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/site-editor-routes/home.js +/** + * Internal dependencies + */ + + + +const homeRoute = { + name: 'home', + path: '/', + areas: { + sidebar: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenMain, {}), + preview: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MaybeEditor, { + showEditor: false + }), + mobile: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenMain, {}) + } +}; + +;// ./node_modules/@wordpress/edit-site/build-module/components/site-editor-routes/styles.js +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + + + + + +const { + useLocation: styles_useLocation +} = unlock(external_wp_router_namespaceObject.privateApis); +function MobileGlobalStylesUI() { + const { + query = {} + } = styles_useLocation(); + const { + canvas + } = query; + if (canvas === 'edit') { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, {}); + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(GlobalStylesUIWrapper, {}); +} +const stylesRoute = { + name: 'styles', + path: '/styles', + areas: { + content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(GlobalStylesUIWrapper, {}), + sidebar: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenGlobalStyles, { + backPath: "/" + }), + preview({ + query + }) { + const isStylebook = query.preview === 'stylebook'; + return isStylebook ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(StyleBookPreview, {}) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, {}); + }, + mobile: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MobileGlobalStylesUI, {}) + }, + widths: { + content: 380 + } +}; + +;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js +// This requested is preloaded in `gutenberg_preload_navigation_posts`. +// As unbounded queries are limited to 100 by `fetchAllMiddleware` +// on apiFetch this query is limited to 100. +// These parameters must be kept aligned with those in +// lib/compat/wordpress-6.3/navigation-block-preloading.php +// and +// block-library/src/navigation/constants.js +const PRELOADED_NAVIGATION_MENUS_QUERY = { + per_page: 100, + status: ['publish', 'draft'], + order: 'desc', + orderby: 'date' +}; + +;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +/** + * WordPress dependencies + */ + + + + +const notEmptyString = testString => testString?.trim()?.length > 0; +function RenameModal({ + menuTitle, + onClose, + onSave +}) { + const [editedMenuTitle, setEditedMenuTitle] = (0,external_wp_element_namespaceObject.useState)(menuTitle); + const titleHasChanged = editedMenuTitle !== menuTitle; + const isEditedMenuTitleValid = titleHasChanged && notEmptyString(editedMenuTitle); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Modal, { + title: (0,external_wp_i18n_namespaceObject.__)('Rename'), + onRequestClose: onClose, + focusOnMount: "firstContentElement", + size: "small", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("form", { + className: "sidebar-navigation__rename-modal-form", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { + spacing: "3", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { + __nextHasNoMarginBottom: true, + __next40pxDefaultSize: true, + value: editedMenuTitle, + placeholder: (0,external_wp_i18n_namespaceObject.__)('Navigation title'), + onChange: setEditedMenuTitle, + label: (0,external_wp_i18n_namespaceObject.__)('Name') + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { + justify: "right", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + __next40pxDefaultSize: true, + variant: "tertiary", + onClick: onClose, + children: (0,external_wp_i18n_namespaceObject.__)('Cancel') + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + __next40pxDefaultSize: true, + accessibleWhenDisabled: true, + disabled: !isEditedMenuTitleValid, + variant: "primary", + type: "submit", + onClick: e => { + e.preventDefault(); + if (!isEditedMenuTitleValid) { + return; + } + onSave({ + title: editedMenuTitle + }); + + // Immediate close avoids ability to hit save multiple times. + onClose(); + }, + children: (0,external_wp_i18n_namespaceObject.__)('Save') + })] + })] + }) + }) + }); +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js +/** + * WordPress dependencies + */ + + + +function DeleteConfirmDialog({ + onClose, + onConfirm +}) { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalConfirmDialog, { + isOpen: true, + onConfirm: () => { + onConfirm(); + + // Immediate close avoids ability to hit delete multiple times. + onClose(); + }, + onCancel: onClose, + confirmButtonText: (0,external_wp_i18n_namespaceObject.__)('Delete'), + size: "medium", + children: (0,external_wp_i18n_namespaceObject.__)('Are you sure you want to delete this Navigation Menu?') + }); +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js +/** + * WordPress dependencies + */ + + + + + + +/** + * Internal dependencies + */ + + + + +const { + useHistory: more_menu_useHistory +} = unlock(external_wp_router_namespaceObject.privateApis); +const POPOVER_PROPS = { + position: 'bottom right' +}; +function ScreenNavigationMoreMenu(props) { + const { + onDelete, + onSave, + onDuplicate, + menuTitle, + menuId + } = props; + const [renameModalOpen, setRenameModalOpen] = (0,external_wp_element_namespaceObject.useState)(false); + const [deleteConfirmDialogOpen, setDeleteConfirmDialogOpen] = (0,external_wp_element_namespaceObject.useState)(false); + const history = more_menu_useHistory(); + const closeModals = () => { + setRenameModalOpen(false); + setDeleteConfirmDialogOpen(false); + }; + const openRenameModal = () => setRenameModalOpen(true); + const openDeleteConfirmDialog = () => setDeleteConfirmDialogOpen(true); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.DropdownMenu, { + className: "sidebar-navigation__more-menu", + label: (0,external_wp_i18n_namespaceObject.__)('Actions'), + icon: more_vertical, + popoverProps: POPOVER_PROPS, + children: ({ + onClose + }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.MenuGroup, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { + onClick: () => { + openRenameModal(); + // Close the dropdown after opening the modal. + onClose(); + }, + children: (0,external_wp_i18n_namespaceObject.__)('Rename') + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { + onClick: () => { + history.navigate(`/wp_navigation/${menuId}?canvas=edit`); + }, + children: (0,external_wp_i18n_namespaceObject.__)('Edit') + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { + onClick: () => { + onDuplicate(); + onClose(); + }, + children: (0,external_wp_i18n_namespaceObject.__)('Duplicate') + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { + isDestructive: true, + onClick: () => { + openDeleteConfirmDialog(); + + // Close the dropdown after opening the modal. + onClose(); + }, + children: (0,external_wp_i18n_namespaceObject.__)('Delete') + })] + }) + }) + }), deleteConfirmDialogOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DeleteConfirmDialog, { + onClose: closeModals, + onConfirm: onDelete + }), renameModalOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(RenameModal, { + onClose: closeModals, + menuTitle: menuTitle, + onSave: onSave + })] + }); +} + +;// ./node_modules/@wordpress/icons/build-module/library/chevron-up.js +/** + * WordPress dependencies + */ + + +const chevronUp = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + viewBox: "0 0 24 24", + xmlns: "http://www.w3.org/2000/svg", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z" + }) +}); +/* harmony default export */ const chevron_up = (chevronUp); + +;// ./node_modules/@wordpress/icons/build-module/library/chevron-down.js +/** + * WordPress dependencies + */ + + +const chevronDown = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + viewBox: "0 0 24 24", + xmlns: "http://www.w3.org/2000/svg", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z" + }) +}); +/* harmony default export */ const chevron_down = (chevronDown); + +;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +/** + * WordPress dependencies + */ + + + + + + + + +const leaf_more_menu_POPOVER_PROPS = { + className: 'block-editor-block-settings-menu__popover', + placement: 'bottom-start' +}; + +/** + * Internal dependencies + */ + + +const { + useHistory: leaf_more_menu_useHistory, + useLocation: leaf_more_menu_useLocation +} = unlock(external_wp_router_namespaceObject.privateApis); +function LeafMoreMenu(props) { + const history = leaf_more_menu_useHistory(); + const { + path + } = leaf_more_menu_useLocation(); + const { + block + } = props; + const { + clientId + } = block; + const { + moveBlocksDown, + moveBlocksUp, + removeBlocks + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); + const removeLabel = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: block name */ + (0,external_wp_i18n_namespaceObject.__)('Remove %s'), (0,external_wp_blockEditor_namespaceObject.BlockTitle)({ + clientId, + maximumLength: 25 + })); + const goToLabel = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: block name */ + (0,external_wp_i18n_namespaceObject.__)('Go to %s'), (0,external_wp_blockEditor_namespaceObject.BlockTitle)({ + clientId, + maximumLength: 25 + })); + const rootClientId = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getBlockRootClientId + } = select(external_wp_blockEditor_namespaceObject.store); + return getBlockRootClientId(clientId); + }, [clientId]); + const onGoToPage = (0,external_wp_element_namespaceObject.useCallback)(selectedBlock => { + const { + attributes, + name + } = selectedBlock; + if (attributes.kind === 'post-type' && attributes.id && attributes.type && history) { + history.navigate(`/${attributes.type}/${attributes.id}?canvas=edit`, { + state: { + backPath: path + } + }); + } + if (name === 'core/page-list-item' && attributes.id && history) { + history.navigate(`/page/${attributes.id}?canvas=edit`, { + state: { + backPath: path + } + }); + } + }, [path, history]); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.DropdownMenu, { + icon: more_vertical, + label: (0,external_wp_i18n_namespaceObject.__)('Options'), + className: "block-editor-block-settings-menu", + popoverProps: leaf_more_menu_POPOVER_PROPS, + noIcons: true, + ...props, + children: ({ + onClose + }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.MenuGroup, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { + icon: chevron_up, + onClick: () => { + moveBlocksUp([clientId], rootClientId); + onClose(); + }, + children: (0,external_wp_i18n_namespaceObject.__)('Move up') + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { + icon: chevron_down, + onClick: () => { + moveBlocksDown([clientId], rootClientId); + onClose(); + }, + children: (0,external_wp_i18n_namespaceObject.__)('Move down') + }), block.attributes?.type === 'page' && block.attributes?.id && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { + onClick: () => { + onGoToPage(block); + onClose(); + }, + children: goToLabel + })] + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { + onClick: () => { + removeBlocks([clientId], false); + onClose(); + }, + children: removeLabel + }) + })] + }) + }); +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +/** + * WordPress dependencies + */ + + + + + + +/** + * Internal dependencies + */ + + + +const { + PrivateListView +} = unlock(external_wp_blockEditor_namespaceObject.privateApis); + +// Needs to be kept in sync with the query used at packages/block-library/src/page-list/edit.js. +const MAX_PAGE_COUNT = 100; +const PAGES_QUERY = ['postType', 'page', { + per_page: MAX_PAGE_COUNT, + _fields: ['id', 'link', 'menu_order', 'parent', 'title', 'type'], + // TODO: When https://core.trac.wordpress.org/ticket/39037 REST API support for multiple orderby + // values is resolved, update 'orderby' to [ 'menu_order', 'post_title' ] to provide a consistent + // sort. + orderby: 'menu_order', + order: 'asc' +}]; +function NavigationMenuContent({ + rootClientId +}) { + const { + listViewRootClientId, + isLoading + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + areInnerBlocksControlled, + getBlockName, + getBlockCount, + getBlockOrder + } = select(external_wp_blockEditor_namespaceObject.store); + const { + isResolving + } = select(external_wp_coreData_namespaceObject.store); + const blockClientIds = getBlockOrder(rootClientId); + const hasOnlyPageListBlock = blockClientIds.length === 1 && getBlockName(blockClientIds[0]) === 'core/page-list'; + const pageListHasBlocks = hasOnlyPageListBlock && getBlockCount(blockClientIds[0]) > 0; + const isLoadingPages = isResolving('getEntityRecords', PAGES_QUERY); + return { + listViewRootClientId: pageListHasBlocks ? blockClientIds[0] : rootClientId, + // This is a small hack to wait for the navigation block + // to actually load its inner blocks. + isLoading: !areInnerBlocksControlled(rootClientId) || isLoadingPages + }; + }, [rootClientId]); + const { + replaceBlock, + __unstableMarkNextChangeAsNotPersistent + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); + const offCanvasOnselect = (0,external_wp_element_namespaceObject.useCallback)(block => { + if (block.name === 'core/navigation-link' && !block.attributes.url) { + __unstableMarkNextChangeAsNotPersistent(); + replaceBlock(block.clientId, (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link', block.attributes)); + } + }, [__unstableMarkNextChangeAsNotPersistent, replaceBlock]); + + // The hidden block is needed because it makes block edit side effects trigger. + // For example a navigation page list load its items has an effect on edit to load its items. + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [!isLoading && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PrivateListView, { + rootClientId: listViewRootClientId, + onSelect: offCanvasOnselect, + blockSettingsMenu: LeafMoreMenu, + showAppender: false + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: "edit-site-sidebar-navigation-screen-navigation-menus__helper-block-editor", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockList, {}) + })] + }); +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js +/** + * WordPress dependencies + */ + + + + + +/** + * Internal dependencies + */ + + + + +const navigation_menu_editor_noop = () => {}; +function NavigationMenuEditor({ + navigationMenuId +}) { + const { + storedSettings + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getSettings + } = unlock(select(store)); + return { + storedSettings: getSettings() + }; + }, []); + const blocks = (0,external_wp_element_namespaceObject.useMemo)(() => { + if (!navigationMenuId) { + return []; + } + return [(0,external_wp_blocks_namespaceObject.createBlock)('core/navigation', { + ref: navigationMenuId + })]; + }, [navigationMenuId]); + if (!navigationMenuId || !blocks?.length) { + return null; + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockEditorProvider, { + settings: storedSettings, + value: blocks, + onChange: navigation_menu_editor_noop, + onInput: navigation_menu_editor_noop, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: "edit-site-sidebar-navigation-screen-navigation-menus__content", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationMenuContent, { + rootClientId: blocks[0].clientId + }) + }) + }); +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js +/** + * WordPress dependencies + */ + + + +// Copied from packages/block-library/src/navigation/edit/navigation-menu-selector.js. +function buildNavigationLabel(title, id, status) { + if (!title?.rendered) { + /* translators: %s: the index of the menu in the list of menus. */ + return (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('(no title %s)'), id); + } + if (status === 'publish') { + return (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title?.rendered); + } + return (0,external_wp_i18n_namespaceObject.sprintf)( + // translators: 1: title of the menu. 2: status of the menu (draft, pending, etc.). + (0,external_wp_i18n_namespaceObject._x)('%1$s (%2$s)', 'menu label'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title?.rendered), status); +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + + + + +function SingleNavigationMenu({ + navigationMenu, + backPath, + handleDelete, + handleDuplicate, + handleSave +}) { + const menuTitle = navigationMenu?.title?.rendered; + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenWrapper, { + actions: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ScreenNavigationMoreMenu, { + menuId: navigationMenu?.id, + menuTitle: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(menuTitle), + onDelete: handleDelete, + onSave: handleSave, + onDuplicate: handleDuplicate + }) + }), + backPath: backPath, + title: buildNavigationLabel(navigationMenu?.title, navigationMenu?.id, navigationMenu?.status), + description: (0,external_wp_i18n_namespaceObject.__)('Navigation Menus are a curated collection of blocks that allow visitors to get around your site.'), + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationMenuEditor, { + navigationMenuId: navigationMenu?.id + }) + }); +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-navigation-menu/index.js +/** + * WordPress dependencies + */ + + + + + + + +/** + * Internal dependencies + */ + + + + + + + +const { + useLocation: sidebar_navigation_screen_navigation_menu_useLocation +} = unlock(external_wp_router_namespaceObject.privateApis); +const postType = `wp_navigation`; +function SidebarNavigationScreenNavigationMenu({ + backPath +}) { + const { + params: { + postId + } + } = sidebar_navigation_screen_navigation_menu_useLocation(); + const { + record: navigationMenu, + isResolving + } = (0,external_wp_coreData_namespaceObject.useEntityRecord)('postType', postType, postId); + const { + isSaving, + isDeleting + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + isSavingEntityRecord, + isDeletingEntityRecord + } = select(external_wp_coreData_namespaceObject.store); + return { + isSaving: isSavingEntityRecord('postType', postType, postId), + isDeleting: isDeletingEntityRecord('postType', postType, postId) + }; + }, [postId]); + const isLoading = isResolving || isSaving || isDeleting; + const menuTitle = navigationMenu?.title?.rendered || navigationMenu?.slug; + const { + handleSave, + handleDelete, + handleDuplicate + } = useNavigationMenuHandlers(); + const _handleDelete = () => handleDelete(navigationMenu); + const _handleSave = edits => handleSave(navigationMenu, edits); + const _handleDuplicate = () => handleDuplicate(navigationMenu); + if (isLoading) { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenWrapper, { + description: (0,external_wp_i18n_namespaceObject.__)('Navigation Menus are a curated collection of blocks that allow visitors to get around your site.'), + backPath: backPath, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, { + className: "edit-site-sidebar-navigation-screen-navigation-menus__loading" + }) + }); + } + if (!isLoading && !navigationMenu) { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenWrapper, { + description: (0,external_wp_i18n_namespaceObject.__)('Navigation Menu missing.'), + backPath: backPath + }); + } + if (!navigationMenu?.content?.raw) { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenWrapper, { + actions: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ScreenNavigationMoreMenu, { + menuId: navigationMenu?.id, + menuTitle: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(menuTitle), + onDelete: _handleDelete, + onSave: _handleSave, + onDuplicate: _handleDuplicate + }), + backPath: backPath, + title: buildNavigationLabel(navigationMenu?.title, navigationMenu?.id, navigationMenu?.status), + description: (0,external_wp_i18n_namespaceObject.__)('This Navigation Menu is empty.') + }); + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SingleNavigationMenu, { + navigationMenu: navigationMenu, + backPath: backPath, + handleDelete: _handleDelete, + handleSave: _handleSave, + handleDuplicate: _handleDuplicate + }); +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +/** + * WordPress dependencies + */ + + + + + + +/** + * Internal dependencies + */ + + + +const { + useHistory: use_navigation_menu_handlers_useHistory +} = unlock(external_wp_router_namespaceObject.privateApis); +function useDeleteNavigationMenu() { + const { + deleteEntityRecord + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); + const { + createSuccessNotice, + createErrorNotice + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); + const history = use_navigation_menu_handlers_useHistory(); + const handleDelete = async navigationMenu => { + const postId = navigationMenu?.id; + try { + await deleteEntityRecord('postType', postType, postId, { + force: true + }, { + throwOnError: true + }); + createSuccessNotice((0,external_wp_i18n_namespaceObject.__)('Navigation Menu successfully deleted.'), { + type: 'snackbar' + }); + history.navigate('/navigation'); + } catch (error) { + createErrorNotice((0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: error message describing why the navigation menu could not be deleted. */ + (0,external_wp_i18n_namespaceObject.__)(`Unable to delete Navigation Menu (%s).`), error?.message), { + type: 'snackbar' + }); + } + }; + return handleDelete; +} +function useSaveNavigationMenu() { + const { + getEditedEntityRecord + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getEditedEntityRecord: getEditedEntityRecordSelector + } = select(external_wp_coreData_namespaceObject.store); + return { + getEditedEntityRecord: getEditedEntityRecordSelector + }; + }, []); + const { + editEntityRecord, + __experimentalSaveSpecifiedEntityEdits: saveSpecifiedEntityEdits + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); + const { + createSuccessNotice, + createErrorNotice + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); + const handleSave = async (navigationMenu, edits) => { + if (!edits) { + return; + } + const postId = navigationMenu?.id; + // Prepare for revert in case of error. + const originalRecord = getEditedEntityRecord('postType', NAVIGATION_POST_TYPE, postId); + + // Apply the edits. + editEntityRecord('postType', postType, postId, edits); + const recordPropertiesToSave = Object.keys(edits); + + // Attempt to persist. + try { + await saveSpecifiedEntityEdits('postType', postType, postId, recordPropertiesToSave, { + throwOnError: true + }); + createSuccessNotice((0,external_wp_i18n_namespaceObject.__)('Renamed Navigation Menu'), { + type: 'snackbar' + }); + } catch (error) { + // Revert to original in case of error. + editEntityRecord('postType', postType, postId, originalRecord); + createErrorNotice((0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: error message describing why the navigation menu could not be renamed. */ + (0,external_wp_i18n_namespaceObject.__)(`Unable to rename Navigation Menu (%s).`), error?.message), { + type: 'snackbar' + }); + } + }; + return handleSave; +} +function useDuplicateNavigationMenu() { + const history = use_navigation_menu_handlers_useHistory(); + const { + saveEntityRecord + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); + const { + createSuccessNotice, + createErrorNotice + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); + const handleDuplicate = async navigationMenu => { + const menuTitle = navigationMenu?.title?.rendered || navigationMenu?.slug; + try { + const savedRecord = await saveEntityRecord('postType', postType, { + title: (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: Navigation menu title */ + (0,external_wp_i18n_namespaceObject._x)('%s (Copy)', 'navigation menu'), menuTitle), + content: navigationMenu?.content?.raw, + status: 'publish' + }, { + throwOnError: true + }); + if (savedRecord) { + createSuccessNotice((0,external_wp_i18n_namespaceObject.__)('Duplicated Navigation Menu'), { + type: 'snackbar' + }); + history.navigate(`/wp_navigation/${savedRecord.id}`); + } + } catch (error) { + createErrorNotice((0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: error message describing why the navigation menu could not be deleted. */ + (0,external_wp_i18n_namespaceObject.__)(`Unable to duplicate Navigation Menu (%s).`), error?.message), { + type: 'snackbar' + }); + } + }; + return handleDuplicate; +} +function useNavigationMenuHandlers() { + return { + handleDelete: useDeleteNavigationMenu(), + handleSave: useSaveNavigationMenu(), + handleDuplicate: useDuplicateNavigationMenu() + }; +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +/** + * WordPress dependencies + */ + + + + + + + +/** + * Internal dependencies + */ + + + + + + + + +// Copied from packages/block-library/src/navigation/edit/navigation-menu-selector.js. + +function buildMenuLabel(title, id, status) { + if (!title) { + /* translators: %s: the index of the menu in the list of menus. */ + return (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('(no title %s)'), id); + } + if (status === 'publish') { + return (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title); + } + return (0,external_wp_i18n_namespaceObject.sprintf)( + // translators: 1: title of the menu. 2: status of the menu (draft, pending, etc.). + (0,external_wp_i18n_namespaceObject._x)('%1$s (%2$s)', 'menu label'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title), status); +} +function SidebarNavigationScreenNavigationMenus({ + backPath +}) { + const { + records: navigationMenus, + isResolving: isResolvingNavigationMenus, + hasResolved: hasResolvedNavigationMenus + } = (0,external_wp_coreData_namespaceObject.useEntityRecords)('postType', NAVIGATION_POST_TYPE, PRELOADED_NAVIGATION_MENUS_QUERY); + const isLoading = isResolvingNavigationMenus && !hasResolvedNavigationMenus; + const { + getNavigationFallbackId + } = unlock((0,external_wp_data_namespaceObject.useSelect)(external_wp_coreData_namespaceObject.store)); + const isCreatingNavigationFallback = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).isResolving('getNavigationFallbackId'), []); + const firstNavigationMenu = navigationMenus?.[0]; + + // If there is no navigation menu found + // then trigger fallback algorithm to create one. + if (!firstNavigationMenu && !isResolvingNavigationMenus && hasResolvedNavigationMenus && + // Ensure a fallback navigation is created only once + !isCreatingNavigationFallback) { + getNavigationFallbackId(); + } + const { + handleSave, + handleDelete, + handleDuplicate + } = useNavigationMenuHandlers(); + const hasNavigationMenus = !!navigationMenus?.length; + if (isLoading) { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenWrapper, { + backPath: backPath, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, { + className: "edit-site-sidebar-navigation-screen-navigation-menus__loading" + }) + }); + } + if (!isLoading && !hasNavigationMenus) { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenWrapper, { + description: (0,external_wp_i18n_namespaceObject.__)('No Navigation Menus found.'), + backPath: backPath + }); + } + + // if single menu then render it + if (navigationMenus?.length === 1) { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SingleNavigationMenu, { + navigationMenu: firstNavigationMenu, + backPath: backPath, + handleDelete: () => handleDelete(firstNavigationMenu), + handleDuplicate: () => handleDuplicate(firstNavigationMenu), + handleSave: edits => handleSave(firstNavigationMenu, edits) + }); + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenWrapper, { + backPath: backPath, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalItemGroup, { + className: "edit-site-sidebar-navigation-screen-navigation-menus", + children: navigationMenus?.map(({ + id, + title, + status + }, index) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavMenuItem, { + postId: id, + withChevron: true, + icon: library_navigation, + children: buildMenuLabel(title?.rendered, index + 1, status) + }, id)) + }) + }); +} +function SidebarNavigationScreenWrapper({ + children, + actions, + title, + description, + backPath +}) { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreen, { + title: title || (0,external_wp_i18n_namespaceObject.__)('Navigation'), + actions: actions, + description: description || (0,external_wp_i18n_namespaceObject.__)('Manage your Navigation Menus.'), + backPath: backPath, + content: children + }); +} +const NavMenuItem = ({ + postId, + ...props +}) => { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationItem, { + to: `/wp_navigation/${postId}`, + ...props + }); +}; + +;// ./node_modules/@wordpress/edit-site/build-module/components/site-editor-routes/navigation.js +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + + + +const { + useLocation: navigation_useLocation +} = unlock(external_wp_router_namespaceObject.privateApis); +function MobileNavigationView() { + const { + query = {} + } = navigation_useLocation(); + const { + canvas = 'view' + } = query; + return canvas === 'edit' ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, {}) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenNavigationMenus, { + backPath: "/" + }); +} +const navigationRoute = { + name: 'navigation', + path: '/navigation', + areas: { + sidebar: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenNavigationMenus, { + backPath: "/" + }), + preview: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, {}), + mobile: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MobileNavigationView, {}) + } +}; + +;// ./node_modules/@wordpress/edit-site/build-module/components/site-editor-routes/navigation-item.js +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + + + + +const { + useLocation: navigation_item_useLocation +} = unlock(external_wp_router_namespaceObject.privateApis); +function MobileNavigationItemView() { + const { + query = {} + } = navigation_item_useLocation(); + const { + canvas = 'view' + } = query; + return canvas === 'edit' ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, {}) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenNavigationMenu, { + backPath: { + postType: NAVIGATION_POST_TYPE + } + }); +} +const navigationItemRoute = { + name: 'navigation-item', + path: '/wp_navigation/:postId', + areas: { + sidebar: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenNavigationMenu, { + backPath: "/navigation" + }), + preview: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, {}), + mobile: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MobileNavigationItemView, {}) + } +}; + +;// ./node_modules/@wordpress/icons/build-module/library/file.js +/** + * WordPress dependencies + */ + + +const file = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + viewBox: "0 0 24 24", + xmlns: "http://www.w3.org/2000/svg", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M12.848 8a1 1 0 0 1-.914-.594l-.723-1.63a.5.5 0 0 0-.447-.276H5a.5.5 0 0 0-.5.5v11.5a.5.5 0 0 0 .5.5h14a.5.5 0 0 0 .5-.5v-9A.5.5 0 0 0 19 8h-6.152Zm.612-1.5a.5.5 0 0 1-.462-.31l-.445-1.084A2 2 0 0 0 10.763 4H5a2 2 0 0 0-2 2v11.5a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-9a2 2 0 0 0-2-2h-5.54Z" + }) +}); +/* harmony default export */ const library_file = (file); + +;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-patterns/category-item.js +/** + * Internal dependencies + */ + + +function CategoryItem({ + count, + icon, + id, + isActive, + label, + type +}) { + if (!count) { + return; + } + const queryArgs = [`postType=${type}`]; + if (id) { + queryArgs.push(`categoryId=${id}`); + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationItem, { + icon: icon, + suffix: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { + children: count + }), + "aria-current": isActive ? 'true' : undefined, + to: `/pattern?${queryArgs.join('&')}`, + children: label + }); +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-patterns/use-default-pattern-categories.js +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + +function useDefaultPatternCategories() { + const blockPatternCategories = (0,external_wp_data_namespaceObject.useSelect)(select => { + var _settings$__experimen; + const { + getSettings + } = unlock(select(store)); + const settings = getSettings(); + return (_settings$__experimen = settings.__experimentalAdditionalBlockPatternCategories) !== null && _settings$__experimen !== void 0 ? _settings$__experimen : settings.__experimentalBlockPatternCategories; + }); + const restBlockPatternCategories = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getBlockPatternCategories()); + return [...(blockPatternCategories || []), ...(restBlockPatternCategories || [])]; +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/page-patterns/utils.js +const filterOutDuplicatesByName = (currentItem, index, items) => index === items.findIndex(item => currentItem.name === item.name); + +;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js +/* wp:polyfill */ +/** + * WordPress dependencies + */ + + + + +/** + * Internal dependencies + */ + + + + +function useThemePatterns() { + const blockPatterns = (0,external_wp_data_namespaceObject.useSelect)(select => { + var _getSettings$__experi; + const { + getSettings + } = unlock(select(store)); + return (_getSettings$__experi = getSettings().__experimentalAdditionalBlockPatterns) !== null && _getSettings$__experi !== void 0 ? _getSettings$__experi : getSettings().__experimentalBlockPatterns; + }); + const restBlockPatterns = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getBlockPatterns()); + const patterns = (0,external_wp_element_namespaceObject.useMemo)(() => [...(blockPatterns || []), ...(restBlockPatterns || [])].filter(pattern => !EXCLUDED_PATTERN_SOURCES.includes(pattern.source)).filter(filterOutDuplicatesByName).filter(pattern => pattern.inserter !== false), [blockPatterns, restBlockPatterns]); + return patterns; +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/page-patterns/search-items.js +/* wp:polyfill */ +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + +const { + extractWords, + getNormalizedSearchTerms, + normalizeString +} = unlock(external_wp_blockEditor_namespaceObject.privateApis); + +/** + * Internal dependencies + */ + + +// Default search helpers. +const defaultGetName = item => { + if (item.type === PATTERN_TYPES.user) { + return item.slug; + } + if (item.type === TEMPLATE_PART_POST_TYPE) { + return ''; + } + return item.name || ''; +}; +const defaultGetTitle = item => { + if (typeof item.title === 'string') { + return item.title; + } + if (item.title && item.title.rendered) { + return item.title.rendered; + } + if (item.title && item.title.raw) { + return item.title.raw; + } + return ''; +}; +const defaultGetDescription = item => { + if (item.type === PATTERN_TYPES.user) { + return item.excerpt.raw; + } + return item.description || ''; +}; +const defaultGetKeywords = item => item.keywords || []; +const defaultHasCategory = () => false; +const removeMatchingTerms = (unmatchedTerms, unprocessedTerms) => { + return unmatchedTerms.filter(term => !getNormalizedSearchTerms(unprocessedTerms).some(unprocessedTerm => unprocessedTerm.includes(term))); +}; + +/** + * Filters an item list given a search term. + * + * @param {Array} items Item list + * @param {string} searchInput Search input. + * @param {Object} config Search Config. + * + * @return {Array} Filtered item list. + */ +const searchItems = (items = [], searchInput = '', config = {}) => { + const normalizedSearchTerms = getNormalizedSearchTerms(searchInput); + + // Filter patterns by category: the default category indicates that all patterns will be shown. + const onlyFilterByCategory = config.categoryId !== PATTERN_DEFAULT_CATEGORY && !normalizedSearchTerms.length; + const searchRankConfig = { + ...config, + onlyFilterByCategory + }; + + // If we aren't filtering on search terms, matching on category is satisfactory. + // If we are, then we need more than a category match. + const threshold = onlyFilterByCategory ? 0 : 1; + const rankedItems = items.map(item => { + return [item, getItemSearchRank(item, searchInput, searchRankConfig)]; + }).filter(([, rank]) => rank > threshold); + + // If we didn't have terms to search on, there's no point sorting. + if (normalizedSearchTerms.length === 0) { + return rankedItems.map(([item]) => item); + } + rankedItems.sort(([, rank1], [, rank2]) => rank2 - rank1); + return rankedItems.map(([item]) => item); +}; + +/** + * Get the search rank for a given item and a specific search term. + * The better the match, the higher the rank. + * If the rank equals 0, it should be excluded from the results. + * + * @param {Object} item Item to filter. + * @param {string} searchTerm Search term. + * @param {Object} config Search Config. + * + * @return {number} Search Rank. + */ +function getItemSearchRank(item, searchTerm, config) { + const { + categoryId, + getName = defaultGetName, + getTitle = defaultGetTitle, + getDescription = defaultGetDescription, + getKeywords = defaultGetKeywords, + hasCategory = defaultHasCategory, + onlyFilterByCategory + } = config; + let rank = categoryId === PATTERN_DEFAULT_CATEGORY || categoryId === TEMPLATE_PART_ALL_AREAS_CATEGORY || categoryId === PATTERN_USER_CATEGORY && item.type === PATTERN_TYPES.user || hasCategory(item, categoryId) ? 1 : 0; + + // If an item doesn't belong to the current category or we don't have + // search terms to filter by, return the initial rank value. + if (!rank || onlyFilterByCategory) { + return rank; + } + const name = getName(item); + const title = getTitle(item); + const description = getDescription(item); + const keywords = getKeywords(item); + const normalizedSearchInput = normalizeString(searchTerm); + const normalizedTitle = normalizeString(title); + + // Prefers exact matches + // Then prefers if the beginning of the title matches the search term + // name, keywords, description matches come later. + if (normalizedSearchInput === normalizedTitle) { + rank += 30; + } else if (normalizedTitle.startsWith(normalizedSearchInput)) { + rank += 20; + } else { + const terms = [name, title, description, ...keywords].join(' '); + const normalizedSearchTerms = extractWords(normalizedSearchInput); + const unmatchedTerms = removeMatchingTerms(normalizedSearchTerms, terms); + if (unmatchedTerms.length === 0) { + rank += 10; + } + } + return rank; +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/page-patterns/use-patterns.js +/* wp:polyfill */ +/** + * WordPress dependencies + */ + + + + + +/** + * Internal dependencies + */ + + + + + +const EMPTY_PATTERN_LIST = []; +const selectTemplateParts = (0,external_wp_data_namespaceObject.createSelector)((select, categoryId, search = '') => { + var _getEntityRecords; + const { + getEntityRecords, + isResolving: isResolvingSelector + } = select(external_wp_coreData_namespaceObject.store); + const query = { + per_page: -1 + }; + const templateParts = (_getEntityRecords = getEntityRecords('postType', TEMPLATE_PART_POST_TYPE, query)) !== null && _getEntityRecords !== void 0 ? _getEntityRecords : EMPTY_PATTERN_LIST; + + // In the case where a custom template part area has been removed we need + // the current list of areas to cross check against so orphaned template + // parts can be treated as uncategorized. + const knownAreas = select(external_wp_coreData_namespaceObject.store).getEntityRecord('root', '__unstableBase')?.default_template_part_areas || []; + const templatePartAreas = knownAreas.map(area => area.area); + const templatePartHasCategory = (item, category) => { + if (category !== TEMPLATE_PART_AREA_DEFAULT_CATEGORY) { + return item.area === category; + } + return item.area === category || !templatePartAreas.includes(item.area); + }; + const isResolving = isResolvingSelector('getEntityRecords', ['postType', TEMPLATE_PART_POST_TYPE, query]); + const patterns = searchItems(templateParts, search, { + categoryId, + hasCategory: templatePartHasCategory + }); + return { + patterns, + isResolving + }; +}, select => [select(external_wp_coreData_namespaceObject.store).getEntityRecords('postType', TEMPLATE_PART_POST_TYPE, { + per_page: -1 +}), select(external_wp_coreData_namespaceObject.store).isResolving('getEntityRecords', ['postType', TEMPLATE_PART_POST_TYPE, { + per_page: -1 +}]), select(external_wp_coreData_namespaceObject.store).getEntityRecord('root', '__unstableBase')?.default_template_part_areas]); +const selectThemePatterns = (0,external_wp_data_namespaceObject.createSelector)(select => { + var _settings$__experimen; + const { + getSettings + } = unlock(select(store)); + const { + isResolving: isResolvingSelector + } = select(external_wp_coreData_namespaceObject.store); + const settings = getSettings(); + const blockPatterns = (_settings$__experimen = settings.__experimentalAdditionalBlockPatterns) !== null && _settings$__experimen !== void 0 ? _settings$__experimen : settings.__experimentalBlockPatterns; + const restBlockPatterns = select(external_wp_coreData_namespaceObject.store).getBlockPatterns(); + const patterns = [...(blockPatterns || []), ...(restBlockPatterns || [])].filter(pattern => !EXCLUDED_PATTERN_SOURCES.includes(pattern.source)).filter(filterOutDuplicatesByName).filter(pattern => pattern.inserter !== false).map(pattern => ({ + ...pattern, + keywords: pattern.keywords || [], + type: PATTERN_TYPES.theme, + blocks: (0,external_wp_blocks_namespaceObject.parse)(pattern.content, { + __unstableSkipMigrationLogs: true + }) + })); + return { + patterns, + isResolving: isResolvingSelector('getBlockPatterns') + }; +}, select => [select(external_wp_coreData_namespaceObject.store).getBlockPatterns(), select(external_wp_coreData_namespaceObject.store).isResolving('getBlockPatterns'), unlock(select(store)).getSettings()]); +const selectPatterns = (0,external_wp_data_namespaceObject.createSelector)((select, categoryId, syncStatus, search = '') => { + const { + patterns: themePatterns, + isResolving: isResolvingThemePatterns + } = selectThemePatterns(select); + const { + patterns: userPatterns, + isResolving: isResolvingUserPatterns, + categories: userPatternCategories + } = selectUserPatterns(select); + let patterns = [...(themePatterns || []), ...(userPatterns || [])]; + if (syncStatus) { + // User patterns can have their sync statuses checked directly + // Non-user patterns are all unsynced for the time being. + patterns = patterns.filter(pattern => { + return pattern.type === PATTERN_TYPES.user ? (pattern.wp_pattern_sync_status || PATTERN_SYNC_TYPES.full) === syncStatus : syncStatus === PATTERN_SYNC_TYPES.unsynced; + }); + } + if (categoryId) { + patterns = searchItems(patterns, search, { + categoryId, + hasCategory: (item, currentCategory) => { + if (item.type === PATTERN_TYPES.user) { + return item.wp_pattern_category?.some(catId => userPatternCategories.find(cat => cat.id === catId)?.slug === currentCategory); + } + return item.categories?.includes(currentCategory); + } + }); + } else { + patterns = searchItems(patterns, search, { + hasCategory: item => { + if (item.type === PATTERN_TYPES.user) { + return userPatternCategories?.length && (!item.wp_pattern_category?.length || !item.wp_pattern_category?.some(catId => userPatternCategories.find(cat => cat.id === catId))); + } + return !item.hasOwnProperty('categories'); + } + }); + } + return { + patterns, + isResolving: isResolvingThemePatterns || isResolvingUserPatterns + }; +}, select => [selectThemePatterns(select), selectUserPatterns(select)]); +const selectUserPatterns = (0,external_wp_data_namespaceObject.createSelector)((select, syncStatus, search = '') => { + const { + getEntityRecords, + isResolving: isResolvingSelector, + getUserPatternCategories + } = select(external_wp_coreData_namespaceObject.store); + const query = { + per_page: -1 + }; + const patternPosts = getEntityRecords('postType', PATTERN_TYPES.user, query); + const userPatternCategories = getUserPatternCategories(); + const categories = new Map(); + userPatternCategories.forEach(userCategory => categories.set(userCategory.id, userCategory)); + let patterns = patternPosts !== null && patternPosts !== void 0 ? patternPosts : EMPTY_PATTERN_LIST; + const isResolving = isResolvingSelector('getEntityRecords', ['postType', PATTERN_TYPES.user, query]); + if (syncStatus) { + patterns = patterns.filter(pattern => pattern.wp_pattern_sync_status || PATTERN_SYNC_TYPES.full === syncStatus); + } + patterns = searchItems(patterns, search, { + // We exit user pattern retrieval early if we aren't in the + // catch-all category for user created patterns, so it has + // to be in the category. + hasCategory: () => true + }); + return { + patterns, + isResolving, + categories: userPatternCategories + }; +}, select => [select(external_wp_coreData_namespaceObject.store).getEntityRecords('postType', PATTERN_TYPES.user, { + per_page: -1 +}), select(external_wp_coreData_namespaceObject.store).isResolving('getEntityRecords', ['postType', PATTERN_TYPES.user, { + per_page: -1 +}]), select(external_wp_coreData_namespaceObject.store).getUserPatternCategories()]); +function useAugmentPatternsWithPermissions(patterns) { + const idsAndTypes = (0,external_wp_element_namespaceObject.useMemo)(() => { + var _patterns$filter$map; + return (_patterns$filter$map = patterns?.filter(record => record.type !== PATTERN_TYPES.theme).map(record => [record.type, record.id])) !== null && _patterns$filter$map !== void 0 ? _patterns$filter$map : []; + }, [patterns]); + const permissions = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getEntityRecordPermissions + } = unlock(select(external_wp_coreData_namespaceObject.store)); + return idsAndTypes.reduce((acc, [type, id]) => { + acc[id] = getEntityRecordPermissions('postType', type, id); + return acc; + }, {}); + }, [idsAndTypes]); + return (0,external_wp_element_namespaceObject.useMemo)(() => { + var _patterns$map; + return (_patterns$map = patterns?.map(record => { + var _permissions$record$i; + return { + ...record, + permissions: (_permissions$record$i = permissions?.[record.id]) !== null && _permissions$record$i !== void 0 ? _permissions$record$i : {} + }; + })) !== null && _patterns$map !== void 0 ? _patterns$map : []; + }, [patterns, permissions]); +} +const usePatterns = (postType, categoryId, { + search = '', + syncStatus +} = {}) => { + return (0,external_wp_data_namespaceObject.useSelect)(select => { + if (postType === TEMPLATE_PART_POST_TYPE) { + return selectTemplateParts(select, categoryId, search); + } else if (postType === PATTERN_TYPES.user && !!categoryId) { + const appliedCategory = categoryId === 'uncategorized' ? '' : categoryId; + return selectPatterns(select, appliedCategory, syncStatus, search); + } else if (postType === PATTERN_TYPES.user) { + return selectUserPatterns(select, syncStatus, search); + } + return { + patterns: EMPTY_PATTERN_LIST, + isResolving: false + }; + }, [categoryId, postType, search, syncStatus]); +}; +/* harmony default export */ const use_patterns = (usePatterns); + +;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +/* wp:polyfill */ +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + + + +function usePatternCategories() { + const defaultCategories = useDefaultPatternCategories(); + defaultCategories.push({ + name: TEMPLATE_PART_AREA_DEFAULT_CATEGORY, + label: (0,external_wp_i18n_namespaceObject.__)('Uncategorized') + }); + const themePatterns = useThemePatterns(); + const { + patterns: userPatterns, + categories: userPatternCategories + } = use_patterns(PATTERN_TYPES.user); + const patternCategories = (0,external_wp_element_namespaceObject.useMemo)(() => { + const categoryMap = {}; + const categoriesWithCounts = []; + + // Create a map for easier counting of patterns in categories. + defaultCategories.forEach(category => { + if (!categoryMap[category.name]) { + categoryMap[category.name] = { + ...category, + count: 0 + }; + } + }); + userPatternCategories.forEach(category => { + if (!categoryMap[category.name]) { + categoryMap[category.name] = { + ...category, + count: 0 + }; + } + }); + + // Update the category counts to reflect theme registered patterns. + themePatterns.forEach(pattern => { + pattern.categories?.forEach(category => { + if (categoryMap[category]) { + categoryMap[category].count += 1; + } + }); + // If the pattern has no categories, add it to uncategorized. + if (!pattern.categories?.length) { + categoryMap.uncategorized.count += 1; + } + }); + + // Update the category counts to reflect user registered patterns. + userPatterns.forEach(pattern => { + pattern.wp_pattern_category?.forEach(catId => { + const category = userPatternCategories.find(cat => cat.id === catId)?.name; + if (categoryMap[category]) { + categoryMap[category].count += 1; + } + }); + // If the pattern has no categories, add it to uncategorized. + if (!pattern.wp_pattern_category?.length || !pattern.wp_pattern_category?.some(catId => userPatternCategories.find(cat => cat.id === catId))) { + categoryMap.uncategorized.count += 1; + } + }); + + // Filter categories so we only have those containing patterns. + [...defaultCategories, ...userPatternCategories].forEach(category => { + if (categoryMap[category.name].count && !categoriesWithCounts.find(cat => cat.name === category.name)) { + categoriesWithCounts.push(categoryMap[category.name]); + } + }); + const sortedCategories = categoriesWithCounts.sort((a, b) => a.label.localeCompare(b.label)); + sortedCategories.unshift({ + name: PATTERN_USER_CATEGORY, + label: (0,external_wp_i18n_namespaceObject.__)('My patterns'), + count: userPatterns.length + }); + sortedCategories.unshift({ + name: PATTERN_DEFAULT_CATEGORY, + label: (0,external_wp_i18n_namespaceObject.__)('All patterns'), + description: (0,external_wp_i18n_namespaceObject.__)('A list of all patterns from all sources.'), + count: themePatterns.length + userPatterns.length + }); + return sortedCategories; + }, [defaultCategories, themePatterns, userPatternCategories, userPatterns]); + return { + patternCategories, + hasPatterns: !!patternCategories.length + }; +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +/* wp:polyfill */ +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + +const useTemplatePartsGroupedByArea = items => { + const allItems = items || []; + const templatePartAreas = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getEntityRecord('root', '__unstableBase')?.default_template_part_areas || [], []); + + // Create map of template areas ensuring that default areas are displayed before + // any custom registered template part areas. + const knownAreas = { + header: {}, + footer: {}, + sidebar: {}, + uncategorized: {} + }; + templatePartAreas.forEach(templatePartArea => knownAreas[templatePartArea.area] = { + ...templatePartArea, + templateParts: [] + }); + const groupedByArea = allItems.reduce((accumulator, item) => { + const key = accumulator[item.area] ? item.area : TEMPLATE_PART_AREA_DEFAULT_CATEGORY; + accumulator[key]?.templateParts?.push(item); + return accumulator; + }, knownAreas); + return groupedByArea; +}; +function useTemplatePartAreas() { + const { + records: templateParts, + isResolving: isLoading + } = (0,external_wp_coreData_namespaceObject.useEntityRecords)('postType', TEMPLATE_PART_POST_TYPE, { + per_page: -1 + }); + return { + hasTemplateParts: templateParts ? !!templateParts.length : false, + isLoading, + templatePartAreas: useTemplatePartsGroupedByArea(templateParts) + }; +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-patterns/index.js +/* wp:polyfill */ +/** + * WordPress dependencies + */ + + + + + + +/** + * Internal dependencies + */ + + + + + + + +const { + useLocation: sidebar_navigation_screen_patterns_useLocation +} = unlock(external_wp_router_namespaceObject.privateApis); +function CategoriesGroup({ + templatePartAreas, + patternCategories, + currentCategory, + currentType +}) { + const [allPatterns, ...otherPatterns] = patternCategories; + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalItemGroup, { + className: "edit-site-sidebar-navigation-screen-patterns__group", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CategoryItem, { + count: Object.values(templatePartAreas).map(({ + templateParts + }) => templateParts?.length || 0).reduce((acc, val) => acc + val, 0), + icon: (0,external_wp_editor_namespaceObject.getTemplatePartIcon)() /* no name, so it provides the fallback icon */, + label: (0,external_wp_i18n_namespaceObject.__)('All template parts'), + id: TEMPLATE_PART_ALL_AREAS_CATEGORY, + type: TEMPLATE_PART_POST_TYPE, + isActive: currentCategory === TEMPLATE_PART_ALL_AREAS_CATEGORY && currentType === TEMPLATE_PART_POST_TYPE + }, "all"), Object.entries(templatePartAreas).map(([area, { + label, + templateParts + }]) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CategoryItem, { + count: templateParts?.length, + icon: (0,external_wp_editor_namespaceObject.getTemplatePartIcon)(area), + label: label, + id: area, + type: TEMPLATE_PART_POST_TYPE, + isActive: currentCategory === area && currentType === TEMPLATE_PART_POST_TYPE + }, area)), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: "edit-site-sidebar-navigation-screen-patterns__divider" + }), allPatterns && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CategoryItem, { + count: allPatterns.count, + label: allPatterns.label, + icon: library_file, + id: allPatterns.name, + type: PATTERN_TYPES.user, + isActive: currentCategory === `${allPatterns.name}` && currentType === PATTERN_TYPES.user + }, allPatterns.name), otherPatterns.map(category => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CategoryItem, { + count: category.count, + label: category.label, + icon: library_file, + id: category.name, + type: PATTERN_TYPES.user, + isActive: currentCategory === `${category.name}` && currentType === PATTERN_TYPES.user + }, category.name))] + }); +} +function SidebarNavigationScreenPatterns({ + backPath +}) { + const { + query: { + postType = 'wp_block', + categoryId + } + } = sidebar_navigation_screen_patterns_useLocation(); + const currentCategory = categoryId || (postType === PATTERN_TYPES.user ? PATTERN_DEFAULT_CATEGORY : TEMPLATE_PART_ALL_AREAS_CATEGORY); + const { + templatePartAreas, + hasTemplateParts, + isLoading + } = useTemplatePartAreas(); + const { + patternCategories, + hasPatterns + } = usePatternCategories(); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreen, { + title: (0,external_wp_i18n_namespaceObject.__)('Patterns'), + description: (0,external_wp_i18n_namespaceObject.__)('Manage what patterns are available when editing the site.'), + backPath: backPath, + content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [isLoading && (0,external_wp_i18n_namespaceObject.__)('Loading items…'), !isLoading && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [!hasTemplateParts && !hasPatterns && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalItemGroup, { + className: "edit-site-sidebar-navigation-screen-patterns__group", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalItem, { + children: (0,external_wp_i18n_namespaceObject.__)('No items found') + }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CategoriesGroup, { + templatePartAreas: templatePartAreas, + patternCategories: patternCategories, + currentCategory: currentCategory, + currentType: postType + })] + })] + }) + }); +} + // EXTERNAL MODULE: ./node_modules/remove-accents/index.js var remove_accents = __webpack_require__(9681); var remove_accents_default = /*#__PURE__*/__webpack_require__.n(remove_accents); @@ -24539,7 +27558,7 @@ function sort(a, b, direction) { return direction === 'asc' ? a - b : b - a; } function isValid(value, context) { - // TODO: this implicitely means the value is required. + // TODO: this implicitly means the value is required. if (value === '') { return false; } @@ -24664,7 +27683,6 @@ function getFieldTypeDefinition(type) { * Internal dependencies */ - function DateTime({ data, field, @@ -24910,11 +27928,26 @@ function getControlByType(type) { } ;// ./node_modules/@wordpress/dataviews/build-module/normalize-fields.js +/* wp:polyfill */ /** * Internal dependencies */ +const getValueFromId = id => ({ + item +}) => { + const path = id.split('.'); + let value = item; + for (const segment of path) { + if (value.hasOwnProperty(segment)) { + value = value[segment]; + } else { + value = undefined; + } + } + return value; +}; /** * Apply default values and normalize the fields config. @@ -24926,9 +27959,7 @@ function normalizeFields(fields) { return fields.map(field => { var _field$sort, _field$isValid, _field$enableHiding, _field$enableSorting; const fieldTypeDefinition = getFieldTypeDefinition(field.type); - const getValue = field.getValue || (({ - item - }) => item[field.id]); + const getValue = field.getValue || getValueFromId(field.id); const sort = (_field$sort = field.sort) !== null && _field$sort !== void 0 ? _field$sort : function sort(a, b, direction) { return fieldTypeDefinition.sort(getValue({ item: a @@ -24969,6 +28000,7 @@ function normalizeFields(fields) { } ;// ./node_modules/@wordpress/dataviews/build-module/filter-and-sort-data-view.js +/* wp:polyfill */ /** * External dependencies */ @@ -25136,7 +28168,8 @@ const DataViewsContext = (0,external_wp_element_namespaceObject.createContext)({ setOpenedFilter: () => {}, openedFilter: null, getItemId: item => item.id, - density: 0 + isItemClickable: () => true, + containerWidth: 0 }); /* harmony default export */ const dataviews_context = (DataViewsContext); @@ -25298,7 +28331,7 @@ function chain(...fns) { function cx(...args) { return args.filter(Boolean).join(" ") || void 0; } -function normalizeString(str) { +function PBFD2E7P_normalizeString(str) { return str.normalize("NFD").replace(/[\u0300-\u036f]/g, ""); } function omit(object, keys) { @@ -25424,28 +28457,32 @@ function mergeProps(base, overrides) { -;// ./node_modules/@ariakit/core/esm/__chunks/HWOIWM4O.js +;// ./node_modules/@ariakit/core/esm/__chunks/DTR5TSDJ.js "use client"; // src/utils/dom.ts -var HWOIWM4O_canUseDOM = checkIsBrowser(); +var DTR5TSDJ_canUseDOM = checkIsBrowser(); function checkIsBrowser() { var _a; return typeof window !== "undefined" && !!((_a = window.document) == null ? void 0 : _a.createElement); } function getDocument(node) { - return node ? node.ownerDocument || node : document; + if (!node) return document; + if ("self" in node) return node.document; + return node.ownerDocument || document; } function getWindow(node) { + if (!node) return self; + if ("self" in node) return node.self; return getDocument(node).defaultView || window; } -function HWOIWM4O_getActiveElement(node, activeDescendant = false) { +function DTR5TSDJ_getActiveElement(node, activeDescendant = false) { const { activeElement } = getDocument(node); if (!(activeElement == null ? void 0 : activeElement.nodeName)) { return null; } - if (HWOIWM4O_isFrame(activeElement) && activeElement.contentDocument) { - return HWOIWM4O_getActiveElement( + if (DTR5TSDJ_isFrame(activeElement) && activeElement.contentDocument) { + return DTR5TSDJ_getActiveElement( activeElement.contentDocument.body, activeDescendant ); @@ -25464,7 +28501,7 @@ function HWOIWM4O_getActiveElement(node, activeDescendant = false) { function contains(parent, child) { return parent === child || parent.contains(child); } -function HWOIWM4O_isFrame(element) { +function DTR5TSDJ_isFrame(element) { return element.tagName === "IFRAME"; } function isButton(element) { @@ -25560,14 +28597,17 @@ function scrollIntoViewIfNeeded(element, arg) { } function getScrollingElement(element) { if (!element) return null; + const isScrollableOverflow = (overflow) => { + if (overflow === "auto") return true; + if (overflow === "scroll") return true; + return false; + }; if (element.clientHeight && element.scrollHeight > element.clientHeight) { const { overflowY } = getComputedStyle(element); - const isScrollable = overflowY !== "visible" && overflowY !== "hidden"; - if (isScrollable) return element; + if (isScrollableOverflow(overflowY)) return element; } else if (element.clientWidth && element.scrollWidth > element.clientWidth) { const { overflowX } = getComputedStyle(element); - const isScrollable = overflowX !== "visible" && overflowX !== "hidden"; - if (isScrollable) return element; + if (isScrollableOverflow(overflowX)) return element; } return getScrollingElement(element.parentElement) || document.scrollingElement || document.body; } @@ -25592,26 +28632,55 @@ function setSelectionRange(element, ...args) { element.setSelectionRange(...args); } } +function sortBasedOnDOMPosition(items, getElement) { + const pairs = items.map((item, index) => [index, item]); + let isOrderDifferent = false; + pairs.sort(([indexA, a], [indexB, b]) => { + const elementA = getElement(a); + const elementB = getElement(b); + if (elementA === elementB) return 0; + if (!elementA || !elementB) return 0; + if (isElementPreceding(elementA, elementB)) { + if (indexA > indexB) { + isOrderDifferent = true; + } + return -1; + } + if (indexA < indexB) { + isOrderDifferent = true; + } + return 1; + }); + if (isOrderDifferent) { + return pairs.map(([_, item]) => item); + } + return items; +} +function isElementPreceding(a, b) { + return Boolean( + b.compareDocumentPosition(a) & Node.DOCUMENT_POSITION_PRECEDING + ); +} -;// ./node_modules/@ariakit/core/esm/__chunks/US4USQPI.js +;// ./node_modules/@ariakit/core/esm/__chunks/QAGXQEUG.js "use client"; // src/utils/platform.ts function isTouchDevice() { - return HWOIWM4O_canUseDOM && !!navigator.maxTouchPoints; + return DTR5TSDJ_canUseDOM && !!navigator.maxTouchPoints; } function isApple() { - if (!HWOIWM4O_canUseDOM) return false; + if (!DTR5TSDJ_canUseDOM) return false; return /mac|iphone|ipad|ipod/i.test(navigator.platform); } function isSafari() { - return HWOIWM4O_canUseDOM && isApple() && /apple/i.test(navigator.vendor); + return DTR5TSDJ_canUseDOM && isApple() && /apple/i.test(navigator.vendor); } function isFirefox() { - return HWOIWM4O_canUseDOM && /firefox\//i.test(navigator.userAgent); + return DTR5TSDJ_canUseDOM && /firefox\//i.test(navigator.userAgent); } function isMac() { return canUseDOM && navigator.platform.startsWith("Mac") && !isTouchDevice(); @@ -25736,7 +28805,7 @@ function addGlobalEventListener(type, listener, options, scope = window) { } -;// ./node_modules/@ariakit/react-core/esm/__chunks/Z32BISHQ.js +;// ./node_modules/@ariakit/react-core/esm/__chunks/ABQUS43J.js "use client"; @@ -25750,9 +28819,9 @@ var _React = _3YLGPPWQ_spreadValues({}, external_React_namespaceObject); var useReactId = _React.useId; var useReactDeferredValue = _React.useDeferredValue; var useReactInsertionEffect = _React.useInsertionEffect; -var useSafeLayoutEffect = HWOIWM4O_canUseDOM ? external_React_.useLayoutEffect : external_React_.useEffect; +var useSafeLayoutEffect = DTR5TSDJ_canUseDOM ? external_React_.useLayoutEffect : external_React_.useEffect; function useInitialValue(value) { - const [initialValue] = useState(value); + const [initialValue] = (0,external_React_.useState)(value); return initialValue; } function useLazyValue(init) { @@ -25827,7 +28896,7 @@ function useId(defaultId) { const [id, setId] = (0,external_React_.useState)(defaultId); useSafeLayoutEffect(() => { if (defaultId || id) return; - const random = Math.random().toString(36).substr(2, 6); + const random = Math.random().toString(36).slice(2, 8); setId(`id-${random}`); }, [defaultId, id]); return defaultId || id; @@ -25856,20 +28925,20 @@ function useTagName(refOrElement, type) { return tagName; } function useAttribute(refOrElement, attributeName, defaultValue) { - const [attribute, setAttribute] = (0,external_React_.useState)(defaultValue); - useSafeLayoutEffect(() => { + const initialValue = useInitialValue(defaultValue); + const [attribute, setAttribute] = (0,external_React_.useState)(initialValue); + (0,external_React_.useEffect)(() => { const element = refOrElement && "current" in refOrElement ? refOrElement.current : refOrElement; if (!element) return; const callback = () => { const value = element.getAttribute(attributeName); - if (value == null) return; - setAttribute(value); + setAttribute(value == null ? initialValue : value); }; const observer = new MutationObserver(callback); observer.observe(element, { attributeFilter: [attributeName] }); callback(); return () => observer.disconnect(); - }, [refOrElement, attributeName]); + }, [refOrElement, attributeName, initialValue]); return attribute; } function useUpdateEffect(effect, deps) { @@ -25967,7 +29036,7 @@ function resetMouseMoving() { -;// ./node_modules/@ariakit/react-core/esm/__chunks/HKOOKEDE.js +;// ./node_modules/@ariakit/react-core/esm/__chunks/LMDWO4NN.js "use client"; @@ -26049,7 +29118,7 @@ function createStoreContext(providers = [], scopedProviders = []) { -;// ./node_modules/@ariakit/react-core/esm/__chunks/FMYQNSCK.js +;// ./node_modules/@ariakit/react-core/esm/__chunks/VDHZ5F7K.js "use client"; @@ -26063,22 +29132,22 @@ var CollectionScopedContextProvider = ctx.ScopedContextProvider; -;// ./node_modules/@ariakit/react-core/esm/__chunks/WENSINUV.js +;// ./node_modules/@ariakit/react-core/esm/__chunks/P7GR5CS5.js "use client"; // src/composite/composite-context.tsx -var WENSINUV_ctx = createStoreContext( +var P7GR5CS5_ctx = createStoreContext( [CollectionContextProvider], [CollectionScopedContextProvider] ); -var useCompositeContext = WENSINUV_ctx.useContext; -var useCompositeScopedContext = WENSINUV_ctx.useScopedContext; -var useCompositeProviderContext = WENSINUV_ctx.useProviderContext; -var CompositeContextProvider = WENSINUV_ctx.ContextProvider; -var CompositeScopedContextProvider = WENSINUV_ctx.ScopedContextProvider; +var useCompositeContext = P7GR5CS5_ctx.useContext; +var useCompositeScopedContext = P7GR5CS5_ctx.useScopedContext; +var useCompositeProviderContext = P7GR5CS5_ctx.useProviderContext; +var CompositeContextProvider = P7GR5CS5_ctx.ContextProvider; +var CompositeScopedContextProvider = P7GR5CS5_ctx.ScopedContextProvider; var CompositeItemContext = (0,external_React_.createContext)( void 0 ); @@ -26088,7 +29157,7 @@ var CompositeRowContext = (0,external_React_.createContext)( -;// ./node_modules/@ariakit/react-core/esm/__chunks/P2OTTZSX.js +;// ./node_modules/@ariakit/react-core/esm/__chunks/3XAVFTCA.js "use client"; @@ -26099,19 +29168,19 @@ var TagValueContext = (0,external_React_.createContext)(null); var TagRemoveIdContext = (0,external_React_.createContext)( null ); -var P2OTTZSX_ctx = createStoreContext( +var _3XAVFTCA_ctx = createStoreContext( [CompositeContextProvider], [CompositeScopedContextProvider] ); -var useTagContext = P2OTTZSX_ctx.useContext; -var useTagScopedContext = P2OTTZSX_ctx.useScopedContext; -var useTagProviderContext = P2OTTZSX_ctx.useProviderContext; -var TagContextProvider = P2OTTZSX_ctx.ContextProvider; -var TagScopedContextProvider = P2OTTZSX_ctx.ScopedContextProvider; +var useTagContext = _3XAVFTCA_ctx.useContext; +var useTagScopedContext = _3XAVFTCA_ctx.useScopedContext; +var useTagProviderContext = _3XAVFTCA_ctx.useProviderContext; +var TagContextProvider = _3XAVFTCA_ctx.ContextProvider; +var TagScopedContextProvider = _3XAVFTCA_ctx.ScopedContextProvider; -;// ./node_modules/@ariakit/core/esm/__chunks/EQQLU3CG.js +;// ./node_modules/@ariakit/core/esm/__chunks/BCALMBPZ.js "use client"; @@ -26286,7 +29355,7 @@ function mergeStore(...stores) { return Object.assign(state, nextState); }, {}); const store = createStore(initialState, ...stores); - return store; + return Object.assign({}, ...stores, store); } function throwOnConflictingProps(props, store) { if (true) return; @@ -26325,7 +29394,7 @@ If there's a particular need for this, please submit a feature request at https: // EXTERNAL MODULE: ./node_modules/use-sync-external-store/shim/index.js var shim = __webpack_require__(422); -;// ./node_modules/@ariakit/react-core/esm/__chunks/2GXGCHW6.js +;// ./node_modules/@ariakit/react-core/esm/__chunks/YV4JVR4I.js "use client"; @@ -26358,6 +29427,47 @@ function useStoreState(store, keyOrSelector = identity) { }; return useSyncExternalStore(storeSubscribe, getSnapshot, getSnapshot); } +function useStoreStateObject(store, object) { + const objRef = external_React_.useRef( + {} + ); + const storeSubscribe = external_React_.useCallback( + (callback) => { + if (!store) return noopSubscribe(); + return subscribe(store, null, callback); + }, + [store] + ); + const getSnapshot = () => { + const state = store == null ? void 0 : store.getState(); + let updated = false; + const obj = objRef.current; + for (const prop in object) { + const keyOrSelector = object[prop]; + if (typeof keyOrSelector === "function") { + const value = keyOrSelector(state); + if (value !== obj[prop]) { + obj[prop] = value; + updated = true; + } + } + if (typeof keyOrSelector === "string") { + if (!state) continue; + if (!PBFD2E7P_hasOwnProperty(state, keyOrSelector)) continue; + const value = state[keyOrSelector]; + if (value !== obj[prop]) { + obj[prop] = value; + updated = true; + } + } + } + if (updated) { + objRef.current = _3YLGPPWQ_spreadValues({}, obj); + } + return objRef.current; + }; + return useSyncExternalStore(storeSubscribe, getSnapshot, getSnapshot); +} function useStoreProps(store, props, key, setKey) { const value = PBFD2E7P_hasOwnProperty(props, key) ? props[key] : void 0; const setValue = setKey ? props[setKey] : void 0; @@ -26380,7 +29490,7 @@ function useStoreProps(store, props, key, setKey) { }); }); } -function _2GXGCHW6_useStore(createStore, props) { +function YV4JVR4I_useStore(createStore, props) { const [store, setStore] = external_React_.useState(() => createStore(props)); useSafeLayoutEffect(() => init(store), [store]); const useState2 = external_React_.useCallback( @@ -26399,7 +29509,7 @@ function _2GXGCHW6_useStore(createStore, props) { -;// ./node_modules/@ariakit/react-core/esm/__chunks/TCAGH6BH.js +;// ./node_modules/@ariakit/react-core/esm/__chunks/C3IKGW5T.js "use client"; @@ -26418,13 +29528,19 @@ function useCollectionStore(props = {}) { -;// ./node_modules/@ariakit/react-core/esm/__chunks/UVQLZ7T5.js +;// ./node_modules/@ariakit/react-core/esm/__chunks/4CMBR7SL.js "use client"; + + // src/composite/composite-store.ts +function useCompositeStoreOptions(props) { + const id = useId(props.id); + return _3YLGPPWQ_spreadValues({ id }, props); +} function useCompositeStoreProps(store, update, props) { store = useCollectionStoreProps(store, update, props); useStoreProps(store, props, "activeId", "setActiveId"); @@ -26438,13 +29554,14 @@ function useCompositeStoreProps(store, update, props) { return store; } function useCompositeStore(props = {}) { + props = useCompositeStoreOptions(props); const [store, update] = useStore(Core.createCompositeStore, props); return useCompositeStoreProps(store, update, props); } -;// ./node_modules/@ariakit/react-core/esm/__chunks/KGK2TTFO.js +;// ./node_modules/@ariakit/react-core/esm/__chunks/WYCIER3C.js "use client"; @@ -26465,7 +29582,7 @@ function useDisclosureStore(props = {}) { -;// ./node_modules/@ariakit/react-core/esm/__chunks/QYS5FHDY.js +;// ./node_modules/@ariakit/react-core/esm/__chunks/BM6PGYQY.js "use client"; @@ -26482,7 +29599,7 @@ function useDialogStore(props = {}) { -;// ./node_modules/@ariakit/react-core/esm/__chunks/CBC47ZYL.js +;// ./node_modules/@ariakit/react-core/esm/__chunks/O2PQ2652.js "use client"; @@ -26502,7 +29619,7 @@ function usePopoverStore(props = {}) { -;// ./node_modules/@ariakit/core/esm/__chunks/6DHTHWXD.js +;// ./node_modules/@ariakit/core/esm/__chunks/CYQWQL4J.js "use client"; @@ -26510,35 +29627,6 @@ function usePopoverStore(props = {}) { // src/collection/collection-store.ts -function isElementPreceding(a, b) { - return Boolean( - b.compareDocumentPosition(a) & Node.DOCUMENT_POSITION_PRECEDING - ); -} -function sortBasedOnDOMPosition(items) { - const pairs = items.map((item, index) => [index, item]); - let isOrderDifferent = false; - pairs.sort(([indexA, a], [indexB, b]) => { - const elementA = a.element; - const elementB = b.element; - if (elementA === elementB) return 0; - if (!elementA || !elementB) return 0; - if (isElementPreceding(elementA, elementB)) { - if (indexA > indexB) { - isOrderDifferent = true; - } - return -1; - } - if (indexA < indexB) { - isOrderDifferent = true; - } - return 1; - }); - if (isOrderDifferent) { - return pairs.map(([_, item]) => item); - } - return items; -} function getCommonParent(items) { var _a; const firstItem = items.find((item) => !!item.element); @@ -26578,7 +29666,7 @@ function createCollectionStore(props = {}) { ); const collection = createStore(initialState, props.store); const sortItems = (renderedItems) => { - const sortedItems = sortBasedOnDOMPosition(renderedItems); + const sortedItems = sortBasedOnDOMPosition(renderedItems, (i) => i.element); privateStore.setState("renderedItems", sortedItems); collection.setState("renderedItems", sortedItems); }; @@ -26671,7 +29759,7 @@ function createCollectionStore(props = {}) { if (!id) return null; let item = itemsMap.get(id); if (!item) { - const { items: items2 } = collection.getState(); + const { items: items2 } = privateStore.getState(); item = items2.find((item2) => item2.id === id); if (item) { itemsMap.set(id, item); @@ -26715,7 +29803,7 @@ function reverseArray(array) { -;// ./node_modules/@ariakit/core/esm/__chunks/D7EIQZAU.js +;// ./node_modules/@ariakit/core/esm/__chunks/AJZ4BYF3.js "use client"; @@ -26741,11 +29829,6 @@ function getEnabledItems(items, excludeId) { return !item.disabled; }); } -function getOppositeOrientation(orientation) { - if (orientation === "vertical") return "horizontal"; - if (orientation === "horizontal") return "vertical"; - return; -} function getItemsInRow(items, rowId) { return items.filter((item) => item.rowId === rowId); } @@ -26833,6 +29916,11 @@ function createCompositeStore(props = {}) { props.defaultActiveId ); const initialState = _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, collection.getState()), { + id: defaultValue( + props.id, + syncState == null ? void 0 : syncState.id, + `id-${Math.random().toString(36).slice(2, 8)}` + ), activeId, baseElement: defaultValue(syncState == null ? void 0 : syncState.baseElement, null), includesBaseElement: defaultValue( @@ -26867,40 +29955,50 @@ function createCompositeStore(props = {}) { }); }) ); - const getNextId = (items, orientation, hasNullItem, skip) => { + const getNextId = (direction = "next", options = {}) => { var _a2, _b; - const { activeId: activeId2, rtl, focusLoop, focusWrap, includesBaseElement } = composite.getState(); - const isHorizontal = orientation !== "vertical"; - const isRTL = rtl && isHorizontal; - const allItems = isRTL ? reverseArray(items) : items; + const defaultState = composite.getState(); + const { + skip = 0, + activeId: activeId2 = defaultState.activeId, + focusShift = defaultState.focusShift, + focusLoop = defaultState.focusLoop, + focusWrap = defaultState.focusWrap, + includesBaseElement = defaultState.includesBaseElement, + renderedItems = defaultState.renderedItems, + rtl = defaultState.rtl + } = options; + const isVerticalDirection = direction === "up" || direction === "down"; + const isNextDirection = direction === "next" || direction === "down"; + const canReverse = isNextDirection ? rtl && !isVerticalDirection : !rtl || isVerticalDirection; + const canShift = focusShift && !skip; + let items = !isVerticalDirection ? renderedItems : flatten2DArray( + normalizeRows(groupItemsByRows(renderedItems), activeId2, canShift) + ); + items = canReverse ? reverseArray(items) : items; + items = isVerticalDirection ? verticalizeItems(items) : items; if (activeId2 == null) { - return (_a2 = findFirstEnabledItem(allItems)) == null ? void 0 : _a2.id; + return (_a2 = findFirstEnabledItem(items)) == null ? void 0 : _a2.id; } - const activeItem = allItems.find((item) => item.id === activeId2); + const activeItem = items.find((item) => item.id === activeId2); if (!activeItem) { - return (_b = findFirstEnabledItem(allItems)) == null ? void 0 : _b.id; + return (_b = findFirstEnabledItem(items)) == null ? void 0 : _b.id; } - const isGrid = !!activeItem.rowId; - const activeIndex = allItems.indexOf(activeItem); - const nextItems = allItems.slice(activeIndex + 1); + const isGrid = items.some((item) => item.rowId); + const activeIndex = items.indexOf(activeItem); + const nextItems = items.slice(activeIndex + 1); const nextItemsInRow = getItemsInRow(nextItems, activeItem.rowId); - if (skip !== void 0) { + if (skip) { const nextEnabledItemsInRow = getEnabledItems(nextItemsInRow, activeId2); const nextItem2 = nextEnabledItemsInRow.slice(skip)[0] || // If we can't find an item, just return the last one. nextEnabledItemsInRow[nextEnabledItemsInRow.length - 1]; return nextItem2 == null ? void 0 : nextItem2.id; } - const oppositeOrientation = getOppositeOrientation( - // If it's a grid and orientation is not set, it's a next/previous call, - // which is inherently horizontal. up/down will call next with orientation - // set to vertical by default (see below on up/down methods). - isGrid ? orientation || "horizontal" : orientation - ); - const canLoop = focusLoop && focusLoop !== oppositeOrientation; - const canWrap = isGrid && focusWrap && focusWrap !== oppositeOrientation; - hasNullItem = hasNullItem || !isGrid && canLoop && includesBaseElement; + const canLoop = focusLoop && (isVerticalDirection ? focusLoop !== "horizontal" : focusLoop !== "vertical"); + const canWrap = isGrid && focusWrap && (isVerticalDirection ? focusWrap !== "horizontal" : focusWrap !== "vertical"); + const hasNullItem = isNextDirection ? (!isGrid || isVerticalDirection) && canLoop && includesBaseElement : isVerticalDirection ? includesBaseElement : false; if (canLoop) { - const loopItems = canWrap && !hasNullItem ? allItems : getItemsInRow(allItems, activeItem.rowId); + const loopItems = canWrap && !hasNullItem ? items : getItemsInRow(items, activeItem.rowId); const sortedItems = flipItems(loopItems, activeId2, hasNullItem); const nextItem2 = findFirstEnabledItem(sortedItems, activeId2); return nextItem2 == null ? void 0 : nextItem2.id; @@ -26941,63 +30039,36 @@ function createCompositeStore(props = {}) { var _a2; return (_a2 = findFirstEnabledItem(reverseArray(composite.getState().renderedItems))) == null ? void 0 : _a2.id; }, - next: (skip) => { - const { renderedItems, orientation } = composite.getState(); - return getNextId(renderedItems, orientation, false, skip); + next: (options) => { + if (options !== void 0 && typeof options === "number") { + options = { skip: options }; + } + return getNextId("next", options); }, - previous: (skip) => { - var _a2; - const { renderedItems, orientation, includesBaseElement } = composite.getState(); - const isGrid = !!((_a2 = findFirstEnabledItem(renderedItems)) == null ? void 0 : _a2.rowId); - const hasNullItem = !isGrid && includesBaseElement; - return getNextId( - reverseArray(renderedItems), - orientation, - hasNullItem, - skip - ); + previous: (options) => { + if (options !== void 0 && typeof options === "number") { + options = { skip: options }; + } + return getNextId("previous", options); }, - down: (skip) => { - const { - activeId: activeId2, - renderedItems, - focusShift, - focusLoop, - includesBaseElement - } = composite.getState(); - const shouldShift = focusShift && !skip; - const verticalItems = verticalizeItems( - flatten2DArray( - normalizeRows(groupItemsByRows(renderedItems), activeId2, shouldShift) - ) - ); - const canLoop = focusLoop && focusLoop !== "horizontal"; - const hasNullItem = canLoop && includesBaseElement; - return getNextId(verticalItems, "vertical", hasNullItem, skip); + down: (options) => { + if (options !== void 0 && typeof options === "number") { + options = { skip: options }; + } + return getNextId("down", options); }, - up: (skip) => { - const { activeId: activeId2, renderedItems, focusShift, includesBaseElement } = composite.getState(); - const shouldShift = focusShift && !skip; - const verticalItems = verticalizeItems( - reverseArray( - flatten2DArray( - normalizeRows( - groupItemsByRows(renderedItems), - activeId2, - shouldShift - ) - ) - ) - ); - const hasNullItem = includesBaseElement; - return getNextId(verticalItems, "vertical", hasNullItem, skip); + up: (options) => { + if (options !== void 0 && typeof options === "number") { + options = { skip: options }; + } + return getNextId("up", options); } }); } -;// ./node_modules/@ariakit/core/esm/__chunks/6E4KKOSB.js +;// ./node_modules/@ariakit/core/esm/__chunks/RCQ5P4YE.js "use client"; @@ -27061,7 +30132,7 @@ function createDisclosureStore(props = {}) { -;// ./node_modules/@ariakit/core/esm/__chunks/YOHCVXJB.js +;// ./node_modules/@ariakit/core/esm/__chunks/FZZ2AVHF.js "use client"; @@ -27072,7 +30143,7 @@ function createDialogStore(props = {}) { -;// ./node_modules/@ariakit/core/esm/__chunks/3UYWTADI.js +;// ./node_modules/@ariakit/core/esm/__chunks/ME2CUF3F.js "use client"; @@ -27274,7 +30345,7 @@ function createComboboxStore(_a = {}) { } -;// ./node_modules/@ariakit/react-core/esm/__chunks/7BSNT25J.js +;// ./node_modules/@ariakit/react-core/esm/__chunks/FEOFMWBY.js "use client"; @@ -27285,6 +30356,13 @@ function createComboboxStore(_a = {}) { // src/combobox/combobox-store.ts +function useComboboxStoreOptions(props) { + const tag = useTagContext(); + props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), { + tag: props.tag !== void 0 ? props.tag : tag + }); + return useCompositeStoreOptions(props); +} function useComboboxStoreProps(store, update, props) { useUpdateEffect(update, [props.tag]); useStoreProps(store, props, "value", "setValue"); @@ -27301,70 +30379,67 @@ function useComboboxStoreProps(store, update, props) { ); } function useComboboxStore(props = {}) { - const tag = useTagContext(); - props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), { - tag: props.tag !== void 0 ? props.tag : tag - }); - const [store, update] = _2GXGCHW6_useStore(createComboboxStore, props); + props = useComboboxStoreOptions(props); + const [store, update] = YV4JVR4I_useStore(createComboboxStore, props); return useComboboxStoreProps(store, update, props); } -;// ./node_modules/@ariakit/react-core/esm/__chunks/RGUP62TM.js +;// ./node_modules/@ariakit/react-core/esm/__chunks/S6EF7IVO.js "use client"; // src/disclosure/disclosure-context.tsx -var RGUP62TM_ctx = createStoreContext(); -var useDisclosureContext = RGUP62TM_ctx.useContext; -var useDisclosureScopedContext = RGUP62TM_ctx.useScopedContext; -var useDisclosureProviderContext = RGUP62TM_ctx.useProviderContext; -var DisclosureContextProvider = RGUP62TM_ctx.ContextProvider; -var DisclosureScopedContextProvider = RGUP62TM_ctx.ScopedContextProvider; +var S6EF7IVO_ctx = createStoreContext(); +var useDisclosureContext = S6EF7IVO_ctx.useContext; +var useDisclosureScopedContext = S6EF7IVO_ctx.useScopedContext; +var useDisclosureProviderContext = S6EF7IVO_ctx.useProviderContext; +var DisclosureContextProvider = S6EF7IVO_ctx.ContextProvider; +var DisclosureScopedContextProvider = S6EF7IVO_ctx.ScopedContextProvider; -;// ./node_modules/@ariakit/react-core/esm/__chunks/DU4D3UCJ.js +;// ./node_modules/@ariakit/react-core/esm/__chunks/RS7LB2H4.js "use client"; // src/dialog/dialog-context.tsx -var DU4D3UCJ_ctx = createStoreContext( +var RS7LB2H4_ctx = createStoreContext( [DisclosureContextProvider], [DisclosureScopedContextProvider] ); -var useDialogContext = DU4D3UCJ_ctx.useContext; -var useDialogScopedContext = DU4D3UCJ_ctx.useScopedContext; -var useDialogProviderContext = DU4D3UCJ_ctx.useProviderContext; -var DialogContextProvider = DU4D3UCJ_ctx.ContextProvider; -var DialogScopedContextProvider = DU4D3UCJ_ctx.ScopedContextProvider; +var useDialogContext = RS7LB2H4_ctx.useContext; +var useDialogScopedContext = RS7LB2H4_ctx.useScopedContext; +var useDialogProviderContext = RS7LB2H4_ctx.useProviderContext; +var DialogContextProvider = RS7LB2H4_ctx.ContextProvider; +var DialogScopedContextProvider = RS7LB2H4_ctx.ScopedContextProvider; var DialogHeadingContext = (0,external_React_.createContext)(void 0); var DialogDescriptionContext = (0,external_React_.createContext)(void 0); -;// ./node_modules/@ariakit/react-core/esm/__chunks/54MGSIOI.js +;// ./node_modules/@ariakit/react-core/esm/__chunks/MTZPJQMC.js "use client"; // src/popover/popover-context.tsx -var _54MGSIOI_ctx = createStoreContext( +var MTZPJQMC_ctx = createStoreContext( [DialogContextProvider], [DialogScopedContextProvider] ); -var usePopoverContext = _54MGSIOI_ctx.useContext; -var usePopoverScopedContext = _54MGSIOI_ctx.useScopedContext; -var usePopoverProviderContext = _54MGSIOI_ctx.useProviderContext; -var PopoverContextProvider = _54MGSIOI_ctx.ContextProvider; -var PopoverScopedContextProvider = _54MGSIOI_ctx.ScopedContextProvider; +var usePopoverContext = MTZPJQMC_ctx.useContext; +var usePopoverScopedContext = MTZPJQMC_ctx.useScopedContext; +var usePopoverProviderContext = MTZPJQMC_ctx.useProviderContext; +var PopoverContextProvider = MTZPJQMC_ctx.ContextProvider; +var PopoverScopedContextProvider = MTZPJQMC_ctx.ScopedContextProvider; -;// ./node_modules/@ariakit/react-core/esm/__chunks/DWZ7E5TJ.js +;// ./node_modules/@ariakit/react-core/esm/__chunks/VEVQD5MH.js "use client"; @@ -27375,15 +30450,15 @@ var PopoverScopedContextProvider = _54MGSIOI_ctx.ScopedContextProvider; var ComboboxListRoleContext = (0,external_React_.createContext)( void 0 ); -var DWZ7E5TJ_ctx = createStoreContext( +var VEVQD5MH_ctx = createStoreContext( [PopoverContextProvider, CompositeContextProvider], [PopoverScopedContextProvider, CompositeScopedContextProvider] ); -var useComboboxContext = DWZ7E5TJ_ctx.useContext; -var useComboboxScopedContext = DWZ7E5TJ_ctx.useScopedContext; -var useComboboxProviderContext = DWZ7E5TJ_ctx.useProviderContext; -var ComboboxContextProvider = DWZ7E5TJ_ctx.ContextProvider; -var ComboboxScopedContextProvider = DWZ7E5TJ_ctx.ScopedContextProvider; +var useComboboxContext = VEVQD5MH_ctx.useContext; +var useComboboxScopedContext = VEVQD5MH_ctx.useScopedContext; +var useComboboxProviderContext = VEVQD5MH_ctx.useProviderContext; +var ComboboxContextProvider = VEVQD5MH_ctx.ContextProvider; +var ComboboxScopedContextProvider = VEVQD5MH_ctx.ScopedContextProvider; var ComboboxItemValueContext = (0,external_React_.createContext)( void 0 ); @@ -27463,7 +30538,7 @@ var ComboboxLabel = memo2( ); -;// ./node_modules/@ariakit/react-core/esm/__chunks/74NFH3UH.js +;// ./node_modules/@ariakit/react-core/esm/__chunks/OMU7RWRV.js "use client"; @@ -27471,7 +30546,7 @@ var ComboboxLabel = memo2( // src/popover/popover-anchor.tsx -var _74NFH3UH_TagName = "div"; +var OMU7RWRV_TagName = "div"; var usePopoverAnchor = createHook( function usePopoverAnchor2(_a) { var _b = _a, { store } = _b, props = __objRest(_b, ["store"]); @@ -27485,7 +30560,7 @@ var usePopoverAnchor = createHook( ); var PopoverAnchor = forwardRef2(function PopoverAnchor2(props) { const htmlProps = usePopoverAnchor(props); - return createElement(_74NFH3UH_TagName, htmlProps); + return createElement(OMU7RWRV_TagName, htmlProps); }); @@ -27722,7 +30797,7 @@ function getClosestFocusable(element) { return element || null; } function hasFocus(element) { - const activeElement = HWOIWM4O_getActiveElement(element); + const activeElement = DTR5TSDJ_getActiveElement(element); if (!activeElement) return false; if (activeElement === element) return true; const activeDescendant = activeElement.getAttribute("aria-activedescendant"); @@ -27730,7 +30805,7 @@ function hasFocus(element) { return activeDescendant === element.id; } function hasFocusWithin(element) { - const activeElement = HWOIWM4O_getActiveElement(element); + const activeElement = DTR5TSDJ_getActiveElement(element); if (!activeElement) return false; if (contains(element, activeElement)) return true; const activeDescendant = activeElement.getAttribute("aria-activedescendant"); @@ -27784,7 +30859,7 @@ function focusIntoView(element, options) { } -;// ./node_modules/@ariakit/react-core/esm/__chunks/OD7ALSX5.js +;// ./node_modules/@ariakit/react-core/esm/__chunks/LVA2YJMS.js "use client"; @@ -27798,7 +30873,7 @@ function focusIntoView(element, options) { -var OD7ALSX5_TagName = "div"; +var LVA2YJMS_TagName = "div"; var isSafariBrowser = isSafari(); var alwaysFocusVisibleInputTypes = [ "text", @@ -28096,12 +31171,12 @@ var useFocusable = createHook( ); var Focusable = forwardRef2(function Focusable2(props) { const htmlProps = useFocusable(props); - return createElement(OD7ALSX5_TagName, htmlProps); + return createElement(LVA2YJMS_TagName, htmlProps); }); -;// ./node_modules/@ariakit/react-core/esm/__chunks/2BDG6X5K.js +;// ./node_modules/@ariakit/react-core/esm/__chunks/ITI7HKP4.js "use client"; @@ -28118,7 +31193,7 @@ var Focusable = forwardRef2(function Focusable2(props) { -var _2BDG6X5K_TagName = "div"; +var ITI7HKP4_TagName = "div"; function isGrid(items) { return items.some((item) => !!item.rowId); } @@ -28240,7 +31315,7 @@ var useComposite = createHook( previousElementRef.current = null; if (!previousElement) return; const activeElement = (_a2 = getEnabledItem(store, activeId)) == null ? void 0 : _a2.element; - const relatedTarget = activeElement || HWOIWM4O_getActiveElement(previousElement); + const relatedTarget = activeElement || DTR5TSDJ_getActiveElement(previousElement); if (relatedTarget === previousElement) return; fireBlurEvent(previousElement, { relatedTarget }); }, [store, activeId, virtualFocus, composite]); @@ -28323,7 +31398,7 @@ var useComposite = createHook( if (event.defaultPrevented) return; if (!store) return; if (!isSelfTarget(event)) return; - const { orientation, items, renderedItems, activeId: activeId2 } = store.getState(); + const { orientation, renderedItems, activeId: activeId2 } = store.getState(); const activeItem = getEnabledItem(store, activeId2); if ((_a2 = activeItem == null ? void 0 : activeItem.element) == null ? void 0 : _a2.isConnected) return; const isVertical = orientation !== "horizontal"; @@ -28333,7 +31408,7 @@ var useComposite = createHook( if (isHorizontalKey && isTextField(event.currentTarget)) return; const up = () => { if (grid) { - const item = items && findFirstEnabledItemInTheLastRow(items); + const item = findFirstEnabledItemInTheLastRow(renderedItems); return item == null ? void 0 : item.id; } return store == null ? void 0 : store.last(); @@ -28390,7 +31465,7 @@ var useComposite = createHook( ); var Composite = forwardRef2(function Composite2(props) { const htmlProps = useComposite(props); - return createElement(_2BDG6X5K_TagName, htmlProps); + return createElement(ITI7HKP4_TagName, htmlProps); }); @@ -28429,7 +31504,7 @@ function isFirstItemAutoSelected(items, activeValue, autoSelect) { function hasCompletionString(value, activeValue) { if (!activeValue) return false; if (value == null) return false; - value = normalizeString(value); + value = PBFD2E7P_normalizeString(value); return activeValue.length > value.length && activeValue.toLowerCase().indexOf(value.toLowerCase()) === 0; } function isInputEvent(event) { @@ -28628,7 +31703,7 @@ var useCombobox = createHook( const canAutoSelect = canAutoSelectRef.current; if (!store) return; if (!open) return; - if ((!autoSelect || !canAutoSelect) && !resetValueOnSelect) return; + if (!canAutoSelect && !resetValueOnSelect) return; const { baseElement, contentElement: contentElement2, activeId } = store.getState(); if (baseElement && !hasFocus(baseElement)) return; if (contentElement2 == null ? void 0 : contentElement2.hasAttribute("data-placing")) { @@ -28642,7 +31717,7 @@ var useCombobox = createHook( autoSelectIdRef.current = autoSelectId; store.move(autoSelectId != null ? autoSelectId : null); } else { - const element = (_b2 = store.item(activeId)) == null ? void 0 : _b2.element; + const element = (_b2 = store.item(activeId || store.first())) == null ? void 0 : _b2.element; if (element && "scrollIntoView" in element) { element.scrollIntoView({ block: "nearest", inline: "nearest" }); } @@ -28827,7 +31902,7 @@ var Combobox = forwardRef2(function Combobox2(props) { }); -;// ./node_modules/@ariakit/react-core/esm/__chunks/BSEL4YAF.js +;// ./node_modules/@ariakit/react-core/esm/__chunks/VGCJ63VH.js "use client"; @@ -28841,12 +31916,12 @@ var Combobox = forwardRef2(function Combobox2(props) { -var BSEL4YAF_TagName = "div"; +var VGCJ63VH_TagName = "div"; function afterTimeout(timeoutMs, cb) { const timeoutId = setTimeout(cb, timeoutMs); return () => clearTimeout(timeoutId); } -function BSEL4YAF_afterPaint(cb) { +function VGCJ63VH_afterPaint(cb) { let raf = requestAnimationFrame(() => { raf = requestAnimationFrame(cb); }); @@ -28900,19 +31975,17 @@ var useDisclosureContent = createHook(function useDisclosureContent2(_a) { setTransition(null); return; } - return BSEL4YAF_afterPaint(() => { + return VGCJ63VH_afterPaint(() => { setTransition(open ? "enter" : mounted ? "leave" : null); }); }, [animated, contentElement, open, mounted]); useSafeLayoutEffect(() => { if (!store) return; if (!animated) return; + if (!transition) return; + if (!contentElement) return; const stopAnimation = () => store == null ? void 0 : store.setState("animating", false); const stopAnimationSync = () => (0,external_ReactDOM_namespaceObject.flushSync)(stopAnimation); - if (!transition || !contentElement) { - stopAnimation(); - return; - } if (transition === "leave" && open) return; if (transition === "enter" && !open) return; if (typeof animated === "number") { @@ -28963,7 +32036,9 @@ var useDisclosureContent = createHook(function useDisclosureContent2(_a) { const hidden = isHidden(mounted, props.hidden, alwaysVisible); const styleProp = props.style; const style = (0,external_React_.useMemo)(() => { - if (hidden) return _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, styleProp), { display: "none" }); + if (hidden) { + return _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, styleProp), { display: "none" }); + } return styleProp; }, [hidden, styleProp]); props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({ @@ -28980,7 +32055,7 @@ var useDisclosureContent = createHook(function useDisclosureContent2(_a) { }); var DisclosureContentImpl = forwardRef2(function DisclosureContentImpl2(props) { const htmlProps = useDisclosureContent(props); - return createElement(BSEL4YAF_TagName, htmlProps); + return createElement(VGCJ63VH_TagName, htmlProps); }); var DisclosureContent = forwardRef2(function DisclosureContent2(_a) { var _b = _a, { @@ -29000,7 +32075,7 @@ var DisclosureContent = forwardRef2(function DisclosureContent2(_a) { -;// ./node_modules/@ariakit/react-core/esm/__chunks/6ZVAPMHT.js +;// ./node_modules/@ariakit/react-core/esm/__chunks/HUWAI7RB.js "use client"; @@ -29012,7 +32087,7 @@ var DisclosureContent = forwardRef2(function DisclosureContent2(_a) { -var _6ZVAPMHT_TagName = "div"; +var HUWAI7RB_TagName = "div"; var useComboboxList = createHook( function useComboboxList2(_a) { var _b = _a, { store, alwaysVisible } = _b, props = __objRest(_b, ["store", "alwaysVisible"]); @@ -29078,12 +32153,12 @@ var useComboboxList = createHook( ); var ComboboxList = forwardRef2(function ComboboxList2(props) { const htmlProps = useComboboxList(props); - return createElement(_6ZVAPMHT_TagName, htmlProps); + return createElement(HUWAI7RB_TagName, htmlProps); }); -;// ./node_modules/@ariakit/react-core/esm/__chunks/OBZMLI6J.js +;// ./node_modules/@ariakit/react-core/esm/__chunks/UQQRIHDV.js "use client"; @@ -29095,7 +32170,7 @@ var ComboboxList = forwardRef2(function ComboboxList2(props) { -var OBZMLI6J_TagName = "div"; +var UQQRIHDV_TagName = "div"; function getMouseDestination(event) { const relatedTarget = event.relatedTarget; if ((relatedTarget == null ? void 0 : relatedTarget.nodeType) === Node.ELEMENT_NODE) { @@ -29108,12 +32183,12 @@ function hoveringInside(event) { if (!nextElement) return false; return contains(event.currentTarget, nextElement); } -var symbol = Symbol("composite-hover"); +var UQQRIHDV_symbol = Symbol("composite-hover"); function movingToAnotherItem(event) { let dest = getMouseDestination(event); if (!dest) return false; do { - if (PBFD2E7P_hasOwnProperty(dest, symbol) && dest[symbol]) return true; + if (PBFD2E7P_hasOwnProperty(dest, UQQRIHDV_symbol) && dest[UQQRIHDV_symbol]) return true; dest = dest.parentElement; } while (dest); return false; @@ -29167,7 +32242,7 @@ var useCompositeHover = createHook( }); const ref = (0,external_React_.useCallback)((element) => { if (!element) return; - element[symbol] = true; + element[UQQRIHDV_symbol] = true; }, []); props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), { ref: useMergeRefs(ref, props.ref), @@ -29180,13 +32255,13 @@ var useCompositeHover = createHook( var CompositeHover = memo2( forwardRef2(function CompositeHover2(props) { const htmlProps = useCompositeHover(props); - return createElement(OBZMLI6J_TagName, htmlProps); + return createElement(UQQRIHDV_TagName, htmlProps); }) ); -;// ./node_modules/@ariakit/react-core/esm/__chunks/PLQDTVXM.js +;// ./node_modules/@ariakit/react-core/esm/__chunks/RZ4GPYOB.js "use client"; @@ -29196,7 +32271,7 @@ var CompositeHover = memo2( // src/collection/collection-item.tsx -var PLQDTVXM_TagName = "div"; +var RZ4GPYOB_TagName = "div"; var useCollectionItem = createHook( function useCollectionItem2(_a) { var _b = _a, { @@ -29231,12 +32306,12 @@ var useCollectionItem = createHook( ); var CollectionItem = forwardRef2(function CollectionItem2(props) { const htmlProps = useCollectionItem(props); - return createElement(PLQDTVXM_TagName, htmlProps); + return createElement(RZ4GPYOB_TagName, htmlProps); }); -;// ./node_modules/@ariakit/react-core/esm/__chunks/HGP5L2ST.js +;// ./node_modules/@ariakit/react-core/esm/__chunks/KUU7WJ55.js "use client"; @@ -29249,7 +32324,7 @@ var CollectionItem = forwardRef2(function CollectionItem2(props) { -var HGP5L2ST_TagName = "button"; +var KUU7WJ55_TagName = "button"; function isNativeClick(event) { if (!event.isTrusted) return false; const element = event.currentTarget; @@ -29261,16 +32336,12 @@ function isNativeClick(event) { } return false; } -var HGP5L2ST_symbol = Symbol("command"); +var KUU7WJ55_symbol = Symbol("command"); var useCommand = createHook( function useCommand2(_a) { var _b = _a, { clickOnEnter = true, clickOnSpace = true } = _b, props = __objRest(_b, ["clickOnEnter", "clickOnSpace"]); const ref = (0,external_React_.useRef)(null); - const tagName = useTagName(ref); - const type = props.type; - const [isNativeButton, setIsNativeButton] = (0,external_React_.useState)( - () => !!tagName && isButton({ tagName, type }) - ); + const [isNativeButton, setIsNativeButton] = (0,external_React_.useState)(false); (0,external_React_.useEffect)(() => { if (!ref.current) return; setIsNativeButton(isButton(ref.current)); @@ -29278,7 +32349,7 @@ var useCommand = createHook( const [active, setActive] = (0,external_React_.useState)(false); const activeRef = (0,external_React_.useRef)(false); const disabled = disabledFromProps(props); - const [isDuplicate, metadataProps] = useMetadataProps(props, HGP5L2ST_symbol, true); + const [isDuplicate, metadataProps] = useMetadataProps(props, KUU7WJ55_symbol, true); const onKeyDownProp = props.onKeyDown; const onKeyDown = useEvent((event) => { onKeyDownProp == null ? void 0 : onKeyDownProp(event); @@ -29352,12 +32423,12 @@ var useCommand = createHook( ); var Command = forwardRef2(function Command2(props) { const htmlProps = useCommand(props); - return createElement(HGP5L2ST_TagName, htmlProps); + return createElement(KUU7WJ55_TagName, htmlProps); }); -;// ./node_modules/@ariakit/react-core/esm/__chunks/7QKWW6TW.js +;// ./node_modules/@ariakit/react-core/esm/__chunks/P2CTZE2T.js "use client"; @@ -29375,7 +32446,7 @@ var Command = forwardRef2(function Command2(props) { -var _7QKWW6TW_TagName = "button"; +var P2CTZE2T_TagName = "button"; function isEditableElement(element) { if (isTextbox(element)) return true; return element.tagName === "INPUT" && !isButton(element); @@ -29457,21 +32528,65 @@ var useCompositeItem = createHook( const id = useId(props.id); const ref = (0,external_React_.useRef)(null); const row = (0,external_React_.useContext)(CompositeRowContext); - const rowId = useStoreState(store, (state) => { - if (rowIdProp) return rowIdProp; - if (!state) return; - if (!(row == null ? void 0 : row.baseElement)) return; - if (row.baseElement !== state.baseElement) return; - return row.id; - }); const disabled = disabledFromProps(props); const trulyDisabled = disabled && !props.accessibleWhenDisabled; + const { + rowId, + baseElement, + isActiveItem, + ariaSetSize, + ariaPosInSet, + isTabbable + } = useStoreStateObject(store, { + rowId(state) { + if (rowIdProp) return rowIdProp; + if (!state) return; + if (!(row == null ? void 0 : row.baseElement)) return; + if (row.baseElement !== state.baseElement) return; + return row.id; + }, + baseElement(state) { + return (state == null ? void 0 : state.baseElement) || void 0; + }, + isActiveItem(state) { + return !!state && state.activeId === id; + }, + ariaSetSize(state) { + if (ariaSetSizeProp != null) return ariaSetSizeProp; + if (!state) return; + if (!(row == null ? void 0 : row.ariaSetSize)) return; + if (row.baseElement !== state.baseElement) return; + return row.ariaSetSize; + }, + ariaPosInSet(state) { + if (ariaPosInSetProp != null) return ariaPosInSetProp; + if (!state) return; + if (!(row == null ? void 0 : row.ariaPosInSet)) return; + if (row.baseElement !== state.baseElement) return; + const itemsInRow = state.renderedItems.filter( + (item) => item.rowId === rowId + ); + return row.ariaPosInSet + itemsInRow.findIndex((item) => item.id === id); + }, + isTabbable(state) { + if (!(state == null ? void 0 : state.renderedItems.length)) return true; + if (state.virtualFocus) return false; + if (tabbable) return true; + if (state.activeId === null) return false; + const item = store == null ? void 0 : store.item(state.activeId); + if (item == null ? void 0 : item.disabled) return true; + if (!(item == null ? void 0 : item.element)) return true; + return state.activeId === id; + } + }); const getItem = (0,external_React_.useCallback)( (item) => { + var _a2; const nextItem = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, item), { id: id || item.id, rowId, - disabled: !!trulyDisabled + disabled: !!trulyDisabled, + children: (_a2 = item.element) == null ? void 0 : _a2.textContent }); if (getItemProp) { return getItemProp(nextItem); @@ -29591,10 +32706,6 @@ var useCompositeItem = createHook( } } }); - const baseElement = useStoreState( - store, - (state) => (state == null ? void 0 : state.baseElement) || void 0 - ); const providerValue = (0,external_React_.useMemo)( () => ({ id, baseElement }), [id, baseElement] @@ -29604,33 +32715,6 @@ var useCompositeItem = createHook( (element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CompositeItemContext.Provider, { value: providerValue, children: element }), [providerValue] ); - const isActiveItem = useStoreState( - store, - (state) => !!state && state.activeId === id - ); - const ariaSetSize = useStoreState(store, (state) => { - if (ariaSetSizeProp != null) return ariaSetSizeProp; - if (!state) return; - if (!(row == null ? void 0 : row.ariaSetSize)) return; - if (row.baseElement !== state.baseElement) return; - return row.ariaSetSize; - }); - const ariaPosInSet = useStoreState(store, (state) => { - if (ariaPosInSetProp != null) return ariaPosInSetProp; - if (!state) return; - if (!(row == null ? void 0 : row.ariaPosInSet)) return; - if (row.baseElement !== state.baseElement) return; - const itemsInRow = state.renderedItems.filter( - (item) => item.rowId === rowId - ); - return row.ariaPosInSet + itemsInRow.findIndex((item) => item.id === id); - }); - const isTabbable = useStoreState(store, (state) => { - if (!(state == null ? void 0 : state.renderedItems.length)) return true; - if (state.virtualFocus) return false; - if (tabbable) return true; - return state.activeId === id; - }); props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({ id, "data-active-item": isActiveItem || void 0 @@ -29657,13 +32741,13 @@ var useCompositeItem = createHook( var CompositeItem = memo2( forwardRef2(function CompositeItem2(props) { const htmlProps = useCompositeItem(props); - return createElement(_7QKWW6TW_TagName, htmlProps); + return createElement(P2CTZE2T_TagName, htmlProps); }) ); -;// ./node_modules/@ariakit/react-core/esm/combobox/combobox-item.js +;// ./node_modules/@ariakit/react-core/esm/__chunks/ZTDSJLD6.js "use client"; @@ -29673,17 +32757,6 @@ var CompositeItem = memo2( - - - - - - - - - - - // src/combobox/combobox-item.tsx @@ -29691,7 +32764,7 @@ var CompositeItem = memo2( -var combobox_item_TagName = "div"; +var ZTDSJLD6_TagName = "div"; function isSelected(storeValue, itemValue) { if (itemValue == null) return; if (storeValue == null) return false; @@ -29740,6 +32813,15 @@ var useComboboxItem = createHook( store, false && 0 ); + const { resetValueOnSelectState, multiSelectable, selected } = useStoreStateObject(store, { + resetValueOnSelectState: "resetValueOnSelect", + multiSelectable(state) { + return Array.isArray(state.selectedValue); + }, + selected(state) { + return isSelected(state.selectedValue, value); + } + }); const getItem = (0,external_React_.useCallback)( (item) => { const nextItem = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, item), { value }); @@ -29750,13 +32832,6 @@ var useComboboxItem = createHook( }, [value, getItemProp] ); - const multiSelectable = store.useState( - (state) => Array.isArray(state.selectedValue) - ); - const selected = store.useState( - (state) => isSelected(state.selectedValue, value) - ); - const resetValueOnSelectState = store.useState("resetValueOnSelect"); setValueOnClick = setValueOnClick != null ? setValueOnClick : !multiSelectable; hideOnClick = hideOnClick != null ? hideOnClick : value != null && !multiSelectable; const onClickProp = props.onClick; @@ -29848,11 +32923,12 @@ var useComboboxItem = createHook( var ComboboxItem = memo2( forwardRef2(function ComboboxItem2(props) { const htmlProps = useComboboxItem(props); - return createElement(combobox_item_TagName, htmlProps); + return createElement(ZTDSJLD6_TagName, htmlProps); }) ); + ;// ./node_modules/@ariakit/react-core/esm/combobox/combobox-item-value.js "use client"; @@ -29874,7 +32950,7 @@ var ComboboxItem = memo2( var combobox_item_value_TagName = "span"; function normalizeValue(value) { - return normalizeString(value).toLowerCase(); + return PBFD2E7P_normalizeString(value).toLowerCase(); } function getOffsets(string, values) { const offsets = []; @@ -29966,6 +33042,7 @@ var ComboboxItemValue = forwardRef2(function ComboboxItemValue2(props) { ;// ./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/search-widget.js +/* wp:polyfill */ /** * External dependencies */ @@ -29987,7 +33064,6 @@ var ComboboxItemValue = forwardRef2(function ComboboxItemValue2(props) { * Internal dependencies */ - const radioCheck = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", @@ -30048,7 +33124,7 @@ function ListBox({ setActiveId: setActiveCompositeId, role: "listbox", className: "dataviews-filters__search-widget-listbox", - "aria-label": (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: List of items for a filter. 1: Filter name. e.g.: "List of: Author". */ + "aria-label": (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: List of items for a filter. 1: Filter name. e.g.: "List of: Author". */ (0,external_wp_i18n_namespaceObject.__)('List of: %1$s'), filter.name), onFocusVisible: () => { // `onFocusVisible` needs the `Composite` component to be focusable, @@ -30199,6 +33275,7 @@ function SearchWidget(props) { } ;// ./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/filter-summary.js +/* wp:polyfill */ /** * External dependencies */ @@ -30219,7 +33296,6 @@ const SPACE = ' '; - const FilterText = ({ activeElements, filterInView, @@ -30237,30 +33313,30 @@ const FilterText = ({ }) }; if (filterInView?.operator === constants_OPERATOR_IS_ANY) { - return (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: 1: Filter name. 3: Filter value. e.g.: "Author is any: Admin, Editor". */ + return (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)(/* translators: 1: Filter name. 3: Filter value. e.g.: "Author is any: Admin, Editor". */ (0,external_wp_i18n_namespaceObject.__)('%1$s is any: %2$s'), filter.name, activeElements.map(element => element.label).join(', ')), filterTextWrappers); } if (filterInView?.operator === constants_OPERATOR_IS_NONE) { - return (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: 1: Filter name. 3: Filter value. e.g.: "Author is none: Admin, Editor". */ + return (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)(/* translators: 1: Filter name. 3: Filter value. e.g.: "Author is none: Admin, Editor". */ (0,external_wp_i18n_namespaceObject.__)('%1$s is none: %2$s'), filter.name, activeElements.map(element => element.label).join(', ')), filterTextWrappers); } if (filterInView?.operator === OPERATOR_IS_ALL) { - return (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: 1: Filter name. 3: Filter value. e.g.: "Author is all: Admin, Editor". */ + return (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)(/* translators: 1: Filter name. 3: Filter value. e.g.: "Author is all: Admin, Editor". */ (0,external_wp_i18n_namespaceObject.__)('%1$s is all: %2$s'), filter.name, activeElements.map(element => element.label).join(', ')), filterTextWrappers); } if (filterInView?.operator === OPERATOR_IS_NOT_ALL) { - return (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: 1: Filter name. 3: Filter value. e.g.: "Author is not all: Admin, Editor". */ + return (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)(/* translators: 1: Filter name. 3: Filter value. e.g.: "Author is not all: Admin, Editor". */ (0,external_wp_i18n_namespaceObject.__)('%1$s is not all: %2$s'), filter.name, activeElements.map(element => element.label).join(', ')), filterTextWrappers); } if (filterInView?.operator === constants_OPERATOR_IS) { - return (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: 1: Filter name. 3: Filter value. e.g.: "Author is: Admin". */ + return (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)(/* translators: 1: Filter name. 3: Filter value. e.g.: "Author is: Admin". */ (0,external_wp_i18n_namespaceObject.__)('%1$s is: %2$s'), filter.name, activeElements[0].label), filterTextWrappers); } if (filterInView?.operator === constants_OPERATOR_IS_NOT) { - return (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: 1: Filter name. 3: Filter value. e.g.: "Author is not: Admin". */ + return (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)(/* translators: 1: Filter name. 3: Filter value. e.g.: "Author is not: Admin". */ (0,external_wp_i18n_namespaceObject.__)('%1$s is not: %2$s'), filter.name, activeElements[0].label), filterTextWrappers); } - return (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: 1: Filter name e.g.: "Unknown status for Author". */ + return (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: 1: Filter name e.g.: "Unknown status for Author". */ (0,external_wp_i18n_namespaceObject.__)('Unknown status for %1$s'), filter.name); }; function OperatorSelector({ @@ -30350,7 +33426,7 @@ function FilterSummary({ }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "dataviews-filters__summary-chip-container", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Tooltip, { - text: (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: 1: Filter name. */ + text: (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: 1: Filter name. */ (0,external_wp_i18n_namespaceObject.__)('Filter by: %1$s'), filter.name.toLowerCase()), placement: "top", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { @@ -30429,6 +33505,7 @@ const { } = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/dataviews'); ;// ./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/add-filter.js +/* wp:polyfill */ /** * External dependencies */ @@ -30446,37 +33523,40 @@ const { const { - DropdownMenuV2: add_filter_DropdownMenuV2 + Menu: add_filter_Menu } = lock_unlock_unlock(external_wp_components_namespaceObject.privateApis); -function AddFilterDropdownMenu({ +function AddFilterMenu({ filters, view, onChangeView, setOpenedFilter, - trigger + triggerProps }) { const inactiveFilters = filters.filter(filter => !filter.isVisible); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(add_filter_DropdownMenuV2, { - trigger: trigger, - children: inactiveFilters.map(filter => { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(add_filter_DropdownMenuV2.Item, { - onClick: () => { - setOpenedFilter(filter.field); - onChangeView({ - ...view, - page: 1, - filters: [...(view.filters || []), { - field: filter.field, - value: undefined, - operator: filter.operators[0] - }] - }); - }, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(add_filter_DropdownMenuV2.ItemLabel, { - children: filter.name - }) - }, filter.field); - }) + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(add_filter_Menu, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(add_filter_Menu.TriggerButton, { + ...triggerProps + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(add_filter_Menu.Popover, { + children: inactiveFilters.map(filter => { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(add_filter_Menu.Item, { + onClick: () => { + setOpenedFilter(filter.field); + onChangeView({ + ...view, + page: 1, + filters: [...(view.filters || []), { + field: filter.field, + value: undefined, + operator: filter.operators[0] + }] + }); + }, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(add_filter_Menu.ItemLabel, { + children: filter.name + }) + }, filter.field); + }) + })] }); } function AddFilter({ @@ -30491,16 +33571,18 @@ function AddFilter({ return null; } const inactiveFilters = filters.filter(filter => !filter.isVisible); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(AddFilterDropdownMenu, { - trigger: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - accessibleWhenDisabled: true, - size: "compact", - className: "dataviews-filters-button", - variant: "tertiary", - disabled: !inactiveFilters.length, - ref: ref, + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(AddFilterMenu, { + triggerProps: { + render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + accessibleWhenDisabled: true, + size: "compact", + className: "dataviews-filters-button", + variant: "tertiary", + disabled: !inactiveFilters.length, + ref: ref + }), children: (0,external_wp_i18n_namespaceObject.__)('Add filter') - }), + }, filters, view, onChangeView, @@ -30510,6 +33592,7 @@ function AddFilter({ /* harmony default export */ const add_filter = ((0,external_wp_element_namespaceObject.forwardRef)(AddFilter)); ;// ./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/reset-filters.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -30546,6 +33629,7 @@ function ResetFilter({ } ;// ./node_modules/@wordpress/dataviews/build-module/utils.js +/* wp:polyfill */ /** * Internal dependencies */ @@ -30570,6 +33654,7 @@ function sanitizeOperators(field) { } ;// ./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/index.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -30588,7 +33673,6 @@ function sanitizeOperators(field) { - function useFilters(fields, view) { return (0,external_wp_element_namespaceObject.useMemo)(() => { const filters = []; @@ -30625,7 +33709,7 @@ function useFilters(fields, view) { return filters; }, [fields, view]); } -function FilterVisibilityToggle({ +function FiltersToggle({ filters, view, onChangeView, @@ -30633,6 +33717,7 @@ function FilterVisibilityToggle({ isShowingFilter, setIsShowingFilter }) { + const buttonRef = (0,external_wp_element_namespaceObject.useRef)(null); const onChangeViewWithFilterVisibility = (0,external_wp_element_namespaceObject.useCallback)(_view => { onChangeView(_view); setIsShowingFilter(true); @@ -30642,40 +33727,59 @@ function FilterVisibilityToggle({ if (filters.length === 0) { return null; } - if (!hasVisibleFilters) { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(AddFilterDropdownMenu, { + const addFilterButtonProps = { + label: (0,external_wp_i18n_namespaceObject.__)('Add filter'), + 'aria-expanded': false, + isPressed: false + }; + const toggleFiltersButtonProps = { + label: (0,external_wp_i18n_namespaceObject._x)('Filter', 'verb'), + 'aria-expanded': isShowingFilter, + isPressed: isShowingFilter, + onClick: () => { + if (!isShowingFilter) { + setOpenedFilter(null); + } + setIsShowingFilter(!isShowingFilter); + } + }; + const buttonComponent = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + ref: buttonRef, + className: "dataviews-filters__visibility-toggle", + size: "compact", + icon: library_funnel, + ...(hasVisibleFilters ? toggleFiltersButtonProps : addFilterButtonProps) + }); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: "dataviews-filters__container-visibility-toggle", + children: !hasVisibleFilters ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(AddFilterMenu, { filters: filters, view: view, onChangeView: onChangeViewWithFilterVisibility, setOpenedFilter: setOpenedFilter, - trigger: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - className: "dataviews-filters__visibility-toggle", - size: "compact", - icon: library_funnel, - label: (0,external_wp_i18n_namespaceObject.__)('Add filter'), - isPressed: false, - "aria-expanded": false - }) - }); - } - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { - className: "dataviews-filters__container-visibility-toggle", - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - className: "dataviews-filters__visibility-toggle", - size: "compact", - icon: library_funnel, - label: (0,external_wp_i18n_namespaceObject.__)('Toggle filter display'), - onClick: () => { - if (!isShowingFilter) { - setOpenedFilter(null); - } - setIsShowingFilter(!isShowingFilter); - }, - isPressed: isShowingFilter, - "aria-expanded": isShowingFilter - }), hasVisibleFilters && !!view.filters?.length && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { + triggerProps: { + render: buttonComponent + } + }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(FilterVisibilityToggle, { + buttonRef: buttonRef, + filtersCount: view.filters?.length, + children: buttonComponent + }) + }); +} +function FilterVisibilityToggle({ + buttonRef, + filtersCount, + children +}) { + // Focus the `add filter` button when unmounts. + (0,external_wp_element_namespaceObject.useEffect)(() => () => { + buttonRef.current?.focus(); + }, [buttonRef]); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [children, !!filtersCount && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "dataviews-filters-toggle__count", - children: view.filters?.length + children: filtersCount })] }); } @@ -30709,7 +33813,7 @@ function Filters() { openedFilter: openedFilter }, filter.field); }), addFilter]; - filterComponents.push( /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ResetFilter, { + filterComponents.push(/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ResetFilter, { filters: filters, view: view, onChangeView: onChangeView @@ -30789,6 +33893,7 @@ const formatListBullets = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObje /* harmony default export */ const format_list_bullets = (formatListBullets); ;// ./node_modules/@wordpress/dataviews/build-module/components/dataviews-selection-checkbox/index.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -30804,20 +33909,16 @@ function DataViewsSelectionCheckbox({ onChangeSelection, item, getItemId, - primaryField, + titleField, disabled }) { const id = getItemId(item); const checked = !disabled && selection.includes(id); - let selectionLabel; - if (primaryField?.getValue && item) { - // eslint-disable-next-line @wordpress/valid-sprintf - selectionLabel = (0,external_wp_i18n_namespaceObject.sprintf)(checked ? /* translators: %s: item title. */(0,external_wp_i18n_namespaceObject.__)('Deselect item: %s') : /* translators: %s: item title. */(0,external_wp_i18n_namespaceObject.__)('Select item: %s'), primaryField.getValue({ - item - })); - } else { - selectionLabel = checked ? (0,external_wp_i18n_namespaceObject.__)('Select a new item') : (0,external_wp_i18n_namespaceObject.__)('Deselect item'); - } + + // Fallback label to ensure accessibility + const selectionLabel = titleField?.getValue?.({ + item + }) || (0,external_wp_i18n_namespaceObject.__)('(no title)'); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.CheckboxControl, { className: "dataviews-selection-checkbox", __nextHasNoMarginBottom: true, @@ -30834,6 +33935,7 @@ function DataViewsSelectionCheckbox({ } ;// ./node_modules/@wordpress/dataviews/build-module/components/dataviews-item-actions/index.js +/* wp:polyfill */ /** * External dependencies */ @@ -30852,10 +33954,8 @@ function DataViewsSelectionCheckbox({ */ - - const { - DropdownMenuV2: dataviews_item_actions_DropdownMenuV2, + Menu: dataviews_item_actions_Menu, kebabCase: dataviews_item_actions_kebabCase } = lock_unlock_unlock(external_wp_components_namespaceObject.privateApis); function ButtonTrigger({ @@ -30867,21 +33967,23 @@ function ButtonTrigger({ return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { label: label, icon: action.icon, + disabled: !!action.disabled, + accessibleWhenDisabled: true, isDestructive: action.isDestructive, size: "compact", onClick: onClick }); } -function DropdownMenuItemTrigger({ +function MenuItemTrigger({ action, onClick, items }) { const label = typeof action.label === 'string' ? action.label : action.label(items); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(dataviews_item_actions_DropdownMenuV2.Item, { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(dataviews_item_actions_Menu.Item, { + disabled: action.disabled, onClick: onClick, - hideOnClick: !('RenderModal' in action), - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(dataviews_item_actions_DropdownMenuV2.ItemLabel, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(dataviews_item_actions_Menu.ItemLabel, { children: label }) }); @@ -30895,9 +33997,9 @@ function ActionModal({ return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Modal, { title: action.modalHeader || label, __experimentalHideHeader: !!action.hideModalHeader, - onRequestClose: closeModal !== null && closeModal !== void 0 ? closeModal : () => {}, + onRequestClose: closeModal, focusOnMount: "firstContentElement", - size: "small", + size: "medium", overlayClassName: `dataviews-action-modal dataviews-action-modal__${dataviews_item_actions_kebabCase(action.id)}`, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(action.RenderModal, { items: items, @@ -30905,55 +34007,26 @@ function ActionModal({ }) }); } -function ActionWithModal({ - action, - items, - ActionTrigger, - isBusy -}) { - const [isModalOpen, setIsModalOpen] = (0,external_wp_element_namespaceObject.useState)(false); - const actionTriggerProps = { - action, - onClick: () => { - setIsModalOpen(true); - }, - items, - isBusy - }; - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ActionTrigger, { - ...actionTriggerProps - }), isModalOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ActionModal, { - action: action, - items: items, - closeModal: () => setIsModalOpen(false) - })] - }); -} -function ActionsDropdownMenuGroup({ +function ActionsMenuGroup({ actions, - item + item, + registry, + setActiveModalAction }) { - const registry = (0,external_wp_data_namespaceObject.useRegistry)(); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(dataviews_item_actions_DropdownMenuV2.Group, { - children: actions.map(action => { - if ('RenderModal' in action) { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ActionWithModal, { - action: action, - items: [item], - ActionTrigger: DropdownMenuItemTrigger - }, action.id); - } - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DropdownMenuItemTrigger, { - action: action, - onClick: () => { - action.callback([item], { - registry - }); - }, - items: [item] - }, action.id); - }) + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(dataviews_item_actions_Menu.Group, { + children: actions.map(action => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MenuItemTrigger, { + action: action, + onClick: () => { + if ('RenderModal' in action) { + setActiveModalAction(action); + return; + } + action.callback([item], { + registry + }); + }, + items: [item] + }, action.id)) }); } function ItemActions({ @@ -30978,7 +34051,18 @@ function ItemActions({ if (isCompact) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CompactItemActions, { item: item, - actions: eligibleActions + actions: eligibleActions, + isSmall: true, + registry: registry + }); + } + + // If all actions are primary, there is no need to render the dropdown. + if (primaryActions.length === eligibleActions.length) { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PrimaryActions, { + item: item, + actions: primaryActions, + registry: registry }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { @@ -30989,51 +34073,87 @@ function ItemActions({ flexShrink: '0', width: 'auto' }, - children: [!!primaryActions.length && primaryActions.map(action => { - if ('RenderModal' in action) { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ActionWithModal, { - action: action, - items: [item], - ActionTrigger: ButtonTrigger - }, action.id); - } - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ButtonTrigger, { - action: action, - onClick: () => { - action.callback([item], { - registry - }); - }, - items: [item] - }, action.id); + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PrimaryActions, { + item: item, + actions: primaryActions, + registry: registry }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CompactItemActions, { item: item, - actions: eligibleActions + actions: eligibleActions, + registry: registry })] }); } function CompactItemActions({ item, - actions + actions, + isSmall, + registry }) { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(dataviews_item_actions_DropdownMenuV2, { - trigger: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - size: "compact", - icon: more_vertical, - label: (0,external_wp_i18n_namespaceObject.__)('Actions'), - accessibleWhenDisabled: true, - disabled: !actions.length, - className: "dataviews-all-actions-button" - }), - placement: "bottom-end", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ActionsDropdownMenuGroup, { - actions: actions, - item: item - }) + const [activeModalAction, setActiveModalAction] = (0,external_wp_element_namespaceObject.useState)(null); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(dataviews_item_actions_Menu, { + placement: "bottom-end", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(dataviews_item_actions_Menu.TriggerButton, { + render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + size: isSmall ? 'small' : 'compact', + icon: more_vertical, + label: (0,external_wp_i18n_namespaceObject.__)('Actions'), + accessibleWhenDisabled: true, + disabled: !actions.length, + className: "dataviews-all-actions-button" + }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(dataviews_item_actions_Menu.Popover, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ActionsMenuGroup, { + actions: actions, + item: item, + registry: registry, + setActiveModalAction: setActiveModalAction + }) + })] + }), !!activeModalAction && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ActionModal, { + action: activeModalAction, + items: [item], + closeModal: () => setActiveModalAction(null) + })] + }); +} +function PrimaryActions({ + item, + actions, + registry +}) { + const [activeModalAction, setActiveModalAction] = (0,external_wp_element_namespaceObject.useState)(null); + if (!Array.isArray(actions) || actions.length === 0) { + return null; + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [actions.map(action => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ButtonTrigger, { + action: action, + onClick: () => { + if ('RenderModal' in action) { + setActiveModalAction(action); + return; + } + action.callback([item], { + registry + }); + }, + items: [item] + }, action.id)), !!activeModalAction && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ActionModal, { + action: activeModalAction, + items: [item], + closeModal: () => setActiveModalAction(null) + })] }); } ;// ./node_modules/@wordpress/dataviews/build-module/components/dataviews-bulk-actions/index.js +/* wp:polyfill */ +/** + * External dependencies + */ + /** * WordPress dependencies */ @@ -31049,7 +34169,29 @@ function CompactItemActions({ - +function ActionWithModal({ + action, + items, + ActionTriggerComponent +}) { + const [isModalOpen, setIsModalOpen] = (0,external_wp_element_namespaceObject.useState)(false); + const actionTriggerProps = { + action, + onClick: () => { + setIsModalOpen(true); + }, + items + }; + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ActionTriggerComponent, { + ...actionTriggerProps + }), isModalOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ActionModal, { + action: action, + items: items, + closeModal: () => setIsModalOpen(false) + })] + }); +} function useHasAPossibleBulkAction(actions, item) { return (0,external_wp_element_namespaceObject.useMemo)(() => { return actions.some(action => { @@ -31131,7 +34273,7 @@ function ActionButton({ return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ActionWithModal, { action: action, items: selectedEligibleItems, - ActionTrigger: ActionTrigger + ActionTriggerComponent: ActionTrigger }, action.id); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ActionTrigger, { @@ -31148,8 +34290,8 @@ function ActionButton({ }, action.id); } function renderFooterContent(data, actions, getItemId, selection, actionsToShow, selectedItems, actionInProgress, setActionInProgress, onChangeSelection) { - const message = selectedItems.length > 0 ? (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %d: number of items. */ - (0,external_wp_i18n_namespaceObject._n)('%d Item selected', '%d Items selected', selectedItems.length), selectedItems.length) : (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %d: number of items. */ + const message = selectedItems.length > 0 ? (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %d: number of items. */ + (0,external_wp_i18n_namespaceObject._n)('%d Item selected', '%d Items selected', selectedItems.length), selectedItems.length) : (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %d: number of items. */ (0,external_wp_i18n_namespaceObject._n)('%d Item', '%d Items', data.length), data.length); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { expanded: false, @@ -31198,7 +34340,7 @@ function FooterContent({ getItemId }) { const [actionInProgress, setActionInProgress] = (0,external_wp_element_namespaceObject.useState)(null); - const footerContent = (0,external_wp_element_namespaceObject.useRef)(null); + const footerContentRef = (0,external_wp_element_namespaceObject.useRef)(null); const bulkActions = (0,external_wp_element_namespaceObject.useMemo)(() => actions.filter(action => action.supportsBulk), [actions]); const selectableItems = (0,external_wp_element_namespaceObject.useMemo)(() => { return data.filter(item => { @@ -31212,14 +34354,14 @@ function FooterContent({ return action.supportsBulk && action.icon && selectedItems.some(item => !action.isEligible || action.isEligible(item)); }), [actions, selectedItems]); if (!actionInProgress) { - if (footerContent.current) { - footerContent.current = null; + if (footerContentRef.current) { + footerContentRef.current = null; } return renderFooterContent(data, actions, getItemId, selection, actionsToShow, selectedItems, actionInProgress, setActionInProgress, onChangeSelection); - } else if (!footerContent.current) { - footerContent.current = renderFooterContent(data, actions, getItemId, selection, actionsToShow, selectedItems, actionInProgress, setActionInProgress, onChangeSelection); + } else if (!footerContentRef.current) { + footerContentRef.current = renderFooterContent(data, actions, getItemId, selection, actionsToShow, selectedItems, actionInProgress, setActionInProgress, onChangeSelection); } - return footerContent.current; + return footerContentRef.current; } function BulkActionsFooter() { const { @@ -31278,12 +34420,13 @@ const unseen = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ext viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - d: "M4.67 10.664s-2.09 1.11-2.917 1.582l.494.87 1.608-.914.002.002c.343.502.86 1.17 1.563 1.84.348.33.742.663 1.185.976L5.57 16.744l.858.515 1.02-1.701a9.1 9.1 0 0 0 4.051 1.18V19h1v-2.263a9.1 9.1 0 0 0 4.05-1.18l1.021 1.7.858-.514-1.034-1.723c.442-.313.837-.646 1.184-.977.703-.669 1.22-1.337 1.563-1.839l.002-.003 1.61.914.493-.87c-1.75-.994-2.918-1.58-2.918-1.58l-.003.005a8.29 8.29 0 0 1-.422.689 10.097 10.097 0 0 1-1.36 1.598c-1.218 1.16-3.042 2.293-5.544 2.293-2.503 0-4.327-1.132-5.546-2.293a10.099 10.099 0 0 1-1.359-1.599 8.267 8.267 0 0 1-.422-.689l-.003-.005Z" + d: "M20.7 12.7s0-.1-.1-.2c0-.2-.2-.4-.4-.6-.3-.5-.9-1.2-1.6-1.8-.7-.6-1.5-1.3-2.6-1.8l-.6 1.4c.9.4 1.6 1 2.1 1.5.6.6 1.1 1.2 1.4 1.6.1.2.3.4.3.5v.1l.7-.3.7-.3Zm-5.2-9.3-1.8 4c-.5-.1-1.1-.2-1.7-.2-3 0-5.2 1.4-6.6 2.7-.7.7-1.2 1.3-1.6 1.8-.2.3-.3.5-.4.6 0 0 0 .1-.1.2s0 0 .7.3l.7.3V13c0-.1.2-.3.3-.5.3-.4.7-1 1.4-1.6 1.2-1.2 3-2.3 5.5-2.3H13v.3c-.4 0-.8-.1-1.1-.1-1.9 0-3.5 1.6-3.5 3.5s.6 2.3 1.6 2.9l-2 4.4.9.4 7.6-16.2-.9-.4Zm-3 12.6c1.7-.2 3-1.7 3-3.5s-.2-1.4-.6-1.9L12.4 16Z" }) }); /* harmony default export */ const library_unseen = (unseen); ;// ./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/table/column-header-menu.js +/* wp:polyfill */ /** * External dependencies */ @@ -31303,16 +34446,14 @@ const unseen = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ext - - const { - DropdownMenuV2: column_header_menu_DropdownMenuV2 + Menu: column_header_menu_Menu } = lock_unlock_unlock(external_wp_components_namespaceObject.privateApis); -function WithDropDownMenuSeparators({ +function WithMenuSeparators({ children }) { return external_wp_element_namespaceObject.Children.toArray(children).filter(Boolean).map((child, i) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_element_namespaceObject.Fragment, { - children: [i > 0 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(column_header_menu_DropdownMenuV2.Separator, {}), child] + children: [i > 0 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(column_header_menu_Menu.Separator, {}), child] }, i)); } const _HeaderMenu = (0,external_wp_element_namespaceObject.forwardRef)(function HeaderMenu({ @@ -31321,147 +34462,146 @@ const _HeaderMenu = (0,external_wp_element_namespaceObject.forwardRef)(function fields, onChangeView, onHide, - setOpenedFilter + setOpenedFilter, + canMove = true }, ref) { - const visibleFieldIds = getVisibleFieldIds(view, fields); + var _view$fields; + const visibleFieldIds = (_view$fields = view.fields) !== null && _view$fields !== void 0 ? _view$fields : []; const index = visibleFieldIds?.indexOf(fieldId); const isSorted = view.sort?.field === fieldId; let isHidable = false; let isSortable = false; let canAddFilter = false; - let header; let operators = []; - const combinedField = view.layout?.combinedFields?.find(f => f.id === fieldId); const field = fields.find(f => f.id === fieldId); - if (!combinedField) { - if (!field) { - // No combined or regular field found. - return null; - } - isHidable = field.enableHiding !== false; - isSortable = field.enableSorting !== false; - header = field.header; - operators = sanitizeOperators(field); - // Filter can be added: - // 1. If the field is not already part of a view's filters. - // 2. If the field meets the type and operator requirements. - // 3. If it's not primary. If it is, it should be already visible. - canAddFilter = !view.filters?.some(_filter => fieldId === _filter.field) && !!field.elements?.length && !!operators.length && !field.filterBy?.isPrimary; - } else { - header = combinedField.header || combinedField.label; + if (!field) { + // No combined or regular field found. + return null; } - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(column_header_menu_DropdownMenuV2, { - align: "start", - trigger: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Button, { - size: "compact", - className: "dataviews-view-table-header-button", - ref: ref, - variant: "tertiary", + isHidable = field.enableHiding !== false; + isSortable = field.enableSorting !== false; + const header = field.header; + operators = sanitizeOperators(field); + // Filter can be added: + // 1. If the field is not already part of a view's filters. + // 2. If the field meets the type and operator requirements. + // 3. If it's not primary. If it is, it should be already visible. + canAddFilter = !view.filters?.some(_filter => fieldId === _filter.field) && !!field.elements?.length && !!operators.length && !field.filterBy?.isPrimary; + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(column_header_menu_Menu, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(column_header_menu_Menu.TriggerButton, { + render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + size: "compact", + className: "dataviews-view-table-header-button", + ref: ref, + variant: "tertiary" + }), children: [header, view.sort && isSorted && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { "aria-hidden": "true", children: sortArrows[view.sort.direction] })] - }), - style: { - minWidth: '240px' - }, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(WithDropDownMenuSeparators, { - children: [isSortable && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(column_header_menu_DropdownMenuV2.Group, { - children: SORTING_DIRECTIONS.map(direction => { - const isChecked = view.sort && isSorted && view.sort.direction === direction; - const value = `${fieldId}-${direction}`; - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(column_header_menu_DropdownMenuV2.RadioItem, { - // All sorting radio items share the same name, so that - // selecting a sorting option automatically deselects the - // previously selected one, even if it is displayed in - // another submenu. The field and direction are passed via - // the `value` prop. - name: "view-table-sorting", - value: value, - checked: isChecked, - onChange: () => { + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(column_header_menu_Menu.Popover, { + style: { + minWidth: '240px' + }, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(WithMenuSeparators, { + children: [isSortable && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(column_header_menu_Menu.Group, { + children: SORTING_DIRECTIONS.map(direction => { + const isChecked = view.sort && isSorted && view.sort.direction === direction; + const value = `${fieldId}-${direction}`; + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(column_header_menu_Menu.RadioItem, { + // All sorting radio items share the same name, so that + // selecting a sorting option automatically deselects the + // previously selected one, even if it is displayed in + // another submenu. The field and direction are passed via + // the `value` prop. + name: "view-table-sorting", + value: value, + checked: isChecked, + onChange: () => { + onChangeView({ + ...view, + sort: { + field: fieldId, + direction + }, + showLevels: false + }); + }, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(column_header_menu_Menu.ItemLabel, { + children: sortLabels[direction] + }) + }, value); + }) + }), canAddFilter && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(column_header_menu_Menu.Group, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(column_header_menu_Menu.Item, { + prefix: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { + icon: library_funnel + }), + onClick: () => { + setOpenedFilter(fieldId); onChangeView({ ...view, - sort: { + page: 1, + filters: [...(view.filters || []), { field: fieldId, - direction - } + value: undefined, + operator: operators[0] + }] }); }, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(column_header_menu_DropdownMenuV2.ItemLabel, { - children: sortLabels[direction] + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(column_header_menu_Menu.ItemLabel, { + children: (0,external_wp_i18n_namespaceObject.__)('Add filter') }) - }, value); - }) - }), canAddFilter && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(column_header_menu_DropdownMenuV2.Group, { - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(column_header_menu_DropdownMenuV2.Item, { - prefix: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { - icon: library_funnel - }), - onClick: () => { - setOpenedFilter(fieldId); - onChangeView({ - ...view, - page: 1, - filters: [...(view.filters || []), { - field: fieldId, - value: undefined, - operator: operators[0] - }] - }); - }, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(column_header_menu_DropdownMenuV2.ItemLabel, { - children: (0,external_wp_i18n_namespaceObject.__)('Add filter') - }) - }) - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(column_header_menu_DropdownMenuV2.Group, { - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(column_header_menu_DropdownMenuV2.Item, { - prefix: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { - icon: arrow_left - }), - disabled: index < 1, - onClick: () => { - var _visibleFieldIds$slic; - onChangeView({ - ...view, - fields: [...((_visibleFieldIds$slic = visibleFieldIds.slice(0, index - 1)) !== null && _visibleFieldIds$slic !== void 0 ? _visibleFieldIds$slic : []), fieldId, visibleFieldIds[index - 1], ...visibleFieldIds.slice(index + 1)] - }); - }, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(column_header_menu_DropdownMenuV2.ItemLabel, { - children: (0,external_wp_i18n_namespaceObject.__)('Move left') - }) - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(column_header_menu_DropdownMenuV2.Item, { - prefix: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { - icon: arrow_right - }), - disabled: index >= visibleFieldIds.length - 1, - onClick: () => { - var _visibleFieldIds$slic2; - onChangeView({ - ...view, - fields: [...((_visibleFieldIds$slic2 = visibleFieldIds.slice(0, index)) !== null && _visibleFieldIds$slic2 !== void 0 ? _visibleFieldIds$slic2 : []), visibleFieldIds[index + 1], fieldId, ...visibleFieldIds.slice(index + 2)] - }); - }, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(column_header_menu_DropdownMenuV2.ItemLabel, { - children: (0,external_wp_i18n_namespaceObject.__)('Move right') - }) - }), isHidable && field && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(column_header_menu_DropdownMenuV2.Item, { - prefix: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { - icon: library_unseen - }), - onClick: () => { - onHide(field); - onChangeView({ - ...view, - fields: visibleFieldIds.filter(id => id !== fieldId) - }); - }, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(column_header_menu_DropdownMenuV2.ItemLabel, { - children: (0,external_wp_i18n_namespaceObject.__)('Hide column') }) + }), (canMove || isHidable) && field && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(column_header_menu_Menu.Group, { + children: [canMove && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(column_header_menu_Menu.Item, { + prefix: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { + icon: arrow_left + }), + disabled: index < 1, + onClick: () => { + var _visibleFieldIds$slic; + onChangeView({ + ...view, + fields: [...((_visibleFieldIds$slic = visibleFieldIds.slice(0, index - 1)) !== null && _visibleFieldIds$slic !== void 0 ? _visibleFieldIds$slic : []), fieldId, visibleFieldIds[index - 1], ...visibleFieldIds.slice(index + 1)] + }); + }, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(column_header_menu_Menu.ItemLabel, { + children: (0,external_wp_i18n_namespaceObject.__)('Move left') + }) + }), canMove && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(column_header_menu_Menu.Item, { + prefix: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { + icon: arrow_right + }), + disabled: index >= visibleFieldIds.length - 1, + onClick: () => { + var _visibleFieldIds$slic2; + onChangeView({ + ...view, + fields: [...((_visibleFieldIds$slic2 = visibleFieldIds.slice(0, index)) !== null && _visibleFieldIds$slic2 !== void 0 ? _visibleFieldIds$slic2 : []), visibleFieldIds[index + 1], fieldId, ...visibleFieldIds.slice(index + 2)] + }); + }, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(column_header_menu_Menu.ItemLabel, { + children: (0,external_wp_i18n_namespaceObject.__)('Move right') + }) + }), isHidable && field && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(column_header_menu_Menu.Item, { + prefix: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { + icon: library_unseen + }), + onClick: () => { + onHide(field); + onChangeView({ + ...view, + fields: visibleFieldIds.filter(id => id !== fieldId) + }); + }, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(column_header_menu_Menu.ItemLabel, { + children: (0,external_wp_i18n_namespaceObject.__)('Hide column') + }) + })] })] - })] - }) + }) + })] }); }); @@ -31469,7 +34609,92 @@ const _HeaderMenu = (0,external_wp_element_namespaceObject.forwardRef)(function const ColumnHeaderMenu = _HeaderMenu; /* harmony default export */ const column_header_menu = (ColumnHeaderMenu); +;// ./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/utils/get-clickable-item-props.js +function getClickableItemProps({ + item, + isItemClickable, + onClickItem, + className +}) { + if (!isItemClickable(item) || !onClickItem) { + return { + className + }; + } + return { + className: className ? `${className} ${className}--clickable` : undefined, + role: 'button', + tabIndex: 0, + onClick: event => { + // Prevents onChangeSelection from triggering. + event.stopPropagation(); + onClickItem(item); + }, + onKeyDown: event => { + if (event.key === 'Enter' || event.key === '' || event.key === ' ') { + // Prevents onChangeSelection from triggering. + event.stopPropagation(); + onClickItem(item); + } + } + }; +} + +;// ./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/table/column-primary.js +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + + +function ColumnPrimary({ + item, + level, + titleField, + mediaField, + descriptionField, + onClickItem, + isItemClickable +}) { + const clickableProps = getClickableItemProps({ + item, + isItemClickable, + onClickItem, + className: 'dataviews-view-table__cell-content-wrapper dataviews-title-field' + }); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { + spacing: 3, + justify: "flex-start", + children: [mediaField && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: "dataviews-view-table__cell-content-wrapper dataviews-column-primary__media", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(mediaField.render, { + item: item + }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { + spacing: 0, + children: [titleField && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { + ...clickableProps, + children: [level !== undefined && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("span", { + className: "dataviews-view-table__level", + children: ['—'.repeat(level), "\xA0"] + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(titleField.render, { + item: item + })] + }), descriptionField && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(descriptionField.render, { + item: item + })] + })] + }); +} +/* harmony default export */ const column_primary = (ColumnPrimary); + ;// ./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/table/index.js +/* wp:polyfill */ /** * External dependencies */ @@ -31492,80 +34717,48 @@ const ColumnHeaderMenu = _HeaderMenu; - - -function TableColumn({ - column, +function TableColumnField({ + item, fields, - view, - ...props + column }) { const field = fields.find(f => f.id === column); - if (!!field) { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TableColumnField, { - ...props, - field: field - }); + if (!field) { + return null; } - const combinedField = view.layout?.combinedFields?.find(f => f.id === column); - if (!!combinedField) { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TableColumnCombined, { - ...props, - fields: fields, - view: view, - field: combinedField - }); - } - return null; -} -function TableColumnField({ - primaryField, - item, - field -}) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { - className: dist_clsx('dataviews-view-table__cell-content-wrapper', { - 'dataviews-view-table__primary-field': primaryField?.id === field.id - }), + className: "dataviews-view-table__cell-content-wrapper", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(field.render, { item }) }); } -function TableColumnCombined({ - field, - ...props -}) { - const children = field.children.map(child => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TableColumn, { - ...props, - column: child - }, child)); - if (field.direction === 'horizontal') { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHStack, { - spacing: 3, - children: children - }); - } - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalVStack, { - spacing: 0, - children: children - }); -} function TableRow({ hasBulkActions, item, + level, actions, fields, id, view, - primaryField, + titleField, + mediaField, + descriptionField, selection, getItemId, + isItemClickable, + onClickItem, onChangeSelection }) { + var _view$fields; const hasPossibleBulkAction = useHasAPossibleBulkAction(actions, item); const isSelected = hasPossibleBulkAction && selection.includes(id); const [isHovered, setIsHovered] = (0,external_wp_element_namespaceObject.useState)(false); + const { + showTitle = true, + showMedia = true, + showDescription = true + } = view; const handleMouseEnter = () => { setIsHovered(true); }; @@ -31577,7 +34770,8 @@ function TableRow({ // `onClick` and can be used to exclude touchscreen devices from certain // behaviours. const isTouchDeviceRef = (0,external_wp_element_namespaceObject.useRef)(false); - const columns = getVisibleFieldIds(view, fields); + const columns = (_view$fields = view.fields) !== null && _view$fields !== void 0 ? _view$fields : []; + const hasPrimaryColumn = titleField && showTitle || mediaField && showMedia || descriptionField && showDescription; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("tr", { className: dist_clsx('dataviews-view-table__row', { 'is-selected': hasPossibleBulkAction && isSelected, @@ -31609,13 +34803,23 @@ function TableRow({ selection: selection, onChangeSelection: onChangeSelection, getItemId: getItemId, - primaryField: primaryField, + titleField: titleField, disabled: !hasPossibleBulkAction }) }) + }), hasPrimaryColumn && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("td", { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(column_primary, { + item: item, + level: level, + titleField: showTitle ? titleField : undefined, + mediaField: showMedia ? mediaField : undefined, + descriptionField: showDescription ? descriptionField : undefined, + isItemClickable: isItemClickable, + onClickItem: onClickItem + }) }), columns.map(column => { var _view$layout$styles$c; - // Explicits picks the supported styles. + // Explicit picks the supported styles. const { width, maxWidth, @@ -31627,12 +34831,10 @@ function TableRow({ maxWidth, minWidth }, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TableColumn, { - primaryField: primaryField, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TableColumnField, { fields: fields, item: item, - column: column, - view: view + column: column }) }, column); }), !!actions?.length && @@ -31659,13 +34861,17 @@ function ViewTable({ data, fields, getItemId, + getItemLevel, isLoading = false, onChangeView, onChangeSelection, selection, setOpenedFilter, + onClickItem, + isItemClickable, view }) { + var _view$fields2; const headerMenuRefs = (0,external_wp_element_namespaceObject.useRef)(new Map()); const headerMenuToFocusRef = (0,external_wp_element_namespaceObject.useRef)(); const [nextHeaderMenuToFocus, setNextHeaderMenuToFocus] = (0,external_wp_element_namespaceObject.useState)(); @@ -31691,12 +34897,32 @@ function ViewTable({ const fallback = hidden ? headerMenuRefs.current.get(hidden.fallback) : undefined; setNextHeaderMenuToFocus(fallback?.node); }; - const columns = getVisibleFieldIds(view, fields); const hasData = !!data?.length; - const primaryField = fields.find(field => field.id === view.layout?.primaryField); + const titleField = fields.find(field => field.id === view.titleField); + const mediaField = fields.find(field => field.id === view.mediaField); + const descriptionField = fields.find(field => field.id === view.descriptionField); + const { + showTitle = true, + showMedia = true, + showDescription = true + } = view; + const hasPrimaryColumn = titleField && showTitle || mediaField && showMedia || descriptionField && showDescription; + const columns = (_view$fields2 = view.fields) !== null && _view$fields2 !== void 0 ? _view$fields2 : []; + const headerMenuRef = (column, index) => node => { + if (node) { + headerMenuRefs.current.set(column, { + node, + fallback: columns[index > 0 ? index - 1 : 1] + }); + } else { + headerMenuRefs.current.delete(column); + } + }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("table", { - className: "dataviews-view-table", + className: dist_clsx('dataviews-view-table', { + [`has-${view.layout?.density}-density`]: view.layout?.density && ['compact', 'comfortable'].includes(view.layout.density) + }), "aria-busy": isLoading, "aria-describedby": tableNoticeId, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("thead", { @@ -31715,9 +34941,24 @@ function ViewTable({ actions: actions, getItemId: getItemId }) + }), hasPrimaryColumn && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("th", { + scope: "col", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { + className: "dataviews-view-table-header", + children: titleField && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(column_header_menu, { + ref: headerMenuRef(titleField.id, 0), + fieldId: titleField.id, + view: view, + fields: fields, + onChangeView: onChangeView, + onHide: onHide, + setOpenedFilter: setOpenedFilter, + canMove: false + }) + }) }), columns.map((column, index) => { var _view$layout$styles$c2; - // Explicits picks the supported styles. + // Explicit picks the supported styles. const { width, maxWidth, @@ -31729,19 +34970,10 @@ function ViewTable({ maxWidth, minWidth }, - "aria-sort": view.sort?.field === column ? sortValues[view.sort.direction] : undefined, + "aria-sort": view.sort?.direction && view.sort?.field === column ? sortValues[view.sort.direction] : undefined, scope: "col", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(column_header_menu, { - ref: node => { - if (node) { - headerMenuRefs.current.set(column, { - node, - fallback: columns[index > 0 ? index - 1 : 1] - }); - } else { - headerMenuRefs.current.delete(column); - } - }, + ref: headerMenuRef(column, index), fieldId: column, view: view, fields: fields, @@ -31761,15 +34993,20 @@ function ViewTable({ }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("tbody", { children: hasData && data.map((item, index) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TableRow, { item: item, + level: view.showLevels && typeof getItemLevel === 'function' ? getItemLevel(item) : undefined, hasBulkActions: hasBulkActions, actions: actions, fields: fields, id: getItemId(item) || index.toString(), view: view, - primaryField: primaryField, + titleField: titleField, + mediaField: mediaField, + descriptionField: descriptionField, selection: selection, getItemId: getItemId, - onChangeSelection: onChangeSelection + onChangeSelection: onChangeSelection, + onClickItem: onClickItem, + isItemClickable: isItemClickable }, getItemId(item))) })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { @@ -31786,7 +35023,127 @@ function ViewTable({ } /* harmony default export */ const table = (ViewTable); +;// ./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/grid/preview-size-picker.js +/** + * WordPress dependencies + */ + + + + +/** + * Internal dependencies + */ + + +const viewportBreaks = { + xhuge: { + min: 3, + max: 6, + default: 5 + }, + huge: { + min: 2, + max: 4, + default: 4 + }, + xlarge: { + min: 2, + max: 3, + default: 3 + }, + large: { + min: 1, + max: 2, + default: 2 + }, + mobile: { + min: 1, + max: 2, + default: 2 + } +}; + +/** + * Breakpoints were adjusted from media queries breakpoints to account for + * the sidebar width. This was done to match the existing styles we had. + */ +const BREAKPOINTS = { + xhuge: 1520, + huge: 1140, + xlarge: 780, + large: 480, + mobile: 0 +}; +function useViewPortBreakpoint() { + const containerWidth = (0,external_wp_element_namespaceObject.useContext)(dataviews_context).containerWidth; + for (const [key, value] of Object.entries(BREAKPOINTS)) { + if (containerWidth >= value) { + return key; + } + } + return 'mobile'; +} +function useUpdatedPreviewSizeOnViewportChange() { + const view = (0,external_wp_element_namespaceObject.useContext)(dataviews_context).view; + const viewport = useViewPortBreakpoint(); + return (0,external_wp_element_namespaceObject.useMemo)(() => { + const previewSize = view.layout?.previewSize; + let newPreviewSize; + if (!previewSize) { + return; + } + const breakValues = viewportBreaks[viewport]; + if (previewSize < breakValues.min) { + newPreviewSize = breakValues.min; + } + if (previewSize > breakValues.max) { + newPreviewSize = breakValues.max; + } + return newPreviewSize; + }, [viewport, view]); +} +function PreviewSizePicker() { + const viewport = useViewPortBreakpoint(); + const context = (0,external_wp_element_namespaceObject.useContext)(dataviews_context); + const view = context.view; + const breakValues = viewportBreaks[viewport]; + const previewSizeToUse = view.layout?.previewSize || breakValues.default; + const marks = (0,external_wp_element_namespaceObject.useMemo)(() => Array.from({ + length: breakValues.max - breakValues.min + 1 + }, (_, i) => { + return { + value: breakValues.min + i + }; + }), [breakValues]); + if (viewport === 'mobile') { + return null; + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RangeControl, { + __nextHasNoMarginBottom: true, + __next40pxDefaultSize: true, + showTooltip: false, + label: (0,external_wp_i18n_namespaceObject.__)('Preview size'), + value: breakValues.max + breakValues.min - previewSizeToUse, + marks: marks, + min: breakValues.min, + max: breakValues.max, + withInputField: false, + onChange: (value = 0) => { + context.onChangeView({ + ...view, + layout: { + ...view.layout, + previewSize: breakValues.max + breakValues.min - value + } + }); + }, + step: 1 + }); +} + ;// ./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/grid/index.js +/* wp:polyfill */ /** * External dependencies */ @@ -31798,6 +35155,7 @@ function ViewTable({ + /** * Internal dependencies */ @@ -31807,27 +35165,69 @@ function ViewTable({ + +const { + Badge +} = lock_unlock_unlock(external_wp_components_namespaceObject.privateApis); function GridItem({ + view, selection, onChangeSelection, + onClickItem, + isItemClickable, getItemId, item, actions, mediaField, - primaryField, - visibleFields, + titleField, + descriptionField, + regularFields, badgeFields, - columnFields + hasBulkActions }) { + const { + showTitle = true, + showMedia = true, + showDescription = true + } = view; const hasBulkAction = useHasAPossibleBulkAction(actions, item); const id = getItemId(item); + const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(GridItem); const isSelected = selection.includes(id); const renderedMediaField = mediaField?.render ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(mediaField.render, { item: item }) : null; - const renderedPrimaryField = primaryField?.render ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(primaryField.render, { + const renderedTitleField = showTitle && titleField?.render ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(titleField.render, { item: item }) : null; + const clickableMediaItemProps = getClickableItemProps({ + item, + isItemClickable, + onClickItem, + className: 'dataviews-view-grid__media' + }); + const clickableTitleItemProps = getClickableItemProps({ + item, + isItemClickable, + onClickItem, + className: 'dataviews-view-grid__title-field dataviews-title-field' + }); + let mediaA11yProps; + let titleA11yProps; + if (isItemClickable(item) && onClickItem) { + if (renderedTitleField) { + mediaA11yProps = { + 'aria-labelledby': `dataviews-view-grid__title-field-${instanceId}` + }; + titleA11yProps = { + id: `dataviews-view-grid__title-field-${instanceId}` + }; + } else { + mediaA11yProps = { + 'aria-label': (0,external_wp_i18n_namespaceObject.__)('Navigate to item') + }; + } + } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 0, className: dist_clsx('dataviews-view-grid__card', { @@ -31843,70 +35243,77 @@ function GridItem({ onChangeSelection(selection.includes(id) ? selection.filter(itemId => id !== itemId) : [...selection, id]); } }, - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { - className: "dataviews-view-grid__media", + children: [showMedia && renderedMediaField && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + ...clickableMediaItemProps, + ...mediaA11yProps, children: renderedMediaField - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataViewsSelectionCheckbox, { + }), hasBulkActions && showMedia && renderedMediaField && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataViewsSelectionCheckbox, { item: item, selection: selection, onChangeSelection: onChangeSelection, getItemId: getItemId, - primaryField: primaryField, + titleField: titleField, disabled: !hasBulkAction }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "space-between", className: "dataviews-view-grid__title-actions", - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHStack, { - className: "dataviews-view-grid__primary-field", - children: renderedPrimaryField - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ItemActions, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + ...clickableTitleItemProps, + ...titleA11yProps, + children: renderedTitleField + }), !!actions?.length && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ItemActions, { item: item, actions: actions, isCompact: true })] - }), !!badgeFields?.length && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHStack, { - className: "dataviews-view-grid__badge-fields", - spacing: 2, - wrap: true, - alignment: "top", - justify: "flex-start", - children: badgeFields.map(field => { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { - className: "dataviews-view-grid__field-value", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(field.render, { - item: item - }) - }, field.id); - }) - }), !!visibleFields?.length && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalVStack, { - className: "dataviews-view-grid__fields", + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 1, - children: visibleFields.map(field => { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Flex, { - className: dist_clsx('dataviews-view-grid__field', columnFields?.includes(field.id) ? 'is-column' : 'is-row'), - gap: 1, - justify: "flex-start", - expanded: true, - style: { - height: 'auto' - }, - direction: columnFields?.includes(field.id) ? 'column' : 'row', - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { - className: "dataviews-view-grid__field-name", - children: field.header - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { - className: "dataviews-view-grid__field-value", - style: { - maxHeight: 'none' - }, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(field.render, { - item: item - }) - })] - }) - }, field.id); - }) + children: [showDescription && descriptionField?.render && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(descriptionField.render, { + item: item + }), !!badgeFields?.length && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHStack, { + className: "dataviews-view-grid__badge-fields", + spacing: 2, + wrap: true, + alignment: "top", + justify: "flex-start", + children: badgeFields.map(field => { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Badge, { + className: "dataviews-view-grid__field-value", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(field.render, { + item: item + }) + }, field.id); + }) + }), !!regularFields?.length && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalVStack, { + className: "dataviews-view-grid__fields", + spacing: 1, + children: regularFields.map(field => { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Flex, { + className: "dataviews-view-grid__field", + gap: 1, + justify: "flex-start", + expanded: true, + style: { + height: 'auto' + }, + direction: "row", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { + className: "dataviews-view-grid__field-name", + children: field.header + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { + className: "dataviews-view-grid__field-value", + style: { + maxHeight: 'none' + }, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(field.render, { + item: item + }) + })] + }) + }, field.id); + }) + })] })] }, id); } @@ -31917,32 +35324,39 @@ function ViewGrid({ getItemId, isLoading, onChangeSelection, + onClickItem, + isItemClickable, selection, - view, - density + view }) { - const mediaField = fields.find(field => field.id === view.layout?.mediaField); - const primaryField = fields.find(field => field.id === view.layout?.primaryField); - const viewFields = view.fields || fields.map(field => field.id); + var _view$fields; + const titleField = fields.find(field => field.id === view?.titleField); + const mediaField = fields.find(field => field.id === view?.mediaField); + const descriptionField = fields.find(field => field.id === view?.descriptionField); + const otherFields = (_view$fields = view.fields) !== null && _view$fields !== void 0 ? _view$fields : []; const { - visibleFields, + regularFields, badgeFields - } = fields.reduce((accumulator, field) => { - if (!viewFields.includes(field.id) || [view.layout?.mediaField, view?.layout?.primaryField].includes(field.id)) { + } = otherFields.reduce((accumulator, fieldId) => { + const field = fields.find(f => f.id === fieldId); + if (!field) { return accumulator; } // If the field is a badge field, add it to the badgeFields array // otherwise add it to the rest visibleFields array. - const key = view.layout?.badgeFields?.includes(field.id) ? 'badgeFields' : 'visibleFields'; + const key = view.layout?.badgeFields?.includes(fieldId) ? 'badgeFields' : 'regularFields'; accumulator[key].push(field); return accumulator; }, { - visibleFields: [], + regularFields: [], badgeFields: [] }); const hasData = !!data?.length; - const gridStyle = density ? { - gridTemplateColumns: `repeat(${density}, minmax(0, 1fr))` + const updatedPreviewSize = useUpdatedPreviewSizeOnViewportChange(); + const hasBulkActions = useSomeItemHasAPossibleBulkAction(actions, data); + const usedPreviewSize = updatedPreviewSize || view.layout?.previewSize; + const gridStyle = usedPreviewSize ? { + gridTemplateColumns: `repeat(${usedPreviewSize}, minmax(0, 1fr))` } : {}; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [hasData && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalGrid, { @@ -31954,16 +35368,20 @@ function ViewGrid({ "aria-busy": isLoading, children: data.map(item => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(GridItem, { + view: view, selection: selection, onChangeSelection: onChangeSelection, + onClickItem: onClickItem, + isItemClickable: isItemClickable, getItemId: getItemId, item: item, actions: actions, mediaField: mediaField, - primaryField: primaryField, - visibleFields: visibleFields, + titleField: titleField, + descriptionField: descriptionField, + regularFields: regularFields, badgeFields: badgeFields, - columnFields: view.layout?.columnFields + hasBulkActions: hasBulkActions }, getItemId(item)); }) }), !hasData && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { @@ -31979,6 +35397,7 @@ function ViewGrid({ } ;// ./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/list/index.js +/* wp:polyfill */ /** * External dependencies */ @@ -32000,9 +35419,8 @@ function ViewGrid({ - const { - DropdownMenuV2: DropdownMenu + Menu: list_Menu } = lock_unlock_unlock(external_wp_components_namespaceObject.privateApis); function generateItemWrapperCompositeId(idPrefix) { return `${idPrefix}-item-wrapper`; @@ -32028,6 +35446,8 @@ function PrimaryActionGridCell({ id: compositeItemId, render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { label: label, + disabled: !!primaryAction.disabled, + accessibleWhenDisabled: true, icon: primaryAction.icon, isDestructive: primaryAction.isDestructive, size: "small", @@ -32045,6 +35465,8 @@ function PrimaryActionGridCell({ id: compositeItemId, render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { label: label, + disabled: !!primaryAction.disabled, + accessibleWhenDisabled: true, icon: primaryAction.icon, isDestructive: primaryAction.isDestructive, size: "small", @@ -32058,20 +35480,29 @@ function PrimaryActionGridCell({ }, primaryAction.id); } function ListItem({ + view, actions, idPrefix, isSelected, item, + titleField, mediaField, + descriptionField, onSelect, - primaryField, - visibleFields, + otherFields, onDropdownTriggerKeyDown }) { + const { + showTitle = true, + showMedia = true, + showDescription = true + } = view; const itemRef = (0,external_wp_element_namespaceObject.useRef)(null); const labelId = `${idPrefix}-label`; const descriptionId = `${idPrefix}-description`; + const registry = (0,external_wp_data_namespaceObject.useRegistry)(); const [isHovered, setIsHovered] = (0,external_wp_element_namespaceObject.useState)(false); + const [activeModalAction, setActiveModalAction] = (0,external_wp_element_namespaceObject.useState)(null); const handleHover = ({ type }) => { @@ -32096,16 +35527,18 @@ function ListItem({ const _eligibleActions = actions.filter(action => !action.isEligible || action.isEligible(item)); const _primaryActions = _eligibleActions.filter(action => action.isPrimary && !!action.icon); return { - primaryAction: _primaryActions?.[0], + primaryAction: _primaryActions[0], eligibleActions: _eligibleActions }; }, [actions, item]); - const renderedMediaField = mediaField?.render ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(mediaField.render, { - item: item - }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { - className: "dataviews-view-list__media-placeholder" - }); - const renderedPrimaryField = primaryField?.render ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(primaryField.render, { + const hasOnlyOnePrimaryAction = primaryAction && actions.length === 1; + const renderedMediaField = showMedia && mediaField?.render ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: "dataviews-view-list__media-wrapper", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(mediaField.render, { + item: item + }) + }) : null; + const renderedTitleField = showTitle && titleField?.render ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(titleField.render, { item: item }) : null; const usedActions = eligibleActions?.length > 0 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { @@ -32115,31 +35548,40 @@ function ListItem({ idPrefix: idPrefix, primaryAction: primaryAction, item: item - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + }), !hasOnlyOnePrimaryAction && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { role: "gridcell", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DropdownMenu, { - trigger: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Composite.Item, { - id: generateDropdownTriggerCompositeId(idPrefix), - render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - size: "small", - icon: more_vertical, - label: (0,external_wp_i18n_namespaceObject.__)('Actions'), - accessibleWhenDisabled: true, - disabled: !actions.length, - onKeyDown: onDropdownTriggerKeyDown - }) - }), + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(list_Menu, { placement: "bottom-end", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ActionsDropdownMenuGroup, { - actions: eligibleActions, - item: item - }) - }) + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(list_Menu.TriggerButton, { + render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Composite.Item, { + id: generateDropdownTriggerCompositeId(idPrefix), + render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + size: "small", + icon: more_vertical, + label: (0,external_wp_i18n_namespaceObject.__)('Actions'), + accessibleWhenDisabled: true, + disabled: !actions.length, + onKeyDown: onDropdownTriggerKeyDown + }) + }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(list_Menu.Popover, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ActionsMenuGroup, { + actions: eligibleActions, + item: item, + registry: registry, + setActiveModalAction: setActiveModalAction + }) + })] + }), !!activeModalAction && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ActionModal, { + action: activeModalAction, + items: [item], + closeModal: () => setActiveModalAction(null) + })] })] }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Composite.Row, { ref: itemRef, - render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("li", {}), + render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {}), role: "row", className: dist_clsx({ 'is-selected': isSelected, @@ -32164,23 +35606,25 @@ function ListItem({ spacing: 3, justify: "start", alignment: "flex-start", - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { - className: "dataviews-view-list__media-wrapper", - children: renderedMediaField - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { + children: [renderedMediaField, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 1, className: "dataviews-view-list__field-wrapper", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { spacing: 0, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { - className: "dataviews-view-list__primary-field", + className: "dataviews-title-field", id: labelId, - children: renderedPrimaryField + children: renderedTitleField }), usedActions] + }), showDescription && descriptionField?.render && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: "dataviews-view-list__field", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(descriptionField.render, { + item: item + }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "dataviews-view-list__fields", id: descriptionId, - children: visibleFields.map(field => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { + children: otherFields.map(field => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "dataviews-view-list__field", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, { as: "span", @@ -32199,7 +35643,11 @@ function ListItem({ }) }); } +function isDefined(item) { + return !!item; +} function ViewList(props) { + var _view$fields; const { actions, data, @@ -32212,10 +35660,10 @@ function ViewList(props) { } = props; const baseId = (0,external_wp_compose_namespaceObject.useInstanceId)(ViewList, 'view-list'); const selectedItem = data?.findLast(item => selection.includes(getItemId(item))); - const mediaField = fields.find(field => field.id === view.layout?.mediaField); - const primaryField = fields.find(field => field.id === view.layout?.primaryField); - const viewFields = view.fields || fields.map(field => field.id); - const visibleFields = fields.filter(field => viewFields.includes(field.id) && ![view.layout?.primaryField, view.layout?.mediaField].includes(field.id)); + const titleField = fields.find(field => field.id === view.titleField); + const mediaField = fields.find(field => field.id === view.mediaField); + const descriptionField = fields.find(field => field.id === view.descriptionField); + const otherFields = ((_view$fields = view?.fields) !== null && _view$fields !== void 0 ? _view$fields : []).map(fieldId => fields.find(f => fieldId === f.id)).filter(isDefined); const onSelect = item => onChangeSelection([getItemId(item)]); const generateCompositeItemIdPrefix = (0,external_wp_element_namespaceObject.useCallback)(item => `${baseId}-${getItemId(item)}`, [baseId, getItemId]); const isActiveCompositeItem = (0,external_wp_element_namespaceObject.useCallback)((item, idToCheck) => { @@ -32289,7 +35737,7 @@ function ViewList(props) { } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Composite, { id: baseId, - render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ul", {}), + render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {}), className: "dataviews-view-list", role: "grid", activeId: activeCompositeId, @@ -32297,20 +35745,66 @@ function ViewList(props) { children: data.map(item => { const id = generateCompositeItemIdPrefix(item); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ListItem, { + view: view, idPrefix: id, actions: actions, item: item, isSelected: item === selectedItem, onSelect: onSelect, mediaField: mediaField, - primaryField: primaryField, - visibleFields: visibleFields, + titleField: titleField, + descriptionField: descriptionField, + otherFields: otherFields, onDropdownTriggerKeyDown: onDropdownTriggerKeyDown }, id); }) }); } +;// ./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/table/density-picker.js +/** + * WordPress dependencies + */ + + + + +/** + * Internal dependencies + */ + + +function DensityPicker() { + const context = (0,external_wp_element_namespaceObject.useContext)(dataviews_context); + const view = context.view; + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, { + __nextHasNoMarginBottom: true, + size: "__unstable-large", + label: (0,external_wp_i18n_namespaceObject.__)('Density'), + value: view.layout?.density || 'balanced', + onChange: value => { + context.onChangeView({ + ...view, + layout: { + ...view.layout, + density: value + } + }); + }, + isBlock: true, + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { + value: "comfortable", + label: (0,external_wp_i18n_namespaceObject._x)('Comfortable', 'Density option for DataView layout') + }, "comfortable"), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { + value: "balanced", + label: (0,external_wp_i18n_namespaceObject._x)('Balanced', 'Density option for DataView layout') + }, "balanced"), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { + value: "compact", + label: (0,external_wp_i18n_namespaceObject._x)('Compact', 'Density option for DataView layout') + }, "compact")] + }); +} + ;// ./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/index.js /** * WordPress dependencies @@ -32325,81 +35819,29 @@ function ViewList(props) { + + const VIEW_LAYOUTS = [{ type: constants_LAYOUT_TABLE, label: (0,external_wp_i18n_namespaceObject.__)('Table'), component: table, - icon: block_table + icon: block_table, + viewConfigOptions: DensityPicker }, { type: constants_LAYOUT_GRID, label: (0,external_wp_i18n_namespaceObject.__)('Grid'), component: ViewGrid, - icon: library_category + icon: library_category, + viewConfigOptions: PreviewSizePicker }, { type: constants_LAYOUT_LIST, label: (0,external_wp_i18n_namespaceObject.__)('List'), component: ViewList, icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? format_list_bullets_rtl : format_list_bullets }]; -function getNotHidableFieldIds(view) { - if (view.type === 'table') { - var _view$layout$combined; - return [view.layout?.primaryField].concat((_view$layout$combined = view.layout?.combinedFields?.flatMap(field => field.children)) !== null && _view$layout$combined !== void 0 ? _view$layout$combined : []).filter(item => !!item); - } - if (view.type === 'grid') { - return [view.layout?.primaryField, view.layout?.mediaField].filter(item => !!item); - } - if (view.type === 'list') { - return [view.layout?.primaryField, view.layout?.mediaField].filter(item => !!item); - } - return []; -} -function getCombinedFieldIds(view) { - const combinedFields = []; - if (view.type === constants_LAYOUT_TABLE && view.layout?.combinedFields) { - view.layout.combinedFields.forEach(combination => { - combinedFields.push(...combination.children); - }); - } - return combinedFields; -} -function getVisibleFieldIds(view, fields) { - const fieldsToExclude = getCombinedFieldIds(view); - if (view.fields) { - return view.fields.filter(id => !fieldsToExclude.includes(id)); - } - const visibleFields = []; - if (view.type === constants_LAYOUT_TABLE && view.layout?.combinedFields) { - visibleFields.push(...view.layout.combinedFields.map(({ - id - }) => id)); - } - visibleFields.push(...fields.filter(({ - id - }) => !fieldsToExclude.includes(id)).map(({ - id - }) => id)); - return visibleFields; -} -function getHiddenFieldIds(view, fields) { - const fieldsToExclude = [...getCombinedFieldIds(view), ...getVisibleFieldIds(view, fields)]; - - // The media field does not need to be in the view.fields to be displayed. - if (view.type === constants_LAYOUT_GRID && view.layout?.mediaField) { - fieldsToExclude.push(view.layout?.mediaField); - } - if (view.type === constants_LAYOUT_LIST && view.layout?.mediaField) { - fieldsToExclude.push(view.layout?.mediaField); - } - return fields.filter(({ - id, - enableHiding - }) => !fieldsToExclude.includes(id) && enableHiding).map(({ - id - }) => id); -} ;// ./node_modules/@wordpress/dataviews/build-module/components/dataviews-layout/index.js +/* wp:polyfill */ /** * External dependencies */ @@ -32421,13 +35863,15 @@ function DataViewsLayout() { data, fields, getItemId, + getItemLevel, isLoading, view, onChangeView, selection, onChangeSelection, setOpenedFilter, - density + onClickItem, + isItemClickable } = (0,external_wp_element_namespaceObject.useContext)(dataviews_context); const ViewComponent = VIEW_LAYOUTS.find(v => v.type === view.type)?.component; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ViewComponent, { @@ -32435,17 +35879,20 @@ function DataViewsLayout() { data: data, fields: fields, getItemId: getItemId, + getItemLevel: getItemLevel, isLoading: isLoading, onChangeView: onChangeView, onChangeSelection: onChangeSelection, selection: selection, setOpenedFilter: setOpenedFilter, - view: view, - density: density + onClickItem: onClickItem, + isItemClickable: isItemClickable, + view: view }); } ;// ./node_modules/@wordpress/dataviews/build-module/components/dataviews-pagination/index.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -32459,7 +35906,6 @@ function DataViewsLayout() { */ - function DataViewsPagination() { var _view$page; const { @@ -32563,7 +36009,6 @@ function DataViewsPagination() { - const dataviews_footer_EMPTY_ARRAY = []; function DataViewsFooter() { const { @@ -32641,35 +36086,20 @@ const DataViewsSearch = (0,external_wp_element_namespaceObject.memo)(function Se }); /* harmony default export */ const dataviews_search = (DataViewsSearch); -;// ./node_modules/@wordpress/icons/build-module/library/chevron-up.js +;// ./node_modules/@wordpress/icons/build-module/library/lock.js /** * WordPress dependencies */ -const chevronUp = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { +const lock_lock = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - d: "M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z" + d: "M17 10h-1.2V7c0-2.1-1.7-3.8-3.8-3.8-2.1 0-3.8 1.7-3.8 3.8v3H7c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h10c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1zm-2.8 0H9.8V7c0-1.2 1-2.2 2.2-2.2s2.2 1 2.2 2.2v3z" }) }); -/* harmony default export */ const chevron_up = (chevronUp); - -;// ./node_modules/@wordpress/icons/build-module/library/chevron-down.js -/** - * WordPress dependencies - */ - - -const chevronDown = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - viewBox: "0 0 24 24", - xmlns: "http://www.w3.org/2000/svg", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - d: "M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z" - }) -}); -/* harmony default export */ const chevron_down = (chevronDown); +/* harmony default export */ const library_lock = (lock_lock); ;// ./node_modules/@wordpress/icons/build-module/library/cog.js /** @@ -32691,119 +36121,14 @@ const cog = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(extern ;// external ["wp","warning"] const external_wp_warning_namespaceObject = window["wp"]["warning"]; var external_wp_warning_default = /*#__PURE__*/__webpack_require__.n(external_wp_warning_namespaceObject); -;// ./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/grid/density-picker.js -/** - * WordPress dependencies - */ - - - - - -const viewportBreaks = { - xhuge: { - min: 3, - max: 6, - default: 5 - }, - huge: { - min: 2, - max: 4, - default: 4 - }, - xlarge: { - min: 2, - max: 3, - default: 3 - }, - large: { - min: 1, - max: 2, - default: 2 - }, - mobile: { - min: 1, - max: 2, - default: 2 - } -}; -function useViewPortBreakpoint() { - const isXHuge = (0,external_wp_compose_namespaceObject.useViewportMatch)('xhuge', '>='); - const isHuge = (0,external_wp_compose_namespaceObject.useViewportMatch)('huge', '>='); - const isXlarge = (0,external_wp_compose_namespaceObject.useViewportMatch)('xlarge', '>='); - const isLarge = (0,external_wp_compose_namespaceObject.useViewportMatch)('large', '>='); - const isMobile = (0,external_wp_compose_namespaceObject.useViewportMatch)('mobile', '>='); - if (isXHuge) { - return 'xhuge'; - } - if (isHuge) { - return 'huge'; - } - if (isXlarge) { - return 'xlarge'; - } - if (isLarge) { - return 'large'; - } - if (isMobile) { - return 'mobile'; - } - return null; -} -function DensityPicker({ - density, - setDensity -}) { - const viewport = useViewPortBreakpoint(); - (0,external_wp_element_namespaceObject.useEffect)(() => { - setDensity(_density => { - if (!viewport || !_density) { - return 0; - } - const breakValues = viewportBreaks[viewport]; - if (_density < breakValues.min) { - return breakValues.min; - } - if (_density > breakValues.max) { - return breakValues.max; - } - return _density; - }); - }, [setDensity, viewport]); - const breakValues = viewportBreaks[viewport || 'mobile']; - const densityToUse = density || breakValues.default; - const marks = (0,external_wp_element_namespaceObject.useMemo)(() => Array.from({ - length: breakValues.max - breakValues.min + 1 - }, (_, i) => { - return { - value: breakValues.min + i - }; - }), [breakValues]); - if (!viewport) { - return null; - } - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RangeControl, { - __nextHasNoMarginBottom: true, - __next40pxDefaultSize: true, - showTooltip: false, - label: (0,external_wp_i18n_namespaceObject.__)('Preview size'), - value: breakValues.max + breakValues.min - densityToUse, - marks: marks, - min: breakValues.min, - max: breakValues.max, - withInputField: false, - onChange: (value = 0) => { - setDensity(breakValues.max + breakValues.min - value); - }, - step: 1 - }); -} - ;// ./node_modules/@wordpress/dataviews/build-module/components/dataviews-view-config/index.js +/* wp:polyfill */ /** * External dependencies */ + + /** * WordPress dependencies */ @@ -32813,6 +36138,7 @@ function DensityPicker({ + /** * Internal dependencies */ @@ -32821,12 +36147,14 @@ function DensityPicker({ - - - const { - DropdownMenuV2: dataviews_view_config_DropdownMenuV2 + Menu: dataviews_view_config_Menu } = lock_unlock_unlock(external_wp_components_namespaceObject.privateApis); +const DATAVIEWS_CONFIG_POPOVER_PROPS = { + className: 'dataviews-config__popover', + placement: 'bottom-end', + offset: 9 +}; function ViewTypeMenu({ defaultLayouts = { list: {}, @@ -32843,40 +36171,50 @@ function ViewTypeMenu({ return null; } const activeView = VIEW_LAYOUTS.find(v => view.type === v.type); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(dataviews_view_config_DropdownMenuV2, { - trigger: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - size: "compact", - icon: activeView?.icon, - label: (0,external_wp_i18n_namespaceObject.__)('Layout') - }), - children: availableLayouts.map(layout => { - const config = VIEW_LAYOUTS.find(v => v.type === layout); - if (!config) { - return null; - } - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(dataviews_view_config_DropdownMenuV2.RadioItem, { - value: layout, - name: "view-actions-available-view", - checked: layout === view.type, - hideOnClick: true, - onChange: e => { - switch (e.target.value) { - case 'list': - case 'grid': - case 'table': - return onChangeView({ - ...view, - type: e.target.value, - ...defaultLayouts[e.target.value] - }); - } - true ? external_wp_warning_default()('Invalid dataview') : 0; - }, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(dataviews_view_config_DropdownMenuV2.ItemLabel, { - children: config.label - }) - }, layout); - }) + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(dataviews_view_config_Menu, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(dataviews_view_config_Menu.TriggerButton, { + render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + size: "compact", + icon: activeView?.icon, + label: (0,external_wp_i18n_namespaceObject.__)('Layout') + }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(dataviews_view_config_Menu.Popover, { + children: availableLayouts.map(layout => { + const config = VIEW_LAYOUTS.find(v => v.type === layout); + if (!config) { + return null; + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(dataviews_view_config_Menu.RadioItem, { + value: layout, + name: "view-actions-available-view", + checked: layout === view.type, + hideOnClick: true, + onChange: e => { + switch (e.target.value) { + case 'list': + case 'grid': + case 'table': + const viewWithoutLayout = { + ...view + }; + if ('layout' in viewWithoutLayout) { + delete viewWithoutLayout.layout; + } + // @ts-expect-error + return onChangeView({ + ...viewWithoutLayout, + type: e.target.value, + ...defaultLayouts[e.target.value] + }); + } + true ? external_wp_warning_default()('Invalid dataview') : 0; + }, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(dataviews_view_config_Menu.ItemLabel, { + children: config.label + }) + }, layout); + }) + })] }); } function SortFieldControl() { @@ -32906,7 +36244,8 @@ function SortFieldControl() { sort: { direction: view?.sort?.direction || 'desc', field: value - } + }, + showLevels: false }); } }); @@ -32941,7 +36280,8 @@ function SortDirectionControl() { field: view.sort?.field || // If there is no field assigned as the sorting field assign the first sortable field. fields.find(field => field.enableSorting !== false)?.id || '' - } + }, + showLevels: false }); return; } @@ -32985,176 +36325,335 @@ function ItemsPerPageControl() { }) }); } -function FieldItem({ - field: { - id, - label, - index, - isVisible, - isHidable - }, - fields, - view, - onChangeView +function PreviewOptions({ + previewOptions, + onChangePreviewOption, + onMenuOpenChange, + activeOption }) { - const visibleFieldIds = getVisibleFieldIds(view, fields); + const focusPreviewOptionsField = id => { + // Focus the visibility button to avoid focus loss. + // Our code is safe against the component being unmounted, so we don't need to worry about cleaning the timeout. + // eslint-disable-next-line @wordpress/react-no-unsafe-timeout + setTimeout(() => { + const element = document.querySelector(`.dataviews-field-control__field-${id} .dataviews-field-control__field-preview-options-button`); + if (element instanceof HTMLElement) { + element.focus(); + } + }, 50); + }; + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(dataviews_view_config_Menu, { + onOpenChange: onMenuOpenChange, + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(dataviews_view_config_Menu.TriggerButton, { + render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + className: "dataviews-field-control__field-preview-options-button", + size: "compact", + icon: more_vertical, + label: (0,external_wp_i18n_namespaceObject.__)('Preview') + }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(dataviews_view_config_Menu.Popover, { + children: previewOptions?.map(({ + id, + label + }) => { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(dataviews_view_config_Menu.RadioItem, { + value: id, + checked: id === activeOption, + onChange: () => { + onChangePreviewOption?.(id); + focusPreviewOptionsField(id); + }, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(dataviews_view_config_Menu.ItemLabel, { + children: label + }) + }, id); + }) + })] + }); +} +function FieldItem({ + field, + label, + description, + isVisible, + isFirst, + isLast, + canMove = true, + onToggleVisibility, + onMoveUp, + onMoveDown, + previewOptions, + onChangePreviewOption +}) { + const [isChangingPreviewOption, setIsChangingPreviewOption] = (0,external_wp_element_namespaceObject.useState)(false); + const focusVisibilityField = () => { + // Focus the visibility button to avoid focus loss. + // Our code is safe against the component being unmounted, so we don't need to worry about cleaning the timeout. + // eslint-disable-next-line @wordpress/react-no-unsafe-timeout + setTimeout(() => { + const element = document.querySelector(`.dataviews-field-control__field-${field.id} .dataviews-field-control__field-visibility-button`); + if (element instanceof HTMLElement) { + element.focus(); + } + }, 50); + }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalItem, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { expanded: true, - className: `dataviews-field-control__field dataviews-field-control__field-${id}`, + className: dist_clsx('dataviews-field-control__field', `dataviews-field-control__field-${field.id}`, + // The actions are hidden when the mouse is not hovering the item, or focus + // is outside the item. + // For actions that require a popover, a menu etc, that would mean that when the interactive element + // opens and the focus goes there the actions would be hidden. + // To avoid that we add a class to the item, that makes sure actions are visible while there is some + // interaction with the item. + { + 'is-interacting': isChangingPreviewOption + }), + justify: "flex-start", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { - children: label + className: "dataviews-field-control__icon", + children: !canMove && !field.enableHiding && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { + icon: library_lock + }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("span", { + className: "dataviews-field-control__label-sub-label-container", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { + className: "dataviews-field-control__label", + children: label || field.label + }), description && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { + className: "dataviews-field-control__sub-label", + children: description + })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "flex-end", expanded: false, className: "dataviews-field-control__actions", - children: [view.type === constants_LAYOUT_TABLE && isVisible && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [isVisible && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - disabled: index < 1, + disabled: isFirst || !canMove, accessibleWhenDisabled: true, size: "compact", - onClick: () => { - var _visibleFieldIds$slic; - onChangeView({ - ...view, - fields: [...((_visibleFieldIds$slic = visibleFieldIds.slice(0, index - 1)) !== null && _visibleFieldIds$slic !== void 0 ? _visibleFieldIds$slic : []), id, visibleFieldIds[index - 1], ...visibleFieldIds.slice(index + 1)] - }); - }, + onClick: onMoveUp, icon: chevron_up, - label: (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: field label */ - (0,external_wp_i18n_namespaceObject.__)('Move %s up'), label) + label: isFirst || !canMove ? (0,external_wp_i18n_namespaceObject.__)("This field can't be moved up") : (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: field label */ + (0,external_wp_i18n_namespaceObject.__)('Move %s up'), field.label) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - disabled: index >= visibleFieldIds.length - 1, + disabled: isLast || !canMove, accessibleWhenDisabled: true, size: "compact", - onClick: () => { - var _visibleFieldIds$slic2; - onChangeView({ - ...view, - fields: [...((_visibleFieldIds$slic2 = visibleFieldIds.slice(0, index)) !== null && _visibleFieldIds$slic2 !== void 0 ? _visibleFieldIds$slic2 : []), visibleFieldIds[index + 1], id, ...visibleFieldIds.slice(index + 2)] - }); - }, + onClick: onMoveDown, icon: chevron_down, - label: (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: field label */ - (0,external_wp_i18n_namespaceObject.__)('Move %s down'), label) - }), ' '] - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + label: isLast || !canMove ? (0,external_wp_i18n_namespaceObject.__)("This field can't be moved down") : (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: field label */ + (0,external_wp_i18n_namespaceObject.__)('Move %s down'), field.label) + })] + }), onToggleVisibility && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { className: "dataviews-field-control__field-visibility-button", - disabled: !isHidable, + disabled: !field.enableHiding, accessibleWhenDisabled: true, size: "compact", onClick: () => { - onChangeView({ - ...view, - fields: isVisible ? visibleFieldIds.filter(fieldId => fieldId !== id) : [...visibleFieldIds, id] - }); - // Focus the visibility button to avoid focus loss. - // Our code is safe against the component being unmounted, so we don't need to worry about cleaning the timeout. - // eslint-disable-next-line @wordpress/react-no-unsafe-timeout - setTimeout(() => { - const element = document.querySelector(`.dataviews-field-control__field-${id} .dataviews-field-control__field-visibility-button`); - if (element instanceof HTMLElement) { - element.focus(); - } - }, 50); + onToggleVisibility(); + focusVisibilityField(); }, - icon: isVisible ? library_seen : library_unseen, - label: isVisible ? (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: field label */ - (0,external_wp_i18n_namespaceObject._x)('Hide %s', 'field'), label) : (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: field label */ - (0,external_wp_i18n_namespaceObject._x)('Show %s', 'field'), label) + icon: isVisible ? library_unseen : library_seen, + label: isVisible ? (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: field label */ + (0,external_wp_i18n_namespaceObject._x)('Hide %s', 'field'), field.label) : (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: field label */ + (0,external_wp_i18n_namespaceObject._x)('Show %s', 'field'), field.label) + }), previewOptions && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreviewOptions, { + previewOptions: previewOptions, + onChangePreviewOption: onChangePreviewOption, + onMenuOpenChange: setIsChangingPreviewOption, + activeOption: field.id })] })] }) - }, id); + }); +} +function RegularFieldItem({ + index, + field, + view, + onChangeView +}) { + var _view$fields; + const visibleFieldIds = (_view$fields = view.fields) !== null && _view$fields !== void 0 ? _view$fields : []; + const isVisible = index !== undefined && visibleFieldIds.includes(field.id); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(FieldItem, { + field: field, + isVisible: isVisible, + isFirst: index !== undefined && index < 1, + isLast: index !== undefined && index === visibleFieldIds.length - 1, + onToggleVisibility: () => { + onChangeView({ + ...view, + fields: isVisible ? visibleFieldIds.filter(fieldId => fieldId !== field.id) : [...visibleFieldIds, field.id] + }); + }, + onMoveUp: index !== undefined ? () => { + var _visibleFieldIds$slic; + onChangeView({ + ...view, + fields: [...((_visibleFieldIds$slic = visibleFieldIds.slice(0, index - 1)) !== null && _visibleFieldIds$slic !== void 0 ? _visibleFieldIds$slic : []), field.id, visibleFieldIds[index - 1], ...visibleFieldIds.slice(index + 1)] + }); + } : undefined, + onMoveDown: index !== undefined ? () => { + var _visibleFieldIds$slic2; + onChangeView({ + ...view, + fields: [...((_visibleFieldIds$slic2 = visibleFieldIds.slice(0, index)) !== null && _visibleFieldIds$slic2 !== void 0 ? _visibleFieldIds$slic2 : []), visibleFieldIds[index + 1], field.id, ...visibleFieldIds.slice(index + 2)] + }); + } : undefined + }); +} +function dataviews_view_config_isDefined(item) { + return !!item; } function FieldControl() { + var _view$fields2; const { view, fields, onChangeView } = (0,external_wp_element_namespaceObject.useContext)(dataviews_context); - const visibleFieldIds = (0,external_wp_element_namespaceObject.useMemo)(() => getVisibleFieldIds(view, fields), [view, fields]); - const hiddenFieldIds = (0,external_wp_element_namespaceObject.useMemo)(() => getHiddenFieldIds(view, fields), [view, fields]); - const notHidableFieldIds = (0,external_wp_element_namespaceObject.useMemo)(() => getNotHidableFieldIds(view), [view]); - const visibleFields = fields.filter(({ - id - }) => visibleFieldIds.includes(id)).map(({ - id, - label, - enableHiding - }) => { - return { - id, - label, - index: visibleFieldIds.indexOf(id), - isVisible: true, - isHidable: notHidableFieldIds.includes(id) ? false : enableHiding - }; - }); - if (view.type === constants_LAYOUT_TABLE && view.layout?.combinedFields) { - view.layout.combinedFields.forEach(({ - id, - label - }) => { - visibleFields.push({ - id, - label, - index: visibleFieldIds.indexOf(id), - isVisible: true, - isHidable: notHidableFieldIds.includes(id) - }); - }); - } - visibleFields.sort((a, b) => a.index - b.index); - const hiddenFields = fields.filter(({ - id - }) => hiddenFieldIds.includes(id)).map(({ - id, - label, - enableHiding - }, index) => { - return { - id, - label, - index, - isVisible: false, - isHidable: enableHiding - }; - }); + const togglableFields = [view?.titleField, view?.mediaField, view?.descriptionField].filter(Boolean); + const visibleFieldIds = (_view$fields2 = view.fields) !== null && _view$fields2 !== void 0 ? _view$fields2 : []; + const hiddenFields = fields.filter(f => !visibleFieldIds.includes(f.id) && !togglableFields.includes(f.id) && f.type !== 'media'); + const visibleFields = visibleFieldIds.map(fieldId => fields.find(f => f.id === fieldId)).filter(dataviews_view_config_isDefined); if (!visibleFields?.length && !hiddenFields?.length) { return null; } + const titleField = fields.find(f => f.id === view.titleField); + const previewField = fields.find(f => f.id === view.mediaField); + const descriptionField = fields.find(f => f.id === view.descriptionField); + const previewFields = fields.filter(f => f.type === 'media'); + let previewFieldUI; + if (previewFields.length > 1) { + var _view$showMedia; + const isPreviewFieldVisible = dataviews_view_config_isDefined(previewField) && ((_view$showMedia = view.showMedia) !== null && _view$showMedia !== void 0 ? _view$showMedia : true); + previewFieldUI = dataviews_view_config_isDefined(previewField) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(FieldItem, { + field: previewField, + label: (0,external_wp_i18n_namespaceObject.__)('Preview'), + description: previewField.label, + isVisible: isPreviewFieldVisible, + onToggleVisibility: () => { + onChangeView({ + ...view, + showMedia: !isPreviewFieldVisible + }); + }, + canMove: false, + previewOptions: previewFields.map(field => ({ + label: field.label, + id: field.id + })), + onChangePreviewOption: newPreviewId => onChangeView({ + ...view, + mediaField: newPreviewId + }) + }, previewField.id); + } + const lockedFields = [{ + field: titleField, + isVisibleFlag: 'showTitle' + }, { + field: previewField, + isVisibleFlag: 'showMedia', + ui: previewFieldUI + }, { + field: descriptionField, + isVisibleFlag: 'showDescription' + }].filter(({ + field + }) => dataviews_view_config_isDefined(field)); + const visibleLockedFields = lockedFields.filter(({ + field, + isVisibleFlag + }) => { + var _view$isVisibleFlag; + return ( + // @ts-expect-error + dataviews_view_config_isDefined(field) && ((_view$isVisibleFlag = view[isVisibleFlag]) !== null && _view$isVisibleFlag !== void 0 ? _view$isVisibleFlag : true) + ); + }); + const hiddenLockedFields = lockedFields.filter(({ + field, + isVisibleFlag + }) => { + var _view$isVisibleFlag2; + return ( + // @ts-expect-error + dataviews_view_config_isDefined(field) && !((_view$isVisibleFlag2 = view[isVisibleFlag]) !== null && _view$isVisibleFlag2 !== void 0 ? _view$isVisibleFlag2 : true) + ); + }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { - spacing: 6, className: "dataviews-field-control", - children: [!!visibleFields?.length && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalItemGroup, { - isBordered: true, - isSeparated: true, - children: visibleFields.map(field => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(FieldItem, { - field: field, - fields: fields, - view: view, - onChangeView: onChangeView - }, field.id)) - }), !!hiddenFields?.length && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { - spacing: 4, - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.BaseControl.VisualLabel, { - style: { - margin: 0 - }, - children: (0,external_wp_i18n_namespaceObject.__)('Hidden') - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalItemGroup, { + spacing: 6, + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalVStack, { + className: "dataviews-view-config__properties", + spacing: 0, + children: (visibleLockedFields.length > 0 || !!visibleFields?.length) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalItemGroup, { + isBordered: true, + isSeparated: true, + children: [visibleLockedFields.map(({ + field, + isVisibleFlag, + ui + }) => { + return ui !== null && ui !== void 0 ? ui : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(FieldItem, { + field: field, + isVisible: true, + onToggleVisibility: () => { + onChangeView({ + ...view, + [isVisibleFlag]: false + }); + }, + canMove: false + }, field.id); + }), visibleFields.map((field, index) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(RegularFieldItem, { + field: field, + view: view, + onChangeView: onChangeView, + index: index + }, field.id))] + }) + }), (!!hiddenFields?.length || !!hiddenLockedFields.length) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { + spacing: 4, + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.BaseControl.VisualLabel, { + style: { + margin: 0 + }, + children: (0,external_wp_i18n_namespaceObject.__)('Hidden') + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalVStack, { + className: "dataviews-view-config__properties", + spacing: 0, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalItemGroup, { isBordered: true, isSeparated: true, - children: hiddenFields.map(field => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(FieldItem, { + children: [hiddenLockedFields.length > 0 && hiddenLockedFields.map(({ + field, + isVisibleFlag, + ui + }) => { + return ui !== null && ui !== void 0 ? ui : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(FieldItem, { + field: field, + isVisible: false, + onToggleVisibility: () => { + onChangeView({ + ...view, + [isVisibleFlag]: true + }); + }, + canMove: false + }, field.id); + }), hiddenFields.map(field => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(RegularFieldItem, { field: field, - fields: fields, view: view, onChangeView: onChangeView - }, field.id)) - })] - }) + }, field.id))] + }) + })] })] }); } @@ -33186,35 +36685,53 @@ function SettingsSection({ })] }); } -function DataviewsViewConfigContent({ - density, - setDensity -}) { +function DataviewsViewConfigDropdown() { const { view } = (0,external_wp_element_namespaceObject.useContext)(dataviews_context); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { - className: "dataviews-view-config", - spacing: 6, - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(SettingsSection, { - title: (0,external_wp_i18n_namespaceObject.__)('Appearance'), - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { - expanded: true, - className: "is-divided-in-two", - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SortFieldControl, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SortDirectionControl, {})] - }), view.type === constants_LAYOUT_GRID && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DensityPicker, { - density: density, - setDensity: setDensity - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ItemsPerPageControl, {})] - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SettingsSection, { - title: (0,external_wp_i18n_namespaceObject.__)('Properties'), - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(FieldControl, {}) - })] + const popoverId = (0,external_wp_compose_namespaceObject.useInstanceId)(_DataViewsViewConfig, 'dataviews-view-config-dropdown'); + const activeLayout = VIEW_LAYOUTS.find(layout => layout.type === view.type); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Dropdown, { + expandOnMobile: true, + popoverProps: { + ...DATAVIEWS_CONFIG_POPOVER_PROPS, + id: popoverId + }, + renderToggle: ({ + onToggle, + isOpen + }) => { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + size: "compact", + icon: library_cog, + label: (0,external_wp_i18n_namespaceObject._x)('View options', 'View is used as a noun'), + onClick: onToggle, + "aria-expanded": isOpen ? 'true' : 'false', + "aria-controls": popoverId + }); + }, + renderContent: () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalDropdownContentWrapper, { + paddingSize: "medium", + className: "dataviews-config__popover-content-wrapper", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { + className: "dataviews-view-config", + spacing: 6, + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(SettingsSection, { + title: (0,external_wp_i18n_namespaceObject.__)('Appearance'), + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { + expanded: true, + className: "is-divided-in-two", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SortFieldControl, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SortDirectionControl, {})] + }), !!activeLayout?.viewConfigOptions && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(activeLayout.viewConfigOptions, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ItemsPerPageControl, {})] + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SettingsSection, { + title: (0,external_wp_i18n_namespaceObject.__)('Properties'), + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(FieldControl, {}) + })] + }) + }) }); } function _DataViewsViewConfig({ - density, - setDensity, defaultLayouts = { list: {}, grid: {}, @@ -33224,33 +36741,14 @@ function _DataViewsViewConfig({ return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ViewTypeMenu, { defaultLayouts: defaultLayouts - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Dropdown, { - popoverProps: { - placement: 'bottom-end', - offset: 9 - }, - contentClassName: "dataviews-view-config", - renderToggle: ({ - onToggle - }) => { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - size: "compact", - icon: library_cog, - label: (0,external_wp_i18n_namespaceObject._x)('View options', 'View is used as a noun'), - onClick: onToggle - }); - }, - renderContent: () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataviewsViewConfigContent, { - density: density, - setDensity: setDensity - }) - })] + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataviewsViewConfigDropdown, {})] }); } const DataViewsViewConfig = (0,external_wp_element_namespaceObject.memo)(_DataViewsViewConfig); /* harmony default export */ const dataviews_view_config = (DataViewsViewConfig); ;// ./node_modules/@wordpress/dataviews/build-module/components/dataviews/index.js +/* wp:polyfill */ /** * External dependencies */ @@ -33261,6 +36759,7 @@ const DataViewsViewConfig = (0,external_wp_element_namespaceObject.memo)(_DataVi + /** * Internal dependencies */ @@ -33272,26 +36771,35 @@ const DataViewsViewConfig = (0,external_wp_element_namespaceObject.memo)(_DataVi - const defaultGetItemId = item => item.id; +const defaultIsItemClickable = () => true; +const dataviews_EMPTY_ARRAY = []; function DataViews({ view, onChangeView, fields, search = true, searchLabel = undefined, - actions = [], + actions = dataviews_EMPTY_ARRAY, data, getItemId = defaultGetItemId, + getItemLevel, isLoading = false, paginationInfo, defaultLayouts, selection: selectionProperty, onChangeSelection, + onClickItem, + isItemClickable = defaultIsItemClickable, header }) { + const [containerWidth, setContainerWidth] = (0,external_wp_element_namespaceObject.useState)(0); + const containerRef = (0,external_wp_compose_namespaceObject.useResizeObserver)(resizeObserverEntries => { + setContainerWidth(resizeObserverEntries[0].borderBoxSize[0].inlineSize); + }, { + box: 'border-box' + }); const [selectionState, setSelectionState] = (0,external_wp_element_namespaceObject.useState)([]); - const [density, setDensity] = (0,external_wp_element_namespaceObject.useState)(0); const isUncontrolled = selectionProperty === undefined || onChangeSelection === undefined; const selection = isUncontrolled ? selectionState : selectionProperty; const [openedFilter, setOpenedFilter] = (0,external_wp_element_namespaceObject.useState)(null); @@ -33324,10 +36832,14 @@ function DataViews({ openedFilter, setOpenedFilter, getItemId, - density + getItemLevel, + isItemClickable, + onClickItem, + containerWidth }, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "dataviews-wrapper", + ref: containerRef, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { alignment: "top", justify: "space-between", @@ -33339,7 +36851,7 @@ function DataViews({ className: "dataviews__search", children: [search && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(dataviews_search, { label: searchLabel - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(FilterVisibilityToggle, { + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(FiltersToggle, { filters: filters, view: view, onChangeView: onChangeView, @@ -33354,9 +36866,7 @@ function DataViews({ flexShrink: 0 }, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(dataviews_view_config, { - defaultLayouts: defaultLayouts, - density: density, - setDensity: setDensity + defaultLayouts: defaultLayouts }), header] })] }), isShowingFilter && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(dataviews_filters, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataViewsLayout, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataViewsFooter, {})] @@ -33364,1265 +36874,8 @@ function DataViews({ }); } -;// ./node_modules/@wordpress/icons/build-module/library/drawer-right.js -/** - * WordPress dependencies - */ - - -const drawerRight = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - width: "24", - height: "24", - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4 14.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h8v13zm4.5-.5c0 .3-.2.5-.5.5h-2.5v-13H18c.3 0 .5.2.5.5v12z" - }) -}); -/* harmony default export */ const drawer_right = (drawerRight); - -;// ./node_modules/@wordpress/edit-site/build-module/components/page/header.js -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - - -function Header({ - title, - subTitle, - actions -}) { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { - className: "edit-site-page-header", - as: "header", - spacing: 0, - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { - className: "edit-site-page-header__page-title", - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHeading, { - as: "h2", - level: 3, - weight: 500, - className: "edit-site-page-header__title", - truncate: true, - children: title - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { - className: "edit-site-page-header__actions", - children: actions - })] - }), subTitle && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { - variant: "muted", - as: "p", - className: "edit-site-page-header__sub-title", - children: subTitle - })] - }); -} - -;// ./node_modules/@wordpress/edit-site/build-module/components/page/index.js -/** - * External dependencies - */ - - -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - - - - -const { - NavigableRegion: page_NavigableRegion -} = unlock(external_wp_editor_namespaceObject.privateApis); -function Page({ - title, - subTitle, - actions, - children, - className, - hideTitleFromUI = false -}) { - const classes = dist_clsx('edit-site-page', className); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(page_NavigableRegion, { - className: classes, - ariaLabel: title, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { - className: "edit-site-page-content", - children: [!hideTitleFromUI && title && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Header, { - title: title, - subTitle: subTitle, - actions: actions - }), children] - }) - }); -} - -;// ./node_modules/@wordpress/icons/build-module/library/pages.js -/** - * WordPress dependencies - */ - - - -const pages = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - d: "M14.5 5.5h-7V7h7V5.5ZM7.5 9h7v1.5h-7V9Zm7 3.5h-7V14h7v-1.5Z" - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - d: "M16 2H6a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2ZM6 3.5h10a.5.5 0 0 1 .5.5v12a.5.5 0 0 1-.5.5H6a.5.5 0 0 1-.5-.5V4a.5.5 0 0 1 .5-.5Z" - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - d: "M20 8v11c0 .69-.31 1-.999 1H6v1.5h13.001c1.52 0 2.499-.982 2.499-2.5V8H20Z" - })] -}); -/* harmony default export */ const library_pages = (pages); - -;// ./node_modules/@wordpress/icons/build-module/library/published.js -/** - * WordPress dependencies - */ - - -const published = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm11.53-1.47-1.06-1.06L11 12.94l-1.47-1.47-1.06 1.06L11 15.06l4.53-4.53Z" - }) -}); -/* harmony default export */ const library_published = (published); - -;// ./node_modules/@wordpress/icons/build-module/library/scheduled.js -/** - * WordPress dependencies - */ - - -const scheduled = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm9 1V8h-1.5v3.5h-2V13H13Z" - }) -}); -/* harmony default export */ const library_scheduled = (scheduled); - -;// ./node_modules/@wordpress/icons/build-module/library/drafts.js -/** - * WordPress dependencies - */ - - -const drafts = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm8 4a4 4 0 0 0 4-4H8a4 4 0 0 0 4 4Z" - }) -}); -/* harmony default export */ const library_drafts = (drafts); - -;// ./node_modules/@wordpress/icons/build-module/library/pending.js -/** - * WordPress dependencies - */ - - -const pending = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm8 4a4 4 0 0 1-4-4h4V8a4 4 0 0 1 0 8Z" - }) -}); -/* harmony default export */ const library_pending = (pending); - -;// ./node_modules/@wordpress/icons/build-module/library/not-allowed.js -/** - * WordPress dependencies - */ - - -const notAllowed = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M12 18.5A6.5 6.5 0 0 1 6.93 7.931l9.139 9.138A6.473 6.473 0 0 1 12 18.5Zm5.123-2.498a6.5 6.5 0 0 0-9.124-9.124l9.124 9.124ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Z" - }) -}); -/* harmony default export */ const not_allowed = (notAllowed); - -;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-dataviews/default-views.js -/** - * WordPress dependencies - */ - - - - - - -/** - * Internal dependencies - */ - -const defaultLayouts = { - [LAYOUT_TABLE]: { - layout: { - primaryField: 'title', - styles: { - 'featured-image': { - width: '1%' - }, - title: { - maxWidth: 300 - } - } - } - }, - [LAYOUT_GRID]: { - layout: { - mediaField: 'featured-image', - primaryField: 'title' - } - }, - [LAYOUT_LIST]: { - layout: { - primaryField: 'title', - mediaField: 'featured-image' - } - } -}; -const DEFAULT_POST_BASE = { - type: LAYOUT_LIST, - search: '', - filters: [], - page: 1, - perPage: 20, - sort: { - field: 'date', - direction: 'desc' - }, - fields: ['title', 'author', 'status'], - layout: defaultLayouts[LAYOUT_LIST].layout -}; -function useDefaultViews({ - postType -}) { - const labels = (0,external_wp_data_namespaceObject.useSelect)(select => { - const { - getPostType - } = select(external_wp_coreData_namespaceObject.store); - return getPostType(postType)?.labels; - }, [postType]); - return (0,external_wp_element_namespaceObject.useMemo)(() => { - return [{ - title: labels?.all_items || (0,external_wp_i18n_namespaceObject.__)('All items'), - slug: 'all', - icon: library_pages, - view: DEFAULT_POST_BASE - }, { - title: (0,external_wp_i18n_namespaceObject.__)('Published'), - slug: 'published', - icon: library_published, - view: DEFAULT_POST_BASE, - filters: [{ - field: 'status', - operator: OPERATOR_IS_ANY, - value: 'publish' - }] - }, { - title: (0,external_wp_i18n_namespaceObject.__)('Scheduled'), - slug: 'future', - icon: library_scheduled, - view: DEFAULT_POST_BASE, - filters: [{ - field: 'status', - operator: OPERATOR_IS_ANY, - value: 'future' - }] - }, { - title: (0,external_wp_i18n_namespaceObject.__)('Drafts'), - slug: 'drafts', - icon: library_drafts, - view: DEFAULT_POST_BASE, - filters: [{ - field: 'status', - operator: OPERATOR_IS_ANY, - value: 'draft' - }] - }, { - title: (0,external_wp_i18n_namespaceObject.__)('Pending'), - slug: 'pending', - icon: library_pending, - view: DEFAULT_POST_BASE, - filters: [{ - field: 'status', - operator: OPERATOR_IS_ANY, - value: 'pending' - }] - }, { - title: (0,external_wp_i18n_namespaceObject.__)('Private'), - slug: 'private', - icon: not_allowed, - view: DEFAULT_POST_BASE, - filters: [{ - field: 'status', - operator: OPERATOR_IS_ANY, - value: 'private' - }] - }, { - title: (0,external_wp_i18n_namespaceObject.__)('Trash'), - slug: 'trash', - icon: library_trash, - view: { - ...DEFAULT_POST_BASE, - type: LAYOUT_TABLE, - layout: defaultLayouts[LAYOUT_TABLE].layout - }, - filters: [{ - field: 'status', - operator: OPERATOR_IS_ANY, - value: 'trash' - }] - }]; - }, [labels]); -} - -;// ./node_modules/@wordpress/edit-site/build-module/components/add-new-post/index.js -/** - * WordPress dependencies - */ - - - - - - - - - - -function AddNewPostModal({ - postType, - onSave, - onClose -}) { - const labels = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getPostType(postType)?.labels, [postType]); - const [isCreatingPost, setIsCreatingPost] = (0,external_wp_element_namespaceObject.useState)(false); - const [title, setTitle] = (0,external_wp_element_namespaceObject.useState)(''); - const { - saveEntityRecord - } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); - const { - createErrorNotice, - createSuccessNotice - } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); - const { - resolveSelect - } = (0,external_wp_data_namespaceObject.useRegistry)(); - async function createPost(event) { - event.preventDefault(); - if (isCreatingPost) { - return; - } - setIsCreatingPost(true); - try { - const postTypeObject = await resolveSelect(external_wp_coreData_namespaceObject.store).getPostType(postType); - const newPage = await saveEntityRecord('postType', postType, { - status: 'draft', - title, - slug: title || (0,external_wp_i18n_namespaceObject.__)('No title'), - content: !!postTypeObject.template && postTypeObject.template.length ? (0,external_wp_blocks_namespaceObject.serialize)((0,external_wp_blocks_namespaceObject.synchronizeBlocksWithTemplate)([], postTypeObject.template)) : undefined - }, { - throwOnError: true - }); - onSave(newPage); - createSuccessNotice((0,external_wp_i18n_namespaceObject.sprintf)( - // translators: %s: Title of the created post or template, e.g: "Hello world". - (0,external_wp_i18n_namespaceObject.__)('"%s" successfully created.'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(newPage.title?.rendered || title)), { - type: 'snackbar' - }); - } catch (error) { - const errorMessage = error.message && error.code !== 'unknown_error' ? error.message : (0,external_wp_i18n_namespaceObject.__)('An error occurred while creating the item.'); - createErrorNotice(errorMessage, { - type: 'snackbar' - }); - } finally { - setIsCreatingPost(false); - } - } - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Modal, { - title: - // translators: %s: post type singular_name label e.g: "Page". - (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('Draft new: %s'), labels?.singular_name), - onRequestClose: onClose, - focusOnMount: "firstContentElement", - size: "small", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("form", { - onSubmit: createPost, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { - spacing: 4, - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { - __next40pxDefaultSize: true, - __nextHasNoMarginBottom: true, - label: (0,external_wp_i18n_namespaceObject.__)('Title'), - onChange: setTitle, - placeholder: (0,external_wp_i18n_namespaceObject.__)('No title'), - value: title - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { - spacing: 2, - justify: "end", - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - __next40pxDefaultSize: true, - variant: "tertiary", - onClick: onClose, - children: (0,external_wp_i18n_namespaceObject.__)('Cancel') - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - __next40pxDefaultSize: true, - variant: "primary", - type: "submit", - isBusy: isCreatingPost, - "aria-disabled": isCreatingPost, - children: (0,external_wp_i18n_namespaceObject.__)('Create draft') - })] - })] - }) - }) - }); -} - -;// ./node_modules/@wordpress/icons/build-module/library/pencil.js -/** - * WordPress dependencies - */ - - -const pencil = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - d: "m19 7-3-3-8.5 8.5-1 4 4-1L19 7Zm-7 11.5H5V20h7v-1.5Z" - }) -}); -/* harmony default export */ const library_pencil = (pencil); - -;// ./node_modules/@wordpress/icons/build-module/library/edit.js -/** - * Internal dependencies - */ - - -/* harmony default export */ const edit = (library_pencil); - -;// ./node_modules/@wordpress/edit-site/build-module/components/dataviews-actions/index.js -/** - * WordPress dependencies - */ - - - - - -/** - * Internal dependencies - */ - - -const { - useHistory: dataviews_actions_useHistory -} = unlock(external_wp_router_namespaceObject.privateApis); -const useEditPostAction = () => { - const history = dataviews_actions_useHistory(); - return (0,external_wp_element_namespaceObject.useMemo)(() => ({ - id: 'edit-post', - label: (0,external_wp_i18n_namespaceObject.__)('Edit'), - isPrimary: true, - icon: edit, - isEligible(post) { - if (post.status === 'trash') { - return false; - } - // It's eligible for all post types except theme patterns. - return post.type !== PATTERN_TYPES.theme; - }, - callback(items) { - const post = items[0]; - history.push({ - postId: post.id, - postType: post.type, - canvas: 'edit' - }); - } - }), [history]); -}; - -;// ./node_modules/@wordpress/icons/build-module/library/comment-author-avatar.js -/** - * WordPress dependencies - */ - - -const commentAuthorAvatar = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - fillRule: "evenodd", - d: "M7.25 16.437a6.5 6.5 0 1 1 9.5 0V16A2.75 2.75 0 0 0 14 13.25h-4A2.75 2.75 0 0 0 7.25 16v.437Zm1.5 1.193a6.47 6.47 0 0 0 3.25.87 6.47 6.47 0 0 0 3.25-.87V16c0-.69-.56-1.25-1.25-1.25h-4c-.69 0-1.25.56-1.25 1.25v1.63ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm10-2a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z", - clipRule: "evenodd" - }) -}); -/* harmony default export */ const comment_author_avatar = (commentAuthorAvatar); - -;// ./node_modules/@wordpress/edit-site/build-module/components/media/index.js -/** - * WordPress dependencies - */ - - -function Media({ - id, - size = ['large', 'medium', 'thumbnail'], - ...props -}) { - const { - record: media - } = (0,external_wp_coreData_namespaceObject.useEntityRecord)('root', 'media', id); - const currentSize = size.find(s => !!media?.media_details?.sizes[s]); - const mediaUrl = media?.media_details?.sizes[currentSize]?.source_url || media?.source_url; - if (!mediaUrl) { - return null; - } - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { - ...props, - src: mediaUrl, - alt: media.alt_text - }); -} -/* harmony default export */ const components_media = (Media); - -;// ./node_modules/@wordpress/edit-site/build-module/components/post-fields/index.js -/** - * External dependencies - */ - - -/** - * WordPress dependencies - */ - - - - - - - - - -/** - * Internal dependencies - */ - - - - -// See https://github.com/WordPress/gutenberg/issues/55886 -// We do not support custom statutes at the moment. - - -const STATUSES = [{ - value: 'draft', - label: (0,external_wp_i18n_namespaceObject.__)('Draft'), - icon: library_drafts, - description: (0,external_wp_i18n_namespaceObject.__)('Not ready to publish.') -}, { - value: 'future', - label: (0,external_wp_i18n_namespaceObject.__)('Scheduled'), - icon: library_scheduled, - description: (0,external_wp_i18n_namespaceObject.__)('Publish automatically on a chosen date.') -}, { - value: 'pending', - label: (0,external_wp_i18n_namespaceObject.__)('Pending Review'), - icon: library_pending, - description: (0,external_wp_i18n_namespaceObject.__)('Waiting for review before publishing.') -}, { - value: 'private', - label: (0,external_wp_i18n_namespaceObject.__)('Private'), - icon: not_allowed, - description: (0,external_wp_i18n_namespaceObject.__)('Only visible to site admins and editors.') -}, { - value: 'publish', - label: (0,external_wp_i18n_namespaceObject.__)('Published'), - icon: library_published, - description: (0,external_wp_i18n_namespaceObject.__)('Visible to everyone.') -}, { - value: 'trash', - label: (0,external_wp_i18n_namespaceObject.__)('Trash'), - icon: library_trash -}]; -const getFormattedDate = dateToDisplay => (0,external_wp_date_namespaceObject.dateI18n)((0,external_wp_date_namespaceObject.getSettings)().formats.datetimeAbbreviated, (0,external_wp_date_namespaceObject.getDate)(dateToDisplay)); -function FeaturedImage({ - item, - viewType -}) { - const isDisabled = item.status === 'trash'; - const { - onClick - } = useLink({ - postId: item.id, - postType: item.type, - canvas: 'edit' - }); - const hasMedia = !!item.featured_media; - const size = viewType === LAYOUT_GRID ? ['large', 'full', 'medium', 'thumbnail'] : ['thumbnail', 'medium', 'large', 'full']; - const media = hasMedia ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(components_media, { - className: "edit-site-post-list__featured-image", - id: item.featured_media, - size: size - }) : null; - const renderButton = viewType !== LAYOUT_LIST && !isDisabled; - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { - className: `edit-site-post-list__featured-image-wrapper is-layout-${viewType}`, - children: renderButton ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("button", { - className: "edit-site-post-list__featured-image-button", - type: "button", - onClick: onClick, - "aria-label": item.title?.rendered || (0,external_wp_i18n_namespaceObject.__)('(no title)'), - children: media - }) : media - }); -} -function PostStatusField({ - item -}) { - const status = STATUSES.find(({ - value - }) => value === item.status); - const label = status?.label || item.status; - const icon = status?.icon; - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { - alignment: "left", - spacing: 0, - children: [icon && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { - className: "edit-site-post-list__status-icon", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { - icon: icon - }) - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { - children: label - })] - }); -} -function PostAuthorField({ - item -}) { - const { - text, - imageUrl - } = (0,external_wp_data_namespaceObject.useSelect)(select => { - const { - getUser - } = select(external_wp_coreData_namespaceObject.store); - const user = getUser(item.author); - return { - imageUrl: user?.avatar_urls?.[48], - text: user?.name - }; - }, [item]); - const [isImageLoaded, setIsImageLoaded] = (0,external_wp_element_namespaceObject.useState)(false); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { - alignment: "left", - spacing: 0, - children: [!!imageUrl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { - className: dist_clsx('page-templates-author-field__avatar', { - 'is-loaded': isImageLoaded - }), - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { - onLoad: () => setIsImageLoaded(true), - alt: (0,external_wp_i18n_namespaceObject.__)('Author avatar'), - src: imageUrl - }) - }), !imageUrl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { - className: "page-templates-author-field__icon", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { - icon: comment_author_avatar - }) - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { - className: "page-templates-author-field__name", - children: text - })] - }); -} -function usePostFields(viewType) { - const { - records: authors, - isResolving: isLoadingAuthors - } = (0,external_wp_coreData_namespaceObject.useEntityRecords)('root', 'user', { - per_page: -1 - }); - const { - frontPageId, - postsPageId - } = (0,external_wp_data_namespaceObject.useSelect)(select => { - const { - getEntityRecord - } = select(external_wp_coreData_namespaceObject.store); - const siteSettings = getEntityRecord('root', 'site'); - return { - frontPageId: siteSettings?.page_on_front, - postsPageId: siteSettings?.page_for_posts - }; - }, []); - const fields = (0,external_wp_element_namespaceObject.useMemo)(() => [{ - id: 'featured-image', - label: (0,external_wp_i18n_namespaceObject.__)('Featured Image'), - getValue: ({ - item - }) => item.featured_media, - render: ({ - item - }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(FeaturedImage, { - item: item, - viewType: viewType - }), - enableSorting: false - }, { - label: (0,external_wp_i18n_namespaceObject.__)('Title'), - id: 'title', - type: 'text', - getValue: ({ - item - }) => typeof item.title === 'string' ? item.title : item.title?.raw, - render: ({ - item - }) => { - const addLink = [LAYOUT_TABLE, LAYOUT_GRID].includes(viewType) && item.status !== 'trash'; - const renderedTitle = typeof item.title === 'string' ? item.title : item.title?.rendered; - const title = addLink ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Link, { - params: { - postId: item.id, - postType: item.type, - canvas: 'edit' - }, - children: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(renderedTitle) || (0,external_wp_i18n_namespaceObject.__)('(no title)') - }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { - children: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(renderedTitle) || (0,external_wp_i18n_namespaceObject.__)('(no title)') - }); - let suffix = ''; - if (item.id === frontPageId) { - suffix = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { - className: "edit-site-post-list__title-badge", - children: (0,external_wp_i18n_namespaceObject.__)('Homepage') - }); - } else if (item.id === postsPageId) { - suffix = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { - className: "edit-site-post-list__title-badge", - children: (0,external_wp_i18n_namespaceObject.__)('Posts Page') - }); - } - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { - className: "edit-site-post-list__title", - alignment: "center", - justify: "flex-start", - children: [title, suffix] - }); - }, - enableHiding: false - }, { - label: (0,external_wp_i18n_namespaceObject.__)('Author'), - id: 'author', - type: 'integer', - elements: authors?.map(({ - id, - name - }) => ({ - value: id, - label: name - })) || [], - render: PostAuthorField, - sort: (a, b, direction) => { - const nameA = a._embedded?.author?.[0]?.name || ''; - const nameB = b._embedded?.author?.[0]?.name || ''; - return direction === 'asc' ? nameA.localeCompare(nameB) : nameB.localeCompare(nameA); - } - }, { - label: (0,external_wp_i18n_namespaceObject.__)('Status'), - id: 'status', - type: 'text', - elements: STATUSES, - render: PostStatusField, - Edit: 'radio', - enableSorting: false, - filterBy: { - operators: [OPERATOR_IS_ANY] - } - }, { - label: (0,external_wp_i18n_namespaceObject.__)('Date'), - id: 'date', - type: 'datetime', - render: ({ - item - }) => { - const isDraftOrPrivate = ['draft', 'private'].includes(item.status); - if (isDraftOrPrivate) { - return (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: page creation or modification date. */ - (0,external_wp_i18n_namespaceObject.__)('Modified: '), getFormattedDate(item.date)), { - span: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {}), - time: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("time", {}) - }); - } - const isScheduled = item.status === 'future'; - if (isScheduled) { - return (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: page creation date */ - (0,external_wp_i18n_namespaceObject.__)('Scheduled: '), getFormattedDate(item.date)), { - span: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {}), - time: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("time", {}) - }); - } - const isPublished = item.status === 'publish'; - if (isPublished) { - return (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: page creation time */ - (0,external_wp_i18n_namespaceObject.__)('Published: '), getFormattedDate(item.date)), { - span: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {}), - time: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("time", {}) - }); - } - - // Pending posts show the modified date if it's newer. - const dateToDisplay = (0,external_wp_date_namespaceObject.getDate)(item.modified) > (0,external_wp_date_namespaceObject.getDate)(item.date) ? item.modified : item.date; - const isPending = item.status === 'pending'; - if (isPending) { - return (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: page creation or modification date. */ - (0,external_wp_i18n_namespaceObject.__)('Modified: '), getFormattedDate(dateToDisplay)), { - span: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {}), - time: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("time", {}) - }); - } - - // Unknow status. - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("time", { - children: getFormattedDate(item.date) - }); - } - }, { - id: 'comment_status', - label: (0,external_wp_i18n_namespaceObject.__)('Discussion'), - type: 'text', - Edit: 'radio', - enableSorting: false, - filterBy: { - operators: [] - }, - elements: [{ - value: 'open', - label: (0,external_wp_i18n_namespaceObject.__)('Open'), - description: (0,external_wp_i18n_namespaceObject.__)('Visitors can add new comments and replies.') - }, { - value: 'closed', - label: (0,external_wp_i18n_namespaceObject.__)('Closed'), - description: (0,external_wp_i18n_namespaceObject.__)('Visitors cannot add new comments or replies. Existing comments remain visible.') - }] - }], [authors, viewType, frontPageId, postsPageId]); - return { - isLoading: isLoadingAuthors, - fields - }; -} -/* harmony default export */ const post_fields = (usePostFields); - -;// ./node_modules/@wordpress/edit-site/build-module/components/post-list/index.js -/** - * WordPress dependencies - */ - - - - - - - - - - -/** - * Internal dependencies - */ - - - - - - - - - - - -const { - usePostActions -} = unlock(external_wp_editor_namespaceObject.privateApis); -const { - useLocation: post_list_useLocation, - useHistory: post_list_useHistory -} = unlock(external_wp_router_namespaceObject.privateApis); -const { - useEntityRecordsWithPermissions -} = unlock(external_wp_coreData_namespaceObject.privateApis); -const post_list_EMPTY_ARRAY = []; -const getDefaultView = (defaultViews, activeView) => { - return defaultViews.find(({ - slug - }) => slug === activeView)?.view; -}; -const getCustomView = editedEntityRecord => { - if (!editedEntityRecord?.content) { - return undefined; - } - const content = JSON.parse(editedEntityRecord.content); - if (!content) { - return undefined; - } - return { - ...content, - layout: defaultLayouts[content.type]?.layout - }; -}; - -/** - * This function abstracts working with default & custom views by - * providing a [ state, setState ] tuple based on the URL parameters. - * - * Consumers use the provided tuple to work with state - * and don't have to deal with the specifics of default & custom views. - * - * @param {string} postType Post type to retrieve default views for. - * @return {Array} The [ state, setState ] tuple. - */ -function useView(postType) { - const { - params: { - activeView = 'all', - isCustom = 'false', - layout - } - } = post_list_useLocation(); - const history = post_list_useHistory(); - const defaultViews = useDefaultViews({ - postType - }); - const { - editEntityRecord - } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); - const editedEntityRecord = (0,external_wp_data_namespaceObject.useSelect)(select => { - if (isCustom !== 'true') { - return undefined; - } - const { - getEditedEntityRecord - } = select(external_wp_coreData_namespaceObject.store); - return getEditedEntityRecord('postType', 'wp_dataviews', Number(activeView)); - }, [activeView, isCustom]); - const [view, setView] = (0,external_wp_element_namespaceObject.useState)(() => { - let initialView; - if (isCustom === 'true') { - var _getCustomView; - initialView = (_getCustomView = getCustomView(editedEntityRecord)) !== null && _getCustomView !== void 0 ? _getCustomView : { - type: layout !== null && layout !== void 0 ? layout : LAYOUT_LIST - }; - } else { - var _getDefaultView; - initialView = (_getDefaultView = getDefaultView(defaultViews, activeView)) !== null && _getDefaultView !== void 0 ? _getDefaultView : { - type: layout !== null && layout !== void 0 ? layout : LAYOUT_LIST - }; - } - const type = layout !== null && layout !== void 0 ? layout : initialView.type; - return { - ...initialView, - type - }; - }); - const setViewWithUrlUpdate = (0,external_wp_element_namespaceObject.useCallback)(newView => { - const { - params - } = history.getLocationWithParams(); - if (newView.type === LAYOUT_LIST && !params?.layout) { - // Skip updating the layout URL param if - // it is not present and the newView.type is LAYOUT_LIST. - } else if (newView.type !== params?.layout) { - history.push({ - ...params, - layout: newView.type - }); - } - setView(newView); - if (isCustom === 'true' && editedEntityRecord?.id) { - editEntityRecord('postType', 'wp_dataviews', editedEntityRecord?.id, { - content: JSON.stringify(newView) - }); - } - }, [history, isCustom, editEntityRecord, editedEntityRecord?.id]); - - // When layout URL param changes, update the view type - // without affecting any other config. - (0,external_wp_element_namespaceObject.useEffect)(() => { - setView(prevView => ({ - ...prevView, - type: layout !== null && layout !== void 0 ? layout : LAYOUT_LIST - })); - }, [layout]); - - // When activeView or isCustom URL parameters change, reset the view. - (0,external_wp_element_namespaceObject.useEffect)(() => { - let newView; - if (isCustom === 'true') { - newView = getCustomView(editedEntityRecord); - } else { - newView = getDefaultView(defaultViews, activeView); - } - if (newView) { - const type = layout !== null && layout !== void 0 ? layout : newView.type; - setView({ - ...newView, - type - }); - } - }, [activeView, isCustom, layout, defaultViews, editedEntityRecord]); - return [view, setViewWithUrlUpdate, setViewWithUrlUpdate]; -} -const DEFAULT_STATUSES = 'draft,future,pending,private,publish'; // All but 'trash'. - -function getItemId(item) { - return item.id.toString(); -} -function PostList({ - postType -}) { - var _postId$split, _data$map, _usePrevious; - const [view, setView] = useView(postType); - const defaultViews = useDefaultViews({ - postType - }); - const history = post_list_useHistory(); - const location = post_list_useLocation(); - const { - postId, - quickEdit = false, - isCustom, - activeView = 'all' - } = location.params; - const [selection, setSelection] = (0,external_wp_element_namespaceObject.useState)((_postId$split = postId?.split(',')) !== null && _postId$split !== void 0 ? _postId$split : []); - const onChangeSelection = (0,external_wp_element_namespaceObject.useCallback)(items => { - var _params$isCustom; - setSelection(items); - const { - params - } = history.getLocationWithParams(); - if (((_params$isCustom = params.isCustom) !== null && _params$isCustom !== void 0 ? _params$isCustom : 'false') === 'false') { - history.push({ - ...params, - postId: items.join(',') - }); - } - }, [history]); - const getActiveViewFilters = (views, match) => { - var _found$filters; - const found = views.find(({ - slug - }) => slug === match); - return (_found$filters = found?.filters) !== null && _found$filters !== void 0 ? _found$filters : []; - }; - const { - isLoading: isLoadingFields, - fields: _fields - } = post_fields(view.type); - const fields = (0,external_wp_element_namespaceObject.useMemo)(() => { - const activeViewFilters = getActiveViewFilters(defaultViews, activeView).map(({ - field - }) => field); - return _fields.map(field => ({ - ...field, - elements: activeViewFilters.includes(field.id) ? [] : field.elements - })); - }, [_fields, defaultViews, activeView]); - const queryArgs = (0,external_wp_element_namespaceObject.useMemo)(() => { - const filters = {}; - view.filters?.forEach(filter => { - if (filter.field === 'status' && filter.operator === OPERATOR_IS_ANY) { - filters.status = filter.value; - } - if (filter.field === 'author' && filter.operator === OPERATOR_IS_ANY) { - filters.author = filter.value; - } else if (filter.field === 'author' && filter.operator === OPERATOR_IS_NONE) { - filters.author_exclude = filter.value; - } - }); - - // The bundled views want data filtered without displaying the filter. - const activeViewFilters = getActiveViewFilters(defaultViews, activeView); - activeViewFilters.forEach(filter => { - if (filter.field === 'status' && filter.operator === OPERATOR_IS_ANY) { - filters.status = filter.value; - } - if (filter.field === 'author' && filter.operator === OPERATOR_IS_ANY) { - filters.author = filter.value; - } else if (filter.field === 'author' && filter.operator === OPERATOR_IS_NONE) { - filters.author_exclude = filter.value; - } - }); - - // We want to provide a different default item for the status filter - // than the REST API provides. - if (!filters.status || filters.status === '') { - filters.status = DEFAULT_STATUSES; - } - return { - per_page: view.perPage, - page: view.page, - _embed: 'author', - order: view.sort?.direction, - orderby: view.sort?.field, - search: view.search, - ...filters - }; - }, [view, activeView, defaultViews]); - const { - records, - isResolving: isLoadingData, - totalItems, - totalPages - } = useEntityRecordsWithPermissions('postType', postType, queryArgs); - - // The REST API sort the authors by ID, but we want to sort them by name. - const data = (0,external_wp_element_namespaceObject.useMemo)(() => { - if (!isLoadingFields && view?.sort?.field === 'author') { - return filterSortAndPaginate(records, { - sort: { - ...view.sort - } - }, fields).data; - } - return records; - }, [records, fields, isLoadingFields, view?.sort]); - const ids = (_data$map = data?.map(record => getItemId(record))) !== null && _data$map !== void 0 ? _data$map : []; - const prevIds = (_usePrevious = (0,external_wp_compose_namespaceObject.usePrevious)(ids)) !== null && _usePrevious !== void 0 ? _usePrevious : []; - const deletedIds = prevIds.filter(id => !ids.includes(id)); - const postIdWasDeleted = deletedIds.includes(postId); - (0,external_wp_element_namespaceObject.useEffect)(() => { - if (postIdWasDeleted) { - history.push({ - ...history.getLocationWithParams().params, - postId: undefined - }); - } - }, [postIdWasDeleted, history]); - const paginationInfo = (0,external_wp_element_namespaceObject.useMemo)(() => ({ - totalItems, - totalPages - }), [totalItems, totalPages]); - const { - labels, - canCreateRecord - } = (0,external_wp_data_namespaceObject.useSelect)(select => { - const { - getPostType, - canUser - } = select(external_wp_coreData_namespaceObject.store); - return { - labels: getPostType(postType)?.labels, - canCreateRecord: canUser('create', { - kind: 'postType', - name: postType - }) - }; - }, [postType]); - const postTypeActions = usePostActions({ - postType, - context: 'list' - }); - const editAction = useEditPostAction(); - const actions = (0,external_wp_element_namespaceObject.useMemo)(() => [editAction, ...postTypeActions], [postTypeActions, editAction]); - const [showAddPostModal, setShowAddPostModal] = (0,external_wp_element_namespaceObject.useState)(false); - const openModal = () => setShowAddPostModal(true); - const closeModal = () => setShowAddPostModal(false); - const handleNewPage = ({ - type, - id - }) => { - history.push({ - postId: id, - postType: type, - canvas: 'edit' - }); - closeModal(); - }; - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Page, { - title: labels?.name, - actions: labels?.add_new_item && canCreateRecord && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - variant: "primary", - onClick: openModal, - __next40pxDefaultSize: true, - children: labels.add_new_item - }), showAddPostModal && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(AddNewPostModal, { - postType: postType, - onSave: handleNewPage, - onClose: closeModal - })] - }), - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataViews, { - paginationInfo: paginationInfo, - fields: fields, - actions: actions, - data: data || post_list_EMPTY_ARRAY, - isLoading: isLoadingData || isLoadingFields, - view: view, - onChangeView: setView, - selection: selection, - onChangeSelection: onChangeSelection, - getItemId: getItemId, - defaultLayouts: defaultLayouts, - header: window.__experimentalQuickEditDataViews && view.type !== LAYOUT_LIST && postType === 'page' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - size: "compact", - isPressed: quickEdit, - icon: drawer_right, - label: (0,external_wp_i18n_namespaceObject.__)('Toggle details panel'), - onClick: () => { - history.push({ - ...location.params, - quickEdit: quickEdit ? undefined : true - }); - } - }) - }, activeView + isCustom) - }); -} - -;// ./node_modules/@wordpress/edit-site/build-module/components/page-patterns/utils.js -const filterOutDuplicatesByName = (currentItem, index, items) => index === items.findIndex(item => currentItem.name === item.name); - ;// ./node_modules/@wordpress/edit-site/build-module/components/page-patterns/use-pattern-settings.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -34658,374 +36911,12 @@ function usePatternSettings() { return { ...restStoredSettings, __experimentalBlockPatterns: blockPatterns, - __unstableIsPreviewMode: true + isPreviewMode: true }; }, [storedSettings, blockPatterns]); return settings; } -;// ./node_modules/@wordpress/edit-site/build-module/components/page-patterns/search-items.js -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - -const { - extractWords, - getNormalizedSearchTerms, - normalizeString: search_items_normalizeString -} = unlock(external_wp_blockEditor_namespaceObject.privateApis); - -/** - * Internal dependencies - */ - - -// Default search helpers. -const defaultGetName = item => { - if (item.type === PATTERN_TYPES.user) { - return item.slug; - } - if (item.type === TEMPLATE_PART_POST_TYPE) { - return ''; - } - return item.name || ''; -}; -const defaultGetTitle = item => { - if (typeof item.title === 'string') { - return item.title; - } - if (item.title && item.title.rendered) { - return item.title.rendered; - } - if (item.title && item.title.raw) { - return item.title.raw; - } - return ''; -}; -const defaultGetDescription = item => { - if (item.type === PATTERN_TYPES.user) { - return item.excerpt.raw; - } - return item.description || ''; -}; -const defaultGetKeywords = item => item.keywords || []; -const defaultHasCategory = () => false; -const removeMatchingTerms = (unmatchedTerms, unprocessedTerms) => { - return unmatchedTerms.filter(term => !getNormalizedSearchTerms(unprocessedTerms).some(unprocessedTerm => unprocessedTerm.includes(term))); -}; - -/** - * Filters an item list given a search term. - * - * @param {Array} items Item list - * @param {string} searchInput Search input. - * @param {Object} config Search Config. - * - * @return {Array} Filtered item list. - */ -const searchItems = (items = [], searchInput = '', config = {}) => { - const normalizedSearchTerms = getNormalizedSearchTerms(searchInput); - - // Filter patterns by category: the default category indicates that all patterns will be shown. - const onlyFilterByCategory = config.categoryId !== PATTERN_DEFAULT_CATEGORY && !normalizedSearchTerms.length; - const searchRankConfig = { - ...config, - onlyFilterByCategory - }; - - // If we aren't filtering on search terms, matching on category is satisfactory. - // If we are, then we need more than a category match. - const threshold = onlyFilterByCategory ? 0 : 1; - const rankedItems = items.map(item => { - return [item, getItemSearchRank(item, searchInput, searchRankConfig)]; - }).filter(([, rank]) => rank > threshold); - - // If we didn't have terms to search on, there's no point sorting. - if (normalizedSearchTerms.length === 0) { - return rankedItems.map(([item]) => item); - } - rankedItems.sort(([, rank1], [, rank2]) => rank2 - rank1); - return rankedItems.map(([item]) => item); -}; - -/** - * Get the search rank for a given item and a specific search term. - * The better the match, the higher the rank. - * If the rank equals 0, it should be excluded from the results. - * - * @param {Object} item Item to filter. - * @param {string} searchTerm Search term. - * @param {Object} config Search Config. - * - * @return {number} Search Rank. - */ -function getItemSearchRank(item, searchTerm, config) { - const { - categoryId, - getName = defaultGetName, - getTitle = defaultGetTitle, - getDescription = defaultGetDescription, - getKeywords = defaultGetKeywords, - hasCategory = defaultHasCategory, - onlyFilterByCategory - } = config; - let rank = categoryId === PATTERN_DEFAULT_CATEGORY || categoryId === TEMPLATE_PART_ALL_AREAS_CATEGORY || categoryId === PATTERN_USER_CATEGORY && item.type === PATTERN_TYPES.user || hasCategory(item, categoryId) ? 1 : 0; - - // If an item doesn't belong to the current category or we don't have - // search terms to filter by, return the initial rank value. - if (!rank || onlyFilterByCategory) { - return rank; - } - const name = getName(item); - const title = getTitle(item); - const description = getDescription(item); - const keywords = getKeywords(item); - const normalizedSearchInput = search_items_normalizeString(searchTerm); - const normalizedTitle = search_items_normalizeString(title); - - // Prefers exact matches - // Then prefers if the beginning of the title matches the search term - // name, keywords, description matches come later. - if (normalizedSearchInput === normalizedTitle) { - rank += 30; - } else if (normalizedTitle.startsWith(normalizedSearchInput)) { - rank += 20; - } else { - const terms = [name, title, description, ...keywords].join(' '); - const normalizedSearchTerms = extractWords(normalizedSearchInput); - const unmatchedTerms = removeMatchingTerms(normalizedSearchTerms, terms); - if (unmatchedTerms.length === 0) { - rank += 10; - } - } - return rank; -} - -;// ./node_modules/@wordpress/edit-site/build-module/components/page-patterns/use-patterns.js -/** - * WordPress dependencies - */ - - - - - - -/** - * Internal dependencies - */ - - - - - -const EMPTY_PATTERN_LIST = []; -const selectTemplateParts = (0,external_wp_data_namespaceObject.createSelector)((select, categoryId, search = '') => { - var _getEntityRecords; - const { - getEntityRecords, - isResolving: isResolvingSelector - } = select(external_wp_coreData_namespaceObject.store); - const { - __experimentalGetDefaultTemplatePartAreas - } = select(external_wp_editor_namespaceObject.store); - const query = { - per_page: -1 - }; - const templateParts = (_getEntityRecords = getEntityRecords('postType', TEMPLATE_PART_POST_TYPE, query)) !== null && _getEntityRecords !== void 0 ? _getEntityRecords : EMPTY_PATTERN_LIST; - - // In the case where a custom template part area has been removed we need - // the current list of areas to cross check against so orphaned template - // parts can be treated as uncategorized. - const knownAreas = __experimentalGetDefaultTemplatePartAreas() || []; - const templatePartAreas = knownAreas.map(area => area.area); - const templatePartHasCategory = (item, category) => { - if (category !== TEMPLATE_PART_AREA_DEFAULT_CATEGORY) { - return item.area === category; - } - return item.area === category || !templatePartAreas.includes(item.area); - }; - const isResolving = isResolvingSelector('getEntityRecords', ['postType', TEMPLATE_PART_POST_TYPE, query]); - const patterns = searchItems(templateParts, search, { - categoryId, - hasCategory: templatePartHasCategory - }); - return { - patterns, - isResolving - }; -}, select => [select(external_wp_coreData_namespaceObject.store).getEntityRecords('postType', TEMPLATE_PART_POST_TYPE, { - per_page: -1 -}), select(external_wp_coreData_namespaceObject.store).isResolving('getEntityRecords', ['postType', TEMPLATE_PART_POST_TYPE, { - per_page: -1 -}]), select(external_wp_editor_namespaceObject.store).__experimentalGetDefaultTemplatePartAreas()]); -const selectThemePatterns = (0,external_wp_data_namespaceObject.createSelector)(select => { - var _settings$__experimen; - const { - getSettings - } = unlock(select(store)); - const { - isResolving: isResolvingSelector - } = select(external_wp_coreData_namespaceObject.store); - const settings = getSettings(); - const blockPatterns = (_settings$__experimen = settings.__experimentalAdditionalBlockPatterns) !== null && _settings$__experimen !== void 0 ? _settings$__experimen : settings.__experimentalBlockPatterns; - const restBlockPatterns = select(external_wp_coreData_namespaceObject.store).getBlockPatterns(); - const patterns = [...(blockPatterns || []), ...(restBlockPatterns || [])].filter(pattern => !EXCLUDED_PATTERN_SOURCES.includes(pattern.source)).filter(filterOutDuplicatesByName).filter(pattern => pattern.inserter !== false).map(pattern => ({ - ...pattern, - keywords: pattern.keywords || [], - type: PATTERN_TYPES.theme, - blocks: (0,external_wp_blocks_namespaceObject.parse)(pattern.content, { - __unstableSkipMigrationLogs: true - }) - })); - return { - patterns, - isResolving: isResolvingSelector('getBlockPatterns') - }; -}, select => [select(external_wp_coreData_namespaceObject.store).getBlockPatterns(), select(external_wp_coreData_namespaceObject.store).isResolving('getBlockPatterns'), unlock(select(store)).getSettings()]); -const selectPatterns = (0,external_wp_data_namespaceObject.createSelector)((select, categoryId, syncStatus, search = '') => { - const { - patterns: themePatterns, - isResolving: isResolvingThemePatterns - } = selectThemePatterns(select); - const { - patterns: userPatterns, - isResolving: isResolvingUserPatterns, - categories: userPatternCategories - } = selectUserPatterns(select); - let patterns = [...(themePatterns || []), ...(userPatterns || [])]; - if (syncStatus) { - // User patterns can have their sync statuses checked directly - // Non-user patterns are all unsynced for the time being. - patterns = patterns.filter(pattern => { - return pattern.type === PATTERN_TYPES.user ? (pattern.wp_pattern_sync_status || PATTERN_SYNC_TYPES.full) === syncStatus : syncStatus === PATTERN_SYNC_TYPES.unsynced; - }); - } - if (categoryId) { - patterns = searchItems(patterns, search, { - categoryId, - hasCategory: (item, currentCategory) => { - if (item.type === PATTERN_TYPES.user) { - return item.wp_pattern_category.some(catId => userPatternCategories.find(cat => cat.id === catId)?.slug === currentCategory); - } - return item.categories?.includes(currentCategory); - } - }); - } else { - patterns = searchItems(patterns, search, { - hasCategory: item => { - if (item.type === PATTERN_TYPES.user) { - return userPatternCategories?.length && (!item.wp_pattern_category?.length || !item.wp_pattern_category.some(catId => userPatternCategories.find(cat => cat.id === catId))); - } - return !item.hasOwnProperty('categories'); - } - }); - } - return { - patterns, - isResolving: isResolvingThemePatterns || isResolvingUserPatterns - }; -}, select => [selectThemePatterns(select), selectUserPatterns(select)]); -const selectUserPatterns = (0,external_wp_data_namespaceObject.createSelector)((select, syncStatus, search = '') => { - const { - getEntityRecords, - isResolving: isResolvingSelector, - getUserPatternCategories - } = select(external_wp_coreData_namespaceObject.store); - const query = { - per_page: -1 - }; - const patternPosts = getEntityRecords('postType', PATTERN_TYPES.user, query); - const userPatternCategories = getUserPatternCategories(); - const categories = new Map(); - userPatternCategories.forEach(userCategory => categories.set(userCategory.id, userCategory)); - let patterns = patternPosts !== null && patternPosts !== void 0 ? patternPosts : EMPTY_PATTERN_LIST; - const isResolving = isResolvingSelector('getEntityRecords', ['postType', PATTERN_TYPES.user, query]); - if (syncStatus) { - patterns = patterns.filter(pattern => pattern.wp_pattern_sync_status || PATTERN_SYNC_TYPES.full === syncStatus); - } - patterns = searchItems(patterns, search, { - // We exit user pattern retrieval early if we aren't in the - // catch-all category for user created patterns, so it has - // to be in the category. - hasCategory: () => true - }); - return { - patterns, - isResolving, - categories: userPatternCategories - }; -}, select => [select(external_wp_coreData_namespaceObject.store).getEntityRecords('postType', PATTERN_TYPES.user, { - per_page: -1 -}), select(external_wp_coreData_namespaceObject.store).isResolving('getEntityRecords', ['postType', PATTERN_TYPES.user, { - per_page: -1 -}]), select(external_wp_coreData_namespaceObject.store).getUserPatternCategories()]); -function useAugmentPatternsWithPermissions(patterns) { - const idsAndTypes = (0,external_wp_element_namespaceObject.useMemo)(() => { - var _patterns$filter$map; - return (_patterns$filter$map = patterns?.filter(record => record.type !== PATTERN_TYPES.theme).map(record => [record.type, record.id])) !== null && _patterns$filter$map !== void 0 ? _patterns$filter$map : []; - }, [patterns]); - const permissions = (0,external_wp_data_namespaceObject.useSelect)(select => { - const { - getEntityRecordPermissions - } = unlock(select(external_wp_coreData_namespaceObject.store)); - return idsAndTypes.reduce((acc, [type, id]) => { - acc[id] = getEntityRecordPermissions('postType', type, id); - return acc; - }, {}); - }, [idsAndTypes]); - return (0,external_wp_element_namespaceObject.useMemo)(() => { - var _patterns$map; - return (_patterns$map = patterns?.map(record => { - var _permissions$record$i; - return { - ...record, - permissions: (_permissions$record$i = permissions?.[record.id]) !== null && _permissions$record$i !== void 0 ? _permissions$record$i : {} - }; - })) !== null && _patterns$map !== void 0 ? _patterns$map : []; - }, [patterns, permissions]); -} -const usePatterns = (postType, categoryId, { - search = '', - syncStatus -} = {}) => { - return (0,external_wp_data_namespaceObject.useSelect)(select => { - if (postType === TEMPLATE_PART_POST_TYPE) { - return selectTemplateParts(select, categoryId, search); - } else if (postType === PATTERN_TYPES.user && !!categoryId) { - const appliedCategory = categoryId === 'uncategorized' ? '' : categoryId; - return selectPatterns(select, appliedCategory, syncStatus, search); - } else if (postType === PATTERN_TYPES.user) { - return selectUserPatterns(select, syncStatus, search); - } - return { - patterns: EMPTY_PATTERN_LIST, - isResolving: false - }; - }, [categoryId, postType, search, syncStatus]); -}; -/* harmony default export */ const use_patterns = (usePatterns); - -;// ./node_modules/@wordpress/icons/build-module/library/symbol.js -/** - * WordPress dependencies - */ - - -const symbol_symbol = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - d: "M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-1 1.4l-5.6 5.6c-.1.1-.3.1-.4 0l-5.6-5.6c-.1-.1-.1-.3 0-.4l5.6-5.6s.1-.1.2-.1.1 0 .2.1l5.6 5.6c.1.1.1.3 0 .4zm-16.6-.4L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z" - }) -}); -/* harmony default export */ const library_symbol = (symbol_symbol); - ;// ./node_modules/@wordpress/icons/build-module/library/symbol-filled.js /** * WordPress dependencies @@ -35057,6 +36948,7 @@ const upload = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ext /* harmony default export */ const library_upload = (upload); ;// ./node_modules/@wordpress/edit-site/build-module/components/add-new-pattern/index.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -35077,10 +36969,9 @@ const upload = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ext - - const { - useHistory: add_new_pattern_useHistory + useHistory: add_new_pattern_useHistory, + useLocation: add_new_pattern_useLocation } = unlock(external_wp_router_namespaceObject.privateApis); const { CreatePatternModal, @@ -35091,6 +36982,7 @@ const { } = unlock(external_wp_editor_namespaceObject.privateApis); function AddNewPattern() { const history = add_new_pattern_useHistory(); + const location = add_new_pattern_useLocation(); const [showPatternModal, setShowPatternModal] = (0,external_wp_element_namespaceObject.useState)(false); const [showTemplatePartModal, setShowTemplatePartModal] = (0,external_wp_element_namespaceObject.useState)(false); // eslint-disable-next-line @wordpress/no-unused-vars-before-return @@ -35133,21 +37025,11 @@ function AddNewPattern() { pattern }) { setShowPatternModal(false); - history.push({ - postId: pattern.id, - postType: PATTERN_TYPES.user, - canvas: 'edit' - }); + history.navigate(`/${PATTERN_TYPES.user}/${pattern.id}?canvas=edit`); } function handleCreateTemplatePart(templatePart) { setShowTemplatePartModal(false); - - // Navigate to the created template part editor. - history.push({ - postId: templatePart.id, - postType: TEMPLATE_PART_POST_TYPE, - canvas: 'edit' - }); + history.navigate(`/${TEMPLATE_PART_POST_TYPE}/${templatePart.id}?canvas=edit`); } function handleError() { setShowPatternModal(false); @@ -35215,22 +37097,16 @@ function AddNewPattern() { return; } try { - const { - params: { - postType, - categoryId - } - } = history.getLocationWithParams(); let currentCategoryId; // When we're not handling template parts, we should // add or create the proper pattern category. - if (postType !== TEMPLATE_PART_POST_TYPE) { + if (location.query.postType !== TEMPLATE_PART_POST_TYPE) { /* * categoryMap.values() returns an iterator. * Iterator.prototype.find() is not yet widely supported. * Convert to array to use the Array.prototype.find method. */ - const currentCategory = Array.from(categoryMap.values()).find(term => term.name === categoryId); + const currentCategory = Array.from(categoryMap.values()).find(term => term.name === location.query.categoryId); if (currentCategory) { currentCategoryId = currentCategory.id || (await findOrCreateTerm(currentCategory.label)); } @@ -35240,11 +37116,8 @@ function AddNewPattern() { // Navigate to the All patterns category for the newly created pattern // if we're not on that page already and if we're not in the `my-patterns` // category. - if (!currentCategoryId && categoryId !== 'my-patterns') { - history.push({ - postType: PATTERN_TYPES.user, - categoryId: PATTERN_DEFAULT_CATEGORY - }); + if (!currentCategoryId && location.query.categoryId !== 'my-patterns') { + history.navigate(`/pattern?categoryId=${PATTERN_DEFAULT_CATEGORY}`); } createSuccessNotice((0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: The imported pattern's title. @@ -35265,159 +37138,6 @@ function AddNewPattern() { }); } -;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-patterns/use-default-pattern-categories.js -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - - -function useDefaultPatternCategories() { - const blockPatternCategories = (0,external_wp_data_namespaceObject.useSelect)(select => { - var _settings$__experimen; - const { - getSettings - } = unlock(select(store)); - const settings = getSettings(); - return (_settings$__experimen = settings.__experimentalAdditionalBlockPatternCategories) !== null && _settings$__experimen !== void 0 ? _settings$__experimen : settings.__experimentalBlockPatternCategories; - }); - const restBlockPatternCategories = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getBlockPatternCategories()); - return [...(blockPatternCategories || []), ...(restBlockPatternCategories || [])]; -} - -;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js -/** - * WordPress dependencies - */ - - - - -/** - * Internal dependencies - */ - - - - -function useThemePatterns() { - const blockPatterns = (0,external_wp_data_namespaceObject.useSelect)(select => { - var _getSettings$__experi; - const { - getSettings - } = unlock(select(store)); - return (_getSettings$__experi = getSettings().__experimentalAdditionalBlockPatterns) !== null && _getSettings$__experi !== void 0 ? _getSettings$__experi : getSettings().__experimentalBlockPatterns; - }); - const restBlockPatterns = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getBlockPatterns()); - const patterns = (0,external_wp_element_namespaceObject.useMemo)(() => [...(blockPatterns || []), ...(restBlockPatterns || [])].filter(pattern => !EXCLUDED_PATTERN_SOURCES.includes(pattern.source)).filter(filterOutDuplicatesByName).filter(pattern => pattern.inserter !== false), [blockPatterns, restBlockPatterns]); - return patterns; -} - -;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - - - - -function usePatternCategories() { - const defaultCategories = useDefaultPatternCategories(); - defaultCategories.push({ - name: TEMPLATE_PART_AREA_DEFAULT_CATEGORY, - label: (0,external_wp_i18n_namespaceObject.__)('Uncategorized') - }); - const themePatterns = useThemePatterns(); - const { - patterns: userPatterns, - categories: userPatternCategories - } = use_patterns(PATTERN_TYPES.user); - const patternCategories = (0,external_wp_element_namespaceObject.useMemo)(() => { - const categoryMap = {}; - const categoriesWithCounts = []; - - // Create a map for easier counting of patterns in categories. - defaultCategories.forEach(category => { - if (!categoryMap[category.name]) { - categoryMap[category.name] = { - ...category, - count: 0 - }; - } - }); - userPatternCategories.forEach(category => { - if (!categoryMap[category.name]) { - categoryMap[category.name] = { - ...category, - count: 0 - }; - } - }); - - // Update the category counts to reflect theme registered patterns. - themePatterns.forEach(pattern => { - pattern.categories?.forEach(category => { - if (categoryMap[category]) { - categoryMap[category].count += 1; - } - }); - // If the pattern has no categories, add it to uncategorized. - if (!pattern.categories?.length) { - categoryMap.uncategorized.count += 1; - } - }); - - // Update the category counts to reflect user registered patterns. - userPatterns.forEach(pattern => { - pattern.wp_pattern_category?.forEach(catId => { - const category = userPatternCategories.find(cat => cat.id === catId)?.name; - if (categoryMap[category]) { - categoryMap[category].count += 1; - } - }); - // If the pattern has no categories, add it to uncategorized. - if (!pattern.wp_pattern_category?.length || !pattern.wp_pattern_category.some(catId => userPatternCategories.find(cat => cat.id === catId))) { - categoryMap.uncategorized.count += 1; - } - }); - - // Filter categories so we only have those containing patterns. - [...defaultCategories, ...userPatternCategories].forEach(category => { - if (categoryMap[category.name].count && !categoriesWithCounts.find(cat => cat.name === category.name)) { - categoriesWithCounts.push(categoryMap[category.name]); - } - }); - const sortedCategories = categoriesWithCounts.sort((a, b) => a.label.localeCompare(b.label)); - sortedCategories.unshift({ - name: PATTERN_USER_CATEGORY, - label: (0,external_wp_i18n_namespaceObject.__)('My patterns'), - count: userPatterns.length - }); - sortedCategories.unshift({ - name: PATTERN_DEFAULT_CATEGORY, - label: (0,external_wp_i18n_namespaceObject.__)('All patterns'), - description: (0,external_wp_i18n_namespaceObject.__)('A list of all patterns from all sources.'), - count: themePatterns.length + userPatterns.length - }); - return sortedCategories; - }, [defaultCategories, themePatterns, userPatternCategories, userPatterns]); - return { - patternCategories, - hasPatterns: !!patternCategories.length - }; -} - ;// ./node_modules/@wordpress/edit-site/build-module/components/page-patterns/rename-category-menu-item.js /** * WordPress dependencies @@ -35436,8 +37156,6 @@ function usePatternCategories() { */ - - const { RenamePatternCategoryModal } = unlock(external_wp_patterns_namespaceObject.privateApis); @@ -35450,7 +37168,7 @@ function RenameCategoryMenuItem({ children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { onClick: () => setIsModalOpen(true), children: (0,external_wp_i18n_namespaceObject.__)('Rename') - }), isModalOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(RenameModal, { + }), isModalOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(rename_category_menu_item_RenameModal, { category: category, onClose: () => { setIsModalOpen(false); @@ -35459,7 +37177,7 @@ function RenameCategoryMenuItem({ })] }); } -function RenameModal({ +function rename_category_menu_item_RenameModal({ category, onClose }) { @@ -35503,8 +37221,6 @@ function RenameModal({ - - const { useHistory: delete_category_menu_item_useHistory } = unlock(external_wp_router_namespaceObject.privateApis); @@ -35536,16 +37252,13 @@ function DeleteCategoryMenuItem({ invalidateResolution('getEntityRecords', ['postType', PATTERN_TYPES.user, { per_page: -1 }]); - createSuccessNotice((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: The pattern category's name */ + createSuccessNotice((0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: The pattern category's name */ (0,external_wp_i18n_namespaceObject._x)('"%s" deleted.', 'pattern category'), category.label), { type: 'snackbar', id: 'pattern-category-delete' }); onClose?.(); - history.push({ - postType: PATTERN_TYPES.user, - categoryId: PATTERN_DEFAULT_CATEGORY - }); + history.navigate(`/pattern?categoryId=${PATTERN_DEFAULT_CATEGORY}`); } catch (error) { const errorMessage = error.message && error.code !== 'unknown_error' ? error.message : (0,external_wp_i18n_namespaceObject.__)('An error occurred while deleting the pattern category.'); createErrorNotice(errorMessage, { @@ -35578,6 +37291,7 @@ function DeleteCategoryMenuItem({ } ;// ./node_modules/@wordpress/edit-site/build-module/components/page-patterns/header.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -35596,7 +37310,6 @@ function DeleteCategoryMenuItem({ - function PatternsHeader({ categoryId, type, @@ -35606,7 +37319,7 @@ function PatternsHeader({ const { patternCategories } = usePatternCategories(); - const templatePartAreas = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_editor_namespaceObject.store).__experimentalGetDefaultTemplatePartAreas(), []); + const templatePartAreas = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getEntityRecord('root', '__unstableBase')?.default_template_part_areas || [], []); let title, description, patternCategory; if (type === TEMPLATE_PART_POST_TYPE) { const templatePartArea = templatePartAreas.find(area => area.area === categoryId); @@ -35640,7 +37353,7 @@ function PatternsHeader({ label: (0,external_wp_i18n_namespaceObject.__)('Actions'), toggleProps: { className: 'edit-site-patterns__button', - description: (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: pattern category name */ + description: (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: pattern category name */ (0,external_wp_i18n_namespaceObject.__)('Action menu for %s pattern category'), title), size: 'compact' }, @@ -35667,69 +37380,66 @@ function PatternsHeader({ }); } -;// ./node_modules/@wordpress/icons/build-module/library/lock-small.js +;// ./node_modules/@wordpress/icons/build-module/library/pencil.js /** * WordPress dependencies */ -const lockSmall = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - viewBox: "0 0 24 24", +const pencil = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M15 11h-.2V9c0-1.5-1.2-2.8-2.8-2.8S9.2 7.5 9.2 9v2H9c-.6 0-1 .4-1 1v4c0 .6.4 1 1 1h6c.6 0 1-.4 1-1v-4c0-.6-.4-1-1-1zm-1.8 0h-2.5V9c0-.7.6-1.2 1.2-1.2s1.2.6 1.2 1.2v2z" + d: "m19 7-3-3-8.5 8.5-1 4 4-1L19 7Zm-7 11.5H5V20h7v-1.5Z" }) }); -/* harmony default export */ const lock_small = (lockSmall); +/* harmony default export */ const library_pencil = (pencil); -;// external ["wp","priorityQueue"] -const external_wp_priorityQueue_namespaceObject = window["wp"]["priorityQueue"]; -;// ./node_modules/@wordpress/edit-site/build-module/components/async/index.js +;// ./node_modules/@wordpress/icons/build-module/library/edit.js +/** + * Internal dependencies + */ + + +/* harmony default export */ const edit = (library_pencil); + +;// ./node_modules/@wordpress/edit-site/build-module/components/dataviews-actions/index.js /** * WordPress dependencies */ -const blockPreviewQueue = (0,external_wp_priorityQueue_namespaceObject.createQueue)(); + + /** - * Renders a component at the next idle time. - * @param {*} props + * Internal dependencies */ -function Async({ - children, - placeholder -}) { - const [shouldRender, setShouldRender] = (0,external_wp_element_namespaceObject.useState)(false); - // In the future, we could try to use startTransition here, but currently - // react will batch all transitions, which means all previews will be - // rendered at the same time. - // https://react.dev/reference/react/startTransition#caveats - // > If there are multiple ongoing Transitions, React currently batches them - // > together. This is a limitation that will likely be removed in a future - // > release. - (0,external_wp_element_namespaceObject.useEffect)(() => { - const context = {}; - blockPreviewQueue.add(context, () => { - // Synchronously run all renders so it consumes timeRemaining. - // See https://github.com/WordPress/gutenberg/pull/48238 - (0,external_wp_element_namespaceObject.flushSync)(() => { - setShouldRender(true); - }); - }); - return () => { - blockPreviewQueue.cancel(context); - }; - }, []); - if (!shouldRender) { - return placeholder; - } - return children; -} +const { + useHistory: dataviews_actions_useHistory +} = unlock(external_wp_router_namespaceObject.privateApis); +const useEditPostAction = () => { + const history = dataviews_actions_useHistory(); + return (0,external_wp_element_namespaceObject.useMemo)(() => ({ + id: 'edit-post', + label: (0,external_wp_i18n_namespaceObject.__)('Edit'), + isPrimary: true, + icon: edit, + isEligible(post) { + if (post.status === 'trash') { + return false; + } + // It's eligible for all post types except theme patterns. + return post.type !== PATTERN_TYPES.theme; + }, + callback(items) { + const post = items[0]; + history.navigate(`/${post.type}/${post.id}?canvas=edit`); + } + }), [history]); +}; ;// ./node_modules/@wordpress/icons/build-module/library/plugins.js /** @@ -35761,6 +37471,23 @@ const globe = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(exte }); /* harmony default export */ const library_globe = (globe); +;// ./node_modules/@wordpress/icons/build-module/library/comment-author-avatar.js +/** + * WordPress dependencies + */ + + +const commentAuthorAvatar = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + fillRule: "evenodd", + d: "M7.25 16.437a6.5 6.5 0 1 1 9.5 0V16A2.75 2.75 0 0 0 14 13.25h-4A2.75 2.75 0 0 0 7.25 16v.437Zm1.5 1.193a6.47 6.47 0 0 0 3.25.87 6.47 6.47 0 0 0 3.25-.87V16c0-.69-.56-1.25-1.25-1.25h-4c-.69 0-1.25.56-1.25 1.25v1.63ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm10-2a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z", + clipRule: "evenodd" + }) +}); +/* harmony default export */ const comment_author_avatar = (commentAuthorAvatar); + ;// ./node_modules/@wordpress/edit-site/build-module/components/page-templates/hooks.js /** * WordPress dependencies @@ -35848,6 +37575,7 @@ function useAddedBy(postType, postId) { } ;// ./node_modules/@wordpress/edit-site/build-module/components/page-patterns/fields.js +/* wp:polyfill */ /** * External dependencies */ @@ -35863,7 +37591,6 @@ function useAddedBy(postType, postId) { - /** * Internal dependencies */ @@ -35871,44 +37598,16 @@ function useAddedBy(postType, postId) { - - - - const { useGlobalStyle: fields_useGlobalStyle } = unlock(external_wp_blockEditor_namespaceObject.privateApis); -function PreviewWrapper({ - item, - onClick, - ariaDescribedBy, - children -}) { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("button", { - className: "page-patterns-preview-field__button", - type: "button", - onClick: item.type !== PATTERN_TYPES.theme ? onClick : undefined, - "aria-label": item.title, - "aria-describedby": ariaDescribedBy, - "aria-disabled": item.type === PATTERN_TYPES.theme, - children: children - }); -} function PreviewField({ item }) { const descriptionId = (0,external_wp_element_namespaceObject.useId)(); const description = item.description || item?.excerpt?.raw; - const isUserPattern = item.type === PATTERN_TYPES.user; const isTemplatePart = item.type === TEMPLATE_PART_POST_TYPE; const [backgroundColor] = fields_useGlobalStyle('color.background'); - const { - onClick - } = useLink({ - postType: item.type, - postId: isUserPattern || isTemplatePart ? item.id : item.name, - canvas: 'edit' - }); const blocks = (0,external_wp_element_namespaceObject.useMemo)(() => { var _item$blocks; return (_item$blocks = item.blocks) !== null && _item$blocks !== void 0 ? _item$blocks : (0,external_wp_blocks_namespaceObject.parse)(item.content.raw, { @@ -35921,16 +37620,12 @@ function PreviewField({ style: { backgroundColor }, - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(PreviewWrapper, { - item: item, - onClick: onClick, - ariaDescribedBy: !!description ? descriptionId : undefined, - children: [isEmpty && isTemplatePart && (0,external_wp_i18n_namespaceObject.__)('Empty template part'), isEmpty && !isTemplatePart && (0,external_wp_i18n_namespaceObject.__)('Empty pattern'), !isEmpty && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Async, { - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockPreview, { - blocks: blocks, - viewportWidth: item.viewportWidth - }) - })] + "aria-describedby": !!description ? descriptionId : undefined, + children: [isEmpty && isTemplatePart && (0,external_wp_i18n_namespaceObject.__)('Empty template part'), isEmpty && !isTemplatePart && (0,external_wp_i18n_namespaceObject.__)('Empty pattern'), !isEmpty && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockPreview.Async, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockPreview, { + blocks: blocks, + viewportWidth: item.viewportWidth + }) }), !!description && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { hidden: true, id: descriptionId, @@ -35944,58 +37639,6 @@ const previewField = { render: PreviewField, enableSorting: false }; -function TitleField({ - item -}) { - const isUserPattern = item.type === PATTERN_TYPES.user; - const isTemplatePart = item.type === TEMPLATE_PART_POST_TYPE; - const { - onClick - } = useLink({ - postType: item.type, - postId: isUserPattern || isTemplatePart ? item.id : item.name, - canvas: 'edit' - }); - const title = (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(defaultGetTitle(item)); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { - alignment: "center", - justify: "flex-start", - spacing: 2, - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Flex, { - as: "div", - gap: 0, - justify: "flex-start", - className: "edit-site-patterns__pattern-title", - children: item.type === PATTERN_TYPES.theme ? title : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - __next40pxDefaultSize: true, - variant: "link", - onClick: onClick - // Required for the grid's roving tab index system. - // See https://github.com/WordPress/gutenberg/pull/51898#discussion_r1243399243. - , - tabIndex: "-1", - children: title - }) - }), item.type === PATTERN_TYPES.theme && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Tooltip, { - placement: "top", - text: (0,external_wp_i18n_namespaceObject.__)('This pattern cannot be edited.'), - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, { - className: "edit-site-patterns__pattern-lock-icon", - icon: lock_small, - size: 24 - }) - })] - }); -} -const titleField = { - label: (0,external_wp_i18n_namespaceObject.__)('Title'), - id: 'title', - getValue: ({ - item - }) => item.title?.raw || item.title, - render: TitleField, - enableHiding: false -}; const SYNC_FILTERS = [{ value: PATTERN_SYNC_TYPES.full, label: (0,external_wp_i18n_namespaceObject._x)('Synced', 'pattern (singular)'), @@ -36073,6 +37716,7 @@ const templatePartAuthorField = { }; ;// ./node_modules/@wordpress/edit-site/build-module/components/page-patterns/index.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -36097,25 +37741,22 @@ const templatePartAuthorField = { - const { ExperimentalBlockEditorProvider: page_patterns_ExperimentalBlockEditorProvider } = unlock(external_wp_blockEditor_namespaceObject.privateApis); const { - usePostActions: page_patterns_usePostActions + usePostActions, + patternTitleField } = unlock(external_wp_editor_namespaceObject.privateApis); const { - useLocation: page_patterns_useLocation + useLocation: page_patterns_useLocation, + useHistory: page_patterns_useHistory } = unlock(external_wp_router_namespaceObject.privateApis); const page_patterns_EMPTY_ARRAY = []; -const page_patterns_defaultLayouts = { +const defaultLayouts = { [LAYOUT_TABLE]: { layout: { - primaryField: 'title', styles: { - preview: { - width: '1%' - }, author: { width: '1%' } @@ -36124,8 +37765,6 @@ const page_patterns_defaultLayouts = { }, [LAYOUT_GRID]: { layout: { - mediaField: 'preview', - primaryField: 'title', badgeFields: ['sync-status'] } } @@ -36135,29 +37774,31 @@ const DEFAULT_VIEW = { search: '', page: 1, perPage: 20, - layout: page_patterns_defaultLayouts[LAYOUT_GRID].layout, - fields: ['title', 'sync-status'], - filters: [] + titleField: 'title', + mediaField: 'preview', + fields: ['sync-status'], + filters: [], + ...defaultLayouts[LAYOUT_GRID] }; function DataviewsPatterns() { const { - params: { - postType, + query: { + postType = 'wp_block', categoryId: categoryIdFromURL } } = page_patterns_useLocation(); - const type = postType || PATTERN_TYPES.user; + const history = page_patterns_useHistory(); const categoryId = categoryIdFromURL || PATTERN_DEFAULT_CATEGORY; const [view, setView] = (0,external_wp_element_namespaceObject.useState)(DEFAULT_VIEW); const previousCategoryId = (0,external_wp_compose_namespaceObject.usePrevious)(categoryId); - const previousPostType = (0,external_wp_compose_namespaceObject.usePrevious)(type); + const previousPostType = (0,external_wp_compose_namespaceObject.usePrevious)(postType); const viewSyncStatus = view.filters?.find(({ field }) => field === 'sync-status')?.value; const { patterns, isResolving - } = use_patterns(type, categoryId, { + } = use_patterns(postType, categoryId, { search: view.search, syncStatus: viewSyncStatus }); @@ -36180,27 +37821,27 @@ function DataviewsPatterns() { })); }, [records]); const fields = (0,external_wp_element_namespaceObject.useMemo)(() => { - const _fields = [previewField, titleField]; - if (type === PATTERN_TYPES.user) { + const _fields = [previewField, patternTitleField]; + if (postType === PATTERN_TYPES.user) { _fields.push(patternStatusField); - } else if (type === TEMPLATE_PART_POST_TYPE) { + } else if (postType === TEMPLATE_PART_POST_TYPE) { _fields.push({ ...templatePartAuthorField, elements: authors }); } return _fields; - }, [type, authors]); + }, [postType, authors]); // Reset the page number when the category changes. (0,external_wp_element_namespaceObject.useEffect)(() => { - if (previousCategoryId !== categoryId || previousPostType !== type) { + if (previousCategoryId !== categoryId || previousPostType !== postType) { setView(prevView => ({ ...prevView, page: 1 })); } - }, [categoryId, previousCategoryId, previousPostType, type]); + }, [categoryId, previousCategoryId, previousPostType, postType]); const { data, paginationInfo @@ -36211,27 +37852,27 @@ function DataviewsPatterns() { ...view }; delete viewWithoutFilters.search; - if (type !== TEMPLATE_PART_POST_TYPE) { + if (postType !== TEMPLATE_PART_POST_TYPE) { viewWithoutFilters.filters = []; } return filterSortAndPaginate(patterns, viewWithoutFilters, fields); - }, [patterns, view, fields, type]); + }, [patterns, view, fields, postType]); const dataWithPermissions = useAugmentPatternsWithPermissions(data); - const templatePartActions = page_patterns_usePostActions({ + const templatePartActions = usePostActions({ postType: TEMPLATE_PART_POST_TYPE, context: 'list' }); - const patternActions = page_patterns_usePostActions({ + const patternActions = usePostActions({ postType: PATTERN_TYPES.user, context: 'list' }); const editAction = useEditPostAction(); const actions = (0,external_wp_element_namespaceObject.useMemo)(() => { - if (type === TEMPLATE_PART_POST_TYPE) { + if (postType === TEMPLATE_PART_POST_TYPE) { return [editAction, ...templatePartActions].filter(Boolean); } return [editAction, ...patternActions].filter(Boolean); - }, [editAction, type, templatePartActions, patternActions]); + }, [editAction, postType, templatePartActions, patternActions]); const id = (0,external_wp_element_namespaceObject.useId)(); const settings = usePatternSettings(); // Wrap everything in a block editor provider. @@ -36245,7 +37886,7 @@ function DataviewsPatterns() { hideTitleFromUI: true, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PatternsHeader, { categoryId: categoryId, - type: type, + type: postType, titleId: `${id}-title`, descriptionId: `${id}-description` }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataViews, { @@ -36258,14 +37899,178 @@ function DataviewsPatterns() { return (_item$name = item.name) !== null && _item$name !== void 0 ? _item$name : item.id; }, isLoading: isResolving, + isItemClickable: item => item.type !== PATTERN_TYPES.theme, + onClickItem: item => { + history.navigate(`/${item.type}/${[PATTERN_TYPES.user, TEMPLATE_PART_POST_TYPE].includes(item.type) ? item.id : item.name}?canvas=edit`); + }, view: view, onChangeView: setView, - defaultLayouts: page_patterns_defaultLayouts + defaultLayouts: defaultLayouts }, categoryId + postType)] }) }); } +;// ./node_modules/@wordpress/edit-site/build-module/components/site-editor-routes/patterns.js +/** + * Internal dependencies + */ + + + +const patternsRoute = { + name: 'patterns', + path: '/pattern', + areas: { + sidebar: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenPatterns, { + backPath: "/" + }), + content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataviewsPatterns, {}), + mobile: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataviewsPatterns, {}) + } +}; + +;// ./node_modules/@wordpress/edit-site/build-module/components/site-editor-routes/pattern-item.js +/** + * Internal dependencies + */ + + + +const patternItemRoute = { + name: 'pattern-item', + path: '/wp_block/:postId', + areas: { + sidebar: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenPatterns, { + backPath: "/" + }), + mobile: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, {}), + preview: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, {}) + } +}; + +;// ./node_modules/@wordpress/edit-site/build-module/components/site-editor-routes/template-part-item.js +/** + * Internal dependencies + */ + + + +const templatePartItemRoute = { + name: 'template-part-item', + path: '/wp_template_part/*postId', + areas: { + sidebar: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenPatterns, { + backPath: "/" + }), + mobile: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MaybeEditor, {}), + preview: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MaybeEditor, {}) + } +}; + +;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-templates-browse/content.js +/* wp:polyfill */ +/** + * WordPress dependencies + */ + + + + + + + +/** + * Internal dependencies + */ + + + + + + +const { + useLocation: content_useLocation +} = unlock(external_wp_router_namespaceObject.privateApis); +const content_EMPTY_ARRAY = []; +function TemplateDataviewItem({ + template, + isActive +}) { + const { + text, + icon + } = useAddedBy(template.type, template.id); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationItem, { + to: (0,external_wp_url_namespaceObject.addQueryArgs)('/template', { + activeView: text + }), + icon: icon, + "aria-current": isActive, + children: text + }); +} +function DataviewsTemplatesSidebarContent() { + const { + query: { + activeView = 'all' + } + } = content_useLocation(); + const { + records + } = (0,external_wp_coreData_namespaceObject.useEntityRecords)('postType', TEMPLATE_POST_TYPE, { + per_page: -1 + }); + const firstItemPerAuthorText = (0,external_wp_element_namespaceObject.useMemo)(() => { + var _ref; + const firstItemPerAuthor = records?.reduce((acc, template) => { + const author = template.author_text; + if (author && !acc[author]) { + acc[author] = template; + } + return acc; + }, {}); + return (_ref = firstItemPerAuthor && Object.values(firstItemPerAuthor)) !== null && _ref !== void 0 ? _ref : content_EMPTY_ARRAY; + }, [records]); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalItemGroup, { + className: "edit-site-sidebar-navigation-screen-templates-browse", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationItem, { + to: "/template", + icon: library_layout, + "aria-current": activeView === 'all', + children: (0,external_wp_i18n_namespaceObject.__)('All templates') + }), firstItemPerAuthorText.map(template => { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TemplateDataviewItem, { + template: template, + isActive: activeView === template.author_text + }, template.author_text); + })] + }); +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-templates-browse/index.js +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + + +function SidebarNavigationScreenTemplatesBrowse({ + backPath +}) { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreen, { + title: (0,external_wp_i18n_namespaceObject.__)('Templates'), + description: (0,external_wp_i18n_namespaceObject.__)('Create new templates, or reset any customizations made to the templates supplied by your theme.'), + backPath: backPath, + content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataviewsTemplatesSidebarContent, {}) + }); +} + ;// ./node_modules/@wordpress/icons/build-module/library/home.js /** * WordPress dependencies @@ -36411,7 +38216,6 @@ const tag = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(extern */ - const media = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", @@ -36441,6 +38245,7 @@ const post_post = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)( /* harmony default export */ const library_post = (post_post); ;// ./node_modules/@wordpress/edit-site/build-module/components/add-new-template/utils.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -36451,7 +38256,6 @@ const post_post = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)( - /** * Internal dependencies */ @@ -36479,7 +38283,7 @@ const utils_getValueFromObjectPath = (object, path) => { * * @param {Object[]} entities The array of entities. * @param {string} path The path to map a `name` property from the entity. - * @return {IHasNameAndId[]} An array of enitities that now implement the `IHasNameAndId` interface. + * @return {IHasNameAndId[]} An array of entities that now implement the `IHasNameAndId` interface. */ const mapToIHasNameAndId = (entities, path) => { return (entities || []).map(entity => ({ @@ -36500,7 +38304,7 @@ const useExistingTemplates = () => { }), []); }; const useDefaultTemplateTypes = () => { - return (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_editor_namespaceObject.store).__experimentalGetDefaultTemplateTypes(), []); + return (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getEntityRecord('root', '__unstableBase')?.default_template_types || [], []); }; const usePublicPostTypes = () => { const postTypes = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getPostTypes({ @@ -37012,6 +38816,7 @@ const useEntitiesInfo = (entityName, templatePrefixes, additionalQueryParameters }; ;// ./node_modules/@wordpress/edit-site/build-module/components/add-new-template/add-custom-template-modal-content.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -37027,8 +38832,6 @@ const useEntitiesInfo = (entityName, templatePrefixes, additionalQueryParameters */ - - const add_custom_template_modal_content_EMPTY_ARRAY = []; function SuggestionListItem({ suggestion, @@ -37483,10 +39286,19 @@ var __setModuleDefault = Object.create ? (function(o, v) { o["default"] = v; }; +var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); +}; + function __importStar(mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); __setModuleDefault(result, mod); return result; } @@ -37567,12 +39379,25 @@ function __disposeResources(env) { return next(); } +function __rewriteRelativeImportExtension(path, preserveJsx) { + if (typeof path === "string" && /^\.\.?\//.test(path)) { + return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) { + return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js"); + }); + } + return path; +} + /* harmony default export */ const tslib_es6 = ({ __extends, __assign, __rest, __decorate, __param, + __esDecorate, + __runInitializers, + __propKey, + __setFunctionName, __metadata, __awaiter, __generator, @@ -37595,6 +39420,7 @@ function __disposeResources(env) { __classPrivateFieldIn, __addDisposableResource, __disposeResources, + __rewriteRelativeImportExtension, }); ;// ./node_modules/lower-case/dist.es2015/index.js @@ -37707,7 +39533,6 @@ function paramCase(input, options) { - function AddCustomGenericTemplateModalContent({ onClose, createTemplate @@ -37768,6 +39593,7 @@ function AddCustomGenericTemplateModalContent({ /* harmony default export */ const add_custom_generic_template_modal_content = (AddCustomGenericTemplateModalContent); ;// ./node_modules/@wordpress/edit-site/build-module/components/add-new-template/index.js +/* wp:polyfill */ /** * External dependencies */ @@ -37800,8 +39626,6 @@ function AddCustomGenericTemplateModalContent({ - - const { useHistory: add_new_template_useHistory } = unlock(external_wp_router_namespaceObject.privateApis); @@ -37921,11 +39745,7 @@ function NewTemplateModal({ }); // Navigate to the created template editor. - history.push({ - postId: newTemplate.id, - postType: TEMPLATE_POST_TYPE, - canvas: 'edit' - }); + history.navigate(`/${TEMPLATE_POST_TYPE}/${newTemplate.id}?canvas=edit`); createSuccessNotice((0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: Title of the created post or template, e.g: "Hello world". (0,external_wp_i18n_namespaceObject.__)('"%s" successfully created.'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(newTemplate.title?.rendered || title)), { @@ -38105,9 +39925,6 @@ function useMissingTemplates(setEntityForSuggestions, onClick) { - - - const { useGlobalStyle: page_templates_fields_useGlobalStyle } = unlock(external_wp_blockEditor_namespaceObject.privateApis); @@ -38119,13 +39936,6 @@ function fields_PreviewField({ const blocks = (0,external_wp_element_namespaceObject.useMemo)(() => { return (0,external_wp_blocks_namespaceObject.parse)(item.content.raw); }, [item.content.raw]); - const { - onClick - } = useLink({ - postId: item.id, - postType: item.type, - canvas: 'edit' - }); const isEmpty = !blocks?.length; // Wrap everything in a block editor provider to ensure 'styles' that are needed // for the previews are synced between the site editor store and the block editor store. @@ -38137,22 +39947,16 @@ function fields_PreviewField({ return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.EditorProvider, { post: item, settings: settings, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "page-templates-preview-field", style: { backgroundColor }, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("button", { - className: "page-templates-preview-field__button", - type: "button", - onClick: onClick, - "aria-label": item.title?.rendered || item.title, - children: [isEmpty && (0,external_wp_i18n_namespaceObject.__)('Empty template'), !isEmpty && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Async, { - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockPreview, { - blocks: blocks - }) - })] - }) + children: [isEmpty && (0,external_wp_i18n_namespaceObject.__)('Empty template'), !isEmpty && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockPreview.Async, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockPreview, { + blocks: blocks + }) + })] }) }); } @@ -38162,31 +39966,6 @@ const fields_previewField = { render: fields_PreviewField, enableSorting: false }; -function fields_TitleField({ - item -}) { - const linkProps = { - params: { - postId: item.id, - postType: item.type, - canvas: 'edit' - } - }; - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Link, { - ...linkProps, - children: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(item.title?.rendered) || (0,external_wp_i18n_namespaceObject.__)('(no title)') - }); -} -const fields_titleField = { - label: (0,external_wp_i18n_namespaceObject.__)('Template'), - id: 'title', - getValue: ({ - item - }) => item.title?.rendered, - render: fields_TitleField, - enableHiding: false, - enableGlobalSearch: true -}; const descriptionField = { label: (0,external_wp_i18n_namespaceObject.__)('Description'), id: 'description', @@ -38243,6 +40022,7 @@ const authorField = { }; ;// ./node_modules/@wordpress/edit-site/build-module/components/page-templates/index.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -38253,6 +40033,7 @@ const authorField = { + /** * Internal dependencies */ @@ -38263,36 +40044,24 @@ const authorField = { + const { - usePostActions: page_templates_usePostActions + usePostActions: page_templates_usePostActions, + templateTitleField } = unlock(external_wp_editor_namespaceObject.privateApis); const { useHistory: page_templates_useHistory, useLocation: page_templates_useLocation } = unlock(external_wp_router_namespaceObject.privateApis); const { - useEntityRecordsWithPermissions: page_templates_useEntityRecordsWithPermissions + useEntityRecordsWithPermissions } = unlock(external_wp_coreData_namespaceObject.privateApis); const page_templates_EMPTY_ARRAY = []; const page_templates_defaultLayouts = { [LAYOUT_TABLE]: { - fields: ['template', 'author'], + showMedia: false, layout: { - primaryField: 'title', - combinedFields: [{ - id: 'template', - label: (0,external_wp_i18n_namespaceObject.__)('Template'), - children: ['title', 'description'], - direction: 'vertical' - }], styles: { - template: { - maxWidth: 400, - minWidth: 320 - }, - preview: { - width: '1%' - }, author: { width: '1%' } @@ -38300,19 +40069,10 @@ const page_templates_defaultLayouts = { } }, [LAYOUT_GRID]: { - fields: ['title', 'description', 'author'], - layout: { - mediaField: 'preview', - primaryField: 'title', - columnFields: ['description'] - } + showMedia: true }, [LAYOUT_LIST]: { - fields: ['title', 'description', 'author'], - layout: { - primaryField: 'title', - mediaField: 'preview' - } + showMedia: false } }; const page_templates_DEFAULT_VIEW = { @@ -38324,35 +40084,48 @@ const page_templates_DEFAULT_VIEW = { field: 'title', direction: 'asc' }, - fields: page_templates_defaultLayouts[LAYOUT_GRID].fields, - layout: page_templates_defaultLayouts[LAYOUT_GRID].layout, - filters: [] + titleField: 'title', + descriptionField: 'description', + mediaField: 'preview', + fields: ['author'], + filters: [], + ...page_templates_defaultLayouts[LAYOUT_GRID] }; function PageTemplates() { const { - params + path, + query } = page_templates_useLocation(); const { activeView = 'all', layout, postId - } = params; + } = query; const [selection, setSelection] = (0,external_wp_element_namespaceObject.useState)([postId]); const defaultView = (0,external_wp_element_namespaceObject.useMemo)(() => { const usedType = layout !== null && layout !== void 0 ? layout : page_templates_DEFAULT_VIEW.type; return { ...page_templates_DEFAULT_VIEW, type: usedType, - layout: page_templates_defaultLayouts[usedType].layout, - fields: page_templates_defaultLayouts[usedType].fields, filters: activeView !== 'all' ? [{ field: 'author', operator: 'isAny', value: [activeView] - }] : [] + }] : [], + ...page_templates_defaultLayouts[usedType] }; }, [layout, activeView]); const [view, setView] = (0,external_wp_element_namespaceObject.useState)(defaultView); + + // Sync the layout from the URL to the view state. + (0,external_wp_element_namespaceObject.useEffect)(() => { + setView(currentView => ({ + ...currentView, + type: layout !== null && layout !== void 0 ? layout : page_templates_DEFAULT_VIEW.type + })); + }, [setView, layout]); + + // Sync the active view from the URL to the view state. (0,external_wp_element_namespaceObject.useEffect)(() => { setView(currentView => ({ ...currentView, @@ -38362,23 +40135,22 @@ function PageTemplates() { value: [activeView] }] : [] })); - }, [activeView]); + }, [setView, activeView]); const { records, isResolving: isLoadingData - } = page_templates_useEntityRecordsWithPermissions('postType', TEMPLATE_POST_TYPE, { + } = useEntityRecordsWithPermissions('postType', TEMPLATE_POST_TYPE, { per_page: -1 }); const history = page_templates_useHistory(); const onChangeSelection = (0,external_wp_element_namespaceObject.useCallback)(items => { setSelection(items); if (view?.type === LAYOUT_LIST) { - history.push({ - ...params, + history.navigate((0,external_wp_url_namespaceObject.addQueryArgs)(path, { postId: items.length === 1 ? items[0] : undefined - }); + })); } - }, [history, params, view?.type]); + }, [history, path, view?.type]); const authors = (0,external_wp_element_namespaceObject.useMemo)(() => { if (!records) { return page_templates_EMPTY_ARRAY; @@ -38392,7 +40164,7 @@ function PageTemplates() { label: author })); }, [records]); - const fields = (0,external_wp_element_namespaceObject.useMemo)(() => [fields_previewField, fields_titleField, descriptionField, { + const fields = (0,external_wp_element_namespaceObject.useMemo)(() => [fields_previewField, templateTitleField, descriptionField, { ...authorField, elements: authors }], [authors]); @@ -38408,15 +40180,14 @@ function PageTemplates() { }); const editAction = useEditPostAction(); const actions = (0,external_wp_element_namespaceObject.useMemo)(() => [editAction, ...postTypeActions], [postTypeActions, editAction]); - const onChangeView = (0,external_wp_element_namespaceObject.useCallback)(newView => { - if (newView.type !== view.type) { - history.push({ - ...params, - layout: newView.type - }); - } + const onChangeView = (0,external_wp_compose_namespaceObject.useEvent)(newView => { setView(newView); - }, [view.type, setView, history, params]); + if (newView.type !== layout) { + history.navigate((0,external_wp_url_namespaceObject.addQueryArgs)(path, { + layout: newView.type + })); + } + }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Page, { className: "edit-site-page-templates", title: (0,external_wp_i18n_namespaceObject.__)('Templates'), @@ -38430,48 +40201,19 @@ function PageTemplates() { view: view, onChangeView: onChangeView, onChangeSelection: onChangeSelection, + isItemClickable: () => true, + onClickItem: ({ + id + }) => { + history.navigate(`/wp_template/${id}?canvas=edit`); + }, selection: selection, defaultLayouts: page_templates_defaultLayouts }, activeView) }); } -;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-button/index.js -/** - * External dependencies - */ - - -/** - * WordPress dependencies - */ - - -function SidebarButton(props) { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - size: "compact", - ...props, - className: dist_clsx('edit-site-sidebar-button', props.className) - }); -} - -;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen/index.js -/** - * External dependencies - */ - - -/** - * WordPress dependencies - */ - - - - - - - - +;// ./node_modules/@wordpress/edit-site/build-module/components/site-editor-routes/templates.js /** * Internal dependencies */ @@ -38479,1536 +40221,292 @@ function SidebarButton(props) { - - - - -const { - useHistory: sidebar_navigation_screen_useHistory, - useLocation: sidebar_navigation_screen_useLocation -} = unlock(external_wp_router_namespaceObject.privateApis); -function SidebarNavigationScreen({ - isRoot, - title, - actions, - meta, - content, - footer, - description, - backPath: backPathProp -}) { - const { - dashboardLink, - dashboardLinkText, - previewingThemeName - } = (0,external_wp_data_namespaceObject.useSelect)(select => { - const { - getSettings - } = unlock(select(store)); - const currentlyPreviewingThemeId = currentlyPreviewingTheme(); - return { - dashboardLink: getSettings().__experimentalDashboardLink, - dashboardLinkText: getSettings().__experimentalDashboardLinkText, - // Do not call `getTheme` with null, it will cause a request to - // the server. - previewingThemeName: currentlyPreviewingThemeId ? select(external_wp_coreData_namespaceObject.store).getTheme(currentlyPreviewingThemeId)?.name?.rendered : undefined - }; - }, []); - const location = sidebar_navigation_screen_useLocation(); - const history = sidebar_navigation_screen_useHistory(); - const { - navigate - } = (0,external_wp_element_namespaceObject.useContext)(SidebarNavigationContext); - const backPath = backPathProp !== null && backPathProp !== void 0 ? backPathProp : location.state?.backPath; - const icon = (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_right : chevron_left; - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { - className: dist_clsx('edit-site-sidebar-navigation-screen__main', { - 'has-footer': !!footer - }), - spacing: 0, - justify: "flex-start", - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { - spacing: 3, - alignment: "flex-start", - className: "edit-site-sidebar-navigation-screen__title-icon", - children: [!isRoot && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarButton, { - onClick: () => { - history.push(backPath); - navigate('back'); - }, - icon: icon, - label: (0,external_wp_i18n_namespaceObject.__)('Back'), - showTooltip: false - }), isRoot && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarButton, { - icon: icon, - label: dashboardLinkText || (0,external_wp_i18n_namespaceObject.__)('Go to the Dashboard'), - href: dashboardLink || 'index.php' - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHeading, { - className: "edit-site-sidebar-navigation-screen__title", - color: '#e0e0e0' /* $gray-200 */, - level: 1, - size: 20, - children: !isPreviewingTheme() ? title : (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: 1: theme name. 2: title */ - (0,external_wp_i18n_namespaceObject.__)('Previewing %1$s: %2$s'), previewingThemeName, title) - }), actions && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { - className: "edit-site-sidebar-navigation-screen__actions", - children: actions - })] - }), meta && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { - className: "edit-site-sidebar-navigation-screen__meta", - children: meta - }) - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { - className: "edit-site-sidebar-navigation-screen__content", - children: [description && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { - className: "edit-site-sidebar-navigation-screen__description", - children: description - }), content] - })] - }), footer && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("footer", { - className: "edit-site-sidebar-navigation-screen__footer", - children: footer - })] - }); -} - -;// ./node_modules/@wordpress/icons/build-module/library/chevron-left-small.js -/** - * WordPress dependencies - */ - - -const chevronLeftSmall = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - d: "m13.1 16-3.4-4 3.4-4 1.1 1-2.6 3 2.6 3-1.1 1z" - }) -}); -/* harmony default export */ const chevron_left_small = (chevronLeftSmall); - -;// ./node_modules/@wordpress/icons/build-module/library/chevron-right-small.js -/** - * WordPress dependencies - */ - - -const chevronRightSmall = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - d: "M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z" - }) -}); -/* harmony default export */ const chevron_right_small = (chevronRightSmall); - -;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-item/index.js -/** - * External dependencies - */ - - -/** - * WordPress dependencies - */ - - - - - - -/** - * Internal dependencies - */ - - - - -const { - useHistory: sidebar_navigation_item_useHistory -} = unlock(external_wp_router_namespaceObject.privateApis); -function SidebarNavigationItem({ - className, - icon, - withChevron = false, - suffix, - uid, - params, - onClick, - children, - ...props -}) { - const history = sidebar_navigation_item_useHistory(); - const { - navigate - } = (0,external_wp_element_namespaceObject.useContext)(SidebarNavigationContext); - // If there is no custom click handler, create one that navigates to `params`. - function handleClick(e) { - if (onClick) { - onClick(e); - navigate('forward'); - } else if (params) { - e.preventDefault(); - history.push(params); - navigate('forward', `[id="${uid}"]`); - } - } - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalItem, { - className: dist_clsx('edit-site-sidebar-navigation-item', { - 'with-suffix': !withChevron && suffix - }, className), - onClick: handleClick, - id: uid, - ...props, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { - justify: "flex-start", - children: [icon && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, { - style: { - fill: 'currentcolor' - }, - icon: icon, - size: 24 - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexBlock, { - children: children - }), withChevron && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, { - icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_left_small : chevron_right_small, - className: "edit-site-sidebar-navigation-item__drilldown-indicator", - size: 24 - }), !withChevron && suffix] - }) - }); -} - -;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js -/** - * WordPress dependencies - */ - - -function SidebarNavigationScreenDetailsPanelLabel({ - children -}) { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { - className: "edit-site-sidebar-navigation-details-screen-panel__label", - children: children - }); -} - -;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js -/** - * External dependencies - */ - - -/** - * WordPress dependencies - */ - - -function SidebarNavigationScreenDetailsPanelRow({ - label, - children, - className, - ...extraProps -}) { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHStack, { - spacing: 5, - alignment: "left", - className: dist_clsx('edit-site-sidebar-navigation-details-screen-panel__row', className), - ...extraProps, - children: children - }, label); -} - -;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js -/** - * WordPress dependencies - */ - - -function SidebarNavigationScreenDetailsPanelValue({ - children -}) { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { - className: "edit-site-sidebar-navigation-details-screen-panel__value", - children: children - }); -} - -;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-details-panel/index.js -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - - - - - -function SidebarNavigationScreenDetailsPanel({ - title, - children, - spacing -}) { - return /*#__PURE__*/_jsxs(VStack, { - className: "edit-site-sidebar-navigation-details-screen-panel", - spacing: spacing, - children: [title && /*#__PURE__*/_jsx(Heading, { - className: "edit-site-sidebar-navigation-details-screen-panel__heading", - level: 2, - children: title - }), children] - }); -} - - -;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-details-footer/index.js -/** - * WordPress dependencies - */ - - - - - - - -/** - * Internal dependencies - */ - - - - -function SidebarNavigationScreenDetailsFooter({ - record, - ...otherProps -}) { - var _record$_links$predec, _record$_links$versio; - /* - * There might be other items in the future, - * but for now it's just modified date. - * Later we might render a list of items and isolate - * the following logic. - */ - const hrefProps = {}; - const lastRevisionId = (_record$_links$predec = record?._links?.['predecessor-version']?.[0]?.id) !== null && _record$_links$predec !== void 0 ? _record$_links$predec : null; - const revisionsCount = (_record$_links$versio = record?._links?.['version-history']?.[0]?.count) !== null && _record$_links$versio !== void 0 ? _record$_links$versio : 0; - // Enable the revisions link if there is a last revision and there are more than one revisions. - if (lastRevisionId && revisionsCount > 1) { - hrefProps.href = (0,external_wp_url_namespaceObject.addQueryArgs)('revision.php', { - revision: record?._links['predecessor-version'][0].id - }); - hrefProps.as = 'a'; - } - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalItemGroup, { - className: "edit-site-sidebar-navigation-screen-details-footer", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationItem, { - "aria-label": (0,external_wp_i18n_namespaceObject.__)('Revisions'), - ...hrefProps, - ...otherProps, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(SidebarNavigationScreenDetailsPanelRow, { - justify: "space-between", - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenDetailsPanelLabel, { - children: (0,external_wp_i18n_namespaceObject.__)('Last modified') - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenDetailsPanelValue, { - children: (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: is the relative time when the post was last modified. */ - (0,external_wp_i18n_namespaceObject.__)(''), (0,external_wp_date_namespaceObject.humanTimeDiff)(record.modified)), { - time: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("time", { - dateTime: record.modified - }) - }) - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { - className: "edit-site-sidebar-navigation-screen-details-footer__icon", - icon: library_backup - })] - }) - }) - }); -} - -;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-global-styles/index.js -/** - * WordPress dependencies - */ - - - - - - - - - -/** - * Internal dependencies - */ - - - - - - - - - - - - -function SidebarNavigationItemGlobalStyles(props) { - const { - openGeneralSidebar - } = (0,external_wp_data_namespaceObject.useDispatch)(store); - const { - setCanvasMode - } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store)); - const hasGlobalStyleVariations = (0,external_wp_data_namespaceObject.useSelect)(select => !!select(external_wp_coreData_namespaceObject.store).__experimentalGetCurrentThemeGlobalStylesVariations()?.length, []); - if (hasGlobalStyleVariations) { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationItem, { - ...props, - params: { - path: '/wp_global_styles' - }, - uid: "global-styles-navigation-item" - }); - } - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationItem, { - ...props, - onClick: () => { - // Switch to edit mode. - setCanvasMode('edit'); - // Open global styles sidebar. - openGeneralSidebar('edit-site/global-styles'); - } - }); -} -function SidebarNavigationScreenGlobalStyles({ - backPath -}) { - const { - revisions, - isLoading: isLoadingRevisions - } = useGlobalStylesRevisions(); - const { - openGeneralSidebar - } = (0,external_wp_data_namespaceObject.useDispatch)(store); - const { - setIsListViewOpened - } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_editor_namespaceObject.store); - const isMobileViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<'); - const { - setCanvasMode, - setEditorCanvasContainerView - } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store)); - const { - isViewMode, - isStyleBookOpened, - revisionsCount - } = (0,external_wp_data_namespaceObject.useSelect)(select => { - var _globalStyles$_links$; - const { - getCanvasMode, - getEditorCanvasContainerView - } = unlock(select(store)); - const { - getEntityRecord, - __experimentalGetCurrentGlobalStylesId - } = select(external_wp_coreData_namespaceObject.store); - const globalStylesId = __experimentalGetCurrentGlobalStylesId(); - const globalStyles = globalStylesId ? getEntityRecord('root', 'globalStyles', globalStylesId) : undefined; - return { - isViewMode: 'view' === getCanvasMode(), - isStyleBookOpened: 'style-book' === getEditorCanvasContainerView(), - revisionsCount: (_globalStyles$_links$ = globalStyles?._links?.['version-history']?.[0]?.count) !== null && _globalStyles$_links$ !== void 0 ? _globalStyles$_links$ : 0 - }; - }, []); - const { - set: setPreference - } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_preferences_namespaceObject.store); - const openGlobalStyles = (0,external_wp_element_namespaceObject.useCallback)(async () => { - return Promise.all([setPreference('core', 'distractionFree', false), setCanvasMode('edit'), openGeneralSidebar('edit-site/global-styles')]); - }, [setCanvasMode, openGeneralSidebar, setPreference]); - const openStyleBook = (0,external_wp_element_namespaceObject.useCallback)(async () => { - await openGlobalStyles(); - // Open the Style Book once the canvas mode is set to edit, - // and the global styles sidebar is open. This ensures that - // the Style Book is not prematurely closed. - setEditorCanvasContainerView('style-book'); - setIsListViewOpened(false); - }, [openGlobalStyles, setEditorCanvasContainerView, setIsListViewOpened]); - const openRevisions = (0,external_wp_element_namespaceObject.useCallback)(async () => { - await openGlobalStyles(); - // Open the global styles revisions once the canvas mode is set to edit, - // and the global styles sidebar is open. The global styles UI is responsible - // for redirecting to the revisions screen once the editor canvas container - // has been set to 'global-styles-revisions'. - setEditorCanvasContainerView('global-styles-revisions'); - }, [openGlobalStyles, setEditorCanvasContainerView]); - - // If there are no revisions, do not render a footer. - const hasRevisions = revisionsCount > 0; - const modifiedDateTime = revisions?.[0]?.modified; - const shouldShowGlobalStylesFooter = hasRevisions && !isLoadingRevisions && modifiedDateTime; - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreen, { - title: (0,external_wp_i18n_namespaceObject.__)('Styles'), - description: (0,external_wp_i18n_namespaceObject.__)('Choose a different style combination for the theme styles.'), - backPath: backPath, - content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenGlobalStylesContent, {}), - footer: shouldShowGlobalStylesFooter && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenDetailsFooter, { - record: revisions?.[0], - onClick: openRevisions - }), - actions: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: [!isMobileViewport && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarButton, { - icon: library_seen, - label: (0,external_wp_i18n_namespaceObject.__)('Style Book'), - onClick: () => setEditorCanvasContainerView(!isStyleBookOpened ? 'style-book' : undefined), - isPressed: isStyleBookOpened - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarButton, { - icon: edit, - label: (0,external_wp_i18n_namespaceObject.__)('Edit styles'), - onClick: async () => await openGlobalStyles() - })] - }) - }), isStyleBookOpened && !isMobileViewport && isViewMode && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(style_book, { - enableResizing: false, - isSelected: () => false, - onClick: openStyleBook, - onSelect: openStyleBook, - showCloseButton: false, - showTabs: false - })] - }); -} - -;// ./node_modules/@wordpress/icons/build-module/library/navigation.js -/** - * WordPress dependencies - */ - - -const navigation = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - viewBox: "0 0 24 24", - xmlns: "http://www.w3.org/2000/svg", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - d: "M12 4c-4.4 0-8 3.6-8 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8zm0 14.5c-3.6 0-6.5-2.9-6.5-6.5S8.4 5.5 12 5.5s6.5 2.9 6.5 6.5-2.9 6.5-6.5 6.5zM9 16l4.5-3L15 8.4l-4.5 3L9 16z" - }) -}); -/* harmony default export */ const library_navigation = (navigation); - -;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-main/index.js -/** - * WordPress dependencies - */ - - - - - - -/** - * Internal dependencies - */ - - - - - - - - - -function SidebarNavigationScreenMain() { - const { - setEditorCanvasContainerView - } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store)); - - // Clear the editor canvas container view when accessing the main navigation screen. - (0,external_wp_element_namespaceObject.useEffect)(() => { - setEditorCanvasContainerView(undefined); - }, [setEditorCanvasContainerView]); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreen, { - isRoot: true, - title: (0,external_wp_i18n_namespaceObject.__)('Design'), - description: (0,external_wp_i18n_namespaceObject.__)('Customize the appearance of your website using the block editor.'), - content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalItemGroup, { - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationItem, { - uid: "navigation-navigation-item", - params: { - postType: NAVIGATION_POST_TYPE - }, - withChevron: true, - icon: library_navigation, - children: (0,external_wp_i18n_namespaceObject.__)('Navigation') - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationItemGlobalStyles, { - uid: "styles-navigation-item", - withChevron: true, - icon: library_styles, - children: (0,external_wp_i18n_namespaceObject.__)('Styles') - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationItem, { - uid: "page-navigation-item", - params: { - postType: 'page' - }, - withChevron: true, - icon: library_page, - children: (0,external_wp_i18n_namespaceObject.__)('Pages') - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationItem, { - uid: "template-navigation-item", - params: { - postType: TEMPLATE_POST_TYPE - }, - withChevron: true, - icon: library_layout, - children: (0,external_wp_i18n_namespaceObject.__)('Templates') - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationItem, { - uid: "patterns-navigation-item", - params: { - postType: PATTERN_TYPES.user - }, - withChevron: true, - icon: library_symbol, - children: (0,external_wp_i18n_namespaceObject.__)('Patterns') - })] - }) - }) - }); -} - -;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js -// This requested is preloaded in `gutenberg_preload_navigation_posts`. -// As unbounded queries are limited to 100 by `fetchAllMiddleware` -// on apiFetch this query is limited to 100. -// These parameters must be kept aligned with those in -// lib/compat/wordpress-6.3/navigation-block-preloading.php -// and -// block-library/src/navigation/constants.js -const PRELOADED_NAVIGATION_MENUS_QUERY = { - per_page: 100, - status: ['publish', 'draft'], - order: 'desc', - orderby: 'date' -}; - -;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js -/** - * WordPress dependencies - */ - - - - - -const notEmptyString = testString => testString?.trim()?.length > 0; -function rename_modal_RenameModal({ - menuTitle, - onClose, - onSave -}) { - const [editedMenuTitle, setEditedMenuTitle] = (0,external_wp_element_namespaceObject.useState)(menuTitle); - const titleHasChanged = editedMenuTitle !== menuTitle; - const isEditedMenuTitleValid = titleHasChanged && notEmptyString(editedMenuTitle); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Modal, { - title: (0,external_wp_i18n_namespaceObject.__)('Rename'), - onRequestClose: onClose, - focusOnMount: "firstContentElement", - size: "small", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("form", { - className: "sidebar-navigation__rename-modal-form", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { - spacing: "3", - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { - __nextHasNoMarginBottom: true, - __next40pxDefaultSize: true, - value: editedMenuTitle, - placeholder: (0,external_wp_i18n_namespaceObject.__)('Navigation title'), - onChange: setEditedMenuTitle, - label: (0,external_wp_i18n_namespaceObject.__)('Name') - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { - justify: "right", - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - __next40pxDefaultSize: true, - variant: "tertiary", - onClick: onClose, - children: (0,external_wp_i18n_namespaceObject.__)('Cancel') - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - __next40pxDefaultSize: true, - accessibleWhenDisabled: true, - disabled: !isEditedMenuTitleValid, - variant: "primary", - type: "submit", - onClick: e => { - e.preventDefault(); - if (!isEditedMenuTitleValid) { - return; - } - onSave({ - title: editedMenuTitle - }); - - // Immediate close avoids ability to hit save multiple times. - onClose(); - }, - children: (0,external_wp_i18n_namespaceObject.__)('Save') - })] - })] - }) - }) - }); -} - -;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js -/** - * WordPress dependencies - */ - - - -function DeleteConfirmDialog({ - onClose, - onConfirm -}) { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalConfirmDialog, { - isOpen: true, - onConfirm: () => { - onConfirm(); - - // Immediate close avoids ability to hit delete multiple times. - onClose(); - }, - onCancel: onClose, - confirmButtonText: (0,external_wp_i18n_namespaceObject.__)('Delete'), - size: "medium", - children: (0,external_wp_i18n_namespaceObject.__)('Are you sure you want to delete this Navigation Menu?') - }); -} - -;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js -/** - * WordPress dependencies - */ - - - - - - -/** - * Internal dependencies - */ - - - - - - -const { - useHistory: more_menu_useHistory -} = unlock(external_wp_router_namespaceObject.privateApis); -const POPOVER_PROPS = { - position: 'bottom right' -}; -function ScreenNavigationMoreMenu(props) { - const { - onDelete, - onSave, - onDuplicate, - menuTitle, - menuId - } = props; - const [renameModalOpen, setRenameModalOpen] = (0,external_wp_element_namespaceObject.useState)(false); - const [deleteConfirmDialogOpen, setDeleteConfirmDialogOpen] = (0,external_wp_element_namespaceObject.useState)(false); - const history = more_menu_useHistory(); - const closeModals = () => { - setRenameModalOpen(false); - setDeleteConfirmDialogOpen(false); - }; - const openRenameModal = () => setRenameModalOpen(true); - const openDeleteConfirmDialog = () => setDeleteConfirmDialogOpen(true); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.DropdownMenu, { - className: "sidebar-navigation__more-menu", - label: (0,external_wp_i18n_namespaceObject.__)('Actions'), - icon: more_vertical, - popoverProps: POPOVER_PROPS, - children: ({ - onClose - }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.MenuGroup, { - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { - onClick: () => { - openRenameModal(); - // Close the dropdown after opening the modal. - onClose(); - }, - children: (0,external_wp_i18n_namespaceObject.__)('Rename') - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { - onClick: () => { - history.push({ - postId: menuId, - postType: 'wp_navigation', - canvas: 'edit' - }); - }, - children: (0,external_wp_i18n_namespaceObject.__)('Edit') - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { - onClick: () => { - onDuplicate(); - onClose(); - }, - children: (0,external_wp_i18n_namespaceObject.__)('Duplicate') - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { - isDestructive: true, - onClick: () => { - openDeleteConfirmDialog(); - - // Close the dropdown after opening the modal. - onClose(); - }, - children: (0,external_wp_i18n_namespaceObject.__)('Delete') - })] - }) - }) - }), deleteConfirmDialogOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DeleteConfirmDialog, { - onClose: closeModals, - onConfirm: onDelete - }), renameModalOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(rename_modal_RenameModal, { - onClose: closeModals, - menuTitle: menuTitle, - onSave: onSave - })] - }); -} - -;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js -/** - * WordPress dependencies - */ - - - - - - - - -const leaf_more_menu_POPOVER_PROPS = { - className: 'block-editor-block-settings-menu__popover', - placement: 'bottom-start' -}; - -/** - * Internal dependencies - */ - - - - -const { - useHistory: leaf_more_menu_useHistory -} = unlock(external_wp_router_namespaceObject.privateApis); -function LeafMoreMenu(props) { - const history = leaf_more_menu_useHistory(); - const { - block - } = props; - const { - clientId - } = block; - const { - moveBlocksDown, - moveBlocksUp, - removeBlocks - } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); - const removeLabel = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: block name */ - (0,external_wp_i18n_namespaceObject.__)('Remove %s'), (0,external_wp_blockEditor_namespaceObject.BlockTitle)({ - clientId, - maximumLength: 25 - })); - const goToLabel = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: block name */ - (0,external_wp_i18n_namespaceObject.__)('Go to %s'), (0,external_wp_blockEditor_namespaceObject.BlockTitle)({ - clientId, - maximumLength: 25 - })); - const rootClientId = (0,external_wp_data_namespaceObject.useSelect)(select => { - const { - getBlockRootClientId - } = select(external_wp_blockEditor_namespaceObject.store); - return getBlockRootClientId(clientId); - }, [clientId]); - const onGoToPage = (0,external_wp_element_namespaceObject.useCallback)(selectedBlock => { - const { - attributes, - name - } = selectedBlock; - if (attributes.kind === 'post-type' && attributes.id && attributes.type && history) { - const { - params - } = history.getLocationWithParams(); - history.push({ - postType: attributes.type, - postId: attributes.id, - canvas: 'edit' - }, { - backPath: params - }); - } - if (name === 'core/page-list-item' && attributes.id && history) { - const { - params - } = history.getLocationWithParams(); - history.push({ - postType: 'page', - postId: attributes.id, - canvas: 'edit' - }, { - backPath: params - }); - } - }, [history]); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.DropdownMenu, { - icon: more_vertical, - label: (0,external_wp_i18n_namespaceObject.__)('Options'), - className: "block-editor-block-settings-menu", - popoverProps: leaf_more_menu_POPOVER_PROPS, - noIcons: true, - ...props, - children: ({ - onClose - }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.MenuGroup, { - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { - icon: chevron_up, - onClick: () => { - moveBlocksUp([clientId], rootClientId); - onClose(); - }, - children: (0,external_wp_i18n_namespaceObject.__)('Move up') - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { - icon: chevron_down, - onClick: () => { - moveBlocksDown([clientId], rootClientId); - onClose(); - }, - children: (0,external_wp_i18n_namespaceObject.__)('Move down') - }), block.attributes?.type === 'page' && block.attributes?.id && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { - onClick: () => { - onGoToPage(block); - onClose(); - }, - children: goToLabel - })] - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, { - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { - onClick: () => { - removeBlocks([clientId], false); - onClose(); - }, - children: removeLabel - }) - })] - }) - }); -} - -;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js -/** - * WordPress dependencies - */ - - - - - - -/** - * Internal dependencies - */ - - - - - -const { - PrivateListView -} = unlock(external_wp_blockEditor_namespaceObject.privateApis); - -// Needs to be kept in sync with the query used at packages/block-library/src/page-list/edit.js. -const MAX_PAGE_COUNT = 100; -const PAGES_QUERY = ['postType', 'page', { - per_page: MAX_PAGE_COUNT, - _fields: ['id', 'link', 'menu_order', 'parent', 'title', 'type'], - // TODO: When https://core.trac.wordpress.org/ticket/39037 REST API support for multiple orderby - // values is resolved, update 'orderby' to [ 'menu_order', 'post_title' ] to provide a consistent - // sort. - orderby: 'menu_order', - order: 'asc' -}]; -function NavigationMenuContent({ - rootClientId -}) { - const { - listViewRootClientId, - isLoading - } = (0,external_wp_data_namespaceObject.useSelect)(select => { - const { - areInnerBlocksControlled, - getBlockName, - getBlockCount, - getBlockOrder - } = select(external_wp_blockEditor_namespaceObject.store); - const { - isResolving - } = select(external_wp_coreData_namespaceObject.store); - const blockClientIds = getBlockOrder(rootClientId); - const hasOnlyPageListBlock = blockClientIds.length === 1 && getBlockName(blockClientIds[0]) === 'core/page-list'; - const pageListHasBlocks = hasOnlyPageListBlock && getBlockCount(blockClientIds[0]) > 0; - const isLoadingPages = isResolving('getEntityRecords', PAGES_QUERY); - return { - listViewRootClientId: pageListHasBlocks ? blockClientIds[0] : rootClientId, - // This is a small hack to wait for the navigation block - // to actually load its inner blocks. - isLoading: !areInnerBlocksControlled(rootClientId) || isLoadingPages - }; - }, [rootClientId]); - const { - replaceBlock, - __unstableMarkNextChangeAsNotPersistent - } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); - const offCanvasOnselect = (0,external_wp_element_namespaceObject.useCallback)(block => { - if (block.name === 'core/navigation-link' && !block.attributes.url) { - __unstableMarkNextChangeAsNotPersistent(); - replaceBlock(block.clientId, (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link', block.attributes)); - } - }, [__unstableMarkNextChangeAsNotPersistent, replaceBlock]); - - // The hidden block is needed because it makes block edit side effects trigger. - // For example a navigation page list load its items has an effect on edit to load its items. - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: [!isLoading && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PrivateListView, { - rootClientId: listViewRootClientId, - onSelect: offCanvasOnselect, - blockSettingsMenu: LeafMoreMenu, - showAppender: false - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { - className: "edit-site-sidebar-navigation-screen-navigation-menus__helper-block-editor", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockList, {}) - })] - }); -} - -;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js -/** - * WordPress dependencies - */ - - - - - -/** - * Internal dependencies - */ - - - - -const navigation_menu_editor_noop = () => {}; -function NavigationMenuEditor({ - navigationMenuId -}) { - const { - storedSettings - } = (0,external_wp_data_namespaceObject.useSelect)(select => { - const { - getSettings - } = unlock(select(store)); - return { - storedSettings: getSettings() - }; - }, []); - const blocks = (0,external_wp_element_namespaceObject.useMemo)(() => { - if (!navigationMenuId) { - return []; - } - return [(0,external_wp_blocks_namespaceObject.createBlock)('core/navigation', { - ref: navigationMenuId - })]; - }, [navigationMenuId]); - if (!navigationMenuId || !blocks?.length) { - return null; - } - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockEditorProvider, { - settings: storedSettings, - value: blocks, - onChange: navigation_menu_editor_noop, - onInput: navigation_menu_editor_noop, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { - className: "edit-site-sidebar-navigation-screen-navigation-menus__content", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationMenuContent, { - rootClientId: blocks[0].clientId - }) - }) - }); -} - -;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js -/** - * WordPress dependencies - */ - - - -// Copied from packages/block-library/src/navigation/edit/navigation-menu-selector.js. -function buildNavigationLabel(title, id, status) { - if (!title?.rendered) { - /* translators: %s: the index of the menu in the list of menus. */ - return (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('(no title %s)'), id); - } - if (status === 'publish') { - return (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title?.rendered); - } - return (0,external_wp_i18n_namespaceObject.sprintf)( - // translators: 1: title of the menu. 2: status of the menu (draft, pending, etc.). - (0,external_wp_i18n_namespaceObject._x)('%1$s (%2$s)', 'menu label'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title?.rendered), status); -} - -;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - - - - - - -function SingleNavigationMenu({ - navigationMenu, - backPath, - handleDelete, - handleDuplicate, - handleSave -}) { - const menuTitle = navigationMenu?.title?.rendered; - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenWrapper, { - actions: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ScreenNavigationMoreMenu, { - menuId: navigationMenu?.id, - menuTitle: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(menuTitle), - onDelete: handleDelete, - onSave: handleSave, - onDuplicate: handleDuplicate - }) +const templatesRoute = { + name: 'templates', + path: '/template', + areas: { + sidebar: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenTemplatesBrowse, { + backPath: "/" }), - backPath: backPath, - title: buildNavigationLabel(navigationMenu?.title, navigationMenu?.id, navigationMenu?.status), - description: (0,external_wp_i18n_namespaceObject.__)('Navigation Menus are a curated collection of blocks that allow visitors to get around your site.'), - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationMenuEditor, { - navigationMenuId: navigationMenu?.id - }) - }); -} - -;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-navigation-menu/index.js -/** - * WordPress dependencies - */ - - - - - - - -/** - * Internal dependencies - */ - - - - - - - -const { - useLocation: sidebar_navigation_screen_navigation_menu_useLocation -} = unlock(external_wp_router_namespaceObject.privateApis); -const postType = `wp_navigation`; -function SidebarNavigationScreenNavigationMenu({ - backPath -}) { - const { - params: { - postId + content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PageTemplates, {}), + preview({ + query + }) { + const isListView = query.layout === 'list'; + return isListView ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, {}) : undefined; + }, + mobile: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PageTemplates, {}) + }, + widths: { + content({ + query + }) { + const isListView = query.layout === 'list'; + return isListView ? 380 : undefined; } - } = sidebar_navigation_screen_navigation_menu_useLocation(); - const { - record: navigationMenu, - isResolving - } = (0,external_wp_coreData_namespaceObject.useEntityRecord)('postType', postType, postId); - const { - isSaving, - isDeleting - } = (0,external_wp_data_namespaceObject.useSelect)(select => { - const { - isSavingEntityRecord, - isDeletingEntityRecord - } = select(external_wp_coreData_namespaceObject.store); - return { - isSaving: isSavingEntityRecord('postType', postType, postId), - isDeleting: isDeletingEntityRecord('postType', postType, postId) - }; - }, [postId]); - const isLoading = isResolving || isSaving || isDeleting; - const menuTitle = navigationMenu?.title?.rendered || navigationMenu?.slug; - const { - handleSave, - handleDelete, - handleDuplicate - } = useNavigationMenuHandlers(); - const _handleDelete = () => handleDelete(navigationMenu); - const _handleSave = edits => handleSave(navigationMenu, edits); - const _handleDuplicate = () => handleDuplicate(navigationMenu); - if (isLoading) { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenWrapper, { - description: (0,external_wp_i18n_namespaceObject.__)('Navigation Menus are a curated collection of blocks that allow visitors to get around your site.'), - backPath: backPath, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, { - className: "edit-site-sidebar-navigation-screen-navigation-menus__loading" - }) - }); } - if (!isLoading && !navigationMenu) { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenWrapper, { - description: (0,external_wp_i18n_namespaceObject.__)('Navigation Menu missing.'), - backPath: backPath - }); - } - if (!navigationMenu?.content?.raw) { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenWrapper, { - actions: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ScreenNavigationMoreMenu, { - menuId: navigationMenu?.id, - menuTitle: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(menuTitle), - onDelete: _handleDelete, - onSave: _handleSave, - onDuplicate: _handleDuplicate - }), - backPath: backPath, - title: buildNavigationLabel(navigationMenu?.title, navigationMenu?.id, navigationMenu?.status), - description: (0,external_wp_i18n_namespaceObject.__)('This Navigation Menu is empty.') - }); - } - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SingleNavigationMenu, { - navigationMenu: navigationMenu, - backPath: backPath, - handleDelete: _handleDelete, - handleSave: _handleSave, - handleDuplicate: _handleDuplicate - }); -} - -;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js -/** - * WordPress dependencies - */ - - - - - - -/** - * Internal dependencies - */ - - - -const { - useHistory: use_navigation_menu_handlers_useHistory -} = unlock(external_wp_router_namespaceObject.privateApis); -function useDeleteNavigationMenu() { - const { - deleteEntityRecord - } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); - const { - createSuccessNotice, - createErrorNotice - } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); - const history = use_navigation_menu_handlers_useHistory(); - const handleDelete = async navigationMenu => { - const postId = navigationMenu?.id; - try { - await deleteEntityRecord('postType', postType, postId, { - force: true - }, { - throwOnError: true - }); - createSuccessNotice((0,external_wp_i18n_namespaceObject.__)('Navigation Menu successfully deleted.'), { - type: 'snackbar' - }); - history.push({ - postType: 'wp_navigation' - }); - } catch (error) { - createErrorNotice((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: error message describing why the navigation menu could not be deleted. */ - (0,external_wp_i18n_namespaceObject.__)(`Unable to delete Navigation Menu (%s).`), error?.message), { - type: 'snackbar' - }); - } - }; - return handleDelete; -} -function useSaveNavigationMenu() { - const { - getEditedEntityRecord - } = (0,external_wp_data_namespaceObject.useSelect)(select => { - const { - getEditedEntityRecord: getEditedEntityRecordSelector - } = select(external_wp_coreData_namespaceObject.store); - return { - getEditedEntityRecord: getEditedEntityRecordSelector - }; - }, []); - const { - editEntityRecord, - __experimentalSaveSpecifiedEntityEdits: saveSpecifiedEntityEdits - } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); - const { - createSuccessNotice, - createErrorNotice - } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); - const handleSave = async (navigationMenu, edits) => { - if (!edits) { - return; - } - const postId = navigationMenu?.id; - // Prepare for revert in case of error. - const originalRecord = getEditedEntityRecord('postType', NAVIGATION_POST_TYPE, postId); - - // Apply the edits. - editEntityRecord('postType', postType, postId, edits); - const recordPropertiesToSave = Object.keys(edits); - - // Attempt to persist. - try { - await saveSpecifiedEntityEdits('postType', postType, postId, recordPropertiesToSave, { - throwOnError: true - }); - createSuccessNotice((0,external_wp_i18n_namespaceObject.__)('Renamed Navigation Menu'), { - type: 'snackbar' - }); - } catch (error) { - // Revert to original in case of error. - editEntityRecord('postType', postType, postId, originalRecord); - createErrorNotice((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: error message describing why the navigation menu could not be renamed. */ - (0,external_wp_i18n_namespaceObject.__)(`Unable to rename Navigation Menu (%s).`), error?.message), { - type: 'snackbar' - }); - } - }; - return handleSave; -} -function useDuplicateNavigationMenu() { - const history = use_navigation_menu_handlers_useHistory(); - const { - saveEntityRecord - } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); - const { - createSuccessNotice, - createErrorNotice - } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); - const handleDuplicate = async navigationMenu => { - const menuTitle = navigationMenu?.title?.rendered || navigationMenu?.slug; - try { - const savedRecord = await saveEntityRecord('postType', postType, { - title: (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: Navigation menu title */ - (0,external_wp_i18n_namespaceObject._x)('%s (Copy)', 'navigation menu'), menuTitle), - content: navigationMenu?.content?.raw, - status: 'publish' - }, { - throwOnError: true - }); - if (savedRecord) { - createSuccessNotice((0,external_wp_i18n_namespaceObject.__)('Duplicated Navigation Menu'), { - type: 'snackbar' - }); - history.push({ - postType: postType, - postId: savedRecord.id - }); - } - } catch (error) { - createErrorNotice((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: error message describing why the navigation menu could not be deleted. */ - (0,external_wp_i18n_namespaceObject.__)(`Unable to duplicate Navigation Menu (%s).`), error?.message), { - type: 'snackbar' - }); - } - }; - return handleDuplicate; -} -function useNavigationMenuHandlers() { - return { - handleDelete: useDeleteNavigationMenu(), - handleSave: useSaveNavigationMenu(), - handleDuplicate: useDuplicateNavigationMenu() - }; -} - -;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-navigation-menus/index.js -/** - * WordPress dependencies - */ - - - - - - - -/** - * Internal dependencies - */ - - - - - - - - - -// Copied from packages/block-library/src/navigation/edit/navigation-menu-selector.js. - -function buildMenuLabel(title, id, status) { - if (!title) { - /* translators: %s: the index of the menu in the list of menus. */ - return (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('(no title %s)'), id); - } - if (status === 'publish') { - return (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title); - } - return (0,external_wp_i18n_namespaceObject.sprintf)( - // translators: 1: title of the menu. 2: status of the menu (draft, pending, etc.). - (0,external_wp_i18n_namespaceObject._x)('%1$s (%2$s)', 'menu label'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title), status); -} - -// Save a boolean to prevent us creating a fallback more than once per session. -let hasCreatedFallback = false; -function SidebarNavigationScreenNavigationMenus({ - backPath -}) { - const { - records: navigationMenus, - isResolving: isResolvingNavigationMenus, - hasResolved: hasResolvedNavigationMenus - } = (0,external_wp_coreData_namespaceObject.useEntityRecords)('postType', NAVIGATION_POST_TYPE, PRELOADED_NAVIGATION_MENUS_QUERY); - const isLoading = isResolvingNavigationMenus && !hasResolvedNavigationMenus; - const { - getNavigationFallbackId - } = unlock((0,external_wp_data_namespaceObject.useSelect)(external_wp_coreData_namespaceObject.store)); - const firstNavigationMenu = navigationMenus?.[0]; - - // Save a boolean to prevent us creating a fallback more than once per session. - if (firstNavigationMenu) { - hasCreatedFallback = true; - } - - // If there is no navigation menu found - // then trigger fallback algorithm to create one. - if (!firstNavigationMenu && !isResolvingNavigationMenus && hasResolvedNavigationMenus && !hasCreatedFallback) { - getNavigationFallbackId(); - } - const { - handleSave, - handleDelete, - handleDuplicate - } = useNavigationMenuHandlers(); - const hasNavigationMenus = !!navigationMenus?.length; - if (isLoading) { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenWrapper, { - backPath: backPath, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, { - className: "edit-site-sidebar-navigation-screen-navigation-menus__loading" - }) - }); - } - if (!isLoading && !hasNavigationMenus) { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenWrapper, { - description: (0,external_wp_i18n_namespaceObject.__)('No Navigation Menus found.'), - backPath: backPath - }); - } - - // if single menu then render it - if (navigationMenus?.length === 1) { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SingleNavigationMenu, { - navigationMenu: firstNavigationMenu, - backPath: backPath, - handleDelete: () => handleDelete(firstNavigationMenu), - handleDuplicate: () => handleDuplicate(firstNavigationMenu), - handleSave: edits => handleSave(firstNavigationMenu, edits) - }); - } - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenWrapper, { - backPath: backPath, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalItemGroup, { - children: navigationMenus?.map(({ - id, - title, - status - }, index) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavMenuItem, { - postId: id, - withChevron: true, - icon: library_navigation, - children: buildMenuLabel(title?.rendered, index + 1, status) - }, id)) - }) - }); -} -function SidebarNavigationScreenWrapper({ - children, - actions, - title, - description, - backPath -}) { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreen, { - title: title || (0,external_wp_i18n_namespaceObject.__)('Navigation'), - actions: actions, - description: description || (0,external_wp_i18n_namespaceObject.__)('Manage your Navigation Menus.'), - backPath: backPath, - content: children - }); -} -const NavMenuItem = ({ - postId, - ...props -}) => { - const linkInfo = useLink({ - postId, - postType: 'wp_navigation' - }); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationItem, { - ...linkInfo, - ...props - }); }; +;// ./node_modules/@wordpress/edit-site/build-module/components/site-editor-routes/template-item.js +/** + * Internal dependencies + */ + + + +const templateItemRoute = { + name: 'template-item', + path: '/wp_template/*postId', + areas: { + sidebar: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenTemplatesBrowse, { + backPath: "/" + }), + mobile: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MaybeEditor, {}), + preview: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MaybeEditor, {}) + } +}; + +;// ./node_modules/@wordpress/icons/build-module/library/pages.js +/** + * WordPress dependencies + */ + + +const pages = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "M14.5 5.5h-7V7h7V5.5ZM7.5 9h7v1.5h-7V9Zm7 3.5h-7V14h7v-1.5Z" + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "M16 2H6a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2ZM6 3.5h10a.5.5 0 0 1 .5.5v12a.5.5 0 0 1-.5.5H6a.5.5 0 0 1-.5-.5V4a.5.5 0 0 1 .5-.5Z" + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "M20 8v11c0 .69-.31 1-.999 1H6v1.5h13.001c1.52 0 2.499-.982 2.499-2.5V8H20Z" + })] +}); +/* harmony default export */ const library_pages = (pages); + +;// ./node_modules/@wordpress/icons/build-module/library/published.js +/** + * WordPress dependencies + */ + + +const published = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm11.53-1.47-1.06-1.06L11 12.94l-1.47-1.47-1.06 1.06L11 15.06l4.53-4.53Z" + }) +}); +/* harmony default export */ const library_published = (published); + +;// ./node_modules/@wordpress/icons/build-module/library/scheduled.js +/** + * WordPress dependencies + */ + + +const scheduled = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm9 1V8h-1.5v3.5h-2V13H13Z" + }) +}); +/* harmony default export */ const library_scheduled = (scheduled); + +;// ./node_modules/@wordpress/icons/build-module/library/drafts.js +/** + * WordPress dependencies + */ + + +const drafts = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm8 4a4 4 0 0 0 4-4H8a4 4 0 0 0 4 4Z" + }) +}); +/* harmony default export */ const library_drafts = (drafts); + +;// ./node_modules/@wordpress/icons/build-module/library/pending.js +/** + * WordPress dependencies + */ + + +const pending = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm8 4a4 4 0 0 1-4-4h4V8a4 4 0 0 1 0 8Z" + }) +}); +/* harmony default export */ const library_pending = (pending); + +;// ./node_modules/@wordpress/icons/build-module/library/not-allowed.js +/** + * WordPress dependencies + */ + + +const notAllowed = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M12 18.5A6.5 6.5 0 0 1 6.93 7.931l9.139 9.138A6.473 6.473 0 0 1 12 18.5Zm5.123-2.498a6.5 6.5 0 0 0-9.124-9.124l9.124 9.124ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Z" + }) +}); +/* harmony default export */ const not_allowed = (notAllowed); + +;// ./node_modules/@wordpress/icons/build-module/library/trash.js +/** + * WordPress dependencies + */ + + +const trash = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M12 5.5A2.25 2.25 0 0 0 9.878 7h4.244A2.251 2.251 0 0 0 12 5.5ZM12 4a3.751 3.751 0 0 0-3.675 3H5v1.5h1.27l.818 8.997a2.75 2.75 0 0 0 2.739 2.501h4.347a2.75 2.75 0 0 0 2.738-2.5L17.73 8.5H19V7h-3.325A3.751 3.751 0 0 0 12 4Zm4.224 4.5H7.776l.806 8.861a1.25 1.25 0 0 0 1.245 1.137h4.347a1.25 1.25 0 0 0 1.245-1.137l.805-8.861Z" + }) +}); +/* harmony default export */ const library_trash = (trash); + +;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-dataviews/default-views.js +/** + * WordPress dependencies + */ + + + + + + +/** + * Internal dependencies + */ + +const default_views_defaultLayouts = { + [LAYOUT_TABLE]: {}, + [LAYOUT_GRID]: {}, + [LAYOUT_LIST]: {} +}; +const DEFAULT_POST_BASE = { + type: LAYOUT_LIST, + search: '', + filters: [], + page: 1, + perPage: 20, + sort: { + field: 'title', + direction: 'asc' + }, + showLevels: true, + titleField: 'title', + mediaField: 'featured_media', + fields: ['author', 'status'], + ...default_views_defaultLayouts[LAYOUT_LIST] +}; +function useDefaultViews({ + postType +}) { + const labels = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getPostType + } = select(external_wp_coreData_namespaceObject.store); + return getPostType(postType)?.labels; + }, [postType]); + return (0,external_wp_element_namespaceObject.useMemo)(() => { + return [{ + title: labels?.all_items || (0,external_wp_i18n_namespaceObject.__)('All items'), + slug: 'all', + icon: library_pages, + view: DEFAULT_POST_BASE + }, { + title: (0,external_wp_i18n_namespaceObject.__)('Published'), + slug: 'published', + icon: library_published, + view: DEFAULT_POST_BASE, + filters: [{ + field: 'status', + operator: OPERATOR_IS_ANY, + value: 'publish' + }] + }, { + title: (0,external_wp_i18n_namespaceObject.__)('Scheduled'), + slug: 'future', + icon: library_scheduled, + view: DEFAULT_POST_BASE, + filters: [{ + field: 'status', + operator: OPERATOR_IS_ANY, + value: 'future' + }] + }, { + title: (0,external_wp_i18n_namespaceObject.__)('Drafts'), + slug: 'drafts', + icon: library_drafts, + view: DEFAULT_POST_BASE, + filters: [{ + field: 'status', + operator: OPERATOR_IS_ANY, + value: 'draft' + }] + }, { + title: (0,external_wp_i18n_namespaceObject.__)('Pending'), + slug: 'pending', + icon: library_pending, + view: DEFAULT_POST_BASE, + filters: [{ + field: 'status', + operator: OPERATOR_IS_ANY, + value: 'pending' + }] + }, { + title: (0,external_wp_i18n_namespaceObject.__)('Private'), + slug: 'private', + icon: not_allowed, + view: DEFAULT_POST_BASE, + filters: [{ + field: 'status', + operator: OPERATOR_IS_ANY, + value: 'private' + }] + }, { + title: (0,external_wp_i18n_namespaceObject.__)('Trash'), + slug: 'trash', + icon: library_trash, + view: { + ...DEFAULT_POST_BASE, + type: LAYOUT_TABLE, + layout: default_views_defaultLayouts[LAYOUT_TABLE].layout + }, + filters: [{ + field: 'status', + operator: OPERATOR_IS_ANY, + value: 'trash' + }] + }]; + }, [labels]); +} + ;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-dataviews/dataview-item.js +/* wp:polyfill */ /** * External dependencies */ @@ -40021,14 +40519,13 @@ const NavMenuItem = ({ + /** * Internal dependencies */ - - const { useLocation: dataview_item_useLocation } = unlock(external_wp_router_namespaceObject.privateApis); @@ -40043,21 +40540,18 @@ function DataViewItem({ suffix }) { const { - params: { - postType - } + path } = dataview_item_useLocation(); const iconToUse = icon || VIEW_LAYOUTS.find(v => v.type === type).icon; let activeView = isCustom ? customViewId : slug; if (activeView === 'all') { activeView = undefined; } - const linkInfo = useLink({ - postType, + const query = { layout: type, activeView, isCustom: isCustom ? 'true' : undefined - }); + }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "flex-start", className: dist_clsx('edit-site-sidebar-dataviews-dataview-item', { @@ -40065,337 +40559,13 @@ function DataViewItem({ }), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationItem, { icon: iconToUse, - ...linkInfo, + to: (0,external_wp_url_namespaceObject.addQueryArgs)(path, query), "aria-current": isActive ? 'true' : undefined, children: title }), suffix] }); } -;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-templates-browse/content.js -/** - * WordPress dependencies - */ - - - - -/** - * Internal dependencies - */ - - - - - - -const content_EMPTY_ARRAY = []; -function TemplateDataviewItem({ - template, - isActive -}) { - const { - text, - icon - } = useAddedBy(template.type, template.id); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataViewItem, { - slug: text, - title: text, - icon: icon, - isActive: isActive, - isCustom: false - }, text); -} -function DataviewsTemplatesSidebarContent({ - activeView, - title -}) { - const { - records - } = (0,external_wp_coreData_namespaceObject.useEntityRecords)('postType', TEMPLATE_POST_TYPE, { - per_page: -1 - }); - const firstItemPerAuthorText = (0,external_wp_element_namespaceObject.useMemo)(() => { - var _ref; - const firstItemPerAuthor = records?.reduce((acc, template) => { - const author = template.author_text; - if (author && !acc[author]) { - acc[author] = template; - } - return acc; - }, {}); - return (_ref = firstItemPerAuthor && Object.values(firstItemPerAuthor)) !== null && _ref !== void 0 ? _ref : content_EMPTY_ARRAY; - }, [records]); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalItemGroup, { - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataViewItem, { - slug: "all", - title: title, - icon: library_layout, - isActive: activeView === 'all', - isCustom: false - }), firstItemPerAuthorText.map(template => { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TemplateDataviewItem, { - template: template, - isActive: activeView === template.author_text - }, template.author_text); - })] - }); -} - -;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-templates-browse/index.js -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - - - - -const { - useLocation: sidebar_navigation_screen_templates_browse_useLocation -} = unlock(external_wp_router_namespaceObject.privateApis); -function SidebarNavigationScreenTemplatesBrowse({ - backPath -}) { - const { - params: { - activeView = 'all' - } - } = sidebar_navigation_screen_templates_browse_useLocation(); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreen, { - title: (0,external_wp_i18n_namespaceObject.__)('Templates'), - description: (0,external_wp_i18n_namespaceObject.__)('Create new templates, or reset any customizations made to the templates supplied by your theme.'), - backPath: backPath, - content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataviewsTemplatesSidebarContent, { - activeView: activeView, - title: (0,external_wp_i18n_namespaceObject.__)('All templates') - }) - }); -} - -;// ./node_modules/@wordpress/icons/build-module/library/file.js -/** - * WordPress dependencies - */ - - -const file = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - viewBox: "0 0 24 24", - xmlns: "http://www.w3.org/2000/svg", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M12.848 8a1 1 0 0 1-.914-.594l-.723-1.63a.5.5 0 0 0-.447-.276H5a.5.5 0 0 0-.5.5v11.5a.5.5 0 0 0 .5.5h14a.5.5 0 0 0 .5-.5v-9A.5.5 0 0 0 19 8h-6.152Zm.612-1.5a.5.5 0 0 1-.462-.31l-.445-1.084A2 2 0 0 0 10.763 4H5a2 2 0 0 0-2 2v11.5a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-9a2 2 0 0 0-2-2h-5.54Z" - }) -}); -/* harmony default export */ const library_file = (file); - -;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-patterns/category-item.js -/** - * Internal dependencies - */ - - - - -function CategoryItem({ - count, - icon, - id, - isActive, - label, - type -}) { - const linkInfo = useLink({ - categoryId: id !== TEMPLATE_PART_ALL_AREAS_CATEGORY && id !== PATTERN_DEFAULT_CATEGORY ? id : undefined, - postType: type === TEMPLATE_PART_POST_TYPE ? TEMPLATE_PART_POST_TYPE : PATTERN_TYPES.user - }); - if (!count) { - return; - } - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationItem, { - ...linkInfo, - icon: icon, - suffix: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { - children: count - }), - "aria-current": isActive ? 'true' : undefined, - children: label - }); -} - -;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js -/** - * WordPress dependencies - */ - - - - -/** - * Internal dependencies - */ - -const useTemplatePartsGroupedByArea = items => { - const allItems = items || []; - const templatePartAreas = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_editor_namespaceObject.store).__experimentalGetDefaultTemplatePartAreas(), []); - - // Create map of template areas ensuring that default areas are displayed before - // any custom registered template part areas. - const knownAreas = { - header: {}, - footer: {}, - sidebar: {}, - uncategorized: {} - }; - templatePartAreas.forEach(templatePartArea => knownAreas[templatePartArea.area] = { - ...templatePartArea, - templateParts: [] - }); - const groupedByArea = allItems.reduce((accumulator, item) => { - const key = accumulator[item.area] ? item.area : TEMPLATE_PART_AREA_DEFAULT_CATEGORY; - accumulator[key].templateParts.push(item); - return accumulator; - }, knownAreas); - return groupedByArea; -}; -function useTemplatePartAreas() { - const { - records: templateParts, - isResolving: isLoading - } = (0,external_wp_coreData_namespaceObject.useEntityRecords)('postType', TEMPLATE_PART_POST_TYPE, { - per_page: -1 - }); - return { - hasTemplateParts: templateParts ? !!templateParts.length : false, - isLoading, - templatePartAreas: useTemplatePartsGroupedByArea(templateParts) - }; -} - -;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-patterns/index.js -/** - * WordPress dependencies - */ - - - - - - - - -/** - * Internal dependencies - */ - - - - - - - - - -const { - useLocation: sidebar_navigation_screen_patterns_useLocation -} = unlock(external_wp_router_namespaceObject.privateApis); -function CategoriesGroup({ - templatePartAreas, - patternCategories, - currentCategory, - currentType -}) { - const [allPatterns, ...otherPatterns] = patternCategories; - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalItemGroup, { - className: "edit-site-sidebar-navigation-screen-patterns__group", - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CategoryItem, { - count: Object.values(templatePartAreas).map(({ - templateParts - }) => templateParts?.length || 0).reduce((acc, val) => acc + val, 0), - icon: (0,external_wp_editor_namespaceObject.getTemplatePartIcon)() /* no name, so it provides the fallback icon */, - label: (0,external_wp_i18n_namespaceObject.__)('All template parts'), - id: TEMPLATE_PART_ALL_AREAS_CATEGORY, - type: TEMPLATE_PART_POST_TYPE, - isActive: currentCategory === TEMPLATE_PART_ALL_AREAS_CATEGORY && currentType === TEMPLATE_PART_POST_TYPE - }, "all"), Object.entries(templatePartAreas).map(([area, { - label, - templateParts - }]) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CategoryItem, { - count: templateParts?.length, - icon: (0,external_wp_editor_namespaceObject.getTemplatePartIcon)(area), - label: label, - id: area, - type: TEMPLATE_PART_POST_TYPE, - isActive: currentCategory === area && currentType === TEMPLATE_PART_POST_TYPE - }, area)), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { - className: "edit-site-sidebar-navigation-screen-patterns__divider" - }), allPatterns && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CategoryItem, { - count: allPatterns.count, - label: allPatterns.label, - icon: library_file, - id: allPatterns.name, - type: PATTERN_TYPES.user, - isActive: currentCategory === `${allPatterns.name}` && currentType === PATTERN_TYPES.user - }, allPatterns.name), otherPatterns.map(category => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CategoryItem, { - count: category.count, - label: category.label, - icon: library_file, - id: category.name, - type: PATTERN_TYPES.user, - isActive: currentCategory === `${category.name}` && currentType === PATTERN_TYPES.user - }, category.name))] - }); -} -function SidebarNavigationScreenPatterns({ - backPath -}) { - const { - params: { - postType, - categoryId - } - } = sidebar_navigation_screen_patterns_useLocation(); - const currentType = postType || PATTERN_TYPES.user; - const currentCategory = categoryId || (currentType === PATTERN_TYPES.user ? PATTERN_DEFAULT_CATEGORY : TEMPLATE_PART_ALL_AREAS_CATEGORY); - const { - templatePartAreas, - hasTemplateParts, - isLoading - } = useTemplatePartAreas(); - const { - patternCategories, - hasPatterns - } = usePatternCategories(); - const isBlockBasedTheme = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getCurrentTheme()?.is_block_theme, []); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreen, { - isRoot: !isBlockBasedTheme, - title: (0,external_wp_i18n_namespaceObject.__)('Patterns'), - description: (0,external_wp_i18n_namespaceObject.__)('Manage what patterns are available when editing the site.'), - backPath: backPath, - content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: [isLoading && (0,external_wp_i18n_namespaceObject.__)('Loading items…'), !isLoading && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: [!hasTemplateParts && !hasPatterns && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalItemGroup, { - className: "edit-site-sidebar-navigation-screen-patterns__group", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalItem, { - children: (0,external_wp_i18n_namespaceObject.__)('No items found') - }) - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CategoriesGroup, { - templatePartAreas: templatePartAreas, - patternCategories: patternCategories, - currentCategory: currentCategory, - currentType: currentType - })] - })] - }) - }); -} - ;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-dataviews/add-new-view.js /** * WordPress dependencies @@ -40408,6 +40578,7 @@ function SidebarNavigationScreenPatterns({ + /** * Internal dependencies */ @@ -40415,9 +40586,8 @@ function SidebarNavigationScreenPatterns({ - - const { + useLocation: add_new_view_useLocation, useHistory: add_new_view_useHistory } = unlock(external_wp_router_namespaceObject.privateApis); function AddNewItemModalContent({ @@ -40425,6 +40595,9 @@ function AddNewItemModalContent({ setIsAdding }) { const history = add_new_view_useHistory(); + const { + path + } = add_new_view_useLocation(); const { saveEntityRecord } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); @@ -40460,16 +40633,10 @@ function AddNewItemModalContent({ wp_dataviews_type: dataViewTaxonomyId, content: JSON.stringify(defaultViews[0].view) }); - const { - params: { - postType - } - } = history.getLocationWithParams(); - history.push({ - postType, + history.navigate((0,external_wp_url_namespaceObject.addQueryArgs)(path, { activeView: savedRecord.id, isCustom: 'true' - }); + })); setIsSaving(false); setIsAdding(false); }, @@ -40530,6 +40697,7 @@ function AddNewItem({ } ;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-dataviews/custom-dataviews-list.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -40548,10 +40716,9 @@ function AddNewItem({ - - const { - useHistory: custom_dataviews_list_useHistory + useHistory: custom_dataviews_list_useHistory, + useLocation: custom_dataviews_list_useLocation } = unlock(external_wp_router_namespaceObject.privateApis); const custom_dataviews_list_EMPTY_ARRAY = []; function RenameItemModalContent({ @@ -40606,6 +40773,7 @@ function CustomDataViewItem({ isActive }) { const history = custom_dataviews_list_useHistory(); + const location = custom_dataviews_list_useLocation(); const { dataview } = (0,external_wp_data_namespaceObject.useSelect)(select => { @@ -40656,13 +40824,8 @@ function CustomDataViewItem({ force: true }); if (isActive) { - const { - params: { - postType - } - } = history.getLocationWithParams(); history.replace({ - postType + postType: location.query.postType }); } onClose(); @@ -40724,6 +40887,7 @@ function CustomDataViewsList({ children: (0,external_wp_i18n_namespaceObject.__)('Custom Views') }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalItemGroup, { + className: "edit-site-sidebar-navigation-screen-dataviews__custom-items", children: [customDataViews.map(customViewRecord => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CustomDataViewItem, { dataviewId: customViewRecord.id, @@ -40737,6 +40901,7 @@ function CustomDataViewsList({ } ;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-dataviews/index.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -40751,15 +40916,14 @@ function CustomDataViewsList({ - - const { useLocation: sidebar_dataviews_useLocation } = unlock(external_wp_router_namespaceObject.privateApis); -function DataViewsSidebarContent() { +function DataViewsSidebarContent({ + postType +}) { const { - params: { - postType, + query: { activeView = 'all', isCustom = 'false' } @@ -40773,6 +40937,7 @@ function DataViewsSidebarContent() { const isCustomBoolean = isCustom === 'true'; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalItemGroup, { + className: "edit-site-sidebar-dataviews", children: defaultViews.map(dataview => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataViewItem, { slug: dataview.slug, @@ -40791,7 +40956,544 @@ function DataViewsSidebarContent() { }); } +;// ./node_modules/@wordpress/icons/build-module/library/drawer-right.js +/** + * WordPress dependencies + */ + + +const drawerRight = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + width: "24", + height: "24", + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4 14.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h8v13zm4.5-.5c0 .3-.2.5-.5.5h-2.5v-13H18c.3 0 .5.2.5.5v12z" + }) +}); +/* harmony default export */ const drawer_right = (drawerRight); + +;// ./node_modules/@wordpress/edit-site/build-module/components/add-new-post/index.js +/** + * WordPress dependencies + */ + + + + + + + + + +function AddNewPostModal({ + postType, + onSave, + onClose +}) { + const labels = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getPostType(postType)?.labels, [postType]); + const [isCreatingPost, setIsCreatingPost] = (0,external_wp_element_namespaceObject.useState)(false); + const [title, setTitle] = (0,external_wp_element_namespaceObject.useState)(''); + const { + saveEntityRecord + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); + const { + createErrorNotice, + createSuccessNotice + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); + const { + resolveSelect + } = (0,external_wp_data_namespaceObject.useRegistry)(); + async function createPost(event) { + event.preventDefault(); + if (isCreatingPost) { + return; + } + setIsCreatingPost(true); + try { + const postTypeObject = await resolveSelect(external_wp_coreData_namespaceObject.store).getPostType(postType); + const newPage = await saveEntityRecord('postType', postType, { + status: 'draft', + title, + slug: title !== null && title !== void 0 ? title : undefined, + content: !!postTypeObject.template && postTypeObject.template.length ? (0,external_wp_blocks_namespaceObject.serialize)((0,external_wp_blocks_namespaceObject.synchronizeBlocksWithTemplate)([], postTypeObject.template)) : undefined + }, { + throwOnError: true + }); + onSave(newPage); + createSuccessNotice((0,external_wp_i18n_namespaceObject.sprintf)( + // translators: %s: Title of the created post or template, e.g: "Hello world". + (0,external_wp_i18n_namespaceObject.__)('"%s" successfully created.'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(newPage.title?.rendered || title)), { + type: 'snackbar' + }); + } catch (error) { + const errorMessage = error.message && error.code !== 'unknown_error' ? error.message : (0,external_wp_i18n_namespaceObject.__)('An error occurred while creating the item.'); + createErrorNotice(errorMessage, { + type: 'snackbar' + }); + } finally { + setIsCreatingPost(false); + } + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Modal, { + title: + // translators: %s: post type singular_name label e.g: "Page". + (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('Draft new: %s'), labels?.singular_name), + onRequestClose: onClose, + focusOnMount: "firstContentElement", + size: "small", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("form", { + onSubmit: createPost, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { + spacing: 4, + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { + __next40pxDefaultSize: true, + __nextHasNoMarginBottom: true, + label: (0,external_wp_i18n_namespaceObject.__)('Title'), + onChange: setTitle, + placeholder: (0,external_wp_i18n_namespaceObject.__)('No title'), + value: title + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { + spacing: 2, + justify: "end", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + __next40pxDefaultSize: true, + variant: "tertiary", + onClick: onClose, + children: (0,external_wp_i18n_namespaceObject.__)('Cancel') + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + __next40pxDefaultSize: true, + variant: "primary", + type: "submit", + isBusy: isCreatingPost, + "aria-disabled": isCreatingPost, + children: (0,external_wp_i18n_namespaceObject.__)('Create draft') + })] + })] + }) + }) + }); +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/post-list/index.js +/* wp:polyfill */ +/** + * WordPress dependencies + */ + + + + + + + + + + + + +/** + * Internal dependencies + */ + + + + + + + +const { + usePostActions: post_list_usePostActions, + usePostFields +} = unlock(external_wp_editor_namespaceObject.privateApis); +const { + useLocation: post_list_useLocation, + useHistory: post_list_useHistory +} = unlock(external_wp_router_namespaceObject.privateApis); +const { + useEntityRecordsWithPermissions: post_list_useEntityRecordsWithPermissions +} = unlock(external_wp_coreData_namespaceObject.privateApis); +const post_list_EMPTY_ARRAY = []; +const getDefaultView = (defaultViews, activeView) => { + return defaultViews.find(({ + slug + }) => slug === activeView)?.view; +}; +const getCustomView = editedEntityRecord => { + if (!editedEntityRecord?.content) { + return undefined; + } + const content = JSON.parse(editedEntityRecord.content); + if (!content) { + return undefined; + } + return { + ...content, + ...default_views_defaultLayouts[content.type] + }; +}; + +/** + * This function abstracts working with default & custom views by + * providing a [ state, setState ] tuple based on the URL parameters. + * + * Consumers use the provided tuple to work with state + * and don't have to deal with the specifics of default & custom views. + * + * @param {string} postType Post type to retrieve default views for. + * @return {Array} The [ state, setState ] tuple. + */ +function useView(postType) { + const { + path, + query: { + activeView = 'all', + isCustom = 'false', + layout + } + } = post_list_useLocation(); + const history = post_list_useHistory(); + const defaultViews = useDefaultViews({ + postType + }); + const { + editEntityRecord + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); + const editedEntityRecord = (0,external_wp_data_namespaceObject.useSelect)(select => { + if (isCustom !== 'true') { + return undefined; + } + const { + getEditedEntityRecord + } = select(external_wp_coreData_namespaceObject.store); + return getEditedEntityRecord('postType', 'wp_dataviews', Number(activeView)); + }, [activeView, isCustom]); + const [view, setView] = (0,external_wp_element_namespaceObject.useState)(() => { + let initialView; + if (isCustom === 'true') { + var _getCustomView; + initialView = (_getCustomView = getCustomView(editedEntityRecord)) !== null && _getCustomView !== void 0 ? _getCustomView : { + type: layout !== null && layout !== void 0 ? layout : LAYOUT_LIST + }; + } else { + var _getDefaultView; + initialView = (_getDefaultView = getDefaultView(defaultViews, activeView)) !== null && _getDefaultView !== void 0 ? _getDefaultView : { + type: layout !== null && layout !== void 0 ? layout : LAYOUT_LIST + }; + } + const type = layout !== null && layout !== void 0 ? layout : initialView.type; + return { + ...initialView, + type, + ...default_views_defaultLayouts[type] + }; + }); + const setViewWithUrlUpdate = (0,external_wp_compose_namespaceObject.useEvent)(newView => { + setView(newView); + if (isCustom === 'true' && editedEntityRecord?.id) { + editEntityRecord('postType', 'wp_dataviews', editedEntityRecord?.id, { + content: JSON.stringify(newView) + }); + } + const currentUrlLayout = layout !== null && layout !== void 0 ? layout : LAYOUT_LIST; + if (newView.type !== currentUrlLayout) { + history.navigate((0,external_wp_url_namespaceObject.addQueryArgs)(path, { + layout: newView.type + })); + } + }); + + // When layout URL param changes, update the view type + // without affecting any other config. + const onUrlLayoutChange = (0,external_wp_compose_namespaceObject.useEvent)(() => { + setView(prevView => { + const newType = layout !== null && layout !== void 0 ? layout : LAYOUT_LIST; + if (newType === prevView.type) { + return prevView; + } + return { + ...prevView, + type: newType, + ...default_views_defaultLayouts[newType] + }; + }); + }); + (0,external_wp_element_namespaceObject.useEffect)(() => { + onUrlLayoutChange(); + }, [onUrlLayoutChange, layout]); + + // When activeView or isCustom URL parameters change, reset the view. + const onUrlActiveViewChange = (0,external_wp_compose_namespaceObject.useEvent)(() => { + let newView; + if (isCustom === 'true') { + newView = getCustomView(editedEntityRecord); + } else { + newView = getDefaultView(defaultViews, activeView); + } + if (newView) { + const type = layout !== null && layout !== void 0 ? layout : newView.type; + setView({ + ...newView, + type, + ...default_views_defaultLayouts[type] + }); + } + }); + (0,external_wp_element_namespaceObject.useEffect)(() => { + onUrlActiveViewChange(); + }, [onUrlActiveViewChange, activeView, isCustom, defaultViews, editedEntityRecord]); + return [view, setViewWithUrlUpdate]; +} +const DEFAULT_STATUSES = 'draft,future,pending,private,publish'; // All but 'trash'. + +function getItemId(item) { + return item.id.toString(); +} +function getItemLevel(item) { + return item.level; +} +function PostList({ + postType +}) { + var _postId$split, _data$map, _usePrevious; + const [view, setView] = useView(postType); + const defaultViews = useDefaultViews({ + postType + }); + const history = post_list_useHistory(); + const location = post_list_useLocation(); + const { + postId, + quickEdit = false, + isCustom, + activeView = 'all' + } = location.query; + const [selection, setSelection] = (0,external_wp_element_namespaceObject.useState)((_postId$split = postId?.split(',')) !== null && _postId$split !== void 0 ? _postId$split : []); + const onChangeSelection = (0,external_wp_element_namespaceObject.useCallback)(items => { + var _location$query$isCus; + setSelection(items); + if (((_location$query$isCus = location.query.isCustom) !== null && _location$query$isCus !== void 0 ? _location$query$isCus : 'false') === 'false') { + history.navigate((0,external_wp_url_namespaceObject.addQueryArgs)(location.path, { + postId: items.join(',') + })); + } + }, [location.path, location.query.isCustom, history]); + const getActiveViewFilters = (views, match) => { + var _found$filters; + const found = views.find(({ + slug + }) => slug === match); + return (_found$filters = found?.filters) !== null && _found$filters !== void 0 ? _found$filters : []; + }; + const { + isLoading: isLoadingFields, + fields: _fields + } = usePostFields({ + postType + }); + const fields = (0,external_wp_element_namespaceObject.useMemo)(() => { + const activeViewFilters = getActiveViewFilters(defaultViews, activeView).map(({ + field + }) => field); + return _fields.map(field => ({ + ...field, + elements: activeViewFilters.includes(field.id) ? [] : field.elements + })); + }, [_fields, defaultViews, activeView]); + const queryArgs = (0,external_wp_element_namespaceObject.useMemo)(() => { + const filters = {}; + view.filters?.forEach(filter => { + if (filter.field === 'status' && filter.operator === OPERATOR_IS_ANY) { + filters.status = filter.value; + } + if (filter.field === 'author' && filter.operator === OPERATOR_IS_ANY) { + filters.author = filter.value; + } else if (filter.field === 'author' && filter.operator === OPERATOR_IS_NONE) { + filters.author_exclude = filter.value; + } + }); + + // The bundled views want data filtered without displaying the filter. + const activeViewFilters = getActiveViewFilters(defaultViews, activeView); + activeViewFilters.forEach(filter => { + if (filter.field === 'status' && filter.operator === OPERATOR_IS_ANY) { + filters.status = filter.value; + } + if (filter.field === 'author' && filter.operator === OPERATOR_IS_ANY) { + filters.author = filter.value; + } else if (filter.field === 'author' && filter.operator === OPERATOR_IS_NONE) { + filters.author_exclude = filter.value; + } + }); + + // We want to provide a different default item for the status filter + // than the REST API provides. + if (!filters.status || filters.status === '') { + filters.status = DEFAULT_STATUSES; + } + return { + per_page: view.perPage, + page: view.page, + _embed: 'author', + order: view.sort?.direction, + orderby: view.sort?.field, + orderby_hierarchy: !!view.showLevels, + search: view.search, + ...filters + }; + }, [view, activeView, defaultViews]); + const { + records, + isResolving: isLoadingData, + totalItems, + totalPages + } = post_list_useEntityRecordsWithPermissions('postType', postType, queryArgs); + + // The REST API sort the authors by ID, but we want to sort them by name. + const data = (0,external_wp_element_namespaceObject.useMemo)(() => { + if (!isLoadingFields && view?.sort?.field === 'author') { + return filterSortAndPaginate(records, { + sort: { + ...view.sort + } + }, fields).data; + } + return records; + }, [records, fields, isLoadingFields, view?.sort]); + const ids = (_data$map = data?.map(record => getItemId(record))) !== null && _data$map !== void 0 ? _data$map : []; + const prevIds = (_usePrevious = (0,external_wp_compose_namespaceObject.usePrevious)(ids)) !== null && _usePrevious !== void 0 ? _usePrevious : []; + const deletedIds = prevIds.filter(id => !ids.includes(id)); + const postIdWasDeleted = deletedIds.includes(postId); + (0,external_wp_element_namespaceObject.useEffect)(() => { + if (postIdWasDeleted) { + history.navigate((0,external_wp_url_namespaceObject.addQueryArgs)(location.path, { + postId: undefined + })); + } + }, [history, postIdWasDeleted, location.path]); + const paginationInfo = (0,external_wp_element_namespaceObject.useMemo)(() => ({ + totalItems, + totalPages + }), [totalItems, totalPages]); + const { + labels, + canCreateRecord + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getPostType, + canUser + } = select(external_wp_coreData_namespaceObject.store); + return { + labels: getPostType(postType)?.labels, + canCreateRecord: canUser('create', { + kind: 'postType', + name: postType + }) + }; + }, [postType]); + const postTypeActions = post_list_usePostActions({ + postType, + context: 'list' + }); + const editAction = useEditPostAction(); + const actions = (0,external_wp_element_namespaceObject.useMemo)(() => [editAction, ...postTypeActions], [postTypeActions, editAction]); + const [showAddPostModal, setShowAddPostModal] = (0,external_wp_element_namespaceObject.useState)(false); + const openModal = () => setShowAddPostModal(true); + const closeModal = () => setShowAddPostModal(false); + const handleNewPage = ({ + type, + id + }) => { + history.navigate(`/${type}/${id}?canvas=edit`); + closeModal(); + }; + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Page, { + title: labels?.name, + actions: labels?.add_new_item && canCreateRecord && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + variant: "primary", + onClick: openModal, + __next40pxDefaultSize: true, + children: labels.add_new_item + }), showAddPostModal && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(AddNewPostModal, { + postType: postType, + onSave: handleNewPage, + onClose: closeModal + })] + }), + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataViews, { + paginationInfo: paginationInfo, + fields: fields, + actions: actions, + data: data || post_list_EMPTY_ARRAY, + isLoading: isLoadingData || isLoadingFields, + view: view, + onChangeView: setView, + selection: selection, + onChangeSelection: onChangeSelection, + isItemClickable: item => item.status !== 'trash', + onClickItem: ({ + id + }) => { + history.navigate(`/${postType}/${id}?canvas=edit`); + }, + getItemId: getItemId, + getItemLevel: getItemLevel, + defaultLayouts: default_views_defaultLayouts, + header: window.__experimentalQuickEditDataViews && view.type !== LAYOUT_LIST && postType === 'page' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + size: "compact", + isPressed: quickEdit, + icon: drawer_right, + label: (0,external_wp_i18n_namespaceObject.__)('Details'), + onClick: () => { + history.navigate((0,external_wp_url_namespaceObject.addQueryArgs)(location.path, { + quickEdit: quickEdit ? undefined : true + })); + } + }) + }, activeView + isCustom) + }); +} + +;// ./node_modules/@wordpress/dataviews/build-module/components/dataform-context/index.js +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + +const DataFormContext = (0,external_wp_element_namespaceObject.createContext)({ + fields: [] +}); +function DataFormProvider({ + fields, + children +}) { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataFormContext.Provider, { + value: { + fields + }, + children: children + }); +} +/* harmony default export */ const dataform_context = (DataFormContext); + +;// ./node_modules/@wordpress/dataviews/build-module/dataforms-layouts/is-combined-field.js +/** + * Internal dependencies + */ + +function isCombinedField(field) { + return field.children !== undefined; +} + ;// ./node_modules/@wordpress/dataviews/build-module/dataforms-layouts/regular/index.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -40803,31 +41505,100 @@ function DataViewsSidebarContent() { */ -function FormRegular({ - data, - fields, - form, - onChange + + + +function regular_Header({ + title }) { - const visibleFields = (0,external_wp_element_namespaceObject.useMemo)(() => { - var _form$fields; - return normalizeFields(((_form$fields = form.fields) !== null && _form$fields !== void 0 ? _form$fields : []).map(fieldId => fields.find(({ - id - }) => id === fieldId)).filter(field => !!field)); - }, [fields, form.fields]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalVStack, { + className: "dataforms-layouts-regular__header", spacing: 4, - children: visibleFields.map(field => { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(field.Edit, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { + alignment: "center", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHeading, { + level: 2, + size: 13, + children: title + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalSpacer, {})] + }) + }); +} +function FormRegularField({ + data, + field, + onChange, + hideLabelFromVision +}) { + var _field$labelPosition; + const { + fields + } = (0,external_wp_element_namespaceObject.useContext)(dataform_context); + const form = (0,external_wp_element_namespaceObject.useMemo)(() => { + if (isCombinedField(field)) { + return { + fields: field.children.map(child => { + if (typeof child === 'string') { + return { + id: child + }; + } + return child; + }), + type: 'regular' + }; + } + return { + type: 'regular', + fields: [] + }; + }, [field]); + if (isCombinedField(field)) { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [!hideLabelFromVision && field.label && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(regular_Header, { + title: field.label + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataFormLayout, { data: data, - field: field, + form: form, onChange: onChange - }, field.id); + })] + }); + } + const labelPosition = (_field$labelPosition = field.labelPosition) !== null && _field$labelPosition !== void 0 ? _field$labelPosition : 'top'; + const fieldDefinition = fields.find(fieldDef => fieldDef.id === field.id); + if (!fieldDefinition) { + return null; + } + if (labelPosition === 'side') { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { + className: "dataforms-layouts-regular__field", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: "dataforms-layouts-regular__field-label", + children: fieldDefinition.label + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: "dataforms-layouts-regular__field-control", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(fieldDefinition.Edit, { + data: data, + field: fieldDefinition, + onChange: onChange, + hideLabelFromVision: true + }, fieldDefinition.id) + })] + }); + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: "dataforms-layouts-regular__field", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(fieldDefinition.Edit, { + data: data, + field: fieldDefinition, + onChange: onChange, + hideLabelFromVision: labelPosition === 'none' ? true : hideLabelFromVision }) }); } ;// ./node_modules/@wordpress/dataviews/build-module/dataforms-layouts/panel/index.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -40843,6 +41614,7 @@ function FormRegular({ + function DropdownHeader({ title, onClose @@ -40852,7 +41624,7 @@ function DropdownHeader({ spacing: 4, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { alignment: "center", - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHeading, { + children: [title && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHeading, { level: 2, size: 13, children: title @@ -40865,14 +41637,38 @@ function DropdownHeader({ }) }); } -function FormField({ +function PanelDropdown({ + fieldDefinition, + popoverAnchor, + labelPosition = 'side', data, - field, - onChange + onChange, + field }) { - // Use internal state instead of a ref to make sure that the component - // re-renders when the popover's anchor updates. - const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null); + const fieldLabel = isCombinedField(field) ? field.label : fieldDefinition?.label; + const form = (0,external_wp_element_namespaceObject.useMemo)(() => { + if (isCombinedField(field)) { + return { + type: 'regular', + fields: field.children.map(child => { + if (typeof child === 'string') { + return { + id: child + }; + } + return child; + }) + }; + } + // If not explicit children return the field id itself. + return { + type: 'regular', + fields: [{ + id: field.id + }] + }; + }, [field]); + // Memoize popoverProps to avoid returning a new object every time. const popoverProps = (0,external_wp_element_namespaceObject.useMemo)(() => ({ // Anchor the popover to the middle of the entire row so that it doesn't @@ -40882,119 +41678,279 @@ function FormField({ offset: 36, shift: true }), [popoverAnchor]); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Dropdown, { + contentClassName: "dataforms-layouts-panel__field-dropdown", + popoverProps: popoverProps, + focusOnMount: true, + toggleProps: { + size: 'compact', + variant: 'tertiary', + tooltipPosition: 'middle left' + }, + renderToggle: ({ + isOpen, + onToggle + }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + className: "dataforms-layouts-panel__field-control", + size: "compact", + variant: ['none', 'top'].includes(labelPosition) ? 'link' : 'tertiary', + "aria-expanded": isOpen, + "aria-label": (0,external_wp_i18n_namespaceObject.sprintf)( + // translators: %s: Field name. + (0,external_wp_i18n_namespaceObject._x)('Edit %s', 'field'), fieldLabel), + onClick: onToggle, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(fieldDefinition.render, { + item: data + }) + }), + renderContent: ({ + onClose + }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DropdownHeader, { + title: fieldLabel, + onClose: onClose + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataFormLayout, { + data: data, + form: form, + onChange: onChange, + children: (FieldLayout, nestedField) => { + var _form$fields; + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(FieldLayout, { + data: data, + field: nestedField, + onChange: onChange, + hideLabelFromVision: ((_form$fields = form?.fields) !== null && _form$fields !== void 0 ? _form$fields : []).length < 2 + }, nestedField.id); + } + })] + }) + }); +} +function FormPanelField({ + data, + field, + onChange +}) { + var _field$labelPosition; + const { + fields + } = (0,external_wp_element_namespaceObject.useContext)(dataform_context); + const fieldDefinition = fields.find(fieldDef => { + // Default to the first child if it is a combined field. + if (isCombinedField(field)) { + const children = field.children.filter(child => typeof child === 'string' || !isCombinedField(child)); + const firstChildFieldId = typeof children[0] === 'string' ? children[0] : children[0].id; + return fieldDef.id === firstChildFieldId; + } + return fieldDef.id === field.id; + }); + const labelPosition = (_field$labelPosition = field.labelPosition) !== null && _field$labelPosition !== void 0 ? _field$labelPosition : 'side'; + + // Use internal state instead of a ref to make sure that the component + // re-renders when the popover's anchor updates. + const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null); + if (!fieldDefinition) { + return null; + } + const fieldLabel = isCombinedField(field) ? field.label : fieldDefinition?.label; + if (labelPosition === 'top') { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { + className: "dataforms-layouts-panel__field", + spacing: 0, + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: "dataforms-layouts-panel__field-label", + style: { + paddingBottom: 0 + }, + children: fieldLabel + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: "dataforms-layouts-panel__field-control", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PanelDropdown, { + field: field, + popoverAnchor: popoverAnchor, + fieldDefinition: fieldDefinition, + data: data, + onChange: onChange, + labelPosition: labelPosition + }) + })] + }); + } + if (labelPosition === 'none') { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: "dataforms-layouts-panel__field", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PanelDropdown, { + field: field, + popoverAnchor: popoverAnchor, + fieldDefinition: fieldDefinition, + data: data, + onChange: onChange, + labelPosition: labelPosition + }) + }); + } + + // Defaults to label position side. return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { ref: setPopoverAnchor, className: "dataforms-layouts-panel__field", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "dataforms-layouts-panel__field-label", - children: field.label + children: fieldLabel }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Dropdown, { - contentClassName: "dataforms-layouts-panel__field-dropdown", - popoverProps: popoverProps, - focusOnMount: true, - toggleProps: { - size: 'compact', - variant: 'tertiary', - tooltipPosition: 'middle left' - }, - renderToggle: ({ - isOpen, - onToggle - }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - className: "dataforms-layouts-panel__field-control", - size: "compact", - variant: "tertiary", - "aria-expanded": isOpen, - "aria-label": (0,external_wp_i18n_namespaceObject.sprintf)( - // translators: %s: Field name. - (0,external_wp_i18n_namespaceObject._x)('Edit %s', 'field'), field.label), - onClick: onToggle, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(field.render, { - item: data - }) - }), - renderContent: ({ - onClose - }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DropdownHeader, { - title: field.label, - onClose: onClose - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(field.Edit, { - data: data, - field: field, - onChange: onChange, - hideLabelFromVision: true - }, field.id)] - }) + className: "dataforms-layouts-panel__field-control", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PanelDropdown, { + field: field, + popoverAnchor: popoverAnchor, + fieldDefinition: fieldDefinition, + data: data, + onChange: onChange, + labelPosition: labelPosition }) })] }); } -function FormPanel({ + +;// ./node_modules/@wordpress/dataviews/build-module/dataforms-layouts/index.js +/* wp:polyfill */ +/** + * Internal dependencies + */ + + +const FORM_FIELD_LAYOUTS = [{ + type: 'regular', + component: FormRegularField +}, { + type: 'panel', + component: FormPanelField +}]; +function getFormFieldLayout(type) { + return FORM_FIELD_LAYOUTS.find(layout => layout.type === type); +} + +;// ./node_modules/@wordpress/dataviews/build-module/normalize-form-fields.js +/* wp:polyfill */ +/** + * Internal dependencies + */ + +function normalizeFormFields(form) { + var _form$type, _form$labelPosition, _form$fields; + let layout = 'regular'; + if (['regular', 'panel'].includes((_form$type = form.type) !== null && _form$type !== void 0 ? _form$type : '')) { + layout = form.type; + } + const labelPosition = (_form$labelPosition = form.labelPosition) !== null && _form$labelPosition !== void 0 ? _form$labelPosition : layout === 'regular' ? 'top' : 'side'; + return ((_form$fields = form.fields) !== null && _form$fields !== void 0 ? _form$fields : []).map(field => { + var _field$layout, _field$labelPosition; + if (typeof field === 'string') { + return { + id: field, + layout, + labelPosition + }; + } + const fieldLayout = (_field$layout = field.layout) !== null && _field$layout !== void 0 ? _field$layout : layout; + const fieldLabelPosition = (_field$labelPosition = field.labelPosition) !== null && _field$labelPosition !== void 0 ? _field$labelPosition : fieldLayout === 'regular' ? 'top' : 'side'; + return { + ...field, + layout: fieldLayout, + labelPosition: fieldLabelPosition + }; + }); +} + +;// ./node_modules/@wordpress/dataviews/build-module/dataforms-layouts/data-form-layout.js +/* wp:polyfill */ +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + + + + + +function DataFormLayout({ data, - fields, form, - onChange + onChange, + children }) { - const visibleFields = (0,external_wp_element_namespaceObject.useMemo)(() => { - var _form$fields; - return normalizeFields(((_form$fields = form.fields) !== null && _form$fields !== void 0 ? _form$fields : []).map(fieldId => fields.find(({ - id - }) => id === fieldId)).filter(field => !!field)); - }, [fields, form.fields]); + const { + fields: fieldDefinitions + } = (0,external_wp_element_namespaceObject.useContext)(dataform_context); + function getFieldDefinition(field) { + const fieldId = typeof field === 'string' ? field : field.id; + return fieldDefinitions.find(fieldDefinition => fieldDefinition.id === fieldId); + } + const normalizedFormFields = (0,external_wp_element_namespaceObject.useMemo)(() => normalizeFormFields(form), [form]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 2, - children: visibleFields.map(field => { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(FormField, { + children: normalizedFormFields.map(formField => { + const FieldLayout = getFormFieldLayout(formField.layout)?.component; + if (!FieldLayout) { + return null; + } + const fieldDefinition = !isCombinedField(formField) ? getFieldDefinition(formField) : undefined; + if (fieldDefinition && fieldDefinition.isVisible && !fieldDefinition.isVisible(data)) { + return null; + } + if (children) { + return children(FieldLayout, formField); + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(FieldLayout, { data: data, - field: field, + field: formField, onChange: onChange - }, field.id); + }, formField.id); }) }); } -;// ./node_modules/@wordpress/dataviews/build-module/dataforms-layouts/index.js -/** - * Internal dependencies - */ - - -const FORM_LAYOUTS = [{ - type: 'regular', - component: FormRegular -}, { - type: 'panel', - component: FormPanel -}]; -function getFormLayout(type) { - return FORM_LAYOUTS.find(layout => layout.type === type); -} - ;// ./node_modules/@wordpress/dataviews/build-module/components/dataform/index.js +/** + * WordPress dependencies + */ + + /** * Internal dependencies */ + + function DataForm({ + data, form, - ...props + fields, + onChange }) { - var _form$type; - const layout = getFormLayout((_form$type = form.type) !== null && _form$type !== void 0 ? _form$type : 'regular'); - if (!layout) { + const normalizedFields = (0,external_wp_element_namespaceObject.useMemo)(() => normalizeFields(fields), [fields]); + if (!form.fields) { return null; } - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(layout.component, { - form: form, - ...props + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataFormProvider, { + fields: normalizedFields, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataFormLayout, { + data: data, + form: form, + onChange: onChange + }) }); } ;// ./node_modules/@wordpress/edit-site/build-module/components/post-edit/index.js +/* wp:polyfill */ /** * External dependencies */ @@ -41020,18 +41976,27 @@ function DataForm({ const { + usePostFields: post_edit_usePostFields, PostCardPanel } = unlock(external_wp_editor_namespaceObject.privateApis); +const fieldsWithBulkEditSupport = ['title', 'status', 'date', 'author', 'comment_status']; function PostEditForm({ postType, postId }) { const ids = (0,external_wp_element_namespaceObject.useMemo)(() => postId.split(','), [postId]); const { - record + record, + hasFinishedResolution } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const args = ['postType', postType, ids[0]]; + const { + getEditedEntityRecord, + hasFinishedResolution: hasFinished + } = select(external_wp_coreData_namespaceObject.store); return { - record: ids.length === 1 ? select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord('postType', postType, ids[0]) : null + record: ids.length === 1 ? getEditedEntityRecord(...args) : null, + hasFinishedResolution: hasFinished('getEditedEntityRecord', args) }; }, [postType, ids]); const [multiEdits, setMultiEdits] = (0,external_wp_element_namespaceObject.useState)({}); @@ -41040,7 +42005,9 @@ function PostEditForm({ } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); const { fields: _fields - } = post_fields(); + } = post_edit_usePostFields({ + postType + }); const fields = (0,external_wp_element_namespaceObject.useMemo)(() => _fields?.map(field => { if (field.id === 'status') { return { @@ -41050,16 +42017,28 @@ function PostEditForm({ } return field; }), [_fields]); - const form = { + const form = (0,external_wp_element_namespaceObject.useMemo)(() => ({ type: 'panel', - fields: ['title', 'status', 'date', 'author', 'comment_status'] - }; + fields: [{ + id: 'featured_media', + layout: 'regular' + }, { + id: 'status', + label: (0,external_wp_i18n_namespaceObject.__)('Status & Visibility'), + children: ['status', 'password'] + }, 'author', 'date', 'slug', 'parent', 'comment_status', { + label: (0,external_wp_i18n_namespaceObject.__)('Template'), + labelPosition: 'side', + id: 'template', + layout: 'regular' + }].filter(field => ids.length === 1 || fieldsWithBulkEditSupport.includes(field)) + }), [ids]); const onChange = edits => { for (const id of ids) { - if (edits.status !== 'future' && record.status === 'future' && new Date(record.date) > new Date()) { + if (edits.status && edits.status !== 'future' && record?.status === 'future' && new Date(record.date) > new Date()) { edits.date = null; } - if (edits.status === 'private' && record.password) { + if (edits.status && edits.status === 'private' && record.password) { edits.password = ''; } editEntityRecord('postType', postType, id, edits); @@ -41074,14 +42053,40 @@ function PostEditForm({ (0,external_wp_element_namespaceObject.useEffect)(() => { setMultiEdits({}); }, [ids]); + const { + ExperimentalBlockEditorProvider + } = unlock(external_wp_blockEditor_namespaceObject.privateApis); + const settings = usePatternSettings(); + + /** + * The template field depends on the block editor settings. + * This is a workaround to ensure that the block editor settings are available. + * For more information, see: https://github.com/WordPress/gutenberg/issues/67521 + */ + const fieldsWithDependency = (0,external_wp_element_namespaceObject.useMemo)(() => { + return fields.map(field => { + if (field.id === 'template') { + return { + ...field, + Edit: data => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ExperimentalBlockEditorProvider, { + settings: settings, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(field.Edit, { + ...data + }) + }) + }; + } + return field; + }); + }, [fields, settings]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 4, - children: [ids.length === 1 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostCardPanel, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostCardPanel, { postType: postType, - postId: ids[0] - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataForm, { + postId: ids + }), hasFinishedResolution && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataForm, { data: ids.length === 1 ? record : multiEdits, - fields: fields, + fields: fieldsWithDependency, form: form, onChange: onChange })] @@ -41105,7 +42110,7 @@ function PostEdit({ }); } -;// ./node_modules/@wordpress/edit-site/build-module/components/layout/router.js +;// ./node_modules/@wordpress/edit-site/build-module/components/site-editor-routes/pages.js /** * WordPress dependencies */ @@ -41122,202 +42127,134 @@ function PostEdit({ - - - - - - - - - const { - useLocation: router_useLocation, - useHistory: router_useHistory + useLocation: pages_useLocation } = unlock(external_wp_router_namespaceObject.privateApis); -function useRedirectOldPaths() { - const history = router_useHistory(); +function MobilePagesView() { const { - params - } = router_useLocation(); - (0,external_wp_element_namespaceObject.useEffect)(() => { - const { - postType, - path, - categoryType, - ...rest - } = params; - if (path === '/wp_template_part/all') { - history.replace({ - postType: TEMPLATE_PART_POST_TYPE - }); - } - if (path === '/page') { - history.replace({ - postType: 'page', - ...rest - }); - } - if (path === '/wp_template') { - history.replace({ - postType: TEMPLATE_POST_TYPE, - ...rest - }); - } - if (path === '/patterns') { - history.replace({ - postType: categoryType === TEMPLATE_PART_POST_TYPE ? TEMPLATE_PART_POST_TYPE : PATTERN_TYPES.user, - ...rest - }); - } - if (path === '/navigation') { - history.replace({ - postType: NAVIGATION_POST_TYPE, - ...rest - }); - } - }, [history, params]); + query = {} + } = pages_useLocation(); + const { + canvas = 'view' + } = query; + return canvas === 'edit' ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, {}) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostList, { + postType: "page" + }); } -function useLayoutAreas() { - const { - params - } = router_useLocation(); - const { - postType, - postId, - path, - layout, - isCustom, - canvas, - quickEdit - } = params; - const hasEditCanvasMode = canvas === 'edit'; - useRedirectOldPaths(); - - // Page list - if (postType === 'page') { - const isListLayout = layout === 'list' || !layout; - const showQuickEdit = quickEdit && !isListLayout; - return { - key: 'pages', - areas: { - sidebar: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreen, { - title: (0,external_wp_i18n_namespaceObject.__)('Pages'), - backPath: {}, - content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataViewsSidebarContent, {}) - }), - content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostList, { - postType: postType - }), - preview: !showQuickEdit && (isListLayout || hasEditCanvasMode) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, {}), - mobile: hasEditCanvasMode ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, {}) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostList, { - postType: postType - }), - edit: showQuickEdit && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostEdit, { - postType: postType, - postId: postId - }) - }, - widths: { - content: isListLayout ? 380 : undefined, - edit: showQuickEdit ? 380 : undefined - } - }; - } - - // Templates - if (postType === TEMPLATE_POST_TYPE) { - const isListLayout = isCustom !== 'true' && layout === 'list'; - return { - key: 'templates', - areas: { - sidebar: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenTemplatesBrowse, { - backPath: {} - }), - content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PageTemplates, {}), - preview: (isListLayout || hasEditCanvasMode) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, {}), - mobile: hasEditCanvasMode ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, {}) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PageTemplates, {}) - }, - widths: { - content: isListLayout ? 380 : undefined - } - }; - } - - // Patterns - if ([TEMPLATE_PART_POST_TYPE, PATTERN_TYPES.user].includes(postType)) { - return { - key: 'patterns', - areas: { - sidebar: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenPatterns, { - backPath: {} - }), - content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataviewsPatterns, {}), - mobile: hasEditCanvasMode ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, {}) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataviewsPatterns, {}), - preview: hasEditCanvasMode && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, {}) - } - }; - } - - // Styles - if (path === '/wp_global_styles') { - return { - key: 'styles', - areas: { - sidebar: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenGlobalStyles, { - backPath: {} - }), - preview: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, {}), - mobile: hasEditCanvasMode && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, {}) - } - }; - } - - // Navigation - if (postType === NAVIGATION_POST_TYPE) { - if (postId) { - return { - key: 'navigation', - areas: { - sidebar: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenNavigationMenu, { - backPath: { - postType: NAVIGATION_POST_TYPE - } - }), - preview: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, {}), - mobile: hasEditCanvasMode && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, {}) - } - }; +const pagesRoute = { + name: 'pages', + path: '/page', + areas: { + sidebar: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreen, { + title: (0,external_wp_i18n_namespaceObject.__)('Pages'), + backPath: "/", + content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataViewsSidebarContent, { + postType: "page" + }) + }), + content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostList, { + postType: "page" + }), + preview({ + query + }) { + const isListView = (query.layout === 'list' || !query.layout) && query.isCustom !== 'true'; + return isListView ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, {}) : undefined; + }, + mobile: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MobilePagesView, {}), + edit({ + query + }) { + var _query$layout; + const hasQuickEdit = ((_query$layout = query.layout) !== null && _query$layout !== void 0 ? _query$layout : 'list') !== 'list' && !!query.quickEdit; + return hasQuickEdit ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostEdit, { + postType: "page", + postId: query.postId + }) : undefined; } - return { - key: 'navigation', - areas: { - sidebar: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenNavigationMenus, { - backPath: {} - }), - preview: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, {}), - mobile: hasEditCanvasMode && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, {}) - } - }; - } - - // Fallback shows the home page preview - return { - key: 'default', - areas: { - sidebar: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenMain, {}), - preview: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, {}), - mobile: hasEditCanvasMode && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, {}) + }, + widths: { + content({ + query + }) { + const isListView = (query.layout === 'list' || !query.layout) && query.isCustom !== 'true'; + return isListView ? 380 : undefined; + }, + edit({ + query + }) { + var _query$layout2; + const hasQuickEdit = ((_query$layout2 = query.layout) !== null && _query$layout2 !== void 0 ? _query$layout2 : 'list') !== 'list' && !!query.quickEdit; + return hasQuickEdit ? 380 : undefined; } - }; -} + } +}; -;// ./node_modules/@wordpress/edit-site/build-module/hooks/commands/use-set-command-context.js +;// ./node_modules/@wordpress/edit-site/build-module/components/site-editor-routes/page-item.js /** * WordPress dependencies */ +/** + * Internal dependencies + */ + + + + +const pageItemRoute = { + name: 'page-item', + path: '/page/:postId', + areas: { + sidebar: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreen, { + title: (0,external_wp_i18n_namespaceObject.__)('Pages'), + backPath: "/", + content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataViewsSidebarContent, { + postType: "page" + }) + }), + mobile: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, {}), + preview: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, {}) + } +}; + +;// ./node_modules/@wordpress/edit-site/build-module/components/site-editor-routes/stylebook.js +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + + +const stylebookRoute = { + name: 'stylebook', + path: '/stylebook', + areas: { + sidebar: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreen, { + title: (0,external_wp_i18n_namespaceObject.__)('Styles'), + backPath: "/", + description: (0,external_wp_i18n_namespaceObject.__)(`Preview your website's visual identity: colors, typography, and blocks.`) + }), + preview: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(StyleBookPreview, { + isStatic: true + }), + mobile: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(StyleBookPreview, { + isStatic: true + }) + } +}; + +;// ./node_modules/@wordpress/edit-site/build-module/components/site-editor-routes/index.js +/* wp:polyfill */ +/** + * WordPress dependencies + */ + /** @@ -41326,48 +42263,28 @@ function useLayoutAreas() { -const { - useCommandContext -} = unlock(external_wp_commands_namespaceObject.privateApis); -/** - * React hook used to set the correct command context based on the current state. - */ -function useSetCommandContext() { + + + + + + + + + + +const site_editor_routes_routes = [pageItemRoute, pagesRoute, templateItemRoute, templatesRoute, templatePartItemRoute, patternItemRoute, patternsRoute, navigationItemRoute, navigationRoute, stylesRoute, homeRoute, stylebookRoute]; +function useRegisterSiteEditorRoutes() { + const registry = (0,external_wp_data_namespaceObject.useRegistry)(); const { - hasBlockSelected, - canvasMode - } = (0,external_wp_data_namespaceObject.useSelect)(select => { - const { - getCanvasMode - } = unlock(select(store)); - const { - getBlockSelectionStart - } = select(external_wp_blockEditor_namespaceObject.store); - return { - canvasMode: getCanvasMode(), - hasBlockSelected: getBlockSelectionStart() - }; - }, []); - const hasEditorCanvasContainer = useHasEditorCanvasContainer(); - - // Sets the right context for the command palette - let commandContext = 'site-editor'; - if (canvasMode === 'edit') { - commandContext = 'entity-edit'; - } - if (hasBlockSelected) { - commandContext = 'block-selection-edit'; - } - if (hasEditorCanvasContainer) { - /* - * The editor canvas overlay will likely be deprecated in the future, so for now we clear the command context - * to remove the suggested commands that may not make sense with Style Book or Style Revisions open. - * See https://github.com/WordPress/gutenberg/issues/62216. - */ - commandContext = ''; - } - useCommandContext(commandContext); + registerRoute + } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store)); + (0,external_wp_element_namespaceObject.useEffect)(() => { + registry.batch(() => { + site_editor_routes_routes.forEach(registerRoute); + }); + }, [registry, registerRoute]); } ;// ./node_modules/@wordpress/edit-site/build-module/components/app/index.js @@ -41378,10 +42295,6 @@ function useSetCommandContext() { - - - - /** * Internal dependencies */ @@ -41393,40 +42306,42 @@ function useSetCommandContext() { - const { RouterProvider } = unlock(external_wp_router_namespaceObject.privateApis); -const { - GlobalStylesProvider -} = unlock(external_wp_editor_namespaceObject.privateApis); function AppLayout() { - // This ensures the edited entity id and type are initialized properly. - useInitEditedEntityFromURL(); - useEditModeCommands(); useCommonCommands(); useSetCommandContext(); - const route = useLayoutAreas(); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Layout, { - route: route - }); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(LayoutWithGlobalStylesProvider, {}); } function App() { - const { - createErrorNotice - } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); - function onPluginAreaError(name) { - createErrorNotice((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: plugin name */ - (0,external_wp_i18n_namespaceObject.__)('The "%s" plugin has encountered an error and cannot be rendered.'), name)); - } - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SlotFillProvider, { - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(GlobalStylesProvider, { - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.UnsavedChangesWarning, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(RouterProvider, { - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(AppLayout, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_plugins_namespaceObject.PluginArea, { - onError: onPluginAreaError - })] - })] - }) + useRegisterSiteEditorRoutes(); + const routes = (0,external_wp_data_namespaceObject.useSelect)(select => { + return unlock(select(store)).getRoutes(); + }, []); + const beforeNavigate = (0,external_wp_element_namespaceObject.useCallback)(({ + path, + query + }) => { + if (!isPreviewingTheme()) { + return { + path, + query + }; + } + return { + path, + query: { + ...query, + wp_theme_preview: 'wp_theme_preview' in query ? query.wp_theme_preview : currentlyPreviewingTheme() + } + }; + }, []); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(RouterProvider, { + routes: routes, + pathArg: "p", + beforeNavigate: beforeNavigate, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(AppLayout, {}) }); } @@ -41487,14 +42402,13 @@ function PluginSidebarMoreMenuItem(props) { } /* eslint-enable jsdoc/require-param */ -;// ./node_modules/@wordpress/edit-site/build-module/components/posts-app/router.js +;// ./node_modules/@wordpress/edit-site/build-module/components/posts-app-routes/posts.js /** * WordPress dependencies */ - /** * Internal dependencies */ @@ -41506,63 +42420,129 @@ function PluginSidebarMoreMenuItem(props) { const { - useLocation: posts_app_router_useLocation + useLocation: posts_useLocation } = unlock(external_wp_router_namespaceObject.privateApis); -function router_useLayoutAreas() { +function MobilePostsView() { const { - params = {} - } = posts_app_router_useLocation(); + query = {} + } = posts_useLocation(); const { - postType, - layout, - canvas - } = params; - const labels = (0,external_wp_data_namespaceObject.useSelect)(select => { - return select(external_wp_coreData_namespaceObject.store).getPostType(postType)?.labels; - }, [postType]); - - // Posts list. - if (['post'].includes(postType)) { - const isListLayout = layout === 'list' || !layout; - return { - key: 'posts-list', - areas: { - sidebar: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreen, { - title: labels?.name, - isRoot: true, - content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataViewsSidebarContent, {}) - }), - content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostList, { - postType: postType - }), - preview: (isListLayout || canvas === 'edit') && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, { - isPostsList: true - }), - mobile: canvas === 'edit' ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, { - isPostsList: true - }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostList, { - postType: postType - }) - }, - widths: { - content: isListLayout ? 380 : undefined - } - }; - } - - // Fallback shows the home page preview - return { - key: 'default', - areas: { - sidebar: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenMain, {}), - preview: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, { - isPostsList: true - }), - mobile: canvas === 'edit' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, { - isPostsList: true + canvas = 'view' + } = query; + return canvas === 'edit' ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, {}) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostList, { + postType: "post" + }); +} +const postsRoute = { + name: 'posts', + path: '/', + areas: { + sidebar: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreen, { + title: (0,external_wp_i18n_namespaceObject.__)('Posts'), + isRoot: true, + content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataViewsSidebarContent, { + postType: "post" }) + }), + content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostList, { + postType: "post" + }), + preview({ + query + }) { + const isListView = (query.layout === 'list' || !query.layout) && query.isCustom !== 'true'; + return isListView ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, { + isPostsList: true + }) : undefined; + }, + mobile: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MobilePostsView, {}), + edit({ + query + }) { + var _query$layout; + const hasQuickEdit = ((_query$layout = query.layout) !== null && _query$layout !== void 0 ? _query$layout : 'list') === 'list' && !!query.quickEdit; + return hasQuickEdit ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostEdit, { + postType: "post", + postId: query.postId + }) : undefined; } - }; + }, + widths: { + content({ + query + }) { + const isListView = (query.layout === 'list' || !query.layout) && query.isCustom !== 'true'; + return isListView ? 380 : undefined; + }, + edit({ + query + }) { + var _query$layout2; + const hasQuickEdit = ((_query$layout2 = query.layout) !== null && _query$layout2 !== void 0 ? _query$layout2 : 'list') === 'list' && !!query.quickEdit; + return hasQuickEdit ? 380 : undefined; + } + } +}; + +;// ./node_modules/@wordpress/edit-site/build-module/components/posts-app-routes/post-item.js +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + + + +const postItemRoute = { + name: 'post-item', + path: '/post/:postId', + areas: { + sidebar: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreen, { + title: (0,external_wp_i18n_namespaceObject.__)('Posts'), + isRoot: true, + content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataViewsSidebarContent, { + postType: "post" + }) + }), + mobile: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, { + isPostsList: true + }), + preview: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, { + isPostsList: true + }) + } +}; + +;// ./node_modules/@wordpress/edit-site/build-module/components/posts-app-routes/index.js +/* wp:polyfill */ +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + + + +const posts_app_routes_routes = [postItemRoute, postsRoute]; +function useRegisterPostsAppRoutes() { + const registry = (0,external_wp_data_namespaceObject.useRegistry)(); + const { + registerRoute + } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store)); + (0,external_wp_element_namespaceObject.useEffect)(() => { + registry.batch(() => { + posts_app_routes_routes.forEach(registerRoute); + }); + }, [registry, registerRoute]); } ;// ./node_modules/@wordpress/edit-site/build-module/components/posts-app/index.js @@ -41580,30 +42560,23 @@ function router_useLayoutAreas() { - const { RouterProvider: posts_app_RouterProvider } = unlock(external_wp_router_namespaceObject.privateApis); -const { - GlobalStylesProvider: posts_app_GlobalStylesProvider -} = unlock(external_wp_editor_namespaceObject.privateApis); -function PostsLayout() { - // This ensures the edited entity id and type are initialized properly. - useInitEditedEntityFromURL(); - const route = router_useLayoutAreas(); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Layout, { - route: route - }); -} function PostsApp() { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(posts_app_GlobalStylesProvider, { - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.UnsavedChangesWarning, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(posts_app_RouterProvider, { - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostsLayout, {}) - })] + useRegisterPostsAppRoutes(); + const routes = (0,external_wp_data_namespaceObject.useSelect)(select => { + return unlock(select(store)).getRoutes(); + }, []); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(posts_app_RouterProvider, { + routes: routes, + pathArg: "p", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(LayoutWithGlobalStylesProvider, {}) }); } ;// ./node_modules/@wordpress/edit-site/build-module/posts.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -41663,6 +42636,7 @@ function initializePostsDashboard(id, settings) { allowRightClickOverrides: true, distractionFree: false, editorMode: 'visual', + editorTool: 'edit', fixedToolbar: false, focusMode: false, inactivePanels: [], @@ -41677,13 +42651,14 @@ function initializePostsDashboard(id, settings) { // Prevent the default browser action for files dropped outside of dropzones. window.addEventListener('dragover', e => e.preventDefault(), false); window.addEventListener('drop', e => e.preventDefault(), false); - root.render( /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.StrictMode, { + root.render(/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.StrictMode, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostsApp, {}) })); return root; } ;// ./node_modules/@wordpress/edit-site/build-module/index.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -41744,6 +42719,7 @@ function initializeEditor(id, settings) { allowRightClickOverrides: true, distractionFree: false, editorMode: 'visual', + editorTool: 'edit', fixedToolbar: false, focusMode: false, inactivePanels: [], @@ -41761,19 +42737,10 @@ function initializeEditor(id, settings) { } (0,external_wp_data_namespaceObject.dispatch)(store).updateSettings(settings); - // Keep the defaultTemplateTypes in the core/editor settings too, - // so that they can be selected with core/editor selectors in any editor. - // This is needed because edit-site doesn't initialize with EditorProvider, - // which internally uses updateEditorSettings as well. - (0,external_wp_data_namespaceObject.dispatch)(external_wp_editor_namespaceObject.store).updateEditorSettings({ - defaultTemplateTypes: settings.defaultTemplateTypes, - defaultTemplatePartAreas: settings.defaultTemplatePartAreas - }); - // Prevent the default browser action for files dropped outside of dropzones. window.addEventListener('dragover', e => e.preventDefault(), false); window.addEventListener('drop', e => e.preventDefault(), false); - root.render( /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.StrictMode, { + root.render(/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.StrictMode, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(App, {}) })); return root; diff --git a/wp-includes/js/dist/edit-site.min.js b/wp-includes/js/dist/edit-site.min.js index ea3c033d21..2217a11daa 100644 --- a/wp-includes/js/dist/edit-site.min.js +++ b/wp-includes/js/dist/edit-site.min.js @@ -1,11 +1,11 @@ /*! This file is auto-generated */ -(()=>{var e,t,s={4660:e=>{e.exports=function(){function e(t,s,n){function i(o,a){if(!s[o]){if(!t[o]){if(r)return r(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var c=s[o]={exports:{}};t[o][0].call(c.exports,(function(e){return i(t[o][1][e]||e)}),c,c.exports,e,t,s,n)}return s[o].exports}for(var r=void 0,o=0;o=252?6:a>=248?5:a>=240?4:a>=224?3:a>=192?2:1;function l(e,t){if(t<65534&&(e.subarray&&r||!e.subarray&&i))return String.fromCharCode.apply(null,n.shrinkBuf(e,t));for(var s="",o=0;o>>6,t[o++]=128|63&s):s<65536?(t[o++]=224|s>>>12,t[o++]=128|s>>>6&63,t[o++]=128|63&s):(t[o++]=240|s>>>18,t[o++]=128|s>>>12&63,t[o++]=128|s>>>6&63,t[o++]=128|63&s);return t},s.buf2binstring=function(e){return l(e,e.length)},s.binstring2buf=function(e){for(var t=new n.Buf8(e.length),s=0,i=t.length;s4)c[n++]=65533,s+=r-1;else{for(i&=2===r?31:3===r?15:7;r>1&&s1?c[n++]=65533:i<65536?c[n++]=i:(i-=65536,c[n++]=55296|i>>10&1023,c[n++]=56320|1023&i)}return l(c,n)},s.utf8border=function(e,t){var s;for((t=t||e.length)>e.length&&(t=e.length),s=t-1;s>=0&&128==(192&e[s]);)s--;return s<0||0===s?t:s+o[e[s]]>t?s:t}},{"./common":1}],3:[function(e,t,s){"use strict";function n(e,t,s,n){for(var i=65535&e,r=e>>>16&65535,o=0;0!==s;){s-=o=s>2e3?2e3:s;do{r=r+(i=i+t[n++]|0)|0}while(--o);i%=65521,r%=65521}return i|r<<16}t.exports=n},{}],4:[function(e,t,s){"use strict";t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],5:[function(e,t,s){"use strict";function n(){for(var e,t=[],s=0;s<256;s++){e=s;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[s]=e}return t}var i=n();function r(e,t,s,n){var r=i,o=n+s;e^=-1;for(var a=n;a>>8^r[255&(e^t[a])];return~e}t.exports=r},{}],6:[function(e,t,s){"use strict";function n(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}t.exports=n},{}],7:[function(e,t,s){"use strict";var n=30,i=12;t.exports=function(e,t){var s,r,o,a,l,c,u,d,p,h,f,m,g,v,x,y,b,w,_,S,j,C,k,E,P;s=e.state,r=e.next_in,E=e.input,o=r+(e.avail_in-5),a=e.next_out,P=e.output,l=a-(t-e.avail_out),c=a+(e.avail_out-257),u=s.dmax,d=s.wsize,p=s.whave,h=s.wnext,f=s.window,m=s.hold,g=s.bits,v=s.lencode,x=s.distcode,y=(1<>>=_=w>>>24,g-=_,0==(_=w>>>16&255))P[a++]=65535&w;else{if(!(16&_)){if(64&_){if(32&_){s.mode=i;break e}e.msg="invalid literal/length code",s.mode=n;break e}w=v[(65535&w)+(m&(1<<_)-1)];continue t}for(S=65535&w,(_&=15)&&(g<_&&(m+=E[r++]<>>=_,g-=_),g<15&&(m+=E[r++]<>>=_=w>>>24,g-=_,16&(_=w>>>16&255)){if(j=65535&w,g<(_&=15)&&(m+=E[r++]<u){e.msg="invalid distance too far back",s.mode=n;break e}if(m>>>=_,g-=_,j>(_=a-l)){if((_=j-_)>p&&s.sane){e.msg="invalid distance too far back",s.mode=n;break e}if(C=0,k=f,0===h){if(C+=d-_,_2;)P[a++]=k[C++],P[a++]=k[C++],P[a++]=k[C++],S-=3;S&&(P[a++]=k[C++],S>1&&(P[a++]=k[C++]))}else{C=a-j;do{P[a++]=P[C++],P[a++]=P[C++],P[a++]=P[C++],S-=3}while(S>2);S&&(P[a++]=P[C++],S>1&&(P[a++]=P[C++]))}break}if(64&_){e.msg="invalid distance code",s.mode=n;break e}w=x[(65535&w)+(m&(1<<_)-1)]}}break}}while(r>3,m&=(1<<(g-=S<<3))-1,e.next_in=r,e.next_out=a,e.avail_in=r>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function ne(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function ie(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=_,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new n.Buf32($),t.distcode=t.distdyn=new n.Buf32(ee),t.sane=1,t.back=-1,f):v}function re(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,ie(e)):v}function oe(e,t){var s,n;return e&&e.state?(n=e.state,t<0?(s=0,t=-t):(s=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?v:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=s,n.wbits=t,re(e))):v}function ae(e,t){var s,n;return e?(n=new ne,e.state=n,n.window=null,(s=oe(e,t))!==f&&(e.state=null),s):v}function le(e){return ae(e,te)}var ce,ue,de=!0;function pe(e){if(de){var t;for(ce=new n.Buf32(512),ue=new n.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(a(c,e.lens,0,288,ce,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;a(u,e.lens,0,32,ue,0,e.work,{bits:5}),de=!1}e.lencode=ce,e.lenbits=9,e.distcode=ue,e.distbits=5}function he(e,t,s,i){var r,o=e.state;return null===o.window&&(o.wsize=1<=o.wsize?(n.arraySet(o.window,t,s-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):((r=o.wsize-o.wnext)>i&&(r=i),n.arraySet(o.window,t,s-i,r,o.wnext),(i-=r)?(n.arraySet(o.window,t,s-i,i,0),o.wnext=i,o.whave=o.wsize):(o.wnext+=r,o.wnext===o.wsize&&(o.wnext=0),o.whave>>8&255,s.check=r(s.check,ke,2,0),oe=0,ae=0,s.mode=S;break}if(s.flags=0,s.head&&(s.head.done=!1),!(1&s.wrap)||(((255&oe)<<8)+(oe>>8))%31){e.msg="incorrect header check",s.mode=J;break}if((15&oe)!==w){e.msg="unknown compression method",s.mode=J;break}if(ae-=4,we=8+(15&(oe>>>=4)),0===s.wbits)s.wbits=we;else if(we>s.wbits){e.msg="invalid window size",s.mode=J;break}s.dmax=1<>8&1),512&s.flags&&(ke[0]=255&oe,ke[1]=oe>>>8&255,s.check=r(s.check,ke,2,0)),oe=0,ae=0,s.mode=j;case j:for(;ae<32;){if(0===ie)break e;ie--,oe+=$[te++]<>>8&255,ke[2]=oe>>>16&255,ke[3]=oe>>>24&255,s.check=r(s.check,ke,4,0)),oe=0,ae=0,s.mode=C;case C:for(;ae<16;){if(0===ie)break e;ie--,oe+=$[te++]<>8),512&s.flags&&(ke[0]=255&oe,ke[1]=oe>>>8&255,s.check=r(s.check,ke,2,0)),oe=0,ae=0,s.mode=k;case k:if(1024&s.flags){for(;ae<16;){if(0===ie)break e;ie--,oe+=$[te++]<>>8&255,s.check=r(s.check,ke,2,0)),oe=0,ae=0}else s.head&&(s.head.extra=null);s.mode=E;case E:if(1024&s.flags&&((ue=s.length)>ie&&(ue=ie),ue&&(s.head&&(we=s.head.extra_len-s.length,s.head.extra||(s.head.extra=new Array(s.head.extra_len)),n.arraySet(s.head.extra,$,te,ue,we)),512&s.flags&&(s.check=r(s.check,$,ue,te)),ie-=ue,te+=ue,s.length-=ue),s.length))break e;s.length=0,s.mode=P;case P:if(2048&s.flags){if(0===ie)break e;ue=0;do{we=$[te+ue++],s.head&&we&&s.length<65536&&(s.head.name+=String.fromCharCode(we))}while(we&&ue>9&1,s.head.done=!0),e.adler=s.check=0,s.mode=M;break;case O:for(;ae<32;){if(0===ie)break e;ie--,oe+=$[te++]<>>=7&ae,ae-=7&ae,s.mode=K;break}for(;ae<3;){if(0===ie)break e;ie--,oe+=$[te++]<>>=1)){case 0:s.mode=V;break;case 1:if(pe(s),s.mode=L,t===h){oe>>>=2,ae-=2;break e}break;case 2:s.mode=B;break;case 3:e.msg="invalid block type",s.mode=J}oe>>>=2,ae-=2;break;case V:for(oe>>>=7&ae,ae-=7&ae;ae<32;){if(0===ie)break e;ie--,oe+=$[te++]<>>16^65535)){e.msg="invalid stored block lengths",s.mode=J;break}if(s.length=65535&oe,oe=0,ae=0,s.mode=F,t===h)break e;case F:s.mode=R;case R:if(ue=s.length){if(ue>ie&&(ue=ie),ue>re&&(ue=re),0===ue)break e;n.arraySet(ee,$,te,ue,ne),ie-=ue,te+=ue,re-=ue,ne+=ue,s.length-=ue;break}s.mode=M;break;case B:for(;ae<14;){if(0===ie)break e;ie--,oe+=$[te++]<>>=5,ae-=5,s.ndist=1+(31&oe),oe>>>=5,ae-=5,s.ncode=4+(15&oe),oe>>>=4,ae-=4,s.nlen>286||s.ndist>30){e.msg="too many length or distance symbols",s.mode=J;break}s.have=0,s.mode=D;case D:for(;s.have>>=3,ae-=3}for(;s.have<19;)s.lens[Ee[s.have++]]=0;if(s.lencode=s.lendyn,s.lenbits=7,Se={bits:s.lenbits},_e=a(l,s.lens,0,19,s.lencode,0,s.work,Se),s.lenbits=Se.bits,_e){e.msg="invalid code lengths set",s.mode=J;break}s.have=0,s.mode=z;case z:for(;s.have>>16&255,ve=65535&Ce,!((me=Ce>>>24)<=ae);){if(0===ie)break e;ie--,oe+=$[te++]<>>=me,ae-=me,s.lens[s.have++]=ve;else{if(16===ve){for(je=me+2;ae>>=me,ae-=me,0===s.have){e.msg="invalid bit length repeat",s.mode=J;break}we=s.lens[s.have-1],ue=3+(3&oe),oe>>>=2,ae-=2}else if(17===ve){for(je=me+3;ae>>=me)),oe>>>=3,ae-=3}else{for(je=me+7;ae>>=me)),oe>>>=7,ae-=7}if(s.have+ue>s.nlen+s.ndist){e.msg="invalid bit length repeat",s.mode=J;break}for(;ue--;)s.lens[s.have++]=we}}if(s.mode===J)break;if(0===s.lens[256]){e.msg="invalid code -- missing end-of-block",s.mode=J;break}if(s.lenbits=9,Se={bits:s.lenbits},_e=a(c,s.lens,0,s.nlen,s.lencode,0,s.work,Se),s.lenbits=Se.bits,_e){e.msg="invalid literal/lengths set",s.mode=J;break}if(s.distbits=6,s.distcode=s.distdyn,Se={bits:s.distbits},_e=a(u,s.lens,s.nlen,s.ndist,s.distcode,0,s.work,Se),s.distbits=Se.bits,_e){e.msg="invalid distances set",s.mode=J;break}if(s.mode=L,t===h)break e;case L:s.mode=H;case H:if(ie>=6&&re>=258){e.next_out=ne,e.avail_out=re,e.next_in=te,e.avail_in=ie,s.hold=oe,s.bits=ae,o(e,ce),ne=e.next_out,ee=e.output,re=e.avail_out,te=e.next_in,$=e.input,ie=e.avail_in,oe=s.hold,ae=s.bits,s.mode===M&&(s.back=-1);break}for(s.back=0;ge=(Ce=s.lencode[oe&(1<>>16&255,ve=65535&Ce,!((me=Ce>>>24)<=ae);){if(0===ie)break e;ie--,oe+=$[te++]<>xe)])>>>16&255,ve=65535&Ce,!(xe+(me=Ce>>>24)<=ae);){if(0===ie)break e;ie--,oe+=$[te++]<>>=xe,ae-=xe,s.back+=xe}if(oe>>>=me,ae-=me,s.back+=me,s.length=ve,0===ge){s.mode=Z;break}if(32&ge){s.back=-1,s.mode=M;break}if(64&ge){e.msg="invalid literal/length code",s.mode=J;break}s.extra=15&ge,s.mode=G;case G:if(s.extra){for(je=s.extra;ae>>=s.extra,ae-=s.extra,s.back+=s.extra}s.was=s.length,s.mode=U;case U:for(;ge=(Ce=s.distcode[oe&(1<>>16&255,ve=65535&Ce,!((me=Ce>>>24)<=ae);){if(0===ie)break e;ie--,oe+=$[te++]<>xe)])>>>16&255,ve=65535&Ce,!(xe+(me=Ce>>>24)<=ae);){if(0===ie)break e;ie--,oe+=$[te++]<>>=xe,ae-=xe,s.back+=xe}if(oe>>>=me,ae-=me,s.back+=me,64&ge){e.msg="invalid distance code",s.mode=J;break}s.offset=ve,s.extra=15&ge,s.mode=W;case W:if(s.extra){for(je=s.extra;ae>>=s.extra,ae-=s.extra,s.back+=s.extra}if(s.offset>s.dmax){e.msg="invalid distance too far back",s.mode=J;break}s.mode=q;case q:if(0===re)break e;if(ue=ce-re,s.offset>ue){if((ue=s.offset-ue)>s.whave&&s.sane){e.msg="invalid distance too far back",s.mode=J;break}ue>s.wnext?(ue-=s.wnext,de=s.wsize-ue):de=s.wnext-ue,ue>s.length&&(ue=s.length),fe=s.window}else fe=ee,de=ne-s.offset,ue=s.length;ue>re&&(ue=re),re-=ue,s.length-=ue;do{ee[ne++]=fe[de++]}while(--ue);0===s.length&&(s.mode=H);break;case Z:if(0===re)break e;ee[ne++]=s.length,re--,s.mode=H;break;case K:if(s.wrap){for(;ae<32;){if(0===ie)break e;ie--,oe|=$[te++]<=1&&0===L[A];A--);if(M>A&&(M=A),0===A)return m[g++]=20971520,m[g++]=20971520,x.bits=1,0;for(O=1;O0&&(e===a||1!==A))return-1;for(H[1]=0,I=1;Ir||e===c&&R>o)return 1;for(;;){C=I-V,v[T]j?(k=G[U+v[T]],E=D[z+v[T]]):(k=96,E=0),y=1<>V)+(b-=y)]=C<<24|k<<16|E}while(0!==b);for(y=1<>=1;if(0!==y?(B&=y-1,B+=y):B=0,T++,0==--L[I]){if(I===A)break;I=t[s+v[T]]}if(I>M&&(B&_)!==w){for(0===V&&(V=M),S+=O,F=1<<(N=I-V);N+Vr||e===c&&R>o)return 1;m[w=B&_]=M<<24|N<<16|S-g}}return 0!==B&&(m[S+B]=I-V<<24|64<<16),x.bits=M,0}},{"../utils/common":1}],10:[function(e,t,s){"use strict";t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],11:[function(e,t,s){"use strict";function n(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}t.exports=n},{}],"/lib/inflate.js":[function(e,t,s){"use strict";var n=e("./zlib/inflate"),i=e("./utils/common"),r=e("./utils/strings"),o=e("./zlib/constants"),a=e("./zlib/messages"),l=e("./zlib/zstream"),c=e("./zlib/gzheader"),u=Object.prototype.toString;function d(e){if(!(this instanceof d))return new d(e);this.options=i.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(15&t.windowBits||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var s=n.inflateInit2(this.strm,t.windowBits);if(s!==o.Z_OK)throw new Error(a[s]);if(this.header=new c,n.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=r.string2buf(t.dictionary):"[object ArrayBuffer]"===u.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(s=n.inflateSetDictionary(this.strm,t.dictionary))!==o.Z_OK))throw new Error(a[s])}function p(e,t){var s=new d(t);if(s.push(e,!0),s.err)throw s.msg||a[s.err];return s.result}function h(e,t){return(t=t||{}).raw=!0,p(e,t)}d.prototype.push=function(e,t){var s,a,l,c,d,p=this.strm,h=this.options.chunkSize,f=this.options.dictionary,m=!1;if(this.ended)return!1;a=t===~~t?t:!0===t?o.Z_FINISH:o.Z_NO_FLUSH,"string"==typeof e?p.input=r.binstring2buf(e):"[object ArrayBuffer]"===u.call(e)?p.input=new Uint8Array(e):p.input=e,p.next_in=0,p.avail_in=p.input.length;do{if(0===p.avail_out&&(p.output=new i.Buf8(h),p.next_out=0,p.avail_out=h),(s=n.inflate(p,o.Z_NO_FLUSH))===o.Z_NEED_DICT&&f&&(s=n.inflateSetDictionary(this.strm,f)),s===o.Z_BUF_ERROR&&!0===m&&(s=o.Z_OK,m=!1),s!==o.Z_STREAM_END&&s!==o.Z_OK)return this.onEnd(s),this.ended=!0,!1;p.next_out&&(0!==p.avail_out&&s!==o.Z_STREAM_END&&(0!==p.avail_in||a!==o.Z_FINISH&&a!==o.Z_SYNC_FLUSH)||("string"===this.options.to?(l=r.utf8border(p.output,p.next_out),c=p.next_out-l,d=r.buf2string(p.output,l),p.next_out=c,p.avail_out=h-c,c&&i.arraySet(p.output,p.output,l,c,0),this.onData(d)):this.onData(i.shrinkBuf(p.output,p.next_out)))),0===p.avail_in&&0===p.avail_out&&(m=!0)}while((p.avail_in>0||0===p.avail_out)&&s!==o.Z_STREAM_END);return s===o.Z_STREAM_END&&(a=o.Z_FINISH),a===o.Z_FINISH?(s=n.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,s===o.Z_OK):a!==o.Z_SYNC_FLUSH||(this.onEnd(o.Z_OK),p.avail_out=0,!0)},d.prototype.onData=function(e){this.chunks.push(e)},d.prototype.onEnd=function(e){e===o.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},s.Inflate=d,s.inflate=p,s.inflateRaw=h,s.ungzip=p},{"./utils/common":1,"./utils/strings":2,"./zlib/constants":4,"./zlib/gzheader":6,"./zlib/inflate":8,"./zlib/messages":10,"./zlib/zstream":11}]},{},[])("/lib/inflate.js")},8572:e=>{e.exports=function(){function e(t,s,n){function i(o,a){if(!s[o]){if(!t[o]){if(r)return r(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var c=s[o]={exports:{}};t[o][0].call(c.exports,(function(e){return i(t[o][1][e]||e)}),c,c.exports,e,t,s,n)}return s[o].exports}for(var r=void 0,o=0;o0},a.prototype.readMoreInput=function(){if(!(this.bit_end_pos_>256))if(this.eos_){if(this.bit_pos_>this.bit_end_pos_)throw new Error("Unexpected end of input "+this.bit_pos_+" "+this.bit_end_pos_)}else{var e=this.buf_ptr_,t=this.input_.read(this.buf_,e,n);if(t<0)throw new Error("Unexpected end of input");if(t=8;)this.val_>>>=8,this.val_|=this.buf_[this.pos_&r]<<24,++this.pos_,this.bit_pos_=this.bit_pos_-8>>>0,this.bit_end_pos_=this.bit_end_pos_-8>>>0},a.prototype.readBits=function(e){32-this.bit_pos_>>this.bit_pos_&o[e];return this.bit_pos_+=e,t},t.exports=a},{}],2:[function(e,t,s){s.lookup=new Uint8Array([0,0,0,0,0,0,0,0,0,4,4,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,12,16,12,12,20,12,16,24,28,12,12,32,12,36,12,44,44,44,44,44,44,44,44,44,44,32,32,24,40,28,12,12,48,52,52,52,48,52,52,52,48,52,52,52,52,52,48,52,52,52,52,52,48,52,52,52,52,52,24,12,28,12,12,12,56,60,60,60,56,60,60,60,56,60,60,60,60,60,56,60,60,60,60,60,56,60,60,60,60,60,24,12,28,12,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,0,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,56,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,6,6,6,6,7,7,7,7,8,8,8,8,9,9,9,9,10,10,10,10,11,11,11,11,12,12,12,12,13,13,13,13,14,14,14,14,15,15,15,15,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,22,22,22,22,23,23,23,23,24,24,24,24,25,25,25,25,26,26,26,26,27,27,27,27,28,28,28,28,29,29,29,29,30,30,30,30,31,31,31,31,32,32,32,32,33,33,33,33,34,34,34,34,35,35,35,35,36,36,36,36,37,37,37,37,38,38,38,38,39,39,39,39,40,40,40,40,41,41,41,41,42,42,42,42,43,43,43,43,44,44,44,44,45,45,45,45,46,46,46,46,47,47,47,47,48,48,48,48,49,49,49,49,50,50,50,50,51,51,51,51,52,52,52,52,53,53,53,53,54,54,54,54,55,55,55,55,56,56,56,56,57,57,57,57,58,58,58,58,59,59,59,59,60,60,60,60,61,61,61,61,62,62,62,62,63,63,63,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),s.lookupOffsets=new Uint16Array([1024,1536,1280,1536,0,256,768,512])},{}],3:[function(e,t,s){var n=e("./streams").BrotliInput,i=e("./streams").BrotliOutput,r=e("./bit_reader"),o=e("./dictionary"),a=e("./huffman").HuffmanCode,l=e("./huffman").BrotliBuildHuffmanTable,c=e("./context"),u=e("./prefix"),d=e("./transform"),p=8,h=16,f=256,m=704,g=26,v=6,x=2,y=8,b=255,w=1080,_=18,S=new Uint8Array([1,2,3,4,0,5,17,6,16,7,8,9,10,11,12,13,14,15]),j=16,C=new Uint8Array([3,2,1,0,3,3,3,3,3,3,2,2,2,2,2,2]),k=new Int8Array([0,0,0,0,-1,1,-2,2,-3,3,-1,1,-2,2,-3,3]),E=new Uint16Array([256,402,436,468,500,534,566,598,630,662,694,726,758,790,822,854,886,920,952,984,1016,1048,1080]);function P(e){var t;return 0===e.readBits(1)?16:(t=e.readBits(3))>0?17+t:(t=e.readBits(3))>0?8+t:17}function I(e){if(e.readBits(1)){var t=e.readBits(3);return 0===t?1:e.readBits(t)+(1<1&&0===r)throw new Error("Invalid size byte");i.meta_block_length|=r<<8*n}}else for(n=0;n4&&0===o)throw new Error("Invalid size nibble");i.meta_block_length|=o<<4*n}return++i.meta_block_length,i.input_end||i.is_metadata||(i.is_uncompressed=e.readBits(1)),i}function A(e,t,s){var n;return s.fillBitWindow(),(n=e[t+=s.val_>>>s.bit_pos_&b].bits-y)>0&&(s.bit_pos_+=y,t+=e[t].value,t+=s.val_>>>s.bit_pos_&(1<0;){var m,g=0;if(n.readMoreInput(),n.fillBitWindow(),g+=n.val_>>>n.bit_pos_&31,n.bit_pos_+=d[g].bits,(m=255&d[g].value)>m);else{var v,x,y=m-14,b=0;if(m===h&&(b=r),c!==b&&(o=0,c=b),v=o,o>0&&(o-=2,o<<=y),i+(x=(o+=n.readBits(y)+3)-v)>t)throw new Error("[ReadHuffmanCodeLengths] symbol + repeat_delta > num_symbols");for(var w=0;w0;++h){var x,b=S[h],w=0;n.fillBitWindow(),w+=n.val_>>>n.bit_pos_&15,n.bit_pos_+=v[w].bits,x=v[w].value,f[b]=x,0!==x&&(m-=32>>x,++g)}if(1!==g&&0!==m)throw new Error("[ReadHuffmanCode] invalid num_codes or space");M(f,e,o,n)}if(0===(r=l(t,s,y,o,e)))throw new Error("[ReadHuffmanCode] BuildHuffmanTable failed: ");return r}function V(e,t,s){var n,i;return n=A(e,t,s),i=u.kBlockLengthPrefixCode[n].nbits,u.kBlockLengthPrefixCode[n].offset+s.readBits(i)}function F(e,t,s){var n;return e>>5]),this.htrees=new Uint32Array(t)}function z(e,t){var s,n,i={num_htrees:null,context_map:null},r=0;t.readMoreInput();var o=i.num_htrees=I(t)+1,l=i.context_map=new Uint8Array(e);if(o<=1)return i;for(t.readBits(1)&&(r=t.readBits(4)+1),s=[],n=0;n=e)throw new Error("[DecodeContextMap] i >= context_map_size");l[n]=0,++n}else l[n]=c-r,++n}return t.readBits(1)&&B(l,e),i}function L(e,t,s,n,i,r,o){var a,l=2*s,c=s,u=A(t,s*w,o);(a=0===u?i[l+(1&r[c])]:1===u?i[l+(r[c]-1&1)]+1:u-2)>=e&&(a-=e),n[s]=a,i[l+(1&r[c])]=a,++r[c]}function H(e,t,s,n,i,o){var a,l=i+1,c=s&i,u=o.pos_&r.IBUF_MASK;if(t<8||o.bit_pos_+(t<<3)0;)o.readMoreInput(),n[c++]=o.readBits(8),c===l&&(e.write(n,l),c=0);else{if(o.bit_end_pos_<32)throw new Error("[CopyUncompressedBlockToOutput] br.bit_end_pos_ < 32");for(;o.bit_pos_<32;)n[c]=o.val_>>>o.bit_pos_,o.bit_pos_+=8,++c,--t;if(u+(a=o.bit_end_pos_-o.bit_pos_>>3)>r.IBUF_MASK){for(var d=r.IBUF_MASK+1-u,p=0;p=l)for(e.write(n,l),c-=l,p=0;p=l;){if(a=l-c,o.input_.read(n,c,a)t.buffer.length){var xe=new Uint8Array(S+se);xe.set(t.buffer),t.buffer=xe}if(C=ve.input_end,Z=ve.is_uncompressed,ve.is_metadata)for(G(_);se>0;--se)_.readMoreInput(),_.readBits(8);else if(0!==se)if(Z)_.bit_pos_=_.bit_pos_+7&-8,H(t,se,S,p,l,_),S+=se;else{for(s=0;s<3;++s)re[s]=I(_)+1,re[s]>=2&&(N(re[s]+2,y,s*w,_),N(g,b,s*w,_),ne[s]=V(b,s*w,_),ae[s]=1);for(_.readMoreInput(),X=(1<<(K=_.readBits(2)))-1,J=(Y=j+(_.readBits(4)<0;){var we,_e,Se,je,Ce,ke,Ee,Pe,Ie,Te,Oe,Ae;for(_.readMoreInput(),0===ne[1]&&(L(re[1],y,1,ie,oe,ae,_),ne[1]=V(b,w,_),te=U[1].htrees[ie[1]]),--ne[1],(_e=(we=A(U[1].codes,te,_))>>6)>=2?(_e-=2,Ee=-1):Ee=0,Se=u.kInsertRangeLut[_e]+(we>>3&7),je=u.kCopyRangeLut[_e]+(7&we),Ce=u.kInsertLengthPrefixCode[Se].offset+_.readBits(u.kInsertLengthPrefixCode[Se].nbits),ke=u.kCopyLengthPrefixCode[je].offset+_.readBits(u.kCopyLengthPrefixCode[je].nbits),R=p[S-1&l],B=p[S-2&l],Ie=0;Ie4?3:ke-2))],(Ee=A(U[2].codes,U[2].htrees[fe],_))>=Y&&(Ae=(Ee-=Y)&X,Ee=Y+((Me=(2+(1&(Ee>>=K))<<(Oe=1+(Ee>>1)))-4)+_.readBits(Oe)<(E=S=o.minDictionaryWordLength&&ke<=o.maxDictionaryWordLength))throw new Error("Invalid backward reference. pos: "+S+" distance: "+Pe+" len: "+ke+" bytes left: "+se);var Me=o.offsetsByLength[ke],Ne=Pe-E-1,Ve=o.sizeBitsByLength[ke],Fe=Ne>>Ve;if(Me+=(Ne&(1<=h){t.write(p,i);for(var Be=0;Be0&&(T[3&M]=Pe,++M),ke>se)throw new Error("Invalid backward reference. pos: "+S+" distance: "+Pe+" len: "+ke+" bytes left: "+se);for(Ie=0;Ie>=1;return(e&s-1)+s}function o(e,t,s,i,r){do{e[t+(i-=s)]=new n(r.bits,r.value)}while(i>0)}function a(e,t,s){for(var n=1<0;--w[u])o(e,t+p,h,v,new n(255&u,65535&y[d++])),p=r(p,u);for(m=x-1,f=-1,u=s+1,h=2;u<=i;++u,h<<=1)for(;w[u]>0;--w[u])(p&m)!==f&&(t+=v,x+=v=1<<(g=a(w,u,s)),e[b+(f=p&m)]=new n(g+s&255,t-b-f&65535)),o(e,t+(p>>s),h,v,new n(u-s&255,65535&y[d++])),p=r(p,u);return x}},{}],8:[function(e,t,s){"use strict";s.byteLength=u,s.toByteArray=p,s.fromByteArray=m;for(var n=[],i=[],r="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,l=o.length;a0)throw new Error("Invalid string. Length must be a multiple of 4");var s=e.indexOf("=");return-1===s&&(s=t),[s,s===t?0:4-s%4]}function u(e){var t=c(e),s=t[0],n=t[1];return 3*(s+n)/4-n}function d(e,t,s){return 3*(t+s)/4-s}function p(e){for(var t,s=c(e),n=s[0],o=s[1],a=new r(d(e,n,o)),l=0,u=o>0?n-4:n,p=0;p>16&255,a[l++]=t>>8&255,a[l++]=255&t;return 2===o&&(t=i[e.charCodeAt(p)]<<2|i[e.charCodeAt(p+1)]>>4,a[l++]=255&t),1===o&&(t=i[e.charCodeAt(p)]<<10|i[e.charCodeAt(p+1)]<<4|i[e.charCodeAt(p+2)]>>2,a[l++]=t>>8&255,a[l++]=255&t),a}function h(e){return n[e>>18&63]+n[e>>12&63]+n[e>>6&63]+n[63&e]}function f(e,t,s){for(var n,i=[],r=t;rl?l:a+o));return 1===i?(t=e[s-1],r.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[s-2]<<8)+e[s-1],r.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"=")),r.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},{}],9:[function(e,t,s){function n(e,t){this.offset=e,this.nbits=t}s.kBlockLengthPrefixCode=[new n(1,2),new n(5,2),new n(9,2),new n(13,2),new n(17,3),new n(25,3),new n(33,3),new n(41,3),new n(49,4),new n(65,4),new n(81,4),new n(97,4),new n(113,5),new n(145,5),new n(177,5),new n(209,5),new n(241,6),new n(305,6),new n(369,7),new n(497,8),new n(753,9),new n(1265,10),new n(2289,11),new n(4337,12),new n(8433,13),new n(16625,24)],s.kInsertLengthPrefixCode=[new n(0,0),new n(1,0),new n(2,0),new n(3,0),new n(4,0),new n(5,0),new n(6,1),new n(8,1),new n(10,2),new n(14,2),new n(18,3),new n(26,3),new n(34,4),new n(50,4),new n(66,5),new n(98,5),new n(130,6),new n(194,7),new n(322,8),new n(578,9),new n(1090,10),new n(2114,12),new n(6210,14),new n(22594,24)],s.kCopyLengthPrefixCode=[new n(2,0),new n(3,0),new n(4,0),new n(5,0),new n(6,0),new n(7,0),new n(8,0),new n(9,0),new n(10,1),new n(12,1),new n(14,2),new n(18,2),new n(22,3),new n(30,3),new n(38,4),new n(54,4),new n(70,5),new n(102,5),new n(134,6),new n(198,7),new n(326,8),new n(582,9),new n(1094,10),new n(2118,24)],s.kInsertRangeLut=[0,0,8,8,0,16,8,16,16],s.kCopyRangeLut=[0,8,0,8,16,0,16,8,16]},{}],10:[function(e,t,s){function n(e){this.buffer=e,this.pos=0}function i(e){this.buffer=e,this.pos=0}n.prototype.read=function(e,t,s){this.pos+s>this.buffer.length&&(s=this.buffer.length-this.pos);for(var n=0;nthis.buffer.length)throw new Error("Output buffer is not large enough");return this.buffer.set(e.subarray(0,t),this.pos),this.pos+=t,t},s.BrotliOutput=i},{}],11:[function(e,t,s){var n=e("./dictionary"),i=0,r=1,o=2,a=3,l=4,c=5,u=6,d=7,p=8,h=9,f=10,m=11,g=12,v=13,x=14,y=15,b=16,w=17,_=18,S=20;function j(e,t,s){this.prefix=new Uint8Array(e.length),this.transform=t,this.suffix=new Uint8Array(s.length);for(var n=0;n'),new j("",i,"\n"),new j("",a,""),new j("",i,"]"),new j("",i," for "),new j("",x,""),new j("",o,""),new j("",i," a "),new j("",i," that "),new j(" ",f,""),new j("",i,". "),new j(".",i,""),new j(" ",i,", "),new j("",y,""),new j("",i," with "),new j("",i,"'"),new j("",i," from "),new j("",i," by "),new j("",b,""),new j("",w,""),new j(" the ",i,""),new j("",l,""),new j("",i,". The "),new j("",m,""),new j("",i," on "),new j("",i," as "),new j("",i," is "),new j("",d,""),new j("",r,"ing "),new j("",i,"\n\t"),new j("",i,":"),new j(" ",i,". "),new j("",i,"ed "),new j("",S,""),new j("",_,""),new j("",u,""),new j("",i,"("),new j("",f,", "),new j("",p,""),new j("",i," at "),new j("",i,"ly "),new j(" the ",i," of "),new j("",c,""),new j("",h,""),new j(" ",f,", "),new j("",f,'"'),new j(".",i,"("),new j("",m," "),new j("",f,'">'),new j("",i,'="'),new j(" ",i,"."),new j(".com/",i,""),new j(" the ",i," of the "),new j("",f,"'"),new j("",i,". This "),new j("",i,","),new j(".",i," "),new j("",f,"("),new j("",f,"."),new j("",i," not "),new j(" ",i,'="'),new j("",i,"er "),new j(" ",m," "),new j("",i,"al "),new j(" ",m,""),new j("",i,"='"),new j("",m,'"'),new j("",f,". "),new j(" ",i,"("),new j("",i,"ful "),new j(" ",f,". "),new j("",i,"ive "),new j("",i,"less "),new j("",m,"'"),new j("",i,"est "),new j(" ",f,"."),new j("",m,'">'),new j(" ",i,"='"),new j("",f,","),new j("",i,"ize "),new j("",m,"."),new j(" ",i,""),new j(" ",i,","),new j("",f,'="'),new j("",m,'="'),new j("",i,"ous "),new j("",m,", "),new j("",f,"='"),new j(" ",f,","),new j(" ",m,'="'),new j(" ",m,", "),new j("",m,","),new j("",m,"("),new j("",m,". "),new j(" ",m,"."),new j("",m,"='"),new j(" ",m,". "),new j(" ",f,'="'),new j(" ",m,"='"),new j(" ",f,"='")];function k(e,t){return e[t]<192?(e[t]>=97&&e[t]<=122&&(e[t]^=32),1):e[t]<224?(e[t+1]^=32,2):(e[t+2]^=5,3)}s.kTransforms=C,s.kNumTransforms=C.length,s.transformDictionaryWord=function(e,t,s,i,r){var o,a=C[r].prefix,l=C[r].suffix,c=C[r].transform,u=ci&&(u=i);for(var v=0;v0;){var x=k(e,o);o+=x,i-=x}for(var y=0;y{var t={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ả:"A",Ạ:"A",Ẩ:"A",Ẫ:"A",Ậ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ẻ:"E",Ẽ:"E",Ẹ:"E",Ể:"E",Ễ:"E",Ệ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ỉ:"I",Ị:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ỏ:"O",Ọ:"O",Ổ:"O",Ỗ:"O",Ộ:"O",Ờ:"O",Ở:"O",Ỡ:"O",Ớ:"O",Ợ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ủ:"U",Ụ:"U",Ử:"U",Ữ:"U",Ự:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ả:"a",ạ:"a",ẩ:"a",ẫ:"a",ậ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ẻ:"e",ẽ:"e",ẹ:"e",ể:"e",ễ:"e",ệ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ỉ:"i",ị:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ỏ:"o",ọ:"o",ổ:"o",ỗ:"o",ộ:"o",ờ:"o",ở:"o",ỡ:"o",ớ:"o",ợ:"o",ù:"u",ú:"u",û:"u",ü:"u",ủ:"u",ụ:"u",ử:"u",ữ:"u",ự:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"C",ċ:"c",Č:"C",č:"c",C̆:"C",c̆:"c",Ď:"D",ď:"d",Đ:"D",đ:"d",Ē:"E",ē:"e",Ĕ:"E",ĕ:"e",Ė:"E",ė:"e",Ę:"E",ę:"e",Ě:"E",ě:"e",Ĝ:"G",Ǵ:"G",ĝ:"g",ǵ:"g",Ğ:"G",ğ:"g",Ġ:"G",ġ:"g",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",Ḫ:"H",ḫ:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",IJ:"IJ",ij:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",Ḱ:"K",ḱ:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",Ḿ:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ʼn:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",Ẃ:"W",ẃ:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",Ứ:"U",ứ:"u",Ṹ:"U",ṹ:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",Ṕ:"P",ṕ:"p",Ṥ:"S",ṥ:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",Ồ:"O",ồ:"o",Ṑ:"O",ṑ:"o",Ừ:"U",ừ:"u",Ẁ:"W",ẁ:"w",Ỳ:"Y",ỳ:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",Ṧ:"S",ṧ:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",Ḑ:"D",ḑ:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z",й:"и",Й:"И",ё:"е",Ё:"Е"},s=Object.keys(t).join("|"),n=new RegExp(s,"g"),i=new RegExp(s,"");function r(e){return t[e]}var o=function(e){return e.replace(n,r)};e.exports=o,e.exports.has=function(e){return!!e.match(i)},e.exports.remove=o},8477:(e,t,s)=>{"use strict"; +(()=>{var e,t,n={4660:e=>{e.exports=function(){function e(t,n,s){function i(o,a){if(!n[o]){if(!t[o]){if(r)return r(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[o]={exports:{}};t[o][0].call(c.exports,(function(e){return i(t[o][1][e]||e)}),c,c.exports,e,t,n,s)}return n[o].exports}for(var r=void 0,o=0;o=252?6:a>=248?5:a>=240?4:a>=224?3:a>=192?2:1;function l(e,t){if(t<65534&&(e.subarray&&r||!e.subarray&&i))return String.fromCharCode.apply(null,s.shrinkBuf(e,t));for(var n="",o=0;o>>6,t[o++]=128|63&n):n<65536?(t[o++]=224|n>>>12,t[o++]=128|n>>>6&63,t[o++]=128|63&n):(t[o++]=240|n>>>18,t[o++]=128|n>>>12&63,t[o++]=128|n>>>6&63,t[o++]=128|63&n);return t},n.buf2binstring=function(e){return l(e,e.length)},n.binstring2buf=function(e){for(var t=new s.Buf8(e.length),n=0,i=t.length;n4)c[s++]=65533,n+=r-1;else{for(i&=2===r?31:3===r?15:7;r>1&&n1?c[s++]=65533:i<65536?c[s++]=i:(i-=65536,c[s++]=55296|i>>10&1023,c[s++]=56320|1023&i)}return l(c,s)},n.utf8border=function(e,t){var n;for((t=t||e.length)>e.length&&(t=e.length),n=t-1;n>=0&&128==(192&e[n]);)n--;return n<0||0===n?t:n+o[e[n]]>t?n:t}},{"./common":1}],3:[function(e,t,n){"use strict";function s(e,t,n,s){for(var i=65535&e,r=e>>>16&65535,o=0;0!==n;){n-=o=n>2e3?2e3:n;do{r=r+(i=i+t[s++]|0)|0}while(--o);i%=65521,r%=65521}return i|r<<16}t.exports=s},{}],4:[function(e,t,n){"use strict";t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],5:[function(e,t,n){"use strict";function s(){for(var e,t=[],n=0;n<256;n++){e=n;for(var s=0;s<8;s++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}var i=s();function r(e,t,n,s){var r=i,o=s+n;e^=-1;for(var a=s;a>>8^r[255&(e^t[a])];return~e}t.exports=r},{}],6:[function(e,t,n){"use strict";function s(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}t.exports=s},{}],7:[function(e,t,n){"use strict";var s=30,i=12;t.exports=function(e,t){var n,r,o,a,l,c,u,d,h,p,f,m,g,v,x,y,b,w,_,j,S,C,k,E,P;n=e.state,r=e.next_in,E=e.input,o=r+(e.avail_in-5),a=e.next_out,P=e.output,l=a-(t-e.avail_out),c=a+(e.avail_out-257),u=n.dmax,d=n.wsize,h=n.whave,p=n.wnext,f=n.window,m=n.hold,g=n.bits,v=n.lencode,x=n.distcode,y=(1<>>=_=w>>>24,g-=_,0==(_=w>>>16&255))P[a++]=65535&w;else{if(!(16&_)){if(64&_){if(32&_){n.mode=i;break e}e.msg="invalid literal/length code",n.mode=s;break e}w=v[(65535&w)+(m&(1<<_)-1)];continue t}for(j=65535&w,(_&=15)&&(g<_&&(m+=E[r++]<>>=_,g-=_),g<15&&(m+=E[r++]<>>=_=w>>>24,g-=_,16&(_=w>>>16&255)){if(S=65535&w,g<(_&=15)&&(m+=E[r++]<u){e.msg="invalid distance too far back",n.mode=s;break e}if(m>>>=_,g-=_,S>(_=a-l)){if((_=S-_)>h&&n.sane){e.msg="invalid distance too far back",n.mode=s;break e}if(C=0,k=f,0===p){if(C+=d-_,_2;)P[a++]=k[C++],P[a++]=k[C++],P[a++]=k[C++],j-=3;j&&(P[a++]=k[C++],j>1&&(P[a++]=k[C++]))}else{C=a-S;do{P[a++]=P[C++],P[a++]=P[C++],P[a++]=P[C++],j-=3}while(j>2);j&&(P[a++]=P[C++],j>1&&(P[a++]=P[C++]))}break}if(64&_){e.msg="invalid distance code",n.mode=s;break e}w=x[(65535&w)+(m&(1<<_)-1)]}}break}}while(r>3,m&=(1<<(g-=j<<3))-1,e.next_in=r,e.next_out=a,e.avail_in=r>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function se(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new s.Buf16(320),this.work=new s.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function ie(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=_,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new s.Buf32($),t.distcode=t.distdyn=new s.Buf32(ee),t.sane=1,t.back=-1,f):v}function re(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,ie(e)):v}function oe(e,t){var n,s;return e&&e.state?(s=e.state,t<0?(n=0,t=-t):(n=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?v:(null!==s.window&&s.wbits!==t&&(s.window=null),s.wrap=n,s.wbits=t,re(e))):v}function ae(e,t){var n,s;return e?(s=new se,e.state=s,s.window=null,(n=oe(e,t))!==f&&(e.state=null),n):v}function le(e){return ae(e,te)}var ce,ue,de=!0;function he(e){if(de){var t;for(ce=new s.Buf32(512),ue=new s.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(a(c,e.lens,0,288,ce,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;a(u,e.lens,0,32,ue,0,e.work,{bits:5}),de=!1}e.lencode=ce,e.lenbits=9,e.distcode=ue,e.distbits=5}function pe(e,t,n,i){var r,o=e.state;return null===o.window&&(o.wsize=1<=o.wsize?(s.arraySet(o.window,t,n-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):((r=o.wsize-o.wnext)>i&&(r=i),s.arraySet(o.window,t,n-i,r,o.wnext),(i-=r)?(s.arraySet(o.window,t,n-i,i,0),o.wnext=i,o.whave=o.wsize):(o.wnext+=r,o.wnext===o.wsize&&(o.wnext=0),o.whave>>8&255,n.check=r(n.check,ke,2,0),oe=0,ae=0,n.mode=j;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&oe)<<8)+(oe>>8))%31){e.msg="incorrect header check",n.mode=J;break}if((15&oe)!==w){e.msg="unknown compression method",n.mode=J;break}if(ae-=4,we=8+(15&(oe>>>=4)),0===n.wbits)n.wbits=we;else if(we>n.wbits){e.msg="invalid window size",n.mode=J;break}n.dmax=1<>8&1),512&n.flags&&(ke[0]=255&oe,ke[1]=oe>>>8&255,n.check=r(n.check,ke,2,0)),oe=0,ae=0,n.mode=S;case S:for(;ae<32;){if(0===ie)break e;ie--,oe+=$[te++]<>>8&255,ke[2]=oe>>>16&255,ke[3]=oe>>>24&255,n.check=r(n.check,ke,4,0)),oe=0,ae=0,n.mode=C;case C:for(;ae<16;){if(0===ie)break e;ie--,oe+=$[te++]<>8),512&n.flags&&(ke[0]=255&oe,ke[1]=oe>>>8&255,n.check=r(n.check,ke,2,0)),oe=0,ae=0,n.mode=k;case k:if(1024&n.flags){for(;ae<16;){if(0===ie)break e;ie--,oe+=$[te++]<>>8&255,n.check=r(n.check,ke,2,0)),oe=0,ae=0}else n.head&&(n.head.extra=null);n.mode=E;case E:if(1024&n.flags&&((ue=n.length)>ie&&(ue=ie),ue&&(n.head&&(we=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),s.arraySet(n.head.extra,$,te,ue,we)),512&n.flags&&(n.check=r(n.check,$,ue,te)),ie-=ue,te+=ue,n.length-=ue),n.length))break e;n.length=0,n.mode=P;case P:if(2048&n.flags){if(0===ie)break e;ue=0;do{we=$[te+ue++],n.head&&we&&n.length<65536&&(n.head.name+=String.fromCharCode(we))}while(we&&ue>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=N;break;case O:for(;ae<32;){if(0===ie)break e;ie--,oe+=$[te++]<>>=7&ae,ae-=7&ae,n.mode=K;break}for(;ae<3;){if(0===ie)break e;ie--,oe+=$[te++]<>>=1)){case 0:n.mode=F;break;case 1:if(he(n),n.mode=z,t===p){oe>>>=2,ae-=2;break e}break;case 2:n.mode=B;break;case 3:e.msg="invalid block type",n.mode=J}oe>>>=2,ae-=2;break;case F:for(oe>>>=7&ae,ae-=7&ae;ae<32;){if(0===ie)break e;ie--,oe+=$[te++]<>>16^65535)){e.msg="invalid stored block lengths",n.mode=J;break}if(n.length=65535&oe,oe=0,ae=0,n.mode=V,t===p)break e;case V:n.mode=R;case R:if(ue=n.length){if(ue>ie&&(ue=ie),ue>re&&(ue=re),0===ue)break e;s.arraySet(ee,$,te,ue,se),ie-=ue,te+=ue,re-=ue,se+=ue,n.length-=ue;break}n.mode=N;break;case B:for(;ae<14;){if(0===ie)break e;ie--,oe+=$[te++]<>>=5,ae-=5,n.ndist=1+(31&oe),oe>>>=5,ae-=5,n.ncode=4+(15&oe),oe>>>=4,ae-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=J;break}n.have=0,n.mode=D;case D:for(;n.have>>=3,ae-=3}for(;n.have<19;)n.lens[Ee[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,je={bits:n.lenbits},_e=a(l,n.lens,0,19,n.lencode,0,n.work,je),n.lenbits=je.bits,_e){e.msg="invalid code lengths set",n.mode=J;break}n.have=0,n.mode=L;case L:for(;n.have>>16&255,ve=65535&Ce,!((me=Ce>>>24)<=ae);){if(0===ie)break e;ie--,oe+=$[te++]<>>=me,ae-=me,n.lens[n.have++]=ve;else{if(16===ve){for(Se=me+2;ae>>=me,ae-=me,0===n.have){e.msg="invalid bit length repeat",n.mode=J;break}we=n.lens[n.have-1],ue=3+(3&oe),oe>>>=2,ae-=2}else if(17===ve){for(Se=me+3;ae>>=me)),oe>>>=3,ae-=3}else{for(Se=me+7;ae>>=me)),oe>>>=7,ae-=7}if(n.have+ue>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=J;break}for(;ue--;)n.lens[n.have++]=we}}if(n.mode===J)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=J;break}if(n.lenbits=9,je={bits:n.lenbits},_e=a(c,n.lens,0,n.nlen,n.lencode,0,n.work,je),n.lenbits=je.bits,_e){e.msg="invalid literal/lengths set",n.mode=J;break}if(n.distbits=6,n.distcode=n.distdyn,je={bits:n.distbits},_e=a(u,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,je),n.distbits=je.bits,_e){e.msg="invalid distances set",n.mode=J;break}if(n.mode=z,t===p)break e;case z:n.mode=G;case G:if(ie>=6&&re>=258){e.next_out=se,e.avail_out=re,e.next_in=te,e.avail_in=ie,n.hold=oe,n.bits=ae,o(e,ce),se=e.next_out,ee=e.output,re=e.avail_out,te=e.next_in,$=e.input,ie=e.avail_in,oe=n.hold,ae=n.bits,n.mode===N&&(n.back=-1);break}for(n.back=0;ge=(Ce=n.lencode[oe&(1<>>16&255,ve=65535&Ce,!((me=Ce>>>24)<=ae);){if(0===ie)break e;ie--,oe+=$[te++]<>xe)])>>>16&255,ve=65535&Ce,!(xe+(me=Ce>>>24)<=ae);){if(0===ie)break e;ie--,oe+=$[te++]<>>=xe,ae-=xe,n.back+=xe}if(oe>>>=me,ae-=me,n.back+=me,n.length=ve,0===ge){n.mode=Z;break}if(32&ge){n.back=-1,n.mode=N;break}if(64&ge){e.msg="invalid literal/length code",n.mode=J;break}n.extra=15&ge,n.mode=H;case H:if(n.extra){for(Se=n.extra;ae>>=n.extra,ae-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=U;case U:for(;ge=(Ce=n.distcode[oe&(1<>>16&255,ve=65535&Ce,!((me=Ce>>>24)<=ae);){if(0===ie)break e;ie--,oe+=$[te++]<>xe)])>>>16&255,ve=65535&Ce,!(xe+(me=Ce>>>24)<=ae);){if(0===ie)break e;ie--,oe+=$[te++]<>>=xe,ae-=xe,n.back+=xe}if(oe>>>=me,ae-=me,n.back+=me,64&ge){e.msg="invalid distance code",n.mode=J;break}n.offset=ve,n.extra=15&ge,n.mode=W;case W:if(n.extra){for(Se=n.extra;ae>>=n.extra,ae-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=J;break}n.mode=q;case q:if(0===re)break e;if(ue=ce-re,n.offset>ue){if((ue=n.offset-ue)>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=J;break}ue>n.wnext?(ue-=n.wnext,de=n.wsize-ue):de=n.wnext-ue,ue>n.length&&(ue=n.length),fe=n.window}else fe=ee,de=se-n.offset,ue=n.length;ue>re&&(ue=re),re-=ue,n.length-=ue;do{ee[se++]=fe[de++]}while(--ue);0===n.length&&(n.mode=G);break;case Z:if(0===re)break e;ee[se++]=n.length,re--,n.mode=G;break;case K:if(n.wrap){for(;ae<32;){if(0===ie)break e;ie--,oe|=$[te++]<=1&&0===z[A];A--);if(N>A&&(N=A),0===A)return m[g++]=20971520,m[g++]=20971520,x.bits=1,0;for(O=1;O0&&(e===a||1!==A))return-1;for(G[1]=0,I=1;Ir||e===c&&R>o)return 1;for(;;){C=I-F,v[T]S?(k=H[U+v[T]],E=D[L+v[T]]):(k=96,E=0),y=1<>F)+(b-=y)]=C<<24|k<<16|E}while(0!==b);for(y=1<>=1;if(0!==y?(B&=y-1,B+=y):B=0,T++,0==--z[I]){if(I===A)break;I=t[n+v[T]]}if(I>N&&(B&_)!==w){for(0===F&&(F=N),j+=O,V=1<<(M=I-F);M+Fr||e===c&&R>o)return 1;m[w=B&_]=N<<24|M<<16|j-g}}return 0!==B&&(m[j+B]=I-F<<24|64<<16),x.bits=N,0}},{"../utils/common":1}],10:[function(e,t,n){"use strict";t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],11:[function(e,t,n){"use strict";function s(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}t.exports=s},{}],"/lib/inflate.js":[function(e,t,n){"use strict";var s=e("./zlib/inflate"),i=e("./utils/common"),r=e("./utils/strings"),o=e("./zlib/constants"),a=e("./zlib/messages"),l=e("./zlib/zstream"),c=e("./zlib/gzheader"),u=Object.prototype.toString;function d(e){if(!(this instanceof d))return new d(e);this.options=i.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(15&t.windowBits||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var n=s.inflateInit2(this.strm,t.windowBits);if(n!==o.Z_OK)throw new Error(a[n]);if(this.header=new c,s.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=r.string2buf(t.dictionary):"[object ArrayBuffer]"===u.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=s.inflateSetDictionary(this.strm,t.dictionary))!==o.Z_OK))throw new Error(a[n])}function h(e,t){var n=new d(t);if(n.push(e,!0),n.err)throw n.msg||a[n.err];return n.result}function p(e,t){return(t=t||{}).raw=!0,h(e,t)}d.prototype.push=function(e,t){var n,a,l,c,d,h=this.strm,p=this.options.chunkSize,f=this.options.dictionary,m=!1;if(this.ended)return!1;a=t===~~t?t:!0===t?o.Z_FINISH:o.Z_NO_FLUSH,"string"==typeof e?h.input=r.binstring2buf(e):"[object ArrayBuffer]"===u.call(e)?h.input=new Uint8Array(e):h.input=e,h.next_in=0,h.avail_in=h.input.length;do{if(0===h.avail_out&&(h.output=new i.Buf8(p),h.next_out=0,h.avail_out=p),(n=s.inflate(h,o.Z_NO_FLUSH))===o.Z_NEED_DICT&&f&&(n=s.inflateSetDictionary(this.strm,f)),n===o.Z_BUF_ERROR&&!0===m&&(n=o.Z_OK,m=!1),n!==o.Z_STREAM_END&&n!==o.Z_OK)return this.onEnd(n),this.ended=!0,!1;h.next_out&&(0!==h.avail_out&&n!==o.Z_STREAM_END&&(0!==h.avail_in||a!==o.Z_FINISH&&a!==o.Z_SYNC_FLUSH)||("string"===this.options.to?(l=r.utf8border(h.output,h.next_out),c=h.next_out-l,d=r.buf2string(h.output,l),h.next_out=c,h.avail_out=p-c,c&&i.arraySet(h.output,h.output,l,c,0),this.onData(d)):this.onData(i.shrinkBuf(h.output,h.next_out)))),0===h.avail_in&&0===h.avail_out&&(m=!0)}while((h.avail_in>0||0===h.avail_out)&&n!==o.Z_STREAM_END);return n===o.Z_STREAM_END&&(a=o.Z_FINISH),a===o.Z_FINISH?(n=s.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===o.Z_OK):a!==o.Z_SYNC_FLUSH||(this.onEnd(o.Z_OK),h.avail_out=0,!0)},d.prototype.onData=function(e){this.chunks.push(e)},d.prototype.onEnd=function(e){e===o.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},n.Inflate=d,n.inflate=h,n.inflateRaw=p,n.ungzip=h},{"./utils/common":1,"./utils/strings":2,"./zlib/constants":4,"./zlib/gzheader":6,"./zlib/inflate":8,"./zlib/messages":10,"./zlib/zstream":11}]},{},[])("/lib/inflate.js")},8572:e=>{e.exports=function(){function e(t,n,s){function i(o,a){if(!n[o]){if(!t[o]){if(r)return r(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[o]={exports:{}};t[o][0].call(c.exports,(function(e){return i(t[o][1][e]||e)}),c,c.exports,e,t,n,s)}return n[o].exports}for(var r=void 0,o=0;o0},a.prototype.readMoreInput=function(){if(!(this.bit_end_pos_>256))if(this.eos_){if(this.bit_pos_>this.bit_end_pos_)throw new Error("Unexpected end of input "+this.bit_pos_+" "+this.bit_end_pos_)}else{var e=this.buf_ptr_,t=this.input_.read(this.buf_,e,s);if(t<0)throw new Error("Unexpected end of input");if(t=8;)this.val_>>>=8,this.val_|=this.buf_[this.pos_&r]<<24,++this.pos_,this.bit_pos_=this.bit_pos_-8>>>0,this.bit_end_pos_=this.bit_end_pos_-8>>>0},a.prototype.readBits=function(e){32-this.bit_pos_>>this.bit_pos_&o[e];return this.bit_pos_+=e,t},t.exports=a},{}],2:[function(e,t,n){n.lookup=new Uint8Array([0,0,0,0,0,0,0,0,0,4,4,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,12,16,12,12,20,12,16,24,28,12,12,32,12,36,12,44,44,44,44,44,44,44,44,44,44,32,32,24,40,28,12,12,48,52,52,52,48,52,52,52,48,52,52,52,52,52,48,52,52,52,52,52,48,52,52,52,52,52,24,12,28,12,12,12,56,60,60,60,56,60,60,60,56,60,60,60,60,60,56,60,60,60,60,60,56,60,60,60,60,60,24,12,28,12,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,0,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,56,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,6,6,6,6,7,7,7,7,8,8,8,8,9,9,9,9,10,10,10,10,11,11,11,11,12,12,12,12,13,13,13,13,14,14,14,14,15,15,15,15,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,22,22,22,22,23,23,23,23,24,24,24,24,25,25,25,25,26,26,26,26,27,27,27,27,28,28,28,28,29,29,29,29,30,30,30,30,31,31,31,31,32,32,32,32,33,33,33,33,34,34,34,34,35,35,35,35,36,36,36,36,37,37,37,37,38,38,38,38,39,39,39,39,40,40,40,40,41,41,41,41,42,42,42,42,43,43,43,43,44,44,44,44,45,45,45,45,46,46,46,46,47,47,47,47,48,48,48,48,49,49,49,49,50,50,50,50,51,51,51,51,52,52,52,52,53,53,53,53,54,54,54,54,55,55,55,55,56,56,56,56,57,57,57,57,58,58,58,58,59,59,59,59,60,60,60,60,61,61,61,61,62,62,62,62,63,63,63,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),n.lookupOffsets=new Uint16Array([1024,1536,1280,1536,0,256,768,512])},{}],3:[function(e,t,n){var s=e("./streams").BrotliInput,i=e("./streams").BrotliOutput,r=e("./bit_reader"),o=e("./dictionary"),a=e("./huffman").HuffmanCode,l=e("./huffman").BrotliBuildHuffmanTable,c=e("./context"),u=e("./prefix"),d=e("./transform"),h=8,p=16,f=256,m=704,g=26,v=6,x=2,y=8,b=255,w=1080,_=18,j=new Uint8Array([1,2,3,4,0,5,17,6,16,7,8,9,10,11,12,13,14,15]),S=16,C=new Uint8Array([3,2,1,0,3,3,3,3,3,3,2,2,2,2,2,2]),k=new Int8Array([0,0,0,0,-1,1,-2,2,-3,3,-1,1,-2,2,-3,3]),E=new Uint16Array([256,402,436,468,500,534,566,598,630,662,694,726,758,790,822,854,886,920,952,984,1016,1048,1080]);function P(e){var t;return 0===e.readBits(1)?16:(t=e.readBits(3))>0?17+t:(t=e.readBits(3))>0?8+t:17}function I(e){if(e.readBits(1)){var t=e.readBits(3);return 0===t?1:e.readBits(t)+(1<1&&0===r)throw new Error("Invalid size byte");i.meta_block_length|=r<<8*s}}else for(s=0;s4&&0===o)throw new Error("Invalid size nibble");i.meta_block_length|=o<<4*s}return++i.meta_block_length,i.input_end||i.is_metadata||(i.is_uncompressed=e.readBits(1)),i}function A(e,t,n){var s;return n.fillBitWindow(),(s=e[t+=n.val_>>>n.bit_pos_&b].bits-y)>0&&(n.bit_pos_+=y,t+=e[t].value,t+=n.val_>>>n.bit_pos_&(1<0;){var m,g=0;if(s.readMoreInput(),s.fillBitWindow(),g+=s.val_>>>s.bit_pos_&31,s.bit_pos_+=d[g].bits,(m=255&d[g].value)>m);else{var v,x,y=m-14,b=0;if(m===p&&(b=r),c!==b&&(o=0,c=b),v=o,o>0&&(o-=2,o<<=y),i+(x=(o+=s.readBits(y)+3)-v)>t)throw new Error("[ReadHuffmanCodeLengths] symbol + repeat_delta > num_symbols");for(var w=0;w0;++p){var x,b=j[p],w=0;s.fillBitWindow(),w+=s.val_>>>s.bit_pos_&15,s.bit_pos_+=v[w].bits,x=v[w].value,f[b]=x,0!==x&&(m-=32>>x,++g)}if(1!==g&&0!==m)throw new Error("[ReadHuffmanCode] invalid num_codes or space");N(f,e,o,s)}if(0===(r=l(t,n,y,o,e)))throw new Error("[ReadHuffmanCode] BuildHuffmanTable failed: ");return r}function F(e,t,n){var s,i;return s=A(e,t,n),i=u.kBlockLengthPrefixCode[s].nbits,u.kBlockLengthPrefixCode[s].offset+n.readBits(i)}function V(e,t,n){var s;return e>>5]),this.htrees=new Uint32Array(t)}function L(e,t){var n,s,i={num_htrees:null,context_map:null},r=0;t.readMoreInput();var o=i.num_htrees=I(t)+1,l=i.context_map=new Uint8Array(e);if(o<=1)return i;for(t.readBits(1)&&(r=t.readBits(4)+1),n=[],s=0;s=e)throw new Error("[DecodeContextMap] i >= context_map_size");l[s]=0,++s}else l[s]=c-r,++s}return t.readBits(1)&&B(l,e),i}function z(e,t,n,s,i,r,o){var a,l=2*n,c=n,u=A(t,n*w,o);(a=0===u?i[l+(1&r[c])]:1===u?i[l+(r[c]-1&1)]+1:u-2)>=e&&(a-=e),s[n]=a,i[l+(1&r[c])]=a,++r[c]}function G(e,t,n,s,i,o){var a,l=i+1,c=n&i,u=o.pos_&r.IBUF_MASK;if(t<8||o.bit_pos_+(t<<3)0;)o.readMoreInput(),s[c++]=o.readBits(8),c===l&&(e.write(s,l),c=0);else{if(o.bit_end_pos_<32)throw new Error("[CopyUncompressedBlockToOutput] br.bit_end_pos_ < 32");for(;o.bit_pos_<32;)s[c]=o.val_>>>o.bit_pos_,o.bit_pos_+=8,++c,--t;if(u+(a=o.bit_end_pos_-o.bit_pos_>>3)>r.IBUF_MASK){for(var d=r.IBUF_MASK+1-u,h=0;h=l)for(e.write(s,l),c-=l,h=0;h=l;){if(a=l-c,o.input_.read(s,c,a)t.buffer.length){var xe=new Uint8Array(j+ne);xe.set(t.buffer),t.buffer=xe}if(C=ve.input_end,Z=ve.is_uncompressed,ve.is_metadata)for(H(_);ne>0;--ne)_.readMoreInput(),_.readBits(8);else if(0!==ne)if(Z)_.bit_pos_=_.bit_pos_+7&-8,G(t,ne,j,h,l,_),j+=ne;else{for(n=0;n<3;++n)re[n]=I(_)+1,re[n]>=2&&(M(re[n]+2,y,n*w,_),M(g,b,n*w,_),se[n]=F(b,n*w,_),ae[n]=1);for(_.readMoreInput(),X=(1<<(K=_.readBits(2)))-1,J=(Y=S+(_.readBits(4)<0;){var we,_e,je,Se,Ce,ke,Ee,Pe,Ie,Te,Oe,Ae;for(_.readMoreInput(),0===se[1]&&(z(re[1],y,1,ie,oe,ae,_),se[1]=F(b,w,_),te=U[1].htrees[ie[1]]),--se[1],(_e=(we=A(U[1].codes,te,_))>>6)>=2?(_e-=2,Ee=-1):Ee=0,je=u.kInsertRangeLut[_e]+(we>>3&7),Se=u.kCopyRangeLut[_e]+(7&we),Ce=u.kInsertLengthPrefixCode[je].offset+_.readBits(u.kInsertLengthPrefixCode[je].nbits),ke=u.kCopyLengthPrefixCode[Se].offset+_.readBits(u.kCopyLengthPrefixCode[Se].nbits),R=h[j-1&l],B=h[j-2&l],Ie=0;Ie4?3:ke-2))],(Ee=A(U[2].codes,U[2].htrees[fe],_))>=Y&&(Ae=(Ee-=Y)&X,Ee=Y+((Ne=(2+(1&(Ee>>=K))<<(Oe=1+(Ee>>1)))-4)+_.readBits(Oe)<(E=j=o.minDictionaryWordLength&&ke<=o.maxDictionaryWordLength))throw new Error("Invalid backward reference. pos: "+j+" distance: "+Pe+" len: "+ke+" bytes left: "+ne);var Ne=o.offsetsByLength[ke],Me=Pe-E-1,Fe=o.sizeBitsByLength[ke],Ve=Me>>Fe;if(Ne+=(Me&(1<=p){t.write(h,i);for(var Be=0;Be0&&(T[3&N]=Pe,++N),ke>ne)throw new Error("Invalid backward reference. pos: "+j+" distance: "+Pe+" len: "+ke+" bytes left: "+ne);for(Ie=0;Ie>=1;return(e&n-1)+n}function o(e,t,n,i,r){do{e[t+(i-=n)]=new s(r.bits,r.value)}while(i>0)}function a(e,t,n){for(var s=1<0;--w[u])o(e,t+h,p,v,new s(255&u,65535&y[d++])),h=r(h,u);for(m=x-1,f=-1,u=n+1,p=2;u<=i;++u,p<<=1)for(;w[u]>0;--w[u])(h&m)!==f&&(t+=v,x+=v=1<<(g=a(w,u,n)),e[b+(f=h&m)]=new s(g+n&255,t-b-f&65535)),o(e,t+(h>>n),p,v,new s(u-n&255,65535&y[d++])),h=r(h,u);return x}},{}],8:[function(e,t,n){"use strict";n.byteLength=u,n.toByteArray=h,n.fromByteArray=m;for(var s=[],i=[],r="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,l=o.length;a0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function u(e){var t=c(e),n=t[0],s=t[1];return 3*(n+s)/4-s}function d(e,t,n){return 3*(t+n)/4-n}function h(e){for(var t,n=c(e),s=n[0],o=n[1],a=new r(d(e,s,o)),l=0,u=o>0?s-4:s,h=0;h>16&255,a[l++]=t>>8&255,a[l++]=255&t;return 2===o&&(t=i[e.charCodeAt(h)]<<2|i[e.charCodeAt(h+1)]>>4,a[l++]=255&t),1===o&&(t=i[e.charCodeAt(h)]<<10|i[e.charCodeAt(h+1)]<<4|i[e.charCodeAt(h+2)]>>2,a[l++]=t>>8&255,a[l++]=255&t),a}function p(e){return s[e>>18&63]+s[e>>12&63]+s[e>>6&63]+s[63&e]}function f(e,t,n){for(var s,i=[],r=t;rl?l:a+o));return 1===i?(t=e[n-1],r.push(s[t>>2]+s[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],r.push(s[t>>10]+s[t>>4&63]+s[t<<2&63]+"=")),r.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},{}],9:[function(e,t,n){function s(e,t){this.offset=e,this.nbits=t}n.kBlockLengthPrefixCode=[new s(1,2),new s(5,2),new s(9,2),new s(13,2),new s(17,3),new s(25,3),new s(33,3),new s(41,3),new s(49,4),new s(65,4),new s(81,4),new s(97,4),new s(113,5),new s(145,5),new s(177,5),new s(209,5),new s(241,6),new s(305,6),new s(369,7),new s(497,8),new s(753,9),new s(1265,10),new s(2289,11),new s(4337,12),new s(8433,13),new s(16625,24)],n.kInsertLengthPrefixCode=[new s(0,0),new s(1,0),new s(2,0),new s(3,0),new s(4,0),new s(5,0),new s(6,1),new s(8,1),new s(10,2),new s(14,2),new s(18,3),new s(26,3),new s(34,4),new s(50,4),new s(66,5),new s(98,5),new s(130,6),new s(194,7),new s(322,8),new s(578,9),new s(1090,10),new s(2114,12),new s(6210,14),new s(22594,24)],n.kCopyLengthPrefixCode=[new s(2,0),new s(3,0),new s(4,0),new s(5,0),new s(6,0),new s(7,0),new s(8,0),new s(9,0),new s(10,1),new s(12,1),new s(14,2),new s(18,2),new s(22,3),new s(30,3),new s(38,4),new s(54,4),new s(70,5),new s(102,5),new s(134,6),new s(198,7),new s(326,8),new s(582,9),new s(1094,10),new s(2118,24)],n.kInsertRangeLut=[0,0,8,8,0,16,8,16,16],n.kCopyRangeLut=[0,8,0,8,16,0,16,8,16]},{}],10:[function(e,t,n){function s(e){this.buffer=e,this.pos=0}function i(e){this.buffer=e,this.pos=0}s.prototype.read=function(e,t,n){this.pos+n>this.buffer.length&&(n=this.buffer.length-this.pos);for(var s=0;sthis.buffer.length)throw new Error("Output buffer is not large enough");return this.buffer.set(e.subarray(0,t),this.pos),this.pos+=t,t},n.BrotliOutput=i},{}],11:[function(e,t,n){var s=e("./dictionary"),i=0,r=1,o=2,a=3,l=4,c=5,u=6,d=7,h=8,p=9,f=10,m=11,g=12,v=13,x=14,y=15,b=16,w=17,_=18,j=20;function S(e,t,n){this.prefix=new Uint8Array(e.length),this.transform=t,this.suffix=new Uint8Array(n.length);for(var s=0;s'),new S("",i,"\n"),new S("",a,""),new S("",i,"]"),new S("",i," for "),new S("",x,""),new S("",o,""),new S("",i," a "),new S("",i," that "),new S(" ",f,""),new S("",i,". "),new S(".",i,""),new S(" ",i,", "),new S("",y,""),new S("",i," with "),new S("",i,"'"),new S("",i," from "),new S("",i," by "),new S("",b,""),new S("",w,""),new S(" the ",i,""),new S("",l,""),new S("",i,". The "),new S("",m,""),new S("",i," on "),new S("",i," as "),new S("",i," is "),new S("",d,""),new S("",r,"ing "),new S("",i,"\n\t"),new S("",i,":"),new S(" ",i,". "),new S("",i,"ed "),new S("",j,""),new S("",_,""),new S("",u,""),new S("",i,"("),new S("",f,", "),new S("",h,""),new S("",i," at "),new S("",i,"ly "),new S(" the ",i," of "),new S("",c,""),new S("",p,""),new S(" ",f,", "),new S("",f,'"'),new S(".",i,"("),new S("",m," "),new S("",f,'">'),new S("",i,'="'),new S(" ",i,"."),new S(".com/",i,""),new S(" the ",i," of the "),new S("",f,"'"),new S("",i,". This "),new S("",i,","),new S(".",i," "),new S("",f,"("),new S("",f,"."),new S("",i," not "),new S(" ",i,'="'),new S("",i,"er "),new S(" ",m," "),new S("",i,"al "),new S(" ",m,""),new S("",i,"='"),new S("",m,'"'),new S("",f,". "),new S(" ",i,"("),new S("",i,"ful "),new S(" ",f,". "),new S("",i,"ive "),new S("",i,"less "),new S("",m,"'"),new S("",i,"est "),new S(" ",f,"."),new S("",m,'">'),new S(" ",i,"='"),new S("",f,","),new S("",i,"ize "),new S("",m,"."),new S(" ",i,""),new S(" ",i,","),new S("",f,'="'),new S("",m,'="'),new S("",i,"ous "),new S("",m,", "),new S("",f,"='"),new S(" ",f,","),new S(" ",m,'="'),new S(" ",m,", "),new S("",m,","),new S("",m,"("),new S("",m,". "),new S(" ",m,"."),new S("",m,"='"),new S(" ",m,". "),new S(" ",f,'="'),new S(" ",m,"='"),new S(" ",f,"='")];function k(e,t){return e[t]<192?(e[t]>=97&&e[t]<=122&&(e[t]^=32),1):e[t]<224?(e[t+1]^=32,2):(e[t+2]^=5,3)}n.kTransforms=C,n.kNumTransforms=C.length,n.transformDictionaryWord=function(e,t,n,i,r){var o,a=C[r].prefix,l=C[r].suffix,c=C[r].transform,u=ci&&(u=i);for(var v=0;v0;){var x=k(e,o);o+=x,i-=x}for(var y=0;y{var t={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ả:"A",Ạ:"A",Ẩ:"A",Ẫ:"A",Ậ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ẻ:"E",Ẽ:"E",Ẹ:"E",Ể:"E",Ễ:"E",Ệ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ỉ:"I",Ị:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ỏ:"O",Ọ:"O",Ổ:"O",Ỗ:"O",Ộ:"O",Ờ:"O",Ở:"O",Ỡ:"O",Ớ:"O",Ợ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ủ:"U",Ụ:"U",Ử:"U",Ữ:"U",Ự:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ả:"a",ạ:"a",ẩ:"a",ẫ:"a",ậ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ẻ:"e",ẽ:"e",ẹ:"e",ể:"e",ễ:"e",ệ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ỉ:"i",ị:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ỏ:"o",ọ:"o",ổ:"o",ỗ:"o",ộ:"o",ờ:"o",ở:"o",ỡ:"o",ớ:"o",ợ:"o",ù:"u",ú:"u",û:"u",ü:"u",ủ:"u",ụ:"u",ử:"u",ữ:"u",ự:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"C",ċ:"c",Č:"C",č:"c",C̆:"C",c̆:"c",Ď:"D",ď:"d",Đ:"D",đ:"d",Ē:"E",ē:"e",Ĕ:"E",ĕ:"e",Ė:"E",ė:"e",Ę:"E",ę:"e",Ě:"E",ě:"e",Ĝ:"G",Ǵ:"G",ĝ:"g",ǵ:"g",Ğ:"G",ğ:"g",Ġ:"G",ġ:"g",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",Ḫ:"H",ḫ:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",IJ:"IJ",ij:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",Ḱ:"K",ḱ:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",Ḿ:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ʼn:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",Ẃ:"W",ẃ:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",Ứ:"U",ứ:"u",Ṹ:"U",ṹ:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",Ṕ:"P",ṕ:"p",Ṥ:"S",ṥ:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",Ồ:"O",ồ:"o",Ṑ:"O",ṑ:"o",Ừ:"U",ừ:"u",Ẁ:"W",ẁ:"w",Ỳ:"Y",ỳ:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",Ṧ:"S",ṧ:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",Ḑ:"D",ḑ:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z",й:"и",Й:"И",ё:"е",Ё:"Е"},n=Object.keys(t).join("|"),s=new RegExp(n,"g"),i=new RegExp(n,"");function r(e){return t[e]}var o=function(e){return e.replace(s,r)};e.exports=o,e.exports.has=function(e){return!!e.match(i)},e.exports.remove=o},83:(e,t,n)=>{"use strict"; /** * @license React - * use-sync-external-store-shim.production.min.js + * use-sync-external-store-shim.production.js * - * Copyright (c) Facebook, Inc. and its affiliates. + * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var n=s(1609);var i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r=n.useState,o=n.useEffect,a=n.useLayoutEffect,l=n.useDebugValue;function c(e){var t=e.getSnapshot;e=e.value;try{var s=t();return!i(e,s)}catch(e){return!0}}var u="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var s=t(),n=r({inst:{value:s,getSnapshot:t}}),i=n[0].inst,u=n[1];return a((function(){i.value=s,i.getSnapshot=t,c(i)&&u({inst:i})}),[e,s,t]),o((function(){return c(i)&&u({inst:i}),e((function(){c(i)&&u({inst:i})}))}),[e]),l(s),s};t.useSyncExternalStore=void 0!==n.useSyncExternalStore?n.useSyncExternalStore:u},422:(e,t,s)=>{"use strict";e.exports=s(8477)},1609:e=>{"use strict";e.exports=window.React}},n={};function i(e){var t=n[e];if(void 0!==t)return t.exports;var r=n[e]={exports:{}};return s[e](r,r.exports,i),r.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,i.t=function(s,n){if(1&n&&(s=this(s)),8&n)return s;if("object"==typeof s&&s){if(4&n&&s.__esModule)return s;if(16&n&&"function"==typeof s.then)return s}var r=Object.create(null);i.r(r);var o={};e=e||[null,t({}),t([]),t(t)];for(var a=2&n&&s;"object"==typeof a&&!~e.indexOf(a);a=t(a))Object.getOwnPropertyNames(a).forEach((e=>o[e]=()=>s[e]));return o.default=()=>s,i.d(r,o),r},i.d=(e,t)=>{for(var s in t)i.o(t,s)&&!i.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};(()=>{"use strict";i.r(r),i.d(r,{PluginMoreMenuItem:()=>Lk,PluginSidebar:()=>Hk,PluginSidebarMoreMenuItem:()=>Gk,PluginTemplateSettingPanel:()=>ha,initializeEditor:()=>Yk,initializePostsDashboard:()=>Zk,reinitializeEditor:()=>Xk,store:()=>zt});var e={};i.r(e),i.d(e,{__experimentalSetPreviewDeviceType:()=>Ge,addTemplate:()=>We,closeGeneralSidebar:()=>lt,openGeneralSidebar:()=>at,openNavigationPanelToMenu:()=>et,removeTemplate:()=>qe,revertTemplate:()=>ot,setEditedEntity:()=>Ye,setEditedPostContext:()=>Je,setHasPageContentFocus:()=>ut,setHomeTemplateId:()=>Xe,setIsInserterOpened:()=>st,setIsListViewOpened:()=>nt,setIsNavigationPanelOpened:()=>tt,setIsSaveViewOpened:()=>rt,setNavigationMenu:()=>Ke,setNavigationPanelActiveMenu:()=>$e,setPage:()=>Qe,setTemplate:()=>Ue,setTemplatePart:()=>Ze,switchEditorMode:()=>ct,toggleDistractionFree:()=>dt,toggleFeature:()=>He,updateSettings:()=>it});var t={};i.r(t),i.d(t,{setCanvasMode:()=>pt,setEditorCanvasContainerView:()=>ht});var s={};i.r(s),i.d(s,{__experimentalGetInsertionPoint:()=>kt,__experimentalGetPreviewDeviceType:()=>gt,getCanUserCreateMedia:()=>vt,getCurrentTemplateNavigationPanelSubMenu:()=>At,getCurrentTemplateTemplateParts:()=>Tt,getEditedPostContext:()=>St,getEditedPostId:()=>_t,getEditedPostType:()=>wt,getEditorMode:()=>Ot,getHomeTemplateId:()=>bt,getNavigationPanelActiveMenu:()=>Mt,getPage:()=>jt,getReusableBlocks:()=>xt,getSettings:()=>yt,hasPageContentFocus:()=>Ft,isFeatureActive:()=>mt,isInserterOpened:()=>Ct,isListViewOpened:()=>Et,isNavigationOpened:()=>Nt,isPage:()=>Vt,isSaveViewOpened:()=>Pt});var n={};i.r(n),i.d(n,{getCanvasMode:()=>Rt,getEditorCanvasContainerView:()=>Bt});const o=window.wp.blocks,a=window.wp.blockLibrary,l=window.wp.data,c=window.wp.deprecated;var u=i.n(c);const d=window.wp.element,h=window.wp.editor,f=window.wp.preferences,m=window.wp.widgets,g=window.wp.hooks,v=window.wp.compose,x=window.wp.blockEditor,y=window.wp.components,b=window.wp.i18n,w=window.wp.notices,_=window.wp.coreData;var S={grad:.9,turn:360,rad:360/(2*Math.PI)},j=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},C=function(e,t,s){return void 0===t&&(t=0),void 0===s&&(s=Math.pow(10,t)),Math.round(s*e)/s+0},k=function(e,t,s){return void 0===t&&(t=0),void 0===s&&(s=1),e>s?s:e>t?e:t},E=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},P=function(e){return{r:k(e.r,0,255),g:k(e.g,0,255),b:k(e.b,0,255),a:k(e.a)}},I=function(e){return{r:C(e.r),g:C(e.g),b:C(e.b),a:C(e.a,3)}},T=/^#([0-9a-f]{3,8})$/i,O=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},A=function(e){var t=e.r,s=e.g,n=e.b,i=e.a,r=Math.max(t,s,n),o=r-Math.min(t,s,n),a=o?r===t?(s-n)/o:r===s?2+(n-t)/o:4+(t-s)/o:0;return{h:60*(a<0?a+6:a),s:r?o/r*100:0,v:r/255*100,a:i}},M=function(e){var t=e.h,s=e.s,n=e.v,i=e.a;t=t/360*6,s/=100,n/=100;var r=Math.floor(t),o=n*(1-s),a=n*(1-(t-r)*s),l=n*(1-(1-t+r)*s),c=r%6;return{r:255*[n,a,o,o,l,n][c],g:255*[l,n,n,a,o,o][c],b:255*[o,o,l,n,n,a][c],a:i}},N=function(e){return{h:E(e.h),s:k(e.s,0,100),l:k(e.l,0,100),a:k(e.a)}},V=function(e){return{h:C(e.h),s:C(e.s),l:C(e.l),a:C(e.a,3)}},F=function(e){return M((s=(t=e).s,{h:t.h,s:(s*=((n=t.l)<50?n:100-n)/100)>0?2*s/(n+s)*100:0,v:n+s,a:t.a}));var t,s,n},R=function(e){return{h:(t=A(e)).h,s:(i=(200-(s=t.s))*(n=t.v)/100)>0&&i<200?s*n/100/(i<=100?i:200-i)*100:0,l:i/2,a:t.a};var t,s,n,i},B=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,D=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,z=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,L=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,H={string:[[function(e){var t=T.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:4===e.length?C(parseInt(e[3]+e[3],16)/255,2):1}:6===e.length||8===e.length?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:8===e.length?C(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=z.exec(e)||L.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:P({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=B.exec(e)||D.exec(e);if(!t)return null;var s,n,i=N({h:(s=t[1],n=t[2],void 0===n&&(n="deg"),Number(s)*(S[n]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return F(i)},"hsl"]],object:[[function(e){var t=e.r,s=e.g,n=e.b,i=e.a,r=void 0===i?1:i;return j(t)&&j(s)&&j(n)?P({r:Number(t),g:Number(s),b:Number(n),a:Number(r)}):null},"rgb"],[function(e){var t=e.h,s=e.s,n=e.l,i=e.a,r=void 0===i?1:i;if(!j(t)||!j(s)||!j(n))return null;var o=N({h:Number(t),s:Number(s),l:Number(n),a:Number(r)});return F(o)},"hsl"],[function(e){var t=e.h,s=e.s,n=e.v,i=e.a,r=void 0===i?1:i;if(!j(t)||!j(s)||!j(n))return null;var o=function(e){return{h:E(e.h),s:k(e.s,0,100),v:k(e.v,0,100),a:k(e.a)}}({h:Number(t),s:Number(s),v:Number(n),a:Number(r)});return M(o)},"hsv"]]},G=function(e,t){for(var s=0;s=.5},e.prototype.toHex=function(){return t=(e=I(this.rgba)).r,s=e.g,n=e.b,r=(i=e.a)<1?O(C(255*i)):"","#"+O(t)+O(s)+O(n)+r;var e,t,s,n,i,r},e.prototype.toRgb=function(){return I(this.rgba)},e.prototype.toRgbString=function(){return t=(e=I(this.rgba)).r,s=e.g,n=e.b,(i=e.a)<1?"rgba("+t+", "+s+", "+n+", "+i+")":"rgb("+t+", "+s+", "+n+")";var e,t,s,n,i},e.prototype.toHsl=function(){return V(R(this.rgba))},e.prototype.toHslString=function(){return t=(e=V(R(this.rgba))).h,s=e.s,n=e.l,(i=e.a)<1?"hsla("+t+", "+s+"%, "+n+"%, "+i+")":"hsl("+t+", "+s+"%, "+n+"%)";var e,t,s,n,i},e.prototype.toHsv=function(){return e=A(this.rgba),{h:C(e.h),s:C(e.s),v:C(e.v),a:C(e.a,3)};var e},e.prototype.invert=function(){return Y({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},e.prototype.saturate=function(e){return void 0===e&&(e=.1),Y(W(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),Y(W(this.rgba,-e))},e.prototype.grayscale=function(){return Y(W(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),Y(Z(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),Y(Z(this.rgba,-e))},e.prototype.rotate=function(e){return void 0===e&&(e=15),this.hue(this.hue()+e)},e.prototype.alpha=function(e){return"number"==typeof e?Y({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):C(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=R(this.rgba);return"number"==typeof e?Y({h:e,s:t.s,l:t.l,a:t.a}):C(t.h)},e.prototype.isEqual=function(e){return this.toHex()===Y(e).toHex()},e}(),Y=function(e){return e instanceof K?e:new K(e)},X=[],J=function(e){var t=e/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},Q=function(e){return.2126*J(e.r)+.7152*J(e.g)+.0722*J(e.b)};const $=window.wp.privateApis,{lock:ee,unlock:te}=(0,$.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/edit-site"),{useGlobalSetting:se,useGlobalStyle:ne}=te(x.privateApis);function ie(){const[e="black"]=ne("color.text"),[t="white"]=ne("color.background"),[s=e]=ne("elements.h1.color.text"),[n=s]=ne("elements.link.color.text"),[i=n]=ne("elements.button.color.background"),[r]=se("color.palette.core"),[o]=se("color.palette.theme"),[a]=se("color.palette.custom"),l=(null!=o?o:[]).concat(null!=a?a:[]).concat(null!=r?r:[]),c=l.filter((({color:t})=>t===e)),u=l.filter((({color:e})=>e===i)),d=c.concat(u).concat(l).filter((({color:e})=>e!==t)).slice(0,2);return{paletteColors:l,highlightedColors:d}}function re(e,t,s){return e&&"object"==typeof e?(t.reduce(((e,n,i)=>(void 0===e[n]&&(Number.isInteger(t[i+1])?e[n]=[]:e[n]={}),i===t.length-1&&(e[n]=s),e[n])),e),e):e}!function(e){e.forEach((function(e){X.indexOf(e)<0&&(e(K,H),X.push(e))}))}([function(e){e.prototype.luminance=function(){return e=Q(this.rgba),void 0===(t=2)&&(t=0),void 0===s&&(s=Math.pow(10,t)),Math.round(s*e)/s+0;var e,t,s},e.prototype.contrast=function(t){void 0===t&&(t="#FFF");var s,n,i,r,o,a,l,c=t instanceof e?t:new e(t);return r=this.rgba,o=c.toRgb(),s=(a=Q(r))>(l=Q(o))?(a+.05)/(l+.05):(l+.05)/(a+.05),void 0===(n=2)&&(n=0),void 0===i&&(i=Math.pow(10,n)),Math.floor(i*s)/i+0},e.prototype.isReadable=function(e,t){return void 0===e&&(e="#FFF"),void 0===t&&(t={}),this.contrast(e)>=(o=void 0===(r=(s=t).size)?"normal":r,"AAA"===(i=void 0===(n=s.level)?"AA":n)&&"normal"===o?7:"AA"===i&&"large"===o?3:4.5);var s,n,i,r,o}}]);const oe=window.ReactJSXRuntime,{cleanEmptyObject:ae,GlobalStylesContext:le}=te(x.privateApis),ce={...o.__EXPERIMENTAL_STYLE_PROPERTY,blockGap:{value:["spacing","blockGap"]}},ue={"border.color":"color","color.background":"color","color.text":"color","elements.link.color.text":"color","elements.link.:hover.color.text":"color","elements.link.typography.fontFamily":"font-family","elements.link.typography.fontSize":"font-size","elements.button.color.text":"color","elements.button.color.background":"color","elements.button.typography.fontFamily":"font-family","elements.button.typography.fontSize":"font-size","elements.caption.color.text":"color","elements.heading.color":"color","elements.heading.color.background":"color","elements.heading.typography.fontFamily":"font-family","elements.heading.gradient":"gradient","elements.heading.color.gradient":"gradient","elements.h1.color":"color","elements.h1.color.background":"color","elements.h1.typography.fontFamily":"font-family","elements.h1.color.gradient":"gradient","elements.h2.color":"color","elements.h2.color.background":"color","elements.h2.typography.fontFamily":"font-family","elements.h2.color.gradient":"gradient","elements.h3.color":"color","elements.h3.color.background":"color","elements.h3.typography.fontFamily":"font-family","elements.h3.color.gradient":"gradient","elements.h4.color":"color","elements.h4.color.background":"color","elements.h4.typography.fontFamily":"font-family","elements.h4.color.gradient":"gradient","elements.h5.color":"color","elements.h5.color.background":"color","elements.h5.typography.fontFamily":"font-family","elements.h5.color.gradient":"gradient","elements.h6.color":"color","elements.h6.color.background":"color","elements.h6.typography.fontFamily":"font-family","elements.h6.color.gradient":"gradient","color.gradient":"gradient",blockGap:"spacing","typography.fontSize":"font-size","typography.fontFamily":"font-family"},de={"border.color":"borderColor","color.background":"backgroundColor","color.text":"textColor","color.gradient":"gradient","typography.fontSize":"fontSize","typography.fontFamily":"fontFamily"},pe=["border","color","spacing","typography"],he=(e,t)=>{let s=e;return t.forEach((e=>{s=s?.[e]})),s},fe=["borderColor","borderWidth","borderStyle"],me=["top","right","bottom","left"];function ge(e,t,s){if(!t?.[e]||s?.[e]?.style)return[];const{color:n,style:i,width:r}=t[e];return!(n||r)||i?[]:[{path:["border",e,"style"],value:"solid"}]}function ve(e,t,s){const n=function(e,t){const{supportedPanels:s}=(0,l.useSelect)((s=>({supportedPanels:te(s(o.store)).getSupportedStyles(e,t)})),[e,t]);return s}(e),i=s?.styles?.blocks?.[e];return(0,d.useMemo)((()=>{const e=n.flatMap((e=>{if(!ce[e])return[];const{value:s}=ce[e],n=s.join("."),i=t[de[n]],r=i?`var:preset|${ue[n]}|${i}`:he(t.style,s);if("linkColor"===e){const e=r?[{path:s,value:r}]:[],n=["elements","link",":hover","color","text"],i=he(t.style,n);return i&&e.push({path:n,value:i}),e}if(fe.includes(e)&&r){const e=[{path:s,value:r}];return me.forEach((t=>{const n=[...s];n.splice(-1,0,t),e.push({path:n,value:r})})),e}return r?[{path:s,value:r}]:[]}));return function(e,t,s){if(!e&&!t)return[];const n=[...ge("top",e,s),...ge("right",e,s),...ge("bottom",e,s),...ge("left",e,s)],{color:i,style:r,width:o}=e||{};return(t||i||o)&&!r&&me.forEach((e=>{s?.[e]?.style||n.push({path:["border",e,"style"],value:"solid"})})),n}(t.style?.border,t.borderColor,i?.border).forEach((t=>e.push(t))),e}),[n,t,i])}function xe({name:e,attributes:t,setAttributes:s}){const{user:n,setUserConfig:i}=(0,d.useContext)(le),r=ve(e,t,n),{__unstableMarkNextChangeAsNotPersistent:a}=(0,l.useDispatch)(x.store),{createSuccessNotice:c}=(0,l.useDispatch)(w.store),u=(0,d.useCallback)((()=>{if(0!==r.length&&r.length>0){const{style:l}=t,u=structuredClone(l),d=structuredClone(n);for(const{path:t,value:s}of r)re(u,t,void 0),re(d,["styles","blocks",e,...t],s);const p={borderColor:void 0,backgroundColor:void 0,textColor:void 0,gradient:void 0,fontSize:void 0,fontFamily:void 0,style:ae(u)};a(),s(p),i(d,{undoIgnore:!0}),c((0,b.sprintf)((0,b.__)("%s styles applied."),(0,o.getBlockType)(e).title),{type:"snackbar",actions:[{label:(0,b.__)("Undo"),onClick(){a(),s(t),i(n,{undoIgnore:!0})}}]})}}),[a,t,r,c,e,s,i,n]);return(0,oe.jsxs)(y.BaseControl,{__nextHasNoMarginBottom:!0,className:"edit-site-push-changes-to-global-styles-control",help:(0,b.sprintf)((0,b.__)("Apply this block’s typography, spacing, dimensions, and color styles to all %s blocks."),(0,o.getBlockType)(e).title),children:[(0,oe.jsx)(y.BaseControl.VisualLabel,{children:(0,b.__)("Styles")}),(0,oe.jsx)(y.Button,{__next40pxDefaultSize:!0,variant:"secondary",accessibleWhenDisabled:!0,disabled:0===r.length,onClick:u,children:(0,b.__)("Apply globally")})]})}function ye(e){const t=(0,x.useBlockEditingMode)(),s=(0,l.useSelect)((e=>e(_.store).getCurrentTheme()?.is_block_theme),[]),n=pe.some((t=>(0,o.hasBlockSupport)(e.name,t)));return"default"===t&&n&&s?(0,oe.jsx)(x.InspectorAdvancedControls,{children:(0,oe.jsx)(xe,{...e})}):null}const be=(0,v.createHigherOrderComponent)((e=>t=>(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(e,{...t},"edit"),t.isSelected&&(0,oe.jsx)(ye,{...t})]})));(0,g.addFilter)("editor.BlockEdit","core/edit-site/push-changes-to-global-styles",be);const we=(0,l.combineReducers)({settings:function(e={},t){return"UPDATE_SETTINGS"===t.type?{...e,...t.settings}:e},editedPost:function(e={},t){switch(t.type){case"SET_EDITED_POST":return{postType:t.postType,id:t.id,context:t.context};case"SET_EDITED_POST_CONTEXT":return{...e,context:t.context}}return e},saveViewPanel:function(e=!1,t){switch(t.type){case"SET_IS_SAVE_VIEW_OPENED":return t.isOpen;case"SET_CANVAS_MODE":return!1}return e},canvasMode:function(e="init",t){return"SET_CANVAS_MODE"===t.type?t.mode:e},editorCanvasContainerView:function(e=void 0,t){return"SET_EDITOR_CANVAS_CONTAINER_VIEW"===t.type?t.view:e}}),_e=window.wp.patterns,Se="wp_navigation",je="wp_template",Ce="wp_template_part",ke={custom:"custom",theme:"theme",plugin:"plugin"},Ee="uncategorized",Pe="all-parts",{PATTERN_TYPES:Ie,PATTERN_DEFAULT_CATEGORY:Te,PATTERN_USER_CATEGORY:Oe,EXCLUDED_PATTERN_SOURCES:Ae,PATTERN_SYNC_TYPES:Me}=te(_e.privateApis),Ne=[Ce,Se,Ie.user],Ve={[je]:(0,b.__)("Template"),[Ce]:(0,b.__)("Template part"),[Ie.user]:(0,b.__)("Pattern"),[Se]:(0,b.__)("Navigation")},Fe="grid",Re="table",Be="list",De="isAny",ze="isNone",{interfaceStore:Le}=te(h.privateApis);function He(e){return function({registry:t}){u()("dispatch( 'core/edit-site' ).toggleFeature( featureName )",{since:"6.0",alternative:"dispatch( 'core/preferences').toggle( 'core/edit-site', featureName )"}),t.dispatch(f.store).toggle("core/edit-site",e)}}const Ge=e=>({registry:t})=>{u()("dispatch( 'core/edit-site' ).__experimentalSetPreviewDeviceType",{since:"6.5",version:"6.7",hint:"registry.dispatch( editorStore ).setDeviceType"}),t.dispatch(h.store).setDeviceType(e)};function Ue(){return u()("dispatch( 'core/edit-site' ).setTemplate",{since:"6.5",version:"6.8",hint:"The setTemplate is not needed anymore, the correct entity is resolved from the URL automatically."}),{type:"NOTHING"}}const We=e=>async({dispatch:t,registry:s})=>{u()("dispatch( 'core/edit-site' ).addTemplate",{since:"6.5",version:"6.8",hint:"use saveEntityRecord directly"});const n=await s.dispatch(_.store).saveEntityRecord("postType",je,e);e.content&&s.dispatch(_.store).editEntityRecord("postType",je,n.id,{blocks:(0,o.parse)(e.content)},{undoIgnore:!0}),t({type:"SET_EDITED_POST",postType:je,id:n.id})},qe=e=>({registry:t})=>te(t.dispatch(h.store)).removeTemplates([e]);function Ze(e){return{type:"SET_EDITED_POST",postType:Ce,id:e}}function Ke(e){return{type:"SET_EDITED_POST",postType:Se,id:e}}function Ye(e,t,s){return{type:"SET_EDITED_POST",postType:e,id:t,context:s}}function Xe(){return u()("dispatch( 'core/edit-site' ).setHomeTemplateId",{since:"6.2",version:"6.4"}),{type:"NOTHING"}}function Je(e){return{type:"SET_EDITED_POST_CONTEXT",context:e}}function Qe(){return u()("dispatch( 'core/edit-site' ).setPage",{since:"6.5",version:"6.8",hint:"The setPage is not needed anymore, the correct entity is resolved from the URL automatically."}),{type:"NOTHING"}}function $e(){return u()("dispatch( 'core/edit-site' ).setNavigationPanelActiveMenu",{since:"6.2",version:"6.4"}),{type:"NOTHING"}}function et(){return u()("dispatch( 'core/edit-site' ).openNavigationPanelToMenu",{since:"6.2",version:"6.4"}),{type:"NOTHING"}}function tt(){return u()("dispatch( 'core/edit-site' ).setIsNavigationPanelOpened",{since:"6.2",version:"6.4"}),{type:"NOTHING"}}const st=e=>({registry:t})=>{u()("dispatch( 'core/edit-site' ).setIsInserterOpened",{since:"6.5",alternative:"dispatch( 'core/editor').setIsInserterOpened"}),t.dispatch(h.store).setIsInserterOpened(e)},nt=e=>({registry:t})=>{u()("dispatch( 'core/edit-site' ).setIsListViewOpened",{since:"6.5",alternative:"dispatch( 'core/editor').setIsListViewOpened"}),t.dispatch(h.store).setIsListViewOpened(e)};function it(e){return{type:"UPDATE_SETTINGS",settings:e}}function rt(e){return{type:"SET_IS_SAVE_VIEW_OPENED",isOpen:e}}const ot=(e,t)=>({registry:s})=>te(s.dispatch(h.store)).revertTemplate(e,t),at=e=>({registry:t})=>{t.dispatch(Le).enableComplementaryArea("core",e)},lt=()=>({registry:e})=>{e.dispatch(Le).disableComplementaryArea("core")},ct=e=>({registry:t})=>{u()("dispatch( 'core/edit-site' ).switchEditorMode",{since:"6.6",alternative:"dispatch( 'core/editor').switchEditorMode"}),t.dispatch(h.store).switchEditorMode(e)},ut=e=>({dispatch:t,registry:s})=>{u()("dispatch( 'core/edit-site' ).setHasPageContentFocus",{since:"6.5"}),e&&s.dispatch(x.store).clearSelectedBlock(),t({type:"SET_HAS_PAGE_CONTENT_FOCUS",hasPageContentFocus:e})},dt=()=>({registry:e})=>{u()("dispatch( 'core/edit-site' ).toggleDistractionFree",{since:"6.6",alternative:"dispatch( 'core/editor').toggleDistractionFree"}),e.dispatch(h.store).toggleDistractionFree()},pt=e=>({registry:t,dispatch:s})=>{const n=window.matchMedia("(min-width: 782px)").matches,i=()=>{t.batch((()=>{t.dispatch(x.store).clearSelectedBlock(),t.dispatch(h.store).setDeviceType("Desktop"),t.dispatch(x.store).__unstableSetEditorMode("edit");const i=t.select(h.store).isPublishSidebarOpened();s({type:"SET_CANVAS_MODE",mode:e});const r="edit"===e;i&&!r&&t.dispatch(h.store).closePublishSidebar(),n&&r&&t.select(f.store).get("core","showListViewByDefault")&&!t.select(f.store).get("core","distractionFree")?t.dispatch(h.store).setIsListViewOpened(!0):t.dispatch(h.store).setIsListViewOpened(!1),t.dispatch(h.store).setIsInserterOpened(!1)}))};if(n&&document.startViewTransition){document.documentElement.classList.add(`canvas-mode-${e}-transition`);document.startViewTransition((()=>i())).finished.finally((()=>{document.documentElement.classList.remove(`canvas-mode-${e}-transition`)}))}else i()},ht=e=>({dispatch:t})=>{t({type:"SET_EDITOR_CANVAS_CONTAINER_VIEW",view:e})},ft=[];const mt=(0,l.createRegistrySelector)((e=>(t,s)=>(u()("select( 'core/edit-site' ).isFeatureActive",{since:"6.0",alternative:"select( 'core/preferences' ).get"}),!!e(f.store).get("core/edit-site",s)))),gt=(0,l.createRegistrySelector)((e=>()=>(u()("select( 'core/edit-site' ).__experimentalGetPreviewDeviceType",{since:"6.5",version:"6.7",alternative:"select( 'core/editor' ).getDeviceType"}),e(h.store).getDeviceType()))),vt=(0,l.createRegistrySelector)((e=>()=>(u()("wp.data.select( 'core/edit-site' ).getCanUserCreateMedia()",{since:"6.7",alternative:"wp.data.select( 'core' ).canUser( 'create', { kind: 'root', type: 'media' } )"}),e(_.store).canUser("create","media")))),xt=(0,l.createRegistrySelector)((e=>()=>{u()("select( 'core/edit-site' ).getReusableBlocks()",{since:"6.5",version:"6.8",alternative:"select( 'core/core' ).getEntityRecords( 'postType', 'wp_block' )"});return"web"===d.Platform.OS?e(_.store).getEntityRecords("postType","wp_block",{per_page:-1}):[]}));function yt(e){return e.settings}function bt(){u()("select( 'core/edit-site' ).getHomeTemplateId",{since:"6.2",version:"6.4"})}function wt(e){return e.editedPost.postType}function _t(e){return e.editedPost.id}function St(e){return e.editedPost.context}function jt(e){return{context:e.editedPost.context}}const Ct=(0,l.createRegistrySelector)((e=>()=>(u()("select( 'core/edit-site' ).isInserterOpened",{since:"6.5",alternative:"select( 'core/editor' ).isInserterOpened"}),e(h.store).isInserterOpened()))),kt=(0,l.createRegistrySelector)((e=>()=>(u()("select( 'core/edit-site' ).__experimentalGetInsertionPoint",{since:"6.5",version:"6.7"}),te(e(h.store)).getInsertionPoint()))),Et=(0,l.createRegistrySelector)((e=>()=>(u()("select( 'core/edit-site' ).isListViewOpened",{since:"6.5",alternative:"select( 'core/editor' ).isListViewOpened"}),e(h.store).isListViewOpened())));function Pt(e){return e.saveViewPanel}function It(e){const t=e(_.store).getEntityRecords("postType",Ce,{per_page:-1}),{getBlocksByName:s,getBlocksByClientId:n}=e(x.store);return[n(s("core/template-part")),t]}const Tt=(0,l.createRegistrySelector)((e=>(0,l.createSelector)((()=>(u()("select( 'core/edit-site' ).getCurrentTemplateTemplateParts()",{since:"6.7",version:"6.9",alternative:"select( 'core/block-editor' ).getBlocksByName( 'core/template-part' )"}),function(e=ft,t){const s=t?t.reduce(((e,t)=>({...e,[t.id]:t})),{}):{},n=[],i=[...e];for(;i.length;){const{innerBlocks:e,...t}=i.shift();if(i.unshift(...e),(0,o.isTemplatePart)(t)){const{attributes:{theme:e,slug:i}}=t,r=s[`${e}//${i}`];r&&n.push({templatePart:r,block:t})}}return n}(...It(e)))),(()=>It(e))))),Ot=(0,l.createRegistrySelector)((e=>()=>e(f.store).get("core","editorMode")));function At(){u()("dispatch( 'core/edit-site' ).getCurrentTemplateNavigationPanelSubMenu",{since:"6.2",version:"6.4"})}function Mt(){u()("dispatch( 'core/edit-site' ).getNavigationPanelActiveMenu",{since:"6.2",version:"6.4"})}function Nt(){u()("dispatch( 'core/edit-site' ).isNavigationOpened",{since:"6.2",version:"6.4"})}function Vt(e){return!!e.editedPost.context?.postId}function Ft(){return u()("select( 'core/edit-site' ).hasPageContentFocus",{since:"6.5"}),!1}function Rt(e){return e.canvasMode}function Bt(e){return e.editorCanvasContainerView}const Dt={reducer:we,actions:e,selectors:s},zt=(0,l.createReduxStore)("core/edit-site",Dt);(0,l.register)(zt),te(zt).registerPrivateSelectors(n),te(zt).registerPrivateActions(t);const Lt=window.wp.plugins,Ht=window.wp.router;function Gt(e){var t,s,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var i=e.length;for(t=0;t{const{getEntityRecord:t}=e(_.store),s=t("root","__unstableBase",void 0);return{isRequestingSite:!s,siteIconUrl:s?.site_icon_url}}),[]);if(t&&!s)return(0,oe.jsx)("div",{className:"edit-site-site-icon__image"});const n=s?(0,oe.jsx)("img",{className:"edit-site-site-icon__image",alt:(0,b.__)("Site Icon"),src:s}):(0,oe.jsx)(y.Icon,{className:"edit-site-site-icon__icon",icon:ts,size:48});return(0,oe.jsx)("div",{className:Ut(e,"edit-site-site-icon"),children:n})},ns=window.wp.dom,is=(0,d.createContext)((()=>{}));function rs(){let e={direction:null,focusSelector:null};return{get:()=>e,navigate(t,s=null){e={direction:t,focusSelector:"forward"===t&&s?s:e.focusSelector}}}}function os({children:e}){const t=(0,d.useContext)(is),s=(0,d.useRef)(),[n,i]=(0,d.useState)(null);(0,d.useLayoutEffect)((()=>{const{direction:e,focusSelector:n}=t.get();!function(e,t,s){let n;if("back"===t&&s&&(n=e.querySelector(s)),null!==t&&!n){const[t]=ns.focus.tabbable.find(e);n=null!=t?t:e}n?.focus()}(s.current,e,n),i(e)}),[t]);const r=Ut("edit-site-sidebar__screen-wrapper",{"slide-from-left":"back"===n,"slide-from-right":"forward"===n});return(0,oe.jsx)("div",{ref:s,className:r,children:e})}function as({routeKey:e,children:t}){const[s]=(0,d.useState)(rs);return(0,oe.jsx)(is.Provider,{value:s,children:(0,oe.jsx)("div",{className:"edit-site-sidebar__content",children:(0,oe.jsx)(os,{children:t},e)})})}const{useHistory:ls}=te(Ht.privateApis),cs=(0,d.memo)((0,d.forwardRef)((({isTransparent:e},t)=>{const{dashboardLink:s,homeUrl:n,siteTitle:i}=(0,l.useSelect)((e=>{const{getSettings:t}=te(e(zt)),{getEntityRecord:s}=e(_.store),n=s("root","site");return{dashboardLink:t().__experimentalDashboardLink||"index.php",homeUrl:s("root","__unstableBase")?.home,siteTitle:!n?.title&&n?.url?(0,es.filterURLForDisplay)(n?.url):n?.title}}),[]),{open:r}=(0,l.useDispatch)(Wt.store);return(0,oe.jsx)("div",{className:"edit-site-site-hub",children:(0,oe.jsxs)(y.__experimentalHStack,{justify:"flex-start",spacing:"0",children:[(0,oe.jsx)("div",{className:Ut("edit-site-site-hub__view-mode-toggle-container",{"has-transparent-background":e}),children:(0,oe.jsx)(y.Button,{__next40pxDefaultSize:!0,ref:t,href:s,label:(0,b.__)("Go to the Dashboard"),className:"edit-site-layout__view-mode-toggle",style:{transform:"scale(0.5333) translateX(-4px)",borderRadius:4},children:(0,oe.jsx)(ss,{className:"edit-site-layout__view-mode-toggle-icon"})})}),(0,oe.jsxs)(y.__experimentalHStack,{children:[(0,oe.jsx)("div",{className:"edit-site-site-hub__title",children:(0,oe.jsxs)(y.Button,{__next40pxDefaultSize:!0,variant:"link",href:n,target:"_blank",children:[(0,Xt.decodeEntities)(i),(0,oe.jsx)(y.VisuallyHidden,{as:"span",children:(0,b.__)("(opens in a new tab)")})]})}),(0,oe.jsx)(y.__experimentalHStack,{spacing:0,expanded:!1,className:"edit-site-site-hub__actions",children:(0,oe.jsx)(y.Button,{size:"compact",className:"edit-site-site-hub_toggle-command-center",icon:Qt,onClick:()=>r(),label:(0,b.__)("Open command palette"),shortcut:$t.displayShortcut.primary("k")})})]})]})})}))),us=cs,ds=(0,d.memo)((0,d.forwardRef)((({isTransparent:e},t)=>{const s=ls(),{navigate:n}=(0,d.useContext)(is),{homeUrl:i,siteTitle:r}=(0,l.useSelect)((e=>{const{getEntityRecord:t}=e(_.store),s=t("root","site");return{homeUrl:t("root","__unstableBase")?.home,siteTitle:!s?.title&&s?.url?(0,es.filterURLForDisplay)(s?.url):s?.title}}),[]),{open:o}=(0,l.useDispatch)(Wt.store);return(0,oe.jsx)("div",{className:"edit-site-site-hub",children:(0,oe.jsxs)(y.__experimentalHStack,{justify:"flex-start",spacing:"0",children:[(0,oe.jsx)("div",{className:Ut("edit-site-site-hub__view-mode-toggle-container",{"has-transparent-background":e}),children:(0,oe.jsx)(y.Button,{__next40pxDefaultSize:!0,ref:t,label:(0,b.__)("Go to Site Editor"),className:"edit-site-layout__view-mode-toggle",style:{transform:"scale(0.5)",borderRadius:4},onClick:()=>{s.push({}),n("back")},children:(0,oe.jsx)(ss,{className:"edit-site-layout__view-mode-toggle-icon"})})}),(0,oe.jsxs)(y.__experimentalHStack,{children:[(0,oe.jsx)("div",{className:"edit-site-site-hub__title",children:(0,oe.jsx)(y.Button,{__next40pxDefaultSize:!0,variant:"link",href:i,target:"_blank",label:(0,b.__)("View site (opens in a new tab)"),children:(0,Xt.decodeEntities)(r)})}),(0,oe.jsx)(y.__experimentalHStack,{spacing:0,expanded:!1,className:"edit-site-site-hub__actions",children:(0,oe.jsx)(y.Button,{__next40pxDefaultSize:!0,className:"edit-site-site-hub_toggle-command-center",icon:Qt,onClick:()=>o(),label:(0,b.__)("Open command palette"),shortcut:$t.displayShortcut.primary("k")})})]})]})})}))),ps={position:void 0,userSelect:void 0,cursor:void 0,width:void 0,height:void 0,top:void 0,right:void 0,bottom:void 0,left:void 0},hs=320,fs=9/19.5,ms={width:"100%",height:"100%"};function gs(e,t){const s=1-Math.max(0,Math.min(1,(e-hs)/980)),n=((e,t,s)=>e+(t-e)*s)(t,fs,s);return e/n}const vs=function e({isFullWidth:t,isOversized:s,setIsOversized:n,isReady:i,children:r,defaultSize:o,innerContentStyle:a}){const c=(0,v.useReducedMotion)(),[u,p]=(0,d.useState)(ms),[h,f]=(0,d.useState)(),[m,g]=(0,d.useState)(!1),[x,w]=(0,d.useState)(!1),[_,S]=(0,d.useState)(1),j=(0,l.useSelect)((e=>te(e(zt)).getCanvasMode()),[]),{setCanvasMode:C}=te((0,l.useDispatch)(zt)),k={type:"tween",duration:m?0:.5},E=(0,d.useRef)(null),P=(0,v.useInstanceId)(e,"edit-site-resizable-frame-handle-help"),I=o.width/o.height,T={default:{flexGrow:0,height:u.height},fullWidth:{flexGrow:1,height:u.height}},O=m?"active":x?"visible":"hidden";return(0,oe.jsx)(y.ResizableBox,{as:y.__unstableMotion.div,ref:E,initial:!1,variants:T,animate:t?"fullWidth":"default",onAnimationComplete:e=>{"fullWidth"===e&&p({width:"100%",height:"100%"})},whileHover:"view"===j?{scale:1.005,transition:{duration:c?0:.5,ease:"easeOut"}}:{},transition:k,size:u,enable:{top:!1,right:!1,bottom:!1,left:i,topRight:!1,bottomRight:!1,bottomLeft:!1,topLeft:!1},resizeRatio:_,handleClasses:void 0,handleStyles:{left:ps,right:ps},minWidth:hs,maxWidth:t?"100%":"150%",maxHeight:"100%",onFocus:()=>w(!0),onBlur:()=>w(!1),onMouseOver:()=>w(!0),onMouseOut:()=>w(!1),handleComponent:{left:"view"===j&&(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(y.Tooltip,{text:(0,b.__)("Drag to resize"),children:(0,oe.jsx)(y.__unstableMotion.button,{role:"separator","aria-orientation":"vertical",className:Ut("edit-site-resizable-frame__handle",{"is-resizing":m}),variants:{hidden:{opacity:0,left:0},visible:{opacity:1,left:-14},active:{opacity:1,left:-14,scaleY:1.3}},animate:O,"aria-label":(0,b.__)("Drag to resize"),"aria-describedby":P,"aria-valuenow":E.current?.resizable?.offsetWidth||void 0,"aria-valuemin":hs,"aria-valuemax":o.width,onKeyDown:e=>{if(!["ArrowLeft","ArrowRight"].includes(e.key))return;e.preventDefault();const t=20*(e.shiftKey?5:1)*("ArrowLeft"===e.key?1:-1),s=Math.min(Math.max(hs,E.current.resizable.offsetWidth+t),o.width);p({width:s,height:gs(s,I)})},initial:"hidden",exit:"hidden",whileFocus:"active",whileHover:"active"},"handle")}),(0,oe.jsx)("div",{hidden:!0,id:P,children:(0,b.__)("Use left and right arrow keys to resize the canvas. Hold shift to resize in larger increments.")})]})},onResizeStart:(e,t,s)=>{f(s.offsetWidth),g(!0)},onResize:(e,t,i,r)=>{const a=r.width/_,l=Math.abs(a),c=r.width<0?l:(o.width-h)/2,u=Math.min(l,c),d=0===l?0:u/l;S(1-d+2*d);const f=h+r.width;n(f>o.width),p({height:s?"100%":gs(f,I)})},onResizeStop:(e,t,i)=>{if(g(!1),!s)return;n(!1);i.ownerDocument.documentElement.offsetWidth-i.offsetWidth>200?p(ms):C("edit")},className:Ut("edit-site-resizable-frame__inner",{"is-resizing":m}),showHandle:!1,children:(0,oe.jsx)("div",{className:"edit-site-resizable-frame__inner-content",style:a,children:r})})},xs=window.wp.keyboardShortcuts;const ys=function(){const{registerShortcut:e}=(0,l.useDispatch)(xs.store);return(0,d.useEffect)((()=>{e({name:"core/edit-site/save",category:"global",description:(0,b.__)("Save your changes."),keyCombination:{modifier:"primary",character:"s"}})}),[e]),null};const bs=function(){const{__experimentalGetDirtyEntityRecords:e,isSavingEntityRecord:t}=(0,l.useSelect)(_.store),{hasNonPostEntityChanges:s}=(0,l.useSelect)(h.store),{getCanvasMode:n}=te((0,l.useSelect)(zt)),{setIsSaveViewOpened:i}=(0,l.useDispatch)(zt);return(0,xs.useShortcut)("core/edit-site/save",(r=>{r.preventDefault();const o=e(),a=!!o.length,l=o.some((e=>t(e.kind,e.name,e.key))),c=s(),u="view"===n();(a&&c&&!l||u)&&i(!0)})),null};function ws(e,t){const{record:s,title:n,description:i,isLoaded:r,icon:o}=(0,l.useSelect)((s=>{const{getEditedPostType:n,getEditedPostId:i}=s(zt),{getEditedEntityRecord:r,hasFinishedResolution:o}=s(_.store),{__experimentalGetTemplateInfo:a}=s(h.store),l=null!=e?e:n(),c=null!=t?t:i(),u=r("postType",l,c),d=c&&o("getEditedEntityRecord",["postType",l,c]),p=a(u);return{record:u,title:p.title,description:p.description,isLoaded:d,icon:p.icon}}),[e,t]);return{isLoaded:r,icon:o,record:s,getTitle:()=>n?(0,Xt.decodeEntities)(n):null,getDescription:()=>i?(0,Xt.decodeEntities)(i):null}}const _s=1e4;function Ss(){const{isLoaded:e}=ws(),[t,s]=(0,d.useState)(!1),n=(0,l.useSelect)((e=>{const s=e(_.store).hasResolvingSelectors();return!t&&!s}),[t]);return(0,d.useEffect)((()=>{let e;return t||(e=setTimeout((()=>{s(!0)}),_s)),()=>{clearTimeout(e)}}),[t]),(0,d.useEffect)((()=>{if(n){const e=setTimeout((()=>{s(!0)}),100);return()=>{clearTimeout(e)}}}),[n]),!t||!e}var js=zs(),Cs=e=>Fs(e,js),ks=zs();Cs.write=e=>Fs(e,ks);var Es=zs();Cs.onStart=e=>Fs(e,Es);var Ps=zs();Cs.onFrame=e=>Fs(e,Ps);var Is=zs();Cs.onFinish=e=>Fs(e,Is);var Ts=[];Cs.setTimeout=(e,t)=>{let s=Cs.now()+t,n=()=>{let e=Ts.findIndex((e=>e.cancel==n));~e&&Ts.splice(e,1),Ns-=~e?1:0},i={time:s,handler:e,cancel:n};return Ts.splice(Os(s),0,i),Ns+=1,Rs(),i};var Os=e=>~(~Ts.findIndex((t=>t.time>e))||~Ts.length);Cs.cancel=e=>{Es.delete(e),Ps.delete(e),Is.delete(e),js.delete(e),ks.delete(e)},Cs.sync=e=>{Vs=!0,Cs.batchedUpdates(e),Vs=!1},Cs.throttle=e=>{let t;function s(){try{e(...t)}finally{t=null}}function n(...e){t=e,Cs.onStart(s)}return n.handler=e,n.cancel=()=>{Es.delete(s),t=null},n};var As=typeof window<"u"?window.requestAnimationFrame:()=>{};Cs.use=e=>As=e,Cs.now=typeof performance<"u"?()=>performance.now():Date.now,Cs.batchedUpdates=e=>e(),Cs.catch=console.error,Cs.frameLoop="always",Cs.advance=()=>{"demand"!==Cs.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):Ds()};var Ms=-1,Ns=0,Vs=!1;function Fs(e,t){Vs?(t.delete(e),e(0)):(t.add(e),Rs())}function Rs(){Ms<0&&(Ms=0,"demand"!==Cs.frameLoop&&As(Bs))}function Bs(){~Ms&&(As(Bs),Cs.batchedUpdates(Ds))}function Ds(){let e=Ms;Ms=Cs.now();let t=Os(Ms);t&&(Ls(Ts.splice(0,t),(e=>e.handler())),Ns-=t),Ns?(Es.flush(),js.flush(e?Math.min(64,Ms-e):16.667),Ps.flush(),ks.flush(),Is.flush()):Ms=-1}function zs(){let e=new Set,t=e;return{add(s){Ns+=t!=e||e.has(s)?0:1,e.add(s)},delete:s=>(Ns-=t==e&&e.has(s)?1:0,e.delete(s)),flush(s){t.size&&(e=new Set,Ns-=t.size,Ls(t,(t=>t(s)&&e.add(t))),Ns+=e.size,t=e)}}}function Ls(e,t){e.forEach((e=>{try{t(e)}catch(e){Cs.catch(e)}}))}var Hs=i(1609),Gs=i.t(Hs,2),Us=Object.defineProperty,Ws={};function qs(){}((e,t)=>{for(var s in t)Us(e,s,{get:t[s],enumerable:!0})})(Ws,{assign:()=>an,colors:()=>nn,createStringInterpolator:()=>$s,skipAnimation:()=>rn,to:()=>en,willAdvance:()=>on});var Zs={arr:Array.isArray,obj:e=>!!e&&"Object"===e.constructor.name,fun:e=>"function"==typeof e,str:e=>"string"==typeof e,num:e=>"number"==typeof e,und:e=>void 0===e};function Ks(e,t){if(Zs.arr(e)){if(!Zs.arr(t)||e.length!==t.length)return!1;for(let s=0;se.forEach(t);function Xs(e,t,s){if(Zs.arr(e))for(let n=0;nZs.und(e)?[]:Zs.arr(e)?e:[e];function Qs(e,t){if(e.size){let s=Array.from(e);e.clear(),Ys(s,t)}}var $s,en,tn=(e,...t)=>Qs(e,(e=>e(...t))),sn=()=>typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),nn=null,rn=!1,on=qs,an=e=>{e.to&&(en=e.to),e.now&&(Cs.now=e.now),void 0!==e.colors&&(nn=e.colors),null!=e.skipAnimation&&(rn=e.skipAnimation),e.createStringInterpolator&&($s=e.createStringInterpolator),e.requestAnimationFrame&&Cs.use(e.requestAnimationFrame),e.batchedUpdates&&(Cs.batchedUpdates=e.batchedUpdates),e.willAdvance&&(on=e.willAdvance),e.frameLoop&&(Cs.frameLoop=e.frameLoop)},ln=new Set,cn=[],un=[],dn=0,pn={get idle(){return!ln.size&&!cn.length},start(e){dn>e.priority?(ln.add(e),Cs.onStart(hn)):(fn(e),Cs(gn))},advance:gn,sort(e){if(dn)Cs.onFrame((()=>pn.sort(e)));else{let t=cn.indexOf(e);~t&&(cn.splice(t,1),mn(e))}},clear(){cn=[],ln.clear()}};function hn(){ln.forEach(fn),ln.clear(),Cs(gn)}function fn(e){cn.includes(e)||mn(e)}function mn(e){cn.splice(function(e,t){let s=e.findIndex(t);return s<0?e.length:s}(cn,(t=>t.priority>e.priority)),0,e)}function gn(e){let t=un;for(let s=0;s0}var vn="[-+]?\\d*\\.?\\d+",xn=vn+"%";function yn(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}var bn=new RegExp("rgb"+yn(vn,vn,vn)),wn=new RegExp("rgba"+yn(vn,vn,vn,vn)),_n=new RegExp("hsl"+yn(vn,xn,xn)),Sn=new RegExp("hsla"+yn(vn,xn,xn,vn)),jn=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Cn=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,kn=/^#([0-9a-fA-F]{6})$/,En=/^#([0-9a-fA-F]{8})$/;function Pn(e,t,s){return s<0&&(s+=1),s>1&&(s-=1),s<1/6?e+6*(t-e)*s:s<.5?t:s<2/3?e+(t-e)*(2/3-s)*6:e}function In(e,t,s){let n=s<.5?s*(1+t):s+t-s*t,i=2*s-n,r=Pn(i,n,e+1/3),o=Pn(i,n,e),a=Pn(i,n,e-1/3);return Math.round(255*r)<<24|Math.round(255*o)<<16|Math.round(255*a)<<8}function Tn(e){let t=parseInt(e,10);return t<0?0:t>255?255:t}function On(e){return(parseFloat(e)%360+360)%360/360}function An(e){let t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function Mn(e){let t=parseFloat(e);return t<0?0:t>100?1:t/100}function Nn(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=kn.exec(e))?parseInt(t[1]+"ff",16)>>>0:nn&&void 0!==nn[e]?nn[e]:(t=bn.exec(e))?(Tn(t[1])<<24|Tn(t[2])<<16|Tn(t[3])<<8|255)>>>0:(t=wn.exec(e))?(Tn(t[1])<<24|Tn(t[2])<<16|Tn(t[3])<<8|An(t[4]))>>>0:(t=jn.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=En.exec(e))?parseInt(t[1],16)>>>0:(t=Cn.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=_n.exec(e))?(255|In(On(t[1]),Mn(t[2]),Mn(t[3])))>>>0:(t=Sn.exec(e))?(In(On(t[1]),Mn(t[2]),Mn(t[3]))|An(t[4]))>>>0:null}(e);return null===t?e:(t=t||0,`rgba(${(4278190080&t)>>>24}, ${(16711680&t)>>>16}, ${(65280&t)>>>8}, ${(255&t)/255})`)}var Vn=(e,t,s)=>{if(Zs.fun(e))return e;if(Zs.arr(e))return Vn({range:e,output:t,extrapolate:s});if(Zs.str(e.output[0]))return $s(e);let n=e,i=n.output,r=n.range||[0,1],o=n.extrapolateLeft||n.extrapolate||"extend",a=n.extrapolateRight||n.extrapolate||"extend",l=n.easing||(e=>e);return e=>{let t=function(e,t){for(var s=1;s=e);++s);return s-1}(e,r);return function(e,t,s,n,i,r,o,a,l){let c=l?l(e):e;if(cs){if("identity"===a)return c;"clamp"===a&&(c=s)}return n===i?n:t===s?e<=t?n:i:(t===-1/0?c=-c:s===1/0?c-=t:c=(c-t)/(s-t),c=r(c),n===-1/0?c=-c:i===1/0?c+=n:c=c*(i-n)+n,c)}(e,r[t],r[t+1],i[t],i[t+1],l,o,a,n.map)}};var Fn=1.70158,Rn=1.525*Fn,Bn=Fn+1,Dn=2*Math.PI/3,zn=2*Math.PI/4.5,Ln=e=>e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375,Hn={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>1-(1-e)*(1-e),easeInOutQuad:e=>e<.5?2*e*e:1-Math.pow(-2*e+2,2)/2,easeInCubic:e=>e*e*e,easeOutCubic:e=>1-Math.pow(1-e,3),easeInOutCubic:e=>e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2,easeInQuart:e=>e*e*e*e,easeOutQuart:e=>1-Math.pow(1-e,4),easeInOutQuart:e=>e<.5?8*e*e*e*e:1-Math.pow(-2*e+2,4)/2,easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>1-Math.pow(1-e,5),easeInOutQuint:e=>e<.5?16*e*e*e*e*e:1-Math.pow(-2*e+2,5)/2,easeInSine:e=>1-Math.cos(e*Math.PI/2),easeOutSine:e=>Math.sin(e*Math.PI/2),easeInOutSine:e=>-(Math.cos(Math.PI*e)-1)/2,easeInExpo:e=>0===e?0:Math.pow(2,10*e-10),easeOutExpo:e=>1===e?1:1-Math.pow(2,-10*e),easeInOutExpo:e=>0===e?0:1===e?1:e<.5?Math.pow(2,20*e-10)/2:(2-Math.pow(2,-20*e+10))/2,easeInCirc:e=>1-Math.sqrt(1-Math.pow(e,2)),easeOutCirc:e=>Math.sqrt(1-Math.pow(e-1,2)),easeInOutCirc:e=>e<.5?(1-Math.sqrt(1-Math.pow(2*e,2)))/2:(Math.sqrt(1-Math.pow(-2*e+2,2))+1)/2,easeInBack:e=>Bn*e*e*e-Fn*e*e,easeOutBack:e=>1+Bn*Math.pow(e-1,3)+Fn*Math.pow(e-1,2),easeInOutBack:e=>e<.5?Math.pow(2*e,2)*(2*(Rn+1)*e-Rn)/2:(Math.pow(2*e-2,2)*((Rn+1)*(2*e-2)+Rn)+2)/2,easeInElastic:e=>0===e?0:1===e?1:-Math.pow(2,10*e-10)*Math.sin((10*e-10.75)*Dn),easeOutElastic:e=>0===e?0:1===e?1:Math.pow(2,-10*e)*Math.sin((10*e-.75)*Dn)+1,easeInOutElastic:e=>0===e?0:1===e?1:e<.5?-Math.pow(2,20*e-10)*Math.sin((20*e-11.125)*zn)/2:Math.pow(2,-20*e+10)*Math.sin((20*e-11.125)*zn)/2+1,easeInBounce:e=>1-Ln(1-e),easeOutBounce:Ln,easeInOutBounce:e=>e<.5?(1-Ln(1-2*e))/2:(1+Ln(2*e-1))/2,steps:(e,t="end")=>s=>{let n=(s="end"===t?Math.min(s,.999):Math.max(s,.001))*e;return((e,t,s)=>Math.min(Math.max(s,e),t))(0,1,("end"===t?Math.floor(n):Math.ceil(n))/e)}},Gn=Symbol.for("FluidValue.get"),Un=Symbol.for("FluidValue.observers"),Wn=e=>Boolean(e&&e[Gn]),qn=e=>e&&e[Gn]?e[Gn]():e,Zn=e=>e[Un]||null;function Kn(e,t){let s=e[Un];s&&s.forEach((e=>{!function(e,t){e.eventObserved?e.eventObserved(t):e(t)}(e,t)}))}var Yn=class{[Gn];[Un];constructor(e){if(!e&&!(e=this.get))throw Error("Unknown getter");Xn(this,e)}},Xn=(e,t)=>ei(e,Gn,t);function Jn(e,t){if(e[Gn]){let s=e[Un];s||ei(e,Un,s=new Set),s.has(t)||(s.add(t),e.observerAdded&&e.observerAdded(s.size,t))}return t}function Qn(e,t){let s=e[Un];if(s&&s.has(t)){let n=s.size-1;n?s.delete(t):e[Un]=null,e.observerRemoved&&e.observerRemoved(n,t)}}var $n,ei=(e,t,s)=>Object.defineProperty(e,t,{value:s,writable:!0,configurable:!0}),ti=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,si=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,ni=new RegExp(`(${ti.source})(%|[a-z]+)`,"i"),ii=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,ri=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,oi=e=>{let[t,s]=ai(e);if(!t||sn())return e;let n=window.getComputedStyle(document.documentElement).getPropertyValue(t);if(n)return n.trim();if(s&&s.startsWith("--")){return window.getComputedStyle(document.documentElement).getPropertyValue(s)||e}return s&&ri.test(s)?oi(s):s||e},ai=e=>{let t=ri.exec(e);if(!t)return[,];let[,s,n]=t;return[s,n]},li=(e,t,s,n,i)=>`rgba(${Math.round(t)}, ${Math.round(s)}, ${Math.round(n)}, ${i})`,ci=e=>{$n||($n=nn?new RegExp(`(${Object.keys(nn).join("|")})(?!\\w)`,"g"):/^\b$/);let t=e.output.map((e=>qn(e).replace(ri,oi).replace(si,Nn).replace($n,Nn))),s=t.map((e=>e.match(ti).map(Number))),n=s[0].map(((e,t)=>s.map((e=>{if(!(t in e))throw Error('The arity of each "output" value must be equal');return e[t]})))).map((t=>Vn({...e,output:t})));return e=>{let s=!ni.test(t[0])&&t.find((e=>ni.test(e)))?.replace(ti,""),i=0;return t[0].replace(ti,(()=>`${n[i++](e)}${s||""}`)).replace(ii,li)}},ui="react-spring: ",di=e=>{let t=e,s=!1;if("function"!=typeof t)throw new TypeError(`${ui}once requires a function parameter`);return(...e)=>{s||(t(...e),s=!0)}},pi=di(console.warn);di(console.warn);function hi(e){return Zs.str(e)&&("#"==e[0]||/\d/.test(e)||!sn()&&ri.test(e)||e in(nn||{}))}new WeakMap;new Set,new WeakMap,new WeakMap,new WeakMap;var fi=sn()?Hs.useEffect:Hs.useLayoutEffect;function mi(){let e=(0,Hs.useState)()[1],t=(()=>{let e=(0,Hs.useRef)(!1);return fi((()=>(e.current=!0,()=>{e.current=!1})),[]),e})();return()=>{t.current&&e(Math.random())}}var gi=[];var vi=Symbol.for("Animated:node"),xi=e=>e&&e[vi],yi=(e,t)=>((e,t,s)=>Object.defineProperty(e,t,{value:s,writable:!0,configurable:!0}))(e,vi,t),bi=e=>e&&e[vi]&&e[vi].getPayload(),wi=class{payload;constructor(){yi(this,this)}getPayload(){return this.payload||[]}},_i=class extends wi{constructor(e){super(),this._value=e,Zs.num(this._value)&&(this.lastPosition=this._value)}done=!0;elapsedTime;lastPosition;lastVelocity;v0;durationProgress=0;static create(e){return new _i(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return Zs.num(e)&&(this.lastPosition=e,t&&(e=Math.round(e/t)*t,this.done&&(this.lastPosition=e))),this._value!==e&&(this._value=e,!0)}reset(){let{done:e}=this;this.done=!1,Zs.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}},Si=class extends _i{_string=null;_toString;constructor(e){super(0),this._toString=Vn({output:[e,e]})}static create(e){return new Si(e)}getValue(){return this._string??(this._string=this._toString(this._value))}setValue(e){if(Zs.str(e)){if(e==this._string)return!1;this._string=e,this._value=1}else{if(!super.setValue(e))return!1;this._string=null}return!0}reset(e){e&&(this._toString=Vn({output:[this.getValue(),e]})),this._value=0,super.reset()}},ji={dependencies:null},Ci=class extends wi{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){let t={};return Xs(this.source,((s,n)=>{(e=>!!e&&e[vi]===e)(s)?t[n]=s.getValue(e):Wn(s)?t[n]=qn(s):e||(t[n]=s)})),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&Ys(this.payload,(e=>e.reset()))}_makePayload(e){if(e){let t=new Set;return Xs(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){ji.dependencies&&Wn(e)&&ji.dependencies.add(e);let t=bi(e);t&&Ys(t,(e=>this.add(e)))}},ki=class extends Ci{constructor(e){super(e)}static create(e){return new ki(e)}getValue(){return this.source.map((e=>e.getValue()))}setValue(e){let t=this.getPayload();return e.length==t.length?t.map(((t,s)=>t.setValue(e[s]))).some(Boolean):(super.setValue(e.map(Ei)),!0)}};function Ei(e){return(hi(e)?Si:_i).create(e)}function Pi(e){let t=xi(e);return t?t.constructor:Zs.arr(e)?ki:hi(e)?Si:_i}var Ii=(e,t)=>{let s=!Zs.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,Hs.forwardRef)(((n,i)=>{let r=(0,Hs.useRef)(null),o=s&&(0,Hs.useCallback)((e=>{r.current=function(e,t){return e&&(Zs.fun(e)?e(t):e.current=t),t}(i,e)}),[i]),[a,l]=function(e,t){let s=new Set;return ji.dependencies=s,e.style&&(e={...e,style:t.createAnimatedStyle(e.style)}),e=new Ci(e),ji.dependencies=null,[e,s]}(n,t),c=mi(),u=()=>{let e=r.current;s&&!e||!1===(!!e&&t.applyAnimatedValues(e,a.getValue(!0)))&&c()},d=new Ti(u,l),p=(0,Hs.useRef)();fi((()=>(p.current=d,Ys(l,(e=>Jn(e,d))),()=>{p.current&&(Ys(p.current.deps,(e=>Qn(e,p.current))),Cs.cancel(p.current.update))}))),(0,Hs.useEffect)(u,[]),(e=>{(0,Hs.useEffect)(e,gi)})((()=>()=>{let e=p.current;Ys(e.deps,(t=>Qn(t,e)))}));let h=t.getComponentProps(a.getValue());return Hs.createElement(e,{...h,ref:o})}))},Ti=class{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){"change"==e.type&&Cs.write(this.update)}};var Oi=Symbol.for("AnimatedComponent"),Ai=e=>Zs.str(e)?e:e&&Zs.str(e.displayName)?e.displayName:Zs.fun(e)&&e.name||null;function Mi(e,...t){return Zs.fun(e)?e(...t):e}var Ni=(e,t)=>!0===e||!!(t&&e&&(Zs.fun(e)?e(t):Js(e).includes(t))),Vi=(e,t)=>Zs.obj(e)?t&&e[t]:e,Fi=(e,t)=>!0===e.default?e[t]:e.default?e.default[t]:void 0,Ri=e=>e,Bi=(e,t=Ri)=>{let s=Di;e.default&&!0!==e.default&&(e=e.default,s=Object.keys(e));let n={};for(let i of s){let s=t(e[i],i);Zs.und(s)||(n[i]=s)}return n},Di=["config","onProps","onStart","onChange","onPause","onResume","onRest"],zi={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function Li(e){let t=function(e){let t={},s=0;if(Xs(e,((e,n)=>{zi[n]||(t[n]=e,s++)})),s)return t}(e);if(t){let s={to:t};return Xs(e,((e,n)=>n in t||(s[n]=e))),s}return{...e}}function Hi(e){return e=qn(e),Zs.arr(e)?e.map(Hi):hi(e)?Ws.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function Gi(e){return Zs.fun(e)||Zs.arr(e)&&Zs.obj(e[0])}var Ui={tension:170,friction:26,mass:1,damping:1,easing:Hn.linear,clamp:!1},Wi=class{tension;friction;frequency;damping;mass;velocity=0;restVelocity;precision;progress;duration;easing;clamp;bounce;decay;round;constructor(){Object.assign(this,Ui)}};function qi(e,t){if(Zs.und(t.decay)){let s=!Zs.und(t.tension)||!Zs.und(t.friction);(s||!Zs.und(t.frequency)||!Zs.und(t.damping)||!Zs.und(t.mass))&&(e.duration=void 0,e.decay=void 0),s&&(e.frequency=void 0)}else e.duration=void 0}var Zi=[],Ki=class{changed=!1;values=Zi;toValues=null;fromValues=Zi;to;from;config=new Wi;immediate=!1};function Yi(e,{key:t,props:s,defaultProps:n,state:i,actions:r}){return new Promise(((o,a)=>{let l,c,u=Ni(s.cancel??n?.cancel,t);if(u)h();else{Zs.und(s.pause)||(i.paused=Ni(s.pause,t));let e=n?.pause;!0!==e&&(e=i.paused||Ni(e,t)),l=Mi(s.delay||0,t),e?(i.resumeQueue.add(p),r.pause()):(r.resume(),p())}function d(){i.resumeQueue.add(p),i.timeouts.delete(c),c.cancel(),l=c.time-Cs.now()}function p(){l>0&&!Ws.skipAnimation?(i.delayed=!0,c=Cs.setTimeout(h,l),i.pauseQueue.add(d),i.timeouts.add(c)):h()}function h(){i.delayed&&(i.delayed=!1),i.pauseQueue.delete(d),i.timeouts.delete(c),e<=(i.cancelId||0)&&(u=!0);try{r.start({...s,callId:e,cancel:u},o)}catch(e){a(e)}}}))}var Xi=(e,t)=>1==t.length?t[0]:t.some((e=>e.cancelled))?$i(e.get()):t.every((e=>e.noop))?Ji(e.get()):Qi(e.get(),t.every((e=>e.finished))),Ji=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),Qi=(e,t,s=!1)=>({value:e,finished:t,cancelled:s}),$i=e=>({value:e,cancelled:!0,finished:!1});function er(e,t,s,n){let{callId:i,parentId:r,onRest:o}=t,{asyncTo:a,promise:l}=s;return r||e!==a||t.reset?s.promise=(async()=>{s.asyncId=i,s.asyncTo=e;let c,u,d,p=Bi(t,((e,t)=>"onRest"===t?void 0:e)),h=new Promise(((e,t)=>(c=e,u=t))),f=e=>{let t=i<=(s.cancelId||0)&&$i(n)||i!==s.asyncId&&Qi(n,!1);if(t)throw e.result=t,u(e),e},m=(e,t)=>{let r=new sr,o=new nr;return(async()=>{if(Ws.skipAnimation)throw tr(s),o.result=Qi(n,!1),u(o),o;f(r);let a=Zs.obj(e)?{...e}:{...t,to:e};a.parentId=i,Xs(p,((e,t)=>{Zs.und(a[t])&&(a[t]=e)}));let l=await n.start(a);return f(r),s.paused&&await new Promise((e=>{s.resumeQueue.add(e)})),l})()};if(Ws.skipAnimation)return tr(s),Qi(n,!1);try{let t;t=Zs.arr(e)?(async e=>{for(let t of e)await m(t)})(e):Promise.resolve(e(m,n.stop.bind(n))),await Promise.all([t.then(c),h]),d=Qi(n.get(),!0,!1)}catch(e){if(e instanceof sr)d=e.result;else{if(!(e instanceof nr))throw e;d=e.result}}finally{i==s.asyncId&&(s.asyncId=r,s.asyncTo=r?a:void 0,s.promise=r?l:void 0)}return Zs.fun(o)&&Cs.batchedUpdates((()=>{o(d,n,n.item)})),d})():l}function tr(e,t){Qs(e.timeouts,(e=>e.cancel())),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}var sr=class extends Error{result;constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise.")}},nr=class extends Error{result;constructor(){super("SkipAnimationSignal")}},ir=e=>e instanceof or,rr=1,or=class extends Yn{id=rr++;_priority=0;get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){let e=xi(this);return e&&e.getValue()}to(...e){return Ws.to(this,e)}interpolate(...e){return pi(`${ui}The "interpolate" function is deprecated in v9 (use "to" instead)`),Ws.to(this,e)}toJSON(){return this.get()}observerAdded(e){1==e&&this._attach()}observerRemoved(e){0==e&&this._detach()}_attach(){}_detach(){}_onChange(e,t=!1){Kn(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||pn.sort(this),Kn(this,{type:"priority",parent:this,priority:e})}},ar=Symbol.for("SpringPhase"),lr=e=>(1&e[ar])>0,cr=e=>(2&e[ar])>0,ur=e=>(4&e[ar])>0,dr=(e,t)=>t?e[ar]|=3:e[ar]&=-3,pr=(e,t)=>t?e[ar]|=4:e[ar]&=-5,hr=class extends or{key;animation=new Ki;queue;defaultProps={};_state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set};_pendingCalls=new Set;_lastCallId=0;_lastToId=0;_memoizedDuration=0;constructor(e,t){if(super(),!Zs.und(e)||!Zs.und(t)){let s=Zs.obj(e)?{...e}:{...t,from:e};Zs.und(s.default)&&(s.default=!0),this.start(s)}}get idle(){return!(cr(this)||this._state.asyncTo)||ur(this)}get goal(){return qn(this.animation.to)}get velocity(){let e=xi(this);return e instanceof _i?e.lastVelocity||0:e.getPayload().map((e=>e.lastVelocity||0))}get hasAnimated(){return lr(this)}get isAnimating(){return cr(this)}get isPaused(){return ur(this)}get isDelayed(){return this._state.delayed}advance(e){let t=!0,s=!1,n=this.animation,{config:i,toValues:r}=n,o=bi(n.to);!o&&Wn(n.to)&&(r=Js(qn(n.to))),n.values.forEach(((a,l)=>{if(a.done)return;let c=a.constructor==Si?1:o?o[l].lastPosition:r[l],u=n.immediate,d=c;if(!u){if(d=a.lastPosition,i.tension<=0)return void(a.done=!0);let t,s=a.elapsedTime+=e,r=n.fromValues[l],o=null!=a.v0?a.v0:a.v0=Zs.arr(i.velocity)?i.velocity[l]:i.velocity,p=i.precision||(r==c?.005:Math.min(1,.001*Math.abs(c-r)));if(Zs.und(i.duration))if(i.decay){let e=!0===i.decay?.998:i.decay,n=Math.exp(-(1-e)*s);d=r+o/(1-e)*(1-n),u=Math.abs(a.lastPosition-d)<=p,t=o*n}else{t=null==a.lastVelocity?o:a.lastVelocity;let s,n=i.restVelocity||p/10,l=i.clamp?0:i.bounce,h=!Zs.und(l),f=r==c?a.v0>0:rn,s||(u=Math.abs(c-d)<=p,!u));++e){h&&(m=d==c||d>c==f,m&&(t=-t*l,d=c)),t+=(1e-6*-i.tension*(d-c)+.001*-i.friction*t)/i.mass*g,d+=t*g}}else{let n=1;i.duration>0&&(this._memoizedDuration!==i.duration&&(this._memoizedDuration=i.duration,a.durationProgress>0&&(a.elapsedTime=i.duration*a.durationProgress,s=a.elapsedTime+=e)),n=(i.progress||0)+s/this._memoizedDuration,n=n>1?1:n<0?0:n,a.durationProgress=n),d=r+i.easing(n)*(c-r),t=(d-a.lastPosition)/e,u=1==n}a.lastVelocity=t,Number.isNaN(d)&&(console.warn("Got NaN while animating:",this),u=!0)}o&&!o[l].done&&(u=!1),u?a.done=!0:t=!1,a.setValue(d,i.round)&&(s=!0)}));let a=xi(this),l=a.getValue();if(t){let e=qn(n.to);l===e&&!s||i.decay?s&&i.decay&&this._onChange(l):(a.setValue(e),this._onChange(e)),this._stop()}else s&&this._onChange(l)}set(e){return Cs.batchedUpdates((()=>{this._stop(),this._focus(e),this._set(e)})),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(cr(this)){let{to:e,config:t}=this.animation;Cs.batchedUpdates((()=>{this._onStart(),t.decay||this._set(e,!1),this._stop()}))}return this}update(e){return(this.queue||(this.queue=[])).push(e),this}start(e,t){let s;return Zs.und(e)?(s=this.queue||[],this.queue=[]):s=[Zs.obj(e)?e:{...t,to:e}],Promise.all(s.map((e=>this._update(e)))).then((e=>Xi(this,e)))}stop(e){let{to:t}=this.animation;return this._focus(this.get()),tr(this._state,e&&this._lastCallId),Cs.batchedUpdates((()=>this._stop(t,e))),this}reset(){this._update({reset:!0})}eventObserved(e){"change"==e.type?this._start():"priority"==e.type&&(this.priority=e.priority+1)}_prepareNode(e){let t=this.key||"",{to:s,from:n}=e;s=Zs.obj(s)?s[t]:s,(null==s||Gi(s))&&(s=void 0),n=Zs.obj(n)?n[t]:n,null==n&&(n=void 0);let i={to:s,from:n};return lr(this)||(e.reverse&&([s,n]=[n,s]),n=qn(n),Zs.und(n)?xi(this)||this._set(s):this._set(n)),i}_update({...e},t){let{key:s,defaultProps:n}=this;e.default&&Object.assign(n,Bi(e,((e,t)=>/^on/.test(t)?Vi(e,s):e))),yr(this,e,"onProps"),br(this,"onProps",e,this);let i=this._prepareNode(e);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");let r=this._state;return Yi(++this._lastCallId,{key:s,props:e,defaultProps:n,state:r,actions:{pause:()=>{ur(this)||(pr(this,!0),tn(r.pauseQueue),br(this,"onPause",Qi(this,fr(this,this.animation.to)),this))},resume:()=>{ur(this)&&(pr(this,!1),cr(this)&&this._resume(),tn(r.resumeQueue),br(this,"onResume",Qi(this,fr(this,this.animation.to)),this))},start:this._merge.bind(this,i)}}).then((s=>{if(e.loop&&s.finished&&(!t||!s.noop)){let t=mr(e);if(t)return this._update(t,!0)}return s}))}_merge(e,t,s){if(t.cancel)return this.stop(!0),s($i(this));let n=!Zs.und(e.to),i=!Zs.und(e.from);if(n||i){if(!(t.callId>this._lastToId))return s($i(this));this._lastToId=t.callId}let{key:r,defaultProps:o,animation:a}=this,{to:l,from:c}=a,{to:u=l,from:d=c}=e;i&&!n&&(!t.default||Zs.und(u))&&(u=d),t.reverse&&([u,d]=[d,u]);let p=!Ks(d,c);p&&(a.from=d),d=qn(d);let h=!Ks(u,l);h&&this._focus(u);let f=Gi(t.to),{config:m}=a,{decay:g,velocity:v}=m;(n||i)&&(m.velocity=0),t.config&&!f&&function(e,t,s){s&&(qi(s={...s},t),t={...s,...t}),qi(e,t),Object.assign(e,t);for(let t in Ui)null==e[t]&&(e[t]=Ui[t]);let{mass:n,frequency:i,damping:r}=e;Zs.und(i)||(i<.01&&(i=.01),r<0&&(r=0),e.tension=Math.pow(2*Math.PI/i,2)*n,e.friction=4*Math.PI*r*n/i)}(m,Mi(t.config,r),t.config!==o.config?Mi(o.config,r):void 0);let x=xi(this);if(!x||Zs.und(u))return s(Qi(this,!0));let y=Zs.und(t.reset)?i&&!t.default:!Zs.und(d)&&Ni(t.reset,r),b=y?d:this.get(),w=Hi(u),_=Zs.num(w)||Zs.arr(w)||hi(w),S=!f&&(!_||Ni(o.immediate||t.immediate,r));if(h){let e=Pi(u);if(e!==x.constructor){if(!S)throw Error(`Cannot animate between ${x.constructor.name} and ${e.name}, as the "to" prop suggests`);x=this._set(w)}}let j=x.constructor,C=Wn(u),k=!1;if(!C){let e=y||!lr(this)&&p;(h||e)&&(k=Ks(Hi(b),w),C=!k),(!Ks(a.immediate,S)&&!S||!Ks(m.decay,g)||!Ks(m.velocity,v))&&(C=!0)}if(k&&cr(this)&&(a.changed&&!y?C=!0:C||this._stop(l)),!f&&((C||Wn(l))&&(a.values=x.getPayload(),a.toValues=Wn(u)?null:j==Si?[1]:Js(w)),a.immediate!=S&&(a.immediate=S,!S&&!y&&this._set(l)),C)){let{onRest:e}=a;Ys(xr,(e=>yr(this,t,e)));let n=Qi(this,fr(this,l));tn(this._pendingCalls,n),this._pendingCalls.add(s),a.changed&&Cs.batchedUpdates((()=>{a.changed=!y,e?.(n,this),y?Mi(o.onRest,n):a.onStart?.(n,this)}))}y&&this._set(b),f?s(er(t.to,t,this._state,this)):C?this._start():cr(this)&&!h?this._pendingCalls.add(s):s(Ji(b))}_focus(e){let t=this.animation;e!==t.to&&(Zn(this)&&this._detach(),t.to=e,Zn(this)&&this._attach())}_attach(){let e=0,{to:t}=this.animation;Wn(t)&&(Jn(t,this),ir(t)&&(e=t.priority+1)),this.priority=e}_detach(){let{to:e}=this.animation;Wn(e)&&Qn(e,this)}_set(e,t=!0){let s=qn(e);if(!Zs.und(s)){let e=xi(this);if(!e||!Ks(s,e.getValue())){let n=Pi(s);e&&e.constructor==n?e.setValue(s):yi(this,n.create(s)),e&&Cs.batchedUpdates((()=>{this._onChange(s,t)}))}}return xi(this)}_onStart(){let e=this.animation;e.changed||(e.changed=!0,br(this,"onStart",Qi(this,fr(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),Mi(this.animation.onChange,e,this)),Mi(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){let e=this.animation;xi(this).reset(qn(e.to)),e.immediate||(e.fromValues=e.values.map((e=>e.lastPosition))),cr(this)||(dr(this,!0),ur(this)||this._resume())}_resume(){Ws.skipAnimation?this.finish():pn.start(this)}_stop(e,t){if(cr(this)){dr(this,!1);let s=this.animation;Ys(s.values,(e=>{e.done=!0})),s.toValues&&(s.onChange=s.onPause=s.onResume=void 0),Kn(this,{type:"idle",parent:this});let n=t?$i(this.get()):Qi(this.get(),fr(this,e??s.to));tn(this._pendingCalls,n),s.changed&&(s.changed=!1,br(this,"onRest",n,this))}}};function fr(e,t){let s=Hi(t);return Ks(Hi(e.get()),s)}function mr(e,t=e.loop,s=e.to){let n=Mi(t);if(n){let i=!0!==n&&Li(n),r=(i||e).reverse,o=!i||i.reset;return gr({...e,loop:t,default:!1,pause:void 0,to:!r||Gi(s)?s:void 0,from:o?e.from:void 0,reset:o,...i})}}function gr(e){let{to:t,from:s}=e=Li(e),n=new Set;return Zs.obj(t)&&vr(t,n),Zs.obj(s)&&vr(s,n),e.keys=n.size?Array.from(n):null,e}function vr(e,t){Xs(e,((e,s)=>null!=e&&t.add(s)))}var xr=["onStart","onRest","onChange","onPause","onResume"];function yr(e,t,s){e.animation[s]=t[s]!==Fi(t,s)?Vi(t[s],e.key):void 0}function br(e,t,...s){e.animation[t]?.(...s),e.defaultProps[t]?.(...s)}var wr=["onStart","onChange","onRest"],_r=1,Sr=class{id=_r++;springs={};queue=[];ref;_flush;_initialProps;_lastAsyncId=0;_active=new Set;_changed=new Set;_started=!1;_item;_state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set};_events={onStart:new Map,onChange:new Map,onRest:new Map};constructor(e,t){this._onFrame=this._onFrame.bind(this),t&&(this._flush=t),e&&this.start({default:!0,...e})}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every((e=>e.idle&&!e.isDelayed&&!e.isPaused))}get item(){return this._item}set item(e){this._item=e}get(){let e={};return this.each(((t,s)=>e[s]=t.get())),e}set(e){for(let t in e){let s=e[t];Zs.und(s)||this.springs[t].set(s)}}update(e){return e&&this.queue.push(gr(e)),this}start(e){let{queue:t}=this;return e?t=Js(e).map(gr):this.queue=[],this._flush?this._flush(this,t):(Pr(this,t),jr(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){let s=this.springs;Ys(Js(t),(t=>s[t].stop(!!e)))}else tr(this._state,this._lastAsyncId),this.each((t=>t.stop(!!e)));return this}pause(e){if(Zs.und(e))this.start({pause:!0});else{let t=this.springs;Ys(Js(e),(e=>t[e].pause()))}return this}resume(e){if(Zs.und(e))this.start({pause:!1});else{let t=this.springs;Ys(Js(e),(e=>t[e].resume()))}return this}each(e){Xs(this.springs,e)}_onFrame(){let{onStart:e,onChange:t,onRest:s}=this._events,n=this._active.size>0,i=this._changed.size>0;(n&&!this._started||i&&!this._started)&&(this._started=!0,Qs(e,(([e,t])=>{t.value=this.get(),e(t,this,this._item)})));let r=!n&&this._started,o=i||r&&s.size?this.get():null;i&&t.size&&Qs(t,(([e,t])=>{t.value=o,e(t,this,this._item)})),r&&(this._started=!1,Qs(s,(([e,t])=>{t.value=o,e(t,this,this._item)})))}eventObserved(e){if("change"==e.type)this._changed.add(e.parent),e.idle||this._active.add(e.parent);else{if("idle"!=e.type)return;this._active.delete(e.parent)}Cs.onFrame(this._onFrame)}};function jr(e,t){return Promise.all(t.map((t=>Cr(e,t)))).then((t=>Xi(e,t)))}async function Cr(e,t,s){let{keys:n,to:i,from:r,loop:o,onRest:a,onResolve:l}=t,c=Zs.obj(t.default)&&t.default;o&&(t.loop=!1),!1===i&&(t.to=null),!1===r&&(t.from=null);let u=Zs.arr(i)||Zs.fun(i)?i:void 0;u?(t.to=void 0,t.onRest=void 0,c&&(c.onRest=void 0)):Ys(wr,(s=>{let n=t[s];if(Zs.fun(n)){let i=e._events[s];t[s]=({finished:e,cancelled:t})=>{let s=i.get(n);s?(e||(s.finished=!1),t&&(s.cancelled=!0)):i.set(n,{value:null,finished:e||!1,cancelled:t||!1})},c&&(c[s]=t[s])}}));let d=e._state;t.pause===!d.paused?(d.paused=t.pause,tn(t.pause?d.pauseQueue:d.resumeQueue)):d.paused&&(t.pause=!0);let p=(n||Object.keys(e.springs)).map((s=>e.springs[s].start(t))),h=!0===t.cancel||!0===Fi(t,"cancel");(u||h&&d.asyncId)&&p.push(Yi(++e._lastAsyncId,{props:t,state:d,actions:{pause:qs,resume:qs,start(t,s){h?(tr(d,e._lastAsyncId),s($i(e))):(t.onRest=a,s(er(u,t,d,e)))}}})),d.paused&&await new Promise((e=>{d.resumeQueue.add(e)}));let f=Xi(e,await Promise.all(p));if(o&&f.finished&&(!s||!f.noop)){let s=mr(t,o,i);if(s)return Pr(e,[s]),Cr(e,s,!0)}return l&&Cs.batchedUpdates((()=>l(f,e,e.item))),f}function kr(e,t){let s=new hr;return s.key=e,t&&Jn(s,t),s}function Er(e,t,s){t.keys&&Ys(t.keys,(n=>{(e[n]||(e[n]=s(n)))._prepareNode(t)}))}function Pr(e,t){Ys(t,(t=>{Er(e.springs,t,(t=>kr(t,e)))}))}var Ir=({children:e,...t})=>{let s=(0,Hs.useContext)(Tr),n=t.pause||!!s.pause,i=t.immediate||!!s.immediate;t=function(e,t){let[s]=(0,Hs.useState)((()=>({inputs:t,result:e()}))),n=(0,Hs.useRef)(),i=n.current,r=i;return r?Boolean(t&&r.inputs&&function(e,t){if(e.length!==t.length)return!1;for(let s=0;s{n.current=r,i==s&&(s.inputs=s.result=void 0)}),[r]),r.result}((()=>({pause:n,immediate:i})),[n,i]);let{Provider:r}=Tr;return Hs.createElement(r,{value:t},e)},Tr=function(e,t){return Object.assign(e,Hs.createContext(t)),e.Provider._context=e,e.Consumer._context=e,e}(Ir,{});Ir.Provider=Tr.Provider,Ir.Consumer=Tr.Consumer;var Or=class extends or{constructor(e,t){super(),this.source=e,this.calc=Vn(...t);let s=this._get(),n=Pi(s);yi(this,n.create(s))}key;idle=!0;calc;_active=new Set;advance(e){let t=this._get();Ks(t,this.get())||(xi(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&Mr(this._active)&&Nr(this)}_get(){let e=Zs.arr(this.source)?this.source.map(qn):Js(qn(this.source));return this.calc(...e)}_start(){this.idle&&!Mr(this._active)&&(this.idle=!1,Ys(bi(this),(e=>{e.done=!1})),Ws.skipAnimation?(Cs.batchedUpdates((()=>this.advance())),Nr(this)):pn.start(this))}_attach(){let e=1;Ys(Js(this.source),(t=>{Wn(t)&&Jn(t,this),ir(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))})),this.priority=e,this._start()}_detach(){Ys(Js(this.source),(e=>{Wn(e)&&Qn(e,this)})),this._active.clear(),Nr(this)}eventObserved(e){"change"==e.type?e.idle?this.advance():(this._active.add(e.parent),this._start()):"idle"==e.type?this._active.delete(e.parent):"priority"==e.type&&(this.priority=Js(this.source).reduce(((e,t)=>Math.max(e,(ir(t)?t.priority:0)+1)),0))}};function Ar(e){return!1!==e.idle}function Mr(e){return!e.size||Array.from(e).every(Ar)}function Nr(e){e.idle||(e.idle=!0,Ys(bi(e),(e=>{e.done=!0})),Kn(e,{type:"idle",parent:e}))}Ws.assign({createStringInterpolator:ci,to:(e,t)=>new Or(e,t)});pn.advance;const Vr=window.ReactDOM;var Fr=/^--/;function Rr(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||Fr.test(e)||Dr.hasOwnProperty(e)&&Dr[e]?(""+t).trim():t+"px"}var Br={};var Dr={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},zr=["Webkit","Ms","Moz","O"];Dr=Object.keys(Dr).reduce(((e,t)=>(zr.forEach((s=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(s,t)]=e[t])),e)),Dr);var Lr=/^(matrix|translate|scale|rotate|skew)/,Hr=/^(translate)/,Gr=/^(rotate|skew)/,Ur=(e,t)=>Zs.num(e)&&0!==e?e+t:e,Wr=(e,t)=>Zs.arr(e)?e.every((e=>Wr(e,t))):Zs.num(e)?e===t:parseFloat(e)===t,qr=class extends Ci{constructor({x:e,y:t,z:s,...n}){let i=[],r=[];(e||t||s)&&(i.push([e||0,t||0,s||0]),r.push((e=>[`translate3d(${e.map((e=>Ur(e,"px"))).join(",")})`,Wr(e,0)]))),Xs(n,((e,t)=>{if("transform"===t)i.push([e||""]),r.push((e=>[e,""===e]));else if(Lr.test(t)){if(delete n[t],Zs.und(e))return;let s=Hr.test(t)?"px":Gr.test(t)?"deg":"";i.push(Js(e)),r.push("rotate3d"===t?([e,t,n,i])=>[`rotate3d(${e},${t},${n},${Ur(i,s)})`,Wr(i,0)]:e=>[`${t}(${e.map((e=>Ur(e,s))).join(",")})`,Wr(e,t.startsWith("scale")?1:0)])}})),i.length&&(n.transform=new Zr(i,r)),super(n)}},Zr=class extends Yn{constructor(e,t){super(),this.inputs=e,this.transforms=t}_value=null;get(){return this._value||(this._value=this._get())}_get(){let e="",t=!0;return Ys(this.inputs,((s,n)=>{let i=qn(s[0]),[r,o]=this.transforms[n](Zs.arr(i)?i:s.map(qn));e+=" "+r,t=t&&o})),t?"none":e}observerAdded(e){1==e&&Ys(this.inputs,(e=>Ys(e,(e=>Wn(e)&&Jn(e,this)))))}observerRemoved(e){0==e&&Ys(this.inputs,(e=>Ys(e,(e=>Wn(e)&&Qn(e,this)))))}eventObserved(e){"change"==e.type&&(this._value=null),Kn(this,e)}};Ws.assign({batchedUpdates:Vr.unstable_batchedUpdates,createStringInterpolator:ci,colors:{transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199}});var Kr=((e,{applyAnimatedValues:t=()=>!1,createAnimatedStyle:s=e=>new Ci(e),getComponentProps:n=e=>e}={})=>{let i={applyAnimatedValues:t,createAnimatedStyle:s,getComponentProps:n},r=e=>{let t=Ai(e)||"Anonymous";return(e=Zs.str(e)?r[e]||(r[e]=Ii(e,i)):e[Oi]||(e[Oi]=Ii(e,i))).displayName=`Animated(${t})`,e};return Xs(e,((t,s)=>{Zs.arr(e)&&(s=Ai(t)),r[s]=r(t)})),{animated:r}})(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],{applyAnimatedValues:function(e,t){if(!e.nodeType||!e.setAttribute)return!1;let s="filter"===e.nodeName||e.parentNode&&"filter"===e.parentNode.nodeName,{style:n,children:i,scrollTop:r,scrollLeft:o,viewBox:a,...l}=t,c=Object.values(l),u=Object.keys(l).map((t=>s||e.hasAttribute(t)?t:Br[t]||(Br[t]=t.replace(/([A-Z])/g,(e=>"-"+e.toLowerCase())))));void 0!==i&&(e.textContent=i);for(let t in n)if(n.hasOwnProperty(t)){let s=Rr(t,n[t]);Fr.test(t)?e.style.setProperty(t,s):e.style[t]=s}u.forEach(((t,s)=>{e.setAttribute(t,c[s])})),void 0!==r&&(e.scrollTop=r),void 0!==o&&(e.scrollLeft=o),void 0!==a&&e.setAttribute("viewBox",a)},createAnimatedStyle:e=>new qr(e),getComponentProps:({scrollTop:e,scrollLeft:t,...s})=>s});Kr.animated;const Yr=function({triggerAnimationOnChange:e}){const t=(0,d.useRef)(),{previous:s,prevRect:n}=(0,d.useMemo)((()=>{return{previous:t.current&&(e=t.current,{top:e.offsetTop,left:e.offsetLeft}),prevRect:t.current&&t.current.getBoundingClientRect()};var e}),[e]);return(0,d.useLayoutEffect)((()=>{if(!s||!t.current)return;if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return;const e=new Sr({x:0,y:0,width:n.width,height:n.height,config:{duration:400,easing:Hn.easeInOutQuint},onChange({value:e}){if(!t.current)return;let{x:s,y:n,width:i,height:r}=e;s=Math.round(s),n=Math.round(n),i=Math.round(i),r=Math.round(r);const o=0===s&&0===n;t.current.style.transformOrigin="center center",t.current.style.transform=o?null:`translate3d(${s}px,${n}px,0)`,t.current.style.width=o?null:`${i}px`,t.current.style.height=o?null:`${r}px`}});t.current.style.transform=void 0;const i=t.current.getBoundingClientRect(),r=Math.round(n.left-i.left),o=Math.round(n.top-i.top),a=i.width,l=i.height;return e.start({x:0,y:0,width:a,height:l,from:{x:r,y:o,width:n.width,height:n.height}}),()=>{e.stop(),e.set({x:0,y:0,width:n.width,height:n.height})}}),[s,n]),t},Xr=(0,oe.jsx)(Jt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Jt.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})});function Jr(){return void 0!==(0,es.getQueryArg)(window.location.href,"wp_theme_preview")}function Qr(){return Jr()?(0,es.getQueryArg)(window.location.href,"wp_theme_preview"):null}const{useLocation:$r}=te(Ht.privateApis);function eo({className:e="edit-site-save-button__button",variant:t="primary",showTooltip:s=!0,showReviewMessage:n,icon:i,size:r,__next40pxDefaultSize:o=!1}){const{params:a}=$r(),{setIsSaveViewOpened:c}=(0,l.useDispatch)(zt),{saveDirtyEntities:u}=te((0,l.useDispatch)(h.store)),{dirtyEntityRecords:d}=(0,h.useEntitiesSavedStatesIsDirty)(),{isSaving:p,isSaveViewOpen:f,previewingThemeName:m}=(0,l.useSelect)((e=>{const{isSavingEntityRecord:t,isResolving:s}=e(_.store),{isSaveViewOpened:n}=e(zt),i=s("activateTheme"),r=Qr();return{isSaving:d.some((e=>t(e.kind,e.name,e.key)))||i,isSaveViewOpen:n(),previewingThemeName:r?e(_.store).getTheme(r)?.name?.rendered:void 0}}),[d]),g=!!d.length;let v;1===d.length&&(a.postId?v=`${d[0].key}`===a.postId&&d[0].name===a.postType:a.path?.includes("wp_global_styles")&&(v="globalStyles"===d[0].name));const x=p||!g&&!Jr(),w=Jr()?p?(0,b.sprintf)((0,b.__)("Activating %s"),m):x?(0,b.__)("Saved"):g?(0,b.sprintf)((0,b.__)("Activate %s & Save"),m):(0,b.sprintf)((0,b.__)("Activate %s"),m):p?(0,b.__)("Saving"):x?(0,b.__)("Saved"):!v&&n?(0,b.sprintf)((0,b._n)("Review %d change…","Review %d changes…",d.length),d.length):(0,b.__)("Save"),S=v?()=>u({dirtyEntityRecords:d}):()=>c(!0);return(0,oe.jsx)(y.Button,{variant:t,className:e,"aria-disabled":x,"aria-expanded":f,isBusy:p,onClick:x?void 0:S,label:w,shortcut:x?void 0:$t.displayShortcut.primary("s"),showTooltip:s,icon:i,__next40pxDefaultSize:o,size:r,children:w})}function to(){const{isDisabled:e,isSaving:t}=(0,l.useSelect)((e=>{const{__experimentalGetDirtyEntityRecords:t,isSavingEntityRecord:s}=e(_.store),n=t(),i=n.some((e=>s(e.kind,e.name,e.key)));return{isSaving:i,isDisabled:i||!n.length&&!Jr()}}),[]);return(0,oe.jsx)(y.__experimentalHStack,{className:"edit-site-save-hub",alignment:"right",spacing:4,children:(0,oe.jsx)(eo,{className:"edit-site-save-hub__button",variant:e?null:"primary",showTooltip:!1,icon:e&&!t?Xr:null,showReviewMessage:!0,__next40pxDefaultSize:!0})})}const{useHistory:so}=te(Ht.privateApis);const no=window.wp.apiFetch;var io=i.n(no);const{EntitiesSavedStatesExtensible:ro,NavigableRegion:oo}=te(h.privateApis),ao=({onClose:e})=>{var t,s;const n=(0,h.useEntitiesSavedStatesIsDirty)();let i;i=n.isDirty?(0,b.__)("Activate & Save"):(0,b.__)("Activate");const r=function(){const[e,t]=(0,d.useState)();return(0,d.useEffect)((()=>{const e=(0,es.addQueryArgs)("/wp/v2/themes?status=active",{context:"edit",wp_theme_preview:""});io()({path:e}).then((e=>t(e[0]))).catch((()=>{}))}),[]),e}(),o=(0,l.useSelect)((e=>e(_.store).getCurrentTheme()),[]),a=(0,oe.jsx)("p",{children:(0,b.sprintf)((0,b.__)("Saving your changes will change your active theme from %1$s to %2$s."),null!==(t=r?.name?.rendered)&&void 0!==t?t:"...",null!==(s=o?.name?.rendered)&&void 0!==s?s:"...")}),c=function(){const e=so(),{startResolution:t,finishResolution:s}=(0,l.useDispatch)(_.store);return async()=>{if(Jr()){const n="themes.php?action=activate&stylesheet="+Qr()+"&_wpnonce="+window.WP_BLOCK_THEME_ACTIVATE_NONCE;t("activateTheme"),await window.fetch(n),s("activateTheme");const{params:i}=e.getLocationWithParams();e.replace({...i,wp_theme_preview:void 0})}}}();return(0,oe.jsx)(ro,{...n,additionalPrompt:a,close:e,onSave:async e=>(await c(),e),saveEnabled:!0,saveLabel:i})},lo=({onClose:e,renderDialog:t})=>Jr()?(0,oe.jsx)(ao,{onClose:e}):(0,oe.jsx)(h.EntitiesSavedStates,{close:e,renderDialog:t});function co(){const{isSaveViewOpen:e,canvasMode:t,isDirty:s,isSaving:n}=(0,l.useSelect)((e=>{const{__experimentalGetDirtyEntityRecords:t,isSavingEntityRecord:s,isResolving:n}=e(_.store),i=t(),r=n("activateTheme"),{isSaveViewOpened:o,getCanvasMode:a}=te(e(zt));return{isSaveViewOpen:o(),canvasMode:a(),isDirty:i.length>0,isSaving:i.some((e=>s(e.kind,e.name,e.key)))||r}}),[]),{setIsSaveViewOpened:i}=(0,l.useDispatch)(zt),r=()=>i(!1);if("view"===t)return e?(0,oe.jsx)(y.Modal,{className:"edit-site-save-panel__modal",onRequestClose:r,__experimentalHideHeader:!0,contentLabel:(0,b.__)("Save site, content, and template changes"),children:(0,oe.jsx)(lo,{onClose:r})}):null;const o=Jr()||s,a=n||!o;return(0,oe.jsxs)(oo,{className:Ut("edit-site-layout__actions",{"is-entity-save-view-open":e}),ariaLabel:(0,b.__)("Save panel"),children:[(0,oe.jsx)("div",{className:Ut("edit-site-editor__toggle-save-panel",{"screen-reader-text":e}),children:(0,oe.jsx)(y.Button,{__next40pxDefaultSize:!0,variant:"secondary",className:"edit-site-editor__toggle-save-panel-button",onClick:()=>i(!0),"aria-haspopup":"dialog",disabled:a,accessibleWhenDisabled:!0,children:(0,b.__)("Open save panel")})}),e&&(0,oe.jsx)(lo,{onClose:r,renderDialog:!0})]})}const{useLocation:uo,useHistory:po}=te(Ht.privateApis);const{useCommands:ho}=te(qt.privateApis),{useGlobalStyle:fo}=te(x.privateApis),{NavigableRegion:mo}=te(h.privateApis),go=.3;function vo({route:e}){!function(){const e=po(),{params:t}=uo(),s=(0,l.useSelect)((e=>te(e(zt)).getCanvasMode()),[]),{setCanvasMode:n}=te((0,l.useDispatch)(zt)),i=(0,d.useRef)(s),{canvas:r}=t,o=(0,d.useRef)(r),a=(0,d.useRef)(t);(0,d.useEffect)((()=>{a.current=t}),[t]),(0,d.useEffect)((()=>{i.current=s,"init"!==s&&("edit"===s&&o.current!==s&&e.push({...a.current,canvas:"edit"}),"view"===s&&void 0!==o.current&&e.push({...a.current,canvas:void 0}))}),[s,e]),(0,d.useEffect)((()=>{o.current=r,"edit"!==r&&"view"!==i.current?n("view"):"edit"===r&&"edit"!==i.current&&n("edit")}),[r,n])}(),ho();const t=(0,v.useViewportMatch)("medium","<"),s=(0,d.useRef)(),{canvasMode:n}=(0,l.useSelect)((e=>{const{getCanvasMode:t}=te(e(zt));return{canvasMode:t()}}),[]),i=(0,y.__unstableUseNavigateRegions)(),r=(0,v.useReducedMotion)(),[o,a]=(0,v.useResizeObserver)(),c=Ss(),[u,p]=(0,d.useState)(!1),{key:f,areas:m,widths:g}=e,x=Yr({triggerAnimationOnChange:n+"__"+f}),[w]=fo("color.background"),[_]=fo("color.gradient"),S=(0,v.usePrevious)(n);return(0,d.useEffect)((()=>{"edit"===S&&s.current?.focus()}),[n]),"init"===n?null:(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(Wt.CommandMenu,{}),(0,oe.jsx)(ys,{}),(0,oe.jsx)(bs,{}),(0,oe.jsx)("div",{...i,ref:i.ref,className:Ut("edit-site-layout",i.className,{"is-full-canvas":"edit"===n}),children:(0,oe.jsxs)("div",{className:"edit-site-layout__content",children:[(!t||!m.mobile)&&(0,oe.jsx)(mo,{ariaLabel:(0,b.__)("Navigation"),className:"edit-site-layout__sidebar-region",children:(0,oe.jsx)(y.__unstableAnimatePresence,{children:"view"===n&&(0,oe.jsxs)(y.__unstableMotion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{type:"tween",duration:r||t?0:go,ease:"easeOut"},className:"edit-site-layout__sidebar",children:[(0,oe.jsx)(us,{ref:s,isTransparent:u}),(0,oe.jsx)(as,{routeKey:f,children:m.sidebar}),(0,oe.jsx)(to,{}),(0,oe.jsx)(co,{})]})})}),(0,oe.jsx)(h.EditorSnackbars,{}),t&&m.mobile&&(0,oe.jsxs)("div",{className:"edit-site-layout__mobile",children:["edit"!==n&&(0,oe.jsx)(as,{routeKey:f,children:(0,oe.jsx)(ds,{ref:s,isTransparent:u})}),m.mobile]}),!t&&m.content&&"edit"!==n&&(0,oe.jsx)("div",{className:"edit-site-layout__area",style:{maxWidth:g?.content},children:m.content}),!t&&m.edit&&(0,oe.jsx)("div",{className:"edit-site-layout__area",style:{maxWidth:g?.edit},children:m.edit}),!t&&m.preview&&(0,oe.jsxs)("div",{className:"edit-site-layout__canvas-container",children:[o,!!a.width&&(0,oe.jsx)("div",{className:Ut("edit-site-layout__canvas",{"is-right-aligned":u}),ref:x,children:(0,oe.jsx)(Yt,{children:(0,oe.jsx)(vs,{isReady:!c,isFullWidth:"edit"===n,defaultSize:{width:a.width-24,height:a.height},isOversized:u,setIsOversized:p,innerContentStyle:{background:null!=_?_:w},children:m.preview})})})]})]})})]})}const xo=(0,oe.jsx)(Jt.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,oe.jsx)(Jt.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M20 12a8 8 0 1 1-16 0 8 8 0 0 1 16 0Zm-1.5 0a6.5 6.5 0 0 1-6.5 6.5v-13a6.5 6.5 0 0 1 6.5 6.5Z"})}),yo=(0,oe.jsx)(Jt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Jt.Path,{d:"M12 4.75a7.25 7.25 0 100 14.5 7.25 7.25 0 000-14.5zM3.25 12a8.75 8.75 0 1117.5 0 8.75 8.75 0 01-17.5 0zM12 8.75a1.5 1.5 0 01.167 2.99c-.465.052-.917.44-.917 1.01V14h1.5v-.845A3 3 0 109 10.25h1.5a1.5 1.5 0 011.5-1.5zM11.25 15v1.5h1.5V15h-1.5z"})}),bo=(0,oe.jsx)(Jt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Jt.Path,{d:"M15.1 4.8l-3-2.5V4c-4.4 0-8 3.6-8 8 0 3.7 2.5 6.9 6 7.7.3.1.6.1 1 .2l.2-1.5c-.4 0-.7-.1-1.1-.2l-.1.2v-.2c-2.6-.8-4.5-3.3-4.5-6.2 0-3.6 2.9-6.5 6.5-6.5v1.8l3-2.5zM20 11c-.2-1.4-.7-2.7-1.6-3.8l-1.2.8c.7.9 1.1 2 1.3 3.1L20 11zm-1.5 1.8c-.1.5-.2 1.1-.4 1.6s-.5 1-.8 1.5l1.2.9c.4-.5.8-1.1 1-1.8s.5-1.3.5-2l-1.5-.2zm-5.6 5.6l.2 1.5c1.4-.2 2.7-.7 3.8-1.6l-.9-1.1c-.9.7-2 1.1-3.1 1.2z"})}),wo=(0,oe.jsx)(Jt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Jt.Path,{d:"M12 4V2.2L9 4.8l3 2.5V5.5c3.6 0 6.5 2.9 6.5 6.5 0 2.9-1.9 5.3-4.5 6.2v.2l-.1-.2c-.4.1-.7.2-1.1.2l.2 1.5c.3 0 .6-.1 1-.2 3.5-.9 6-4 6-7.7 0-4.4-3.6-8-8-8zm-7.9 7l1.5.2c.1-1.2.5-2.3 1.2-3.2l-1.1-.9C4.8 8.2 4.3 9.6 4.1 11zm1.5 1.8l-1.5.2c.1.7.3 1.4.5 2 .3.7.6 1.3 1 1.8l1.2-.8c-.3-.5-.6-1-.8-1.5s-.4-1.1-.4-1.7zm1.5 5.5c1.1.9 2.4 1.4 3.8 1.6l.2-1.5c-1.1-.1-2.2-.5-3.1-1.2l-.9 1.1z"})}),_o=(0,oe.jsx)(Jt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Jt.Path,{d:"M4 20h8v-1.5H4V20zM18.9 3.5c-.6-.6-1.5-.6-2.1 0l-7.2 7.2c-.4-.1-.7 0-1.1.1-.5.2-1.5.7-1.9 2.2-.4 1.7-.8 2.2-1.1 2.7-.1.1-.2.3-.3.4l-.6 1.1H6c2 0 3.4-.4 4.7-1.4.8-.6 1.2-1.4 1.3-2.3 0-.3 0-.5-.1-.7L19 5.7c.5-.6.5-1.6-.1-2.2zM9.7 14.7c-.7.5-1.5.8-2.4 1 .2-.5.5-1.2.8-2.3.2-.6.4-1 .8-1.1.5-.1 1 .1 1.3.3.2.2.3.5.2.8 0 .3-.1.9-.7 1.3z"})}),So=(0,oe.jsx)(Jt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Jt.Path,{d:"M5.5 12h1.75l-2.5 3-2.5-3H4a8 8 0 113.134 6.35l.907-1.194A6.5 6.5 0 105.5 12zm9.53 1.97l-2.28-2.28V8.5a.75.75 0 00-1.5 0V12a.747.747 0 00.218.529l1.282-.84-1.28.842 2.5 2.5a.75.75 0 101.06-1.061z"})}),jo=(0,oe.jsx)(Jt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Jt.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"})}),{useGlobalStylesReset:Co}=te(x.privateApis),{useHistory:ko,useLocation:Eo}=te(Ht.privateApis);function Po(){const{openGeneralSidebar:e,setCanvasMode:t}=te((0,l.useDispatch)(zt)),{params:s}=Eo(),{getCanvasMode:n}=te((0,l.useSelect)(zt)),i=ko(),r=(0,l.useSelect)((e=>e(_.store).getCurrentTheme().is_block_theme),[]);return{isLoading:!1,commands:(0,d.useMemo)((()=>r?[{name:"core/edit-site/open-styles",label:(0,b.__)("Open styles"),callback:({close:r})=>{r(),s.postId||i.push({path:"/wp_global_styles",canvas:"edit"}),s.postId&&"edit"!==n()&&t("edit"),e("edit-site/global-styles")},icon:xo}]:[]),[i,e,t,n,r,s.postId])}}function Io(){const{openGeneralSidebar:e,setCanvasMode:t}=te((0,l.useDispatch)(zt)),{params:s}=Eo(),{getCanvasMode:n}=te((0,l.useSelect)(zt)),{set:i}=(0,l.useDispatch)(f.store),r=ko(),o=(0,l.useSelect)((e=>e(_.store).getCurrentTheme().is_block_theme),[]);return{isLoading:!1,commands:(0,d.useMemo)((()=>o?[{name:"core/edit-site/toggle-styles-welcome-guide",label:(0,b.__)("Learn about styles"),callback:({close:o})=>{o(),s.postId||r.push({path:"/wp_global_styles",canvas:"edit"}),s.postId&&"edit"!==n()&&t("edit"),e("edit-site/global-styles"),i("core/edit-site","welcomeGuideStyles",!0),setTimeout((()=>{i("core/edit-site","welcomeGuideStyles",!0)}),500)},icon:yo}]:[]),[r,e,t,n,o,i,s.postId])}}function To(){const[e,t]=Co();return{isLoading:!1,commands:(0,d.useMemo)((()=>e?[{name:"core/edit-site/reset-global-styles",label:(0,b.__)("Reset styles"),icon:(0,b.isRTL)()?bo:wo,callback:({close:e})=>{e(),t()}}]:[]),[e,t])}}function Oo(){const{openGeneralSidebar:e,setEditorCanvasContainerView:t,setCanvasMode:s}=te((0,l.useDispatch)(zt)),{params:n}=Eo(),i=ko(),{canEditCSS:r}=(0,l.useSelect)((e=>{const{getEntityRecord:t,__experimentalGetCurrentGlobalStylesId:s}=e(_.store),n=s(),i=n?t("root","globalStyles",n):void 0;return{canEditCSS:!!i?._links?.["wp:action-edit-css"]}}),[]),{getCanvasMode:o}=te((0,l.useSelect)(zt));return{isLoading:!1,commands:(0,d.useMemo)((()=>r?[{name:"core/edit-site/open-styles-css",label:(0,b.__)("Customize CSS"),icon:_o,callback:({close:r})=>{r(),n.postId||i.push({path:"/wp_global_styles",canvas:"edit"}),n.postId&&"edit"!==o()&&s("edit"),e("edit-site/global-styles"),t("global-styles-css")}}]:[]),[i,e,t,r,o,s,n.postId])}}function Ao(){const{openGeneralSidebar:e,setEditorCanvasContainerView:t,setCanvasMode:s}=te((0,l.useDispatch)(zt)),{getCanvasMode:n}=te((0,l.useSelect)(zt)),{params:i}=Eo(),r=ko(),o=(0,l.useSelect)((e=>{const{getEntityRecord:t,__experimentalGetCurrentGlobalStylesId:s}=e(_.store),n=s(),i=n?t("root","globalStyles",n):void 0;return!!i?._links?.["version-history"]?.[0]?.count}),[]);return{isLoading:!1,commands:(0,d.useMemo)((()=>o?[{name:"core/edit-site/open-global-styles-revisions",label:(0,b.__)("Style revisions"),icon:So,callback:({close:o})=>{o(),i.postId||r.push({path:"/wp_global_styles",canvas:"edit"}),i.postId&&"edit"!==n()&&s("edit"),e("edit-site/global-styles"),t("global-styles-revisions")}}]:[]),[o,r,e,t,n,s,i.postId])}}const Mo=(0,oe.jsx)(Jt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Jt.Path,{d:"M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"})}),No=(0,oe.jsxs)(Jt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,oe.jsx)(Jt.Path,{d:"M15.5 7.5h-7V9h7V7.5Zm-7 3.5h7v1.5h-7V11Zm7 3.5h-7V16h7v-1.5Z"}),(0,oe.jsx)(Jt.Path,{d:"M17 4H7a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2ZM7 5.5h10a.5.5 0 0 1 .5.5v12a.5.5 0 0 1-.5.5H7a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .5-.5Z"})]}),Vo=(0,oe.jsx)(Jt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Jt.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 5.5A2.25 2.25 0 0 0 9.878 7h4.244A2.251 2.251 0 0 0 12 5.5ZM12 4a3.751 3.751 0 0 0-3.675 3H5v1.5h1.27l.818 8.997a2.75 2.75 0 0 0 2.739 2.501h4.347a2.75 2.75 0 0 0 2.738-2.5L17.73 8.5H19V7h-3.325A3.751 3.751 0 0 0 12 4Zm4.224 4.5H7.776l.806 8.861a1.25 1.25 0 0 0 1.245 1.137h4.347a1.25 1.25 0 0 0 1.245-1.137l.805-8.861Z"})});const{useHistory:Fo}=te(Ht.privateApis);function Ro(e,t,s=!1){const n=Fo();const i=(0,es.getQueryArgs)(window.location.href),r=(0,es.removeQueryArgs)(window.location.href,...Object.keys(i));Jr()&&(e={...e,wp_theme_preview:Qr()});return{href:(0,es.addQueryArgs)(r,e),onClick:function(i){i?.preventDefault(),s?n.replace(e,t):n.push(e,t)}}}function Bo({params:e={},state:t,replace:s=!1,children:n,...i}){const{href:r,onClick:o}=Ro(e,t,s);return(0,oe.jsx)("a",{href:r,onClick:o,...i,children:n})}const{useHistory:Do}=te(Ht.privateApis);function zo(){const{record:e}=ws(),{isPage:t,canvasMode:s,templateId:n,currentPostType:i}=(0,l.useSelect)((e=>{const{isPage:t,getCanvasMode:s}=te(e(zt)),{getCurrentPostType:n,getCurrentTemplateId:i}=e(h.store);return{isPage:t(),canvasMode:s(),templateId:i(),currentPostType:n()}}),[]),{onClick:r}=Ro({postType:"wp_template",postId:n}),{setRenderingMode:o}=(0,l.useDispatch)(h.store);if(!t||"edit"!==s)return{isLoading:!1,commands:[]};const a=[];return"wp_template"!==i?a.push({name:"core/switch-to-template-focus",label:(0,b.sprintf)((0,b.__)("Edit template: %s"),(0,Xt.decodeEntities)(e.title)),icon:Mo,callback:({close:e})=>{r(),e()}}):a.push({name:"core/switch-to-page-focus",label:(0,b.__)("Back to page"),icon:No,callback:({close:e})=>{o("template-locked"),e()}}),{isLoading:!1,commands:a}}function Lo(){const{isLoaded:e,record:t}=ws(),{removeTemplate:s,revertTemplate:n}=(0,l.useDispatch)(zt),i=Do(),r=(0,l.useSelect)((e=>e(zt).isPage()&&"wp_template"!==e(h.store).getCurrentPostType()),[]);if(!e)return{isLoading:!0,commands:[]};const o=[];if(function(e){return!!e&&e?.source===ke.custom&&(Boolean(e?.plugin)||e?.has_theme_file)}(t)&&!r){const e=t.type===je?(0,b.sprintf)((0,b.__)("Reset template: %s"),(0,Xt.decodeEntities)(t.title)):(0,b.sprintf)((0,b.__)("Reset template part: %s"),(0,Xt.decodeEntities)(t.title));o.push({name:"core/reset-template",label:e,icon:(0,b.isRTL)()?bo:wo,callback:({close:e})=>{n(t),e()}})}if(function(e){return!!e&&e.source===ke.custom&&!Boolean(e.plugin)&&!e.has_theme_file}(t)&&!r){const e=t.type===je?(0,b.sprintf)((0,b.__)("Delete template: %s"),(0,Xt.decodeEntities)(t.title)):(0,b.sprintf)((0,b.__)("Delete template part: %s"),(0,Xt.decodeEntities)(t.title));o.push({name:"core/remove-template",label:e,icon:Vo,callback:({close:e})=>{s(t),i.push({postType:t.type}),e()}})}return{isLoading:!e,commands:o}}const{useLocation:Ho}=te(Ht.privateApis),Go=[je,Ce,Se,Ie.user],Uo=["page","post"];function Wo(){const{params:e={}}=Ho(),{postType:t,postId:s,context:n,isReady:i}=function({postId:e,postType:t}){const{hasLoadedAllDependencies:s,homepageId:n,postsPageId:i,url:r,frontPageTemplateId:o}=(0,l.useSelect)((e=>{const{getEntityRecord:t,getEntityRecords:s}=e(_.store),n=t("root","site"),i=t("root","__unstableBase"),r=s("postType",je,{per_page:-1}),o="page"===n?.show_on_front&&["number","string"].includes(typeof n.page_on_front)&&+n.page_on_front?n.page_on_front.toString():null,a="page"===n?.show_on_front&&["number","string"].includes(typeof n.page_for_posts)?n.page_for_posts.toString():null;let l;if(r){const e=r.find((e=>"front-page"===e.slug));l=!!e&&e.id}return{hasLoadedAllDependencies:!!i&&!!n,homepageId:o,postsPageId:a,url:i?.home,frontPageTemplateId:l}}),[]),a=(0,l.useSelect)((a=>{if(Go.includes(t)&&e)return;if(e&&e.includes(","))return;const{getEditedEntityRecord:l,getEntityRecords:c,getDefaultTemplateId:u,__experimentalGetTemplateForLink:d}=a(_.store);function p(e,t){if("page"===e&&n===t){if(void 0===o)return;if(o)return o}const s=l("postType",e,t);if(!s)return;if("page"===e&&i===t)return d(s.link)?.id;const r=s.template;if(r){const e=c("postType",je,{per_page:-1})?.find((({slug:e})=>e===r));if(e)return e.id}let a;return a=s.slug?"page"===e?`${e}-${s.slug}`:`single-${e}-${s.slug}`:"page"===e?"page":`single-${e}`,u({slug:a})}if(s){if(t&&e&&Uo.includes(t))return p(t,e);if(n)return p("page",n);if(r){const e=d(r);return e?.id}}}),[n,i,s,r,e,t,o]),c=(0,d.useMemo)((()=>Go.includes(t)&&e?{}:t&&e&&Uo.includes(t)?{postType:t,postId:e}:n?{postType:"page",postId:n}:{}),[n,t,e]);return Go.includes(t)&&e?{isReady:!0,postType:t,postId:e,context:c}:s?{isReady:void 0!==a,postType:je,postId:a,context:c}:{isReady:!1}}(e),{setEditedEntity:r}=(0,l.useDispatch)(zt),{__unstableSetEditorMode:o,resetZoomLevel:a}=te((0,l.useDispatch)(x.store));(0,d.useEffect)((()=>{i&&(o("edit"),a(),r(t,s,n))}),[i,t,s,n,r])}const qo=(0,d.forwardRef)((function({icon:e,size:t=24,...s},n){return(0,d.cloneElement)(e,{width:t,height:t,...s,ref:n})})),Zo=(0,oe.jsx)(Jt.SVG,{width:"24",height:"24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,oe.jsx)(Jt.Path,{d:"M14 6H6v8h1.5V8.5L17 18l1-1-9.5-9.5H14V6Z"})});function Ko({nonAnimatedSrc:e,animatedSrc:t}){return(0,oe.jsxs)("picture",{className:"edit-site-welcome-guide__image",children:[(0,oe.jsx)("source",{srcSet:e,media:"(prefers-reduced-motion: reduce)"}),(0,oe.jsx)("img",{src:t,width:"312",height:"240",alt:""})]})}function Yo(){const{toggle:e}=(0,l.useDispatch)(f.store),{isActive:t,isBlockBasedTheme:s}=(0,l.useSelect)((e=>({isActive:!!e(f.store).get("core/edit-site","welcomeGuide"),isBlockBasedTheme:e(_.store).getCurrentTheme()?.is_block_theme})),[]);return t&&s?(0,oe.jsx)(y.Guide,{className:"edit-site-welcome-guide guide-editor",contentLabel:(0,b.__)("Welcome to the site editor"),finishButtonText:(0,b.__)("Get started"),onFinish:()=>e("core/edit-site","welcomeGuide"),pages:[{image:(0,oe.jsx)(Ko,{nonAnimatedSrc:"https://s.w.org/images/block-editor/edit-your-site.svg?1",animatedSrc:"https://s.w.org/images/block-editor/edit-your-site.gif?1"}),content:(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)("h1",{className:"edit-site-welcome-guide__heading",children:(0,b.__)("Edit your site")}),(0,oe.jsx)("p",{className:"edit-site-welcome-guide__text",children:(0,b.__)("Design everything on your site — from the header right down to the footer — using blocks.")}),(0,oe.jsx)("p",{className:"edit-site-welcome-guide__text",children:(0,d.createInterpolateElement)((0,b.__)("Click to start designing your blocks, and choose your typography, layout, and colors."),{StylesIconImage:(0,oe.jsx)("img",{alt:(0,b.__)("styles"),src:"data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 4c-4.4 0-8 3.6-8 8v.1c0 4.1 3.2 7.5 7.2 7.9h.8c4.4 0 8-3.6 8-8s-3.6-8-8-8zm0 15V5c3.9 0 7 3.1 7 7s-3.1 7-7 7z' fill='%231E1E1E'/%3E%3C/svg%3E%0A"})})})]})}]}):null}const{interfaceStore:Xo}=te(h.privateApis);function Jo(){const{toggle:e}=(0,l.useDispatch)(f.store),{isActive:t,isStylesOpen:s}=(0,l.useSelect)((e=>{const t=e(Xo).getActiveComplementaryArea("core");return{isActive:!!e(f.store).get("core/edit-site","welcomeGuideStyles"),isStylesOpen:"edit-site/global-styles"===t}}),[]);if(!t||!s)return null;const n=(0,b.__)("Welcome to Styles");return(0,oe.jsx)(y.Guide,{className:"edit-site-welcome-guide guide-styles",contentLabel:n,finishButtonText:(0,b.__)("Get started"),onFinish:()=>e("core/edit-site","welcomeGuideStyles"),pages:[{image:(0,oe.jsx)(Ko,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-to-styles.svg?1",animatedSrc:"https://s.w.org/images/block-editor/welcome-to-styles.gif?1"}),content:(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)("h1",{className:"edit-site-welcome-guide__heading",children:n}),(0,oe.jsx)("p",{className:"edit-site-welcome-guide__text",children:(0,b.__)("Tweak your site, or give it a whole new look! Get creative — how about a new color palette for your buttons, or choosing a new font? Take a look at what you can do here.")})]})},{image:(0,oe.jsx)(Ko,{nonAnimatedSrc:"https://s.w.org/images/block-editor/set-the-design.svg?1",animatedSrc:"https://s.w.org/images/block-editor/set-the-design.gif?1"}),content:(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)("h1",{className:"edit-site-welcome-guide__heading",children:(0,b.__)("Set the design")}),(0,oe.jsx)("p",{className:"edit-site-welcome-guide__text",children:(0,b.__)("You can customize your site as much as you like with different colors, typography, and layouts. Or if you prefer, just leave it up to your theme to handle!")})]})},{image:(0,oe.jsx)(Ko,{nonAnimatedSrc:"https://s.w.org/images/block-editor/personalize-blocks.svg?1",animatedSrc:"https://s.w.org/images/block-editor/personalize-blocks.gif?1"}),content:(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)("h1",{className:"edit-site-welcome-guide__heading",children:(0,b.__)("Personalize blocks")}),(0,oe.jsx)("p",{className:"edit-site-welcome-guide__text",children:(0,b.__)("You can adjust your blocks to ensure a cohesive experience across your site — add your unique colors to a branded Button block, or adjust the Heading block to your preferred size.")})]})},{image:(0,oe.jsx)(Ko,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-documentation.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-documentation.gif"}),content:(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)("h1",{className:"edit-site-welcome-guide__heading",children:(0,b.__)("Learn more")}),(0,oe.jsxs)("p",{className:"edit-site-welcome-guide__text",children:[(0,b.__)("New to block themes and styling your site?")," ",(0,oe.jsx)(y.ExternalLink,{href:(0,b.__)("https://wordpress.org/documentation/article/styles-overview/"),children:(0,b.__)("Here’s a detailed guide to learn how to make the most of it.")})]})]})}]})}function Qo(){const{toggle:e}=(0,l.useDispatch)(f.store),t=(0,l.useSelect)((e=>{const t=!!e(f.store).get("core/edit-site","welcomeGuidePage"),s=!!e(f.store).get("core/edit-site","welcomeGuide"),{isPage:n}=e(zt);return t&&!s&&n()}),[]);if(!t)return null;const s=(0,b.__)("Editing a page");return(0,oe.jsx)(y.Guide,{className:"edit-site-welcome-guide guide-page",contentLabel:s,finishButtonText:(0,b.__)("Continue"),onFinish:()=>e("core/edit-site","welcomeGuidePage"),pages:[{image:(0,oe.jsx)("video",{className:"edit-site-welcome-guide__video",autoPlay:!0,loop:!0,muted:!0,width:"312",height:"240",children:(0,oe.jsx)("source",{src:"https://s.w.org/images/block-editor/editing-your-page.mp4",type:"video/mp4"})}),content:(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)("h1",{className:"edit-site-welcome-guide__heading",children:s}),(0,oe.jsx)("p",{className:"edit-site-welcome-guide__text",children:(0,b.__)("It’s now possible to edit page content in the site editor. To customise other parts of the page like the header and footer switch to editing the template using the settings sidebar.")})]})}]})}function $o(){const{toggle:e}=(0,l.useDispatch)(f.store),{isLoaded:t,record:s}=ws(),n=t&&"wp_template"===s.type,{isActive:i,hasPreviousEntity:r}=(0,l.useSelect)((e=>{const{getEditorSettings:t}=e(h.store),{get:s}=e(f.store);return{isActive:s("core/edit-site","welcomeGuideTemplate"),hasPreviousEntity:!!t().onNavigateToPreviousEntityRecord}}),[]);if(!(i&&n&&r))return null;const o=(0,b.__)("Editing a template");return(0,oe.jsx)(y.Guide,{className:"edit-site-welcome-guide guide-template",contentLabel:o,finishButtonText:(0,b.__)("Continue"),onFinish:()=>e("core/edit-site","welcomeGuideTemplate"),pages:[{image:(0,oe.jsx)("video",{className:"edit-site-welcome-guide__video",autoPlay:!0,loop:!0,muted:!0,width:"312",height:"240",children:(0,oe.jsx)("source",{src:"https://s.w.org/images/block-editor/editing-your-template.mp4",type:"video/mp4"})}),content:(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)("h1",{className:"edit-site-welcome-guide__heading",children:o}),(0,oe.jsx)("p",{className:"edit-site-welcome-guide__text",children:(0,b.__)("Note that the same template can be used by multiple pages, so any changes made here may affect other pages on the site. To switch back to editing the page content click the ‘Back’ button in the toolbar.")})]})}]})}function ea(){return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(Yo,{}),(0,oe.jsx)(Jo,{}),(0,oe.jsx)(Qo,{}),(0,oe.jsx)($o,{})]})}const{useGlobalStylesOutput:ta}=te(x.privateApis);function sa(){return function(){const e=(0,l.useSelect)((e=>e(zt).getEditedPostType())),[t,s]=ta(e!==je),{getSettings:n}=(0,l.useSelect)(zt),{updateSettings:i}=(0,l.useDispatch)(zt);(0,d.useEffect)((()=>{var e;if(!t||!s)return;const r=n(),o=Object.values(null!==(e=r.styles)&&void 0!==e?e:[]).filter((e=>!e.isGlobalStyles));i({...r,styles:[...o,...t],__experimentalFeatures:s})}),[t,s,i,n])}(),null}const{Theme:na}=te(y.privateApis),{useGlobalStyle:ia}=te(x.privateApis);function ra({id:e}){var t;const[s]=ia("color.text"),[n]=ia("color.background"),{highlightedColors:i}=ie(),r=null!==(t=i[0]?.color)&&void 0!==t?t:s,{elapsed:o,total:a}=(0,l.useSelect)((e=>{var t,s;const n=e(_.store).countSelectorsByStatus(),i=null!==(t=n.resolving)&&void 0!==t?t:0,r=null!==(s=n.finished)&&void 0!==s?s:0;return{elapsed:r,total:r+i}}),[]);return(0,oe.jsx)("div",{className:"edit-site-canvas-loader",children:(0,oe.jsx)(na,{accent:r,background:n,children:(0,oe.jsx)(y.ProgressBar,{id:e,max:a,value:o})})})}const{useHistory:oa}=te(Ht.privateApis);const{useLocation:aa,useHistory:la}=te(Ht.privateApis);function ca(){const e=function(){const e=oa();return(0,d.useCallback)((t=>{e.push({...t,focusMode:!0,canvas:"edit"})}),[e])}(),{canvasMode:t,settings:s,shouldUseTemplateAsDefaultRenderingMode:n}=(0,l.useSelect)((e=>{const{getEditedPostContext:t,getCanvasMode:s,getSettings:n}=te(e(zt)),i=t();return{canvasMode:s(),settings:n(),shouldUseTemplateAsDefaultRenderingMode:i?.postId&&"post"!==i?.postType}}),[]),i=n?"template-locked":"post-only",r=function(){const e=aa(),t=(0,v.usePrevious)(e),s=la();return(0,d.useMemo)((()=>{const n=e.params.focusMode||e.params.postId&&Ne.includes(e.params.postType),i="edit"===t?.params.canvas;return n&&i?()=>s.back():void 0}),[e,s])}();return(0,d.useMemo)((()=>({...s,richEditingEnabled:!0,supportsTemplateMode:!0,focusMode:"view"!==t,defaultRenderingMode:i,onNavigateToEntityRecord:e,onNavigateToPreviousEntityRecord:r,__unstableIsPreviewMode:"view"===t})),[s,t,i,e,r])}const{Fill:ua,Slot:da}=(0,y.createSlotFill)("PluginTemplateSettingPanel"),pa=({children:e})=>{u()("wp.editSite.PluginTemplateSettingPanel",{since:"6.6",version:"6.8",alternative:"wp.editor.PluginDocumentSettingPanel"});return(0,l.useSelect)((e=>"wp_template"===e(h.store).getCurrentPostType()),[])?(0,oe.jsx)(ua,{children:e}):null};pa.Slot=da;const ha=pa,fa=(0,oe.jsx)(Jt.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,oe.jsx)(Jt.Path,{d:"M3.99961 13C4.67043 13.3354 4.6703 13.3357 4.67017 13.3359L4.67298 13.3305C4.67621 13.3242 4.68184 13.3135 4.68988 13.2985C4.70595 13.2686 4.7316 13.2218 4.76695 13.1608C4.8377 13.0385 4.94692 12.8592 5.09541 12.6419C5.39312 12.2062 5.84436 11.624 6.45435 11.0431C7.67308 9.88241 9.49719 8.75 11.9996 8.75C14.502 8.75 16.3261 9.88241 17.5449 11.0431C18.1549 11.624 18.6061 12.2062 18.9038 12.6419C19.0523 12.8592 19.1615 13.0385 19.2323 13.1608C19.2676 13.2218 19.2933 13.2686 19.3093 13.2985C19.3174 13.3135 19.323 13.3242 19.3262 13.3305L19.3291 13.3359C19.3289 13.3357 19.3288 13.3354 19.9996 13C20.6704 12.6646 20.6703 12.6643 20.6701 12.664L20.6697 12.6632L20.6688 12.6614L20.6662 12.6563L20.6583 12.6408C20.6517 12.6282 20.6427 12.6108 20.631 12.5892C20.6078 12.5459 20.5744 12.4852 20.5306 12.4096C20.4432 12.2584 20.3141 12.0471 20.1423 11.7956C19.7994 11.2938 19.2819 10.626 18.5794 9.9569C17.1731 8.61759 14.9972 7.25 11.9996 7.25C9.00203 7.25 6.82614 8.61759 5.41987 9.9569C4.71736 10.626 4.19984 11.2938 3.85694 11.7956C3.68511 12.0471 3.55605 12.2584 3.4686 12.4096C3.42484 12.4852 3.39142 12.5459 3.36818 12.5892C3.35656 12.6108 3.34748 12.6282 3.34092 12.6408L3.33297 12.6563L3.33041 12.6614L3.32948 12.6632L3.32911 12.664C3.32894 12.6643 3.32879 12.6646 3.99961 13ZM11.9996 16C13.9326 16 15.4996 14.433 15.4996 12.5C15.4996 10.567 13.9326 9 11.9996 9C10.0666 9 8.49961 10.567 8.49961 12.5C8.49961 14.433 10.0666 16 11.9996 16Z"})}),ma=(0,oe.jsx)(Jt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Jt.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"})}),ga=(0,oe.jsx)(Jt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Jt.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"})}),va=(0,oe.jsx)(Jt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Jt.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"})});function xa({className:e,...t}){return(0,oe.jsx)(y.Icon,{className:Ut(e,"edit-site-global-styles-icon-with-current-color"),...t})}function ya({icon:e,children:t,...s}){return(0,oe.jsxs)(y.__experimentalItem,{...s,children:[e&&(0,oe.jsxs)(y.__experimentalHStack,{justify:"flex-start",children:[(0,oe.jsx)(xa,{icon:e,size:24}),(0,oe.jsx)(y.FlexItem,{children:t})]}),!e&&t]})}function ba(e){return(0,oe.jsx)(y.__experimentalNavigatorButton,{as:ya,...e})}const wa=(0,oe.jsx)(Jt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Jt.Path,{d:"M6.9 7L3 17.8h1.7l1-2.8h4.1l1 2.8h1.7L8.6 7H6.9zm-.7 6.6l1.5-4.3 1.5 4.3h-3zM21.6 17c-.1.1-.2.2-.3.2-.1.1-.2.1-.4.1s-.3-.1-.4-.2c-.1-.1-.1-.3-.1-.6V12c0-.5 0-1-.1-1.4-.1-.4-.3-.7-.5-1-.2-.2-.5-.4-.9-.5-.4 0-.8-.1-1.3-.1s-1 .1-1.4.2c-.4.1-.7.3-1 .4-.2.2-.4.3-.6.5-.1.2-.2.4-.2.7 0 .3.1.5.2.8.2.2.4.3.8.3.3 0 .6-.1.8-.3.2-.2.3-.4.3-.7 0-.3-.1-.5-.2-.7-.2-.2-.4-.3-.6-.4.2-.2.4-.3.7-.4.3-.1.6-.1.8-.1.3 0 .6 0 .8.1.2.1.4.3.5.5.1.2.2.5.2.9v1.1c0 .3-.1.5-.3.6-.2.2-.5.3-.9.4-.3.1-.7.3-1.1.4-.4.1-.8.3-1.1.5-.3.2-.6.4-.8.7-.2.3-.3.7-.3 1.2 0 .6.2 1.1.5 1.4.3.4.9.5 1.6.5.5 0 1-.1 1.4-.3.4-.2.8-.6 1.1-1.1 0 .4.1.7.3 1 .2.3.6.4 1.2.4.4 0 .7-.1.9-.2.2-.1.5-.3.7-.4h-.3zm-3-.9c-.2.4-.5.7-.8.8-.3.2-.6.2-.8.2-.4 0-.6-.1-.9-.3-.2-.2-.3-.6-.3-1.1 0-.5.1-.9.3-1.2s.5-.5.8-.7c.3-.2.7-.3 1-.5.3-.1.6-.3.7-.6v3.4z"})}),_a=(0,oe.jsx)(Jt.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,oe.jsx)(Jt.Path,{d:"M17.2 10.9c-.5-1-1.2-2.1-2.1-3.2-.6-.9-1.3-1.7-2.1-2.6L12 4l-1 1.1c-.6.9-1.3 1.7-2 2.6-.8 1.2-1.5 2.3-2 3.2-.6 1.2-1 2.2-1 3 0 3.4 2.7 6.1 6.1 6.1s6.1-2.7 6.1-6.1c0-.8-.3-1.8-1-3zm-5.1 7.6c-2.5 0-4.6-2.1-4.6-4.6 0-.3.1-1 .8-2.3.5-.9 1.1-1.9 2-3.1.7-.9 1.3-1.7 1.8-2.3.7.8 1.3 1.6 1.8 2.3.8 1.1 1.5 2.2 2 3.1.7 1.3.8 2 .8 2.3 0 2.5-2.1 4.6-4.6 4.6z"})}),Sa=(0,oe.jsx)(Jt.SVG,{width:"24",height:"24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,oe.jsx)(Jt.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M11.53 4.47a.75.75 0 1 0-1.06 1.06l8 8a.75.75 0 1 0 1.06-1.06l-8-8Zm5 1a.75.75 0 1 0-1.06 1.06l2 2a.75.75 0 1 0 1.06-1.06l-2-2Zm-11.06 10a.75.75 0 0 1 1.06 0l2 2a.75.75 0 1 1-1.06 1.06l-2-2a.75.75 0 0 1 0-1.06Zm.06-5a.75.75 0 0 0-1.06 1.06l8 8a.75.75 0 1 0 1.06-1.06l-8-8Zm-.06-3a.75.75 0 0 1 1.06 0l10 10a.75.75 0 1 1-1.06 1.06l-10-10a.75.75 0 0 1 0-1.06Zm3.06-2a.75.75 0 0 0-1.06 1.06l10 10a.75.75 0 1 0 1.06-1.06l-10-10Z"})}),ja=(0,oe.jsx)(Jt.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,oe.jsx)(Jt.Path,{d:"M12 8c-2.2 0-4 1.8-4 4s1.8 4 4 4 4-1.8 4-4-1.8-4-4-4zm0 6.5c-1.4 0-2.5-1.1-2.5-2.5s1.1-2.5 2.5-2.5 2.5 1.1 2.5 2.5-1.1 2.5-2.5 2.5zM12.8 3h-1.5v3h1.5V3zm-1.6 18h1.5v-3h-1.5v3zm6.8-9.8v1.5h3v-1.5h-3zm-12 0H3v1.5h3v-1.5zm9.7 5.6 2.1 2.1 1.1-1.1-2.1-2.1-1.1 1.1zM8.3 7.2 6.2 5.1 5.1 6.2l2.1 2.1 1.1-1.1zM5.1 17.8l1.1 1.1 2.1-2.1-1.1-1.1-2.1 2.1zM18.9 6.2l-1.1-1.1-2.1 2.1 1.1 1.1 2.1-2.1z"})}),{useHasDimensionsPanel:Ca,useHasTypographyPanel:ka,useHasColorPanel:Ea,useGlobalSetting:Pa,useSettingsForBlockElement:Ia,useHasBackgroundPanel:Ta}=te(x.privateApis);const Oa=function(){const[e]=Pa(""),t=Ia(e),s=Ta(e),n=ka(t),i=Ea(t),r=Ca(t);return(0,oe.jsx)(oe.Fragment,{children:(0,oe.jsxs)(y.__experimentalItemGroup,{children:[n&&(0,oe.jsx)(ba,{icon:wa,path:"/typography","aria-label":(0,b.__)("Typography styles"),children:(0,b.__)("Typography")}),i&&(0,oe.jsx)(ba,{icon:_a,path:"/colors","aria-label":(0,b.__)("Colors styles"),children:(0,b.__)("Colors")}),s&&(0,oe.jsx)(ba,{icon:Sa,path:"/background","aria-label":(0,b.__)("Background styles"),children:(0,b.__)("Background")}),(0,oe.jsx)(ba,{icon:ja,path:"/shadows","aria-label":(0,b.__)("Shadow styles"),children:(0,b.__)("Shadows")}),r&&(0,oe.jsx)(ba,{icon:Mo,path:"/layout","aria-label":(0,b.__)("Layout styles"),children:(0,b.__)("Layout")})]})})};function Aa(e){const t=/^(?!generic\([ a-zA-Z\-]+\)$)(?!^[a-zA-Z\-]+$).+/,s=e.trim(),n=e=>(e=e.trim()).match(t)?`"${e=e.replace(/^["']|["']$/g,"")}"`:e;return s.includes(",")?s.split(",").map(n).filter((e=>""!==e)).join(", "):n(s)}function Ma(e){if(!e)return"";let t=e.trim();return t.includes(",")&&(t=t.split(",").find((e=>""!==e.trim())).trim()),t=t.replace(/^["']|["']$/g,""),window.navigator.userAgent.toLowerCase().includes("firefox")&&(t=`"${t}"`),t}function Na(e){const t={fontFamily:Aa(e.fontFamily)};if(!Array.isArray(e.fontFace))return t.fontWeight="400",t.fontStyle="normal",t;if(e.fontFace){const i=e.fontFace.filter((e=>e?.fontStyle&&"normal"===e.fontStyle.toLowerCase()));if(i.length>0){t.fontStyle="normal";const e=function(e){const t=[];return e.forEach((e=>{const s=String(e.fontWeight).split(" ");if(2===s.length){const e=parseInt(s[0]),n=parseInt(s[1]);for(let s=e;s<=n;s+=100)t.push(s)}else 1===s.length&&t.push(parseInt(s[0]))})),t}(i),r=(s=400,0===(n=e).length?null:(n.sort(((e,t)=>Math.abs(s-e)-Math.abs(s-t))),n[0]));t.fontWeight=String(r)||"400"}else t.fontStyle=e.fontFace.length&&e.fontFace[0].fontStyle||"normal",t.fontWeight=e.fontFace.length&&String(e.fontFace[0].fontWeight)||"400"}var s,n;return t}function Va(e){return e?`is-style-${e}`:""}function Fa(e,t){const s=new RegExp(`^${t}([\\d]+)$`);return e.reduce(((e,t)=>{if("string"==typeof t?.slug){const n=t?.slug.match(s);if(n){const t=parseInt(n[1],10);if(t>e)return t}}return e}),0)+1}function Ra(e,t){if(!Array.isArray(e)||!t)return null;const s=t.replace("var(","").replace(")",""),n=s?.split("--").slice(-1)[0];return e.find((e=>e.slug===n))}const{GlobalStylesContext:Ba}=te(x.privateApis),{mergeBaseAndUserConfigs:Da}=te(h.privateApis);function za({fontSize:e,variation:t}){const{base:s}=(0,d.useContext)(Ba);let n=s;t&&(n=Da(s,t));const[i,r]=function(e){const t=e?.settings?.typography?.fontFamilies?.theme,s=e?.settings?.typography?.fontFamilies?.custom;let n=[];t&&s?n=[...t,...s]:t?n=t:s&&(n=s);const i=e?.styles?.typography?.fontFamily,r=Ra(n,i),o=e?.styles?.elements?.heading?.typography?.fontFamily;let a;return a=o?Ra(n,e?.styles?.elements?.heading?.typography?.fontFamily):r,[r,a]}(n),o=i?Na(i):{},a=r?Na(r):{};return e&&(o.fontSize=e,a.fontSize=e),(0,oe.jsxs)(y.__unstableMotion.div,{animate:{scale:1,opacity:1},initial:{scale:.1,opacity:0},transition:{delay:.3,type:"tween"},style:{textAlign:"center"},children:[(0,oe.jsx)("span",{style:a,children:(0,b._x)("A","Uppercase letter A")}),(0,oe.jsx)("span",{style:o,children:(0,b._x)("a","Lowercase letter A")})]})}function La({normalizedColorSwatchSize:e,ratio:t}){const{highlightedColors:s}=ie(),n=e*t;return s.map((({slug:e,color:t},s)=>(0,oe.jsx)(y.__unstableMotion.div,{style:{height:n,width:n,background:t,borderRadius:n/2},animate:{scale:1,opacity:1},initial:{scale:.1,opacity:0},transition:{delay:1===s?.2:.1}},`${e}-${s}`)))}const{useGlobalStyle:Ha,useGlobalStylesOutput:Ga}=te(x.privateApis),Ua={leading:!0,trailing:!0};function Wa({children:e,label:t,isFocused:s,withHoverView:n}){const[i="white"]=Ha("color.background"),[r]=Ha("color.gradient"),[o]=Ga(),a=(0,v.useReducedMotion)(),[l,c]=(0,d.useState)(!1),[u,{width:p}]=(0,v.useResizeObserver)(),[h,f]=(0,d.useState)(p),[m,g]=(0,d.useState)(),b=(0,v.useThrottle)(f,250,Ua);(0,d.useLayoutEffect)((()=>{p&&b(p)}),[p,b]),(0,d.useLayoutEffect)((()=>{const e=h?h/248:1,t=e-(m||0);!(Math.abs(t)>.1)&&m||g(e)}),[h,m]);const w=m||(p?p/248:1),_=(0,d.useMemo)((()=>o?[...o,{css:"html{overflow:hidden}body{min-width: 0;padding: 0;border: none;cursor: pointer;}",isGlobalStyles:!0}]:o),[o]),S=!!p;return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)("div",{style:{position:"relative"},children:u}),S&&(0,oe.jsxs)(x.__unstableIframe,{className:"edit-site-global-styles-preview__iframe",style:{height:152*w},onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),tabIndex:-1,children:[(0,oe.jsx)(x.__unstableEditorStyles,{styles:_}),(0,oe.jsx)(y.__unstableMotion.div,{style:{height:152*w,width:"100%",background:null!=r?r:i,cursor:n?"pointer":void 0},initial:"start",animate:(l||s)&&!a&&t?"hover":"start",children:[].concat(e).map(((e,t)=>e({ratio:w,key:t})))})]})]})}const{useGlobalStyle:qa}=te(x.privateApis),Za={start:{scale:1,opacity:1},hover:{scale:0,opacity:0}},Ka={hover:{opacity:1},start:{opacity:.5}},Ya={hover:{scale:1,opacity:1},start:{scale:0,opacity:0}},Xa=({label:e,isFocused:t,withHoverView:s,variation:n})=>{const[i]=qa("typography.fontWeight"),[r="serif"]=qa("typography.fontFamily"),[o=r]=qa("elements.h1.typography.fontFamily"),[a=i]=qa("elements.h1.typography.fontWeight"),[l="black"]=qa("color.text"),[c=l]=qa("elements.h1.color.text"),{paletteColors:u}=ie();return(0,oe.jsxs)(Wa,{label:e,isFocused:t,withHoverView:s,children:[({ratio:e,key:t})=>(0,oe.jsx)(y.__unstableMotion.div,{variants:Za,style:{height:"100%",overflow:"hidden"},children:(0,oe.jsxs)(y.__experimentalHStack,{spacing:10*e,justify:"center",style:{height:"100%",overflow:"hidden"},children:[(0,oe.jsx)(za,{fontSize:65*e,variation:n}),(0,oe.jsx)(y.__experimentalVStack,{spacing:4*e,children:(0,oe.jsx)(La,{normalizedColorSwatchSize:32,ratio:e})})]})},t),({key:e})=>(0,oe.jsx)(y.__unstableMotion.div,{variants:s&&Ka,style:{height:"100%",width:"100%",position:"absolute",top:0,overflow:"hidden",filter:"blur(60px)",opacity:.1},children:(0,oe.jsx)(y.__experimentalHStack,{spacing:0,justify:"flex-start",style:{height:"100%",overflow:"hidden"},children:u.slice(0,4).map((({color:e},t)=>(0,oe.jsx)("div",{style:{height:"100%",background:e,flexGrow:1}},t)))})},e),({ratio:t,key:s})=>(0,oe.jsx)(y.__unstableMotion.div,{variants:Ya,style:{height:"100%",width:"100%",overflow:"hidden",position:"absolute",top:0},children:(0,oe.jsx)(y.__experimentalVStack,{spacing:3*t,justify:"center",style:{height:"100%",overflow:"hidden",padding:10*t,boxSizing:"border-box"},children:e&&(0,oe.jsx)("div",{style:{fontSize:40*t,fontFamily:o,color:c,fontWeight:a,lineHeight:"1em",textAlign:"center"},children:e})})},s)]})},{useGlobalStyle:Ja}=te(x.privateApis);const Qa=function(){const[e]=Ja("css"),{hasVariations:t,canEditCSS:s}=(0,l.useSelect)((e=>{const{getEntityRecord:t,__experimentalGetCurrentGlobalStylesId:s,__experimentalGetCurrentThemeGlobalStylesVariations:n}=e(_.store),i=s(),r=i?t("root","globalStyles",i):void 0;return{hasVariations:!!n()?.length,canEditCSS:!!r?._links?.["wp:action-edit-css"]}}),[]);return(0,oe.jsxs)(y.Card,{size:"small",className:"edit-site-global-styles-screen-root",isRounded:!1,children:[(0,oe.jsx)(y.CardBody,{children:(0,oe.jsxs)(y.__experimentalVStack,{spacing:4,children:[(0,oe.jsx)(y.Card,{className:"edit-site-global-styles-screen-root__active-style-tile",children:(0,oe.jsx)(y.CardMedia,{className:"edit-site-global-styles-screen-root__active-style-tile-preview",children:(0,oe.jsx)(Xa,{})})}),t&&(0,oe.jsx)(y.__experimentalItemGroup,{children:(0,oe.jsx)(ba,{path:"/variations","aria-label":(0,b.__)("Browse styles"),children:(0,oe.jsxs)(y.__experimentalHStack,{justify:"space-between",children:[(0,oe.jsx)(y.FlexItem,{children:(0,b.__)("Browse styles")}),(0,oe.jsx)(xa,{icon:(0,b.isRTL)()?ga:va})]})})}),(0,oe.jsx)(Oa,{})]})}),(0,oe.jsx)(y.CardDivider,{}),(0,oe.jsxs)(y.CardBody,{children:[(0,oe.jsx)(y.__experimentalSpacer,{as:"p",paddingTop:2,paddingX:"13px",marginBottom:4,children:(0,b.__)("Customize the appearance of specific blocks for the whole site.")}),(0,oe.jsx)(y.__experimentalItemGroup,{children:(0,oe.jsx)(ba,{path:"/blocks","aria-label":(0,b.__)("Blocks styles"),children:(0,oe.jsxs)(y.__experimentalHStack,{justify:"space-between",children:[(0,oe.jsx)(y.FlexItem,{children:(0,b.__)("Blocks")}),(0,oe.jsx)(xa,{icon:(0,b.isRTL)()?ga:va})]})})})]}),s&&!!e&&(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(y.CardDivider,{}),(0,oe.jsxs)(y.CardBody,{children:[(0,oe.jsx)(y.__experimentalSpacer,{as:"p",paddingTop:2,paddingX:"13px",marginBottom:4,children:(0,b.__)("Add your own CSS to customize the appearance and layout of your site.")}),(0,oe.jsx)(y.__experimentalItemGroup,{children:(0,oe.jsx)(ba,{path:"/css","aria-label":(0,b.__)("Additional CSS"),children:(0,oe.jsxs)(y.__experimentalHStack,{justify:"space-between",children:[(0,oe.jsx)(y.FlexItem,{children:(0,b.__)("Additional CSS")}),(0,oe.jsx)(xa,{icon:(0,b.isRTL)()?ga:va})]})})})]})]})]})},$a=window.wp.a11y,{useGlobalStyle:el}=te(x.privateApis);function tl(e){const t=(0,l.useSelect)((t=>{const{getBlockStyles:s}=t(o.store);return s(e)}),[e]),[s]=el("variations",e);return function(e,t){return e?.filter((e=>"block"===e.source||t.includes(e.name)))}(t,Object.keys(null!=s?s:{}))}function sl({name:e}){const t=tl(e);return(0,oe.jsx)(y.__experimentalItemGroup,{isBordered:!0,isSeparated:!0,children:t.map(((t,s)=>t?.isDefault?null:(0,oe.jsx)(ba,{path:"/blocks/"+encodeURIComponent(e)+"/variations/"+encodeURIComponent(t.name),"aria-label":t.label,children:t.label},s)))})}const nl=function({title:e,description:t,onBack:s}){return(0,oe.jsxs)(y.__experimentalVStack,{spacing:0,children:[(0,oe.jsx)(y.__experimentalView,{children:(0,oe.jsx)(y.__experimentalSpacer,{marginBottom:0,paddingX:4,paddingY:3,children:(0,oe.jsxs)(y.__experimentalHStack,{spacing:2,children:[(0,oe.jsx)(y.__experimentalNavigatorBackButton,{icon:(0,b.isRTL)()?va:ga,size:"small",label:(0,b.__)("Back"),onClick:s}),(0,oe.jsx)(y.__experimentalSpacer,{children:(0,oe.jsx)(y.__experimentalHeading,{className:"edit-site-global-styles-header",level:2,size:13,children:e})})]})})}),t&&(0,oe.jsx)("p",{className:"edit-site-global-styles-header__description",children:t})]})},{useHasDimensionsPanel:il,useHasTypographyPanel:rl,useHasBorderPanel:ol,useGlobalSetting:al,useSettingsForBlockElement:ll,useHasColorPanel:cl}=te(x.privateApis);function ul(e){const[t]=al("",e),s=ll(t,e),n=rl(s),i=cl(s),r=ol(s),o=il(s),a=r||o,l=!!tl(e)?.length;return n||i||a||l}function dl({block:e}){if(!ul(e.name))return null;const t=(0,b.sprintf)((0,b.__)("%s block styles"),e.title);return(0,oe.jsx)(ba,{path:"/blocks/"+encodeURIComponent(e.name),"aria-label":t,children:(0,oe.jsxs)(y.__experimentalHStack,{justify:"flex-start",children:[(0,oe.jsx)(x.BlockIcon,{icon:e.icon}),(0,oe.jsx)(y.FlexItem,{children:e.title})]})})}const pl=(0,d.memo)((function({filterValue:e}){const t=function(){const e=(0,l.useSelect)((e=>e(o.store).getBlockTypes()),[]),{core:t,noncore:s}=e.reduce(((e,t)=>{const{core:s,noncore:n}=e;return(t.name.startsWith("core/")?s:n).push(t),e}),{core:[],noncore:[]});return[...t,...s]}(),s=(0,v.useDebounce)($a.speak,500),{isMatchingSearchTerm:n}=(0,l.useSelect)(o.store),i=e?t.filter((t=>n(t,e))):t,r=(0,d.useRef)();return(0,d.useEffect)((()=>{if(!e)return;const t=r.current.childElementCount,n=(0,b.sprintf)((0,b._n)("%d result found.","%d results found.",t),t);s(n,t)}),[e,s]),(0,oe.jsx)("div",{ref:r,className:"edit-site-block-types-item-list",children:i.map((e=>(0,oe.jsx)(dl,{block:e},"menu-itemblock-"+e.name)))})}));const hl=function(){const[e,t]=(0,d.useState)(""),s=(0,d.useDeferredValue)(e);return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(nl,{title:(0,b.__)("Blocks"),description:(0,b.__)("Customize the appearance of specific blocks and for the whole site.")}),(0,oe.jsx)(y.SearchControl,{__nextHasNoMarginBottom:!0,className:"edit-site-block-types-search",onChange:t,value:e,label:(0,b.__)("Search for blocks"),placeholder:(0,b.__)("Search")}),(0,oe.jsx)(pl,{filterValue:s})]})},fl=({name:e,variation:t=""})=>{var s;const n=(0,o.getBlockType)(e)?.example,i=(0,d.useMemo)((()=>{if(!n)return null;let s=n;return t&&(s={...s,attributes:{...s.attributes,className:Va(t)}}),(0,o.getBlockFromExample)(e,s)}),[e,n,t]),r=null!==(s=n?.viewportWidth)&&void 0!==s?s:500,a=144,l=235/r,c=0!==l&&l<1?a/l:a;return n?(0,oe.jsx)(y.__experimentalSpacer,{marginX:4,marginBottom:4,children:(0,oe.jsx)("div",{className:"edit-site-global-styles__block-preview-panel",style:{maxHeight:a,boxSizing:"initial"},children:(0,oe.jsx)(x.BlockPreview,{blocks:i,viewportWidth:r,minHeight:a,additionalStyles:[{css:`\n\t\t\t\t\t\t\t\tbody{\n\t\t\t\t\t\t\t\t\tpadding: 24px;\n\t\t\t\t\t\t\t\t\tmin-height:${Math.round(c)}px;\n\t\t\t\t\t\t\t\t\tdisplay:flex;\n\t\t\t\t\t\t\t\t\talign-items:center;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t.is-root-container { width: 100%; }\n\t\t\t\t\t\t\t`}]})})}):null};const ml=function({children:e,level:t}){return(0,oe.jsx)(y.__experimentalHeading,{className:"edit-site-global-styles-subtitle",level:null!=t?t:2,children:e})},gl={backgroundSize:"cover",backgroundPosition:"50% 50%"};function vl(e){if(!e)return e;const t=e.color||e.width;return!e.style&&t?{...e,style:"solid"}:!e.style||t?e:void 0}const{useHasDimensionsPanel:xl,useHasTypographyPanel:yl,useHasBorderPanel:bl,useGlobalSetting:wl,useSettingsForBlockElement:_l,useHasColorPanel:Sl,useHasFiltersPanel:jl,useHasImageSettingsPanel:Cl,useGlobalStyle:kl,useHasBackgroundPanel:El,BackgroundPanel:Pl,BorderPanel:Il,ColorPanel:Tl,TypographyPanel:Ol,DimensionsPanel:Al,FiltersPanel:Ml,ImageSettingsPanel:Nl,AdvancedPanel:Vl}=te(x.privateApis);const Fl=function({name:e,variation:t}){let s=[];t&&(s=["variations",t].concat(s));const n=s.join("."),[i]=kl(n,e,"user",{shouldDecodeEncode:!1}),[r,a]=kl(n,e,"all",{shouldDecodeEncode:!1}),[c]=wl("",e,"user"),[u,p]=wl("",e),h=_l(u,e),f=(0,o.getBlockType)(e);h?.spacing?.blockGap&&f?.supports?.spacing?.blockGap&&(!0===f?.supports?.spacing?.__experimentalSkipSerialization||f?.supports?.spacing?.__experimentalSkipSerialization?.some?.((e=>"blockGap"===e)))&&(h.spacing.blockGap=!1),h?.dimensions?.aspectRatio&&"core/group"===e&&(h.dimensions.aspectRatio=!1);const m=tl(e),g=El(h),v=yl(h),x=Sl(h),w=bl(h),S=xl(h),j=jl(h),C=Cl(e,c,h),k=!!m?.length&&!t,{canEditCSS:E}=(0,l.useSelect)((e=>{const{getEntityRecord:t,__experimentalGetCurrentGlobalStylesId:s}=e(_.store),n=s(),i=n?t("root","globalStyles",n):void 0;return{canEditCSS:!!i?._links?.["wp:action-edit-css"]}}),[]),P=t?m.find((e=>e.name===t)):null,I=(0,d.useMemo)((()=>({...r,layout:h.layout})),[r,h.layout]),T=(0,d.useMemo)((()=>({...i,layout:c.layout})),[i,c.layout]);return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(nl,{title:t?P?.label:f.title}),(0,oe.jsx)(fl,{name:e,variation:t}),k&&(0,oe.jsx)("div",{className:"edit-site-global-styles-screen-variations",children:(0,oe.jsxs)(y.__experimentalVStack,{spacing:3,children:[(0,oe.jsx)(ml,{children:(0,b.__)("Style Variations")}),(0,oe.jsx)(sl,{name:e})]})}),x&&(0,oe.jsx)(Tl,{inheritedValue:r,value:i,onChange:a,settings:h}),g&&(0,oe.jsx)(Pl,{inheritedValue:r,value:i,onChange:a,settings:h,defaultValues:gl}),v&&(0,oe.jsx)(Ol,{inheritedValue:r,value:i,onChange:a,settings:h}),S&&(0,oe.jsx)(Al,{inheritedValue:I,value:T,onChange:e=>{const t={...e};delete t.layout,a(t),e.layout!==c.layout&&p({...c,layout:e.layout})},settings:h,includeLayoutControls:!0}),w&&(0,oe.jsx)(Il,{inheritedValue:r,value:i,onChange:e=>{if(!e?.border)return void a(e);const{radius:t,...s}=e.border,n=function(e){return e?(0,y.__experimentalHasSplitBorders)(e)?{top:vl(e.top),right:vl(e.right),bottom:vl(e.bottom),left:vl(e.left)}:vl(e):e}(s),i=(0,y.__experimentalHasSplitBorders)(n)?{color:null,style:null,width:null,...n}:{top:n,right:n,bottom:n,left:n};a({...e,border:{...i,radius:t}})},settings:h}),j&&(0,oe.jsx)(Ml,{inheritedValue:I,value:T,onChange:a,settings:h,includeLayoutControls:!0}),C&&(0,oe.jsx)(Nl,{onChange:e=>{p(void 0===e?{...u,lightbox:void 0}:{...u,lightbox:{...u.lightbox,...e}})},value:c,inheritedValue:h}),E&&(0,oe.jsxs)(y.PanelBody,{title:(0,b.__)("Advanced"),initialOpen:!1,children:[(0,oe.jsx)("p",{children:(0,b.sprintf)((0,b.__)("Add your own CSS to customize the appearance of the %s block. You do not need to include a CSS selector, just add the property and value."),f?.title)}),(0,oe.jsx)(Vl,{value:i,onChange:a,inheritedValue:r})]})]})},{useGlobalStyle:Rl}=te(x.privateApis);function Bl({parentMenu:e,element:t,label:s}){var n;const i="text"!==t&&t?`elements.${t}.`:"",r="link"===t?{textDecoration:"underline"}:{},[o]=Rl(i+"typography.fontFamily"),[a]=Rl(i+"typography.fontStyle"),[l]=Rl(i+"typography.fontWeight"),[c]=Rl(i+"color.background"),[u]=Rl("color.background"),[d]=Rl(i+"color.gradient"),[p]=Rl(i+"color.text"),h=(0,b.sprintf)((0,b.__)("Typography %s styles"),s);return(0,oe.jsx)(ba,{path:e+"/typography/"+t,"aria-label":h,children:(0,oe.jsxs)(y.__experimentalHStack,{justify:"flex-start",children:[(0,oe.jsx)(y.FlexItem,{className:"edit-site-global-styles-screen-typography__indicator",style:{fontFamily:null!=o?o:"serif",background:null!==(n=null!=d?d:c)&&void 0!==n?n:u,color:p,fontStyle:a,fontWeight:l,...r},children:(0,b.__)("Aa")}),(0,oe.jsx)(y.FlexItem,{children:s})]})})}const Dl=function(){return(0,oe.jsxs)(y.__experimentalVStack,{spacing:3,children:[(0,oe.jsx)(ml,{level:3,children:(0,b.__)("Elements")}),(0,oe.jsxs)(y.__experimentalItemGroup,{isBordered:!0,isSeparated:!0,children:[(0,oe.jsx)(Bl,{parentMenu:"",element:"text",label:(0,b.__)("Text")}),(0,oe.jsx)(Bl,{parentMenu:"",element:"link",label:(0,b.__)("Links")}),(0,oe.jsx)(Bl,{parentMenu:"",element:"heading",label:(0,b.__)("Headings")}),(0,oe.jsx)(Bl,{parentMenu:"",element:"caption",label:(0,b.__)("Captions")}),(0,oe.jsx)(Bl,{parentMenu:"",element:"button",label:(0,b.__)("Buttons")})]})]})},zl=({variation:e,isFocused:t,withHoverView:s})=>(0,oe.jsx)(Wa,{label:e.title,isFocused:t,withHoverView:s,children:({ratio:t,key:s})=>(0,oe.jsx)(y.__experimentalHStack,{spacing:10*t,justify:"center",style:{height:"100%",overflow:"hidden"},children:(0,oe.jsx)(za,{variation:e,fontSize:85*t})},s)}),{GlobalStylesContext:Ll,areGlobalStyleConfigsEqual:Hl}=te(x.privateApis),{mergeBaseAndUserConfigs:Gl}=te(h.privateApis);function Ul(e,t){if(!t?.length)return e;if("object"!=typeof e||!e||!Object.keys(e).length)return e;for(const s in e)t.includes(s)?delete e[s]:"object"==typeof e[s]&&Ul(e[s],t);return e}function Wl({title:e,settings:t,styles:s}){return e===(0,b.__)("Default")||Object.keys(t).length>0||Object.keys(s).length>0}function ql(e=[]){const{variationsFromTheme:t}=(0,l.useSelect)((e=>({variationsFromTheme:e(_.store).__experimentalGetCurrentThemeGlobalStylesVariations()||[]})),[]),{user:s}=(0,d.useContext)(Ll),n=e.toString();return(0,d.useMemo)((()=>{const n=Ul(structuredClone(s),e);n.title=(0,b.__)("Default");const i=t.filter((t=>Kl(t,e))).map((e=>Gl(n,e))),r=[n,...i];return r?.length?r.filter(Wl):[]}),[n,s,t])}const Zl=(e,t)=>{if(!e||!t?.length)return{};const s={};return Object.keys(e).forEach((n=>{if(t.includes(n))s[n]=e[n];else if("object"==typeof e[n]){const i=Zl(e[n],t);Object.keys(i).length&&(s[n]=i)}})),s};function Kl(e,t){const s=Zl(structuredClone(e),t);return Hl(s,e)}const{mergeBaseAndUserConfigs:Yl}=te(h.privateApis),{GlobalStylesContext:Xl,areGlobalStyleConfigsEqual:Jl}=te(x.privateApis);function Ql({variation:e,children:t,isPill:s,properties:n,showTooltip:i}){const[r,o]=(0,d.useState)(!1),{base:a,user:l,setUserConfig:c}=(0,d.useContext)(Xl),u=(0,d.useMemo)((()=>{let t=Yl(a,e);return n&&(t=Zl(t,n)),{user:e,base:a,merged:t,setUserConfig:()=>{}}}),[e,a,n]),p=()=>c(e),h=(0,d.useMemo)((()=>Jl(l,e)),[l,e]);let f=e?.title;e?.description&&(f=(0,b.sprintf)((0,b._x)("%1$s (%2$s)","variation label"),e?.title,e?.description));const m=(0,oe.jsx)("div",{className:Ut("edit-site-global-styles-variations_item",{"is-active":h}),role:"button",onClick:p,onKeyDown:e=>{e.keyCode===$t.ENTER&&(e.preventDefault(),p())},tabIndex:"0","aria-label":f,"aria-current":h,onFocus:()=>o(!0),onBlur:()=>o(!1),children:(0,oe.jsx)("div",{className:Ut("edit-site-global-styles-variations_item-preview",{"is-pill":s}),children:t(r)})});return(0,oe.jsx)(Xl.Provider,{value:u,children:i?(0,oe.jsx)(y.Tooltip,{text:e?.title,children:m}):m})}function $l({title:e,gap:t=2}){const s=["typography"],n=ql(s);return n?.length<=1?null:(0,oe.jsxs)(y.__experimentalVStack,{spacing:3,children:[e&&(0,oe.jsx)(ml,{level:3,children:e}),(0,oe.jsx)(y.__experimentalGrid,{columns:3,gap:t,className:"edit-site-global-styles-style-variations-container",children:n.map(((e,t)=>(0,oe.jsx)(Ql,{variation:e,properties:s,showTooltip:!0,children:()=>(0,oe.jsx)(zl,{variation:e})},t)))})]})}const ec=function(){return(0,oe.jsxs)(y.__experimentalVStack,{spacing:2,children:[(0,oe.jsx)(y.__experimentalHStack,{justify:"space-between",children:(0,oe.jsx)(ml,{level:3,children:(0,b.__)("Font Sizes")})}),(0,oe.jsx)(y.__experimentalItemGroup,{isBordered:!0,isSeparated:!0,children:(0,oe.jsx)(ba,{path:"/typography/font-sizes/","aria-label":(0,b.__)("Edit font size presets"),children:(0,oe.jsxs)(y.__experimentalHStack,{direction:"row",children:[(0,oe.jsx)(y.FlexItem,{children:(0,b.__)("Font size presets")}),(0,oe.jsx)(qo,{icon:(0,b.isRTL)()?ga:va})]})})})]})},tc=(0,oe.jsxs)(Jt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,oe.jsx)(Jt.Path,{d:"m19 7.5h-7.628c-.3089-.87389-1.1423-1.5-2.122-1.5-.97966 0-1.81309.62611-2.12197 1.5h-2.12803v1.5h2.12803c.30888.87389 1.14231 1.5 2.12197 1.5.9797 0 1.8131-.62611 2.122-1.5h7.628z"}),(0,oe.jsx)(Jt.Path,{d:"m19 15h-2.128c-.3089-.8739-1.1423-1.5-2.122-1.5s-1.8131.6261-2.122 1.5h-7.628v1.5h7.628c.3089.8739 1.1423 1.5 2.122 1.5s1.8131-.6261 2.122-1.5h2.128z"})]}),sc="/wp/v2/font-families",nc="/wp/v2/font-collections";async function ic(e){const t={path:sc,method:"POST",body:e},s=await io()(t);return{id:s.id,...s.font_family_settings,fontFace:[]}}async function rc(e,t){const s={path:`${sc}/${e}/font-faces`,method:"POST",body:t},n=await io()(s);return{id:n.id,...n.font_face_settings}}async function oc(e){const t={path:`${sc}?slug=${e}&_embed=true`,method:"GET"},s=await io()(t);if(!s||0===s.length)return null;const n=s[0];return{id:n.id,...n.font_family_settings,fontFace:n?._embedded?.font_faces.map((e=>e.font_face_settings))||[]}}async function ac(e){const t={path:`${sc}/${e}?force=true`,method:"DELETE"};return await io()(t)}const lc=["otf","ttf","woff","woff2"],cc={100:(0,b._x)("Thin","font weight"),200:(0,b._x)("Extra-light","font weight"),300:(0,b._x)("Light","font weight"),400:(0,b._x)("Normal","font weight"),500:(0,b._x)("Medium","font weight"),600:(0,b._x)("Semi-bold","font weight"),700:(0,b._x)("Bold","font weight"),800:(0,b._x)("Extra-bold","font weight"),900:(0,b._x)("Black","font weight")},uc={normal:(0,b._x)("Normal","font style"),italic:(0,b._x)("Italic","font style")},{File:dc}=window,{kebabCase:pc}=te(y.privateApis);function hc(e,t={}){return e.name||!e.fontFamily&&!e.slug||(e.name=e.fontFamily||e.slug),{...e,...t}}function fc(e){return`${cc[e.fontWeight]||e.fontWeight} ${"normal"===e.fontStyle?"":uc[e.fontStyle]||e.fontStyle}`}function mc(e=[],t=[]){const s=new Map;for(const t of e)s.set(`${t.fontWeight}${t.fontStyle}`,t);for(const e of t)s.set(`${e.fontWeight}${e.fontStyle}`,e);return Array.from(s.values())}function gc(e=[],t=[]){const s=new Map;for(const t of e)s.set(t.slug,{...t});for(const e of t)if(s.has(e.slug)){const{fontFace:t,...n}=e,i=mc(s.get(e.slug).fontFace,t);s.set(e.slug,{...n,fontFace:i})}else s.set(e.slug,{...e});return Array.from(s.values())}async function vc(e,t,s="all"){let n;if("string"==typeof t)n=`url(${t})`;else{if(!(t instanceof dc))return;n=await t.arrayBuffer()}const i=new window.FontFace(Ma(e.fontFamily),n,{style:e.fontStyle,weight:e.fontWeight}),r=await i.load();if("document"!==s&&"all"!==s||document.fonts.add(r),"iframe"===s||"all"===s){document.querySelector('iframe[name="editor-canvas"]').contentDocument.fonts.add(r)}}function xc(e,t="all"){const s=t=>{t.forEach((s=>{s.family===Ma(e?.fontFamily)&&s.weight===e?.fontWeight&&s.style===e?.fontStyle&&t.delete(s)}))};if("document"!==t&&"all"!==t||s(document.fonts),"iframe"===t||"all"===t){s(document.querySelector('iframe[name="editor-canvas"]').contentDocument.fonts)}}function yc(e){if(!e)return;let t;var s;return t=Array.isArray(e)?e[0]:e,t.startsWith("file:.")?void 0:(("string"!=typeof(s=t)||s===decodeURIComponent(s))&&(t=encodeURI(t)),t)}function bc(e){const t=new FormData,{fontFace:s,category:n,...i}=e,r={...i,slug:pc(e.slug)};return t.append("font_family_settings",JSON.stringify(r)),t}function wc(e){if(e?.fontFace){const t=e.fontFace.map(((e,t)=>{const s={...e},n=new FormData;if(s.file){const e=Array.isArray(s.file)?s.file:[s.file],i=[];e.forEach(((e,s)=>{const r=`file-${t}-${s}`;n.append(r,e,e.name),i.push(r)})),s.src=1===i.length?i[0]:i,delete s.file,n.append("font_face_settings",JSON.stringify(s))}else n.append("font_face_settings",JSON.stringify(s));return n}));return t}}async function _c(e,t){const s=[];for(const n of t)try{const t=await rc(e,n);s.push({status:"fulfilled",value:t})}catch(e){s.push({status:"rejected",reason:e})}const n={errors:[],successes:[]};return s.forEach(((e,s)=>{if("fulfilled"===e.status){const i=e.value;i.id?n.successes.push(i):n.errors.push({data:t[s],message:`Error: ${i.message}`})}else n.errors.push({data:t[s],message:e.reason.message})})),n}function Sc(e,t){return-1!==t.findIndex((t=>t.fontWeight===e.fontWeight&&t.fontStyle===e.fontStyle))}function jc(e,t,s){const n=t=>t.slug===e.slug,i=s.find(n);return t?(i=>{const r=e=>e.fontWeight===t.fontWeight&&e.fontStyle===t.fontStyle;if(!i)return[...s,{...e,fontFace:[t]}];let o=i.fontFace||[];return o=o.find(r)?o.filter((e=>!r(e))):[...o,t],0===o.length?s.filter((e=>!n(e))):s.map((e=>n(e)?{...e,fontFace:o}:e))})(i):(t=>t?s.filter((e=>!n(e))):[...s,e])(i)}const{useGlobalSetting:Cc}=te(x.privateApis),kc=(0,d.createContext)({});const Ec=function({children:e}){const{saveEntityRecord:t}=(0,l.useDispatch)(_.store),{globalStylesId:s}=(0,l.useSelect)((e=>{const{__experimentalGetCurrentGlobalStylesId:t}=e(_.store);return{globalStylesId:t()}})),n=(0,_.useEntityRecord)("root","globalStyles",s),[i,r]=(0,d.useState)(!1),[o,a]=(0,d.useState)(0),c=()=>{a(Date.now())},{records:u=[],isResolving:p}=(0,_.useEntityRecords)("postType","wp_font_family",{refreshKey:o,_embed:!0}),h=(u||[]).map((e=>({id:e.id,...e.font_family_settings,fontFace:e?._embedded?.font_faces.map((e=>e.font_face_settings))||[]})))||[],[f,m]=Cc("typography.fontFamilies"),g=async e=>{const s=n.record;re(s,["settings","typography","fontFamilies"],e),await t("root","globalStyles",s)},[v,x]=(0,d.useState)(!1),[y,w]=(0,d.useState)(null),S=f?.theme?f.theme.map((e=>hc(e,{source:"theme"}))).sort(((e,t)=>e.name.localeCompare(t.name))):[],j=f?.custom?f.custom.map((e=>hc(e,{source:"custom"}))).sort(((e,t)=>e.name.localeCompare(t.name))):[],C=h?h.map((e=>hc(e,{source:"custom"}))).sort(((e,t)=>e.name.localeCompare(t.name))):[];(0,d.useEffect)((()=>{v||w(null)}),[v]);const[k]=(0,d.useState)(new Set),E=e=>e.reduce(((e,t)=>{const s=t?.fontFace&&t.fontFace?.length>0?t?.fontFace.map((e=>`${e.fontStyle+e.fontWeight}`)):["normal400"];return e[t.slug]=s,e}),{}),P=e=>E("theme"===e?S:j),I=(e,t,s,n)=>t||s?!!P(n)[e]?.includes(t+s):!!P(n)[e],T=e=>{var t;const s=(null!==(t=f?.[e.source])&&void 0!==t?t:[]).filter((t=>t.slug!==e.slug)),n={...f,[e.source]:s};return m(n),e.fontFace&&e.fontFace.forEach((e=>{xc(e,"all")})),n},O=e=>{const t=A(e),s={...f,custom:gc(f?.custom,t)};return m(s),M(t),s},A=e=>e.map((({id:e,fontFace:t,...s})=>({...s,...t&&t.length>0?{fontFace:t.map((({id:e,...t})=>t))}:{}}))),M=e=>{e.forEach((e=>{e.fontFace&&e.fontFace.forEach((e=>{vc(e,yc(e.src),"all")}))}))},[N,V]=(0,d.useState)([]),F=async()=>{const e=await async function(){const e={path:`${nc}?_fields=slug,name,description`,method:"GET"};return await io()(e)}();V(e)};return(0,d.useEffect)((()=>{F()}),[]),(0,oe.jsx)(kc.Provider,{value:{libraryFontSelected:y,handleSetLibraryFontSelected:e=>{if(!e)return void w(null);const t=("theme"===e.source?S:C).find((t=>t.slug===e.slug));w({...t||e,source:e.source})},fontFamilies:f,baseCustomFonts:C,isFontActivated:I,getFontFacesActivated:(e,t)=>P(t)[e]||[],loadFontFaceAsset:async e=>{if(!e.src)return;const t=yc(e.src);t&&!k.has(t)&&(vc(e,t,"document"),k.add(t))},installFonts:async function(e){r(!0);try{const t=[];let s=[];for(const n of e){let e=!1,i=await oc(n.slug);i||(e=!0,i=await ic(bc(n)));const r=i.fontFace&&n.fontFace?i.fontFace.filter((e=>Sc(e,n.fontFace))):[];i.fontFace&&n.fontFace&&(n.fontFace=n.fontFace.filter((e=>!Sc(e,i.fontFace))));let o=[],a=[];if(n?.fontFace?.length>0){const e=await _c(i.id,wc(n));o=e?.successes,a=e?.errors}(o?.length>0||r?.length>0)&&(i.fontFace=[...o],t.push(i)),i&&!n?.fontFace?.length&&t.push(i),e&&n?.fontFace?.length>0&&0===o?.length&&await ac(i.id),s=s.concat(a)}if(s=s.reduce(((e,t)=>e.includes(t.message)?e:[...e,t.message]),[]),t.length>0){const e=O(t);await g(e),c()}if(s.length>0){const e=new Error((0,b.__)("There was an error installing fonts."));throw e.installationErrors=s,e}}finally{r(!1)}},uninstallFontFamily:async function(e){try{const t=await ac(e.id);if(t.deleted){const t=T(e);await g(t)}return c(),t}catch(e){throw console.error("There was an error uninstalling the font family:",e),e}},toggleActivateFont:(e,t)=>{var s;const n=jc(e,t,null!==(s=f?.[e.source])&&void 0!==s?s:[]);m({...f,[e.source]:n});I(e.slug,t?.fontStyle,t?.fontWeight,e.source)?xc(t,"all"):vc(t,yc(t?.src),"all")},getAvailableFontsOutline:E,modalTabOpen:v,setModalTabOpen:x,refreshLibrary:c,saveFontFamilies:g,isResolvingLibrary:p,isInstalling:i,collections:N,getFontCollection:async e=>{try{if(!!N.find((t=>t.slug===e))?.font_families)return;const t=await async function(e){const t={path:`${nc}/${e}`,method:"GET"};return await io()(t)}(e),s=N.map((s=>s.slug===e?{...s,...t}:s));V(s)}catch(e){throw console.error(e),e}}},children:e})};const Pc=function({font:e,text:t}){const s=(0,d.useRef)(null),n=function(e){return e.fontStyle||e.fontWeight?e:e.fontFace&&e.fontFace.length?e.fontFace.find((e=>"normal"===e.fontStyle&&"400"===e.fontWeight))||e.fontFace[0]:{fontStyle:"normal",fontWeight:"400",fontFamily:e.fontFamily,fake:!0}}(e),i=Na(e);t=t||e.name;const r=e.preview,[o,a]=(0,d.useState)(!1),[l,c]=(0,d.useState)(!1),{loadFontFaceAsset:u}=(0,d.useContext)(kc),p=null!=r?r:function(e){return e.preview?e.preview:e.src?Array.isArray(e.src)?e.src[0]:e.src:void 0}(n),h=p&&p.match(/\.(png|jpg|jpeg|gif|svg)$/i);var f;const m={fontSize:"18px",lineHeight:1,opacity:l?"1":"0",...i,...{fontFamily:Aa((f=n).fontFamily),fontStyle:f.fontStyle||"normal",fontWeight:f.fontWeight||"400"}};return(0,d.useEffect)((()=>{const e=new window.IntersectionObserver((([e])=>{a(e.isIntersecting)}),{});return e.observe(s.current),()=>e.disconnect()}),[s]),(0,d.useEffect)((()=>{(async()=>{o&&(!h&&n.src&&await u(n),c(!0))})()}),[n,o,u,h]),(0,oe.jsx)("div",{ref:s,children:h?(0,oe.jsx)("img",{src:p,loading:"lazy",alt:t,className:"font-library-modal__font-variant_demo-image"}):(0,oe.jsx)(y.__experimentalText,{style:m,className:"font-library-modal__font-variant_demo-text",children:t})})};const Ic=function({font:e,onClick:t,variantsText:s,navigatorPath:n}){const i=e.fontFace?.length||1,r={cursor:t?"pointer":"default"},o=(0,y.__experimentalUseNavigator)();return(0,oe.jsx)(y.Button,{__next40pxDefaultSize:!0,onClick:()=>{t(),n&&o.goTo(n)},style:r,className:"font-library-modal__font-card",children:(0,oe.jsxs)(y.Flex,{justify:"space-between",wrap:!1,children:[(0,oe.jsx)(Pc,{font:e}),(0,oe.jsxs)(y.Flex,{justify:"flex-end",children:[(0,oe.jsx)(y.FlexItem,{children:(0,oe.jsx)(y.__experimentalText,{className:"font-library-modal__font-card__count",children:s||(0,b.sprintf)((0,b._n)("%d variant","%d variants",i),i)})}),(0,oe.jsx)(y.FlexItem,{children:(0,oe.jsx)(y.Icon,{icon:(0,b.isRTL)()?ga:va})})]})]})})},{kebabCase:Tc}=te(y.privateApis);const Oc=function({face:e,font:t}){const{isFontActivated:s,toggleActivateFont:n}=(0,d.useContext)(kc),i=t?.fontFace?.length>0?s(t.slug,e.fontStyle,e.fontWeight,t.source):s(t.slug,null,null,t.source),r=()=>{t?.fontFace?.length>0?n(t,e):n(t)},o=t.name+" "+fc(e),a=Tc(`${t.slug}-${fc(e)}`);return(0,oe.jsx)("div",{className:"font-library-modal__font-card",children:(0,oe.jsxs)(y.Flex,{justify:"flex-start",align:"center",gap:"1rem",children:[(0,oe.jsx)(y.CheckboxControl,{checked:i,onChange:r,__nextHasNoMarginBottom:!0,id:a}),(0,oe.jsx)("label",{htmlFor:a,children:(0,oe.jsx)(Pc,{font:e,text:o,onClick:r})})]})})};function Ac(e){switch(e){case"normal":return 400;case"bold":return 700;case"bolder":return 500;case"lighter":return 300;default:return parseInt(e,10)}}function Mc(e){return e.sort(((e,t)=>"normal"===e.fontStyle&&"normal"!==t.fontStyle?-1:"normal"===t.fontStyle&&"normal"!==e.fontStyle?1:e.fontStyle===t.fontStyle?Ac(e.fontWeight)-Ac(t.fontWeight):e.fontStyle.localeCompare(t.fontStyle)))}const{useGlobalSetting:Nc}=te(x.privateApis);function Vc({font:e,isOpen:t,setIsOpen:s,setNotice:n,uninstallFontFamily:i,handleSetLibraryFontSelected:r}){const o=(0,y.__experimentalUseNavigator)();return(0,oe.jsx)(y.__experimentalConfirmDialog,{isOpen:t,cancelButtonText:(0,b.__)("Cancel"),confirmButtonText:(0,b.__)("Delete"),onCancel:()=>{s(!1)},onConfirm:async()=>{n(null),s(!1);try{await i(e),o.goBack(),r(null),n({type:"success",message:(0,b.__)("Font family uninstalled successfully.")})}catch(e){n({type:"error",message:(0,b.__)("There was an error uninstalling the font family.")+e.message})}},size:"medium",children:e&&(0,b.sprintf)((0,b.__)('Are you sure you want to delete "%s" font and all its variants and assets?'),e.name)})}const Fc=function(){var e;const{baseCustomFonts:t,libraryFontSelected:s,handleSetLibraryFontSelected:n,refreshLibrary:i,uninstallFontFamily:r,isResolvingLibrary:o,isInstalling:a,saveFontFamilies:c,getFontFacesActivated:u}=(0,d.useContext)(kc),[p,h]=Nc("typography.fontFamilies"),[f,m]=(0,d.useState)(!1),[g,v]=(0,d.useState)(!1),[x]=Nc("typography.fontFamilies",void 0,"base"),w=(0,l.useSelect)((e=>{const{__experimentalGetCurrentGlobalStylesId:t}=e(_.store);return t()})),S=(0,_.useEntityRecord)("root","globalStyles",w),j=!!S?.edits?.settings?.typography?.fontFamilies,C=p?.theme?p.theme.map((e=>hc(e,{source:"theme"}))).sort(((e,t)=>e.name.localeCompare(t.name))):[],k=new Set(C.map((e=>e.slug))),E=x?.theme?C.concat(x.theme.filter((e=>!k.has(e.slug))).map((e=>hc(e,{source:"theme"}))).sort(((e,t)=>e.name.localeCompare(t.name)))):[],P="custom"===s?.source&&s?.id,I=(0,l.useSelect)((e=>{const{canUser:t}=e(_.store);return P&&t("delete",{kind:"postType",name:"wp_font_family",id:P})}),[P]),T=!!s&&"theme"!==s?.source&&I,O=e=>{const t=e?.fontFace?.length>0?e.fontFace.length:1,s=u(e.slug,e.source).length;return(0,b.sprintf)((0,b.__)("%1$s/%2$s variants active"),s,t)};(0,d.useEffect)((()=>{n(s),i()}),[]);const A=s?u(s.slug,s.source).length:0,M=null!==(e=s?.fontFace?.length)&&void 0!==e?e:s?.fontFamily?1:0,N=A>0&&A!==M,V=A===M,F=E.length>0||t.length>0;return(0,oe.jsxs)("div",{className:"font-library-modal__tabpanel-layout",children:[o&&(0,oe.jsx)("div",{className:"font-library-modal__loading",children:(0,oe.jsx)(y.ProgressBar,{})}),!o&&(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsxs)(y.__experimentalNavigatorProvider,{initialPath:s?"/fontFamily":"/",children:[(0,oe.jsx)(y.__experimentalNavigatorScreen,{path:"/",children:(0,oe.jsxs)(y.__experimentalVStack,{spacing:"8",children:[g&&(0,oe.jsx)(y.Notice,{status:g.type,onRemove:()=>v(null),children:g.message}),!F&&(0,oe.jsx)(y.__experimentalText,{as:"p",children:(0,b.__)("No fonts installed.")}),E.length>0&&(0,oe.jsxs)(y.__experimentalVStack,{children:[(0,oe.jsx)("h2",{className:"font-library-modal__fonts-title",children:(0,b._x)("Theme","font source")}),(0,oe.jsx)("ul",{role:"list",className:"font-library-modal__fonts-list",children:E.map((e=>(0,oe.jsx)("li",{className:"font-library-modal__fonts-list-item",children:(0,oe.jsx)(Ic,{font:e,navigatorPath:"/fontFamily",variantsText:O(e),onClick:()=>{v(null),n(e)}})},e.slug)))})]}),t.length>0&&(0,oe.jsxs)(y.__experimentalVStack,{children:[(0,oe.jsx)("h2",{className:"font-library-modal__fonts-title",children:(0,b._x)("Custom","font source")}),(0,oe.jsx)("ul",{role:"list",className:"font-library-modal__fonts-list",children:t.map((e=>(0,oe.jsx)("li",{className:"font-library-modal__fonts-list-item",children:(0,oe.jsx)(Ic,{font:e,navigatorPath:"/fontFamily",variantsText:O(e),onClick:()=>{v(null),n(e)}})},e.slug)))})]})]})}),(0,oe.jsxs)(y.__experimentalNavigatorScreen,{path:"/fontFamily",children:[(0,oe.jsx)(Vc,{font:s,isOpen:f,setIsOpen:m,setNotice:v,uninstallFontFamily:r,handleSetLibraryFontSelected:n}),(0,oe.jsxs)(y.Flex,{justify:"flex-start",children:[(0,oe.jsx)(y.__experimentalNavigatorBackButton,{icon:(0,b.isRTL)()?va:ga,size:"small",onClick:()=>{n(null),v(null)},label:(0,b.__)("Back")}),(0,oe.jsx)(y.__experimentalHeading,{level:2,size:13,className:"edit-site-global-styles-header",children:s?.name})]}),g&&(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(y.__experimentalSpacer,{margin:1}),(0,oe.jsx)(y.Notice,{status:g.type,onRemove:()=>v(null),children:g.message}),(0,oe.jsx)(y.__experimentalSpacer,{margin:1})]}),(0,oe.jsx)(y.__experimentalSpacer,{margin:4}),(0,oe.jsx)(y.__experimentalText,{children:(0,b.__)("Choose font variants. Keep in mind that too many variants could make your site slower.")}),(0,oe.jsx)(y.__experimentalSpacer,{margin:4}),(0,oe.jsxs)(y.__experimentalVStack,{spacing:0,children:[(0,oe.jsx)(y.CheckboxControl,{className:"font-library-modal__select-all",label:(0,b.__)("Select all"),checked:V,onChange:()=>{var e;const t=null!==(e=p?.[s.source]?.filter((e=>e.slug!==s.slug)))&&void 0!==e?e:[],n=V?t:[...t,s];h({...p,[s.source]:n}),s.fontFace&&s.fontFace.forEach((e=>{V?xc(e,"all"):vc(e,yc(e?.src),"all")}))},indeterminate:N,__nextHasNoMarginBottom:!0}),(0,oe.jsx)(y.__experimentalSpacer,{margin:8}),(0,oe.jsx)("ul",{role:"list",className:"font-library-modal__fonts-list",children:(e=>e?e.fontFace&&e.fontFace.length?Mc(e.fontFace):[{fontFamily:e.fontFamily,fontStyle:"normal",fontWeight:"400"}]:[])(s).map(((e,t)=>(0,oe.jsx)("li",{className:"font-library-modal__fonts-list-item",children:(0,oe.jsx)(Oc,{font:s,face:e},`face${t}`)},`face${t}`)))})]})]})]}),(0,oe.jsxs)(y.__experimentalHStack,{justify:"flex-end",className:"font-library-modal__footer",children:[a&&(0,oe.jsx)(y.ProgressBar,{}),T&&(0,oe.jsx)(y.Button,{__next40pxDefaultSize:!0,isDestructive:!0,variant:"tertiary",onClick:()=>{m(!0)},children:(0,b.__)("Delete")}),(0,oe.jsx)(y.Button,{__next40pxDefaultSize:!0,variant:"primary",onClick:async()=>{v(null);try{await c(p),v({type:"success",message:(0,b.__)("Font family updated successfully.")})}catch(e){v({type:"error",message:(0,b.sprintf)((0,b.__)("There was an error updating the font family. %s"),e.message)})}},disabled:!j,accessibleWhenDisabled:!0,children:(0,b.__)("Update")})]})]})]})};function Rc(e,t,s){return t?!!s[e]?.[`${t.fontStyle}-${t.fontWeight}`]:!!s[e]}const Bc=function(){return(0,oe.jsx)("div",{className:"font-library__google-fonts-confirm",children:(0,oe.jsx)(y.Card,{children:(0,oe.jsxs)(y.CardBody,{children:[(0,oe.jsx)(y.__experimentalHeading,{level:2,children:(0,b.__)("Connect to Google Fonts")}),(0,oe.jsx)(y.__experimentalSpacer,{margin:6}),(0,oe.jsx)(y.__experimentalText,{as:"p",children:(0,b.__)("To install fonts from Google you must give permission to connect directly to Google servers. The fonts you install will be downloaded from Google and stored on your site. Your site will then use these locally-hosted fonts.")}),(0,oe.jsx)(y.__experimentalSpacer,{margin:3}),(0,oe.jsx)(y.__experimentalText,{as:"p",children:(0,b.__)("You can alternatively upload files directly on the Upload tab.")}),(0,oe.jsx)(y.__experimentalSpacer,{margin:6}),(0,oe.jsx)(y.Button,{__next40pxDefaultSize:!0,variant:"primary",onClick:()=>{window.localStorage.setItem("wp-font-library-google-fonts-permission","true"),window.dispatchEvent(new Event("storage"))},children:(0,b.__)("Allow access to Google Fonts")})]})})})},{kebabCase:Dc}=te(y.privateApis);const zc=function({face:e,font:t,handleToggleVariant:s,selected:n}){const i=()=>{t?.fontFace?s(t,e):s(t)},r=t.name+" "+fc(e),o=Dc(`${t.slug}-${fc(e)}`);return(0,oe.jsx)("div",{className:"font-library-modal__font-card",children:(0,oe.jsxs)(y.Flex,{justify:"flex-start",align:"center",gap:"1rem",children:[(0,oe.jsx)(y.CheckboxControl,{checked:n,onChange:i,__nextHasNoMarginBottom:!0,id:o}),(0,oe.jsx)("label",{htmlFor:o,children:(0,oe.jsx)(Pc,{font:e,text:r,onClick:i})})]})})},Lc={slug:"all",name:(0,b._x)("All","font categories")},Hc="wp-font-library-google-fonts-permission";const Gc=function({slug:e}){var t;const s="google-fonts"===e,n=()=>"true"===window.localStorage.getItem(Hc),[i,r]=(0,d.useState)(null),[o,a]=(0,d.useState)(!1),[l,c]=(0,d.useState)([]),[u,p]=(0,d.useState)(1),[h,f]=(0,d.useState)({}),[m,g]=(0,d.useState)(s&&!n()),{collections:x,getFontCollection:w,installFonts:_,isInstalling:S}=(0,d.useContext)(kc),j=x.find((t=>t.slug===e));(0,d.useEffect)((()=>{const e=()=>{g(s&&!n())};return e(),window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)}),[e,s]);const C=()=>{window.localStorage.setItem(Hc,"false"),window.dispatchEvent(new Event("storage"))};(0,d.useEffect)((()=>{(async()=>{try{await w(e),B()}catch(e){o||a({type:"error",message:e?.message})}})()}),[e,w,a,o]),(0,d.useEffect)((()=>{r(null)}),[e]),(0,d.useEffect)((()=>{c([])}),[i]);const k=(0,d.useMemo)((()=>{var e;return null!==(e=j?.font_families)&&void 0!==e?e:[]}),[j]),E=null!==(t=j?.categories)&&void 0!==t?t:[],P=[Lc,...E],I=(0,d.useMemo)((()=>function(e,t){const{category:s,search:n}=t;let i=e||[];return s&&"all"!==s&&(i=i.filter((e=>-1!==e.categories.indexOf(s)))),n&&(i=i.filter((e=>e.font_family_settings.name.toLowerCase().includes(n.toLowerCase())))),i}(k,h)),[k,h]),T=!j?.font_families&&!o,O=Math.max(window.innerHeight,500),A=Math.floor((O-417)/61),M=Math.ceil(I.length/A),N=(u-1)*A,V=u*A,F=I.slice(N,V),R=(0,v.debounce)((e=>{f({...h,search:e}),p(1)}),300),B=()=>{f({}),p(1)},D=(e,t)=>{const s=jc(e,t,l);c(s)},z=function(e){return e.reduce(((e,t)=>({...e,[t.slug]:(t?.fontFace||[]).reduce(((e,t)=>({...e,[`${t.fontStyle}-${t.fontWeight}`]:!0})),{})})),{})}(l),L=l.length>0?l[0]?.fontFace?.length:0,H=L>0&&L!==i?.fontFace?.length,G=L===i?.fontFace?.length;if(m)return(0,oe.jsx)(Bc,{});const U=()=>"google-fonts"!==e||m||i?null:(0,oe.jsx)(y.DropdownMenu,{icon:ma,label:(0,b.__)("Actions"),popoverProps:{position:"bottom left"},controls:[{title:(0,b.__)("Revoke access to Google Fonts"),onClick:C}]});return(0,oe.jsxs)("div",{className:"font-library-modal__tabpanel-layout",children:[T&&(0,oe.jsx)("div",{className:"font-library-modal__loading",children:(0,oe.jsx)(y.ProgressBar,{})}),!T&&(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsxs)(y.__experimentalNavigatorProvider,{initialPath:"/",className:"font-library-modal__tabpanel-layout",children:[(0,oe.jsxs)(y.__experimentalNavigatorScreen,{path:"/",children:[(0,oe.jsxs)(y.__experimentalHStack,{justify:"space-between",children:[(0,oe.jsxs)(y.__experimentalVStack,{children:[(0,oe.jsx)(y.__experimentalHeading,{level:2,size:13,children:j.name}),(0,oe.jsx)(y.__experimentalText,{children:j.description})]}),(0,oe.jsx)(U,{})]}),(0,oe.jsx)(y.__experimentalSpacer,{margin:4}),(0,oe.jsxs)(y.Flex,{children:[(0,oe.jsx)(y.FlexItem,{children:(0,oe.jsx)(y.SearchControl,{className:"font-library-modal__search",value:h.search,placeholder:(0,b.__)("Font name…"),label:(0,b.__)("Search"),onChange:R,__nextHasNoMarginBottom:!0,hideLabelFromVision:!1})}),(0,oe.jsx)(y.FlexItem,{children:(0,oe.jsx)(y.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,b.__)("Category"),value:h.category,onChange:e=>{f({...h,category:e}),p(1)},children:P&&P.map((e=>(0,oe.jsx)("option",{value:e.slug,children:e.name},e.slug)))})})]}),(0,oe.jsx)(y.__experimentalSpacer,{margin:4}),!!j?.font_families?.length&&!I.length&&(0,oe.jsx)(y.__experimentalText,{children:(0,b.__)("No fonts found. Try with a different search term")}),(0,oe.jsx)("div",{className:"font-library-modal__fonts-grid__main",children:(0,oe.jsx)("ul",{role:"list",className:"font-library-modal__fonts-list",children:F.map((e=>(0,oe.jsx)("li",{className:"font-library-modal__fonts-list-item",children:(0,oe.jsx)(Ic,{font:e.font_family_settings,navigatorPath:"/fontFamily",onClick:()=>{r(e.font_family_settings)}})},e.font_family_settings.slug)))})})]}),(0,oe.jsxs)(y.__experimentalNavigatorScreen,{path:"/fontFamily",children:[(0,oe.jsxs)(y.Flex,{justify:"flex-start",children:[(0,oe.jsx)(y.__experimentalNavigatorBackButton,{icon:(0,b.isRTL)()?va:ga,size:"small",onClick:()=>{r(null),a(null)},label:(0,b.__)("Back")}),(0,oe.jsx)(y.__experimentalHeading,{level:2,size:13,className:"edit-site-global-styles-header",children:i?.name})]}),o&&(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(y.__experimentalSpacer,{margin:1}),(0,oe.jsx)(y.Notice,{status:o.type,onRemove:()=>a(null),children:o.message}),(0,oe.jsx)(y.__experimentalSpacer,{margin:1})]}),(0,oe.jsx)(y.__experimentalSpacer,{margin:4}),(0,oe.jsx)(y.__experimentalText,{children:(0,b.__)("Select font variants to install.")}),(0,oe.jsx)(y.__experimentalSpacer,{margin:4}),(0,oe.jsx)(y.CheckboxControl,{className:"font-library-modal__select-all",label:(0,b.__)("Select all"),checked:G,onChange:()=>{c(G?[]:[i])},indeterminate:H,__nextHasNoMarginBottom:!0}),(0,oe.jsx)(y.__experimentalVStack,{spacing:0,children:(0,oe.jsx)("ul",{role:"list",className:"font-library-modal__fonts-list",children:(W=i,W?W.fontFace&&W.fontFace.length?Mc(W.fontFace):[{fontFamily:W.fontFamily,fontStyle:"normal",fontWeight:"400"}]:[]).map(((e,t)=>(0,oe.jsx)("li",{className:"font-library-modal__fonts-list-item",children:(0,oe.jsx)(zc,{font:i,face:e,handleToggleVariant:D,selected:Rc(i.slug,i.fontFace?e:null,z)})},`face${t}`)))})}),(0,oe.jsx)(y.__experimentalSpacer,{margin:16})]})]}),i&&(0,oe.jsx)(y.Flex,{justify:"flex-end",className:"font-library-modal__footer",children:(0,oe.jsx)(y.Button,{__next40pxDefaultSize:!0,variant:"primary",onClick:async()=>{a(null);const e=l[0];try{e?.fontFace&&await Promise.all(e.fontFace.map((async e=>{e.src&&(e.file=await async function(e){e=Array.isArray(e)?e:[e];const t=await Promise.all(e.map((async e=>fetch(new Request(e)).then((t=>{if(!t.ok)throw new Error(`Error downloading font face asset from ${e}. Server responded with status: ${t.status}`);return t.blob()})).then((t=>{const s=e.split("/").pop();return new dc([t],s,{type:t.type})})))));return 1===t.length?t[0]:t}(e.src))})))}catch(e){return void a({type:"error",message:(0,b.__)("Error installing the fonts, could not be downloaded.")})}try{await _([e]),a({type:"success",message:(0,b.__)("Fonts were installed successfully.")})}catch(e){a({type:"error",message:e.message})}c([])},isBusy:S,disabled:0===l.length||S,accessibleWhenDisabled:!0,children:(0,b.__)("Install")})}),!i&&(0,oe.jsxs)(y.__experimentalHStack,{spacing:4,justify:"center",className:"font-library-modal__footer",children:[(0,oe.jsx)(y.Button,{label:(0,b.__)("Previous page"),size:"compact",onClick:()=>p(u-1),disabled:1===u,showTooltip:!0,accessibleWhenDisabled:!0,icon:(0,b.isRTL)()?va:ga,tooltipPosition:"top"}),(0,oe.jsx)(y.__experimentalHStack,{justify:"flex-start",expanded:!1,spacing:2,className:"font-library-modal__page-selection",children:(0,d.createInterpolateElement)((0,b.sprintf)((0,b._x)("Page of %s","paging"),M),{CurrentPageControl:(0,oe.jsx)(y.SelectControl,{"aria-label":(0,b.__)("Current page"),value:u,options:[...Array(M)].map(((e,t)=>({label:t+1,value:t+1}))),onChange:e=>p(parseInt(e)),size:"compact",__nextHasNoMarginBottom:!0})})}),(0,oe.jsx)(y.Button,{label:(0,b.__)("Next page"),size:"compact",onClick:()=>p(u+1),disabled:u===M,accessibleWhenDisabled:!0,icon:(0,b.isRTL)()?ga:va,tooltipPosition:"top"})]})]})]});var W};var Uc=i(8572),Wc=i.n(Uc),qc=i(4660),Zc=i.n(qc);globalThis.fetch;class Kc{constructor(e,t={},s){this.type=e,this.detail=t,this.msg=s,Object.defineProperty(this,"__mayPropagate",{enumerable:!1,writable:!0}),this.__mayPropagate=!0}preventDefault(){}stopPropagation(){this.__mayPropagate=!1}valueOf(){return this}toString(){return this.msg?`[${this.type} event]: ${this.msg}`:`[${this.type} event]`}}class Yc{constructor(){this.listeners={}}addEventListener(e,t,s){let n=this.listeners[e]||[];s?n.unshift(t):n.push(t),this.listeners[e]=n}removeEventListener(e,t){let s=this.listeners[e]||[],n=s.findIndex((e=>e===t));n>-1&&(s.splice(n,1),this.listeners[e]=s)}dispatch(e){let t=this.listeners[e.type];if(t)for(let s=0,n=t.length;s{let t=e.replace(/get(Big)?/,"").toLowerCase(),s=parseInt(e.replace(/[^\d]/g,""))/8;Object.defineProperty(this,t,{get:()=>this.getValue(e,s)})}))}get currentPosition(){return this.start+this.offset}set currentPosition(e){this.start=e,this.offset=0}skip(e=0,t=8){this.offset+=e*t/8}getValue(e,t){let s=this.start+this.offset;this.offset+=t;try{return this.data[e](s)}catch(s){throw console.error("parser",e,t,this),console.error("parser",this.start,this.offset),s}}flags(e){if(8===e||16===e||32===e||64===e)return this[`uint${e}`].toString(2).padStart(e,0).split("").map((e=>"1"===e));console.error("Error parsing flags: flag types can only be 1, 2, 4, or 8 bytes long"),console.trace()}get tag(){const e=this.uint32;return t=[e>>24&255,e>>16&255,e>>8&255,255&e],Array.from(t).map((e=>String.fromCharCode(e))).join("");var t}get fixed(){return this.int16+Math.round(1e3*this.uint16/65356)/1e3}get legacyFixed(){let e=this.uint16,t=this.uint16.toString(16).padStart(4,0);return parseFloat(`${e}.${t}`)}get uint24(){return(this.uint8<<16)+(this.uint8<<8)+this.uint8}get uint128(){let e=0;for(let t=0;t<5;t++){let t=this.uint8;if(e=128*e+(127&t),t<128)break}return e}get longdatetime(){return new Date(Xc+1e3*parseInt(this.int64.toString()))}get fword(){return this.int16}get ufword(){return this.uint16}get Offset16(){return this.uint16}get Offset32(){return this.uint32}get F2DOT14(){const e=p.uint16;return[0,1,-2,-1][e>>14]+(16383&e)/16384}verifyLength(){this.offset!=this.length&&console.error(`unexpected parsed table size (${this.offset}) for "${this.name}" (expected ${this.length})`)}readBytes(e=0,t=0,s=8,n=!1){if(0===(e=e||this.length))return[];t&&(this.currentPosition=t);const i=`${n?"":"u"}int${s}`,r=[];for(;e--;)r.push(this[i]);return r}}class Qc{constructor(e){const t={enumerable:!1,get:()=>e};Object.defineProperty(this,"parser",t);const s=e.currentPosition,n={enumerable:!1,get:()=>s};Object.defineProperty(this,"start",n)}load(e){Object.keys(e).forEach((t=>{let s=Object.getOwnPropertyDescriptor(e,t);s.get?this[t]=s.get.bind(this):void 0!==s.value&&(this[t]=s.value)})),this.parser.length&&this.parser.verifyLength()}}class $c extends Qc{constructor(e,t,s){const{parser:n,start:i}=super(new Jc(e,t,s)),r={enumerable:!1,get:()=>n};Object.defineProperty(this,"p",r);const o={enumerable:!1,get:()=>i};Object.defineProperty(this,"tableStart",o)}}function eu(e,t,s){let n;Object.defineProperty(e,t,{get:()=>n||(n=s(),n),enumerable:!0})}class tu extends $c{constructor(e,t,s){const{p:n}=super({offset:0,length:12},t,"sfnt");this.version=n.uint32,this.numTables=n.uint16,this.searchRange=n.uint16,this.entrySelector=n.uint16,this.rangeShift=n.uint16,n.verifyLength(),this.directory=[...new Array(this.numTables)].map((e=>new su(n))),this.tables={},this.directory.forEach((e=>{eu(this.tables,e.tag.trim(),(()=>s(this.tables,{tag:e.tag,offset:e.offset,length:e.length},t)))}))}}class su{constructor(e){this.tag=e.tag,this.checksum=e.uint32,this.offset=e.uint32,this.length=e.uint32}}const nu=Zc().inflate||void 0;let iu;class ru extends $c{constructor(e,t,s){const{p:n}=super({offset:0,length:44},t,"woff");this.signature=n.tag,this.flavor=n.uint32,this.length=n.uint32,this.numTables=n.uint16,n.uint16,this.totalSfntSize=n.uint32,this.majorVersion=n.uint16,this.minorVersion=n.uint16,this.metaOffset=n.uint32,this.metaLength=n.uint32,this.metaOrigLength=n.uint32,this.privOffset=n.uint32,this.privLength=n.uint32,n.verifyLength(),this.directory=[...new Array(this.numTables)].map((e=>new ou(n))),au(this,t,s)}}class ou{constructor(e){this.tag=e.tag,this.offset=e.uint32,this.compLength=e.uint32,this.origLength=e.uint32,this.origChecksum=e.uint32}}function au(e,t,s){e.tables={},e.directory.forEach((n=>{eu(e.tables,n.tag.trim(),(()=>{let i=0,r=t;if(n.compLength!==n.origLength){const e=t.buffer.slice(n.offset,n.offset+n.compLength);let s;if(nu)s=nu(new Uint8Array(e));else{if(!iu){const e="no brotli decoder available to decode WOFF2 font";throw font.onerror&&font.onerror(e),new Error(e)}s=iu(new Uint8Array(e))}r=new DataView(s.buffer)}else i=n.offset;return s(e.tables,{tag:n.tag,offset:i,length:n.origLength},r)}))}))}const lu=Wc();let cu;class uu extends $c{constructor(e,t,s){const{p:n}=super({offset:0,length:48},t,"woff2");this.signature=n.tag,this.flavor=n.uint32,this.length=n.uint32,this.numTables=n.uint16,n.uint16,this.totalSfntSize=n.uint32,this.totalCompressedSize=n.uint32,this.majorVersion=n.uint16,this.minorVersion=n.uint16,this.metaOffset=n.uint32,this.metaLength=n.uint32,this.metaOrigLength=n.uint32,this.privOffset=n.uint32,this.privLength=n.uint32,n.verifyLength(),this.directory=[...new Array(this.numTables)].map((e=>new du(n)));let i,r=n.currentPosition;this.directory[0].offset=0,this.directory.forEach(((e,t)=>{let s=this.directory[t+1];s&&(s.offset=e.offset+(void 0!==e.transformLength?e.transformLength:e.origLength))}));let o=t.buffer.slice(r);if(lu)i=lu(new Uint8Array(o));else{if(!cu){const t="no brotli decoder available to decode WOFF2 font";throw e.onerror&&e.onerror(t),new Error(t)}i=new Uint8Array(cu(o))}!function(e,t,s){e.tables={},e.directory.forEach((n=>{eu(e.tables,n.tag.trim(),(()=>{const i=n.offset,r=i+(n.transformLength?n.transformLength:n.origLength),o=new DataView(t.slice(i,r).buffer);try{return s(e.tables,{tag:n.tag,offset:0,length:n.origLength},o)}catch(e){console.error(e)}}))}))}(this,i,s)}}class du{constructor(e){this.flags=e.uint8;const t=this.tagNumber=63&this.flags;this.tag=63===t?e.tag:["cmap","head","hhea","hmtx","maxp","name","OS/2","post","cvt ","fpgm","glyf","loca","prep","CFF ","VORG","EBDT","EBLC","gasp","hdmx","kern","LTSH","PCLT","VDMX","vhea","vmtx","BASE","GDEF","GPOS","GSUB","EBSC","JSTF","MATH","CBDT","CBLC","COLR","CPAL","SVG ","sbix","acnt","avar","bdat","bloc","bsln","cvar","fdsc","feat","fmtx","fvar","gvar","hsty","just","lcar","mort","morx","opbd","prop","trak","Zapf","Silf","Glat","Gloc","Feat","Sill"][63&t];let s=0!==(this.transformVersion=(192&this.flags)>>6);"glyf"!==this.tag&&"loca"!==this.tag||(s=3!==this.transformVersion),this.origLength=e.uint128,s&&(this.transformLength=e.uint128)}}const pu={};let hu=!1;function fu(e,t,s){let n=t.tag.replace(/[^\w\d]/g,""),i=pu[n];return i?new i(t,s,e):(console.warn(`lib-font has no definition for ${n}. The table was skipped.`),{})}function mu(){let e=0;function t(s,n){if(!hu)return e>10?n(new Error("loading took too long")):(e++,setTimeout((()=>t(s)),250));s(fu)}return new Promise(((e,s)=>t(e)))}async function gu(e,t,s={}){if(!globalThis.document)return;let n=function(e,t){let s=e.lastIndexOf("."),n=(e.substring(s+1)||"").toLowerCase(),i={ttf:"truetype",otf:"opentype",woff:"woff",woff2:"woff2"}[n];if(i)return i;let r={eot:"The .eot format is not supported: it died in January 12, 2016, when Microsoft retired all versions of IE that didn't already support WOFF.",svg:"The .svg format is not supported: SVG fonts (not to be confused with OpenType with embedded SVG) were so bad we took the entire fonts chapter out of the SVG specification again.",fon:"The .fon format is not supported: this is an ancient Windows bitmap font format.",ttc:"Based on the current CSS specification, font collections are not (yet?) supported."}[n];if(r||(r=`${e} is not a known webfont format.`),t)throw new Error(r);console.warn(`Could not load font: ${r}`)}(t,s.errorOnStyle);if(!n)return;let i=document.createElement("style");i.className="injected-by-Font-js";let r=[];return s.styleRules&&(r=Object.entries(s.styleRules).map((([e,t])=>`${e}: ${t};`))),i.textContent=`\n@font-face {\n font-family: "${e}";\n ${r.join("\n\t")}\n src: url("${t}") format("${n}");\n}`,globalThis.document.head.appendChild(i),i}Promise.all([Promise.resolve().then((function(){return Du})),Promise.resolve().then((function(){return zu})),Promise.resolve().then((function(){return Lu})),Promise.resolve().then((function(){return Gu})),Promise.resolve().then((function(){return Uu})),Promise.resolve().then((function(){return Zu})),Promise.resolve().then((function(){return Ku})),Promise.resolve().then((function(){return Xu})),Promise.resolve().then((function(){return ad})),Promise.resolve().then((function(){return yd})),Promise.resolve().then((function(){return gp})),Promise.resolve().then((function(){return vp})),Promise.resolve().then((function(){return bp})),Promise.resolve().then((function(){return Sp})),Promise.resolve().then((function(){return jp})),Promise.resolve().then((function(){return Cp})),Promise.resolve().then((function(){return Ep})),Promise.resolve().then((function(){return Pp})),Promise.resolve().then((function(){return Ip})),Promise.resolve().then((function(){return Tp})),Promise.resolve().then((function(){return Op})),Promise.resolve().then((function(){return Ap})),Promise.resolve().then((function(){return Np})),Promise.resolve().then((function(){return Dp})),Promise.resolve().then((function(){return Lp})),Promise.resolve().then((function(){return Hp})),Promise.resolve().then((function(){return Gp})),Promise.resolve().then((function(){return Up})),Promise.resolve().then((function(){return Wp})),Promise.resolve().then((function(){return Kp})),Promise.resolve().then((function(){return $p})),Promise.resolve().then((function(){return sh})),Promise.resolve().then((function(){return ih})),Promise.resolve().then((function(){return ah})),Promise.resolve().then((function(){return lh})),Promise.resolve().then((function(){return ch})),Promise.resolve().then((function(){return dh})),Promise.resolve().then((function(){return ph})),Promise.resolve().then((function(){return gh})),Promise.resolve().then((function(){return vh})),Promise.resolve().then((function(){return yh}))]).then((e=>{e.forEach((e=>{let t=Object.keys(e)[0];pu[t]=e[t]})),hu=!0}));const vu=[0,1,0,0],xu=[79,84,84,79],yu=[119,79,70,70],bu=[119,79,70,50];function wu(e,t){if(e.length===t.length){for(let s=0;s{globalThis.document&&!this.options.skipStyleSheet&&await gu(this.name,e,this.options),this.loadFont(e)})()}async loadFont(e,t){fetch(e).then((e=>function(e){if(!e.ok)throw new Error(`HTTP ${e.status} - ${e.statusText}`);return e}(e)&&e.arrayBuffer())).then((s=>this.fromDataBuffer(s,t||e))).catch((s=>{const n=new Kc("error",s,`Failed to load font at ${t||e}`);this.dispatch(n),this.onerror&&this.onerror(n)}))}async fromDataBuffer(e,t){this.fontData=new DataView(e);let s=function(e){const t=[e.getUint8(0),e.getUint8(1),e.getUint8(2),e.getUint8(3)];return wu(t,vu)||wu(t,xu)?"SFNT":wu(t,yu)?"WOFF":wu(t,bu)?"WOFF2":void 0}(this.fontData);if(!s)throw new Error(`${t} is either an unsupported font format, or not a font at all.`);await this.parseBasicData(s);const n=new Kc("load",{font:this});this.dispatch(n),this.onload&&this.onload(n)}async parseBasicData(e){return mu().then((t=>("SFNT"===e&&(this.opentype=new tu(this,this.fontData,t)),"WOFF"===e&&(this.opentype=new ru(this,this.fontData,t)),"WOFF2"===e&&(this.opentype=new uu(this,this.fontData,t)),this.opentype)))}getGlyphId(e){return this.opentype.tables.cmap.getGlyphId(e)}reverse(e){return this.opentype.tables.cmap.reverse(e)}supports(e){return 0!==this.getGlyphId(e)}supportsVariation(e){return!1!==this.opentype.tables.cmap.supportsVariation(e)}measureText(e,t=16){if(this.__unloaded)throw new Error("Cannot measure text: font was unloaded. Please reload before calling measureText()");let s=document.createElement("div");s.textContent=e,s.style.fontFamily=this.name,s.style.fontSize=`${t}px`,s.style.color="transparent",s.style.background="transparent",s.style.top="0",s.style.left="0",s.style.position="absolute",document.body.appendChild(s);let n=s.getBoundingClientRect();document.body.removeChild(s);const i=this.opentype.tables["OS/2"];return n.fontSize=t,n.ascender=i.sTypoAscender,n.descender=i.sTypoDescender,n}unload(){if(this.styleElement.parentNode){this.styleElement.parentNode.removeElement(this.styleElement);const e=new Kc("unload",{font:this});this.dispatch(e),this.onunload&&this.onunload(e)}this._unloaded=!0}load(){if(this.__unloaded){delete this.__unloaded,document.head.appendChild(this.styleElement);const e=new Kc("load",{font:this});this.dispatch(e),this.onload&&this.onload(e)}}}globalThis.Font=_u;class Su extends Qc{constructor(e,t,s){super(e),this.plaformID=t,this.encodingID=s}}class ju extends Su{constructor(e,t,s){super(e,t,s),this.format=0,this.length=e.uint16,this.language=e.uint16,this.glyphIdArray=[...new Array(256)].map((t=>e.uint8))}supports(e){return e.charCodeAt&&(e=-1,console.warn("supports(character) not implemented for cmap subtable format 0. only supports(id) is implemented.")),0<=e&&e<=255}reverse(e){return console.warn("reverse not implemented for cmap subtable format 0"),{}}getSupportedCharCodes(){return[{start:1,end:256}]}}class Cu extends Su{constructor(e,t,s){super(e,t,s),this.format=2,this.length=e.uint16,this.language=e.uint16,this.subHeaderKeys=[...new Array(256)].map((t=>e.uint16));const n=Math.max(...this.subHeaderKeys),i=e.currentPosition;eu(this,"subHeaders",(()=>(e.currentPosition=i,[...new Array(n)].map((t=>new ku(e))))));const r=i+8*n;eu(this,"glyphIndexArray",(()=>(e.currentPosition=r,[...new Array(n)].map((t=>e.uint16)))))}supports(e){e.charCodeAt&&(e=-1,console.warn("supports(character) not implemented for cmap subtable format 2. only supports(id) is implemented."));const t=e&&255,s=e&&65280,n=this.subHeaders[s],i=this.subHeaders[n],r=i.firstCode,o=r+i.entryCount;return r<=t&&t<=o}reverse(e){return console.warn("reverse not implemented for cmap subtable format 2"),{}}getSupportedCharCodes(e=!1){return e?this.subHeaders.map((e=>({firstCode:e.firstCode,lastCode:e.lastCode}))):this.subHeaders.map((e=>({start:e.firstCode,end:e.lastCode})))}}class ku{constructor(e){this.firstCode=e.uint16,this.entryCount=e.uint16,this.lastCode=this.first+this.entryCount,this.idDelta=e.int16,this.idRangeOffset=e.uint16}}class Eu extends Su{constructor(e,t,s){super(e,t,s),this.format=4,this.length=e.uint16,this.language=e.uint16,this.segCountX2=e.uint16,this.segCount=this.segCountX2/2,this.searchRange=e.uint16,this.entrySelector=e.uint16,this.rangeShift=e.uint16;const n=e.currentPosition;eu(this,"endCode",(()=>e.readBytes(this.segCount,n,16)));const i=n+2+this.segCountX2;eu(this,"startCode",(()=>e.readBytes(this.segCount,i,16)));const r=i+this.segCountX2;eu(this,"idDelta",(()=>e.readBytes(this.segCount,r,16,!0)));const o=r+this.segCountX2;eu(this,"idRangeOffset",(()=>e.readBytes(this.segCount,o,16)));const a=o+this.segCountX2,l=this.length-(a-this.tableStart);eu(this,"glyphIdArray",(()=>e.readBytes(l,a,16))),eu(this,"segments",(()=>this.buildSegments(o,a,e)))}buildSegments(e,t,s){return[...new Array(this.segCount)].map(((t,n)=>{let i=this.startCode[n],r=this.endCode[n],o=this.idDelta[n],a=this.idRangeOffset[n],l=e+2*n,c=[];if(0===a)for(let e=i+o,t=r+o;e<=t;e++)c.push(e);else for(let e=0,t=r-i;e<=t;e++)s.currentPosition=l+a+2*e,c.push(s.uint16);return{startCode:i,endCode:r,idDelta:o,idRangeOffset:a,glyphIDs:c}}))}reverse(e){let t=this.segments.find((t=>t.glyphIDs.includes(e)));if(!t)return{};const s=t.startCode+t.glyphIDs.indexOf(e);return{code:s,unicode:String.fromCodePoint(s)}}getGlyphId(e){if(e.charCodeAt&&(e=e.charCodeAt(0)),55296<=e&&e<=57343)return 0;if(!(65534&~e&&65535&~e))return 0;let t=this.segments.find((t=>t.startCode<=e&&e<=t.endCode));return t?t.glyphIDs[e-t.startCode]:0}supports(e){return 0!==this.getGlyphId(e)}getSupportedCharCodes(e=!1){return e?this.segments:this.segments.map((e=>({start:e.startCode,end:e.endCode})))}}class Pu extends Su{constructor(e,t,s){super(e,t,s),this.format=6,this.length=e.uint16,this.language=e.uint16,this.firstCode=e.uint16,this.entryCount=e.uint16,this.lastCode=this.firstCode+this.entryCount-1;eu(this,"glyphIdArray",(()=>[...new Array(this.entryCount)].map((t=>e.uint16))))}supports(e){if(e.charCodeAt&&(e=-1,console.warn("supports(character) not implemented for cmap subtable format 6. only supports(id) is implemented.")),ethis.firstCode+this.entryCount)return{};const t=e-this.firstCode;return{code:t,unicode:String.fromCodePoint(t)}}reverse(e){let t=this.glyphIdArray.indexOf(e);if(t>-1)return this.firstCode+t}getSupportedCharCodes(e=!1){return e?[{firstCode:this.firstCode,lastCode:this.lastCode}]:[{start:this.firstCode,end:this.lastCode}]}}class Iu extends Su{constructor(e,t,s){super(e,t,s),this.format=8,e.uint16,this.length=e.uint32,this.language=e.uint32,this.is32=[...new Array(8192)].map((t=>e.uint8)),this.numGroups=e.uint32;eu(this,"groups",(()=>[...new Array(this.numGroups)].map((t=>new Tu(e)))))}supports(e){return e.charCodeAt&&(e=-1,console.warn("supports(character) not implemented for cmap subtable format 8. only supports(id) is implemented.")),-1!==this.groups.findIndex((t=>t.startcharCode<=e&&e<=t.endcharCode))}reverse(e){return console.warn("reverse not implemented for cmap subtable format 8"),{}}getSupportedCharCodes(e=!1){return e?this.groups:this.groups.map((e=>({start:e.startcharCode,end:e.endcharCode})))}}class Tu{constructor(e){this.startcharCode=e.uint32,this.endcharCode=e.uint32,this.startGlyphID=e.uint32}}class Ou extends Su{constructor(e,t,s){super(e,t,s),this.format=10,e.uint16,this.length=e.uint32,this.language=e.uint32,this.startCharCode=e.uint32,this.numChars=e.uint32,this.endCharCode=this.startCharCode+this.numChars;eu(this,"glyphs",(()=>[...new Array(this.numChars)].map((t=>e.uint16))))}supports(e){return e.charCodeAt&&(e=-1,console.warn("supports(character) not implemented for cmap subtable format 10. only supports(id) is implemented.")),!(ethis.startCharCode+this.numChars)&&e-this.startCharCode)}reverse(e){return console.warn("reverse not implemented for cmap subtable format 10"),{}}getSupportedCharCodes(e=!1){return e?[{startCharCode:this.startCharCode,endCharCode:this.endCharCode}]:[{start:this.startCharCode,end:this.endCharCode}]}}class Au extends Su{constructor(e,t,s){super(e,t,s),this.format=12,e.uint16,this.length=e.uint32,this.language=e.uint32,this.numGroups=e.uint32;eu(this,"groups",(()=>[...new Array(this.numGroups)].map((t=>new Mu(e)))))}supports(e){return e.charCodeAt&&(e=e.charCodeAt(0)),55296<=e&&e<=57343?0:65534&~e&&65535&~e?-1!==this.groups.findIndex((t=>t.startCharCode<=e&&e<=t.endCharCode)):0}reverse(e){for(let t of this.groups){let s=t.startGlyphID;if(s>e)continue;if(s===e)return t.startCharCode;if(s+(t.endCharCode-t.startCharCode)({start:e.startCharCode,end:e.endCharCode})))}}class Mu{constructor(e){this.startCharCode=e.uint32,this.endCharCode=e.uint32,this.startGlyphID=e.uint32}}class Nu extends Su{constructor(e,t,s){super(e,t,s),this.format=13,e.uint16,this.length=e.uint32,this.language=e.uint32,this.numGroups=e.uint32;eu(this,"groups",[...new Array(this.numGroups)].map((t=>new Vu(e))))}supports(e){return e.charCodeAt&&(e=e.charCodeAt(0)),-1!==this.groups.findIndex((t=>t.startCharCode<=e&&e<=t.endCharCode))}reverse(e){return console.warn("reverse not implemented for cmap subtable format 13"),{}}getSupportedCharCodes(e=!1){return e?this.groups:this.groups.map((e=>({start:e.startCharCode,end:e.endCharCode})))}}class Vu{constructor(e){this.startCharCode=e.uint32,this.endCharCode=e.uint32,this.glyphID=e.uint32}}class Fu extends Su{constructor(e,t,s){super(e,t,s),this.subTableStart=e.currentPosition,this.format=14,this.length=e.uint32,this.numVarSelectorRecords=e.uint32,eu(this,"varSelectors",(()=>[...new Array(this.numVarSelectorRecords)].map((t=>new Ru(e)))))}supports(){return console.warn("supports not implemented for cmap subtable format 14"),0}getSupportedCharCodes(){return console.warn("getSupportedCharCodes not implemented for cmap subtable format 14"),[]}reverse(e){return console.warn("reverse not implemented for cmap subtable format 14"),{}}supportsVariation(e){let t=this.varSelector.find((t=>t.varSelector===e));return t||!1}getSupportedVariations(){return this.varSelectors.map((e=>e.varSelector))}}class Ru{constructor(e){this.varSelector=e.uint24,this.defaultUVSOffset=e.Offset32,this.nonDefaultUVSOffset=e.Offset32}}class Bu{constructor(e,t){const s=this.platformID=e.uint16,n=this.encodingID=e.uint16,i=this.offset=e.Offset32;eu(this,"table",(()=>(e.currentPosition=t+i,function(e,t,s){const n=e.uint16;return 0===n?new ju(e,t,s):2===n?new Cu(e,t,s):4===n?new Eu(e,t,s):6===n?new Pu(e,t,s):8===n?new Iu(e,t,s):10===n?new Ou(e,t,s):12===n?new Au(e,t,s):13===n?new Nu(e,t,s):14===n?new Fu(e,t,s):{}}(e,s,n))))}}var Du=Object.freeze({__proto__:null,cmap:class extends $c{constructor(e,t){const{p:s}=super(e,t);this.version=s.uint16,this.numTables=s.uint16,this.encodingRecords=[...new Array(this.numTables)].map((e=>new Bu(s,this.tableStart)))}getSubTable(e){return this.encodingRecords[e].table}getSupportedEncodings(){return this.encodingRecords.map((e=>({platformID:e.platformID,encodingId:e.encodingID})))}getSupportedCharCodes(e,t){const s=this.encodingRecords.findIndex((s=>s.platformID===e&&s.encodingID===t));if(-1===s)return!1;return this.getSubTable(s).getSupportedCharCodes()}reverse(e){for(let t=0;t{let i=this.getSubTable(n);return!!i.getGlyphId&&(t=i.getGlyphId(e),0!==t)})),t}supports(e){return this.encodingRecords.some(((t,s)=>{const n=this.getSubTable(s);return n.supports&&!1!==n.supports(e)}))}supportsVariation(e){return this.encodingRecords.some(((t,s)=>{const n=this.getSubTable(s);return n.supportsVariation&&!1!==n.supportsVariation(e)}))}}});var zu=Object.freeze({__proto__:null,head:class extends $c{constructor(e,t){const{p:s}=super(e,t);this.load({majorVersion:s.uint16,minorVersion:s.uint16,fontRevision:s.fixed,checkSumAdjustment:s.uint32,magicNumber:s.uint32,flags:s.flags(16),unitsPerEm:s.uint16,created:s.longdatetime,modified:s.longdatetime,xMin:s.int16,yMin:s.int16,xMax:s.int16,yMax:s.int16,macStyle:s.flags(16),lowestRecPPEM:s.uint16,fontDirectionHint:s.uint16,indexToLocFormat:s.uint16,glyphDataFormat:s.uint16})}}});var Lu=Object.freeze({__proto__:null,hhea:class extends $c{constructor(e,t){const{p:s}=super(e,t);this.majorVersion=s.uint16,this.minorVersion=s.uint16,this.ascender=s.fword,this.descender=s.fword,this.lineGap=s.fword,this.advanceWidthMax=s.ufword,this.minLeftSideBearing=s.fword,this.minRightSideBearing=s.fword,this.xMaxExtent=s.fword,this.caretSlopeRise=s.int16,this.caretSlopeRun=s.int16,this.caretOffset=s.int16,s.int16,s.int16,s.int16,s.int16,this.metricDataFormat=s.int16,this.numberOfHMetrics=s.uint16,s.verifyLength()}}});class Hu{constructor(e,t){this.advanceWidth=e,this.lsb=t}}var Gu=Object.freeze({__proto__:null,hmtx:class extends $c{constructor(e,t,s){const{p:n}=super(e,t),i=s.hhea.numberOfHMetrics,r=s.maxp.numGlyphs,o=n.currentPosition;if(eu(this,"hMetrics",(()=>(n.currentPosition=o,[...new Array(i)].map((e=>new Hu(n.uint16,n.int16)))))),i(n.currentPosition=e,[...new Array(r-i)].map((e=>n.int16)))))}}}});var Uu=Object.freeze({__proto__:null,maxp:class extends $c{constructor(e,t){const{p:s}=super(e,t);this.version=s.legacyFixed,this.numGlyphs=s.uint16,1===this.version&&(this.maxPoints=s.uint16,this.maxContours=s.uint16,this.maxCompositePoints=s.uint16,this.maxCompositeContours=s.uint16,this.maxZones=s.uint16,this.maxTwilightPoints=s.uint16,this.maxStorage=s.uint16,this.maxFunctionDefs=s.uint16,this.maxInstructionDefs=s.uint16,this.maxStackElements=s.uint16,this.maxSizeOfInstructions=s.uint16,this.maxComponentElements=s.uint16,this.maxComponentDepth=s.uint16),s.verifyLength()}}});class Wu{constructor(e,t){this.length=e,this.offset=t}}class qu{constructor(e,t){this.platformID=e.uint16,this.encodingID=e.uint16,this.languageID=e.uint16,this.nameID=e.uint16,this.length=e.uint16,this.offset=e.Offset16,eu(this,"string",(()=>(e.currentPosition=t.stringStart+this.offset,function(e,t){const{platformID:s,length:n}=t;if(0===n)return"";if(0===s||3===s){const t=[];for(let s=0,i=n/2;snew qu(s,this))),1===this.format&&(this.langTagCount=s.uint16,this.langTagRecords=[...new Array(this.langTagCount)].map((e=>new Wu(s.uint16,s.Offset16)))),this.stringStart=this.tableStart+this.stringOffset}get(e){let t=this.nameRecords.find((t=>t.nameID===e));if(t)return t.string}}});var Ku=Object.freeze({__proto__:null,OS2:class extends $c{constructor(e,t){const{p:s}=super(e,t);return this.version=s.uint16,this.xAvgCharWidth=s.int16,this.usWeightClass=s.uint16,this.usWidthClass=s.uint16,this.fsType=s.uint16,this.ySubscriptXSize=s.int16,this.ySubscriptYSize=s.int16,this.ySubscriptXOffset=s.int16,this.ySubscriptYOffset=s.int16,this.ySuperscriptXSize=s.int16,this.ySuperscriptYSize=s.int16,this.ySuperscriptXOffset=s.int16,this.ySuperscriptYOffset=s.int16,this.yStrikeoutSize=s.int16,this.yStrikeoutPosition=s.int16,this.sFamilyClass=s.int16,this.panose=[...new Array(10)].map((e=>s.uint8)),this.ulUnicodeRange1=s.flags(32),this.ulUnicodeRange2=s.flags(32),this.ulUnicodeRange3=s.flags(32),this.ulUnicodeRange4=s.flags(32),this.achVendID=s.tag,this.fsSelection=s.uint16,this.usFirstCharIndex=s.uint16,this.usLastCharIndex=s.uint16,this.sTypoAscender=s.int16,this.sTypoDescender=s.int16,this.sTypoLineGap=s.int16,this.usWinAscent=s.uint16,this.usWinDescent=s.uint16,0===this.version?s.verifyLength():(this.ulCodePageRange1=s.flags(32),this.ulCodePageRange2=s.flags(32),1===this.version?s.verifyLength():(this.sxHeight=s.int16,this.sCapHeight=s.int16,this.usDefaultChar=s.uint16,this.usBreakChar=s.uint16,this.usMaxContext=s.uint16,this.version<=4?s.verifyLength():(this.usLowerOpticalPointSize=s.uint16,this.usUpperOpticalPointSize=s.uint16,5===this.version?s.verifyLength():void 0)))}}});const Yu=[".notdef",".null","nonmarkingreturn","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quotesingle","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","grave","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","Adieresis","Aring","Ccedilla","Eacute","Ntilde","Odieresis","Udieresis","aacute","agrave","acircumflex","adieresis","atilde","aring","ccedilla","eacute","egrave","ecircumflex","edieresis","iacute","igrave","icircumflex","idieresis","ntilde","oacute","ograve","ocircumflex","odieresis","otilde","uacute","ugrave","ucircumflex","udieresis","dagger","degree","cent","sterling","section","bullet","paragraph","germandbls","registered","copyright","trademark","acute","dieresis","notequal","AE","Oslash","infinity","plusminus","lessequal","greaterequal","yen","mu","partialdiff","summation","product","pi","integral","ordfeminine","ordmasculine","Omega","ae","oslash","questiondown","exclamdown","logicalnot","radical","florin","approxequal","Delta","guillemotleft","guillemotright","ellipsis","nonbreakingspace","Agrave","Atilde","Otilde","OE","oe","endash","emdash","quotedblleft","quotedblright","quoteleft","quoteright","divide","lozenge","ydieresis","Ydieresis","fraction","currency","guilsinglleft","guilsinglright","fi","fl","daggerdbl","periodcentered","quotesinglbase","quotedblbase","perthousand","Acircumflex","Ecircumflex","Aacute","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Oacute","Ocircumflex","apple","Ograve","Uacute","Ucircumflex","Ugrave","dotlessi","circumflex","tilde","macron","breve","dotaccent","ring","cedilla","hungarumlaut","ogonek","caron","Lslash","lslash","Scaron","scaron","Zcaron","zcaron","brokenbar","Eth","eth","Yacute","yacute","Thorn","thorn","minus","multiply","onesuperior","twosuperior","threesuperior","onehalf","onequarter","threequarters","franc","Gbreve","gbreve","Idotaccent","Scedilla","scedilla","Cacute","cacute","Ccaron","ccaron","dcroat"];var Xu=Object.freeze({__proto__:null,post:class extends $c{constructor(e,t){const{p:s}=super(e,t);if(this.version=s.legacyFixed,this.italicAngle=s.fixed,this.underlinePosition=s.fword,this.underlineThickness=s.fword,this.isFixedPitch=s.uint32,this.minMemType42=s.uint32,this.maxMemType42=s.uint32,this.minMemType1=s.uint32,this.maxMemType1=s.uint32,1===this.version||3===this.version)return s.verifyLength();if(this.numGlyphs=s.uint16,2===this.version){this.glyphNameIndex=[...new Array(this.numGlyphs)].map((e=>s.uint16)),this.namesOffset=s.currentPosition,this.glyphNameOffsets=[1];for(let e=0;es.int8)))}getGlyphName(e){if(2!==this.version)return console.warn(`post table version ${this.version} does not support glyph name lookups`),"";let t=this.glyphNameIndex[e];if(t<258)return Yu[t];let s=this.glyphNameOffsets[e],n=this.glyphNameOffsets[e+1]-s-1;if(0===n)return".notdef.";this.parser.currentPosition=this.namesOffset+s;return this.parser.readBytes(n,this.namesOffset+s,8,!0).map((e=>String.fromCharCode(e))).join("")}}});class Ju extends $c{constructor(e,t){const{p:s}=super(e,t,"AxisTable");this.baseTagListOffset=s.Offset16,this.baseScriptListOffset=s.Offset16,eu(this,"baseTagList",(()=>new Qu({offset:e.offset+this.baseTagListOffset},t))),eu(this,"baseScriptList",(()=>new $u({offset:e.offset+this.baseScriptListOffset},t)))}}class Qu extends $c{constructor(e,t){const{p:s}=super(e,t,"BaseTagListTable");this.baseTagCount=s.uint16,this.baselineTags=[...new Array(this.baseTagCount)].map((e=>s.tag))}}class $u extends $c{constructor(e,t){const{p:s}=super(e,t,"BaseScriptListTable");this.baseScriptCount=s.uint16;const n=s.currentPosition;eu(this,"baseScriptRecords",(()=>(s.currentPosition=n,[...new Array(this.baseScriptCount)].map((e=>new ed(this.start,s))))))}}class ed{constructor(e,t){this.baseScriptTag=t.tag,this.baseScriptOffset=t.Offset16,eu(this,"baseScriptTable",(()=>(t.currentPosition=e+this.baseScriptOffset,new td(t))))}}class td{constructor(e){this.start=e.currentPosition,this.baseValuesOffset=e.Offset16,this.defaultMinMaxOffset=e.Offset16,this.baseLangSysCount=e.uint16,this.baseLangSysRecords=[...new Array(this.baseLangSysCount)].map((t=>new sd(this.start,e))),eu(this,"baseValues",(()=>(e.currentPosition=this.start+this.baseValuesOffset,new nd(e)))),eu(this,"defaultMinMax",(()=>(e.currentPosition=this.start+this.defaultMinMaxOffset,new id(e))))}}class sd{constructor(e,t){this.baseLangSysTag=t.tag,this.minMaxOffset=t.Offset16,eu(this,"minMax",(()=>(t.currentPosition=e+this.minMaxOffset,new id(t))))}}class nd{constructor(e){this.parser=e,this.start=e.currentPosition,this.defaultBaselineIndex=e.uint16,this.baseCoordCount=e.uint16,this.baseCoords=[...new Array(this.baseCoordCount)].map((t=>e.Offset16))}getTable(e){return this.parser.currentPosition=this.start+this.baseCoords[e],new od(this.parser)}}class id{constructor(e){this.minCoord=e.Offset16,this.maxCoord=e.Offset16,this.featMinMaxCount=e.uint16;const t=e.currentPosition;eu(this,"featMinMaxRecords",(()=>(e.currentPosition=t,[...new Array(this.featMinMaxCount)].map((t=>new rd(e))))))}}class rd{constructor(e){this.featureTableTag=e.tag,this.minCoord=e.Offset16,this.maxCoord=e.Offset16}}class od{constructor(e){this.baseCoordFormat=e.uint16,this.coordinate=e.int16,2===this.baseCoordFormat&&(this.referenceGlyph=e.uint16,this.baseCoordPoint=e.uint16),3===this.baseCoordFormat&&(this.deviceTable=e.Offset16)}}var ad=Object.freeze({__proto__:null,BASE:class extends $c{constructor(e,t){const{p:s}=super(e,t);this.majorVersion=s.uint16,this.minorVersion=s.uint16,this.horizAxisOffset=s.Offset16,this.vertAxisOffset=s.Offset16,eu(this,"horizAxis",(()=>new Ju({offset:e.offset+this.horizAxisOffset},t))),eu(this,"vertAxis",(()=>new Ju({offset:e.offset+this.vertAxisOffset},t))),1===this.majorVersion&&1===this.minorVersion&&(this.itemVarStoreOffset=s.Offset32,eu(this,"itemVarStore",(()=>new Ju({offset:e.offset+this.itemVarStoreOffset},t))))}}});class ld{constructor(e){this.classFormat=e.uint16,1===this.classFormat&&(this.startGlyphID=e.uint16,this.glyphCount=e.uint16,this.classValueArray=[...new Array(this.glyphCount)].map((t=>e.uint16))),2===this.classFormat&&(this.classRangeCount=e.uint16,this.classRangeRecords=[...new Array(this.classRangeCount)].map((t=>new cd(e))))}}class cd{constructor(e){this.startGlyphID=e.uint16,this.endGlyphID=e.uint16,this.class=e.uint16}}class ud extends Qc{constructor(e){super(e),this.coverageFormat=e.uint16,1===this.coverageFormat&&(this.glyphCount=e.uint16,this.glyphArray=[...new Array(this.glyphCount)].map((t=>e.uint16))),2===this.coverageFormat&&(this.rangeCount=e.uint16,this.rangeRecords=[...new Array(this.rangeCount)].map((t=>new dd(e))))}}class dd{constructor(e){this.startGlyphID=e.uint16,this.endGlyphID=e.uint16,this.startCoverageIndex=e.uint16}}class pd{constructor(e,t){this.table=e,this.parser=t,this.start=t.currentPosition,this.format=t.uint16,this.variationRegionListOffset=t.Offset32,this.itemVariationDataCount=t.uint16,this.itemVariationDataOffsets=[...new Array(this.itemVariationDataCount)].map((e=>t.Offset32))}}class hd extends Qc{constructor(e){super(e),this.coverageOffset=e.Offset16,this.glyphCount=e.uint16,this.attachPointOffsets=[...new Array(this.glyphCount)].map((t=>e.Offset16))}getPoint(e){return this.parser.currentPosition=this.start+this.attachPointOffsets[e],new fd(this.parser)}}class fd{constructor(e){this.pointCount=e.uint16,this.pointIndices=[...new Array(this.pointCount)].map((t=>e.uint16))}}class md extends Qc{constructor(e){super(e),this.coverageOffset=e.Offset16,eu(this,"coverage",(()=>(e.currentPosition=this.start+this.coverageOffset,new ud(e)))),this.ligGlyphCount=e.uint16,this.ligGlyphOffsets=[...new Array(this.ligGlyphCount)].map((t=>e.Offset16))}getLigGlyph(e){return this.parser.currentPosition=this.start+this.ligGlyphOffsets[e],new gd(this.parser)}}class gd extends Qc{constructor(e){super(e),this.caretCount=e.uint16,this.caretValueOffsets=[...new Array(this.caretCount)].map((t=>e.Offset16))}getCaretValue(e){return this.parser.currentPosition=this.start+this.caretValueOffsets[e],new vd(this.parser)}}class vd{constructor(e){this.caretValueFormat=e.uint16,1===this.caretValueFormat&&(this.coordinate=e.int16),2===this.caretValueFormat&&(this.caretValuePointIndex=e.uint16),3===this.caretValueFormat&&(this.coordinate=e.int16,this.deviceOffset=e.Offset16)}}class xd extends Qc{constructor(e){super(e),this.markGlyphSetTableFormat=e.uint16,this.markGlyphSetCount=e.uint16,this.coverageOffsets=[...new Array(this.markGlyphSetCount)].map((t=>e.Offset32))}getMarkGlyphSet(e){return this.parser.currentPosition=this.start+this.coverageOffsets[e],new ud(this.parser)}}var yd=Object.freeze({__proto__:null,GDEF:class extends $c{constructor(e,t){const{p:s}=super(e,t);this.majorVersion=s.uint16,this.minorVersion=s.uint16,this.glyphClassDefOffset=s.Offset16,eu(this,"glyphClassDefs",(()=>{if(0!==this.glyphClassDefOffset)return s.currentPosition=this.tableStart+this.glyphClassDefOffset,new ld(s)})),this.attachListOffset=s.Offset16,eu(this,"attachList",(()=>{if(0!==this.attachListOffset)return s.currentPosition=this.tableStart+this.attachListOffset,new hd(s)})),this.ligCaretListOffset=s.Offset16,eu(this,"ligCaretList",(()=>{if(0!==this.ligCaretListOffset)return s.currentPosition=this.tableStart+this.ligCaretListOffset,new md(s)})),this.markAttachClassDefOffset=s.Offset16,eu(this,"markAttachClassDef",(()=>{if(0!==this.markAttachClassDefOffset)return s.currentPosition=this.tableStart+this.markAttachClassDefOffset,new ld(s)})),this.minorVersion>=2&&(this.markGlyphSetsDefOffset=s.Offset16,eu(this,"markGlyphSetsDef",(()=>{if(0!==this.markGlyphSetsDefOffset)return s.currentPosition=this.tableStart+this.markGlyphSetsDefOffset,new xd(s)}))),3===this.minorVersion&&(this.itemVarStoreOffset=s.Offset32,eu(this,"itemVarStore",(()=>{if(0!==this.itemVarStoreOffset)return s.currentPosition=this.tableStart+this.itemVarStoreOffset,new pd(s)})))}}});class bd extends Qc{static EMPTY={scriptCount:0,scriptRecords:[]};constructor(e){super(e),this.scriptCount=e.uint16,this.scriptRecords=[...new Array(this.scriptCount)].map((t=>new wd(e)))}}class wd{constructor(e){this.scriptTag=e.tag,this.scriptOffset=e.Offset16}}class _d extends Qc{constructor(e){super(e),this.defaultLangSys=e.Offset16,this.langSysCount=e.uint16,this.langSysRecords=[...new Array(this.langSysCount)].map((t=>new Sd(e)))}}class Sd{constructor(e){this.langSysTag=e.tag,this.langSysOffset=e.Offset16}}class jd{constructor(e){this.lookupOrder=e.Offset16,this.requiredFeatureIndex=e.uint16,this.featureIndexCount=e.uint16,this.featureIndices=[...new Array(this.featureIndexCount)].map((t=>e.uint16))}}class Cd extends Qc{static EMPTY={featureCount:0,featureRecords:[]};constructor(e){super(e),this.featureCount=e.uint16,this.featureRecords=[...new Array(this.featureCount)].map((t=>new kd(e)))}}class kd{constructor(e){this.featureTag=e.tag,this.featureOffset=e.Offset16}}class Ed extends Qc{constructor(e){super(e),this.featureParams=e.Offset16,this.lookupIndexCount=e.uint16,this.lookupListIndices=[...new Array(this.lookupIndexCount)].map((t=>e.uint16))}getFeatureParams(){if(this.featureParams>0){const e=this.parser;e.currentPosition=this.start+this.featureParams;const t=this.featureTag;if("size"===t)return new Id(e);if(t.startsWith("cc"))return new Pd(e);if(t.startsWith("ss"))return new Td(e)}}}class Pd{constructor(e){this.format=e.uint16,this.featUiLabelNameId=e.uint16,this.featUiTooltipTextNameId=e.uint16,this.sampleTextNameId=e.uint16,this.numNamedParameters=e.uint16,this.firstParamUiLabelNameId=e.uint16,this.charCount=e.uint16,this.character=[...new Array(this.charCount)].map((t=>e.uint24))}}class Id{constructor(e){this.designSize=e.uint16,this.subfamilyIdentifier=e.uint16,this.subfamilyNameID=e.uint16,this.smallEnd=e.uint16,this.largeEnd=e.uint16}}class Td{constructor(e){this.version=e.uint16,this.UINameID=e.uint16}}function Od(e){e.parser.currentPosition-=2,delete e.coverageOffset,delete e.getCoverageTable}class Ad extends Qc{constructor(e){super(e),this.substFormat=e.uint16,this.coverageOffset=e.Offset16}getCoverageTable(){let e=this.parser;return e.currentPosition=this.start+this.coverageOffset,new ud(e)}}class Md{constructor(e){this.glyphSequenceIndex=e.uint16,this.lookupListIndex=e.uint16}}class Nd extends Ad{constructor(e){super(e),this.deltaGlyphID=e.int16}}class Vd extends Ad{constructor(e){super(e),this.sequenceCount=e.uint16,this.sequenceOffsets=[...new Array(this.sequenceCount)].map((t=>e.Offset16))}getSequence(e){let t=this.parser;return t.currentPosition=this.start+this.sequenceOffsets[e],new Fd(t)}}class Fd{constructor(e){this.glyphCount=e.uint16,this.substituteGlyphIDs=[...new Array(this.glyphCount)].map((t=>e.uint16))}}class Rd extends Ad{constructor(e){super(e),this.alternateSetCount=e.uint16,this.alternateSetOffsets=[...new Array(this.alternateSetCount)].map((t=>e.Offset16))}getAlternateSet(e){let t=this.parser;return t.currentPosition=this.start+this.alternateSetOffsets[e],new Bd(t)}}class Bd{constructor(e){this.glyphCount=e.uint16,this.alternateGlyphIDs=[...new Array(this.glyphCount)].map((t=>e.uint16))}}class Dd extends Ad{constructor(e){super(e),this.ligatureSetCount=e.uint16,this.ligatureSetOffsets=[...new Array(this.ligatureSetCount)].map((t=>e.Offset16))}getLigatureSet(e){let t=this.parser;return t.currentPosition=this.start+this.ligatureSetOffsets[e],new zd(t)}}class zd extends Qc{constructor(e){super(e),this.ligatureCount=e.uint16,this.ligatureOffsets=[...new Array(this.ligatureCount)].map((t=>e.Offset16))}getLigature(e){let t=this.parser;return t.currentPosition=this.start+this.ligatureOffsets[e],new Ld(t)}}class Ld{constructor(e){this.ligatureGlyph=e.uint16,this.componentCount=e.uint16,this.componentGlyphIDs=[...new Array(this.componentCount-1)].map((t=>e.uint16))}}class Hd extends Ad{constructor(e){super(e),1===this.substFormat&&(this.subRuleSetCount=e.uint16,this.subRuleSetOffsets=[...new Array(this.subRuleSetCount)].map((t=>e.Offset16))),2===this.substFormat&&(this.classDefOffset=e.Offset16,this.subClassSetCount=e.uint16,this.subClassSetOffsets=[...new Array(this.subClassSetCount)].map((t=>e.Offset16))),3===this.substFormat&&(Od(this),this.glyphCount=e.uint16,this.substitutionCount=e.uint16,this.coverageOffsets=[...new Array(this.glyphCount)].map((t=>e.Offset16)),this.substLookupRecords=[...new Array(this.substitutionCount)].map((t=>new Md(e))))}getSubRuleSet(e){if(1!==this.substFormat)throw new Error(`lookup type 5.${this.substFormat} has no subrule sets.`);let t=this.parser;return t.currentPosition=this.start+this.subRuleSetOffsets[e],new Gd(t)}getSubClassSet(e){if(2!==this.substFormat)throw new Error(`lookup type 5.${this.substFormat} has no subclass sets.`);let t=this.parser;return t.currentPosition=this.start+this.subClassSetOffsets[e],new Wd(t)}getCoverageTable(e){if(3!==this.substFormat&&!e)return super.getCoverageTable();if(!e)throw new Error(`lookup type 5.${this.substFormat} requires an coverage table index.`);let t=this.parser;return t.currentPosition=this.start+this.coverageOffsets[e],new ud(t)}}class Gd extends Qc{constructor(e){super(e),this.subRuleCount=e.uint16,this.subRuleOffsets=[...new Array(this.subRuleCount)].map((t=>e.Offset16))}getSubRule(e){let t=this.parser;return t.currentPosition=this.start+this.subRuleOffsets[e],new Ud(t)}}class Ud{constructor(e){this.glyphCount=e.uint16,this.substitutionCount=e.uint16,this.inputSequence=[...new Array(this.glyphCount-1)].map((t=>e.uint16)),this.substLookupRecords=[...new Array(this.substitutionCount)].map((t=>new Md(e)))}}class Wd extends Qc{constructor(e){super(e),this.subClassRuleCount=e.uint16,this.subClassRuleOffsets=[...new Array(this.subClassRuleCount)].map((t=>e.Offset16))}getSubClass(e){let t=this.parser;return t.currentPosition=this.start+this.subClassRuleOffsets[e],new qd(t)}}class qd extends Ud{constructor(e){super(e)}}class Zd extends Ad{constructor(e){super(e),1===this.substFormat&&(this.chainSubRuleSetCount=e.uint16,this.chainSubRuleSetOffsets=[...new Array(this.chainSubRuleSetCount)].map((t=>e.Offset16))),2===this.substFormat&&(this.backtrackClassDefOffset=e.Offset16,this.inputClassDefOffset=e.Offset16,this.lookaheadClassDefOffset=e.Offset16,this.chainSubClassSetCount=e.uint16,this.chainSubClassSetOffsets=[...new Array(this.chainSubClassSetCount)].map((t=>e.Offset16))),3===this.substFormat&&(Od(this),this.backtrackGlyphCount=e.uint16,this.backtrackCoverageOffsets=[...new Array(this.backtrackGlyphCount)].map((t=>e.Offset16)),this.inputGlyphCount=e.uint16,this.inputCoverageOffsets=[...new Array(this.inputGlyphCount)].map((t=>e.Offset16)),this.lookaheadGlyphCount=e.uint16,this.lookaheadCoverageOffsets=[...new Array(this.lookaheadGlyphCount)].map((t=>e.Offset16)),this.seqLookupCount=e.uint16,this.seqLookupRecords=[...new Array(this.substitutionCount)].map((t=>new Qd(e))))}getChainSubRuleSet(e){if(1!==this.substFormat)throw new Error(`lookup type 6.${this.substFormat} has no chainsubrule sets.`);let t=this.parser;return t.currentPosition=this.start+this.chainSubRuleSetOffsets[e],new Kd(t)}getChainSubClassSet(e){if(2!==this.substFormat)throw new Error(`lookup type 6.${this.substFormat} has no chainsubclass sets.`);let t=this.parser;return t.currentPosition=this.start+this.chainSubClassSetOffsets[e],new Xd(t)}getCoverageFromOffset(e){if(3!==this.substFormat)throw new Error(`lookup type 6.${this.substFormat} does not use contextual coverage offsets.`);let t=this.parser;return t.currentPosition=this.start+e,new ud(t)}}class Kd extends Qc{constructor(e){super(e),this.chainSubRuleCount=e.uint16,this.chainSubRuleOffsets=[...new Array(this.chainSubRuleCount)].map((t=>e.Offset16))}getSubRule(e){let t=this.parser;return t.currentPosition=this.start+this.chainSubRuleOffsets[e],new Yd(t)}}class Yd{constructor(e){this.backtrackGlyphCount=e.uint16,this.backtrackSequence=[...new Array(this.backtrackGlyphCount)].map((t=>e.uint16)),this.inputGlyphCount=e.uint16,this.inputSequence=[...new Array(this.inputGlyphCount-1)].map((t=>e.uint16)),this.lookaheadGlyphCount=e.uint16,this.lookAheadSequence=[...new Array(this.lookAheadGlyphCount)].map((t=>e.uint16)),this.substitutionCount=e.uint16,this.substLookupRecords=[...new Array(this.SubstCount)].map((t=>new Md(e)))}}class Xd extends Qc{constructor(e){super(e),this.chainSubClassRuleCount=e.uint16,this.chainSubClassRuleOffsets=[...new Array(this.chainSubClassRuleCount)].map((t=>e.Offset16))}getSubClass(e){let t=this.parser;return t.currentPosition=this.start+this.chainSubRuleOffsets[e],new Jd(t)}}class Jd{constructor(e){this.backtrackGlyphCount=e.uint16,this.backtrackSequence=[...new Array(this.backtrackGlyphCount)].map((t=>e.uint16)),this.inputGlyphCount=e.uint16,this.inputSequence=[...new Array(this.inputGlyphCount-1)].map((t=>e.uint16)),this.lookaheadGlyphCount=e.uint16,this.lookAheadSequence=[...new Array(this.lookAheadGlyphCount)].map((t=>e.uint16)),this.substitutionCount=e.uint16,this.substLookupRecords=[...new Array(this.substitutionCount)].map((t=>new Qd(e)))}}class Qd extends Qc{constructor(e){super(e),this.sequenceIndex=e.uint16,this.lookupListIndex=e.uint16}}class $d extends Qc{constructor(e){super(e),this.substFormat=e.uint16,this.extensionLookupType=e.uint16,this.extensionOffset=e.Offset32}}class ep extends Ad{constructor(e){super(e),this.backtrackGlyphCount=e.uint16,this.backtrackCoverageOffsets=[...new Array(this.backtrackGlyphCount)].map((t=>e.Offset16)),this.lookaheadGlyphCount=e.uint16,this.lookaheadCoverageOffsets=[new Array(this.lookaheadGlyphCount)].map((t=>e.Offset16)),this.glyphCount=e.uint16,this.substituteGlyphIDs=[...new Array(this.glyphCount)].map((t=>e.uint16))}}var tp={buildSubtable:function(e,t){const s=new[void 0,Nd,Vd,Rd,Dd,Hd,Zd,$d,ep][e](t);return s.type=e,s}};class sp extends Qc{constructor(e){super(e)}}class np extends sp{constructor(e){super(e),console.log("lookup type 1")}}class ip extends sp{constructor(e){super(e),console.log("lookup type 2")}}class rp extends sp{constructor(e){super(e),console.log("lookup type 3")}}class op extends sp{constructor(e){super(e),console.log("lookup type 4")}}class ap extends sp{constructor(e){super(e),console.log("lookup type 5")}}class lp extends sp{constructor(e){super(e),console.log("lookup type 6")}}class cp extends sp{constructor(e){super(e),console.log("lookup type 7")}}class up extends sp{constructor(e){super(e),console.log("lookup type 8")}}class dp extends sp{constructor(e){super(e),console.log("lookup type 9")}}var pp={buildSubtable:function(e,t){const s=new[void 0,np,ip,rp,op,ap,lp,cp,up,dp][e](t);return s.type=e,s}};class hp extends Qc{static EMPTY={lookupCount:0,lookups:[]};constructor(e){super(e),this.lookupCount=e.uint16,this.lookups=[...new Array(this.lookupCount)].map((t=>e.Offset16))}}class fp extends Qc{constructor(e,t){super(e),this.ctType=t,this.lookupType=e.uint16,this.lookupFlag=e.uint16,this.subTableCount=e.uint16,this.subtableOffsets=[...new Array(this.subTableCount)].map((t=>e.Offset16)),this.markFilteringSet=e.uint16}get rightToLeft(){return!0&this.lookupFlag}get ignoreBaseGlyphs(){return!0&this.lookupFlag}get ignoreLigatures(){return!0&this.lookupFlag}get ignoreMarks(){return!0&this.lookupFlag}get useMarkFilteringSet(){return!0&this.lookupFlag}get markAttachmentType(){return!0&this.lookupFlag}getSubTable(e){const t="GSUB"===this.ctType?tp:pp;return this.parser.currentPosition=this.start+this.subtableOffsets[e],t.buildSubtable(this.lookupType,this.parser)}}class mp extends $c{constructor(e,t,s){const{p:n,tableStart:i}=super(e,t,s);this.majorVersion=n.uint16,this.minorVersion=n.uint16,this.scriptListOffset=n.Offset16,this.featureListOffset=n.Offset16,this.lookupListOffset=n.Offset16,1===this.majorVersion&&1===this.minorVersion&&(this.featureVariationsOffset=n.Offset32);const r=!(this.scriptListOffset||this.featureListOffset||this.lookupListOffset);eu(this,"scriptList",(()=>r?bd.EMPTY:(n.currentPosition=i+this.scriptListOffset,new bd(n)))),eu(this,"featureList",(()=>r?Cd.EMPTY:(n.currentPosition=i+this.featureListOffset,new Cd(n)))),eu(this,"lookupList",(()=>r?hp.EMPTY:(n.currentPosition=i+this.lookupListOffset,new hp(n)))),this.featureVariationsOffset&&eu(this,"featureVariations",(()=>r?FeatureVariations.EMPTY:(n.currentPosition=i+this.featureVariationsOffset,new FeatureVariations(n))))}getSupportedScripts(){return this.scriptList.scriptRecords.map((e=>e.scriptTag))}getScriptTable(e){let t=this.scriptList.scriptRecords.find((t=>t.scriptTag===e));this.parser.currentPosition=this.scriptList.start+t.scriptOffset;let s=new _d(this.parser);return s.scriptTag=e,s}ensureScriptTable(e){return"string"==typeof e?this.getScriptTable(e):e}getSupportedLangSys(e){const t=0!==(e=this.ensureScriptTable(e)).defaultLangSys,s=e.langSysRecords.map((e=>e.langSysTag));return t&&s.unshift("dflt"),s}getDefaultLangSysTable(e){let t=(e=this.ensureScriptTable(e)).defaultLangSys;if(0!==t){this.parser.currentPosition=e.start+t;let s=new jd(this.parser);return s.langSysTag="",s.defaultForScript=e.scriptTag,s}}getLangSysTable(e,t="dflt"){if("dflt"===t)return this.getDefaultLangSysTable(e);let s=(e=this.ensureScriptTable(e)).langSysRecords.find((e=>e.langSysTag===t));this.parser.currentPosition=e.start+s.langSysOffset;let n=new jd(this.parser);return n.langSysTag=t,n}getFeatures(e){return e.featureIndices.map((e=>this.getFeature(e)))}getFeature(e){let t;if(t=parseInt(e)==e?this.featureList.featureRecords[e]:this.featureList.featureRecords.find((t=>t.featureTag===e)),!t)return;this.parser.currentPosition=this.featureList.start+t.featureOffset;let s=new Ed(this.parser);return s.featureTag=t.featureTag,s}getLookups(e){return e.lookupListIndices.map((e=>this.getLookup(e)))}getLookup(e,t){let s=this.lookupList.lookups[e];return this.parser.currentPosition=this.lookupList.start+s,new fp(this.parser,t)}}var gp=Object.freeze({__proto__:null,GSUB:class extends mp{constructor(e,t){super(e,t,"GSUB")}getLookup(e){return super.getLookup(e,"GSUB")}}});var vp=Object.freeze({__proto__:null,GPOS:class extends mp{constructor(e,t){super(e,t,"GPOS")}getLookup(e){return super.getLookup(e,"GPOS")}}});class xp extends Qc{constructor(e){super(e),this.numEntries=e.uint16,this.documentRecords=[...new Array(this.numEntries)].map((t=>new yp(e)))}getDocument(e){let t=this.documentRecords[e];if(!t)return"";let s=this.start+t.svgDocOffset;return this.parser.currentPosition=s,this.parser.readBytes(t.svgDocLength)}getDocumentForGlyph(e){let t=this.documentRecords.findIndex((t=>t.startGlyphID<=e&&e<=t.endGlyphID));return-1===t?"":this.getDocument(t)}}class yp{constructor(e){this.startGlyphID=e.uint16,this.endGlyphID=e.uint16,this.svgDocOffset=e.Offset32,this.svgDocLength=e.uint32}}var bp=Object.freeze({__proto__:null,SVG:class extends $c{constructor(e,t){const{p:s}=super(e,t);this.version=s.uint16,this.offsetToSVGDocumentList=s.Offset32,s.currentPosition=this.tableStart+this.offsetToSVGDocumentList,this.documentList=new xp(s)}}});class wp{constructor(e){this.tag=e.tag,this.minValue=e.fixed,this.defaultValue=e.fixed,this.maxValue=e.fixed,this.flags=e.flags(16),this.axisNameID=e.uint16}}class _p{constructor(e,t,s){let n=e.currentPosition;this.subfamilyNameID=e.uint16,e.uint16,this.coordinates=[...new Array(t)].map((t=>e.fixed)),e.currentPosition-n(s.currentPosition=n,[...new Array(this.axisCount)].map((e=>new wp(s))))));const i=n+this.axisCount*this.axisSize;eu(this,"instances",(()=>{let e=[];for(let t=0;te.tag))}getAxis(e){return this.axes.find((t=>t.tag===e))}}});var jp=Object.freeze({__proto__:null,cvt:class extends $c{constructor(e,t){const{p:s}=super(e,t),n=e.length/2;eu(this,"items",(()=>[...new Array(n)].map((e=>s.fword))))}}});var Cp=Object.freeze({__proto__:null,fpgm:class extends $c{constructor(e,t){const{p:s}=super(e,t);eu(this,"instructions",(()=>[...new Array(e.length)].map((e=>s.uint8))))}}});class kp{constructor(e){this.rangeMaxPPEM=e.uint16,this.rangeGaspBehavior=e.uint16}}var Ep=Object.freeze({__proto__:null,gasp:class extends $c{constructor(e,t){const{p:s}=super(e,t);this.version=s.uint16,this.numRanges=s.uint16;eu(this,"gaspRanges",(()=>[...new Array(this.numRanges)].map((e=>new kp(s)))))}}});var Pp=Object.freeze({__proto__:null,glyf:class extends $c{constructor(e,t){super(e,t)}getGlyphData(e,t){return this.parser.currentPosition=this.tableStart+e,this.parser.readBytes(t)}}});var Ip=Object.freeze({__proto__:null,loca:class extends $c{constructor(e,t,s){const{p:n}=super(e,t),i=s.maxp.numGlyphs+1;0===s.head.indexToLocFormat?(this.x2=!0,eu(this,"offsets",(()=>[...new Array(i)].map((e=>n.Offset16))))):eu(this,"offsets",(()=>[...new Array(i)].map((e=>n.Offset32))))}getGlyphDataOffsetAndLength(e){let t=this.offsets[e]*this.x2?2:1;return{offset:t,length:(this.offsets[e+1]*this.x2?2:1)-t}}}});var Tp=Object.freeze({__proto__:null,prep:class extends $c{constructor(e,t){const{p:s}=super(e,t);eu(this,"instructions",(()=>[...new Array(e.length)].map((e=>s.uint8))))}}});var Op=Object.freeze({__proto__:null,CFF:class extends $c{constructor(e,t){const{p:s}=super(e,t);eu(this,"data",(()=>s.readBytes()))}}});var Ap=Object.freeze({__proto__:null,CFF2:class extends $c{constructor(e,t){const{p:s}=super(e,t);eu(this,"data",(()=>s.readBytes()))}}});class Mp{constructor(e){this.glyphIndex=e.uint16,this.vertOriginY=e.int16}}var Np=Object.freeze({__proto__:null,VORG:class extends $c{constructor(e,t){const{p:s}=super(e,t);this.majorVersion=s.uint16,this.minorVersion=s.uint16,this.defaultVertOriginY=s.int16,this.numVertOriginYMetrics=s.uint16,eu(this,"vertORiginYMetrics",(()=>[...new Array(this.numVertOriginYMetrics)].map((e=>new Mp(s)))))}}});class Vp{constructor(e){this.indexSubTableArrayOffset=e.Offset32,this.indexTablesSize=e.uint32,this.numberofIndexSubTables=e.uint32,this.colorRef=e.uint32,this.hori=new Rp(e),this.vert=new Rp(e),this.startGlyphIndex=e.uint16,this.endGlyphIndex=e.uint16,this.ppemX=e.uint8,this.ppemY=e.uint8,this.bitDepth=e.uint8,this.flags=e.int8}}class Fp{constructor(e){this.hori=new Rp(e),this.vert=new Rp(e),this.ppemX=e.uint8,this.ppemY=e.uint8,this.substitutePpemX=e.uint8,this.substitutePpemY=e.uint8}}class Rp{constructor(e){this.ascender=e.int8,this.descender=e.int8,this.widthMax=e.uint8,this.caretSlopeNumerator=e.int8,this.caretSlopeDenominator=e.int8,this.caretOffset=e.int8,this.minOriginSB=e.int8,this.minAdvanceSB=e.int8,this.maxBeforeBL=e.int8,this.minAfterBL=e.int8,this.pad1=e.int8,this.pad2=e.int8}}class Bp extends $c{constructor(e,t,s){const{p:n}=super(e,t,s);this.majorVersion=n.uint16,this.minorVersion=n.uint16,this.numSizes=n.uint32,eu(this,"bitMapSizes",(()=>[...new Array(this.numSizes)].map((e=>new Vp(n)))))}}var Dp=Object.freeze({__proto__:null,EBLC:Bp});class zp extends $c{constructor(e,t,s){const{p:n}=super(e,t,s);this.majorVersion=n.uint16,this.minorVersion=n.uint16}}var Lp=Object.freeze({__proto__:null,EBDT:zp});var Hp=Object.freeze({__proto__:null,EBSC:class extends $c{constructor(e,t){const{p:s}=super(e,t);this.majorVersion=s.uint16,this.minorVersion=s.uint16,this.numSizes=s.uint32,eu(this,"bitmapScales",(()=>[...new Array(this.numSizes)].map((e=>new Fp(s)))))}}});var Gp=Object.freeze({__proto__:null,CBLC:class extends Bp{constructor(e,t){super(e,t,"CBLC")}}});var Up=Object.freeze({__proto__:null,CBDT:class extends zp{constructor(e,t){super(e,t,"CBDT")}}});var Wp=Object.freeze({__proto__:null,sbix:class extends $c{constructor(e,t){const{p:s}=super(e,t);this.version=s.uint16,this.flags=s.flags(16),this.numStrikes=s.uint32,eu(this,"strikeOffsets",(()=>[...new Array(this.numStrikes)].map((e=>s.Offset32))))}}});class qp{constructor(e){this.gID=e.uint16,this.firstLayerIndex=e.uint16,this.numLayers=e.uint16}}class Zp{constructor(e){this.gID=e.uint16,this.paletteIndex=e.uint16}}var Kp=Object.freeze({__proto__:null,COLR:class extends $c{constructor(e,t){const{p:s}=super(e,t);this.version=s.uint16,this.numBaseGlyphRecords=s.uint16,this.baseGlyphRecordsOffset=s.Offset32,this.layerRecordsOffset=s.Offset32,this.numLayerRecords=s.uint16}getBaseGlyphRecord(e){let t=this.tableStart+this.baseGlyphRecordsOffset;this.parser.currentPosition=t;let s=new qp(this.parser),n=s.gID,i=this.tableStart+this.layerRecordsOffset-6;this.parser.currentPosition=i;let r=new qp(this.parser),o=r.gID;if(n===e)return s;if(o===e)return r;for(;t!==i;){let s=t+(i-t)/12;this.parser.currentPosition=s;let n=new qp(this.parser),r=n.gID;if(r===e)return n;r>e?i=s:rnew Zp(p)))}}});class Yp{constructor(e){this.blue=e.uint8,this.green=e.uint8,this.red=e.uint8,this.alpha=e.uint8}}class Xp{constructor(e,t){this.paletteTypes=[...new Array(t)].map((t=>e.uint32))}}class Jp{constructor(e,t){this.paletteLabels=[...new Array(t)].map((t=>e.uint16))}}class Qp{constructor(e,t){this.paletteEntryLabels=[...new Array(t)].map((t=>e.uint16))}}var $p=Object.freeze({__proto__:null,CPAL:class extends $c{constructor(e,t){const{p:s}=super(e,t);this.version=s.uint16,this.numPaletteEntries=s.uint16;const n=this.numPalettes=s.uint16;this.numColorRecords=s.uint16,this.offsetFirstColorRecord=s.Offset32,this.colorRecordIndices=[...new Array(this.numPalettes)].map((e=>s.uint16)),eu(this,"colorRecords",(()=>(s.currentPosition=this.tableStart+this.offsetFirstColorRecord,[...new Array(this.numColorRecords)].map((e=>new Yp(s)))))),1===this.version&&(this.offsetPaletteTypeArray=s.Offset32,this.offsetPaletteLabelArray=s.Offset32,this.offsetPaletteEntryLabelArray=s.Offset32,eu(this,"paletteTypeArray",(()=>(s.currentPosition=this.tableStart+this.offsetPaletteTypeArray,new Xp(s,n)))),eu(this,"paletteLabelArray",(()=>(s.currentPosition=this.tableStart+this.offsetPaletteLabelArray,new Jp(s,n)))),eu(this,"paletteEntryLabelArray",(()=>(s.currentPosition=this.tableStart+this.offsetPaletteEntryLabelArray,new Qp(s,n)))))}}});class eh{constructor(e){this.format=e.uint32,this.length=e.uint32,this.offset=e.Offset32}}class th{constructor(e){e.uint16,e.uint16,this.signatureLength=e.uint32,this.signature=e.readBytes(this.signatureLength)}}var sh=Object.freeze({__proto__:null,DSIG:class extends $c{constructor(e,t){const{p:s}=super(e,t);this.version=s.uint32,this.numSignatures=s.uint16,this.flags=s.uint16,this.signatureRecords=[...new Array(this.numSignatures)].map((e=>new eh(s)))}getData(e){const t=this.signatureRecords[e];return this.parser.currentPosition=this.tableStart+t.offset,new th(this.parser)}}});class nh{constructor(e,t){this.pixelSize=e.uint8,this.maxWidth=e.uint8,this.widths=e.readBytes(t)}}var ih=Object.freeze({__proto__:null,hdmx:class extends $c{constructor(e,t,s){const{p:n}=super(e,t),i=s.hmtx.numGlyphs;this.version=n.uint16,this.numRecords=n.int16,this.sizeDeviceRecord=n.int32,this.records=[...new Array(numRecords)].map((e=>new nh(n,i)))}}});class rh{constructor(e){this.version=e.uint16,this.length=e.uint16,this.coverage=e.flags(8),this.format=e.uint8,0===this.format&&(this.nPairs=e.uint16,this.searchRange=e.uint16,this.entrySelector=e.uint16,this.rangeShift=e.uint16,eu(this,"pairs",(()=>[...new Array(this.nPairs)].map((t=>new oh(e)))))),2===this.format&&console.warn("Kern subtable format 2 is not supported: this parser currently only parses universal table data.")}get horizontal(){return this.coverage[0]}get minimum(){return this.coverage[1]}get crossstream(){return this.coverage[2]}get override(){return this.coverage[3]}}class oh{constructor(e){this.left=e.uint16,this.right=e.uint16,this.value=e.fword}}var ah=Object.freeze({__proto__:null,kern:class extends $c{constructor(e,t){const{p:s}=super(e,t);this.version=s.uint16,this.nTables=s.uint16,eu(this,"tables",(()=>{let e=this.tableStart+4;const t=[];for(let n=0;n[...new Array(this.mergeClassCount)].map((e=>s.readBytes(this.mergeClassCount))))),console.warn("Full MERG parsing is currently not supported."),console.warn("If you need this table parsed, please file an issue, or better yet, a PR.")}}});class uh{constructor(e,t){this.tableStart=e,this.parser=t,this.tag=t.tag,this.dataOffset=t.Offset32,this.dataLength=t.uint32}getData(){return this.parser.currentField=this.tableStart+this.dataOffset,this.parser.readBytes(this.dataLength)}}var dh=Object.freeze({__proto__:null,meta:class extends $c{constructor(e,t){const{p:s}=super(e,t);this.version=s.uint32,this.flags=s.uint32,s.uint32,this.dataMapsCount=s.uint32,this.dataMaps=[...new Array(this.dataMapsCount)].map((e=>new uh(this.tableStart,s)))}}});var ph=Object.freeze({__proto__:null,PCLT:class extends $c{constructor(e,t){super(e,t),console.warn("This font uses a PCLT table, which is currently not supported by this parser."),console.warn("If you need this table parsed, please file an issue, or better yet, a PR.")}}});class hh{constructor(e){this.bCharSet=e.uint8,this.xRatio=e.uint8,this.yStartRatio=e.uint8,this.yEndRatio=e.uint8}}class fh{constructor(e){this.recs=e.uint16,this.startsz=e.uint8,this.endsz=e.uint8,this.records=[...new Array(this.recs)].map((t=>new mh(e)))}}class mh{constructor(e){this.yPelHeight=e.uint16,this.yMax=e.int16,this.yMin=e.int16}}var gh=Object.freeze({__proto__:null,VDMX:class extends $c{constructor(e,t){const{p:s}=super(e,t);this.version=s.uint16,this.numRecs=s.uint16,this.numRatios=s.uint16,this.ratRanges=[...new Array(this.numRatios)].map((e=>new hh(s))),this.offsets=[...new Array(this.numRatios)].map((e=>s.Offset16)),this.VDMXGroups=[...new Array(this.numRecs)].map((e=>new fh(s)))}}});var vh=Object.freeze({__proto__:null,vhea:class extends $c{constructor(e,t){const{p:s}=super(e,t);this.version=s.fixed,this.ascent=this.vertTypoAscender=s.int16,this.descent=this.vertTypoDescender=s.int16,this.lineGap=this.vertTypoLineGap=s.int16,this.advanceHeightMax=s.int16,this.minTopSideBearing=s.int16,this.minBottomSideBearing=s.int16,this.yMaxExtent=s.int16,this.caretSlopeRise=s.int16,this.caretSlopeRun=s.int16,this.caretOffset=s.int16,this.reserved=s.int16,this.reserved=s.int16,this.reserved=s.int16,this.reserved=s.int16,this.metricDataFormat=s.int16,this.numOfLongVerMetrics=s.uint16,s.verifyLength()}}});class xh{constructor(e,t){this.advanceHeight=e,this.topSideBearing=t}}var yh=Object.freeze({__proto__:null,vmtx:class extends $c{constructor(e,t,s){super(e,t);const n=s.vhea.numOfLongVerMetrics,i=s.maxp.numGlyphs,r=p.currentPosition;if(lazy(this,"vMetrics",(()=>(p.currentPosition=r,[...new Array(n)].map((e=>new xh(p.uint16,p.int16)))))),n(p.currentPosition=e,[...new Array(i-n)].map((e=>p.int16)))))}}}});const{kebabCase:bh}=te(y.privateApis);const wh=function(){const{installFonts:e}=(0,d.useContext)(kc),[t,s]=(0,d.useState)(!1),[n,i]=(0,d.useState)(!1),r=async e=>{i(null),s(!0);const t=new Set,n=[...e];let r=!1;const l=n.map((async e=>{const s=await async function(e){const t=new _u("Uploaded Font");try{const s=await a(e);return await t.fromDataBuffer(s,"font"),!0}catch(e){return!1}}(e);if(!s)return r=!0,null;if(t.has(e.name))return null;const n=e.name.split(".").pop().toLowerCase();return lc.includes(n)?(t.add(e.name),e):null})),c=(await Promise.all(l)).filter((e=>null!==e));if(c.length>0)o(c);else{const e=r?(0,b.__)("Sorry, you are not allowed to upload this file type."):(0,b.__)("No fonts found to install.");i({type:"error",message:e}),s(!1)}},o=async e=>{const t=await Promise.all(e.map((async e=>{const t=await l(e);return await vc(t,t.file,"all"),t})));c(t)};async function a(e){return new Promise(((t,s)=>{const n=new window.FileReader;n.readAsArrayBuffer(e),n.onload=()=>t(n.result),n.onerror=s}))}const l=async e=>{const t=await a(e),s=new _u("Uploaded Font");s.fromDataBuffer(t,e.name);const n=(await new Promise((e=>s.onload=e))).detail.font,{name:i}=n.opentype.tables,r=i.get(16)||i.get(1),o=i.get(2).toLowerCase().includes("italic"),l=n.opentype.tables["OS/2"].usWeightClass||"normal",c=!!n.opentype.tables.fvar&&n.opentype.tables.fvar.axes.find((({tag:e})=>"wght"===e));return{file:e,fontFamily:r,fontStyle:o?"italic":"normal",fontWeight:(c?`${c.minValue} ${c.maxValue}`:null)||l}},c=async t=>{const n=function(e){const t=e.reduce(((e,t)=>(e[t.fontFamily]||(e[t.fontFamily]={name:t.fontFamily,fontFamily:t.fontFamily,slug:bh(t.fontFamily.toLowerCase()),fontFace:[]}),e[t.fontFamily].fontFace.push(t),e)),{});return Object.values(t)}(t);try{await e(n),i({type:"success",message:(0,b.__)("Fonts were installed successfully.")})}catch(e){i({type:"error",message:e.message,errors:e?.installationErrors})}s(!1)};return(0,oe.jsxs)("div",{className:"font-library-modal__tabpanel-layout",children:[(0,oe.jsx)(y.DropZone,{onFilesDrop:e=>{r(e)}}),(0,oe.jsxs)(y.__experimentalVStack,{className:"font-library-modal__local-fonts",children:[n&&(0,oe.jsxs)(y.Notice,{status:n.type,__unstableHTML:!0,onRemove:()=>i(null),children:[n.message,n.errors&&(0,oe.jsx)("ul",{children:n.errors.map(((e,t)=>(0,oe.jsx)("li",{children:e},t)))})]}),t&&(0,oe.jsx)(y.FlexItem,{children:(0,oe.jsx)("div",{className:"font-library-modal__upload-area",children:(0,oe.jsx)(y.ProgressBar,{})})}),!t&&(0,oe.jsx)(y.FormFileUpload,{accept:lc.map((e=>`.${e}`)).join(","),multiple:!0,onChange:e=>{r(e.target.files)},render:({openFileDialog:e})=>(0,oe.jsx)(y.Button,{__next40pxDefaultSize:!0,className:"font-library-modal__upload-area",onClick:e,children:(0,b.__)("Upload font")})}),(0,oe.jsx)(y.__experimentalSpacer,{margin:2}),(0,oe.jsx)(y.__experimentalText,{className:"font-library-modal__upload-area__text",children:(0,b.__)("Uploaded fonts appear in your library and can be used in your theme. Supported formats: .ttf, .otf, .woff, and .woff2.")})]})]})},{Tabs:_h}=te(y.privateApis),Sh={id:"installed-fonts",title:(0,b._x)("Library","Font library")},jh={id:"upload-fonts",title:(0,b.__)("Upload")};const Ch=function({onRequestClose:e,defaultTabId:t="installed-fonts"}){const{collections:s}=(0,d.useContext)(kc),n=(0,l.useSelect)((e=>e(_.store).canUser("create",{kind:"postType",name:"wp_font_family"})),[]),i=[Sh];return n&&(i.push(jh),i.push(...(e=>e.map((({slug:t,name:s})=>({id:t,title:1===e.length&&"google-fonts"===t?(0,b.__)("Install Fonts"):s}))))(s||[]))),(0,oe.jsx)(y.Modal,{title:(0,b.__)("Fonts"),onRequestClose:e,isFullScreen:!0,className:"font-library-modal",children:(0,oe.jsxs)(_h,{defaultTabId:t,children:[(0,oe.jsx)("div",{className:"font-library-modal__tablist",children:(0,oe.jsx)(_h.TabList,{children:i.map((({id:e,title:t})=>(0,oe.jsx)(_h.Tab,{tabId:e,children:t},e)))})}),i.map((({id:e})=>{let t;switch(e){case"upload-fonts":t=(0,oe.jsx)(wh,{});break;case"installed-fonts":t=(0,oe.jsx)(Fc,{});break;default:t=(0,oe.jsx)(Gc,{slug:e})}return(0,oe.jsx)(_h.TabPanel,{tabId:e,focusable:!1,children:t},e)}))]})})};const kh=function({font:e}){const{handleSetLibraryFontSelected:t,setModalTabOpen:s}=(0,d.useContext)(kc),n=e?.fontFace?.length||1,i=Na(e);return(0,oe.jsx)(y.__experimentalItem,{onClick:()=>{t(e),s("installed-fonts")},children:(0,oe.jsxs)(y.__experimentalHStack,{justify:"space-between",children:[(0,oe.jsx)(y.FlexItem,{style:i,children:e.name}),(0,oe.jsx)(y.FlexItem,{className:"edit-site-global-styles-screen-typography__font-variants-count",children:(0,b.sprintf)((0,b._n)("%d variant","%d variants",n),n)})]})})},{useGlobalSetting:Eh}=te(x.privateApis);function Ph(e,t){return e?e.map((e=>hc(e,{source:t}))):[]}function Ih(){const{baseCustomFonts:e,modalTabOpen:t,setModalTabOpen:s}=(0,d.useContext)(kc),[n]=Eh("typography.fontFamilies"),[i]=Eh("typography.fontFamilies",void 0,"base"),r=[...Ph(n?.theme,"theme"),...Ph(n?.custom,"custom")].sort(((e,t)=>e.name.localeCompare(t.name))),o=00||e?.length>0;return(0,oe.jsxs)(oe.Fragment,{children:[!!t&&(0,oe.jsx)(Ch,{onRequestClose:()=>s(null),defaultTabId:t}),(0,oe.jsxs)(y.__experimentalVStack,{spacing:2,children:[(0,oe.jsxs)(y.__experimentalHStack,{justify:"space-between",children:[(0,oe.jsx)(ml,{level:3,children:(0,b.__)("Fonts")}),(0,oe.jsx)(y.Button,{onClick:()=>s("installed-fonts"),label:(0,b.__)("Manage fonts"),icon:tc,size:"small"})]}),r.length>0&&(0,oe.jsx)(oe.Fragment,{children:(0,oe.jsx)(y.__experimentalItemGroup,{size:"large",isBordered:!0,isSeparated:!0,children:r.map((e=>(0,oe.jsx)(kh,{font:e},e.slug)))})}),!o&&(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(y.__experimentalText,{as:"p",children:a?(0,b.__)("No fonts activated."):(0,b.__)("No fonts installed.")}),(0,oe.jsx)(y.Button,{className:"edit-site-global-styles-font-families__manage-fonts",variant:"secondary",__next40pxDefaultSize:!0,onClick:()=>{s(a?"installed-fonts":"upload-fonts")},children:a?(0,b.__)("Manage fonts"):(0,b.__)("Add fonts")})]})]})]})}const Th=({...e})=>(0,oe.jsx)(Ec,{children:(0,oe.jsx)(Ih,{...e})});const Oh=function(){const e=(0,l.useSelect)((e=>e(h.store).getEditorSettings().fontLibraryEnabled),[]);return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(nl,{title:(0,b.__)("Typography"),description:(0,b.__)("Available fonts, typographic styles, and the application of those styles.")}),(0,oe.jsx)("div",{className:"edit-site-global-styles-screen",children:(0,oe.jsxs)(y.__experimentalVStack,{spacing:7,children:[(0,oe.jsx)($l,{title:(0,b.__)("Typesets")}),e&&(0,oe.jsx)(Th,{}),(0,oe.jsx)(Dl,{}),(0,oe.jsx)(ec,{})]})})]})},{useGlobalStyle:Ah,useGlobalSetting:Mh,useSettingsForBlockElement:Nh,TypographyPanel:Vh}=te(x.privateApis);function Fh({element:e,headingLevel:t}){let s=[];"heading"===e?s=s.concat(["elements",t]):e&&"text"!==e&&(s=s.concat(["elements",e]));const n=s.join("."),[i]=Ah(n,void 0,"user",{shouldDecodeEncode:!1}),[r,o]=Ah(n,void 0,"all",{shouldDecodeEncode:!1}),[a]=Mh(""),l=Nh(a,void 0,"heading"===e?t:e);return(0,oe.jsx)(Vh,{inheritedValue:r,value:i,onChange:o,settings:l})}const{useGlobalStyle:Rh}=te(x.privateApis);function Bh({name:e,element:t,headingLevel:s}){var n;let i="";"heading"===t?i=`elements.${s}.`:t&&"text"!==t&&(i=`elements.${t}.`);const[r]=Rh(i+"typography.fontFamily",e),[o]=Rh(i+"color.gradient",e),[a]=Rh(i+"color.background",e),[l]=Rh("color.background"),[c]=Rh(i+"color.text",e),[u]=Rh(i+"typography.fontSize",e),[d]=Rh(i+"typography.fontStyle",e),[p]=Rh(i+"typography.fontWeight",e),[h]=Rh(i+"typography.letterSpacing",e),f="link"===t?{textDecoration:"underline"}:{};return(0,oe.jsx)("div",{className:"edit-site-typography-preview",style:{fontFamily:null!=r?r:"serif",background:null!==(n=null!=o?o:a)&&void 0!==n?n:l,color:c,fontSize:u,fontStyle:d,fontWeight:p,letterSpacing:h,...f},children:"Aa"})}const Dh={text:{description:(0,b.__)("Manage the fonts used on the site."),title:(0,b.__)("Text")},link:{description:(0,b.__)("Manage the fonts and typography used on the links."),title:(0,b.__)("Links")},heading:{description:(0,b.__)("Manage the fonts and typography used on headings."),title:(0,b.__)("Headings")},caption:{description:(0,b.__)("Manage the fonts and typography used on captions."),title:(0,b.__)("Captions")},button:{description:(0,b.__)("Manage the fonts and typography used on buttons."),title:(0,b.__)("Buttons")}};const zh=function({element:e}){const[t,s]=(0,d.useState)("heading");return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(nl,{title:Dh[e].title,description:Dh[e].description}),(0,oe.jsx)(y.__experimentalSpacer,{marginX:4,children:(0,oe.jsx)(Bh,{element:e,headingLevel:t})}),"heading"===e&&(0,oe.jsx)(y.__experimentalSpacer,{marginX:4,marginBottom:"1em",children:(0,oe.jsxs)(y.__experimentalToggleGroupControl,{label:(0,b.__)("Select heading level"),hideLabelFromVision:!0,value:t,onChange:s,isBlock:!0,size:"__unstable-large",__nextHasNoMarginBottom:!0,children:[(0,oe.jsx)(y.__experimentalToggleGroupControlOption,{value:"heading",showTooltip:!0,"aria-label":(0,b.__)("All headings"),label:(0,b._x)("All","heading levels")}),(0,oe.jsx)(y.__experimentalToggleGroupControlOption,{value:"h1",showTooltip:!0,"aria-label":(0,b.__)("Heading 1"),label:(0,b.__)("H1")}),(0,oe.jsx)(y.__experimentalToggleGroupControlOption,{value:"h2",showTooltip:!0,"aria-label":(0,b.__)("Heading 2"),label:(0,b.__)("H2")}),(0,oe.jsx)(y.__experimentalToggleGroupControlOption,{value:"h3",showTooltip:!0,"aria-label":(0,b.__)("Heading 3"),label:(0,b.__)("H3")}),(0,oe.jsx)(y.__experimentalToggleGroupControlOption,{value:"h4",showTooltip:!0,"aria-label":(0,b.__)("Heading 4"),label:(0,b.__)("H4")}),(0,oe.jsx)(y.__experimentalToggleGroupControlOption,{value:"h5",showTooltip:!0,"aria-label":(0,b.__)("Heading 5"),label:(0,b.__)("H5")}),(0,oe.jsx)(y.__experimentalToggleGroupControlOption,{value:"h6",showTooltip:!0,"aria-label":(0,b.__)("Heading 6"),label:(0,b.__)("H6")})]})}),(0,oe.jsx)(Fh,{element:e,headingLevel:t})]})},{useGlobalStyle:Lh}=te(x.privateApis);const Hh=function({fontSize:e}){var t;const[s]=Lh("typography"),n=e?.fluid?.min&&e?.fluid?.max?{minimumFontSize:e.fluid.min,maximumFontSize:e.fluid.max}:{fontSize:e.size},i=(0,x.getComputedFluidTypographyValue)(n);return(0,oe.jsx)("div",{className:"edit-site-typography-preview",style:{fontSize:i,fontFamily:null!==(t=s?.fontFamily)&&void 0!==t?t:"serif"},children:(0,b.__)("Aa")})};const Gh=function({fontSize:e,isOpen:t,toggleOpen:s,handleRemoveFontSize:n}){return(0,oe.jsx)(y.__experimentalConfirmDialog,{isOpen:t,cancelButtonText:(0,b.__)("Cancel"),confirmButtonText:(0,b.__)("Delete"),onCancel:()=>{s()},onConfirm:async()=>{s(),n(e)},size:"medium",children:e&&(0,b.sprintf)((0,b.__)('Are you sure you want to delete "%s" font size preset?'),e.name)})};const Uh=function({fontSize:e,toggleOpen:t,handleRename:s}){const[n,i]=(0,d.useState)(e.name);return(0,oe.jsx)(y.Modal,{onRequestClose:t,focusOnMount:"firstContentElement",title:(0,b.__)("Rename"),size:"small",children:(0,oe.jsx)("form",{onSubmit:e=>{e.preventDefault(),n.trim()&&s(n),t(),t()},children:(0,oe.jsxs)(y.__experimentalVStack,{spacing:"3",children:[(0,oe.jsx)(y.__experimentalInputControl,{__next40pxDefaultSize:!0,autoComplete:"off",value:n,onChange:i,label:(0,b.__)("Name"),placeholder:(0,b.__)("Font size preset name")}),(0,oe.jsxs)(y.__experimentalHStack,{justify:"right",children:[(0,oe.jsx)(y.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:t,children:(0,b.__)("Cancel")}),(0,oe.jsx)(y.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",children:(0,b.__)("Save")})]})]})})})},Wh=["px","em","rem","vw","vh"];const qh=function({__nextHasNoMarginBottom:e,...t}){const{baseControlProps:s}=(0,y.useBaseControlProps)(t),{value:n,onChange:i,fallbackValue:r,disabled:o,label:a}=t,l=(0,y.__experimentalUseCustomUnits)({availableUnits:Wh}),[c,u="px"]=(0,y.__experimentalParseQuantityAndUnitFromRawValue)(n,l),d=!!u&&["em","rem","vw","vh"].includes(u);return(0,oe.jsx)(y.BaseControl,{...s,__nextHasNoMarginBottom:!0,children:(0,oe.jsxs)(y.Flex,{children:[(0,oe.jsx)(y.FlexItem,{isBlock:!0,children:(0,oe.jsx)(y.__experimentalUnitControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:a,hideLabelFromVision:!0,value:n,onChange:e=>{i(e)},units:l,min:0,disabled:o})}),(0,oe.jsx)(y.FlexItem,{isBlock:!0,children:(0,oe.jsx)(y.__experimentalSpacer,{marginX:2,marginBottom:0,children:(0,oe.jsx)(y.RangeControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:a,hideLabelFromVision:!0,value:c,initialPosition:r,withInputField:!1,onChange:e=>{i?.(e+u)},min:0,max:d?10:100,step:d?.1:1,disabled:o})})})]})})},{DropdownMenuV2:Zh}=te(y.privateApis),{useGlobalSetting:Kh}=te(x.privateApis);const Yh=function(){var e;const[t,s]=(0,d.useState)(!1),[n,i]=(0,d.useState)(!1),{params:{origin:r,slug:o},goTo:a}=(0,y.__experimentalUseNavigator)(),[l,c]=Kh("typography.fontSizes"),[u]=Kh("typography.fluid"),p=null!==(e=l[r])&&void 0!==e?e:[],h=p.find((e=>e.slug===o)),f=void 0!==h?.fluid?!!h.fluid:!!u,m="object"==typeof h?.fluid,g=(e,t)=>{const s=p.map((s=>s.slug===o?{...s,[e]:t}:s));c({...l,[r]:s})},v=()=>{s(!t)},x=()=>{i(!n)};return(0,d.useEffect)((()=>{h||a("/typography/font-sizes/",{isBack:!0})}),[h,a]),h?(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(Gh,{fontSize:h,isOpen:t,toggleOpen:v,handleRemoveFontSize:()=>{const e=p.filter((e=>e.slug!==o));c({...l,[r]:e})}}),n&&(0,oe.jsx)(Uh,{fontSize:h,toggleOpen:x,handleRename:e=>{g("name",e)}}),(0,oe.jsxs)(y.__experimentalVStack,{spacing:4,children:[(0,oe.jsxs)(y.__experimentalHStack,{justify:"space-between",align:"flex-start",children:[(0,oe.jsx)(nl,{title:h.name,description:(0,b.sprintf)((0,b.__)("Manage the font size %s."),h.name),onBack:()=>a("/typography/font-sizes/")}),"custom"===r&&(0,oe.jsx)(y.FlexItem,{children:(0,oe.jsx)(y.__experimentalSpacer,{marginTop:3,marginBottom:0,paddingX:4,children:(0,oe.jsxs)(Zh,{trigger:(0,oe.jsx)(y.Button,{size:"small",icon:ma,label:(0,b.__)("Font size options")}),children:[(0,oe.jsx)(Zh.Item,{onClick:x,children:(0,oe.jsx)(Zh.ItemLabel,{children:(0,b.__)("Rename")})}),(0,oe.jsx)(Zh.Item,{onClick:v,children:(0,oe.jsx)(Zh.ItemLabel,{children:(0,b.__)("Delete")})})]})})})]}),(0,oe.jsx)(y.__experimentalView,{children:(0,oe.jsx)(y.__experimentalSpacer,{paddingX:4,children:(0,oe.jsxs)(y.__experimentalVStack,{spacing:4,children:[(0,oe.jsx)(y.FlexItem,{children:(0,oe.jsx)(Hh,{fontSize:h})}),(0,oe.jsx)(qh,{label:(0,b.__)("Size"),value:m?"":h.size,onChange:e=>{g("size",e)},disabled:m}),(0,oe.jsx)(y.ToggleControl,{label:(0,b.__)("Fluid typography"),help:(0,b.__)("Scale the font size dynamically to fit the screen or viewport."),checked:f,onChange:e=>{g("fluid",e)},__nextHasNoMarginBottom:!0}),f&&(0,oe.jsx)(y.ToggleControl,{label:(0,b.__)("Custom fluid values"),help:(0,b.__)("Set custom min and max values for the fluid font size."),checked:m,onChange:e=>{g("fluid",!e||{min:h.size,max:h.size})},__nextHasNoMarginBottom:!0}),m&&(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(qh,{label:(0,b.__)("Minimum"),value:h.fluid?.min,onChange:e=>{g("fluid",{...h.fluid,min:e})}}),(0,oe.jsx)(qh,{label:(0,b.__)("Maximum"),value:h.fluid?.max,onChange:e=>{g("fluid",{...h.fluid,max:e})}})]})]})})})]})]}):null},Xh=(0,oe.jsx)(Jt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Jt.Path,{d:"M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z"})});const Jh=function({text:e,confirmButtonText:t,isOpen:s,toggleOpen:n,onConfirm:i}){return(0,oe.jsx)(y.__experimentalConfirmDialog,{isOpen:s,cancelButtonText:(0,b.__)("Cancel"),confirmButtonText:t,onCancel:()=>{n()},onConfirm:async()=>{n(),i()},size:"medium",children:e})},{DropdownMenuV2:Qh}=te(y.privateApis),{useGlobalSetting:$h}=te(x.privateApis);function ef({label:e,origin:t,sizes:s,handleAddFontSize:n,handleResetFontSizes:i}){const[r,o]=(0,d.useState)(!1),a=()=>o(!r),l="custom"===t?(0,b.__)("Are you sure you want to remove all custom font size presets?"):(0,b.__)("Are you sure you want to reset all font size presets to their default values?");return(0,oe.jsxs)(oe.Fragment,{children:[r&&(0,oe.jsx)(Jh,{text:l,confirmButtonText:"custom"===t?(0,b.__)("Remove"):(0,b.__)("Reset"),isOpen:r,toggleOpen:a,onConfirm:i}),(0,oe.jsxs)(y.__experimentalVStack,{spacing:4,children:[(0,oe.jsxs)(y.__experimentalHStack,{justify:"space-between",align:"center",children:[(0,oe.jsx)(ml,{level:3,children:e}),(0,oe.jsxs)(y.FlexItem,{children:["custom"===t&&(0,oe.jsx)(y.Button,{label:(0,b.__)("Add font size"),icon:Xh,size:"small",onClick:n}),!!i&&(0,oe.jsx)(Qh,{trigger:(0,oe.jsx)(y.Button,{size:"small",icon:ma,label:(0,b.__)("Font size presets options")}),children:(0,oe.jsx)(Qh.Item,{onClick:a,children:(0,oe.jsx)(Qh.ItemLabel,{children:"custom"===t?(0,b.__)("Remove font size presets"):(0,b.__)("Reset font size presets")})})})]})]}),!!s.length&&(0,oe.jsx)(y.__experimentalItemGroup,{isBordered:!0,isSeparated:!0,children:s.map((e=>(0,oe.jsx)(ba,{path:`/typography/font-sizes/${t}/${e.slug}`,children:(0,oe.jsxs)(y.__experimentalHStack,{direction:"row",children:[(0,oe.jsx)(y.FlexItem,{className:"edit-site-font-size__item",children:e.name}),(0,oe.jsx)(y.FlexItem,{children:(0,oe.jsxs)(y.__experimentalHStack,{justify:"flex-end",children:[(0,oe.jsx)(y.FlexBlock,{className:"edit-site-font-size__item edit-site-font-size__item-value",children:e.size}),(0,oe.jsx)(qo,{icon:(0,b.isRTL)()?ga:va})]})})]})},e.slug)))})]})]})}const tf=function(){const[e,t]=$h("typography.fontSizes.theme"),[s]=$h("typography.fontSizes.theme",null,"base"),[n,i]=$h("typography.fontSizes.default"),[r]=$h("typography.fontSizes.default",null,"base"),[o=[],a]=$h("typography.fontSizes.custom"),[l]=$h("typography.defaultFontSizes"),c=()=>{const e=Fa(o,"custom-"),t={name:(0,b.sprintf)((0,b.__)("New Font Size %d"),e),size:"16px",slug:`custom-${e}`};a([...o,t])},u=(e,t)=>e.map((e=>e.size)).join("")===t.map((e=>e.size)).join("");return(0,oe.jsxs)(y.__experimentalVStack,{spacing:2,children:[(0,oe.jsx)(nl,{title:(0,b.__)("Font size presets"),description:(0,b.__)("Create and edit the presets used for font sizes across the site.")}),(0,oe.jsx)(y.__experimentalView,{children:(0,oe.jsx)(y.__experimentalSpacer,{paddingX:4,children:(0,oe.jsxs)(y.__experimentalVStack,{spacing:8,children:[!!e?.length&&(0,oe.jsx)(ef,{label:(0,b.__)("Theme"),origin:"theme",sizes:e,baseSizes:s,handleAddFontSize:c,handleResetFontSizes:u(e,s)?null:()=>t(s)}),l&&!!n?.length&&(0,oe.jsx)(ef,{label:(0,b.__)("Default"),origin:"default",sizes:n,baseSizes:r,handleAddFontSize:c,handleResetFontSizes:u(n,r)?null:()=>i(r)}),(0,oe.jsx)(ef,{label:(0,b.__)("Custom"),origin:"custom",sizes:o,handleAddFontSize:c,handleResetFontSizes:o.length>0?()=>a([]):null})]})})})]})},sf=(0,oe.jsx)(Jt.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/SVG",children:(0,oe.jsx)(Jt.Path,{d:"M17.192 6.75L15.47 5.03l1.06-1.06 3.537 3.53-3.537 3.53-1.06-1.06 1.723-1.72h-3.19c-.602 0-.993.202-1.28.498-.309.319-.538.792-.695 1.383-.13.488-.222 1.023-.296 1.508-.034.664-.116 1.413-.303 2.117-.193.721-.513 1.467-1.068 2.04-.575.594-1.359.954-2.357.954H4v-1.5h4.003c.601 0 .993-.202 1.28-.498.308-.319.538-.792.695-1.383.149-.557.216-1.093.288-1.662l.039-.31a9.653 9.653 0 0 1 .272-1.653c.193-.722.513-1.467 1.067-2.04.576-.594 1.36-.954 2.358-.954h3.19zM8.004 6.75c.8 0 1.46.23 1.988.628a6.24 6.24 0 0 0-.684 1.396 1.725 1.725 0 0 0-.024-.026c-.287-.296-.679-.498-1.28-.498H4v-1.5h4.003zM12.699 14.726c-.161.459-.38.94-.684 1.396.527.397 1.188.628 1.988.628h3.19l-1.722 1.72 1.06 1.06L20.067 16l-3.537-3.53-1.06 1.06 1.723 1.72h-3.19c-.602 0-.993-.202-1.28-.498a1.96 1.96 0 0 1-.024-.026z"})});const nf=function({className:e,...t}){return(0,oe.jsx)(y.Flex,{className:Ut("edit-site-global-styles__color-indicator-wrapper",e),...t})},{useGlobalSetting:rf}=te(x.privateApis),of=[];const af=function({name:e}){const[t]=rf("color.palette.custom"),[s]=rf("color.palette.theme"),[n]=rf("color.palette.default"),[i]=rf("color.defaultPalette",e),[r]=function(e){const[t,s]=se("color.palette.theme",e);return window.__experimentalEnableColorRandomizer?[function(){const e=Math.floor(225*Math.random()),n=t.map((t=>{const{color:s}=t,n=Y(s).rotate(e).toHex();return{...t,color:n}}));s(n)}]:[]}(),o=(0,d.useMemo)((()=>[...t||of,...s||of,...n&&i?n:of]),[t,s,n,i]),a=e?"/blocks/"+encodeURIComponent(e)+"/colors/palette":"/colors/palette",l=o.length>0?(0,b.__)("Edit palette"):(0,b.__)("Add colors");return(0,oe.jsxs)(y.__experimentalVStack,{spacing:3,children:[(0,oe.jsx)(ml,{level:3,children:(0,b.__)("Palette")}),(0,oe.jsx)(y.__experimentalItemGroup,{isBordered:!0,isSeparated:!0,children:(0,oe.jsx)(ba,{path:a,"aria-label":l,children:(0,oe.jsxs)(y.__experimentalHStack,{direction:"row",children:[o.length<=0&&(0,oe.jsx)(y.FlexItem,{children:(0,b.__)("Add colors")}),(0,oe.jsx)(y.__experimentalZStack,{isLayered:!1,offset:-8,children:o.slice(0,5).map((({color:e},t)=>(0,oe.jsx)(nf,{children:(0,oe.jsx)(y.ColorIndicator,{colorValue:e})},`${e}-${t}`)))}),(0,oe.jsx)(qo,{icon:(0,b.isRTL)()?ga:va})]})})}),window.__experimentalEnableColorRandomizer&&s?.length>0&&(0,oe.jsx)(y.Button,{__next40pxDefaultSize:!0,variant:"secondary",icon:sf,onClick:r,children:(0,b.__)("Randomize colors")})]})},{useGlobalStyle:lf,useGlobalSetting:cf,useSettingsForBlockElement:uf,ColorPanel:df}=te(x.privateApis);const pf=function(){const[e]=lf("",void 0,"user",{shouldDecodeEncode:!1}),[t,s]=lf("",void 0,"all",{shouldDecodeEncode:!1}),[n]=cf(""),i=uf(n);return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(nl,{title:(0,b.__)("Colors"),description:(0,b.__)("Palette colors and the application of those colors on site elements.")}),(0,oe.jsx)("div",{className:"edit-site-global-styles-screen",children:(0,oe.jsxs)(y.__experimentalVStack,{spacing:7,children:[(0,oe.jsx)(af,{}),(0,oe.jsx)(df,{inheritedValue:t,value:e,onChange:s,settings:i})]})})]})};function hf(){const{paletteColors:e}=ie();return e.slice(0,4).map((({slug:e,color:t},s)=>(0,oe.jsx)("div",{style:{flexGrow:1,height:"100%",background:t}},`${e}-${s}`)))}const ff={start:{scale:1,opacity:1},hover:{scale:0,opacity:0}},mf=({label:e,isFocused:t,withHoverView:s})=>(0,oe.jsx)(Wa,{label:e,isFocused:t,withHoverView:s,children:({key:e})=>(0,oe.jsx)(y.__unstableMotion.div,{variants:ff,style:{height:"100%",overflow:"hidden"},children:(0,oe.jsx)(y.__experimentalHStack,{spacing:0,justify:"center",style:{height:"100%",overflow:"hidden"},children:(0,oe.jsx)(hf,{})})},e)});function gf({title:e,gap:t=2}){const s=["color"],n=ql(s);return n?.length<=1?null:(0,oe.jsxs)(y.__experimentalVStack,{spacing:3,children:[e&&(0,oe.jsx)(ml,{level:3,children:e}),(0,oe.jsx)(y.__experimentalGrid,{spacing:t,children:n.map(((e,t)=>(0,oe.jsx)(Ql,{variation:e,isPill:!0,properties:s,showTooltip:!0,children:()=>(0,oe.jsx)(mf,{})},t)))})]})}const{useGlobalSetting:vf}=te(x.privateApis),xf={placement:"bottom-start",offset:8};function yf({name:e}){const[t,s]=vf("color.palette.theme",e),[n]=vf("color.palette.theme",e,"base"),[i,r]=vf("color.palette.default",e),[o]=vf("color.palette.default",e,"base"),[a,l]=vf("color.palette.custom",e),[c]=vf("color.defaultPalette",e),u=(0,v.useViewportMatch)("small","<")?xf:void 0;return(0,oe.jsxs)(y.__experimentalVStack,{className:"edit-site-global-styles-color-palette-panel",spacing:8,children:[!!t&&!!t.length&&(0,oe.jsx)(y.__experimentalPaletteEdit,{canReset:t!==n,canOnlyChangeValues:!0,colors:t,onChange:s,paletteLabel:(0,b.__)("Theme"),paletteLabelHeadingLevel:3,popoverProps:u}),!!i&&!!i.length&&!!c&&(0,oe.jsx)(y.__experimentalPaletteEdit,{canReset:i!==o,canOnlyChangeValues:!0,colors:i,onChange:r,paletteLabel:(0,b.__)("Default"),paletteLabelHeadingLevel:3,popoverProps:u}),(0,oe.jsx)(y.__experimentalPaletteEdit,{colors:a,onChange:l,paletteLabel:(0,b.__)("Custom"),paletteLabelHeadingLevel:3,slugPrefix:"custom-",popoverProps:u}),(0,oe.jsx)(gf,{title:(0,b.__)("Palettes")})]})}const{useGlobalSetting:bf}=te(x.privateApis),wf={placement:"bottom-start",offset:8},_f=()=>{};function Sf({name:e}){const[t,s]=bf("color.gradients.theme",e),[n]=bf("color.gradients.theme",e,"base"),[i,r]=bf("color.gradients.default",e),[o]=bf("color.gradients.default",e,"base"),[a,l]=bf("color.gradients.custom",e),[c]=bf("color.defaultGradients",e),[u]=bf("color.duotone.custom")||[],[d]=bf("color.duotone.default")||[],[p]=bf("color.duotone.theme")||[],[h]=bf("color.defaultDuotone"),f=[...u||[],...p||[],...d&&h?d:[]],m=(0,v.useViewportMatch)("small","<")?wf:void 0;return(0,oe.jsxs)(y.__experimentalVStack,{className:"edit-site-global-styles-gradient-palette-panel",spacing:8,children:[!!t&&!!t.length&&(0,oe.jsx)(y.__experimentalPaletteEdit,{canReset:t!==n,canOnlyChangeValues:!0,gradients:t,onChange:s,paletteLabel:(0,b.__)("Theme"),paletteLabelHeadingLevel:3,popoverProps:m}),!!i&&!!i.length&&!!c&&(0,oe.jsx)(y.__experimentalPaletteEdit,{canReset:i!==o,canOnlyChangeValues:!0,gradients:i,onChange:r,paletteLabel:(0,b.__)("Default"),paletteLabelLevel:3,popoverProps:m}),(0,oe.jsx)(y.__experimentalPaletteEdit,{gradients:a,onChange:l,paletteLabel:(0,b.__)("Custom"),paletteLabelLevel:3,slugPrefix:"custom-",popoverProps:m}),!!f&&!!f.length&&(0,oe.jsxs)("div",{children:[(0,oe.jsx)(ml,{level:3,children:(0,b.__)("Duotone")}),(0,oe.jsx)(y.__experimentalSpacer,{margin:3}),(0,oe.jsx)(y.DuotonePicker,{duotonePalette:f,disableCustomDuotone:!0,disableCustomColors:!0,clearable:!1,onChange:_f})]})]})}const{Tabs:jf}=te(y.privateApis);const Cf=function({name:e}){return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(nl,{title:(0,b.__)("Edit palette"),description:(0,b.__)("The combination of colors used across the site and in color pickers.")}),(0,oe.jsxs)(jf,{children:[(0,oe.jsxs)(jf.TabList,{children:[(0,oe.jsx)(jf.Tab,{tabId:"color",children:(0,b.__)("Color")}),(0,oe.jsx)(jf.Tab,{tabId:"gradient",children:(0,b.__)("Gradient")})]}),(0,oe.jsx)(jf.TabPanel,{tabId:"color",focusable:!1,children:(0,oe.jsx)(yf,{name:e})}),(0,oe.jsx)(jf.TabPanel,{tabId:"gradient",focusable:!1,children:(0,oe.jsx)(Sf,{name:e})})]})]})},kf={backgroundSize:"auto"},{useGlobalStyle:Ef,useGlobalSetting:Pf,BackgroundPanel:If}=te(x.privateApis);function Tf(){const[e]=Ef("",void 0,"user",{shouldDecodeEncode:!1}),[t,s]=Ef("",void 0,"all",{shouldDecodeEncode:!1}),[n]=Pf("");return(0,oe.jsx)(If,{inheritedValue:t,value:e,onChange:s,settings:n,defaultValues:kf})}const{useHasBackgroundPanel:Of,useGlobalSetting:Af}=te(x.privateApis);const Mf=function(){const[e]=Af(""),t=Of(e);return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(nl,{title:(0,b.__)("Background"),description:(0,oe.jsx)(y.__experimentalText,{children:(0,b.__)("Set styles for the site’s background.")})}),t&&(0,oe.jsx)(Tf,{})]})},{useGlobalSetting:Nf}=te(x.privateApis),Vf="6px 6px 9px rgba(0, 0, 0, 0.2)";function Ff(){const[e]=Nf("shadow.presets.default"),[t]=Nf("shadow.defaultPresets"),[s]=Nf("shadow.presets.theme"),[n,i]=Nf("shadow.presets.custom");return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(nl,{title:(0,b.__)("Shadows"),description:(0,b.__)("Manage and create shadow styles for use across the site.")}),(0,oe.jsx)("div",{className:"edit-site-global-styles-screen",children:(0,oe.jsxs)(y.__experimentalVStack,{className:"edit-site-global-styles__shadows-panel",spacing:7,children:[t&&(0,oe.jsx)(Rf,{label:(0,b.__)("Default"),shadows:e||[],category:"default"}),s&&s.length>0&&(0,oe.jsx)(Rf,{label:(0,b.__)("Theme"),shadows:s||[],category:"theme"}),(0,oe.jsx)(Rf,{label:(0,b.__)("Custom"),shadows:n||[],category:"custom",canCreate:!0,onCreate:e=>{i([...n||[],e])}})]})})]})}function Rf({label:e,shadows:t,category:s,canCreate:n,onCreate:i}){return(0,oe.jsxs)(y.__experimentalVStack,{spacing:2,children:[(0,oe.jsxs)(y.__experimentalHStack,{justify:"space-between",children:[(0,oe.jsx)(y.Flex,{align:"center",className:"edit-site-global-styles__shadows-panel__title",children:(0,oe.jsx)(ml,{level:3,children:e})}),n&&(0,oe.jsx)(y.FlexItem,{className:"edit-site-global-styles__shadows-panel__options-container",children:(0,oe.jsx)(y.Button,{size:"small",icon:Xh,label:(0,b.__)("Add shadow"),onClick:()=>{(()=>{const e=Fa(t,"shadow-");i({name:(0,b.sprintf)((0,b.__)("Shadow %s"),e),shadow:Vf,slug:`shadow-${e}`})})()}})})]}),t.length>0&&(0,oe.jsx)(y.__experimentalItemGroup,{isBordered:!0,isSeparated:!0,children:t.map((e=>(0,oe.jsx)(Bf,{shadow:e,category:s},e.slug)))})]})}function Bf({shadow:e,category:t}){return(0,oe.jsx)(ba,{path:`/shadows/edit/${t}/${e.slug}`,"aria-label":(0,b.sprintf)("Edit shadow %s",e.name),icon:ja,children:e.name})}const Df=(0,oe.jsx)(Jt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Jt.Path,{d:"M7 11.5h10V13H7z"})});const{useGlobalSetting:zf}=te(x.privateApis),{DropdownMenuV2:Lf}=te(y.privateApis),Hf=[{label:(0,b.__)("Rename"),action:"rename"},{label:(0,b.__)("Delete"),action:"delete"}],Gf=[{label:(0,b.__)("Reset"),action:"reset"}];function Uf(){const{goBack:e,params:{category:t,slug:s}}=(0,y.__experimentalUseNavigator)(),[n,i]=zf(`shadow.presets.${t}`);(0,d.useEffect)((()=>{const t=n?.some((e=>e.slug===s));s&&!t&&e()}),[n,s,e]);const[r]=zf(`shadow.presets.${t}`,void 0,"base"),[o,a]=(0,d.useState)((()=>(n||[]).find((e=>e.slug===s)))),l=(0,d.useMemo)((()=>(r||[]).find((e=>e.slug===s))),[r,s]),[c,u]=(0,d.useState)(!1),[p,h]=(0,d.useState)(!1),[f,m]=(0,d.useState)(o.name);return o?(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsxs)(y.__experimentalHStack,{justify:"space-between",children:[(0,oe.jsx)(nl,{title:o.name}),(0,oe.jsx)(y.FlexItem,{children:(0,oe.jsx)(y.__experimentalSpacer,{marginTop:2,marginBottom:0,paddingX:4,children:(0,oe.jsx)(Lf,{trigger:(0,oe.jsx)(y.Button,{size:"small",icon:ma,label:(0,b.__)("Menu")}),children:("custom"===t?Hf:Gf).map((e=>(0,oe.jsx)(Lf.Item,{onClick:()=>(e=>{if("reset"===e){const e=n.map((e=>e.slug===s?l:e));a(l),i(e)}else"delete"===e?u(!0):"rename"===e&&h(!0)})(e.action),disabled:"reset"===e.action&&o.shadow===l.shadow,children:(0,oe.jsx)(Lf.ItemLabel,{children:e.label})},e.action)))})})})]}),(0,oe.jsxs)("div",{className:"edit-site-global-styles-screen",children:[(0,oe.jsx)(Wf,{shadow:o.shadow}),(0,oe.jsx)(qf,{shadow:o.shadow,onChange:e=>{a({...o,shadow:e});const t=n.map((t=>t.slug===s?{...o,shadow:e}:t));i(t)}})]}),c&&(0,oe.jsx)(y.__experimentalConfirmDialog,{isOpen:!0,onConfirm:()=>{i(n.filter((e=>e.slug!==s))),u(!1)},onCancel:()=>{u(!1)},confirmButtonText:(0,b.__)("Delete"),size:"medium",children:(0,b.sprintf)('Are you sure you want to delete "%s"?',o.name)}),p&&(0,oe.jsx)(y.Modal,{title:(0,b.__)("Rename"),onRequestClose:()=>h(!1),size:"small",children:(0,oe.jsxs)("form",{onSubmit:e=>{e.preventDefault(),(e=>{if(!e)return;const t=n.map((t=>t.slug===s?{...o,name:e}:t));a({...o,name:e}),i(t)})(f),h(!1)},children:[(0,oe.jsx)(y.__experimentalInputControl,{__next40pxDefaultSize:!0,autoComplete:"off",label:(0,b.__)("Name"),placeholder:(0,b.__)("Shadow name"),value:f,onChange:e=>m(e)}),(0,oe.jsx)(y.__experimentalSpacer,{marginBottom:6}),(0,oe.jsxs)(y.Flex,{className:"block-editor-shadow-edit-modal__actions",justify:"flex-end",expanded:!1,children:[(0,oe.jsx)(y.FlexItem,{children:(0,oe.jsx)(y.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>h(!1),children:(0,b.__)("Cancel")})}),(0,oe.jsx)(y.FlexItem,{children:(0,oe.jsx)(y.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",children:(0,b.__)("Save")})})]})]})})]}):(0,oe.jsx)(nl,{title:""})}function Wf({shadow:e}){const t={boxShadow:e};return(0,oe.jsx)(y.__experimentalSpacer,{marginBottom:4,marginTop:-2,children:(0,oe.jsx)(y.__experimentalHStack,{align:"center",justify:"center",className:"edit-site-global-styles__shadow-preview-panel",children:(0,oe.jsx)("div",{className:"edit-site-global-styles__shadow-preview-block",style:t})})})}function qf({shadow:e,onChange:t}){const s=(0,d.useMemo)((()=>function(e){return(e.match(/(?:[^,(]|\([^)]*\))+/g)||[]).map((e=>e.trim()))}(e)),[e]);return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(y.__experimentalVStack,{spacing:2,children:(0,oe.jsxs)(y.__experimentalHStack,{justify:"space-between",children:[(0,oe.jsx)(y.Flex,{align:"center",className:"edit-site-global-styles__shadows-panel__title",children:(0,oe.jsx)(ml,{level:3,children:(0,b.__)("Shadows")})}),(0,oe.jsx)(y.FlexItem,{className:"edit-site-global-styles__shadows-panel__options-container",children:(0,oe.jsx)(y.Button,{size:"small",icon:Xh,label:(0,b.__)("Add shadow"),onClick:()=>{s.push(Vf),t(s.join(", "))}})})]})}),(0,oe.jsx)(y.__experimentalSpacer,{}),(0,oe.jsx)(y.__experimentalItemGroup,{isBordered:!0,isSeparated:!0,children:s.map(((e,n)=>(0,oe.jsx)(Zf,{shadow:e,onChange:e=>((e,n)=>{s[e]=n,t(s.join(", "))})(n,e),canRemove:s.length>1,onRemove:()=>(e=>{s.splice(e,1),t(s.join(", "))})(n)},n)))})]})}function Zf({shadow:e,onChange:t,canRemove:s,onRemove:n}){const i=(0,d.useMemo)((()=>function(e){const t={x:"0",y:"0",blur:"0",spread:"0",color:"#000",inset:!1};if(!e)return t;if(e.includes("none"))return t;const s=/((?:^|\s+)(-?\d*\.?\d+(?:px|%|in|cm|mm|em|rem|ex|pt|pc|vh|vw|vmin|vmax|ch|lh)?)(?=\s|$)(?![^(]*\))){1,4}/g,n=e.match(s)||[];if(1!==n.length)return t;const i=n[0].split(" ").map((e=>e.trim())).filter((e=>e));if(i.length<2)return t;const r=e.match(/inset/gi)||[];if(r.length>1)return t;const o=1===r.length;let a=e.replace(s,"").trim();o&&(a=a.replace("inset","").replace("INSET","").trim());let l=(a.match(/^#([0-9a-f]{3}){1,2}$|^#([0-9a-f]{4}){1,2}$|^(?:rgb|hsl)a?\(?[\d*\.?\d+%?,?\/?\s]*\)$/gi)||[]).map((e=>e?.trim())).filter((e=>e));if(l.length>1)return t;if(0===l.length&&(l=a.trim().split(" ").filter((e=>e)),l.length>1))return t;const[c,u,d,p]=i;return{x:c,y:u,blur:d||t.blur,spread:p||t.spread,inset:o,color:a||t.color}}(e)),[e]),r=e=>{t(function(e){const t=`${e.x||"0px"} ${e.y||"0px"} ${e.blur||"0px"} ${e.spread||"0px"}`;return`${e.inset?"inset":""} ${t} ${e.color||""}`.trim()}(e))};return(0,oe.jsx)(y.Dropdown,{popoverProps:{placement:"left-start",offset:36,shift:!0},className:"edit-site-global-styles__shadow-editor__dropdown",renderToggle:({onToggle:e,isOpen:t})=>{const r={onClick:e,className:Ut("edit-site-global-styles__shadow-editor__dropdown-toggle",{"is-open":t}),"aria-expanded":t},o={onClick:n,className:Ut("edit-site-global-styles__shadow-editor__remove-button",{"is-open":t}),label:(0,b.__)("Remove shadow")};return(0,oe.jsxs)(y.__experimentalHStack,{align:"center",justify:"flex-start",spacing:0,children:[(0,oe.jsx)(y.FlexItem,{style:{flexGrow:1},children:(0,oe.jsx)(y.Button,{__next40pxDefaultSize:!0,icon:ja,...r,children:i.inset?(0,b.__)("Inner shadow"):(0,b.__)("Drop shadow")})}),s&&(0,oe.jsx)(y.FlexItem,{children:(0,oe.jsx)(y.Button,{__next40pxDefaultSize:!0,icon:Df,...o})})]})},renderContent:()=>(0,oe.jsx)(y.__experimentalDropdownContentWrapper,{paddingSize:"medium",className:"edit-site-global-styles__shadow-editor__dropdown-content",children:(0,oe.jsx)(Kf,{shadowObj:i,onChange:r})})})}function Kf({shadowObj:e,onChange:t}){const s=(s,n)=>{const i={...e,[s]:n};t(i)};return(0,oe.jsxs)(y.__experimentalVStack,{spacing:4,className:"edit-site-global-styles__shadow-editor-panel",children:[(0,oe.jsx)(y.ColorPalette,{clearable:!1,enableAlpha:!0,__experimentalIsRenderedInSidebar:!0,value:e.color,onChange:e=>s("color",e)}),(0,oe.jsxs)(y.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,value:e.inset?"inset":"outset",isBlock:!0,onChange:e=>s("inset","inset"===e),hideLabelFromVision:!0,__next40pxDefaultSize:!0,children:[(0,oe.jsx)(y.__experimentalToggleGroupControlOption,{value:"outset",label:(0,b.__)("Outset")}),(0,oe.jsx)(y.__experimentalToggleGroupControlOption,{value:"inset",label:(0,b.__)("Inset")})]}),(0,oe.jsxs)(y.__experimentalGrid,{columns:2,gap:4,children:[(0,oe.jsx)(Yf,{label:(0,b.__)("X Position"),value:e.x,onChange:e=>s("x",e)}),(0,oe.jsx)(Yf,{label:(0,b.__)("Y Position"),value:e.y,onChange:e=>s("y",e)}),(0,oe.jsx)(Yf,{label:(0,b.__)("Blur"),value:e.blur,onChange:e=>s("blur",e)}),(0,oe.jsx)(Yf,{label:(0,b.__)("Spread"),value:e.spread,onChange:e=>s("spread",e)})]})]})}function Yf({label:e,value:t,onChange:s}){return(0,oe.jsx)(y.__experimentalUnitControl,{label:e,__next40pxDefaultSize:!0,value:t,onChange:e=>{const t=void 0!==e&&!isNaN(parseFloat(e));s(t?e:"0px")}})}function Xf(){return(0,oe.jsx)(Ff,{})}function Jf(){return(0,oe.jsx)(Uf,{})}const{useGlobalStyle:Qf,useGlobalSetting:$f,useSettingsForBlockElement:em,DimensionsPanel:tm}=te(x.privateApis),sm={contentSize:!0,wideSize:!0,padding:!0,margin:!0,blockGap:!0,minHeight:!0,childLayout:!1};function nm(){const[e]=Qf("",void 0,"user",{shouldDecodeEncode:!1}),[t,s]=Qf("",void 0,"all",{shouldDecodeEncode:!1}),[n]=$f("",void 0,"user"),[i,r]=$f(""),o=em(i),a=(0,d.useMemo)((()=>({...t,layout:o.layout})),[t,o.layout]),l=(0,d.useMemo)((()=>({...e,layout:n.layout})),[e,n.layout]);return(0,oe.jsx)(tm,{inheritedValue:a,value:l,onChange:e=>{const t={...e};if(delete t.layout,s(t),e.layout!==n.layout){const t={...n,layout:e.layout};t.layout?.definitions&&delete t.layout.definitions,r(t)}},settings:o,includeLayoutControls:!0,defaultControls:sm})}const{useHasDimensionsPanel:im,useGlobalSetting:rm,useSettingsForBlockElement:om}=te(x.privateApis);const am=function(){const[e]=rm(""),t=om(e),s=im(t);return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(nl,{title:(0,b.__)("Layout")}),s&&(0,oe.jsx)(nm,{})]})},{GlobalStylesContext:lm}=te(x.privateApis);function cm({gap:e=2}){const{user:t}=(0,d.useContext)(lm),[s,n]=(0,d.useState)(t),i=s?.styles;(0,d.useEffect)((()=>{n(t)}),[t]);const r=(0,l.useSelect)((e=>e(_.store).__experimentalGetCurrentThemeGlobalStylesVariations()),[]),o=r?.filter((e=>!Kl(e,["color"])&&!Kl(e,["typography","spacing"]))),a=(0,d.useMemo)((()=>[...[{title:(0,b.__)("Default"),settings:{},styles:{}},...null!=o?o:[]].map((e=>{var t;const s={...e?.styles?.blocks}||{};i?.blocks&&Object.keys(i.blocks).forEach((e=>{if(i.blocks[e].css){const t=s[e]||{},n={css:`${s[e]?.css||""} ${i.blocks[e].css.trim()||""}`};s[e]={...t,...n}}}));const n=i?.css||e.styles?.css?{css:`${e.styles?.css||""} ${i?.css||""}`}:{},r=Object.keys(s).length>0?{blocks:s}:{},o={...e.styles,...n,...r};return{...e,settings:null!==(t=e.settings)&&void 0!==t?t:{},styles:o}}))]),[o,i?.blocks,i?.css]);return!o||o?.length<1?null:(0,oe.jsx)(y.__experimentalGrid,{columns:2,className:"edit-site-global-styles-style-variations-container",gap:e,children:a.map(((e,t)=>(0,oe.jsx)(Ql,{variation:e,children:t=>(0,oe.jsx)(Xa,{label:e?.title,withHoverView:!0,isFocused:t,variation:e})},t)))})}const um=()=>{};function dm(){const{storedSettings:e}=(0,l.useSelect)((e=>{const{getSettings:t}=te(e(zt));return{storedSettings:t()}}),[]);return(0,oe.jsx)(x.BlockEditorProvider,{settings:e,onChange:um,onInput:um,children:(0,oe.jsxs)(y.__experimentalVStack,{spacing:10,className:"edit-site-global-styles-variation-container",children:[(0,oe.jsx)(cm,{gap:3}),(0,oe.jsx)(gf,{title:(0,b.__)("Palettes"),gap:3}),(0,oe.jsx)($l,{title:(0,b.__)("Typography"),gap:3})]})})}const{useZoomOut:pm}=te(x.privateApis);const hm=function(){const{setDeviceType:e}=(0,l.useDispatch)(h.store);return pm(),e("desktop"),(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(nl,{title:(0,b.__)("Browse styles"),description:(0,b.__)("Choose a variation to change the look of the site.")}),(0,oe.jsx)(y.Card,{size:"small",isBorderless:!0,className:"edit-site-global-styles-screen-style-variations",children:(0,oe.jsx)(y.CardBody,{children:(0,oe.jsx)(dm,{})})})]})},fm=(0,oe.jsx)(Jt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Jt.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"})}),{EditorContentSlotFill:mm,ResizableEditor:gm}=te(h.privateApis);function vm(e){switch(e){case"style-book":return(0,b.__)("Style Book");case"global-styles-revisions":case"global-styles-revisions:style-book":return(0,b.__)("Style Revisions");default:return""}}function xm(){const e=(0,y.__experimentalUseSlotFills)(mm.privateKey);return!!e?.length}const ym=function({children:e,closeButtonLabel:t,onClose:s,enableResizing:n=!1}){const{editorCanvasContainerView:i,showListViewByDefault:r}=(0,l.useSelect)((e=>({editorCanvasContainerView:te(e(zt)).getEditorCanvasContainerView(),showListViewByDefault:e(f.store).get("core","showListViewByDefault")})),[]),[o,a]=(0,d.useState)(!1),{setEditorCanvasContainerView:c}=te((0,l.useDispatch)(zt)),{setIsListViewOpened:u}=(0,l.useDispatch)(h.store),p=(0,v.useFocusOnMount)("firstElement"),m=(0,v.useFocusReturn)();function g(){u(r),c(void 0),a(!0),"function"==typeof s&&s()}const x=Array.isArray(e)?d.Children.map(e,((e,t)=>0===t?(0,d.cloneElement)(e,{ref:m}):e)):(0,d.cloneElement)(e,{ref:m});if(o)return null;const w=vm(i),_=s||t;return(0,oe.jsx)(mm.Fill,{children:(0,oe.jsx)("div",{className:"edit-site-editor-canvas-container",children:(0,oe.jsx)(gm,{enableResizing:n,children:(0,oe.jsxs)("section",{className:"edit-site-editor-canvas-container__section",ref:_?p:null,onKeyDown:function(e){e.keyCode!==$t.ESCAPE||e.defaultPrevented||(e.preventDefault(),g())},"aria-label":w,children:[_&&(0,oe.jsx)(y.Button,{__next40pxDefaultSize:!0,className:"edit-site-editor-canvas-container__close-button",icon:fm,label:t||(0,b.__)("Close"),onClick:g}),x]})})})})},{ExperimentalBlockEditorProvider:bm,useGlobalStyle:wm,GlobalStylesContext:_m,useGlobalStylesOutputWithConfig:Sm}=te(x.privateApis),{mergeBaseAndUserConfigs:jm}=te(h.privateApis),{Tabs:Cm}=te(y.privateApis);function km(e){return!e||0===Object.keys(e).length}function Em(){const e=(0,o.getBlockTypes)().filter((e=>{const{name:t,example:s,supports:n}=e;return"core/heading"!==t&&!!s&&!1!==n.inserter})).map((e=>({name:e.name,title:e.title,category:e.category,blocks:(0,o.getBlockFromExample)(e.name,e.example)})));if(!!!(0,o.getBlockType)("core/heading"))return e;return[{name:"core/heading",title:(0,b.__)("Headings"),category:"text",blocks:[1,2,3,4,5,6].map((e=>(0,o.createBlock)("core/heading",{content:(0,b.sprintf)((0,b.__)("Heading %d"),e),level:e})))},...e]}const Pm=({category:e,examples:t,isSelected:s,onClick:n,onSelect:i,settings:r,sizes:o,title:a})=>{const[l,c]=(0,d.useState)(!1),u={role:"button",onFocus:()=>c(!0),onBlur:()=>c(!1),onKeyDown:e=>{if(e.defaultPrevented)return;const{keyCode:t}=e;!n||t!==$t.ENTER&&t!==$t.SPACE||(e.preventDefault(),n(e))},onClick:e=>{e.defaultPrevented||n&&(e.preventDefault(),n(e))},readonly:!0},p=n?"body { cursor: pointer; } body * { pointer-events: none; }":"";return(0,oe.jsxs)(x.__unstableIframe,{className:Ut("edit-site-style-book__iframe",{"is-focused":l&&!!n,"is-button":!!n}),name:"style-book-canvas",tabIndex:0,...n?u:{},children:[(0,oe.jsx)(x.__unstableEditorStyles,{styles:r.styles}),(0,oe.jsx)("style",{children:'.is-root-container { display: flow-root; }\n\t\t\t\t\t\tbody { position: relative; padding: 32px !important; }\n\t.edit-site-style-book__examples {\n\t\tmax-width: 900px;\n\t\tmargin: 0 auto;\n\t}\n\n\t.edit-site-style-book__example {\n\t\tborder-radius: 2px;\n\t\tcursor: pointer;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tgap: 40px;\n\t\tmargin-bottom: 40px;\n\t\tpadding: 16px;\n\t\twidth: 100%;\n\t\tbox-sizing: border-box;\n\t\tscroll-margin-top: 32px;\n\t\tscroll-margin-bottom: 32px;\n\t}\n\n\t.edit-site-style-book__example.is-selected {\n\t\tbox-shadow: 0 0 0 1px var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba));\n\t}\n\n\t.edit-site-style-book__example:focus:not(:disabled) {\n\t\tbox-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba));\n\t\toutline: 3px solid transparent;\n\t}\n\n\t.edit-site-style-book__examples.is-wide .edit-site-style-book__example {\n\t\tflex-direction: row;\n\t}\n\n\t.edit-site-style-book__example-title {\n\t\tfont-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;\n\t\tfont-size: 11px;\n\t\tfont-weight: 500;\n\t\tline-height: normal;\n\t\tmargin: 0;\n\t\ttext-align: left;\n\t\ttext-transform: uppercase;\n\t}\n\n\t.edit-site-style-book__examples.is-wide .edit-site-style-book__example-title {\n\t\ttext-align: right;\n\t\twidth: 120px;\n\t}\n\n\t.edit-site-style-book__example-preview {\n\t\twidth: 100%;\n\t}\n\n\t.edit-site-style-book__example-preview .block-editor-block-list__insertion-point,\n\t.edit-site-style-book__example-preview .block-list-appender {\n\t\tdisplay: none;\n\t}\n\n\t.edit-site-style-book__example-preview .is-root-container > .wp-block:first-child {\n\t\tmargin-top: 0;\n\t}\n\t.edit-site-style-book__example-preview .is-root-container > .wp-block:last-child {\n\t\tmargin-bottom: 0;\n\t}\n'+p}),(0,oe.jsx)(Im,{className:Ut("edit-site-style-book__examples",{"is-wide":o.width>600}),examples:t,category:e,label:a?(0,b.sprintf)((0,b.__)("Examples of blocks in the %s category"),a):(0,b.__)("Examples of blocks"),isSelected:s,onSelect:i},e)]})},Im=(0,d.memo)((({className:e,examples:t,category:s,label:n,isSelected:i,onSelect:r})=>(0,oe.jsx)(y.Composite,{orientation:"vertical",className:e,"aria-label":n,role:"grid",children:t.filter((e=>!s||e.category===s)).map((e=>(0,oe.jsx)(Tm,{id:`example-${e.name}`,title:e.title,blocks:e.blocks,isSelected:i(e.name),onClick:()=>{r?.(e.name)}},e.name)))}))),Tm=({id:e,title:t,blocks:s,isSelected:n,onClick:i})=>{const r=(0,l.useSelect)((e=>e(x.store).getSettings()),[]),o=(0,d.useMemo)((()=>({...r,focusMode:!1,__unstableIsPreviewMode:!0})),[r]),a=(0,d.useMemo)((()=>Array.isArray(s)?s:[s]),[s]);return(0,oe.jsx)("div",{role:"row",children:(0,oe.jsx)("div",{role:"gridcell",children:(0,oe.jsxs)(y.Composite.Item,{className:Ut("edit-site-style-book__example",{"is-selected":n}),id:e,"aria-label":(0,b.sprintf)((0,b.__)("Open %s styles in Styles panel"),t),render:(0,oe.jsx)("div",{}),role:"button",onClick:i,children:[(0,oe.jsx)("span",{className:"edit-site-style-book__example-title",children:t}),(0,oe.jsx)("div",{className:"edit-site-style-book__example-preview","aria-hidden":!0,children:(0,oe.jsx)(y.Disabled,{className:"edit-site-style-book__example-preview__content",children:(0,oe.jsx)(bm,{value:a,settings:o,children:(0,oe.jsx)(x.BlockList,{renderAppender:!1})})})})]})})})},Om=function({enableResizing:e=!0,isSelected:t,onClick:s,onSelect:n,showCloseButton:i=!0,onClose:r,showTabs:a=!0,userConfig:c={}}){const[u,p]=(0,v.useResizeObserver)(),[h]=wm("color.text"),[f]=wm("color.background"),[m]=(0,d.useState)(Em),g=(0,d.useMemo)((()=>(0,o.getCategories)().filter((e=>m.some((t=>t.category===e.slug)))).map((e=>({name:e.slug,title:e.title,icon:e.icon})))),[m]),{base:y}=(0,d.useContext)(_m),w=(0,d.useMemo)((()=>km(c)||km(y)?{}:jm(y,c)),[y,c]),_=(0,l.useSelect)((e=>e(x.store).getSettings()),[]),S=(0,d.useMemo)((()=>({..._,__unstableIsPreviewMode:!0})),[_]),[j]=Sm(w);return S.styles=km(j)||km(c)?S.styles:j,(0,oe.jsx)(ym,{onClose:r,enableResizing:e,closeButtonLabel:i?(0,b.__)("Close"):null,children:(0,oe.jsxs)("div",{className:Ut("edit-site-style-book",{"is-wide":p.width>600,"is-button":!!s}),style:{color:h,background:f},children:[u,a?(0,oe.jsx)("div",{className:"edit-site-style-book__tabs",children:(0,oe.jsxs)(Cm,{children:[(0,oe.jsx)(Cm.TabList,{children:g.map((e=>(0,oe.jsx)(Cm.Tab,{tabId:e.name,children:e.title},e.name)))}),g.map((e=>(0,oe.jsx)(Cm.TabPanel,{tabId:e.name,focusable:!1,children:(0,oe.jsx)(Pm,{category:e.name,examples:m,isSelected:t,onSelect:n,settings:S,sizes:p,title:e.title})},e.name)))]})}):(0,oe.jsx)(Pm,{examples:m,isSelected:t,onClick:s,onSelect:n,settings:S,sizes:p})]})})},{useGlobalStyle:Am,AdvancedPanel:Mm}=te(x.privateApis);const Nm=function(){const e=(0,b.__)("Add your own CSS to customize the appearance and layout of your site."),[t]=Am("",void 0,"user",{shouldDecodeEncode:!1}),[s,n]=Am("",void 0,"all",{shouldDecodeEncode:!1});return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(nl,{title:(0,b.__)("CSS"),description:(0,oe.jsxs)(oe.Fragment,{children:[e,(0,oe.jsx)(y.ExternalLink,{href:(0,b.__)("https://developer.wordpress.org/advanced-administration/wordpress/css/"),className:"edit-site-global-styles-screen-css-help-link",children:(0,b.__)("Learn more about CSS")})]})}),(0,oe.jsx)("div",{className:"edit-site-global-styles-screen-css",children:(0,oe.jsx)(Mm,{value:t,onChange:n,inheritedValue:s})})]})},{ExperimentalBlockEditorProvider:Vm,GlobalStylesContext:Fm,useGlobalStylesOutputWithConfig:Rm,__unstableBlockStyleVariationOverridesWithConfig:Bm}=te(x.privateApis),{mergeBaseAndUserConfigs:Dm}=te(h.privateApis);function zm(e){return!e||0===Object.keys(e).length}const Lm=function({userConfig:e,blocks:t}){const{base:s}=(0,d.useContext)(Fm),n=(0,d.useMemo)((()=>zm(e)||zm(s)?{}:Dm(s,e)),[s,e]),i=(0,d.useMemo)((()=>Array.isArray(t)?t:[t]),[t]),r=(0,l.useSelect)((e=>e(x.store).getSettings()),[]),o=(0,d.useMemo)((()=>({...r,__unstableIsPreviewMode:!0})),[r]),[a]=Rm(n),c=zm(a)||zm(e)?o.styles:a;return(0,oe.jsx)(ym,{title:(0,b.__)("Revisions"),closeButtonLabel:(0,b.__)("Close revisions"),enableResizing:!0,children:(0,oe.jsxs)(x.__unstableIframe,{className:"edit-site-revisions__iframe",name:"revisions",tabIndex:0,children:[(0,oe.jsx)("style",{children:".is-root-container { display: flow-root; }"}),(0,oe.jsx)(y.Disabled,{className:"edit-site-revisions__example-preview__content",children:(0,oe.jsxs)(Vm,{value:i,settings:o,children:[(0,oe.jsx)(x.BlockList,{renderAppender:!1}),(0,oe.jsx)(x.__unstableEditorStyles,{styles:c}),(0,oe.jsx)(Bm,{config:n})]})})]})})},Hm={per_page:-1,_fields:"id,name,avatar_urls",context:"view",capabilities:["edit_theme_options"]},Gm={per_page:100,page:1},Um=[],{GlobalStylesContext:Wm}=te(x.privateApis);function qm({query:e}={}){const{user:t}=(0,d.useContext)(Wm),s={...Gm,...e},{authors:n,currentUser:i,isDirty:r,revisions:o,isLoadingGlobalStylesRevisions:a,revisionsCount:c}=(0,l.useSelect)((e=>{var t;const{__experimentalGetDirtyEntityRecords:n,getCurrentUser:i,getUsers:r,getRevisions:o,__experimentalGetCurrentGlobalStylesId:a,getEntityRecord:l,isResolving:c}=e(_.store),u=n(),d=i(),p=u.length>0,h=a(),f=h?l("root","globalStyles",h):void 0,m=null!==(t=f?._links?.["version-history"]?.[0]?.count)&&void 0!==t?t:0,g=o("root","globalStyles",h,s)||Um;return{authors:r(Hm)||Um,currentUser:d,isDirty:p,revisions:g,isLoadingGlobalStylesRevisions:c("getRevisions",["root","globalStyles",h,s]),revisionsCount:m}}),[e]);return(0,d.useMemo)((()=>{if(!n.length||a)return{revisions:Um,hasUnsavedChanges:r,isLoading:!0,revisionsCount:c};const e=o.map((e=>({...e,author:n.find((t=>t.id===e.author))})));if(o.length){if("unsaved"!==e[0].id&&1===s.page&&(e[0].isLatest=!0),r&&t&&Object.keys(t).length>0&&i&&1===s.page){const s={id:"unsaved",styles:t?.styles,settings:t?.settings,_links:t?._links,author:{name:i?.name,avatar_urls:i?.avatar_urls},modified:new Date};e.unshift(s)}s.page===Math.ceil(c/s.per_page)&&e.push({id:"parent",styles:{},settings:{}})}return{revisions:e,hasUnsavedChanges:r,isLoading:!1,revisionsCount:c}}),[r,o,i,n,t,a])}const Zm=window.wp.date,{getGlobalStylesChanges:Km}=te(x.privateApis);function Ym({revision:e,previousRevision:t}){const s=Km(e,t,{maxResults:7});return s.length?(0,oe.jsx)("ul",{"data-testid":"global-styles-revision-changes",className:"edit-site-global-styles-screen-revisions__changes",children:s.map((e=>(0,oe.jsx)("li",{children:e},e)))}):null}const Xm=function({userRevisions:e,selectedRevisionId:t,onChange:s,canApplyRevision:n,onApplyRevision:i}){const{currentThemeName:r,currentUser:o}=(0,l.useSelect)((e=>{const{getCurrentTheme:t,getCurrentUser:s}=e(_.store),n=t();return{currentThemeName:n?.name?.rendered||n?.stylesheet,currentUser:s()}}),[]),a=(0,Zm.getDate)().getTime(),{datetimeAbbreviated:c}=(0,Zm.getSettings)().formats;return(0,oe.jsx)("ol",{className:"edit-site-global-styles-screen-revisions__revisions-list","aria-label":(0,b.__)("Global styles revisions list"),role:"group",children:e.map(((l,u)=>{const{id:d,author:p,modified:h}=l,f="unsaved"===d,m=f?o:p,g=m?.name||(0,b.__)("User"),v=m?.avatar_urls?.[48],x=t?t===d:0===u,w=!n&&x,_="parent"===d,S=(0,Zm.getDate)(h),j=h&&a-S.getTime()>864e5?(0,Zm.dateI18n)(c,S):(0,Zm.humanTimeDiff)(h),C=function(e,t,s,n){return"parent"===e?(0,b.__)("Reset the styles to the theme defaults"):"unsaved"===e?(0,b.sprintf)((0,b.__)("Unsaved changes by %s"),t):n?(0,b.sprintf)((0,b.__)("Changes saved by %1$s on %2$s. This revision matches current editor styles."),t,s):(0,b.sprintf)((0,b.__)("Changes saved by %1$s on %2$s"),t,s)}(d,g,(0,Zm.dateI18n)(c,S),w);return(0,oe.jsxs)("li",{className:Ut("edit-site-global-styles-screen-revisions__revision-item",{"is-selected":x,"is-active":w,"is-reset":_}),"aria-current":x,children:[(0,oe.jsx)(y.Button,{__next40pxDefaultSize:!0,className:"edit-site-global-styles-screen-revisions__revision-button",accessibleWhenDisabled:!0,disabled:x,onClick:()=>{s(l)},"aria-label":C,children:_?(0,oe.jsxs)("span",{className:"edit-site-global-styles-screen-revisions__description",children:[(0,b.__)("Default styles"),(0,oe.jsx)("span",{className:"edit-site-global-styles-screen-revisions__meta",children:r})]}):(0,oe.jsxs)("span",{className:"edit-site-global-styles-screen-revisions__description",children:[f?(0,oe.jsx)("span",{className:"edit-site-global-styles-screen-revisions__date",children:(0,b.__)("(Unsaved)")}):(0,oe.jsx)("time",{className:"edit-site-global-styles-screen-revisions__date",dateTime:h,children:j}),(0,oe.jsxs)("span",{className:"edit-site-global-styles-screen-revisions__meta",children:[(0,oe.jsx)("img",{alt:g,src:v}),g]}),x&&(0,oe.jsx)(Ym,{revision:l,previousRevision:us(1),accessibleWhenDisabled:!0,disabled:r||1===e,label:(0,b.__)("First page"),icon:(0,b.isRTL)()?Jm:Qm,size:"compact"}),(0,oe.jsx)(y.Button,{variant:o,onClick:()=>s(e-1),accessibleWhenDisabled:!0,disabled:r||1===e,label:(0,b.__)("Previous page"),icon:(0,b.isRTL)()?va:ga,size:"compact"})]}),(0,oe.jsx)(y.__experimentalText,{variant:"muted",children:(0,b.sprintf)((0,b._x)("%1$s of %2$s","paging"),e,t)}),(0,oe.jsxs)(y.__experimentalHStack,{expanded:!1,spacing:1,children:[(0,oe.jsx)(y.Button,{variant:o,onClick:()=>s(e+1),accessibleWhenDisabled:!0,disabled:r||e===t,label:(0,b.__)("Next page"),icon:(0,b.isRTL)()?ga:va,size:"compact"}),(0,oe.jsx)(y.Button,{variant:o,onClick:()=>s(t),accessibleWhenDisabled:!0,disabled:r||e===t,label:(0,b.__)("Last page"),icon:(0,b.isRTL)()?Qm:Jm,size:"compact"})]})]})}const{GlobalStylesContext:eg,areGlobalStyleConfigsEqual:tg}=te(x.privateApis);const sg=function(){const{goTo:e}=(0,y.__experimentalUseNavigator)(),{user:t,setUserConfig:s}=(0,d.useContext)(eg),{blocks:n,editorCanvasContainerView:i}=(0,l.useSelect)((e=>({editorCanvasContainerView:te(e(zt)).getEditorCanvasContainerView(),blocks:e(x.store).getBlocks()})),[]),[r,o]=(0,d.useState)(1),[a,c]=(0,d.useState)([]),{revisions:u,isLoading:p,hasUnsavedChanges:h,revisionsCount:f}=qm({query:{per_page:10,page:r}}),m=Math.ceil(f/10),[g,v]=(0,d.useState)(t),[w,_]=(0,d.useState)(!1),{setEditorCanvasContainerView:S}=te((0,l.useDispatch)(zt)),j=tg(g,t),C=()=>{e("/");S("global-styles-revisions:style-book"===i?"style-book":void 0)},k=e=>{s((()=>e)),_(!1),C()};(0,d.useEffect)((()=>{i&&i.startsWith("global-styles-revisions")||e("/")}),[i]),(0,d.useEffect)((()=>{!p&&u.length&&c(u)}),[u,p]);const E=u[0],P=g?.id,I=!!E?.id&&!j&&!P;(0,d.useEffect)((()=>{I&&v(E)}),[I,E]);const T=!!P&&"unsaved"!==P&&!j,O=!!a.length;return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(nl,{title:f&&(0,b.sprintf)((0,b.__)("Revisions (%s)"),f),description:(0,b.__)('Click on previously saved styles to preview them. To restore a selected version to the editor, hit "Apply." When you\'re ready, use the Save button to save your changes.'),onBack:C}),!O&&(0,oe.jsx)(y.Spinner,{className:"edit-site-global-styles-screen-revisions__loading"}),O&&("global-styles-revisions:style-book"===i?(0,oe.jsx)(Om,{userConfig:g,isSelected:()=>{},onClose:()=>{S("global-styles-revisions")}}):(0,oe.jsx)(Lm,{blocks:n,userConfig:g,closeButtonLabel:(0,b.__)("Close revisions")})),(0,oe.jsx)(Xm,{onChange:v,selectedRevisionId:P,userRevisions:a,canApplyRevision:T,onApplyRevision:()=>h?_(!0):k(g)}),m>1&&(0,oe.jsx)("div",{className:"edit-site-global-styles-screen-revisions__footer",children:(0,oe.jsx)($m,{className:"edit-site-global-styles-screen-revisions__pagination",currentPage:r,numPages:m,changePage:o,totalItems:f,disabled:p,label:(0,b.__)("Global Styles pagination navigation")})}),w&&(0,oe.jsx)(y.__experimentalConfirmDialog,{isOpen:w,confirmButtonText:(0,b.__)("Apply"),onConfirm:()=>k(g),onCancel:()=>_(!1),size:"medium",children:(0,b.__)("Are you sure you want to apply this revision? Any unsaved changes will be lost.")})]})},{useGlobalStylesReset:ng}=te(x.privateApis),{Slot:ig,Fill:rg}=(0,y.createSlotFill)("GlobalStylesMenu");function og(){const[e,t]=ng(),{toggle:s}=(0,l.useDispatch)(f.store),{canEditCSS:n}=(0,l.useSelect)((e=>{const{getEntityRecord:t,__experimentalGetCurrentGlobalStylesId:s}=e(_.store),n=s(),i=n?t("root","globalStyles",n):void 0;return{canEditCSS:!!i?._links?.["wp:action-edit-css"]}}),[]),{setEditorCanvasContainerView:i}=te((0,l.useDispatch)(zt)),{goTo:r}=(0,y.__experimentalUseNavigator)(),o=()=>{i("global-styles-css"),r("/css")};return(0,oe.jsx)(rg,{children:(0,oe.jsx)(y.DropdownMenu,{icon:ma,label:(0,b.__)("More"),toggleProps:{size:"compact"},children:({onClose:i})=>(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsxs)(y.MenuGroup,{children:[n&&(0,oe.jsx)(y.MenuItem,{onClick:o,children:(0,b.__)("Additional CSS")}),(0,oe.jsx)(y.MenuItem,{onClick:()=>{s("core/edit-site","welcomeGuideStyles"),i()},children:(0,b.__)("Welcome Guide")})]}),(0,oe.jsx)(y.MenuGroup,{children:(0,oe.jsx)(y.MenuItem,{onClick:()=>{t(),i()},disabled:!e,children:(0,b.__)("Reset styles")})})]})})})}function ag({className:e,...t}){return(0,oe.jsx)(y.__experimentalNavigatorScreen,{className:["edit-site-global-styles-sidebar__navigator-screen",e].filter(Boolean).join(" "),...t})}function lg({parentMenu:e,blockStyles:t,blockName:s}){return t.map(((t,n)=>(0,oe.jsx)(ag,{path:e+"/variations/"+t.name,children:(0,oe.jsx)(Fl,{name:s,variation:t.name})},n)))}function cg({name:e,parentMenu:t=""}){const s=(0,l.useSelect)((t=>{const{getBlockStyles:s}=t(o.store);return s(e)}),[e]);return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(ag,{path:t+"/colors/palette",children:(0,oe.jsx)(Cf,{name:e})}),!!s?.length&&(0,oe.jsx)(lg,{parentMenu:t,blockStyles:s,blockName:e})]})}function ug(){const e=(0,y.__experimentalUseNavigator)(),{path:t}=e.location;return(0,oe.jsx)(Om,{isSelected:e=>t===`/blocks/${encodeURIComponent(e)}`||t.startsWith(`/blocks/${encodeURIComponent(e)}/`),onSelect:t=>{e.goTo("/blocks/"+encodeURIComponent(t))}})}function dg(){const e=(0,y.__experimentalUseNavigator)(),{selectedBlockName:t,selectedBlockClientId:s}=(0,l.useSelect)((e=>{const{getSelectedBlockClientId:t,getBlockName:s}=e(x.store),n=t();return{selectedBlockName:s(n),selectedBlockClientId:n}}),[]),n=ul(t);(0,d.useEffect)((()=>{if(!s||!n)return;const i=e.location.path;if("/blocks"!==i&&!i.startsWith("/blocks/"))return;const r="/blocks/"+encodeURIComponent(t);r!==i&&e.goTo(r,{skipFocus:!0})}),[s,t,n])}function pg(){const{goTo:e,location:t}=(0,y.__experimentalUseNavigator)(),s=(0,l.useSelect)((e=>te(e(zt)).getEditorCanvasContainerView()),[]),n=t?.path,i="/revisions"===n;(0,d.useEffect)((()=>{switch(s){case"global-styles-revisions":case"global-styles-revisions:style-book":e("/revisions");break;case"global-styles-css":e("/css");break;case"style-book":i&&e("/")}}),[s,i,e])}const hg=function(){const e=(0,o.getBlockTypes)(),t=(0,l.useSelect)((e=>te(e(zt)).getEditorCanvasContainerView()),[]);return(0,oe.jsxs)(y.__experimentalNavigatorProvider,{className:"edit-site-global-styles-sidebar__navigator-provider",initialPath:"/",children:[(0,oe.jsx)(ag,{path:"/",children:(0,oe.jsx)(Qa,{})}),(0,oe.jsx)(ag,{path:"/variations",children:(0,oe.jsx)(hm,{})}),(0,oe.jsx)(ag,{path:"/blocks",children:(0,oe.jsx)(hl,{})}),(0,oe.jsx)(ag,{path:"/typography",children:(0,oe.jsx)(Oh,{})}),(0,oe.jsx)(ag,{path:"/typography/font-sizes/",children:(0,oe.jsx)(tf,{})}),(0,oe.jsx)(ag,{path:"/typography/font-sizes/:origin/:slug",children:(0,oe.jsx)(Yh,{})}),(0,oe.jsx)(ag,{path:"/typography/text",children:(0,oe.jsx)(zh,{element:"text"})}),(0,oe.jsx)(ag,{path:"/typography/link",children:(0,oe.jsx)(zh,{element:"link"})}),(0,oe.jsx)(ag,{path:"/typography/heading",children:(0,oe.jsx)(zh,{element:"heading"})}),(0,oe.jsx)(ag,{path:"/typography/caption",children:(0,oe.jsx)(zh,{element:"caption"})}),(0,oe.jsx)(ag,{path:"/typography/button",children:(0,oe.jsx)(zh,{element:"button"})}),(0,oe.jsx)(ag,{path:"/colors",children:(0,oe.jsx)(pf,{})}),(0,oe.jsx)(ag,{path:"/shadows",children:(0,oe.jsx)(Xf,{})}),(0,oe.jsx)(ag,{path:"/shadows/edit/:category/:slug",children:(0,oe.jsx)(Jf,{})}),(0,oe.jsx)(ag,{path:"/layout",children:(0,oe.jsx)(am,{})}),(0,oe.jsx)(ag,{path:"/css",children:(0,oe.jsx)(Nm,{})}),(0,oe.jsx)(ag,{path:"/revisions",children:(0,oe.jsx)(sg,{})}),(0,oe.jsx)(ag,{path:"/background",children:(0,oe.jsx)(Mf,{})}),e.map((e=>(0,oe.jsx)(ag,{path:"/blocks/"+encodeURIComponent(e.name),children:(0,oe.jsx)(Fl,{name:e.name})},"menu-block-"+e.name))),(0,oe.jsx)(cg,{}),e.map((e=>(0,oe.jsx)(cg,{name:e.name,parentMenu:"/blocks/"+encodeURIComponent(e.name)},"screens-block-"+e.name))),"style-book"===t&&(0,oe.jsx)(ug,{}),(0,oe.jsx)(og,{}),(0,oe.jsx)(dg,{}),(0,oe.jsx)(pg,{})]})},{ComplementaryArea:fg,ComplementaryAreaMoreMenuItem:mg}=te(h.privateApis);function gg({className:e,identifier:t,title:s,icon:n,children:i,closeLabel:r,header:o,headerClassName:a,panelClassName:l,isActiveByDefault:c}){return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(fg,{className:e,scope:"core",identifier:t,title:s,smallScreenTitle:s,icon:n,closeLabel:r,header:o,headerClassName:a,panelClassName:l,isActiveByDefault:c,children:i}),(0,oe.jsx)(mg,{scope:"core",identifier:t,icon:n,children:s})]})}const{interfaceStore:vg}=te(h.privateApis);function xg(){const{shouldClearCanvasContainerView:e,isStyleBookOpened:t,showListViewByDefault:s,hasRevisions:n,isRevisionsOpened:i,isRevisionsStyleBookOpened:r}=(0,l.useSelect)((e=>{const{getActiveComplementaryArea:t}=e(vg),{getEditorCanvasContainerView:s,getCanvasMode:n}=te(e(zt)),i=s(),r="visual"===e(h.store).getEditorMode(),o="edit"===n(),a=e(f.store).get("core","showListViewByDefault"),{getEntityRecord:l,__experimentalGetCurrentGlobalStylesId:c}=e(_.store),u=c(),d=u?l("root","globalStyles",u):void 0;return{isStyleBookOpened:"style-book"===i,shouldClearCanvasContainerView:"edit-site/global-styles"!==t("core")||!r||!o,showListViewByDefault:a,hasRevisions:!!d?._links?.["version-history"]?.[0]?.count,isRevisionsStyleBookOpened:"global-styles-revisions:style-book"===i,isRevisionsOpened:"global-styles-revisions"===i}}),[]),{setEditorCanvasContainerView:o}=te((0,l.useDispatch)(zt));(0,d.useEffect)((()=>{e&&o(void 0)}),[e]);const{setIsListViewOpened:a}=(0,l.useDispatch)(h.store),{goTo:c}=(0,y.__experimentalUseNavigator)();return(0,oe.jsx)(gg,{className:"edit-site-global-styles-sidebar",identifier:"edit-site/global-styles",title:(0,b.__)("Styles"),icon:xo,closeLabel:(0,b.__)("Close Styles"),panelClassName:"edit-site-global-styles-sidebar__panel",header:(0,oe.jsxs)(y.Flex,{className:"edit-site-global-styles-sidebar__header",gap:1,children:[(0,oe.jsx)(y.FlexBlock,{style:{minWidth:"min-content"},children:(0,oe.jsx)("h2",{className:"edit-site-global-styles-sidebar__header-title",children:(0,b.__)("Styles")})}),(0,oe.jsx)(y.FlexItem,{children:(0,oe.jsx)(y.Button,{icon:fa,label:(0,b.__)("Style Book"),isPressed:t||r,accessibleWhenDisabled:!0,disabled:e,onClick:()=>{i?o("global-styles-revisions:style-book"):r?o("global-styles-revisions"):(a(t&&s),o(t?void 0:"style-book"))},size:"compact"})}),(0,oe.jsx)(y.FlexItem,{children:(0,oe.jsx)(y.Button,{label:(0,b.__)("Revisions"),icon:So,onClick:()=>(a(!1),r?(c("/"),void o("style-book")):i?(c("/"),void o(void 0)):(c("/revisions"),void o(t?"global-styles-revisions:style-book":"global-styles-revisions"))),accessibleWhenDisabled:!0,disabled:!n,isPressed:i||r,size:"compact"})}),(0,oe.jsx)(ig,{})]}),children:(0,oe.jsx)(hg,{})})}const yg=(0,oe.jsx)(Jt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Jt.Path,{d:"M18 11.3l-1-1.1-4 4V3h-1.5v11.3L7 10.2l-1 1.1 6.2 5.8 5.8-5.8zm.5 3.7v3.5h-13V15H4v5h16v-5h-1.5z"})}),bg=window.wp.blob;function wg(){const{createErrorNotice:e}=(0,l.useDispatch)(w.store);return(0,oe.jsx)(y.MenuItem,{role:"menuitem",icon:yg,onClick:async function(){try{const e=await io()({path:"/wp-block-editor/v1/export",parse:!1,headers:{Accept:"application/zip"}}),t=await e.blob(),s=e.headers.get("content-disposition").match(/=(.+)\.zip/),n=s[1]?s[1]:"edit-site-export";(0,bg.downloadBlob)(n+".zip",t,"application/zip")}catch(t){let s={};try{s=await t.json()}catch(e){}const n=s.message&&"unknown_error"!==s.code?s.message:(0,b.__)("An error occurred while creating the site export.");e(n,{type:"snackbar"})}},info:(0,b.__)("Download your theme with updated templates and styles."),children:(0,b._x)("Export","site exporter menu item")})}function _g(){const{toggle:e}=(0,l.useDispatch)(f.store);return(0,oe.jsx)(y.MenuItem,{onClick:()=>e("core/edit-site","welcomeGuide"),children:(0,b.__)("Welcome Guide")})}const{ToolsMoreMenuGroup:Sg,PreferencesModal:jg}=te(h.privateApis);function Cg(){const e=(0,l.useSelect)((e=>e(_.store).getCurrentTheme().is_block_theme),[]);return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsxs)(Sg,{children:[e&&(0,oe.jsx)(wg,{}),(0,oe.jsx)(_g,{})]}),(0,oe.jsx)(jg,{})]})}const{useLocation:kg}=te(Ht.privateApis);const Eg=function(){const{record:e,getTitle:t,isLoaded:s}=ws();let n;var i;s&&(n=(0,b.sprintf)((0,b._x)("%1$s ‹ %2$s","breadcrumb trail"),t(),null!==(i=Ve[e.type])&&void 0!==i?i:Ve[je])),function(e){const t=kg(),s=(0,l.useSelect)((e=>e(_.store).getEntityRecord("root","site")?.title),[]),n=(0,d.useRef)(!0);(0,d.useEffect)((()=>{n.current=!1}),[t]),(0,d.useEffect)((()=>{if(!n.current&&e&&s){const t=(0,b.sprintf)((0,b.__)("%1$s ‹ %2$s ‹ Editor — WordPress"),(0,Xt.decodeEntities)(e),(0,Xt.decodeEntities)(s));document.title=t,(0,$a.speak)(e,"assertive")}}),[e,s,t])}(s&&n)},{Editor:Pg,BackButton:Ig}=te(h.privateApis),{useHistory:Tg,useLocation:Og}=te(Ht.privateApis),{BlockKeyboardShortcuts:Ag}=te(a.privateApis),Mg={edit:{opacity:0,scale:.2},hover:{opacity:1,scale:1,clipPath:"inset( 22% round 2px )"}},Ng={edit:{clipPath:"inset(0% round 0px)"},hover:{clipPath:"inset( 22% round 2px )"},tap:{clipPath:"inset(0% round 0px)"}};function Vg({isPostsList:e=!1}){const t=(0,v.useReducedMotion)(),{params:s}=Og(),n=Ss(),{editedPostType:i,editedPostId:r,contextPostType:o,contextPostId:a,canvasMode:c,isEditingPage:u,supportsGlobalStyles:p,showIconLabels:m,editorCanvasView:g,currentPostIsTrashed:S,hasSiteIcon:j}=(0,l.useSelect)((e=>{const{getEditorCanvasContainerView:t,getEditedPostContext:s,getCanvasMode:n,isPage:i,getEditedPostType:r,getEditedPostId:o}=te(e(zt)),{get:a}=e(f.store),{getCurrentTheme:l,getEntityRecord:c}=e(_.store),u=s(),d=c("root","__unstableBase",void 0);return{editedPostType:r(),editedPostId:o(),contextPostType:u?.postId?u.postType:void 0,contextPostId:u?.postId?u.postId:void 0,canvasMode:n(),isEditingPage:i(),supportsGlobalStyles:l()?.is_block_theme,showIconLabels:a("core","showIconLabels"),editorCanvasView:t(),currentPostIsTrashed:"trash"===e(h.store).getCurrentPostAttribute("status"),hasSiteIcon:!!d?.site_icon_url}}),[]);Eg();const C=Jr(),k=!xm(),E=function(){const{canvasMode:e,currentPostIsTrashed:t}=(0,l.useSelect)((e=>{const{getCanvasMode:t}=te(e(zt));return{canvasMode:t(),currentPostIsTrashed:"trash"===e(h.store).getCurrentPostAttribute("status")}}),[]),{setCanvasMode:s}=te((0,l.useDispatch)(zt)),[n,i]=(0,d.useState)(!1);(0,d.useEffect)((()=>{"edit"===e&&i(!1)}),[e]);const r={"aria-label":(0,b.__)("Edit"),"aria-disabled":t,title:null,role:"button",tabIndex:0,onFocus:()=>i(!0),onBlur:()=>i(!1),onKeyDown:e=>{const{keyCode:n}=e;n!==$t.ENTER&&n!==$t.SPACE||t||(e.preventDefault(),s("edit"))},onClick:()=>{s("edit")},onClickCapture:e=>{t&&(e.preventDefault(),e.stopPropagation())},readonly:!0};return{className:Ut("edit-site-visual-editor__editor-canvas",{"is-focused":n&&"view"===e}),..."view"===e?r:{}}}(),P="edit"===c,I=!!a,T=(0,v.useInstanceId)(ra,"edit-site-editor__loading-progress"),O=ca(),A=(0,d.useMemo)((()=>[...O.styles,{css:"view"===c?`body{min-height: 100vh; ${S?"":"cursor: pointer;"}}`:void 0}]),[O.styles,c,S]),{setCanvasMode:M}=te((0,l.useDispatch)(zt)),{__unstableSetEditorMode:N,resetZoomLevel:V}=te((0,l.useDispatch)(x.store)),{createSuccessNotice:F}=(0,l.useDispatch)(w.store),R=Tg(),B=(0,d.useCallback)(((e,t)=>{switch(e){case"move-to-trash":case"delete-post":R.push({postType:t[0].type});break;case"duplicate-post":{const e=t[0],s="string"==typeof e.title?e.title:e.title?.rendered;F((0,b.sprintf)((0,b.__)('"%s" successfully created.'),(0,Xt.decodeEntities)(s)),{type:"snackbar",id:"duplicate-post-action",actions:[{label:(0,b.__)("Edit"),onClick:()=>{R.push({postId:e.id,postType:e.type,canvas:"edit"})}}]})}}}),[R,F]),D=vm(g),z=!n,L={duration:t?0:.2};return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(sa,{}),(0,oe.jsx)(h.EditorKeyboardShortcutsRegister,{}),P&&(0,oe.jsx)(Ag,{}),z?null:(0,oe.jsx)(ra,{id:T}),P&&(0,oe.jsx)(ea,{}),z&&(0,oe.jsxs)(Pg,{postType:I?o:i,postId:I?a:r,templateId:I?r:void 0,settings:O,className:Ut("edit-site-editor__editor-interface",{"show-icon-labels":m}),styles:A,customSaveButton:C&&(0,oe.jsx)(eo,{size:"compact"}),customSavePanel:C&&(0,oe.jsx)(co,{}),forceDisableBlockTools:!k,title:D,iframeProps:E,onActionPerformed:B,extraSidebarPanels:!u&&(0,oe.jsx)(ha.Slot,{}),children:[P&&(0,oe.jsx)(Ig,{children:({length:t})=>t<=1&&(0,oe.jsxs)(y.__unstableMotion.div,{className:"edit-site-editor__view-mode-toggle",transition:L,animate:"edit",initial:"edit",whileHover:"hover",whileTap:"tap",children:[(0,oe.jsx)(y.Button,{__next40pxDefaultSize:!0,label:(0,b.__)("Open Navigation"),showTooltip:!0,tooltipPosition:"middle right",onClick:()=>{M("view"),N("edit"),V(),e&&s?.focusMode&&R.push({page:"gutenberg-posts-dashboard",postType:"post"})},children:(0,oe.jsx)(y.__unstableMotion.div,{variants:Ng,children:(0,oe.jsx)(ss,{className:"edit-site-editor__view-mode-toggle-icon"})})}),(0,oe.jsx)(y.__unstableMotion.div,{className:Ut("edit-site-editor__back-icon",{"has-site-icon":j}),variants:Mg,children:(0,oe.jsx)(qo,{icon:Zo})})]})}),(0,oe.jsx)(Cg,{}),p&&(0,oe.jsx)(xg,{})]})]})}var Fg=i(9681),Rg=i.n(Fg);const Bg=(0,oe.jsx)(Jt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Jt.Path,{d:"M12 3.9 6.5 9.5l1 1 3.8-3.7V20h1.5V6.8l3.7 3.7 1-1z"})}),Dg=(0,oe.jsx)(Jt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Jt.Path,{d:"m16.5 13.5-3.7 3.7V4h-1.5v13.2l-3.8-3.7-1 1 5.5 5.6 5.5-5.6z"})}),zg="is",Lg="isNot",Hg="isAny",Gg="isNone",Ug="isAll",Wg="isNotAll",qg=[zg,Lg,Hg,Gg,Ug,Wg],Zg={[zg]:{key:"is-filter",label:(0,b.__)("Is")},[Lg]:{key:"is-not-filter",label:(0,b.__)("Is not")},[Hg]:{key:"is-any-filter",label:(0,b.__)("Is any")},[Gg]:{key:"is-none-filter",label:(0,b.__)("Is none")},[Ug]:{key:"is-all-filter",label:(0,b.__)("Is all")},[Wg]:{key:"is-not-all-filter",label:(0,b.__)("Is not all")}},Kg=["asc","desc"],Yg={asc:"↑",desc:"↓"},Xg={asc:"ascending",desc:"descending"},Jg={asc:(0,b.__)("Sort ascending"),desc:(0,b.__)("Sort descending")},Qg={asc:Bg,desc:Dg},$g="table",ev="grid",tv="list";const sv={sort:function(e,t,s){return"asc"===s?e-t:t-e},isValid:function(e,t){if(""===e)return!1;if(!Number.isInteger(Number(e)))return!1;if(t?.elements){const s=t?.elements.map((e=>e.value));if(!s.includes(Number(e)))return!1}return!0},Edit:"integer"};const nv={sort:function(e,t,s){return"asc"===s?e.localeCompare(t):t.localeCompare(e)},isValid:function(e,t){if(t?.elements){const s=t?.elements?.map((e=>e.value));if(!s.includes(e))return!1}return!0},Edit:"text"};const iv={sort:function(e,t,s){const n=new Date(e).getTime(),i=new Date(t).getTime();return"asc"===s?n-i:i-n},isValid:function(e,t){if(t?.elements){const s=t?.elements.map((e=>e.value));if(!s.includes(e))return!1}return!0},Edit:"datetime"};const rv={datetime:function({data:e,field:t,onChange:s,hideLabelFromVision:n}){const{id:i,label:r}=t,o=t.getValue({item:e}),a=(0,d.useCallback)((e=>s({[i]:e})),[i,s]);return(0,oe.jsxs)("fieldset",{className:"dataviews-controls__datetime",children:[!n&&(0,oe.jsx)(y.BaseControl.VisualLabel,{as:"legend",children:r}),n&&(0,oe.jsx)(y.VisuallyHidden,{as:"legend",children:r}),(0,oe.jsx)(y.TimePicker,{currentTime:o,onChange:a,hideLabelFromVision:!0})]})},integer:function({data:e,field:t,onChange:s,hideLabelFromVision:n}){var i;const{id:r,label:o,description:a}=t,l=null!==(i=t.getValue({item:e}))&&void 0!==i?i:"",c=(0,d.useCallback)((e=>s({[r]:Number(e)})),[r,s]);return(0,oe.jsx)(y.__experimentalNumberControl,{label:o,help:a,value:l,onChange:c,__next40pxDefaultSize:!0,hideLabelFromVision:n})},radio:function({data:e,field:t,onChange:s,hideLabelFromVision:n}){const{id:i,label:r}=t,o=t.getValue({item:e}),a=(0,d.useCallback)((e=>s({[i]:e})),[i,s]);return t.elements?(0,oe.jsx)(y.RadioControl,{label:r,onChange:a,options:t.elements,selected:o,hideLabelFromVision:n}):null},select:function({data:e,field:t,onChange:s,hideLabelFromVision:n}){var i,r;const{id:o,label:a}=t,l=null!==(i=t.getValue({item:e}))&&void 0!==i?i:"",c=(0,d.useCallback)((e=>s({[o]:e})),[o,s]),u=[{label:(0,b.__)("Select item"),value:""},...null!==(r=t?.elements)&&void 0!==r?r:[]];return(0,oe.jsx)(y.SelectControl,{label:a,value:l,options:u,onChange:c,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,hideLabelFromVision:n})},text:function({data:e,field:t,onChange:s,hideLabelFromVision:n}){const{id:i,label:r,placeholder:o}=t,a=t.getValue({item:e}),l=(0,d.useCallback)((e=>s({[i]:e})),[i,s]);return(0,oe.jsx)(y.TextControl,{label:r,placeholder:o,value:null!=a?a:"",onChange:l,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,hideLabelFromVision:n})}};function ov(e){if(Object.keys(rv).includes(e))return rv[e];throw"Control "+e+" not found"}function av(e){return e.map((e=>{var t,s,n,i;const r="integer"===(o=e.type)?sv:"text"===o?nv:"datetime"===o?iv:{sort:(e,t,s)=>"number"==typeof e&&"number"==typeof t?"asc"===s?e-t:t-e:"asc"===s?e.localeCompare(t):t.localeCompare(e),isValid:(e,t)=>{if(t?.elements){const s=t?.elements?.map((e=>e.value));if(!s.includes(e))return!1}return!0},Edit:()=>null};var o;const a=e.getValue||(({item:t})=>t[e.id]),l=null!==(t=e.sort)&&void 0!==t?t:function(e,t,s){return r.sort(a({item:e}),a({item:t}),s)},c=null!==(s=e.isValid)&&void 0!==s?s:function(e,t){return r.isValid(a({item:e}),t)},u=function(e,t){return"function"==typeof e.Edit?e.Edit:"string"==typeof e.Edit?ov(e.Edit):e.elements?ov("select"):"string"==typeof t.Edit?ov(t.Edit):t.Edit}(e,r),d=e.render||(e.elements?({item:t})=>{const s=a({item:t});return e?.elements?.find((e=>e.value===s))?.label||a({item:t})}:a);return{...e,label:e.label||e.id,header:e.header||e.label||e.id,getValue:a,render:d,sort:l,isValid:c,Edit:u,enableHiding:null===(n=e.enableHiding)||void 0===n||n,enableSorting:null===(i=e.enableSorting)||void 0===i||i}}))}function lv(e=""){return Rg()(e.trim().toLowerCase())}const cv=[];function uv(e,t,s){if(!e)return{data:cv,paginationInfo:{totalItems:0,totalPages:0}};const n=av(s);let i=[...e];if(t.search){const e=lv(t.search);i=i.filter((t=>n.filter((e=>e.enableGlobalSearch)).map((e=>lv(e.getValue({item:t})))).some((t=>t.includes(e)))))}if(t.filters&&t.filters?.length>0&&t.filters.forEach((e=>{const t=n.find((t=>t.id===e.field));t&&(e.operator===Hg&&e?.value?.length>0?i=i.filter((s=>{const n=t.getValue({item:s});return Array.isArray(n)?e.value.some((e=>n.includes(e))):"string"==typeof n&&e.value.includes(n)})):e.operator===Gg&&e?.value?.length>0?i=i.filter((s=>{const n=t.getValue({item:s});return Array.isArray(n)?!e.value.some((e=>n.includes(e))):"string"==typeof n&&!e.value.includes(n)})):e.operator===Ug&&e?.value?.length>0?i=i.filter((s=>e.value.every((e=>t.getValue({item:s})?.includes(e))))):e.operator===Wg&&e?.value?.length>0?i=i.filter((s=>e.value.every((e=>!t.getValue({item:s})?.includes(e))))):e.operator===zg?i=i.filter((s=>e.value===t.getValue({item:s}))):e.operator===Lg&&(i=i.filter((s=>e.value!==t.getValue({item:s})))))})),t.sort){const e=t.sort.field,s=n.find((t=>t.id===e));s&&i.sort(((e,n)=>{var i;return s.sort(e,n,null!==(i=t.sort?.direction)&&void 0!==i?i:"desc")}))}let r=i.length,o=1;if(void 0!==t.page&&void 0!==t.perPage){const e=(t.page-1)*t.perPage;r=i?.length||0,o=Math.ceil(r/t.perPage),i=i?.slice(e,e+t.perPage)}return{data:i,paginationInfo:{totalItems:r,totalPages:o}}}const dv=(0,d.createContext)({view:{type:$g},onChangeView:()=>{},fields:[],data:[],paginationInfo:{totalItems:0,totalPages:0},selection:[],onChangeSelection:()=>{},setOpenedFilter:()=>{},openedFilter:null,getItemId:e=>e.id,density:0}),pv=(0,oe.jsx)(Jt.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,oe.jsx)(Jt.Path,{d:"M10 17.5H14V16H10V17.5ZM6 6V7.5H18V6H6ZM8 12.5H16V11H8V12.5Z"})});var hv=Object.defineProperty,fv=Object.defineProperties,mv=Object.getOwnPropertyDescriptors,gv=Object.getOwnPropertySymbols,vv=Object.prototype.hasOwnProperty,xv=Object.prototype.propertyIsEnumerable,yv=(e,t,s)=>t in e?hv(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,bv=(e,t)=>{for(var s in t||(t={}))vv.call(t,s)&&yv(e,s,t[s]);if(gv)for(var s of gv(t))xv.call(t,s)&&yv(e,s,t[s]);return e},wv=(e,t)=>fv(e,mv(t)),_v=(e,t)=>{var s={};for(var n in e)vv.call(e,n)&&t.indexOf(n)<0&&(s[n]=e[n]);if(null!=e&&gv)for(var n of gv(e))t.indexOf(n)<0&&xv.call(e,n)&&(s[n]=e[n]);return s},Sv=Object.defineProperty,jv=Object.defineProperties,Cv=Object.getOwnPropertyDescriptors,kv=Object.getOwnPropertySymbols,Ev=Object.prototype.hasOwnProperty,Pv=Object.prototype.propertyIsEnumerable,Iv=(e,t,s)=>t in e?Sv(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Tv=(e,t)=>{for(var s in t||(t={}))Ev.call(t,s)&&Iv(e,s,t[s]);if(kv)for(var s of kv(t))Pv.call(t,s)&&Iv(e,s,t[s]);return e},Ov=(e,t)=>jv(e,Cv(t)),Av=(e,t)=>{var s={};for(var n in e)Ev.call(e,n)&&t.indexOf(n)<0&&(s[n]=e[n]);if(null!=e&&kv)for(var n of kv(e))t.indexOf(n)<0&&Pv.call(e,n)&&(s[n]=e[n]);return s};function Mv(...e){}function Nv(e,t){return"function"==typeof Object.hasOwn?Object.hasOwn(e,t):Object.prototype.hasOwnProperty.call(e,t)}function Vv(...e){return(...t)=>{for(const s of e)"function"==typeof s&&s(...t)}}function Fv(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}function Rv(e){return e}function Bv(e,t){if(!e){if("string"!=typeof t)throw new Error("Invariant failed");throw new Error(t)}}function Dv(e){return e.disabled||!0===e["aria-disabled"]||"true"===e["aria-disabled"]}function zv(e){const t={};for(const s in e)void 0!==e[s]&&(t[s]=e[s]);return t}function Lv(...e){for(const t of e)if(void 0!==t)return t}function Hv(e,t){"function"==typeof e?e(t):e&&(e.current=t)}function Gv(e){if(!function(e){return!!e&&!!(0,Hs.isValidElement)(e)&&("ref"in e.props||"ref"in e)}(e))return null;return bv({},e.props).ref||e.ref}var Uv,Wv="undefined"!=typeof window&&!!(null==(Uv=window.document)?void 0:Uv.createElement);function qv(e){return e?e.ownerDocument||e:document}function Zv(e,t=!1){const{activeElement:s}=qv(e);if(!(null==s?void 0:s.nodeName))return null;if("IFRAME"===s.tagName&&s.contentDocument)return Zv(s.contentDocument.body,t);if(t){const e=s.getAttribute("aria-activedescendant");if(e){const t=qv(s).getElementById(e);if(t)return t}}return s}function Kv(e,t){return e===t||e.contains(t)}function Yv(e){const t=e.tagName.toLowerCase();return"button"===t||!("input"!==t||!e.type)&&-1!==Xv.indexOf(e.type)}var Xv=["button","color","file","image","reset","submit"];function Jv(e){try{const t=e instanceof HTMLInputElement&&null!==e.selectionStart,s="TEXTAREA"===e.tagName;return t||s||!1}catch(e){return!1}}function Qv(e){return e.isContentEditable||Jv(e)}function $v(e){let t=0,s=0;if(Jv(e))t=e.selectionStart||0,s=e.selectionEnd||0;else if(e.isContentEditable){const n=qv(e).getSelection();if((null==n?void 0:n.rangeCount)&&n.anchorNode&&Kv(e,n.anchorNode)&&n.focusNode&&Kv(e,n.focusNode)){const i=n.getRangeAt(0),r=i.cloneRange();r.selectNodeContents(e),r.setEnd(i.startContainer,i.startOffset),t=r.toString().length,r.setEnd(i.endContainer,i.endOffset),s=r.toString().length}}return{start:t,end:s}}function ex(e,t){const s=null==e?void 0:e.getAttribute("role");return s&&-1!==["dialog","menu","listbox","tree","grid"].indexOf(s)?s:t}function tx(e){if(!e)return null;if(e.clientHeight&&e.scrollHeight>e.clientHeight){const{overflowY:t}=getComputedStyle(e);if("visible"!==t&&"hidden"!==t)return e}else if(e.clientWidth&&e.scrollWidth>e.clientWidth){const{overflowX:t}=getComputedStyle(e);if("visible"!==t&&"hidden"!==t)return e}return tx(e.parentElement)||document.scrollingElement||document.body}function sx(e,...t){/text|search|password|tel|url/i.test(e.type)&&e.setSelectionRange(...t)}function nx(){return Wv&&!!navigator.maxTouchPoints}function ix(){return!!Wv&&/mac|iphone|ipad|ipod/i.test(navigator.platform)}function rx(){return Wv&&ix()&&/apple/i.test(navigator.vendor)}function ox(e){return Boolean(e.currentTarget&&!Kv(e.currentTarget,e.target))}function ax(e){return e.target===e.currentTarget}function lx(e,t){const s=new FocusEvent("blur",t),n=e.dispatchEvent(s),i=Ov(Tv({},t),{bubbles:!0});return e.dispatchEvent(new FocusEvent("focusout",i)),n}function cx(e,t){const s=new MouseEvent("click",t);return e.dispatchEvent(s)}function ux(e,t){const s=t||e.currentTarget,n=e.relatedTarget;return!n||!Kv(s,n)}function dx(e,t,s,n){const i=(e=>{if(n){const t=setTimeout(e,n);return()=>clearTimeout(t)}const t=requestAnimationFrame(e);return()=>cancelAnimationFrame(t)})((()=>{e.removeEventListener(t,r,!0),s()})),r=()=>{i(),s()};return e.addEventListener(t,r,{once:!0,capture:!0}),i}function px(e,t,s,n=window){const i=[];try{n.document.addEventListener(e,t,s);for(const r of Array.from(n.frames))i.push(px(e,t,s,r))}catch(e){}return()=>{try{n.document.removeEventListener(e,t,s)}catch(e){}for(const e of i)e()}}var hx=bv({},Gs),fx=hx.useId,mx=(hx.useDeferredValue,hx.useInsertionEffect),gx=Wv?Hs.useLayoutEffect:Hs.useEffect;function vx(e){const t=(0,Hs.useRef)((()=>{throw new Error("Cannot call an event handler while rendering.")}));return mx?mx((()=>{t.current=e})):t.current=e,(0,Hs.useCallback)(((...e)=>{var s;return null==(s=t.current)?void 0:s.call(t,...e)}),[])}function xx(...e){return(0,Hs.useMemo)((()=>{if(e.some(Boolean))return t=>{for(const s of e)Hv(s,t)}}),e)}function yx(e){if(fx){const t=fx();return e||t}const[t,s]=(0,Hs.useState)(e);return gx((()=>{if(e||t)return;const n=Math.random().toString(36).substr(2,6);s(`id-${n}`)}),[e,t]),e||t}function bx(e,t){const s=e=>{if("string"==typeof e)return e},[n,i]=(0,Hs.useState)((()=>s(t)));return gx((()=>{const n=e&&"current"in e?e.current:e;i((null==n?void 0:n.tagName.toLowerCase())||s(t))}),[e,t]),n}function wx(e,t){const s=(0,Hs.useRef)(!1);(0,Hs.useEffect)((()=>{if(s.current)return e();s.current=!0}),t),(0,Hs.useEffect)((()=>()=>{s.current=!1}),[])}function _x(e){return vx("function"==typeof e?e:()=>e)}function Sx(e,t,s=[]){const n=(0,Hs.useCallback)((s=>(e.wrapElement&&(s=e.wrapElement(s)),t(s))),[...s,e.wrapElement]);return wv(bv({},e),{wrapElement:n})}var jx=!1,Cx=0,kx=0;function Ex(e){(function(e){const t=e.movementX||e.screenX-Cx,s=e.movementY||e.screenY-kx;return Cx=e.screenX,kx=e.screenY,t||s||!1})(e)&&(jx=!0)}function Px(){jx=!1}function Ix(e){const t=Hs.forwardRef(((t,s)=>e(wv(bv({},t),{ref:s}))));return t.displayName=e.displayName||e.name,t}function Tx(e,t){return Hs.memo(e,t)}function Ox(e,t){const s=t,{wrapElement:n,render:i}=s,r=_v(s,["wrapElement","render"]),o=xx(t.ref,Gv(i));let a;if(Hs.isValidElement(i)){const e=wv(bv({},i.props),{ref:o});a=Hs.cloneElement(i,function(e,t){const s=bv({},e);for(const n in t){if(!Nv(t,n))continue;if("className"===n){const n="className";s[n]=e[n]?`${e[n]} ${t[n]}`:t[n];continue}if("style"===n){const n="style";s[n]=e[n]?bv(bv({},e[n]),t[n]):t[n];continue}const i=t[n];if("function"==typeof i&&n.startsWith("on")){const t=e[n];if("function"==typeof t){s[n]=(...e)=>{i(...e),t(...e)};continue}}s[n]=i}return s}(r,e))}else a=i?i(r):(0,oe.jsx)(e,bv({},r));return n?n(a):a}function Ax(e){const t=(t={})=>e(t);return t.displayName=e.name,t}function Mx(e=[],t=[]){const s=Hs.createContext(void 0),n=Hs.createContext(void 0),i=()=>Hs.useContext(s),r=t=>e.reduceRight(((e,s)=>(0,oe.jsx)(s,wv(bv({},t),{children:e}))),(0,oe.jsx)(s.Provider,bv({},t)));return{context:s,scopedContext:n,useContext:i,useScopedContext:(e=!1)=>{const t=Hs.useContext(n),s=i();return e?t:t||s},useProviderContext:()=>{const e=Hs.useContext(n),t=i();if(!e||e!==t)return t},ContextProvider:r,ScopedContextProvider:e=>(0,oe.jsx)(r,wv(bv({},e),{children:t.reduceRight(((t,s)=>(0,oe.jsx)(s,wv(bv({},e),{children:t}))),(0,oe.jsx)(n.Provider,bv({},e)))}))}}var Nx=Mx(),Vx=Nx.useContext,Fx=(Nx.useScopedContext,Nx.useProviderContext,Mx([Nx.ContextProvider],[Nx.ScopedContextProvider])),Rx=Fx.useContext,Bx=(Fx.useScopedContext,Fx.useProviderContext),Dx=Fx.ContextProvider,zx=Fx.ScopedContextProvider,Lx=(0,Hs.createContext)(void 0),Hx=(0,Hs.createContext)(void 0),Gx=((0,Hs.createContext)(null),(0,Hs.createContext)(null),Mx([Dx],[zx])),Ux=Gx.useContext;Gx.useScopedContext,Gx.useProviderContext,Gx.ContextProvider,Gx.ScopedContextProvider;function Wx(e,t){const s=e.__unstableInternals;return Bv(s,"Invalid store"),s[t]}function qx(e,...t){let s=e,n=s,i=Symbol(),r=Mv;const o=new Set,a=new Set,l=new Set,c=new Set,u=new Set,d=new WeakMap,p=new WeakMap,h=(e,t,s=c)=>(s.add(t),p.set(t,e),()=>{var e;null==(e=d.get(t))||e(),d.delete(t),p.delete(t),s.delete(t)}),f=(e,r,o=!1)=>{var l;if(!Nv(s,e))return;const h=function(e,t){if(function(e){return"function"==typeof e}(e))return e(function(e){return"function"==typeof e}(t)?t():t);return e}(r,s[e]);if(h===s[e])return;if(!o)for(const s of t)null==(l=null==s?void 0:s.setState)||l.call(s,e,h);const f=s;s=Ov(Tv({},s),{[e]:h});const m=Symbol();i=m,a.add(e);const g=(t,n,i)=>{var r;const o=p.get(t);o&&!o.some((t=>i?i.has(t):t===e))||(null==(r=d.get(t))||r(),d.set(t,t(s,n)))};for(const e of c)g(e,f);queueMicrotask((()=>{if(i!==m)return;const e=s;for(const e of u)g(e,n,a);n=e,a.clear()}))},m={getState:()=>s,setState:f,__unstableInternals:{setup:e=>(l.add(e),()=>l.delete(e)),init:()=>{const e=o.size,n=Symbol();o.add(n);const i=()=>{o.delete(n),o.size||r()};if(e)return i;const a=(c=s,Object.keys(c)).map((e=>Vv(...t.map((t=>{var s;const n=null==(s=null==t?void 0:t.getState)?void 0:s.call(t);if(n&&Nv(n,e))return Xx(t,[e],(t=>{f(e,t[e],!0)}))})))));var c;const u=[];for(const e of l)u.push(e());const d=t.map(Kx);return r=Vv(...a,...u,...d),i},subscribe:(e,t)=>h(e,t),sync:(e,t)=>(d.set(t,t(s,s)),h(e,t)),batch:(e,t)=>(d.set(t,t(s,n)),h(e,t,u)),pick:e=>qx(function(e,t){const s={};for(const n of t)Nv(e,n)&&(s[n]=e[n]);return s}(s,e),m),omit:e=>qx(function(e,t){const s=Tv({},e);for(const e of t)Nv(s,e)&&delete s[e];return s}(s,e),m)}};return m}function Zx(e,...t){if(e)return Wx(e,"setup")(...t)}function Kx(e,...t){if(e)return Wx(e,"init")(...t)}function Yx(e,...t){if(e)return Wx(e,"subscribe")(...t)}function Xx(e,...t){if(e)return Wx(e,"sync")(...t)}function Jx(e,...t){if(e)return Wx(e,"batch")(...t)}function Qx(e,...t){if(e)return Wx(e,"omit")(...t)}function $x(...e){const t=e.reduce(((e,t)=>{var s;const n=null==(s=null==t?void 0:t.getState)?void 0:s.call(t);return n?Object.assign(e,n):e}),{});return qx(t,...e)}var ey=i(422),{useSyncExternalStore:ty}=ey;function sy(e,t=Rv){const s=Hs.useCallback((t=>e?Yx(e,null,t):()=>{}),[e]),n=()=>{const s="string"==typeof t?t:null,n="function"==typeof t?t:null,i=null==e?void 0:e.getState();return n?n(i):i&&s&&Nv(i,s)?i[s]:void 0};return ty(s,n,n)}function ny(e,t,s,n){const i=Nv(t,s)?t[s]:void 0,r=n?t[n]:void 0,o=function(e){const t=(0,Hs.useRef)(e);return gx((()=>{t.current=e})),t}({value:i,setValue:r});gx((()=>Xx(e,[s],((e,t)=>{const{value:n,setValue:i}=o.current;i&&e[s]!==t[s]&&e[s]!==n&&i(e[s])}))),[e,s]),gx((()=>{if(void 0!==i)return e.setState(s,i),Jx(e,[s],(()=>{void 0!==i&&e.setState(s,i)}))}))}function iy(e,t,s){return wx(t,[s.store]),ny(e,s,"items","setItems"),e}function ry(e,t,s){return ny(e=iy(e,t,s),s,"activeId","setActiveId"),ny(e,s,"includesBaseElement"),ny(e,s,"virtualFocus"),ny(e,s,"orientation"),ny(e,s,"rtl"),ny(e,s,"focusLoop"),ny(e,s,"focusWrap"),ny(e,s,"focusShift"),e}function oy(e,t,s){return wx(t,[s.store,s.disclosure]),ny(e,s,"open","setOpen"),ny(e,s,"mounted","setMounted"),ny(e,s,"animated"),Object.assign(e,{disclosure:s.disclosure})}function ay(e,t,s){return oy(e,t,s)}function ly(e,t,s){return wx(t,[s.popover]),ny(e,s,"placement"),ay(e,t,s)}function cy(e){const t=e.map(((e,t)=>[t,e]));let s=!1;return t.sort((([e,t],[n,i])=>{const r=t.element,o=i.element;return r===o?0:r&&o?function(e,t){return Boolean(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}(r,o)?(e>n&&(s=!0),-1):(et)):e}function uy(e={}){var t;e.store;const s=null==(t=e.store)?void 0:t.getState(),n=Lv(e.items,null==s?void 0:s.items,e.defaultItems,[]),i=new Map(n.map((e=>[e.id,e]))),r={items:n,renderedItems:Lv(null==s?void 0:s.renderedItems,[])},o=function(e){return null==e?void 0:e.__unstablePrivateStore}(e.store),a=qx({items:n,renderedItems:r.renderedItems},o),l=qx(r,e.store),c=e=>{const t=cy(e);a.setState("renderedItems",t),l.setState("renderedItems",t)};Zx(l,(()=>Kx(a))),Zx(a,(()=>Jx(a,["items"],(e=>{l.setState("items",e.items)})))),Zx(a,(()=>Jx(a,["renderedItems"],(e=>{let t=!0,s=requestAnimationFrame((()=>{const{renderedItems:t}=l.getState();e.renderedItems!==t&&c(e.renderedItems)}));if("function"!=typeof IntersectionObserver)return()=>cancelAnimationFrame(s);const n=function(e){var t;const s=e.find((e=>!!e.element)),n=[...e].reverse().find((e=>!!e.element));let i=null==(t=null==s?void 0:s.element)?void 0:t.parentElement;for(;i&&(null==n?void 0:n.element);){if(n&&i.contains(n.element))return i;i=i.parentElement}return qv(i).body}(e.renderedItems),i=new IntersectionObserver((()=>{t?t=!1:(cancelAnimationFrame(s),s=requestAnimationFrame((()=>c(e.renderedItems))))}),{root:n});for(const t of e.renderedItems)t.element&&i.observe(t.element);return()=>{cancelAnimationFrame(s),i.disconnect()}}))));const u=(e,t,s=!1)=>{let n;t((t=>{const s=t.findIndex((({id:t})=>t===e.id)),r=t.slice();if(-1!==s){n=t[s];const o=Tv(Tv({},n),e);r[s]=o,i.set(e.id,o)}else r.push(e),i.set(e.id,e);return r}));return()=>{t((t=>{if(!n)return s&&i.delete(e.id),t.filter((({id:t})=>t!==e.id));const r=t.findIndex((({id:t})=>t===e.id));if(-1===r)return t;const o=t.slice();return o[r]=n,i.set(e.id,n),o}))}},d=e=>u(e,(e=>a.setState("items",e)),!0);return Ov(Tv({},l),{registerItem:d,renderItem:e=>Vv(d(e),u(e,(e=>a.setState("renderedItems",e)))),item:e=>{if(!e)return null;let t=i.get(e);if(!t){const{items:s}=l.getState();t=s.find((t=>t.id===e)),t&&i.set(e,t)}return t||null},__unstablePrivateStore:a})}function dy(e){const t=[];for(const s of e)t.push(...s);return t}function py(e){return e.slice().reverse()}var hy={id:null};function fy(e,t){return e.find((e=>t?!e.disabled&&e.id!==t:!e.disabled))}function my(e,t){return e.filter((e=>e.rowId===t))}function gy(e){const t=[];for(const s of e){const e=t.find((e=>{var t;return(null==(t=e[0])?void 0:t.rowId)===s.rowId}));e?e.push(s):t.push([s])}return t}function vy(e){let t=0;for(const{length:s}of e)s>t&&(t=s);return t}function xy(e,t,s){const n=vy(e);for(const i of e)for(let e=0;eXx(r,["renderedItems","activeId"],(e=>{r.setState("activeId",(t=>{var s;return void 0!==t?t:null==(s=fy(e.renderedItems))?void 0:s.id}))}))));const o=(e,t,s,n)=>{var i,o;const{activeId:a,rtl:l,focusLoop:c,focusWrap:u,includesBaseElement:d}=r.getState(),p=l&&"vertical"!==t?py(e):e;if(null==a)return null==(i=fy(p))?void 0:i.id;const h=p.find((e=>e.id===a));if(!h)return null==(o=fy(p))?void 0:o.id;const f=!!h.rowId,m=p.indexOf(h),g=p.slice(m+1),v=my(g,h.rowId);if(void 0!==n){const e=function(e,t){return e.filter((e=>t?!e.disabled&&e.id!==t:!e.disabled))}(v,a),t=e.slice(n)[0]||e[e.length-1];return null==t?void 0:t.id}const x=function(e){return"vertical"===e?"horizontal":"horizontal"===e?"vertical":void 0}(f?t||"horizontal":t),y=c&&c!==x,b=f&&u&&u!==x;if(s=s||!f&&y&&d,y){const e=function(e,t,s=!1){const n=e.findIndex((e=>e.id===t));return[...e.slice(n+1),...s?[hy]:[],...e.slice(0,n)]}(b&&!s?p:my(p,h.rowId),a,s),t=fy(e,a);return null==t?void 0:t.id}if(b){const e=fy(s?v:g,a);return s?(null==e?void 0:e.id)||null:null==e?void 0:e.id}const w=fy(v,a);return!w&&s?null:null==w?void 0:w.id};return Ov(Tv(Tv({},n),r),{setBaseElement:e=>r.setState("baseElement",e),setActiveId:e=>r.setState("activeId",e),move:e=>{void 0!==e&&(r.setState("activeId",e),r.setState("moves",(e=>e+1)))},first:()=>{var e;return null==(e=fy(r.getState().renderedItems))?void 0:e.id},last:()=>{var e;return null==(e=fy(py(r.getState().renderedItems)))?void 0:e.id},next:e=>{const{renderedItems:t,orientation:s}=r.getState();return o(t,s,!1,e)},previous:e=>{var t;const{renderedItems:s,orientation:n,includesBaseElement:i}=r.getState(),a=!!!(null==(t=fy(s))?void 0:t.rowId)&&i;return o(py(s),n,a,e)},down:e=>{const{activeId:t,renderedItems:s,focusShift:n,focusLoop:i,includesBaseElement:a}=r.getState(),l=n&&!e,c=yy(dy(xy(gy(s),t,l)));return o(c,"vertical",i&&"horizontal"!==i&&a,e)},up:e=>{const{activeId:t,renderedItems:s,focusShift:n,includesBaseElement:i}=r.getState(),a=n&&!e,l=yy(py(dy(xy(gy(s),t,a))));return o(l,"vertical",i,e)}})}function wy(e={}){return function(e={}){const t=$x(e.store,Qx(e.disclosure,["contentElement","disclosureElement"])),s=null==t?void 0:t.getState(),n=Lv(e.open,null==s?void 0:s.open,e.defaultOpen,!1),i=Lv(e.animated,null==s?void 0:s.animated,!1),r=qx({open:n,animated:i,animating:!!i&&n,mounted:n,contentElement:Lv(null==s?void 0:s.contentElement,null),disclosureElement:Lv(null==s?void 0:s.disclosureElement,null)},t);return Zx(r,(()=>Xx(r,["animated","animating"],(e=>{e.animated||r.setState("animating",!1)})))),Zx(r,(()=>Yx(r,["open"],(()=>{r.getState().animated&&r.setState("animating",!0)})))),Zx(r,(()=>Xx(r,["open","animating"],(e=>{r.setState("mounted",e.open||e.animating)})))),Ov(Tv({},r),{disclosure:e.disclosure,setOpen:e=>r.setState("open",e),show:()=>r.setState("open",!0),hide:()=>r.setState("open",!1),toggle:()=>r.setState("open",(e=>!e)),stopAnimation:()=>r.setState("animating",!1),setContentElement:e=>r.setState("contentElement",e),setDisclosureElement:e=>r.setState("disclosureElement",e)})}(e)}var _y=rx()&&nx();function Sy(e={}){var t=e,{tag:s}=t,n=Av(t,["tag"]);const i=$x(n.store,function(e,...t){if(e)return Wx(e,"pick")(...t)}(s,["value","rtl"])),r=null==s?void 0:s.getState(),o=null==i?void 0:i.getState(),a=Lv(n.activeId,null==o?void 0:o.activeId,n.defaultActiveId,null),l=by(Ov(Tv({},n),{activeId:a,includesBaseElement:Lv(n.includesBaseElement,null==o?void 0:o.includesBaseElement,!0),orientation:Lv(n.orientation,null==o?void 0:o.orientation,"vertical"),focusLoop:Lv(n.focusLoop,null==o?void 0:o.focusLoop,!0),focusWrap:Lv(n.focusWrap,null==o?void 0:o.focusWrap,!0),virtualFocus:Lv(n.virtualFocus,null==o?void 0:o.virtualFocus,!0)})),c=function(e={}){var t=e,{popover:s}=t,n=Av(t,["popover"]);const i=$x(n.store,Qx(s,["arrowElement","anchorElement","contentElement","popoverElement","disclosureElement"])),r=null==i?void 0:i.getState(),o=wy(Ov(Tv({},n),{store:i})),a=Lv(n.placement,null==r?void 0:r.placement,"bottom"),l=qx(Ov(Tv({},o.getState()),{placement:a,currentPlacement:a,anchorElement:Lv(null==r?void 0:r.anchorElement,null),popoverElement:Lv(null==r?void 0:r.popoverElement,null),arrowElement:Lv(null==r?void 0:r.arrowElement,null),rendered:Symbol("rendered")}),o,i);return Ov(Tv(Tv({},o),l),{setAnchorElement:e=>l.setState("anchorElement",e),setPopoverElement:e=>l.setState("popoverElement",e),setArrowElement:e=>l.setState("arrowElement",e),render:()=>l.setState("rendered",Symbol("rendered"))})}(Ov(Tv({},n),{placement:Lv(n.placement,null==o?void 0:o.placement,"bottom-start")})),u=Lv(n.value,null==o?void 0:o.value,n.defaultValue,""),d=Lv(n.selectedValue,null==o?void 0:o.selectedValue,null==r?void 0:r.values,n.defaultSelectedValue,""),p=Array.isArray(d),h=Ov(Tv(Tv({},l.getState()),c.getState()),{value:u,selectedValue:d,resetValueOnSelect:Lv(n.resetValueOnSelect,null==o?void 0:o.resetValueOnSelect,p),resetValueOnHide:Lv(n.resetValueOnHide,null==o?void 0:o.resetValueOnHide,p&&!s),activeValue:null==o?void 0:o.activeValue}),f=qx(h,l,c,i);return _y&&Zx(f,(()=>Xx(f,["virtualFocus"],(()=>{f.setState("virtualFocus",!1)})))),Zx(f,(()=>{if(s)return Vv(Xx(f,["selectedValue"],(e=>{Array.isArray(e.selectedValue)&&s.setValues(e.selectedValue)})),Xx(s,["values"],(e=>{f.setState("selectedValue",e.values)})))})),Zx(f,(()=>Xx(f,["resetValueOnHide","mounted"],(e=>{e.resetValueOnHide&&(e.mounted||f.setState("value",u))})))),Zx(f,(()=>Xx(f,["open"],(e=>{e.open||(f.setState("activeId",a),f.setState("moves",0))})))),Zx(f,(()=>Xx(f,["moves","activeId"],((e,t)=>{e.moves===t.moves&&f.setState("activeValue",void 0)})))),Zx(f,(()=>Jx(f,["moves","renderedItems"],((e,t)=>{if(e.moves===t.moves)return;const{activeId:s}=f.getState(),n=l.item(s);f.setState("activeValue",null==n?void 0:n.value)})))),Ov(Tv(Tv(Tv({},c),l),f),{tag:s,setValue:e=>f.setState("value",e),resetValue:()=>f.setState("value",h.value),setSelectedValue:e=>f.setState("selectedValue",e)})}function jy(e={}){const t=Ux();e=wv(bv({},e),{tag:void 0!==e.tag?e.tag:t});const[s,n]=function(e,t){const[s,n]=Hs.useState((()=>e(t)));gx((()=>Kx(s)),[s]);const i=Hs.useCallback((e=>sy(s,e)),[s]);return[Hs.useMemo((()=>wv(bv({},s),{useState:i})),[s,i]),vx((()=>{n((s=>e(bv(bv({},t),s.getState()))))}))]}(Sy,e);return function(e,t,s){return wx(t,[s.tag]),ny(e,s,"value","setValue"),ny(e,s,"selectedValue","setSelectedValue"),ny(e,s,"resetValueOnHide"),ny(e,s,"resetValueOnSelect"),Object.assign(ry(ly(e,t,s),t,s),{tag:s.tag})}(s,n,e)}var Cy=Mx(),ky=(Cy.useContext,Cy.useScopedContext,Cy.useProviderContext),Ey=Mx([Cy.ContextProvider],[Cy.ScopedContextProvider]),Py=(Ey.useContext,Ey.useScopedContext,Ey.useProviderContext,Ey.ContextProvider),Iy=Ey.ScopedContextProvider,Ty=((0,Hs.createContext)(void 0),(0,Hs.createContext)(void 0),Mx([Py],[Iy])),Oy=(Ty.useContext,Ty.useScopedContext,Ty.useProviderContext),Ay=Ty.ContextProvider,My=Ty.ScopedContextProvider,Ny=(0,Hs.createContext)(void 0),Vy=Mx([Ay,Dx],[My,zx]),Fy=Vy.useContext,Ry=Vy.useScopedContext,By=Vy.useProviderContext,Dy=Vy.ContextProvider,zy=Vy.ScopedContextProvider,Ly=(0,Hs.createContext)(void 0),Hy=(0,Hs.createContext)(!1);function Gy(e={}){const t=jy(e);return(0,oe.jsx)(Dy,{value:t,children:e.children})}var Uy=Ax((function(e){var t=e,{store:s}=t,n=_v(t,["store"]);const i=By();Bv(s=s||i,!1);const r=s.useState((e=>{var t;return null==(t=e.baseElement)?void 0:t.id}));return zv(n=bv({htmlFor:r},n))})),Wy=Tx(Ix((function(e){return Ox("label",Uy(e))}))),qy=Ax((function(e){var t=e,{store:s}=t,n=_v(t,["store"]);const i=Oy();return s=s||i,n=wv(bv({},n),{ref:xx(null==s?void 0:s.setAnchorElement,n.ref)})}));Ix((function(e){return Ox("div",qy(e))}));function Zy(e,t){return t&&e.item(t)||null}var Ky=Symbol("FOCUS_SILENTLY");function Yy(e,t,s){if(!t)return!1;if(t===s)return!1;const n=e.item(t.id);return!!n&&(!s||n.element!==s)}var Xy=(0,Hs.createContext)(!0),Jy="input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], summary, iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false'])";function Qy(e){return!!e.matches(Jy)&&(!!function(e){if("function"==typeof e.checkVisibility)return e.checkVisibility();const t=e;return t.offsetWidth>0||t.offsetHeight>0||e.getClientRects().length>0}(e)&&!e.closest("[inert]"))}function $y(e){const t=Zv(e);if(!t)return!1;if(t===e)return!0;const s=t.getAttribute("aria-activedescendant");return!!s&&s===e.id}function eb(e){const t=Zv(e);if(!t)return!1;if(Kv(e,t))return!0;const s=t.getAttribute("aria-activedescendant");return!!s&&("id"in e&&(s===e.id||!!e.querySelector(`#${CSS.escape(s)}`)))}var tb=rx(),sb=["text","search","url","tel","email","password","number","date","month","week","time","datetime","datetime-local"],nb=Symbol("safariFocusAncestor");function ib(e,t){e&&(e[nb]=t)}function rb(e){return!("input"!==e.tagName.toLowerCase()||!e.type)&&("radio"===e.type||"checkbox"===e.type)}function ob(e,t,s,n,i){return e?t?s&&!n?-1:void 0:s?i:i||0:i}function ab(e,t){return vx((s=>{null==e||e(s),s.defaultPrevented||t&&(s.stopPropagation(),s.preventDefault())}))}var lb=!0;function cb(e){const t=e.target;t&&"hasAttribute"in t&&(t.hasAttribute("data-focus-visible")||(lb=!1))}function ub(e){e.metaKey||e.ctrlKey||e.altKey||(lb=!0)}var db=Ax((function(e){var t=e,{focusable:s=!0,accessibleWhenDisabled:n,autoFocus:i,onFocusVisible:r}=t,o=_v(t,["focusable","accessibleWhenDisabled","autoFocus","onFocusVisible"]);const a=(0,Hs.useRef)(null);(0,Hs.useEffect)((()=>{s&&(px("mousedown",cb,!0),px("keydown",ub,!0))}),[s]),tb&&(0,Hs.useEffect)((()=>{if(!s)return;const e=a.current;if(!e)return;if(!rb(e))return;const t=function(e){return"labels"in e?e.labels:null}(e);if(!t)return;const n=()=>queueMicrotask((()=>e.focus()));for(const e of t)e.addEventListener("mouseup",n);return()=>{for(const e of t)e.removeEventListener("mouseup",n)}}),[s]);const l=s&&Dv(o),c=!!l&&!n,[u,d]=(0,Hs.useState)(!1);(0,Hs.useEffect)((()=>{s&&c&&u&&d(!1)}),[s,c,u]),(0,Hs.useEffect)((()=>{if(!s)return;if(!u)return;const e=a.current;if(!e)return;if("undefined"==typeof IntersectionObserver)return;const t=new IntersectionObserver((()=>{Qy(e)||d(!1)}));return t.observe(e),()=>t.disconnect()}),[s,u]);const p=ab(o.onKeyPressCapture,l),h=ab(o.onMouseDownCapture,l),f=ab(o.onClickCapture,l),m=o.onMouseDown,g=vx((e=>{if(null==m||m(e),e.defaultPrevented)return;if(!s)return;const t=e.currentTarget;if(!tb)return;if(ox(e))return;if(!Yv(t)&&!rb(t))return;let n=!1;const i=()=>{n=!0};t.addEventListener("focusin",i,{capture:!0,once:!0});const r=function(e){for(;e&&!Qy(e);)e=e.closest(Jy);return e||null}(t.parentElement);ib(r,!0),dx(t,"mouseup",(()=>{t.removeEventListener("focusin",i,!0),ib(r,!1),n||function(e){!eb(e)&&Qy(e)&&e.focus()}(t)}))})),v=(e,t)=>{if(t&&(e.currentTarget=t),!s)return;const n=e.currentTarget;n&&$y(n)&&(null==r||r(e),e.defaultPrevented||(n.dataset.focusVisible="true",d(!0)))},x=o.onKeyDownCapture,y=vx((e=>{if(null==x||x(e),e.defaultPrevented)return;if(!s)return;if(u)return;if(e.metaKey)return;if(e.altKey)return;if(e.ctrlKey)return;if(!ax(e))return;const t=e.currentTarget;dx(t,"focusout",(()=>v(e,t)))})),b=o.onFocusCapture,w=vx((e=>{if(null==b||b(e),e.defaultPrevented)return;if(!s)return;if(!ax(e))return void d(!1);const t=e.currentTarget,n=()=>v(e,t);lb||function(e){const{tagName:t,readOnly:s,type:n}=e;return"TEXTAREA"===t&&!s||("SELECT"===t&&!s||("INPUT"!==t||s?!!e.isContentEditable||!("combobox"!==e.getAttribute("role")||!e.dataset.name):sb.includes(n)))}(e.target)?dx(e.target,"focusout",n):d(!1)})),_=o.onBlur,S=vx((e=>{null==_||_(e),s&&ux(e)&&d(!1)})),j=(0,Hs.useContext)(Xy),C=vx((e=>{s&&i&&e&&j&&queueMicrotask((()=>{$y(e)||Qy(e)&&e.focus()}))})),k=bx(a),E=s&&function(e){return!e||"button"===e||"summary"===e||"input"===e||"select"===e||"textarea"===e||"a"===e}(k),P=s&&function(e){return!e||"button"===e||"input"===e||"select"===e||"textarea"===e}(k),I=o.style,T=(0,Hs.useMemo)((()=>c?bv({pointerEvents:"none"},I):I),[c,I]);return zv(o=wv(bv({"data-focus-visible":s&&u||void 0,"data-autofocus":i||void 0,"aria-disabled":l||void 0},o),{ref:xx(a,C,o.ref),style:T,tabIndex:ob(s,c,E,P,o.tabIndex),disabled:!(!P||!c)||void 0,contentEditable:l?void 0:o.contentEditable,onKeyPressCapture:p,onClickCapture:f,onMouseDownCapture:h,onMouseDown:g,onKeyDownCapture:y,onFocusCapture:w,onBlur:S}))}));Ix((function(e){return Ox("div",db(e))}));function pb(e,t,s){return vx((n=>{var i;if(null==t||t(n),n.defaultPrevented)return;if(n.isPropagationStopped())return;if(!ax(n))return;if(function(e){return"Shift"===e.key||"Control"===e.key||"Alt"===e.key||"Meta"===e.key}(n))return;if(function(e){const t=e.target;return!(t&&!Jv(t)||1!==e.key.length||e.ctrlKey||e.metaKey)}(n))return;const r=e.getState(),o=null==(i=Zy(e,r.activeId))?void 0:i.element;if(!o)return;const a=n,{view:l}=a,c=_v(a,["view"]);o!==(null==s?void 0:s.current)&&o.focus(),function(e,t,s){const n=new KeyboardEvent(t,s);return e.dispatchEvent(n)}(o,n.type,c)||n.preventDefault(),n.currentTarget.contains(o)&&n.stopPropagation()}))}var hb=Ax((function(e){var t=e,{store:s,composite:n=!0,focusOnMove:i=n,moveOnKeyPress:r=!0}=t,o=_v(t,["store","composite","focusOnMove","moveOnKeyPress"]);const a=Bx();Bv(s=s||a,!1);const l=(0,Hs.useRef)(null),c=(0,Hs.useRef)(null),u=function(e){const[t,s]=(0,Hs.useState)(!1),n=(0,Hs.useCallback)((()=>s(!0)),[]),i=e.useState((t=>Zy(e,t.activeId)));return(0,Hs.useEffect)((()=>{const e=null==i?void 0:i.element;t&&e&&(s(!1),e.focus({preventScroll:!0}))}),[i,t]),n}(s),d=s.useState("moves"),[,p]=function(e){const[t,s]=(0,Hs.useState)(null);return gx((()=>{if(null==t)return;if(!e)return;let s=null;return e((e=>(s=e,t))),()=>{e(s)}}),[t,e]),[t,s]}(n?s.setBaseElement:null);(0,Hs.useEffect)((()=>{var e;if(!s)return;if(!d)return;if(!n)return;if(!i)return;const{activeId:t}=s.getState(),r=null==(e=Zy(s,t))?void 0:e.element;var o,a;r&&("scrollIntoView"in(o=r)?(o.focus({preventScroll:!0}),o.scrollIntoView(Tv({block:"nearest",inline:"nearest"},a))):o.focus())}),[s,d,n,i]),gx((()=>{if(!s)return;if(!d)return;if(!n)return;const{baseElement:e,activeId:t}=s.getState();if(!(null===t))return;if(!e)return;const i=c.current;c.current=null,i&&lx(i,{relatedTarget:e}),$y(e)||e.focus()}),[s,d,n]);const h=s.useState("activeId"),f=s.useState("virtualFocus");gx((()=>{var e;if(!s)return;if(!n)return;if(!f)return;const t=c.current;if(c.current=null,!t)return;const i=(null==(e=Zy(s,h))?void 0:e.element)||Zv(t);i!==t&&lx(t,{relatedTarget:i})}),[s,h,f,n]);const m=pb(s,o.onKeyDownCapture,c),g=pb(s,o.onKeyUpCapture,c),v=o.onFocusCapture,x=vx((e=>{if(null==v||v(e),e.defaultPrevented)return;if(!s)return;const{virtualFocus:t}=s.getState();if(!t)return;const n=e.relatedTarget,i=function(e){const t=e[Ky];return delete e[Ky],t}(e.currentTarget);ax(e)&&i&&(e.stopPropagation(),c.current=n)})),y=o.onFocus,b=vx((e=>{if(null==y||y(e),e.defaultPrevented)return;if(!n)return;if(!s)return;const{relatedTarget:t}=e,{virtualFocus:i}=s.getState();i?ax(e)&&!Yy(s,t)&&queueMicrotask(u):ax(e)&&s.setActiveId(null)})),w=o.onBlurCapture,_=vx((e=>{var t;if(null==w||w(e),e.defaultPrevented)return;if(!s)return;const{virtualFocus:n,activeId:i}=s.getState();if(!n)return;const r=null==(t=Zy(s,i))?void 0:t.element,o=e.relatedTarget,a=Yy(s,o),l=c.current;if(c.current=null,ax(e)&&a)o===r?l&&l!==o&&lx(l,e):r?lx(r,e):l&&lx(l,e),e.stopPropagation();else{!Yy(s,e.target)&&r&&lx(r,e)}})),S=o.onKeyDown,j=_x(r),C=vx((e=>{var t;if(null==S||S(e),e.defaultPrevented)return;if(!s)return;if(!ax(e))return;const{orientation:n,items:i,renderedItems:r,activeId:o}=s.getState(),a=Zy(s,o);if(null==(t=null==a?void 0:a.element)?void 0:t.isConnected)return;const l="horizontal"!==n,c="vertical"!==n,u=function(e){return e.some((e=>!!e.rowId))}(r);if(("ArrowLeft"===e.key||"ArrowRight"===e.key||"Home"===e.key||"End"===e.key)&&Jv(e.currentTarget))return;const d={ArrowUp:(u||l)&&(()=>{if(u){const e=i&&function(e){return function(e,t){return e.find((e=>t?!e.disabled&&e.id!==t:!e.disabled))}(dy(py(function(e){const t=[];for(const s of e){const e=t.find((e=>{var t;return(null==(t=e[0])?void 0:t.rowId)===s.rowId}));e?e.push(s):t.push([s])}return t}(e))))}(i);return null==e?void 0:e.id}return null==s?void 0:s.last()}),ArrowRight:(u||c)&&s.first,ArrowDown:(u||l)&&s.first,ArrowLeft:(u||c)&&s.last,Home:s.first,End:s.last,PageUp:s.first,PageDown:s.last},p=d[e.key];if(p){const t=p();if(void 0!==t){if(!j(e))return;e.preventDefault(),s.move(t)}}}));o=Sx(o,(e=>(0,oe.jsx)(Dx,{value:s,children:e})),[s]);const k=s.useState((e=>{var t;if(s&&n&&e.virtualFocus)return null==(t=Zy(s,e.activeId))?void 0:t.id}));o=wv(bv({"aria-activedescendant":k},o),{ref:xx(l,p,o.ref),onKeyDownCapture:m,onKeyUpCapture:g,onFocusCapture:x,onFocus:b,onBlurCapture:_,onKeyDown:C});const E=s.useState((e=>n&&(e.virtualFocus||null===e.activeId)));return o=db(bv({focusable:E},o))}));Ix((function(e){return Ox("div",hb(e))}));function fb(e,t,s){if(!s)return!1;const n=e.find((e=>!e.disabled&&e.value));return(null==n?void 0:n.value)===t}function mb(e,t){return!!t&&(null!=e&&(e=Fv(e),t.length>e.length&&0===t.toLowerCase().indexOf(e.toLowerCase())))}var gb=Ax((function(e){var t=e,{store:s,focusable:n=!0,autoSelect:i=!1,getAutoSelectId:r,setValueOnChange:o,showMinLength:a=0,showOnChange:l,showOnMouseDown:c,showOnClick:u=c,showOnKeyDown:d,showOnKeyPress:p=d,blurActiveItemOnClick:h,setValueOnClick:f=!0,moveOnKeyPress:m=!0,autoComplete:g="list"}=t,v=_v(t,["store","focusable","autoSelect","getAutoSelectId","setValueOnChange","showMinLength","showOnChange","showOnMouseDown","showOnClick","showOnKeyDown","showOnKeyPress","blurActiveItemOnClick","setValueOnClick","moveOnKeyPress","autoComplete"]);const x=By();Bv(s=s||x,!1);const y=(0,Hs.useRef)(null),[b,w]=(0,Hs.useReducer)((()=>[]),[]),_=(0,Hs.useRef)(!1),S=(0,Hs.useRef)(!1),j=s.useState((e=>e.virtualFocus&&i)),C="inline"===g||"both"===g,[k,E]=(0,Hs.useState)(C);!function(e,t){const s=(0,Hs.useRef)(!1);gx((()=>{if(s.current)return e();s.current=!0}),t),gx((()=>()=>{s.current=!1}),[])}((()=>{C&&E(!0)}),[C]);const P=s.useState("value"),I=(0,Hs.useRef)();(0,Hs.useEffect)((()=>Xx(s,["selectedValue","activeId"],((e,t)=>{I.current=t.selectedValue}))),[]);const T=s.useState((e=>{var t;if(C&&k){if(e.activeValue&&Array.isArray(e.selectedValue)){if(e.selectedValue.includes(e.activeValue))return;if(null==(t=I.current)?void 0:t.includes(e.activeValue))return}return e.activeValue}})),O=s.useState("renderedItems"),A=s.useState("open"),M=s.useState("contentElement"),N=(0,Hs.useMemo)((()=>{if(!C)return P;if(!k)return P;if(fb(O,T,j)){if(mb(P,T)){const e=(null==T?void 0:T.slice(P.length))||"";return P+e}return P}return T||P}),[C,k,O,T,j,P]);(0,Hs.useEffect)((()=>{const e=y.current;if(!e)return;const t=()=>E(!0);return e.addEventListener("combobox-item-move",t),()=>{e.removeEventListener("combobox-item-move",t)}}),[]),(0,Hs.useEffect)((()=>{if(!C)return;if(!k)return;if(!T)return;if(!fb(O,T,j))return;if(!mb(P,T))return;let e=Mv;return queueMicrotask((()=>{const t=y.current;if(!t)return;const{start:s,end:n}=$v(t),i=P.length,r=T.length;sx(t,i,r),e=()=>{if(!$y(t))return;const{start:e,end:o}=$v(t);e===i&&o===r&&sx(t,s,n)}})),()=>e()}),[b,C,k,T,O,j,P]);const V=(0,Hs.useRef)(null),F=vx(r),R=(0,Hs.useRef)(null);(0,Hs.useEffect)((()=>{if(!A)return;if(!M)return;const e=tx(M);if(!e)return;V.current=e;const t=()=>{_.current=!1},n=()=>{if(!s)return;if(!_.current)return;const{activeId:e}=s.getState();null!==e&&e!==R.current&&(_.current=!1)},i={passive:!0,capture:!0};return e.addEventListener("wheel",t,i),e.addEventListener("touchmove",t,i),e.addEventListener("scroll",n,i),()=>{e.removeEventListener("wheel",t,!0),e.removeEventListener("touchmove",t,!0),e.removeEventListener("scroll",n,!0)}}),[A,M,s]),gx((()=>{P&&(S.current||(_.current=!0))}),[P]),gx((()=>{"always"!==j&&A||(_.current=A)}),[j,A]);const B=s.useState("resetValueOnSelect");wx((()=>{var e,t;const n=_.current;if(!s)return;if(!A)return;if(!(j&&n||B))return;const{baseElement:i,contentElement:r,activeId:o}=s.getState();if(!i||$y(i)){if(null==r?void 0:r.hasAttribute("data-placing")){const e=new MutationObserver(w);return e.observe(r,{attributeFilter:["data-placing"]}),()=>e.disconnect()}if(j&&n){const t=F(O),n=void 0!==t?t:null!=(e=function(e){const t=e.find((e=>{var t;return!e.disabled&&"tab"!==(null==(t=e.element)?void 0:t.getAttribute("role"))}));return null==t?void 0:t.id}(O))?e:s.first();R.current=n,s.move(null!=n?n:null)}else{const e=null==(t=s.item(o))?void 0:t.element;e&&"scrollIntoView"in e&&e.scrollIntoView({block:"nearest",inline:"nearest"})}}}),[s,A,b,P,j,B,F,O]),(0,Hs.useEffect)((()=>{if(!C)return;const e=y.current;if(!e)return;const t=[e,M].filter((e=>!!e)),n=e=>{t.every((t=>ux(e,t)))&&(null==s||s.setValue(N))};for(const e of t)e.addEventListener("focusout",n);return()=>{for(const e of t)e.removeEventListener("focusout",n)}}),[C,M,s,N]);const D=e=>e.currentTarget.value.length>=a,z=v.onChange,L=_x(null!=l?l:D),H=_x(null!=o?o:!s.tag),G=vx((e=>{if(null==z||z(e),e.defaultPrevented)return;if(!s)return;const t=e.currentTarget,{value:n,selectionStart:i,selectionEnd:r}=t,o=e.nativeEvent;if(_.current=!0,function(e){return"input"===e.type}(o)&&(o.isComposing&&(_.current=!1,S.current=!0),C)){const e="insertText"===o.inputType||"insertCompositionText"===o.inputType,t=i===n.length;E(e&&t)}if(H(e)){const e=n===s.getState().value;s.setValue(n),queueMicrotask((()=>{sx(t,i,r)})),C&&j&&e&&w()}L(e)&&s.show(),j&&_.current||s.setActiveId(null)})),U=v.onCompositionEnd,W=vx((e=>{_.current=!0,S.current=!1,null==U||U(e),e.defaultPrevented||j&&w()})),q=v.onMouseDown,Z=_x(null!=h?h:()=>!!(null==s?void 0:s.getState().includesBaseElement)),K=_x(f),Y=_x(null!=u?u:D),X=vx((e=>{null==q||q(e),e.defaultPrevented||e.button||e.ctrlKey||s&&(Z(e)&&s.setActiveId(null),K(e)&&s.setValue(N),Y(e)&&dx(e.currentTarget,"mouseup",s.show))})),J=v.onKeyDown,Q=_x(null!=p?p:D),$=vx((e=>{if(null==J||J(e),e.repeat||(_.current=!1),e.defaultPrevented)return;if(e.ctrlKey)return;if(e.altKey)return;if(e.shiftKey)return;if(e.metaKey)return;if(!s)return;const{open:t}=s.getState();t||"ArrowUp"!==e.key&&"ArrowDown"!==e.key||Q(e)&&(e.preventDefault(),s.show())})),ee=v.onBlur,te=vx((e=>{_.current=!1,null==ee||ee(e),e.defaultPrevented})),se=yx(v.id),ne=function(e){return"inline"===e||"list"===e||"both"===e||"none"===e}(g)?g:void 0,ie=s.useState((e=>null===e.activeId));return v=wv(bv({id:se,role:"combobox","aria-autocomplete":ne,"aria-haspopup":ex(M,"listbox"),"aria-expanded":A,"aria-controls":null==M?void 0:M.id,"data-active-item":ie||void 0,value:N},v),{ref:xx(y,v.ref),onChange:G,onCompositionEnd:W,onMouseDown:X,onKeyDown:$,onBlur:te}),v=hb(wv(bv({store:s,focusable:n},v),{moveOnKeyPress:e=>!function(e,...t){const s="function"==typeof e?e(...t):e;return null!=s&&!s}(m,e)&&(C&&E(!0),!0)})),v=qy(bv({store:s},v)),bv({autoComplete:"off"},v)})),vb=Ix((function(e){return Ox("input",gb(e))}));function xb(e,t){const s=setTimeout(t,e);return()=>clearTimeout(s)}function yb(...e){return e.join(", ").split(", ").reduce(((e,t)=>{const s=t.endsWith("ms")?1:1e3,n=Number.parseFloat(t||"0s")*s;return n>e?n:e}),0)}function bb(e,t,s){return!(s||!1===t||e&&!t)}var wb=Ax((function(e){var t=e,{store:s,alwaysVisible:n}=t,i=_v(t,["store","alwaysVisible"]);const r=ky();Bv(s=s||r,!1);const o=(0,Hs.useRef)(null),a=yx(i.id),[l,c]=(0,Hs.useState)(null),u=s.useState("open"),d=s.useState("mounted"),p=s.useState("animated"),h=s.useState("contentElement"),f=sy(s.disclosure,"contentElement");gx((()=>{o.current&&(null==s||s.setContentElement(o.current))}),[s]),gx((()=>{let e;return null==s||s.setState("animated",(t=>(e=t,!0))),()=>{void 0!==e&&(null==s||s.setState("animated",e))}}),[s]),gx((()=>{if(p){if(null==h?void 0:h.isConnected)return function(e){let t=requestAnimationFrame((()=>{t=requestAnimationFrame(e)}));return()=>cancelAnimationFrame(t)}((()=>{c(u?"enter":d?"leave":null)}));c(null)}}),[p,h,u,d]),gx((()=>{if(!s)return;if(!p)return;const e=()=>null==s?void 0:s.setState("animating",!1),t=()=>(0,Vr.flushSync)(e);if(!l||!h)return void e();if("leave"===l&&u)return;if("enter"===l&&!u)return;if("number"==typeof p){return xb(p,t)}const{transitionDuration:n,animationDuration:i,transitionDelay:r,animationDelay:o}=getComputedStyle(h),{transitionDuration:a="0",animationDuration:c="0",transitionDelay:d="0",animationDelay:m="0"}=f?getComputedStyle(f):{},g=yb(r,o,d,m)+yb(n,i,a,c);if(!g)return"enter"===l&&s.setState("animated",!1),void e();return xb(Math.max(g-1e3/60,0),t)}),[s,p,h,f,u,l]),i=Sx(i,(e=>(0,oe.jsx)(Iy,{value:s,children:e})),[s]);const m=bb(d,i.hidden,n),g=i.style,v=(0,Hs.useMemo)((()=>m?wv(bv({},g),{display:"none"}):g),[m,g]);return zv(i=wv(bv({id:a,"data-open":u||void 0,"data-enter":"enter"===l||void 0,"data-leave":"leave"===l||void 0,hidden:m},i),{ref:xx(a?s.setContentElement:null,o,i.ref),style:v}))})),_b=Ix((function(e){return Ox("div",wb(e))})),Sb=(Ix((function(e){var t=e,{unmountOnHide:s}=t,n=_v(t,["unmountOnHide"]);const i=ky();return!1===sy(n.store||i,(e=>!s||(null==e?void 0:e.mounted)))?null:(0,oe.jsx)(_b,bv({},n))})),Ax((function(e){var t=e,{store:s,alwaysVisible:n}=t,i=_v(t,["store","alwaysVisible"]);const r=Ry(!0),o=Fy(),a=!!(s=s||o)&&s===r;Bv(s,!1);const l=(0,Hs.useRef)(null),c=yx(i.id),u=s.useState("mounted"),d=bb(u,i.hidden,n),p=d?wv(bv({},i.style),{display:"none"}):i.style,h=s.useState((e=>Array.isArray(e.selectedValue))),f=function(e,t,s){const[n,i]=(0,Hs.useState)(s);return gx((()=>{const s=e&&"current"in e?e.current:e;if(!s)return;const n=()=>{const e=s.getAttribute(t);null!=e&&i(e)},r=new MutationObserver(n);return r.observe(s,{attributeFilter:[t]}),n(),()=>r.disconnect()}),[e,t]),n}(l,"role",i.role),m=("listbox"===f||"tree"===f||"grid"===f)&&h||void 0,[g,v]=(0,Hs.useState)(!1),x=s.useState("contentElement");gx((()=>{if(!u)return;const e=l.current;if(!e)return;if(x!==e)return;const t=()=>{v(!!e.querySelector("[role='listbox']"))},s=new MutationObserver(t);return s.observe(e,{subtree:!0,childList:!0,attributeFilter:["role"]}),t(),()=>s.disconnect()}),[u,x]),g||(i=bv({role:"listbox","aria-multiselectable":m},i)),i=Sx(i,(e=>(0,oe.jsx)(zy,{value:s,children:(0,oe.jsx)(Ny.Provider,{value:f,children:e})})),[s,f]);const y=!c||r&&a?null:s.setContentElement;return zv(i=wv(bv({id:c,hidden:d},i),{ref:xx(y,l,i.ref),style:p}))}))),jb=Ix((function(e){return Ox("div",Sb(e))}));function Cb(e){const t=e.relatedTarget;return(null==t?void 0:t.nodeType)===Node.ELEMENT_NODE?t:null}var kb=Symbol("composite-hover");var Eb=Ax((function(e){var t=e,{store:s,focusOnHover:n=!0,blurOnHoverEnd:i=!!n}=t,r=_v(t,["store","focusOnHover","blurOnHoverEnd"]);const o=Rx();Bv(s=s||o,!1);const a=((0,Hs.useEffect)((()=>{px("mousemove",Ex,!0),px("mousedown",Px,!0),px("mouseup",Px,!0),px("keydown",Px,!0),px("scroll",Px,!0)}),[]),vx((()=>jx))),l=r.onMouseMove,c=_x(n),u=vx((e=>{if(null==l||l(e),!e.defaultPrevented&&a()&&c(e)){if(!eb(e.currentTarget)){const e=null==s?void 0:s.getState().baseElement;e&&!$y(e)&&e.focus()}null==s||s.setActiveId(e.currentTarget.id)}})),d=r.onMouseLeave,p=_x(i),h=vx((e=>{var t;null==d||d(e),e.defaultPrevented||a()&&(function(e){const t=Cb(e);return!!t&&Kv(e.currentTarget,t)}(e)||function(e){let t=Cb(e);if(!t)return!1;do{if(Nv(t,kb)&&t[kb])return!0;t=t.parentElement}while(t);return!1}(e)||c(e)&&p(e)&&(null==s||s.setActiveId(null),null==(t=null==s?void 0:s.getState().baseElement)||t.focus()))})),f=(0,Hs.useCallback)((e=>{e&&(e[kb]=!0)}),[]);return zv(r=wv(bv({},r),{ref:xx(f,r.ref),onMouseMove:u,onMouseLeave:h}))})),Pb=(Tx(Ix((function(e){return Ox("div",Eb(e))}))),Ax((function(e){var t=e,{store:s,shouldRegisterItem:n=!0,getItem:i=Rv,element:r}=t,o=_v(t,["store","shouldRegisterItem","getItem","element"]);const a=Vx();s=s||a;const l=yx(o.id),c=(0,Hs.useRef)(r);return(0,Hs.useEffect)((()=>{const e=c.current;if(!l)return;if(!e)return;if(!n)return;const t=i({id:l,element:e});return null==s?void 0:s.renderItem(t)}),[l,n,i,s]),zv(o=wv(bv({},o),{ref:xx(c,o.ref)}))})));Ix((function(e){return Ox("div",Pb(e))}));function Ib(e){if(!e.isTrusted)return!1;const t=e.currentTarget;return"Enter"===e.key?Yv(t)||"SUMMARY"===t.tagName||"A"===t.tagName:" "===e.key&&(Yv(t)||"SUMMARY"===t.tagName||"INPUT"===t.tagName||"SELECT"===t.tagName)}var Tb=Symbol("command"),Ob=Ax((function(e){var t=e,{clickOnEnter:s=!0,clickOnSpace:n=!0}=t,i=_v(t,["clickOnEnter","clickOnSpace"]);const r=(0,Hs.useRef)(null),o=bx(r),a=i.type,[l,c]=(0,Hs.useState)((()=>!!o&&Yv({tagName:o,type:a})));(0,Hs.useEffect)((()=>{r.current&&c(Yv(r.current))}),[]);const[u,d]=(0,Hs.useState)(!1),p=(0,Hs.useRef)(!1),h=Dv(i),[f,m]=function(e,t,s){const n=e.onLoadedMetadataCapture,i=(0,Hs.useMemo)((()=>Object.assign((()=>{}),wv(bv({},n),{[t]:s}))),[n,t,s]);return[null==n?void 0:n[t],{onLoadedMetadataCapture:i}]}(i,Tb,!0),g=i.onKeyDown,v=vx((e=>{null==g||g(e);const t=e.currentTarget;if(e.defaultPrevented)return;if(f)return;if(h)return;if(!ax(e))return;if(Jv(t))return;if(t.isContentEditable)return;const i=s&&"Enter"===e.key,r=n&&" "===e.key,o="Enter"===e.key&&!s,a=" "===e.key&&!n;if(o||a)e.preventDefault();else if(i||r){const s=Ib(e);if(i){if(!s){e.preventDefault();const s=e,{view:n}=s,i=_v(s,["view"]),r=()=>cx(t,i);Wv&&/firefox\//i.test(navigator.userAgent)?dx(t,"keyup",r):queueMicrotask(r)}}else r&&(p.current=!0,s||(e.preventDefault(),d(!0)))}})),x=i.onKeyUp,y=vx((e=>{if(null==x||x(e),e.defaultPrevented)return;if(f)return;if(h)return;if(e.metaKey)return;const t=n&&" "===e.key;if(p.current&&t&&(p.current=!1,!Ib(e))){e.preventDefault(),d(!1);const t=e.currentTarget,s=e,{view:n}=s,i=_v(s,["view"]);queueMicrotask((()=>cx(t,i)))}}));return i=wv(bv(bv({"data-active":u||void 0,type:l?"button":void 0},m),i),{ref:xx(r,i.ref),onKeyDown:v,onKeyUp:y}),i=db(i)}));Ix((function(e){return Ox("button",Ob(e))}));function Ab(e,t=!1){const{top:s}=e.getBoundingClientRect();return t?s+e.clientHeight:s}function Mb(e,t,s,n=!1){var i;if(!t)return;if(!s)return;const{renderedItems:r}=t.getState(),o=tx(e);if(!o)return;const a=function(e,t=!1){const s=e.clientHeight,{top:n}=e.getBoundingClientRect(),i=1.5*Math.max(.875*s,s-40),r=t?s-i+n:i+n;return"HTML"===e.tagName?r+e.scrollTop:r}(o,n);let l,c;for(let e=0;e=0){void 0!==c&&cn||(e&&(null==f?void 0:f.baseElement)&&f.baseElement===e.baseElement?f.id:void 0))),g=Dv(u)&&!u.accessibleWhenDisabled,v=(0,Hs.useCallback)((e=>{const t=wv(bv({},e),{id:p||e.id,rowId:m,disabled:!!g});return a?a(t):t}),[p,m,g,a]),x=u.onFocus,y=(0,Hs.useRef)(!1),b=vx((e=>{if(null==x||x(e),e.defaultPrevented)return;if(ox(e))return;if(!p)return;if(!s)return;if(function(e,t){return!ax(e)&&Yy(t,e.target)}(e,s))return;const{virtualFocus:t,baseElement:n}=s.getState();if(s.setActiveId(p),Qv(e.currentTarget)&&function(e,t=!1){if(Jv(e))e.setSelectionRange(t?e.value.length:0,e.value.length);else if(e.isContentEditable){const s=qv(e).getSelection();null==s||s.selectAllChildren(e),t&&(null==s||s.collapseToEnd())}}(e.currentTarget),!t)return;if(!ax(e))return;if(Qv(i=e.currentTarget)||"INPUT"===i.tagName&&!Yv(i))return;var i;if(!(null==n?void 0:n.isConnected))return;rx()&&e.currentTarget.hasAttribute("data-autofocus")&&e.currentTarget.scrollIntoView({block:"nearest",inline:"nearest"}),y.current=!0;e.relatedTarget===n||Yy(s,e.relatedTarget)?function(e){e[Ky]=!0,e.focus({preventScroll:!0})}(n):n.focus()})),w=u.onBlurCapture,_=vx((e=>{if(null==w||w(e),e.defaultPrevented)return;const t=null==s?void 0:s.getState();(null==t?void 0:t.virtualFocus)&&y.current&&(y.current=!1,e.preventDefault(),e.stopPropagation())})),S=u.onKeyDown,j=_x(i),C=_x(r),k=vx((e=>{if(null==S||S(e),e.defaultPrevented)return;if(!ax(e))return;if(!s)return;const{currentTarget:t}=e,n=s.getState(),i=s.item(p),r=!!(null==i?void 0:i.rowId),o="horizontal"!==n.orientation,a="vertical"!==n.orientation,l=()=>!!r||(!!a||(!n.baseElement||!Jv(n.baseElement))),c={ArrowUp:(r||o)&&s.up,ArrowRight:(r||a)&&s.next,ArrowDown:(r||o)&&s.down,ArrowLeft:(r||a)&&s.previous,Home:()=>{if(l())return!r||e.ctrlKey?null==s?void 0:s.first():null==s?void 0:s.previous(-1)},End:()=>{if(l())return!r||e.ctrlKey?null==s?void 0:s.last():null==s?void 0:s.next(-1)},PageUp:()=>Mb(t,s,null==s?void 0:s.up,!0),PageDown:()=>Mb(t,s,null==s?void 0:s.down)}[e.key];if(c){if(Qv(t)){const s=$v(t),n=a&&"ArrowLeft"===e.key,i=a&&"ArrowRight"===e.key,r=o&&"ArrowUp"===e.key,l=o&&"ArrowDown"===e.key;if(i||l){const{length:e}=function(e){if(Jv(e))return e.value;if(e.isContentEditable){const t=qv(e).createRange();return t.selectNodeContents(e),t.toString()}return""}(t);if(s.end!==e)return}else if((n||r)&&0!==s.start)return}const n=c();if(j(e)||void 0!==n){if(!C(e))return;e.preventDefault(),s.move(n)}}})),E=sy(s,(e=>(null==e?void 0:e.baseElement)||void 0)),P=(0,Hs.useMemo)((()=>({id:p,baseElement:E})),[p,E]);u=Sx(u,(e=>(0,oe.jsx)(Lx.Provider,{value:P,children:e})),[P]);const I=sy(s,(e=>!!e&&e.activeId===p)),T=sy(s,(e=>null!=l?l:e&&(null==f?void 0:f.ariaSetSize)&&f.baseElement===e.baseElement?f.ariaSetSize:void 0)),O=sy(s,(e=>{if(null!=c)return c;if(!e)return;if(!(null==f?void 0:f.ariaPosInSet))return;if(f.baseElement!==e.baseElement)return;const t=e.renderedItems.filter((e=>e.rowId===m));return f.ariaPosInSet+t.findIndex((e=>e.id===p))})),A=sy(s,(e=>!(null==e?void 0:e.renderedItems.length)||!e.virtualFocus&&(!!o||e.activeId===p)));return u=wv(bv({id:p,"data-active-item":I||void 0},u),{ref:xx(h,u.ref),tabIndex:A?u.tabIndex:-1,onFocus:b,onBlurCapture:_,onKeyDown:k}),u=Ob(u),u=Pb(wv(bv({store:s},u),{getItem:v,shouldRegisterItem:!!p&&u.shouldRegisterItem})),zv(wv(bv({},u),{"aria-setsize":T,"aria-posinset":O}))}));Tx(Ix((function(e){return Ox("button",Nb(e))})));function Vb(e){var t;return null!=(t={menu:"menuitem",listbox:"option",tree:"treeitem"}[e])?t:"option"}var Fb=Ax((function(e){var t,s=e,{store:n,value:i,hideOnClick:r,setValueOnClick:o,selectValueOnClick:a=!0,resetValueOnSelect:l,focusOnHover:c=!1,moveOnKeyPress:u=!0,getItem:d}=s,p=_v(s,["store","value","hideOnClick","setValueOnClick","selectValueOnClick","resetValueOnSelect","focusOnHover","moveOnKeyPress","getItem"]);const h=Ry();Bv(n=n||h,!1);const f=(0,Hs.useCallback)((e=>{const t=wv(bv({},e),{value:i});return d?d(t):t}),[i,d]),m=n.useState((e=>Array.isArray(e.selectedValue))),g=n.useState((e=>function(e,t){if(null!=t)return null!=e&&(Array.isArray(e)?e.includes(t):e===t)}(e.selectedValue,i))),v=n.useState("resetValueOnSelect");o=null!=o?o:!m,r=null!=r?r:null!=i&&!m;const x=p.onClick,y=_x(o),b=_x(a),w=_x(null!=(t=null!=l?l:v)?t:m),_=_x(r),S=vx((e=>{null==x||x(e),e.defaultPrevented||function(e){const t=e.currentTarget;if(!t)return!1;const s=t.tagName.toLowerCase();return!!e.altKey&&("a"===s||"button"===s&&"submit"===t.type||"input"===s&&"submit"===t.type)}(e)||function(e){const t=e.currentTarget;if(!t)return!1;const s=ix();if(s&&!e.metaKey)return!1;if(!s&&!e.ctrlKey)return!1;const n=t.tagName.toLowerCase();return"a"===n||"button"===n&&"submit"===t.type||"input"===n&&"submit"===t.type}(e)||(null!=i&&(b(e)&&(w(e)&&(null==n||n.resetValue()),null==n||n.setSelectedValue((e=>Array.isArray(e)?e.includes(i)?e.filter((e=>e!==i)):[...e,i]:i))),y(e)&&(null==n||n.setValue(i))),_(e)&&(null==n||n.hide()))})),j=p.onKeyDown,C=vx((e=>{if(null==j||j(e),e.defaultPrevented)return;const t=null==n?void 0:n.getState().baseElement;if(!t)return;if($y(t))return;(1===e.key.length||"Backspace"===e.key||"Delete"===e.key)&&(queueMicrotask((()=>t.focus())),Jv(t)&&(null==n||n.setValue(t.value)))}));m&&null!=g&&(p=bv({"aria-selected":g},p)),p=Sx(p,(e=>(0,oe.jsx)(Ly.Provider,{value:i,children:(0,oe.jsx)(Hy.Provider,{value:null!=g&&g,children:e})})),[i,g]);const k=(0,Hs.useContext)(Ny);p=wv(bv({role:Vb(k),children:i},p),{onClick:S,onKeyDown:C});const E=_x(u);return p=Nb(wv(bv({store:n},p),{getItem:f,moveOnKeyPress:e=>{if(!E(e))return!1;const t=new Event("combobox-item-move"),s=null==n?void 0:n.getState().baseElement;return null==s||s.dispatchEvent(t),!0}})),p=Eb(bv({store:n,focusOnHover:c},p))})),Rb=Tx(Ix((function(e){return Ox("div",Fb(e))})));function Bb(e){return Fv(e).toLowerCase()}function Db(e,t){if(!e)return e;if(!t)return e;const s=(n=t,Array.isArray(n)?n:void 0!==n?[n]:[]).filter(Boolean).map(Bb);var n;const i=[],r=(e,t=!1)=>(0,oe.jsx)("span",{"data-autocomplete-value":t?"":void 0,"data-user-value":t?void 0:"",children:e},i.length),o=function(e){return e.sort((([e],[t])=>e-t))}(function(e){return e.filter((([e,t],s,n)=>!n.some((([n,i],r)=>r!==s&&n<=e&&n+i>=e+t))))}(function(e,t){const s=[];for(const n of t){let t=0;const i=n.length;for(;-1!==e.indexOf(n,t);){const r=e.indexOf(n,t);-1!==r&&s.push([r,i]),t=r+1}}return s}(Bb(e),new Set(s))));if(!o.length)return i.push(r(e,!0)),i;const[a]=o[0],l=[e.slice(0,a),...o.flatMap((([t,s],n)=>{var i;const r=e.slice(t,t+s),a=null==(i=o[n+1])?void 0:i[0];return[r,e.slice(t+s,a)]}))];return l.forEach(((e,t)=>{e&&i.push(r(e,t%2==0))})),i}var zb=Ax((function(e){var t=e,{store:s,value:n,userValue:i}=t,r=_v(t,["store","value","userValue"]);const o=Ry();s=s||o;const a=(0,Hs.useContext)(Ly),l=null!=n?n:a,c=sy(s,(e=>null!=i?i:null==e?void 0:e.value)),u=(0,Hs.useMemo)((()=>{if(l)return c?Db(l,c):l}),[l,c]);return zv(r=bv({children:u},r))})),Lb=Ix((function(e){return Ox("span",zb(e))}));const Hb=(0,oe.jsx)(Jt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Jt.Circle,{cx:12,cy:12,r:3})});function Gb(e=""){return Rg()(e.trim().toLowerCase())}const Ub=[],Wb=(e,t)=>e.singleSelection?t?.value:Array.isArray(t?.value)?t.value:!Array.isArray(t?.value)&&t?.value?[t.value]:Ub,qb=(e,t,s)=>e.singleSelection?s:Array.isArray(t?.value)?t.value.includes(s)?t.value.filter((e=>e!==s)):[...t.value,s]:[s];function Zb(e,t){return`${e}-${t}`}function Kb({view:e,filter:t,onChangeView:s}){const n=(0,v.useInstanceId)(Kb,"dataviews-filter-list-box"),[i,r]=(0,d.useState)(1===t.operators?.length?void 0:null),o=e.filters?.find((e=>e.field===t.field)),a=Wb(t,o);return(0,oe.jsx)(y.Composite,{virtualFocus:!0,focusLoop:!0,activeId:i,setActiveId:r,role:"listbox",className:"dataviews-filters__search-widget-listbox","aria-label":(0,b.sprintf)((0,b.__)("List of: %1$s"),t.name),onFocusVisible:()=>{!i&&t.elements.length&&r(Zb(n,t.elements[0].value))},render:(0,oe.jsx)(y.Composite.Typeahead,{}),children:t.elements.map((i=>(0,oe.jsxs)(y.Composite.Hover,{render:(0,oe.jsx)(y.Composite.Item,{id:Zb(n,i.value),render:(0,oe.jsx)("div",{"aria-label":i.label,role:"option",className:"dataviews-filters__search-widget-listitem"}),onClick:()=>{var n,r;const a=o?[...(null!==(n=e.filters)&&void 0!==n?n:[]).map((e=>e.field===t.field?{...e,operator:o.operator||t.operators[0],value:qb(t,o,i.value)}:e))]:[...null!==(r=e.filters)&&void 0!==r?r:[],{field:t.field,operator:t.operators[0],value:qb(t,o,i.value)}];s({...e,page:1,filters:a})}}),children:[(0,oe.jsxs)("span",{className:"dataviews-filters__search-widget-listitem-check",children:[t.singleSelection&&a===i.value&&(0,oe.jsx)(y.Icon,{icon:Hb}),!t.singleSelection&&a.includes(i.value)&&(0,oe.jsx)(y.Icon,{icon:Xr})]}),(0,oe.jsx)("span",{children:i.label})]},i.value)))})}function Yb({view:e,filter:t,onChangeView:s}){const[n,i]=(0,d.useState)(""),r=(0,d.useDeferredValue)(n),o=e.filters?.find((e=>e.field===t.field)),a=Wb(t,o),l=(0,d.useMemo)((()=>{const e=Gb(r);return t.elements.filter((t=>Gb(t.label).includes(e)))}),[t.elements,r]);return(0,oe.jsxs)(Gy,{selectedValue:a,setSelectedValue:n=>{var i,r;const a=o?[...(null!==(i=e.filters)&&void 0!==i?i:[]).map((e=>e.field===t.field?{...e,operator:o.operator||t.operators[0],value:n}:e))]:[...null!==(r=e.filters)&&void 0!==r?r:[],{field:t.field,operator:t.operators[0],value:n}];s({...e,page:1,filters:a})},setValue:i,children:[(0,oe.jsxs)("div",{className:"dataviews-filters__search-widget-filter-combobox__wrapper",children:[(0,oe.jsx)(Wy,{render:(0,oe.jsx)(y.VisuallyHidden,{children:(0,b.__)("Search items")}),children:(0,b.__)("Search items")}),(0,oe.jsx)(vb,{autoSelect:"always",placeholder:(0,b.__)("Search"),className:"dataviews-filters__search-widget-filter-combobox__input"}),(0,oe.jsx)("div",{className:"dataviews-filters__search-widget-filter-combobox__icon",children:(0,oe.jsx)(y.Icon,{icon:Qt})})]}),(0,oe.jsxs)(jb,{className:"dataviews-filters__search-widget-filter-combobox-list",alwaysVisible:!0,children:[l.map((e=>(0,oe.jsxs)(Rb,{resetValueOnSelect:!1,value:e.value,className:"dataviews-filters__search-widget-listitem",hideOnClick:!1,setValueOnClick:!1,focusOnHover:!0,children:[(0,oe.jsxs)("span",{className:"dataviews-filters__search-widget-listitem-check",children:[t.singleSelection&&a===e.value&&(0,oe.jsx)(y.Icon,{icon:Hb}),!t.singleSelection&&a.includes(e.value)&&(0,oe.jsx)(y.Icon,{icon:Xr})]}),(0,oe.jsxs)("span",{children:[(0,oe.jsx)(Lb,{className:"dataviews-filters__search-widget-filter-combobox-item-value",value:e.label}),!!e.description&&(0,oe.jsx)("span",{className:"dataviews-filters__search-widget-listitem-description",children:e.description})]})]},e.value))),!l.length&&(0,oe.jsx)("p",{children:(0,b.__)("No results found")})]})]})}function Xb(e){const t=e.filter.elements.length>10?Yb:Kb;return(0,oe.jsx)(t,{...e})}const Jb="Enter",Qb=" ",$b=({activeElements:e,filterInView:t,filter:s})=>{if(void 0===e||0===e.length)return s.name;const n={Name:(0,oe.jsx)("span",{className:"dataviews-filters__summary-filter-text-name"}),Value:(0,oe.jsx)("span",{className:"dataviews-filters__summary-filter-text-value"})};return t?.operator===Hg?(0,d.createInterpolateElement)((0,b.sprintf)((0,b.__)("%1$s is any: %2$s"),s.name,e.map((e=>e.label)).join(", ")),n):t?.operator===Gg?(0,d.createInterpolateElement)((0,b.sprintf)((0,b.__)("%1$s is none: %2$s"),s.name,e.map((e=>e.label)).join(", ")),n):t?.operator===Ug?(0,d.createInterpolateElement)((0,b.sprintf)((0,b.__)("%1$s is all: %2$s"),s.name,e.map((e=>e.label)).join(", ")),n):t?.operator===Wg?(0,d.createInterpolateElement)((0,b.sprintf)((0,b.__)("%1$s is not all: %2$s"),s.name,e.map((e=>e.label)).join(", ")),n):t?.operator===zg?(0,d.createInterpolateElement)((0,b.sprintf)((0,b.__)("%1$s is: %2$s"),s.name,e[0].label),n):t?.operator===Lg?(0,d.createInterpolateElement)((0,b.sprintf)((0,b.__)("%1$s is not: %2$s"),s.name,e[0].label),n):(0,b.sprintf)((0,b.__)("Unknown status for %1$s"),s.name)};function ew({filter:e,view:t,onChangeView:s}){const n=e.operators?.map((e=>({value:e,label:Zg[e]?.label}))),i=t.filters?.find((t=>t.field===e.field)),r=i?.operator||e.operators[0];return n.length>1&&(0,oe.jsxs)(y.__experimentalHStack,{spacing:2,justify:"flex-start",className:"dataviews-filters__summary-operators-container",children:[(0,oe.jsx)(y.FlexItem,{className:"dataviews-filters__summary-operators-filter-name",children:e.name}),(0,oe.jsx)(y.SelectControl,{label:(0,b.__)("Conditions"),value:r,options:n,onChange:n=>{var r,o;const a=n,l=i?[...(null!==(r=t.filters)&&void 0!==r?r:[]).map((t=>t.field===e.field?{...t,operator:a}:t))]:[...null!==(o=t.filters)&&void 0!==o?o:[],{field:e.field,operator:a,value:void 0}];s({...t,page:1,filters:l})},size:"small",__nextHasNoMarginBottom:!0,hideLabelFromVision:!0})]})}function tw({addFilterRef:e,openedFilter:t,...s}){const n=(0,d.useRef)(null),{filter:i,view:r,onChangeView:o}=s,a=r.filters?.find((e=>e.field===i.field)),l=i.elements.filter((e=>i.singleSelection?e.value===a?.value:a?.value?.includes(e.value))),c=i.isPrimary,u=void 0!==a?.value,p=!c||u;return(0,oe.jsx)(y.Dropdown,{defaultOpen:t===i.field,contentClassName:"dataviews-filters__summary-popover",popoverProps:{placement:"bottom-start",role:"dialog"},onClose:()=>{n.current?.focus()},renderToggle:({isOpen:t,onToggle:s})=>(0,oe.jsxs)("div",{className:"dataviews-filters__summary-chip-container",children:[(0,oe.jsx)(y.Tooltip,{text:(0,b.sprintf)((0,b.__)("Filter by: %1$s"),i.name.toLowerCase()),placement:"top",children:(0,oe.jsx)("div",{className:Ut("dataviews-filters__summary-chip",{"has-reset":p,"has-values":u}),role:"button",tabIndex:0,onClick:s,onKeyDown:e=>{[Jb,Qb].includes(e.key)&&(s(),e.preventDefault())},"aria-pressed":t,"aria-expanded":t,ref:n,children:(0,oe.jsx)($b,{activeElements:l,filterInView:a,filter:i})})}),p&&(0,oe.jsx)(y.Tooltip,{text:c?(0,b.__)("Reset"):(0,b.__)("Remove"),placement:"top",children:(0,oe.jsx)("button",{className:Ut("dataviews-filters__summary-chip-remove",{"has-values":u}),onClick:()=>{o({...r,page:1,filters:r.filters?.filter((e=>e.field!==i.field))}),c?n.current?.focus():e.current?.focus()},children:(0,oe.jsx)(y.Icon,{icon:fm})})})]}),renderContent:()=>(0,oe.jsxs)(y.__experimentalVStack,{spacing:0,justify:"flex-start",children:[(0,oe.jsx)(ew,{...s}),(0,oe.jsx)(Xb,{...s})]})})}const{lock:sw,unlock:nw}=(0,$.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/dataviews"),{DropdownMenuV2:iw}=nw(y.privateApis);function rw({filters:e,view:t,onChangeView:s,setOpenedFilter:n,trigger:i}){const r=e.filter((e=>!e.isVisible));return(0,oe.jsx)(iw,{trigger:i,children:r.map((e=>(0,oe.jsx)(iw.Item,{onClick:()=>{n(e.field),s({...t,page:1,filters:[...t.filters||[],{field:e.field,value:void 0,operator:e.operators[0]}]})},children:(0,oe.jsx)(iw.ItemLabel,{children:e.name})},e.field)))})}const ow=(0,d.forwardRef)((function({filters:e,view:t,onChangeView:s,setOpenedFilter:n},i){if(!e.length||e.every((({isPrimary:e})=>e)))return null;const r=e.filter((e=>!e.isVisible));return(0,oe.jsx)(rw,{trigger:(0,oe.jsx)(y.Button,{accessibleWhenDisabled:!0,size:"compact",className:"dataviews-filters-button",variant:"tertiary",disabled:!r.length,ref:i,children:(0,b.__)("Add filter")}),filters:e,view:t,onChangeView:s,setOpenedFilter:n})}));function aw({filters:e,view:t,onChangeView:s}){const n=!t.search&&!t.filters?.some((t=>{return void 0!==t.value||(s=t.field,!e.some((e=>e.field===s&&e.isPrimary)));var s}));return(0,oe.jsx)(y.Button,{disabled:n,accessibleWhenDisabled:!0,size:"compact",variant:"tertiary",className:"dataviews-filters__reset-button",onClick:()=>{s({...t,page:1,search:"",filters:[]})},children:(0,b.__)("Reset")})}function lw(e){let t=e.filterBy?.operators;return t&&Array.isArray(t)||(t=[Hg,Gg]),t=t.filter((e=>qg.includes(e))),(t.includes(zg)||t.includes(Lg))&&(t=t.filter((e=>[zg,Lg].includes(e)))),t}function cw(e,t){return(0,d.useMemo)((()=>{const s=[];return e.forEach((e=>{if(!e.elements?.length)return;const n=lw(e);if(0===n.length)return;const i=!!e.filterBy?.isPrimary;s.push({field:e.id,name:e.label,elements:e.elements,singleSelection:n.some((e=>[zg,Lg].includes(e))),operators:n,isVisible:i||!!t.filters?.some((t=>t.field===e.id&&qg.includes(t.operator))),isPrimary:i})})),s.sort(((e,t)=>e.isPrimary&&!t.isPrimary?-1:!e.isPrimary&&t.isPrimary?1:e.name.localeCompare(t.name))),s}),[e,t])}function uw({filters:e,view:t,onChangeView:s,setOpenedFilter:n,isShowingFilter:i,setIsShowingFilter:r}){const o=(0,d.useCallback)((e=>{s(e),r(!0)}),[s,r]),a=!!e.filter((e=>e.isVisible)).length;return 0===e.length?null:a?(0,oe.jsxs)("div",{className:"dataviews-filters__container-visibility-toggle",children:[(0,oe.jsx)(y.Button,{className:"dataviews-filters__visibility-toggle",size:"compact",icon:pv,label:(0,b.__)("Toggle filter display"),onClick:()=>{i||n(null),r(!i)},isPressed:i,"aria-expanded":i}),a&&!!t.filters?.length&&(0,oe.jsx)("span",{className:"dataviews-filters-toggle__count",children:t.filters?.length})]}):(0,oe.jsx)(rw,{filters:e,view:t,onChangeView:o,setOpenedFilter:n,trigger:(0,oe.jsx)(y.Button,{className:"dataviews-filters__visibility-toggle",size:"compact",icon:pv,label:(0,b.__)("Add filter"),isPressed:!1,"aria-expanded":!1})})}const dw=(0,d.memo)((function(){const{fields:e,view:t,onChangeView:s,openedFilter:n,setOpenedFilter:i}=(0,d.useContext)(dv),r=(0,d.useRef)(null),o=cw(e,t),a=(0,oe.jsx)(ow,{filters:o,view:t,onChangeView:s,ref:r,setOpenedFilter:i},"add-filter"),l=o.filter((e=>e.isVisible));if(0===l.length)return null;const c=[...l.map((e=>(0,oe.jsx)(tw,{filter:e,view:t,onChangeView:s,addFilterRef:r,openedFilter:n},e.field))),a];return c.push((0,oe.jsx)(aw,{filters:o,view:t,onChangeView:s},"reset-filters")),(0,oe.jsx)(y.__experimentalHStack,{justify:"flex-start",style:{width:"fit-content"},className:"dataviews-filters__container",wrap:!0,children:c})})),pw=(0,oe.jsx)(Jt.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,oe.jsx)(Jt.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM5 4.5h14c.3 0 .5.2.5.5v3.5h-15V5c0-.3.2-.5.5-.5zm8 5.5h6.5v3.5H13V10zm-1.5 3.5h-7V10h7v3.5zm-7 5.5v-4h7v4.5H5c-.3 0-.5-.2-.5-.5zm14.5.5h-6V15h6.5v4c0 .3-.2.5-.5.5z"})}),hw=(0,oe.jsx)(Jt.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,oe.jsx)(Jt.Path,{d:"M6 5.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM4 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2V6zm11-.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5h-3a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM13 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2h-3a2 2 0 01-2-2V6zm5 8.5h-3a.5.5 0 00-.5.5v3a.5.5 0 00.5.5h3a.5.5 0 00.5-.5v-3a.5.5 0 00-.5-.5zM15 13a2 2 0 00-2 2v3a2 2 0 002 2h3a2 2 0 002-2v-3a2 2 0 00-2-2h-3zm-9 1.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5v-3a.5.5 0 01.5-.5zM4 15a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2v-3z",fillRule:"evenodd",clipRule:"evenodd"})}),fw=(0,oe.jsx)(Jt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Jt.Path,{d:"M4 8.8h8.9V7.2H4v1.6zm0 7h8.9v-1.5H4v1.5zM18 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z"})}),mw=(0,oe.jsx)(Jt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Jt.Path,{d:"M11.1 15.8H20v-1.5h-8.9v1.5zm0-8.6v1.5H20V7.2h-8.9zM6 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-7c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})});function gw({selection:e,onChangeSelection:t,item:s,getItemId:n,primaryField:i,disabled:r}){const o=n(s),a=!r&&e.includes(o);let l;return l=i?.getValue&&s?(0,b.sprintf)(a?(0,b.__)("Deselect item: %s"):(0,b.__)("Select item: %s"),i.getValue({item:s})):a?(0,b.__)("Select a new item"):(0,b.__)("Deselect item"),(0,oe.jsx)(y.CheckboxControl,{className:"dataviews-selection-checkbox",__nextHasNoMarginBottom:!0,"aria-label":l,"aria-disabled":r,checked:a,onChange:()=>{r||t(e.includes(o)?e.filter((e=>o!==e)):[...e,o])}})}const{DropdownMenuV2:vw,kebabCase:xw}=nw(y.privateApis);function yw({action:e,onClick:t,items:s}){const n="string"==typeof e.label?e.label:e.label(s);return(0,oe.jsx)(y.Button,{label:n,icon:e.icon,isDestructive:e.isDestructive,size:"compact",onClick:t})}function bw({action:e,onClick:t,items:s}){const n="string"==typeof e.label?e.label:e.label(s);return(0,oe.jsx)(vw.Item,{onClick:t,hideOnClick:!("RenderModal"in e),children:(0,oe.jsx)(vw.ItemLabel,{children:n})})}function ww({action:e,items:t,closeModal:s}){const n="string"==typeof e.label?e.label:e.label(t);return(0,oe.jsx)(y.Modal,{title:e.modalHeader||n,__experimentalHideHeader:!!e.hideModalHeader,onRequestClose:null!=s?s:()=>{},focusOnMount:"firstContentElement",size:"small",overlayClassName:`dataviews-action-modal dataviews-action-modal__${xw(e.id)}`,children:(0,oe.jsx)(e.RenderModal,{items:t,closeModal:s})})}function _w({action:e,items:t,ActionTrigger:s,isBusy:n}){const[i,r]=(0,d.useState)(!1),o={action:e,onClick:()=>{r(!0)},items:t,isBusy:n};return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(s,{...o}),i&&(0,oe.jsx)(ww,{action:e,items:t,closeModal:()=>r(!1)})]})}function Sw({actions:e,item:t}){const s=(0,l.useRegistry)();return(0,oe.jsx)(vw.Group,{children:e.map((e=>"RenderModal"in e?(0,oe.jsx)(_w,{action:e,items:[t],ActionTrigger:bw},e.id):(0,oe.jsx)(bw,{action:e,onClick:()=>{e.callback([t],{registry:s})},items:[t]},e.id)))})}function jw({item:e,actions:t,isCompact:s}){const n=(0,l.useRegistry)(),{primaryActions:i,eligibleActions:r}=(0,d.useMemo)((()=>{const s=t.filter((t=>!t.isEligible||t.isEligible(e)));return{primaryActions:s.filter((e=>e.isPrimary&&!!e.icon)),eligibleActions:s}}),[t,e]);return s?(0,oe.jsx)(Cw,{item:e,actions:r}):(0,oe.jsxs)(y.__experimentalHStack,{spacing:1,justify:"flex-end",className:"dataviews-item-actions",style:{flexShrink:"0",width:"auto"},children:[!!i.length&&i.map((t=>"RenderModal"in t?(0,oe.jsx)(_w,{action:t,items:[e],ActionTrigger:yw},t.id):(0,oe.jsx)(yw,{action:t,onClick:()=>{t.callback([e],{registry:n})},items:[e]},t.id))),(0,oe.jsx)(Cw,{item:e,actions:r})]})}function Cw({item:e,actions:t}){return(0,oe.jsx)(vw,{trigger:(0,oe.jsx)(y.Button,{size:"compact",icon:ma,label:(0,b.__)("Actions"),accessibleWhenDisabled:!0,disabled:!t.length,className:"dataviews-all-actions-button"}),placement:"bottom-end",children:(0,oe.jsx)(Sw,{actions:t,item:e})})}function kw(e,t){return(0,d.useMemo)((()=>e.some((e=>e.supportsBulk&&(!e.isEligible||e.isEligible(t))))),[e,t])}function Ew(e,t){return(0,d.useMemo)((()=>t.some((t=>e.some((e=>e.supportsBulk&&(!e.isEligible||e.isEligible(t))))))),[e,t])}function Pw({selection:e,onChangeSelection:t,data:s,actions:n,getItemId:i}){const r=(0,d.useMemo)((()=>s.filter((e=>n.some((t=>t.supportsBulk&&(!t.isEligible||t.isEligible(e))))))),[s,n]),o=s.filter((t=>e.includes(i(t))&&r.includes(t))),a=o.length===r.length;return(0,oe.jsx)(y.CheckboxControl,{className:"dataviews-view-table-selection-checkbox",__nextHasNoMarginBottom:!0,checked:a,indeterminate:!a&&!!o.length,onChange:()=>{t(a?[]:r.map((e=>i(e))))},"aria-label":a?(0,b.__)("Deselect all"):(0,b.__)("Select all")})}function Iw({action:e,onClick:t,isBusy:s,items:n}){const i="string"==typeof e.label?e.label:e.label(n);return(0,oe.jsx)(y.Button,{disabled:s,accessibleWhenDisabled:!0,label:i,icon:e.icon,isDestructive:e.isDestructive,size:"compact",onClick:t,isBusy:s,tooltipPosition:"top"})}const Tw=[];function Ow({action:e,selectedItems:t,actionInProgress:s,setActionInProgress:n}){const i=(0,l.useRegistry)(),r=(0,d.useMemo)((()=>t.filter((t=>!e.isEligible||e.isEligible(t)))),[e,t]);return"RenderModal"in e?(0,oe.jsx)(_w,{action:e,items:r,ActionTrigger:Iw},e.id):(0,oe.jsx)(Iw,{action:e,onClick:async()=>{n(e.id),await e.callback(t,{registry:i}),n(null)},items:r,isBusy:s===e.id},e.id)}function Aw(e,t,s,n,i,r,o,a,l){const c=r.length>0?(0,b.sprintf)((0,b._n)("%d Item selected","%d Items selected",r.length),r.length):(0,b.sprintf)((0,b._n)("%d Item","%d Items",e.length),e.length);return(0,oe.jsxs)(y.__experimentalHStack,{expanded:!1,className:"dataviews-bulk-actions-footer__container",spacing:3,children:[(0,oe.jsx)(Pw,{selection:n,onChangeSelection:l,data:e,actions:t,getItemId:s}),(0,oe.jsx)("span",{className:"dataviews-bulk-actions-footer__item-count",children:c}),(0,oe.jsxs)(y.__experimentalHStack,{className:"dataviews-bulk-actions-footer__action-buttons",expanded:!1,spacing:1,children:[i.map((e=>(0,oe.jsx)(Ow,{action:e,selectedItems:r,actionInProgress:o,setActionInProgress:a},e.id))),r.length>0&&(0,oe.jsx)(y.Button,{icon:fm,showTooltip:!0,tooltipPosition:"top",size:"compact",label:(0,b.__)("Cancel"),disabled:!!o,accessibleWhenDisabled:!1,onClick:()=>{l(Tw)}})]})]})}function Mw({selection:e,actions:t,onChangeSelection:s,data:n,getItemId:i}){const[r,o]=(0,d.useState)(null),a=(0,d.useRef)(null),l=(0,d.useMemo)((()=>t.filter((e=>e.supportsBulk))),[t]),c=(0,d.useMemo)((()=>n.filter((e=>l.some((t=>!t.isEligible||t.isEligible(e)))))),[n,l]),u=(0,d.useMemo)((()=>n.filter((t=>e.includes(i(t))&&c.includes(t)))),[e,n,i,c]),p=(0,d.useMemo)((()=>t.filter((e=>e.supportsBulk&&e.icon&&u.some((t=>!e.isEligible||e.isEligible(t)))))),[t,u]);return r?(a.current||(a.current=Aw(n,t,i,e,p,u,r,o,s)),a.current):(a.current&&(a.current=null),Aw(n,t,i,e,p,u,r,o,s))}function Nw(){const{data:e,selection:t,actions:s=Tw,onChangeSelection:n,getItemId:i}=(0,d.useContext)(dv);return(0,oe.jsx)(Mw,{selection:t,onChangeSelection:n,data:e,actions:s,getItemId:i})}const Vw=(0,oe.jsx)(Jt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Jt.Path,{d:"M20 11.2H6.8l3.7-3.7-1-1L3.9 12l5.6 5.5 1-1-3.7-3.7H20z"})}),Fw=(0,oe.jsx)(Jt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Jt.Path,{d:"m14.5 6.5-1 1 3.7 3.7H4v1.6h13.2l-3.7 3.7 1 1 5.6-5.5z"})}),Rw=(0,oe.jsx)(Jt.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,oe.jsx)(Jt.Path,{d:"M4.67 10.664s-2.09 1.11-2.917 1.582l.494.87 1.608-.914.002.002c.343.502.86 1.17 1.563 1.84.348.33.742.663 1.185.976L5.57 16.744l.858.515 1.02-1.701a9.1 9.1 0 0 0 4.051 1.18V19h1v-2.263a9.1 9.1 0 0 0 4.05-1.18l1.021 1.7.858-.514-1.034-1.723c.442-.313.837-.646 1.184-.977.703-.669 1.22-1.337 1.563-1.839l.002-.003 1.61.914.493-.87c-1.75-.994-2.918-1.58-2.918-1.58l-.003.005a8.29 8.29 0 0 1-.422.689 10.097 10.097 0 0 1-1.36 1.598c-1.218 1.16-3.042 2.293-5.544 2.293-2.503 0-4.327-1.132-5.546-2.293a10.099 10.099 0 0 1-1.359-1.599 8.267 8.267 0 0 1-.422-.689l-.003-.005Z"})}),{DropdownMenuV2:Bw}=nw(y.privateApis);function Dw({children:e}){return d.Children.toArray(e).filter(Boolean).map(((e,t)=>(0,oe.jsxs)(d.Fragment,{children:[t>0&&(0,oe.jsx)(Bw.Separator,{}),e]},t)))}const zw=(0,d.forwardRef)((function({fieldId:e,view:t,fields:s,onChangeView:n,onHide:i,setOpenedFilter:r},o){const a=t_(t,s),l=a?.indexOf(e),c=t.sort?.field===e;let u,d=!1,p=!1,h=!1,f=[];const m=t.layout?.combinedFields?.find((t=>t.id===e)),g=s.find((t=>t.id===e));if(m)u=m.header||m.label;else{if(!g)return null;d=!1!==g.enableHiding,p=!1!==g.enableSorting,u=g.header,f=lw(g),h=!(t.filters?.some((t=>e===t.field))||!g.elements?.length||!f.length||g.filterBy?.isPrimary)}return(0,oe.jsx)(Bw,{align:"start",trigger:(0,oe.jsxs)(y.Button,{size:"compact",className:"dataviews-view-table-header-button",ref:o,variant:"tertiary",children:[u,t.sort&&c&&(0,oe.jsx)("span",{"aria-hidden":"true",children:Yg[t.sort.direction]})]}),style:{minWidth:"240px"},children:(0,oe.jsxs)(Dw,{children:[p&&(0,oe.jsx)(Bw.Group,{children:Kg.map((s=>{const i=t.sort&&c&&t.sort.direction===s,r=`${e}-${s}`;return(0,oe.jsx)(Bw.RadioItem,{name:"view-table-sorting",value:r,checked:i,onChange:()=>{n({...t,sort:{field:e,direction:s}})},children:(0,oe.jsx)(Bw.ItemLabel,{children:Jg[s]})},r)}))}),h&&(0,oe.jsx)(Bw.Group,{children:(0,oe.jsx)(Bw.Item,{prefix:(0,oe.jsx)(y.Icon,{icon:pv}),onClick:()=>{r(e),n({...t,page:1,filters:[...t.filters||[],{field:e,value:void 0,operator:f[0]}]})},children:(0,oe.jsx)(Bw.ItemLabel,{children:(0,b.__)("Add filter")})})}),(0,oe.jsxs)(Bw.Group,{children:[(0,oe.jsx)(Bw.Item,{prefix:(0,oe.jsx)(y.Icon,{icon:Vw}),disabled:l<1,onClick:()=>{var s;n({...t,fields:[...null!==(s=a.slice(0,l-1))&&void 0!==s?s:[],e,a[l-1],...a.slice(l+1)]})},children:(0,oe.jsx)(Bw.ItemLabel,{children:(0,b.__)("Move left")})}),(0,oe.jsx)(Bw.Item,{prefix:(0,oe.jsx)(y.Icon,{icon:Fw}),disabled:l>=a.length-1,onClick:()=>{var s;n({...t,fields:[...null!==(s=a.slice(0,l))&&void 0!==s?s:[],a[l+1],e,...a.slice(l+2)]})},children:(0,oe.jsx)(Bw.ItemLabel,{children:(0,b.__)("Move right")})}),d&&g&&(0,oe.jsx)(Bw.Item,{prefix:(0,oe.jsx)(y.Icon,{icon:Rw}),onClick:()=>{i(g),n({...t,fields:a.filter((t=>t!==e))})},children:(0,oe.jsx)(Bw.ItemLabel,{children:(0,b.__)("Hide column")})})]})]})})})),Lw=zw;function Hw({column:e,fields:t,view:s,...n}){const i=t.find((t=>t.id===e));if(i)return(0,oe.jsx)(Gw,{...n,field:i});const r=s.layout?.combinedFields?.find((t=>t.id===e));return r?(0,oe.jsx)(Uw,{...n,fields:t,view:s,field:r}):null}function Gw({primaryField:e,item:t,field:s}){return(0,oe.jsx)("div",{className:Ut("dataviews-view-table__cell-content-wrapper",{"dataviews-view-table__primary-field":e?.id===s.id}),children:(0,oe.jsx)(s.render,{item:t})})}function Uw({field:e,...t}){const s=e.children.map((e=>(0,oe.jsx)(Hw,{...t,column:e},e)));return"horizontal"===e.direction?(0,oe.jsx)(y.__experimentalHStack,{spacing:3,children:s}):(0,oe.jsx)(y.__experimentalVStack,{spacing:0,children:s})}function Ww({hasBulkActions:e,item:t,actions:s,fields:n,id:i,view:r,primaryField:o,selection:a,getItemId:l,onChangeSelection:c}){const u=kw(s,t),p=u&&a.includes(i),[h,f]=(0,d.useState)(!1),m=(0,d.useRef)(!1),g=t_(r,n);return(0,oe.jsxs)("tr",{className:Ut("dataviews-view-table__row",{"is-selected":u&&p,"is-hovered":h,"has-bulk-actions":u}),onMouseEnter:()=>{f(!0)},onMouseLeave:()=>{f(!1)},onTouchStart:()=>{m.current=!0},onClick:()=>{u&&(m.current||"Range"===document.getSelection()?.type||c(a.includes(i)?a.filter((e=>i!==e)):[i]))},children:[e&&(0,oe.jsx)("td",{className:"dataviews-view-table__checkbox-column",style:{width:"1%"},children:(0,oe.jsx)("div",{className:"dataviews-view-table__cell-content-wrapper",children:(0,oe.jsx)(gw,{item:t,selection:a,onChangeSelection:c,getItemId:l,primaryField:o,disabled:!u})})}),g.map((e=>{var s;const{width:i,maxWidth:a,minWidth:l}=null!==(s=r.layout?.styles?.[e])&&void 0!==s?s:{};return(0,oe.jsx)("td",{style:{width:i,maxWidth:a,minWidth:l},children:(0,oe.jsx)(Hw,{primaryField:o,fields:n,item:t,column:e,view:r})},e)})),!!s?.length&&(0,oe.jsx)("td",{className:"dataviews-view-table__actions-column",onClick:e=>e.stopPropagation(),children:(0,oe.jsx)(jw,{item:t,actions:s})})]})}const qw=function({actions:e,data:t,fields:s,getItemId:n,isLoading:i=!1,onChangeView:r,onChangeSelection:o,selection:a,setOpenedFilter:l,view:c}){const u=(0,d.useRef)(new Map),p=(0,d.useRef)(),[h,f]=(0,d.useState)(),m=Ew(e,t);(0,d.useEffect)((()=>{p.current&&(p.current.focus(),p.current=void 0)}));const g=(0,d.useId)();if(h)return p.current=h,void f(void 0);const v=e=>{const t=u.current.get(e.id),s=t?u.current.get(t.fallback):void 0;f(s?.node)},x=t_(c,s),w=!!t?.length,_=s.find((e=>e.id===c.layout?.primaryField));return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsxs)("table",{className:"dataviews-view-table","aria-busy":i,"aria-describedby":g,children:[(0,oe.jsx)("thead",{children:(0,oe.jsxs)("tr",{className:"dataviews-view-table__row",children:[m&&(0,oe.jsx)("th",{className:"dataviews-view-table__checkbox-column",style:{width:"1%"},scope:"col",children:(0,oe.jsx)(Pw,{selection:a,onChangeSelection:o,data:t,actions:e,getItemId:n})}),x.map(((e,t)=>{var n;const{width:i,maxWidth:o,minWidth:a}=null!==(n=c.layout?.styles?.[e])&&void 0!==n?n:{};return(0,oe.jsx)("th",{style:{width:i,maxWidth:o,minWidth:a},"aria-sort":c.sort?.field===e?Xg[c.sort.direction]:void 0,scope:"col",children:(0,oe.jsx)(Lw,{ref:s=>{s?u.current.set(e,{node:s,fallback:x[t>0?t-1:1]}):u.current.delete(e)},fieldId:e,view:c,fields:s,onChangeView:r,onHide:v,setOpenedFilter:l})},e)})),!!e?.length&&(0,oe.jsx)("th",{className:"dataviews-view-table__actions-column",children:(0,oe.jsx)("span",{className:"dataviews-view-table-header",children:(0,b.__)("Actions")})})]})}),(0,oe.jsx)("tbody",{children:w&&t.map(((t,i)=>(0,oe.jsx)(Ww,{item:t,hasBulkActions:m,actions:e,fields:s,id:n(t)||i.toString(),view:c,primaryField:_,selection:a,getItemId:n,onChangeSelection:o},n(t))))})]}),(0,oe.jsx)("div",{className:Ut({"dataviews-loading":i,"dataviews-no-results":!w&&!i}),id:g,children:!w&&(0,oe.jsx)("p",{children:i?(0,oe.jsx)(y.Spinner,{}):(0,b.__)("No results")})})]})};function Zw({selection:e,onChangeSelection:t,getItemId:s,item:n,actions:i,mediaField:r,primaryField:o,visibleFields:a,badgeFields:l,columnFields:c}){const u=kw(i,n),d=s(n),p=e.includes(d),h=r?.render?(0,oe.jsx)(r.render,{item:n}):null,f=o?.render?(0,oe.jsx)(o.render,{item:n}):null;return(0,oe.jsxs)(y.__experimentalVStack,{spacing:0,className:Ut("dataviews-view-grid__card",{"is-selected":u&&p}),onClickCapture:s=>{if(s.ctrlKey||s.metaKey){if(s.stopPropagation(),s.preventDefault(),!u)return;t(e.includes(d)?e.filter((e=>d!==e)):[...e,d])}},children:[(0,oe.jsx)("div",{className:"dataviews-view-grid__media",children:h}),(0,oe.jsx)(gw,{item:n,selection:e,onChangeSelection:t,getItemId:s,primaryField:o,disabled:!u}),(0,oe.jsxs)(y.__experimentalHStack,{justify:"space-between",className:"dataviews-view-grid__title-actions",children:[(0,oe.jsx)(y.__experimentalHStack,{className:"dataviews-view-grid__primary-field",children:f}),(0,oe.jsx)(jw,{item:n,actions:i,isCompact:!0})]}),!!l?.length&&(0,oe.jsx)(y.__experimentalHStack,{className:"dataviews-view-grid__badge-fields",spacing:2,wrap:!0,alignment:"top",justify:"flex-start",children:l.map((e=>(0,oe.jsx)(y.FlexItem,{className:"dataviews-view-grid__field-value",children:(0,oe.jsx)(e.render,{item:n})},e.id)))}),!!a?.length&&(0,oe.jsx)(y.__experimentalVStack,{className:"dataviews-view-grid__fields",spacing:1,children:a.map((e=>(0,oe.jsx)(y.Flex,{className:Ut("dataviews-view-grid__field",c?.includes(e.id)?"is-column":"is-row"),gap:1,justify:"flex-start",expanded:!0,style:{height:"auto"},direction:c?.includes(e.id)?"column":"row",children:(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(y.FlexItem,{className:"dataviews-view-grid__field-name",children:e.header}),(0,oe.jsx)(y.FlexItem,{className:"dataviews-view-grid__field-value",style:{maxHeight:"none"},children:(0,oe.jsx)(e.render,{item:n})})]})},e.id)))})]},d)}const{DropdownMenuV2:Kw}=nw(y.privateApis);function Yw(e){return`${e}-item-wrapper`}function Xw(e){return`${e}-dropdown`}function Jw({idPrefix:e,primaryAction:t,item:s}){const n=(0,l.useRegistry)(),[i,r]=(0,d.useState)(!1),o=function(e,t){return`${e}-primary-action-${t}`}(e,t.id),a="string"==typeof t.label?t.label:t.label([s]);return"RenderModal"in t?(0,oe.jsx)("div",{role:"gridcell",children:(0,oe.jsx)(y.Composite.Item,{id:o,render:(0,oe.jsx)(y.Button,{label:a,icon:t.icon,isDestructive:t.isDestructive,size:"small",onClick:()=>r(!0)}),children:i&&(0,oe.jsx)(ww,{action:t,items:[s],closeModal:()=>r(!1)})})},t.id):(0,oe.jsx)("div",{role:"gridcell",children:(0,oe.jsx)(y.Composite.Item,{id:o,render:(0,oe.jsx)(y.Button,{label:a,icon:t.icon,isDestructive:t.isDestructive,size:"small",onClick:()=>{t.callback([s],{registry:n})}})})},t.id)}function Qw({actions:e,idPrefix:t,isSelected:s,item:n,mediaField:i,onSelect:r,primaryField:o,visibleFields:a,onDropdownTriggerKeyDown:l}){const c=(0,d.useRef)(null),u=`${t}-label`,p=`${t}-description`,[h,f]=(0,d.useState)(!1),m=({type:e})=>{f("mouseenter"===e)};(0,d.useEffect)((()=>{s&&c.current?.scrollIntoView({behavior:"auto",block:"nearest",inline:"nearest"})}),[s]);const{primaryAction:g,eligibleActions:v}=(0,d.useMemo)((()=>{const t=e.filter((e=>!e.isEligible||e.isEligible(n))),s=t.filter((e=>e.isPrimary&&!!e.icon));return{primaryAction:s?.[0],eligibleActions:t}}),[e,n]),x=i?.render?(0,oe.jsx)(i.render,{item:n}):(0,oe.jsx)("div",{className:"dataviews-view-list__media-placeholder"}),w=o?.render?(0,oe.jsx)(o.render,{item:n}):null,_=v?.length>0&&(0,oe.jsxs)(y.__experimentalHStack,{spacing:3,className:"dataviews-view-list__item-actions",children:[g&&(0,oe.jsx)(Jw,{idPrefix:t,primaryAction:g,item:n}),(0,oe.jsx)("div",{role:"gridcell",children:(0,oe.jsx)(Kw,{trigger:(0,oe.jsx)(y.Composite.Item,{id:Xw(t),render:(0,oe.jsx)(y.Button,{size:"small",icon:ma,label:(0,b.__)("Actions"),accessibleWhenDisabled:!0,disabled:!e.length,onKeyDown:l})}),placement:"bottom-end",children:(0,oe.jsx)(Sw,{actions:v,item:n})})})]});return(0,oe.jsx)(y.Composite.Row,{ref:c,render:(0,oe.jsx)("li",{}),role:"row",className:Ut({"is-selected":s,"is-hovered":h}),onMouseEnter:m,onMouseLeave:m,children:(0,oe.jsxs)(y.__experimentalHStack,{className:"dataviews-view-list__item-wrapper",spacing:0,children:[(0,oe.jsx)("div",{role:"gridcell",children:(0,oe.jsx)(y.Composite.Item,{id:Yw(t),"aria-pressed":s,"aria-labelledby":u,"aria-describedby":p,className:"dataviews-view-list__item",onClick:()=>r(n)})}),(0,oe.jsxs)(y.__experimentalHStack,{spacing:3,justify:"start",alignment:"flex-start",children:[(0,oe.jsx)("div",{className:"dataviews-view-list__media-wrapper",children:x}),(0,oe.jsxs)(y.__experimentalVStack,{spacing:1,className:"dataviews-view-list__field-wrapper",children:[(0,oe.jsxs)(y.__experimentalHStack,{spacing:0,children:[(0,oe.jsx)("div",{className:"dataviews-view-list__primary-field",id:u,children:w}),_]}),(0,oe.jsx)("div",{className:"dataviews-view-list__fields",id:p,children:a.map((e=>(0,oe.jsxs)("div",{className:"dataviews-view-list__field",children:[(0,oe.jsx)(y.VisuallyHidden,{as:"span",className:"dataviews-view-list__field-label",children:e.label}),(0,oe.jsx)("span",{className:"dataviews-view-list__field-value",children:(0,oe.jsx)(e.render,{item:n})})]},e.id)))})]})]})]})})}const $w=[{type:$g,label:(0,b.__)("Table"),component:qw,icon:pw},{type:ev,label:(0,b.__)("Grid"),component:function({actions:e,data:t,fields:s,getItemId:n,isLoading:i,onChangeSelection:r,selection:o,view:a,density:l}){const c=s.find((e=>e.id===a.layout?.mediaField)),u=s.find((e=>e.id===a.layout?.primaryField)),d=a.fields||s.map((e=>e.id)),{visibleFields:p,badgeFields:h}=s.reduce(((e,t)=>{if(!d.includes(t.id)||[a.layout?.mediaField,a?.layout?.primaryField].includes(t.id))return e;return e[a.layout?.badgeFields?.includes(t.id)?"badgeFields":"visibleFields"].push(t),e}),{visibleFields:[],badgeFields:[]}),f=!!t?.length,m=l?{gridTemplateColumns:`repeat(${l}, minmax(0, 1fr))`}:{};return(0,oe.jsxs)(oe.Fragment,{children:[f&&(0,oe.jsx)(y.__experimentalGrid,{gap:8,columns:2,alignment:"top",className:"dataviews-view-grid",style:m,"aria-busy":i,children:t.map((t=>(0,oe.jsx)(Zw,{selection:o,onChangeSelection:r,getItemId:n,item:t,actions:e,mediaField:c,primaryField:u,visibleFields:p,badgeFields:h,columnFields:a.layout?.columnFields},n(t))))}),!f&&(0,oe.jsx)("div",{className:Ut({"dataviews-loading":i,"dataviews-no-results":!i}),children:(0,oe.jsx)("p",{children:i?(0,oe.jsx)(y.Spinner,{}):(0,b.__)("No results")})})]})},icon:hw},{type:tv,label:(0,b.__)("List"),component:function e(t){const{actions:s,data:n,fields:i,getItemId:r,isLoading:o,onChangeSelection:a,selection:l,view:c}=t,u=(0,v.useInstanceId)(e,"view-list"),p=n?.findLast((e=>l.includes(r(e)))),h=i.find((e=>e.id===c.layout?.mediaField)),f=i.find((e=>e.id===c.layout?.primaryField)),m=c.fields||i.map((e=>e.id)),g=i.filter((e=>m.includes(e.id)&&![c.layout?.primaryField,c.layout?.mediaField].includes(e.id))),x=e=>a([r(e)]),w=(0,d.useCallback)((e=>`${u}-${r(e)}`),[u,r]),_=(0,d.useCallback)(((e,t)=>t.startsWith(w(e))),[w]),[S,j]=(0,d.useState)(void 0);(0,d.useEffect)((()=>{p&&j(Yw(w(p)))}),[p,w]);const C=n.findIndex((e=>_(e,null!=S?S:""))),k=(0,v.usePrevious)(C),E=-1!==C,P=(0,d.useCallback)(((e,t)=>{const s=Math.min(n.length-1,Math.max(0,e));if(!n[s])return;const i=t(w(n[s]));j(i),document.getElementById(i)?.focus()}),[n,w]);(0,d.useEffect)((()=>{!E&&(void 0!==k&&-1!==k)&&P(k,Yw)}),[E,P,k]);const I=(0,d.useCallback)((e=>{"ArrowDown"===e.key&&(e.preventDefault(),P(C+1,Xw)),"ArrowUp"===e.key&&(e.preventDefault(),P(C-1,Xw))}),[P,C]),T=n?.length;return T?(0,oe.jsx)(y.Composite,{id:u,render:(0,oe.jsx)("ul",{}),className:"dataviews-view-list",role:"grid",activeId:S,setActiveId:j,children:n.map((e=>{const t=w(e);return(0,oe.jsx)(Qw,{idPrefix:t,actions:s,item:e,isSelected:e===p,onSelect:x,mediaField:h,primaryField:f,visibleFields:g,onDropdownTriggerKeyDown:I},t)}))}):(0,oe.jsx)("div",{className:Ut({"dataviews-loading":o,"dataviews-no-results":!T&&!o}),children:!T&&(0,oe.jsx)("p",{children:o?(0,oe.jsx)(y.Spinner,{}):(0,b.__)("No results")})})},icon:(0,b.isRTL)()?fw:mw}];function e_(e){const t=[];return e.type===$g&&e.layout?.combinedFields&&e.layout.combinedFields.forEach((e=>{t.push(...e.children)})),t}function t_(e,t){const s=e_(e);if(e.fields)return e.fields.filter((e=>!s.includes(e)));const n=[];return e.type===$g&&e.layout?.combinedFields&&n.push(...e.layout.combinedFields.map((({id:e})=>e))),n.push(...t.filter((({id:e})=>!s.includes(e))).map((({id:e})=>e))),n}function s_(){const{actions:e=[],data:t,fields:s,getItemId:n,isLoading:i,view:r,onChangeView:o,selection:a,onChangeSelection:l,setOpenedFilter:c,density:u}=(0,d.useContext)(dv),p=$w.find((e=>e.type===r.type))?.component;return(0,oe.jsx)(p,{actions:e,data:t,fields:s,getItemId:n,isLoading:i,onChangeView:o,onChangeSelection:l,selection:a,setOpenedFilter:c,view:r,density:u})}const n_=(0,d.memo)((function(){var e;const{view:t,onChangeView:s,paginationInfo:{totalItems:n=0,totalPages:i}}=(0,d.useContext)(dv);if(!n||!i)return null;const r=null!==(e=t.page)&&void 0!==e?e:1,o=Array.from(Array(i)).map(((e,t)=>{const s=t+1;return{value:s.toString(),label:s.toString(),"aria-label":r===s?(0,b.sprintf)((0,b.__)("Page %1$s of %2$s"),r,i):s.toString()}}));return!!n&&1!==i&&(0,oe.jsxs)(y.__experimentalHStack,{expanded:!1,className:"dataviews-pagination",justify:"end",spacing:6,children:[(0,oe.jsx)(y.__experimentalHStack,{justify:"flex-start",expanded:!1,spacing:1,className:"dataviews-pagination__page-select",children:(0,d.createInterpolateElement)((0,b.sprintf)((0,b._x)("
    Page
    %1$s
    of %2$s
    ","paging"),"",i),{div:(0,oe.jsx)("div",{"aria-hidden":!0}),CurrentPage:(0,oe.jsx)(y.SelectControl,{"aria-label":(0,b.__)("Current page"),value:r.toString(),options:o,onChange:e=>{s({...t,page:+e})},size:"small",__nextHasNoMarginBottom:!0,variant:"minimal"})})}),(0,oe.jsxs)(y.__experimentalHStack,{expanded:!1,spacing:1,children:[(0,oe.jsx)(y.Button,{onClick:()=>s({...t,page:r-1}),disabled:1===r,accessibleWhenDisabled:!0,label:(0,b.__)("Previous page"),icon:(0,b.isRTL)()?Jm:Qm,showTooltip:!0,size:"compact",tooltipPosition:"top"}),(0,oe.jsx)(y.Button,{onClick:()=>s({...t,page:r+1}),disabled:r>=i,accessibleWhenDisabled:!0,label:(0,b.__)("Next page"),icon:(0,b.isRTL)()?Qm:Jm,showTooltip:!0,size:"compact",tooltipPosition:"top"})]})]})})),i_=[];function r_(){const{view:e,paginationInfo:{totalItems:t=0,totalPages:s},data:n,actions:i=i_}=(0,d.useContext)(dv),r=Ew(i,n)&&[$g,ev].includes(e.type);return!t||!s||s<=1&&!r?null:!!t&&(0,oe.jsxs)(y.__experimentalHStack,{expanded:!1,justify:"end",className:"dataviews-footer",children:[r&&(0,oe.jsx)(Nw,{}),(0,oe.jsx)(n_,{})]})}const o_=(0,d.memo)((function({label:e}){const{view:t,onChangeView:s}=(0,d.useContext)(dv),[n,i,r]=(0,v.useDebouncedInput)(t.search);(0,d.useEffect)((()=>{var e;i(null!==(e=t.search)&&void 0!==e?e:"")}),[t.search,i]);const o=(0,d.useRef)(s),a=(0,d.useRef)(t);(0,d.useEffect)((()=>{o.current=s,a.current=t}),[s,t]),(0,d.useEffect)((()=>{r!==a.current?.search&&o.current({...a.current,page:1,search:r})}),[r]);const l=e||(0,b.__)("Search");return(0,oe.jsx)(y.SearchControl,{className:"dataviews-search",__nextHasNoMarginBottom:!0,onChange:i,value:n,label:l,placeholder:l,size:"compact"})})),a_=o_,l_=(0,oe.jsx)(Jt.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,oe.jsx)(Jt.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"})}),c_=(0,oe.jsx)(Jt.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,oe.jsx)(Jt.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"})}),u_=(0,oe.jsx)(Jt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Jt.Path,{fillRule:"evenodd",d:"M10.289 4.836A1 1 0 0111.275 4h1.306a1 1 0 01.987.836l.244 1.466c.787.26 1.503.679 2.108 1.218l1.393-.522a1 1 0 011.216.437l.653 1.13a1 1 0 01-.23 1.273l-1.148.944a6.025 6.025 0 010 2.435l1.149.946a1 1 0 01.23 1.272l-.653 1.13a1 1 0 01-1.216.437l-1.394-.522c-.605.54-1.32.958-2.108 1.218l-.244 1.466a1 1 0 01-.987.836h-1.306a1 1 0 01-.986-.836l-.244-1.466a5.995 5.995 0 01-2.108-1.218l-1.394.522a1 1 0 01-1.217-.436l-.653-1.131a1 1 0 01.23-1.272l1.149-.946a6.026 6.026 0 010-2.435l-1.148-.944a1 1 0 01-.23-1.272l.653-1.131a1 1 0 011.217-.437l1.393.522a5.994 5.994 0 012.108-1.218l.244-1.466zM14.929 12a3 3 0 11-6 0 3 3 0 016 0z",clipRule:"evenodd"})}),d_=(window.wp.warning,{xhuge:{min:3,max:6,default:5},huge:{min:2,max:4,default:4},xlarge:{min:2,max:3,default:3},large:{min:1,max:2,default:2},mobile:{min:1,max:2,default:2}});function p_({density:e,setDensity:t}){const s=function(){const e=(0,v.useViewportMatch)("xhuge",">="),t=(0,v.useViewportMatch)("huge",">="),s=(0,v.useViewportMatch)("xlarge",">="),n=(0,v.useViewportMatch)("large",">="),i=(0,v.useViewportMatch)("mobile",">=");return e?"xhuge":t?"huge":s?"xlarge":n?"large":i?"mobile":null}();(0,d.useEffect)((()=>{t((e=>{if(!s||!e)return 0;const t=d_[s];return et.max?t.max:e}))}),[t,s]);const n=d_[s||"mobile"],i=e||n.default,r=(0,d.useMemo)((()=>Array.from({length:n.max-n.min+1},((e,t)=>({value:n.min+t})))),[n]);return s?(0,oe.jsx)(y.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,showTooltip:!1,label:(0,b.__)("Preview size"),value:n.max+n.min-i,marks:r,min:n.min,max:n.max,withInputField:!1,onChange:(e=0)=>{t(n.max+n.min-e)},step:1}):null}const{DropdownMenuV2:h_}=nw(y.privateApis);function f_({defaultLayouts:e={list:{},grid:{},table:{}}}){const{view:t,onChangeView:s}=(0,d.useContext)(dv),n=Object.keys(e);if(n.length<=1)return null;const i=$w.find((e=>t.type===e.type));return(0,oe.jsx)(h_,{trigger:(0,oe.jsx)(y.Button,{size:"compact",icon:i?.icon,label:(0,b.__)("Layout")}),children:n.map((n=>{const i=$w.find((e=>e.type===n));return i?(0,oe.jsx)(h_.RadioItem,{value:n,name:"view-actions-available-view",checked:n===t.type,hideOnClick:!0,onChange:n=>{switch(n.target.value){case"list":case"grid":case"table":return s({...t,type:n.target.value,...e[n.target.value]})}},children:(0,oe.jsx)(h_.ItemLabel,{children:i.label})},n):null}))})}function m_(){const{view:e,fields:t,onChangeView:s}=(0,d.useContext)(dv),n=(0,d.useMemo)((()=>t.filter((e=>!1!==e.enableSorting)).map((e=>({label:e.label,value:e.id})))),[t]);return(0,oe.jsx)(y.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,b.__)("Sort by"),value:e.sort?.field,options:n,onChange:t=>{s({...e,sort:{direction:e?.sort?.direction||"desc",field:t}})}})}function g_(){const{view:e,fields:t,onChangeView:s}=(0,d.useContext)(dv);if(0===t.filter((e=>!1!==e.enableSorting)).length)return null;let n=e.sort?.direction;return!n&&e.sort?.field&&(n="desc"),(0,oe.jsx)(y.__experimentalToggleGroupControl,{className:"dataviews-view-config__sort-direction",__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,isBlock:!0,label:(0,b.__)("Order"),value:n,onChange:n=>{"asc"!==n&&"desc"!==n||s({...e,sort:{direction:n,field:e.sort?.field||t.find((e=>!1!==e.enableSorting))?.id||""}})},children:Kg.map((e=>(0,oe.jsx)(y.__experimentalToggleGroupControlOptionIcon,{value:e,icon:Qg[e],label:Jg[e]},e)))})}const v_=[10,20,50,100];function x_(){const{view:e,onChangeView:t}=(0,d.useContext)(dv);return(0,oe.jsx)(y.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,isBlock:!0,label:(0,b.__)("Items per page"),value:e.perPage||10,disabled:!e?.sort?.field,onChange:s=>{const n="number"==typeof s||void 0===s?s:parseInt(s,10);t({...e,perPage:n,page:1})},children:v_.map((e=>(0,oe.jsx)(y.__experimentalToggleGroupControlOption,{value:e,label:e.toString()},e)))})}function y_({field:{id:e,label:t,index:s,isVisible:n,isHidable:i},fields:r,view:o,onChangeView:a}){const l=t_(o,r);return(0,oe.jsx)(y.__experimentalItem,{children:(0,oe.jsxs)(y.__experimentalHStack,{expanded:!0,className:`dataviews-field-control__field dataviews-field-control__field-${e}`,children:[(0,oe.jsx)("span",{children:t}),(0,oe.jsxs)(y.__experimentalHStack,{justify:"flex-end",expanded:!1,className:"dataviews-field-control__actions",children:[o.type===$g&&n&&(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(y.Button,{disabled:s<1,accessibleWhenDisabled:!0,size:"compact",onClick:()=>{var t;a({...o,fields:[...null!==(t=l.slice(0,s-1))&&void 0!==t?t:[],e,l[s-1],...l.slice(s+1)]})},icon:l_,label:(0,b.sprintf)((0,b.__)("Move %s up"),t)}),(0,oe.jsx)(y.Button,{disabled:s>=l.length-1,accessibleWhenDisabled:!0,size:"compact",onClick:()=>{var t;a({...o,fields:[...null!==(t=l.slice(0,s))&&void 0!==t?t:[],l[s+1],e,...l.slice(s+2)]})},icon:c_,label:(0,b.sprintf)((0,b.__)("Move %s down"),t)})," "]}),(0,oe.jsx)(y.Button,{className:"dataviews-field-control__field-visibility-button",disabled:!i,accessibleWhenDisabled:!0,size:"compact",onClick:()=>{a({...o,fields:n?l.filter((t=>t!==e)):[...l,e]}),setTimeout((()=>{const t=document.querySelector(`.dataviews-field-control__field-${e} .dataviews-field-control__field-visibility-button`);t instanceof HTMLElement&&t.focus()}),50)},icon:n?fa:Rw,label:n?(0,b.sprintf)((0,b._x)("Hide %s","field"),t):(0,b.sprintf)((0,b._x)("Show %s","field"),t)})]})]})},e)}function b_(){const{view:e,fields:t,onChangeView:s}=(0,d.useContext)(dv),n=(0,d.useMemo)((()=>t_(e,t)),[e,t]),i=(0,d.useMemo)((()=>function(e,t){const s=[...e_(e),...t_(e,t)];return e.type===ev&&e.layout?.mediaField&&s.push(e.layout?.mediaField),e.type===tv&&e.layout?.mediaField&&s.push(e.layout?.mediaField),t.filter((({id:e,enableHiding:t})=>!s.includes(e)&&t)).map((({id:e})=>e))}(e,t)),[e,t]),r=(0,d.useMemo)((()=>function(e){var t;return"table"===e.type?[e.layout?.primaryField].concat(null!==(t=e.layout?.combinedFields?.flatMap((e=>e.children)))&&void 0!==t?t:[]).filter((e=>!!e)):"grid"===e.type||"list"===e.type?[e.layout?.primaryField,e.layout?.mediaField].filter((e=>!!e)):[]}(e)),[e]),o=t.filter((({id:e})=>n.includes(e))).map((({id:e,label:t,enableHiding:s})=>({id:e,label:t,index:n.indexOf(e),isVisible:!0,isHidable:!r.includes(e)&&s})));e.type===$g&&e.layout?.combinedFields&&e.layout.combinedFields.forEach((({id:e,label:t})=>{o.push({id:e,label:t,index:n.indexOf(e),isVisible:!0,isHidable:r.includes(e)})})),o.sort(((e,t)=>e.index-t.index));const a=t.filter((({id:e})=>i.includes(e))).map((({id:e,label:t,enableHiding:s},n)=>({id:e,label:t,index:n,isVisible:!1,isHidable:s})));return o?.length||a?.length?(0,oe.jsxs)(y.__experimentalVStack,{spacing:6,className:"dataviews-field-control",children:[!!o?.length&&(0,oe.jsx)(y.__experimentalItemGroup,{isBordered:!0,isSeparated:!0,children:o.map((n=>(0,oe.jsx)(y_,{field:n,fields:t,view:e,onChangeView:s},n.id)))}),!!a?.length&&(0,oe.jsx)(oe.Fragment,{children:(0,oe.jsxs)(y.__experimentalVStack,{spacing:4,children:[(0,oe.jsx)(y.BaseControl.VisualLabel,{style:{margin:0},children:(0,b.__)("Hidden")}),(0,oe.jsx)(y.__experimentalItemGroup,{isBordered:!0,isSeparated:!0,children:a.map((n=>(0,oe.jsx)(y_,{field:n,fields:t,view:e,onChangeView:s},n.id)))})]})})]}):null}function w_({title:e,description:t,children:s}){return(0,oe.jsxs)(y.__experimentalGrid,{columns:12,className:"dataviews-settings-section",gap:4,children:[(0,oe.jsxs)("div",{className:"dataviews-settings-section__sidebar",children:[(0,oe.jsx)(y.__experimentalHeading,{level:2,className:"dataviews-settings-section__title",children:e}),t&&(0,oe.jsx)(y.__experimentalText,{variant:"muted",className:"dataviews-settings-section__description",children:t})]}),(0,oe.jsx)(y.__experimentalGrid,{columns:8,gap:4,className:"dataviews-settings-section__content",children:s})]})}function __({density:e,setDensity:t}){const{view:s}=(0,d.useContext)(dv);return(0,oe.jsxs)(y.__experimentalVStack,{className:"dataviews-view-config",spacing:6,children:[(0,oe.jsxs)(w_,{title:(0,b.__)("Appearance"),children:[(0,oe.jsxs)(y.__experimentalHStack,{expanded:!0,className:"is-divided-in-two",children:[(0,oe.jsx)(m_,{}),(0,oe.jsx)(g_,{})]}),s.type===ev&&(0,oe.jsx)(p_,{density:e,setDensity:t}),(0,oe.jsx)(x_,{})]}),(0,oe.jsx)(w_,{title:(0,b.__)("Properties"),children:(0,oe.jsx)(b_,{})})]})}const S_=(0,d.memo)((function({density:e,setDensity:t,defaultLayouts:s={list:{},grid:{},table:{}}}){return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(f_,{defaultLayouts:s}),(0,oe.jsx)(y.Dropdown,{popoverProps:{placement:"bottom-end",offset:9},contentClassName:"dataviews-view-config",renderToggle:({onToggle:e})=>(0,oe.jsx)(y.Button,{size:"compact",icon:u_,label:(0,b._x)("View options","View is used as a noun"),onClick:e}),renderContent:()=>(0,oe.jsx)(__,{density:e,setDensity:t})})]})})),j_=S_,C_=e=>e.id;function k_({view:e,onChangeView:t,fields:s,search:n=!0,searchLabel:i,actions:r=[],data:o,getItemId:a=C_,isLoading:l=!1,paginationInfo:c,defaultLayouts:u,selection:p,onChangeSelection:h,header:f}){const[m,g]=(0,d.useState)([]),[v,x]=(0,d.useState)(0),b=void 0===p||void 0===h,w=b?m:p,[_,S]=(0,d.useState)(null);const j=(0,d.useMemo)((()=>av(s)),[s]),C=(0,d.useMemo)((()=>w.filter((e=>o.some((t=>a(t)===e))))),[w,o,a]),k=cw(j,e),[E,P]=(0,d.useState)((()=>(k||[]).some((e=>e.isPrimary))));return(0,oe.jsx)(dv.Provider,{value:{view:e,onChangeView:t,fields:j,actions:r,data:o,isLoading:l,paginationInfo:c,selection:C,onChangeSelection:function(e){const t="function"==typeof e?e(w):e;b&&g(t),h&&h(t)},openedFilter:_,setOpenedFilter:S,getItemId:a,density:v},children:(0,oe.jsxs)("div",{className:"dataviews-wrapper",children:[(0,oe.jsxs)(y.__experimentalHStack,{alignment:"top",justify:"space-between",className:"dataviews__view-actions",spacing:1,children:[(0,oe.jsxs)(y.__experimentalHStack,{justify:"start",expanded:!1,className:"dataviews__search",children:[n&&(0,oe.jsx)(a_,{label:i}),(0,oe.jsx)(uw,{filters:k,view:e,onChangeView:t,setOpenedFilter:S,setIsShowingFilter:P,isShowingFilter:E})]}),(0,oe.jsxs)(y.__experimentalHStack,{spacing:1,expanded:!1,style:{flexShrink:0},children:[(0,oe.jsx)(j_,{defaultLayouts:u,density:v,setDensity:x}),f]})]}),E&&(0,oe.jsx)(dw,{}),(0,oe.jsx)(s_,{}),(0,oe.jsx)(r_,{})]})})}const E_=(0,oe.jsx)(Jt.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Jt.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4 14.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h8v13zm4.5-.5c0 .3-.2.5-.5.5h-2.5v-13H18c.3 0 .5.2.5.5v12z"})});function P_({title:e,subTitle:t,actions:s}){return(0,oe.jsxs)(y.__experimentalVStack,{className:"edit-site-page-header",as:"header",spacing:0,children:[(0,oe.jsxs)(y.__experimentalHStack,{className:"edit-site-page-header__page-title",children:[(0,oe.jsx)(y.__experimentalHeading,{as:"h2",level:3,weight:500,className:"edit-site-page-header__title",truncate:!0,children:e}),(0,oe.jsx)(y.FlexItem,{className:"edit-site-page-header__actions",children:s})]}),t&&(0,oe.jsx)(y.__experimentalText,{variant:"muted",as:"p",className:"edit-site-page-header__sub-title",children:t})]})}const{NavigableRegion:I_}=te(h.privateApis);function T_({title:e,subTitle:t,actions:s,children:n,className:i,hideTitleFromUI:r=!1}){const o=Ut("edit-site-page",i);return(0,oe.jsx)(I_,{className:o,ariaLabel:e,children:(0,oe.jsxs)("div",{className:"edit-site-page-content",children:[!r&&e&&(0,oe.jsx)(P_,{title:e,subTitle:t,actions:s}),n]})})}const O_=(0,oe.jsxs)(Jt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,oe.jsx)(Jt.Path,{d:"M14.5 5.5h-7V7h7V5.5ZM7.5 9h7v1.5h-7V9Zm7 3.5h-7V14h7v-1.5Z"}),(0,oe.jsx)(Jt.Path,{d:"M16 2H6a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2ZM6 3.5h10a.5.5 0 0 1 .5.5v12a.5.5 0 0 1-.5.5H6a.5.5 0 0 1-.5-.5V4a.5.5 0 0 1 .5-.5Z"}),(0,oe.jsx)(Jt.Path,{d:"M20 8v11c0 .69-.31 1-.999 1H6v1.5h13.001c1.52 0 2.499-.982 2.499-2.5V8H20Z"})]}),A_=(0,oe.jsx)(Jt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Jt.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm11.53-1.47-1.06-1.06L11 12.94l-1.47-1.47-1.06 1.06L11 15.06l4.53-4.53Z"})}),M_=(0,oe.jsx)(Jt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Jt.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm9 1V8h-1.5v3.5h-2V13H13Z"})}),N_=(0,oe.jsx)(Jt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Jt.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm8 4a4 4 0 0 0 4-4H8a4 4 0 0 0 4 4Z"})}),V_=(0,oe.jsx)(Jt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Jt.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm8 4a4 4 0 0 1-4-4h4V8a4 4 0 0 1 0 8Z"})}),F_=(0,oe.jsx)(Jt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Jt.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 18.5A6.5 6.5 0 0 1 6.93 7.931l9.139 9.138A6.473 6.473 0 0 1 12 18.5Zm5.123-2.498a6.5 6.5 0 0 0-9.124-9.124l9.124 9.124ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Z"})}),R_={[Re]:{layout:{primaryField:"title",styles:{"featured-image":{width:"1%"},title:{maxWidth:300}}}},[Fe]:{layout:{mediaField:"featured-image",primaryField:"title"}},[Be]:{layout:{primaryField:"title",mediaField:"featured-image"}}},B_={type:Be,search:"",filters:[],page:1,perPage:20,sort:{field:"date",direction:"desc"},fields:["title","author","status"],layout:R_[Be].layout};function D_({postType:e}){const t=(0,l.useSelect)((t=>{const{getPostType:s}=t(_.store);return s(e)?.labels}),[e]);return(0,d.useMemo)((()=>[{title:t?.all_items||(0,b.__)("All items"),slug:"all",icon:O_,view:B_},{title:(0,b.__)("Published"),slug:"published",icon:A_,view:B_,filters:[{field:"status",operator:De,value:"publish"}]},{title:(0,b.__)("Scheduled"),slug:"future",icon:M_,view:B_,filters:[{field:"status",operator:De,value:"future"}]},{title:(0,b.__)("Drafts"),slug:"drafts",icon:N_,view:B_,filters:[{field:"status",operator:De,value:"draft"}]},{title:(0,b.__)("Pending"),slug:"pending",icon:V_,view:B_,filters:[{field:"status",operator:De,value:"pending"}]},{title:(0,b.__)("Private"),slug:"private",icon:F_,view:B_,filters:[{field:"status",operator:De,value:"private"}]},{title:(0,b.__)("Trash"),slug:"trash",icon:Vo,view:{...B_,type:Re,layout:R_[Re].layout},filters:[{field:"status",operator:De,value:"trash"}]}]),[t])}function z_({postType:e,onSave:t,onClose:s}){const n=(0,l.useSelect)((t=>t(_.store).getPostType(e)?.labels),[e]),[i,r]=(0,d.useState)(!1),[a,c]=(0,d.useState)(""),{saveEntityRecord:u}=(0,l.useDispatch)(_.store),{createErrorNotice:p,createSuccessNotice:h}=(0,l.useDispatch)(w.store),{resolveSelect:f}=(0,l.useRegistry)();return(0,oe.jsx)(y.Modal,{title:(0,b.sprintf)((0,b.__)("Draft new: %s"),n?.singular_name),onRequestClose:s,focusOnMount:"firstContentElement",size:"small",children:(0,oe.jsx)("form",{onSubmit:async function(s){if(s.preventDefault(),!i){r(!0);try{const s=await f(_.store).getPostType(e),n=await u("postType",e,{status:"draft",title:a,slug:a||(0,b.__)("No title"),content:s.template&&s.template.length?(0,o.serialize)((0,o.synchronizeBlocksWithTemplate)([],s.template)):void 0},{throwOnError:!0});t(n),h((0,b.sprintf)((0,b.__)('"%s" successfully created.'),(0,Xt.decodeEntities)(n.title?.rendered||a)),{type:"snackbar"})}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,b.__)("An error occurred while creating the item.");p(t,{type:"snackbar"})}finally{r(!1)}}},children:(0,oe.jsxs)(y.__experimentalVStack,{spacing:4,children:[(0,oe.jsx)(y.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,b.__)("Title"),onChange:c,placeholder:(0,b.__)("No title"),value:a}),(0,oe.jsxs)(y.__experimentalHStack,{spacing:2,justify:"end",children:[(0,oe.jsx)(y.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:s,children:(0,b.__)("Cancel")}),(0,oe.jsx)(y.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",isBusy:i,"aria-disabled":i,children:(0,b.__)("Create draft")})]})]})})})}const L_=(0,oe.jsx)(Jt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Jt.Path,{d:"m19 7-3-3-8.5 8.5-1 4 4-1L19 7Zm-7 11.5H5V20h7v-1.5Z"})}),{useHistory:H_}=te(Ht.privateApis),G_=()=>{const e=H_();return(0,d.useMemo)((()=>({id:"edit-post",label:(0,b.__)("Edit"),isPrimary:!0,icon:L_,isEligible:e=>"trash"!==e.status&&e.type!==Ie.theme,callback(t){const s=t[0];e.push({postId:s.id,postType:s.type,canvas:"edit"})}})),[e])},U_=(0,oe.jsx)(Jt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Jt.Path,{fillRule:"evenodd",d:"M7.25 16.437a6.5 6.5 0 1 1 9.5 0V16A2.75 2.75 0 0 0 14 13.25h-4A2.75 2.75 0 0 0 7.25 16v.437Zm1.5 1.193a6.47 6.47 0 0 0 3.25.87 6.47 6.47 0 0 0 3.25-.87V16c0-.69-.56-1.25-1.25-1.25h-4c-.69 0-1.25.56-1.25 1.25v1.63ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm10-2a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z",clipRule:"evenodd"})});const W_=function({id:e,size:t=["large","medium","thumbnail"],...s}){const{record:n}=(0,_.useEntityRecord)("root","media",e),i=t.find((e=>!!n?.media_details?.sizes[e])),r=n?.media_details?.sizes[i]?.source_url||n?.source_url;return r?(0,oe.jsx)("img",{...s,src:r,alt:n.alt_text}):null},q_=[{value:"draft",label:(0,b.__)("Draft"),icon:N_,description:(0,b.__)("Not ready to publish.")},{value:"future",label:(0,b.__)("Scheduled"),icon:M_,description:(0,b.__)("Publish automatically on a chosen date.")},{value:"pending",label:(0,b.__)("Pending Review"),icon:V_,description:(0,b.__)("Waiting for review before publishing.")},{value:"private",label:(0,b.__)("Private"),icon:F_,description:(0,b.__)("Only visible to site admins and editors.")},{value:"publish",label:(0,b.__)("Published"),icon:A_,description:(0,b.__)("Visible to everyone.")},{value:"trash",label:(0,b.__)("Trash"),icon:Vo}],Z_=e=>(0,Zm.dateI18n)((0,Zm.getSettings)().formats.datetimeAbbreviated,(0,Zm.getDate)(e));function K_({item:e,viewType:t}){const s="trash"===e.status,{onClick:n}=Ro({postId:e.id,postType:e.type,canvas:"edit"}),i=!!e.featured_media,r=t===Fe?["large","full","medium","thumbnail"]:["thumbnail","medium","large","full"],o=i?(0,oe.jsx)(W_,{className:"edit-site-post-list__featured-image",id:e.featured_media,size:r}):null,a=t!==Be&&!s;return(0,oe.jsx)("div",{className:`edit-site-post-list__featured-image-wrapper is-layout-${t}`,children:a?(0,oe.jsx)("button",{className:"edit-site-post-list__featured-image-button",type:"button",onClick:n,"aria-label":e.title?.rendered||(0,b.__)("(no title)"),children:o}):o})}function Y_({item:e}){const t=q_.find((({value:t})=>t===e.status)),s=t?.label||e.status,n=t?.icon;return(0,oe.jsxs)(y.__experimentalHStack,{alignment:"left",spacing:0,children:[n&&(0,oe.jsx)("div",{className:"edit-site-post-list__status-icon",children:(0,oe.jsx)(y.Icon,{icon:n})}),(0,oe.jsx)("span",{children:s})]})}function X_({item:e}){const{text:t,imageUrl:s}=(0,l.useSelect)((t=>{const{getUser:s}=t(_.store),n=s(e.author);return{imageUrl:n?.avatar_urls?.[48],text:n?.name}}),[e]),[n,i]=(0,d.useState)(!1);return(0,oe.jsxs)(y.__experimentalHStack,{alignment:"left",spacing:0,children:[!!s&&(0,oe.jsx)("div",{className:Ut("page-templates-author-field__avatar",{"is-loaded":n}),children:(0,oe.jsx)("img",{onLoad:()=>i(!0),alt:(0,b.__)("Author avatar"),src:s})}),!s&&(0,oe.jsx)("div",{className:"page-templates-author-field__icon",children:(0,oe.jsx)(y.Icon,{icon:U_})}),(0,oe.jsx)("span",{className:"page-templates-author-field__name",children:t})]})}const J_=function(e){const{records:t,isResolving:s}=(0,_.useEntityRecords)("root","user",{per_page:-1}),{frontPageId:n,postsPageId:i}=(0,l.useSelect)((e=>{const{getEntityRecord:t}=e(_.store),s=t("root","site");return{frontPageId:s?.page_on_front,postsPageId:s?.page_for_posts}}),[]),r=(0,d.useMemo)((()=>[{id:"featured-image",label:(0,b.__)("Featured Image"),getValue:({item:e})=>e.featured_media,render:({item:t})=>(0,oe.jsx)(K_,{item:t,viewType:e}),enableSorting:!1},{label:(0,b.__)("Title"),id:"title",type:"text",getValue:({item:e})=>"string"==typeof e.title?e.title:e.title?.raw,render:({item:t})=>{const s=[Re,Fe].includes(e)&&"trash"!==t.status,r="string"==typeof t.title?t.title:t.title?.rendered,o=s?(0,oe.jsx)(Bo,{params:{postId:t.id,postType:t.type,canvas:"edit"},children:(0,Xt.decodeEntities)(r)||(0,b.__)("(no title)")}):(0,oe.jsx)("span",{children:(0,Xt.decodeEntities)(r)||(0,b.__)("(no title)")});let a="";return t.id===n?a=(0,oe.jsx)("span",{className:"edit-site-post-list__title-badge",children:(0,b.__)("Homepage")}):t.id===i&&(a=(0,oe.jsx)("span",{className:"edit-site-post-list__title-badge",children:(0,b.__)("Posts Page")})),(0,oe.jsxs)(y.__experimentalHStack,{className:"edit-site-post-list__title",alignment:"center",justify:"flex-start",children:[o,a]})},enableHiding:!1},{label:(0,b.__)("Author"),id:"author",type:"integer",elements:t?.map((({id:e,name:t})=>({value:e,label:t})))||[],render:X_,sort:(e,t,s)=>{const n=e._embedded?.author?.[0]?.name||"",i=t._embedded?.author?.[0]?.name||"";return"asc"===s?n.localeCompare(i):i.localeCompare(n)}},{label:(0,b.__)("Status"),id:"status",type:"text",elements:q_,render:Y_,Edit:"radio",enableSorting:!1,filterBy:{operators:[De]}},{label:(0,b.__)("Date"),id:"date",type:"datetime",render:({item:e})=>{if(["draft","private"].includes(e.status))return(0,d.createInterpolateElement)((0,b.sprintf)((0,b.__)("Modified: "),Z_(e.date)),{span:(0,oe.jsx)("span",{}),time:(0,oe.jsx)("time",{})});if("future"===e.status)return(0,d.createInterpolateElement)((0,b.sprintf)((0,b.__)("Scheduled: "),Z_(e.date)),{span:(0,oe.jsx)("span",{}),time:(0,oe.jsx)("time",{})});if("publish"===e.status)return(0,d.createInterpolateElement)((0,b.sprintf)((0,b.__)("Published: "),Z_(e.date)),{span:(0,oe.jsx)("span",{}),time:(0,oe.jsx)("time",{})});const t=(0,Zm.getDate)(e.modified)>(0,Zm.getDate)(e.date)?e.modified:e.date;return"pending"===e.status?(0,d.createInterpolateElement)((0,b.sprintf)((0,b.__)("Modified: "),Z_(t)),{span:(0,oe.jsx)("span",{}),time:(0,oe.jsx)("time",{})}):(0,oe.jsx)("time",{children:Z_(e.date)})}},{id:"comment_status",label:(0,b.__)("Discussion"),type:"text",Edit:"radio",enableSorting:!1,filterBy:{operators:[]},elements:[{value:"open",label:(0,b.__)("Open"),description:(0,b.__)("Visitors can add new comments and replies.")},{value:"closed",label:(0,b.__)("Closed"),description:(0,b.__)("Visitors cannot add new comments or replies. Existing comments remain visible.")}]}]),[t,e,n,i]);return{isLoading:s,fields:r}},{usePostActions:Q_}=te(h.privateApis),{useLocation:$_,useHistory:eS}=te(Ht.privateApis),{useEntityRecordsWithPermissions:tS}=te(_.privateApis),sS=[],nS=(e,t)=>e.find((({slug:e})=>e===t))?.view,iS=e=>{if(!e?.content)return;const t=JSON.parse(e.content);return t?{...t,layout:R_[t.type]?.layout}:void 0};const rS="draft,future,pending,private,publish";function oS(e){return e.id.toString()}function aS({postType:e}){var t,s,n;const[i,r]=function(e){const{params:{activeView:t="all",isCustom:s="false",layout:n}}=$_(),i=eS(),r=D_({postType:e}),{editEntityRecord:o}=(0,l.useDispatch)(_.store),a=(0,l.useSelect)((e=>{if("true"!==s)return;const{getEditedEntityRecord:n}=e(_.store);return n("postType","wp_dataviews",Number(t))}),[t,s]),[c,u]=(0,d.useState)((()=>{let e;var i,o;e="true"===s?null!==(i=iS(a))&&void 0!==i?i:{type:null!=n?n:Be}:null!==(o=nS(r,t))&&void 0!==o?o:{type:null!=n?n:Be};const l=null!=n?n:e.type;return{...e,type:l}})),p=(0,d.useCallback)((e=>{const{params:t}=i.getLocationWithParams();(e.type!==Be||t?.layout)&&e.type!==t?.layout&&i.push({...t,layout:e.type}),u(e),"true"===s&&a?.id&&o("postType","wp_dataviews",a?.id,{content:JSON.stringify(e)})}),[i,s,o,a?.id]);return(0,d.useEffect)((()=>{u((e=>({...e,type:null!=n?n:Be})))}),[n]),(0,d.useEffect)((()=>{let e;if(e="true"===s?iS(a):nS(r,t),e){const t=null!=n?n:e.type;u({...e,type:t})}}),[t,s,n,r,a]),[c,p,p]}(e),o=D_({postType:e}),a=eS(),c=$_(),{postId:u,quickEdit:p=!1,isCustom:h,activeView:f="all"}=c.params,[m,g]=(0,d.useState)(null!==(t=u?.split(","))&&void 0!==t?t:[]),x=(0,d.useCallback)((e=>{var t;g(e);const{params:s}=a.getLocationWithParams();"false"===(null!==(t=s.isCustom)&&void 0!==t?t:"false")&&a.push({...s,postId:e.join(",")})}),[a]),w=(e,t)=>{var s;const n=e.find((({slug:e})=>e===t));return null!==(s=n?.filters)&&void 0!==s?s:[]},{isLoading:S,fields:j}=J_(i.type),C=(0,d.useMemo)((()=>{const e=w(o,f).map((({field:e})=>e));return j.map((t=>({...t,elements:e.includes(t.id)?[]:t.elements})))}),[j,o,f]),k=(0,d.useMemo)((()=>{const e={};i.filters?.forEach((t=>{"status"===t.field&&t.operator===De&&(e.status=t.value),"author"===t.field&&t.operator===De?e.author=t.value:"author"===t.field&&t.operator===ze&&(e.author_exclude=t.value)}));return w(o,f).forEach((t=>{"status"===t.field&&t.operator===De&&(e.status=t.value),"author"===t.field&&t.operator===De?e.author=t.value:"author"===t.field&&t.operator===ze&&(e.author_exclude=t.value)})),e.status&&""!==e.status||(e.status=rS),{per_page:i.perPage,page:i.page,_embed:"author",order:i.sort?.direction,orderby:i.sort?.field,search:i.search,...e}}),[i,f,o]),{records:E,isResolving:P,totalItems:I,totalPages:T}=tS("postType",e,k),O=(0,d.useMemo)((()=>S||"author"!==i?.sort?.field?E:uv(E,{sort:{...i.sort}},C).data),[E,C,S,i?.sort]),A=null!==(s=O?.map((e=>oS(e))))&&void 0!==s?s:[],M=(null!==(n=(0,v.usePrevious)(A))&&void 0!==n?n:[]).filter((e=>!A.includes(e))).includes(u);(0,d.useEffect)((()=>{M&&a.push({...a.getLocationWithParams().params,postId:void 0})}),[M,a]);const N=(0,d.useMemo)((()=>({totalItems:I,totalPages:T})),[I,T]),{labels:V,canCreateRecord:F}=(0,l.useSelect)((t=>{const{getPostType:s,canUser:n}=t(_.store);return{labels:s(e)?.labels,canCreateRecord:n("create",{kind:"postType",name:e})}}),[e]),R=Q_({postType:e,context:"list"}),B=G_(),D=(0,d.useMemo)((()=>[B,...R]),[R,B]),[z,L]=(0,d.useState)(!1),H=()=>L(!1);return(0,oe.jsx)(T_,{title:V?.name,actions:V?.add_new_item&&F&&(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(y.Button,{variant:"primary",onClick:()=>L(!0),__next40pxDefaultSize:!0,children:V.add_new_item}),z&&(0,oe.jsx)(z_,{postType:e,onSave:({type:e,id:t})=>{a.push({postId:t,postType:e,canvas:"edit"}),H()},onClose:H})]}),children:(0,oe.jsx)(k_,{paginationInfo:N,fields:C,actions:D,data:O||sS,isLoading:P||S,view:i,onChangeView:r,selection:m,onChangeSelection:x,getItemId:oS,defaultLayouts:R_,header:window.__experimentalQuickEditDataViews&&i.type!==Be&&"page"===e&&(0,oe.jsx)(y.Button,{size:"compact",isPressed:p,icon:E_,label:(0,b.__)("Toggle details panel"),onClick:()=>{a.push({...c.params,quickEdit:!p||void 0})}})},f+h)})}const lS=(e,t,s)=>t===s.findIndex((t=>e.name===t.name));function cS(){var e;const t=(0,l.useSelect)((e=>{const{getSettings:t}=te(e(zt));return t()}),[]),s=null!==(e=t.__experimentalAdditionalBlockPatterns)&&void 0!==e?e:t.__experimentalBlockPatterns,n=(0,l.useSelect)((e=>e(_.store).getBlockPatterns()),[]),i=(0,d.useMemo)((()=>[...s||[],...n||[]].filter(lS)),[s,n]);return(0,d.useMemo)((()=>{const{__experimentalAdditionalBlockPatterns:e,...s}=t;return{...s,__experimentalBlockPatterns:i,__unstableIsPreviewMode:!0}}),[t,i])}const{extractWords:uS,getNormalizedSearchTerms:dS,normalizeString:pS}=te(x.privateApis),hS=e=>e.type===Ie.user?e.slug:e.type===Ce?"":e.name||"",fS=e=>"string"==typeof e.title?e.title:e.title&&e.title.rendered?e.title.rendered:e.title&&e.title.raw?e.title.raw:"",mS=e=>e.type===Ie.user?e.excerpt.raw:e.description||"",gS=e=>e.keywords||[],vS=()=>!1,xS=(e=[],t="",s={})=>{const n=dS(t),i=s.categoryId!==Te&&!n.length,r={...s,onlyFilterByCategory:i},o=i?0:1,a=e.map((e=>[e,yS(e,t,r)])).filter((([,e])=>e>o));return 0===n.length||a.sort((([,e],[,t])=>t-e)),a.map((([e])=>e))};function yS(e,t,s){const{categoryId:n,getName:i=hS,getTitle:r=fS,getDescription:o=mS,getKeywords:a=gS,hasCategory:l=vS,onlyFilterByCategory:c}=s;let u=n===Te||n===Pe||n===Oe&&e.type===Ie.user||l(e,n)?1:0;if(!u||c)return u;const d=i(e),p=r(e),h=o(e),f=a(e),m=pS(t),g=pS(p);if(m===g)u+=30;else if(g.startsWith(m))u+=20;else{const e=[d,p,h,...f].join(" ");0===((e,t)=>e.filter((e=>!dS(t).some((t=>t.includes(e))))))(uS(m),e).length&&(u+=10)}return u}const bS=[],wS=(0,l.createSelector)(((e,t,s="")=>{var n;const{getEntityRecords:i,isResolving:r}=e(_.store),{__experimentalGetDefaultTemplatePartAreas:o}=e(h.store),a={per_page:-1},l=null!==(n=i("postType",Ce,a))&&void 0!==n?n:bS,c=(o()||[]).map((e=>e.area)),u=r("getEntityRecords",["postType",Ce,a]),d=xS(l,s,{categoryId:t,hasCategory:(e,t)=>t!==Ee?e.area===t:e.area===t||!c.includes(e.area)});return{patterns:d,isResolving:u}}),(e=>[e(_.store).getEntityRecords("postType",Ce,{per_page:-1}),e(_.store).isResolving("getEntityRecords",["postType",Ce,{per_page:-1}]),e(h.store).__experimentalGetDefaultTemplatePartAreas()])),_S=(0,l.createSelector)((e=>{var t;const{getSettings:s}=te(e(zt)),{isResolving:n}=e(_.store),i=s();return{patterns:[...(null!==(t=i.__experimentalAdditionalBlockPatterns)&&void 0!==t?t:i.__experimentalBlockPatterns)||[],...e(_.store).getBlockPatterns()||[]].filter((e=>!Ae.includes(e.source))).filter(lS).filter((e=>!1!==e.inserter)).map((e=>({...e,keywords:e.keywords||[],type:Ie.theme,blocks:(0,o.parse)(e.content,{__unstableSkipMigrationLogs:!0})}))),isResolving:n("getBlockPatterns")}}),(e=>[e(_.store).getBlockPatterns(),e(_.store).isResolving("getBlockPatterns"),te(e(zt)).getSettings()])),SS=(0,l.createSelector)(((e,t,s,n="")=>{const{patterns:i,isResolving:r}=_S(e),{patterns:o,isResolving:a,categories:l}=jS(e);let c=[...i||[],...o||[]];return s&&(c=c.filter((e=>e.type===Ie.user?(e.wp_pattern_sync_status||Me.full)===s:s===Me.unsynced))),c=xS(c,n,t?{categoryId:t,hasCategory:(e,t)=>e.type===Ie.user?e.wp_pattern_category.some((e=>l.find((t=>t.id===e))?.slug===t)):e.categories?.includes(t)}:{hasCategory:e=>e.type===Ie.user?l?.length&&(!e.wp_pattern_category?.length||!e.wp_pattern_category.some((e=>l.find((t=>t.id===e))))):!e.hasOwnProperty("categories")}),{patterns:c,isResolving:r||a}}),(e=>[_S(e),jS(e)])),jS=(0,l.createSelector)(((e,t,s="")=>{const{getEntityRecords:n,isResolving:i,getUserPatternCategories:r}=e(_.store),o={per_page:-1},a=n("postType",Ie.user,o),l=r(),c=new Map;l.forEach((e=>c.set(e.id,e)));let u=null!=a?a:bS;const d=i("getEntityRecords",["postType",Ie.user,o]);return t&&(u=u.filter((e=>e.wp_pattern_sync_status||Me.full===t))),u=xS(u,s,{hasCategory:()=>!0}),{patterns:u,isResolving:d,categories:l}}),(e=>[e(_.store).getEntityRecords("postType",Ie.user,{per_page:-1}),e(_.store).isResolving("getEntityRecords",["postType",Ie.user,{per_page:-1}]),e(_.store).getUserPatternCategories()]));const CS=(e,t,{search:s="",syncStatus:n}={})=>(0,l.useSelect)((i=>{if(e===Ce)return wS(i,t,s);if(e===Ie.user&&t){return SS(i,"uncategorized"===t?"":t,n,s)}return e===Ie.user?jS(i,n,s):{patterns:bS,isResolving:!1}}),[t,e,s,n]),kS=(0,oe.jsx)(Jt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Jt.Path,{d:"M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-1 1.4l-5.6 5.6c-.1.1-.3.1-.4 0l-5.6-5.6c-.1-.1-.1-.3 0-.4l5.6-5.6s.1-.1.2-.1.1 0 .2.1l5.6 5.6c.1.1.1.3 0 .4zm-16.6-.4L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"})}),ES=(0,oe.jsx)(Jt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Jt.Path,{d:"M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-17.6 1L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"})}),PS=(0,oe.jsx)(Jt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Jt.Path,{d:"M18.5 15v3.5H13V6.7l4.5 4.1 1-1.1-6.2-5.8-5.8 5.8 1 1.1 4-4v11.7h-6V15H4v5h16v-5z"})}),{useHistory:IS}=te(Ht.privateApis),{CreatePatternModal:TS,useAddPatternCategory:OS}=te(_e.privateApis),{CreateTemplatePartModal:AS}=te(h.privateApis);function MS(){const e=IS(),[t,s]=(0,d.useState)(!1),[n,i]=(0,d.useState)(!1),{createPatternFromFile:r}=te((0,l.useDispatch)(_e.store)),{createSuccessNotice:o,createErrorNotice:a}=(0,l.useDispatch)(w.store),c=(0,d.useRef)(),{isBlockBasedTheme:u,addNewPatternLabel:p,addNewTemplatePartLabel:h,canCreatePattern:f,canCreateTemplatePart:m}=(0,l.useSelect)((e=>{const{getCurrentTheme:t,getPostType:s,canUser:n}=e(_.store);return{isBlockBasedTheme:t()?.is_block_theme,addNewPatternLabel:s(Ie.user)?.labels?.add_new_item,addNewTemplatePartLabel:s(Ce)?.labels?.add_new_item,canCreatePattern:n("create",{kind:"postType",name:Ie.user}),canCreateTemplatePart:n("create",{kind:"postType",name:Ce})}}),[]);function g(){s(!1),i(!1)}const v=[];f&&v.push({icon:kS,onClick:()=>s(!0),title:p}),u&&m&&v.push({icon:ES,onClick:()=>i(!0),title:h}),f&&v.push({icon:PS,onClick:()=>{c.current.click()},title:(0,b.__)("Import pattern from JSON")});const{categoryMap:x,findOrCreateTerm:S}=OS();return 0===v.length?null:(0,oe.jsxs)(oe.Fragment,{children:[p&&(0,oe.jsx)(y.DropdownMenu,{controls:v,icon:null,toggleProps:{variant:"primary",showTooltip:!1,__next40pxDefaultSize:!0},text:p,label:p}),t&&(0,oe.jsx)(TS,{onClose:()=>s(!1),onSuccess:function({pattern:t}){s(!1),e.push({postId:t.id,postType:Ie.user,canvas:"edit"})},onError:g}),n&&(0,oe.jsx)(AS,{closeModal:()=>i(!1),blocks:[],onCreate:function(t){i(!1),e.push({postId:t.id,postType:Ce,canvas:"edit"})},onError:g}),(0,oe.jsx)("input",{type:"file",accept:".json",hidden:!0,ref:c,onChange:async t=>{const s=t.target.files?.[0];if(s)try{const{params:{postType:t,categoryId:n}}=e.getLocationWithParams();let i;if(t!==Ce){const e=Array.from(x.values()).find((e=>e.name===n));e&&(i=e.id||await S(e.label))}const a=await r(s,i?[i]:void 0);i||"my-patterns"===n||e.push({postType:Ie.user,categoryId:Te}),o((0,b.sprintf)((0,b.__)('Imported "%s" from JSON.'),a.title.raw),{type:"snackbar",id:"import-pattern-success"})}catch(e){a(e.message,{type:"snackbar",id:"import-pattern-error"})}finally{t.target.value=""}}})]})}function NS(){const e=function(){const e=(0,l.useSelect)((e=>{var t;const{getSettings:s}=te(e(zt)),n=s();return null!==(t=n.__experimentalAdditionalBlockPatternCategories)&&void 0!==t?t:n.__experimentalBlockPatternCategories}));return[...e||[],...(0,l.useSelect)((e=>e(_.store).getBlockPatternCategories()))||[]]}();e.push({name:Ee,label:(0,b.__)("Uncategorized")});const t=function(){const e=(0,l.useSelect)((e=>{var t;const{getSettings:s}=te(e(zt));return null!==(t=s().__experimentalAdditionalBlockPatterns)&&void 0!==t?t:s().__experimentalBlockPatterns})),t=(0,l.useSelect)((e=>e(_.store).getBlockPatterns()));return(0,d.useMemo)((()=>[...e||[],...t||[]].filter((e=>!Ae.includes(e.source))).filter(lS).filter((e=>!1!==e.inserter))),[e,t])}(),{patterns:s,categories:n}=CS(Ie.user),i=(0,d.useMemo)((()=>{const i={},r=[];e.forEach((e=>{i[e.name]||(i[e.name]={...e,count:0})})),n.forEach((e=>{i[e.name]||(i[e.name]={...e,count:0})})),t.forEach((e=>{e.categories?.forEach((e=>{i[e]&&(i[e].count+=1)})),e.categories?.length||(i.uncategorized.count+=1)})),s.forEach((e=>{e.wp_pattern_category?.forEach((e=>{const t=n.find((t=>t.id===e))?.name;i[t]&&(i[t].count+=1)})),e.wp_pattern_category?.length&&e.wp_pattern_category.some((e=>n.find((t=>t.id===e))))||(i.uncategorized.count+=1)})),[...e,...n].forEach((e=>{i[e.name].count&&!r.find((t=>t.name===e.name))&&r.push(i[e.name])}));const o=r.sort(((e,t)=>e.label.localeCompare(t.label)));return o.unshift({name:Oe,label:(0,b.__)("My patterns"),count:s.length}),o.unshift({name:Te,label:(0,b.__)("All patterns"),description:(0,b.__)("A list of all patterns from all sources."),count:t.length+s.length}),o}),[e,t,n,s]);return{patternCategories:i,hasPatterns:!!i.length}}const{RenamePatternCategoryModal:VS}=te(_e.privateApis);function FS({category:e,onClose:t}){const[s,n]=(0,d.useState)(!1);return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(y.MenuItem,{onClick:()=>n(!0),children:(0,b.__)("Rename")}),s&&(0,oe.jsx)(RS,{category:e,onClose:()=>{n(!1),t()}})]})}function RS({category:e,onClose:t}){const s={id:e.id,slug:e.slug,name:e.label},n=NS();return(0,oe.jsx)(VS,{category:s,existingCategories:n,onClose:t,overlayClassName:"edit-site-list__rename-modal",focusOnMount:"firstContentElement",size:"small"})}const{useHistory:BS}=te(Ht.privateApis);function DS({category:e,onClose:t}){const[s,n]=(0,d.useState)(!1),i=BS(),{createSuccessNotice:r,createErrorNotice:o}=(0,l.useDispatch)(w.store),{deleteEntityRecord:a,invalidateResolution:c}=(0,l.useDispatch)(_.store);return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(y.MenuItem,{isDestructive:!0,onClick:()=>n(!0),children:(0,b.__)("Delete")}),(0,oe.jsx)(y.__experimentalConfirmDialog,{isOpen:s,onConfirm:async()=>{try{await a("taxonomy","wp_pattern_category",e.id,{force:!0},{throwOnError:!0}),c("getUserPatternCategories"),c("getEntityRecords",["postType",Ie.user,{per_page:-1}]),r((0,b.sprintf)((0,b._x)('"%s" deleted.',"pattern category"),e.label),{type:"snackbar",id:"pattern-category-delete"}),t?.(),i.push({postType:Ie.user,categoryId:Te})}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,b.__)("An error occurred while deleting the pattern category.");o(t,{type:"snackbar",id:"pattern-category-delete"})}},onCancel:()=>n(!1),confirmButtonText:(0,b.__)("Delete"),className:"edit-site-patterns__delete-modal",title:(0,b.sprintf)((0,b._x)('Delete "%s"?',"pattern category"),(0,Xt.decodeEntities)(e.label)),size:"medium",__experimentalHideHeader:!1,children:(0,b.sprintf)((0,b.__)('Are you sure you want to delete the category "%s"? The patterns will not be deleted.'),(0,Xt.decodeEntities)(e.label))})]})}function zS({categoryId:e,type:t,titleId:s,descriptionId:n}){const{patternCategories:i}=NS(),r=(0,l.useSelect)((e=>e(h.store).__experimentalGetDefaultTemplatePartAreas()),[]);let o,a,c;if(t===Ce){const t=r.find((t=>t.area===e));o=t?.label||(0,b.__)("All Template Parts"),a=t?.description||(0,b.__)("Includes every template part defined for any area.")}else t===Ie.user&&e&&(c=i.find((t=>t.name===e)),o=c?.label,a=c?.description);return o?(0,oe.jsxs)(y.__experimentalVStack,{className:"edit-site-patterns__section-header",spacing:1,children:[(0,oe.jsxs)(y.__experimentalHStack,{justify:"space-between",className:"edit-site-patterns__title",children:[(0,oe.jsx)(y.__experimentalHeading,{as:"h2",level:3,id:s,weight:500,truncate:!0,children:o}),(0,oe.jsxs)(y.__experimentalHStack,{expanded:!1,children:[(0,oe.jsx)(MS,{}),!!c?.id&&(0,oe.jsx)(y.DropdownMenu,{icon:ma,label:(0,b.__)("Actions"),toggleProps:{className:"edit-site-patterns__button",description:(0,b.sprintf)((0,b.__)("Action menu for %s pattern category"),o),size:"compact"},children:({onClose:e})=>(0,oe.jsxs)(y.MenuGroup,{children:[(0,oe.jsx)(FS,{category:c,onClose:e}),(0,oe.jsx)(DS,{category:c,onClose:e})]})})]})]}),a?(0,oe.jsx)(y.__experimentalText,{variant:"muted",as:"p",id:n,className:"edit-site-patterns__sub-title",children:a}):null]}):null}const LS=(0,oe.jsx)(Jt.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,oe.jsx)(Jt.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M15 11h-.2V9c0-1.5-1.2-2.8-2.8-2.8S9.2 7.5 9.2 9v2H9c-.6 0-1 .4-1 1v4c0 .6.4 1 1 1h6c.6 0 1-.4 1-1v-4c0-.6-.4-1-1-1zm-1.8 0h-2.5V9c0-.7.6-1.2 1.2-1.2s1.2.6 1.2 1.2v2z"})}),HS=(0,window.wp.priorityQueue.createQueue)();function GS({children:e,placeholder:t}){const[s,n]=(0,d.useState)(!1);return(0,d.useEffect)((()=>{const e={};return HS.add(e,(()=>{(0,d.flushSync)((()=>{n(!0)}))})),()=>{HS.cancel(e)}}),[]),s?e:t}const US=(0,oe.jsx)(Jt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Jt.Path,{d:"M10.5 4v4h3V4H15v4h1.5a1 1 0 011 1v4l-3 4v2a1 1 0 01-1 1h-3a1 1 0 01-1-1v-2l-3-4V9a1 1 0 011-1H9V4h1.5zm.5 12.5v2h2v-2l3-4v-3H8v3l3 4z"})}),WS=(0,oe.jsx)(Jt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Jt.Path,{d:"M12 3.3c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8s-4-8.8-8.8-8.8zm6.5 5.5h-2.6C15.4 7.3 14.8 6 14 5c2 .6 3.6 2 4.5 3.8zm.7 3.2c0 .6-.1 1.2-.2 1.8h-2.9c.1-.6.1-1.2.1-1.8s-.1-1.2-.1-1.8H19c.2.6.2 1.2.2 1.8zM12 18.7c-1-.7-1.8-1.9-2.3-3.5h4.6c-.5 1.6-1.3 2.9-2.3 3.5zm-2.6-4.9c-.1-.6-.1-1.1-.1-1.8 0-.6.1-1.2.1-1.8h5.2c.1.6.1 1.1.1 1.8s-.1 1.2-.1 1.8H9.4zM4.8 12c0-.6.1-1.2.2-1.8h2.9c-.1.6-.1 1.2-.1 1.8 0 .6.1 1.2.1 1.8H5c-.2-.6-.2-1.2-.2-1.8zM12 5.3c1 .7 1.8 1.9 2.3 3.5H9.7c.5-1.6 1.3-2.9 2.3-3.5zM10 5c-.8 1-1.4 2.3-1.8 3.8H5.5C6.4 7 8 5.6 10 5zM5.5 15.3h2.6c.4 1.5 1 2.8 1.8 3.7-1.8-.6-3.5-2-4.4-3.7zM14 19c.8-1 1.4-2.2 1.8-3.7h2.6C17.6 17 16 18.4 14 19z"})});function qS(e,t){return(0,l.useSelect)((s=>{const{getEntityRecord:n,getMedia:i,getUser:r,getEditedEntityRecord:o}=s(_.store),a=o("postType",e,t),l=a?.original_source,c=a?.author_text;switch(l){case"theme":return{type:l,icon:Mo,text:c,isCustomized:a.source===ke.custom};case"plugin":return{type:l,icon:US,text:c,isCustomized:a.source===ke.custom};case"site":{const e=n("root","__unstableBase");return{type:l,icon:WS,imageUrl:e?.site_logo?i(e.site_logo)?.source_url:void 0,text:c,isCustomized:!1}}default:{const e=r(a.author);return{type:"user",icon:U_,imageUrl:e?.avatar_urls?.[48],text:c,isCustomized:!1}}}}),[e,t])}const{useGlobalStyle:ZS}=te(x.privateApis);function KS({item:e,onClick:t,ariaDescribedBy:s,children:n}){return(0,oe.jsx)("button",{className:"page-patterns-preview-field__button",type:"button",onClick:e.type!==Ie.theme?t:void 0,"aria-label":e.title,"aria-describedby":s,"aria-disabled":e.type===Ie.theme,children:n})}const YS={label:(0,b.__)("Preview"),id:"preview",render:function({item:e}){const t=(0,d.useId)(),s=e.description||e?.excerpt?.raw,n=e.type===Ie.user,i=e.type===Ce,[r]=ZS("color.background"),{onClick:a}=Ro({postType:e.type,postId:n||i?e.id:e.name,canvas:"edit"}),l=(0,d.useMemo)((()=>{var t;return null!==(t=e.blocks)&&void 0!==t?t:(0,o.parse)(e.content.raw,{__unstableSkipMigrationLogs:!0})}),[e?.content?.raw,e.blocks]),c=!l?.length;return(0,oe.jsxs)("div",{className:"page-patterns-preview-field",style:{backgroundColor:r},children:[(0,oe.jsxs)(KS,{item:e,onClick:a,ariaDescribedBy:s?t:void 0,children:[c&&i&&(0,b.__)("Empty template part"),c&&!i&&(0,b.__)("Empty pattern"),!c&&(0,oe.jsx)(GS,{children:(0,oe.jsx)(x.BlockPreview,{blocks:l,viewportWidth:e.viewportWidth})})]}),!!s&&(0,oe.jsx)("div",{hidden:!0,id:t,children:s})]})},enableSorting:!1};const XS={label:(0,b.__)("Title"),id:"title",getValue:({item:e})=>e.title?.raw||e.title,render:function({item:e}){const t=e.type===Ie.user,s=e.type===Ce,{onClick:n}=Ro({postType:e.type,postId:t||s?e.id:e.name,canvas:"edit"}),i=(0,Xt.decodeEntities)(fS(e));return(0,oe.jsxs)(y.__experimentalHStack,{alignment:"center",justify:"flex-start",spacing:2,children:[(0,oe.jsx)(y.Flex,{as:"div",gap:0,justify:"flex-start",className:"edit-site-patterns__pattern-title",children:e.type===Ie.theme?i:(0,oe.jsx)(y.Button,{__next40pxDefaultSize:!0,variant:"link",onClick:n,tabIndex:"-1",children:i})}),e.type===Ie.theme&&(0,oe.jsx)(y.Tooltip,{placement:"top",text:(0,b.__)("This pattern cannot be edited."),children:(0,oe.jsx)(qo,{className:"edit-site-patterns__pattern-lock-icon",icon:LS,size:24})})]})},enableHiding:!1},JS=[{value:Me.full,label:(0,b._x)("Synced","pattern (singular)"),description:(0,b.__)("Patterns that are kept in sync across the site.")},{value:Me.unsynced,label:(0,b._x)("Not synced","pattern (singular)"),description:(0,b.__)("Patterns that can be changed freely without affecting the site.")}],QS={label:(0,b.__)("Sync status"),id:"sync-status",render:({item:e})=>{const t="wp_pattern_sync_status"in e?e.wp_pattern_sync_status||Me.full:Me.unsynced;return(0,oe.jsx)("span",{className:`edit-site-patterns__field-sync-status-${t}`,children:JS.find((({value:e})=>e===t)).label})},elements:JS,filterBy:{operators:["is"],isPrimary:!0},enableSorting:!1};const $S={label:(0,b.__)("Author"),id:"author",getValue:({item:e})=>e.author_text,render:function({item:e}){const[t,s]=(0,d.useState)(!1),{text:n,icon:i,imageUrl:r}=qS(e.type,e.id);return(0,oe.jsxs)(y.__experimentalHStack,{alignment:"left",spacing:0,children:[r&&(0,oe.jsx)("div",{className:Ut("page-templates-author-field__avatar",{"is-loaded":t}),children:(0,oe.jsx)("img",{onLoad:()=>s(!0),alt:"",src:r})}),!r&&(0,oe.jsx)("div",{className:"page-templates-author-field__icon",children:(0,oe.jsx)(qo,{icon:i})}),(0,oe.jsx)("span",{className:"page-templates-author-field__name",children:n})]})},filterBy:{isPrimary:!0}},{ExperimentalBlockEditorProvider:ej}=te(x.privateApis),{usePostActions:tj}=te(h.privateApis),{useLocation:sj}=te(Ht.privateApis),nj=[],ij={[Re]:{layout:{primaryField:"title",styles:{preview:{width:"1%"},author:{width:"1%"}}}},[Fe]:{layout:{mediaField:"preview",primaryField:"title",badgeFields:["sync-status"]}}},rj={type:Fe,search:"",page:1,perPage:20,layout:ij[Fe].layout,fields:["title","sync-status"],filters:[]};function oj(){const{params:{postType:e,categoryId:t}}=sj(),s=e||Ie.user,n=t||Te,[i,r]=(0,d.useState)(rj),o=(0,v.usePrevious)(n),a=(0,v.usePrevious)(s),c=i.filters?.find((({field:e})=>"sync-status"===e))?.value,{patterns:u,isResolving:p}=CS(s,n,{search:i.search,syncStatus:c}),{records:h}=(0,_.useEntityRecords)("postType",Ce,{per_page:-1}),f=(0,d.useMemo)((()=>{if(!h)return nj;const e=new Set;return h.forEach((t=>{e.add(t.author_text)})),Array.from(e).map((e=>({value:e,label:e})))}),[h]),m=(0,d.useMemo)((()=>{const e=[YS,XS];return s===Ie.user?e.push(QS):s===Ce&&e.push({...$S,elements:f}),e}),[s,f]);(0,d.useEffect)((()=>{o===n&&a===s||r((e=>({...e,page:1})))}),[n,o,a,s]);const{data:g,paginationInfo:x}=(0,d.useMemo)((()=>{const e={...i};return delete e.search,s!==Ce&&(e.filters=[]),uv(u,e,m)}),[u,i,m,s]),y=function(e){const t=(0,d.useMemo)((()=>{var t;return null!==(t=e?.filter((e=>e.type!==Ie.theme)).map((e=>[e.type,e.id])))&&void 0!==t?t:[]}),[e]),s=(0,l.useSelect)((e=>{const{getEntityRecordPermissions:s}=te(e(_.store));return t.reduce(((e,[t,n])=>(e[n]=s("postType",t,n),e)),{})}),[t]);return(0,d.useMemo)((()=>{var t;return null!==(t=e?.map((e=>{var t;return{...e,permissions:null!==(t=s?.[e.id])&&void 0!==t?t:{}}})))&&void 0!==t?t:[]}),[e,s])}(g),w=tj({postType:Ce,context:"list"}),S=tj({postType:Ie.user,context:"list"}),j=G_(),C=(0,d.useMemo)((()=>s===Ce?[j,...w].filter(Boolean):[j,...S].filter(Boolean)),[j,s,w,S]),k=(0,d.useId)(),E=cS();return(0,oe.jsx)(ej,{settings:E,children:(0,oe.jsxs)(T_,{title:(0,b.__)("Patterns content"),className:"edit-site-page-patterns-dataviews",hideTitleFromUI:!0,children:[(0,oe.jsx)(zS,{categoryId:n,type:s,titleId:`${k}-title`,descriptionId:`${k}-description`}),(0,oe.jsx)(k_,{paginationInfo:x,fields:m,actions:C,data:y||nj,getItemId:e=>{var t;return null!==(t=e.name)&&void 0!==t?t:e.id},isLoading:p,view:i,onChangeView:r,defaultLayouts:ij},n+e)]})})}const aj=(0,oe.jsx)(Jt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Jt.Path,{d:"M12 4L4 7.9V20h16V7.9L12 4zm6.5 14.5H14V13h-4v5.5H5.5V8.8L12 5.7l6.5 3.1v9.7z"})}),lj=(0,oe.jsx)(Jt.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,oe.jsx)(Jt.Path,{d:"M17.8 2l-.9.3c-.1 0-3.6 1-5.2 2.1C10 5.5 9.3 6.5 8.9 7.1c-.6.9-1.7 4.7-1.7 6.3l-.9 2.3c-.2.4 0 .8.4 1 .1 0 .2.1.3.1.3 0 .6-.2.7-.5l.6-1.5c.3 0 .7-.1 1.2-.2.7-.1 1.4-.3 2.2-.5.8-.2 1.6-.5 2.4-.8.7-.3 1.4-.7 1.9-1.2s.8-1.2 1-1.9c.2-.7.3-1.6.4-2.4.1-.8.1-1.7.2-2.5 0-.8.1-1.5.2-2.1V2zm-1.9 5.6c-.1.8-.2 1.5-.3 2.1-.2.6-.4 1-.6 1.3-.3.3-.8.6-1.4.9-.7.3-1.4.5-2.2.8-.6.2-1.3.3-1.8.4L15 7.5c.3-.3.6-.7 1-1.1 0 .4 0 .8-.1 1.2zM6 20h8v-1.5H6V20z"})}),cj=(0,oe.jsx)(Jt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Jt.Path,{d:"m21.5 9.1-6.6-6.6-4.2 5.6c-1.2-.1-2.4.1-3.6.7-.1 0-.1.1-.2.1-.5.3-.9.6-1.2.9l3.7 3.7-5.7 5.7v1.1h1.1l5.7-5.7 3.7 3.7c.4-.4.7-.8.9-1.2.1-.1.1-.2.2-.3.6-1.1.8-2.4.6-3.6l5.6-4.1zm-7.3 3.5.1.9c.1.9 0 1.8-.4 2.6l-6-6c.8-.4 1.7-.5 2.6-.4l.9.1L15 4.9 19.1 9l-4.9 3.6z"})}),uj=(0,oe.jsx)(Jt.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,oe.jsx)(Jt.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M11.934 7.406a1 1 0 0 0 .914.594H19a.5.5 0 0 1 .5.5v9a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .5-.5h5.764a.5.5 0 0 1 .447.276l.723 1.63Zm1.064-1.216a.5.5 0 0 0 .462.31H19a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h5.764a2 2 0 0 1 1.789 1.106l.445 1.084ZM8.5 10.5h7V12h-7v-1.5Zm7 3.5h-7v1.5h7V14Z"})}),dj=(0,oe.jsx)(Jt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Jt.Path,{d:"M19 5H5c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm.5 12c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V7c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v10zm-11-7.6h-.7l-3.1 4.3h2.8V15h1v-1.3h.7v-.8h-.7V9.4zm-.9 3.5H6.3l1.2-1.7v1.7zm5.6-3.2c-.4-.2-.8-.4-1.2-.4-.5 0-.9.1-1.2.4-.4.2-.6.6-.8 1-.2.4-.3.9-.3 1.5s.1 1.1.3 1.6c.2.4.5.8.8 1 .4.2.8.4 1.2.4.5 0 .9-.1 1.2-.4.4-.2.6-.6.8-1 .2-.4.3-1 .3-1.6 0-.6-.1-1.1-.3-1.5-.1-.5-.4-.8-.8-1zm0 3.6c-.1.3-.3.5-.5.7-.2.1-.4.2-.7.2-.3 0-.5-.1-.7-.2-.2-.1-.4-.4-.5-.7-.1-.3-.2-.7-.2-1.2 0-.7.1-1.2.4-1.5.3-.3.6-.5 1-.5s.7.2 1 .5c.3.3.4.8.4 1.5-.1.5-.1.9-.2 1.2zm5-3.9h-.7l-3.1 4.3h2.8V15h1v-1.3h.7v-.8h-.7V9.4zm-1 3.5H16l1.2-1.7v1.7z"})}),pj=(0,oe.jsx)(Jt.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,oe.jsx)(Jt.Path,{d:"M4 4v1.5h16V4H4zm8 8.5h8V11h-8v1.5zM4 20h16v-1.5H4V20zm4-8c0-1.1-.9-2-2-2s-2 .9-2 2 .9 2 2 2 2-.9 2-2z"})}),hj=(0,oe.jsx)(Jt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Jt.Path,{fillRule:"evenodd",d:"M8.95 11.25H4v1.5h4.95v4.5H13V18c0 1.1.9 2 2 2h3c1.1 0 2-.9 2-2v-3c0-1.1-.9-2-2-2h-3c-1.1 0-2 .9-2 2v.75h-2.55v-7.5H13V9c0 1.1.9 2 2 2h3c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2h-3c-1.1 0-2 .9-2 2v.75H8.95v4.5ZM14.5 15v3c0 .3.2.5.5.5h3c.3 0 .5-.2.5-.5v-3c0-.3-.2-.5-.5-.5h-3c-.3 0-.5.2-.5.5Zm0-6V6c0-.3.2-.5.5-.5h3c.3 0 .5.2.5.5v3c0 .3-.2.5-.5.5h-3c-.3 0-.5-.2-.5-.5Z",clipRule:"evenodd"})}),fj=(0,oe.jsx)(Jt.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,oe.jsx)(Jt.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 16c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V7h15v12zM9 10H7v2h2v-2zm0 4H7v2h2v-2zm4-4h-2v2h2v-2zm4 0h-2v2h2v-2zm-4 4h-2v2h2v-2zm4 0h-2v2h2v-2z"})}),mj=(0,oe.jsx)(Jt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Jt.Path,{d:"M4.75 4a.75.75 0 0 0-.75.75v7.826c0 .2.08.39.22.53l6.72 6.716a2.313 2.313 0 0 0 3.276-.001l5.61-5.611-.531-.53.532.528a2.315 2.315 0 0 0 0-3.264L13.104 4.22a.75.75 0 0 0-.53-.22H4.75ZM19 12.576a.815.815 0 0 1-.236.574l-5.61 5.611a.814.814 0 0 1-1.153 0L5.5 12.264V5.5h6.763l6.5 6.502a.816.816 0 0 1 .237.574ZM8.75 9.75a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"})}),gj=(0,oe.jsxs)(Jt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,oe.jsx)(Jt.Path,{d:"m7 6.5 4 2.5-4 2.5z"}),(0,oe.jsx)(Jt.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"m5 3c-1.10457 0-2 .89543-2 2v14c0 1.1046.89543 2 2 2h14c1.1046 0 2-.8954 2-2v-14c0-1.10457-.8954-2-2-2zm14 1.5h-14c-.27614 0-.5.22386-.5.5v10.7072l3.62953-2.6465c.25108-.1831.58905-.1924.84981-.0234l2.92666 1.8969 3.5712-3.4719c.2911-.2831.7545-.2831 1.0456 0l2.9772 2.8945v-9.3568c0-.27614-.2239-.5-.5-.5zm-14.5 14.5v-1.4364l4.09643-2.987 2.99567 1.9417c.2936.1903.6798.1523.9307-.0917l3.4772-3.3806 3.4772 3.3806.0228-.0234v2.5968c0 .2761-.2239.5-.5.5h-14c-.27614 0-.5-.2239-.5-.5z"})]}),vj=(0,oe.jsx)(Jt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Jt.Path,{d:"m7.3 9.7 1.4 1.4c.2-.2.3-.3.4-.5 0 0 0-.1.1-.1.3-.5.4-1.1.3-1.6L12 7 9 4 7.2 6.5c-.6-.1-1.1 0-1.6.3 0 0-.1 0-.1.1-.3.1-.4.2-.6.4l1.4 1.4L4 11v1h1l2.3-2.3zM4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4z"})}),xj={},yj=(e,t)=>{let s=e;return t.split(".").forEach((e=>{s=s?.[e]})),s},bj=()=>(0,l.useSelect)((e=>e(_.store).getEntityRecords("postType",je,{per_page:-1})),[]),wj=()=>(0,l.useSelect)((e=>e(h.store).__experimentalGetDefaultTemplateTypes()),[]),_j=()=>{const e=(0,l.useSelect)((e=>e(_.store).getPostTypes({per_page:-1})),[]);return(0,d.useMemo)((()=>{const t=["attachment"];return e?.filter((({viewable:e,slug:s})=>e&&!t.includes(s)))}),[e])};function Sj(){const e=_j(),t=(0,d.useMemo)((()=>e?.filter((e=>e.has_archive))),[e]),s=bj(),n=(0,d.useMemo)((()=>e?.reduce(((e,{labels:t})=>{const s=t.singular_name.toLowerCase();return e[s]=(e[s]||0)+1,e}),{})),[e]),i=(0,d.useCallback)((({labels:e,slug:t})=>{const s=e.singular_name.toLowerCase();return n[s]>1&&s!==t}),[n]);return(0,d.useMemo)((()=>t?.filter((e=>!(s||[]).some((t=>t.slug==="archive-"+e.slug)))).map((e=>{let t;return t=i(e)?(0,b.sprintf)((0,b.__)("Archive: %1$s (%2$s)"),e.labels.singular_name,e.slug):(0,b.sprintf)((0,b.__)("Archive: %s"),e.labels.singular_name),{slug:"archive-"+e.slug,description:(0,b.sprintf)((0,b.__)("Displays an archive with the latest posts of type: %s."),e.labels.singular_name),title:t,icon:"string"==typeof e.icon&&e.icon.startsWith("dashicons-")?e.icon.slice(10):uj,templatePrefix:"archive"}}))||[]),[t,s,i])}const jj=e=>{const t=(()=>{const e=(0,l.useSelect)((e=>e(_.store).getTaxonomies({per_page:-1})),[]);return(0,d.useMemo)((()=>e?.filter((({visibility:e})=>e?.publicly_queryable))),[e])})(),s=bj(),n=wj(),i=(0,d.useMemo)((()=>t?.reduce(((e,{slug:t})=>{let s=t;return["category","post_tag"].includes(t)||(s=`taxonomy-${s}`),"post_tag"===t&&(s="tag"),e[t]=s,e}),{})),[t]),r=t?.reduce(((e,{labels:t})=>{const s=(t.template_name||t.singular_name).toLowerCase();return e[s]=(e[s]||0)+1,e}),{}),o=Pj("taxonomy",i),a=(s||[]).map((({slug:e})=>e)),c=(t||[]).reduce(((t,s)=>{const{slug:l,labels:c}=s,u=i[l],d=n?.find((({slug:e})=>e===u)),p=a?.includes(u),h=((e,t)=>{if(["category","post_tag"].includes(t))return!1;const s=(e.template_name||e.singular_name).toLowerCase();return r[s]>1&&s!==t})(c,l);let f=c.template_name||c.singular_name;h&&(f=c.template_name?(0,b.sprintf)((0,b._x)("%1$s (%2$s)","taxonomy template menu label"),c.template_name,l):(0,b.sprintf)((0,b._x)("%1$s (%2$s)","taxonomy menu label"),c.singular_name,l));const m=d?{...d,templatePrefix:i[l]}:{slug:u,title:f,description:(0,b.sprintf)((0,b.__)("Displays taxonomy: %s."),c.singular_name),icon:hj,templatePrefix:i[l]},g=o?.[l]?.hasEntities;return g&&(m.onClick=t=>{e({type:"taxonomy",slug:l,config:{queryArgs:({search:e})=>({_fields:"id,name,slug,link",orderBy:e?"name":"count",exclude:o[l].existingEntitiesIds}),getSpecificTemplate:e=>{const t=`${i[l]}-${e.slug}`;return{title:t,slug:t,templatePrefix:i[l]}}},labels:c,hasGeneralTemplate:p,template:t})}),p&&!g||t.push(m),t}),[]);return(0,d.useMemo)((()=>c.reduce(((e,t)=>{const{slug:s}=t;let n="taxonomiesMenuItems";return["category","tag"].includes(s)&&(n="defaultTaxonomiesMenuItems"),e[n].push(t),e}),{defaultTaxonomiesMenuItems:[],taxonomiesMenuItems:[]})),[c])},Cj={user:"author"},kj={user:{who:"authors"}};const Ej=(e,t,s={})=>{const n=(e=>{const t=bj();return(0,d.useMemo)((()=>Object.entries(e||{}).reduce(((e,[s,n])=>{const i=(t||[]).reduce(((e,t)=>{const s=`${n}-`;return t.slug.startsWith(s)&&e.push(t.slug.substring(s.length)),e}),[]);return i.length&&(e[s]=i),e}),{})),[e,t])})(t);return(0,l.useSelect)((t=>Object.entries(n||{}).reduce(((n,[i,r])=>{const o=t(_.store).getEntityRecords(e,i,{_fields:"id",context:"view",slug:r,...s[i]});return o?.length&&(n[i]=o),n}),{})),[n])},Pj=(e,t,s=xj)=>{const n=Ej(e,t,s),i=(0,l.useSelect)((i=>Object.keys(t||{}).reduce(((t,r)=>{const o=n?.[r]?.map((({id:e})=>e))||[];return t[r]=!!i(_.store).getEntityRecords(e,r,{per_page:1,_fields:"id",context:"view",exclude:o,...s[r]})?.length,t}),{})),[t,n,e,s]);return(0,d.useMemo)((()=>Object.keys(t||{}).reduce(((e,t)=>{const s=n?.[t]?.map((({id:e})=>e))||[];return e[t]={hasEntities:i[t],existingEntitiesIds:s},e}),{})),[t,n,i])},Ij=[];function Tj({suggestion:e,search:t,onSelect:s,entityForSuggestions:n}){const i="edit-site-custom-template-modal__suggestions_list__list-item";return(0,oe.jsxs)(y.Composite.Item,{render:(0,oe.jsx)(y.Button,{__next40pxDefaultSize:!0,role:"option",className:i,onClick:()=>s(n.config.getSpecificTemplate(e))}),children:[(0,oe.jsx)(y.__experimentalText,{size:"body",lineHeight:1.53846153846,weight:500,className:`${i}__title`,children:(0,oe.jsx)(y.TextHighlight,{text:(0,Xt.decodeEntities)(e.name),highlight:t})}),e.link&&(0,oe.jsx)(y.__experimentalText,{size:"body",lineHeight:1.53846153846,className:`${i}__info`,children:e.link})]})}function Oj(e,t){const{config:s}=e,n=(0,d.useMemo)((()=>({order:"asc",context:"view",search:t,per_page:t?20:10,...s.queryArgs(t)})),[t,s]),{records:i,hasResolved:r}=(0,_.useEntityRecords)(e.type,e.slug,n),[o,a]=(0,d.useState)(Ij);return(0,d.useEffect)((()=>{if(!r)return;let e=Ij;var t,n;i?.length&&(e=i,s.recordNamePath&&(t=e,n=s.recordNamePath,e=(t||[]).map((e=>({...e,name:(0,Xt.decodeEntities)(yj(e,n))}))))),a(e)}),[i,r]),o}function Aj({entityForSuggestions:e,onSelect:t}){const[s,n,i]=(0,v.useDebouncedInput)(),r=Oj(e,i),{labels:o}=e,[a,l]=(0,d.useState)(!1);return!a&&r?.length>9&&l(!0),(0,oe.jsxs)(oe.Fragment,{children:[a&&(0,oe.jsx)(y.SearchControl,{__nextHasNoMarginBottom:!0,onChange:n,value:s,label:o.search_items,placeholder:o.search_items}),!!r?.length&&(0,oe.jsx)(y.Composite,{orientation:"vertical",role:"listbox",className:"edit-site-custom-template-modal__suggestions_list","aria-label":(0,b.__)("Suggestions list"),children:r.map((s=>(0,oe.jsx)(Tj,{suggestion:s,search:i,onSelect:t,entityForSuggestions:e},s.slug)))}),i&&!r?.length&&(0,oe.jsx)(y.__experimentalText,{as:"p",className:"edit-site-custom-template-modal__no-results",children:o.not_found})]})}const Mj=function({onSelect:e,entityForSuggestions:t}){const[s,n]=(0,d.useState)(t.hasGeneralTemplate);return(0,oe.jsxs)(y.__experimentalVStack,{spacing:4,className:"edit-site-custom-template-modal__contents-wrapper",alignment:"left",children:[!s&&(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(y.__experimentalText,{as:"p",children:(0,b.__)("Select whether to create a single template for all items or a specific one.")}),(0,oe.jsxs)(y.Flex,{className:"edit-site-custom-template-modal__contents",gap:"4",align:"initial",children:[(0,oe.jsxs)(y.FlexItem,{isBlock:!0,as:y.Button,onClick:()=>{const{slug:s,title:n,description:i,templatePrefix:r}=t.template;e({slug:s,title:n,description:i,templatePrefix:r})},children:[(0,oe.jsx)(y.__experimentalText,{as:"span",weight:500,lineHeight:1.53846153846,children:t.labels.all_items}),(0,oe.jsx)(y.__experimentalText,{as:"span",lineHeight:1.53846153846,children:(0,b.__)("For all items")})]}),(0,oe.jsxs)(y.FlexItem,{isBlock:!0,as:y.Button,onClick:()=>{n(!0)},children:[(0,oe.jsx)(y.__experimentalText,{as:"span",weight:500,lineHeight:1.53846153846,children:t.labels.singular_name}),(0,oe.jsx)(y.__experimentalText,{as:"span",lineHeight:1.53846153846,children:(0,b.__)("For a specific item")})]})]})]}),s&&(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(y.__experimentalText,{as:"p",children:(0,b.__)("This template will be used only for the specific item chosen.")}),(0,oe.jsx)(Aj,{entityForSuggestions:t,onSelect:e})]})]})};var Nj=function(){return Nj=Object.assign||function(e){for(var t,s=1,n=arguments.length;s{e()},children:(0,b.__)("Cancel")}),(0,oe.jsx)(y.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",isBusy:r,"aria-disabled":r,children:(0,b.__)("Create")})]})]})})},{useHistory:Lj}=te(Ht.privateApis),Hj=["front-page","home","single","page","index","archive","author","category","date","tag","search","404"],Gj={"front-page":aj,home:lj,single:cj,page:No,archive:uj,search:Qt,404:dj,index:pj,category:hw,author:U_,taxonomy:hj,date:fj,tag:mj,attachment:gj};function Uj({title:e,direction:t,className:s,description:n,icon:i,onClick:r,children:o}){return(0,oe.jsx)(y.Button,{__next40pxDefaultSize:!0,className:s,onClick:r,label:n,showTooltip:!!n,children:(0,oe.jsxs)(y.Flex,{as:"span",spacing:2,align:"center",justify:"center",style:{width:"100%"},direction:t,children:[(0,oe.jsx)("div",{className:"edit-site-add-new-template__template-icon",children:(0,oe.jsx)(y.Icon,{icon:i})}),(0,oe.jsxs)(y.__experimentalVStack,{className:"edit-site-add-new-template__template-name",alignment:"center",spacing:0,children:[(0,oe.jsx)(y.__experimentalText,{align:"center",weight:500,lineHeight:1.53846153846,children:e}),o]})]})})}const Wj=1,qj=2,Zj=3;function Kj({onClose:e}){const[t,s]=(0,d.useState)(Wj),[n,i]=(0,d.useState)({}),[r,o]=(0,d.useState)(!1),a=function(e,t){const s=bj(),n=wj(),i=(s||[]).map((({slug:e})=>e)),r=(n||[]).filter((e=>Hj.includes(e.slug)&&!i.includes(e.slug))),o=s=>{t?.(),e(s)},a=[...r],{defaultTaxonomiesMenuItems:l,taxonomiesMenuItems:c}=jj(o),{defaultPostTypesMenuItems:u,postTypesMenuItems:p}=(e=>{const t=_j(),s=bj(),n=wj(),i=(0,d.useMemo)((()=>t?.reduce(((e,{labels:t})=>{const s=(t.template_name||t.singular_name).toLowerCase();return e[s]=(e[s]||0)+1,e}),{})),[t]),r=(0,d.useCallback)((({labels:e,slug:t})=>{const s=(e.template_name||e.singular_name).toLowerCase();return i[s]>1&&s!==t}),[i]),o=(0,d.useMemo)((()=>t?.reduce(((e,{slug:t})=>{let s=t;return"page"!==t&&(s=`single-${s}`),e[t]=s,e}),{})),[t]),a=Pj("postType",o),l=(s||[]).map((({slug:e})=>e)),c=(t||[]).reduce(((t,s)=>{const{slug:i,labels:c,icon:u}=s,d=o[i],p=n?.find((({slug:e})=>e===d)),h=l?.includes(d),f=r(s);let m=c.template_name||(0,b.sprintf)((0,b.__)("Single item: %s"),c.singular_name);f&&(m=c.template_name?(0,b.sprintf)((0,b._x)("%1$s (%2$s)","post type menu label"),c.template_name,i):(0,b.sprintf)((0,b._x)("Single item: %1$s (%2$s)","post type menu label"),c.singular_name,i));const g=p?{...p,templatePrefix:o[i]}:{slug:d,title:m,description:(0,b.sprintf)((0,b.__)("Displays a single item: %s."),c.singular_name),icon:"string"==typeof u&&u.startsWith("dashicons-")?u.slice(10):vj,templatePrefix:o[i]},v=a?.[i]?.hasEntities;return v&&(g.onClick=t=>{e({type:"postType",slug:i,config:{recordNamePath:"title.rendered",queryArgs:({search:e})=>({_fields:"id,title,slug,link",orderBy:e?"relevance":"modified",exclude:a[i].existingEntitiesIds}),getSpecificTemplate:e=>{const t=`${o[i]}-${e.slug}`;return{title:t,slug:t,templatePrefix:o[i]}}},labels:c,hasGeneralTemplate:h,template:t})}),h&&!v||t.push(g),t}),[]),u=(0,d.useMemo)((()=>c.reduce(((e,t)=>{const{slug:s}=t;let n="postTypesMenuItems";return"page"===s&&(n="defaultPostTypesMenuItems"),e[n].push(t),e}),{defaultPostTypesMenuItems:[],postTypesMenuItems:[]})),[c]);return u})(o),h=function(e){const t=bj(),s=wj(),n=Pj("root",Cj,kj);let i=s?.find((({slug:e})=>"author"===e));i||(i={description:(0,b.__)("Displays latest posts written by a single author."),slug:"author",title:"Author"});const r=!!t?.find((({slug:e})=>"author"===e));if(n.user?.hasEntities&&(i={...i,templatePrefix:"author"},i.onClick=t=>{e({type:"root",slug:"user",config:{queryArgs:({search:e})=>({_fields:"id,name,slug,link",orderBy:e?"name":"registered_date",exclude:n.user.existingEntitiesIds,who:"authors"}),getSpecificTemplate:e=>{const t=`author-${e.slug}`;return{title:t,slug:t,templatePrefix:"author"}}},labels:{singular_name:(0,b.__)("Author"),search_items:(0,b.__)("Search Authors"),not_found:(0,b.__)("No authors found."),all_items:(0,b.__)("All Authors")},hasGeneralTemplate:r,template:t})}),!r||n.user?.hasEntities)return i}(o);[...l,...u,h].forEach((e=>{if(!e)return;const t=a.findIndex((t=>t.slug===e.slug));t>-1?a[t]=e:a.push(e)})),a?.sort(((e,t)=>Hj.indexOf(e.slug)-Hj.indexOf(t.slug)));const f=[...a,...Sj(),...p,...c];return f}(i,(()=>s(qj))),c=Lj(),{saveEntityRecord:u}=(0,l.useDispatch)(_.store),{createErrorNotice:p,createSuccessNotice:h}=(0,l.useDispatch)(w.store),f=(0,v.useViewportMatch)("medium","<"),m=(0,l.useSelect)((e=>e(_.store).getEntityRecord("root","__unstableBase")?.home),[]),g={"front-page":m,date:(0,b.sprintf)((0,b.__)("E.g. %s"),m+"/"+(new Date).getFullYear())};async function x(e,t=!0){if(!r){o(!0);try{const{title:s,description:n,slug:i}=e,r=await u("postType",je,{description:n,slug:i.toString(),status:"publish",title:s,is_wp_suggestion:t},{throwOnError:!0});c.push({postId:r.id,postType:je,canvas:"edit"}),h((0,b.sprintf)((0,b.__)('"%s" successfully created.'),(0,Xt.decodeEntities)(r.title?.rendered||s)),{type:"snackbar"})}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,b.__)("An error occurred while creating the template.");p(t,{type:"snackbar"})}finally{o(!1)}}}const S=()=>{e(),s(Wj)};let j=(0,b.__)("Add template");return t===qj?j=(0,b.sprintf)((0,b.__)("Add template: %s"),n.labels.singular_name):t===Zj&&(j=(0,b.__)("Create custom template")),(0,oe.jsxs)(y.Modal,{title:j,className:Ut("edit-site-add-new-template__modal",{"edit-site-add-new-template__modal_template_list":t===Wj,"edit-site-custom-template-modal":t===qj}),onRequestClose:S,overlayClassName:t===Zj?"edit-site-custom-generic-template__modal":void 0,children:[t===Wj&&(0,oe.jsxs)(y.__experimentalGrid,{columns:f?2:3,gap:4,align:"flex-start",justify:"center",className:"edit-site-add-new-template__template-list__contents",children:[(0,oe.jsx)(y.Flex,{className:"edit-site-add-new-template__template-list__prompt",children:(0,b.__)("Select what the new template should apply to:")}),a.map((e=>{const{title:t,slug:s,onClick:n}=e;return(0,oe.jsx)(Uj,{title:t,direction:"column",className:"edit-site-add-new-template__template-button",description:g[s],icon:Gj[s]||Mo,onClick:()=>n?n(e):x(e)},s)})),(0,oe.jsx)(Uj,{title:(0,b.__)("Custom template"),direction:"row",className:"edit-site-add-new-template__custom-template-button",icon:L_,onClick:()=>s(Zj),children:(0,oe.jsx)(y.__experimentalText,{lineHeight:1.53846153846,children:(0,b.__)("A custom template can be manually applied to any post or page.")})})]}),t===qj&&(0,oe.jsx)(Mj,{onSelect:x,entityForSuggestions:n}),t===Zj&&(0,oe.jsx)(zj,{onClose:S,createTemplate:x})]})}const Yj=(0,d.memo)((function(){const[e,t]=(0,d.useState)(!1),{postType:s}=(0,l.useSelect)((e=>{const{getPostType:t}=e(_.store);return{postType:t(je)}}),[]);return s?(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(y.Button,{variant:"primary",onClick:()=>t(!0),label:s.labels.add_new_item,__next40pxDefaultSize:!0,children:s.labels.add_new_item}),e&&(0,oe.jsx)(Kj,{onClose:()=>t(!1)})]}):null})),{useGlobalStyle:Xj}=te(x.privateApis);const Jj={label:(0,b.__)("Preview"),id:"preview",render:function({item:e}){const t=cS(),[s="white"]=Xj("color.background"),n=(0,d.useMemo)((()=>(0,o.parse)(e.content.raw)),[e.content.raw]),{onClick:i}=Ro({postId:e.id,postType:e.type,canvas:"edit"}),r=!n?.length;return(0,oe.jsx)(h.EditorProvider,{post:e,settings:t,children:(0,oe.jsx)("div",{className:"page-templates-preview-field",style:{backgroundColor:s},children:(0,oe.jsxs)("button",{className:"page-templates-preview-field__button",type:"button",onClick:i,"aria-label":e.title?.rendered||e.title,children:[r&&(0,b.__)("Empty template"),!r&&(0,oe.jsx)(GS,{children:(0,oe.jsx)(x.BlockPreview,{blocks:n})})]})})})},enableSorting:!1};const Qj={label:(0,b.__)("Template"),id:"title",getValue:({item:e})=>e.title?.rendered,render:function({item:e}){const t={params:{postId:e.id,postType:e.type,canvas:"edit"}};return(0,oe.jsx)(Bo,{...t,children:(0,Xt.decodeEntities)(e.title?.rendered)||(0,b.__)("(no title)")})},enableHiding:!1,enableGlobalSearch:!0},$j={label:(0,b.__)("Description"),id:"description",render:({item:e})=>e.description&&(0,oe.jsx)("span",{className:"page-templates-description",children:(0,Xt.decodeEntities)(e.description)}),enableSorting:!1,enableGlobalSearch:!0};const eC={label:(0,b.__)("Author"),id:"author",getValue:({item:e})=>e.author_text,render:function({item:e}){const[t,s]=(0,d.useState)(!1),{text:n,icon:i,imageUrl:r}=qS(e.type,e.id);return(0,oe.jsxs)(y.__experimentalHStack,{alignment:"left",spacing:0,children:[r&&(0,oe.jsx)("div",{className:Ut("page-templates-author-field__avatar",{"is-loaded":t}),children:(0,oe.jsx)("img",{onLoad:()=>s(!0),alt:"",src:r})}),!r&&(0,oe.jsx)("div",{className:"page-templates-author-field__icon",children:(0,oe.jsx)(y.Icon,{icon:i})}),(0,oe.jsx)("span",{className:"page-templates-author-field__name",children:n})]})}},{usePostActions:tC}=te(h.privateApis),{useHistory:sC,useLocation:nC}=te(Ht.privateApis),{useEntityRecordsWithPermissions:iC}=te(_.privateApis),rC=[],oC={[Re]:{fields:["template","author"],layout:{primaryField:"title",combinedFields:[{id:"template",label:(0,b.__)("Template"),children:["title","description"],direction:"vertical"}],styles:{template:{maxWidth:400,minWidth:320},preview:{width:"1%"},author:{width:"1%"}}}},[Fe]:{fields:["title","description","author"],layout:{mediaField:"preview",primaryField:"title",columnFields:["description"]}},[Be]:{fields:["title","description","author"],layout:{primaryField:"title",mediaField:"preview"}}},aC={type:Fe,search:"",page:1,perPage:20,sort:{field:"title",direction:"asc"},fields:oC[Fe].fields,layout:oC[Fe].layout,filters:[]};function lC(){const{params:e}=nC(),{activeView:t="all",layout:s,postId:n}=e,[i,r]=(0,d.useState)([n]),o=(0,d.useMemo)((()=>{const e=null!=s?s:aC.type;return{...aC,type:e,layout:oC[e].layout,fields:oC[e].fields,filters:"all"!==t?[{field:"author",operator:"isAny",value:[t]}]:[]}}),[s,t]),[a,l]=(0,d.useState)(o);(0,d.useEffect)((()=>{l((e=>({...e,filters:"all"!==t?[{field:"author",operator:De,value:[t]}]:[]})))}),[t]);const{records:c,isResolving:u}=iC("postType",je,{per_page:-1}),p=sC(),h=(0,d.useCallback)((t=>{r(t),a?.type===Be&&p.push({...e,postId:1===t.length?t[0]:void 0})}),[p,e,a?.type]),f=(0,d.useMemo)((()=>{if(!c)return rC;const e=new Set;return c.forEach((t=>{e.add(t.author_text)})),Array.from(e).map((e=>({value:e,label:e})))}),[c]),m=(0,d.useMemo)((()=>[Jj,Qj,$j,{...eC,elements:f}]),[f]),{data:g,paginationInfo:v}=(0,d.useMemo)((()=>uv(c,a,m)),[c,a,m]),x=tC({postType:je,context:"list"}),y=G_(),w=(0,d.useMemo)((()=>[y,...x]),[x,y]),_=(0,d.useCallback)((t=>{t.type!==a.type&&p.push({...e,layout:t.type}),l(t)}),[a.type,l,p,e]);return(0,oe.jsx)(T_,{className:"edit-site-page-templates",title:(0,b.__)("Templates"),actions:(0,oe.jsx)(Yj,{}),children:(0,oe.jsx)(k_,{paginationInfo:v,fields:m,actions:w,data:g,isLoading:u,view:a,onChangeView:_,onChangeSelection:h,selection:i,defaultLayouts:oC},t)})}function cC(e){return(0,oe.jsx)(y.Button,{size:"compact",...e,className:Ut("edit-site-sidebar-button",e.className)})}const{useHistory:uC,useLocation:dC}=te(Ht.privateApis);function pC({isRoot:e,title:t,actions:s,meta:n,content:i,footer:r,description:o,backPath:a}){const{dashboardLink:c,dashboardLinkText:u,previewingThemeName:p}=(0,l.useSelect)((e=>{const{getSettings:t}=te(e(zt)),s=Qr();return{dashboardLink:t().__experimentalDashboardLink,dashboardLinkText:t().__experimentalDashboardLinkText,previewingThemeName:s?e(_.store).getTheme(s)?.name?.rendered:void 0}}),[]),h=dC(),f=uC(),{navigate:m}=(0,d.useContext)(is),g=null!=a?a:h.state?.backPath,v=(0,b.isRTL)()?va:ga;return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsxs)(y.__experimentalVStack,{className:Ut("edit-site-sidebar-navigation-screen__main",{"has-footer":!!r}),spacing:0,justify:"flex-start",children:[(0,oe.jsxs)(y.__experimentalHStack,{spacing:3,alignment:"flex-start",className:"edit-site-sidebar-navigation-screen__title-icon",children:[!e&&(0,oe.jsx)(cC,{onClick:()=>{f.push(g),m("back")},icon:v,label:(0,b.__)("Back"),showTooltip:!1}),e&&(0,oe.jsx)(cC,{icon:v,label:u||(0,b.__)("Go to the Dashboard"),href:c||"index.php"}),(0,oe.jsx)(y.__experimentalHeading,{className:"edit-site-sidebar-navigation-screen__title",color:"#e0e0e0",level:1,size:20,children:Jr()?(0,b.sprintf)((0,b.__)("Previewing %1$s: %2$s"),p,t):t}),s&&(0,oe.jsx)("div",{className:"edit-site-sidebar-navigation-screen__actions",children:s})]}),n&&(0,oe.jsx)(oe.Fragment,{children:(0,oe.jsx)("div",{className:"edit-site-sidebar-navigation-screen__meta",children:n})}),(0,oe.jsxs)("div",{className:"edit-site-sidebar-navigation-screen__content",children:[o&&(0,oe.jsx)("p",{className:"edit-site-sidebar-navigation-screen__description",children:o}),i]})]}),r&&(0,oe.jsx)("footer",{className:"edit-site-sidebar-navigation-screen__footer",children:r})]})}const hC=(0,oe.jsx)(Jt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Jt.Path,{d:"m13.1 16-3.4-4 3.4-4 1.1 1-2.6 3 2.6 3-1.1 1z"})}),fC=(0,oe.jsx)(Jt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Jt.Path,{d:"M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z"})}),{useHistory:mC}=te(Ht.privateApis);function gC({className:e,icon:t,withChevron:s=!1,suffix:n,uid:i,params:r,onClick:o,children:a,...l}){const c=mC(),{navigate:u}=(0,d.useContext)(is);return(0,oe.jsx)(y.__experimentalItem,{className:Ut("edit-site-sidebar-navigation-item",{"with-suffix":!s&&n},e),onClick:function(e){o?(o(e),u("forward")):r&&(e.preventDefault(),c.push(r),u("forward",`[id="${i}"]`))},id:i,...l,children:(0,oe.jsxs)(y.__experimentalHStack,{justify:"flex-start",children:[t&&(0,oe.jsx)(qo,{style:{fill:"currentcolor"},icon:t,size:24}),(0,oe.jsx)(y.FlexBlock,{children:a}),s&&(0,oe.jsx)(qo,{icon:(0,b.isRTL)()?hC:fC,className:"edit-site-sidebar-navigation-item__drilldown-indicator",size:24}),!s&&n]})})}function vC({children:e}){return(0,oe.jsx)(y.__experimentalText,{className:"edit-site-sidebar-navigation-details-screen-panel__label",children:e})}function xC({label:e,children:t,className:s,...n}){return(0,oe.jsx)(y.__experimentalHStack,{spacing:5,alignment:"left",className:Ut("edit-site-sidebar-navigation-details-screen-panel__row",s),...n,children:t},e)}function yC({children:e}){return(0,oe.jsx)(y.__experimentalText,{className:"edit-site-sidebar-navigation-details-screen-panel__value",children:e})}function bC({record:e,...t}){var s,n;const i={},r=null!==(s=e?._links?.["predecessor-version"]?.[0]?.id)&&void 0!==s?s:null,o=null!==(n=e?._links?.["version-history"]?.[0]?.count)&&void 0!==n?n:0;return r&&o>1&&(i.href=(0,es.addQueryArgs)("revision.php",{revision:e?._links["predecessor-version"][0].id}),i.as="a"),(0,oe.jsx)(y.__experimentalItemGroup,{className:"edit-site-sidebar-navigation-screen-details-footer",children:(0,oe.jsx)(gC,{"aria-label":(0,b.__)("Revisions"),...i,...t,children:(0,oe.jsxs)(xC,{justify:"space-between",children:[(0,oe.jsx)(vC,{children:(0,b.__)("Last modified")}),(0,oe.jsx)(yC,{children:(0,d.createInterpolateElement)((0,b.sprintf)((0,b.__)(""),(0,Zm.humanTimeDiff)(e.modified)),{time:(0,oe.jsx)("time",{dateTime:e.modified})})}),(0,oe.jsx)(y.Icon,{className:"edit-site-sidebar-navigation-screen-details-footer__icon",icon:So})]})})})}function wC(e){const{openGeneralSidebar:t}=(0,l.useDispatch)(zt),{setCanvasMode:s}=te((0,l.useDispatch)(zt));return(0,l.useSelect)((e=>!!e(_.store).__experimentalGetCurrentThemeGlobalStylesVariations()?.length),[])?(0,oe.jsx)(gC,{...e,params:{path:"/wp_global_styles"},uid:"global-styles-navigation-item"}):(0,oe.jsx)(gC,{...e,onClick:()=>{s("edit"),t("edit-site/global-styles")}})}function _C({backPath:e}){const{revisions:t,isLoading:s}=qm(),{openGeneralSidebar:n}=(0,l.useDispatch)(zt),{setIsListViewOpened:i}=(0,l.useDispatch)(h.store),r=(0,v.useViewportMatch)("medium","<"),{setCanvasMode:o,setEditorCanvasContainerView:a}=te((0,l.useDispatch)(zt)),{isViewMode:c,isStyleBookOpened:u,revisionsCount:p}=(0,l.useSelect)((e=>{var t;const{getCanvasMode:s,getEditorCanvasContainerView:n}=te(e(zt)),{getEntityRecord:i,__experimentalGetCurrentGlobalStylesId:r}=e(_.store),o=r(),a=o?i("root","globalStyles",o):void 0;return{isViewMode:"view"===s(),isStyleBookOpened:"style-book"===n(),revisionsCount:null!==(t=a?._links?.["version-history"]?.[0]?.count)&&void 0!==t?t:0}}),[]),{set:m}=(0,l.useDispatch)(f.store),g=(0,d.useCallback)((async()=>Promise.all([m("core","distractionFree",!1),o("edit"),n("edit-site/global-styles")])),[o,n,m]),x=(0,d.useCallback)((async()=>{await g(),a("style-book"),i(!1)}),[g,a,i]),y=(0,d.useCallback)((async()=>{await g(),a("global-styles-revisions")}),[g,a]),w=p>0,S=t?.[0]?.modified,j=w&&!s&&S;return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(pC,{title:(0,b.__)("Styles"),description:(0,b.__)("Choose a different style combination for the theme styles."),backPath:e,content:(0,oe.jsx)(dm,{}),footer:j&&(0,oe.jsx)(bC,{record:t?.[0],onClick:y}),actions:(0,oe.jsxs)(oe.Fragment,{children:[!r&&(0,oe.jsx)(cC,{icon:fa,label:(0,b.__)("Style Book"),onClick:()=>a(u?void 0:"style-book"),isPressed:u}),(0,oe.jsx)(cC,{icon:L_,label:(0,b.__)("Edit styles"),onClick:async()=>await g()})]})}),u&&!r&&c&&(0,oe.jsx)(Om,{enableResizing:!1,isSelected:()=>!1,onClick:x,onSelect:x,showCloseButton:!1,showTabs:!1})]})}const SC=(0,oe.jsx)(Jt.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,oe.jsx)(Jt.Path,{d:"M12 4c-4.4 0-8 3.6-8 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8zm0 14.5c-3.6 0-6.5-2.9-6.5-6.5S8.4 5.5 12 5.5s6.5 2.9 6.5 6.5-2.9 6.5-6.5 6.5zM9 16l4.5-3L15 8.4l-4.5 3L9 16z"})});function jC(){const{setEditorCanvasContainerView:e}=te((0,l.useDispatch)(zt));return(0,d.useEffect)((()=>{e(void 0)}),[e]),(0,oe.jsx)(pC,{isRoot:!0,title:(0,b.__)("Design"),description:(0,b.__)("Customize the appearance of your website using the block editor."),content:(0,oe.jsx)(oe.Fragment,{children:(0,oe.jsxs)(y.__experimentalItemGroup,{children:[(0,oe.jsx)(gC,{uid:"navigation-navigation-item",params:{postType:Se},withChevron:!0,icon:SC,children:(0,b.__)("Navigation")}),(0,oe.jsx)(wC,{uid:"styles-navigation-item",withChevron:!0,icon:xo,children:(0,b.__)("Styles")}),(0,oe.jsx)(gC,{uid:"page-navigation-item",params:{postType:"page"},withChevron:!0,icon:No,children:(0,b.__)("Pages")}),(0,oe.jsx)(gC,{uid:"template-navigation-item",params:{postType:je},withChevron:!0,icon:Mo,children:(0,b.__)("Templates")}),(0,oe.jsx)(gC,{uid:"patterns-navigation-item",params:{postType:Ie.user},withChevron:!0,icon:kS,children:(0,b.__)("Patterns")})]})})})}const CC={per_page:100,status:["publish","draft"],order:"desc",orderby:"date"},kC=e=>e?.trim()?.length>0;function EC({menuTitle:e,onClose:t,onSave:s}){const[n,i]=(0,d.useState)(e),r=n!==e&&kC(n);return(0,oe.jsx)(y.Modal,{title:(0,b.__)("Rename"),onRequestClose:t,focusOnMount:"firstContentElement",size:"small",children:(0,oe.jsx)("form",{className:"sidebar-navigation__rename-modal-form",children:(0,oe.jsxs)(y.__experimentalVStack,{spacing:"3",children:[(0,oe.jsx)(y.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,value:n,placeholder:(0,b.__)("Navigation title"),onChange:i,label:(0,b.__)("Name")}),(0,oe.jsxs)(y.__experimentalHStack,{justify:"right",children:[(0,oe.jsx)(y.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:t,children:(0,b.__)("Cancel")}),(0,oe.jsx)(y.Button,{__next40pxDefaultSize:!0,accessibleWhenDisabled:!0,disabled:!r,variant:"primary",type:"submit",onClick:e=>{e.preventDefault(),r&&(s({title:n}),t())},children:(0,b.__)("Save")})]})]})})})}function PC({onClose:e,onConfirm:t}){return(0,oe.jsx)(y.__experimentalConfirmDialog,{isOpen:!0,onConfirm:()=>{t(),e()},onCancel:e,confirmButtonText:(0,b.__)("Delete"),size:"medium",children:(0,b.__)("Are you sure you want to delete this Navigation Menu?")})}const{useHistory:IC}=te(Ht.privateApis),TC={position:"bottom right"};function OC(e){const{onDelete:t,onSave:s,onDuplicate:n,menuTitle:i,menuId:r}=e,[o,a]=(0,d.useState)(!1),[l,c]=(0,d.useState)(!1),u=IC(),p=()=>{a(!1),c(!1)};return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(y.DropdownMenu,{className:"sidebar-navigation__more-menu",label:(0,b.__)("Actions"),icon:ma,popoverProps:TC,children:({onClose:e})=>(0,oe.jsx)("div",{children:(0,oe.jsxs)(y.MenuGroup,{children:[(0,oe.jsx)(y.MenuItem,{onClick:()=>{a(!0),e()},children:(0,b.__)("Rename")}),(0,oe.jsx)(y.MenuItem,{onClick:()=>{u.push({postId:r,postType:"wp_navigation",canvas:"edit"})},children:(0,b.__)("Edit")}),(0,oe.jsx)(y.MenuItem,{onClick:()=>{n(),e()},children:(0,b.__)("Duplicate")}),(0,oe.jsx)(y.MenuItem,{isDestructive:!0,onClick:()=>{c(!0),e()},children:(0,b.__)("Delete")})]})})}),l&&(0,oe.jsx)(PC,{onClose:p,onConfirm:t}),o&&(0,oe.jsx)(EC,{onClose:p,menuTitle:i,onSave:s})]})}const AC={className:"block-editor-block-settings-menu__popover",placement:"bottom-start"},{useHistory:MC}=te(Ht.privateApis);function NC(e){const t=MC(),{block:s}=e,{clientId:n}=s,{moveBlocksDown:i,moveBlocksUp:r,removeBlocks:o}=(0,l.useDispatch)(x.store),a=(0,b.sprintf)((0,b.__)("Remove %s"),(0,x.BlockTitle)({clientId:n,maximumLength:25})),c=(0,b.sprintf)((0,b.__)("Go to %s"),(0,x.BlockTitle)({clientId:n,maximumLength:25})),u=(0,l.useSelect)((e=>{const{getBlockRootClientId:t}=e(x.store);return t(n)}),[n]),p=(0,d.useCallback)((e=>{const{attributes:s,name:n}=e;if("post-type"===s.kind&&s.id&&s.type&&t){const{params:e}=t.getLocationWithParams();t.push({postType:s.type,postId:s.id,canvas:"edit"},{backPath:e})}if("core/page-list-item"===n&&s.id&&t){const{params:e}=t.getLocationWithParams();t.push({postType:"page",postId:s.id,canvas:"edit"},{backPath:e})}}),[t]);return(0,oe.jsx)(y.DropdownMenu,{icon:ma,label:(0,b.__)("Options"),className:"block-editor-block-settings-menu",popoverProps:AC,noIcons:!0,...e,children:({onClose:e})=>(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsxs)(y.MenuGroup,{children:[(0,oe.jsx)(y.MenuItem,{icon:l_,onClick:()=>{r([n],u),e()},children:(0,b.__)("Move up")}),(0,oe.jsx)(y.MenuItem,{icon:c_,onClick:()=>{i([n],u),e()},children:(0,b.__)("Move down")}),"page"===s.attributes?.type&&s.attributes?.id&&(0,oe.jsx)(y.MenuItem,{onClick:()=>{p(s),e()},children:c})]}),(0,oe.jsx)(y.MenuGroup,{children:(0,oe.jsx)(y.MenuItem,{onClick:()=>{o([n],!1),e()},children:a})})]})})}const{PrivateListView:VC}=te(x.privateApis),FC=["postType","page",{per_page:100,_fields:["id","link","menu_order","parent","title","type"],orderby:"menu_order",order:"asc"}];function RC({rootClientId:e}){const{listViewRootClientId:t,isLoading:s}=(0,l.useSelect)((t=>{const{areInnerBlocksControlled:s,getBlockName:n,getBlockCount:i,getBlockOrder:r}=t(x.store),{isResolving:o}=t(_.store),a=r(e),l=1===a.length&&"core/page-list"===n(a[0])&&i(a[0])>0,c=o("getEntityRecords",FC);return{listViewRootClientId:l?a[0]:e,isLoading:!s(e)||c}}),[e]),{replaceBlock:n,__unstableMarkNextChangeAsNotPersistent:i}=(0,l.useDispatch)(x.store),r=(0,d.useCallback)((e=>{"core/navigation-link"!==e.name||e.attributes.url||(i(),n(e.clientId,(0,o.createBlock)("core/navigation-link",e.attributes)))}),[i,n]);return(0,oe.jsxs)(oe.Fragment,{children:[!s&&(0,oe.jsx)(VC,{rootClientId:t,onSelect:r,blockSettingsMenu:NC,showAppender:!1}),(0,oe.jsx)("div",{className:"edit-site-sidebar-navigation-screen-navigation-menus__helper-block-editor",children:(0,oe.jsx)(x.BlockList,{})})]})}const BC=()=>{};function DC({navigationMenuId:e}){const{storedSettings:t}=(0,l.useSelect)((e=>{const{getSettings:t}=te(e(zt));return{storedSettings:t()}}),[]),s=(0,d.useMemo)((()=>e?[(0,o.createBlock)("core/navigation",{ref:e})]:[]),[e]);return e&&s?.length?(0,oe.jsx)(x.BlockEditorProvider,{settings:t,value:s,onChange:BC,onInput:BC,children:(0,oe.jsx)("div",{className:"edit-site-sidebar-navigation-screen-navigation-menus__content",children:(0,oe.jsx)(RC,{rootClientId:s[0].clientId})})}):null}function zC(e,t,s){return e?.rendered?"publish"===s?(0,Xt.decodeEntities)(e?.rendered):(0,b.sprintf)((0,b._x)("%1$s (%2$s)","menu label"),(0,Xt.decodeEntities)(e?.rendered),s):(0,b.sprintf)((0,b.__)("(no title %s)"),t)}function LC({navigationMenu:e,backPath:t,handleDelete:s,handleDuplicate:n,handleSave:i}){const r=e?.title?.rendered;return(0,oe.jsx)($C,{actions:(0,oe.jsx)(oe.Fragment,{children:(0,oe.jsx)(OC,{menuId:e?.id,menuTitle:(0,Xt.decodeEntities)(r),onDelete:s,onSave:i,onDuplicate:n})}),backPath:t,title:zC(e?.title,e?.id,e?.status),description:(0,b.__)("Navigation Menus are a curated collection of blocks that allow visitors to get around your site."),children:(0,oe.jsx)(DC,{navigationMenuId:e?.id})})}const{useLocation:HC}=te(Ht.privateApis),GC="wp_navigation";function UC({backPath:e}){const{params:{postId:t}}=HC(),{record:s,isResolving:n}=(0,_.useEntityRecord)("postType",GC,t),{isSaving:i,isDeleting:r}=(0,l.useSelect)((e=>{const{isSavingEntityRecord:s,isDeletingEntityRecord:n}=e(_.store);return{isSaving:s("postType",GC,t),isDeleting:n("postType",GC,t)}}),[t]),o=n||i||r,a=s?.title?.rendered||s?.slug,{handleSave:c,handleDelete:u,handleDuplicate:d}=YC(),p=()=>u(s),h=e=>c(s,e),f=()=>d(s);return o?(0,oe.jsx)($C,{description:(0,b.__)("Navigation Menus are a curated collection of blocks that allow visitors to get around your site."),backPath:e,children:(0,oe.jsx)(y.Spinner,{className:"edit-site-sidebar-navigation-screen-navigation-menus__loading"})}):o||s?s?.content?.raw?(0,oe.jsx)(LC,{navigationMenu:s,backPath:e,handleDelete:p,handleSave:h,handleDuplicate:f}):(0,oe.jsx)($C,{actions:(0,oe.jsx)(OC,{menuId:s?.id,menuTitle:(0,Xt.decodeEntities)(a),onDelete:p,onSave:h,onDuplicate:f}),backPath:e,title:zC(s?.title,s?.id,s?.status),description:(0,b.__)("This Navigation Menu is empty.")}):(0,oe.jsx)($C,{description:(0,b.__)("Navigation Menu missing."),backPath:e})}const{useHistory:WC}=te(Ht.privateApis);function qC(){const{deleteEntityRecord:e}=(0,l.useDispatch)(_.store),{createSuccessNotice:t,createErrorNotice:s}=(0,l.useDispatch)(w.store),n=WC();return async i=>{const r=i?.id;try{await e("postType",GC,r,{force:!0},{throwOnError:!0}),t((0,b.__)("Navigation Menu successfully deleted."),{type:"snackbar"}),n.push({postType:"wp_navigation"})}catch(e){s((0,b.sprintf)((0,b.__)("Unable to delete Navigation Menu (%s)."),e?.message),{type:"snackbar"})}}}function ZC(){const{getEditedEntityRecord:e}=(0,l.useSelect)((e=>{const{getEditedEntityRecord:t}=e(_.store);return{getEditedEntityRecord:t}}),[]),{editEntityRecord:t,__experimentalSaveSpecifiedEntityEdits:s}=(0,l.useDispatch)(_.store),{createSuccessNotice:n,createErrorNotice:i}=(0,l.useDispatch)(w.store);return async(r,o)=>{if(!o)return;const a=r?.id,l=e("postType",Se,a);t("postType",GC,a,o);const c=Object.keys(o);try{await s("postType",GC,a,c,{throwOnError:!0}),n((0,b.__)("Renamed Navigation Menu"),{type:"snackbar"})}catch(e){t("postType",GC,a,l),i((0,b.sprintf)((0,b.__)("Unable to rename Navigation Menu (%s)."),e?.message),{type:"snackbar"})}}}function KC(){const e=WC(),{saveEntityRecord:t}=(0,l.useDispatch)(_.store),{createSuccessNotice:s,createErrorNotice:n}=(0,l.useDispatch)(w.store);return async i=>{const r=i?.title?.rendered||i?.slug;try{const n=await t("postType",GC,{title:(0,b.sprintf)((0,b._x)("%s (Copy)","navigation menu"),r),content:i?.content?.raw,status:"publish"},{throwOnError:!0});n&&(s((0,b.__)("Duplicated Navigation Menu"),{type:"snackbar"}),e.push({postType:GC,postId:n.id}))}catch(e){n((0,b.sprintf)((0,b.__)("Unable to duplicate Navigation Menu (%s)."),e?.message),{type:"snackbar"})}}}function YC(){return{handleDelete:qC(),handleSave:ZC(),handleDuplicate:KC()}}function XC(e,t,s){return e?"publish"===s?(0,Xt.decodeEntities)(e):(0,b.sprintf)((0,b._x)("%1$s (%2$s)","menu label"),(0,Xt.decodeEntities)(e),s):(0,b.sprintf)((0,b.__)("(no title %s)"),t)}let JC=!1;function QC({backPath:e}){const{records:t,isResolving:s,hasResolved:n}=(0,_.useEntityRecords)("postType",Se,CC),i=s&&!n,{getNavigationFallbackId:r}=te((0,l.useSelect)(_.store)),o=t?.[0];o&&(JC=!0),o||s||!n||JC||r();const{handleSave:a,handleDelete:c,handleDuplicate:u}=YC(),d=!!t?.length;return i?(0,oe.jsx)($C,{backPath:e,children:(0,oe.jsx)(y.Spinner,{className:"edit-site-sidebar-navigation-screen-navigation-menus__loading"})}):i||d?1===t?.length?(0,oe.jsx)(LC,{navigationMenu:o,backPath:e,handleDelete:()=>c(o),handleDuplicate:()=>u(o),handleSave:e=>a(o,e)}):(0,oe.jsx)($C,{backPath:e,children:(0,oe.jsx)(y.__experimentalItemGroup,{children:t?.map((({id:e,title:t,status:s},n)=>(0,oe.jsx)(ek,{postId:e,withChevron:!0,icon:SC,children:XC(t?.rendered,n+1,s)},e)))})}):(0,oe.jsx)($C,{description:(0,b.__)("No Navigation Menus found."),backPath:e})}function $C({children:e,actions:t,title:s,description:n,backPath:i}){return(0,oe.jsx)(pC,{title:s||(0,b.__)("Navigation"),actions:t,description:n||(0,b.__)("Manage your Navigation Menus."),backPath:i,content:e})}const ek=({postId:e,...t})=>{const s=Ro({postId:e,postType:"wp_navigation"});return(0,oe.jsx)(gC,{...s,...t})},{useLocation:tk}=te(Ht.privateApis);function sk({title:e,slug:t,customViewId:s,type:n,icon:i,isActive:r,isCustom:o,suffix:a}){const{params:{postType:l}}=tk(),c=i||$w.find((e=>e.type===n)).icon;let u=o?s:t;"all"===u&&(u=void 0);const d=Ro({postType:l,layout:n,activeView:u,isCustom:o?"true":void 0});return(0,oe.jsxs)(y.__experimentalHStack,{justify:"flex-start",className:Ut("edit-site-sidebar-dataviews-dataview-item",{"is-selected":r}),children:[(0,oe.jsx)(gC,{icon:c,...d,"aria-current":r?"true":void 0,children:e}),a]})}const nk=[];function ik({template:e,isActive:t}){const{text:s,icon:n}=qS(e.type,e.id);return(0,oe.jsx)(sk,{slug:s,title:s,icon:n,isActive:t,isCustom:!1},s)}function rk({activeView:e,title:t}){const{records:s}=(0,_.useEntityRecords)("postType",je,{per_page:-1}),n=(0,d.useMemo)((()=>{var e;const t=s?.reduce(((e,t)=>{const s=t.author_text;return s&&!e[s]&&(e[s]=t),e}),{});return null!==(e=t&&Object.values(t))&&void 0!==e?e:nk}),[s]);return(0,oe.jsxs)(y.__experimentalItemGroup,{children:[(0,oe.jsx)(sk,{slug:"all",title:t,icon:Mo,isActive:"all"===e,isCustom:!1}),n.map((t=>(0,oe.jsx)(ik,{template:t,isActive:e===t.author_text},t.author_text)))]})}const{useLocation:ok}=te(Ht.privateApis);function ak({backPath:e}){const{params:{activeView:t="all"}}=ok();return(0,oe.jsx)(pC,{title:(0,b.__)("Templates"),description:(0,b.__)("Create new templates, or reset any customizations made to the templates supplied by your theme."),backPath:e,content:(0,oe.jsx)(rk,{activeView:t,title:(0,b.__)("All templates")})})}const lk=(0,oe.jsx)(Jt.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,oe.jsx)(Jt.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12.848 8a1 1 0 0 1-.914-.594l-.723-1.63a.5.5 0 0 0-.447-.276H5a.5.5 0 0 0-.5.5v11.5a.5.5 0 0 0 .5.5h14a.5.5 0 0 0 .5-.5v-9A.5.5 0 0 0 19 8h-6.152Zm.612-1.5a.5.5 0 0 1-.462-.31l-.445-1.084A2 2 0 0 0 10.763 4H5a2 2 0 0 0-2 2v11.5a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-9a2 2 0 0 0-2-2h-5.54Z"})});function ck({count:e,icon:t,id:s,isActive:n,label:i,type:r}){const o=Ro({categoryId:s!==Pe&&s!==Te?s:void 0,postType:r===Ce?Ce:Ie.user});if(e)return(0,oe.jsx)(gC,{...o,icon:t,suffix:(0,oe.jsx)("span",{children:e}),"aria-current":n?"true":void 0,children:i})}const uk=e=>{const t=e||[],s=(0,l.useSelect)((e=>e(h.store).__experimentalGetDefaultTemplatePartAreas()),[]),n={header:{},footer:{},sidebar:{},uncategorized:{}};s.forEach((e=>n[e.area]={...e,templateParts:[]}));return t.reduce(((e,t)=>(e[e[t.area]?t.area:Ee].templateParts.push(t),e)),n)};const{useLocation:dk}=te(Ht.privateApis);function pk({templatePartAreas:e,patternCategories:t,currentCategory:s,currentType:n}){const[i,...r]=t;return(0,oe.jsxs)(y.__experimentalItemGroup,{className:"edit-site-sidebar-navigation-screen-patterns__group",children:[(0,oe.jsx)(ck,{count:Object.values(e).map((({templateParts:e})=>e?.length||0)).reduce(((e,t)=>e+t),0),icon:(0,h.getTemplatePartIcon)(),label:(0,b.__)("All template parts"),id:Pe,type:Ce,isActive:s===Pe&&n===Ce},"all"),Object.entries(e).map((([e,{label:t,templateParts:i}])=>(0,oe.jsx)(ck,{count:i?.length,icon:(0,h.getTemplatePartIcon)(e),label:t,id:e,type:Ce,isActive:s===e&&n===Ce},e))),(0,oe.jsx)("div",{className:"edit-site-sidebar-navigation-screen-patterns__divider"}),i&&(0,oe.jsx)(ck,{count:i.count,label:i.label,icon:lk,id:i.name,type:Ie.user,isActive:s===`${i.name}`&&n===Ie.user},i.name),r.map((e=>(0,oe.jsx)(ck,{count:e.count,label:e.label,icon:lk,id:e.name,type:Ie.user,isActive:s===`${e.name}`&&n===Ie.user},e.name)))]})}function hk({backPath:e}){const{params:{postType:t,categoryId:s}}=dk(),n=t||Ie.user,i=s||(n===Ie.user?Te:Pe),{templatePartAreas:r,hasTemplateParts:o,isLoading:a}=function(){const{records:e,isResolving:t}=(0,_.useEntityRecords)("postType",Ce,{per_page:-1});return{hasTemplateParts:!!e&&!!e.length,isLoading:t,templatePartAreas:uk(e)}}(),{patternCategories:c,hasPatterns:u}=NS(),d=(0,l.useSelect)((e=>e(_.store).getCurrentTheme()?.is_block_theme),[]);return(0,oe.jsx)(pC,{isRoot:!d,title:(0,b.__)("Patterns"),description:(0,b.__)("Manage what patterns are available when editing the site."),backPath:e,content:(0,oe.jsxs)(oe.Fragment,{children:[a&&(0,b.__)("Loading items…"),!a&&(0,oe.jsxs)(oe.Fragment,{children:[!o&&!u&&(0,oe.jsx)(y.__experimentalItemGroup,{className:"edit-site-sidebar-navigation-screen-patterns__group",children:(0,oe.jsx)(y.__experimentalItem,{children:(0,b.__)("No items found")})}),(0,oe.jsx)(pk,{templatePartAreas:r,patternCategories:c,currentCategory:i,currentType:n})]})]})})}const{useHistory:fk}=te(Ht.privateApis);function mk({type:e,setIsAdding:t}){const s=fk(),{saveEntityRecord:n}=(0,l.useDispatch)(_.store),[i,r]=(0,d.useState)(""),[o,a]=(0,d.useState)(!1),c=D_({postType:e});return(0,oe.jsx)("form",{onSubmit:async r=>{r.preventDefault(),a(!0);const{getEntityRecords:o}=(0,l.resolveSelect)(_.store);let u;const d=await o("taxonomy","wp_dataviews_type",{slug:e});if(d&&d.length>0)u=d[0].id;else{const t=await n("taxonomy","wp_dataviews_type",{name:e});t&&t.id&&(u=t.id)}const p=await n("postType","wp_dataviews",{title:i,status:"publish",wp_dataviews_type:u,content:JSON.stringify(c[0].view)}),{params:{postType:h}}=s.getLocationWithParams();s.push({postType:h,activeView:p.id,isCustom:"true"}),a(!1),t(!1)},children:(0,oe.jsxs)(y.__experimentalVStack,{spacing:"5",children:[(0,oe.jsx)(y.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,b.__)("Name"),value:i,onChange:r,placeholder:(0,b.__)("My view"),className:"patterns-create-modal__name-input"}),(0,oe.jsxs)(y.__experimentalHStack,{justify:"right",children:[(0,oe.jsx)(y.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>{t(!1)},children:(0,b.__)("Cancel")}),(0,oe.jsx)(y.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit","aria-disabled":!i||o,isBusy:o,children:(0,b.__)("Create")})]})]})})}function gk({type:e}){const[t,s]=(0,d.useState)(!1);return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(gC,{icon:Xh,onClick:()=>{s(!0)},className:"dataviews__siderbar-content-add-new-item",children:(0,b.__)("New view")}),t&&(0,oe.jsx)(y.Modal,{title:(0,b.__)("Add new view"),onRequestClose:()=>{s(!1)},children:(0,oe.jsx)(mk,{type:e,setIsAdding:s})})]})}const{useHistory:vk}=te(Ht.privateApis),xk=[];function yk({dataviewId:e,currentTitle:t,setIsRenaming:s}){const{editEntityRecord:n}=(0,l.useDispatch)(_.store),[i,r]=(0,d.useState)(t);return(0,oe.jsx)("form",{onSubmit:async t=>{t.preventDefault(),await n("postType","wp_dataviews",e,{title:i}),s(!1)},children:(0,oe.jsxs)(y.__experimentalVStack,{spacing:"5",children:[(0,oe.jsx)(y.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,b.__)("Name"),value:i,onChange:r,placeholder:(0,b.__)("My view"),className:"patterns-create-modal__name-input"}),(0,oe.jsxs)(y.__experimentalHStack,{justify:"right",children:[(0,oe.jsx)(y.Button,{variant:"tertiary",__next40pxDefaultSize:!0,onClick:()=>{s(!1)},children:(0,b.__)("Cancel")}),(0,oe.jsx)(y.Button,{variant:"primary",type:"submit","aria-disabled":!i,__next40pxDefaultSize:!0,children:(0,b.__)("Save")})]})]})})}function bk({dataviewId:e,isActive:t}){const s=vk(),{dataview:n}=(0,l.useSelect)((t=>{const{getEditedEntityRecord:s}=t(_.store);return{dataview:s("postType","wp_dataviews",e)}}),[e]),{deleteEntityRecord:i}=(0,l.useDispatch)(_.store),r=(0,d.useMemo)((()=>JSON.parse(n.content).type),[n.content]),[o,a]=(0,d.useState)(!1);return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(sk,{title:n.title,type:r,isActive:t,isCustom:!0,customViewId:e,suffix:(0,oe.jsx)(y.DropdownMenu,{icon:ma,label:(0,b.__)("Actions"),className:"edit-site-sidebar-dataviews-dataview-item__dropdown-menu",toggleProps:{style:{color:"inherit"},size:"small"},children:({onClose:e})=>(0,oe.jsxs)(y.MenuGroup,{children:[(0,oe.jsx)(y.MenuItem,{onClick:()=>{a(!0),e()},children:(0,b.__)("Rename")}),(0,oe.jsx)(y.MenuItem,{onClick:async()=>{if(await i("postType","wp_dataviews",n.id,{force:!0}),t){const{params:{postType:e}}=s.getLocationWithParams();s.replace({postType:e})}e()},isDestructive:!0,children:(0,b.__)("Delete")})]})})}),o&&(0,oe.jsx)(y.Modal,{title:(0,b.__)("Rename"),onRequestClose:()=>{a(!1)},focusOnMount:"firstContentElement",size:"small",children:(0,oe.jsx)(yk,{dataviewId:e,setIsRenaming:a,currentTitle:n.title})})]})}function wk({type:e,activeView:t,isCustom:s}){const n=function(e){return(0,l.useSelect)((t=>{const{getEntityRecords:s}=t(_.store),n=s("taxonomy","wp_dataviews_type",{slug:e});if(!n||0===n.length)return xk;return s("postType","wp_dataviews",{wp_dataviews_type:n[0].id,orderby:"date",order:"asc"})||xk}))}(e);return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)("div",{className:"edit-site-sidebar-navigation-screen-dataviews__group-header",children:(0,oe.jsx)(y.__experimentalHeading,{level:2,children:(0,b.__)("Custom Views")})}),(0,oe.jsxs)(y.__experimentalItemGroup,{children:[n.map((e=>(0,oe.jsx)(bk,{dataviewId:e.id,isActive:s&&Number(t)===e.id},e.id))),(0,oe.jsx)(gk,{type:e})]})]})}const{useLocation:_k}=te(Ht.privateApis);function Sk(){const{params:{postType:e,activeView:t="all",isCustom:s="false"}}=_k(),n=D_({postType:e});if(!e)return null;const i="true"===s;return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(y.__experimentalItemGroup,{children:n.map((e=>(0,oe.jsx)(sk,{slug:e.slug,title:e.title,icon:e.icon,type:e.view.type,isActive:!i&&e.slug===t,isCustom:!1},e.slug)))}),window?.__experimentalCustomViews&&(0,oe.jsx)(wk,{activeView:t,type:e,isCustom:!0})]})}function jk({title:e,onClose:t}){return(0,oe.jsx)(y.__experimentalVStack,{className:"dataforms-layouts-panel__dropdown-header",spacing:4,children:(0,oe.jsxs)(y.__experimentalHStack,{alignment:"center",children:[(0,oe.jsx)(y.__experimentalHeading,{level:2,size:13,children:e}),(0,oe.jsx)(y.__experimentalSpacer,{}),t&&(0,oe.jsx)(y.Button,{label:(0,b.__)("Close"),icon:fm,onClick:t,size:"small"})]})})}function Ck({data:e,field:t,onChange:s}){const[n,i]=(0,d.useState)(null),r=(0,d.useMemo)((()=>({anchor:n,placement:"left-start",offset:36,shift:!0})),[n]);return(0,oe.jsxs)(y.__experimentalHStack,{ref:i,className:"dataforms-layouts-panel__field",children:[(0,oe.jsx)("div",{className:"dataforms-layouts-panel__field-label",children:t.label}),(0,oe.jsx)("div",{children:(0,oe.jsx)(y.Dropdown,{contentClassName:"dataforms-layouts-panel__field-dropdown",popoverProps:r,focusOnMount:!0,toggleProps:{size:"compact",variant:"tertiary",tooltipPosition:"middle left"},renderToggle:({isOpen:s,onToggle:n})=>(0,oe.jsx)(y.Button,{className:"dataforms-layouts-panel__field-control",size:"compact",variant:"tertiary","aria-expanded":s,"aria-label":(0,b.sprintf)((0,b._x)("Edit %s","field"),t.label),onClick:n,children:(0,oe.jsx)(t.render,{item:e})}),renderContent:({onClose:n})=>(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(jk,{title:t.label,onClose:n}),(0,oe.jsx)(t.Edit,{data:e,field:t,onChange:s,hideLabelFromVision:!0},t.id)]})})})]})}const kk=[{type:"regular",component:function({data:e,fields:t,form:s,onChange:n}){const i=(0,d.useMemo)((()=>{var e;return av((null!==(e=s.fields)&&void 0!==e?e:[]).map((e=>t.find((({id:t})=>t===e)))).filter((e=>!!e)))}),[t,s.fields]);return(0,oe.jsx)(y.__experimentalVStack,{spacing:4,children:i.map((t=>(0,oe.jsx)(t.Edit,{data:e,field:t,onChange:n},t.id)))})}},{type:"panel",component:function({data:e,fields:t,form:s,onChange:n}){const i=(0,d.useMemo)((()=>{var e;return av((null!==(e=s.fields)&&void 0!==e?e:[]).map((e=>t.find((({id:t})=>t===e)))).filter((e=>!!e)))}),[t,s.fields]);return(0,oe.jsx)(y.__experimentalVStack,{spacing:2,children:i.map((t=>(0,oe.jsx)(Ck,{data:e,field:t,onChange:n},t.id)))})}}];function Ek({form:e,...t}){var s;const n=(i=null!==(s=e.type)&&void 0!==s?s:"regular",kk.find((e=>e.type===i)));var i;return n?(0,oe.jsx)(n.component,{form:e,...t}):null}const{PostCardPanel:Pk}=te(h.privateApis);function Ik({postType:e,postId:t}){const s=(0,d.useMemo)((()=>t.split(",")),[t]),{record:n}=(0,l.useSelect)((t=>({record:1===s.length?t(_.store).getEditedEntityRecord("postType",e,s[0]):null})),[e,s]),[i,r]=(0,d.useState)({}),{editEntityRecord:o}=(0,l.useDispatch)(_.store),{fields:a}=J_(),c=(0,d.useMemo)((()=>a?.map((e=>"status"===e.id?{...e,elements:e.elements.filter((e=>"trash"!==e.value))}:e))),[a]);return(0,d.useEffect)((()=>{r({})}),[s]),(0,oe.jsxs)(y.__experimentalVStack,{spacing:4,children:[1===s.length&&(0,oe.jsx)(Pk,{postType:e,postId:s[0]}),(0,oe.jsx)(Ek,{data:1===s.length?n:i,fields:c,form:{type:"panel",fields:["title","status","date","author","comment_status"]},onChange:t=>{for(const i of s)"future"!==t.status&&"future"===n.status&&new Date(n.date)>new Date&&(t.date=null),"private"===t.status&&n.password&&(t.password=""),o("postType",e,i,t),s.length>1&&r((e=>({...e,...t})))}})]})}function Tk({postType:e,postId:t}){return(0,oe.jsxs)(T_,{className:Ut("edit-site-post-edit",{"is-empty":!t}),label:(0,b.__)("Post Edit"),children:[t&&(0,oe.jsx)(Ik,{postType:e,postId:t}),!t&&(0,oe.jsx)("p",{children:(0,b.__)("Select a page to edit")})]})}const{useLocation:Ok,useHistory:Ak}=te(Ht.privateApis);function Mk(){const{params:e}=Ok(),{postType:t,postId:s,path:n,layout:i,isCustom:r,canvas:o,quickEdit:a}=e,l="edit"===o;if(function(){const e=Ak(),{params:t}=Ok();(0,d.useEffect)((()=>{const{postType:s,path:n,categoryType:i,...r}=t;"/wp_template_part/all"===n&&e.replace({postType:Ce}),"/page"===n&&e.replace({postType:"page",...r}),"/wp_template"===n&&e.replace({postType:je,...r}),"/patterns"===n&&e.replace({postType:i===Ce?Ce:Ie.user,...r}),"/navigation"===n&&e.replace({postType:Se,...r})}),[e,t])}(),"page"===t){const e="list"===i||!i,n=a&&!e;return{key:"pages",areas:{sidebar:(0,oe.jsx)(pC,{title:(0,b.__)("Pages"),backPath:{},content:(0,oe.jsx)(Sk,{})}),content:(0,oe.jsx)(aS,{postType:t}),preview:!n&&(e||l)&&(0,oe.jsx)(Vg,{}),mobile:l?(0,oe.jsx)(Vg,{}):(0,oe.jsx)(aS,{postType:t}),edit:n&&(0,oe.jsx)(Tk,{postType:t,postId:s})},widths:{content:e?380:void 0,edit:n?380:void 0}}}if(t===je){const e="true"!==r&&"list"===i;return{key:"templates",areas:{sidebar:(0,oe.jsx)(ak,{backPath:{}}),content:(0,oe.jsx)(lC,{}),preview:(e||l)&&(0,oe.jsx)(Vg,{}),mobile:l?(0,oe.jsx)(Vg,{}):(0,oe.jsx)(lC,{})},widths:{content:e?380:void 0}}}return[Ce,Ie.user].includes(t)?{key:"patterns",areas:{sidebar:(0,oe.jsx)(hk,{backPath:{}}),content:(0,oe.jsx)(oj,{}),mobile:l?(0,oe.jsx)(Vg,{}):(0,oe.jsx)(oj,{}),preview:l&&(0,oe.jsx)(Vg,{})}}:"/wp_global_styles"===n?{key:"styles",areas:{sidebar:(0,oe.jsx)(_C,{backPath:{}}),preview:(0,oe.jsx)(Vg,{}),mobile:l&&(0,oe.jsx)(Vg,{})}}:t===Se?s?{key:"navigation",areas:{sidebar:(0,oe.jsx)(UC,{backPath:{postType:Se}}),preview:(0,oe.jsx)(Vg,{}),mobile:l&&(0,oe.jsx)(Vg,{})}}:{key:"navigation",areas:{sidebar:(0,oe.jsx)(QC,{backPath:{}}),preview:(0,oe.jsx)(Vg,{}),mobile:l&&(0,oe.jsx)(Vg,{})}}:{key:"default",areas:{sidebar:(0,oe.jsx)(jC,{}),preview:(0,oe.jsx)(Vg,{}),mobile:l&&(0,oe.jsx)(Vg,{})}}}const{useCommandContext:Nk}=te(Wt.privateApis);const{RouterProvider:Vk}=te(Ht.privateApis),{GlobalStylesProvider:Fk}=te(h.privateApis);function Rk(){Wo(),(0,Wt.useCommandLoader)({name:"core/edit-site/page-content-focus",hook:zo,context:"entity-edit"}),(0,Wt.useCommandLoader)({name:"core/edit-site/manipulate-document",hook:Lo}),function(){const e=(0,l.useSelect)((e=>e(_.store).getEntityRecord("root","__unstableBase")?.home),[]);(0,Wt.useCommand)({name:"core/edit-site/view-site",label:(0,b.__)("View site"),callback:({close:t})=>{t(),window.open(e,"_blank")},icon:jo}),(0,Wt.useCommandLoader)({name:"core/edit-site/open-styles",hook:Po}),(0,Wt.useCommandLoader)({name:"core/edit-site/toggle-styles-welcome-guide",hook:Io}),(0,Wt.useCommandLoader)({name:"core/edit-site/reset-global-styles",hook:To}),(0,Wt.useCommandLoader)({name:"core/edit-site/open-styles-css",hook:Oo}),(0,Wt.useCommandLoader)({name:"core/edit-site/open-styles-revisions",hook:Ao})}(),function(){const{hasBlockSelected:e,canvasMode:t}=(0,l.useSelect)((e=>{const{getCanvasMode:t}=te(e(zt)),{getBlockSelectionStart:s}=e(x.store);return{canvasMode:t(),hasBlockSelected:s()}}),[]);let s="site-editor";"edit"===t&&(s="entity-edit"),e&&(s="block-selection-edit"),xm()&&(s=""),Nk(s)}();const e=Mk();return(0,oe.jsx)(vo,{route:e})}function Bk(){const{createErrorNotice:e}=(0,l.useDispatch)(w.store);return(0,oe.jsx)(y.SlotFillProvider,{children:(0,oe.jsxs)(Fk,{children:[(0,oe.jsx)(h.UnsavedChangesWarning,{}),(0,oe.jsxs)(Vk,{children:[(0,oe.jsx)(Rk,{}),(0,oe.jsx)(Lt.PluginArea,{onError:function(t){e((0,b.sprintf)((0,b.__)('The "%s" plugin has encountered an error and cannot be rendered.'),t))}})]})]})})}const Dk=(0,es.getPath)(window.location.href)?.includes("site-editor.php"),zk=e=>{u()(`wp.editPost.${e}`,{since:"6.6",alternative:`wp.editor.${e}`})};function Lk(e){return Dk?(zk("PluginMoreMenuItem"),(0,oe.jsx)(h.PluginMoreMenuItem,{...e})):null}function Hk(e){return Dk?(zk("PluginSidebar"),(0,oe.jsx)(h.PluginSidebar,{...e})):null}function Gk(e){return Dk?(zk("PluginSidebarMoreMenuItem"),(0,oe.jsx)(h.PluginSidebarMoreMenuItem,{...e})):null}const{useLocation:Uk}=te(Ht.privateApis);const{RouterProvider:Wk}=te(Ht.privateApis),{GlobalStylesProvider:qk}=te(h.privateApis);function Zk(e,t){}const{registerCoreBlockBindingsSources:Kk}=te(h.privateApis);function Yk(e,t){const s=document.getElementById(e),n=(0,d.createRoot)(s);(0,l.dispatch)(o.store).reapplyBlockTypeFilters();const i=(0,a.__experimentalGetCoreBlocks)().filter((({name:e})=>"core/freeform"!==e));return(0,a.registerCoreBlocks)(i),Kk(),(0,l.dispatch)(o.store).setFreeformFallbackBlockName("core/html"),(0,m.registerLegacyWidgetBlock)({inserter:!1}),(0,m.registerWidgetGroupBlock)({inserter:!1}),(0,l.dispatch)(f.store).setDefaults("core/edit-site",{welcomeGuide:!0,welcomeGuideStyles:!0,welcomeGuidePage:!0,welcomeGuideTemplate:!0}),(0,l.dispatch)(f.store).setDefaults("core",{allowRightClickOverrides:!0,distractionFree:!1,editorMode:"visual",fixedToolbar:!1,focusMode:!1,inactivePanels:[],keepCaretInsideBlock:!1,openPanels:["post-status"],showBlockBreadcrumbs:!0,showListViewByDefault:!1,enableChoosePatternModal:!0}),window.__experimentalMediaProcessing&&(0,l.dispatch)(f.store).setDefaults("core/media",{requireApproval:!0,optimizeOnUpload:!0}),(0,l.dispatch)(zt).updateSettings(t),(0,l.dispatch)(h.store).updateEditorSettings({defaultTemplateTypes:t.defaultTemplateTypes,defaultTemplatePartAreas:t.defaultTemplatePartAreas}),window.addEventListener("dragover",(e=>e.preventDefault()),!1),window.addEventListener("drop",(e=>e.preventDefault()),!1),n.render((0,oe.jsx)(d.StrictMode,{children:(0,oe.jsx)(Bk,{})})),n}function Xk(){u()("wp.editSite.reinitializeEditor",{since:"6.2",version:"6.3"})}})(),(window.wp=window.wp||{}).editSite=r})(); \ No newline at end of file + */var s=n(1609);var i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r=s.useState,o=s.useEffect,a=s.useLayoutEffect,l=s.useDebugValue;function c(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch(e){return!0}}var u="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),s=r({inst:{value:n,getSnapshot:t}}),i=s[0].inst,u=s[1];return a((function(){i.value=n,i.getSnapshot=t,c(i)&&u({inst:i})}),[e,n,t]),o((function(){return c(i)&&u({inst:i}),e((function(){c(i)&&u({inst:i})}))}),[e]),l(n),n};t.useSyncExternalStore=void 0!==s.useSyncExternalStore?s.useSyncExternalStore:u},422:(e,t,n)=>{"use strict";e.exports=n(83)},1609:e=>{"use strict";e.exports=window.React}},s={};function i(e){var t=s[e];if(void 0!==t)return t.exports;var r=s[e]={exports:{}};return n[e](r,r.exports,i),r.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,i.t=function(n,s){if(1&s&&(n=this(n)),8&s)return n;if("object"==typeof n&&n){if(4&s&&n.__esModule)return n;if(16&s&&"function"==typeof n.then)return n}var r=Object.create(null);i.r(r);var o={};e=e||[null,t({}),t([]),t(t)];for(var a=2&s&&n;"object"==typeof a&&!~e.indexOf(a);a=t(a))Object.getOwnPropertyNames(a).forEach((e=>o[e]=()=>n[e]));return o.default=()=>n,i.d(r,o),r},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};(()=>{"use strict";i.r(r),i.d(r,{PluginMoreMenuItem:()=>LE,PluginSidebar:()=>zE,PluginSidebarMoreMenuItem:()=>GE,PluginTemplateSettingPanel:()=>Ra,initializeEditor:()=>YE,initializePostsDashboard:()=>ZE,reinitializeEditor:()=>XE,store:()=>zt});var e={};i.r(e),i.d(e,{__experimentalSetPreviewDeviceType:()=>He,addTemplate:()=>We,closeGeneralSidebar:()=>lt,openGeneralSidebar:()=>at,openNavigationPanelToMenu:()=>et,removeTemplate:()=>qe,revertTemplate:()=>ot,setEditedEntity:()=>Ye,setEditedPostContext:()=>Je,setHasPageContentFocus:()=>ut,setHomeTemplateId:()=>Xe,setIsInserterOpened:()=>nt,setIsListViewOpened:()=>st,setIsNavigationPanelOpened:()=>tt,setIsSaveViewOpened:()=>rt,setNavigationMenu:()=>Ke,setNavigationPanelActiveMenu:()=>$e,setPage:()=>Qe,setTemplate:()=>Ue,setTemplatePart:()=>Ze,switchEditorMode:()=>ct,toggleDistractionFree:()=>dt,toggleFeature:()=>Ge,updateSettings:()=>it});var t={};i.r(t),i.d(t,{registerRoute:()=>pt,setEditorCanvasContainerView:()=>ht,unregisterRoute:()=>ft});var n={};i.r(n),i.d(n,{__experimentalGetInsertionPoint:()=>Et,__experimentalGetPreviewDeviceType:()=>vt,getCanUserCreateMedia:()=>xt,getCurrentTemplateNavigationPanelSubMenu:()=>Nt,getCurrentTemplateTemplateParts:()=>Ot,getEditedPostContext:()=>St,getEditedPostId:()=>jt,getEditedPostType:()=>_t,getEditorMode:()=>At,getHomeTemplateId:()=>wt,getNavigationPanelActiveMenu:()=>Mt,getPage:()=>Ct,getReusableBlocks:()=>yt,getSettings:()=>bt,hasPageContentFocus:()=>Rt,isFeatureActive:()=>gt,isInserterOpened:()=>kt,isListViewOpened:()=>Pt,isNavigationOpened:()=>Ft,isPage:()=>Vt,isSaveViewOpened:()=>It});var s={};i.r(s),i.d(s,{getEditorCanvasContainerView:()=>Bt,getRoutes:()=>Dt});const o=window.wp.blocks,a=window.wp.blockLibrary,l=window.wp.data,c=window.wp.deprecated;var u=i.n(c);const d=window.wp.element,h=window.wp.editor,f=window.wp.preferences,m=window.wp.widgets,g=window.wp.hooks,v=window.wp.compose,x=window.wp.blockEditor,y=window.wp.components,b=window.wp.i18n,w=window.wp.notices,_=window.wp.coreData;var j={grad:.9,turn:360,rad:360/(2*Math.PI)},S=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},C=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},k=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},E=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},P=function(e){return{r:k(e.r,0,255),g:k(e.g,0,255),b:k(e.b,0,255),a:k(e.a)}},I=function(e){return{r:C(e.r),g:C(e.g),b:C(e.b),a:C(e.a,3)}},T=/^#([0-9a-f]{3,8})$/i,O=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},A=function(e){var t=e.r,n=e.g,s=e.b,i=e.a,r=Math.max(t,n,s),o=r-Math.min(t,n,s),a=o?r===t?(n-s)/o:r===n?2+(s-t)/o:4+(t-n)/o:0;return{h:60*(a<0?a+6:a),s:r?o/r*100:0,v:r/255*100,a:i}},N=function(e){var t=e.h,n=e.s,s=e.v,i=e.a;t=t/360*6,n/=100,s/=100;var r=Math.floor(t),o=s*(1-n),a=s*(1-(t-r)*n),l=s*(1-(1-t+r)*n),c=r%6;return{r:255*[s,a,o,o,l,s][c],g:255*[l,s,s,a,o,o][c],b:255*[o,o,l,s,s,a][c],a:i}},M=function(e){return{h:E(e.h),s:k(e.s,0,100),l:k(e.l,0,100),a:k(e.a)}},F=function(e){return{h:C(e.h),s:C(e.s),l:C(e.l),a:C(e.a,3)}},V=function(e){return N((n=(t=e).s,{h:t.h,s:(n*=((s=t.l)<50?s:100-s)/100)>0?2*n/(s+n)*100:0,v:s+n,a:t.a}));var t,n,s},R=function(e){return{h:(t=A(e)).h,s:(i=(200-(n=t.s))*(s=t.v)/100)>0&&i<200?n*s/100/(i<=100?i:200-i)*100:0,l:i/2,a:t.a};var t,n,s,i},B=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,D=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,L=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,z=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,G={string:[[function(e){var t=T.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:4===e.length?C(parseInt(e[3]+e[3],16)/255,2):1}:6===e.length||8===e.length?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:8===e.length?C(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=L.exec(e)||z.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:P({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=B.exec(e)||D.exec(e);if(!t)return null;var n,s,i=M({h:(n=t[1],s=t[2],void 0===s&&(s="deg"),Number(n)*(j[s]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return V(i)},"hsl"]],object:[[function(e){var t=e.r,n=e.g,s=e.b,i=e.a,r=void 0===i?1:i;return S(t)&&S(n)&&S(s)?P({r:Number(t),g:Number(n),b:Number(s),a:Number(r)}):null},"rgb"],[function(e){var t=e.h,n=e.s,s=e.l,i=e.a,r=void 0===i?1:i;if(!S(t)||!S(n)||!S(s))return null;var o=M({h:Number(t),s:Number(n),l:Number(s),a:Number(r)});return V(o)},"hsl"],[function(e){var t=e.h,n=e.s,s=e.v,i=e.a,r=void 0===i?1:i;if(!S(t)||!S(n)||!S(s))return null;var o=function(e){return{h:E(e.h),s:k(e.s,0,100),v:k(e.v,0,100),a:k(e.a)}}({h:Number(t),s:Number(n),v:Number(s),a:Number(r)});return N(o)},"hsv"]]},H=function(e,t){for(var n=0;n=.5},e.prototype.toHex=function(){return t=(e=I(this.rgba)).r,n=e.g,s=e.b,r=(i=e.a)<1?O(C(255*i)):"","#"+O(t)+O(n)+O(s)+r;var e,t,n,s,i,r},e.prototype.toRgb=function(){return I(this.rgba)},e.prototype.toRgbString=function(){return t=(e=I(this.rgba)).r,n=e.g,s=e.b,(i=e.a)<1?"rgba("+t+", "+n+", "+s+", "+i+")":"rgb("+t+", "+n+", "+s+")";var e,t,n,s,i},e.prototype.toHsl=function(){return F(R(this.rgba))},e.prototype.toHslString=function(){return t=(e=F(R(this.rgba))).h,n=e.s,s=e.l,(i=e.a)<1?"hsla("+t+", "+n+"%, "+s+"%, "+i+")":"hsl("+t+", "+n+"%, "+s+"%)";var e,t,n,s,i},e.prototype.toHsv=function(){return e=A(this.rgba),{h:C(e.h),s:C(e.s),v:C(e.v),a:C(e.a,3)};var e},e.prototype.invert=function(){return Y({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},e.prototype.saturate=function(e){return void 0===e&&(e=.1),Y(W(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),Y(W(this.rgba,-e))},e.prototype.grayscale=function(){return Y(W(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),Y(Z(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),Y(Z(this.rgba,-e))},e.prototype.rotate=function(e){return void 0===e&&(e=15),this.hue(this.hue()+e)},e.prototype.alpha=function(e){return"number"==typeof e?Y({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):C(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=R(this.rgba);return"number"==typeof e?Y({h:e,s:t.s,l:t.l,a:t.a}):C(t.h)},e.prototype.isEqual=function(e){return this.toHex()===Y(e).toHex()},e}(),Y=function(e){return e instanceof K?e:new K(e)},X=[],J=function(e){var t=e/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},Q=function(e){return.2126*J(e.r)+.7152*J(e.g)+.0722*J(e.b)};const $=window.wp.privateApis,{lock:ee,unlock:te}=(0,$.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/edit-site"),{useGlobalSetting:ne,useGlobalStyle:se}=te(x.privateApis);function ie(){const[e="black"]=se("color.text"),[t="white"]=se("color.background"),[n=e]=se("elements.h1.color.text"),[s=n]=se("elements.link.color.text"),[i=s]=se("elements.button.color.background"),[r]=ne("color.palette.core"),[o]=ne("color.palette.theme"),[a]=ne("color.palette.custom"),l=(null!=o?o:[]).concat(null!=a?a:[]).concat(null!=r?r:[]),c=l.filter((({color:t})=>t===e)),u=l.filter((({color:e})=>e===i)),d=c.concat(u).concat(l).filter((({color:e})=>e!==t)).slice(0,2);return{paletteColors:l,highlightedColors:d}}function re(e,t,n){return e&&"object"==typeof e?(t.reduce(((e,s,i)=>(void 0===e[s]&&(Number.isInteger(t[i+1])?e[s]=[]:e[s]={}),i===t.length-1&&(e[s]=n),e[s])),e),e):e}!function(e){e.forEach((function(e){X.indexOf(e)<0&&(e(K,G),X.push(e))}))}([function(e){e.prototype.luminance=function(){return e=Q(this.rgba),void 0===(t=2)&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0;var e,t,n},e.prototype.contrast=function(t){void 0===t&&(t="#FFF");var n,s,i,r,o,a,l,c=t instanceof e?t:new e(t);return r=this.rgba,o=c.toRgb(),n=(a=Q(r))>(l=Q(o))?(a+.05)/(l+.05):(l+.05)/(a+.05),void 0===(s=2)&&(s=0),void 0===i&&(i=Math.pow(10,s)),Math.floor(i*n)/i+0},e.prototype.isReadable=function(e,t){return void 0===e&&(e="#FFF"),void 0===t&&(t={}),this.contrast(e)>=(o=void 0===(r=(n=t).size)?"normal":r,"AAA"===(i=void 0===(s=n.level)?"AA":s)&&"normal"===o?7:"AA"===i&&"large"===o?3:4.5);var n,s,i,r,o}}]);const oe=window.ReactJSXRuntime,{cleanEmptyObject:ae,GlobalStylesContext:le}=te(x.privateApis),ce={...o.__EXPERIMENTAL_STYLE_PROPERTY,blockGap:{value:["spacing","blockGap"]}},ue={"border.color":"color","color.background":"color","color.text":"color","elements.link.color.text":"color","elements.link.:hover.color.text":"color","elements.link.typography.fontFamily":"font-family","elements.link.typography.fontSize":"font-size","elements.button.color.text":"color","elements.button.color.background":"color","elements.button.typography.fontFamily":"font-family","elements.button.typography.fontSize":"font-size","elements.caption.color.text":"color","elements.heading.color":"color","elements.heading.color.background":"color","elements.heading.typography.fontFamily":"font-family","elements.heading.gradient":"gradient","elements.heading.color.gradient":"gradient","elements.h1.color":"color","elements.h1.color.background":"color","elements.h1.typography.fontFamily":"font-family","elements.h1.color.gradient":"gradient","elements.h2.color":"color","elements.h2.color.background":"color","elements.h2.typography.fontFamily":"font-family","elements.h2.color.gradient":"gradient","elements.h3.color":"color","elements.h3.color.background":"color","elements.h3.typography.fontFamily":"font-family","elements.h3.color.gradient":"gradient","elements.h4.color":"color","elements.h4.color.background":"color","elements.h4.typography.fontFamily":"font-family","elements.h4.color.gradient":"gradient","elements.h5.color":"color","elements.h5.color.background":"color","elements.h5.typography.fontFamily":"font-family","elements.h5.color.gradient":"gradient","elements.h6.color":"color","elements.h6.color.background":"color","elements.h6.typography.fontFamily":"font-family","elements.h6.color.gradient":"gradient","color.gradient":"gradient",blockGap:"spacing","typography.fontSize":"font-size","typography.fontFamily":"font-family"},de={"border.color":"borderColor","color.background":"backgroundColor","color.text":"textColor","color.gradient":"gradient","typography.fontSize":"fontSize","typography.fontFamily":"fontFamily"},he=["border","color","spacing","typography"],pe=(e,t)=>{let n=e;return t.forEach((e=>{n=n?.[e]})),n},fe=["borderColor","borderWidth","borderStyle"],me=["top","right","bottom","left"];function ge(e,t,n){if(!t?.[e]||n?.[e]?.style)return[];const{color:s,style:i,width:r}=t[e];return!(s||r)||i?[]:[{path:["border",e,"style"],value:"solid"}]}function ve(e,t,n){const s=function(e,t){const{supportedPanels:n}=(0,l.useSelect)((n=>({supportedPanels:te(n(o.store)).getSupportedStyles(e,t)})),[e,t]);return n}(e),i=n?.styles?.blocks?.[e];return(0,d.useMemo)((()=>{const e=s.flatMap((e=>{if(!ce[e])return[];const{value:n}=ce[e],s=n.join("."),i=t[de[s]],r=i?`var:preset|${ue[s]}|${i}`:pe(t.style,n);if("linkColor"===e){const e=r?[{path:n,value:r}]:[],s=["elements","link",":hover","color","text"],i=pe(t.style,s);return i&&e.push({path:s,value:i}),e}if(fe.includes(e)&&r){const e=[{path:n,value:r}];return me.forEach((t=>{const s=[...n];s.splice(-1,0,t),e.push({path:s,value:r})})),e}return r?[{path:n,value:r}]:[]}));return function(e,t,n){if(!e&&!t)return[];const s=[...ge("top",e,n),...ge("right",e,n),...ge("bottom",e,n),...ge("left",e,n)],{color:i,style:r,width:o}=e||{};return(t||i||o)&&!r&&me.forEach((e=>{n?.[e]?.style||s.push({path:["border",e,"style"],value:"solid"})})),s}(t.style?.border,t.borderColor,i?.border).forEach((t=>e.push(t))),e}),[s,t,i])}function xe({name:e,attributes:t,setAttributes:n}){const{user:s,setUserConfig:i}=(0,d.useContext)(le),r=ve(e,t,s),{__unstableMarkNextChangeAsNotPersistent:a}=(0,l.useDispatch)(x.store),{createSuccessNotice:c}=(0,l.useDispatch)(w.store),u=(0,d.useCallback)((()=>{if(0!==r.length&&r.length>0){const{style:l}=t,u=structuredClone(l),d=structuredClone(s);for(const{path:t,value:n}of r)re(u,t,void 0),re(d,["styles","blocks",e,...t],n);const h={borderColor:void 0,backgroundColor:void 0,textColor:void 0,gradient:void 0,fontSize:void 0,fontFamily:void 0,style:ae(u)};a(),n(h),i(d,{undoIgnore:!0}),c((0,b.sprintf)((0,b.__)("%s styles applied."),(0,o.getBlockType)(e).title),{type:"snackbar",actions:[{label:(0,b.__)("Undo"),onClick(){a(),n(t),i(s,{undoIgnore:!0})}}]})}}),[a,t,r,c,e,n,i,s]);return(0,oe.jsxs)(y.BaseControl,{__nextHasNoMarginBottom:!0,className:"edit-site-push-changes-to-global-styles-control",help:(0,b.sprintf)((0,b.__)("Apply this block’s typography, spacing, dimensions, and color styles to all %s blocks."),(0,o.getBlockType)(e).title),children:[(0,oe.jsx)(y.BaseControl.VisualLabel,{children:(0,b.__)("Styles")}),(0,oe.jsx)(y.Button,{__next40pxDefaultSize:!0,variant:"secondary",accessibleWhenDisabled:!0,disabled:0===r.length,onClick:u,children:(0,b.__)("Apply globally")})]})}function ye(e){const t=(0,x.useBlockEditingMode)(),n=(0,l.useSelect)((e=>e(_.store).getCurrentTheme()?.is_block_theme),[]),s=he.some((t=>(0,o.hasBlockSupport)(e.name,t)));return"default"===t&&s&&n?(0,oe.jsx)(x.InspectorAdvancedControls,{children:(0,oe.jsx)(xe,{...e})}):null}const be=(0,v.createHigherOrderComponent)((e=>t=>(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(e,{...t},"edit"),t.isSelected&&(0,oe.jsx)(ye,{...t})]})));(0,g.addFilter)("editor.BlockEdit","core/edit-site/push-changes-to-global-styles",be);const we=(0,l.combineReducers)({settings:function(e={},t){return"UPDATE_SETTINGS"===t.type?{...e,...t.settings}:e},editedPost:function(e={},t){switch(t.type){case"SET_EDITED_POST":return{postType:t.postType,id:t.id,context:t.context};case"SET_EDITED_POST_CONTEXT":return{...e,context:t.context}}return e},saveViewPanel:function(e=!1,t){return"SET_IS_SAVE_VIEW_OPENED"===t.type?t.isOpen:e},editorCanvasContainerView:function(e=void 0,t){return"SET_EDITOR_CANVAS_CONTAINER_VIEW"===t.type?t.view:e},routes:function(e=[],t){switch(t.type){case"REGISTER_ROUTE":return[...e,t.route];case"UNREGISTER_ROUTE":return e.filter((e=>e.name!==t.name))}return e}}),_e=window.wp.patterns,je="wp_navigation",Se="wp_template",Ce="wp_template_part",ke="custom",Ee="uncategorized",Pe="all-parts",{PATTERN_TYPES:Ie,PATTERN_DEFAULT_CATEGORY:Te,PATTERN_USER_CATEGORY:Oe,EXCLUDED_PATTERN_SOURCES:Ae,PATTERN_SYNC_TYPES:Ne}=te(_e.privateApis),Me=[Ce,je,Ie.user],Fe={[Se]:(0,b.__)("Template"),[Ce]:(0,b.__)("Template part"),[Ie.user]:(0,b.__)("Pattern"),[je]:(0,b.__)("Navigation")},Ve="grid",Re="table",Be="list",De="isAny",Le="isNone",{interfaceStore:ze}=te(h.privateApis);function Ge(e){return function({registry:t}){u()("dispatch( 'core/edit-site' ).toggleFeature( featureName )",{since:"6.0",alternative:"dispatch( 'core/preferences').toggle( 'core/edit-site', featureName )"}),t.dispatch(f.store).toggle("core/edit-site",e)}}const He=e=>({registry:t})=>{u()("dispatch( 'core/edit-site' ).__experimentalSetPreviewDeviceType",{since:"6.5",version:"6.7",hint:"registry.dispatch( editorStore ).setDeviceType"}),t.dispatch(h.store).setDeviceType(e)};function Ue(){return u()("dispatch( 'core/edit-site' ).setTemplate",{since:"6.5",version:"6.8",hint:"The setTemplate is not needed anymore, the correct entity is resolved from the URL automatically."}),{type:"NOTHING"}}const We=e=>async({dispatch:t,registry:n})=>{u()("dispatch( 'core/edit-site' ).addTemplate",{since:"6.5",version:"6.8",hint:"use saveEntityRecord directly"});const s=await n.dispatch(_.store).saveEntityRecord("postType",Se,e);e.content&&n.dispatch(_.store).editEntityRecord("postType",Se,s.id,{blocks:(0,o.parse)(e.content)},{undoIgnore:!0}),t({type:"SET_EDITED_POST",postType:Se,id:s.id})},qe=e=>({registry:t})=>te(t.dispatch(h.store)).removeTemplates([e]);function Ze(e){return u()("dispatch( 'core/edit-site' ).setTemplatePart",{since:"6.8"}),{type:"SET_EDITED_POST",postType:Ce,id:e}}function Ke(e){return u()("dispatch( 'core/edit-site' ).setNavigationMenu",{since:"6.8"}),{type:"SET_EDITED_POST",postType:je,id:e}}function Ye(e,t,n){return{type:"SET_EDITED_POST",postType:e,id:t,context:n}}function Xe(){return u()("dispatch( 'core/edit-site' ).setHomeTemplateId",{since:"6.2",version:"6.4"}),{type:"NOTHING"}}function Je(e){return u()("dispatch( 'core/edit-site' ).setEditedPostContext",{since:"6.8"}),{type:"SET_EDITED_POST_CONTEXT",context:e}}function Qe(){return u()("dispatch( 'core/edit-site' ).setPage",{since:"6.5",version:"6.8",hint:"The setPage is not needed anymore, the correct entity is resolved from the URL automatically."}),{type:"NOTHING"}}function $e(){return u()("dispatch( 'core/edit-site' ).setNavigationPanelActiveMenu",{since:"6.2",version:"6.4"}),{type:"NOTHING"}}function et(){return u()("dispatch( 'core/edit-site' ).openNavigationPanelToMenu",{since:"6.2",version:"6.4"}),{type:"NOTHING"}}function tt(){return u()("dispatch( 'core/edit-site' ).setIsNavigationPanelOpened",{since:"6.2",version:"6.4"}),{type:"NOTHING"}}const nt=e=>({registry:t})=>{u()("dispatch( 'core/edit-site' ).setIsInserterOpened",{since:"6.5",alternative:"dispatch( 'core/editor').setIsInserterOpened"}),t.dispatch(h.store).setIsInserterOpened(e)},st=e=>({registry:t})=>{u()("dispatch( 'core/edit-site' ).setIsListViewOpened",{since:"6.5",alternative:"dispatch( 'core/editor').setIsListViewOpened"}),t.dispatch(h.store).setIsListViewOpened(e)};function it(e){return{type:"UPDATE_SETTINGS",settings:e}}function rt(e){return{type:"SET_IS_SAVE_VIEW_OPENED",isOpen:e}}const ot=(e,t)=>({registry:n})=>te(n.dispatch(h.store)).revertTemplate(e,t),at=e=>({registry:t})=>{t.dispatch(ze).enableComplementaryArea("core",e)},lt=()=>({registry:e})=>{e.dispatch(ze).disableComplementaryArea("core")},ct=e=>({registry:t})=>{u()("dispatch( 'core/edit-site' ).switchEditorMode",{since:"6.6",alternative:"dispatch( 'core/editor').switchEditorMode"}),t.dispatch(h.store).switchEditorMode(e)},ut=e=>({dispatch:t,registry:n})=>{u()("dispatch( 'core/edit-site' ).setHasPageContentFocus",{since:"6.5"}),e&&n.dispatch(x.store).clearSelectedBlock(),t({type:"SET_HAS_PAGE_CONTENT_FOCUS",hasPageContentFocus:e})},dt=()=>({registry:e})=>{u()("dispatch( 'core/edit-site' ).toggleDistractionFree",{since:"6.6",alternative:"dispatch( 'core/editor').toggleDistractionFree"}),e.dispatch(h.store).toggleDistractionFree()},ht=e=>({dispatch:t})=>{t({type:"SET_EDITOR_CANVAS_CONTAINER_VIEW",view:e})};function pt(e){return{type:"REGISTER_ROUTE",route:e}}function ft(e){return{type:"UNREGISTER_ROUTE",name:e}}const mt=[];const gt=(0,l.createRegistrySelector)((e=>(t,n)=>(u()("select( 'core/edit-site' ).isFeatureActive",{since:"6.0",alternative:"select( 'core/preferences' ).get"}),!!e(f.store).get("core/edit-site",n)))),vt=(0,l.createRegistrySelector)((e=>()=>(u()("select( 'core/edit-site' ).__experimentalGetPreviewDeviceType",{since:"6.5",version:"6.7",alternative:"select( 'core/editor' ).getDeviceType"}),e(h.store).getDeviceType()))),xt=(0,l.createRegistrySelector)((e=>()=>(u()("wp.data.select( 'core/edit-site' ).getCanUserCreateMedia()",{since:"6.7",alternative:"wp.data.select( 'core' ).canUser( 'create', { kind: 'root', type: 'media' } )"}),e(_.store).canUser("create","media")))),yt=(0,l.createRegistrySelector)((e=>()=>{u()("select( 'core/edit-site' ).getReusableBlocks()",{since:"6.5",version:"6.8",alternative:"select( 'core/core' ).getEntityRecords( 'postType', 'wp_block' )"});return"web"===d.Platform.OS?e(_.store).getEntityRecords("postType","wp_block",{per_page:-1}):[]}));function bt(e){return e.settings}function wt(){u()("select( 'core/edit-site' ).getHomeTemplateId",{since:"6.2",version:"6.4"})}function _t(e){return u()("select( 'core/edit-site' ).getEditedPostType",{since:"6.8",alternative:"select( 'core/editor' ).getCurrentPostType"}),e.editedPost.postType}function jt(e){return u()("select( 'core/edit-site' ).getEditedPostId",{since:"6.8",alternative:"select( 'core/editor' ).getCurrentPostId"}),e.editedPost.id}function St(e){return u()("select( 'core/edit-site' ).getEditedPostContext",{since:"6.8"}),e.editedPost.context}function Ct(e){return u()("select( 'core/edit-site' ).getPage",{since:"6.8"}),{context:e.editedPost.context}}const kt=(0,l.createRegistrySelector)((e=>()=>(u()("select( 'core/edit-site' ).isInserterOpened",{since:"6.5",alternative:"select( 'core/editor' ).isInserterOpened"}),e(h.store).isInserterOpened()))),Et=(0,l.createRegistrySelector)((e=>()=>(u()("select( 'core/edit-site' ).__experimentalGetInsertionPoint",{since:"6.5",version:"6.7"}),te(e(h.store)).getInserter()))),Pt=(0,l.createRegistrySelector)((e=>()=>(u()("select( 'core/edit-site' ).isListViewOpened",{since:"6.5",alternative:"select( 'core/editor' ).isListViewOpened"}),e(h.store).isListViewOpened())));function It(e){return e.saveViewPanel}function Tt(e){const t=e(_.store).getEntityRecords("postType",Ce,{per_page:-1}),{getBlocksByName:n,getBlocksByClientId:s}=e(x.store);return[s(n("core/template-part")),t]}const Ot=(0,l.createRegistrySelector)((e=>(0,l.createSelector)((()=>(u()("select( 'core/edit-site' ).getCurrentTemplateTemplateParts()",{since:"6.7",version:"6.9",alternative:"select( 'core/block-editor' ).getBlocksByName( 'core/template-part' )"}),function(e=mt,t){const n=t?t.reduce(((e,t)=>({...e,[t.id]:t})),{}):{},s=[],i=[...e];for(;i.length;){const{innerBlocks:e,...t}=i.shift();if(i.unshift(...e),(0,o.isTemplatePart)(t)){const{attributes:{theme:e,slug:i}}=t,r=n[`${e}//${i}`];r&&s.push({templatePart:r,block:t})}}return s}(...Tt(e)))),(()=>Tt(e))))),At=(0,l.createRegistrySelector)((e=>()=>e(f.store).get("core","editorMode")));function Nt(){u()("dispatch( 'core/edit-site' ).getCurrentTemplateNavigationPanelSubMenu",{since:"6.2",version:"6.4"})}function Mt(){u()("dispatch( 'core/edit-site' ).getNavigationPanelActiveMenu",{since:"6.2",version:"6.4"})}function Ft(){u()("dispatch( 'core/edit-site' ).isNavigationOpened",{since:"6.2",version:"6.4"})}function Vt(e){return u()("select( 'core/edit-site' ).isPage",{since:"6.8",alternative:"select( 'core/editor' ).getCurrentPostType"}),!!e.editedPost.context?.postId}function Rt(){return u()("select( 'core/edit-site' ).hasPageContentFocus",{since:"6.5"}),!1}function Bt(e){return e.editorCanvasContainerView}function Dt(e){return e.routes}const Lt={reducer:we,actions:e,selectors:n},zt=(0,l.createReduxStore)("core/edit-site",Lt);(0,l.register)(zt),te(zt).registerPrivateSelectors(s),te(zt).registerPrivateActions(t);const Gt=window.wp.router;function Ht(e){var t,n,s="";if("string"==typeof e||"number"==typeof e)s+=e;else if("object"==typeof e)if(Array.isArray(e)){var i=e.length;for(t=0;t{const{getEntityRecord:t}=e(_.store),n=t("root","__unstableBase",void 0);return{isRequestingSite:!n,siteIconUrl:n?.site_icon_url}}),[]);if(t&&!n)return(0,oe.jsx)("div",{className:"edit-site-site-icon__image"});const s=n?(0,oe.jsx)("img",{className:"edit-site-site-icon__image",alt:(0,b.__)("Site Icon"),src:n}):(0,oe.jsx)(y.Icon,{className:"edit-site-site-icon__icon",icon:$t,size:48});return(0,oe.jsx)("div",{className:Ut(e,"edit-site-site-icon"),children:s})},tn=window.wp.dom,nn=(0,d.createContext)((()=>{}));function sn(){let e={direction:null,focusSelector:null};return{get:()=>e,navigate(t,n=null){e={direction:t,focusSelector:"forward"===t&&n?n:e.focusSelector}}}}function rn({children:e,shouldAnimate:t}){const n=(0,d.useContext)(nn),s=(0,d.useRef)(),[i,r]=(0,d.useState)(null);(0,d.useLayoutEffect)((()=>{const{direction:e,focusSelector:t}=n.get();!function(e,t,n){let s;if("back"===t&&n&&(s=e.querySelector(n)),null!==t&&!s){const[t]=tn.focus.tabbable.find(e);s=null!=t?t:e}s?.focus()}(s.current,e,t),r(e)}),[n]);const o=Ut("edit-site-sidebar__screen-wrapper",t?{"slide-from-left":"back"===i,"slide-from-right":"forward"===i}:{});return(0,oe.jsx)("div",{ref:s,className:o,children:e})}function on({routeKey:e,shouldAnimate:t,children:n}){const[s]=(0,d.useState)(sn);return(0,oe.jsx)(nn.Provider,{value:s,children:(0,oe.jsx)("div",{className:"edit-site-sidebar__content",children:(0,oe.jsx)(rn,{shouldAnimate:t,children:n},e)})})}const{useHistory:an}=te(Gt.privateApis),ln=(0,d.memo)((0,d.forwardRef)((({isTransparent:e},t)=>{const{dashboardLink:n,homeUrl:s,siteTitle:i}=(0,l.useSelect)((e=>{const{getSettings:t}=te(e(zt)),{getEntityRecord:n}=e(_.store),s=n("root","site");return{dashboardLink:t().__experimentalDashboardLink,homeUrl:n("root","__unstableBase")?.home,siteTitle:!s?.title&&s?.url?(0,Qt.filterURLForDisplay)(s?.url):s?.title}}),[]),{open:r}=(0,l.useDispatch)(Wt.store);return(0,oe.jsx)("div",{className:"edit-site-site-hub",children:(0,oe.jsxs)(y.__experimentalHStack,{justify:"flex-start",spacing:"0",children:[(0,oe.jsx)("div",{className:Ut("edit-site-site-hub__view-mode-toggle-container",{"has-transparent-background":e}),children:(0,oe.jsx)(y.Button,{__next40pxDefaultSize:!0,ref:t,href:n,label:(0,b.__)("Go to the Dashboard"),className:"edit-site-layout__view-mode-toggle",style:{transform:"scale(0.5333) translateX(-4px)",borderRadius:4},children:(0,oe.jsx)(en,{className:"edit-site-layout__view-mode-toggle-icon"})})}),(0,oe.jsxs)(y.__experimentalHStack,{children:[(0,oe.jsx)("div",{className:"edit-site-site-hub__title",children:(0,oe.jsxs)(y.Button,{__next40pxDefaultSize:!0,variant:"link",href:s,target:"_blank",children:[(0,Kt.decodeEntities)(i),(0,oe.jsx)(y.VisuallyHidden,{as:"span",children:(0,b.__)("(opens in a new tab)")})]})}),(0,oe.jsx)(y.__experimentalHStack,{spacing:0,expanded:!1,className:"edit-site-site-hub__actions",children:(0,oe.jsx)(y.Button,{size:"compact",className:"edit-site-site-hub_toggle-command-center",icon:Xt,onClick:()=>r(),label:(0,b.__)("Open command palette"),shortcut:Jt.displayShortcut.primary("k")})})]})]})})}))),cn=ln,un=(0,d.memo)((0,d.forwardRef)((({isTransparent:e},t)=>{const n=an(),{navigate:s}=(0,d.useContext)(nn),{dashboardLink:i,isBlockTheme:r,homeUrl:o,siteTitle:a}=(0,l.useSelect)((e=>{const{getSettings:t}=te(e(zt)),{getEntityRecord:n,getCurrentTheme:s}=e(_.store),i=n("root","site");return{dashboardLink:t().__experimentalDashboardLink,isBlockTheme:s()?.is_block_theme,homeUrl:n("root","__unstableBase")?.home,siteTitle:!i?.title&&i?.url?(0,Qt.filterURLForDisplay)(i?.url):i?.title}}),[]),{open:c}=(0,l.useDispatch)(Wt.store);return(0,oe.jsx)("div",{className:"edit-site-site-hub",children:(0,oe.jsxs)(y.__experimentalHStack,{justify:"flex-start",spacing:"0",children:[(0,oe.jsx)("div",{className:Ut("edit-site-site-hub__view-mode-toggle-container",{"has-transparent-background":e}),children:(0,oe.jsx)(y.Button,{__next40pxDefaultSize:!0,ref:t,className:"edit-site-layout__view-mode-toggle",style:{transform:"scale(0.5)",borderRadius:4},...r?{onClick:()=>{n.navigate("/"),s("back")},label:(0,b.__)("Go to Site Editor")}:{href:i,label:(0,b.__)("Go to the Dashboard")},children:(0,oe.jsx)(en,{className:"edit-site-layout__view-mode-toggle-icon"})})}),(0,oe.jsxs)(y.__experimentalHStack,{children:[(0,oe.jsx)("div",{className:"edit-site-site-hub__title",children:(0,oe.jsx)(y.Button,{__next40pxDefaultSize:!0,variant:"link",href:o,target:"_blank",label:(0,b.__)("View site (opens in a new tab)"),children:(0,Kt.decodeEntities)(a)})}),(0,oe.jsx)(y.__experimentalHStack,{spacing:0,expanded:!1,className:"edit-site-site-hub__actions",children:(0,oe.jsx)(y.Button,{__next40pxDefaultSize:!0,className:"edit-site-site-hub_toggle-command-center",icon:Xt,onClick:()=>c(),label:(0,b.__)("Open command palette"),shortcut:Jt.displayShortcut.primary("k")})})]})]})})}))),{useLocation:dn,useHistory:hn}=te(Gt.privateApis),pn={position:void 0,userSelect:void 0,cursor:void 0,width:void 0,height:void 0,top:void 0,right:void 0,bottom:void 0,left:void 0},fn=320,mn=9/19.5,gn={width:"100%",height:"100%"};function vn(e,t){const n=1-Math.max(0,Math.min(1,(e-fn)/980)),s=((e,t,n)=>e+(t-e)*n)(t,mn,n);return e/s}const xn=function e({isFullWidth:t,isOversized:n,setIsOversized:s,isReady:i,children:r,defaultSize:o,innerContentStyle:a}){const c=hn(),{path:u,query:h}=dn(),{canvas:p="view"}=h,f=(0,v.useReducedMotion)(),[m,g]=(0,d.useState)(gn),[x,w]=(0,d.useState)(),[j,S]=(0,d.useState)(!1),[C,k]=(0,d.useState)(!1),[E,P]=(0,d.useState)(1),I={type:"tween",duration:j?0:.5},T=(0,d.useRef)(null),O=(0,v.useInstanceId)(e,"edit-site-resizable-frame-handle-help"),A=o.width/o.height,N=(0,l.useSelect)((e=>{const{getCurrentTheme:t}=e(_.store);return t()?.is_block_theme}),[]),M={default:{flexGrow:0,height:m.height},fullWidth:{flexGrow:1,height:m.height}},F={hidden:{opacity:0,...(0,b.isRTL)()?{right:0}:{left:0}},visible:{opacity:1,...(0,b.isRTL)()?{right:-14}:{left:-14}},active:{opacity:1,...(0,b.isRTL)()?{right:-14}:{left:-14},scaleY:1.3}},V=j?"active":C?"visible":"hidden";return(0,oe.jsx)(y.ResizableBox,{as:y.__unstableMotion.div,ref:T,initial:!1,variants:M,animate:t?"fullWidth":"default",onAnimationComplete:e=>{"fullWidth"===e&&g({width:"100%",height:"100%"})},whileHover:"view"===p?{scale:1.005,transition:{duration:f?0:.5,ease:"easeOut"}}:{},transition:I,size:m,enable:{top:!1,bottom:!1,...(0,b.isRTL)()?{right:i,left:!1}:{left:i,right:!1},topRight:!1,bottomRight:!1,bottomLeft:!1,topLeft:!1},resizeRatio:E,handleClasses:void 0,handleStyles:{left:pn,right:pn},minWidth:fn,maxWidth:t?"100%":"150%",maxHeight:"100%",onFocus:()=>k(!0),onBlur:()=>k(!1),onMouseOver:()=>k(!0),onMouseOut:()=>k(!1),handleComponent:{[(0,b.isRTL)()?"right":"left"]:"view"===p&&(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(y.Tooltip,{text:(0,b.__)("Drag to resize"),children:(0,oe.jsx)(y.__unstableMotion.button,{role:"separator","aria-orientation":"vertical",className:Ut("edit-site-resizable-frame__handle",{"is-resizing":j}),variants:F,animate:V,"aria-label":(0,b.__)("Drag to resize"),"aria-describedby":O,"aria-valuenow":T.current?.resizable?.offsetWidth||void 0,"aria-valuemin":fn,"aria-valuemax":o.width,onKeyDown:e=>{if(!["ArrowLeft","ArrowRight"].includes(e.key))return;e.preventDefault();const t=20*(e.shiftKey?5:1)*("ArrowLeft"===e.key?1:-1)*((0,b.isRTL)()?-1:1),n=Math.min(Math.max(fn,T.current.resizable.offsetWidth+t),o.width);g({width:n,height:vn(n,A)})},initial:"hidden",exit:"hidden",whileFocus:"active",whileHover:"active"},"handle")}),(0,oe.jsx)("div",{hidden:!0,id:O,children:(0,b.__)("Use left and right arrow keys to resize the canvas. Hold shift to resize in larger increments.")})]})},onResizeStart:(e,t,n)=>{w(n.offsetWidth),S(!0)},onResize:(e,t,i,r)=>{const a=r.width/E,l=Math.abs(a),c=r.width<0?l:(o.width-x)/2,u=Math.min(l,c),d=0===l?0:u/l;P(1-d+2*d);const h=x+r.width;s(h>o.width),g({height:n?"100%":vn(h,A)})},onResizeStop:(e,t,i)=>{if(S(!1),!n)return;s(!1);i.ownerDocument.documentElement.offsetWidth-i.offsetWidth>200||!N?g(gn):c.navigate((0,Qt.addQueryArgs)(u,{canvas:"edit"}),{transition:"canvas-mode-edit-transition"})},className:Ut("edit-site-resizable-frame__inner",{"is-resizing":j}),showHandle:!1,children:(0,oe.jsx)("div",{className:"edit-site-resizable-frame__inner-content",style:a,children:r})})},yn=window.wp.keyboardShortcuts,bn="core/edit-site/save";function wn(){const{__experimentalGetDirtyEntityRecords:e,isSavingEntityRecord:t}=(0,l.useSelect)(_.store),{hasNonPostEntityChanges:n,isPostSavingLocked:s}=(0,l.useSelect)(h.store),{savePost:i}=(0,l.useDispatch)(h.store),{setIsSaveViewOpened:r}=(0,l.useDispatch)(zt),{registerShortcut:o,unregisterShortcut:a}=(0,l.useDispatch)(yn.store);return(0,d.useEffect)((()=>(o({name:bn,category:"global",description:(0,b.__)("Save your changes."),keyCombination:{modifier:"primary",character:"s"}}),()=>{a(bn)})),[o,a]),(0,yn.useShortcut)("core/edit-site/save",(o=>{o.preventDefault();const a=e(),l=!!a.length,c=a.some((e=>t(e.kind,e.name,e.key)));l&&!c&&(n()?r(!0):s()||i())})),null}const _n=1e4;function jn(){const[e,t]=(0,d.useState)(!1),n=(0,l.useSelect)((t=>{const n=t(_.store).hasResolvingSelectors();return!e&&!n}),[e]);return(0,d.useEffect)((()=>{let n;return e||(n=setTimeout((()=>{t(!0)}),_n)),()=>{clearTimeout(n)}}),[e]),(0,d.useEffect)((()=>{if(n){const e=setTimeout((()=>{t(!0)}),100);return()=>{clearTimeout(e)}}}),[n]),!e}var Sn=Ln(),Cn=e=>Vn(e,Sn),kn=Ln();Cn.write=e=>Vn(e,kn);var En=Ln();Cn.onStart=e=>Vn(e,En);var Pn=Ln();Cn.onFrame=e=>Vn(e,Pn);var In=Ln();Cn.onFinish=e=>Vn(e,In);var Tn=[];Cn.setTimeout=(e,t)=>{let n=Cn.now()+t,s=()=>{let e=Tn.findIndex((e=>e.cancel==s));~e&&Tn.splice(e,1),Mn-=~e?1:0},i={time:n,handler:e,cancel:s};return Tn.splice(On(n),0,i),Mn+=1,Rn(),i};var On=e=>~(~Tn.findIndex((t=>t.time>e))||~Tn.length);Cn.cancel=e=>{En.delete(e),Pn.delete(e),In.delete(e),Sn.delete(e),kn.delete(e)},Cn.sync=e=>{Fn=!0,Cn.batchedUpdates(e),Fn=!1},Cn.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function s(...e){t=e,Cn.onStart(n)}return s.handler=e,s.cancel=()=>{En.delete(n),t=null},s};var An=typeof window<"u"?window.requestAnimationFrame:()=>{};Cn.use=e=>An=e,Cn.now=typeof performance<"u"?()=>performance.now():Date.now,Cn.batchedUpdates=e=>e(),Cn.catch=console.error,Cn.frameLoop="always",Cn.advance=()=>{"demand"!==Cn.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):Dn()};var Nn=-1,Mn=0,Fn=!1;function Vn(e,t){Fn?(t.delete(e),e(0)):(t.add(e),Rn())}function Rn(){Nn<0&&(Nn=0,"demand"!==Cn.frameLoop&&An(Bn))}function Bn(){~Nn&&(An(Bn),Cn.batchedUpdates(Dn))}function Dn(){let e=Nn;Nn=Cn.now();let t=On(Nn);t&&(zn(Tn.splice(0,t),(e=>e.handler())),Mn-=t),Mn?(En.flush(),Sn.flush(e?Math.min(64,Nn-e):16.667),Pn.flush(),kn.flush(),In.flush()):Nn=-1}function Ln(){let e=new Set,t=e;return{add(n){Mn+=t!=e||e.has(n)?0:1,e.add(n)},delete:n=>(Mn-=t==e&&e.has(n)?1:0,e.delete(n)),flush(n){t.size&&(e=new Set,Mn-=t.size,zn(t,(t=>t(n)&&e.add(t))),Mn+=e.size,t=e)}}}function zn(e,t){e.forEach((e=>{try{t(e)}catch(e){Cn.catch(e)}}))}var Gn=i(1609),Hn=i.t(Gn,2),Un=Object.defineProperty,Wn={};function qn(){}((e,t)=>{for(var n in t)Un(e,n,{get:t[n],enumerable:!0})})(Wn,{assign:()=>os,colors:()=>ss,createStringInterpolator:()=>$n,skipAnimation:()=>is,to:()=>es,willAdvance:()=>rs});var Zn={arr:Array.isArray,obj:e=>!!e&&"Object"===e.constructor.name,fun:e=>"function"==typeof e,str:e=>"string"==typeof e,num:e=>"number"==typeof e,und:e=>void 0===e};function Kn(e,t){if(Zn.arr(e)){if(!Zn.arr(t)||e.length!==t.length)return!1;for(let n=0;ne.forEach(t);function Xn(e,t,n){if(Zn.arr(e))for(let s=0;sZn.und(e)?[]:Zn.arr(e)?e:[e];function Qn(e,t){if(e.size){let n=Array.from(e);e.clear(),Yn(n,t)}}var $n,es,ts=(e,...t)=>Qn(e,(e=>e(...t))),ns=()=>typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),ss=null,is=!1,rs=qn,os=e=>{e.to&&(es=e.to),e.now&&(Cn.now=e.now),void 0!==e.colors&&(ss=e.colors),null!=e.skipAnimation&&(is=e.skipAnimation),e.createStringInterpolator&&($n=e.createStringInterpolator),e.requestAnimationFrame&&Cn.use(e.requestAnimationFrame),e.batchedUpdates&&(Cn.batchedUpdates=e.batchedUpdates),e.willAdvance&&(rs=e.willAdvance),e.frameLoop&&(Cn.frameLoop=e.frameLoop)},as=new Set,ls=[],cs=[],us=0,ds={get idle(){return!as.size&&!ls.length},start(e){us>e.priority?(as.add(e),Cn.onStart(hs)):(ps(e),Cn(ms))},advance:ms,sort(e){if(us)Cn.onFrame((()=>ds.sort(e)));else{let t=ls.indexOf(e);~t&&(ls.splice(t,1),fs(e))}},clear(){ls=[],as.clear()}};function hs(){as.forEach(ps),as.clear(),Cn(ms)}function ps(e){ls.includes(e)||fs(e)}function fs(e){ls.splice(function(e,t){let n=e.findIndex(t);return n<0?e.length:n}(ls,(t=>t.priority>e.priority)),0,e)}function ms(e){let t=cs;for(let n=0;n0}var gs="[-+]?\\d*\\.?\\d+",vs=gs+"%";function xs(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}var ys=new RegExp("rgb"+xs(gs,gs,gs)),bs=new RegExp("rgba"+xs(gs,gs,gs,gs)),ws=new RegExp("hsl"+xs(gs,vs,vs)),_s=new RegExp("hsla"+xs(gs,vs,vs,gs)),js=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Ss=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Cs=/^#([0-9a-fA-F]{6})$/,ks=/^#([0-9a-fA-F]{8})$/;function Es(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Ps(e,t,n){let s=n<.5?n*(1+t):n+t-n*t,i=2*n-s,r=Es(i,s,e+1/3),o=Es(i,s,e),a=Es(i,s,e-1/3);return Math.round(255*r)<<24|Math.round(255*o)<<16|Math.round(255*a)<<8}function Is(e){let t=parseInt(e,10);return t<0?0:t>255?255:t}function Ts(e){return(parseFloat(e)%360+360)%360/360}function Os(e){let t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function As(e){let t=parseFloat(e);return t<0?0:t>100?1:t/100}function Ns(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=Cs.exec(e))?parseInt(t[1]+"ff",16)>>>0:ss&&void 0!==ss[e]?ss[e]:(t=ys.exec(e))?(Is(t[1])<<24|Is(t[2])<<16|Is(t[3])<<8|255)>>>0:(t=bs.exec(e))?(Is(t[1])<<24|Is(t[2])<<16|Is(t[3])<<8|Os(t[4]))>>>0:(t=js.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=ks.exec(e))?parseInt(t[1],16)>>>0:(t=Ss.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=ws.exec(e))?(255|Ps(Ts(t[1]),As(t[2]),As(t[3])))>>>0:(t=_s.exec(e))?(Ps(Ts(t[1]),As(t[2]),As(t[3]))|Os(t[4]))>>>0:null}(e);return null===t?e:(t=t||0,`rgba(${(4278190080&t)>>>24}, ${(16711680&t)>>>16}, ${(65280&t)>>>8}, ${(255&t)/255})`)}var Ms=(e,t,n)=>{if(Zn.fun(e))return e;if(Zn.arr(e))return Ms({range:e,output:t,extrapolate:n});if(Zn.str(e.output[0]))return $n(e);let s=e,i=s.output,r=s.range||[0,1],o=s.extrapolateLeft||s.extrapolate||"extend",a=s.extrapolateRight||s.extrapolate||"extend",l=s.easing||(e=>e);return e=>{let t=function(e,t){for(var n=1;n=e);++n);return n-1}(e,r);return function(e,t,n,s,i,r,o,a,l){let c=l?l(e):e;if(cn){if("identity"===a)return c;"clamp"===a&&(c=n)}return s===i?s:t===n?e<=t?s:i:(t===-1/0?c=-c:n===1/0?c-=t:c=(c-t)/(n-t),c=r(c),s===-1/0?c=-c:i===1/0?c+=s:c=c*(i-s)+s,c)}(e,r[t],r[t+1],i[t],i[t+1],l,o,a,s.map)}};var Fs=1.70158,Vs=1.525*Fs,Rs=Fs+1,Bs=2*Math.PI/3,Ds=2*Math.PI/4.5,Ls=e=>e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375,zs={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>1-(1-e)*(1-e),easeInOutQuad:e=>e<.5?2*e*e:1-Math.pow(-2*e+2,2)/2,easeInCubic:e=>e*e*e,easeOutCubic:e=>1-Math.pow(1-e,3),easeInOutCubic:e=>e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2,easeInQuart:e=>e*e*e*e,easeOutQuart:e=>1-Math.pow(1-e,4),easeInOutQuart:e=>e<.5?8*e*e*e*e:1-Math.pow(-2*e+2,4)/2,easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>1-Math.pow(1-e,5),easeInOutQuint:e=>e<.5?16*e*e*e*e*e:1-Math.pow(-2*e+2,5)/2,easeInSine:e=>1-Math.cos(e*Math.PI/2),easeOutSine:e=>Math.sin(e*Math.PI/2),easeInOutSine:e=>-(Math.cos(Math.PI*e)-1)/2,easeInExpo:e=>0===e?0:Math.pow(2,10*e-10),easeOutExpo:e=>1===e?1:1-Math.pow(2,-10*e),easeInOutExpo:e=>0===e?0:1===e?1:e<.5?Math.pow(2,20*e-10)/2:(2-Math.pow(2,-20*e+10))/2,easeInCirc:e=>1-Math.sqrt(1-Math.pow(e,2)),easeOutCirc:e=>Math.sqrt(1-Math.pow(e-1,2)),easeInOutCirc:e=>e<.5?(1-Math.sqrt(1-Math.pow(2*e,2)))/2:(Math.sqrt(1-Math.pow(-2*e+2,2))+1)/2,easeInBack:e=>Rs*e*e*e-Fs*e*e,easeOutBack:e=>1+Rs*Math.pow(e-1,3)+Fs*Math.pow(e-1,2),easeInOutBack:e=>e<.5?Math.pow(2*e,2)*(2*(Vs+1)*e-Vs)/2:(Math.pow(2*e-2,2)*((Vs+1)*(2*e-2)+Vs)+2)/2,easeInElastic:e=>0===e?0:1===e?1:-Math.pow(2,10*e-10)*Math.sin((10*e-10.75)*Bs),easeOutElastic:e=>0===e?0:1===e?1:Math.pow(2,-10*e)*Math.sin((10*e-.75)*Bs)+1,easeInOutElastic:e=>0===e?0:1===e?1:e<.5?-Math.pow(2,20*e-10)*Math.sin((20*e-11.125)*Ds)/2:Math.pow(2,-20*e+10)*Math.sin((20*e-11.125)*Ds)/2+1,easeInBounce:e=>1-Ls(1-e),easeOutBounce:Ls,easeInOutBounce:e=>e<.5?(1-Ls(1-2*e))/2:(1+Ls(2*e-1))/2,steps:(e,t="end")=>n=>{let s=(n="end"===t?Math.min(n,.999):Math.max(n,.001))*e;return((e,t,n)=>Math.min(Math.max(n,e),t))(0,1,("end"===t?Math.floor(s):Math.ceil(s))/e)}},Gs=Symbol.for("FluidValue.get"),Hs=Symbol.for("FluidValue.observers"),Us=e=>Boolean(e&&e[Gs]),Ws=e=>e&&e[Gs]?e[Gs]():e,qs=e=>e[Hs]||null;function Zs(e,t){let n=e[Hs];n&&n.forEach((e=>{!function(e,t){e.eventObserved?e.eventObserved(t):e(t)}(e,t)}))}var Ks=class{[Gs];[Hs];constructor(e){if(!e&&!(e=this.get))throw Error("Unknown getter");Ys(this,e)}},Ys=(e,t)=>$s(e,Gs,t);function Xs(e,t){if(e[Gs]){let n=e[Hs];n||$s(e,Hs,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function Js(e,t){let n=e[Hs];if(n&&n.has(t)){let s=n.size-1;s?n.delete(t):e[Hs]=null,e.observerRemoved&&e.observerRemoved(s,t)}}var Qs,$s=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),ei=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,ti=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,ni=new RegExp(`(${ei.source})(%|[a-z]+)`,"i"),si=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,ii=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,ri=e=>{let[t,n]=oi(e);if(!t||ns())return e;let s=window.getComputedStyle(document.documentElement).getPropertyValue(t);if(s)return s.trim();if(n&&n.startsWith("--")){return window.getComputedStyle(document.documentElement).getPropertyValue(n)||e}return n&&ii.test(n)?ri(n):n||e},oi=e=>{let t=ii.exec(e);if(!t)return[,];let[,n,s]=t;return[n,s]},ai=(e,t,n,s,i)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(s)}, ${i})`,li=e=>{Qs||(Qs=ss?new RegExp(`(${Object.keys(ss).join("|")})(?!\\w)`,"g"):/^\b$/);let t=e.output.map((e=>Ws(e).replace(ii,ri).replace(ti,Ns).replace(Qs,Ns))),n=t.map((e=>e.match(ei).map(Number))),s=n[0].map(((e,t)=>n.map((e=>{if(!(t in e))throw Error('The arity of each "output" value must be equal');return e[t]})))).map((t=>Ms({...e,output:t})));return e=>{let n=!ni.test(t[0])&&t.find((e=>ni.test(e)))?.replace(ei,""),i=0;return t[0].replace(ei,(()=>`${s[i++](e)}${n||""}`)).replace(si,ai)}},ci="react-spring: ",ui=e=>{let t=e,n=!1;if("function"!=typeof t)throw new TypeError(`${ci}once requires a function parameter`);return(...e)=>{n||(t(...e),n=!0)}},di=ui(console.warn);ui(console.warn);function hi(e){return Zn.str(e)&&("#"==e[0]||/\d/.test(e)||!ns()&&ii.test(e)||e in(ss||{}))}new WeakMap;new Set,new WeakMap,new WeakMap,new WeakMap;var pi=ns()?Gn.useEffect:Gn.useLayoutEffect;function fi(){let e=(0,Gn.useState)()[1],t=(()=>{let e=(0,Gn.useRef)(!1);return pi((()=>(e.current=!0,()=>{e.current=!1})),[]),e})();return()=>{t.current&&e(Math.random())}}var mi=[];var gi=Symbol.for("Animated:node"),vi=e=>e&&e[gi],xi=(e,t)=>((e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}))(e,gi,t),yi=e=>e&&e[gi]&&e[gi].getPayload(),bi=class{payload;constructor(){xi(this,this)}getPayload(){return this.payload||[]}},wi=class extends bi{constructor(e){super(),this._value=e,Zn.num(this._value)&&(this.lastPosition=this._value)}done=!0;elapsedTime;lastPosition;lastVelocity;v0;durationProgress=0;static create(e){return new wi(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return Zn.num(e)&&(this.lastPosition=e,t&&(e=Math.round(e/t)*t,this.done&&(this.lastPosition=e))),this._value!==e&&(this._value=e,!0)}reset(){let{done:e}=this;this.done=!1,Zn.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}},_i=class extends wi{_string=null;_toString;constructor(e){super(0),this._toString=Ms({output:[e,e]})}static create(e){return new _i(e)}getValue(){return this._string??(this._string=this._toString(this._value))}setValue(e){if(Zn.str(e)){if(e==this._string)return!1;this._string=e,this._value=1}else{if(!super.setValue(e))return!1;this._string=null}return!0}reset(e){e&&(this._toString=Ms({output:[this.getValue(),e]})),this._value=0,super.reset()}},ji={dependencies:null},Si=class extends bi{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){let t={};return Xn(this.source,((n,s)=>{(e=>!!e&&e[gi]===e)(n)?t[s]=n.getValue(e):Us(n)?t[s]=Ws(n):e||(t[s]=n)})),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&Yn(this.payload,(e=>e.reset()))}_makePayload(e){if(e){let t=new Set;return Xn(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){ji.dependencies&&Us(e)&&ji.dependencies.add(e);let t=yi(e);t&&Yn(t,(e=>this.add(e)))}},Ci=class extends Si{constructor(e){super(e)}static create(e){return new Ci(e)}getValue(){return this.source.map((e=>e.getValue()))}setValue(e){let t=this.getPayload();return e.length==t.length?t.map(((t,n)=>t.setValue(e[n]))).some(Boolean):(super.setValue(e.map(ki)),!0)}};function ki(e){return(hi(e)?_i:wi).create(e)}function Ei(e){let t=vi(e);return t?t.constructor:Zn.arr(e)?Ci:hi(e)?_i:wi}var Pi=(e,t)=>{let n=!Zn.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,Gn.forwardRef)(((s,i)=>{let r=(0,Gn.useRef)(null),o=n&&(0,Gn.useCallback)((e=>{r.current=function(e,t){return e&&(Zn.fun(e)?e(t):e.current=t),t}(i,e)}),[i]),[a,l]=function(e,t){let n=new Set;return ji.dependencies=n,e.style&&(e={...e,style:t.createAnimatedStyle(e.style)}),e=new Si(e),ji.dependencies=null,[e,n]}(s,t),c=fi(),u=()=>{let e=r.current;n&&!e||!1===(!!e&&t.applyAnimatedValues(e,a.getValue(!0)))&&c()},d=new Ii(u,l),h=(0,Gn.useRef)();pi((()=>(h.current=d,Yn(l,(e=>Xs(e,d))),()=>{h.current&&(Yn(h.current.deps,(e=>Js(e,h.current))),Cn.cancel(h.current.update))}))),(0,Gn.useEffect)(u,[]),(e=>{(0,Gn.useEffect)(e,mi)})((()=>()=>{let e=h.current;Yn(e.deps,(t=>Js(t,e)))}));let p=t.getComponentProps(a.getValue());return Gn.createElement(e,{...p,ref:o})}))},Ii=class{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){"change"==e.type&&Cn.write(this.update)}};var Ti=Symbol.for("AnimatedComponent"),Oi=e=>Zn.str(e)?e:e&&Zn.str(e.displayName)?e.displayName:Zn.fun(e)&&e.name||null;function Ai(e,...t){return Zn.fun(e)?e(...t):e}var Ni=(e,t)=>!0===e||!!(t&&e&&(Zn.fun(e)?e(t):Jn(e).includes(t))),Mi=(e,t)=>Zn.obj(e)?t&&e[t]:e,Fi=(e,t)=>!0===e.default?e[t]:e.default?e.default[t]:void 0,Vi=e=>e,Ri=(e,t=Vi)=>{let n=Bi;e.default&&!0!==e.default&&(e=e.default,n=Object.keys(e));let s={};for(let i of n){let n=t(e[i],i);Zn.und(n)||(s[i]=n)}return s},Bi=["config","onProps","onStart","onChange","onPause","onResume","onRest"],Di={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function Li(e){let t=function(e){let t={},n=0;if(Xn(e,((e,s)=>{Di[s]||(t[s]=e,n++)})),n)return t}(e);if(t){let n={to:t};return Xn(e,((e,s)=>s in t||(n[s]=e))),n}return{...e}}function zi(e){return e=Ws(e),Zn.arr(e)?e.map(zi):hi(e)?Wn.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function Gi(e){return Zn.fun(e)||Zn.arr(e)&&Zn.obj(e[0])}var Hi={tension:170,friction:26,mass:1,damping:1,easing:zs.linear,clamp:!1},Ui=class{tension;friction;frequency;damping;mass;velocity=0;restVelocity;precision;progress;duration;easing;clamp;bounce;decay;round;constructor(){Object.assign(this,Hi)}};function Wi(e,t){if(Zn.und(t.decay)){let n=!Zn.und(t.tension)||!Zn.und(t.friction);(n||!Zn.und(t.frequency)||!Zn.und(t.damping)||!Zn.und(t.mass))&&(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}else e.duration=void 0}var qi=[],Zi=class{changed=!1;values=qi;toValues=null;fromValues=qi;to;from;config=new Ui;immediate=!1};function Ki(e,{key:t,props:n,defaultProps:s,state:i,actions:r}){return new Promise(((o,a)=>{let l,c,u=Ni(n.cancel??s?.cancel,t);if(u)p();else{Zn.und(n.pause)||(i.paused=Ni(n.pause,t));let e=s?.pause;!0!==e&&(e=i.paused||Ni(e,t)),l=Ai(n.delay||0,t),e?(i.resumeQueue.add(h),r.pause()):(r.resume(),h())}function d(){i.resumeQueue.add(h),i.timeouts.delete(c),c.cancel(),l=c.time-Cn.now()}function h(){l>0&&!Wn.skipAnimation?(i.delayed=!0,c=Cn.setTimeout(p,l),i.pauseQueue.add(d),i.timeouts.add(c)):p()}function p(){i.delayed&&(i.delayed=!1),i.pauseQueue.delete(d),i.timeouts.delete(c),e<=(i.cancelId||0)&&(u=!0);try{r.start({...n,callId:e,cancel:u},o)}catch(e){a(e)}}}))}var Yi=(e,t)=>1==t.length?t[0]:t.some((e=>e.cancelled))?Qi(e.get()):t.every((e=>e.noop))?Xi(e.get()):Ji(e.get(),t.every((e=>e.finished))),Xi=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),Ji=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),Qi=e=>({value:e,cancelled:!0,finished:!1});function $i(e,t,n,s){let{callId:i,parentId:r,onRest:o}=t,{asyncTo:a,promise:l}=n;return r||e!==a||t.reset?n.promise=(async()=>{n.asyncId=i,n.asyncTo=e;let c,u,d,h=Ri(t,((e,t)=>"onRest"===t?void 0:e)),p=new Promise(((e,t)=>(c=e,u=t))),f=e=>{let t=i<=(n.cancelId||0)&&Qi(s)||i!==n.asyncId&&Ji(s,!1);if(t)throw e.result=t,u(e),e},m=(e,t)=>{let r=new tr,o=new nr;return(async()=>{if(Wn.skipAnimation)throw er(n),o.result=Ji(s,!1),u(o),o;f(r);let a=Zn.obj(e)?{...e}:{...t,to:e};a.parentId=i,Xn(h,((e,t)=>{Zn.und(a[t])&&(a[t]=e)}));let l=await s.start(a);return f(r),n.paused&&await new Promise((e=>{n.resumeQueue.add(e)})),l})()};if(Wn.skipAnimation)return er(n),Ji(s,!1);try{let t;t=Zn.arr(e)?(async e=>{for(let t of e)await m(t)})(e):Promise.resolve(e(m,s.stop.bind(s))),await Promise.all([t.then(c),p]),d=Ji(s.get(),!0,!1)}catch(e){if(e instanceof tr)d=e.result;else{if(!(e instanceof nr))throw e;d=e.result}}finally{i==n.asyncId&&(n.asyncId=r,n.asyncTo=r?a:void 0,n.promise=r?l:void 0)}return Zn.fun(o)&&Cn.batchedUpdates((()=>{o(d,s,s.item)})),d})():l}function er(e,t){Qn(e.timeouts,(e=>e.cancel())),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}var tr=class extends Error{result;constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise.")}},nr=class extends Error{result;constructor(){super("SkipAnimationSignal")}},sr=e=>e instanceof rr,ir=1,rr=class extends Ks{id=ir++;_priority=0;get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){let e=vi(this);return e&&e.getValue()}to(...e){return Wn.to(this,e)}interpolate(...e){return di(`${ci}The "interpolate" function is deprecated in v9 (use "to" instead)`),Wn.to(this,e)}toJSON(){return this.get()}observerAdded(e){1==e&&this._attach()}observerRemoved(e){0==e&&this._detach()}_attach(){}_detach(){}_onChange(e,t=!1){Zs(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||ds.sort(this),Zs(this,{type:"priority",parent:this,priority:e})}},or=Symbol.for("SpringPhase"),ar=e=>(1&e[or])>0,lr=e=>(2&e[or])>0,cr=e=>(4&e[or])>0,ur=(e,t)=>t?e[or]|=3:e[or]&=-3,dr=(e,t)=>t?e[or]|=4:e[or]&=-5,hr=class extends rr{key;animation=new Zi;queue;defaultProps={};_state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set};_pendingCalls=new Set;_lastCallId=0;_lastToId=0;_memoizedDuration=0;constructor(e,t){if(super(),!Zn.und(e)||!Zn.und(t)){let n=Zn.obj(e)?{...e}:{...t,from:e};Zn.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(lr(this)||this._state.asyncTo)||cr(this)}get goal(){return Ws(this.animation.to)}get velocity(){let e=vi(this);return e instanceof wi?e.lastVelocity||0:e.getPayload().map((e=>e.lastVelocity||0))}get hasAnimated(){return ar(this)}get isAnimating(){return lr(this)}get isPaused(){return cr(this)}get isDelayed(){return this._state.delayed}advance(e){let t=!0,n=!1,s=this.animation,{config:i,toValues:r}=s,o=yi(s.to);!o&&Us(s.to)&&(r=Jn(Ws(s.to))),s.values.forEach(((a,l)=>{if(a.done)return;let c=a.constructor==_i?1:o?o[l].lastPosition:r[l],u=s.immediate,d=c;if(!u){if(d=a.lastPosition,i.tension<=0)return void(a.done=!0);let t,n=a.elapsedTime+=e,r=s.fromValues[l],o=null!=a.v0?a.v0:a.v0=Zn.arr(i.velocity)?i.velocity[l]:i.velocity,h=i.precision||(r==c?.005:Math.min(1,.001*Math.abs(c-r)));if(Zn.und(i.duration))if(i.decay){let e=!0===i.decay?.998:i.decay,s=Math.exp(-(1-e)*n);d=r+o/(1-e)*(1-s),u=Math.abs(a.lastPosition-d)<=h,t=o*s}else{t=null==a.lastVelocity?o:a.lastVelocity;let n,s=i.restVelocity||h/10,l=i.clamp?0:i.bounce,p=!Zn.und(l),f=r==c?a.v0>0:rs,n||(u=Math.abs(c-d)<=h,!u));++e){p&&(m=d==c||d>c==f,m&&(t=-t*l,d=c)),t+=(1e-6*-i.tension*(d-c)+.001*-i.friction*t)/i.mass*g,d+=t*g}}else{let s=1;i.duration>0&&(this._memoizedDuration!==i.duration&&(this._memoizedDuration=i.duration,a.durationProgress>0&&(a.elapsedTime=i.duration*a.durationProgress,n=a.elapsedTime+=e)),s=(i.progress||0)+n/this._memoizedDuration,s=s>1?1:s<0?0:s,a.durationProgress=s),d=r+i.easing(s)*(c-r),t=(d-a.lastPosition)/e,u=1==s}a.lastVelocity=t,Number.isNaN(d)&&(console.warn("Got NaN while animating:",this),u=!0)}o&&!o[l].done&&(u=!1),u?a.done=!0:t=!1,a.setValue(d,i.round)&&(n=!0)}));let a=vi(this),l=a.getValue();if(t){let e=Ws(s.to);l===e&&!n||i.decay?n&&i.decay&&this._onChange(l):(a.setValue(e),this._onChange(e)),this._stop()}else n&&this._onChange(l)}set(e){return Cn.batchedUpdates((()=>{this._stop(),this._focus(e),this._set(e)})),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(lr(this)){let{to:e,config:t}=this.animation;Cn.batchedUpdates((()=>{this._onStart(),t.decay||this._set(e,!1),this._stop()}))}return this}update(e){return(this.queue||(this.queue=[])).push(e),this}start(e,t){let n;return Zn.und(e)?(n=this.queue||[],this.queue=[]):n=[Zn.obj(e)?e:{...t,to:e}],Promise.all(n.map((e=>this._update(e)))).then((e=>Yi(this,e)))}stop(e){let{to:t}=this.animation;return this._focus(this.get()),er(this._state,e&&this._lastCallId),Cn.batchedUpdates((()=>this._stop(t,e))),this}reset(){this._update({reset:!0})}eventObserved(e){"change"==e.type?this._start():"priority"==e.type&&(this.priority=e.priority+1)}_prepareNode(e){let t=this.key||"",{to:n,from:s}=e;n=Zn.obj(n)?n[t]:n,(null==n||Gi(n))&&(n=void 0),s=Zn.obj(s)?s[t]:s,null==s&&(s=void 0);let i={to:n,from:s};return ar(this)||(e.reverse&&([n,s]=[s,n]),s=Ws(s),Zn.und(s)?vi(this)||this._set(n):this._set(s)),i}_update({...e},t){let{key:n,defaultProps:s}=this;e.default&&Object.assign(s,Ri(e,((e,t)=>/^on/.test(t)?Mi(e,n):e))),xr(this,e,"onProps"),yr(this,"onProps",e,this);let i=this._prepareNode(e);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");let r=this._state;return Ki(++this._lastCallId,{key:n,props:e,defaultProps:s,state:r,actions:{pause:()=>{cr(this)||(dr(this,!0),ts(r.pauseQueue),yr(this,"onPause",Ji(this,pr(this,this.animation.to)),this))},resume:()=>{cr(this)&&(dr(this,!1),lr(this)&&this._resume(),ts(r.resumeQueue),yr(this,"onResume",Ji(this,pr(this,this.animation.to)),this))},start:this._merge.bind(this,i)}}).then((n=>{if(e.loop&&n.finished&&(!t||!n.noop)){let t=fr(e);if(t)return this._update(t,!0)}return n}))}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(Qi(this));let s=!Zn.und(e.to),i=!Zn.und(e.from);if(s||i){if(!(t.callId>this._lastToId))return n(Qi(this));this._lastToId=t.callId}let{key:r,defaultProps:o,animation:a}=this,{to:l,from:c}=a,{to:u=l,from:d=c}=e;i&&!s&&(!t.default||Zn.und(u))&&(u=d),t.reverse&&([u,d]=[d,u]);let h=!Kn(d,c);h&&(a.from=d),d=Ws(d);let p=!Kn(u,l);p&&this._focus(u);let f=Gi(t.to),{config:m}=a,{decay:g,velocity:v}=m;(s||i)&&(m.velocity=0),t.config&&!f&&function(e,t,n){n&&(Wi(n={...n},t),t={...n,...t}),Wi(e,t),Object.assign(e,t);for(let t in Hi)null==e[t]&&(e[t]=Hi[t]);let{mass:s,frequency:i,damping:r}=e;Zn.und(i)||(i<.01&&(i=.01),r<0&&(r=0),e.tension=Math.pow(2*Math.PI/i,2)*s,e.friction=4*Math.PI*r*s/i)}(m,Ai(t.config,r),t.config!==o.config?Ai(o.config,r):void 0);let x=vi(this);if(!x||Zn.und(u))return n(Ji(this,!0));let y=Zn.und(t.reset)?i&&!t.default:!Zn.und(d)&&Ni(t.reset,r),b=y?d:this.get(),w=zi(u),_=Zn.num(w)||Zn.arr(w)||hi(w),j=!f&&(!_||Ni(o.immediate||t.immediate,r));if(p){let e=Ei(u);if(e!==x.constructor){if(!j)throw Error(`Cannot animate between ${x.constructor.name} and ${e.name}, as the "to" prop suggests`);x=this._set(w)}}let S=x.constructor,C=Us(u),k=!1;if(!C){let e=y||!ar(this)&&h;(p||e)&&(k=Kn(zi(b),w),C=!k),(!Kn(a.immediate,j)&&!j||!Kn(m.decay,g)||!Kn(m.velocity,v))&&(C=!0)}if(k&&lr(this)&&(a.changed&&!y?C=!0:C||this._stop(l)),!f&&((C||Us(l))&&(a.values=x.getPayload(),a.toValues=Us(u)?null:S==_i?[1]:Jn(w)),a.immediate!=j&&(a.immediate=j,!j&&!y&&this._set(l)),C)){let{onRest:e}=a;Yn(vr,(e=>xr(this,t,e)));let s=Ji(this,pr(this,l));ts(this._pendingCalls,s),this._pendingCalls.add(n),a.changed&&Cn.batchedUpdates((()=>{a.changed=!y,e?.(s,this),y?Ai(o.onRest,s):a.onStart?.(s,this)}))}y&&this._set(b),f?n($i(t.to,t,this._state,this)):C?this._start():lr(this)&&!p?this._pendingCalls.add(n):n(Xi(b))}_focus(e){let t=this.animation;e!==t.to&&(qs(this)&&this._detach(),t.to=e,qs(this)&&this._attach())}_attach(){let e=0,{to:t}=this.animation;Us(t)&&(Xs(t,this),sr(t)&&(e=t.priority+1)),this.priority=e}_detach(){let{to:e}=this.animation;Us(e)&&Js(e,this)}_set(e,t=!0){let n=Ws(e);if(!Zn.und(n)){let e=vi(this);if(!e||!Kn(n,e.getValue())){let s=Ei(n);e&&e.constructor==s?e.setValue(n):xi(this,s.create(n)),e&&Cn.batchedUpdates((()=>{this._onChange(n,t)}))}}return vi(this)}_onStart(){let e=this.animation;e.changed||(e.changed=!0,yr(this,"onStart",Ji(this,pr(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),Ai(this.animation.onChange,e,this)),Ai(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){let e=this.animation;vi(this).reset(Ws(e.to)),e.immediate||(e.fromValues=e.values.map((e=>e.lastPosition))),lr(this)||(ur(this,!0),cr(this)||this._resume())}_resume(){Wn.skipAnimation?this.finish():ds.start(this)}_stop(e,t){if(lr(this)){ur(this,!1);let n=this.animation;Yn(n.values,(e=>{e.done=!0})),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),Zs(this,{type:"idle",parent:this});let s=t?Qi(this.get()):Ji(this.get(),pr(this,e??n.to));ts(this._pendingCalls,s),n.changed&&(n.changed=!1,yr(this,"onRest",s,this))}}};function pr(e,t){let n=zi(t);return Kn(zi(e.get()),n)}function fr(e,t=e.loop,n=e.to){let s=Ai(t);if(s){let i=!0!==s&&Li(s),r=(i||e).reverse,o=!i||i.reset;return mr({...e,loop:t,default:!1,pause:void 0,to:!r||Gi(n)?n:void 0,from:o?e.from:void 0,reset:o,...i})}}function mr(e){let{to:t,from:n}=e=Li(e),s=new Set;return Zn.obj(t)&&gr(t,s),Zn.obj(n)&&gr(n,s),e.keys=s.size?Array.from(s):null,e}function gr(e,t){Xn(e,((e,n)=>null!=e&&t.add(n)))}var vr=["onStart","onRest","onChange","onPause","onResume"];function xr(e,t,n){e.animation[n]=t[n]!==Fi(t,n)?Mi(t[n],e.key):void 0}function yr(e,t,...n){e.animation[t]?.(...n),e.defaultProps[t]?.(...n)}var br=["onStart","onChange","onRest"],wr=1,_r=class{id=wr++;springs={};queue=[];ref;_flush;_initialProps;_lastAsyncId=0;_active=new Set;_changed=new Set;_started=!1;_item;_state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set};_events={onStart:new Map,onChange:new Map,onRest:new Map};constructor(e,t){this._onFrame=this._onFrame.bind(this),t&&(this._flush=t),e&&this.start({default:!0,...e})}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every((e=>e.idle&&!e.isDelayed&&!e.isPaused))}get item(){return this._item}set item(e){this._item=e}get(){let e={};return this.each(((t,n)=>e[n]=t.get())),e}set(e){for(let t in e){let n=e[t];Zn.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(mr(e)),this}start(e){let{queue:t}=this;return e?t=Jn(e).map(mr):this.queue=[],this._flush?this._flush(this,t):(Er(this,t),jr(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){let n=this.springs;Yn(Jn(t),(t=>n[t].stop(!!e)))}else er(this._state,this._lastAsyncId),this.each((t=>t.stop(!!e)));return this}pause(e){if(Zn.und(e))this.start({pause:!0});else{let t=this.springs;Yn(Jn(e),(e=>t[e].pause()))}return this}resume(e){if(Zn.und(e))this.start({pause:!1});else{let t=this.springs;Yn(Jn(e),(e=>t[e].resume()))}return this}each(e){Xn(this.springs,e)}_onFrame(){let{onStart:e,onChange:t,onRest:n}=this._events,s=this._active.size>0,i=this._changed.size>0;(s&&!this._started||i&&!this._started)&&(this._started=!0,Qn(e,(([e,t])=>{t.value=this.get(),e(t,this,this._item)})));let r=!s&&this._started,o=i||r&&n.size?this.get():null;i&&t.size&&Qn(t,(([e,t])=>{t.value=o,e(t,this,this._item)})),r&&(this._started=!1,Qn(n,(([e,t])=>{t.value=o,e(t,this,this._item)})))}eventObserved(e){if("change"==e.type)this._changed.add(e.parent),e.idle||this._active.add(e.parent);else{if("idle"!=e.type)return;this._active.delete(e.parent)}Cn.onFrame(this._onFrame)}};function jr(e,t){return Promise.all(t.map((t=>Sr(e,t)))).then((t=>Yi(e,t)))}async function Sr(e,t,n){let{keys:s,to:i,from:r,loop:o,onRest:a,onResolve:l}=t,c=Zn.obj(t.default)&&t.default;o&&(t.loop=!1),!1===i&&(t.to=null),!1===r&&(t.from=null);let u=Zn.arr(i)||Zn.fun(i)?i:void 0;u?(t.to=void 0,t.onRest=void 0,c&&(c.onRest=void 0)):Yn(br,(n=>{let s=t[n];if(Zn.fun(s)){let i=e._events[n];t[n]=({finished:e,cancelled:t})=>{let n=i.get(s);n?(e||(n.finished=!1),t&&(n.cancelled=!0)):i.set(s,{value:null,finished:e||!1,cancelled:t||!1})},c&&(c[n]=t[n])}}));let d=e._state;t.pause===!d.paused?(d.paused=t.pause,ts(t.pause?d.pauseQueue:d.resumeQueue)):d.paused&&(t.pause=!0);let h=(s||Object.keys(e.springs)).map((n=>e.springs[n].start(t))),p=!0===t.cancel||!0===Fi(t,"cancel");(u||p&&d.asyncId)&&h.push(Ki(++e._lastAsyncId,{props:t,state:d,actions:{pause:qn,resume:qn,start(t,n){p?(er(d,e._lastAsyncId),n(Qi(e))):(t.onRest=a,n($i(u,t,d,e)))}}})),d.paused&&await new Promise((e=>{d.resumeQueue.add(e)}));let f=Yi(e,await Promise.all(h));if(o&&f.finished&&(!n||!f.noop)){let n=fr(t,o,i);if(n)return Er(e,[n]),Sr(e,n,!0)}return l&&Cn.batchedUpdates((()=>l(f,e,e.item))),f}function Cr(e,t){let n=new hr;return n.key=e,t&&Xs(n,t),n}function kr(e,t,n){t.keys&&Yn(t.keys,(s=>{(e[s]||(e[s]=n(s)))._prepareNode(t)}))}function Er(e,t){Yn(t,(t=>{kr(e.springs,t,(t=>Cr(t,e)))}))}var Pr=({children:e,...t})=>{let n=(0,Gn.useContext)(Ir),s=t.pause||!!n.pause,i=t.immediate||!!n.immediate;t=function(e,t){let[n]=(0,Gn.useState)((()=>({inputs:t,result:e()}))),s=(0,Gn.useRef)(),i=s.current,r=i;return r?Boolean(t&&r.inputs&&function(e,t){if(e.length!==t.length)return!1;for(let n=0;n{s.current=r,i==n&&(n.inputs=n.result=void 0)}),[r]),r.result}((()=>({pause:s,immediate:i})),[s,i]);let{Provider:r}=Ir;return Gn.createElement(r,{value:t},e)},Ir=function(e,t){return Object.assign(e,Gn.createContext(t)),e.Provider._context=e,e.Consumer._context=e,e}(Pr,{});Pr.Provider=Ir.Provider,Pr.Consumer=Ir.Consumer;var Tr=class extends rr{constructor(e,t){super(),this.source=e,this.calc=Ms(...t);let n=this._get(),s=Ei(n);xi(this,s.create(n))}key;idle=!0;calc;_active=new Set;advance(e){let t=this._get();Kn(t,this.get())||(vi(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&Ar(this._active)&&Nr(this)}_get(){let e=Zn.arr(this.source)?this.source.map(Ws):Jn(Ws(this.source));return this.calc(...e)}_start(){this.idle&&!Ar(this._active)&&(this.idle=!1,Yn(yi(this),(e=>{e.done=!1})),Wn.skipAnimation?(Cn.batchedUpdates((()=>this.advance())),Nr(this)):ds.start(this))}_attach(){let e=1;Yn(Jn(this.source),(t=>{Us(t)&&Xs(t,this),sr(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))})),this.priority=e,this._start()}_detach(){Yn(Jn(this.source),(e=>{Us(e)&&Js(e,this)})),this._active.clear(),Nr(this)}eventObserved(e){"change"==e.type?e.idle?this.advance():(this._active.add(e.parent),this._start()):"idle"==e.type?this._active.delete(e.parent):"priority"==e.type&&(this.priority=Jn(this.source).reduce(((e,t)=>Math.max(e,(sr(t)?t.priority:0)+1)),0))}};function Or(e){return!1!==e.idle}function Ar(e){return!e.size||Array.from(e).every(Or)}function Nr(e){e.idle||(e.idle=!0,Yn(yi(e),(e=>{e.done=!0})),Zs(e,{type:"idle",parent:e}))}Wn.assign({createStringInterpolator:li,to:(e,t)=>new Tr(e,t)});ds.advance;const Mr=window.ReactDOM;var Fr=/^--/;function Vr(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||Fr.test(e)||Br.hasOwnProperty(e)&&Br[e]?(""+t).trim():t+"px"}var Rr={};var Br={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Dr=["Webkit","Ms","Moz","O"];Br=Object.keys(Br).reduce(((e,t)=>(Dr.forEach((n=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(n,t)]=e[t])),e)),Br);var Lr=/^(matrix|translate|scale|rotate|skew)/,zr=/^(translate)/,Gr=/^(rotate|skew)/,Hr=(e,t)=>Zn.num(e)&&0!==e?e+t:e,Ur=(e,t)=>Zn.arr(e)?e.every((e=>Ur(e,t))):Zn.num(e)?e===t:parseFloat(e)===t,Wr=class extends Si{constructor({x:e,y:t,z:n,...s}){let i=[],r=[];(e||t||n)&&(i.push([e||0,t||0,n||0]),r.push((e=>[`translate3d(${e.map((e=>Hr(e,"px"))).join(",")})`,Ur(e,0)]))),Xn(s,((e,t)=>{if("transform"===t)i.push([e||""]),r.push((e=>[e,""===e]));else if(Lr.test(t)){if(delete s[t],Zn.und(e))return;let n=zr.test(t)?"px":Gr.test(t)?"deg":"";i.push(Jn(e)),r.push("rotate3d"===t?([e,t,s,i])=>[`rotate3d(${e},${t},${s},${Hr(i,n)})`,Ur(i,0)]:e=>[`${t}(${e.map((e=>Hr(e,n))).join(",")})`,Ur(e,t.startsWith("scale")?1:0)])}})),i.length&&(s.transform=new qr(i,r)),super(s)}},qr=class extends Ks{constructor(e,t){super(),this.inputs=e,this.transforms=t}_value=null;get(){return this._value||(this._value=this._get())}_get(){let e="",t=!0;return Yn(this.inputs,((n,s)=>{let i=Ws(n[0]),[r,o]=this.transforms[s](Zn.arr(i)?i:n.map(Ws));e+=" "+r,t=t&&o})),t?"none":e}observerAdded(e){1==e&&Yn(this.inputs,(e=>Yn(e,(e=>Us(e)&&Xs(e,this)))))}observerRemoved(e){0==e&&Yn(this.inputs,(e=>Yn(e,(e=>Us(e)&&Js(e,this)))))}eventObserved(e){"change"==e.type&&(this._value=null),Zs(this,e)}};Wn.assign({batchedUpdates:Mr.unstable_batchedUpdates,createStringInterpolator:li,colors:{transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199}});var Zr=((e,{applyAnimatedValues:t=()=>!1,createAnimatedStyle:n=e=>new Si(e),getComponentProps:s=e=>e}={})=>{let i={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:s},r=e=>{let t=Oi(e)||"Anonymous";return(e=Zn.str(e)?r[e]||(r[e]=Pi(e,i)):e[Ti]||(e[Ti]=Pi(e,i))).displayName=`Animated(${t})`,e};return Xn(e,((t,n)=>{Zn.arr(e)&&(n=Oi(t)),r[n]=r(t)})),{animated:r}})(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],{applyAnimatedValues:function(e,t){if(!e.nodeType||!e.setAttribute)return!1;let n="filter"===e.nodeName||e.parentNode&&"filter"===e.parentNode.nodeName,{style:s,children:i,scrollTop:r,scrollLeft:o,viewBox:a,...l}=t,c=Object.values(l),u=Object.keys(l).map((t=>n||e.hasAttribute(t)?t:Rr[t]||(Rr[t]=t.replace(/([A-Z])/g,(e=>"-"+e.toLowerCase())))));void 0!==i&&(e.textContent=i);for(let t in s)if(s.hasOwnProperty(t)){let n=Vr(t,s[t]);Fr.test(t)?e.style.setProperty(t,n):e.style[t]=n}u.forEach(((t,n)=>{e.setAttribute(t,c[n])})),void 0!==r&&(e.scrollTop=r),void 0!==o&&(e.scrollLeft=o),void 0!==a&&e.setAttribute("viewBox",a)},createAnimatedStyle:e=>new Wr(e),getComponentProps:({scrollTop:e,scrollLeft:t,...n})=>n});Zr.animated;const Kr=function({triggerAnimationOnChange:e}){const t=(0,d.useRef)(),{previous:n,prevRect:s}=(0,d.useMemo)((()=>{return{previous:t.current&&(e=t.current,{top:e.offsetTop,left:e.offsetLeft}),prevRect:t.current&&t.current.getBoundingClientRect()};var e}),[e]);return(0,d.useLayoutEffect)((()=>{if(!n||!t.current)return;if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return;const e=new _r({x:0,y:0,width:s.width,height:s.height,config:{duration:400,easing:zs.easeInOutQuint},onChange({value:e}){if(!t.current)return;let{x:n,y:s,width:i,height:r}=e;n=Math.round(n),s=Math.round(s),i=Math.round(i),r=Math.round(r);const o=0===n&&0===s;t.current.style.transformOrigin="center center",t.current.style.transform=o?null:`translate3d(${n}px,${s}px,0)`,t.current.style.width=o?null:`${i}px`,t.current.style.height=o?null:`${r}px`}});t.current.style.transform=void 0;const i=t.current.getBoundingClientRect(),r=Math.round(s.left-i.left),o=Math.round(s.top-i.top),a=i.width,l=i.height;return e.start({x:0,y:0,width:a,height:l,from:{x:r,y:o,width:s.width,height:s.height}}),()=>{e.stop(),e.set({x:0,y:0,width:s.width,height:s.height})}}),[n,s]),t},Yr=(0,oe.jsx)(Yt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Yt.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})});function Xr(){return!!(0,Qt.getQueryArg)(window.location.href,"wp_theme_preview")}function Jr(){return Xr()?(0,Qt.getQueryArg)(window.location.href,"wp_theme_preview"):null}const{useLocation:Qr}=te(Gt.privateApis);function $r({className:e="edit-site-save-button__button",variant:t="primary",showTooltip:n=!0,showReviewMessage:s,icon:i,size:r,__next40pxDefaultSize:o=!1}){const{params:a}=Qr(),{setIsSaveViewOpened:c}=(0,l.useDispatch)(zt),{saveDirtyEntities:u}=te((0,l.useDispatch)(h.store)),{dirtyEntityRecords:d}=(0,h.useEntitiesSavedStatesIsDirty)(),{isSaving:p,isSaveViewOpen:f,previewingThemeName:m}=(0,l.useSelect)((e=>{const{isSavingEntityRecord:t,isResolving:n}=e(_.store),{isSaveViewOpened:s}=e(zt),i=n("activateTheme"),r=Jr();return{isSaving:d.some((e=>t(e.kind,e.name,e.key)))||i,isSaveViewOpen:s(),previewingThemeName:r?e(_.store).getTheme(r)?.name?.rendered:void 0}}),[d]),g=!!d.length;let v;1===d.length&&(a.postId?v=`${d[0].key}`===a.postId&&d[0].name===a.postType:a.path?.includes("wp_global_styles")&&(v="globalStyles"===d[0].name));const x=p||!g&&!Xr(),w=Xr()?p?(0,b.sprintf)((0,b.__)("Activating %s"),m):x?(0,b.__)("Saved"):g?(0,b.sprintf)((0,b.__)("Activate %s & Save"),m):(0,b.sprintf)((0,b.__)("Activate %s"),m):p?(0,b.__)("Saving"):x?(0,b.__)("Saved"):!v&&s?(0,b.sprintf)((0,b._n)("Review %d change…","Review %d changes…",d.length),d.length):(0,b.__)("Save"),j=v?()=>u({dirtyEntityRecords:d}):()=>c(!0);return(0,oe.jsx)(y.Button,{variant:t,className:e,"aria-disabled":x,"aria-expanded":f,isBusy:p,onClick:x?void 0:j,label:w,shortcut:x?void 0:Jt.displayShortcut.primary("s"),showTooltip:n,icon:i,__next40pxDefaultSize:o,size:r,children:w})}function eo(){const{isDisabled:e,isSaving:t}=(0,l.useSelect)((e=>{const{__experimentalGetDirtyEntityRecords:t,isSavingEntityRecord:n}=e(_.store),s=t(),i=s.some((e=>n(e.kind,e.name,e.key)));return{isSaving:i,isDisabled:i||!s.length&&!Xr()}}),[]);return(0,oe.jsx)(y.__experimentalHStack,{className:"edit-site-save-hub",alignment:"right",spacing:4,children:(0,oe.jsx)($r,{className:"edit-site-save-hub__button",variant:e?null:"primary",showTooltip:!1,icon:e&&!t?Yr:null,showReviewMessage:!0,__next40pxDefaultSize:!0})})}const{useHistory:to,useLocation:no}=te(Gt.privateApis);const so=window.wp.apiFetch;var io=i.n(so);const{EntitiesSavedStatesExtensible:ro,NavigableRegion:oo}=te(h.privateApis),{useLocation:ao}=te(Gt.privateApis),lo=({onClose:e,renderDialog:t})=>{var n,s;const i=(0,h.useEntitiesSavedStatesIsDirty)();let r;r=i.isDirty?(0,b.__)("Activate & Save"):(0,b.__)("Activate");const o=function(){const[e,t]=(0,d.useState)();return(0,d.useEffect)((()=>{const e=(0,Qt.addQueryArgs)("/wp/v2/themes?status=active",{context:"edit",wp_theme_preview:""});io()({path:e}).then((e=>t(e[0]))).catch((()=>{}))}),[]),e}(),a=(0,l.useSelect)((e=>e(_.store).getCurrentTheme()),[]),c=(0,oe.jsx)("p",{children:(0,b.sprintf)((0,b.__)("Saving your changes will change your active theme from %1$s to %2$s."),null!==(n=o?.name?.rendered)&&void 0!==n?n:"...",null!==(s=a?.name?.rendered)&&void 0!==s?s:"...")}),u=function(){const e=to(),{path:t}=no(),{startResolution:n,finishResolution:s}=(0,l.useDispatch)(_.store);return async()=>{if(Xr()){const i="themes.php?action=activate&stylesheet="+Jr()+"&_wpnonce="+window.WP_BLOCK_THEME_ACTIVATE_NONCE;n("activateTheme"),await window.fetch(i),s("activateTheme"),e.navigate((0,Qt.addQueryArgs)(t,{wp_theme_preview:""}))}}}();return(0,oe.jsx)(ro,{...i,additionalPrompt:c,close:e,onSave:async e=>(await u(),e),saveEnabled:!0,saveLabel:r,renderDialog:t})},co=({onClose:e,renderDialog:t})=>Xr()?(0,oe.jsx)(lo,{onClose:e,renderDialog:t}):(0,oe.jsx)(h.EntitiesSavedStates,{close:e,renderDialog:t});function uo(){const{query:e}=ao(),{canvas:t="view"}=e,{isSaveViewOpen:n,isDirty:s,isSaving:i}=(0,l.useSelect)((e=>{const{__experimentalGetDirtyEntityRecords:t,isSavingEntityRecord:n,isResolving:s}=e(_.store),i=t(),r=s("activateTheme"),{isSaveViewOpened:o}=te(e(zt));return{isSaveViewOpen:o(),isDirty:i.length>0,isSaving:i.some((e=>n(e.kind,e.name,e.key)))||r}}),[]),{setIsSaveViewOpened:r}=(0,l.useDispatch)(zt),o=()=>r(!1);if((0,d.useEffect)((()=>{r(!1)}),[t,r]),"view"===t)return n?(0,oe.jsx)(y.Modal,{className:"edit-site-save-panel__modal",onRequestClose:o,__experimentalHideHeader:!0,contentLabel:(0,b.__)("Save site, content, and template changes"),children:(0,oe.jsx)(co,{onClose:o})}):null;const a=Xr()||s,c=i||!a;return(0,oe.jsxs)(oo,{className:Ut("edit-site-layout__actions",{"is-entity-save-view-open":n}),ariaLabel:(0,b.__)("Save panel"),children:[(0,oe.jsx)("div",{className:Ut("edit-site-editor__toggle-save-panel",{"screen-reader-text":n}),children:(0,oe.jsx)(y.Button,{__next40pxDefaultSize:!0,variant:"secondary",className:"edit-site-editor__toggle-save-panel-button",onClick:()=>r(!0),"aria-haspopup":"dialog",disabled:c,accessibleWhenDisabled:!0,children:(0,b.__)("Open save panel")})}),n&&(0,oe.jsx)(co,{onClose:o,renderDialog:!0})]})}const{useCommands:ho}=te(qt.privateApis),{useGlobalStyle:po}=te(x.privateApis),{NavigableRegion:fo,GlobalStylesProvider:mo}=te(h.privateApis),{useLocation:go}=te(Gt.privateApis),vo=.3;function xo(){const{query:e,name:t,areas:n,widths:s}=go(),{canvas:i="view"}=e;ho();const r=(0,v.useViewportMatch)("medium","<"),o=(0,d.useRef)(),a=(0,y.__unstableUseNavigateRegions)(),c=(0,v.useReducedMotion)(),[u,p]=(0,v.useResizeObserver)(),m=jn(),[g,x]=(0,d.useState)(!1),w=Kr({triggerAnimationOnChange:t+"-"+i}),{showIconLabels:_}=(0,l.useSelect)((e=>({showIconLabels:e(f.store).get("core","showIconLabels")}))),[j]=po("color.background"),[S]=po("color.gradient"),C=(0,v.usePrevious)(i);return(0,d.useEffect)((()=>{"edit"===C&&o.current?.focus()}),[i]),(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(h.UnsavedChangesWarning,{}),(0,oe.jsx)(Wt.CommandMenu,{}),"view"===i&&(0,oe.jsx)(wn,{}),(0,oe.jsx)("div",{...a,ref:a.ref,className:Ut("edit-site-layout",a.className,{"is-full-canvas":"edit"===i,"show-icon-labels":_}),children:(0,oe.jsxs)("div",{className:"edit-site-layout__content",children:[(!r||!n.mobile)&&(0,oe.jsx)(fo,{ariaLabel:(0,b.__)("Navigation"),className:"edit-site-layout__sidebar-region",children:(0,oe.jsx)(y.__unstableAnimatePresence,{children:"view"===i&&(0,oe.jsxs)(y.__unstableMotion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{type:"tween",duration:c||r?0:vo,ease:"easeOut"},className:"edit-site-layout__sidebar",children:[(0,oe.jsx)(cn,{ref:o,isTransparent:g}),(0,oe.jsx)(on,{shouldAnimate:"styles"!==t,routeKey:t,children:(0,oe.jsx)(h.ErrorBoundary,{children:n.sidebar})}),(0,oe.jsx)(eo,{}),(0,oe.jsx)(uo,{})]})})}),(0,oe.jsx)(h.EditorSnackbars,{}),r&&n.mobile&&(0,oe.jsxs)("div",{className:"edit-site-layout__mobile",children:["edit"!==i&&(0,oe.jsx)(on,{routeKey:t,children:(0,oe.jsx)(un,{ref:o,isTransparent:g})}),(0,oe.jsx)(h.ErrorBoundary,{children:n.mobile})]}),!r&&n.content&&"edit"!==i&&(0,oe.jsx)("div",{className:"edit-site-layout__area",style:{maxWidth:s?.content},children:(0,oe.jsx)(h.ErrorBoundary,{children:n.content})}),!r&&n.edit&&"edit"!==i&&(0,oe.jsx)("div",{className:"edit-site-layout__area",style:{maxWidth:s?.edit},children:(0,oe.jsx)(h.ErrorBoundary,{children:n.edit})}),!r&&n.preview&&(0,oe.jsxs)("div",{className:"edit-site-layout__canvas-container",children:[u,!!p.width&&(0,oe.jsx)("div",{className:Ut("edit-site-layout__canvas",{"is-right-aligned":g}),ref:w,children:(0,oe.jsx)(h.ErrorBoundary,{children:(0,oe.jsx)(xn,{isReady:!m,isFullWidth:"edit"===i,defaultSize:{width:p.width-24,height:p.height},isOversized:g,setIsOversized:x,innerContentStyle:{background:null!=S?S:j},children:n.preview})})})]})]})})]})}function yo(e){const{createErrorNotice:t}=(0,l.useDispatch)(w.store);return(0,oe.jsx)(y.SlotFillProvider,{children:(0,oe.jsxs)(mo,{children:[(0,oe.jsx)(Zt.PluginArea,{onError:function(e){t((0,b.sprintf)((0,b.__)('The "%s" plugin has encountered an error and cannot be rendered.'),e))}}),(0,oe.jsx)(xo,{...e})]})})}const bo=(0,oe.jsx)(Yt.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,oe.jsx)(Yt.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M20 12a8 8 0 1 1-16 0 8 8 0 0 1 16 0Zm-1.5 0a6.5 6.5 0 0 1-6.5 6.5v-13a6.5 6.5 0 0 1 6.5 6.5Z"})}),wo=(0,oe.jsx)(Yt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Yt.Path,{d:"M12 4.75a7.25 7.25 0 100 14.5 7.25 7.25 0 000-14.5zM3.25 12a8.75 8.75 0 1117.5 0 8.75 8.75 0 01-17.5 0zM12 8.75a1.5 1.5 0 01.167 2.99c-.465.052-.917.44-.917 1.01V14h1.5v-.845A3 3 0 109 10.25h1.5a1.5 1.5 0 011.5-1.5zM11.25 15v1.5h1.5V15h-1.5z"})}),_o=(0,oe.jsx)(Yt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Yt.Path,{d:"M15.1 4.8l-3-2.5V4c-4.4 0-8 3.6-8 8 0 3.7 2.5 6.9 6 7.7.3.1.6.1 1 .2l.2-1.5c-.4 0-.7-.1-1.1-.2l-.1.2v-.2c-2.6-.8-4.5-3.3-4.5-6.2 0-3.6 2.9-6.5 6.5-6.5v1.8l3-2.5zM20 11c-.2-1.4-.7-2.7-1.6-3.8l-1.2.8c.7.9 1.1 2 1.3 3.1L20 11zm-1.5 1.8c-.1.5-.2 1.1-.4 1.6s-.5 1-.8 1.5l1.2.9c.4-.5.8-1.1 1-1.8s.5-1.3.5-2l-1.5-.2zm-5.6 5.6l.2 1.5c1.4-.2 2.7-.7 3.8-1.6l-.9-1.1c-.9.7-2 1.1-3.1 1.2z"})}),jo=(0,oe.jsx)(Yt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Yt.Path,{d:"M12 4V2.2L9 4.8l3 2.5V5.5c3.6 0 6.5 2.9 6.5 6.5 0 2.9-1.9 5.3-4.5 6.2v.2l-.1-.2c-.4.1-.7.2-1.1.2l.2 1.5c.3 0 .6-.1 1-.2 3.5-.9 6-4 6-7.7 0-4.4-3.6-8-8-8zm-7.9 7l1.5.2c.1-1.2.5-2.3 1.2-3.2l-1.1-.9C4.8 8.2 4.3 9.6 4.1 11zm1.5 1.8l-1.5.2c.1.7.3 1.4.5 2 .3.7.6 1.3 1 1.8l1.2-.8c-.3-.5-.6-1-.8-1.5s-.4-1.1-.4-1.7zm1.5 5.5c1.1.9 2.4 1.4 3.8 1.6l.2-1.5c-1.1-.1-2.2-.5-3.1-1.2l-.9 1.1z"})}),So=(0,oe.jsx)(Yt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Yt.Path,{d:"M4 20h8v-1.5H4V20zM18.9 3.5c-.6-.6-1.5-.6-2.1 0l-7.2 7.2c-.4-.1-.7 0-1.1.1-.5.2-1.5.7-1.9 2.2-.4 1.7-.8 2.2-1.1 2.7-.1.1-.2.3-.3.4l-.6 1.1H6c2 0 3.4-.4 4.7-1.4.8-.6 1.2-1.4 1.3-2.3 0-.3 0-.5-.1-.7L19 5.7c.5-.6.5-1.6-.1-2.2zM9.7 14.7c-.7.5-1.5.8-2.4 1 .2-.5.5-1.2.8-2.3.2-.6.4-1 .8-1.1.5-.1 1 .1 1.3.3.2.2.3.5.2.8 0 .3-.1.9-.7 1.3z"})}),Co=(0,oe.jsx)(Yt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Yt.Path,{d:"M5.5 12h1.75l-2.5 3-2.5-3H4a8 8 0 113.134 6.35l.907-1.194A6.5 6.5 0 105.5 12zm9.53 1.97l-2.28-2.28V8.5a.75.75 0 00-1.5 0V12a.747.747 0 00.218.529l1.282-.84-1.28.842 2.5 2.5a.75.75 0 101.06-1.061z"})}),ko=(0,oe.jsx)(Yt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Yt.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"})}),{useGlobalStylesReset:Eo}=te(x.privateApis),{useHistory:Po,useLocation:Io}=te(Gt.privateApis),To=()=>function(){const{openGeneralSidebar:e}=te((0,l.useDispatch)(zt)),{params:t}=Io(),{canvas:n="view"}=t,s=Po(),i=(0,l.useSelect)((e=>e(_.store).getCurrentTheme().is_block_theme),[]);return{isLoading:!1,commands:(0,d.useMemo)((()=>i?[{name:"core/edit-site/open-styles",label:(0,b.__)("Open styles"),callback:({close:t})=>{t(),"edit"!==n&&s.navigate("/styles?canvas=edit",{transition:"canvas-mode-edit-transition"}),e("edit-site/global-styles")},icon:bo}]:[]),[s,e,n,i])}},Oo=()=>function(){const{openGeneralSidebar:e}=te((0,l.useDispatch)(zt)),{params:t}=Io(),{canvas:n="view"}=t,{set:s}=(0,l.useDispatch)(f.store),i=Po(),r=(0,l.useSelect)((e=>e(_.store).getCurrentTheme().is_block_theme),[]);return{isLoading:!1,commands:(0,d.useMemo)((()=>r?[{name:"core/edit-site/toggle-styles-welcome-guide",label:(0,b.__)("Learn about styles"),callback:({close:t})=>{t(),"edit"!==n&&i.navigate("/styles?canvas=edit",{transition:"canvas-mode-edit-transition"}),e("edit-site/global-styles"),s("core/edit-site","welcomeGuideStyles",!0),setTimeout((()=>{s("core/edit-site","welcomeGuideStyles",!0)}),500)},icon:wo}]:[]),[i,e,n,r,s])}},Ao=()=>function(){const[e,t]=Eo();return{isLoading:!1,commands:(0,d.useMemo)((()=>e?[{name:"core/edit-site/reset-global-styles",label:(0,b.__)("Reset styles"),icon:(0,b.isRTL)()?_o:jo,callback:({close:e})=>{e(),t()}}]:[]),[e,t])}},No=()=>function(){const{openGeneralSidebar:e,setEditorCanvasContainerView:t}=te((0,l.useDispatch)(zt)),{params:n}=Io(),{canvas:s="view"}=n,i=Po(),{canEditCSS:r}=(0,l.useSelect)((e=>{const{getEntityRecord:t,__experimentalGetCurrentGlobalStylesId:n}=e(_.store),s=n(),i=s?t("root","globalStyles",s):void 0;return{canEditCSS:!!i?._links?.["wp:action-edit-css"]}}),[]);return{isLoading:!1,commands:(0,d.useMemo)((()=>r?[{name:"core/edit-site/open-styles-css",label:(0,b.__)("Customize CSS"),icon:So,callback:({close:n})=>{n(),"edit"!==s&&i.navigate("/styles?canvas=edit",{transition:"canvas-mode-edit-transition"}),e("edit-site/global-styles"),t("global-styles-css")}}]:[]),[i,e,t,r,s])}},Mo=()=>function(){const{openGeneralSidebar:e,setEditorCanvasContainerView:t}=te((0,l.useDispatch)(zt)),{params:n}=Io(),{canvas:s="view"}=n,i=Po(),r=(0,l.useSelect)((e=>{const{getEntityRecord:t,__experimentalGetCurrentGlobalStylesId:n}=e(_.store),s=n(),i=s?t("root","globalStyles",s):void 0;return!!i?._links?.["version-history"]?.[0]?.count}),[]);return{isLoading:!1,commands:(0,d.useMemo)((()=>r?[{name:"core/edit-site/open-global-styles-revisions",label:(0,b.__)("Style revisions"),icon:Co,callback:({close:n})=>{n(),"edit"!==s&&i.navigate("/styles?canvas=edit",{transition:"canvas-mode-edit-transition"}),e("edit-site/global-styles"),t("global-styles-revisions")}}]:[]),[r,i,e,t,s])}};const Fo=(0,oe.jsx)(Yt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Yt.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"})}),{EditorContentSlotFill:Vo,ResizableEditor:Ro}=te(h.privateApis);function Bo(e){switch(e){case"style-book":return(0,b.__)("Style Book");case"global-styles-revisions":case"global-styles-revisions:style-book":return(0,b.__)("Style Revisions");default:return""}}function Do(){const e=(0,y.__experimentalUseSlotFills)(Vo.name);return!!e?.length}const Lo=function({children:e,closeButtonLabel:t,onClose:n,enableResizing:s=!1}){const{editorCanvasContainerView:i,showListViewByDefault:r}=(0,l.useSelect)((e=>({editorCanvasContainerView:te(e(zt)).getEditorCanvasContainerView(),showListViewByDefault:e(f.store).get("core","showListViewByDefault")})),[]),[o,a]=(0,d.useState)(!1),{setEditorCanvasContainerView:c}=te((0,l.useDispatch)(zt)),{setIsListViewOpened:u}=(0,l.useDispatch)(h.store),p=(0,v.useFocusOnMount)("firstElement"),m=(0,v.useFocusReturn)();function g(){u(r),c(void 0),a(!0),"function"==typeof n&&n()}const x=Array.isArray(e)?d.Children.map(e,((e,t)=>0===t?(0,d.cloneElement)(e,{ref:m}):e)):(0,d.cloneElement)(e,{ref:m});if(o)return null;const w=Bo(i),_=n||t;return(0,oe.jsx)(Vo.Fill,{children:(0,oe.jsx)("div",{className:"edit-site-editor-canvas-container",children:(0,oe.jsx)(Ro,{enableResizing:s,children:(0,oe.jsxs)("section",{className:"edit-site-editor-canvas-container__section",ref:_?p:null,onKeyDown:function(e){e.keyCode!==Jt.ESCAPE||e.defaultPrevented||(e.preventDefault(),g())},"aria-label":w,children:[_&&(0,oe.jsx)(y.Button,{size:"compact",className:"edit-site-editor-canvas-container__close-button",icon:Fo,label:t||(0,b.__)("Close"),onClick:g}),x]})})})})},{useCommandContext:zo}=te(Wt.privateApis),{useLocation:Go}=te(Gt.privateApis);const Ho=(0,oe.jsx)(Yt.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,oe.jsx)(Yt.Path,{d:"M12 4c-4.4 0-8 3.6-8 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8zm0 14.5c-3.6 0-6.5-2.9-6.5-6.5S8.4 5.5 12 5.5s6.5 2.9 6.5 6.5-2.9 6.5-6.5 6.5zM9 16l4.5-3L15 8.4l-4.5 3L9 16z"})}),Uo=(0,oe.jsxs)(Yt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,oe.jsx)(Yt.Path,{d:"M15.5 7.5h-7V9h7V7.5Zm-7 3.5h7v1.5h-7V11Zm7 3.5h-7V16h7v-1.5Z"}),(0,oe.jsx)(Yt.Path,{d:"M17 4H7a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2ZM7 5.5h10a.5.5 0 0 1 .5.5v12a.5.5 0 0 1-.5.5H7a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .5-.5Z"})]}),Wo=(0,oe.jsx)(Yt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Yt.Path,{d:"M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"})}),qo=(0,oe.jsx)(Yt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Yt.Path,{d:"M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-1 1.4l-5.6 5.6c-.1.1-.3.1-.4 0l-5.6-5.6c-.1-.1-.1-.3 0-.4l5.6-5.6s.1-.1.2-.1.1 0 .2.1l5.6 5.6c.1.1.1.3 0 .4zm-16.6-.4L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"})}),Zo=(0,oe.jsx)(Yt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Yt.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"})}),Ko=(0,oe.jsx)(Yt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Yt.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"})});function Yo(e){return(0,oe.jsx)(y.Button,{size:"compact",...e,className:Ut("edit-site-sidebar-button",e.className)})}const{useHistory:Xo,useLocation:Jo}=te(Gt.privateApis);function Qo({isRoot:e,title:t,actions:n,meta:s,content:i,footer:r,description:o,backPath:a}){const{dashboardLink:c,dashboardLinkText:u,previewingThemeName:h}=(0,l.useSelect)((e=>{const{getSettings:t}=te(e(zt)),n=Jr();return{dashboardLink:t().__experimentalDashboardLink,dashboardLinkText:t().__experimentalDashboardLinkText,previewingThemeName:n?e(_.store).getTheme(n)?.name?.rendered:void 0}}),[]),p=Jo(),f=Xo(),{navigate:m}=(0,d.useContext)(nn),g=null!=a?a:p.state?.backPath,v=(0,b.isRTL)()?Zo:Ko;return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsxs)(y.__experimentalVStack,{className:Ut("edit-site-sidebar-navigation-screen__main",{"has-footer":!!r}),spacing:0,justify:"flex-start",children:[(0,oe.jsxs)(y.__experimentalHStack,{spacing:3,alignment:"flex-start",className:"edit-site-sidebar-navigation-screen__title-icon",children:[!e&&(0,oe.jsx)(Yo,{onClick:()=>{f.navigate(g),m("back")},icon:v,label:(0,b.__)("Back"),showTooltip:!1}),e&&(0,oe.jsx)(Yo,{icon:v,label:u||(0,b.__)("Go to the Dashboard"),href:c}),(0,oe.jsx)(y.__experimentalHeading,{className:"edit-site-sidebar-navigation-screen__title",color:"#e0e0e0",level:1,size:20,children:Xr()?(0,b.sprintf)((0,b.__)("Previewing %1$s: %2$s"),h,t):t}),n&&(0,oe.jsx)("div",{className:"edit-site-sidebar-navigation-screen__actions",children:n})]}),s&&(0,oe.jsx)(oe.Fragment,{children:(0,oe.jsx)("div",{className:"edit-site-sidebar-navigation-screen__meta",children:s})}),(0,oe.jsxs)("div",{className:"edit-site-sidebar-navigation-screen__content",children:[o&&(0,oe.jsx)("p",{className:"edit-site-sidebar-navigation-screen__description",children:o}),i]})]}),r&&(0,oe.jsx)("footer",{className:"edit-site-sidebar-navigation-screen__footer",children:r})]})}const $o=(0,d.forwardRef)((function({icon:e,size:t=24,...n},s){return(0,d.cloneElement)(e,{width:t,height:t,...n,ref:s})})),ea=(0,oe.jsx)(Yt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Yt.Path,{d:"m13.1 16-3.4-4 3.4-4 1.1 1-2.6 3 2.6 3-1.1 1z"})}),ta=(0,oe.jsx)(Yt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Yt.Path,{d:"M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z"})}),{useHistory:na,useLink:sa}=te(Gt.privateApis);function ia({className:e,icon:t,withChevron:n=!1,suffix:s,uid:i,to:r,onClick:o,children:a,...l}){const c=na(),{navigate:u}=(0,d.useContext)(nn);const h=sa(r);return(0,oe.jsx)(y.__experimentalItem,{className:Ut("edit-site-sidebar-navigation-item",{"with-suffix":!n&&s},e),id:i,onClick:function(e){o?(o(e),u("forward")):r&&(e.preventDefault(),c.navigate(r),u("forward",`[id="${i}"]`))},href:r?h.href:void 0,...l,children:(0,oe.jsxs)(y.__experimentalHStack,{justify:"flex-start",children:[t&&(0,oe.jsx)($o,{style:{fill:"currentcolor"},icon:t,size:24}),(0,oe.jsx)(y.FlexBlock,{children:a}),n&&(0,oe.jsx)($o,{icon:(0,b.isRTL)()?ea:ta,className:"edit-site-sidebar-navigation-item__drilldown-indicator",size:24}),!n&&s]})})}const ra={per_page:-1,_fields:"id,name,avatar_urls",context:"view",capabilities:["edit_theme_options"]},oa={per_page:100,page:1},aa=[],{GlobalStylesContext:la}=te(x.privateApis);function ca({query:e}={}){const{user:t}=(0,d.useContext)(la),n={...oa,...e},{authors:s,currentUser:i,isDirty:r,revisions:o,isLoadingGlobalStylesRevisions:a,revisionsCount:c}=(0,l.useSelect)((e=>{var t;const{__experimentalGetDirtyEntityRecords:s,getCurrentUser:i,getUsers:r,getRevisions:o,__experimentalGetCurrentGlobalStylesId:a,getEntityRecord:l,isResolving:c}=e(_.store),u=s(),d=i(),h=u.length>0,p=a(),f=p?l("root","globalStyles",p):void 0,m=null!==(t=f?._links?.["version-history"]?.[0]?.count)&&void 0!==t?t:0,g=o("root","globalStyles",p,n)||aa;return{authors:r(ra)||aa,currentUser:d,isDirty:h,revisions:g,isLoadingGlobalStylesRevisions:c("getRevisions",["root","globalStyles",p,n]),revisionsCount:m}}),[e]);return(0,d.useMemo)((()=>{if(!s.length||a)return{revisions:aa,hasUnsavedChanges:r,isLoading:!0,revisionsCount:c};const e=o.map((e=>({...e,author:s.find((t=>t.id===e.author))})));if(o.length){if("unsaved"!==e[0].id&&1===n.page&&(e[0].isLatest=!0),r&&t&&Object.keys(t).length>0&&i&&1===n.page){const n={id:"unsaved",styles:t?.styles,settings:t?.settings,_links:t?._links,author:{name:i?.name,avatar_urls:i?.avatar_urls},modified:new Date};e.unshift(n)}n.page===Math.ceil(c/n.per_page)&&e.push({id:"parent",styles:{},settings:{}})}return{revisions:e,hasUnsavedChanges:r,isLoading:!1,revisionsCount:c}}),[r,o,i,s,t,a])}function ua({record:e,revisionsCount:t,...n}){var s;const i={},r=null!==(s=e?._links?.["predecessor-version"]?.[0]?.id)&&void 0!==s?s:null;return t=t||e?._links?.["version-history"]?.[0]?.count||0,r&&t>1&&(i.href=(0,Qt.addQueryArgs)("revision.php",{revision:e?._links["predecessor-version"][0].id}),i.as="a"),(0,oe.jsx)(y.__experimentalItemGroup,{size:"large",className:"edit-site-sidebar-navigation-screen-details-footer",children:(0,oe.jsx)(ia,{icon:Co,...i,...n,children:(0,b.sprintf)((0,b._n)("%d Revision","%d Revisions",t),t)})})}const{useLocation:da,useHistory:ha}=te(Gt.privateApis);function pa(e){const{name:t}=da();return(0,oe.jsx)(ia,{...e,"aria-current":"styles"===t})}function fa(){const e=ha(),{path:t}=da(),{revisions:n,isLoading:s,revisionsCount:i}=ca(),{openGeneralSidebar:r}=(0,l.useDispatch)(zt),{setEditorCanvasContainerView:o}=te((0,l.useDispatch)(zt)),{set:a}=(0,l.useDispatch)(f.store),c=(0,d.useCallback)((async()=>(e.navigate((0,Qt.addQueryArgs)(t,{canvas:"edit"}),{transition:"canvas-mode-edit-transition"}),Promise.all([a("core","distractionFree",!1),r("edit-site/global-styles")]))),[t,e,r,a]),u=(0,d.useCallback)((async()=>{await c(),o("global-styles-revisions")}),[c,o]),h=!!i&&!s;return(0,oe.jsx)(oe.Fragment,{children:(0,oe.jsx)(Qo,{title:(0,b.__)("Design"),isRoot:!0,description:(0,b.__)("Customize the appearance of your website using the block editor."),content:(0,oe.jsx)(ma,{activeItem:"styles-navigation-item"}),footer:h&&(0,oe.jsx)(ua,{record:n?.[0],revisionsCount:i,onClick:u})})})}function ma({isBlockBasedTheme:e=!0}){return(0,oe.jsxs)(y.__experimentalItemGroup,{className:"edit-site-sidebar-navigation-screen-main",children:[e&&(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(ia,{uid:"navigation-navigation-item",to:"/navigation",withChevron:!0,icon:Ho,children:(0,b.__)("Navigation")}),(0,oe.jsx)(pa,{to:"/styles",uid:"global-styles-navigation-item",icon:bo,children:(0,b.__)("Styles")}),(0,oe.jsx)(ia,{uid:"page-navigation-item",to:"/page",withChevron:!0,icon:Uo,children:(0,b.__)("Pages")}),(0,oe.jsx)(ia,{uid:"template-navigation-item",to:"/template",withChevron:!0,icon:Wo,children:(0,b.__)("Templates")})]}),!e&&(0,oe.jsx)(ia,{uid:"stylebook-navigation-item",to:"/stylebook",withChevron:!0,icon:bo,children:(0,b.__)("Styles")}),(0,oe.jsx)(ia,{uid:"patterns-navigation-item",to:"/pattern",withChevron:!0,icon:qo,children:(0,b.__)("Patterns")})]})}function ga(){const e=(0,l.useSelect)((e=>e(_.store).getCurrentTheme()?.is_block_theme),[]),{setEditorCanvasContainerView:t}=te((0,l.useDispatch)(zt));return(0,d.useEffect)((()=>{t(void 0)}),[t]),(0,oe.jsx)(Qo,{isRoot:!0,title:(0,b.__)("Design"),description:e?(0,b.__)("Customize the appearance of your website using the block editor."):(0,b.__)("Explore block styles and patterns to refine your site"),content:(0,oe.jsx)(ma,{isBlockBasedTheme:e})})}const va=(0,oe.jsx)(Yt.SVG,{width:"24",height:"24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,oe.jsx)(Yt.Path,{d:"M14 6H6v8h1.5V8.5L17 18l1-1-9.5-9.5H14V6Z"})});function xa({nonAnimatedSrc:e,animatedSrc:t}){return(0,oe.jsxs)("picture",{className:"edit-site-welcome-guide__image",children:[(0,oe.jsx)("source",{srcSet:e,media:"(prefers-reduced-motion: reduce)"}),(0,oe.jsx)("img",{src:t,width:"312",height:"240",alt:""})]})}function ya(){const{toggle:e}=(0,l.useDispatch)(f.store),{isActive:t,isBlockBasedTheme:n}=(0,l.useSelect)((e=>({isActive:!!e(f.store).get("core/edit-site","welcomeGuide"),isBlockBasedTheme:e(_.store).getCurrentTheme()?.is_block_theme})),[]);return t&&n?(0,oe.jsx)(y.Guide,{className:"edit-site-welcome-guide guide-editor",contentLabel:(0,b.__)("Welcome to the site editor"),finishButtonText:(0,b.__)("Get started"),onFinish:()=>e("core/edit-site","welcomeGuide"),pages:[{image:(0,oe.jsx)(xa,{nonAnimatedSrc:"https://s.w.org/images/block-editor/edit-your-site.svg?1",animatedSrc:"https://s.w.org/images/block-editor/edit-your-site.gif?1"}),content:(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)("h1",{className:"edit-site-welcome-guide__heading",children:(0,b.__)("Edit your site")}),(0,oe.jsx)("p",{className:"edit-site-welcome-guide__text",children:(0,b.__)("Design everything on your site — from the header right down to the footer — using blocks.")}),(0,oe.jsx)("p",{className:"edit-site-welcome-guide__text",children:(0,d.createInterpolateElement)((0,b.__)("Click to start designing your blocks, and choose your typography, layout, and colors."),{StylesIconImage:(0,oe.jsx)("img",{alt:(0,b.__)("styles"),src:"data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 4c-4.4 0-8 3.6-8 8v.1c0 4.1 3.2 7.5 7.2 7.9h.8c4.4 0 8-3.6 8-8s-3.6-8-8-8zm0 15V5c3.9 0 7 3.1 7 7s-3.1 7-7 7z' fill='%231E1E1E'/%3E%3C/svg%3E%0A"})})})]})}]}):null}const{interfaceStore:ba}=te(h.privateApis);function wa(){const{toggle:e}=(0,l.useDispatch)(f.store),{isActive:t,isStylesOpen:n}=(0,l.useSelect)((e=>{const t=e(ba).getActiveComplementaryArea("core");return{isActive:!!e(f.store).get("core/edit-site","welcomeGuideStyles"),isStylesOpen:"edit-site/global-styles"===t}}),[]);if(!t||!n)return null;const s=(0,b.__)("Welcome to Styles");return(0,oe.jsx)(y.Guide,{className:"edit-site-welcome-guide guide-styles",contentLabel:s,finishButtonText:(0,b.__)("Get started"),onFinish:()=>e("core/edit-site","welcomeGuideStyles"),pages:[{image:(0,oe.jsx)(xa,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-to-styles.svg?1",animatedSrc:"https://s.w.org/images/block-editor/welcome-to-styles.gif?1"}),content:(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)("h1",{className:"edit-site-welcome-guide__heading",children:s}),(0,oe.jsx)("p",{className:"edit-site-welcome-guide__text",children:(0,b.__)("Tweak your site, or give it a whole new look! Get creative — how about a new color palette for your buttons, or choosing a new font? Take a look at what you can do here.")})]})},{image:(0,oe.jsx)(xa,{nonAnimatedSrc:"https://s.w.org/images/block-editor/set-the-design.svg?1",animatedSrc:"https://s.w.org/images/block-editor/set-the-design.gif?1"}),content:(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)("h1",{className:"edit-site-welcome-guide__heading",children:(0,b.__)("Set the design")}),(0,oe.jsx)("p",{className:"edit-site-welcome-guide__text",children:(0,b.__)("You can customize your site as much as you like with different colors, typography, and layouts. Or if you prefer, just leave it up to your theme to handle!")})]})},{image:(0,oe.jsx)(xa,{nonAnimatedSrc:"https://s.w.org/images/block-editor/personalize-blocks.svg?1",animatedSrc:"https://s.w.org/images/block-editor/personalize-blocks.gif?1"}),content:(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)("h1",{className:"edit-site-welcome-guide__heading",children:(0,b.__)("Personalize blocks")}),(0,oe.jsx)("p",{className:"edit-site-welcome-guide__text",children:(0,b.__)("You can adjust your blocks to ensure a cohesive experience across your site — add your unique colors to a branded Button block, or adjust the Heading block to your preferred size.")})]})},{image:(0,oe.jsx)(xa,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-documentation.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-documentation.gif"}),content:(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)("h1",{className:"edit-site-welcome-guide__heading",children:(0,b.__)("Learn more")}),(0,oe.jsxs)("p",{className:"edit-site-welcome-guide__text",children:[(0,b.__)("New to block themes and styling your site?")," ",(0,oe.jsx)(y.ExternalLink,{href:(0,b.__)("https://wordpress.org/documentation/article/styles-overview/"),children:(0,b.__)("Here’s a detailed guide to learn how to make the most of it.")})]})]})}]})}function _a(){const{toggle:e}=(0,l.useDispatch)(f.store);if(!(0,l.useSelect)((e=>{const t=!!e(f.store).get("core/edit-site","welcomeGuidePage"),n=!!e(f.store).get("core/edit-site","welcomeGuide");return t&&!n}),[]))return null;const t=(0,b.__)("Editing a page");return(0,oe.jsx)(y.Guide,{className:"edit-site-welcome-guide guide-page",contentLabel:t,finishButtonText:(0,b.__)("Continue"),onFinish:()=>e("core/edit-site","welcomeGuidePage"),pages:[{image:(0,oe.jsx)("video",{className:"edit-site-welcome-guide__video",autoPlay:!0,loop:!0,muted:!0,width:"312",height:"240",children:(0,oe.jsx)("source",{src:"https://s.w.org/images/block-editor/editing-your-page.mp4",type:"video/mp4"})}),content:(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)("h1",{className:"edit-site-welcome-guide__heading",children:t}),(0,oe.jsx)("p",{className:"edit-site-welcome-guide__text",children:(0,b.__)("It’s now possible to edit page content in the site editor. To customise other parts of the page like the header and footer switch to editing the template using the settings sidebar.")})]})}]})}function ja(){const{toggle:e}=(0,l.useDispatch)(f.store),{isActive:t,hasPreviousEntity:n}=(0,l.useSelect)((e=>{const{getEditorSettings:t}=e(h.store),{get:n}=e(f.store);return{isActive:n("core/edit-site","welcomeGuideTemplate"),hasPreviousEntity:!!t().onNavigateToPreviousEntityRecord}}),[]);if(!(t&&n))return null;const s=(0,b.__)("Editing a template");return(0,oe.jsx)(y.Guide,{className:"edit-site-welcome-guide guide-template",contentLabel:s,finishButtonText:(0,b.__)("Continue"),onFinish:()=>e("core/edit-site","welcomeGuideTemplate"),pages:[{image:(0,oe.jsx)("video",{className:"edit-site-welcome-guide__video",autoPlay:!0,loop:!0,muted:!0,width:"312",height:"240",children:(0,oe.jsx)("source",{src:"https://s.w.org/images/block-editor/editing-your-template.mp4",type:"video/mp4"})}),content:(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)("h1",{className:"edit-site-welcome-guide__heading",children:s}),(0,oe.jsx)("p",{className:"edit-site-welcome-guide__text",children:(0,b.__)("Note that the same template can be used by multiple pages, so any changes made here may affect other pages on the site. To switch back to editing the page content click the ‘Back’ button in the toolbar.")})]})}]})}function Sa({postType:e}){return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(ya,{}),(0,oe.jsx)(wa,{}),"page"===e&&(0,oe.jsx)(_a,{}),"wp_template"===e&&(0,oe.jsx)(ja,{})]})}const{useGlobalStylesOutput:Ca}=te(x.privateApis);function ka({disableRootPadding:e}){return function(e){const[t,n]=Ca(e),{getSettings:s}=(0,l.useSelect)(zt),{updateSettings:i}=(0,l.useDispatch)(zt);(0,d.useEffect)((()=>{var e;if(!t||!n)return;const r=s(),o=Object.values(null!==(e=r.styles)&&void 0!==e?e:[]).filter((e=>!e.isGlobalStyles));i({...r,styles:[...o,...t],__experimentalFeatures:n})}),[t,n,i,s])}(e),null}const{Theme:Ea}=te(y.privateApis),{useGlobalStyle:Pa}=te(x.privateApis);function Ia({id:e}){var t;const[n]=Pa("color.text"),[s]=Pa("color.background"),{highlightedColors:i}=ie(),r=null!==(t=i[0]?.color)&&void 0!==t?t:n,{elapsed:o,total:a}=(0,l.useSelect)((e=>{var t,n;const s=e(_.store).countSelectorsByStatus(),i=null!==(t=s.resolving)&&void 0!==t?t:0,r=null!==(n=s.finished)&&void 0!==n?n:0;return{elapsed:r,total:r+i}}),[]);return(0,oe.jsx)("div",{className:"edit-site-canvas-loader",children:(0,oe.jsx)(Ea,{accent:r,background:s,children:(0,oe.jsx)(y.ProgressBar,{id:e,max:a,value:o})})})}const{useHistory:Ta}=te(Gt.privateApis);const{useLocation:Oa,useHistory:Aa}=te(Gt.privateApis);function Na(){const{query:e}=Oa(),{canvas:t="view"}=e,n=function(){const e=Ta();return(0,d.useCallback)((t=>{e.navigate(`/${t.postType}/${t.postId}?canvas=edit&focusMode=true`)}),[e])}(),{settings:s}=(0,l.useSelect)((e=>{const{getSettings:t}=e(zt);return{settings:t()}}),[]),i=function(){const e=Oa(),t=(0,v.usePrevious)(e),n=Aa();return(0,d.useMemo)((()=>{const s=e.query.focusMode||e?.params?.postId&&Me.includes(e?.params?.postType),i="edit"===t?.query.canvas;return s&&i?()=>n.back():void 0}),[e,n])}();return(0,d.useMemo)((()=>({...s,richEditingEnabled:!0,supportsTemplateMode:!0,focusMode:"view"!==t,onNavigateToEntityRecord:n,onNavigateToPreviousEntityRecord:i,isPreviewMode:"view"===t})),[s,t,n,i])}const{Fill:Ma,Slot:Fa}=(0,y.createSlotFill)("PluginTemplateSettingPanel"),Va=({children:e})=>{u()("wp.editSite.PluginTemplateSettingPanel",{since:"6.6",version:"6.8",alternative:"wp.editor.PluginDocumentSettingPanel"});return(0,l.useSelect)((e=>"wp_template"===e(h.store).getCurrentPostType()),[])?(0,oe.jsx)(Ma,{children:e}):null};Va.Slot=Fa;const Ra=Va,Ba=(0,oe.jsx)(Yt.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,oe.jsx)(Yt.Path,{d:"M3.99961 13C4.67043 13.3354 4.6703 13.3357 4.67017 13.3359L4.67298 13.3305C4.67621 13.3242 4.68184 13.3135 4.68988 13.2985C4.70595 13.2686 4.7316 13.2218 4.76695 13.1608C4.8377 13.0385 4.94692 12.8592 5.09541 12.6419C5.39312 12.2062 5.84436 11.624 6.45435 11.0431C7.67308 9.88241 9.49719 8.75 11.9996 8.75C14.502 8.75 16.3261 9.88241 17.5449 11.0431C18.1549 11.624 18.6061 12.2062 18.9038 12.6419C19.0523 12.8592 19.1615 13.0385 19.2323 13.1608C19.2676 13.2218 19.2933 13.2686 19.3093 13.2985C19.3174 13.3135 19.323 13.3242 19.3262 13.3305L19.3291 13.3359C19.3289 13.3357 19.3288 13.3354 19.9996 13C20.6704 12.6646 20.6703 12.6643 20.6701 12.664L20.6697 12.6632L20.6688 12.6614L20.6662 12.6563L20.6583 12.6408C20.6517 12.6282 20.6427 12.6108 20.631 12.5892C20.6078 12.5459 20.5744 12.4852 20.5306 12.4096C20.4432 12.2584 20.3141 12.0471 20.1423 11.7956C19.7994 11.2938 19.2819 10.626 18.5794 9.9569C17.1731 8.61759 14.9972 7.25 11.9996 7.25C9.00203 7.25 6.82614 8.61759 5.41987 9.9569C4.71736 10.626 4.19984 11.2938 3.85694 11.7956C3.68511 12.0471 3.55605 12.2584 3.4686 12.4096C3.42484 12.4852 3.39142 12.5459 3.36818 12.5892C3.35656 12.6108 3.34748 12.6282 3.34092 12.6408L3.33297 12.6563L3.33041 12.6614L3.32948 12.6632L3.32911 12.664C3.32894 12.6643 3.32879 12.6646 3.99961 13ZM11.9996 16C13.9326 16 15.4996 14.433 15.4996 12.5C15.4996 10.567 13.9326 9 11.9996 9C10.0666 9 8.49961 10.567 8.49961 12.5C8.49961 14.433 10.0666 16 11.9996 16Z"})}),Da=(0,oe.jsx)(Yt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Yt.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"})});function La({className:e,...t}){return(0,oe.jsx)(y.Icon,{className:Ut(e,"edit-site-global-styles-icon-with-current-color"),...t})}function za({icon:e,children:t,...n}){return(0,oe.jsxs)(y.__experimentalItem,{...n,children:[e&&(0,oe.jsxs)(y.__experimentalHStack,{justify:"flex-start",children:[(0,oe.jsx)(La,{icon:e,size:24}),(0,oe.jsx)(y.FlexItem,{children:t})]}),!e&&t]})}function Ga(e){return(0,oe.jsx)(y.Navigator.Button,{as:za,...e})}const Ha=(0,oe.jsx)(Yt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Yt.Path,{d:"M6.9 7L3 17.8h1.7l1-2.8h4.1l1 2.8h1.7L8.6 7H6.9zm-.7 6.6l1.5-4.3 1.5 4.3h-3zM21.6 17c-.1.1-.2.2-.3.2-.1.1-.2.1-.4.1s-.3-.1-.4-.2c-.1-.1-.1-.3-.1-.6V12c0-.5 0-1-.1-1.4-.1-.4-.3-.7-.5-1-.2-.2-.5-.4-.9-.5-.4 0-.8-.1-1.3-.1s-1 .1-1.4.2c-.4.1-.7.3-1 .4-.2.2-.4.3-.6.5-.1.2-.2.4-.2.7 0 .3.1.5.2.8.2.2.4.3.8.3.3 0 .6-.1.8-.3.2-.2.3-.4.3-.7 0-.3-.1-.5-.2-.7-.2-.2-.4-.3-.6-.4.2-.2.4-.3.7-.4.3-.1.6-.1.8-.1.3 0 .6 0 .8.1.2.1.4.3.5.5.1.2.2.5.2.9v1.1c0 .3-.1.5-.3.6-.2.2-.5.3-.9.4-.3.1-.7.3-1.1.4-.4.1-.8.3-1.1.5-.3.2-.6.4-.8.7-.2.3-.3.7-.3 1.2 0 .6.2 1.1.5 1.4.3.4.9.5 1.6.5.5 0 1-.1 1.4-.3.4-.2.8-.6 1.1-1.1 0 .4.1.7.3 1 .2.3.6.4 1.2.4.4 0 .7-.1.9-.2.2-.1.5-.3.7-.4h-.3zm-3-.9c-.2.4-.5.7-.8.8-.3.2-.6.2-.8.2-.4 0-.6-.1-.9-.3-.2-.2-.3-.6-.3-1.1 0-.5.1-.9.3-1.2s.5-.5.8-.7c.3-.2.7-.3 1-.5.3-.1.6-.3.7-.6v3.4z"})}),Ua=(0,oe.jsx)(Yt.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,oe.jsx)(Yt.Path,{d:"M17.2 10.9c-.5-1-1.2-2.1-2.1-3.2-.6-.9-1.3-1.7-2.1-2.6L12 4l-1 1.1c-.6.9-1.3 1.7-2 2.6-.8 1.2-1.5 2.3-2 3.2-.6 1.2-1 2.2-1 3 0 3.4 2.7 6.1 6.1 6.1s6.1-2.7 6.1-6.1c0-.8-.3-1.8-1-3zm-5.1 7.6c-2.5 0-4.6-2.1-4.6-4.6 0-.3.1-1 .8-2.3.5-.9 1.1-1.9 2-3.1.7-.9 1.3-1.7 1.8-2.3.7.8 1.3 1.6 1.8 2.3.8 1.1 1.5 2.2 2 3.1.7 1.3.8 2 .8 2.3 0 2.5-2.1 4.6-4.6 4.6z"})}),Wa=(0,oe.jsx)(Yt.SVG,{width:"24",height:"24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,oe.jsx)(Yt.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M11.53 4.47a.75.75 0 1 0-1.06 1.06l8 8a.75.75 0 1 0 1.06-1.06l-8-8Zm5 1a.75.75 0 1 0-1.06 1.06l2 2a.75.75 0 1 0 1.06-1.06l-2-2Zm-11.06 10a.75.75 0 0 1 1.06 0l2 2a.75.75 0 1 1-1.06 1.06l-2-2a.75.75 0 0 1 0-1.06Zm.06-5a.75.75 0 0 0-1.06 1.06l8 8a.75.75 0 1 0 1.06-1.06l-8-8Zm-.06-3a.75.75 0 0 1 1.06 0l10 10a.75.75 0 1 1-1.06 1.06l-10-10a.75.75 0 0 1 0-1.06Zm3.06-2a.75.75 0 0 0-1.06 1.06l10 10a.75.75 0 1 0 1.06-1.06l-10-10Z"})}),qa=(0,oe.jsx)(Yt.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,oe.jsx)(Yt.Path,{d:"M12 8c-2.2 0-4 1.8-4 4s1.8 4 4 4 4-1.8 4-4-1.8-4-4-4zm0 6.5c-1.4 0-2.5-1.1-2.5-2.5s1.1-2.5 2.5-2.5 2.5 1.1 2.5 2.5-1.1 2.5-2.5 2.5zM12.8 3h-1.5v3h1.5V3zm-1.6 18h1.5v-3h-1.5v3zm6.8-9.8v1.5h3v-1.5h-3zm-12 0H3v1.5h3v-1.5zm9.7 5.6 2.1 2.1 1.1-1.1-2.1-2.1-1.1 1.1zM8.3 7.2 6.2 5.1 5.1 6.2l2.1 2.1 1.1-1.1zM5.1 17.8l1.1 1.1 2.1-2.1-1.1-1.1-2.1 2.1zM18.9 6.2l-1.1-1.1-2.1 2.1 1.1 1.1 2.1-2.1z"})}),{useHasDimensionsPanel:Za,useHasTypographyPanel:Ka,useHasColorPanel:Ya,useGlobalSetting:Xa,useSettingsForBlockElement:Ja,useHasBackgroundPanel:Qa}=te(x.privateApis);const $a=function(){const[e]=Xa(""),t=Ja(e),n=Qa(e),s=Ka(t),i=Ya(t),r=Za(t);return(0,oe.jsx)(oe.Fragment,{children:(0,oe.jsxs)(y.__experimentalItemGroup,{children:[s&&(0,oe.jsx)(Ga,{icon:Ha,path:"/typography",children:(0,b.__)("Typography")}),i&&(0,oe.jsx)(Ga,{icon:Ua,path:"/colors",children:(0,b.__)("Colors")}),n&&(0,oe.jsx)(Ga,{icon:Wa,path:"/background","aria-label":(0,b.__)("Background styles"),children:(0,b.__)("Background")}),(0,oe.jsx)(Ga,{icon:qa,path:"/shadows",children:(0,b.__)("Shadows")}),r&&(0,oe.jsx)(Ga,{icon:Wo,path:"/layout",children:(0,b.__)("Layout")})]})})};function el(e){const t=/^(?!generic\([ a-zA-Z\-]+\)$)(?!^[a-zA-Z\-]+$).+/,n=e.trim(),s=e=>(e=e.trim()).match(t)?`"${e=e.replace(/^["']|["']$/g,"")}"`:e;return n.includes(",")?n.split(",").map(s).filter((e=>""!==e)).join(", "):s(n)}function tl(e){if(!e)return"";let t=e.trim();return t.includes(",")&&(t=t.split(",").find((e=>""!==e.trim())).trim()),t=t.replace(/^["']|["']$/g,""),window.navigator.userAgent.toLowerCase().includes("firefox")&&(t=`"${t}"`),t}function nl(e){const t={fontFamily:el(e.fontFamily)};if(!Array.isArray(e.fontFace))return t.fontWeight="400",t.fontStyle="normal",t;if(e.fontFace){const i=e.fontFace.filter((e=>e?.fontStyle&&"normal"===e.fontStyle.toLowerCase()));if(i.length>0){t.fontStyle="normal";const e=function(e){const t=[];return e.forEach((e=>{const n=String(e.fontWeight).split(" ");if(2===n.length){const e=parseInt(n[0]),s=parseInt(n[1]);for(let n=e;n<=s;n+=100)t.push(n)}else 1===n.length&&t.push(parseInt(n[0]))})),t}(i),r=(n=400,0===(s=e).length?null:(s.sort(((e,t)=>Math.abs(n-e)-Math.abs(n-t))),s[0]));t.fontWeight=String(r)||"400"}else t.fontStyle=e.fontFace.length&&e.fontFace[0].fontStyle||"normal",t.fontWeight=e.fontFace.length&&String(e.fontFace[0].fontWeight)||"400"}var n,s;return t}function sl(e){return e?`is-style-${e}`:""}function il(e,t){const n=new RegExp(`^${t}([\\d]+)$`);return e.reduce(((e,t)=>{if("string"==typeof t?.slug){const s=t?.slug.match(n);if(s){const t=parseInt(s[1],10);if(t>e)return t}}return e}),0)+1}function rl(e,t){if(!Array.isArray(e)||!t)return null;const n=t.replace("var(","").replace(")",""),s=n?.split("--").slice(-1)[0];return e.find((e=>e.slug===s))}const{useGlobalStyle:ol,GlobalStylesContext:al}=te(x.privateApis),{mergeBaseAndUserConfigs:ll}=te(h.privateApis);function cl({fontSize:e,variation:t}){const{base:n}=(0,d.useContext)(al);let s=n;t&&(s=ll(n,t));const[i]=ol("color.text"),[r,o]=function(e){const t=e?.settings?.typography?.fontFamilies?.theme,n=e?.settings?.typography?.fontFamilies?.custom;let s=[];t&&n?s=[...t,...n]:t?s=t:n&&(s=n);const i=e?.styles?.typography?.fontFamily,r=rl(s,i),o=e?.styles?.elements?.heading?.typography?.fontFamily;let a;return a=o?rl(s,e?.styles?.elements?.heading?.typography?.fontFamily):r,[r,a]}(s),a=r?nl(r):{},l=o?nl(o):{};return i&&(a.color=i,l.color=i),e&&(a.fontSize=e,l.fontSize=e),(0,oe.jsxs)(y.__unstableMotion.div,{animate:{scale:1,opacity:1},initial:{scale:.1,opacity:0},transition:{delay:.3,type:"tween"},style:{textAlign:"center",lineHeight:1},children:[(0,oe.jsx)("span",{style:l,children:(0,b._x)("A","Uppercase letter A")}),(0,oe.jsx)("span",{style:a,children:(0,b._x)("a","Lowercase letter A")})]})}function ul({normalizedColorSwatchSize:e,ratio:t}){const{highlightedColors:n}=ie(),s=e*t;return n.map((({slug:e,color:t},n)=>(0,oe.jsx)(y.__unstableMotion.div,{style:{height:s,width:s,background:t,borderRadius:s/2},animate:{scale:1,opacity:1},initial:{scale:.1,opacity:0},transition:{delay:1===n?.2:.1}},`${e}-${n}`)))}const{useGlobalStyle:dl}=te(x.privateApis),hl={leading:!0,trailing:!0};function pl({children:e,label:t,isFocused:n,withHoverView:s}){const[i="white"]=dl("color.background"),[r]=dl("color.gradient"),o=(0,v.useReducedMotion)(),[a,l]=(0,d.useState)(!1),[c,{width:u}]=(0,v.useResizeObserver)(),[h,p]=(0,d.useState)(u),[f,m]=(0,d.useState)(),g=(0,v.useThrottle)(p,250,hl);(0,d.useLayoutEffect)((()=>{u&&g(u)}),[u,g]),(0,d.useLayoutEffect)((()=>{const e=h?h/248:1,t=e-(f||0);!(Math.abs(t)>.1)&&f||m(e)}),[h,f]);const x=f||(u?u/248:1),b=!!u;return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)("div",{style:{position:"relative"},children:c}),b&&(0,oe.jsx)("div",{className:"edit-site-global-styles-preview__wrapper",style:{height:152*x},onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),tabIndex:-1,children:(0,oe.jsx)(y.__unstableMotion.div,{style:{height:152*x,width:"100%",background:null!=r?r:i,cursor:s?"pointer":void 0},initial:"start",animate:(a||n)&&!o&&t?"hover":"start",children:[].concat(e).map(((e,t)=>e({ratio:x,key:t})))})})]})}const{useGlobalStyle:fl}=te(x.privateApis),ml={start:{scale:1,opacity:1},hover:{scale:0,opacity:0}},gl={hover:{opacity:1},start:{opacity:.5}},vl={hover:{scale:1,opacity:1},start:{scale:0,opacity:0}},xl=({label:e,isFocused:t,withHoverView:n,variation:s})=>{const[i]=fl("typography.fontWeight"),[r="serif"]=fl("typography.fontFamily"),[o=r]=fl("elements.h1.typography.fontFamily"),[a=i]=fl("elements.h1.typography.fontWeight"),[l="black"]=fl("color.text"),[c=l]=fl("elements.h1.color.text"),{paletteColors:u}=ie();return(0,oe.jsxs)(pl,{label:e,isFocused:t,withHoverView:n,children:[({ratio:e,key:t})=>(0,oe.jsx)(y.__unstableMotion.div,{variants:ml,style:{height:"100%",overflow:"hidden"},children:(0,oe.jsxs)(y.__experimentalHStack,{spacing:10*e,justify:"center",style:{height:"100%",overflow:"hidden"},children:[(0,oe.jsx)(cl,{fontSize:65*e,variation:s}),(0,oe.jsx)(y.__experimentalVStack,{spacing:4*e,children:(0,oe.jsx)(ul,{normalizedColorSwatchSize:32,ratio:e})})]})},t),({key:e})=>(0,oe.jsx)(y.__unstableMotion.div,{variants:n&&gl,style:{height:"100%",width:"100%",position:"absolute",top:0,overflow:"hidden",filter:"blur(60px)",opacity:.1},children:(0,oe.jsx)(y.__experimentalHStack,{spacing:0,justify:"flex-start",style:{height:"100%",overflow:"hidden"},children:u.slice(0,4).map((({color:e},t)=>(0,oe.jsx)("div",{style:{height:"100%",background:e,flexGrow:1}},t)))})},e),({ratio:t,key:n})=>(0,oe.jsx)(y.__unstableMotion.div,{variants:vl,style:{height:"100%",width:"100%",overflow:"hidden",position:"absolute",top:0},children:(0,oe.jsx)(y.__experimentalVStack,{spacing:3*t,justify:"center",style:{height:"100%",overflow:"hidden",padding:10*t,boxSizing:"border-box"},children:e&&(0,oe.jsx)("div",{style:{fontSize:40*t,fontFamily:o,color:c,fontWeight:a,lineHeight:"1em",textAlign:"center"},children:e})})},n)]})},{useGlobalStyle:yl}=te(x.privateApis);const bl=function(){const[e]=yl("css"),{hasVariations:t,canEditCSS:n}=(0,l.useSelect)((e=>{const{getEntityRecord:t,__experimentalGetCurrentGlobalStylesId:n,__experimentalGetCurrentThemeGlobalStylesVariations:s}=e(_.store),i=n(),r=i?t("root","globalStyles",i):void 0;return{hasVariations:!!s()?.length,canEditCSS:!!r?._links?.["wp:action-edit-css"]}}),[]);return(0,oe.jsxs)(y.Card,{size:"small",className:"edit-site-global-styles-screen-root",isRounded:!1,children:[(0,oe.jsx)(y.CardBody,{children:(0,oe.jsxs)(y.__experimentalVStack,{spacing:4,children:[(0,oe.jsx)(y.Card,{className:"edit-site-global-styles-screen-root__active-style-tile",children:(0,oe.jsx)(y.CardMedia,{className:"edit-site-global-styles-screen-root__active-style-tile-preview",children:(0,oe.jsx)(xl,{})})}),t&&(0,oe.jsx)(y.__experimentalItemGroup,{children:(0,oe.jsx)(Ga,{path:"/variations",children:(0,oe.jsxs)(y.__experimentalHStack,{justify:"space-between",children:[(0,oe.jsx)(y.FlexItem,{children:(0,b.__)("Browse styles")}),(0,oe.jsx)(La,{icon:(0,b.isRTL)()?Ko:Zo})]})})}),(0,oe.jsx)($a,{})]})}),(0,oe.jsx)(y.CardDivider,{}),(0,oe.jsxs)(y.CardBody,{children:[(0,oe.jsx)(y.__experimentalSpacer,{as:"p",paddingTop:2,paddingX:"13px",marginBottom:4,children:(0,b.__)("Customize the appearance of specific blocks for the whole site.")}),(0,oe.jsx)(y.__experimentalItemGroup,{children:(0,oe.jsx)(Ga,{path:"/blocks",children:(0,oe.jsxs)(y.__experimentalHStack,{justify:"space-between",children:[(0,oe.jsx)(y.FlexItem,{children:(0,b.__)("Blocks")}),(0,oe.jsx)(La,{icon:(0,b.isRTL)()?Ko:Zo})]})})})]}),n&&!!e&&(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(y.CardDivider,{}),(0,oe.jsxs)(y.CardBody,{children:[(0,oe.jsx)(y.__experimentalSpacer,{as:"p",paddingTop:2,paddingX:"13px",marginBottom:4,children:(0,b.__)("Add your own CSS to customize the appearance and layout of your site.")}),(0,oe.jsx)(y.__experimentalItemGroup,{children:(0,oe.jsx)(Ga,{path:"/css",children:(0,oe.jsxs)(y.__experimentalHStack,{justify:"space-between",children:[(0,oe.jsx)(y.FlexItem,{children:(0,b.__)("Additional CSS")}),(0,oe.jsx)(La,{icon:(0,b.isRTL)()?Ko:Zo})]})})})]})]})]})},wl=window.wp.a11y,{useGlobalStyle:_l}=te(x.privateApis);function jl(e){const t=(0,l.useSelect)((t=>{const{getBlockStyles:n}=t(o.store);return n(e)}),[e]),[n]=_l("variations",e);return function(e,t){return e?.filter((e=>"block"===e.source||t.includes(e.name)))}(t,Object.keys(null!=n?n:{}))}function Sl({name:e}){const t=jl(e);return(0,oe.jsx)(y.__experimentalItemGroup,{isBordered:!0,isSeparated:!0,children:t.map(((t,n)=>t?.isDefault?null:(0,oe.jsx)(Ga,{path:"/blocks/"+encodeURIComponent(e)+"/variations/"+encodeURIComponent(t.name),children:t.label},n)))})}const Cl=function({title:e,description:t,onBack:n}){return(0,oe.jsxs)(y.__experimentalVStack,{spacing:0,children:[(0,oe.jsx)(y.__experimentalView,{children:(0,oe.jsx)(y.__experimentalSpacer,{marginBottom:0,paddingX:4,paddingY:3,children:(0,oe.jsxs)(y.__experimentalHStack,{spacing:2,children:[(0,oe.jsx)(y.Navigator.BackButton,{icon:(0,b.isRTL)()?Zo:Ko,size:"small",label:(0,b.__)("Back"),onClick:n}),(0,oe.jsx)(y.__experimentalSpacer,{children:(0,oe.jsx)(y.__experimentalHeading,{className:"edit-site-global-styles-header",level:2,size:13,children:e})})]})})}),t&&(0,oe.jsx)("p",{className:"edit-site-global-styles-header__description",children:t})]})},{useHasDimensionsPanel:kl,useHasTypographyPanel:El,useHasBorderPanel:Pl,useGlobalSetting:Il,useSettingsForBlockElement:Tl,useHasColorPanel:Ol}=te(x.privateApis);function Al(e){const[t]=Il("",e),n=Tl(t,e),s=El(n),i=Ol(n),r=Pl(n),o=kl(n),a=r||o,l=!!jl(e)?.length;return s||i||a||l}function Nl({block:e}){return Al(e.name)?(0,oe.jsx)(Ga,{path:"/blocks/"+encodeURIComponent(e.name),children:(0,oe.jsxs)(y.__experimentalHStack,{justify:"flex-start",children:[(0,oe.jsx)(x.BlockIcon,{icon:e.icon}),(0,oe.jsx)(y.FlexItem,{children:e.title})]})}):null}const Ml=(0,d.memo)((function({filterValue:e}){const t=function(){const e=(0,l.useSelect)((e=>e(o.store).getBlockTypes()),[]),{core:t,noncore:n}=e.reduce(((e,t)=>{const{core:n,noncore:s}=e;return(t.name.startsWith("core/")?n:s).push(t),e}),{core:[],noncore:[]});return[...t,...n]}(),n=(0,v.useDebounce)(wl.speak,500),{isMatchingSearchTerm:s}=(0,l.useSelect)(o.store),i=e?t.filter((t=>s(t,e))):t,r=(0,d.useRef)();return(0,d.useEffect)((()=>{if(!e)return;const t=r.current.childElementCount,s=(0,b.sprintf)((0,b._n)("%d result found.","%d results found.",t),t);n(s,t)}),[e,n]),(0,oe.jsx)("div",{ref:r,className:"edit-site-block-types-item-list",children:i.map((e=>(0,oe.jsx)(Nl,{block:e},"menu-itemblock-"+e.name)))})}));const Fl=function(){const[e,t]=(0,d.useState)(""),n=(0,d.useDeferredValue)(e);return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(Cl,{title:(0,b.__)("Blocks"),description:(0,b.__)("Customize the appearance of specific blocks and for the whole site.")}),(0,oe.jsx)(y.SearchControl,{__nextHasNoMarginBottom:!0,className:"edit-site-block-types-search",onChange:t,value:e,label:(0,b.__)("Search"),placeholder:(0,b.__)("Search")}),(0,oe.jsx)(Ml,{filterValue:n})]})},Vl=({name:e,variation:t=""})=>{var n;const s=(0,o.getBlockType)(e)?.example,i=(0,d.useMemo)((()=>{if(!s)return null;const n={...s,attributes:{...s.attributes,style:void 0,className:t?sl(t):s.attributes?.className}};return(0,o.getBlockFromExample)(e,n)}),[e,s,t]),r=null!==(n=s?.viewportWidth)&&void 0!==n?n:500,a=144,l=235/r,c=0!==l&&l<1?a/l:a;return s?(0,oe.jsx)(y.__experimentalSpacer,{marginX:4,marginBottom:4,children:(0,oe.jsx)("div",{className:"edit-site-global-styles__block-preview-panel",style:{maxHeight:a,boxSizing:"initial"},children:(0,oe.jsx)(x.BlockPreview,{blocks:i,viewportWidth:r,minHeight:a,additionalStyles:[{css:`\n\t\t\t\t\t\t\t\tbody{\n\t\t\t\t\t\t\t\t\tpadding: 24px;\n\t\t\t\t\t\t\t\t\tmin-height:${Math.round(c)}px;\n\t\t\t\t\t\t\t\t\tdisplay:flex;\n\t\t\t\t\t\t\t\t\talign-items:center;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t.is-root-container { width: 100%; }\n\t\t\t\t\t\t\t`}]})})}):null};const Rl=function({children:e,level:t}){return(0,oe.jsx)(y.__experimentalHeading,{className:"edit-site-global-styles-subtitle",level:null!=t?t:2,children:e})},Bl={backgroundSize:"cover",backgroundPosition:"50% 50%"};function Dl(e){if(!e)return e;const t=e.color||e.width;return!e.style&&t?{...e,style:"solid"}:!e.style||t?e:void 0}const{useHasDimensionsPanel:Ll,useHasTypographyPanel:zl,useHasBorderPanel:Gl,useGlobalSetting:Hl,useSettingsForBlockElement:Ul,useHasColorPanel:Wl,useHasFiltersPanel:ql,useHasImageSettingsPanel:Zl,useGlobalStyle:Kl,useHasBackgroundPanel:Yl,BackgroundPanel:Xl,BorderPanel:Jl,ColorPanel:Ql,TypographyPanel:$l,DimensionsPanel:ec,FiltersPanel:tc,ImageSettingsPanel:nc,AdvancedPanel:sc}=te(x.privateApis);const ic=function({name:e,variation:t}){let n=[];t&&(n=["variations",t].concat(n));const s=n.join("."),[i]=Kl(s,e,"user",{shouldDecodeEncode:!1}),[r,a]=Kl(s,e,"all",{shouldDecodeEncode:!1}),[c]=Hl("",e,"user"),[u,h]=Hl("",e),p=Ul(u,e),f=(0,o.getBlockType)(e);let m=!1;p?.spacing?.blockGap&&f?.supports?.spacing?.blockGap&&(!0===f?.supports?.spacing?.__experimentalSkipSerialization||f?.supports?.spacing?.__experimentalSkipSerialization?.some?.((e=>"blockGap"===e)))&&(m=!0);let g=!1;p?.dimensions?.aspectRatio&&"core/group"===e&&(g=!0);const v=(0,d.useMemo)((()=>{const e=structuredClone(p);return m&&(e.spacing.blockGap=!1),g&&(e.dimensions.aspectRatio=!1),e}),[p,m,g]),x=jl(e),w=Yl(v),j=zl(v),S=Wl(v),C=Gl(v),k=Ll(v),E=ql(v),P=Zl(e,c,v),I=!!x?.length&&!t,{canEditCSS:T}=(0,l.useSelect)((e=>{const{getEntityRecord:t,__experimentalGetCurrentGlobalStylesId:n}=e(_.store),s=n(),i=s?t("root","globalStyles",s):void 0;return{canEditCSS:!!i?._links?.["wp:action-edit-css"]}}),[]),O=t?x.find((e=>e.name===t)):null,A=(0,d.useMemo)((()=>({...r,layout:v.layout})),[r,v.layout]),N=(0,d.useMemo)((()=>({...i,layout:c.layout})),[i,c.layout]);return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(Cl,{title:t?O?.label:f.title}),(0,oe.jsx)(Vl,{name:e,variation:t}),I&&(0,oe.jsx)("div",{className:"edit-site-global-styles-screen-variations",children:(0,oe.jsxs)(y.__experimentalVStack,{spacing:3,children:[(0,oe.jsx)(Rl,{children:(0,b.__)("Style Variations")}),(0,oe.jsx)(Sl,{name:e})]})}),S&&(0,oe.jsx)(Ql,{inheritedValue:r,value:i,onChange:a,settings:v}),w&&(0,oe.jsx)(Xl,{inheritedValue:r,value:i,onChange:a,settings:v,defaultValues:Bl}),j&&(0,oe.jsx)($l,{inheritedValue:r,value:i,onChange:a,settings:v}),k&&(0,oe.jsx)(ec,{inheritedValue:A,value:N,onChange:e=>{const t={...e};delete t.layout,a(t),e.layout!==c.layout&&h({...c,layout:e.layout})},settings:v,includeLayoutControls:!0}),C&&(0,oe.jsx)(Jl,{inheritedValue:r,value:i,onChange:e=>{if(!e?.border)return void a(e);const{radius:t,...n}=e.border,s=function(e){return e?(0,y.__experimentalHasSplitBorders)(e)?{top:Dl(e.top),right:Dl(e.right),bottom:Dl(e.bottom),left:Dl(e.left)}:Dl(e):e}(n),i=(0,y.__experimentalHasSplitBorders)(s)?{color:null,style:null,width:null,...s}:{top:s,right:s,bottom:s,left:s};a({...e,border:{...i,radius:t}})},settings:v}),E&&(0,oe.jsx)(tc,{inheritedValue:A,value:N,onChange:a,settings:v,includeLayoutControls:!0}),P&&(0,oe.jsx)(nc,{onChange:e=>{h(void 0===e?{...u,lightbox:void 0}:{...u,lightbox:{...u.lightbox,...e}})},value:c,inheritedValue:v}),T&&(0,oe.jsxs)(y.PanelBody,{title:(0,b.__)("Advanced"),initialOpen:!1,children:[(0,oe.jsx)("p",{children:(0,b.sprintf)((0,b.__)("Add your own CSS to customize the appearance of the %s block. You do not need to include a CSS selector, just add the property and value."),f?.title)}),(0,oe.jsx)(sc,{value:i,onChange:a,inheritedValue:r})]})]})},{useGlobalStyle:rc}=te(x.privateApis);function oc({parentMenu:e,element:t,label:n}){var s;const i="text"!==t&&t?`elements.${t}.`:"",r="link"===t?{textDecoration:"underline"}:{},[o]=rc(i+"typography.fontFamily"),[a]=rc(i+"typography.fontStyle"),[l]=rc(i+"typography.fontWeight"),[c]=rc(i+"color.background"),[u]=rc("color.background"),[d]=rc(i+"color.gradient"),[h]=rc(i+"color.text");return(0,oe.jsx)(Ga,{path:e+"/typography/"+t,children:(0,oe.jsxs)(y.__experimentalHStack,{justify:"flex-start",children:[(0,oe.jsx)(y.FlexItem,{className:"edit-site-global-styles-screen-typography__indicator",style:{fontFamily:null!=o?o:"serif",background:null!==(s=null!=d?d:c)&&void 0!==s?s:u,color:h,fontStyle:a,fontWeight:l,...r},"aria-hidden":"true",children:(0,b.__)("Aa")}),(0,oe.jsx)(y.FlexItem,{children:n})]})})}const ac=function(){return(0,oe.jsxs)(y.__experimentalVStack,{spacing:3,children:[(0,oe.jsx)(Rl,{level:3,children:(0,b.__)("Elements")}),(0,oe.jsxs)(y.__experimentalItemGroup,{isBordered:!0,isSeparated:!0,children:[(0,oe.jsx)(oc,{parentMenu:"",element:"text",label:(0,b.__)("Text")}),(0,oe.jsx)(oc,{parentMenu:"",element:"link",label:(0,b.__)("Links")}),(0,oe.jsx)(oc,{parentMenu:"",element:"heading",label:(0,b.__)("Headings")}),(0,oe.jsx)(oc,{parentMenu:"",element:"caption",label:(0,b.__)("Captions")}),(0,oe.jsx)(oc,{parentMenu:"",element:"button",label:(0,b.__)("Buttons")})]})]})},lc=({variation:e,isFocused:t,withHoverView:n})=>(0,oe.jsx)(pl,{label:e.title,isFocused:t,withHoverView:n,children:({ratio:t,key:n})=>(0,oe.jsx)(y.__experimentalHStack,{spacing:10*t,justify:"center",style:{height:"100%",overflow:"hidden"},children:(0,oe.jsx)(cl,{variation:e,fontSize:85*t})},n)}),cc=[],{GlobalStylesContext:uc,areGlobalStyleConfigsEqual:dc}=te(x.privateApis),{mergeBaseAndUserConfigs:hc}=te(h.privateApis);function pc(e,t){if(!t?.length)return e;if("object"!=typeof e||!e||!Object.keys(e).length)return e;for(const n in e)t.includes(n)?delete e[n]:"object"==typeof e[n]&&pc(e[n],t);return e}function fc({title:e,settings:t,styles:n}){return e===(0,b.__)("Default")||Object.keys(t).length>0||Object.keys(n).length>0}function mc(e=[]){const{variationsFromTheme:t}=(0,l.useSelect)((e=>({variationsFromTheme:e(_.store).__experimentalGetCurrentThemeGlobalStylesVariations()||cc})),[]),{user:n}=(0,d.useContext)(uc),s=e.toString();return(0,d.useMemo)((()=>{const s=pc(structuredClone(n),e);s.title=(0,b.__)("Default");const i=t.filter((t=>vc(t,e))).map((e=>hc(s,e))),r=[s,...i];return r?.length?r.filter(fc):[]}),[s,n,t])}const gc=(e,t)=>{if(!e||!t?.length)return{};const n={};return Object.keys(e).forEach((s=>{if(t.includes(s))n[s]=e[s];else if("object"==typeof e[s]){const i=gc(e[s],t);Object.keys(i).length&&(n[s]=i)}})),n};function vc(e,t){const n=gc(structuredClone(e),t);return dc(n,e)}const{mergeBaseAndUserConfigs:xc}=te(h.privateApis),{GlobalStylesContext:yc,areGlobalStyleConfigsEqual:bc}=te(x.privateApis);function wc({variation:e,children:t,isPill:n,properties:s,showTooltip:i}){const[r,o]=(0,d.useState)(!1),{base:a,user:l,setUserConfig:c}=(0,d.useContext)(yc),u=(0,d.useMemo)((()=>{let t=xc(a,e);return s&&(t=gc(t,s)),{user:e,base:a,merged:t,setUserConfig:()=>{}}}),[e,a,s]),h=()=>c(e),p=(0,d.useMemo)((()=>bc(l,e)),[l,e]);let f=e?.title;e?.description&&(f=(0,b.sprintf)((0,b._x)("%1$s (%2$s)","variation label"),e?.title,e?.description));const m=(0,oe.jsx)("div",{className:Ut("edit-site-global-styles-variations_item",{"is-active":p}),role:"button",onClick:h,onKeyDown:e=>{e.keyCode===Jt.ENTER&&(e.preventDefault(),h())},tabIndex:"0","aria-label":f,"aria-current":p,onFocus:()=>o(!0),onBlur:()=>o(!1),children:(0,oe.jsx)("div",{className:Ut("edit-site-global-styles-variations_item-preview",{"is-pill":n}),children:t(r)})});return(0,oe.jsx)(yc.Provider,{value:u,children:i?(0,oe.jsx)(y.Tooltip,{text:e?.title,children:m}):m})}function _c({title:e,gap:t=2}){const n=["typography"],s=mc(n);return s?.length<=1?null:(0,oe.jsxs)(y.__experimentalVStack,{spacing:3,children:[e&&(0,oe.jsx)(Rl,{level:3,children:e}),(0,oe.jsx)(y.__experimentalGrid,{columns:3,gap:t,className:"edit-site-global-styles-style-variations-container",children:s.map(((e,t)=>(0,oe.jsx)(wc,{variation:e,properties:n,showTooltip:!0,children:()=>(0,oe.jsx)(lc,{variation:e})},t)))})]})}const jc=function(){return(0,oe.jsxs)(y.__experimentalVStack,{spacing:2,children:[(0,oe.jsx)(y.__experimentalHStack,{justify:"space-between",children:(0,oe.jsx)(Rl,{level:3,children:(0,b.__)("Font Sizes")})}),(0,oe.jsx)(y.__experimentalItemGroup,{isBordered:!0,isSeparated:!0,children:(0,oe.jsx)(Ga,{path:"/typography/font-sizes",children:(0,oe.jsxs)(y.__experimentalHStack,{direction:"row",children:[(0,oe.jsx)(y.FlexItem,{children:(0,b.__)("Font size presets")}),(0,oe.jsx)($o,{icon:(0,b.isRTL)()?Ko:Zo})]})})})]})},Sc=(0,oe.jsxs)(Yt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,oe.jsx)(Yt.Path,{d:"m19 7.5h-7.628c-.3089-.87389-1.1423-1.5-2.122-1.5-.97966 0-1.81309.62611-2.12197 1.5h-2.12803v1.5h2.12803c.30888.87389 1.14231 1.5 2.12197 1.5.9797 0 1.8131-.62611 2.122-1.5h7.628z"}),(0,oe.jsx)(Yt.Path,{d:"m19 15h-2.128c-.3089-.8739-1.1423-1.5-2.122-1.5s-1.8131.6261-2.122 1.5h-7.628v1.5h7.628c.3089.8739 1.1423 1.5 2.122 1.5s1.8131-.6261 2.122-1.5h2.128z"})]}),Cc="/wp/v2/font-families",kc="/wp/v2/font-collections";async function Ec(e){const t={path:Cc,method:"POST",body:e},n=await io()(t);return{id:n.id,...n.font_family_settings,fontFace:[]}}async function Pc(e,t){const n={path:`${Cc}/${e}/font-faces`,method:"POST",body:t},s=await io()(n);return{id:s.id,...s.font_face_settings}}async function Ic(e){const t={path:`${Cc}?slug=${e}&_embed=true`,method:"GET"},n=await io()(t);if(!n||0===n.length)return null;const s=n[0];return{id:s.id,...s.font_family_settings,fontFace:s?._embedded?.font_faces.map((e=>e.font_face_settings))||[]}}async function Tc(e){const t={path:`${Cc}/${e}?force=true`,method:"DELETE"};return await io()(t)}const Oc=["otf","ttf","woff","woff2"],Ac={100:(0,b._x)("Thin","font weight"),200:(0,b._x)("Extra-light","font weight"),300:(0,b._x)("Light","font weight"),400:(0,b._x)("Normal","font weight"),500:(0,b._x)("Medium","font weight"),600:(0,b._x)("Semi-bold","font weight"),700:(0,b._x)("Bold","font weight"),800:(0,b._x)("Extra-bold","font weight"),900:(0,b._x)("Black","font weight")},Nc={normal:(0,b._x)("Normal","font style"),italic:(0,b._x)("Italic","font style")},{File:Mc}=window,{kebabCase:Fc}=te(y.privateApis);function Vc(e,t={}){return e.name||!e.fontFamily&&!e.slug||(e.name=e.fontFamily||e.slug),{...e,...t}}function Rc(e){return`${Ac[e.fontWeight]||e.fontWeight} ${"normal"===e.fontStyle?"":Nc[e.fontStyle]||e.fontStyle}`}function Bc(e=[],t=[]){const n=new Map;for(const t of e)n.set(`${t.fontWeight}${t.fontStyle}`,t);for(const e of t)n.set(`${e.fontWeight}${e.fontStyle}`,e);return Array.from(n.values())}function Dc(e=[],t=[]){const n=new Map;for(const t of e)n.set(t.slug,{...t});for(const e of t)if(n.has(e.slug)){const{fontFace:t,...s}=e,i=Bc(n.get(e.slug).fontFace,t);n.set(e.slug,{...s,fontFace:i})}else n.set(e.slug,{...e});return Array.from(n.values())}async function Lc(e,t,n="all"){let s;if("string"==typeof t)s=`url(${t})`;else{if(!(t instanceof Mc))return;s=await t.arrayBuffer()}const i=new window.FontFace(tl(e.fontFamily),s,{style:e.fontStyle,weight:e.fontWeight}),r=await i.load();if("document"!==n&&"all"!==n||document.fonts.add(r),"iframe"===n||"all"===n){document.querySelector('iframe[name="editor-canvas"]').contentDocument.fonts.add(r)}}function zc(e,t="all"){const n=t=>{t.forEach((n=>{n.family===tl(e?.fontFamily)&&n.weight===e?.fontWeight&&n.style===e?.fontStyle&&t.delete(n)}))};if("document"!==t&&"all"!==t||n(document.fonts),"iframe"===t||"all"===t){n(document.querySelector('iframe[name="editor-canvas"]').contentDocument.fonts)}}function Gc(e){if(!e)return;let t;var n;return t=Array.isArray(e)?e[0]:e,t.startsWith("file:.")?void 0:(("string"!=typeof(n=t)||n===decodeURIComponent(n))&&(t=encodeURI(t)),t)}function Hc(e){const t=new FormData,{fontFace:n,category:s,...i}=e,r={...i,slug:Fc(e.slug)};return t.append("font_family_settings",JSON.stringify(r)),t}function Uc(e){if(e?.fontFace){const t=e.fontFace.map(((e,t)=>{const n={...e},s=new FormData;if(n.file){const e=Array.isArray(n.file)?n.file:[n.file],i=[];e.forEach(((e,n)=>{const r=`file-${t}-${n}`;s.append(r,e,e.name),i.push(r)})),n.src=1===i.length?i[0]:i,delete n.file,s.append("font_face_settings",JSON.stringify(n))}else s.append("font_face_settings",JSON.stringify(n));return s}));return t}}async function Wc(e,t){const n=[];for(const s of t)try{const t=await Pc(e,s);n.push({status:"fulfilled",value:t})}catch(e){n.push({status:"rejected",reason:e})}const s={errors:[],successes:[]};return n.forEach(((e,n)=>{if("fulfilled"===e.status){const i=e.value;i.id?s.successes.push(i):s.errors.push({data:t[n],message:`Error: ${i.message}`})}else s.errors.push({data:t[n],message:e.reason.message})})),s}function qc(e,t){return-1!==t.findIndex((t=>t.fontWeight===e.fontWeight&&t.fontStyle===e.fontStyle))}function Zc(e,t,n){const s=t=>t.slug===e.slug,i=n.find(s);return t?(i=>{const r=e=>e.fontWeight===t.fontWeight&&e.fontStyle===t.fontStyle;if(!i)return[...n,{...e,fontFace:[t]}];let o=i.fontFace||[];return o=o.find(r)?o.filter((e=>!r(e))):[...o,t],0===o.length?n.filter((e=>!s(e))):n.map((e=>s(e)?{...e,fontFace:o}:e))})(i):(t=>t?n.filter((e=>!s(e))):[...n,e])(i)}const{useGlobalSetting:Kc}=te(x.privateApis),Yc=(0,d.createContext)({});const Xc=function({children:e}){const{saveEntityRecord:t}=(0,l.useDispatch)(_.store),{globalStylesId:n}=(0,l.useSelect)((e=>{const{__experimentalGetCurrentGlobalStylesId:t}=e(_.store);return{globalStylesId:t()}})),s=(0,_.useEntityRecord)("root","globalStyles",n),[i,r]=(0,d.useState)(!1),[o,a]=(0,d.useState)(0),c=()=>{a(Date.now())},{records:u=[],isResolving:h}=(0,_.useEntityRecords)("postType","wp_font_family",{refreshKey:o,_embed:!0}),p=(u||[]).map((e=>({id:e.id,...e.font_family_settings,fontFace:e?._embedded?.font_faces.map((e=>e.font_face_settings))||[]})))||[],[f,m]=Kc("typography.fontFamilies"),g=async e=>{const n=s.record;re(n,["settings","typography","fontFamilies"],e),await t("root","globalStyles",n)},[v,x]=(0,d.useState)(!1),[y,w]=(0,d.useState)(null),j=f?.theme?f.theme.map((e=>Vc(e,{source:"theme"}))).sort(((e,t)=>e.name.localeCompare(t.name))):[],S=f?.custom?f.custom.map((e=>Vc(e,{source:"custom"}))).sort(((e,t)=>e.name.localeCompare(t.name))):[],C=p?p.map((e=>Vc(e,{source:"custom"}))).sort(((e,t)=>e.name.localeCompare(t.name))):[];(0,d.useEffect)((()=>{v||w(null)}),[v]);const[k]=(0,d.useState)(new Set),E=e=>e.reduce(((e,t)=>{const n=t?.fontFace&&t.fontFace?.length>0?t?.fontFace.map((e=>`${e.fontStyle+e.fontWeight}`)):["normal400"];return e[t.slug]=n,e}),{}),P=e=>E("theme"===e?j:S),I=(e,t,n,s)=>t||n?!!P(s)[e]?.includes(t+n):!!P(s)[e],T=e=>{var t;const n=(null!==(t=f?.[e.source])&&void 0!==t?t:[]).filter((t=>t.slug!==e.slug)),s={...f,[e.source]:n};return m(s),e.fontFace&&e.fontFace.forEach((e=>{zc(e,"all")})),s},O=e=>{const t=A(e),n={...f,custom:Dc(f?.custom,t)};return m(n),N(t),n},A=e=>e.map((({id:e,fontFace:t,...n})=>({...n,...t&&t.length>0?{fontFace:t.map((({id:e,...t})=>t))}:{}}))),N=e=>{e.forEach((e=>{e.fontFace&&e.fontFace.forEach((e=>{Lc(e,Gc(e.src),"all")}))}))},[M,F]=(0,d.useState)([]),V=async()=>{const e=await async function(){const e={path:`${kc}?_fields=slug,name,description`,method:"GET"};return await io()(e)}();F(e)};return(0,d.useEffect)((()=>{V()}),[]),(0,oe.jsx)(Yc.Provider,{value:{libraryFontSelected:y,handleSetLibraryFontSelected:e=>{if(!e)return void w(null);const t=("theme"===e.source?j:C).find((t=>t.slug===e.slug));w({...t||e,source:e.source})},fontFamilies:f,baseCustomFonts:C,isFontActivated:I,getFontFacesActivated:(e,t)=>P(t)[e]||[],loadFontFaceAsset:async e=>{if(!e.src)return;const t=Gc(e.src);t&&!k.has(t)&&(Lc(e,t,"document"),k.add(t))},installFonts:async function(e){r(!0);try{const t=[];let n=[];for(const s of e){let e=!1,i=await Ic(s.slug);i||(e=!0,i=await Ec(Hc(s)));const r=i.fontFace&&s.fontFace?i.fontFace.filter((e=>qc(e,s.fontFace))):[];i.fontFace&&s.fontFace&&(s.fontFace=s.fontFace.filter((e=>!qc(e,i.fontFace))));let o=[],a=[];if(s?.fontFace?.length>0){const e=await Wc(i.id,Uc(s));o=e?.successes,a=e?.errors}(o?.length>0||r?.length>0)&&(i.fontFace=[...o],t.push(i)),i&&!s?.fontFace?.length&&t.push(i),e&&s?.fontFace?.length>0&&0===o?.length&&await Tc(i.id),n=n.concat(a)}if(n=n.reduce(((e,t)=>e.includes(t.message)?e:[...e,t.message]),[]),t.length>0){const e=O(t);await g(e),c()}if(n.length>0){const e=new Error((0,b.__)("There was an error installing fonts."));throw e.installationErrors=n,e}}finally{r(!1)}},uninstallFontFamily:async function(e){try{const t=await Tc(e.id);if(t.deleted){const t=T(e);await g(t)}return c(),t}catch(e){throw console.error("There was an error uninstalling the font family:",e),e}},toggleActivateFont:(e,t)=>{var n;const s=Zc(e,t,null!==(n=f?.[e.source])&&void 0!==n?n:[]);m({...f,[e.source]:s});I(e.slug,t?.fontStyle,t?.fontWeight,e.source)?zc(t,"all"):Lc(t,Gc(t?.src),"all")},getAvailableFontsOutline:E,modalTabOpen:v,setModalTabOpen:x,refreshLibrary:c,saveFontFamilies:g,isResolvingLibrary:h,isInstalling:i,collections:M,getFontCollection:async e=>{try{if(!!M.find((t=>t.slug===e))?.font_families)return;const t=await async function(e){const t={path:`${kc}/${e}`,method:"GET"};return await io()(t)}(e),n=M.map((n=>n.slug===e?{...n,...t}:n));F(n)}catch(e){throw console.error(e),e}}},children:e})};const Jc=function({font:e,text:t}){const n=(0,d.useRef)(null),s=function(e){return e.fontStyle||e.fontWeight?e:e.fontFace&&e.fontFace.length?e.fontFace.find((e=>"normal"===e.fontStyle&&"400"===e.fontWeight))||e.fontFace[0]:{fontStyle:"normal",fontWeight:"400",fontFamily:e.fontFamily,fake:!0}}(e),i=nl(e);t=t||e.name;const r=e.preview,[o,a]=(0,d.useState)(!1),[l,c]=(0,d.useState)(!1),{loadFontFaceAsset:u}=(0,d.useContext)(Yc),h=null!=r?r:function(e){return e.preview?e.preview:e.src?Array.isArray(e.src)?e.src[0]:e.src:void 0}(s),p=h&&h.match(/\.(png|jpg|jpeg|gif|svg)$/i);var f;const m={fontSize:"18px",lineHeight:1,opacity:l?"1":"0",...i,...{fontFamily:el((f=s).fontFamily),fontStyle:f.fontStyle||"normal",fontWeight:f.fontWeight||"400"}};return(0,d.useEffect)((()=>{const e=new window.IntersectionObserver((([e])=>{a(e.isIntersecting)}),{});return e.observe(n.current),()=>e.disconnect()}),[n]),(0,d.useEffect)((()=>{(async()=>{o&&(!p&&s.src&&await u(s),c(!0))})()}),[s,o,u,p]),(0,oe.jsx)("div",{ref:n,children:p?(0,oe.jsx)("img",{src:h,loading:"lazy",alt:t,className:"font-library-modal__font-variant_demo-image"}):(0,oe.jsx)(y.__experimentalText,{style:m,className:"font-library-modal__font-variant_demo-text",children:t})})};const Qc=function({font:e,onClick:t,variantsText:n,navigatorPath:s}){const i=e.fontFace?.length||1,r={cursor:t?"pointer":"default"},o=(0,y.useNavigator)();return(0,oe.jsx)(y.Button,{__next40pxDefaultSize:!0,onClick:()=>{t(),s&&o.goTo(s)},style:r,className:"font-library-modal__font-card",children:(0,oe.jsxs)(y.Flex,{justify:"space-between",wrap:!1,children:[(0,oe.jsx)(Jc,{font:e}),(0,oe.jsxs)(y.Flex,{justify:"flex-end",children:[(0,oe.jsx)(y.FlexItem,{children:(0,oe.jsx)(y.__experimentalText,{className:"font-library-modal__font-card__count",children:n||(0,b.sprintf)((0,b._n)("%d variant","%d variants",i),i)})}),(0,oe.jsx)(y.FlexItem,{children:(0,oe.jsx)(y.Icon,{icon:(0,b.isRTL)()?Ko:Zo})})]})]})})},{kebabCase:$c}=te(y.privateApis);const eu=function({face:e,font:t}){const{isFontActivated:n,toggleActivateFont:s}=(0,d.useContext)(Yc),i=t?.fontFace?.length>0?n(t.slug,e.fontStyle,e.fontWeight,t.source):n(t.slug,null,null,t.source),r=()=>{t?.fontFace?.length>0?s(t,e):s(t)},o=t.name+" "+Rc(e),a=$c(`${t.slug}-${Rc(e)}`);return(0,oe.jsx)("div",{className:"font-library-modal__font-card",children:(0,oe.jsxs)(y.Flex,{justify:"flex-start",align:"center",gap:"1rem",children:[(0,oe.jsx)(y.CheckboxControl,{checked:i,onChange:r,__nextHasNoMarginBottom:!0,id:a}),(0,oe.jsx)("label",{htmlFor:a,children:(0,oe.jsx)(Jc,{font:e,text:o,onClick:r})})]})})};function tu(e){switch(e){case"normal":return 400;case"bold":return 700;case"bolder":return 500;case"lighter":return 300;default:return parseInt(e,10)}}function nu(e){return e.sort(((e,t)=>"normal"===e.fontStyle&&"normal"!==t.fontStyle?-1:"normal"===t.fontStyle&&"normal"!==e.fontStyle?1:e.fontStyle===t.fontStyle?tu(e.fontWeight)-tu(t.fontWeight):e.fontStyle.localeCompare(t.fontStyle)))}const{useGlobalSetting:su}=te(x.privateApis);function iu({font:e,isOpen:t,setIsOpen:n,setNotice:s,uninstallFontFamily:i,handleSetLibraryFontSelected:r}){const o=(0,y.useNavigator)();return(0,oe.jsx)(y.__experimentalConfirmDialog,{isOpen:t,cancelButtonText:(0,b.__)("Cancel"),confirmButtonText:(0,b.__)("Delete"),onCancel:()=>{n(!1)},onConfirm:async()=>{s(null),n(!1);try{await i(e),o.goBack(),r(null),s({type:"success",message:(0,b.__)("Font family uninstalled successfully.")})}catch(e){s({type:"error",message:(0,b.__)("There was an error uninstalling the font family.")+e.message})}},size:"medium",children:e&&(0,b.sprintf)((0,b.__)('Are you sure you want to delete "%s" font and all its variants and assets?'),e.name)})}const ru=function(){var e;const{baseCustomFonts:t,libraryFontSelected:n,handleSetLibraryFontSelected:s,refreshLibrary:i,uninstallFontFamily:r,isResolvingLibrary:o,isInstalling:a,saveFontFamilies:c,getFontFacesActivated:u}=(0,d.useContext)(Yc),[h,p]=su("typography.fontFamilies"),[f,m]=(0,d.useState)(!1),[g,v]=(0,d.useState)(!1),[x]=su("typography.fontFamilies",void 0,"base"),w=(0,l.useSelect)((e=>{const{__experimentalGetCurrentGlobalStylesId:t}=e(_.store);return t()})),j=(0,_.useEntityRecord)("root","globalStyles",w),S=!!j?.edits?.settings?.typography?.fontFamilies,C=h?.theme?h.theme.map((e=>Vc(e,{source:"theme"}))).sort(((e,t)=>e.name.localeCompare(t.name))):[],k=new Set(C.map((e=>e.slug))),E=x?.theme?C.concat(x.theme.filter((e=>!k.has(e.slug))).map((e=>Vc(e,{source:"theme"}))).sort(((e,t)=>e.name.localeCompare(t.name)))):[],P="custom"===n?.source&&n?.id,I=(0,l.useSelect)((e=>{const{canUser:t}=e(_.store);return P&&t("delete",{kind:"postType",name:"wp_font_family",id:P})}),[P]),T=!!n&&"theme"!==n?.source&&I,O=e=>{const t=e?.fontFace?.length>0?e.fontFace.length:1,n=u(e.slug,e.source).length;return(0,b.sprintf)((0,b.__)("%1$s/%2$s variants active"),n,t)};(0,d.useEffect)((()=>{s(n),i()}),[]);const A=n?u(n.slug,n.source).length:0,N=null!==(e=n?.fontFace?.length)&&void 0!==e?e:n?.fontFamily?1:0,M=A>0&&A!==N,F=A===N,V=E.length>0||t.length>0;return(0,oe.jsxs)("div",{className:"font-library-modal__tabpanel-layout",children:[o&&(0,oe.jsx)("div",{className:"font-library-modal__loading",children:(0,oe.jsx)(y.ProgressBar,{})}),!o&&(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsxs)(y.Navigator,{initialPath:n?"/fontFamily":"/",children:[(0,oe.jsx)(y.Navigator.Screen,{path:"/",children:(0,oe.jsxs)(y.__experimentalVStack,{spacing:"8",children:[g&&(0,oe.jsx)(y.Notice,{status:g.type,onRemove:()=>v(null),children:g.message}),!V&&(0,oe.jsx)(y.__experimentalText,{as:"p",children:(0,b.__)("No fonts installed.")}),E.length>0&&(0,oe.jsxs)(y.__experimentalVStack,{children:[(0,oe.jsx)("h2",{className:"font-library-modal__fonts-title",children:(0,b._x)("Theme","font source")}),(0,oe.jsx)("ul",{role:"list",className:"font-library-modal__fonts-list",children:E.map((e=>(0,oe.jsx)("li",{className:"font-library-modal__fonts-list-item",children:(0,oe.jsx)(Qc,{font:e,navigatorPath:"/fontFamily",variantsText:O(e),onClick:()=>{v(null),s(e)}})},e.slug)))})]}),t.length>0&&(0,oe.jsxs)(y.__experimentalVStack,{children:[(0,oe.jsx)("h2",{className:"font-library-modal__fonts-title",children:(0,b._x)("Custom","font source")}),(0,oe.jsx)("ul",{role:"list",className:"font-library-modal__fonts-list",children:t.map((e=>(0,oe.jsx)("li",{className:"font-library-modal__fonts-list-item",children:(0,oe.jsx)(Qc,{font:e,navigatorPath:"/fontFamily",variantsText:O(e),onClick:()=>{v(null),s(e)}})},e.slug)))})]})]})}),(0,oe.jsxs)(y.Navigator.Screen,{path:"/fontFamily",children:[(0,oe.jsx)(iu,{font:n,isOpen:f,setIsOpen:m,setNotice:v,uninstallFontFamily:r,handleSetLibraryFontSelected:s}),(0,oe.jsxs)(y.Flex,{justify:"flex-start",children:[(0,oe.jsx)(y.Navigator.BackButton,{icon:(0,b.isRTL)()?Zo:Ko,size:"small",onClick:()=>{s(null),v(null)},label:(0,b.__)("Back")}),(0,oe.jsx)(y.__experimentalHeading,{level:2,size:13,className:"edit-site-global-styles-header",children:n?.name})]}),g&&(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(y.__experimentalSpacer,{margin:1}),(0,oe.jsx)(y.Notice,{status:g.type,onRemove:()=>v(null),children:g.message}),(0,oe.jsx)(y.__experimentalSpacer,{margin:1})]}),(0,oe.jsx)(y.__experimentalSpacer,{margin:4}),(0,oe.jsx)(y.__experimentalText,{children:(0,b.__)("Choose font variants. Keep in mind that too many variants could make your site slower.")}),(0,oe.jsx)(y.__experimentalSpacer,{margin:4}),(0,oe.jsxs)(y.__experimentalVStack,{spacing:0,children:[(0,oe.jsx)(y.CheckboxControl,{className:"font-library-modal__select-all",label:(0,b.__)("Select all"),checked:F,onChange:()=>{var e;const t=null!==(e=h?.[n.source]?.filter((e=>e.slug!==n.slug)))&&void 0!==e?e:[],s=F?t:[...t,n];p({...h,[n.source]:s}),n.fontFace&&n.fontFace.forEach((e=>{F?zc(e,"all"):Lc(e,Gc(e?.src),"all")}))},indeterminate:M,__nextHasNoMarginBottom:!0}),(0,oe.jsx)(y.__experimentalSpacer,{margin:8}),(0,oe.jsx)("ul",{role:"list",className:"font-library-modal__fonts-list",children:(e=>e?e.fontFace&&e.fontFace.length?nu(e.fontFace):[{fontFamily:e.fontFamily,fontStyle:"normal",fontWeight:"400"}]:[])(n).map(((e,t)=>(0,oe.jsx)("li",{className:"font-library-modal__fonts-list-item",children:(0,oe.jsx)(eu,{font:n,face:e},`face${t}`)},`face${t}`)))})]})]})]}),(0,oe.jsxs)(y.__experimentalHStack,{justify:"flex-end",className:"font-library-modal__footer",children:[a&&(0,oe.jsx)(y.ProgressBar,{}),T&&(0,oe.jsx)(y.Button,{__next40pxDefaultSize:!0,isDestructive:!0,variant:"tertiary",onClick:()=>{m(!0)},children:(0,b.__)("Delete")}),(0,oe.jsx)(y.Button,{__next40pxDefaultSize:!0,variant:"primary",onClick:async()=>{v(null);try{await c(h),v({type:"success",message:(0,b.__)("Font family updated successfully.")})}catch(e){v({type:"error",message:(0,b.sprintf)((0,b.__)("There was an error updating the font family. %s"),e.message)})}},disabled:!S,accessibleWhenDisabled:!0,children:(0,b.__)("Update")})]})]})]})},ou=(0,oe.jsx)(Yt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Yt.Path,{d:"M6.6 6L5.4 7l4.5 5-4.5 5 1.1 1 5.5-6-5.4-6zm6 0l-1.1 1 4.5 5-4.5 5 1.1 1 5.5-6-5.5-6z"})}),au=(0,oe.jsx)(Yt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Yt.Path,{d:"M11.6 7l-1.1-1L5 12l5.5 6 1.1-1L7 12l4.6-5zm6 0l-1.1-1-5.5 6 5.5 6 1.1-1-4.6-5 4.6-5z"})});function lu(e,t,n){return t?!!n[e]?.[`${t.fontStyle}-${t.fontWeight}`]:!!n[e]}const cu=function(){return(0,oe.jsx)("div",{className:"font-library__google-fonts-confirm",children:(0,oe.jsx)(y.Card,{children:(0,oe.jsxs)(y.CardBody,{children:[(0,oe.jsx)(y.__experimentalHeading,{level:2,children:(0,b.__)("Connect to Google Fonts")}),(0,oe.jsx)(y.__experimentalSpacer,{margin:6}),(0,oe.jsx)(y.__experimentalText,{as:"p",children:(0,b.__)("To install fonts from Google you must give permission to connect directly to Google servers. The fonts you install will be downloaded from Google and stored on your site. Your site will then use these locally-hosted fonts.")}),(0,oe.jsx)(y.__experimentalSpacer,{margin:3}),(0,oe.jsx)(y.__experimentalText,{as:"p",children:(0,b.__)("You can alternatively upload files directly on the Upload tab.")}),(0,oe.jsx)(y.__experimentalSpacer,{margin:6}),(0,oe.jsx)(y.Button,{__next40pxDefaultSize:!0,variant:"primary",onClick:()=>{window.localStorage.setItem("wp-font-library-google-fonts-permission","true"),window.dispatchEvent(new Event("storage"))},children:(0,b.__)("Allow access to Google Fonts")})]})})})},{kebabCase:uu}=te(y.privateApis);const du=function({face:e,font:t,handleToggleVariant:n,selected:s}){const i=()=>{t?.fontFace?n(t,e):n(t)},r=t.name+" "+Rc(e),o=uu(`${t.slug}-${Rc(e)}`);return(0,oe.jsx)("div",{className:"font-library-modal__font-card",children:(0,oe.jsxs)(y.Flex,{justify:"flex-start",align:"center",gap:"1rem",children:[(0,oe.jsx)(y.CheckboxControl,{checked:s,onChange:i,__nextHasNoMarginBottom:!0,id:o}),(0,oe.jsx)("label",{htmlFor:o,children:(0,oe.jsx)(Jc,{font:e,text:r,onClick:i})})]})})},hu={slug:"all",name:(0,b._x)("All","font categories")},pu="wp-font-library-google-fonts-permission";const fu=function({slug:e}){var t;const n="google-fonts"===e,s=()=>"true"===window.localStorage.getItem(pu),[i,r]=(0,d.useState)(null),[o,a]=(0,d.useState)(!1),[l,c]=(0,d.useState)([]),[u,h]=(0,d.useState)(1),[p,f]=(0,d.useState)({}),[m,g]=(0,d.useState)(n&&!s()),{collections:x,getFontCollection:w,installFonts:_,isInstalling:j}=(0,d.useContext)(Yc),S=x.find((t=>t.slug===e));(0,d.useEffect)((()=>{const e=()=>{g(n&&!s())};return e(),window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)}),[e,n]);const C=()=>{window.localStorage.setItem(pu,"false"),window.dispatchEvent(new Event("storage"))};(0,d.useEffect)((()=>{(async()=>{try{await w(e),B()}catch(e){o||a({type:"error",message:e?.message})}})()}),[e,w,a,o]),(0,d.useEffect)((()=>{r(null)}),[e]),(0,d.useEffect)((()=>{c([])}),[i]);const k=(0,d.useMemo)((()=>{var e;return null!==(e=S?.font_families)&&void 0!==e?e:[]}),[S]),E=null!==(t=S?.categories)&&void 0!==t?t:[],P=[hu,...E],I=(0,d.useMemo)((()=>function(e,t){const{category:n,search:s}=t;let i=e||[];return n&&"all"!==n&&(i=i.filter((e=>-1!==e.categories.indexOf(n)))),s&&(i=i.filter((e=>e.font_family_settings.name.toLowerCase().includes(s.toLowerCase())))),i}(k,p)),[k,p]),T=!S?.font_families&&!o,O=Math.max(window.innerHeight,500),A=Math.floor((O-417)/61),N=Math.ceil(I.length/A),M=(u-1)*A,F=u*A,V=I.slice(M,F),R=(0,v.debounce)((e=>{f({...p,search:e}),h(1)}),300),B=()=>{f({}),h(1)},D=(e,t)=>{const n=Zc(e,t,l);c(n)},L=function(e){return e.reduce(((e,t)=>({...e,[t.slug]:(t?.fontFace||[]).reduce(((e,t)=>({...e,[`${t.fontStyle}-${t.fontWeight}`]:!0})),{})})),{})}(l),z=l.length>0?l[0]?.fontFace?.length:0,G=z>0&&z!==i?.fontFace?.length,H=z===i?.fontFace?.length;if(m)return(0,oe.jsx)(cu,{});const U=()=>"google-fonts"!==e||m||i?null:(0,oe.jsx)(y.DropdownMenu,{icon:Da,label:(0,b.__)("Actions"),popoverProps:{position:"bottom left"},controls:[{title:(0,b.__)("Revoke access to Google Fonts"),onClick:C}]});return(0,oe.jsxs)("div",{className:"font-library-modal__tabpanel-layout",children:[T&&(0,oe.jsx)("div",{className:"font-library-modal__loading",children:(0,oe.jsx)(y.ProgressBar,{})}),!T&&(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsxs)(y.Navigator,{initialPath:"/",className:"font-library-modal__tabpanel-layout",children:[(0,oe.jsxs)(y.Navigator.Screen,{path:"/",children:[(0,oe.jsxs)(y.__experimentalHStack,{justify:"space-between",children:[(0,oe.jsxs)(y.__experimentalVStack,{children:[(0,oe.jsx)(y.__experimentalHeading,{level:2,size:13,children:S.name}),(0,oe.jsx)(y.__experimentalText,{children:S.description})]}),(0,oe.jsx)(U,{})]}),(0,oe.jsx)(y.__experimentalSpacer,{margin:4}),(0,oe.jsxs)(y.Flex,{children:[(0,oe.jsx)(y.FlexItem,{children:(0,oe.jsx)(y.SearchControl,{className:"font-library-modal__search",value:p.search,placeholder:(0,b.__)("Font name…"),label:(0,b.__)("Search"),onChange:R,__nextHasNoMarginBottom:!0,hideLabelFromVision:!1})}),(0,oe.jsx)(y.FlexItem,{children:(0,oe.jsx)(y.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,b.__)("Category"),value:p.category,onChange:e=>{f({...p,category:e}),h(1)},children:P&&P.map((e=>(0,oe.jsx)("option",{value:e.slug,children:e.name},e.slug)))})})]}),(0,oe.jsx)(y.__experimentalSpacer,{margin:4}),!!S?.font_families?.length&&!I.length&&(0,oe.jsx)(y.__experimentalText,{children:(0,b.__)("No fonts found. Try with a different search term")}),(0,oe.jsx)("div",{className:"font-library-modal__fonts-grid__main",children:(0,oe.jsx)("ul",{role:"list",className:"font-library-modal__fonts-list",children:V.map((e=>(0,oe.jsx)("li",{className:"font-library-modal__fonts-list-item",children:(0,oe.jsx)(Qc,{font:e.font_family_settings,navigatorPath:"/fontFamily",onClick:()=>{r(e.font_family_settings)}})},e.font_family_settings.slug)))})})]}),(0,oe.jsxs)(y.Navigator.Screen,{path:"/fontFamily",children:[(0,oe.jsxs)(y.Flex,{justify:"flex-start",children:[(0,oe.jsx)(y.Navigator.BackButton,{icon:(0,b.isRTL)()?Zo:Ko,size:"small",onClick:()=>{r(null),a(null)},label:(0,b.__)("Back")}),(0,oe.jsx)(y.__experimentalHeading,{level:2,size:13,className:"edit-site-global-styles-header",children:i?.name})]}),o&&(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(y.__experimentalSpacer,{margin:1}),(0,oe.jsx)(y.Notice,{status:o.type,onRemove:()=>a(null),children:o.message}),(0,oe.jsx)(y.__experimentalSpacer,{margin:1})]}),(0,oe.jsx)(y.__experimentalSpacer,{margin:4}),(0,oe.jsx)(y.__experimentalText,{children:(0,b.__)("Select font variants to install.")}),(0,oe.jsx)(y.__experimentalSpacer,{margin:4}),(0,oe.jsx)(y.CheckboxControl,{className:"font-library-modal__select-all",label:(0,b.__)("Select all"),checked:H,onChange:()=>{c(H?[]:[i])},indeterminate:G,__nextHasNoMarginBottom:!0}),(0,oe.jsx)(y.__experimentalVStack,{spacing:0,children:(0,oe.jsx)("ul",{role:"list",className:"font-library-modal__fonts-list",children:(W=i,W?W.fontFace&&W.fontFace.length?nu(W.fontFace):[{fontFamily:W.fontFamily,fontStyle:"normal",fontWeight:"400"}]:[]).map(((e,t)=>(0,oe.jsx)("li",{className:"font-library-modal__fonts-list-item",children:(0,oe.jsx)(du,{font:i,face:e,handleToggleVariant:D,selected:lu(i.slug,i.fontFace?e:null,L)})},`face${t}`)))})}),(0,oe.jsx)(y.__experimentalSpacer,{margin:16})]})]}),i&&(0,oe.jsx)(y.Flex,{justify:"flex-end",className:"font-library-modal__footer",children:(0,oe.jsx)(y.Button,{__next40pxDefaultSize:!0,variant:"primary",onClick:async()=>{a(null);const e=l[0];try{e?.fontFace&&await Promise.all(e.fontFace.map((async e=>{e.src&&(e.file=await async function(e){e=Array.isArray(e)?e:[e];const t=await Promise.all(e.map((async e=>fetch(new Request(e)).then((t=>{if(!t.ok)throw new Error(`Error downloading font face asset from ${e}. Server responded with status: ${t.status}`);return t.blob()})).then((t=>{const n=e.split("/").pop();return new Mc([t],n,{type:t.type})})))));return 1===t.length?t[0]:t}(e.src))})))}catch(e){return void a({type:"error",message:(0,b.__)("Error installing the fonts, could not be downloaded.")})}try{await _([e]),a({type:"success",message:(0,b.__)("Fonts were installed successfully.")})}catch(e){a({type:"error",message:e.message})}c([])},isBusy:j,disabled:0===l.length||j,accessibleWhenDisabled:!0,children:(0,b.__)("Install")})}),!i&&(0,oe.jsxs)(y.__experimentalHStack,{expanded:!1,className:"font-library-modal__footer",justify:"end",spacing:6,children:[(0,oe.jsx)(y.__experimentalHStack,{justify:"flex-start",expanded:!1,spacing:1,className:"font-library-modal__page-selection",children:(0,d.createInterpolateElement)((0,b.sprintf)((0,b._x)("
    Page
    %1$s
    of %2$s
    ","paging"),"",N),{div:(0,oe.jsx)("div",{"aria-hidden":!0}),CurrentPage:(0,oe.jsx)(y.SelectControl,{"aria-label":(0,b.__)("Current page"),value:u,options:[...Array(N)].map(((e,t)=>({label:t+1,value:t+1}))),onChange:e=>h(parseInt(e)),size:"small",__nextHasNoMarginBottom:!0,variant:"minimal"})})}),(0,oe.jsxs)(y.__experimentalHStack,{expanded:!1,spacing:1,children:[(0,oe.jsx)(y.Button,{onClick:()=>h(u-1),disabled:1===u,accessibleWhenDisabled:!0,label:(0,b.__)("Previous page"),icon:(0,b.isRTL)()?ou:au,showTooltip:!0,size:"compact",tooltipPosition:"top"}),(0,oe.jsx)(y.Button,{onClick:()=>h(u+1),disabled:u===N,accessibleWhenDisabled:!0,label:(0,b.__)("Next page"),icon:(0,b.isRTL)()?au:ou,showTooltip:!0,size:"compact",tooltipPosition:"top"})]})]})]})]});var W};var mu=i(8572),gu=i.n(mu),vu=i(4660),xu=i.n(vu);globalThis.fetch;class yu{constructor(e,t={},n){this.type=e,this.detail=t,this.msg=n,Object.defineProperty(this,"__mayPropagate",{enumerable:!1,writable:!0}),this.__mayPropagate=!0}preventDefault(){}stopPropagation(){this.__mayPropagate=!1}valueOf(){return this}toString(){return this.msg?`[${this.type} event]: ${this.msg}`:`[${this.type} event]`}}class bu{constructor(){this.listeners={}}addEventListener(e,t,n){let s=this.listeners[e]||[];n?s.unshift(t):s.push(t),this.listeners[e]=s}removeEventListener(e,t){let n=this.listeners[e]||[],s=n.findIndex((e=>e===t));s>-1&&(n.splice(s,1),this.listeners[e]=n)}dispatch(e){let t=this.listeners[e.type];if(t)for(let n=0,s=t.length;n{let t=e.replace(/get(Big)?/,"").toLowerCase(),n=parseInt(e.replace(/[^\d]/g,""))/8;Object.defineProperty(this,t,{get:()=>this.getValue(e,n)})}))}get currentPosition(){return this.start+this.offset}set currentPosition(e){this.start=e,this.offset=0}skip(e=0,t=8){this.offset+=e*t/8}getValue(e,t){let n=this.start+this.offset;this.offset+=t;try{return this.data[e](n)}catch(n){throw console.error("parser",e,t,this),console.error("parser",this.start,this.offset),n}}flags(e){if(8===e||16===e||32===e||64===e)return this[`uint${e}`].toString(2).padStart(e,0).split("").map((e=>"1"===e));console.error("Error parsing flags: flag types can only be 1, 2, 4, or 8 bytes long"),console.trace()}get tag(){const e=this.uint32;return t=[e>>24&255,e>>16&255,e>>8&255,255&e],Array.from(t).map((e=>String.fromCharCode(e))).join("");var t}get fixed(){return this.int16+Math.round(1e3*this.uint16/65356)/1e3}get legacyFixed(){let e=this.uint16,t=this.uint16.toString(16).padStart(4,0);return parseFloat(`${e}.${t}`)}get uint24(){return(this.uint8<<16)+(this.uint8<<8)+this.uint8}get uint128(){let e=0;for(let t=0;t<5;t++){let t=this.uint8;if(e=128*e+(127&t),t<128)break}return e}get longdatetime(){return new Date(wu+1e3*parseInt(this.int64.toString()))}get fword(){return this.int16}get ufword(){return this.uint16}get Offset16(){return this.uint16}get Offset32(){return this.uint32}get F2DOT14(){const e=p.uint16;return[0,1,-2,-1][e>>14]+(16383&e)/16384}verifyLength(){this.offset!=this.length&&console.error(`unexpected parsed table size (${this.offset}) for "${this.name}" (expected ${this.length})`)}readBytes(e=0,t=0,n=8,s=!1){if(0===(e=e||this.length))return[];t&&(this.currentPosition=t);const i=`${s?"":"u"}int${n}`,r=[];for(;e--;)r.push(this[i]);return r}}class ju{constructor(e){const t={enumerable:!1,get:()=>e};Object.defineProperty(this,"parser",t);const n=e.currentPosition,s={enumerable:!1,get:()=>n};Object.defineProperty(this,"start",s)}load(e){Object.keys(e).forEach((t=>{let n=Object.getOwnPropertyDescriptor(e,t);n.get?this[t]=n.get.bind(this):void 0!==n.value&&(this[t]=n.value)})),this.parser.length&&this.parser.verifyLength()}}class Su extends ju{constructor(e,t,n){const{parser:s,start:i}=super(new _u(e,t,n)),r={enumerable:!1,get:()=>s};Object.defineProperty(this,"p",r);const o={enumerable:!1,get:()=>i};Object.defineProperty(this,"tableStart",o)}}function Cu(e,t,n){let s;Object.defineProperty(e,t,{get:()=>s||(s=n(),s),enumerable:!0})}class ku extends Su{constructor(e,t,n){const{p:s}=super({offset:0,length:12},t,"sfnt");this.version=s.uint32,this.numTables=s.uint16,this.searchRange=s.uint16,this.entrySelector=s.uint16,this.rangeShift=s.uint16,s.verifyLength(),this.directory=[...new Array(this.numTables)].map((e=>new Eu(s))),this.tables={},this.directory.forEach((e=>{Cu(this.tables,e.tag.trim(),(()=>n(this.tables,{tag:e.tag,offset:e.offset,length:e.length},t)))}))}}class Eu{constructor(e){this.tag=e.tag,this.checksum=e.uint32,this.offset=e.uint32,this.length=e.uint32}}const Pu=xu().inflate||void 0;let Iu;class Tu extends Su{constructor(e,t,n){const{p:s}=super({offset:0,length:44},t,"woff");this.signature=s.tag,this.flavor=s.uint32,this.length=s.uint32,this.numTables=s.uint16,s.uint16,this.totalSfntSize=s.uint32,this.majorVersion=s.uint16,this.minorVersion=s.uint16,this.metaOffset=s.uint32,this.metaLength=s.uint32,this.metaOrigLength=s.uint32,this.privOffset=s.uint32,this.privLength=s.uint32,s.verifyLength(),this.directory=[...new Array(this.numTables)].map((e=>new Ou(s))),Au(this,t,n)}}class Ou{constructor(e){this.tag=e.tag,this.offset=e.uint32,this.compLength=e.uint32,this.origLength=e.uint32,this.origChecksum=e.uint32}}function Au(e,t,n){e.tables={},e.directory.forEach((s=>{Cu(e.tables,s.tag.trim(),(()=>{let i=0,r=t;if(s.compLength!==s.origLength){const e=t.buffer.slice(s.offset,s.offset+s.compLength);let n;if(Pu)n=Pu(new Uint8Array(e));else{if(!Iu){const e="no brotli decoder available to decode WOFF2 font";throw font.onerror&&font.onerror(e),new Error(e)}n=Iu(new Uint8Array(e))}r=new DataView(n.buffer)}else i=s.offset;return n(e.tables,{tag:s.tag,offset:i,length:s.origLength},r)}))}))}const Nu=gu();let Mu;class Fu extends Su{constructor(e,t,n){const{p:s}=super({offset:0,length:48},t,"woff2");this.signature=s.tag,this.flavor=s.uint32,this.length=s.uint32,this.numTables=s.uint16,s.uint16,this.totalSfntSize=s.uint32,this.totalCompressedSize=s.uint32,this.majorVersion=s.uint16,this.minorVersion=s.uint16,this.metaOffset=s.uint32,this.metaLength=s.uint32,this.metaOrigLength=s.uint32,this.privOffset=s.uint32,this.privLength=s.uint32,s.verifyLength(),this.directory=[...new Array(this.numTables)].map((e=>new Vu(s)));let i,r=s.currentPosition;this.directory[0].offset=0,this.directory.forEach(((e,t)=>{let n=this.directory[t+1];n&&(n.offset=e.offset+(void 0!==e.transformLength?e.transformLength:e.origLength))}));let o=t.buffer.slice(r);if(Nu)i=Nu(new Uint8Array(o));else{if(!Mu){const t="no brotli decoder available to decode WOFF2 font";throw e.onerror&&e.onerror(t),new Error(t)}i=new Uint8Array(Mu(o))}!function(e,t,n){e.tables={},e.directory.forEach((s=>{Cu(e.tables,s.tag.trim(),(()=>{const i=s.offset,r=i+(s.transformLength?s.transformLength:s.origLength),o=new DataView(t.slice(i,r).buffer);try{return n(e.tables,{tag:s.tag,offset:0,length:s.origLength},o)}catch(e){console.error(e)}}))}))}(this,i,n)}}class Vu{constructor(e){this.flags=e.uint8;const t=this.tagNumber=63&this.flags;this.tag=63===t?e.tag:["cmap","head","hhea","hmtx","maxp","name","OS/2","post","cvt ","fpgm","glyf","loca","prep","CFF ","VORG","EBDT","EBLC","gasp","hdmx","kern","LTSH","PCLT","VDMX","vhea","vmtx","BASE","GDEF","GPOS","GSUB","EBSC","JSTF","MATH","CBDT","CBLC","COLR","CPAL","SVG ","sbix","acnt","avar","bdat","bloc","bsln","cvar","fdsc","feat","fmtx","fvar","gvar","hsty","just","lcar","mort","morx","opbd","prop","trak","Zapf","Silf","Glat","Gloc","Feat","Sill"][63&t];let n=0!==(this.transformVersion=(192&this.flags)>>6);"glyf"!==this.tag&&"loca"!==this.tag||(n=3!==this.transformVersion),this.origLength=e.uint128,n&&(this.transformLength=e.uint128)}}const Ru={};let Bu=!1;function Du(e,t,n){let s=t.tag.replace(/[^\w\d]/g,""),i=Ru[s];return i?new i(t,n,e):(console.warn(`lib-font has no definition for ${s}. The table was skipped.`),{})}function Lu(){let e=0;function t(n,s){if(!Bu)return e>10?s(new Error("loading took too long")):(e++,setTimeout((()=>t(n)),250));n(Du)}return new Promise(((e,n)=>t(e)))}async function zu(e,t,n={}){if(!globalThis.document)return;let s=function(e,t){let n=e.lastIndexOf("."),s=(e.substring(n+1)||"").toLowerCase(),i={ttf:"truetype",otf:"opentype",woff:"woff",woff2:"woff2"}[s];if(i)return i;let r={eot:"The .eot format is not supported: it died in January 12, 2016, when Microsoft retired all versions of IE that didn't already support WOFF.",svg:"The .svg format is not supported: SVG fonts (not to be confused with OpenType with embedded SVG) were so bad we took the entire fonts chapter out of the SVG specification again.",fon:"The .fon format is not supported: this is an ancient Windows bitmap font format.",ttc:"Based on the current CSS specification, font collections are not (yet?) supported."}[s];if(r||(r=`${e} is not a known webfont format.`),t)throw new Error(r);console.warn(`Could not load font: ${r}`)}(t,n.errorOnStyle);if(!s)return;let i=document.createElement("style");i.className="injected-by-Font-js";let r=[];return n.styleRules&&(r=Object.entries(n.styleRules).map((([e,t])=>`${e}: ${t};`))),i.textContent=`\n@font-face {\n font-family: "${e}";\n ${r.join("\n\t")}\n src: url("${t}") format("${s}");\n}`,globalThis.document.head.appendChild(i),i}Promise.all([Promise.resolve().then((function(){return ud})),Promise.resolve().then((function(){return dd})),Promise.resolve().then((function(){return hd})),Promise.resolve().then((function(){return fd})),Promise.resolve().then((function(){return md})),Promise.resolve().then((function(){return xd})),Promise.resolve().then((function(){return yd})),Promise.resolve().then((function(){return wd})),Promise.resolve().then((function(){return Ad})),Promise.resolve().then((function(){return Ud})),Promise.resolve().then((function(){return zh})),Promise.resolve().then((function(){return Gh})),Promise.resolve().then((function(){return Wh})),Promise.resolve().then((function(){return Kh})),Promise.resolve().then((function(){return Yh})),Promise.resolve().then((function(){return Xh})),Promise.resolve().then((function(){return Qh})),Promise.resolve().then((function(){return $h})),Promise.resolve().then((function(){return ep})),Promise.resolve().then((function(){return tp})),Promise.resolve().then((function(){return np})),Promise.resolve().then((function(){return sp})),Promise.resolve().then((function(){return rp})),Promise.resolve().then((function(){return up})),Promise.resolve().then((function(){return hp})),Promise.resolve().then((function(){return pp})),Promise.resolve().then((function(){return fp})),Promise.resolve().then((function(){return mp})),Promise.resolve().then((function(){return gp})),Promise.resolve().then((function(){return yp})),Promise.resolve().then((function(){return Sp})),Promise.resolve().then((function(){return Ep})),Promise.resolve().then((function(){return Ip})),Promise.resolve().then((function(){return Ap})),Promise.resolve().then((function(){return Np})),Promise.resolve().then((function(){return Mp})),Promise.resolve().then((function(){return Vp})),Promise.resolve().then((function(){return Rp})),Promise.resolve().then((function(){return zp})),Promise.resolve().then((function(){return Gp})),Promise.resolve().then((function(){return Up}))]).then((e=>{e.forEach((e=>{let t=Object.keys(e)[0];Ru[t]=e[t]})),Bu=!0}));const Gu=[0,1,0,0],Hu=[79,84,84,79],Uu=[119,79,70,70],Wu=[119,79,70,50];function qu(e,t){if(e.length===t.length){for(let n=0;n{globalThis.document&&!this.options.skipStyleSheet&&await zu(this.name,e,this.options),this.loadFont(e)})()}async loadFont(e,t){fetch(e).then((e=>function(e){if(!e.ok)throw new Error(`HTTP ${e.status} - ${e.statusText}`);return e}(e)&&e.arrayBuffer())).then((n=>this.fromDataBuffer(n,t||e))).catch((n=>{const s=new yu("error",n,`Failed to load font at ${t||e}`);this.dispatch(s),this.onerror&&this.onerror(s)}))}async fromDataBuffer(e,t){this.fontData=new DataView(e);let n=function(e){const t=[e.getUint8(0),e.getUint8(1),e.getUint8(2),e.getUint8(3)];return qu(t,Gu)||qu(t,Hu)?"SFNT":qu(t,Uu)?"WOFF":qu(t,Wu)?"WOFF2":void 0}(this.fontData);if(!n)throw new Error(`${t} is either an unsupported font format, or not a font at all.`);await this.parseBasicData(n);const s=new yu("load",{font:this});this.dispatch(s),this.onload&&this.onload(s)}async parseBasicData(e){return Lu().then((t=>("SFNT"===e&&(this.opentype=new ku(this,this.fontData,t)),"WOFF"===e&&(this.opentype=new Tu(this,this.fontData,t)),"WOFF2"===e&&(this.opentype=new Fu(this,this.fontData,t)),this.opentype)))}getGlyphId(e){return this.opentype.tables.cmap.getGlyphId(e)}reverse(e){return this.opentype.tables.cmap.reverse(e)}supports(e){return 0!==this.getGlyphId(e)}supportsVariation(e){return!1!==this.opentype.tables.cmap.supportsVariation(e)}measureText(e,t=16){if(this.__unloaded)throw new Error("Cannot measure text: font was unloaded. Please reload before calling measureText()");let n=document.createElement("div");n.textContent=e,n.style.fontFamily=this.name,n.style.fontSize=`${t}px`,n.style.color="transparent",n.style.background="transparent",n.style.top="0",n.style.left="0",n.style.position="absolute",document.body.appendChild(n);let s=n.getBoundingClientRect();document.body.removeChild(n);const i=this.opentype.tables["OS/2"];return s.fontSize=t,s.ascender=i.sTypoAscender,s.descender=i.sTypoDescender,s}unload(){if(this.styleElement.parentNode){this.styleElement.parentNode.removeElement(this.styleElement);const e=new yu("unload",{font:this});this.dispatch(e),this.onunload&&this.onunload(e)}this._unloaded=!0}load(){if(this.__unloaded){delete this.__unloaded,document.head.appendChild(this.styleElement);const e=new yu("load",{font:this});this.dispatch(e),this.onload&&this.onload(e)}}}globalThis.Font=Zu;class Ku extends ju{constructor(e,t,n){super(e),this.plaformID=t,this.encodingID=n}}class Yu extends Ku{constructor(e,t,n){super(e,t,n),this.format=0,this.length=e.uint16,this.language=e.uint16,this.glyphIdArray=[...new Array(256)].map((t=>e.uint8))}supports(e){return e.charCodeAt&&(e=-1,console.warn("supports(character) not implemented for cmap subtable format 0. only supports(id) is implemented.")),0<=e&&e<=255}reverse(e){return console.warn("reverse not implemented for cmap subtable format 0"),{}}getSupportedCharCodes(){return[{start:1,end:256}]}}class Xu extends Ku{constructor(e,t,n){super(e,t,n),this.format=2,this.length=e.uint16,this.language=e.uint16,this.subHeaderKeys=[...new Array(256)].map((t=>e.uint16));const s=Math.max(...this.subHeaderKeys),i=e.currentPosition;Cu(this,"subHeaders",(()=>(e.currentPosition=i,[...new Array(s)].map((t=>new Ju(e))))));const r=i+8*s;Cu(this,"glyphIndexArray",(()=>(e.currentPosition=r,[...new Array(s)].map((t=>e.uint16)))))}supports(e){e.charCodeAt&&(e=-1,console.warn("supports(character) not implemented for cmap subtable format 2. only supports(id) is implemented."));const t=e&&255,n=e&&65280,s=this.subHeaders[n],i=this.subHeaders[s],r=i.firstCode,o=r+i.entryCount;return r<=t&&t<=o}reverse(e){return console.warn("reverse not implemented for cmap subtable format 2"),{}}getSupportedCharCodes(e=!1){return e?this.subHeaders.map((e=>({firstCode:e.firstCode,lastCode:e.lastCode}))):this.subHeaders.map((e=>({start:e.firstCode,end:e.lastCode})))}}class Ju{constructor(e){this.firstCode=e.uint16,this.entryCount=e.uint16,this.lastCode=this.first+this.entryCount,this.idDelta=e.int16,this.idRangeOffset=e.uint16}}class Qu extends Ku{constructor(e,t,n){super(e,t,n),this.format=4,this.length=e.uint16,this.language=e.uint16,this.segCountX2=e.uint16,this.segCount=this.segCountX2/2,this.searchRange=e.uint16,this.entrySelector=e.uint16,this.rangeShift=e.uint16;const s=e.currentPosition;Cu(this,"endCode",(()=>e.readBytes(this.segCount,s,16)));const i=s+2+this.segCountX2;Cu(this,"startCode",(()=>e.readBytes(this.segCount,i,16)));const r=i+this.segCountX2;Cu(this,"idDelta",(()=>e.readBytes(this.segCount,r,16,!0)));const o=r+this.segCountX2;Cu(this,"idRangeOffset",(()=>e.readBytes(this.segCount,o,16)));const a=o+this.segCountX2,l=this.length-(a-this.tableStart);Cu(this,"glyphIdArray",(()=>e.readBytes(l,a,16))),Cu(this,"segments",(()=>this.buildSegments(o,a,e)))}buildSegments(e,t,n){return[...new Array(this.segCount)].map(((t,s)=>{let i=this.startCode[s],r=this.endCode[s],o=this.idDelta[s],a=this.idRangeOffset[s],l=e+2*s,c=[];if(0===a)for(let e=i+o,t=r+o;e<=t;e++)c.push(e);else for(let e=0,t=r-i;e<=t;e++)n.currentPosition=l+a+2*e,c.push(n.uint16);return{startCode:i,endCode:r,idDelta:o,idRangeOffset:a,glyphIDs:c}}))}reverse(e){let t=this.segments.find((t=>t.glyphIDs.includes(e)));if(!t)return{};const n=t.startCode+t.glyphIDs.indexOf(e);return{code:n,unicode:String.fromCodePoint(n)}}getGlyphId(e){if(e.charCodeAt&&(e=e.charCodeAt(0)),55296<=e&&e<=57343)return 0;if(!(65534&~e&&65535&~e))return 0;let t=this.segments.find((t=>t.startCode<=e&&e<=t.endCode));return t?t.glyphIDs[e-t.startCode]:0}supports(e){return 0!==this.getGlyphId(e)}getSupportedCharCodes(e=!1){return e?this.segments:this.segments.map((e=>({start:e.startCode,end:e.endCode})))}}class $u extends Ku{constructor(e,t,n){super(e,t,n),this.format=6,this.length=e.uint16,this.language=e.uint16,this.firstCode=e.uint16,this.entryCount=e.uint16,this.lastCode=this.firstCode+this.entryCount-1;Cu(this,"glyphIdArray",(()=>[...new Array(this.entryCount)].map((t=>e.uint16))))}supports(e){if(e.charCodeAt&&(e=-1,console.warn("supports(character) not implemented for cmap subtable format 6. only supports(id) is implemented.")),ethis.firstCode+this.entryCount)return{};const t=e-this.firstCode;return{code:t,unicode:String.fromCodePoint(t)}}reverse(e){let t=this.glyphIdArray.indexOf(e);if(t>-1)return this.firstCode+t}getSupportedCharCodes(e=!1){return e?[{firstCode:this.firstCode,lastCode:this.lastCode}]:[{start:this.firstCode,end:this.lastCode}]}}class ed extends Ku{constructor(e,t,n){super(e,t,n),this.format=8,e.uint16,this.length=e.uint32,this.language=e.uint32,this.is32=[...new Array(8192)].map((t=>e.uint8)),this.numGroups=e.uint32;Cu(this,"groups",(()=>[...new Array(this.numGroups)].map((t=>new td(e)))))}supports(e){return e.charCodeAt&&(e=-1,console.warn("supports(character) not implemented for cmap subtable format 8. only supports(id) is implemented.")),-1!==this.groups.findIndex((t=>t.startcharCode<=e&&e<=t.endcharCode))}reverse(e){return console.warn("reverse not implemented for cmap subtable format 8"),{}}getSupportedCharCodes(e=!1){return e?this.groups:this.groups.map((e=>({start:e.startcharCode,end:e.endcharCode})))}}class td{constructor(e){this.startcharCode=e.uint32,this.endcharCode=e.uint32,this.startGlyphID=e.uint32}}class nd extends Ku{constructor(e,t,n){super(e,t,n),this.format=10,e.uint16,this.length=e.uint32,this.language=e.uint32,this.startCharCode=e.uint32,this.numChars=e.uint32,this.endCharCode=this.startCharCode+this.numChars;Cu(this,"glyphs",(()=>[...new Array(this.numChars)].map((t=>e.uint16))))}supports(e){return e.charCodeAt&&(e=-1,console.warn("supports(character) not implemented for cmap subtable format 10. only supports(id) is implemented.")),!(ethis.startCharCode+this.numChars)&&e-this.startCharCode)}reverse(e){return console.warn("reverse not implemented for cmap subtable format 10"),{}}getSupportedCharCodes(e=!1){return e?[{startCharCode:this.startCharCode,endCharCode:this.endCharCode}]:[{start:this.startCharCode,end:this.endCharCode}]}}class sd extends Ku{constructor(e,t,n){super(e,t,n),this.format=12,e.uint16,this.length=e.uint32,this.language=e.uint32,this.numGroups=e.uint32;Cu(this,"groups",(()=>[...new Array(this.numGroups)].map((t=>new id(e)))))}supports(e){return e.charCodeAt&&(e=e.charCodeAt(0)),55296<=e&&e<=57343?0:65534&~e&&65535&~e?-1!==this.groups.findIndex((t=>t.startCharCode<=e&&e<=t.endCharCode)):0}reverse(e){for(let t of this.groups){let n=t.startGlyphID;if(n>e)continue;if(n===e)return t.startCharCode;if(n+(t.endCharCode-t.startCharCode)({start:e.startCharCode,end:e.endCharCode})))}}class id{constructor(e){this.startCharCode=e.uint32,this.endCharCode=e.uint32,this.startGlyphID=e.uint32}}class rd extends Ku{constructor(e,t,n){super(e,t,n),this.format=13,e.uint16,this.length=e.uint32,this.language=e.uint32,this.numGroups=e.uint32;Cu(this,"groups",[...new Array(this.numGroups)].map((t=>new od(e))))}supports(e){return e.charCodeAt&&(e=e.charCodeAt(0)),-1!==this.groups.findIndex((t=>t.startCharCode<=e&&e<=t.endCharCode))}reverse(e){return console.warn("reverse not implemented for cmap subtable format 13"),{}}getSupportedCharCodes(e=!1){return e?this.groups:this.groups.map((e=>({start:e.startCharCode,end:e.endCharCode})))}}class od{constructor(e){this.startCharCode=e.uint32,this.endCharCode=e.uint32,this.glyphID=e.uint32}}class ad extends Ku{constructor(e,t,n){super(e,t,n),this.subTableStart=e.currentPosition,this.format=14,this.length=e.uint32,this.numVarSelectorRecords=e.uint32,Cu(this,"varSelectors",(()=>[...new Array(this.numVarSelectorRecords)].map((t=>new ld(e)))))}supports(){return console.warn("supports not implemented for cmap subtable format 14"),0}getSupportedCharCodes(){return console.warn("getSupportedCharCodes not implemented for cmap subtable format 14"),[]}reverse(e){return console.warn("reverse not implemented for cmap subtable format 14"),{}}supportsVariation(e){let t=this.varSelector.find((t=>t.varSelector===e));return t||!1}getSupportedVariations(){return this.varSelectors.map((e=>e.varSelector))}}class ld{constructor(e){this.varSelector=e.uint24,this.defaultUVSOffset=e.Offset32,this.nonDefaultUVSOffset=e.Offset32}}class cd{constructor(e,t){const n=this.platformID=e.uint16,s=this.encodingID=e.uint16,i=this.offset=e.Offset32;Cu(this,"table",(()=>(e.currentPosition=t+i,function(e,t,n){const s=e.uint16;return 0===s?new Yu(e,t,n):2===s?new Xu(e,t,n):4===s?new Qu(e,t,n):6===s?new $u(e,t,n):8===s?new ed(e,t,n):10===s?new nd(e,t,n):12===s?new sd(e,t,n):13===s?new rd(e,t,n):14===s?new ad(e,t,n):{}}(e,n,s))))}}var ud=Object.freeze({__proto__:null,cmap:class extends Su{constructor(e,t){const{p:n}=super(e,t);this.version=n.uint16,this.numTables=n.uint16,this.encodingRecords=[...new Array(this.numTables)].map((e=>new cd(n,this.tableStart)))}getSubTable(e){return this.encodingRecords[e].table}getSupportedEncodings(){return this.encodingRecords.map((e=>({platformID:e.platformID,encodingId:e.encodingID})))}getSupportedCharCodes(e,t){const n=this.encodingRecords.findIndex((n=>n.platformID===e&&n.encodingID===t));if(-1===n)return!1;return this.getSubTable(n).getSupportedCharCodes()}reverse(e){for(let t=0;t{let i=this.getSubTable(s);return!!i.getGlyphId&&(t=i.getGlyphId(e),0!==t)})),t}supports(e){return this.encodingRecords.some(((t,n)=>{const s=this.getSubTable(n);return s.supports&&!1!==s.supports(e)}))}supportsVariation(e){return this.encodingRecords.some(((t,n)=>{const s=this.getSubTable(n);return s.supportsVariation&&!1!==s.supportsVariation(e)}))}}});var dd=Object.freeze({__proto__:null,head:class extends Su{constructor(e,t){const{p:n}=super(e,t);this.load({majorVersion:n.uint16,minorVersion:n.uint16,fontRevision:n.fixed,checkSumAdjustment:n.uint32,magicNumber:n.uint32,flags:n.flags(16),unitsPerEm:n.uint16,created:n.longdatetime,modified:n.longdatetime,xMin:n.int16,yMin:n.int16,xMax:n.int16,yMax:n.int16,macStyle:n.flags(16),lowestRecPPEM:n.uint16,fontDirectionHint:n.uint16,indexToLocFormat:n.uint16,glyphDataFormat:n.uint16})}}});var hd=Object.freeze({__proto__:null,hhea:class extends Su{constructor(e,t){const{p:n}=super(e,t);this.majorVersion=n.uint16,this.minorVersion=n.uint16,this.ascender=n.fword,this.descender=n.fword,this.lineGap=n.fword,this.advanceWidthMax=n.ufword,this.minLeftSideBearing=n.fword,this.minRightSideBearing=n.fword,this.xMaxExtent=n.fword,this.caretSlopeRise=n.int16,this.caretSlopeRun=n.int16,this.caretOffset=n.int16,n.int16,n.int16,n.int16,n.int16,this.metricDataFormat=n.int16,this.numberOfHMetrics=n.uint16,n.verifyLength()}}});class pd{constructor(e,t){this.advanceWidth=e,this.lsb=t}}var fd=Object.freeze({__proto__:null,hmtx:class extends Su{constructor(e,t,n){const{p:s}=super(e,t),i=n.hhea.numberOfHMetrics,r=n.maxp.numGlyphs,o=s.currentPosition;if(Cu(this,"hMetrics",(()=>(s.currentPosition=o,[...new Array(i)].map((e=>new pd(s.uint16,s.int16)))))),i(s.currentPosition=e,[...new Array(r-i)].map((e=>s.int16)))))}}}});var md=Object.freeze({__proto__:null,maxp:class extends Su{constructor(e,t){const{p:n}=super(e,t);this.version=n.legacyFixed,this.numGlyphs=n.uint16,1===this.version&&(this.maxPoints=n.uint16,this.maxContours=n.uint16,this.maxCompositePoints=n.uint16,this.maxCompositeContours=n.uint16,this.maxZones=n.uint16,this.maxTwilightPoints=n.uint16,this.maxStorage=n.uint16,this.maxFunctionDefs=n.uint16,this.maxInstructionDefs=n.uint16,this.maxStackElements=n.uint16,this.maxSizeOfInstructions=n.uint16,this.maxComponentElements=n.uint16,this.maxComponentDepth=n.uint16),n.verifyLength()}}});class gd{constructor(e,t){this.length=e,this.offset=t}}class vd{constructor(e,t){this.platformID=e.uint16,this.encodingID=e.uint16,this.languageID=e.uint16,this.nameID=e.uint16,this.length=e.uint16,this.offset=e.Offset16,Cu(this,"string",(()=>(e.currentPosition=t.stringStart+this.offset,function(e,t){const{platformID:n,length:s}=t;if(0===s)return"";if(0===n||3===n){const t=[];for(let n=0,i=s/2;nnew vd(n,this))),1===this.format&&(this.langTagCount=n.uint16,this.langTagRecords=[...new Array(this.langTagCount)].map((e=>new gd(n.uint16,n.Offset16)))),this.stringStart=this.tableStart+this.stringOffset}get(e){let t=this.nameRecords.find((t=>t.nameID===e));if(t)return t.string}}});var yd=Object.freeze({__proto__:null,OS2:class extends Su{constructor(e,t){const{p:n}=super(e,t);return this.version=n.uint16,this.xAvgCharWidth=n.int16,this.usWeightClass=n.uint16,this.usWidthClass=n.uint16,this.fsType=n.uint16,this.ySubscriptXSize=n.int16,this.ySubscriptYSize=n.int16,this.ySubscriptXOffset=n.int16,this.ySubscriptYOffset=n.int16,this.ySuperscriptXSize=n.int16,this.ySuperscriptYSize=n.int16,this.ySuperscriptXOffset=n.int16,this.ySuperscriptYOffset=n.int16,this.yStrikeoutSize=n.int16,this.yStrikeoutPosition=n.int16,this.sFamilyClass=n.int16,this.panose=[...new Array(10)].map((e=>n.uint8)),this.ulUnicodeRange1=n.flags(32),this.ulUnicodeRange2=n.flags(32),this.ulUnicodeRange3=n.flags(32),this.ulUnicodeRange4=n.flags(32),this.achVendID=n.tag,this.fsSelection=n.uint16,this.usFirstCharIndex=n.uint16,this.usLastCharIndex=n.uint16,this.sTypoAscender=n.int16,this.sTypoDescender=n.int16,this.sTypoLineGap=n.int16,this.usWinAscent=n.uint16,this.usWinDescent=n.uint16,0===this.version?n.verifyLength():(this.ulCodePageRange1=n.flags(32),this.ulCodePageRange2=n.flags(32),1===this.version?n.verifyLength():(this.sxHeight=n.int16,this.sCapHeight=n.int16,this.usDefaultChar=n.uint16,this.usBreakChar=n.uint16,this.usMaxContext=n.uint16,this.version<=4?n.verifyLength():(this.usLowerOpticalPointSize=n.uint16,this.usUpperOpticalPointSize=n.uint16,5===this.version?n.verifyLength():void 0)))}}});const bd=[".notdef",".null","nonmarkingreturn","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quotesingle","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","grave","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","Adieresis","Aring","Ccedilla","Eacute","Ntilde","Odieresis","Udieresis","aacute","agrave","acircumflex","adieresis","atilde","aring","ccedilla","eacute","egrave","ecircumflex","edieresis","iacute","igrave","icircumflex","idieresis","ntilde","oacute","ograve","ocircumflex","odieresis","otilde","uacute","ugrave","ucircumflex","udieresis","dagger","degree","cent","sterling","section","bullet","paragraph","germandbls","registered","copyright","trademark","acute","dieresis","notequal","AE","Oslash","infinity","plusminus","lessequal","greaterequal","yen","mu","partialdiff","summation","product","pi","integral","ordfeminine","ordmasculine","Omega","ae","oslash","questiondown","exclamdown","logicalnot","radical","florin","approxequal","Delta","guillemotleft","guillemotright","ellipsis","nonbreakingspace","Agrave","Atilde","Otilde","OE","oe","endash","emdash","quotedblleft","quotedblright","quoteleft","quoteright","divide","lozenge","ydieresis","Ydieresis","fraction","currency","guilsinglleft","guilsinglright","fi","fl","daggerdbl","periodcentered","quotesinglbase","quotedblbase","perthousand","Acircumflex","Ecircumflex","Aacute","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Oacute","Ocircumflex","apple","Ograve","Uacute","Ucircumflex","Ugrave","dotlessi","circumflex","tilde","macron","breve","dotaccent","ring","cedilla","hungarumlaut","ogonek","caron","Lslash","lslash","Scaron","scaron","Zcaron","zcaron","brokenbar","Eth","eth","Yacute","yacute","Thorn","thorn","minus","multiply","onesuperior","twosuperior","threesuperior","onehalf","onequarter","threequarters","franc","Gbreve","gbreve","Idotaccent","Scedilla","scedilla","Cacute","cacute","Ccaron","ccaron","dcroat"];var wd=Object.freeze({__proto__:null,post:class extends Su{constructor(e,t){const{p:n}=super(e,t);if(this.version=n.legacyFixed,this.italicAngle=n.fixed,this.underlinePosition=n.fword,this.underlineThickness=n.fword,this.isFixedPitch=n.uint32,this.minMemType42=n.uint32,this.maxMemType42=n.uint32,this.minMemType1=n.uint32,this.maxMemType1=n.uint32,1===this.version||3===this.version)return n.verifyLength();if(this.numGlyphs=n.uint16,2===this.version){this.glyphNameIndex=[...new Array(this.numGlyphs)].map((e=>n.uint16)),this.namesOffset=n.currentPosition,this.glyphNameOffsets=[1];for(let e=0;en.int8)))}getGlyphName(e){if(2!==this.version)return console.warn(`post table version ${this.version} does not support glyph name lookups`),"";let t=this.glyphNameIndex[e];if(t<258)return bd[t];let n=this.glyphNameOffsets[e],s=this.glyphNameOffsets[e+1]-n-1;if(0===s)return".notdef.";this.parser.currentPosition=this.namesOffset+n;return this.parser.readBytes(s,this.namesOffset+n,8,!0).map((e=>String.fromCharCode(e))).join("")}}});class _d extends Su{constructor(e,t){const{p:n}=super(e,t,"AxisTable");this.baseTagListOffset=n.Offset16,this.baseScriptListOffset=n.Offset16,Cu(this,"baseTagList",(()=>new jd({offset:e.offset+this.baseTagListOffset},t))),Cu(this,"baseScriptList",(()=>new Sd({offset:e.offset+this.baseScriptListOffset},t)))}}class jd extends Su{constructor(e,t){const{p:n}=super(e,t,"BaseTagListTable");this.baseTagCount=n.uint16,this.baselineTags=[...new Array(this.baseTagCount)].map((e=>n.tag))}}class Sd extends Su{constructor(e,t){const{p:n}=super(e,t,"BaseScriptListTable");this.baseScriptCount=n.uint16;const s=n.currentPosition;Cu(this,"baseScriptRecords",(()=>(n.currentPosition=s,[...new Array(this.baseScriptCount)].map((e=>new Cd(this.start,n))))))}}class Cd{constructor(e,t){this.baseScriptTag=t.tag,this.baseScriptOffset=t.Offset16,Cu(this,"baseScriptTable",(()=>(t.currentPosition=e+this.baseScriptOffset,new kd(t))))}}class kd{constructor(e){this.start=e.currentPosition,this.baseValuesOffset=e.Offset16,this.defaultMinMaxOffset=e.Offset16,this.baseLangSysCount=e.uint16,this.baseLangSysRecords=[...new Array(this.baseLangSysCount)].map((t=>new Ed(this.start,e))),Cu(this,"baseValues",(()=>(e.currentPosition=this.start+this.baseValuesOffset,new Pd(e)))),Cu(this,"defaultMinMax",(()=>(e.currentPosition=this.start+this.defaultMinMaxOffset,new Id(e))))}}class Ed{constructor(e,t){this.baseLangSysTag=t.tag,this.minMaxOffset=t.Offset16,Cu(this,"minMax",(()=>(t.currentPosition=e+this.minMaxOffset,new Id(t))))}}class Pd{constructor(e){this.parser=e,this.start=e.currentPosition,this.defaultBaselineIndex=e.uint16,this.baseCoordCount=e.uint16,this.baseCoords=[...new Array(this.baseCoordCount)].map((t=>e.Offset16))}getTable(e){return this.parser.currentPosition=this.start+this.baseCoords[e],new Od(this.parser)}}class Id{constructor(e){this.minCoord=e.Offset16,this.maxCoord=e.Offset16,this.featMinMaxCount=e.uint16;const t=e.currentPosition;Cu(this,"featMinMaxRecords",(()=>(e.currentPosition=t,[...new Array(this.featMinMaxCount)].map((t=>new Td(e))))))}}class Td{constructor(e){this.featureTableTag=e.tag,this.minCoord=e.Offset16,this.maxCoord=e.Offset16}}class Od{constructor(e){this.baseCoordFormat=e.uint16,this.coordinate=e.int16,2===this.baseCoordFormat&&(this.referenceGlyph=e.uint16,this.baseCoordPoint=e.uint16),3===this.baseCoordFormat&&(this.deviceTable=e.Offset16)}}var Ad=Object.freeze({__proto__:null,BASE:class extends Su{constructor(e,t){const{p:n}=super(e,t);this.majorVersion=n.uint16,this.minorVersion=n.uint16,this.horizAxisOffset=n.Offset16,this.vertAxisOffset=n.Offset16,Cu(this,"horizAxis",(()=>new _d({offset:e.offset+this.horizAxisOffset},t))),Cu(this,"vertAxis",(()=>new _d({offset:e.offset+this.vertAxisOffset},t))),1===this.majorVersion&&1===this.minorVersion&&(this.itemVarStoreOffset=n.Offset32,Cu(this,"itemVarStore",(()=>new _d({offset:e.offset+this.itemVarStoreOffset},t))))}}});class Nd{constructor(e){this.classFormat=e.uint16,1===this.classFormat&&(this.startGlyphID=e.uint16,this.glyphCount=e.uint16,this.classValueArray=[...new Array(this.glyphCount)].map((t=>e.uint16))),2===this.classFormat&&(this.classRangeCount=e.uint16,this.classRangeRecords=[...new Array(this.classRangeCount)].map((t=>new Md(e))))}}class Md{constructor(e){this.startGlyphID=e.uint16,this.endGlyphID=e.uint16,this.class=e.uint16}}class Fd extends ju{constructor(e){super(e),this.coverageFormat=e.uint16,1===this.coverageFormat&&(this.glyphCount=e.uint16,this.glyphArray=[...new Array(this.glyphCount)].map((t=>e.uint16))),2===this.coverageFormat&&(this.rangeCount=e.uint16,this.rangeRecords=[...new Array(this.rangeCount)].map((t=>new Vd(e))))}}class Vd{constructor(e){this.startGlyphID=e.uint16,this.endGlyphID=e.uint16,this.startCoverageIndex=e.uint16}}class Rd{constructor(e,t){this.table=e,this.parser=t,this.start=t.currentPosition,this.format=t.uint16,this.variationRegionListOffset=t.Offset32,this.itemVariationDataCount=t.uint16,this.itemVariationDataOffsets=[...new Array(this.itemVariationDataCount)].map((e=>t.Offset32))}}class Bd extends ju{constructor(e){super(e),this.coverageOffset=e.Offset16,this.glyphCount=e.uint16,this.attachPointOffsets=[...new Array(this.glyphCount)].map((t=>e.Offset16))}getPoint(e){return this.parser.currentPosition=this.start+this.attachPointOffsets[e],new Dd(this.parser)}}class Dd{constructor(e){this.pointCount=e.uint16,this.pointIndices=[...new Array(this.pointCount)].map((t=>e.uint16))}}class Ld extends ju{constructor(e){super(e),this.coverageOffset=e.Offset16,Cu(this,"coverage",(()=>(e.currentPosition=this.start+this.coverageOffset,new Fd(e)))),this.ligGlyphCount=e.uint16,this.ligGlyphOffsets=[...new Array(this.ligGlyphCount)].map((t=>e.Offset16))}getLigGlyph(e){return this.parser.currentPosition=this.start+this.ligGlyphOffsets[e],new zd(this.parser)}}class zd extends ju{constructor(e){super(e),this.caretCount=e.uint16,this.caretValueOffsets=[...new Array(this.caretCount)].map((t=>e.Offset16))}getCaretValue(e){return this.parser.currentPosition=this.start+this.caretValueOffsets[e],new Gd(this.parser)}}class Gd{constructor(e){this.caretValueFormat=e.uint16,1===this.caretValueFormat&&(this.coordinate=e.int16),2===this.caretValueFormat&&(this.caretValuePointIndex=e.uint16),3===this.caretValueFormat&&(this.coordinate=e.int16,this.deviceOffset=e.Offset16)}}class Hd extends ju{constructor(e){super(e),this.markGlyphSetTableFormat=e.uint16,this.markGlyphSetCount=e.uint16,this.coverageOffsets=[...new Array(this.markGlyphSetCount)].map((t=>e.Offset32))}getMarkGlyphSet(e){return this.parser.currentPosition=this.start+this.coverageOffsets[e],new Fd(this.parser)}}var Ud=Object.freeze({__proto__:null,GDEF:class extends Su{constructor(e,t){const{p:n}=super(e,t);this.majorVersion=n.uint16,this.minorVersion=n.uint16,this.glyphClassDefOffset=n.Offset16,Cu(this,"glyphClassDefs",(()=>{if(0!==this.glyphClassDefOffset)return n.currentPosition=this.tableStart+this.glyphClassDefOffset,new Nd(n)})),this.attachListOffset=n.Offset16,Cu(this,"attachList",(()=>{if(0!==this.attachListOffset)return n.currentPosition=this.tableStart+this.attachListOffset,new Bd(n)})),this.ligCaretListOffset=n.Offset16,Cu(this,"ligCaretList",(()=>{if(0!==this.ligCaretListOffset)return n.currentPosition=this.tableStart+this.ligCaretListOffset,new Ld(n)})),this.markAttachClassDefOffset=n.Offset16,Cu(this,"markAttachClassDef",(()=>{if(0!==this.markAttachClassDefOffset)return n.currentPosition=this.tableStart+this.markAttachClassDefOffset,new Nd(n)})),this.minorVersion>=2&&(this.markGlyphSetsDefOffset=n.Offset16,Cu(this,"markGlyphSetsDef",(()=>{if(0!==this.markGlyphSetsDefOffset)return n.currentPosition=this.tableStart+this.markGlyphSetsDefOffset,new Hd(n)}))),3===this.minorVersion&&(this.itemVarStoreOffset=n.Offset32,Cu(this,"itemVarStore",(()=>{if(0!==this.itemVarStoreOffset)return n.currentPosition=this.tableStart+this.itemVarStoreOffset,new Rd(n)})))}}});class Wd extends ju{static EMPTY={scriptCount:0,scriptRecords:[]};constructor(e){super(e),this.scriptCount=e.uint16,this.scriptRecords=[...new Array(this.scriptCount)].map((t=>new qd(e)))}}class qd{constructor(e){this.scriptTag=e.tag,this.scriptOffset=e.Offset16}}class Zd extends ju{constructor(e){super(e),this.defaultLangSys=e.Offset16,this.langSysCount=e.uint16,this.langSysRecords=[...new Array(this.langSysCount)].map((t=>new Kd(e)))}}class Kd{constructor(e){this.langSysTag=e.tag,this.langSysOffset=e.Offset16}}class Yd{constructor(e){this.lookupOrder=e.Offset16,this.requiredFeatureIndex=e.uint16,this.featureIndexCount=e.uint16,this.featureIndices=[...new Array(this.featureIndexCount)].map((t=>e.uint16))}}class Xd extends ju{static EMPTY={featureCount:0,featureRecords:[]};constructor(e){super(e),this.featureCount=e.uint16,this.featureRecords=[...new Array(this.featureCount)].map((t=>new Jd(e)))}}class Jd{constructor(e){this.featureTag=e.tag,this.featureOffset=e.Offset16}}class Qd extends ju{constructor(e){super(e),this.featureParams=e.Offset16,this.lookupIndexCount=e.uint16,this.lookupListIndices=[...new Array(this.lookupIndexCount)].map((t=>e.uint16))}getFeatureParams(){if(this.featureParams>0){const e=this.parser;e.currentPosition=this.start+this.featureParams;const t=this.featureTag;if("size"===t)return new eh(e);if(t.startsWith("cc"))return new $d(e);if(t.startsWith("ss"))return new th(e)}}}class $d{constructor(e){this.format=e.uint16,this.featUiLabelNameId=e.uint16,this.featUiTooltipTextNameId=e.uint16,this.sampleTextNameId=e.uint16,this.numNamedParameters=e.uint16,this.firstParamUiLabelNameId=e.uint16,this.charCount=e.uint16,this.character=[...new Array(this.charCount)].map((t=>e.uint24))}}class eh{constructor(e){this.designSize=e.uint16,this.subfamilyIdentifier=e.uint16,this.subfamilyNameID=e.uint16,this.smallEnd=e.uint16,this.largeEnd=e.uint16}}class th{constructor(e){this.version=e.uint16,this.UINameID=e.uint16}}function nh(e){e.parser.currentPosition-=2,delete e.coverageOffset,delete e.getCoverageTable}class sh extends ju{constructor(e){super(e),this.substFormat=e.uint16,this.coverageOffset=e.Offset16}getCoverageTable(){let e=this.parser;return e.currentPosition=this.start+this.coverageOffset,new Fd(e)}}class ih{constructor(e){this.glyphSequenceIndex=e.uint16,this.lookupListIndex=e.uint16}}class rh extends sh{constructor(e){super(e),this.deltaGlyphID=e.int16}}class oh extends sh{constructor(e){super(e),this.sequenceCount=e.uint16,this.sequenceOffsets=[...new Array(this.sequenceCount)].map((t=>e.Offset16))}getSequence(e){let t=this.parser;return t.currentPosition=this.start+this.sequenceOffsets[e],new ah(t)}}class ah{constructor(e){this.glyphCount=e.uint16,this.substituteGlyphIDs=[...new Array(this.glyphCount)].map((t=>e.uint16))}}class lh extends sh{constructor(e){super(e),this.alternateSetCount=e.uint16,this.alternateSetOffsets=[...new Array(this.alternateSetCount)].map((t=>e.Offset16))}getAlternateSet(e){let t=this.parser;return t.currentPosition=this.start+this.alternateSetOffsets[e],new ch(t)}}class ch{constructor(e){this.glyphCount=e.uint16,this.alternateGlyphIDs=[...new Array(this.glyphCount)].map((t=>e.uint16))}}class uh extends sh{constructor(e){super(e),this.ligatureSetCount=e.uint16,this.ligatureSetOffsets=[...new Array(this.ligatureSetCount)].map((t=>e.Offset16))}getLigatureSet(e){let t=this.parser;return t.currentPosition=this.start+this.ligatureSetOffsets[e],new dh(t)}}class dh extends ju{constructor(e){super(e),this.ligatureCount=e.uint16,this.ligatureOffsets=[...new Array(this.ligatureCount)].map((t=>e.Offset16))}getLigature(e){let t=this.parser;return t.currentPosition=this.start+this.ligatureOffsets[e],new hh(t)}}class hh{constructor(e){this.ligatureGlyph=e.uint16,this.componentCount=e.uint16,this.componentGlyphIDs=[...new Array(this.componentCount-1)].map((t=>e.uint16))}}class ph extends sh{constructor(e){super(e),1===this.substFormat&&(this.subRuleSetCount=e.uint16,this.subRuleSetOffsets=[...new Array(this.subRuleSetCount)].map((t=>e.Offset16))),2===this.substFormat&&(this.classDefOffset=e.Offset16,this.subClassSetCount=e.uint16,this.subClassSetOffsets=[...new Array(this.subClassSetCount)].map((t=>e.Offset16))),3===this.substFormat&&(nh(this),this.glyphCount=e.uint16,this.substitutionCount=e.uint16,this.coverageOffsets=[...new Array(this.glyphCount)].map((t=>e.Offset16)),this.substLookupRecords=[...new Array(this.substitutionCount)].map((t=>new ih(e))))}getSubRuleSet(e){if(1!==this.substFormat)throw new Error(`lookup type 5.${this.substFormat} has no subrule sets.`);let t=this.parser;return t.currentPosition=this.start+this.subRuleSetOffsets[e],new fh(t)}getSubClassSet(e){if(2!==this.substFormat)throw new Error(`lookup type 5.${this.substFormat} has no subclass sets.`);let t=this.parser;return t.currentPosition=this.start+this.subClassSetOffsets[e],new gh(t)}getCoverageTable(e){if(3!==this.substFormat&&!e)return super.getCoverageTable();if(!e)throw new Error(`lookup type 5.${this.substFormat} requires an coverage table index.`);let t=this.parser;return t.currentPosition=this.start+this.coverageOffsets[e],new Fd(t)}}class fh extends ju{constructor(e){super(e),this.subRuleCount=e.uint16,this.subRuleOffsets=[...new Array(this.subRuleCount)].map((t=>e.Offset16))}getSubRule(e){let t=this.parser;return t.currentPosition=this.start+this.subRuleOffsets[e],new mh(t)}}class mh{constructor(e){this.glyphCount=e.uint16,this.substitutionCount=e.uint16,this.inputSequence=[...new Array(this.glyphCount-1)].map((t=>e.uint16)),this.substLookupRecords=[...new Array(this.substitutionCount)].map((t=>new ih(e)))}}class gh extends ju{constructor(e){super(e),this.subClassRuleCount=e.uint16,this.subClassRuleOffsets=[...new Array(this.subClassRuleCount)].map((t=>e.Offset16))}getSubClass(e){let t=this.parser;return t.currentPosition=this.start+this.subClassRuleOffsets[e],new vh(t)}}class vh extends mh{constructor(e){super(e)}}class xh extends sh{constructor(e){super(e),1===this.substFormat&&(this.chainSubRuleSetCount=e.uint16,this.chainSubRuleSetOffsets=[...new Array(this.chainSubRuleSetCount)].map((t=>e.Offset16))),2===this.substFormat&&(this.backtrackClassDefOffset=e.Offset16,this.inputClassDefOffset=e.Offset16,this.lookaheadClassDefOffset=e.Offset16,this.chainSubClassSetCount=e.uint16,this.chainSubClassSetOffsets=[...new Array(this.chainSubClassSetCount)].map((t=>e.Offset16))),3===this.substFormat&&(nh(this),this.backtrackGlyphCount=e.uint16,this.backtrackCoverageOffsets=[...new Array(this.backtrackGlyphCount)].map((t=>e.Offset16)),this.inputGlyphCount=e.uint16,this.inputCoverageOffsets=[...new Array(this.inputGlyphCount)].map((t=>e.Offset16)),this.lookaheadGlyphCount=e.uint16,this.lookaheadCoverageOffsets=[...new Array(this.lookaheadGlyphCount)].map((t=>e.Offset16)),this.seqLookupCount=e.uint16,this.seqLookupRecords=[...new Array(this.substitutionCount)].map((t=>new jh(e))))}getChainSubRuleSet(e){if(1!==this.substFormat)throw new Error(`lookup type 6.${this.substFormat} has no chainsubrule sets.`);let t=this.parser;return t.currentPosition=this.start+this.chainSubRuleSetOffsets[e],new yh(t)}getChainSubClassSet(e){if(2!==this.substFormat)throw new Error(`lookup type 6.${this.substFormat} has no chainsubclass sets.`);let t=this.parser;return t.currentPosition=this.start+this.chainSubClassSetOffsets[e],new wh(t)}getCoverageFromOffset(e){if(3!==this.substFormat)throw new Error(`lookup type 6.${this.substFormat} does not use contextual coverage offsets.`);let t=this.parser;return t.currentPosition=this.start+e,new Fd(t)}}class yh extends ju{constructor(e){super(e),this.chainSubRuleCount=e.uint16,this.chainSubRuleOffsets=[...new Array(this.chainSubRuleCount)].map((t=>e.Offset16))}getSubRule(e){let t=this.parser;return t.currentPosition=this.start+this.chainSubRuleOffsets[e],new bh(t)}}class bh{constructor(e){this.backtrackGlyphCount=e.uint16,this.backtrackSequence=[...new Array(this.backtrackGlyphCount)].map((t=>e.uint16)),this.inputGlyphCount=e.uint16,this.inputSequence=[...new Array(this.inputGlyphCount-1)].map((t=>e.uint16)),this.lookaheadGlyphCount=e.uint16,this.lookAheadSequence=[...new Array(this.lookAheadGlyphCount)].map((t=>e.uint16)),this.substitutionCount=e.uint16,this.substLookupRecords=[...new Array(this.SubstCount)].map((t=>new ih(e)))}}class wh extends ju{constructor(e){super(e),this.chainSubClassRuleCount=e.uint16,this.chainSubClassRuleOffsets=[...new Array(this.chainSubClassRuleCount)].map((t=>e.Offset16))}getSubClass(e){let t=this.parser;return t.currentPosition=this.start+this.chainSubRuleOffsets[e],new _h(t)}}class _h{constructor(e){this.backtrackGlyphCount=e.uint16,this.backtrackSequence=[...new Array(this.backtrackGlyphCount)].map((t=>e.uint16)),this.inputGlyphCount=e.uint16,this.inputSequence=[...new Array(this.inputGlyphCount-1)].map((t=>e.uint16)),this.lookaheadGlyphCount=e.uint16,this.lookAheadSequence=[...new Array(this.lookAheadGlyphCount)].map((t=>e.uint16)),this.substitutionCount=e.uint16,this.substLookupRecords=[...new Array(this.substitutionCount)].map((t=>new jh(e)))}}class jh extends ju{constructor(e){super(e),this.sequenceIndex=e.uint16,this.lookupListIndex=e.uint16}}class Sh extends ju{constructor(e){super(e),this.substFormat=e.uint16,this.extensionLookupType=e.uint16,this.extensionOffset=e.Offset32}}class Ch extends sh{constructor(e){super(e),this.backtrackGlyphCount=e.uint16,this.backtrackCoverageOffsets=[...new Array(this.backtrackGlyphCount)].map((t=>e.Offset16)),this.lookaheadGlyphCount=e.uint16,this.lookaheadCoverageOffsets=[new Array(this.lookaheadGlyphCount)].map((t=>e.Offset16)),this.glyphCount=e.uint16,this.substituteGlyphIDs=[...new Array(this.glyphCount)].map((t=>e.uint16))}}var kh={buildSubtable:function(e,t){const n=new[void 0,rh,oh,lh,uh,ph,xh,Sh,Ch][e](t);return n.type=e,n}};class Eh extends ju{constructor(e){super(e)}}class Ph extends Eh{constructor(e){super(e),console.log("lookup type 1")}}class Ih extends Eh{constructor(e){super(e),console.log("lookup type 2")}}class Th extends Eh{constructor(e){super(e),console.log("lookup type 3")}}class Oh extends Eh{constructor(e){super(e),console.log("lookup type 4")}}class Ah extends Eh{constructor(e){super(e),console.log("lookup type 5")}}class Nh extends Eh{constructor(e){super(e),console.log("lookup type 6")}}class Mh extends Eh{constructor(e){super(e),console.log("lookup type 7")}}class Fh extends Eh{constructor(e){super(e),console.log("lookup type 8")}}class Vh extends Eh{constructor(e){super(e),console.log("lookup type 9")}}var Rh={buildSubtable:function(e,t){const n=new[void 0,Ph,Ih,Th,Oh,Ah,Nh,Mh,Fh,Vh][e](t);return n.type=e,n}};class Bh extends ju{static EMPTY={lookupCount:0,lookups:[]};constructor(e){super(e),this.lookupCount=e.uint16,this.lookups=[...new Array(this.lookupCount)].map((t=>e.Offset16))}}class Dh extends ju{constructor(e,t){super(e),this.ctType=t,this.lookupType=e.uint16,this.lookupFlag=e.uint16,this.subTableCount=e.uint16,this.subtableOffsets=[...new Array(this.subTableCount)].map((t=>e.Offset16)),this.markFilteringSet=e.uint16}get rightToLeft(){return!0&this.lookupFlag}get ignoreBaseGlyphs(){return!0&this.lookupFlag}get ignoreLigatures(){return!0&this.lookupFlag}get ignoreMarks(){return!0&this.lookupFlag}get useMarkFilteringSet(){return!0&this.lookupFlag}get markAttachmentType(){return!0&this.lookupFlag}getSubTable(e){const t="GSUB"===this.ctType?kh:Rh;return this.parser.currentPosition=this.start+this.subtableOffsets[e],t.buildSubtable(this.lookupType,this.parser)}}class Lh extends Su{constructor(e,t,n){const{p:s,tableStart:i}=super(e,t,n);this.majorVersion=s.uint16,this.minorVersion=s.uint16,this.scriptListOffset=s.Offset16,this.featureListOffset=s.Offset16,this.lookupListOffset=s.Offset16,1===this.majorVersion&&1===this.minorVersion&&(this.featureVariationsOffset=s.Offset32);const r=!(this.scriptListOffset||this.featureListOffset||this.lookupListOffset);Cu(this,"scriptList",(()=>r?Wd.EMPTY:(s.currentPosition=i+this.scriptListOffset,new Wd(s)))),Cu(this,"featureList",(()=>r?Xd.EMPTY:(s.currentPosition=i+this.featureListOffset,new Xd(s)))),Cu(this,"lookupList",(()=>r?Bh.EMPTY:(s.currentPosition=i+this.lookupListOffset,new Bh(s)))),this.featureVariationsOffset&&Cu(this,"featureVariations",(()=>r?FeatureVariations.EMPTY:(s.currentPosition=i+this.featureVariationsOffset,new FeatureVariations(s))))}getSupportedScripts(){return this.scriptList.scriptRecords.map((e=>e.scriptTag))}getScriptTable(e){let t=this.scriptList.scriptRecords.find((t=>t.scriptTag===e));this.parser.currentPosition=this.scriptList.start+t.scriptOffset;let n=new Zd(this.parser);return n.scriptTag=e,n}ensureScriptTable(e){return"string"==typeof e?this.getScriptTable(e):e}getSupportedLangSys(e){const t=0!==(e=this.ensureScriptTable(e)).defaultLangSys,n=e.langSysRecords.map((e=>e.langSysTag));return t&&n.unshift("dflt"),n}getDefaultLangSysTable(e){let t=(e=this.ensureScriptTable(e)).defaultLangSys;if(0!==t){this.parser.currentPosition=e.start+t;let n=new Yd(this.parser);return n.langSysTag="",n.defaultForScript=e.scriptTag,n}}getLangSysTable(e,t="dflt"){if("dflt"===t)return this.getDefaultLangSysTable(e);let n=(e=this.ensureScriptTable(e)).langSysRecords.find((e=>e.langSysTag===t));this.parser.currentPosition=e.start+n.langSysOffset;let s=new Yd(this.parser);return s.langSysTag=t,s}getFeatures(e){return e.featureIndices.map((e=>this.getFeature(e)))}getFeature(e){let t;if(t=parseInt(e)==e?this.featureList.featureRecords[e]:this.featureList.featureRecords.find((t=>t.featureTag===e)),!t)return;this.parser.currentPosition=this.featureList.start+t.featureOffset;let n=new Qd(this.parser);return n.featureTag=t.featureTag,n}getLookups(e){return e.lookupListIndices.map((e=>this.getLookup(e)))}getLookup(e,t){let n=this.lookupList.lookups[e];return this.parser.currentPosition=this.lookupList.start+n,new Dh(this.parser,t)}}var zh=Object.freeze({__proto__:null,GSUB:class extends Lh{constructor(e,t){super(e,t,"GSUB")}getLookup(e){return super.getLookup(e,"GSUB")}}});var Gh=Object.freeze({__proto__:null,GPOS:class extends Lh{constructor(e,t){super(e,t,"GPOS")}getLookup(e){return super.getLookup(e,"GPOS")}}});class Hh extends ju{constructor(e){super(e),this.numEntries=e.uint16,this.documentRecords=[...new Array(this.numEntries)].map((t=>new Uh(e)))}getDocument(e){let t=this.documentRecords[e];if(!t)return"";let n=this.start+t.svgDocOffset;return this.parser.currentPosition=n,this.parser.readBytes(t.svgDocLength)}getDocumentForGlyph(e){let t=this.documentRecords.findIndex((t=>t.startGlyphID<=e&&e<=t.endGlyphID));return-1===t?"":this.getDocument(t)}}class Uh{constructor(e){this.startGlyphID=e.uint16,this.endGlyphID=e.uint16,this.svgDocOffset=e.Offset32,this.svgDocLength=e.uint32}}var Wh=Object.freeze({__proto__:null,SVG:class extends Su{constructor(e,t){const{p:n}=super(e,t);this.version=n.uint16,this.offsetToSVGDocumentList=n.Offset32,n.currentPosition=this.tableStart+this.offsetToSVGDocumentList,this.documentList=new Hh(n)}}});class qh{constructor(e){this.tag=e.tag,this.minValue=e.fixed,this.defaultValue=e.fixed,this.maxValue=e.fixed,this.flags=e.flags(16),this.axisNameID=e.uint16}}class Zh{constructor(e,t,n){let s=e.currentPosition;this.subfamilyNameID=e.uint16,e.uint16,this.coordinates=[...new Array(t)].map((t=>e.fixed)),e.currentPosition-s(n.currentPosition=s,[...new Array(this.axisCount)].map((e=>new qh(n))))));const i=s+this.axisCount*this.axisSize;Cu(this,"instances",(()=>{let e=[];for(let t=0;te.tag))}getAxis(e){return this.axes.find((t=>t.tag===e))}}});var Yh=Object.freeze({__proto__:null,cvt:class extends Su{constructor(e,t){const{p:n}=super(e,t),s=e.length/2;Cu(this,"items",(()=>[...new Array(s)].map((e=>n.fword))))}}});var Xh=Object.freeze({__proto__:null,fpgm:class extends Su{constructor(e,t){const{p:n}=super(e,t);Cu(this,"instructions",(()=>[...new Array(e.length)].map((e=>n.uint8))))}}});class Jh{constructor(e){this.rangeMaxPPEM=e.uint16,this.rangeGaspBehavior=e.uint16}}var Qh=Object.freeze({__proto__:null,gasp:class extends Su{constructor(e,t){const{p:n}=super(e,t);this.version=n.uint16,this.numRanges=n.uint16;Cu(this,"gaspRanges",(()=>[...new Array(this.numRanges)].map((e=>new Jh(n)))))}}});var $h=Object.freeze({__proto__:null,glyf:class extends Su{constructor(e,t){super(e,t)}getGlyphData(e,t){return this.parser.currentPosition=this.tableStart+e,this.parser.readBytes(t)}}});var ep=Object.freeze({__proto__:null,loca:class extends Su{constructor(e,t,n){const{p:s}=super(e,t),i=n.maxp.numGlyphs+1;0===n.head.indexToLocFormat?(this.x2=!0,Cu(this,"offsets",(()=>[...new Array(i)].map((e=>s.Offset16))))):Cu(this,"offsets",(()=>[...new Array(i)].map((e=>s.Offset32))))}getGlyphDataOffsetAndLength(e){let t=this.offsets[e]*this.x2?2:1;return{offset:t,length:(this.offsets[e+1]*this.x2?2:1)-t}}}});var tp=Object.freeze({__proto__:null,prep:class extends Su{constructor(e,t){const{p:n}=super(e,t);Cu(this,"instructions",(()=>[...new Array(e.length)].map((e=>n.uint8))))}}});var np=Object.freeze({__proto__:null,CFF:class extends Su{constructor(e,t){const{p:n}=super(e,t);Cu(this,"data",(()=>n.readBytes()))}}});var sp=Object.freeze({__proto__:null,CFF2:class extends Su{constructor(e,t){const{p:n}=super(e,t);Cu(this,"data",(()=>n.readBytes()))}}});class ip{constructor(e){this.glyphIndex=e.uint16,this.vertOriginY=e.int16}}var rp=Object.freeze({__proto__:null,VORG:class extends Su{constructor(e,t){const{p:n}=super(e,t);this.majorVersion=n.uint16,this.minorVersion=n.uint16,this.defaultVertOriginY=n.int16,this.numVertOriginYMetrics=n.uint16,Cu(this,"vertORiginYMetrics",(()=>[...new Array(this.numVertOriginYMetrics)].map((e=>new ip(n)))))}}});class op{constructor(e){this.indexSubTableArrayOffset=e.Offset32,this.indexTablesSize=e.uint32,this.numberofIndexSubTables=e.uint32,this.colorRef=e.uint32,this.hori=new lp(e),this.vert=new lp(e),this.startGlyphIndex=e.uint16,this.endGlyphIndex=e.uint16,this.ppemX=e.uint8,this.ppemY=e.uint8,this.bitDepth=e.uint8,this.flags=e.int8}}class ap{constructor(e){this.hori=new lp(e),this.vert=new lp(e),this.ppemX=e.uint8,this.ppemY=e.uint8,this.substitutePpemX=e.uint8,this.substitutePpemY=e.uint8}}class lp{constructor(e){this.ascender=e.int8,this.descender=e.int8,this.widthMax=e.uint8,this.caretSlopeNumerator=e.int8,this.caretSlopeDenominator=e.int8,this.caretOffset=e.int8,this.minOriginSB=e.int8,this.minAdvanceSB=e.int8,this.maxBeforeBL=e.int8,this.minAfterBL=e.int8,this.pad1=e.int8,this.pad2=e.int8}}class cp extends Su{constructor(e,t,n){const{p:s}=super(e,t,n);this.majorVersion=s.uint16,this.minorVersion=s.uint16,this.numSizes=s.uint32,Cu(this,"bitMapSizes",(()=>[...new Array(this.numSizes)].map((e=>new op(s)))))}}var up=Object.freeze({__proto__:null,EBLC:cp});class dp extends Su{constructor(e,t,n){const{p:s}=super(e,t,n);this.majorVersion=s.uint16,this.minorVersion=s.uint16}}var hp=Object.freeze({__proto__:null,EBDT:dp});var pp=Object.freeze({__proto__:null,EBSC:class extends Su{constructor(e,t){const{p:n}=super(e,t);this.majorVersion=n.uint16,this.minorVersion=n.uint16,this.numSizes=n.uint32,Cu(this,"bitmapScales",(()=>[...new Array(this.numSizes)].map((e=>new ap(n)))))}}});var fp=Object.freeze({__proto__:null,CBLC:class extends cp{constructor(e,t){super(e,t,"CBLC")}}});var mp=Object.freeze({__proto__:null,CBDT:class extends dp{constructor(e,t){super(e,t,"CBDT")}}});var gp=Object.freeze({__proto__:null,sbix:class extends Su{constructor(e,t){const{p:n}=super(e,t);this.version=n.uint16,this.flags=n.flags(16),this.numStrikes=n.uint32,Cu(this,"strikeOffsets",(()=>[...new Array(this.numStrikes)].map((e=>n.Offset32))))}}});class vp{constructor(e){this.gID=e.uint16,this.firstLayerIndex=e.uint16,this.numLayers=e.uint16}}class xp{constructor(e){this.gID=e.uint16,this.paletteIndex=e.uint16}}var yp=Object.freeze({__proto__:null,COLR:class extends Su{constructor(e,t){const{p:n}=super(e,t);this.version=n.uint16,this.numBaseGlyphRecords=n.uint16,this.baseGlyphRecordsOffset=n.Offset32,this.layerRecordsOffset=n.Offset32,this.numLayerRecords=n.uint16}getBaseGlyphRecord(e){let t=this.tableStart+this.baseGlyphRecordsOffset;this.parser.currentPosition=t;let n=new vp(this.parser),s=n.gID,i=this.tableStart+this.layerRecordsOffset-6;this.parser.currentPosition=i;let r=new vp(this.parser),o=r.gID;if(s===e)return n;if(o===e)return r;for(;t!==i;){let n=t+(i-t)/12;this.parser.currentPosition=n;let s=new vp(this.parser),r=s.gID;if(r===e)return s;r>e?i=n:rnew xp(p)))}}});class bp{constructor(e){this.blue=e.uint8,this.green=e.uint8,this.red=e.uint8,this.alpha=e.uint8}}class wp{constructor(e,t){this.paletteTypes=[...new Array(t)].map((t=>e.uint32))}}class _p{constructor(e,t){this.paletteLabels=[...new Array(t)].map((t=>e.uint16))}}class jp{constructor(e,t){this.paletteEntryLabels=[...new Array(t)].map((t=>e.uint16))}}var Sp=Object.freeze({__proto__:null,CPAL:class extends Su{constructor(e,t){const{p:n}=super(e,t);this.version=n.uint16,this.numPaletteEntries=n.uint16;const s=this.numPalettes=n.uint16;this.numColorRecords=n.uint16,this.offsetFirstColorRecord=n.Offset32,this.colorRecordIndices=[...new Array(this.numPalettes)].map((e=>n.uint16)),Cu(this,"colorRecords",(()=>(n.currentPosition=this.tableStart+this.offsetFirstColorRecord,[...new Array(this.numColorRecords)].map((e=>new bp(n)))))),1===this.version&&(this.offsetPaletteTypeArray=n.Offset32,this.offsetPaletteLabelArray=n.Offset32,this.offsetPaletteEntryLabelArray=n.Offset32,Cu(this,"paletteTypeArray",(()=>(n.currentPosition=this.tableStart+this.offsetPaletteTypeArray,new wp(n,s)))),Cu(this,"paletteLabelArray",(()=>(n.currentPosition=this.tableStart+this.offsetPaletteLabelArray,new _p(n,s)))),Cu(this,"paletteEntryLabelArray",(()=>(n.currentPosition=this.tableStart+this.offsetPaletteEntryLabelArray,new jp(n,s)))))}}});class Cp{constructor(e){this.format=e.uint32,this.length=e.uint32,this.offset=e.Offset32}}class kp{constructor(e){e.uint16,e.uint16,this.signatureLength=e.uint32,this.signature=e.readBytes(this.signatureLength)}}var Ep=Object.freeze({__proto__:null,DSIG:class extends Su{constructor(e,t){const{p:n}=super(e,t);this.version=n.uint32,this.numSignatures=n.uint16,this.flags=n.uint16,this.signatureRecords=[...new Array(this.numSignatures)].map((e=>new Cp(n)))}getData(e){const t=this.signatureRecords[e];return this.parser.currentPosition=this.tableStart+t.offset,new kp(this.parser)}}});class Pp{constructor(e,t){this.pixelSize=e.uint8,this.maxWidth=e.uint8,this.widths=e.readBytes(t)}}var Ip=Object.freeze({__proto__:null,hdmx:class extends Su{constructor(e,t,n){const{p:s}=super(e,t),i=n.hmtx.numGlyphs;this.version=s.uint16,this.numRecords=s.int16,this.sizeDeviceRecord=s.int32,this.records=[...new Array(numRecords)].map((e=>new Pp(s,i)))}}});class Tp{constructor(e){this.version=e.uint16,this.length=e.uint16,this.coverage=e.flags(8),this.format=e.uint8,0===this.format&&(this.nPairs=e.uint16,this.searchRange=e.uint16,this.entrySelector=e.uint16,this.rangeShift=e.uint16,Cu(this,"pairs",(()=>[...new Array(this.nPairs)].map((t=>new Op(e)))))),2===this.format&&console.warn("Kern subtable format 2 is not supported: this parser currently only parses universal table data.")}get horizontal(){return this.coverage[0]}get minimum(){return this.coverage[1]}get crossstream(){return this.coverage[2]}get override(){return this.coverage[3]}}class Op{constructor(e){this.left=e.uint16,this.right=e.uint16,this.value=e.fword}}var Ap=Object.freeze({__proto__:null,kern:class extends Su{constructor(e,t){const{p:n}=super(e,t);this.version=n.uint16,this.nTables=n.uint16,Cu(this,"tables",(()=>{let e=this.tableStart+4;const t=[];for(let s=0;s[...new Array(this.mergeClassCount)].map((e=>n.readBytes(this.mergeClassCount))))),console.warn("Full MERG parsing is currently not supported."),console.warn("If you need this table parsed, please file an issue, or better yet, a PR.")}}});class Fp{constructor(e,t){this.tableStart=e,this.parser=t,this.tag=t.tag,this.dataOffset=t.Offset32,this.dataLength=t.uint32}getData(){return this.parser.currentField=this.tableStart+this.dataOffset,this.parser.readBytes(this.dataLength)}}var Vp=Object.freeze({__proto__:null,meta:class extends Su{constructor(e,t){const{p:n}=super(e,t);this.version=n.uint32,this.flags=n.uint32,n.uint32,this.dataMapsCount=n.uint32,this.dataMaps=[...new Array(this.dataMapsCount)].map((e=>new Fp(this.tableStart,n)))}}});var Rp=Object.freeze({__proto__:null,PCLT:class extends Su{constructor(e,t){super(e,t),console.warn("This font uses a PCLT table, which is currently not supported by this parser."),console.warn("If you need this table parsed, please file an issue, or better yet, a PR.")}}});class Bp{constructor(e){this.bCharSet=e.uint8,this.xRatio=e.uint8,this.yStartRatio=e.uint8,this.yEndRatio=e.uint8}}class Dp{constructor(e){this.recs=e.uint16,this.startsz=e.uint8,this.endsz=e.uint8,this.records=[...new Array(this.recs)].map((t=>new Lp(e)))}}class Lp{constructor(e){this.yPelHeight=e.uint16,this.yMax=e.int16,this.yMin=e.int16}}var zp=Object.freeze({__proto__:null,VDMX:class extends Su{constructor(e,t){const{p:n}=super(e,t);this.version=n.uint16,this.numRecs=n.uint16,this.numRatios=n.uint16,this.ratRanges=[...new Array(this.numRatios)].map((e=>new Bp(n))),this.offsets=[...new Array(this.numRatios)].map((e=>n.Offset16)),this.VDMXGroups=[...new Array(this.numRecs)].map((e=>new Dp(n)))}}});var Gp=Object.freeze({__proto__:null,vhea:class extends Su{constructor(e,t){const{p:n}=super(e,t);this.version=n.fixed,this.ascent=this.vertTypoAscender=n.int16,this.descent=this.vertTypoDescender=n.int16,this.lineGap=this.vertTypoLineGap=n.int16,this.advanceHeightMax=n.int16,this.minTopSideBearing=n.int16,this.minBottomSideBearing=n.int16,this.yMaxExtent=n.int16,this.caretSlopeRise=n.int16,this.caretSlopeRun=n.int16,this.caretOffset=n.int16,this.reserved=n.int16,this.reserved=n.int16,this.reserved=n.int16,this.reserved=n.int16,this.metricDataFormat=n.int16,this.numOfLongVerMetrics=n.uint16,n.verifyLength()}}});class Hp{constructor(e,t){this.advanceHeight=e,this.topSideBearing=t}}var Up=Object.freeze({__proto__:null,vmtx:class extends Su{constructor(e,t,n){super(e,t);const s=n.vhea.numOfLongVerMetrics,i=n.maxp.numGlyphs,r=p.currentPosition;if(lazy(this,"vMetrics",(()=>(p.currentPosition=r,[...new Array(s)].map((e=>new Hp(p.uint16,p.int16)))))),s(p.currentPosition=e,[...new Array(i-s)].map((e=>p.int16)))))}}}});const{kebabCase:Wp}=te(y.privateApis);const qp=function(){const{installFonts:e}=(0,d.useContext)(Yc),[t,n]=(0,d.useState)(!1),[s,i]=(0,d.useState)(!1),r=async e=>{i(null),n(!0);const t=new Set,s=[...e];let r=!1;const l=s.map((async e=>{const n=await async function(e){const t=new Zu("Uploaded Font");try{const n=await a(e);return await t.fromDataBuffer(n,"font"),!0}catch(e){return!1}}(e);if(!n)return r=!0,null;if(t.has(e.name))return null;const s=e.name.split(".").pop().toLowerCase();return Oc.includes(s)?(t.add(e.name),e):null})),c=(await Promise.all(l)).filter((e=>null!==e));if(c.length>0)o(c);else{const e=r?(0,b.__)("Sorry, you are not allowed to upload this file type."):(0,b.__)("No fonts found to install.");i({type:"error",message:e}),n(!1)}},o=async e=>{const t=await Promise.all(e.map((async e=>{const t=await l(e);return await Lc(t,t.file,"all"),t})));c(t)};async function a(e){return new Promise(((t,n)=>{const s=new window.FileReader;s.readAsArrayBuffer(e),s.onload=()=>t(s.result),s.onerror=n}))}const l=async e=>{const t=await a(e),n=new Zu("Uploaded Font");n.fromDataBuffer(t,e.name);const s=(await new Promise((e=>n.onload=e))).detail.font,{name:i}=s.opentype.tables,r=i.get(16)||i.get(1),o=i.get(2).toLowerCase().includes("italic"),l=s.opentype.tables["OS/2"].usWeightClass||"normal",c=!!s.opentype.tables.fvar&&s.opentype.tables.fvar.axes.find((({tag:e})=>"wght"===e));return{file:e,fontFamily:r,fontStyle:o?"italic":"normal",fontWeight:(c?`${c.minValue} ${c.maxValue}`:null)||l}},c=async t=>{const s=function(e){const t=e.reduce(((e,t)=>(e[t.fontFamily]||(e[t.fontFamily]={name:t.fontFamily,fontFamily:t.fontFamily,slug:Wp(t.fontFamily.toLowerCase()),fontFace:[]}),e[t.fontFamily].fontFace.push(t),e)),{});return Object.values(t)}(t);try{await e(s),i({type:"success",message:(0,b.__)("Fonts were installed successfully.")})}catch(e){i({type:"error",message:e.message,errors:e?.installationErrors})}n(!1)};return(0,oe.jsxs)("div",{className:"font-library-modal__tabpanel-layout",children:[(0,oe.jsx)(y.DropZone,{onFilesDrop:e=>{r(e)}}),(0,oe.jsxs)(y.__experimentalVStack,{className:"font-library-modal__local-fonts",children:[s&&(0,oe.jsxs)(y.Notice,{status:s.type,__unstableHTML:!0,onRemove:()=>i(null),children:[s.message,s.errors&&(0,oe.jsx)("ul",{children:s.errors.map(((e,t)=>(0,oe.jsx)("li",{children:e},t)))})]}),t&&(0,oe.jsx)(y.FlexItem,{children:(0,oe.jsx)("div",{className:"font-library-modal__upload-area",children:(0,oe.jsx)(y.ProgressBar,{})})}),!t&&(0,oe.jsx)(y.FormFileUpload,{accept:Oc.map((e=>`.${e}`)).join(","),multiple:!0,onChange:e=>{r(e.target.files)},render:({openFileDialog:e})=>(0,oe.jsx)(y.Button,{__next40pxDefaultSize:!0,className:"font-library-modal__upload-area",onClick:e,children:(0,b.__)("Upload font")})}),(0,oe.jsx)(y.__experimentalSpacer,{margin:2}),(0,oe.jsx)(y.__experimentalText,{className:"font-library-modal__upload-area__text",children:(0,b.__)("Uploaded fonts appear in your library and can be used in your theme. Supported formats: .ttf, .otf, .woff, and .woff2.")})]})]})},{Tabs:Zp}=te(y.privateApis),Kp={id:"installed-fonts",title:(0,b._x)("Library","Font library")},Yp={id:"upload-fonts",title:(0,b._x)("Upload","noun")};const Xp=function({onRequestClose:e,defaultTabId:t="installed-fonts"}){const{collections:n}=(0,d.useContext)(Yc),s=(0,l.useSelect)((e=>e(_.store).canUser("create",{kind:"postType",name:"wp_font_family"})),[]),i=[Kp];return s&&(i.push(Yp),i.push(...(e=>e.map((({slug:t,name:n})=>({id:t,title:1===e.length&&"google-fonts"===t?(0,b.__)("Install Fonts"):n}))))(n||[]))),(0,oe.jsx)(y.Modal,{title:(0,b.__)("Fonts"),onRequestClose:e,isFullScreen:!0,className:"font-library-modal",children:(0,oe.jsxs)(Zp,{defaultTabId:t,children:[(0,oe.jsx)("div",{className:"font-library-modal__tablist-container",children:(0,oe.jsx)(Zp.TabList,{children:i.map((({id:e,title:t})=>(0,oe.jsx)(Zp.Tab,{tabId:e,children:t},e)))})}),i.map((({id:e})=>{let t;switch(e){case"upload-fonts":t=(0,oe.jsx)(qp,{});break;case"installed-fonts":t=(0,oe.jsx)(ru,{});break;default:t=(0,oe.jsx)(fu,{slug:e})}return(0,oe.jsx)(Zp.TabPanel,{tabId:e,focusable:!1,children:t},e)}))]})})};const Jp=function({font:e}){const{handleSetLibraryFontSelected:t,setModalTabOpen:n}=(0,d.useContext)(Yc),s=e?.fontFace?.length||1,i=nl(e);return(0,oe.jsx)(y.__experimentalItem,{onClick:()=>{t(e),n("installed-fonts")},children:(0,oe.jsxs)(y.__experimentalHStack,{justify:"space-between",children:[(0,oe.jsx)(y.FlexItem,{style:i,children:e.name}),(0,oe.jsx)(y.FlexItem,{className:"edit-site-global-styles-screen-typography__font-variants-count",children:(0,b.sprintf)((0,b._n)("%d variant","%d variants",s),s)})]})})},{useGlobalSetting:Qp}=te(x.privateApis);function $p(e,t){return e?e.map((e=>Vc(e,{source:t}))):[]}function ef(){const{baseCustomFonts:e,modalTabOpen:t,setModalTabOpen:n}=(0,d.useContext)(Yc),[s]=Qp("typography.fontFamilies"),[i]=Qp("typography.fontFamilies",void 0,"base"),r=[...$p(s?.theme,"theme"),...$p(s?.custom,"custom")].sort(((e,t)=>e.name.localeCompare(t.name))),o=00||e?.length>0;return(0,oe.jsxs)(oe.Fragment,{children:[!!t&&(0,oe.jsx)(Xp,{onRequestClose:()=>n(null),defaultTabId:t}),(0,oe.jsxs)(y.__experimentalVStack,{spacing:2,children:[(0,oe.jsxs)(y.__experimentalHStack,{justify:"space-between",children:[(0,oe.jsx)(Rl,{level:3,children:(0,b.__)("Fonts")}),(0,oe.jsx)(y.Button,{onClick:()=>n("installed-fonts"),label:(0,b.__)("Manage fonts"),icon:Sc,size:"small"})]}),r.length>0&&(0,oe.jsx)(oe.Fragment,{children:(0,oe.jsx)(y.__experimentalItemGroup,{size:"large",isBordered:!0,isSeparated:!0,children:r.map((e=>(0,oe.jsx)(Jp,{font:e},e.slug)))})}),!o&&(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(y.__experimentalText,{as:"p",children:a?(0,b.__)("No fonts activated."):(0,b.__)("No fonts installed.")}),(0,oe.jsx)(y.Button,{className:"edit-site-global-styles-font-families__manage-fonts",variant:"secondary",__next40pxDefaultSize:!0,onClick:()=>{n(a?"installed-fonts":"upload-fonts")},children:a?(0,b.__)("Manage fonts"):(0,b.__)("Add fonts")})]})]})]})}const tf=({...e})=>(0,oe.jsx)(Xc,{children:(0,oe.jsx)(ef,{...e})});const nf=function(){const e=(0,l.useSelect)((e=>e(h.store).getEditorSettings().fontLibraryEnabled),[]);return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(Cl,{title:(0,b.__)("Typography"),description:(0,b.__)("Available fonts, typographic styles, and the application of those styles.")}),(0,oe.jsx)("div",{className:"edit-site-global-styles-screen",children:(0,oe.jsxs)(y.__experimentalVStack,{spacing:7,children:[(0,oe.jsx)(_c,{title:(0,b.__)("Typesets")}),e&&(0,oe.jsx)(tf,{}),(0,oe.jsx)(ac,{}),(0,oe.jsx)(jc,{})]})})]})},{useGlobalStyle:sf,useGlobalSetting:rf,useSettingsForBlockElement:of,TypographyPanel:af}=te(x.privateApis);function lf({element:e,headingLevel:t}){let n=[];"heading"===e?n=n.concat(["elements",t]):e&&"text"!==e&&(n=n.concat(["elements",e]));const s=n.join("."),[i]=sf(s,void 0,"user",{shouldDecodeEncode:!1}),[r,o]=sf(s,void 0,"all",{shouldDecodeEncode:!1}),[a]=rf(""),l=of(a,void 0,"heading"===e?t:e);return(0,oe.jsx)(af,{inheritedValue:r,value:i,onChange:o,settings:l})}const{useGlobalStyle:cf}=te(x.privateApis);function uf({name:e,element:t,headingLevel:n}){var s;let i="";"heading"===t?i=`elements.${n}.`:t&&"text"!==t&&(i=`elements.${t}.`);const[r]=cf(i+"typography.fontFamily",e),[o]=cf(i+"color.gradient",e),[a]=cf(i+"color.background",e),[l]=cf("color.background"),[c]=cf(i+"color.text",e),[u]=cf(i+"typography.fontSize",e),[d]=cf(i+"typography.fontStyle",e),[h]=cf(i+"typography.fontWeight",e),[p]=cf(i+"typography.letterSpacing",e),f="link"===t?{textDecoration:"underline"}:{};return(0,oe.jsx)("div",{className:"edit-site-typography-preview",style:{fontFamily:null!=r?r:"serif",background:null!==(s=null!=o?o:a)&&void 0!==s?s:l,color:c,fontSize:u,fontStyle:d,fontWeight:h,letterSpacing:p,...f},children:"Aa"})}const df={text:{description:(0,b.__)("Manage the fonts used on the site."),title:(0,b.__)("Text")},link:{description:(0,b.__)("Manage the fonts and typography used on the links."),title:(0,b.__)("Links")},heading:{description:(0,b.__)("Manage the fonts and typography used on headings."),title:(0,b.__)("Headings")},caption:{description:(0,b.__)("Manage the fonts and typography used on captions."),title:(0,b.__)("Captions")},button:{description:(0,b.__)("Manage the fonts and typography used on buttons."),title:(0,b.__)("Buttons")}};const hf=function({element:e}){const[t,n]=(0,d.useState)("heading");return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(Cl,{title:df[e].title,description:df[e].description}),(0,oe.jsx)(y.__experimentalSpacer,{marginX:4,children:(0,oe.jsx)(uf,{element:e,headingLevel:t})}),"heading"===e&&(0,oe.jsx)(y.__experimentalSpacer,{marginX:4,marginBottom:"1em",children:(0,oe.jsxs)(y.__experimentalToggleGroupControl,{label:(0,b.__)("Select heading level"),hideLabelFromVision:!0,value:t,onChange:n,isBlock:!0,size:"__unstable-large",__nextHasNoMarginBottom:!0,children:[(0,oe.jsx)(y.__experimentalToggleGroupControlOption,{value:"heading",showTooltip:!0,"aria-label":(0,b.__)("All headings"),label:(0,b._x)("All","heading levels")}),(0,oe.jsx)(y.__experimentalToggleGroupControlOption,{value:"h1",showTooltip:!0,"aria-label":(0,b.__)("Heading 1"),label:(0,b.__)("H1")}),(0,oe.jsx)(y.__experimentalToggleGroupControlOption,{value:"h2",showTooltip:!0,"aria-label":(0,b.__)("Heading 2"),label:(0,b.__)("H2")}),(0,oe.jsx)(y.__experimentalToggleGroupControlOption,{value:"h3",showTooltip:!0,"aria-label":(0,b.__)("Heading 3"),label:(0,b.__)("H3")}),(0,oe.jsx)(y.__experimentalToggleGroupControlOption,{value:"h4",showTooltip:!0,"aria-label":(0,b.__)("Heading 4"),label:(0,b.__)("H4")}),(0,oe.jsx)(y.__experimentalToggleGroupControlOption,{value:"h5",showTooltip:!0,"aria-label":(0,b.__)("Heading 5"),label:(0,b.__)("H5")}),(0,oe.jsx)(y.__experimentalToggleGroupControlOption,{value:"h6",showTooltip:!0,"aria-label":(0,b.__)("Heading 6"),label:(0,b.__)("H6")})]})}),(0,oe.jsx)(lf,{element:e,headingLevel:t})]})},{useGlobalStyle:pf}=te(x.privateApis);const ff=function({fontSize:e}){var t;const[n]=pf("typography"),s=e?.fluid?.min&&e?.fluid?.max?{minimumFontSize:e.fluid.min,maximumFontSize:e.fluid.max}:{fontSize:e.size},i=(0,x.getComputedFluidTypographyValue)(s);return(0,oe.jsx)("div",{className:"edit-site-typography-preview",style:{fontSize:i,fontFamily:null!==(t=n?.fontFamily)&&void 0!==t?t:"serif"},children:(0,b.__)("Aa")})};const mf=function({fontSize:e,isOpen:t,toggleOpen:n,handleRemoveFontSize:s}){return(0,oe.jsx)(y.__experimentalConfirmDialog,{isOpen:t,cancelButtonText:(0,b.__)("Cancel"),confirmButtonText:(0,b.__)("Delete"),onCancel:()=>{n()},onConfirm:async()=>{n(),s(e)},size:"medium",children:e&&(0,b.sprintf)((0,b.__)('Are you sure you want to delete "%s" font size preset?'),e.name)})};const gf=function({fontSize:e,toggleOpen:t,handleRename:n}){const[s,i]=(0,d.useState)(e.name);return(0,oe.jsx)(y.Modal,{onRequestClose:t,focusOnMount:"firstContentElement",title:(0,b.__)("Rename"),size:"small",children:(0,oe.jsx)("form",{onSubmit:e=>{e.preventDefault(),s.trim()&&n(s),t(),t()},children:(0,oe.jsxs)(y.__experimentalVStack,{spacing:"3",children:[(0,oe.jsx)(y.__experimentalInputControl,{__next40pxDefaultSize:!0,autoComplete:"off",value:s,onChange:i,label:(0,b.__)("Name"),placeholder:(0,b.__)("Font size preset name")}),(0,oe.jsxs)(y.__experimentalHStack,{justify:"right",children:[(0,oe.jsx)(y.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:t,children:(0,b.__)("Cancel")}),(0,oe.jsx)(y.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",children:(0,b.__)("Save")})]})]})})})},vf=["px","em","rem","vw","vh"];const xf=function({__nextHasNoMarginBottom:e,...t}){const{baseControlProps:n}=(0,y.useBaseControlProps)(t),{value:s,onChange:i,fallbackValue:r,disabled:o,label:a}=t,l=(0,y.__experimentalUseCustomUnits)({availableUnits:vf}),[c,u="px"]=(0,y.__experimentalParseQuantityAndUnitFromRawValue)(s,l),d=!!u&&["em","rem","vw","vh"].includes(u);return(0,oe.jsx)(y.BaseControl,{...n,__nextHasNoMarginBottom:!0,children:(0,oe.jsxs)(y.Flex,{children:[(0,oe.jsx)(y.FlexItem,{isBlock:!0,children:(0,oe.jsx)(y.__experimentalUnitControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:a,hideLabelFromVision:!0,value:s,onChange:e=>{i(e)},units:l,min:0,disabled:o})}),(0,oe.jsx)(y.FlexItem,{isBlock:!0,children:(0,oe.jsx)(y.__experimentalSpacer,{marginX:2,marginBottom:0,children:(0,oe.jsx)(y.RangeControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:a,hideLabelFromVision:!0,value:c,initialPosition:r,withInputField:!1,onChange:e=>{i?.(e+u)},min:0,max:d?10:100,step:d?.1:1,disabled:o})})})]})})},{Menu:yf}=te(y.privateApis),{useGlobalSetting:bf}=te(x.privateApis);const wf=function(){var e;const[t,n]=(0,d.useState)(!1),[s,i]=(0,d.useState)(!1),{params:{origin:r,slug:o},goBack:a}=(0,y.useNavigator)(),[l,c]=bf("typography.fontSizes"),[u]=bf("typography.fluid"),h=null!==(e=l[r])&&void 0!==e?e:[],p=h.find((e=>e.slug===o));if((0,d.useEffect)((()=>{o&&!p&&a()}),[o,p,a]),!r||!o||!p)return null;const f=void 0!==p?.fluid?!!p.fluid:!!u,m="object"==typeof p?.fluid,g=(e,t)=>{const n=h.map((n=>n.slug===o?{...n,[e]:t}:n));c({...l,[r]:n})},v=()=>{n(!t)},x=()=>{i(!s)};return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(mf,{fontSize:p,isOpen:t,toggleOpen:v,handleRemoveFontSize:()=>{const e=h.filter((e=>e.slug!==o));c({...l,[r]:e})}}),s&&(0,oe.jsx)(gf,{fontSize:p,toggleOpen:x,handleRename:e=>{g("name",e)}}),(0,oe.jsxs)(y.__experimentalVStack,{spacing:4,children:[(0,oe.jsxs)(y.__experimentalHStack,{justify:"space-between",align:"flex-start",children:[(0,oe.jsx)(Cl,{title:p.name,description:(0,b.sprintf)((0,b.__)("Manage the font size %s."),p.name)}),"custom"===r&&(0,oe.jsx)(y.FlexItem,{children:(0,oe.jsx)(y.__experimentalSpacer,{marginTop:3,marginBottom:0,paddingX:4,children:(0,oe.jsxs)(yf,{children:[(0,oe.jsx)(yf.TriggerButton,{render:(0,oe.jsx)(y.Button,{size:"small",icon:Da,label:(0,b.__)("Font size options")})}),(0,oe.jsxs)(yf.Popover,{children:[(0,oe.jsx)(yf.Item,{onClick:x,children:(0,oe.jsx)(yf.ItemLabel,{children:(0,b.__)("Rename")})}),(0,oe.jsx)(yf.Item,{onClick:v,children:(0,oe.jsx)(yf.ItemLabel,{children:(0,b.__)("Delete")})})]})]})})})]}),(0,oe.jsx)(y.__experimentalView,{children:(0,oe.jsx)(y.__experimentalSpacer,{paddingX:4,marginBottom:0,paddingBottom:6,children:(0,oe.jsxs)(y.__experimentalVStack,{spacing:4,children:[(0,oe.jsx)(y.FlexItem,{children:(0,oe.jsx)(ff,{fontSize:p})}),(0,oe.jsx)(xf,{label:(0,b.__)("Size"),value:m?"":p.size,onChange:e=>{g("size",e)},disabled:m}),(0,oe.jsx)(y.ToggleControl,{label:(0,b.__)("Fluid typography"),help:(0,b.__)("Scale the font size dynamically to fit the screen or viewport."),checked:f,onChange:e=>{g("fluid",e)},__nextHasNoMarginBottom:!0}),f&&(0,oe.jsx)(y.ToggleControl,{label:(0,b.__)("Custom fluid values"),help:(0,b.__)("Set custom min and max values for the fluid font size."),checked:m,onChange:e=>{g("fluid",!e||{min:p.size,max:p.size})},__nextHasNoMarginBottom:!0}),m&&(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(xf,{label:(0,b.__)("Minimum"),value:p.fluid?.min,onChange:e=>{g("fluid",{...p.fluid,min:e})}}),(0,oe.jsx)(xf,{label:(0,b.__)("Maximum"),value:p.fluid?.max,onChange:e=>{g("fluid",{...p.fluid,max:e})}})]})]})})})]})]})},_f=(0,oe.jsx)(Yt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Yt.Path,{d:"M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z"})});const jf=function({text:e,confirmButtonText:t,isOpen:n,toggleOpen:s,onConfirm:i}){return(0,oe.jsx)(y.__experimentalConfirmDialog,{isOpen:n,cancelButtonText:(0,b.__)("Cancel"),confirmButtonText:t,onCancel:()=>{s()},onConfirm:async()=>{s(),i()},size:"medium",children:e})},{Menu:Sf}=te(y.privateApis),{useGlobalSetting:Cf}=te(x.privateApis);function kf({label:e,origin:t,sizes:n,handleAddFontSize:s,handleResetFontSizes:i}){const[r,o]=(0,d.useState)(!1),a=()=>o(!r),l="custom"===t?(0,b.__)("Are you sure you want to remove all custom font size presets?"):(0,b.__)("Are you sure you want to reset all font size presets to their default values?");return(0,oe.jsxs)(oe.Fragment,{children:[r&&(0,oe.jsx)(jf,{text:l,confirmButtonText:"custom"===t?(0,b.__)("Remove"):(0,b.__)("Reset"),isOpen:r,toggleOpen:a,onConfirm:i}),(0,oe.jsxs)(y.__experimentalVStack,{spacing:4,children:[(0,oe.jsxs)(y.__experimentalHStack,{justify:"space-between",align:"center",children:[(0,oe.jsx)(Rl,{level:3,children:e}),(0,oe.jsxs)(y.FlexItem,{children:["custom"===t&&(0,oe.jsx)(y.Button,{label:(0,b.__)("Add font size"),icon:_f,size:"small",onClick:s}),!!i&&(0,oe.jsxs)(Sf,{children:[(0,oe.jsx)(Sf.TriggerButton,{render:(0,oe.jsx)(y.Button,{size:"small",icon:Da,label:(0,b.__)("Font size presets options")})}),(0,oe.jsx)(Sf.Popover,{children:(0,oe.jsx)(Sf.Item,{onClick:a,children:(0,oe.jsx)(Sf.ItemLabel,{children:"custom"===t?(0,b.__)("Remove font size presets"):(0,b.__)("Reset font size presets")})})})]})]})]}),!!n.length&&(0,oe.jsx)(y.__experimentalItemGroup,{isBordered:!0,isSeparated:!0,children:n.map((e=>(0,oe.jsx)(Ga,{path:`/typography/font-sizes/${t}/${e.slug}`,children:(0,oe.jsxs)(y.__experimentalHStack,{children:[(0,oe.jsx)(y.FlexItem,{className:"edit-site-font-size__item",children:e.name}),(0,oe.jsx)(y.FlexItem,{display:"flex",children:(0,oe.jsx)($o,{icon:(0,b.isRTL)()?Ko:Zo})})]})},e.slug)))})]})]})}const Ef=function(){const[e,t]=Cf("typography.fontSizes.theme"),[n]=Cf("typography.fontSizes.theme",null,"base"),[s,i]=Cf("typography.fontSizes.default"),[r]=Cf("typography.fontSizes.default",null,"base"),[o=[],a]=Cf("typography.fontSizes.custom"),[l]=Cf("typography.defaultFontSizes"),c=()=>{const e=il(o,"custom-"),t={name:(0,b.sprintf)((0,b.__)("New Font Size %d"),e),size:"16px",slug:`custom-${e}`};a([...o,t])},u=(e,t)=>e.map((e=>e.size)).join("")===t.map((e=>e.size)).join("");return(0,oe.jsxs)(y.__experimentalVStack,{spacing:2,children:[(0,oe.jsx)(Cl,{title:(0,b.__)("Font size presets"),description:(0,b.__)("Create and edit the presets used for font sizes across the site.")}),(0,oe.jsx)(y.__experimentalView,{children:(0,oe.jsx)(y.__experimentalSpacer,{paddingX:4,children:(0,oe.jsxs)(y.__experimentalVStack,{spacing:8,children:[!!e?.length&&(0,oe.jsx)(kf,{label:(0,b.__)("Theme"),origin:"theme",sizes:e,baseSizes:n,handleAddFontSize:c,handleResetFontSizes:u(e,n)?null:()=>t(n)}),l&&!!s?.length&&(0,oe.jsx)(kf,{label:(0,b.__)("Default"),origin:"default",sizes:s,baseSizes:r,handleAddFontSize:c,handleResetFontSizes:u(s,r)?null:()=>i(r)}),(0,oe.jsx)(kf,{label:(0,b.__)("Custom"),origin:"custom",sizes:o,handleAddFontSize:c,handleResetFontSizes:o.length>0?()=>a([]):null})]})})})]})},Pf=(0,oe.jsx)(Yt.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/SVG",children:(0,oe.jsx)(Yt.Path,{d:"M17.192 6.75L15.47 5.03l1.06-1.06 3.537 3.53-3.537 3.53-1.06-1.06 1.723-1.72h-3.19c-.602 0-.993.202-1.28.498-.309.319-.538.792-.695 1.383-.13.488-.222 1.023-.296 1.508-.034.664-.116 1.413-.303 2.117-.193.721-.513 1.467-1.068 2.04-.575.594-1.359.954-2.357.954H4v-1.5h4.003c.601 0 .993-.202 1.28-.498.308-.319.538-.792.695-1.383.149-.557.216-1.093.288-1.662l.039-.31a9.653 9.653 0 0 1 .272-1.653c.193-.722.513-1.467 1.067-2.04.576-.594 1.36-.954 2.358-.954h3.19zM8.004 6.75c.8 0 1.46.23 1.988.628a6.24 6.24 0 0 0-.684 1.396 1.725 1.725 0 0 0-.024-.026c-.287-.296-.679-.498-1.28-.498H4v-1.5h4.003zM12.699 14.726c-.161.459-.38.94-.684 1.396.527.397 1.188.628 1.988.628h3.19l-1.722 1.72 1.06 1.06L20.067 16l-3.537-3.53-1.06 1.06 1.723 1.72h-3.19c-.602 0-.993-.202-1.28-.498a1.96 1.96 0 0 1-.024-.026z"})});const If=function({className:e,...t}){return(0,oe.jsx)(y.Flex,{className:Ut("edit-site-global-styles__color-indicator-wrapper",e),...t})},{useGlobalSetting:Tf}=te(x.privateApis),Of=[];const Af=function({name:e}){const[t]=Tf("color.palette.custom"),[n]=Tf("color.palette.theme"),[s]=Tf("color.palette.default"),[i]=Tf("color.defaultPalette",e),[r]=function(e){const[t,n]=ne("color.palette.theme",e);return window.__experimentalEnableColorRandomizer?[function(){const e=Math.floor(225*Math.random()),s=t.map((t=>{const{color:n}=t,s=Y(n).rotate(e).toHex();return{...t,color:s}}));n(s)}]:[]}(),o=(0,d.useMemo)((()=>[...t||Of,...n||Of,...s&&i?s:Of]),[t,n,s,i]),a=e?"/blocks/"+encodeURIComponent(e)+"/colors/palette":"/colors/palette";return(0,oe.jsxs)(y.__experimentalVStack,{spacing:3,children:[(0,oe.jsx)(Rl,{level:3,children:(0,b.__)("Palette")}),(0,oe.jsx)(y.__experimentalItemGroup,{isBordered:!0,isSeparated:!0,children:(0,oe.jsx)(Ga,{path:a,children:(0,oe.jsxs)(y.__experimentalHStack,{direction:"row",children:[o.length>0?(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(y.__experimentalZStack,{isLayered:!1,offset:-8,children:o.slice(0,5).map((({color:e},t)=>(0,oe.jsx)(If,{children:(0,oe.jsx)(y.ColorIndicator,{colorValue:e})},`${e}-${t}`)))}),(0,oe.jsx)(y.FlexItem,{isBlock:!0,children:(0,b.__)("Edit palette")})]}):(0,oe.jsx)(y.FlexItem,{children:(0,b.__)("Add colors")}),(0,oe.jsx)($o,{icon:(0,b.isRTL)()?Ko:Zo})]})})}),window.__experimentalEnableColorRandomizer&&n?.length>0&&(0,oe.jsx)(y.Button,{__next40pxDefaultSize:!0,variant:"secondary",icon:Pf,onClick:r,children:(0,b.__)("Randomize colors")})]})},{useGlobalStyle:Nf,useGlobalSetting:Mf,useSettingsForBlockElement:Ff,ColorPanel:Vf}=te(x.privateApis);const Rf=function(){const[e]=Nf("",void 0,"user",{shouldDecodeEncode:!1}),[t,n]=Nf("",void 0,"all",{shouldDecodeEncode:!1}),[s]=Mf(""),i=Ff(s);return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(Cl,{title:(0,b.__)("Colors"),description:(0,b.__)("Palette colors and the application of those colors on site elements.")}),(0,oe.jsx)("div",{className:"edit-site-global-styles-screen",children:(0,oe.jsxs)(y.__experimentalVStack,{spacing:7,children:[(0,oe.jsx)(Af,{}),(0,oe.jsx)(Vf,{inheritedValue:t,value:e,onChange:n,settings:i})]})})]})};function Bf(){const{paletteColors:e}=ie();return e.slice(0,4).map((({slug:e,color:t},n)=>(0,oe.jsx)("div",{style:{flexGrow:1,height:"100%",background:t}},`${e}-${n}`)))}const Df={start:{scale:1,opacity:1},hover:{scale:0,opacity:0}},Lf=({label:e,isFocused:t,withHoverView:n})=>(0,oe.jsx)(pl,{label:e,isFocused:t,withHoverView:n,children:({key:e})=>(0,oe.jsx)(y.__unstableMotion.div,{variants:Df,style:{height:"100%",overflow:"hidden"},children:(0,oe.jsx)(y.__experimentalHStack,{spacing:0,justify:"center",style:{height:"100%",overflow:"hidden"},children:(0,oe.jsx)(Bf,{})})},e)});function zf({title:e,gap:t=2}){const n=["color"],s=mc(n);return s?.length<=1?null:(0,oe.jsxs)(y.__experimentalVStack,{spacing:3,children:[e&&(0,oe.jsx)(Rl,{level:3,children:e}),(0,oe.jsx)(y.__experimentalGrid,{spacing:t,children:s.map(((e,t)=>(0,oe.jsx)(wc,{variation:e,isPill:!0,properties:n,showTooltip:!0,children:()=>(0,oe.jsx)(Lf,{})},t)))})]})}const{useGlobalSetting:Gf}=te(x.privateApis),Hf={placement:"bottom-start",offset:8};function Uf({name:e}){const[t,n]=Gf("color.palette.theme",e),[s]=Gf("color.palette.theme",e,"base"),[i,r]=Gf("color.palette.default",e),[o]=Gf("color.palette.default",e,"base"),[a,l]=Gf("color.palette.custom",e),[c]=Gf("color.defaultPalette",e),u=(0,v.useViewportMatch)("small","<")?Hf:void 0;return(0,oe.jsxs)(y.__experimentalVStack,{className:"edit-site-global-styles-color-palette-panel",spacing:8,children:[!!t&&!!t.length&&(0,oe.jsx)(y.__experimentalPaletteEdit,{canReset:t!==s,canOnlyChangeValues:!0,colors:t,onChange:n,paletteLabel:(0,b.__)("Theme"),paletteLabelHeadingLevel:3,popoverProps:u}),!!i&&!!i.length&&!!c&&(0,oe.jsx)(y.__experimentalPaletteEdit,{canReset:i!==o,canOnlyChangeValues:!0,colors:i,onChange:r,paletteLabel:(0,b.__)("Default"),paletteLabelHeadingLevel:3,popoverProps:u}),(0,oe.jsx)(y.__experimentalPaletteEdit,{colors:a,onChange:l,paletteLabel:(0,b.__)("Custom"),paletteLabelHeadingLevel:3,slugPrefix:"custom-",popoverProps:u}),(0,oe.jsx)(zf,{title:(0,b.__)("Palettes")})]})}const{useGlobalSetting:Wf}=te(x.privateApis),qf={placement:"bottom-start",offset:8},Zf=()=>{};function Kf({name:e}){const[t,n]=Wf("color.gradients.theme",e),[s]=Wf("color.gradients.theme",e,"base"),[i,r]=Wf("color.gradients.default",e),[o]=Wf("color.gradients.default",e,"base"),[a,l]=Wf("color.gradients.custom",e),[c]=Wf("color.defaultGradients",e),[u]=Wf("color.duotone.custom")||[],[d]=Wf("color.duotone.default")||[],[h]=Wf("color.duotone.theme")||[],[p]=Wf("color.defaultDuotone"),f=[...u||[],...h||[],...d&&p?d:[]],m=(0,v.useViewportMatch)("small","<")?qf:void 0;return(0,oe.jsxs)(y.__experimentalVStack,{className:"edit-site-global-styles-gradient-palette-panel",spacing:8,children:[!!t&&!!t.length&&(0,oe.jsx)(y.__experimentalPaletteEdit,{canReset:t!==s,canOnlyChangeValues:!0,gradients:t,onChange:n,paletteLabel:(0,b.__)("Theme"),paletteLabelHeadingLevel:3,popoverProps:m}),!!i&&!!i.length&&!!c&&(0,oe.jsx)(y.__experimentalPaletteEdit,{canReset:i!==o,canOnlyChangeValues:!0,gradients:i,onChange:r,paletteLabel:(0,b.__)("Default"),paletteLabelLevel:3,popoverProps:m}),(0,oe.jsx)(y.__experimentalPaletteEdit,{gradients:a,onChange:l,paletteLabel:(0,b.__)("Custom"),paletteLabelLevel:3,slugPrefix:"custom-",popoverProps:m}),!!f&&!!f.length&&(0,oe.jsxs)("div",{children:[(0,oe.jsx)(Rl,{level:3,children:(0,b.__)("Duotone")}),(0,oe.jsx)(y.__experimentalSpacer,{margin:3}),(0,oe.jsx)(y.DuotonePicker,{duotonePalette:f,disableCustomDuotone:!0,disableCustomColors:!0,clearable:!1,onChange:Zf})]})]})}const{Tabs:Yf}=te(y.privateApis);const Xf=function({name:e}){return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(Cl,{title:(0,b.__)("Edit palette"),description:(0,b.__)("The combination of colors used across the site and in color pickers.")}),(0,oe.jsxs)(Yf,{children:[(0,oe.jsxs)(Yf.TabList,{children:[(0,oe.jsx)(Yf.Tab,{tabId:"color",children:(0,b.__)("Color")}),(0,oe.jsx)(Yf.Tab,{tabId:"gradient",children:(0,b.__)("Gradient")})]}),(0,oe.jsx)(Yf.TabPanel,{tabId:"color",focusable:!1,children:(0,oe.jsx)(Uf,{name:e})}),(0,oe.jsx)(Yf.TabPanel,{tabId:"gradient",focusable:!1,children:(0,oe.jsx)(Kf,{name:e})})]})]})},Jf={backgroundSize:"auto"},{useGlobalStyle:Qf,useGlobalSetting:$f,BackgroundPanel:em}=te(x.privateApis);function tm(){const[e]=Qf("",void 0,"user",{shouldDecodeEncode:!1}),[t,n]=Qf("",void 0,"all",{shouldDecodeEncode:!1}),[s]=$f("");return(0,oe.jsx)(em,{inheritedValue:t,value:e,onChange:n,settings:s,defaultValues:Jf})}const{useHasBackgroundPanel:nm,useGlobalSetting:sm}=te(x.privateApis);const im=function(){const[e]=sm(""),t=nm(e);return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(Cl,{title:(0,b.__)("Background"),description:(0,oe.jsx)(y.__experimentalText,{children:(0,b.__)("Set styles for the site’s background.")})}),t&&(0,oe.jsx)(tm,{})]})};const rm=function({text:e,confirmButtonText:t,isOpen:n,toggleOpen:s,onConfirm:i}){return(0,oe.jsx)(y.__experimentalConfirmDialog,{isOpen:n,cancelButtonText:(0,b.__)("Cancel"),confirmButtonText:t,onCancel:()=>{s()},onConfirm:async()=>{s(),i()},size:"medium",children:e})},{useGlobalSetting:om}=te(x.privateApis),{Menu:am}=te(y.privateApis),lm="6px 6px 9px rgba(0, 0, 0, 0.2)";function cm(){const[e]=om("shadow.presets.default"),[t]=om("shadow.defaultPresets"),[n]=om("shadow.presets.theme"),[s,i]=om("shadow.presets.custom"),[r,o]=(0,d.useState)(!1),a=()=>o(!r);return(0,oe.jsxs)(oe.Fragment,{children:[r&&(0,oe.jsx)(rm,{text:(0,b.__)("Are you sure you want to remove all custom shadows?"),confirmButtonText:(0,b.__)("Remove"),isOpen:r,toggleOpen:a,onConfirm:()=>{i([])}}),(0,oe.jsx)(Cl,{title:(0,b.__)("Shadows"),description:(0,b.__)("Manage and create shadow styles for use across the site.")}),(0,oe.jsx)("div",{className:"edit-site-global-styles-screen",children:(0,oe.jsxs)(y.__experimentalVStack,{className:"edit-site-global-styles__shadows-panel",spacing:7,children:[t&&(0,oe.jsx)(um,{label:(0,b.__)("Default"),shadows:e||[],category:"default"}),n&&n.length>0&&(0,oe.jsx)(um,{label:(0,b.__)("Theme"),shadows:n||[],category:"theme"}),(0,oe.jsx)(um,{label:(0,b.__)("Custom"),shadows:s||[],category:"custom",canCreate:!0,onCreate:e=>{i([...s||[],e])},onReset:a})]})})]})}function um({label:e,shadows:t,category:n,canCreate:s,onCreate:i,onReset:r}){return(0,oe.jsxs)(y.__experimentalVStack,{spacing:2,children:[(0,oe.jsxs)(y.__experimentalHStack,{justify:"space-between",children:[(0,oe.jsx)(y.Flex,{align:"center",className:"edit-site-global-styles__shadows-panel__title",children:(0,oe.jsx)(Rl,{level:3,children:e})}),s&&(0,oe.jsx)(y.FlexItem,{className:"edit-site-global-styles__shadows-panel__options-container",children:(0,oe.jsx)(y.Button,{size:"small",icon:_f,label:(0,b.__)("Add shadow"),onClick:()=>{(()=>{const e=il(t,"shadow-");i({name:(0,b.sprintf)((0,b.__)("Shadow %s"),e),shadow:lm,slug:`shadow-${e}`})})()}})}),!!t?.length&&"custom"===n&&(0,oe.jsxs)(am,{children:[(0,oe.jsx)(am.TriggerButton,{render:(0,oe.jsx)(y.Button,{size:"small",icon:Da,label:(0,b.__)("Shadow options")})}),(0,oe.jsx)(am.Popover,{children:(0,oe.jsx)(am.Item,{onClick:r,children:(0,oe.jsx)(am.ItemLabel,{children:(0,b.__)("Remove all custom shadows")})})})]})]}),t.length>0&&(0,oe.jsx)(y.__experimentalItemGroup,{isBordered:!0,isSeparated:!0,children:t.map((e=>(0,oe.jsx)(dm,{shadow:e,category:n},e.slug)))})]})}function dm({shadow:e,category:t}){return(0,oe.jsx)(Ga,{path:`/shadows/edit/${t}/${e.slug}`,children:(0,oe.jsxs)(y.__experimentalHStack,{children:[(0,oe.jsx)(y.FlexItem,{children:e.name}),(0,oe.jsx)($o,{icon:(0,b.isRTL)()?Ko:Zo})]})})}const hm=(0,oe.jsx)(Yt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Yt.Path,{d:"M7 11.5h10V13H7z"})});const{useGlobalSetting:pm}=te(x.privateApis),{Menu:fm}=te(y.privateApis),mm=[{label:(0,b.__)("Rename"),action:"rename"},{label:(0,b.__)("Delete"),action:"delete"}],gm=[{label:(0,b.__)("Reset"),action:"reset"}];function vm(){const{goBack:e,params:{category:t,slug:n}}=(0,y.useNavigator)(),[s,i]=pm(`shadow.presets.${t}`);(0,d.useEffect)((()=>{const t=s?.some((e=>e.slug===n));n&&!t&&e()}),[s,n,e]);const[r]=pm(`shadow.presets.${t}`,void 0,"base"),[o,a]=(0,d.useState)((()=>(s||[]).find((e=>e.slug===n)))),l=(0,d.useMemo)((()=>(r||[]).find((e=>e.slug===n))),[r,n]),[c,u]=(0,d.useState)(!1),[h,p]=(0,d.useState)(!1),[f,m]=(0,d.useState)(o.name);if(!t||!n)return null;return o?(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsxs)(y.__experimentalHStack,{justify:"space-between",children:[(0,oe.jsx)(Cl,{title:o.name}),(0,oe.jsx)(y.FlexItem,{children:(0,oe.jsx)(y.__experimentalSpacer,{marginTop:2,marginBottom:0,paddingX:4,children:(0,oe.jsxs)(fm,{children:[(0,oe.jsx)(fm.TriggerButton,{render:(0,oe.jsx)(y.Button,{size:"small",icon:Da,label:(0,b.__)("Menu")})}),(0,oe.jsx)(fm.Popover,{children:("custom"===t?mm:gm).map((e=>(0,oe.jsx)(fm.Item,{onClick:()=>(e=>{if("reset"===e){const e=s.map((e=>e.slug===n?l:e));a(l),i(e)}else"delete"===e?u(!0):"rename"===e&&p(!0)})(e.action),disabled:"reset"===e.action&&o.shadow===l.shadow,children:(0,oe.jsx)(fm.ItemLabel,{children:e.label})},e.action)))})]})})})]}),(0,oe.jsxs)("div",{className:"edit-site-global-styles-screen",children:[(0,oe.jsx)(xm,{shadow:o.shadow}),(0,oe.jsx)(ym,{shadow:o.shadow,onChange:e=>{a({...o,shadow:e});const t=s.map((t=>t.slug===n?{...o,shadow:e}:t));i(t)}})]}),c&&(0,oe.jsx)(y.__experimentalConfirmDialog,{isOpen:!0,onConfirm:()=>{i(s.filter((e=>e.slug!==n))),u(!1)},onCancel:()=>{u(!1)},confirmButtonText:(0,b.__)("Delete"),size:"medium",children:(0,b.sprintf)((0,b.__)('Are you sure you want to delete "%s" shadow preset?'),o.name)}),h&&(0,oe.jsx)(y.Modal,{title:(0,b.__)("Rename"),onRequestClose:()=>p(!1),size:"small",children:(0,oe.jsxs)("form",{onSubmit:e=>{e.preventDefault(),(e=>{if(!e)return;const t=s.map((t=>t.slug===n?{...o,name:e}:t));a({...o,name:e}),i(t)})(f),p(!1)},children:[(0,oe.jsx)(y.__experimentalInputControl,{__next40pxDefaultSize:!0,autoComplete:"off",label:(0,b.__)("Name"),placeholder:(0,b.__)("Shadow name"),value:f,onChange:e=>m(e)}),(0,oe.jsx)(y.__experimentalSpacer,{marginBottom:6}),(0,oe.jsxs)(y.Flex,{className:"block-editor-shadow-edit-modal__actions",justify:"flex-end",expanded:!1,children:[(0,oe.jsx)(y.FlexItem,{children:(0,oe.jsx)(y.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>p(!1),children:(0,b.__)("Cancel")})}),(0,oe.jsx)(y.FlexItem,{children:(0,oe.jsx)(y.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",children:(0,b.__)("Save")})})]})]})})]}):(0,oe.jsx)(Cl,{title:""})}function xm({shadow:e}){const t={boxShadow:e};return(0,oe.jsx)(y.__experimentalSpacer,{marginBottom:4,marginTop:-2,children:(0,oe.jsx)(y.__experimentalHStack,{align:"center",justify:"center",className:"edit-site-global-styles__shadow-preview-panel",children:(0,oe.jsx)("div",{className:"edit-site-global-styles__shadow-preview-block",style:t})})})}function ym({shadow:e,onChange:t}){const n=(0,d.useRef)(),s=(0,d.useMemo)((()=>function(e){return(e.match(/(?:[^,(]|\([^)]*\))+/g)||[]).map((e=>e.trim()))}(e)),[e]);return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(y.__experimentalVStack,{spacing:2,children:(0,oe.jsxs)(y.__experimentalHStack,{justify:"space-between",children:[(0,oe.jsx)(y.Flex,{align:"center",className:"edit-site-global-styles__shadows-panel__title",children:(0,oe.jsx)(Rl,{level:3,children:(0,b.__)("Shadows")})}),(0,oe.jsx)(y.FlexItem,{className:"edit-site-global-styles__shadows-panel__options-container",children:(0,oe.jsx)(y.Button,{size:"small",icon:_f,label:(0,b.__)("Add shadow"),onClick:()=>{t([...s,lm].join(", "))},ref:n})})]})}),(0,oe.jsx)(y.__experimentalSpacer,{}),(0,oe.jsx)(y.__experimentalItemGroup,{isBordered:!0,isSeparated:!0,children:s.map(((e,i)=>(0,oe.jsx)(bm,{shadow:e,onChange:e=>((e,n)=>{const i=[...s];i[e]=n,t(i.join(", "))})(i,e),canRemove:s.length>1,onRemove:()=>(e=>{t(s.filter(((t,n)=>n!==e)).join(", ")),n.current.focus()})(i)},i)))})]})}function bm({shadow:e,onChange:t,canRemove:n,onRemove:s}){const i=(0,d.useMemo)((()=>function(e){const t={x:"0",y:"0",blur:"0",spread:"0",color:"#000",inset:!1};if(!e)return t;if(e.includes("none"))return t;const n=/((?:^|\s+)(-?\d*\.?\d+(?:px|%|in|cm|mm|em|rem|ex|pt|pc|vh|vw|vmin|vmax|ch|lh)?)(?=\s|$)(?![^(]*\))){1,4}/g,s=e.match(n)||[];if(1!==s.length)return t;const i=s[0].split(" ").map((e=>e.trim())).filter((e=>e));if(i.length<2)return t;const r=e.match(/inset/gi)||[];if(r.length>1)return t;const o=1===r.length;let a=e.replace(n,"").trim();o&&(a=a.replace("inset","").replace("INSET","").trim());let l=(a.match(/^#([0-9a-f]{3}){1,2}$|^#([0-9a-f]{4}){1,2}$|^(?:rgb|hsl)a?\(?[\d*\.?\d+%?,?\/?\s]*\)$/gi)||[]).map((e=>e?.trim())).filter((e=>e));if(l.length>1)return t;if(0===l.length&&(l=a.trim().split(" ").filter((e=>e)),l.length>1))return t;const[c,u,d,h]=i;return{x:c,y:u,blur:d||t.blur,spread:h||t.spread,inset:o,color:a||t.color}}(e)),[e]),r=e=>{t(function(e){const t=`${e.x||"0px"} ${e.y||"0px"} ${e.blur||"0px"} ${e.spread||"0px"}`;return`${e.inset?"inset":""} ${t} ${e.color||""}`.trim()}(e))};return(0,oe.jsx)(y.Dropdown,{popoverProps:{placement:"left-start",offset:36,shift:!0},className:"edit-site-global-styles__shadow-editor__dropdown",renderToggle:({onToggle:e,isOpen:t})=>{const r={onClick:e,className:Ut("edit-site-global-styles__shadow-editor__dropdown-toggle",{"is-open":t}),"aria-expanded":t},o={onClick:()=>{t&&e(),s()},className:Ut("edit-site-global-styles__shadow-editor__remove-button",{"is-open":t}),label:(0,b.__)("Remove shadow")};return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(y.Button,{__next40pxDefaultSize:!0,icon:qa,...r,children:i.inset?(0,b.__)("Inner shadow"):(0,b.__)("Drop shadow")}),n&&(0,oe.jsx)(y.Button,{size:"small",icon:hm,...o})]})},renderContent:()=>(0,oe.jsx)(y.__experimentalDropdownContentWrapper,{paddingSize:"medium",className:"edit-site-global-styles__shadow-editor__dropdown-content",children:(0,oe.jsx)(wm,{shadowObj:i,onChange:r})})})}function wm({shadowObj:e,onChange:t}){const n=(n,s)=>{const i={...e,[n]:s};t(i)};return(0,oe.jsxs)(y.__experimentalVStack,{spacing:4,className:"edit-site-global-styles__shadow-editor-panel",children:[(0,oe.jsx)(y.ColorPalette,{clearable:!1,enableAlpha:!0,__experimentalIsRenderedInSidebar:!0,value:e.color,onChange:e=>n("color",e)}),(0,oe.jsxs)(y.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,value:e.inset?"inset":"outset",isBlock:!0,onChange:e=>n("inset","inset"===e),hideLabelFromVision:!0,__next40pxDefaultSize:!0,children:[(0,oe.jsx)(y.__experimentalToggleGroupControlOption,{value:"outset",label:(0,b.__)("Outset")}),(0,oe.jsx)(y.__experimentalToggleGroupControlOption,{value:"inset",label:(0,b.__)("Inset")})]}),(0,oe.jsxs)(y.__experimentalGrid,{columns:2,gap:4,children:[(0,oe.jsx)(_m,{label:(0,b.__)("X Position"),value:e.x,onChange:e=>n("x",e)}),(0,oe.jsx)(_m,{label:(0,b.__)("Y Position"),value:e.y,onChange:e=>n("y",e)}),(0,oe.jsx)(_m,{label:(0,b.__)("Blur"),value:e.blur,onChange:e=>n("blur",e)}),(0,oe.jsx)(_m,{label:(0,b.__)("Spread"),value:e.spread,onChange:e=>n("spread",e)})]})]})}function _m({label:e,value:t,onChange:n}){return(0,oe.jsx)(y.__experimentalUnitControl,{label:e,__next40pxDefaultSize:!0,value:t,onChange:e=>{const t=void 0!==e&&!isNaN(parseFloat(e));n(t?e:"0px")}})}function jm(){return(0,oe.jsx)(cm,{})}function Sm(){return(0,oe.jsx)(vm,{})}const{useGlobalStyle:Cm,useGlobalSetting:km,useSettingsForBlockElement:Em,DimensionsPanel:Pm}=te(x.privateApis),Im={contentSize:!0,wideSize:!0,padding:!0,margin:!0,blockGap:!0,minHeight:!0,childLayout:!1};function Tm(){const[e]=Cm("",void 0,"user",{shouldDecodeEncode:!1}),[t,n]=Cm("",void 0,"all",{shouldDecodeEncode:!1}),[s]=km("",void 0,"user"),[i,r]=km(""),o=Em(i),a=(0,d.useMemo)((()=>({...t,layout:o.layout})),[t,o.layout]),l=(0,d.useMemo)((()=>({...e,layout:s.layout})),[e,s.layout]);return(0,oe.jsx)(Pm,{inheritedValue:a,value:l,onChange:e=>{const t={...e};if(delete t.layout,n(t),e.layout!==s.layout){const t={...s,layout:e.layout};t.layout?.definitions&&delete t.layout.definitions,r(t)}},settings:o,includeLayoutControls:!0,defaultControls:Im})}const{useHasDimensionsPanel:Om,useGlobalSetting:Am,useSettingsForBlockElement:Nm}=te(x.privateApis);const Mm=function(){const[e]=Am(""),t=Nm(e),n=Om(t);return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(Cl,{title:(0,b.__)("Layout")}),n&&(0,oe.jsx)(Tm,{})]})},{GlobalStylesContext:Fm}=te(x.privateApis);function Vm({gap:e=2}){const{user:t}=(0,d.useContext)(Fm),n=t?.styles,s=(0,l.useSelect)((e=>e(_.store).__experimentalGetCurrentThemeGlobalStylesVariations()),[]),i=s?.filter((e=>!vc(e,["color"])&&!vc(e,["typography","spacing"]))),r=(0,d.useMemo)((()=>[...[{title:(0,b.__)("Default"),settings:{},styles:{}},...null!=i?i:[]].map((e=>{var t;const s={...e?.styles?.blocks}||{};n?.blocks&&Object.keys(n.blocks).forEach((e=>{if(n.blocks[e].css){const t=s[e]||{},i={css:`${s[e]?.css||""} ${n.blocks[e].css.trim()||""}`};s[e]={...t,...i}}}));const i=n?.css||e.styles?.css?{css:`${e.styles?.css||""} ${n?.css||""}`}:{},r=Object.keys(s).length>0?{blocks:s}:{},o={...e.styles,...i,...r};return{...e,settings:null!==(t=e.settings)&&void 0!==t?t:{},styles:o}}))]),[i,n?.blocks,n?.css]);return!i||i?.length<1?null:(0,oe.jsx)(y.__experimentalGrid,{columns:2,className:"edit-site-global-styles-style-variations-container",gap:e,children:r.map(((e,t)=>(0,oe.jsx)(wc,{variation:e,children:t=>(0,oe.jsx)(xl,{label:e?.title,withHoverView:!0,isFocused:t,variation:e})},t)))})}function Rm(){return(0,oe.jsxs)(y.__experimentalVStack,{spacing:10,className:"edit-site-global-styles-variation-container",children:[(0,oe.jsx)(Vm,{gap:3}),(0,oe.jsx)(zf,{title:(0,b.__)("Palettes"),gap:3}),(0,oe.jsx)(_c,{title:(0,b.__)("Typography"),gap:3})]})}const{useZoomOut:Bm}=te(x.privateApis);const Dm=function(){const e=(0,l.useSelect)((e=>e(x.store).getSettings().isPreviewMode),[]),{setDeviceType:t}=(0,l.useDispatch)(h.store);return Bm(!e),(0,d.useEffect)((()=>{t("desktop")}),[t]),(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(Cl,{title:(0,b.__)("Browse styles"),description:(0,b.__)("Choose a variation to change the look of the site.")}),(0,oe.jsx)(y.Card,{size:"small",isBorderless:!0,className:"edit-site-global-styles-screen-style-variations",children:(0,oe.jsx)(y.CardBody,{children:(0,oe.jsx)(Rm,{})})})]})},Lm=window.wp.mediaUtils,zm=[{slug:"theme-colors",title:(0,b.__)("Theme Colors"),origin:"theme",type:"colors"},{slug:"theme-gradients",title:(0,b.__)("Theme Gradients"),origin:"theme",type:"gradients"},{slug:"custom-colors",title:(0,b.__)("Custom Colors"),origin:"custom",type:"colors"},{slug:"custom-gradients",title:(0,b.__)("Custom Gradients"),origin:"custom",type:"gradients"},{slug:"duotones",title:(0,b.__)("Duotones"),origin:"theme",type:"duotones"},{slug:"default-colors",title:(0,b.__)("Default Colors"),origin:"default",type:"colors"},{slug:"default-gradients",title:(0,b.__)("Default Gradients"),origin:"default",type:"gradients"}],Gm=[{slug:"site-identity",title:(0,b.__)("Site Identity"),blocks:["core/site-logo","core/site-title","core/site-tagline"]},{slug:"design",title:(0,b.__)("Design"),blocks:["core/navigation","core/avatar","core/post-time-to-read"],exclude:["core/home-link","core/navigation-link"]},{slug:"posts",title:(0,b.__)("Posts"),blocks:["core/post-title","core/post-excerpt","core/post-author","core/post-author-name","core/post-author-biography","core/post-date","core/post-terms","core/term-description","core/query-title","core/query-no-results","core/query-pagination","core/query-numbers"]},{slug:"comments",title:(0,b.__)("Comments"),blocks:["core/comments-title","core/comments-pagination","core/comments-pagination-numbers","core/comments","core/comments-author-name","core/comment-content","core/comment-date","core/comment-edit-link","core/comment-reply-link","core/comment-template","core/post-comments-count","core/post-comments-link"]}],Hm=[{slug:"overview",title:(0,b.__)("Overview"),blocks:[]},{slug:"text",title:(0,b.__)("Text"),blocks:["core/post-content","core/home-link","core/navigation-link"]},{slug:"colors",title:(0,b.__)("Colors"),blocks:[]},{slug:"theme",title:(0,b.__)("Theme"),subcategories:Gm},{slug:"media",title:(0,b.__)("Media"),blocks:["core/post-featured-image"]},{slug:"widgets",title:(0,b.__)("Widgets"),blocks:[]},{slug:"embed",title:(0,b.__)("Embeds"),include:[]}],Um=[...Gm,{slug:"media",title:(0,b.__)("Media"),blocks:["core/post-featured-image"]},{slug:"widgets",title:(0,b.__)("Widgets"),blocks:[]},{slug:"embed",title:(0,b.__)("Embeds"),include:[]}],Wm=[{slug:"overview",title:(0,b.__)("Overview"),blocks:[]},{slug:"text",title:(0,b.__)("Text"),blocks:["core/post-content","core/home-link","core/navigation-link"]},{slug:"colors",title:(0,b.__)("Colors"),blocks:[]},{slug:"blocks",title:(0,b.__)("All Blocks"),blocks:[],subcategories:Um}];function qm(e,t){var n;if(!e?.slug||!t?.length)return;const s=null!==(n=e?.subcategories)&&void 0!==n?n:[];if(s.length)return s.reduce(((e,n)=>{const s=qm(n,t);return s&&(e.subcategories||(e.subcategories=[]),e.subcategories=[...e.subcategories,s]),e}),{title:e.title,slug:e.slug});const i=e?.blocks||[],r=e?.exclude||[],o=t.filter((t=>!r.includes(t.name)&&(t.category===e.slug||i.includes(t.name))));return o.length?{title:e.title,slug:e.slug,examples:o}:void 0}function Zm(){const e=[...Gm,...Hm].map((({slug:e})=>e)),t=(0,o.getCategories)().filter((({slug:t})=>!e.includes(t)));return[...Hm,...t]}const Km=({colors:e,type:t,templateColumns:n="1fr 1fr",itemHeight:s="52px"})=>e?(0,oe.jsx)(y.__experimentalGrid,{templateColumns:n,rowGap:8,columnGap:16,children:e.map((e=>{const n="gradients"===t?(0,x.__experimentalGetGradientClass)(e.slug):(0,x.getColorClassName)("background-color",e.slug),i=Ut("edit-site-style-book__color-example",n);return(0,oe.jsx)(Yt.View,{className:i,style:{height:s}},e.slug)}))}):null,Ym=({duotones:e})=>e?(0,oe.jsx)(y.__experimentalGrid,{columns:2,rowGap:16,columnGap:16,children:e.map((e=>(0,oe.jsxs)(y.__experimentalGrid,{className:"edit-site-style-book__duotone-example",columns:2,rowGap:8,columnGap:8,children:[(0,oe.jsx)(Yt.View,{children:(0,oe.jsx)("img",{alt:`Duotone example: ${e.slug}`,src:"https://s.w.org/images/core/5.3/MtBlanc1.jpg",style:{filter:`url(#wp-duotone-${e.slug})`}})}),e.colors.map((e=>(0,oe.jsx)(Yt.View,{className:"edit-site-style-book__color-example",style:{backgroundColor:e}},e)))]},e.slug)))}):null;function Xm(e){const t=(0,o.getBlockTypes)().filter((e=>{const{name:t,example:n,supports:s}=e;return"core/heading"!==t&&!!n&&!1!==s?.inserter})).map((e=>({name:e.name,title:e.title,category:e.category,blocks:(0,o.getBlockFromExample)(e.name,{...e.example,attributes:{...e.example.attributes,style:void 0}})})));if(!!!(0,o.getBlockType)("core/heading"))return t;const n={name:"core/heading",title:(0,b.__)("Headings"),category:"text",blocks:[1,2,3,4,5,6].map((e=>(0,o.createBlock)("core/heading",{content:(0,b.sprintf)((0,b.__)("Heading %d"),e),level:e})))},s=function(e){if(!e)return[];const t=[];return zm.forEach((n=>{const s=e[n.type],i=Array.isArray(s)?s.find((e=>e.slug===n.origin)):void 0;if(i?.[n.type]){const e={name:n.slug,title:n.title,category:"colors"};"duotones"===n.type?(e.content=(0,oe.jsx)(Ym,{duotones:i[n.type]}),t.push(e)):(e.content=(0,oe.jsx)(Km,{colors:i[n.type],type:n.type}),t.push(e))}})),t}(e),i=function(e){const t=[],n=Array.isArray(e?.colors)?e.colors.find((e=>"theme"===e.slug)):void 0;if(n){const e={name:"theme-colors",title:(0,b.__)("Colors"),category:"overview",content:(0,oe.jsx)(Km,{colors:n.colors,type:"colors",templateColumns:"repeat(auto-fill, minmax( 200px, 1fr ))",itemHeight:"32px"})};t.push(e)}const s=[];if((0,o.getBlockType)("core/heading")){const e=(0,o.createBlock)("core/heading",{content:(0,b.__)("AaBbCcDdEeFfGgHhiiJjKkLIMmNnOoPpQakRrssTtUuVVWwXxxYyZzOl23356789X{(…)},2!*&:/A@HELFO™"),level:1});s.push(e)}if((0,o.getBlockType)("core/paragraph")){const e=(0,o.createBlock)("core/paragraph",{content:(0,b.__)("A paragraph in a website refers to a distinct block of text that is used to present and organize information. It is a fundamental unit of content in web design and is typically composed of a group of related sentences or thoughts focused on a particular topic or idea. Paragraphs play a crucial role in improving the readability and user experience of a website. They break down the text into smaller, manageable chunks, allowing readers to scan the content more easily.")}),t=(0,o.createBlock)("core/paragraph",{content:(0,b.__)("Additionally, paragraphs help structure the flow of information and provide logical breaks between different concepts or pieces of information. In terms of formatting, paragraphs in websites are commonly denoted by a vertical gap or indentation between each block of text. This visual separation helps visually distinguish one paragraph from another, creating a clear and organized layout that guides the reader through the content smoothly.")});if((0,o.getBlockType)("core/group")){const n=(0,o.createBlock)("core/group",{layout:{type:"grid",columnCount:2,minimumColumnWidth:"12rem"},style:{spacing:{blockGap:"1.5rem"}}},[e,t]);s.push(n)}else s.push(e)}return s.length&&t.push({name:"typography",title:(0,b.__)("Typography"),category:"overview",blocks:s}),["core/image","core/separator","core/buttons","core/pullquote","core/search"].forEach((e=>{const n=(0,o.getBlockType)(e);if(n&&n.example){const s={name:e,title:n.title,category:"overview",blocks:(0,o.getBlockFromExample)(e,{...n.example,attributes:{...n.example.attributes,style:void 0}})};t.push(s)}})),t}(e);return[n,...s,...t,...i]}function Jm({title:e,subTitle:t,actions:n}){return(0,oe.jsxs)(y.__experimentalVStack,{className:"edit-site-page-header",as:"header",spacing:0,children:[(0,oe.jsxs)(y.__experimentalHStack,{className:"edit-site-page-header__page-title",children:[(0,oe.jsx)(y.__experimentalHeading,{as:"h2",level:3,weight:500,className:"edit-site-page-header__title",truncate:!0,children:e}),(0,oe.jsx)(y.FlexItem,{className:"edit-site-page-header__actions",children:n})]}),t&&(0,oe.jsx)(y.__experimentalText,{variant:"muted",as:"p",className:"edit-site-page-header__sub-title",children:t})]})}const{NavigableRegion:Qm}=te(h.privateApis);function $m({title:e,subTitle:t,actions:n,children:s,className:i,hideTitleFromUI:r=!1}){const o=Ut("edit-site-page",i);return(0,oe.jsx)(Qm,{className:o,ariaLabel:e,children:(0,oe.jsxs)("div",{className:"edit-site-page-content",children:[!r&&e&&(0,oe.jsx)(Jm,{title:e,subTitle:t,actions:n}),s]})})}const{useLocation:eg,useHistory:tg}=te(Gt.privateApis),ng=({isStyleBookOpened:e,setIsStyleBookOpened:t,path:n})=>{const s=tg();return(0,oe.jsx)(y.Button,{isPressed:e,icon:Ba,label:(0,b.__)("Style Book"),onClick:()=>{t(!e);const i=e?(0,Qt.removeQueryArgs)(n,"preview"):(0,Qt.addQueryArgs)(n,{preview:"stylebook"});s.navigate(i)},size:"compact"})},sg=()=>{const{path:e,query:t}=eg(),n=tg();return(0,d.useMemo)((()=>{var s;return[null!==(s=t.section)&&void 0!==s?s:"/",t=>{n.navigate((0,Qt.addQueryArgs)(e,{section:t}))}]}),[e,t.section,n])};function ig(){const{path:e}=eg(),[t,n]=(0,d.useState)(e.includes("preview=stylebook")),s=(0,v.useViewportMatch)("medium","<"),[i,r]=sg();return(0,oe.jsx)(oe.Fragment,{children:(0,oe.jsx)($m,{actions:s?null:(0,oe.jsx)(ng,{isStyleBookOpened:t,setIsStyleBookOpened:n,path:e}),className:"edit-site-styles",title:(0,b.__)("Styles"),children:(0,oe.jsx)(Qg,{path:i,onPathChange:r})})})}const{ExperimentalBlockEditorProvider:rg,useGlobalStyle:og,GlobalStylesContext:ag,useGlobalStylesOutputWithConfig:lg}=te(x.privateApis),{mergeBaseAndUserConfigs:cg}=te(h.privateApis),{Tabs:ug}=te(y.privateApis);function dg(e){return!e||0===Object.keys(e).length}const hg=(e,t)=>{if(!e||!t||!t?.contentDocument)return;const n="top"===e?t.contentDocument.body:t.contentDocument.getElementById(e);n&&n.scrollIntoView({behavior:"smooth"})},pg=e=>e&&"string"==typeof e&&("/"===e||e.startsWith("/typography")||e.startsWith("/colors")||e.startsWith("/blocks"))?{top:!0}:null;function fg(){const{colors:e,gradients:t}=(0,x.__experimentalUseMultipleOriginColorsAndGradients)(),[n,s,i,r]=(0,x.useSettings)("color.defaultDuotone","color.duotone.custom","color.duotone.theme","color.duotone.default");return(0,d.useMemo)((()=>{const o={colors:e,gradients:t,duotones:[]};return i&&i.length&&o.duotones.push({name:(0,b._x)("Theme","Indicates these duotone filters come from the theme."),slug:"theme",duotones:i}),n&&r&&r.length&&o.duotones.push({name:(0,b._x)("Default","Indicates these duotone filters come from WordPress."),slug:"default",duotones:r}),s&&s.length&&o.duotones.push({name:(0,b._x)("Custom","Indicates these doutone filters are created by the user."),slug:"custom",duotones:s}),o}),[e,t,s,i,r,n])}function mg(e){const t=[],n=qm({slug:"overview"},e);t.push(...n.examples);const s=e.filter((e=>"overview"!==e.category&&!n.examples.find((t=>t.name===e.name))));return t.push(...s),t}const gg=({userConfig:e={},isStatic:t=!1})=>{const n=(0,l.useSelect)((e=>e(zt).getSettings()),[]),s=(0,l.useSelect)((e=>e(_.store).canUser("create",{kind:"root",name:"media"})),[]);(0,d.useEffect)((()=>{(0,l.dispatch)(x.store).updateSettings({...n,mediaUpload:s?Lm.uploadMedia:void 0})}),[n,s]);const[i,r]=sg(),[o,a]=(0,v.useResizeObserver)(),c=Xm(fg()),u=mg(c);let h=null;if(i.includes("/colors"))h="colors";else if(i.includes("/typography"))h="text";else if(i.includes("/blocks")){h="blocks";const e=decodeURIComponent(i).split("/blocks/")[1];e&&c.find((t=>t.name===e))&&(h=e)}else t||(h="overview");const p=Wm.find((e=>e.slug===h)),f=p?qm(p,c):{examples:[c.find((e=>e.name===h))]},m=h?f:{examples:u},{base:g}=(0,d.useContext)(ag),y=pg(i),b=(0,d.useMemo)((()=>dg(e)||dg(g)?{}:cg(g,e)),[g,e]),[w]=lg(b),j=(0,d.useMemo)((()=>({...n,styles:dg(w)||dg(e)?n.styles:w,isPreviewMode:!0})),[w,n,e]);return(0,oe.jsxs)("div",{className:"edit-site-style-book",children:[o,(0,oe.jsxs)(x.BlockEditorProvider,{settings:j,children:[(0,oe.jsx)(ka,{disableRootPadding:!0}),(0,oe.jsx)(vg,{examples:m,settings:j,goTo:y,sizes:a,isSelected:t?null:e=>i===`/blocks/${encodeURIComponent(e)}`||i.startsWith(`/blocks/${encodeURIComponent(e)}/`),onSelect:t?null:e=>{zm.find((t=>t.slug===e))?r("/colors/palette"):r("typography"!==e?`/blocks/${encodeURIComponent(e)}`:"/typography")}})]})]})},vg=({examples:e,isSelected:t,onClick:n,onSelect:s,settings:i,sizes:r,title:o,goTo:a})=>{const[l,c]=(0,d.useState)(!1),[u,h]=(0,d.useState)(!1),p=(0,d.useRef)(null),f={role:"button",onFocus:()=>c(!0),onBlur:()=>c(!1),onKeyDown:e=>{if(e.defaultPrevented)return;const{keyCode:t}=e;!n||t!==Jt.ENTER&&t!==Jt.SPACE||(e.preventDefault(),n(e))},onClick:e=>{e.defaultPrevented||n&&(e.preventDefault(),n(e))},readonly:!0};return(0,d.useLayoutEffect)((()=>{u&&p?.current&&a?.top&&hg("top",p?.current)}),[p?.current,a,hg,u]),(0,oe.jsxs)(x.__unstableIframe,{onLoad:()=>h(!0),ref:p,className:Ut("edit-site-style-book__iframe",{"is-focused":l&&!!n,"is-button":!!n}),name:"style-book-canvas",tabIndex:0,...n?f:{},children:[(0,oe.jsx)(x.__unstableEditorStyles,{styles:i.styles}),(0,oe.jsxs)("style",{children:['\n\tbody {\n\t\tposition: relative;\n\t\tpadding: 32px !important;\n\t}\n\n\t\n\t.is-root-container {\n\t\tdisplay: flow-root;\n\t}\n\n\n\t.edit-site-style-book__examples {\n\t\tmax-width: 1200px;\n\t\tmargin: 0 auto;\n\t}\n\n\t.edit-site-style-book__example {\n\t max-width: 900px;\n\t\tborder-radius: 2px;\n\t\tcursor: pointer;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tgap: 40px;\n\t\tpadding: 16px;\n\t\twidth: 100%;\n\t\tbox-sizing: border-box;\n\t\tscroll-margin-top: 32px;\n\t\tscroll-margin-bottom: 32px;\n\t\tmargin: 0 auto 40px auto;\n\t}\n\n\t.edit-site-style-book__example.is-selected {\n\t\tbox-shadow: 0 0 0 1px var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba));\n\t}\n\n\t.edit-site-style-book__example.is-disabled-example {\n\t\tpointer-events: none;\n\t}\n\n\t.edit-site-style-book__example:focus:not(:disabled) {\n\t\tbox-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba));\n\t\toutline: 3px solid transparent;\n\t}\n\n\t.edit-site-style-book__duotone-example > div:first-child {\n\t\tdisplay: flex;\n\t\taspect-ratio: 16 / 9;\n\t\tgrid-row: span 1;\n\t\tgrid-column: span 2;\n\t}\n\t.edit-site-style-book__duotone-example img {\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tobject-fit: cover;\n\t}\n\t.edit-site-style-book__duotone-example > div:not(:first-child) {\n\t\theight: 20px;\n\t\tborder: 1px solid color-mix( in srgb, currentColor 10%, transparent );\n\t}\n\n\t.edit-site-style-book__color-example {\n\t\tborder: 1px solid color-mix( in srgb, currentColor 10%, transparent );\n\t}\n\n\t.edit-site-style-book__subcategory-title,\n\t.edit-site-style-book__example-title {\n\t\tfont-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;\n\t\tfont-size: 13px;\n\t\tfont-weight: normal;\n\t\tline-height: normal;\n\t\tmargin: 0;\n\t\ttext-align: left;\n\t\tpadding-top: 8px;\n\t\tborder-top: 1px solid color-mix( in srgb, currentColor 10%, transparent );\n\t\tcolor: color-mix( in srgb, currentColor 60%, transparent );\n\t}\n\n\t.edit-site-style-book__subcategory-title {\n\t\tfont-size: 16px;\n\t\tmargin-bottom: 40px;\n \tpadding-bottom: 8px;\n\t}\n\n\t.edit-site-style-book__example-preview {\n\t\twidth: 100%;\n\t}\n\n\t.edit-site-style-book__example-preview .block-editor-block-list__insertion-point,\n\t.edit-site-style-book__example-preview .block-list-appender {\n\t\tdisplay: none;\n\t}\n\t:where(.is-root-container > .wp-block:first-child) {\n\t\tmargin-top: 0;\n\t}\n\t:where(.is-root-container > .wp-block:last-child) {\n\t\tmargin-bottom: 0;\n\t}\n',!!n&&"body { cursor: pointer; } body * { pointer-events: none; }"]}),(0,oe.jsx)(xg,{className:Ut("edit-site-style-book__examples",{"is-wide":r.width>600}),filteredExamples:e,label:o?(0,b.sprintf)((0,b.__)("Examples of blocks in the %s category"),o):(0,b.__)("Examples of blocks"),isSelected:t,onSelect:s},o)]})},xg=(0,d.memo)((({className:e,filteredExamples:t,label:n,isSelected:s,onSelect:i})=>(0,oe.jsxs)(y.Composite,{orientation:"vertical",className:e,"aria-label":n,role:"grid",children:[!!t?.examples?.length&&t.examples.map((e=>(0,oe.jsx)(wg,{id:`example-${e.name}`,title:e.title,content:e.content,blocks:e.blocks,isSelected:s?.(e.name),onClick:i?()=>i(e.name):null},e.name))),!!t?.subcategories?.length&&t.subcategories.map((e=>(0,oe.jsxs)(y.Composite.Group,{className:"edit-site-style-book__subcategory",children:[(0,oe.jsx)(y.Composite.GroupLabel,{children:(0,oe.jsx)("h2",{className:"edit-site-style-book__subcategory-title",children:e.title})}),(0,oe.jsx)(yg,{examples:e.examples,isSelected:s,onSelect:i})]},`subcategory-${e.slug}`)))]}))),yg=({examples:e,isSelected:t,onSelect:n})=>!!e?.length&&e.map((e=>(0,oe.jsx)(wg,{id:`example-${e.name}`,title:e.title,content:e.content,blocks:e.blocks,isSelected:t?.(e.name),onClick:n?()=>n(e.name):null},e.name))),bg=["example-duotones"],wg=({id:e,title:t,blocks:n,isSelected:s,onClick:i,content:r})=>{const o=(0,l.useSelect)((e=>e(x.store).getSettings()),[]),a=(0,d.useMemo)((()=>({...o,focusMode:!1,isPreviewMode:!0})),[o]),c=(0,d.useMemo)((()=>Array.isArray(n)?n:[n]),[n]),u=bg.includes(e)||!i?{disabled:!0,accessibleWhenDisabled:!!i}:{};return(0,oe.jsx)("div",{role:"row",children:(0,oe.jsx)("div",{role:"gridcell",children:(0,oe.jsxs)(y.Composite.Item,{className:Ut("edit-site-style-book__example",{"is-selected":s,"is-disabled-example":!!u?.disabled}),id:e,"aria-label":i?(0,b.sprintf)((0,b.__)("Open %s styles in Styles panel"),t):void 0,render:(0,oe.jsx)("div",{}),role:i?"button":null,onClick:i,...u,children:[(0,oe.jsx)("span",{className:"edit-site-style-book__example-title",children:t}),(0,oe.jsx)("div",{className:"edit-site-style-book__example-preview","aria-hidden":!0,children:(0,oe.jsx)(y.Disabled,{className:"edit-site-style-book__example-preview__content",children:r||(0,oe.jsxs)(rg,{value:c,settings:a,children:[(0,oe.jsx)(x.__unstableEditorStyles,{}),(0,oe.jsx)(x.BlockList,{renderAppender:!1})]})})})]})})})},_g=function({enableResizing:e=!0,isSelected:t,onClick:n,onSelect:s,showCloseButton:i=!0,onClose:r,showTabs:o=!0,userConfig:a={},path:c=""}){const[u,h]=(0,v.useResizeObserver)(),[p]=og("color.text"),[f]=og("color.background"),m=fg(),g=(0,d.useMemo)((()=>Xm(m)),[m]),y=(0,d.useMemo)((()=>Zm().filter((e=>g.some((t=>t.category===e.slug))))),[g]),w=mg(g),{base:_}=(0,d.useContext)(ag),j=pg(c),S=(0,d.useMemo)((()=>dg(a)||dg(_)?{}:cg(_,a)),[_,a]),C=(0,l.useSelect)((e=>e(x.store).getSettings()),[]),[k]=lg(S),E=(0,d.useMemo)((()=>({...C,styles:dg(k)||dg(a)?C.styles:k,isPreviewMode:!0})),[k,C,a]);return(0,oe.jsx)(Lo,{onClose:r,enableResizing:e,closeButtonLabel:i?(0,b.__)("Close"):null,children:(0,oe.jsxs)("div",{className:Ut("edit-site-style-book",{"is-wide":h.width>600,"is-button":!!n}),style:{color:p,background:f},children:[u,o?(0,oe.jsxs)(ug,{children:[(0,oe.jsx)("div",{className:"edit-site-style-book__tablist-container",children:(0,oe.jsx)(ug.TabList,{children:y.map((e=>(0,oe.jsx)(ug.Tab,{tabId:e.slug,children:e.title},e.slug)))})}),y.map((e=>{const n=e.slug?Zm().find((t=>t.slug===e.slug)):null,i=n?qm(n,g):{examples:g};return(0,oe.jsx)(ug.TabPanel,{tabId:e.slug,focusable:!1,className:"edit-site-style-book__tabpanel",children:(0,oe.jsx)(vg,{category:e.slug,examples:i,isSelected:t,onSelect:s,settings:E,sizes:h,title:e.title,goTo:j})},e.slug)}))]}):(0,oe.jsx)(vg,{examples:{examples:w},isSelected:t,onClick:n,onSelect:s,settings:E,sizes:h,goTo:j})]})})},{useGlobalStyle:jg,AdvancedPanel:Sg}=te(x.privateApis);const Cg=function(){const e=(0,b.__)("Add your own CSS to customize the appearance and layout of your site."),[t]=jg("",void 0,"user",{shouldDecodeEncode:!1}),[n,s]=jg("",void 0,"all",{shouldDecodeEncode:!1});return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(Cl,{title:(0,b.__)("CSS"),description:(0,oe.jsxs)(oe.Fragment,{children:[e,(0,oe.jsx)("br",{}),(0,oe.jsx)(y.ExternalLink,{href:(0,b.__)("https://developer.wordpress.org/advanced-administration/wordpress/css/"),className:"edit-site-global-styles-screen-css-help-link",children:(0,b.__)("Learn more about CSS")})]})}),(0,oe.jsx)("div",{className:"edit-site-global-styles-screen-css",children:(0,oe.jsx)(Sg,{value:t,onChange:s,inheritedValue:n})})]})},{ExperimentalBlockEditorProvider:kg,GlobalStylesContext:Eg,useGlobalStylesOutputWithConfig:Pg,__unstableBlockStyleVariationOverridesWithConfig:Ig}=te(x.privateApis),{mergeBaseAndUserConfigs:Tg}=te(h.privateApis);function Og(e){return!e||0===Object.keys(e).length}const Ag=function({userConfig:e,blocks:t}){const{base:n}=(0,d.useContext)(Eg),s=(0,d.useMemo)((()=>Og(e)||Og(n)?{}:Tg(n,e)),[n,e]),i=(0,d.useMemo)((()=>Array.isArray(t)?t:[t]),[t]),r=(0,l.useSelect)((e=>e(x.store).getSettings()),[]),o=(0,d.useMemo)((()=>({...r,isPreviewMode:!0})),[r]),[a]=Pg(s),c=Og(a)||Og(e)?o.styles:a;return(0,oe.jsx)(Lo,{title:(0,b.__)("Revisions"),closeButtonLabel:(0,b.__)("Close revisions"),enableResizing:!0,children:(0,oe.jsxs)(x.__unstableIframe,{className:"edit-site-revisions__iframe",name:"revisions",tabIndex:0,children:[(0,oe.jsx)("style",{children:".is-root-container { display: flow-root; }"}),(0,oe.jsx)(y.Disabled,{className:"edit-site-revisions__example-preview__content",children:(0,oe.jsxs)(kg,{value:i,settings:o,children:[(0,oe.jsx)(x.BlockList,{renderAppender:!1}),(0,oe.jsx)(x.__unstableEditorStyles,{styles:c}),(0,oe.jsx)(Ig,{config:s})]})})]})})},Ng=window.wp.date,{getGlobalStylesChanges:Mg}=te(x.privateApis);function Fg({revision:e,previousRevision:t}){const n=Mg(e,t,{maxResults:7});return n.length?(0,oe.jsx)("ul",{"data-testid":"global-styles-revision-changes",className:"edit-site-global-styles-screen-revisions__changes",children:n.map((e=>(0,oe.jsx)("li",{children:e},e)))}):null}const Vg=function({userRevisions:e,selectedRevisionId:t,onChange:n,canApplyRevision:s,onApplyRevision:i}){const{currentThemeName:r,currentUser:o}=(0,l.useSelect)((e=>{const{getCurrentTheme:t,getCurrentUser:n}=e(_.store),s=t();return{currentThemeName:s?.name?.rendered||s?.stylesheet,currentUser:n()}}),[]),a=(0,Ng.getDate)().getTime(),{datetimeAbbreviated:c}=(0,Ng.getSettings)().formats;return(0,oe.jsx)(y.Composite,{orientation:"vertical",className:"edit-site-global-styles-screen-revisions__revisions-list","aria-label":(0,b.__)("Global styles revisions list"),role:"listbox",children:e.map(((l,u)=>{const{id:d,author:h,modified:p}=l,f="unsaved"===d,m=f?o:h,g=m?.name||(0,b.__)("User"),v=m?.avatar_urls?.[48],x=t?t===d:0===u,w=!s&&x,_="parent"===d,j=(0,Ng.getDate)(p),S=p&&a-j.getTime()>864e5?(0,Ng.dateI18n)(c,j):(0,Ng.humanTimeDiff)(p),C=function(e,t,n,s){return"parent"===e?(0,b.__)("Reset the styles to the theme defaults"):"unsaved"===e?(0,b.sprintf)((0,b.__)("Unsaved changes by %s"),t):s?(0,b.sprintf)((0,b.__)("Changes saved by %1$s on %2$s. This revision matches current editor styles."),t,n):(0,b.sprintf)((0,b.__)("Changes saved by %1$s on %2$s"),t,n)}(d,g,(0,Ng.dateI18n)(c,j),w);return(0,oe.jsxs)(y.Composite.Item,{className:"edit-site-global-styles-screen-revisions__revision-item","aria-current":x,role:"option",onKeyDown:e=>{const{keyCode:t}=e;t!==Jt.ENTER&&t!==Jt.SPACE||n(l)},onClick:e=>{e.preventDefault(),n(l)},"aria-selected":x,"aria-label":C,render:(0,oe.jsx)("div",{}),children:[(0,oe.jsx)("span",{className:"edit-site-global-styles-screen-revisions__revision-item-wrapper",children:_?(0,oe.jsxs)("span",{className:"edit-site-global-styles-screen-revisions__description",children:[(0,b.__)("Default styles"),(0,oe.jsx)("span",{className:"edit-site-global-styles-screen-revisions__meta",children:r})]}):(0,oe.jsxs)("span",{className:"edit-site-global-styles-screen-revisions__description",children:[f?(0,oe.jsx)("span",{className:"edit-site-global-styles-screen-revisions__date",children:(0,b.__)("(Unsaved)")}):(0,oe.jsx)("time",{className:"edit-site-global-styles-screen-revisions__date",dateTime:p,children:S}),(0,oe.jsxs)("span",{className:"edit-site-global-styles-screen-revisions__meta",children:[(0,oe.jsx)("img",{alt:g,src:v}),g]}),x&&(0,oe.jsx)(Fg,{revision:l,previousRevision:un(1),accessibleWhenDisabled:!0,disabled:r||1===e,label:(0,b.__)("First page"),icon:(0,b.isRTL)()?ou:au,size:"compact"}),(0,oe.jsx)(y.Button,{variant:o,onClick:()=>n(e-1),accessibleWhenDisabled:!0,disabled:r||1===e,label:(0,b.__)("Previous page"),icon:(0,b.isRTL)()?Zo:Ko,size:"compact"})]}),(0,oe.jsx)(y.__experimentalText,{variant:"muted",children:(0,b.sprintf)((0,b._x)("%1$s of %2$s","paging"),e,t)}),(0,oe.jsxs)(y.__experimentalHStack,{expanded:!1,spacing:1,children:[(0,oe.jsx)(y.Button,{variant:o,onClick:()=>n(e+1),accessibleWhenDisabled:!0,disabled:r||e===t,label:(0,b.__)("Next page"),icon:(0,b.isRTL)()?Ko:Zo,size:"compact"}),(0,oe.jsx)(y.Button,{variant:o,onClick:()=>n(t),accessibleWhenDisabled:!0,disabled:r||e===t,label:(0,b.__)("Last page"),icon:(0,b.isRTL)()?au:ou,size:"compact"})]})]})}const{GlobalStylesContext:Bg,areGlobalStyleConfigsEqual:Dg}=te(x.privateApis);const Lg=function(){const{user:e,setUserConfig:t}=(0,d.useContext)(Bg),{blocks:n,editorCanvasContainerView:s}=(0,l.useSelect)((e=>({editorCanvasContainerView:te(e(zt)).getEditorCanvasContainerView(),blocks:e(x.store).getBlocks()})),[]),[i,r]=(0,d.useState)(1),[o,a]=(0,d.useState)([]),{revisions:c,isLoading:u,hasUnsavedChanges:h,revisionsCount:p}=ca({query:{per_page:10,page:i}}),f=Math.ceil(p/10),[m,g]=(0,d.useState)(e),[v,w]=(0,d.useState)(!1),{setEditorCanvasContainerView:_}=te((0,l.useDispatch)(zt)),j=Dg(m,e),S=()=>{_("global-styles-revisions:style-book"===s?"style-book":void 0)},C=e=>{t((()=>e)),w(!1),S()};(0,d.useEffect)((()=>{!u&&c.length&&a(c)}),[c,u]);const k=c[0],E=m?.id,P=!!k?.id&&!j&&!E;(0,d.useEffect)((()=>{P&&g(k)}),[P,k]);const I=!!E&&"unsaved"!==E&&!j,T=!!o.length;return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(Cl,{title:p&&(0,b.sprintf)((0,b.__)("Revisions (%s)"),p),description:(0,b.__)('Click on previously saved styles to preview them. To restore a selected version to the editor, hit "Apply." When you\'re ready, use the Save button to save your changes.'),onBack:S}),!T&&(0,oe.jsx)(y.Spinner,{className:"edit-site-global-styles-screen-revisions__loading"}),T&&("global-styles-revisions:style-book"===s?(0,oe.jsx)(_g,{userConfig:m,isSelected:()=>{},onClose:()=>{_("global-styles-revisions")}}):(0,oe.jsx)(Ag,{blocks:n,userConfig:m,closeButtonLabel:(0,b.__)("Close revisions")})),(0,oe.jsx)(Vg,{onChange:g,selectedRevisionId:E,userRevisions:o,canApplyRevision:I,onApplyRevision:()=>h?w(!0):C(m)}),f>1&&(0,oe.jsx)("div",{className:"edit-site-global-styles-screen-revisions__footer",children:(0,oe.jsx)(Rg,{className:"edit-site-global-styles-screen-revisions__pagination",currentPage:i,numPages:f,changePage:r,totalItems:p,disabled:u,label:(0,b.__)("Global Styles pagination")})}),v&&(0,oe.jsx)(y.__experimentalConfirmDialog,{isOpen:v,confirmButtonText:(0,b.__)("Apply"),onConfirm:()=>C(m),onCancel:()=>w(!1),size:"medium",children:(0,b.__)("Are you sure you want to apply this revision? Any unsaved changes will be lost.")})]})},{useGlobalStylesReset:zg}=te(x.privateApis),{Slot:Gg,Fill:Hg}=(0,y.createSlotFill)("GlobalStylesMenu");function Ug(){const[e,t]=zg(),{toggle:n}=(0,l.useDispatch)(f.store),{canEditCSS:s}=(0,l.useSelect)((e=>{const{getEntityRecord:t,__experimentalGetCurrentGlobalStylesId:n}=e(_.store),s=n(),i=s?t("root","globalStyles",s):void 0;return{canEditCSS:!!i?._links?.["wp:action-edit-css"]}}),[]),{setEditorCanvasContainerView:i}=te((0,l.useDispatch)(zt)),r=()=>{i("global-styles-css")};return(0,oe.jsx)(Hg,{children:(0,oe.jsx)(y.DropdownMenu,{icon:Da,label:(0,b.__)("More"),toggleProps:{size:"compact"},children:({onClose:i})=>(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsxs)(y.MenuGroup,{children:[s&&(0,oe.jsx)(y.MenuItem,{onClick:r,children:(0,b.__)("Additional CSS")}),(0,oe.jsx)(y.MenuItem,{onClick:()=>{n("core/edit-site","welcomeGuideStyles"),i()},children:(0,b.__)("Welcome Guide")})]}),(0,oe.jsx)(y.MenuGroup,{children:(0,oe.jsx)(y.MenuItem,{onClick:()=>{t(),i()},disabled:!e,children:(0,b.__)("Reset styles")})})]})})})}function Wg({className:e,...t}){return(0,oe.jsx)(y.Navigator.Screen,{className:["edit-site-global-styles-sidebar__navigator-screen",e].filter(Boolean).join(" "),...t})}function qg({parentMenu:e,blockStyles:t,blockName:n}){return t.map(((t,s)=>(0,oe.jsx)(Wg,{path:e+"/variations/"+t.name,children:(0,oe.jsx)(ic,{name:n,variation:t.name})},s)))}function Zg({name:e,parentMenu:t=""}){const n=(0,l.useSelect)((t=>{const{getBlockStyles:n}=t(o.store);return n(e)}),[e]);return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(Wg,{path:t+"/colors/palette",children:(0,oe.jsx)(Xf,{name:e})}),!!n?.length&&(0,oe.jsx)(qg,{parentMenu:t,blockStyles:n,blockName:e})]})}function Kg(){const e=(0,y.useNavigator)(),{path:t}=e.location;return(0,oe.jsx)(_g,{isSelected:e=>t===`/blocks/${encodeURIComponent(e)}`||t.startsWith(`/blocks/${encodeURIComponent(e)}/`),onSelect:t=>{zm.find((e=>e.slug===t))?e.goTo("/colors/palette"):"typography"!==t?e.goTo("/blocks/"+encodeURIComponent(t)):e.goTo("/typography")}})}function Yg(){const e=(0,y.useNavigator)(),{selectedBlockName:t,selectedBlockClientId:n}=(0,l.useSelect)((e=>{const{getSelectedBlockClientId:t,getBlockName:n}=e(x.store),s=t();return{selectedBlockName:n(s),selectedBlockClientId:s}}),[]),s=Al(t);(0,d.useEffect)((()=>{if(!n||!s)return;const i=e.location.path;if("/blocks"!==i&&!i.startsWith("/blocks/"))return;const r="/blocks/"+encodeURIComponent(t);r!==i&&e.goTo(r,{skipFocus:!0})}),[n,t,s])}function Xg(){const{goTo:e,location:t}=(0,y.useNavigator)(),n=(0,l.useSelect)((e=>te(e(zt)).getEditorCanvasContainerView()),[]),s=t?.path,i="/revisions"===s;(0,d.useEffect)((()=>{switch(n){case"global-styles-revisions":case"global-styles-revisions:style-book":i||e("/revisions");break;case"global-styles-css":e("/css");break;default:i&&e("/",{isBack:!0})}}),[n,i,e])}function Jg({path:e,onPathChange:t,children:n}){return function(e,t){const n=(0,y.useNavigator)(),{path:s}=n.location,i=(0,v.usePrevious)(e),r=(0,v.usePrevious)(s);(0,d.useEffect)((()=>{e!==s&&(e!==i?n.goTo(e):s!==r&&t(s))}),[t,e,r,i,s,n])}(e,t),n}const Qg=function({path:e,onPathChange:t}){const n=(0,o.getBlockTypes)(),s=(0,l.useSelect)((e=>te(e(zt)).getEditorCanvasContainerView()),[]);return(0,oe.jsxs)(y.Navigator,{className:"edit-site-global-styles-sidebar__navigator-provider",initialPath:"/",children:[e&&t&&(0,oe.jsx)(Jg,{path:e,onPathChange:t}),(0,oe.jsx)(Wg,{path:"/",children:(0,oe.jsx)(bl,{})}),(0,oe.jsx)(Wg,{path:"/variations",children:(0,oe.jsx)(Dm,{})}),(0,oe.jsx)(Wg,{path:"/blocks",children:(0,oe.jsx)(Fl,{})}),(0,oe.jsx)(Wg,{path:"/typography",children:(0,oe.jsx)(nf,{})}),(0,oe.jsx)(Wg,{path:"/typography/font-sizes",children:(0,oe.jsx)(Ef,{})}),(0,oe.jsx)(Wg,{path:"/typography/font-sizes/:origin/:slug",children:(0,oe.jsx)(wf,{})}),(0,oe.jsx)(Wg,{path:"/typography/text",children:(0,oe.jsx)(hf,{element:"text"})}),(0,oe.jsx)(Wg,{path:"/typography/link",children:(0,oe.jsx)(hf,{element:"link"})}),(0,oe.jsx)(Wg,{path:"/typography/heading",children:(0,oe.jsx)(hf,{element:"heading"})}),(0,oe.jsx)(Wg,{path:"/typography/caption",children:(0,oe.jsx)(hf,{element:"caption"})}),(0,oe.jsx)(Wg,{path:"/typography/button",children:(0,oe.jsx)(hf,{element:"button"})}),(0,oe.jsx)(Wg,{path:"/colors",children:(0,oe.jsx)(Rf,{})}),(0,oe.jsx)(Wg,{path:"/shadows",children:(0,oe.jsx)(jm,{})}),(0,oe.jsx)(Wg,{path:"/shadows/edit/:category/:slug",children:(0,oe.jsx)(Sm,{})}),(0,oe.jsx)(Wg,{path:"/layout",children:(0,oe.jsx)(Mm,{})}),(0,oe.jsx)(Wg,{path:"/css",children:(0,oe.jsx)(Cg,{})}),(0,oe.jsx)(Wg,{path:"/revisions",children:(0,oe.jsx)(Lg,{})}),(0,oe.jsx)(Wg,{path:"/background",children:(0,oe.jsx)(im,{})}),n.map((e=>(0,oe.jsx)(Wg,{path:"/blocks/"+encodeURIComponent(e.name),children:(0,oe.jsx)(ic,{name:e.name})},"menu-block-"+e.name))),(0,oe.jsx)(Zg,{}),n.map((e=>(0,oe.jsx)(Zg,{name:e.name,parentMenu:"/blocks/"+encodeURIComponent(e.name)},"screens-block-"+e.name))),"style-book"===s&&(0,oe.jsx)(Kg,{}),(0,oe.jsx)(Ug,{}),(0,oe.jsx)(Yg,{}),(0,oe.jsx)(Xg,{})]})},{ComplementaryArea:$g,ComplementaryAreaMoreMenuItem:ev}=te(h.privateApis);function tv({className:e,identifier:t,title:n,icon:s,children:i,closeLabel:r,header:o,headerClassName:a,panelClassName:l,isActiveByDefault:c}){return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)($g,{className:e,scope:"core",identifier:t,title:n,icon:s,closeLabel:r,header:o,headerClassName:a,panelClassName:l,isActiveByDefault:c,children:i}),(0,oe.jsx)(ev,{scope:"core",identifier:t,icon:s,children:n})]})}const{interfaceStore:nv}=te(h.privateApis),{useLocation:sv}=te(Gt.privateApis);function iv(){const{query:e}=sv(),{canvas:t="view",name:n}=e,{shouldClearCanvasContainerView:s,isStyleBookOpened:i,showListViewByDefault:r,hasRevisions:o,isRevisionsOpened:a,isRevisionsStyleBookOpened:c}=(0,l.useSelect)((e=>{const{getActiveComplementaryArea:n}=e(nv),{getEditorCanvasContainerView:s}=te(e(zt)),i=s(),r="visual"===e(h.store).getEditorMode(),o="edit"===t,a=e(f.store).get("core","showListViewByDefault"),{getEntityRecord:l,__experimentalGetCurrentGlobalStylesId:c}=e(_.store),u=c(),d=u?l("root","globalStyles",u):void 0;return{isStyleBookOpened:"style-book"===i,shouldClearCanvasContainerView:"edit-site/global-styles"!==n("core")||!r||!o,showListViewByDefault:a,hasRevisions:!!d?._links?.["version-history"]?.[0]?.count,isRevisionsStyleBookOpened:"global-styles-revisions:style-book"===i,isRevisionsOpened:"global-styles-revisions"===i}}),[t]),{setEditorCanvasContainerView:u}=te((0,l.useDispatch)(zt)),p=(0,v.useViewportMatch)("medium","<");(0,d.useEffect)((()=>{s&&u(void 0)}),[s,u]);const{setIsListViewOpened:m}=(0,l.useDispatch)(h.store),{getActiveComplementaryArea:g}=(0,l.useSelect)(nv),{enableComplementaryArea:x}=(0,l.useDispatch)(nv),w=(0,d.useRef)(null);return(0,d.useEffect)((()=>{"styles"===n&&"edit"===t?(w.current=g("core"),x("core","edit-site/global-styles")):w.current&&x("core",w.current)}),[n,x,t,g]),(0,oe.jsx)(tv,{className:"edit-site-global-styles-sidebar",identifier:"edit-site/global-styles",title:(0,b.__)("Styles"),icon:bo,closeLabel:(0,b.__)("Close Styles"),panelClassName:"edit-site-global-styles-sidebar__panel",header:(0,oe.jsxs)(y.Flex,{className:"edit-site-global-styles-sidebar__header",gap:1,children:[(0,oe.jsx)(y.FlexItem,{children:(0,oe.jsx)("h2",{className:"edit-site-global-styles-sidebar__header-title",children:(0,b.__)("Styles")})}),(0,oe.jsxs)(y.Flex,{justify:"flex-end",gap:1,className:"edit-site-global-styles-sidebar__header-actions",children:[!p&&(0,oe.jsx)(y.FlexItem,{children:(0,oe.jsx)(y.Button,{icon:Ba,label:(0,b.__)("Style Book"),isPressed:i||c,accessibleWhenDisabled:!0,disabled:s,onClick:()=>{a?u("global-styles-revisions:style-book"):c?u("global-styles-revisions"):(m(i&&r),u(i?void 0:"style-book"))},size:"compact"})}),(0,oe.jsx)(y.FlexItem,{children:(0,oe.jsx)(y.Button,{label:(0,b.__)("Revisions"),icon:Co,onClick:()=>{m(!1),u(c?"style-book":a?void 0:i?"global-styles-revisions:style-book":"global-styles-revisions")},accessibleWhenDisabled:!0,disabled:!o,isPressed:a||c,size:"compact"})}),(0,oe.jsx)(Gg,{})]})]}),children:(0,oe.jsx)(Qg,{})})}const rv=(0,oe.jsx)(Yt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Yt.Path,{d:"M18 11.3l-1-1.1-4 4V3h-1.5v11.3L7 10.2l-1 1.1 6.2 5.8 5.8-5.8zm.5 3.7v3.5h-13V15H4v5h16v-5h-1.5z"})}),ov=window.wp.blob;function av(){const{createErrorNotice:e}=(0,l.useDispatch)(w.store);return(0,oe.jsx)(y.MenuItem,{role:"menuitem",icon:rv,onClick:async function(){try{const e=await io()({path:"/wp-block-editor/v1/export",parse:!1,headers:{Accept:"application/zip"}}),t=await e.blob(),n=e.headers.get("content-disposition").match(/=(.+)\.zip/),s=n[1]?n[1]:"edit-site-export";(0,ov.downloadBlob)(s+".zip",t,"application/zip")}catch(t){let n={};try{n=await t.json()}catch(e){}const s=n.message&&"unknown_error"!==n.code?n.message:(0,b.__)("An error occurred while creating the site export.");e(s,{type:"snackbar"})}},info:(0,b.__)("Download your theme with updated templates and styles."),children:(0,b._x)("Export","site exporter menu item")})}function lv(){const{toggle:e}=(0,l.useDispatch)(f.store);return(0,oe.jsx)(y.MenuItem,{onClick:()=>e("core/edit-site","welcomeGuide"),children:(0,b.__)("Welcome Guide")})}const{ToolsMoreMenuGroup:cv,PreferencesModal:uv}=te(h.privateApis);function dv(){const e=(0,l.useSelect)((e=>e(_.store).getCurrentTheme().is_block_theme),[]);return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsxs)(cv,{children:[e&&(0,oe.jsx)(av,{}),(0,oe.jsx)(lv,{})]}),(0,oe.jsx)(uv,{})]})}const{useLocation:hv,useHistory:pv}=te(Gt.privateApis);const{useLocation:fv}=te(Gt.privateApis);const{getTemplateInfo:mv}=te(h.privateApis);const gv=function(e,t){const{title:n,isLoaded:s}=(0,l.useSelect)((n=>{var s;const{getEditedEntityRecord:i,hasFinishedResolution:r}=n(_.store);if(!t)return{isLoaded:!1};const o=i("postType",e,t),{default_template_types:a=[]}=null!==(s=n(_.store).getEntityRecord("root","__unstableBase"))&&void 0!==s?s:{},l=mv({template:o,templateTypes:a}),c=r("getEditedEntityRecord",["postType",e,t]);return{title:l.title,isLoaded:c}}),[e,t]);let i;var r;s&&(i=(0,b.sprintf)((0,b._x)("%1$s ‹ %2$s","breadcrumb trail"),(0,Kt.decodeEntities)(n),null!==(r=Fe[e])&&void 0!==r?r:Fe[Se])),function(e){const t=fv(),n=(0,l.useSelect)((e=>e(_.store).getEntityRecord("root","site")?.title),[]),s=(0,d.useRef)(!0);(0,d.useEffect)((()=>{s.current=!1}),[t]),(0,d.useEffect)((()=>{if(!s.current&&e&&n){const t=(0,b.sprintf)((0,b.__)("%1$s ‹ %2$s ‹ Editor — WordPress"),(0,Kt.decodeEntities)(e),(0,Kt.decodeEntities)(n));document.title=t,(0,wl.speak)(e,"assertive")}}),[e,n,t])}(s&&i)};const{useLocation:vv}=te(Gt.privateApis),xv=[Se,Ce,je,Ie.user],yv=["page","post"];const{Editor:bv,BackButton:wv}=te(h.privateApis),{useHistory:_v,useLocation:jv}=te(Gt.privateApis),{BlockKeyboardShortcuts:Sv}=te(a.privateApis),Cv={edit:{opacity:0,scale:.2},hover:{opacity:1,scale:1,clipPath:"inset( 22% round 2px )"}},kv={edit:{clipPath:"inset(0% round 0px)"},hover:{clipPath:"inset( 22% round 2px )"},tap:{clipPath:"inset(0% round 0px)"}};function Ev(e){switch(e){case"navigation":return"/navigation";case"wp_block":return"/pattern?postType=wp_block";case"wp_template_part":return"/pattern?postType=wp_template_part";case"wp_template":return"/template";case"page":return"/page";case"post":return"/"}throw"Unknown post type"}function Pv({isPostsList:e=!1}){const t=(0,v.useReducedMotion)(),n=jv(),{canvas:s="view"}=n.query,i=jn();!function(e){const{clearSelectedBlock:t}=(0,l.useDispatch)(x.store),{setDeviceType:n,closePublishSidebar:s,setIsListViewOpened:i,setIsInserterOpened:r}=(0,l.useDispatch)(h.store),{get:o}=(0,l.useSelect)(f.store),a=(0,l.useRegistry)();(0,d.useLayoutEffect)((()=>{const l=window.matchMedia("(min-width: 782px)").matches;a.batch((()=>{t(),n("Desktop"),s(),r(!1),l&&"edit"===e&&o("core","showListViewByDefault")&&!o("core","distractionFree")?i(!0):i(!1)}))}),[e,a,t,n,s,r,i,o])}(s);const r=function(){const{name:e,params:t={},query:n}=vv(),{postId:s=n?.postId}=t;let i;"navigation-item"===e?i=je:"pattern-item"===e?i=Ie.user:"template-part-item"===e?i=Ce:"template-item"===e||"templates"===e?i=Se:"page-item"===e||"pages"===e?i="page":"post-item"!==e&&"posts"!==e||(i="post");const r=(0,l.useSelect)((e=>{const{getHomePage:t}=te(e(_.store));return t()}),[]),o=(0,l.useSelect)((e=>{if(xv.includes(i)&&s)return;if(s&&s.includes(","))return;const{getTemplateId:t}=te(e(_.store));return i&&s&&yv.includes(i)?t(i,s):"page"===r?.postType?t("page",r?.postId):"wp_template"===r?.postType?r?.postId:void 0}),[r,s,i]),a=(0,d.useMemo)((()=>xv.includes(i)&&s?{}:i&&s&&yv.includes(i)?{postType:i,postId:s}:"page"===r?.postType?{postType:"page",postId:r?.postId}:{}),[r,i,s]);return xv.includes(i)&&s?{isReady:!0,postType:i,postId:s,context:a}:r?{isReady:void 0!==o,postType:Se,postId:o,context:a}:{isReady:!1}}();!function({postType:e,postId:t,context:n,isReady:s}){const{setEditedEntity:i}=(0,l.useDispatch)(zt);(0,d.useEffect)((()=>{s&&i(e,t,n)}),[s,e,t,n,i])}(r);const{postType:o,postId:a,context:c}=r,{supportsGlobalStyles:u,editorCanvasView:p,currentPostIsTrashed:m,hasSiteIcon:g}=(0,l.useSelect)((e=>{const{getEditorCanvasContainerView:t}=te(e(zt)),{getCurrentTheme:n,getEntityRecord:s}=e(_.store),i=s("root","__unstableBase",void 0);return{supportsGlobalStyles:n()?.is_block_theme,editorCanvasView:t(),currentPostIsTrashed:"trash"===e(h.store).getCurrentPostAttribute("status"),hasSiteIcon:!!i?.site_icon_url}}),[]),j=!!c?.postId;gv(j?c.postType:o,j?c.postId:a);const S=Xr(),C=!Do(),k=function(){const{query:e,path:t}=hv(),n=pv(),{canvas:s="view"}=e,i=(0,l.useSelect)((e=>"trash"===e(h.store).getCurrentPostAttribute("status")),[]),[r,o]=(0,d.useState)(!1);(0,d.useEffect)((()=>{"edit"===s&&o(!1)}),[s]);const a={"aria-label":(0,b.__)("Edit"),"aria-disabled":i,title:null,role:"button",tabIndex:0,onFocus:()=>o(!0),onBlur:()=>o(!1),onKeyDown:e=>{const{keyCode:s}=e;s!==Jt.ENTER&&s!==Jt.SPACE||i||(e.preventDefault(),n.navigate((0,Qt.addQueryArgs)(t,{canvas:"edit"}),{transition:"canvas-mode-edit-transition"}))},onClick:()=>n.navigate((0,Qt.addQueryArgs)(t,{canvas:"edit"}),{transition:"canvas-mode-edit-transition"}),onClickCapture:e=>{i&&(e.preventDefault(),e.stopPropagation())},readonly:!0};return{className:Ut("edit-site-visual-editor__editor-canvas",{"is-focused":r&&"view"===s}),..."view"===s?a:{}}}(),E="edit"===s,P=(0,v.useInstanceId)(Ia,"edit-site-editor__loading-progress"),I=Na(),T=(0,d.useMemo)((()=>[...I.styles,{css:"view"===s?`body{min-height: 100vh; ${m?"":"cursor: pointer;"}}`:void 0}]),[I.styles,s,m]),{resetZoomLevel:O}=te((0,l.useDispatch)(x.store)),{createSuccessNotice:A}=(0,l.useDispatch)(w.store),N=_v(),M=(0,d.useCallback)(((e,t)=>{switch(e){case"move-to-trash":case"delete-post":N.navigate(Ev(j?c.postType:o));break;case"duplicate-post":{const e=t[0],n="string"==typeof e.title?e.title:e.title?.rendered;A((0,b.sprintf)((0,b.__)('"%s" successfully created.'),(0,Kt.decodeEntities)(n)),{type:"snackbar",id:"duplicate-post-action",actions:[{label:(0,b.__)("Edit"),onClick:()=>{N.navigate(`/${e.type}/${e.id}?canvas=edit`)}}]})}}}),[o,c?.postType,j,N,A]),F=Bo(p),V=!i,R={duration:t?0:.2};return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(ka,{disableRootPadding:o!==Se}),(0,oe.jsx)(h.EditorKeyboardShortcutsRegister,{}),E&&(0,oe.jsx)(Sv,{}),V?null:(0,oe.jsx)(Ia,{id:P}),E&&(0,oe.jsx)(Sa,{postType:j?c.postType:o}),V&&(0,oe.jsxs)(bv,{postType:j?c.postType:o,postId:j?c.postId:a,templateId:j?a:void 0,settings:I,className:"edit-site-editor__editor-interface",styles:T,customSaveButton:S&&(0,oe.jsx)($r,{size:"compact"}),customSavePanel:S&&(0,oe.jsx)(uo,{}),forceDisableBlockTools:!C,title:F,iframeProps:k,onActionPerformed:M,extraSidebarPanels:!j&&(0,oe.jsx)(Ra.Slot,{}),children:[E&&(0,oe.jsx)(wv,{children:({length:t})=>t<=1&&(0,oe.jsxs)(y.__unstableMotion.div,{className:"edit-site-editor__view-mode-toggle",transition:R,animate:"edit",initial:"edit",whileHover:"hover",whileTap:"tap",children:[(0,oe.jsx)(y.Button,{__next40pxDefaultSize:!0,label:(0,b.__)("Open Navigation"),showTooltip:!0,tooltipPosition:"middle right",onClick:()=>{O(),e&&n.query?.focusMode?N.navigate("/",{transition:"canvas-mode-view-transition"}):N.navigate(function(e,t){const{path:n,name:s}=e;return["pattern-item","template-part-item","page-item","template-item","post-item"].includes(s)?Ev(t):(0,Qt.addQueryArgs)(n,{canvas:void 0})}(n,j?c.postType:o),{transition:"canvas-mode-view-transition"})},children:(0,oe.jsx)(y.__unstableMotion.div,{variants:kv,children:(0,oe.jsx)(en,{className:"edit-site-editor__view-mode-toggle-icon"})})}),(0,oe.jsx)(y.__unstableMotion.div,{className:Ut("edit-site-editor__back-icon",{"has-site-icon":g}),variants:Cv,children:(0,oe.jsx)($o,{icon:va})})]})}),(0,oe.jsx)(dv,{}),u&&(0,oe.jsx)(iv,{})]})]})}function Iv({showEditor:e=!0}){const{isBlockBasedTheme:t,siteUrl:n}=(0,l.useSelect)((e=>{const{getEntityRecord:t,getCurrentTheme:n}=e(_.store),s=t("root","__unstableBase");return{isBlockBasedTheme:n()?.is_block_theme,siteUrl:s?.home}}),[]);return t||e?(0,oe.jsx)(Pv,{}):(0,oe.jsx)("iframe",{src:n,title:(0,b.__)("Site Preview"),style:{display:"block",width:"100%",height:"100%",backgroundColor:"#fff"},onLoad:e=>{const t=e.target.contentDocument;t.getElementById("wpadminbar").remove(),t.getElementsByTagName("html")[0].setAttribute("style","margin-top: 0 !important;"),t.getElementsByTagName("body")[0].classList.remove("admin-bar");t.querySelectorAll("a, button, input, details, audio").forEach((e=>{e.style.pointerEvents="none",e.tabIndex=-1,e.setAttribute("aria-hidden","true")}))}})}const Tv={name:"home",path:"/",areas:{sidebar:(0,oe.jsx)(ga,{}),preview:(0,oe.jsx)(Iv,{showEditor:!1}),mobile:(0,oe.jsx)(ga,{})}},{useLocation:Ov}=te(Gt.privateApis);function Av(){const{query:e={}}=Ov(),{canvas:t}=e;return"edit"===t?(0,oe.jsx)(Pv,{}):(0,oe.jsx)(ig,{})}const Nv={name:"styles",path:"/styles",areas:{content:(0,oe.jsx)(ig,{}),sidebar:(0,oe.jsx)(fa,{backPath:"/"}),preview:({query:e})=>"stylebook"===e.preview?(0,oe.jsx)(gg,{}):(0,oe.jsx)(Pv,{}),mobile:(0,oe.jsx)(Av,{})},widths:{content:380}},Mv={per_page:100,status:["publish","draft"],order:"desc",orderby:"date"};function Fv({menuTitle:e,onClose:t,onSave:n}){const[s,i]=(0,d.useState)(e),r=s!==e&&(o=s,o?.trim()?.length>0);var o;return(0,oe.jsx)(y.Modal,{title:(0,b.__)("Rename"),onRequestClose:t,focusOnMount:"firstContentElement",size:"small",children:(0,oe.jsx)("form",{className:"sidebar-navigation__rename-modal-form",children:(0,oe.jsxs)(y.__experimentalVStack,{spacing:"3",children:[(0,oe.jsx)(y.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,value:s,placeholder:(0,b.__)("Navigation title"),onChange:i,label:(0,b.__)("Name")}),(0,oe.jsxs)(y.__experimentalHStack,{justify:"right",children:[(0,oe.jsx)(y.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:t,children:(0,b.__)("Cancel")}),(0,oe.jsx)(y.Button,{__next40pxDefaultSize:!0,accessibleWhenDisabled:!0,disabled:!r,variant:"primary",type:"submit",onClick:e=>{e.preventDefault(),r&&(n({title:s}),t())},children:(0,b.__)("Save")})]})]})})})}function Vv({onClose:e,onConfirm:t}){return(0,oe.jsx)(y.__experimentalConfirmDialog,{isOpen:!0,onConfirm:()=>{t(),e()},onCancel:e,confirmButtonText:(0,b.__)("Delete"),size:"medium",children:(0,b.__)("Are you sure you want to delete this Navigation Menu?")})}const{useHistory:Rv}=te(Gt.privateApis),Bv={position:"bottom right"};function Dv(e){const{onDelete:t,onSave:n,onDuplicate:s,menuTitle:i,menuId:r}=e,[o,a]=(0,d.useState)(!1),[l,c]=(0,d.useState)(!1),u=Rv(),h=()=>{a(!1),c(!1)};return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(y.DropdownMenu,{className:"sidebar-navigation__more-menu",label:(0,b.__)("Actions"),icon:Da,popoverProps:Bv,children:({onClose:e})=>(0,oe.jsx)("div",{children:(0,oe.jsxs)(y.MenuGroup,{children:[(0,oe.jsx)(y.MenuItem,{onClick:()=>{a(!0),e()},children:(0,b.__)("Rename")}),(0,oe.jsx)(y.MenuItem,{onClick:()=>{u.navigate(`/wp_navigation/${r}?canvas=edit`)},children:(0,b.__)("Edit")}),(0,oe.jsx)(y.MenuItem,{onClick:()=>{s(),e()},children:(0,b.__)("Duplicate")}),(0,oe.jsx)(y.MenuItem,{isDestructive:!0,onClick:()=>{c(!0),e()},children:(0,b.__)("Delete")})]})})}),l&&(0,oe.jsx)(Vv,{onClose:h,onConfirm:t}),o&&(0,oe.jsx)(Fv,{onClose:h,menuTitle:i,onSave:n})]})}const Lv=(0,oe.jsx)(Yt.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,oe.jsx)(Yt.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"})}),zv=(0,oe.jsx)(Yt.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,oe.jsx)(Yt.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"})}),Gv={className:"block-editor-block-settings-menu__popover",placement:"bottom-start"},{useHistory:Hv,useLocation:Uv}=te(Gt.privateApis);function Wv(e){const t=Hv(),{path:n}=Uv(),{block:s}=e,{clientId:i}=s,{moveBlocksDown:r,moveBlocksUp:o,removeBlocks:a}=(0,l.useDispatch)(x.store),c=(0,b.sprintf)((0,b.__)("Remove %s"),(0,x.BlockTitle)({clientId:i,maximumLength:25})),u=(0,b.sprintf)((0,b.__)("Go to %s"),(0,x.BlockTitle)({clientId:i,maximumLength:25})),h=(0,l.useSelect)((e=>{const{getBlockRootClientId:t}=e(x.store);return t(i)}),[i]),p=(0,d.useCallback)((e=>{const{attributes:s,name:i}=e;"post-type"===s.kind&&s.id&&s.type&&t&&t.navigate(`/${s.type}/${s.id}?canvas=edit`,{state:{backPath:n}}),"core/page-list-item"===i&&s.id&&t&&t.navigate(`/page/${s.id}?canvas=edit`,{state:{backPath:n}})}),[n,t]);return(0,oe.jsx)(y.DropdownMenu,{icon:Da,label:(0,b.__)("Options"),className:"block-editor-block-settings-menu",popoverProps:Gv,noIcons:!0,...e,children:({onClose:e})=>(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsxs)(y.MenuGroup,{children:[(0,oe.jsx)(y.MenuItem,{icon:Lv,onClick:()=>{o([i],h),e()},children:(0,b.__)("Move up")}),(0,oe.jsx)(y.MenuItem,{icon:zv,onClick:()=>{r([i],h),e()},children:(0,b.__)("Move down")}),"page"===s.attributes?.type&&s.attributes?.id&&(0,oe.jsx)(y.MenuItem,{onClick:()=>{p(s),e()},children:u})]}),(0,oe.jsx)(y.MenuGroup,{children:(0,oe.jsx)(y.MenuItem,{onClick:()=>{a([i],!1),e()},children:c})})]})})}const{PrivateListView:qv}=te(x.privateApis),Zv=["postType","page",{per_page:100,_fields:["id","link","menu_order","parent","title","type"],orderby:"menu_order",order:"asc"}];function Kv({rootClientId:e}){const{listViewRootClientId:t,isLoading:n}=(0,l.useSelect)((t=>{const{areInnerBlocksControlled:n,getBlockName:s,getBlockCount:i,getBlockOrder:r}=t(x.store),{isResolving:o}=t(_.store),a=r(e),l=1===a.length&&"core/page-list"===s(a[0])&&i(a[0])>0,c=o("getEntityRecords",Zv);return{listViewRootClientId:l?a[0]:e,isLoading:!n(e)||c}}),[e]),{replaceBlock:s,__unstableMarkNextChangeAsNotPersistent:i}=(0,l.useDispatch)(x.store),r=(0,d.useCallback)((e=>{"core/navigation-link"!==e.name||e.attributes.url||(i(),s(e.clientId,(0,o.createBlock)("core/navigation-link",e.attributes)))}),[i,s]);return(0,oe.jsxs)(oe.Fragment,{children:[!n&&(0,oe.jsx)(qv,{rootClientId:t,onSelect:r,blockSettingsMenu:Wv,showAppender:!1}),(0,oe.jsx)("div",{className:"edit-site-sidebar-navigation-screen-navigation-menus__helper-block-editor",children:(0,oe.jsx)(x.BlockList,{})})]})}const Yv=()=>{};function Xv({navigationMenuId:e}){const{storedSettings:t}=(0,l.useSelect)((e=>{const{getSettings:t}=te(e(zt));return{storedSettings:t()}}),[]),n=(0,d.useMemo)((()=>e?[(0,o.createBlock)("core/navigation",{ref:e})]:[]),[e]);return e&&n?.length?(0,oe.jsx)(x.BlockEditorProvider,{settings:t,value:n,onChange:Yv,onInput:Yv,children:(0,oe.jsx)("div",{className:"edit-site-sidebar-navigation-screen-navigation-menus__content",children:(0,oe.jsx)(Kv,{rootClientId:n[0].clientId})})}):null}function Jv(e,t,n){return e?.rendered?"publish"===n?(0,Kt.decodeEntities)(e?.rendered):(0,b.sprintf)((0,b._x)("%1$s (%2$s)","menu label"),(0,Kt.decodeEntities)(e?.rendered),n):(0,b.sprintf)((0,b.__)("(no title %s)"),t)}function Qv({navigationMenu:e,backPath:t,handleDelete:n,handleDuplicate:s,handleSave:i}){const r=e?.title?.rendered;return(0,oe.jsx)(cx,{actions:(0,oe.jsx)(oe.Fragment,{children:(0,oe.jsx)(Dv,{menuId:e?.id,menuTitle:(0,Kt.decodeEntities)(r),onDelete:n,onSave:i,onDuplicate:s})}),backPath:t,title:Jv(e?.title,e?.id,e?.status),description:(0,b.__)("Navigation Menus are a curated collection of blocks that allow visitors to get around your site."),children:(0,oe.jsx)(Xv,{navigationMenuId:e?.id})})}const{useLocation:$v}=te(Gt.privateApis),ex="wp_navigation";function tx({backPath:e}){const{params:{postId:t}}=$v(),{record:n,isResolving:s}=(0,_.useEntityRecord)("postType",ex,t),{isSaving:i,isDeleting:r}=(0,l.useSelect)((e=>{const{isSavingEntityRecord:n,isDeletingEntityRecord:s}=e(_.store);return{isSaving:n("postType",ex,t),isDeleting:s("postType",ex,t)}}),[t]),o=s||i||r,a=n?.title?.rendered||n?.slug,{handleSave:c,handleDelete:u,handleDuplicate:d}=ox(),h=()=>u(n),p=e=>c(n,e),f=()=>d(n);return o?(0,oe.jsx)(cx,{description:(0,b.__)("Navigation Menus are a curated collection of blocks that allow visitors to get around your site."),backPath:e,children:(0,oe.jsx)(y.Spinner,{className:"edit-site-sidebar-navigation-screen-navigation-menus__loading"})}):o||n?n?.content?.raw?(0,oe.jsx)(Qv,{navigationMenu:n,backPath:e,handleDelete:h,handleSave:p,handleDuplicate:f}):(0,oe.jsx)(cx,{actions:(0,oe.jsx)(Dv,{menuId:n?.id,menuTitle:(0,Kt.decodeEntities)(a),onDelete:h,onSave:p,onDuplicate:f}),backPath:e,title:Jv(n?.title,n?.id,n?.status),description:(0,b.__)("This Navigation Menu is empty.")}):(0,oe.jsx)(cx,{description:(0,b.__)("Navigation Menu missing."),backPath:e})}const{useHistory:nx}=te(Gt.privateApis);function sx(){const{deleteEntityRecord:e}=(0,l.useDispatch)(_.store),{createSuccessNotice:t,createErrorNotice:n}=(0,l.useDispatch)(w.store),s=nx();return async i=>{const r=i?.id;try{await e("postType",ex,r,{force:!0},{throwOnError:!0}),t((0,b.__)("Navigation Menu successfully deleted."),{type:"snackbar"}),s.navigate("/navigation")}catch(e){n((0,b.sprintf)((0,b.__)("Unable to delete Navigation Menu (%s)."),e?.message),{type:"snackbar"})}}}function ix(){const{getEditedEntityRecord:e}=(0,l.useSelect)((e=>{const{getEditedEntityRecord:t}=e(_.store);return{getEditedEntityRecord:t}}),[]),{editEntityRecord:t,__experimentalSaveSpecifiedEntityEdits:n}=(0,l.useDispatch)(_.store),{createSuccessNotice:s,createErrorNotice:i}=(0,l.useDispatch)(w.store);return async(r,o)=>{if(!o)return;const a=r?.id,l=e("postType",je,a);t("postType",ex,a,o);const c=Object.keys(o);try{await n("postType",ex,a,c,{throwOnError:!0}),s((0,b.__)("Renamed Navigation Menu"),{type:"snackbar"})}catch(e){t("postType",ex,a,l),i((0,b.sprintf)((0,b.__)("Unable to rename Navigation Menu (%s)."),e?.message),{type:"snackbar"})}}}function rx(){const e=nx(),{saveEntityRecord:t}=(0,l.useDispatch)(_.store),{createSuccessNotice:n,createErrorNotice:s}=(0,l.useDispatch)(w.store);return async i=>{const r=i?.title?.rendered||i?.slug;try{const s=await t("postType",ex,{title:(0,b.sprintf)((0,b._x)("%s (Copy)","navigation menu"),r),content:i?.content?.raw,status:"publish"},{throwOnError:!0});s&&(n((0,b.__)("Duplicated Navigation Menu"),{type:"snackbar"}),e.navigate(`/wp_navigation/${s.id}`))}catch(e){s((0,b.sprintf)((0,b.__)("Unable to duplicate Navigation Menu (%s)."),e?.message),{type:"snackbar"})}}}function ox(){return{handleDelete:sx(),handleSave:ix(),handleDuplicate:rx()}}function ax(e,t,n){return e?"publish"===n?(0,Kt.decodeEntities)(e):(0,b.sprintf)((0,b._x)("%1$s (%2$s)","menu label"),(0,Kt.decodeEntities)(e),n):(0,b.sprintf)((0,b.__)("(no title %s)"),t)}function lx({backPath:e}){const{records:t,isResolving:n,hasResolved:s}=(0,_.useEntityRecords)("postType",je,Mv),i=n&&!s,{getNavigationFallbackId:r}=te((0,l.useSelect)(_.store)),o=(0,l.useSelect)((e=>e(_.store).isResolving("getNavigationFallbackId")),[]),a=t?.[0];a||n||!s||o||r();const{handleSave:c,handleDelete:u,handleDuplicate:d}=ox(),h=!!t?.length;return i?(0,oe.jsx)(cx,{backPath:e,children:(0,oe.jsx)(y.Spinner,{className:"edit-site-sidebar-navigation-screen-navigation-menus__loading"})}):i||h?1===t?.length?(0,oe.jsx)(Qv,{navigationMenu:a,backPath:e,handleDelete:()=>u(a),handleDuplicate:()=>d(a),handleSave:e=>c(a,e)}):(0,oe.jsx)(cx,{backPath:e,children:(0,oe.jsx)(y.__experimentalItemGroup,{className:"edit-site-sidebar-navigation-screen-navigation-menus",children:t?.map((({id:e,title:t,status:n},s)=>(0,oe.jsx)(ux,{postId:e,withChevron:!0,icon:Ho,children:ax(t?.rendered,s+1,n)},e)))})}):(0,oe.jsx)(cx,{description:(0,b.__)("No Navigation Menus found."),backPath:e})}function cx({children:e,actions:t,title:n,description:s,backPath:i}){return(0,oe.jsx)(Qo,{title:n||(0,b.__)("Navigation"),actions:t,description:s||(0,b.__)("Manage your Navigation Menus."),backPath:i,content:e})}const ux=({postId:e,...t})=>(0,oe.jsx)(ia,{to:`/wp_navigation/${e}`,...t}),{useLocation:dx}=te(Gt.privateApis);function hx(){const{query:e={}}=dx(),{canvas:t="view"}=e;return"edit"===t?(0,oe.jsx)(Pv,{}):(0,oe.jsx)(lx,{backPath:"/"})}const px={name:"navigation",path:"/navigation",areas:{sidebar:(0,oe.jsx)(lx,{backPath:"/"}),preview:(0,oe.jsx)(Pv,{}),mobile:(0,oe.jsx)(hx,{})}},{useLocation:fx}=te(Gt.privateApis);function mx(){const{query:e={}}=fx(),{canvas:t="view"}=e;return"edit"===t?(0,oe.jsx)(Pv,{}):(0,oe.jsx)(tx,{backPath:{postType:je}})}const gx={name:"navigation-item",path:"/wp_navigation/:postId",areas:{sidebar:(0,oe.jsx)(tx,{backPath:"/navigation"}),preview:(0,oe.jsx)(Pv,{}),mobile:(0,oe.jsx)(mx,{})}},vx=(0,oe.jsx)(Yt.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,oe.jsx)(Yt.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12.848 8a1 1 0 0 1-.914-.594l-.723-1.63a.5.5 0 0 0-.447-.276H5a.5.5 0 0 0-.5.5v11.5a.5.5 0 0 0 .5.5h14a.5.5 0 0 0 .5-.5v-9A.5.5 0 0 0 19 8h-6.152Zm.612-1.5a.5.5 0 0 1-.462-.31l-.445-1.084A2 2 0 0 0 10.763 4H5a2 2 0 0 0-2 2v11.5a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-9a2 2 0 0 0-2-2h-5.54Z"})});function xx({count:e,icon:t,id:n,isActive:s,label:i,type:r}){if(!e)return;const o=[`postType=${r}`];return n&&o.push(`categoryId=${n}`),(0,oe.jsx)(ia,{icon:t,suffix:(0,oe.jsx)("span",{children:e}),"aria-current":s?"true":void 0,to:`/pattern?${o.join("&")}`,children:i})}const yx=(e,t,n)=>t===n.findIndex((t=>e.name===t.name));const{extractWords:bx,getNormalizedSearchTerms:wx,normalizeString:_x}=te(x.privateApis),jx=e=>e.type===Ie.user?e.slug:e.type===Ce?"":e.name||"",Sx=e=>"string"==typeof e.title?e.title:e.title&&e.title.rendered?e.title.rendered:e.title&&e.title.raw?e.title.raw:"",Cx=e=>e.type===Ie.user?e.excerpt.raw:e.description||"",kx=e=>e.keywords||[],Ex=()=>!1,Px=(e=[],t="",n={})=>{const s=wx(t),i=n.categoryId!==Te&&!s.length,r={...n,onlyFilterByCategory:i},o=i?0:1,a=e.map((e=>[e,Ix(e,t,r)])).filter((([,e])=>e>o));return 0===s.length||a.sort((([,e],[,t])=>t-e)),a.map((([e])=>e))};function Ix(e,t,n){const{categoryId:s,getName:i=jx,getTitle:r=Sx,getDescription:o=Cx,getKeywords:a=kx,hasCategory:l=Ex,onlyFilterByCategory:c}=n;let u=s===Te||s===Pe||s===Oe&&e.type===Ie.user||l(e,s)?1:0;if(!u||c)return u;const d=i(e),h=r(e),p=o(e),f=a(e),m=_x(t),g=_x(h);if(m===g)u+=30;else if(g.startsWith(m))u+=20;else{const e=[d,h,p,...f].join(" ");0===((e,t)=>e.filter((e=>!wx(t).some((t=>t.includes(e))))))(bx(m),e).length&&(u+=10)}return u}const Tx=[],Ox=(0,l.createSelector)(((e,t,n="")=>{var s;const{getEntityRecords:i,isResolving:r}=e(_.store),o={per_page:-1},a=null!==(s=i("postType",Ce,o))&&void 0!==s?s:Tx,l=(e(_.store).getEntityRecord("root","__unstableBase")?.default_template_part_areas||[]).map((e=>e.area)),c=r("getEntityRecords",["postType",Ce,o]),u=Px(a,n,{categoryId:t,hasCategory:(e,t)=>t!==Ee?e.area===t:e.area===t||!l.includes(e.area)});return{patterns:u,isResolving:c}}),(e=>[e(_.store).getEntityRecords("postType",Ce,{per_page:-1}),e(_.store).isResolving("getEntityRecords",["postType",Ce,{per_page:-1}]),e(_.store).getEntityRecord("root","__unstableBase")?.default_template_part_areas])),Ax=(0,l.createSelector)((e=>{var t;const{getSettings:n}=te(e(zt)),{isResolving:s}=e(_.store),i=n();return{patterns:[...(null!==(t=i.__experimentalAdditionalBlockPatterns)&&void 0!==t?t:i.__experimentalBlockPatterns)||[],...e(_.store).getBlockPatterns()||[]].filter((e=>!Ae.includes(e.source))).filter(yx).filter((e=>!1!==e.inserter)).map((e=>({...e,keywords:e.keywords||[],type:Ie.theme,blocks:(0,o.parse)(e.content,{__unstableSkipMigrationLogs:!0})}))),isResolving:s("getBlockPatterns")}}),(e=>[e(_.store).getBlockPatterns(),e(_.store).isResolving("getBlockPatterns"),te(e(zt)).getSettings()])),Nx=(0,l.createSelector)(((e,t,n,s="")=>{const{patterns:i,isResolving:r}=Ax(e),{patterns:o,isResolving:a,categories:l}=Mx(e);let c=[...i||[],...o||[]];return n&&(c=c.filter((e=>e.type===Ie.user?(e.wp_pattern_sync_status||Ne.full)===n:n===Ne.unsynced))),c=Px(c,s,t?{categoryId:t,hasCategory:(e,t)=>e.type===Ie.user?e.wp_pattern_category?.some((e=>l.find((t=>t.id===e))?.slug===t)):e.categories?.includes(t)}:{hasCategory:e=>e.type===Ie.user?l?.length&&(!e.wp_pattern_category?.length||!e.wp_pattern_category?.some((e=>l.find((t=>t.id===e))))):!e.hasOwnProperty("categories")}),{patterns:c,isResolving:r||a}}),(e=>[Ax(e),Mx(e)])),Mx=(0,l.createSelector)(((e,t,n="")=>{const{getEntityRecords:s,isResolving:i,getUserPatternCategories:r}=e(_.store),o={per_page:-1},a=s("postType",Ie.user,o),l=r(),c=new Map;l.forEach((e=>c.set(e.id,e)));let u=null!=a?a:Tx;const d=i("getEntityRecords",["postType",Ie.user,o]);return t&&(u=u.filter((e=>e.wp_pattern_sync_status||Ne.full===t))),u=Px(u,n,{hasCategory:()=>!0}),{patterns:u,isResolving:d,categories:l}}),(e=>[e(_.store).getEntityRecords("postType",Ie.user,{per_page:-1}),e(_.store).isResolving("getEntityRecords",["postType",Ie.user,{per_page:-1}]),e(_.store).getUserPatternCategories()]));const Fx=(e,t,{search:n="",syncStatus:s}={})=>(0,l.useSelect)((i=>{if(e===Ce)return Ox(i,t,n);if(e===Ie.user&&t){return Nx(i,"uncategorized"===t?"":t,s,n)}return e===Ie.user?Mx(i,s,n):{patterns:Tx,isResolving:!1}}),[t,e,n,s]);function Vx(){const e=function(){const e=(0,l.useSelect)((e=>{var t;const{getSettings:n}=te(e(zt)),s=n();return null!==(t=s.__experimentalAdditionalBlockPatternCategories)&&void 0!==t?t:s.__experimentalBlockPatternCategories}));return[...e||[],...(0,l.useSelect)((e=>e(_.store).getBlockPatternCategories()))||[]]}();e.push({name:Ee,label:(0,b.__)("Uncategorized")});const t=function(){const e=(0,l.useSelect)((e=>{var t;const{getSettings:n}=te(e(zt));return null!==(t=n().__experimentalAdditionalBlockPatterns)&&void 0!==t?t:n().__experimentalBlockPatterns})),t=(0,l.useSelect)((e=>e(_.store).getBlockPatterns()));return(0,d.useMemo)((()=>[...e||[],...t||[]].filter((e=>!Ae.includes(e.source))).filter(yx).filter((e=>!1!==e.inserter))),[e,t])}(),{patterns:n,categories:s}=Fx(Ie.user),i=(0,d.useMemo)((()=>{const i={},r=[];e.forEach((e=>{i[e.name]||(i[e.name]={...e,count:0})})),s.forEach((e=>{i[e.name]||(i[e.name]={...e,count:0})})),t.forEach((e=>{e.categories?.forEach((e=>{i[e]&&(i[e].count+=1)})),e.categories?.length||(i.uncategorized.count+=1)})),n.forEach((e=>{e.wp_pattern_category?.forEach((e=>{const t=s.find((t=>t.id===e))?.name;i[t]&&(i[t].count+=1)})),e.wp_pattern_category?.length&&e.wp_pattern_category?.some((e=>s.find((t=>t.id===e))))||(i.uncategorized.count+=1)})),[...e,...s].forEach((e=>{i[e.name].count&&!r.find((t=>t.name===e.name))&&r.push(i[e.name])}));const o=r.sort(((e,t)=>e.label.localeCompare(t.label)));return o.unshift({name:Oe,label:(0,b.__)("My patterns"),count:n.length}),o.unshift({name:Te,label:(0,b.__)("All patterns"),description:(0,b.__)("A list of all patterns from all sources."),count:t.length+n.length}),o}),[e,t,s,n]);return{patternCategories:i,hasPatterns:!!i.length}}const Rx=e=>{const t=e||[],n=(0,l.useSelect)((e=>e(_.store).getEntityRecord("root","__unstableBase")?.default_template_part_areas||[]),[]),s={header:{},footer:{},sidebar:{},uncategorized:{}};n.forEach((e=>s[e.area]={...e,templateParts:[]}));return t.reduce(((e,t)=>{const n=e[t.area]?t.area:Ee;return e[n]?.templateParts?.push(t),e}),s)};const{useLocation:Bx}=te(Gt.privateApis);function Dx({templatePartAreas:e,patternCategories:t,currentCategory:n,currentType:s}){const[i,...r]=t;return(0,oe.jsxs)(y.__experimentalItemGroup,{className:"edit-site-sidebar-navigation-screen-patterns__group",children:[(0,oe.jsx)(xx,{count:Object.values(e).map((({templateParts:e})=>e?.length||0)).reduce(((e,t)=>e+t),0),icon:(0,h.getTemplatePartIcon)(),label:(0,b.__)("All template parts"),id:Pe,type:Ce,isActive:n===Pe&&s===Ce},"all"),Object.entries(e).map((([e,{label:t,templateParts:i}])=>(0,oe.jsx)(xx,{count:i?.length,icon:(0,h.getTemplatePartIcon)(e),label:t,id:e,type:Ce,isActive:n===e&&s===Ce},e))),(0,oe.jsx)("div",{className:"edit-site-sidebar-navigation-screen-patterns__divider"}),i&&(0,oe.jsx)(xx,{count:i.count,label:i.label,icon:vx,id:i.name,type:Ie.user,isActive:n===`${i.name}`&&s===Ie.user},i.name),r.map((e=>(0,oe.jsx)(xx,{count:e.count,label:e.label,icon:vx,id:e.name,type:Ie.user,isActive:n===`${e.name}`&&s===Ie.user},e.name)))]})}function Lx({backPath:e}){const{query:{postType:t="wp_block",categoryId:n}}=Bx(),s=n||(t===Ie.user?Te:Pe),{templatePartAreas:i,hasTemplateParts:r,isLoading:o}=function(){const{records:e,isResolving:t}=(0,_.useEntityRecords)("postType",Ce,{per_page:-1});return{hasTemplateParts:!!e&&!!e.length,isLoading:t,templatePartAreas:Rx(e)}}(),{patternCategories:a,hasPatterns:l}=Vx();return(0,oe.jsx)(Qo,{title:(0,b.__)("Patterns"),description:(0,b.__)("Manage what patterns are available when editing the site."),backPath:e,content:(0,oe.jsxs)(oe.Fragment,{children:[o&&(0,b.__)("Loading items…"),!o&&(0,oe.jsxs)(oe.Fragment,{children:[!r&&!l&&(0,oe.jsx)(y.__experimentalItemGroup,{className:"edit-site-sidebar-navigation-screen-patterns__group",children:(0,oe.jsx)(y.__experimentalItem,{children:(0,b.__)("No items found")})}),(0,oe.jsx)(Dx,{templatePartAreas:i,patternCategories:a,currentCategory:s,currentType:t})]})]})})}var zx=i(9681),Gx=i.n(zx);const Hx=(0,oe.jsx)(Yt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Yt.Path,{d:"M12 3.9 6.5 9.5l1 1 3.8-3.7V20h1.5V6.8l3.7 3.7 1-1z"})}),Ux=(0,oe.jsx)(Yt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Yt.Path,{d:"m16.5 13.5-3.7 3.7V4h-1.5v13.2l-3.8-3.7-1 1 5.5 5.6 5.5-5.6z"})}),Wx="is",qx="isNot",Zx="isAny",Kx="isNone",Yx="isAll",Xx="isNotAll",Jx=[Wx,qx,Zx,Kx,Yx,Xx],Qx={[Wx]:{key:"is-filter",label:(0,b.__)("Is")},[qx]:{key:"is-not-filter",label:(0,b.__)("Is not")},[Zx]:{key:"is-any-filter",label:(0,b.__)("Is any")},[Kx]:{key:"is-none-filter",label:(0,b.__)("Is none")},[Yx]:{key:"is-all-filter",label:(0,b.__)("Is all")},[Xx]:{key:"is-not-all-filter",label:(0,b.__)("Is not all")}},$x=["asc","desc"],ey={asc:"↑",desc:"↓"},ty={asc:"ascending",desc:"descending"},ny={asc:(0,b.__)("Sort ascending"),desc:(0,b.__)("Sort descending")},sy={asc:Hx,desc:Ux},iy="table",ry="grid";const oy={sort:function(e,t,n){return"asc"===n?e-t:t-e},isValid:function(e,t){if(""===e)return!1;if(!Number.isInteger(Number(e)))return!1;if(t?.elements){const n=t?.elements.map((e=>e.value));if(!n.includes(Number(e)))return!1}return!0},Edit:"integer"};const ay={sort:function(e,t,n){return"asc"===n?e.localeCompare(t):t.localeCompare(e)},isValid:function(e,t){if(t?.elements){const n=t?.elements?.map((e=>e.value));if(!n.includes(e))return!1}return!0},Edit:"text"};const ly={sort:function(e,t,n){const s=new Date(e).getTime(),i=new Date(t).getTime();return"asc"===n?s-i:i-s},isValid:function(e,t){if(t?.elements){const n=t?.elements.map((e=>e.value));if(!n.includes(e))return!1}return!0},Edit:"datetime"};const cy={datetime:function({data:e,field:t,onChange:n,hideLabelFromVision:s}){const{id:i,label:r}=t,o=t.getValue({item:e}),a=(0,d.useCallback)((e=>n({[i]:e})),[i,n]);return(0,oe.jsxs)("fieldset",{className:"dataviews-controls__datetime",children:[!s&&(0,oe.jsx)(y.BaseControl.VisualLabel,{as:"legend",children:r}),s&&(0,oe.jsx)(y.VisuallyHidden,{as:"legend",children:r}),(0,oe.jsx)(y.TimePicker,{currentTime:o,onChange:a,hideLabelFromVision:!0})]})},integer:function({data:e,field:t,onChange:n,hideLabelFromVision:s}){var i;const{id:r,label:o,description:a}=t,l=null!==(i=t.getValue({item:e}))&&void 0!==i?i:"",c=(0,d.useCallback)((e=>n({[r]:Number(e)})),[r,n]);return(0,oe.jsx)(y.__experimentalNumberControl,{label:o,help:a,value:l,onChange:c,__next40pxDefaultSize:!0,hideLabelFromVision:s})},radio:function({data:e,field:t,onChange:n,hideLabelFromVision:s}){const{id:i,label:r}=t,o=t.getValue({item:e}),a=(0,d.useCallback)((e=>n({[i]:e})),[i,n]);return t.elements?(0,oe.jsx)(y.RadioControl,{label:r,onChange:a,options:t.elements,selected:o,hideLabelFromVision:s}):null},select:function({data:e,field:t,onChange:n,hideLabelFromVision:s}){var i,r;const{id:o,label:a}=t,l=null!==(i=t.getValue({item:e}))&&void 0!==i?i:"",c=(0,d.useCallback)((e=>n({[o]:e})),[o,n]),u=[{label:(0,b.__)("Select item"),value:""},...null!==(r=t?.elements)&&void 0!==r?r:[]];return(0,oe.jsx)(y.SelectControl,{label:a,value:l,options:u,onChange:c,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,hideLabelFromVision:s})},text:function({data:e,field:t,onChange:n,hideLabelFromVision:s}){const{id:i,label:r,placeholder:o}=t,a=t.getValue({item:e}),l=(0,d.useCallback)((e=>n({[i]:e})),[i,n]);return(0,oe.jsx)(y.TextControl,{label:r,placeholder:o,value:null!=a?a:"",onChange:l,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,hideLabelFromVision:s})}};function uy(e){if(Object.keys(cy).includes(e))return cy[e];throw"Control "+e+" not found"}function dy(e){return e.map((e=>{var t,n,s,i;const r="integer"===(o=e.type)?oy:"text"===o?ay:"datetime"===o?ly:{sort:(e,t,n)=>"number"==typeof e&&"number"==typeof t?"asc"===n?e-t:t-e:"asc"===n?e.localeCompare(t):t.localeCompare(e),isValid:(e,t)=>{if(t?.elements){const n=t?.elements?.map((e=>e.value));if(!n.includes(e))return!1}return!0},Edit:()=>null};var o;const a=e.getValue||(l=e.id,({item:e})=>{const t=l.split(".");let n=e;for(const e of t)n=n.hasOwnProperty(e)?n[e]:void 0;return n});var l;const c=null!==(t=e.sort)&&void 0!==t?t:function(e,t,n){return r.sort(a({item:e}),a({item:t}),n)},u=null!==(n=e.isValid)&&void 0!==n?n:function(e,t){return r.isValid(a({item:e}),t)},d=function(e,t){return"function"==typeof e.Edit?e.Edit:"string"==typeof e.Edit?uy(e.Edit):e.elements?uy("select"):"string"==typeof t.Edit?uy(t.Edit):t.Edit}(e,r),h=e.render||(e.elements?({item:t})=>{const n=a({item:t});return e?.elements?.find((e=>e.value===n))?.label||a({item:t})}:a);return{...e,label:e.label||e.id,header:e.header||e.label||e.id,getValue:a,render:h,sort:c,isValid:u,Edit:d,enableHiding:null===(s=e.enableHiding)||void 0===s||s,enableSorting:null===(i=e.enableSorting)||void 0===i||i}}))}function hy(e=""){return Gx()(e.trim().toLowerCase())}const py=[];function fy(e,t,n){if(!e)return{data:py,paginationInfo:{totalItems:0,totalPages:0}};const s=dy(n);let i=[...e];if(t.search){const e=hy(t.search);i=i.filter((t=>s.filter((e=>e.enableGlobalSearch)).map((e=>hy(e.getValue({item:t})))).some((t=>t.includes(e)))))}if(t.filters&&t.filters?.length>0&&t.filters.forEach((e=>{const t=s.find((t=>t.id===e.field));t&&(e.operator===Zx&&e?.value?.length>0?i=i.filter((n=>{const s=t.getValue({item:n});return Array.isArray(s)?e.value.some((e=>s.includes(e))):"string"==typeof s&&e.value.includes(s)})):e.operator===Kx&&e?.value?.length>0?i=i.filter((n=>{const s=t.getValue({item:n});return Array.isArray(s)?!e.value.some((e=>s.includes(e))):"string"==typeof s&&!e.value.includes(s)})):e.operator===Yx&&e?.value?.length>0?i=i.filter((n=>e.value.every((e=>t.getValue({item:n})?.includes(e))))):e.operator===Xx&&e?.value?.length>0?i=i.filter((n=>e.value.every((e=>!t.getValue({item:n})?.includes(e))))):e.operator===Wx?i=i.filter((n=>e.value===t.getValue({item:n}))):e.operator===qx&&(i=i.filter((n=>e.value!==t.getValue({item:n})))))})),t.sort){const e=t.sort.field,n=s.find((t=>t.id===e));n&&i.sort(((e,s)=>{var i;return n.sort(e,s,null!==(i=t.sort?.direction)&&void 0!==i?i:"desc")}))}let r=i.length,o=1;if(void 0!==t.page&&void 0!==t.perPage){const e=(t.page-1)*t.perPage;r=i?.length||0,o=Math.ceil(r/t.perPage),i=i?.slice(e,e+t.perPage)}return{data:i,paginationInfo:{totalItems:r,totalPages:o}}}const my=(0,d.createContext)({view:{type:iy},onChangeView:()=>{},fields:[],data:[],paginationInfo:{totalItems:0,totalPages:0},selection:[],onChangeSelection:()=>{},setOpenedFilter:()=>{},openedFilter:null,getItemId:e=>e.id,isItemClickable:()=>!0,containerWidth:0}),gy=(0,oe.jsx)(Yt.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,oe.jsx)(Yt.Path,{d:"M10 17.5H14V16H10V17.5ZM6 6V7.5H18V6H6ZM8 12.5H16V11H8V12.5Z"})});var vy=Object.defineProperty,xy=Object.defineProperties,yy=Object.getOwnPropertyDescriptors,by=Object.getOwnPropertySymbols,wy=Object.prototype.hasOwnProperty,_y=Object.prototype.propertyIsEnumerable,jy=(e,t,n)=>t in e?vy(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Sy=(e,t)=>{for(var n in t||(t={}))wy.call(t,n)&&jy(e,n,t[n]);if(by)for(var n of by(t))_y.call(t,n)&&jy(e,n,t[n]);return e},Cy=(e,t)=>xy(e,yy(t)),ky=(e,t)=>{var n={};for(var s in e)wy.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(null!=e&&by)for(var s of by(e))t.indexOf(s)<0&&_y.call(e,s)&&(n[s]=e[s]);return n},Ey=Object.defineProperty,Py=Object.defineProperties,Iy=Object.getOwnPropertyDescriptors,Ty=Object.getOwnPropertySymbols,Oy=Object.prototype.hasOwnProperty,Ay=Object.prototype.propertyIsEnumerable,Ny=(e,t,n)=>t in e?Ey(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,My=(e,t)=>{for(var n in t||(t={}))Oy.call(t,n)&&Ny(e,n,t[n]);if(Ty)for(var n of Ty(t))Ay.call(t,n)&&Ny(e,n,t[n]);return e},Fy=(e,t)=>Py(e,Iy(t)),Vy=(e,t)=>{var n={};for(var s in e)Oy.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(null!=e&&Ty)for(var s of Ty(e))t.indexOf(s)<0&&Ay.call(e,s)&&(n[s]=e[s]);return n};function Ry(...e){}function By(e,t){return"function"==typeof Object.hasOwn?Object.hasOwn(e,t):Object.prototype.hasOwnProperty.call(e,t)}function Dy(...e){return(...t)=>{for(const n of e)"function"==typeof n&&n(...t)}}function Ly(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}function zy(e){return e}function Gy(e,t){if(!e){if("string"!=typeof t)throw new Error("Invariant failed");throw new Error(t)}}function Hy(e){return e.disabled||!0===e["aria-disabled"]||"true"===e["aria-disabled"]}function Uy(e){const t={};for(const n in e)void 0!==e[n]&&(t[n]=e[n]);return t}function Wy(...e){for(const t of e)if(void 0!==t)return t}function qy(e,t){"function"==typeof e?e(t):e&&(e.current=t)}function Zy(e){if(!function(e){return!!e&&!!(0,Gn.isValidElement)(e)&&("ref"in e.props||"ref"in e)}(e))return null;return Sy({},e.props).ref||e.ref}var Ky,Yy="undefined"!=typeof window&&!!(null==(Ky=window.document)?void 0:Ky.createElement);function Xy(e){return e?"self"in e?e.document:e.ownerDocument||document:document}function Jy(e,t=!1){const{activeElement:n}=Xy(e);if(!(null==n?void 0:n.nodeName))return null;if("IFRAME"===n.tagName&&n.contentDocument)return Jy(n.contentDocument.body,t);if(t){const e=n.getAttribute("aria-activedescendant");if(e){const t=Xy(n).getElementById(e);if(t)return t}}return n}function Qy(e,t){return e===t||e.contains(t)}function $y(e){const t=e.tagName.toLowerCase();return"button"===t||!("input"!==t||!e.type)&&-1!==eb.indexOf(e.type)}var eb=["button","color","file","image","reset","submit"];function tb(e){try{const t=e instanceof HTMLInputElement&&null!==e.selectionStart,n="TEXTAREA"===e.tagName;return t||n||!1}catch(e){return!1}}function nb(e){return e.isContentEditable||tb(e)}function sb(e){let t=0,n=0;if(tb(e))t=e.selectionStart||0,n=e.selectionEnd||0;else if(e.isContentEditable){const s=Xy(e).getSelection();if((null==s?void 0:s.rangeCount)&&s.anchorNode&&Qy(e,s.anchorNode)&&s.focusNode&&Qy(e,s.focusNode)){const i=s.getRangeAt(0),r=i.cloneRange();r.selectNodeContents(e),r.setEnd(i.startContainer,i.startOffset),t=r.toString().length,r.setEnd(i.endContainer,i.endOffset),n=r.toString().length}}return{start:t,end:n}}function ib(e,t){const n=null==e?void 0:e.getAttribute("role");return n&&-1!==["dialog","menu","listbox","tree","grid"].indexOf(n)?n:t}function rb(e){if(!e)return null;const t=e=>"auto"===e||"scroll"===e;if(e.clientHeight&&e.scrollHeight>e.clientHeight){const{overflowY:n}=getComputedStyle(e);if(t(n))return e}else if(e.clientWidth&&e.scrollWidth>e.clientWidth){const{overflowX:n}=getComputedStyle(e);if(t(n))return e}return rb(e.parentElement)||document.scrollingElement||document.body}function ob(e,...t){/text|search|password|tel|url/i.test(e.type)&&e.setSelectionRange(...t)}function ab(e,t){const n=e.map(((e,t)=>[t,e]));let s=!1;return n.sort((([e,n],[i,r])=>{const o=t(n),a=t(r);return o===a?0:o&&a?function(e,t){return Boolean(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}(o,a)?(e>i&&(s=!0),-1):(et)):e}function lb(){return Yy&&!!navigator.maxTouchPoints}function cb(){return!!Yy&&/mac|iphone|ipad|ipod/i.test(navigator.platform)}function ub(){return Yy&&cb()&&/apple/i.test(navigator.vendor)}function db(e){return Boolean(e.currentTarget&&!Qy(e.currentTarget,e.target))}function hb(e){return e.target===e.currentTarget}function pb(e,t){const n=new FocusEvent("blur",t),s=e.dispatchEvent(n),i=Fy(My({},t),{bubbles:!0});return e.dispatchEvent(new FocusEvent("focusout",i)),s}function fb(e,t){const n=new MouseEvent("click",t);return e.dispatchEvent(n)}function mb(e,t){const n=t||e.currentTarget,s=e.relatedTarget;return!s||!Qy(n,s)}function gb(e,t,n,s){const i=(e=>{if(s){const t=setTimeout(e,s);return()=>clearTimeout(t)}const t=requestAnimationFrame(e);return()=>cancelAnimationFrame(t)})((()=>{e.removeEventListener(t,r,!0),n()})),r=()=>{i(),n()};return e.addEventListener(t,r,{once:!0,capture:!0}),i}function vb(e,t,n,s=window){const i=[];try{s.document.addEventListener(e,t,n);for(const r of Array.from(s.frames))i.push(vb(e,t,n,r))}catch(e){}return()=>{try{s.document.removeEventListener(e,t,n)}catch(e){}for(const e of i)e()}}var xb=Sy({},Hn),yb=xb.useId,bb=(xb.useDeferredValue,xb.useInsertionEffect),wb=Yy?Gn.useLayoutEffect:Gn.useEffect;function _b(e){const t=(0,Gn.useRef)((()=>{throw new Error("Cannot call an event handler while rendering.")}));return bb?bb((()=>{t.current=e})):t.current=e,(0,Gn.useCallback)(((...e)=>{var n;return null==(n=t.current)?void 0:n.call(t,...e)}),[])}function jb(...e){return(0,Gn.useMemo)((()=>{if(e.some(Boolean))return t=>{for(const n of e)qy(n,t)}}),e)}function Sb(e){if(yb){const t=yb();return e||t}const[t,n]=(0,Gn.useState)(e);return wb((()=>{if(e||t)return;const s=Math.random().toString(36).slice(2,8);n(`id-${s}`)}),[e,t]),e||t}function Cb(e,t,n){const s=function(e){const[t]=(0,Gn.useState)(e);return t}(n),[i,r]=(0,Gn.useState)(s);return(0,Gn.useEffect)((()=>{const n=e&&"current"in e?e.current:e;if(!n)return;const i=()=>{const e=n.getAttribute(t);r(null==e?s:e)},o=new MutationObserver(i);return o.observe(n,{attributeFilter:[t]}),i(),()=>o.disconnect()}),[e,t,s]),i}function kb(e,t){const n=(0,Gn.useRef)(!1);(0,Gn.useEffect)((()=>{if(n.current)return e();n.current=!0}),t),(0,Gn.useEffect)((()=>()=>{n.current=!1}),[])}function Eb(e){return _b("function"==typeof e?e:()=>e)}function Pb(e,t,n=[]){const s=(0,Gn.useCallback)((n=>(e.wrapElement&&(n=e.wrapElement(n)),t(n))),[...n,e.wrapElement]);return Cy(Sy({},e),{wrapElement:s})}var Ib=!1,Tb=0,Ob=0;function Ab(e){(function(e){const t=e.movementX||e.screenX-Tb,n=e.movementY||e.screenY-Ob;return Tb=e.screenX,Ob=e.screenY,t||n||!1})(e)&&(Ib=!0)}function Nb(){Ib=!1}function Mb(e){const t=Gn.forwardRef(((t,n)=>e(Cy(Sy({},t),{ref:n}))));return t.displayName=e.displayName||e.name,t}function Fb(e,t){return Gn.memo(e,t)}function Vb(e,t){const n=t,{wrapElement:s,render:i}=n,r=ky(n,["wrapElement","render"]),o=jb(t.ref,Zy(i));let a;if(Gn.isValidElement(i)){const e=Cy(Sy({},i.props),{ref:o});a=Gn.cloneElement(i,function(e,t){const n=Sy({},e);for(const s in t){if(!By(t,s))continue;if("className"===s){const s="className";n[s]=e[s]?`${e[s]} ${t[s]}`:t[s];continue}if("style"===s){const s="style";n[s]=e[s]?Sy(Sy({},e[s]),t[s]):t[s];continue}const i=t[s];if("function"==typeof i&&s.startsWith("on")){const t=e[s];if("function"==typeof t){n[s]=(...e)=>{i(...e),t(...e)};continue}}n[s]=i}return n}(r,e))}else a=i?i(r):(0,oe.jsx)(e,Sy({},r));return s?s(a):a}function Rb(e){const t=(t={})=>e(t);return t.displayName=e.name,t}function Bb(e=[],t=[]){const n=Gn.createContext(void 0),s=Gn.createContext(void 0),i=()=>Gn.useContext(n),r=t=>e.reduceRight(((e,n)=>(0,oe.jsx)(n,Cy(Sy({},t),{children:e}))),(0,oe.jsx)(n.Provider,Sy({},t)));return{context:n,scopedContext:s,useContext:i,useScopedContext:(e=!1)=>{const t=Gn.useContext(s),n=i();return e?t:t||n},useProviderContext:()=>{const e=Gn.useContext(s),t=i();if(!e||e!==t)return t},ContextProvider:r,ScopedContextProvider:e=>(0,oe.jsx)(r,Cy(Sy({},e),{children:t.reduceRight(((t,n)=>(0,oe.jsx)(n,Cy(Sy({},e),{children:t}))),(0,oe.jsx)(s.Provider,Sy({},e)))}))}}var Db=Bb(),Lb=Db.useContext,zb=(Db.useScopedContext,Db.useProviderContext,Bb([Db.ContextProvider],[Db.ScopedContextProvider])),Gb=zb.useContext,Hb=(zb.useScopedContext,zb.useProviderContext),Ub=zb.ContextProvider,Wb=zb.ScopedContextProvider,qb=(0,Gn.createContext)(void 0),Zb=(0,Gn.createContext)(void 0),Kb=((0,Gn.createContext)(null),(0,Gn.createContext)(null),Bb([Ub],[Wb])),Yb=Kb.useContext;Kb.useScopedContext,Kb.useProviderContext,Kb.ContextProvider,Kb.ScopedContextProvider;function Xb(e,t){const n=e.__unstableInternals;return Gy(n,"Invalid store"),n[t]}function Jb(e,...t){let n=e,s=n,i=Symbol(),r=Ry;const o=new Set,a=new Set,l=new Set,c=new Set,u=new Set,d=new WeakMap,h=new WeakMap,p=(e,t,n=c)=>(n.add(t),h.set(t,e),()=>{var e;null==(e=d.get(t))||e(),d.delete(t),h.delete(t),n.delete(t)}),f=(e,r,o=!1)=>{var l;if(!By(n,e))return;const p=function(e,t){if(function(e){return"function"==typeof e}(e))return e(function(e){return"function"==typeof e}(t)?t():t);return e}(r,n[e]);if(p===n[e])return;if(!o)for(const n of t)null==(l=null==n?void 0:n.setState)||l.call(n,e,p);const f=n;n=Fy(My({},n),{[e]:p});const m=Symbol();i=m,a.add(e);const g=(t,s,i)=>{var r;const o=h.get(t);o&&!o.some((t=>i?i.has(t):t===e))||(null==(r=d.get(t))||r(),d.set(t,t(n,s)))};for(const e of c)g(e,f);queueMicrotask((()=>{if(i!==m)return;const e=n;for(const e of u)g(e,s,a);s=e,a.clear()}))},m={getState:()=>n,setState:f,__unstableInternals:{setup:e=>(l.add(e),()=>l.delete(e)),init:()=>{const e=o.size,s=Symbol();o.add(s);const i=()=>{o.delete(s),o.size||r()};if(e)return i;const a=(c=n,Object.keys(c)).map((e=>Dy(...t.map((t=>{var n;const s=null==(n=null==t?void 0:t.getState)?void 0:n.call(t);if(s&&By(s,e))return tw(t,[e],(t=>{f(e,t[e],!0)}))})))));var c;const u=[];for(const e of l)u.push(e());const d=t.map($b);return r=Dy(...a,...u,...d),i},subscribe:(e,t)=>p(e,t),sync:(e,t)=>(d.set(t,t(n,n)),p(e,t)),batch:(e,t)=>(d.set(t,t(n,s)),p(e,t,u)),pick:e=>Jb(function(e,t){const n={};for(const s of t)By(e,s)&&(n[s]=e[s]);return n}(n,e),m),omit:e=>Jb(function(e,t){const n=My({},e);for(const e of t)By(n,e)&&delete n[e];return n}(n,e),m)}};return m}function Qb(e,...t){if(e)return Xb(e,"setup")(...t)}function $b(e,...t){if(e)return Xb(e,"init")(...t)}function ew(e,...t){if(e)return Xb(e,"subscribe")(...t)}function tw(e,...t){if(e)return Xb(e,"sync")(...t)}function nw(e,...t){if(e)return Xb(e,"batch")(...t)}function sw(e,...t){if(e)return Xb(e,"omit")(...t)}function iw(...e){const t=e.reduce(((e,t)=>{var n;const s=null==(n=null==t?void 0:t.getState)?void 0:n.call(t);return s?Object.assign(e,s):e}),{}),n=Jb(t,...e);return Object.assign({},...e,n)}var rw=i(422),{useSyncExternalStore:ow}=rw;function aw(e,t=zy){const n=Gn.useCallback((t=>e?ew(e,null,t):()=>{}),[e]),s=()=>{const n="string"==typeof t?t:null,s="function"==typeof t?t:null,i=null==e?void 0:e.getState();return s?s(i):i&&n&&By(i,n)?i[n]:void 0};return ow(n,s,s)}function lw(e,t){const n=Gn.useRef({}),s=Gn.useCallback((t=>e?ew(e,null,t):()=>{}),[e]),i=()=>{const s=null==e?void 0:e.getState();let i=!1;const r=n.current;for(const e in t){const n=t[e];if("function"==typeof n){const t=n(s);t!==r[e]&&(r[e]=t,i=!0)}if("string"==typeof n){if(!s)continue;if(!By(s,n))continue;const t=s[n];t!==r[e]&&(r[e]=t,i=!0)}}return i&&(n.current=Sy({},r)),n.current};return ow(s,i,i)}function cw(e,t,n,s){const i=By(t,n)?t[n]:void 0,r=s?t[s]:void 0,o=function(e){const t=(0,Gn.useRef)(e);return wb((()=>{t.current=e})),t}({value:i,setValue:r});wb((()=>tw(e,[n],((e,t)=>{const{value:s,setValue:i}=o.current;i&&e[n]!==t[n]&&e[n]!==s&&i(e[n])}))),[e,n]),wb((()=>{if(void 0!==i)return e.setState(n,i),nw(e,[n],(()=>{void 0!==i&&e.setState(n,i)}))}))}function uw(e,t,n){return kb(t,[n.store]),cw(e,n,"items","setItems"),e}function dw(e){const t=Sb(e.id);return Sy({id:t},e)}function hw(e,t,n){return cw(e=uw(e,t,n),n,"activeId","setActiveId"),cw(e,n,"includesBaseElement"),cw(e,n,"virtualFocus"),cw(e,n,"orientation"),cw(e,n,"rtl"),cw(e,n,"focusLoop"),cw(e,n,"focusWrap"),cw(e,n,"focusShift"),e}function pw(e,t,n){return kb(t,[n.store,n.disclosure]),cw(e,n,"open","setOpen"),cw(e,n,"mounted","setMounted"),cw(e,n,"animated"),Object.assign(e,{disclosure:n.disclosure})}function fw(e,t,n){return pw(e,t,n)}function mw(e,t,n){return kb(t,[n.popover]),cw(e,n,"placement"),fw(e,t,n)}function gw(e={}){var t;e.store;const n=null==(t=e.store)?void 0:t.getState(),s=Wy(e.items,null==n?void 0:n.items,e.defaultItems,[]),i=new Map(s.map((e=>[e.id,e]))),r={items:s,renderedItems:Wy(null==n?void 0:n.renderedItems,[])},o=function(e){return null==e?void 0:e.__unstablePrivateStore}(e.store),a=Jb({items:s,renderedItems:r.renderedItems},o),l=Jb(r,e.store),c=e=>{const t=ab(e,(e=>e.element));a.setState("renderedItems",t),l.setState("renderedItems",t)};Qb(l,(()=>$b(a))),Qb(a,(()=>nw(a,["items"],(e=>{l.setState("items",e.items)})))),Qb(a,(()=>nw(a,["renderedItems"],(e=>{let t=!0,n=requestAnimationFrame((()=>{const{renderedItems:t}=l.getState();e.renderedItems!==t&&c(e.renderedItems)}));if("function"!=typeof IntersectionObserver)return()=>cancelAnimationFrame(n);const s=function(e){var t;const n=e.find((e=>!!e.element)),s=[...e].reverse().find((e=>!!e.element));let i=null==(t=null==n?void 0:n.element)?void 0:t.parentElement;for(;i&&(null==s?void 0:s.element);){if(s&&i.contains(s.element))return i;i=i.parentElement}return Xy(i).body}(e.renderedItems),i=new IntersectionObserver((()=>{t?t=!1:(cancelAnimationFrame(n),n=requestAnimationFrame((()=>c(e.renderedItems))))}),{root:s});for(const t of e.renderedItems)t.element&&i.observe(t.element);return()=>{cancelAnimationFrame(n),i.disconnect()}}))));const u=(e,t,n=!1)=>{let s;t((t=>{const n=t.findIndex((({id:t})=>t===e.id)),r=t.slice();if(-1!==n){s=t[n];const o=My(My({},s),e);r[n]=o,i.set(e.id,o)}else r.push(e),i.set(e.id,e);return r}));return()=>{t((t=>{if(!s)return n&&i.delete(e.id),t.filter((({id:t})=>t!==e.id));const r=t.findIndex((({id:t})=>t===e.id));if(-1===r)return t;const o=t.slice();return o[r]=s,i.set(e.id,s),o}))}},d=e=>u(e,(e=>a.setState("items",e)),!0);return Fy(My({},l),{registerItem:d,renderItem:e=>Dy(d(e),u(e,(e=>a.setState("renderedItems",e)))),item:e=>{if(!e)return null;let t=i.get(e);if(!t){const{items:n}=a.getState();t=n.find((t=>t.id===e)),t&&i.set(e,t)}return t||null},__unstablePrivateStore:a})}function vw(e){const t=[];for(const n of e)t.push(...n);return t}function xw(e){return e.slice().reverse()}var yw={id:null};function bw(e,t){return e.find((e=>t?!e.disabled&&e.id!==t:!e.disabled))}function ww(e,t){return e.filter((e=>e.rowId===t))}function _w(e){const t=[];for(const n of e){const e=t.find((e=>{var t;return(null==(t=e[0])?void 0:t.rowId)===n.rowId}));e?e.push(n):t.push([n])}return t}function jw(e){let t=0;for(const{length:n}of e)n>t&&(t=n);return t}function Sw(e={}){var t;const n=null==(t=e.store)?void 0:t.getState(),s=gw(e),i=Wy(e.activeId,null==n?void 0:n.activeId,e.defaultActiveId),r=Jb(Fy(My({},s.getState()),{id:Wy(e.id,null==n?void 0:n.id,`id-${Math.random().toString(36).slice(2,8)}`),activeId:i,baseElement:Wy(null==n?void 0:n.baseElement,null),includesBaseElement:Wy(e.includesBaseElement,null==n?void 0:n.includesBaseElement,null===i),moves:Wy(null==n?void 0:n.moves,0),orientation:Wy(e.orientation,null==n?void 0:n.orientation,"both"),rtl:Wy(e.rtl,null==n?void 0:n.rtl,!1),virtualFocus:Wy(e.virtualFocus,null==n?void 0:n.virtualFocus,!1),focusLoop:Wy(e.focusLoop,null==n?void 0:n.focusLoop,!1),focusWrap:Wy(e.focusWrap,null==n?void 0:n.focusWrap,!1),focusShift:Wy(e.focusShift,null==n?void 0:n.focusShift,!1)}),s,e.store);Qb(r,(()=>tw(r,["renderedItems","activeId"],(e=>{r.setState("activeId",(t=>{var n;return void 0!==t?t:null==(n=bw(e.renderedItems))?void 0:n.id}))}))));const o=(e="next",t={})=>{var n,s;const i=r.getState(),{skip:o=0,activeId:a=i.activeId,focusShift:l=i.focusShift,focusLoop:c=i.focusLoop,focusWrap:u=i.focusWrap,includesBaseElement:d=i.includesBaseElement,renderedItems:h=i.renderedItems,rtl:p=i.rtl}=t,f="up"===e||"down"===e,m="next"===e||"down"===e,g=m?p&&!f:!p||f,v=l&&!o;let x=f?vw(function(e,t,n){const s=jw(e);for(const i of e)for(let e=0;ee.id===a));if(!y)return null==(s=bw(x))?void 0:s.id;const b=x.some((e=>e.rowId)),w=x.indexOf(y),_=x.slice(w+1),j=ww(_,y.rowId);if(o){const e=function(e,t){return e.filter((e=>t?!e.disabled&&e.id!==t:!e.disabled))}(j,a),t=e.slice(o)[0]||e[e.length-1];return null==t?void 0:t.id}const S=c&&(f?"horizontal"!==c:"vertical"!==c),C=b&&u&&(f?"horizontal"!==u:"vertical"!==u),k=m?(!b||f)&&S&&d:!!f&&d;if(S){const e=function(e,t,n=!1){const s=e.findIndex((e=>e.id===t));return[...e.slice(s+1),...n?[yw]:[],...e.slice(0,s)]}(C&&!k?x:ww(x,y.rowId),a,k),t=bw(e,a);return null==t?void 0:t.id}if(C){const e=bw(k?j:_,a);return k?(null==e?void 0:e.id)||null:null==e?void 0:e.id}const E=bw(j,a);return!E&&k?null:null==E?void 0:E.id};return Fy(My(My({},s),r),{setBaseElement:e=>r.setState("baseElement",e),setActiveId:e=>r.setState("activeId",e),move:e=>{void 0!==e&&(r.setState("activeId",e),r.setState("moves",(e=>e+1)))},first:()=>{var e;return null==(e=bw(r.getState().renderedItems))?void 0:e.id},last:()=>{var e;return null==(e=bw(xw(r.getState().renderedItems)))?void 0:e.id},next:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),o("next",e)),previous:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),o("previous",e)),down:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),o("down",e)),up:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),o("up",e))})}function Cw(e={}){return function(e={}){const t=iw(e.store,sw(e.disclosure,["contentElement","disclosureElement"])),n=null==t?void 0:t.getState(),s=Wy(e.open,null==n?void 0:n.open,e.defaultOpen,!1),i=Wy(e.animated,null==n?void 0:n.animated,!1),r=Jb({open:s,animated:i,animating:!!i&&s,mounted:s,contentElement:Wy(null==n?void 0:n.contentElement,null),disclosureElement:Wy(null==n?void 0:n.disclosureElement,null)},t);return Qb(r,(()=>tw(r,["animated","animating"],(e=>{e.animated||r.setState("animating",!1)})))),Qb(r,(()=>ew(r,["open"],(()=>{r.getState().animated&&r.setState("animating",!0)})))),Qb(r,(()=>tw(r,["open","animating"],(e=>{r.setState("mounted",e.open||e.animating)})))),Fy(My({},r),{disclosure:e.disclosure,setOpen:e=>r.setState("open",e),show:()=>r.setState("open",!0),hide:()=>r.setState("open",!1),toggle:()=>r.setState("open",(e=>!e)),stopAnimation:()=>r.setState("animating",!1),setContentElement:e=>r.setState("contentElement",e),setDisclosureElement:e=>r.setState("disclosureElement",e)})}(e)}var kw=ub()&&lb();function Ew(e={}){var t=e,{tag:n}=t,s=Vy(t,["tag"]);const i=iw(s.store,function(e,...t){if(e)return Xb(e,"pick")(...t)}(n,["value","rtl"])),r=null==n?void 0:n.getState(),o=null==i?void 0:i.getState(),a=Wy(s.activeId,null==o?void 0:o.activeId,s.defaultActiveId,null),l=Sw(Fy(My({},s),{activeId:a,includesBaseElement:Wy(s.includesBaseElement,null==o?void 0:o.includesBaseElement,!0),orientation:Wy(s.orientation,null==o?void 0:o.orientation,"vertical"),focusLoop:Wy(s.focusLoop,null==o?void 0:o.focusLoop,!0),focusWrap:Wy(s.focusWrap,null==o?void 0:o.focusWrap,!0),virtualFocus:Wy(s.virtualFocus,null==o?void 0:o.virtualFocus,!0)})),c=function(e={}){var t=e,{popover:n}=t,s=Vy(t,["popover"]);const i=iw(s.store,sw(n,["arrowElement","anchorElement","contentElement","popoverElement","disclosureElement"])),r=null==i?void 0:i.getState(),o=Cw(Fy(My({},s),{store:i})),a=Wy(s.placement,null==r?void 0:r.placement,"bottom"),l=Jb(Fy(My({},o.getState()),{placement:a,currentPlacement:a,anchorElement:Wy(null==r?void 0:r.anchorElement,null),popoverElement:Wy(null==r?void 0:r.popoverElement,null),arrowElement:Wy(null==r?void 0:r.arrowElement,null),rendered:Symbol("rendered")}),o,i);return Fy(My(My({},o),l),{setAnchorElement:e=>l.setState("anchorElement",e),setPopoverElement:e=>l.setState("popoverElement",e),setArrowElement:e=>l.setState("arrowElement",e),render:()=>l.setState("rendered",Symbol("rendered"))})}(Fy(My({},s),{placement:Wy(s.placement,null==o?void 0:o.placement,"bottom-start")})),u=Wy(s.value,null==o?void 0:o.value,s.defaultValue,""),d=Wy(s.selectedValue,null==o?void 0:o.selectedValue,null==r?void 0:r.values,s.defaultSelectedValue,""),h=Array.isArray(d),p=Fy(My(My({},l.getState()),c.getState()),{value:u,selectedValue:d,resetValueOnSelect:Wy(s.resetValueOnSelect,null==o?void 0:o.resetValueOnSelect,h),resetValueOnHide:Wy(s.resetValueOnHide,null==o?void 0:o.resetValueOnHide,h&&!n),activeValue:null==o?void 0:o.activeValue}),f=Jb(p,l,c,i);return kw&&Qb(f,(()=>tw(f,["virtualFocus"],(()=>{f.setState("virtualFocus",!1)})))),Qb(f,(()=>{if(n)return Dy(tw(f,["selectedValue"],(e=>{Array.isArray(e.selectedValue)&&n.setValues(e.selectedValue)})),tw(n,["values"],(e=>{f.setState("selectedValue",e.values)})))})),Qb(f,(()=>tw(f,["resetValueOnHide","mounted"],(e=>{e.resetValueOnHide&&(e.mounted||f.setState("value",u))})))),Qb(f,(()=>tw(f,["open"],(e=>{e.open||(f.setState("activeId",a),f.setState("moves",0))})))),Qb(f,(()=>tw(f,["moves","activeId"],((e,t)=>{e.moves===t.moves&&f.setState("activeValue",void 0)})))),Qb(f,(()=>nw(f,["moves","renderedItems"],((e,t)=>{if(e.moves===t.moves)return;const{activeId:n}=f.getState(),s=l.item(n);f.setState("activeValue",null==s?void 0:s.value)})))),Fy(My(My(My({},c),l),f),{tag:n,setValue:e=>f.setState("value",e),resetValue:()=>f.setState("value",p.value),setSelectedValue:e=>f.setState("selectedValue",e)})}function Pw(e={}){e=function(e){const t=Yb();return dw(e=Cy(Sy({},e),{tag:void 0!==e.tag?e.tag:t}))}(e);const[t,n]=function(e,t){const[n,s]=Gn.useState((()=>e(t)));wb((()=>$b(n)),[n]);const i=Gn.useCallback((e=>aw(n,e)),[n]);return[Gn.useMemo((()=>Cy(Sy({},n),{useState:i})),[n,i]),_b((()=>{s((n=>e(Sy(Sy({},t),n.getState()))))}))]}(Ew,e);return function(e,t,n){return kb(t,[n.tag]),cw(e,n,"value","setValue"),cw(e,n,"selectedValue","setSelectedValue"),cw(e,n,"resetValueOnHide"),cw(e,n,"resetValueOnSelect"),Object.assign(hw(mw(e,t,n),t,n),{tag:n.tag})}(t,n,e)}var Iw=Bb(),Tw=(Iw.useContext,Iw.useScopedContext,Iw.useProviderContext),Ow=Bb([Iw.ContextProvider],[Iw.ScopedContextProvider]),Aw=(Ow.useContext,Ow.useScopedContext,Ow.useProviderContext,Ow.ContextProvider),Nw=Ow.ScopedContextProvider,Mw=((0,Gn.createContext)(void 0),(0,Gn.createContext)(void 0),Bb([Aw],[Nw])),Fw=(Mw.useContext,Mw.useScopedContext,Mw.useProviderContext),Vw=Mw.ContextProvider,Rw=Mw.ScopedContextProvider,Bw=(0,Gn.createContext)(void 0),Dw=Bb([Vw,Ub],[Rw,Wb]),Lw=Dw.useContext,zw=Dw.useScopedContext,Gw=Dw.useProviderContext,Hw=Dw.ContextProvider,Uw=Dw.ScopedContextProvider,Ww=(0,Gn.createContext)(void 0),qw=(0,Gn.createContext)(!1);function Zw(e={}){const t=Pw(e);return(0,oe.jsx)(Hw,{value:t,children:e.children})}var Kw=Rb((function(e){var t=e,{store:n}=t,s=ky(t,["store"]);const i=Gw();Gy(n=n||i,!1);const r=n.useState((e=>{var t;return null==(t=e.baseElement)?void 0:t.id}));return Uy(s=Sy({htmlFor:r},s))})),Yw=Fb(Mb((function(e){return Vb("label",Kw(e))}))),Xw=Rb((function(e){var t=e,{store:n}=t,s=ky(t,["store"]);const i=Fw();return n=n||i,s=Cy(Sy({},s),{ref:jb(null==n?void 0:n.setAnchorElement,s.ref)})}));Mb((function(e){return Vb("div",Xw(e))}));function Jw(e,t){return t&&e.item(t)||null}var Qw=Symbol("FOCUS_SILENTLY");function $w(e,t,n){if(!t)return!1;if(t===n)return!1;const s=e.item(t.id);return!!s&&(!n||s.element!==n)}var e_=(0,Gn.createContext)(!0),t_="input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], summary, iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false'])";function n_(e){return!!e.matches(t_)&&(!!function(e){if("function"==typeof e.checkVisibility)return e.checkVisibility();const t=e;return t.offsetWidth>0||t.offsetHeight>0||e.getClientRects().length>0}(e)&&!e.closest("[inert]"))}function s_(e){const t=Jy(e);if(!t)return!1;if(t===e)return!0;const n=t.getAttribute("aria-activedescendant");return!!n&&n===e.id}function i_(e){const t=Jy(e);if(!t)return!1;if(Qy(e,t))return!0;const n=t.getAttribute("aria-activedescendant");return!!n&&("id"in e&&(n===e.id||!!e.querySelector(`#${CSS.escape(n)}`)))}var r_=ub(),o_=["text","search","url","tel","email","password","number","date","month","week","time","datetime","datetime-local"],a_=Symbol("safariFocusAncestor");function l_(e,t){e&&(e[a_]=t)}function c_(e){return!("input"!==e.tagName.toLowerCase()||!e.type)&&("radio"===e.type||"checkbox"===e.type)}function u_(e,t,n,s,i){return e?t?n&&!s?-1:void 0:n?i:i||0:i}function d_(e,t){return _b((n=>{null==e||e(n),n.defaultPrevented||t&&(n.stopPropagation(),n.preventDefault())}))}var h_=!0;function p_(e){const t=e.target;t&&"hasAttribute"in t&&(t.hasAttribute("data-focus-visible")||(h_=!1))}function f_(e){e.metaKey||e.ctrlKey||e.altKey||(h_=!0)}var m_=Rb((function(e){var t=e,{focusable:n=!0,accessibleWhenDisabled:s,autoFocus:i,onFocusVisible:r}=t,o=ky(t,["focusable","accessibleWhenDisabled","autoFocus","onFocusVisible"]);const a=(0,Gn.useRef)(null);(0,Gn.useEffect)((()=>{n&&(vb("mousedown",p_,!0),vb("keydown",f_,!0))}),[n]),r_&&(0,Gn.useEffect)((()=>{if(!n)return;const e=a.current;if(!e)return;if(!c_(e))return;const t=function(e){return"labels"in e?e.labels:null}(e);if(!t)return;const s=()=>queueMicrotask((()=>e.focus()));for(const e of t)e.addEventListener("mouseup",s);return()=>{for(const e of t)e.removeEventListener("mouseup",s)}}),[n]);const l=n&&Hy(o),c=!!l&&!s,[u,d]=(0,Gn.useState)(!1);(0,Gn.useEffect)((()=>{n&&c&&u&&d(!1)}),[n,c,u]),(0,Gn.useEffect)((()=>{if(!n)return;if(!u)return;const e=a.current;if(!e)return;if("undefined"==typeof IntersectionObserver)return;const t=new IntersectionObserver((()=>{n_(e)||d(!1)}));return t.observe(e),()=>t.disconnect()}),[n,u]);const h=d_(o.onKeyPressCapture,l),p=d_(o.onMouseDownCapture,l),f=d_(o.onClickCapture,l),m=o.onMouseDown,g=_b((e=>{if(null==m||m(e),e.defaultPrevented)return;if(!n)return;const t=e.currentTarget;if(!r_)return;if(db(e))return;if(!$y(t)&&!c_(t))return;let s=!1;const i=()=>{s=!0};t.addEventListener("focusin",i,{capture:!0,once:!0});const r=function(e){for(;e&&!n_(e);)e=e.closest(t_);return e||null}(t.parentElement);l_(r,!0),gb(t,"mouseup",(()=>{t.removeEventListener("focusin",i,!0),l_(r,!1),s||function(e){!i_(e)&&n_(e)&&e.focus()}(t)}))})),v=(e,t)=>{if(t&&(e.currentTarget=t),!n)return;const s=e.currentTarget;s&&s_(s)&&(null==r||r(e),e.defaultPrevented||(s.dataset.focusVisible="true",d(!0)))},x=o.onKeyDownCapture,y=_b((e=>{if(null==x||x(e),e.defaultPrevented)return;if(!n)return;if(u)return;if(e.metaKey)return;if(e.altKey)return;if(e.ctrlKey)return;if(!hb(e))return;const t=e.currentTarget;gb(t,"focusout",(()=>v(e,t)))})),b=o.onFocusCapture,w=_b((e=>{if(null==b||b(e),e.defaultPrevented)return;if(!n)return;if(!hb(e))return void d(!1);const t=e.currentTarget,s=()=>v(e,t);h_||function(e){const{tagName:t,readOnly:n,type:s}=e;return"TEXTAREA"===t&&!n||("SELECT"===t&&!n||("INPUT"!==t||n?!!e.isContentEditable||!("combobox"!==e.getAttribute("role")||!e.dataset.name):o_.includes(s)))}(e.target)?gb(e.target,"focusout",s):d(!1)})),_=o.onBlur,j=_b((e=>{null==_||_(e),n&&mb(e)&&d(!1)})),S=(0,Gn.useContext)(e_),C=_b((e=>{n&&i&&e&&S&&queueMicrotask((()=>{s_(e)||n_(e)&&e.focus()}))})),k=function(e,t){const n=e=>{if("string"==typeof e)return e},[s,i]=(0,Gn.useState)((()=>n(t)));return wb((()=>{const s=e&&"current"in e?e.current:e;i((null==s?void 0:s.tagName.toLowerCase())||n(t))}),[e,t]),s}(a),E=n&&function(e){return!e||"button"===e||"summary"===e||"input"===e||"select"===e||"textarea"===e||"a"===e}(k),P=n&&function(e){return!e||"button"===e||"input"===e||"select"===e||"textarea"===e}(k),I=o.style,T=(0,Gn.useMemo)((()=>c?Sy({pointerEvents:"none"},I):I),[c,I]);return Uy(o=Cy(Sy({"data-focus-visible":n&&u||void 0,"data-autofocus":i||void 0,"aria-disabled":l||void 0},o),{ref:jb(a,C,o.ref),style:T,tabIndex:u_(n,c,E,P,o.tabIndex),disabled:!(!P||!c)||void 0,contentEditable:l?void 0:o.contentEditable,onKeyPressCapture:h,onClickCapture:f,onMouseDownCapture:p,onMouseDown:g,onKeyDownCapture:y,onFocusCapture:w,onBlur:j}))}));Mb((function(e){return Vb("div",m_(e))}));function g_(e,t,n){return _b((s=>{var i;if(null==t||t(s),s.defaultPrevented)return;if(s.isPropagationStopped())return;if(!hb(s))return;if(function(e){return"Shift"===e.key||"Control"===e.key||"Alt"===e.key||"Meta"===e.key}(s))return;if(function(e){const t=e.target;return!(t&&!tb(t)||1!==e.key.length||e.ctrlKey||e.metaKey)}(s))return;const r=e.getState(),o=null==(i=Jw(e,r.activeId))?void 0:i.element;if(!o)return;const a=s,{view:l}=a,c=ky(a,["view"]);o!==(null==n?void 0:n.current)&&o.focus(),function(e,t,n){const s=new KeyboardEvent(t,n);return e.dispatchEvent(s)}(o,s.type,c)||s.preventDefault(),s.currentTarget.contains(o)&&s.stopPropagation()}))}var v_=Rb((function(e){var t=e,{store:n,composite:s=!0,focusOnMove:i=s,moveOnKeyPress:r=!0}=t,o=ky(t,["store","composite","focusOnMove","moveOnKeyPress"]);const a=Hb();Gy(n=n||a,!1);const l=(0,Gn.useRef)(null),c=(0,Gn.useRef)(null),u=function(e){const[t,n]=(0,Gn.useState)(!1),s=(0,Gn.useCallback)((()=>n(!0)),[]),i=e.useState((t=>Jw(e,t.activeId)));return(0,Gn.useEffect)((()=>{const e=null==i?void 0:i.element;t&&e&&(n(!1),e.focus({preventScroll:!0}))}),[i,t]),s}(n),d=n.useState("moves"),[,h]=function(e){const[t,n]=(0,Gn.useState)(null);return wb((()=>{if(null==t)return;if(!e)return;let n=null;return e((e=>(n=e,t))),()=>{e(n)}}),[t,e]),[t,n]}(s?n.setBaseElement:null);(0,Gn.useEffect)((()=>{var e;if(!n)return;if(!d)return;if(!s)return;if(!i)return;const{activeId:t}=n.getState(),r=null==(e=Jw(n,t))?void 0:e.element;var o,a;r&&("scrollIntoView"in(o=r)?(o.focus({preventScroll:!0}),o.scrollIntoView(My({block:"nearest",inline:"nearest"},a))):o.focus())}),[n,d,s,i]),wb((()=>{if(!n)return;if(!d)return;if(!s)return;const{baseElement:e,activeId:t}=n.getState();if(!(null===t))return;if(!e)return;const i=c.current;c.current=null,i&&pb(i,{relatedTarget:e}),s_(e)||e.focus()}),[n,d,s]);const p=n.useState("activeId"),f=n.useState("virtualFocus");wb((()=>{var e;if(!n)return;if(!s)return;if(!f)return;const t=c.current;if(c.current=null,!t)return;const i=(null==(e=Jw(n,p))?void 0:e.element)||Jy(t);i!==t&&pb(t,{relatedTarget:i})}),[n,p,f,s]);const m=g_(n,o.onKeyDownCapture,c),g=g_(n,o.onKeyUpCapture,c),v=o.onFocusCapture,x=_b((e=>{if(null==v||v(e),e.defaultPrevented)return;if(!n)return;const{virtualFocus:t}=n.getState();if(!t)return;const s=e.relatedTarget,i=function(e){const t=e[Qw];return delete e[Qw],t}(e.currentTarget);hb(e)&&i&&(e.stopPropagation(),c.current=s)})),y=o.onFocus,b=_b((e=>{if(null==y||y(e),e.defaultPrevented)return;if(!s)return;if(!n)return;const{relatedTarget:t}=e,{virtualFocus:i}=n.getState();i?hb(e)&&!$w(n,t)&&queueMicrotask(u):hb(e)&&n.setActiveId(null)})),w=o.onBlurCapture,_=_b((e=>{var t;if(null==w||w(e),e.defaultPrevented)return;if(!n)return;const{virtualFocus:s,activeId:i}=n.getState();if(!s)return;const r=null==(t=Jw(n,i))?void 0:t.element,o=e.relatedTarget,a=$w(n,o),l=c.current;if(c.current=null,hb(e)&&a)o===r?l&&l!==o&&pb(l,e):r?pb(r,e):l&&pb(l,e),e.stopPropagation();else{!$w(n,e.target)&&r&&pb(r,e)}})),j=o.onKeyDown,S=Eb(r),C=_b((e=>{var t;if(null==j||j(e),e.defaultPrevented)return;if(!n)return;if(!hb(e))return;const{orientation:s,renderedItems:i,activeId:r}=n.getState(),o=Jw(n,r);if(null==(t=null==o?void 0:o.element)?void 0:t.isConnected)return;const a="horizontal"!==s,l="vertical"!==s,c=i.some((e=>!!e.rowId));if(("ArrowLeft"===e.key||"ArrowRight"===e.key||"Home"===e.key||"End"===e.key)&&tb(e.currentTarget))return;const u={ArrowUp:(c||a)&&(()=>{if(c){const e=function(e){return function(e,t){return e.find((e=>t?!e.disabled&&e.id!==t:!e.disabled))}(vw(xw(function(e){const t=[];for(const n of e){const e=t.find((e=>{var t;return(null==(t=e[0])?void 0:t.rowId)===n.rowId}));e?e.push(n):t.push([n])}return t}(e))))}(i);return null==e?void 0:e.id}return null==n?void 0:n.last()}),ArrowRight:(c||l)&&n.first,ArrowDown:(c||a)&&n.first,ArrowLeft:(c||l)&&n.last,Home:n.first,End:n.last,PageUp:n.first,PageDown:n.last},d=u[e.key];if(d){const t=d();if(void 0!==t){if(!S(e))return;e.preventDefault(),n.move(t)}}}));o=Pb(o,(e=>(0,oe.jsx)(Ub,{value:n,children:e})),[n]);const k=n.useState((e=>{var t;if(n&&s&&e.virtualFocus)return null==(t=Jw(n,e.activeId))?void 0:t.id}));o=Cy(Sy({"aria-activedescendant":k},o),{ref:jb(l,h,o.ref),onKeyDownCapture:m,onKeyUpCapture:g,onFocusCapture:x,onFocus:b,onBlurCapture:_,onKeyDown:C});const E=n.useState((e=>s&&(e.virtualFocus||null===e.activeId)));return o=m_(Sy({focusable:E},o))}));Mb((function(e){return Vb("div",v_(e))}));function x_(e,t,n){if(!n)return!1;const s=e.find((e=>!e.disabled&&e.value));return(null==s?void 0:s.value)===t}function y_(e,t){return!!t&&(null!=e&&(e=Ly(e),t.length>e.length&&0===t.toLowerCase().indexOf(e.toLowerCase())))}var b_=Rb((function(e){var t=e,{store:n,focusable:s=!0,autoSelect:i=!1,getAutoSelectId:r,setValueOnChange:o,showMinLength:a=0,showOnChange:l,showOnMouseDown:c,showOnClick:u=c,showOnKeyDown:d,showOnKeyPress:h=d,blurActiveItemOnClick:p,setValueOnClick:f=!0,moveOnKeyPress:m=!0,autoComplete:g="list"}=t,v=ky(t,["store","focusable","autoSelect","getAutoSelectId","setValueOnChange","showMinLength","showOnChange","showOnMouseDown","showOnClick","showOnKeyDown","showOnKeyPress","blurActiveItemOnClick","setValueOnClick","moveOnKeyPress","autoComplete"]);const x=Gw();Gy(n=n||x,!1);const y=(0,Gn.useRef)(null),[b,w]=(0,Gn.useReducer)((()=>[]),[]),_=(0,Gn.useRef)(!1),j=(0,Gn.useRef)(!1),S=n.useState((e=>e.virtualFocus&&i)),C="inline"===g||"both"===g,[k,E]=(0,Gn.useState)(C);!function(e,t){const n=(0,Gn.useRef)(!1);wb((()=>{if(n.current)return e();n.current=!0}),t),wb((()=>()=>{n.current=!1}),[])}((()=>{C&&E(!0)}),[C]);const P=n.useState("value"),I=(0,Gn.useRef)();(0,Gn.useEffect)((()=>tw(n,["selectedValue","activeId"],((e,t)=>{I.current=t.selectedValue}))),[]);const T=n.useState((e=>{var t;if(C&&k){if(e.activeValue&&Array.isArray(e.selectedValue)){if(e.selectedValue.includes(e.activeValue))return;if(null==(t=I.current)?void 0:t.includes(e.activeValue))return}return e.activeValue}})),O=n.useState("renderedItems"),A=n.useState("open"),N=n.useState("contentElement"),M=(0,Gn.useMemo)((()=>{if(!C)return P;if(!k)return P;if(x_(O,T,S)){if(y_(P,T)){const e=(null==T?void 0:T.slice(P.length))||"";return P+e}return P}return T||P}),[C,k,O,T,S,P]);(0,Gn.useEffect)((()=>{const e=y.current;if(!e)return;const t=()=>E(!0);return e.addEventListener("combobox-item-move",t),()=>{e.removeEventListener("combobox-item-move",t)}}),[]),(0,Gn.useEffect)((()=>{if(!C)return;if(!k)return;if(!T)return;if(!x_(O,T,S))return;if(!y_(P,T))return;let e=Ry;return queueMicrotask((()=>{const t=y.current;if(!t)return;const{start:n,end:s}=sb(t),i=P.length,r=T.length;ob(t,i,r),e=()=>{if(!s_(t))return;const{start:e,end:o}=sb(t);e===i&&o===r&&ob(t,n,s)}})),()=>e()}),[b,C,k,T,O,S,P]);const F=(0,Gn.useRef)(null),V=_b(r),R=(0,Gn.useRef)(null);(0,Gn.useEffect)((()=>{if(!A)return;if(!N)return;const e=rb(N);if(!e)return;F.current=e;const t=()=>{_.current=!1},s=()=>{if(!n)return;if(!_.current)return;const{activeId:e}=n.getState();null!==e&&e!==R.current&&(_.current=!1)},i={passive:!0,capture:!0};return e.addEventListener("wheel",t,i),e.addEventListener("touchmove",t,i),e.addEventListener("scroll",s,i),()=>{e.removeEventListener("wheel",t,!0),e.removeEventListener("touchmove",t,!0),e.removeEventListener("scroll",s,!0)}}),[A,N,n]),wb((()=>{P&&(j.current||(_.current=!0))}),[P]),wb((()=>{"always"!==S&&A||(_.current=A)}),[S,A]);const B=n.useState("resetValueOnSelect");kb((()=>{var e,t;const s=_.current;if(!n)return;if(!A)return;if(!s&&!B)return;const{baseElement:i,contentElement:r,activeId:o}=n.getState();if(!i||s_(i)){if(null==r?void 0:r.hasAttribute("data-placing")){const e=new MutationObserver(w);return e.observe(r,{attributeFilter:["data-placing"]}),()=>e.disconnect()}if(S&&s){const t=V(O),s=void 0!==t?t:null!=(e=function(e){const t=e.find((e=>{var t;return!e.disabled&&"tab"!==(null==(t=e.element)?void 0:t.getAttribute("role"))}));return null==t?void 0:t.id}(O))?e:n.first();R.current=s,n.move(null!=s?s:null)}else{const e=null==(t=n.item(o||n.first()))?void 0:t.element;e&&"scrollIntoView"in e&&e.scrollIntoView({block:"nearest",inline:"nearest"})}}}),[n,A,b,P,S,B,V,O]),(0,Gn.useEffect)((()=>{if(!C)return;const e=y.current;if(!e)return;const t=[e,N].filter((e=>!!e)),s=e=>{t.every((t=>mb(e,t)))&&(null==n||n.setValue(M))};for(const e of t)e.addEventListener("focusout",s);return()=>{for(const e of t)e.removeEventListener("focusout",s)}}),[C,N,n,M]);const D=e=>e.currentTarget.value.length>=a,L=v.onChange,z=Eb(null!=l?l:D),G=Eb(null!=o?o:!n.tag),H=_b((e=>{if(null==L||L(e),e.defaultPrevented)return;if(!n)return;const t=e.currentTarget,{value:s,selectionStart:i,selectionEnd:r}=t,o=e.nativeEvent;if(_.current=!0,function(e){return"input"===e.type}(o)&&(o.isComposing&&(_.current=!1,j.current=!0),C)){const e="insertText"===o.inputType||"insertCompositionText"===o.inputType,t=i===s.length;E(e&&t)}if(G(e)){const e=s===n.getState().value;n.setValue(s),queueMicrotask((()=>{ob(t,i,r)})),C&&S&&e&&w()}z(e)&&n.show(),S&&_.current||n.setActiveId(null)})),U=v.onCompositionEnd,W=_b((e=>{_.current=!0,j.current=!1,null==U||U(e),e.defaultPrevented||S&&w()})),q=v.onMouseDown,Z=Eb(null!=p?p:()=>!!(null==n?void 0:n.getState().includesBaseElement)),K=Eb(f),Y=Eb(null!=u?u:D),X=_b((e=>{null==q||q(e),e.defaultPrevented||e.button||e.ctrlKey||n&&(Z(e)&&n.setActiveId(null),K(e)&&n.setValue(M),Y(e)&&gb(e.currentTarget,"mouseup",n.show))})),J=v.onKeyDown,Q=Eb(null!=h?h:D),$=_b((e=>{if(null==J||J(e),e.repeat||(_.current=!1),e.defaultPrevented)return;if(e.ctrlKey)return;if(e.altKey)return;if(e.shiftKey)return;if(e.metaKey)return;if(!n)return;const{open:t}=n.getState();t||"ArrowUp"!==e.key&&"ArrowDown"!==e.key||Q(e)&&(e.preventDefault(),n.show())})),ee=v.onBlur,te=_b((e=>{_.current=!1,null==ee||ee(e),e.defaultPrevented})),ne=Sb(v.id),se=function(e){return"inline"===e||"list"===e||"both"===e||"none"===e}(g)?g:void 0,ie=n.useState((e=>null===e.activeId));return v=Cy(Sy({id:ne,role:"combobox","aria-autocomplete":se,"aria-haspopup":ib(N,"listbox"),"aria-expanded":A,"aria-controls":null==N?void 0:N.id,"data-active-item":ie||void 0,value:M},v),{ref:jb(y,v.ref),onChange:H,onCompositionEnd:W,onMouseDown:X,onKeyDown:$,onBlur:te}),v=v_(Cy(Sy({store:n,focusable:s},v),{moveOnKeyPress:e=>!function(e,...t){const n="function"==typeof e?e(...t):e;return null!=n&&!n}(m,e)&&(C&&E(!0),!0)})),v=Xw(Sy({store:n},v)),Sy({autoComplete:"off"},v)})),w_=Mb((function(e){return Vb("input",b_(e))}));function __(e,t){const n=setTimeout(t,e);return()=>clearTimeout(n)}function j_(...e){return e.join(", ").split(", ").reduce(((e,t)=>{const n=t.endsWith("ms")?1:1e3,s=Number.parseFloat(t||"0s")*n;return s>e?s:e}),0)}function S_(e,t,n){return!(n||!1===t||e&&!t)}var C_=Rb((function(e){var t=e,{store:n,alwaysVisible:s}=t,i=ky(t,["store","alwaysVisible"]);const r=Tw();Gy(n=n||r,!1);const o=(0,Gn.useRef)(null),a=Sb(i.id),[l,c]=(0,Gn.useState)(null),u=n.useState("open"),d=n.useState("mounted"),h=n.useState("animated"),p=n.useState("contentElement"),f=aw(n.disclosure,"contentElement");wb((()=>{o.current&&(null==n||n.setContentElement(o.current))}),[n]),wb((()=>{let e;return null==n||n.setState("animated",(t=>(e=t,!0))),()=>{void 0!==e&&(null==n||n.setState("animated",e))}}),[n]),wb((()=>{if(h){if(null==p?void 0:p.isConnected)return function(e){let t=requestAnimationFrame((()=>{t=requestAnimationFrame(e)}));return()=>cancelAnimationFrame(t)}((()=>{c(u?"enter":d?"leave":null)}));c(null)}}),[h,p,u,d]),wb((()=>{if(!n)return;if(!h)return;if(!l)return;if(!p)return;const e=()=>null==n?void 0:n.setState("animating",!1),t=()=>(0,Mr.flushSync)(e);if("leave"===l&&u)return;if("enter"===l&&!u)return;if("number"==typeof h){return __(h,t)}const{transitionDuration:s,animationDuration:i,transitionDelay:r,animationDelay:o}=getComputedStyle(p),{transitionDuration:a="0",animationDuration:c="0",transitionDelay:d="0",animationDelay:m="0"}=f?getComputedStyle(f):{},g=j_(r,o,d,m)+j_(s,i,a,c);if(!g)return"enter"===l&&n.setState("animated",!1),void e();return __(Math.max(g-1e3/60,0),t)}),[n,h,p,f,u,l]),i=Pb(i,(e=>(0,oe.jsx)(Nw,{value:n,children:e})),[n]);const m=S_(d,i.hidden,s),g=i.style,v=(0,Gn.useMemo)((()=>m?Cy(Sy({},g),{display:"none"}):g),[m,g]);return Uy(i=Cy(Sy({id:a,"data-open":u||void 0,"data-enter":"enter"===l||void 0,"data-leave":"leave"===l||void 0,hidden:m},i),{ref:jb(a?n.setContentElement:null,o,i.ref),style:v}))})),k_=Mb((function(e){return Vb("div",C_(e))})),E_=(Mb((function(e){var t=e,{unmountOnHide:n}=t,s=ky(t,["unmountOnHide"]);const i=Tw();return!1===aw(s.store||i,(e=>!n||(null==e?void 0:e.mounted)))?null:(0,oe.jsx)(k_,Sy({},s))})),Rb((function(e){var t=e,{store:n,alwaysVisible:s}=t,i=ky(t,["store","alwaysVisible"]);const r=zw(!0),o=Lw(),a=!!(n=n||o)&&n===r;Gy(n,!1);const l=(0,Gn.useRef)(null),c=Sb(i.id),u=n.useState("mounted"),d=S_(u,i.hidden,s),h=d?Cy(Sy({},i.style),{display:"none"}):i.style,p=n.useState((e=>Array.isArray(e.selectedValue))),f=Cb(l,"role",i.role),m=("listbox"===f||"tree"===f||"grid"===f)&&p||void 0,[g,v]=(0,Gn.useState)(!1),x=n.useState("contentElement");wb((()=>{if(!u)return;const e=l.current;if(!e)return;if(x!==e)return;const t=()=>{v(!!e.querySelector("[role='listbox']"))},n=new MutationObserver(t);return n.observe(e,{subtree:!0,childList:!0,attributeFilter:["role"]}),t(),()=>n.disconnect()}),[u,x]),g||(i=Sy({role:"listbox","aria-multiselectable":m},i)),i=Pb(i,(e=>(0,oe.jsx)(Uw,{value:n,children:(0,oe.jsx)(Bw.Provider,{value:f,children:e})})),[n,f]);const y=!c||r&&a?null:n.setContentElement;return Uy(i=Cy(Sy({id:c,hidden:d},i),{ref:jb(y,l,i.ref),style:h}))}))),P_=Mb((function(e){return Vb("div",E_(e))}));function I_(e){const t=e.relatedTarget;return(null==t?void 0:t.nodeType)===Node.ELEMENT_NODE?t:null}var T_=Symbol("composite-hover");var O_=Rb((function(e){var t=e,{store:n,focusOnHover:s=!0,blurOnHoverEnd:i=!!s}=t,r=ky(t,["store","focusOnHover","blurOnHoverEnd"]);const o=Gb();Gy(n=n||o,!1);const a=((0,Gn.useEffect)((()=>{vb("mousemove",Ab,!0),vb("mousedown",Nb,!0),vb("mouseup",Nb,!0),vb("keydown",Nb,!0),vb("scroll",Nb,!0)}),[]),_b((()=>Ib))),l=r.onMouseMove,c=Eb(s),u=_b((e=>{if(null==l||l(e),!e.defaultPrevented&&a()&&c(e)){if(!i_(e.currentTarget)){const e=null==n?void 0:n.getState().baseElement;e&&!s_(e)&&e.focus()}null==n||n.setActiveId(e.currentTarget.id)}})),d=r.onMouseLeave,h=Eb(i),p=_b((e=>{var t;null==d||d(e),e.defaultPrevented||a()&&(function(e){const t=I_(e);return!!t&&Qy(e.currentTarget,t)}(e)||function(e){let t=I_(e);if(!t)return!1;do{if(By(t,T_)&&t[T_])return!0;t=t.parentElement}while(t);return!1}(e)||c(e)&&h(e)&&(null==n||n.setActiveId(null),null==(t=null==n?void 0:n.getState().baseElement)||t.focus()))})),f=(0,Gn.useCallback)((e=>{e&&(e[T_]=!0)}),[]);return Uy(r=Cy(Sy({},r),{ref:jb(f,r.ref),onMouseMove:u,onMouseLeave:p}))})),A_=(Fb(Mb((function(e){return Vb("div",O_(e))}))),Rb((function(e){var t=e,{store:n,shouldRegisterItem:s=!0,getItem:i=zy,element:r}=t,o=ky(t,["store","shouldRegisterItem","getItem","element"]);const a=Lb();n=n||a;const l=Sb(o.id),c=(0,Gn.useRef)(r);return(0,Gn.useEffect)((()=>{const e=c.current;if(!l)return;if(!e)return;if(!s)return;const t=i({id:l,element:e});return null==n?void 0:n.renderItem(t)}),[l,s,i,n]),Uy(o=Cy(Sy({},o),{ref:jb(c,o.ref)}))})));Mb((function(e){return Vb("div",A_(e))}));function N_(e){if(!e.isTrusted)return!1;const t=e.currentTarget;return"Enter"===e.key?$y(t)||"SUMMARY"===t.tagName||"A"===t.tagName:" "===e.key&&($y(t)||"SUMMARY"===t.tagName||"INPUT"===t.tagName||"SELECT"===t.tagName)}var M_=Symbol("command"),F_=Rb((function(e){var t=e,{clickOnEnter:n=!0,clickOnSpace:s=!0}=t,i=ky(t,["clickOnEnter","clickOnSpace"]);const r=(0,Gn.useRef)(null),[o,a]=(0,Gn.useState)(!1);(0,Gn.useEffect)((()=>{r.current&&a($y(r.current))}),[]);const[l,c]=(0,Gn.useState)(!1),u=(0,Gn.useRef)(!1),d=Hy(i),[h,p]=function(e,t,n){const s=e.onLoadedMetadataCapture,i=(0,Gn.useMemo)((()=>Object.assign((()=>{}),Cy(Sy({},s),{[t]:n}))),[s,t,n]);return[null==s?void 0:s[t],{onLoadedMetadataCapture:i}]}(i,M_,!0),f=i.onKeyDown,m=_b((e=>{null==f||f(e);const t=e.currentTarget;if(e.defaultPrevented)return;if(h)return;if(d)return;if(!hb(e))return;if(tb(t))return;if(t.isContentEditable)return;const i=n&&"Enter"===e.key,r=s&&" "===e.key,o="Enter"===e.key&&!n,a=" "===e.key&&!s;if(o||a)e.preventDefault();else if(i||r){const n=N_(e);if(i){if(!n){e.preventDefault();const n=e,{view:s}=n,i=ky(n,["view"]),r=()=>fb(t,i);Yy&&/firefox\//i.test(navigator.userAgent)?gb(t,"keyup",r):queueMicrotask(r)}}else r&&(u.current=!0,n||(e.preventDefault(),c(!0)))}})),g=i.onKeyUp,v=_b((e=>{if(null==g||g(e),e.defaultPrevented)return;if(h)return;if(d)return;if(e.metaKey)return;const t=s&&" "===e.key;if(u.current&&t&&(u.current=!1,!N_(e))){e.preventDefault(),c(!1);const t=e.currentTarget,n=e,{view:s}=n,i=ky(n,["view"]);queueMicrotask((()=>fb(t,i)))}}));return i=Cy(Sy(Sy({"data-active":l||void 0,type:o?"button":void 0},p),i),{ref:jb(r,i.ref),onKeyDown:m,onKeyUp:v}),i=m_(i)}));Mb((function(e){return Vb("button",F_(e))}));function V_(e,t=!1){const{top:n}=e.getBoundingClientRect();return t?n+e.clientHeight:n}function R_(e,t,n,s=!1){var i;if(!t)return;if(!n)return;const{renderedItems:r}=t.getState(),o=rb(e);if(!o)return;const a=function(e,t=!1){const n=e.clientHeight,{top:s}=e.getBoundingClientRect(),i=1.5*Math.max(.875*n,n-40),r=t?n-i+s:i+s;return"HTML"===e.tagName?r+e.scrollTop:r}(o,s);let l,c;for(let e=0;e=0){void 0!==c&&cs||(e&&(null==f?void 0:f.baseElement)&&f.baseElement===e.baseElement?f.id:void 0),baseElement:e=>(null==e?void 0:e.baseElement)||void 0,isActiveItem:e=>!!e&&e.activeId===h,ariaSetSize:e=>null!=l?l:e&&(null==f?void 0:f.ariaSetSize)&&f.baseElement===e.baseElement?f.ariaSetSize:void 0,ariaPosInSet(e){if(null!=c)return c;if(!e)return;if(!(null==f?void 0:f.ariaPosInSet))return;if(f.baseElement!==e.baseElement)return;const t=e.renderedItems.filter((e=>e.rowId===g));return f.ariaPosInSet+t.findIndex((e=>e.id===h))},isTabbable(e){if(!(null==e?void 0:e.renderedItems.length))return!0;if(e.virtualFocus)return!1;if(o)return!0;if(null===e.activeId)return!1;const t=null==n?void 0:n.item(e.activeId);return!!(null==t?void 0:t.disabled)||(!(null==t?void 0:t.element)||e.activeId===h)}}),_=(0,Gn.useCallback)((e=>{var t;const n=Cy(Sy({},e),{id:h||e.id,rowId:g,disabled:!!m,children:null==(t=e.element)?void 0:t.textContent});return a?a(n):n}),[h,g,m,a]),j=u.onFocus,S=(0,Gn.useRef)(!1),C=_b((e=>{if(null==j||j(e),e.defaultPrevented)return;if(db(e))return;if(!h)return;if(!n)return;if(function(e,t){return!hb(e)&&$w(t,e.target)}(e,n))return;const{virtualFocus:t,baseElement:s}=n.getState();if(n.setActiveId(h),nb(e.currentTarget)&&function(e,t=!1){if(tb(e))e.setSelectionRange(t?e.value.length:0,e.value.length);else if(e.isContentEditable){const n=Xy(e).getSelection();null==n||n.selectAllChildren(e),t&&(null==n||n.collapseToEnd())}}(e.currentTarget),!t)return;if(!hb(e))return;if(nb(i=e.currentTarget)||"INPUT"===i.tagName&&!$y(i))return;var i;if(!(null==s?void 0:s.isConnected))return;ub()&&e.currentTarget.hasAttribute("data-autofocus")&&e.currentTarget.scrollIntoView({block:"nearest",inline:"nearest"}),S.current=!0;e.relatedTarget===s||$w(n,e.relatedTarget)?function(e){e[Qw]=!0,e.focus({preventScroll:!0})}(s):s.focus()})),k=u.onBlurCapture,E=_b((e=>{if(null==k||k(e),e.defaultPrevented)return;const t=null==n?void 0:n.getState();(null==t?void 0:t.virtualFocus)&&S.current&&(S.current=!1,e.preventDefault(),e.stopPropagation())})),P=u.onKeyDown,I=Eb(i),T=Eb(r),O=_b((e=>{if(null==P||P(e),e.defaultPrevented)return;if(!hb(e))return;if(!n)return;const{currentTarget:t}=e,s=n.getState(),i=n.item(h),r=!!(null==i?void 0:i.rowId),o="horizontal"!==s.orientation,a="vertical"!==s.orientation,l=()=>!!r||(!!a||(!s.baseElement||!tb(s.baseElement))),c={ArrowUp:(r||o)&&n.up,ArrowRight:(r||a)&&n.next,ArrowDown:(r||o)&&n.down,ArrowLeft:(r||a)&&n.previous,Home:()=>{if(l())return!r||e.ctrlKey?null==n?void 0:n.first():null==n?void 0:n.previous(-1)},End:()=>{if(l())return!r||e.ctrlKey?null==n?void 0:n.last():null==n?void 0:n.next(-1)},PageUp:()=>R_(t,n,null==n?void 0:n.up,!0),PageDown:()=>R_(t,n,null==n?void 0:n.down)}[e.key];if(c){if(nb(t)){const n=sb(t),s=a&&"ArrowLeft"===e.key,i=a&&"ArrowRight"===e.key,r=o&&"ArrowUp"===e.key,l=o&&"ArrowDown"===e.key;if(i||l){const{length:e}=function(e){if(tb(e))return e.value;if(e.isContentEditable){const t=Xy(e).createRange();return t.selectNodeContents(e),t.toString()}return""}(t);if(n.end!==e)return}else if((s||r)&&0!==n.start)return}const s=c();if(I(e)||void 0!==s){if(!T(e))return;e.preventDefault(),n.move(s)}}})),A=(0,Gn.useMemo)((()=>({id:h,baseElement:v})),[h,v]);return u=Pb(u,(e=>(0,oe.jsx)(qb.Provider,{value:A,children:e})),[A]),u=Cy(Sy({id:h,"data-active-item":x||void 0},u),{ref:jb(p,u.ref),tabIndex:w?u.tabIndex:-1,onFocus:C,onBlurCapture:E,onKeyDown:O}),u=F_(u),u=A_(Cy(Sy({store:n},u),{getItem:_,shouldRegisterItem:!!h&&u.shouldRegisterItem})),Uy(Cy(Sy({},u),{"aria-setsize":y,"aria-posinset":b}))}));Fb(Mb((function(e){return Vb("button",B_(e))})));function D_(e){var t;return null!=(t={menu:"menuitem",listbox:"option",tree:"treeitem"}[e])?t:"option"}var L_=Rb((function(e){var t,n=e,{store:s,value:i,hideOnClick:r,setValueOnClick:o,selectValueOnClick:a=!0,resetValueOnSelect:l,focusOnHover:c=!1,moveOnKeyPress:u=!0,getItem:d}=n,h=ky(n,["store","value","hideOnClick","setValueOnClick","selectValueOnClick","resetValueOnSelect","focusOnHover","moveOnKeyPress","getItem"]);const p=zw();Gy(s=s||p,!1);const{resetValueOnSelectState:f,multiSelectable:m,selected:g}=lw(s,{resetValueOnSelectState:"resetValueOnSelect",multiSelectable:e=>Array.isArray(e.selectedValue),selected:e=>function(e,t){if(null!=t)return null!=e&&(Array.isArray(e)?e.includes(t):e===t)}(e.selectedValue,i)}),v=(0,Gn.useCallback)((e=>{const t=Cy(Sy({},e),{value:i});return d?d(t):t}),[i,d]);o=null!=o?o:!m,r=null!=r?r:null!=i&&!m;const x=h.onClick,y=Eb(o),b=Eb(a),w=Eb(null!=(t=null!=l?l:f)?t:m),_=Eb(r),j=_b((e=>{null==x||x(e),e.defaultPrevented||function(e){const t=e.currentTarget;if(!t)return!1;const n=t.tagName.toLowerCase();return!!e.altKey&&("a"===n||"button"===n&&"submit"===t.type||"input"===n&&"submit"===t.type)}(e)||function(e){const t=e.currentTarget;if(!t)return!1;const n=cb();if(n&&!e.metaKey)return!1;if(!n&&!e.ctrlKey)return!1;const s=t.tagName.toLowerCase();return"a"===s||"button"===s&&"submit"===t.type||"input"===s&&"submit"===t.type}(e)||(null!=i&&(b(e)&&(w(e)&&(null==s||s.resetValue()),null==s||s.setSelectedValue((e=>Array.isArray(e)?e.includes(i)?e.filter((e=>e!==i)):[...e,i]:i))),y(e)&&(null==s||s.setValue(i))),_(e)&&(null==s||s.hide()))})),S=h.onKeyDown,C=_b((e=>{if(null==S||S(e),e.defaultPrevented)return;const t=null==s?void 0:s.getState().baseElement;if(!t)return;if(s_(t))return;(1===e.key.length||"Backspace"===e.key||"Delete"===e.key)&&(queueMicrotask((()=>t.focus())),tb(t)&&(null==s||s.setValue(t.value)))}));m&&null!=g&&(h=Sy({"aria-selected":g},h)),h=Pb(h,(e=>(0,oe.jsx)(Ww.Provider,{value:i,children:(0,oe.jsx)(qw.Provider,{value:null!=g&&g,children:e})})),[i,g]);const k=(0,Gn.useContext)(Bw);h=Cy(Sy({role:D_(k),children:i},h),{onClick:j,onKeyDown:C});const E=Eb(u);return h=B_(Cy(Sy({store:s},h),{getItem:v,moveOnKeyPress:e=>{if(!E(e))return!1;const t=new Event("combobox-item-move"),n=null==s?void 0:s.getState().baseElement;return null==n||n.dispatchEvent(t),!0}})),h=O_(Sy({store:s,focusOnHover:c},h))})),z_=Fb(Mb((function(e){return Vb("div",L_(e))})));function G_(e){return Ly(e).toLowerCase()}function H_(e,t){if(!e)return e;if(!t)return e;const n=(s=t,Array.isArray(s)?s:void 0!==s?[s]:[]).filter(Boolean).map(G_);var s;const i=[],r=(e,t=!1)=>(0,oe.jsx)("span",{"data-autocomplete-value":t?"":void 0,"data-user-value":t?void 0:"",children:e},i.length),o=function(e){return e.sort((([e],[t])=>e-t))}(function(e){return e.filter((([e,t],n,s)=>!s.some((([s,i],r)=>r!==n&&s<=e&&s+i>=e+t))))}(function(e,t){const n=[];for(const s of t){let t=0;const i=s.length;for(;-1!==e.indexOf(s,t);){const r=e.indexOf(s,t);-1!==r&&n.push([r,i]),t=r+1}}return n}(G_(e),new Set(n))));if(!o.length)return i.push(r(e,!0)),i;const[a]=o[0],l=[e.slice(0,a),...o.flatMap((([t,n],s)=>{var i;const r=e.slice(t,t+n),a=null==(i=o[s+1])?void 0:i[0];return[r,e.slice(t+n,a)]}))];return l.forEach(((e,t)=>{e&&i.push(r(e,t%2==0))})),i}var U_=Rb((function(e){var t=e,{store:n,value:s,userValue:i}=t,r=ky(t,["store","value","userValue"]);const o=zw();n=n||o;const a=(0,Gn.useContext)(Ww),l=null!=s?s:a,c=aw(n,(e=>null!=i?i:null==e?void 0:e.value)),u=(0,Gn.useMemo)((()=>{if(l)return c?H_(l,c):l}),[l,c]);return Uy(r=Sy({children:u},r))})),W_=Mb((function(e){return Vb("span",U_(e))}));const q_=(0,oe.jsx)(Yt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Yt.Circle,{cx:12,cy:12,r:3})});function Z_(e=""){return Gx()(e.trim().toLowerCase())}const K_=[],Y_=(e,t)=>e.singleSelection?t?.value:Array.isArray(t?.value)?t.value:!Array.isArray(t?.value)&&t?.value?[t.value]:K_,X_=(e,t,n)=>e.singleSelection?n:Array.isArray(t?.value)?t.value.includes(n)?t.value.filter((e=>e!==n)):[...t.value,n]:[n];function J_(e,t){return`${e}-${t}`}function Q_({view:e,filter:t,onChangeView:n}){const s=(0,v.useInstanceId)(Q_,"dataviews-filter-list-box"),[i,r]=(0,d.useState)(1===t.operators?.length?void 0:null),o=e.filters?.find((e=>e.field===t.field)),a=Y_(t,o);return(0,oe.jsx)(y.Composite,{virtualFocus:!0,focusLoop:!0,activeId:i,setActiveId:r,role:"listbox",className:"dataviews-filters__search-widget-listbox","aria-label":(0,b.sprintf)((0,b.__)("List of: %1$s"),t.name),onFocusVisible:()=>{!i&&t.elements.length&&r(J_(s,t.elements[0].value))},render:(0,oe.jsx)(y.Composite.Typeahead,{}),children:t.elements.map((i=>(0,oe.jsxs)(y.Composite.Hover,{render:(0,oe.jsx)(y.Composite.Item,{id:J_(s,i.value),render:(0,oe.jsx)("div",{"aria-label":i.label,role:"option",className:"dataviews-filters__search-widget-listitem"}),onClick:()=>{var s,r;const a=o?[...(null!==(s=e.filters)&&void 0!==s?s:[]).map((e=>e.field===t.field?{...e,operator:o.operator||t.operators[0],value:X_(t,o,i.value)}:e))]:[...null!==(r=e.filters)&&void 0!==r?r:[],{field:t.field,operator:t.operators[0],value:X_(t,o,i.value)}];n({...e,page:1,filters:a})}}),children:[(0,oe.jsxs)("span",{className:"dataviews-filters__search-widget-listitem-check",children:[t.singleSelection&&a===i.value&&(0,oe.jsx)(y.Icon,{icon:q_}),!t.singleSelection&&a.includes(i.value)&&(0,oe.jsx)(y.Icon,{icon:Yr})]}),(0,oe.jsx)("span",{children:i.label})]},i.value)))})}function $_({view:e,filter:t,onChangeView:n}){const[s,i]=(0,d.useState)(""),r=(0,d.useDeferredValue)(s),o=e.filters?.find((e=>e.field===t.field)),a=Y_(t,o),l=(0,d.useMemo)((()=>{const e=Z_(r);return t.elements.filter((t=>Z_(t.label).includes(e)))}),[t.elements,r]);return(0,oe.jsxs)(Zw,{selectedValue:a,setSelectedValue:s=>{var i,r;const a=o?[...(null!==(i=e.filters)&&void 0!==i?i:[]).map((e=>e.field===t.field?{...e,operator:o.operator||t.operators[0],value:s}:e))]:[...null!==(r=e.filters)&&void 0!==r?r:[],{field:t.field,operator:t.operators[0],value:s}];n({...e,page:1,filters:a})},setValue:i,children:[(0,oe.jsxs)("div",{className:"dataviews-filters__search-widget-filter-combobox__wrapper",children:[(0,oe.jsx)(Yw,{render:(0,oe.jsx)(y.VisuallyHidden,{children:(0,b.__)("Search items")}),children:(0,b.__)("Search items")}),(0,oe.jsx)(w_,{autoSelect:"always",placeholder:(0,b.__)("Search"),className:"dataviews-filters__search-widget-filter-combobox__input"}),(0,oe.jsx)("div",{className:"dataviews-filters__search-widget-filter-combobox__icon",children:(0,oe.jsx)(y.Icon,{icon:Xt})})]}),(0,oe.jsxs)(P_,{className:"dataviews-filters__search-widget-filter-combobox-list",alwaysVisible:!0,children:[l.map((e=>(0,oe.jsxs)(z_,{resetValueOnSelect:!1,value:e.value,className:"dataviews-filters__search-widget-listitem",hideOnClick:!1,setValueOnClick:!1,focusOnHover:!0,children:[(0,oe.jsxs)("span",{className:"dataviews-filters__search-widget-listitem-check",children:[t.singleSelection&&a===e.value&&(0,oe.jsx)(y.Icon,{icon:q_}),!t.singleSelection&&a.includes(e.value)&&(0,oe.jsx)(y.Icon,{icon:Yr})]}),(0,oe.jsxs)("span",{children:[(0,oe.jsx)(W_,{className:"dataviews-filters__search-widget-filter-combobox-item-value",value:e.label}),!!e.description&&(0,oe.jsx)("span",{className:"dataviews-filters__search-widget-listitem-description",children:e.description})]})]},e.value))),!l.length&&(0,oe.jsx)("p",{children:(0,b.__)("No results found")})]})]})}function ej(e){const t=e.filter.elements.length>10?$_:Q_;return(0,oe.jsx)(t,{...e})}const tj="Enter",nj=" ",sj=({activeElements:e,filterInView:t,filter:n})=>{if(void 0===e||0===e.length)return n.name;const s={Name:(0,oe.jsx)("span",{className:"dataviews-filters__summary-filter-text-name"}),Value:(0,oe.jsx)("span",{className:"dataviews-filters__summary-filter-text-value"})};return t?.operator===Zx?(0,d.createInterpolateElement)((0,b.sprintf)((0,b.__)("%1$s is any: %2$s"),n.name,e.map((e=>e.label)).join(", ")),s):t?.operator===Kx?(0,d.createInterpolateElement)((0,b.sprintf)((0,b.__)("%1$s is none: %2$s"),n.name,e.map((e=>e.label)).join(", ")),s):t?.operator===Yx?(0,d.createInterpolateElement)((0,b.sprintf)((0,b.__)("%1$s is all: %2$s"),n.name,e.map((e=>e.label)).join(", ")),s):t?.operator===Xx?(0,d.createInterpolateElement)((0,b.sprintf)((0,b.__)("%1$s is not all: %2$s"),n.name,e.map((e=>e.label)).join(", ")),s):t?.operator===Wx?(0,d.createInterpolateElement)((0,b.sprintf)((0,b.__)("%1$s is: %2$s"),n.name,e[0].label),s):t?.operator===qx?(0,d.createInterpolateElement)((0,b.sprintf)((0,b.__)("%1$s is not: %2$s"),n.name,e[0].label),s):(0,b.sprintf)((0,b.__)("Unknown status for %1$s"),n.name)};function ij({filter:e,view:t,onChangeView:n}){const s=e.operators?.map((e=>({value:e,label:Qx[e]?.label}))),i=t.filters?.find((t=>t.field===e.field)),r=i?.operator||e.operators[0];return s.length>1&&(0,oe.jsxs)(y.__experimentalHStack,{spacing:2,justify:"flex-start",className:"dataviews-filters__summary-operators-container",children:[(0,oe.jsx)(y.FlexItem,{className:"dataviews-filters__summary-operators-filter-name",children:e.name}),(0,oe.jsx)(y.SelectControl,{label:(0,b.__)("Conditions"),value:r,options:s,onChange:s=>{var r,o;const a=s,l=i?[...(null!==(r=t.filters)&&void 0!==r?r:[]).map((t=>t.field===e.field?{...t,operator:a}:t))]:[...null!==(o=t.filters)&&void 0!==o?o:[],{field:e.field,operator:a,value:void 0}];n({...t,page:1,filters:l})},size:"small",__nextHasNoMarginBottom:!0,hideLabelFromVision:!0})]})}function rj({addFilterRef:e,openedFilter:t,...n}){const s=(0,d.useRef)(null),{filter:i,view:r,onChangeView:o}=n,a=r.filters?.find((e=>e.field===i.field)),l=i.elements.filter((e=>i.singleSelection?e.value===a?.value:a?.value?.includes(e.value))),c=i.isPrimary,u=void 0!==a?.value,h=!c||u;return(0,oe.jsx)(y.Dropdown,{defaultOpen:t===i.field,contentClassName:"dataviews-filters__summary-popover",popoverProps:{placement:"bottom-start",role:"dialog"},onClose:()=>{s.current?.focus()},renderToggle:({isOpen:t,onToggle:n})=>(0,oe.jsxs)("div",{className:"dataviews-filters__summary-chip-container",children:[(0,oe.jsx)(y.Tooltip,{text:(0,b.sprintf)((0,b.__)("Filter by: %1$s"),i.name.toLowerCase()),placement:"top",children:(0,oe.jsx)("div",{className:Ut("dataviews-filters__summary-chip",{"has-reset":h,"has-values":u}),role:"button",tabIndex:0,onClick:n,onKeyDown:e=>{[tj,nj].includes(e.key)&&(n(),e.preventDefault())},"aria-pressed":t,"aria-expanded":t,ref:s,children:(0,oe.jsx)(sj,{activeElements:l,filterInView:a,filter:i})})}),h&&(0,oe.jsx)(y.Tooltip,{text:c?(0,b.__)("Reset"):(0,b.__)("Remove"),placement:"top",children:(0,oe.jsx)("button",{className:Ut("dataviews-filters__summary-chip-remove",{"has-values":u}),onClick:()=>{o({...r,page:1,filters:r.filters?.filter((e=>e.field!==i.field))}),c?s.current?.focus():e.current?.focus()},children:(0,oe.jsx)(y.Icon,{icon:Fo})})})]}),renderContent:()=>(0,oe.jsxs)(y.__experimentalVStack,{spacing:0,justify:"flex-start",children:[(0,oe.jsx)(ij,{...n}),(0,oe.jsx)(ej,{...n})]})})}const{lock:oj,unlock:aj}=(0,$.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/dataviews"),{Menu:lj}=aj(y.privateApis);function cj({filters:e,view:t,onChangeView:n,setOpenedFilter:s,triggerProps:i}){const r=e.filter((e=>!e.isVisible));return(0,oe.jsxs)(lj,{children:[(0,oe.jsx)(lj.TriggerButton,{...i}),(0,oe.jsx)(lj.Popover,{children:r.map((e=>(0,oe.jsx)(lj.Item,{onClick:()=>{s(e.field),n({...t,page:1,filters:[...t.filters||[],{field:e.field,value:void 0,operator:e.operators[0]}]})},children:(0,oe.jsx)(lj.ItemLabel,{children:e.name})},e.field)))})]})}const uj=(0,d.forwardRef)((function({filters:e,view:t,onChangeView:n,setOpenedFilter:s},i){if(!e.length||e.every((({isPrimary:e})=>e)))return null;const r=e.filter((e=>!e.isVisible));return(0,oe.jsx)(cj,{triggerProps:{render:(0,oe.jsx)(y.Button,{accessibleWhenDisabled:!0,size:"compact",className:"dataviews-filters-button",variant:"tertiary",disabled:!r.length,ref:i}),children:(0,b.__)("Add filter")},filters:e,view:t,onChangeView:n,setOpenedFilter:s})}));function dj({filters:e,view:t,onChangeView:n}){const s=!t.search&&!t.filters?.some((t=>{return void 0!==t.value||(n=t.field,!e.some((e=>e.field===n&&e.isPrimary)));var n}));return(0,oe.jsx)(y.Button,{disabled:s,accessibleWhenDisabled:!0,size:"compact",variant:"tertiary",className:"dataviews-filters__reset-button",onClick:()=>{n({...t,page:1,search:"",filters:[]})},children:(0,b.__)("Reset")})}function hj(e){let t=e.filterBy?.operators;return t&&Array.isArray(t)||(t=[Zx,Kx]),t=t.filter((e=>Jx.includes(e))),(t.includes(Wx)||t.includes(qx))&&(t=t.filter((e=>[Wx,qx].includes(e)))),t}function pj(e,t){return(0,d.useMemo)((()=>{const n=[];return e.forEach((e=>{if(!e.elements?.length)return;const s=hj(e);if(0===s.length)return;const i=!!e.filterBy?.isPrimary;n.push({field:e.id,name:e.label,elements:e.elements,singleSelection:s.some((e=>[Wx,qx].includes(e))),operators:s,isVisible:i||!!t.filters?.some((t=>t.field===e.id&&Jx.includes(t.operator))),isPrimary:i})})),n.sort(((e,t)=>e.isPrimary&&!t.isPrimary?-1:!e.isPrimary&&t.isPrimary?1:e.name.localeCompare(t.name))),n}),[e,t])}function fj({filters:e,view:t,onChangeView:n,setOpenedFilter:s,isShowingFilter:i,setIsShowingFilter:r}){const o=(0,d.useRef)(null),a=(0,d.useCallback)((e=>{n(e),r(!0)}),[n,r]),l=!!e.filter((e=>e.isVisible)).length;if(0===e.length)return null;const c={label:(0,b.__)("Add filter"),"aria-expanded":!1,isPressed:!1},u={label:(0,b._x)("Filter","verb"),"aria-expanded":i,isPressed:i,onClick:()=>{i||s(null),r(!i)}},h=(0,oe.jsx)(y.Button,{ref:o,className:"dataviews-filters__visibility-toggle",size:"compact",icon:gy,...l?u:c});return(0,oe.jsx)("div",{className:"dataviews-filters__container-visibility-toggle",children:l?(0,oe.jsx)(mj,{buttonRef:o,filtersCount:t.filters?.length,children:h}):(0,oe.jsx)(cj,{filters:e,view:t,onChangeView:a,setOpenedFilter:s,triggerProps:{render:h}})})}function mj({buttonRef:e,filtersCount:t,children:n}){return(0,d.useEffect)((()=>()=>{e.current?.focus()}),[e]),(0,oe.jsxs)(oe.Fragment,{children:[n,!!t&&(0,oe.jsx)("span",{className:"dataviews-filters-toggle__count",children:t})]})}const gj=(0,d.memo)((function(){const{fields:e,view:t,onChangeView:n,openedFilter:s,setOpenedFilter:i}=(0,d.useContext)(my),r=(0,d.useRef)(null),o=pj(e,t),a=(0,oe.jsx)(uj,{filters:o,view:t,onChangeView:n,ref:r,setOpenedFilter:i},"add-filter"),l=o.filter((e=>e.isVisible));if(0===l.length)return null;const c=[...l.map((e=>(0,oe.jsx)(rj,{filter:e,view:t,onChangeView:n,addFilterRef:r,openedFilter:s},e.field))),a];return c.push((0,oe.jsx)(dj,{filters:o,view:t,onChangeView:n},"reset-filters")),(0,oe.jsx)(y.__experimentalHStack,{justify:"flex-start",style:{width:"fit-content"},className:"dataviews-filters__container",wrap:!0,children:c})})),vj=(0,oe.jsx)(Yt.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,oe.jsx)(Yt.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM5 4.5h14c.3 0 .5.2.5.5v3.5h-15V5c0-.3.2-.5.5-.5zm8 5.5h6.5v3.5H13V10zm-1.5 3.5h-7V10h7v3.5zm-7 5.5v-4h7v4.5H5c-.3 0-.5-.2-.5-.5zm14.5.5h-6V15h6.5v4c0 .3-.2.5-.5.5z"})}),xj=(0,oe.jsx)(Yt.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,oe.jsx)(Yt.Path,{d:"M6 5.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM4 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2V6zm11-.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5h-3a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM13 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2h-3a2 2 0 01-2-2V6zm5 8.5h-3a.5.5 0 00-.5.5v3a.5.5 0 00.5.5h3a.5.5 0 00.5-.5v-3a.5.5 0 00-.5-.5zM15 13a2 2 0 00-2 2v3a2 2 0 002 2h3a2 2 0 002-2v-3a2 2 0 00-2-2h-3zm-9 1.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5v-3a.5.5 0 01.5-.5zM4 15a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2v-3z",fillRule:"evenodd",clipRule:"evenodd"})}),yj=(0,oe.jsx)(Yt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Yt.Path,{d:"M4 8.8h8.9V7.2H4v1.6zm0 7h8.9v-1.5H4v1.5zM18 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z"})}),bj=(0,oe.jsx)(Yt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Yt.Path,{d:"M11.1 15.8H20v-1.5h-8.9v1.5zm0-8.6v1.5H20V7.2h-8.9zM6 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-7c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})});function wj({selection:e,onChangeSelection:t,item:n,getItemId:s,titleField:i,disabled:r}){const o=s(n),a=!r&&e.includes(o),l=i?.getValue?.({item:n})||(0,b.__)("(no title)");return(0,oe.jsx)(y.CheckboxControl,{className:"dataviews-selection-checkbox",__nextHasNoMarginBottom:!0,"aria-label":l,"aria-disabled":r,checked:a,onChange:()=>{r||t(e.includes(o)?e.filter((e=>o!==e)):[...e,o])}})}const{Menu:_j,kebabCase:jj}=aj(y.privateApis);function Sj({action:e,onClick:t,items:n}){const s="string"==typeof e.label?e.label:e.label(n);return(0,oe.jsx)(y.Button,{label:s,icon:e.icon,disabled:!!e.disabled,accessibleWhenDisabled:!0,isDestructive:e.isDestructive,size:"compact",onClick:t})}function Cj({action:e,onClick:t,items:n}){const s="string"==typeof e.label?e.label:e.label(n);return(0,oe.jsx)(_j.Item,{disabled:e.disabled,onClick:t,children:(0,oe.jsx)(_j.ItemLabel,{children:s})})}function kj({action:e,items:t,closeModal:n}){const s="string"==typeof e.label?e.label:e.label(t);return(0,oe.jsx)(y.Modal,{title:e.modalHeader||s,__experimentalHideHeader:!!e.hideModalHeader,onRequestClose:n,focusOnMount:"firstContentElement",size:"medium",overlayClassName:`dataviews-action-modal dataviews-action-modal__${jj(e.id)}`,children:(0,oe.jsx)(e.RenderModal,{items:t,closeModal:n})})}function Ej({actions:e,item:t,registry:n,setActiveModalAction:s}){return(0,oe.jsx)(_j.Group,{children:e.map((e=>(0,oe.jsx)(Cj,{action:e,onClick:()=>{"RenderModal"in e?s(e):e.callback([t],{registry:n})},items:[t]},e.id)))})}function Pj({item:e,actions:t,isCompact:n}){const s=(0,l.useRegistry)(),{primaryActions:i,eligibleActions:r}=(0,d.useMemo)((()=>{const n=t.filter((t=>!t.isEligible||t.isEligible(e)));return{primaryActions:n.filter((e=>e.isPrimary&&!!e.icon)),eligibleActions:n}}),[t,e]);return n?(0,oe.jsx)(Ij,{item:e,actions:r,isSmall:!0,registry:s}):i.length===r.length?(0,oe.jsx)(Tj,{item:e,actions:i,registry:s}):(0,oe.jsxs)(y.__experimentalHStack,{spacing:1,justify:"flex-end",className:"dataviews-item-actions",style:{flexShrink:"0",width:"auto"},children:[(0,oe.jsx)(Tj,{item:e,actions:i,registry:s}),(0,oe.jsx)(Ij,{item:e,actions:r,registry:s})]})}function Ij({item:e,actions:t,isSmall:n,registry:s}){const[i,r]=(0,d.useState)(null);return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsxs)(_j,{placement:"bottom-end",children:[(0,oe.jsx)(_j.TriggerButton,{render:(0,oe.jsx)(y.Button,{size:n?"small":"compact",icon:Da,label:(0,b.__)("Actions"),accessibleWhenDisabled:!0,disabled:!t.length,className:"dataviews-all-actions-button"})}),(0,oe.jsx)(_j.Popover,{children:(0,oe.jsx)(Ej,{actions:t,item:e,registry:s,setActiveModalAction:r})})]}),!!i&&(0,oe.jsx)(kj,{action:i,items:[e],closeModal:()=>r(null)})]})}function Tj({item:e,actions:t,registry:n}){const[s,i]=(0,d.useState)(null);return Array.isArray(t)&&0!==t.length?(0,oe.jsxs)(oe.Fragment,{children:[t.map((t=>(0,oe.jsx)(Sj,{action:t,onClick:()=>{"RenderModal"in t?i(t):t.callback([e],{registry:n})},items:[e]},t.id))),!!s&&(0,oe.jsx)(kj,{action:s,items:[e],closeModal:()=>i(null)})]}):null}function Oj({action:e,items:t,ActionTriggerComponent:n}){const[s,i]=(0,d.useState)(!1),r={action:e,onClick:()=>{i(!0)},items:t};return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(n,{...r}),s&&(0,oe.jsx)(kj,{action:e,items:t,closeModal:()=>i(!1)})]})}function Aj(e,t){return(0,d.useMemo)((()=>e.some((e=>e.supportsBulk&&(!e.isEligible||e.isEligible(t))))),[e,t])}function Nj(e,t){return(0,d.useMemo)((()=>t.some((t=>e.some((e=>e.supportsBulk&&(!e.isEligible||e.isEligible(t))))))),[e,t])}function Mj({selection:e,onChangeSelection:t,data:n,actions:s,getItemId:i}){const r=(0,d.useMemo)((()=>n.filter((e=>s.some((t=>t.supportsBulk&&(!t.isEligible||t.isEligible(e))))))),[n,s]),o=n.filter((t=>e.includes(i(t))&&r.includes(t))),a=o.length===r.length;return(0,oe.jsx)(y.CheckboxControl,{className:"dataviews-view-table-selection-checkbox",__nextHasNoMarginBottom:!0,checked:a,indeterminate:!a&&!!o.length,onChange:()=>{t(a?[]:r.map((e=>i(e))))},"aria-label":a?(0,b.__)("Deselect all"):(0,b.__)("Select all")})}function Fj({action:e,onClick:t,isBusy:n,items:s}){const i="string"==typeof e.label?e.label:e.label(s);return(0,oe.jsx)(y.Button,{disabled:n,accessibleWhenDisabled:!0,label:i,icon:e.icon,isDestructive:e.isDestructive,size:"compact",onClick:t,isBusy:n,tooltipPosition:"top"})}const Vj=[];function Rj({action:e,selectedItems:t,actionInProgress:n,setActionInProgress:s}){const i=(0,l.useRegistry)(),r=(0,d.useMemo)((()=>t.filter((t=>!e.isEligible||e.isEligible(t)))),[e,t]);return"RenderModal"in e?(0,oe.jsx)(Oj,{action:e,items:r,ActionTriggerComponent:Fj},e.id):(0,oe.jsx)(Fj,{action:e,onClick:async()=>{s(e.id),await e.callback(t,{registry:i}),s(null)},items:r,isBusy:n===e.id},e.id)}function Bj(e,t,n,s,i,r,o,a,l){const c=r.length>0?(0,b.sprintf)((0,b._n)("%d Item selected","%d Items selected",r.length),r.length):(0,b.sprintf)((0,b._n)("%d Item","%d Items",e.length),e.length);return(0,oe.jsxs)(y.__experimentalHStack,{expanded:!1,className:"dataviews-bulk-actions-footer__container",spacing:3,children:[(0,oe.jsx)(Mj,{selection:s,onChangeSelection:l,data:e,actions:t,getItemId:n}),(0,oe.jsx)("span",{className:"dataviews-bulk-actions-footer__item-count",children:c}),(0,oe.jsxs)(y.__experimentalHStack,{className:"dataviews-bulk-actions-footer__action-buttons",expanded:!1,spacing:1,children:[i.map((e=>(0,oe.jsx)(Rj,{action:e,selectedItems:r,actionInProgress:o,setActionInProgress:a},e.id))),r.length>0&&(0,oe.jsx)(y.Button,{icon:Fo,showTooltip:!0,tooltipPosition:"top",size:"compact",label:(0,b.__)("Cancel"),disabled:!!o,accessibleWhenDisabled:!1,onClick:()=>{l(Vj)}})]})]})}function Dj({selection:e,actions:t,onChangeSelection:n,data:s,getItemId:i}){const[r,o]=(0,d.useState)(null),a=(0,d.useRef)(null),l=(0,d.useMemo)((()=>t.filter((e=>e.supportsBulk))),[t]),c=(0,d.useMemo)((()=>s.filter((e=>l.some((t=>!t.isEligible||t.isEligible(e)))))),[s,l]),u=(0,d.useMemo)((()=>s.filter((t=>e.includes(i(t))&&c.includes(t)))),[e,s,i,c]),h=(0,d.useMemo)((()=>t.filter((e=>e.supportsBulk&&e.icon&&u.some((t=>!e.isEligible||e.isEligible(t)))))),[t,u]);return r?(a.current||(a.current=Bj(s,t,i,e,h,u,r,o,n)),a.current):(a.current&&(a.current=null),Bj(s,t,i,e,h,u,r,o,n))}function Lj(){const{data:e,selection:t,actions:n=Vj,onChangeSelection:s,getItemId:i}=(0,d.useContext)(my);return(0,oe.jsx)(Dj,{selection:t,onChangeSelection:s,data:e,actions:n,getItemId:i})}const zj=(0,oe.jsx)(Yt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Yt.Path,{d:"M20 11.2H6.8l3.7-3.7-1-1L3.9 12l5.6 5.5 1-1-3.7-3.7H20z"})}),Gj=(0,oe.jsx)(Yt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Yt.Path,{d:"m14.5 6.5-1 1 3.7 3.7H4v1.6h13.2l-3.7 3.7 1 1 5.6-5.5z"})}),Hj=(0,oe.jsx)(Yt.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,oe.jsx)(Yt.Path,{d:"M20.7 12.7s0-.1-.1-.2c0-.2-.2-.4-.4-.6-.3-.5-.9-1.2-1.6-1.8-.7-.6-1.5-1.3-2.6-1.8l-.6 1.4c.9.4 1.6 1 2.1 1.5.6.6 1.1 1.2 1.4 1.6.1.2.3.4.3.5v.1l.7-.3.7-.3Zm-5.2-9.3-1.8 4c-.5-.1-1.1-.2-1.7-.2-3 0-5.2 1.4-6.6 2.7-.7.7-1.2 1.3-1.6 1.8-.2.3-.3.5-.4.6 0 0 0 .1-.1.2s0 0 .7.3l.7.3V13c0-.1.2-.3.3-.5.3-.4.7-1 1.4-1.6 1.2-1.2 3-2.3 5.5-2.3H13v.3c-.4 0-.8-.1-1.1-.1-1.9 0-3.5 1.6-3.5 3.5s.6 2.3 1.6 2.9l-2 4.4.9.4 7.6-16.2-.9-.4Zm-3 12.6c1.7-.2 3-1.7 3-3.5s-.2-1.4-.6-1.9L12.4 16Z"})}),{Menu:Uj}=aj(y.privateApis);function Wj({children:e}){return d.Children.toArray(e).filter(Boolean).map(((e,t)=>(0,oe.jsxs)(d.Fragment,{children:[t>0&&(0,oe.jsx)(Uj.Separator,{}),e]},t)))}const qj=(0,d.forwardRef)((function({fieldId:e,view:t,fields:n,onChangeView:s,onHide:i,setOpenedFilter:r,canMove:o=!0},a){var l;const c=null!==(l=t.fields)&&void 0!==l?l:[],u=c?.indexOf(e),d=t.sort?.field===e;let h=!1,p=!1,f=!1,m=[];const g=n.find((t=>t.id===e));if(!g)return null;h=!1!==g.enableHiding,p=!1!==g.enableSorting;const v=g.header;return m=hj(g),f=!(t.filters?.some((t=>e===t.field))||!g.elements?.length||!m.length||g.filterBy?.isPrimary),(0,oe.jsxs)(Uj,{children:[(0,oe.jsxs)(Uj.TriggerButton,{render:(0,oe.jsx)(y.Button,{size:"compact",className:"dataviews-view-table-header-button",ref:a,variant:"tertiary"}),children:[v,t.sort&&d&&(0,oe.jsx)("span",{"aria-hidden":"true",children:ey[t.sort.direction]})]}),(0,oe.jsx)(Uj.Popover,{style:{minWidth:"240px"},children:(0,oe.jsxs)(Wj,{children:[p&&(0,oe.jsx)(Uj.Group,{children:$x.map((n=>{const i=t.sort&&d&&t.sort.direction===n,r=`${e}-${n}`;return(0,oe.jsx)(Uj.RadioItem,{name:"view-table-sorting",value:r,checked:i,onChange:()=>{s({...t,sort:{field:e,direction:n},showLevels:!1})},children:(0,oe.jsx)(Uj.ItemLabel,{children:ny[n]})},r)}))}),f&&(0,oe.jsx)(Uj.Group,{children:(0,oe.jsx)(Uj.Item,{prefix:(0,oe.jsx)(y.Icon,{icon:gy}),onClick:()=>{r(e),s({...t,page:1,filters:[...t.filters||[],{field:e,value:void 0,operator:m[0]}]})},children:(0,oe.jsx)(Uj.ItemLabel,{children:(0,b.__)("Add filter")})})}),(o||h)&&g&&(0,oe.jsxs)(Uj.Group,{children:[o&&(0,oe.jsx)(Uj.Item,{prefix:(0,oe.jsx)(y.Icon,{icon:zj}),disabled:u<1,onClick:()=>{var n;s({...t,fields:[...null!==(n=c.slice(0,u-1))&&void 0!==n?n:[],e,c[u-1],...c.slice(u+1)]})},children:(0,oe.jsx)(Uj.ItemLabel,{children:(0,b.__)("Move left")})}),o&&(0,oe.jsx)(Uj.Item,{prefix:(0,oe.jsx)(y.Icon,{icon:Gj}),disabled:u>=c.length-1,onClick:()=>{var n;s({...t,fields:[...null!==(n=c.slice(0,u))&&void 0!==n?n:[],c[u+1],e,...c.slice(u+2)]})},children:(0,oe.jsx)(Uj.ItemLabel,{children:(0,b.__)("Move right")})}),h&&g&&(0,oe.jsx)(Uj.Item,{prefix:(0,oe.jsx)(y.Icon,{icon:Hj}),onClick:()=>{i(g),s({...t,fields:c.filter((t=>t!==e))})},children:(0,oe.jsx)(Uj.ItemLabel,{children:(0,b.__)("Hide column")})})]})]})})]})})),Zj=qj;function Kj({item:e,isItemClickable:t,onClickItem:n,className:s}){return t(e)&&n?{className:s?`${s} ${s}--clickable`:void 0,role:"button",tabIndex:0,onClick:t=>{t.stopPropagation(),n(e)},onKeyDown:t=>{"Enter"!==t.key&&""!==t.key&&" "!==t.key||(t.stopPropagation(),n(e))}}:{className:s}}const Yj=function({item:e,level:t,titleField:n,mediaField:s,descriptionField:i,onClickItem:r,isItemClickable:o}){const a=Kj({item:e,isItemClickable:o,onClickItem:r,className:"dataviews-view-table__cell-content-wrapper dataviews-title-field"});return(0,oe.jsxs)(y.__experimentalHStack,{spacing:3,justify:"flex-start",children:[s&&(0,oe.jsx)("div",{className:"dataviews-view-table__cell-content-wrapper dataviews-column-primary__media",children:(0,oe.jsx)(s.render,{item:e})}),(0,oe.jsxs)(y.__experimentalVStack,{spacing:0,children:[n&&(0,oe.jsxs)("div",{...a,children:[void 0!==t&&(0,oe.jsxs)("span",{className:"dataviews-view-table__level",children:["—".repeat(t)," "]}),(0,oe.jsx)(n.render,{item:e})]}),i&&(0,oe.jsx)(i.render,{item:e})]})]})};function Xj({item:e,fields:t,column:n}){const s=t.find((e=>e.id===n));return s?(0,oe.jsx)("div",{className:"dataviews-view-table__cell-content-wrapper",children:(0,oe.jsx)(s.render,{item:e})}):null}function Jj({hasBulkActions:e,item:t,level:n,actions:s,fields:i,id:r,view:o,titleField:a,mediaField:l,descriptionField:c,selection:u,getItemId:h,isItemClickable:p,onClickItem:f,onChangeSelection:m}){var g;const v=Aj(s,t),x=v&&u.includes(r),[y,b]=(0,d.useState)(!1),{showTitle:w=!0,showMedia:_=!0,showDescription:j=!0}=o,S=(0,d.useRef)(!1),C=null!==(g=o.fields)&&void 0!==g?g:[],k=a&&w||l&&_||c&&j;return(0,oe.jsxs)("tr",{className:Ut("dataviews-view-table__row",{"is-selected":v&&x,"is-hovered":y,"has-bulk-actions":v}),onMouseEnter:()=>{b(!0)},onMouseLeave:()=>{b(!1)},onTouchStart:()=>{S.current=!0},onClick:()=>{v&&(S.current||"Range"===document.getSelection()?.type||m(u.includes(r)?u.filter((e=>r!==e)):[r]))},children:[e&&(0,oe.jsx)("td",{className:"dataviews-view-table__checkbox-column",style:{width:"1%"},children:(0,oe.jsx)("div",{className:"dataviews-view-table__cell-content-wrapper",children:(0,oe.jsx)(wj,{item:t,selection:u,onChangeSelection:m,getItemId:h,titleField:a,disabled:!v})})}),k&&(0,oe.jsx)("td",{children:(0,oe.jsx)(Yj,{item:t,level:n,titleField:w?a:void 0,mediaField:_?l:void 0,descriptionField:j?c:void 0,isItemClickable:p,onClickItem:f})}),C.map((e=>{var n;const{width:s,maxWidth:r,minWidth:a}=null!==(n=o.layout?.styles?.[e])&&void 0!==n?n:{};return(0,oe.jsx)("td",{style:{width:s,maxWidth:r,minWidth:a},children:(0,oe.jsx)(Xj,{fields:i,item:t,column:e})},e)})),!!s?.length&&(0,oe.jsx)("td",{className:"dataviews-view-table__actions-column",onClick:e=>e.stopPropagation(),children:(0,oe.jsx)(Pj,{item:t,actions:s})})]})}const Qj=function({actions:e,data:t,fields:n,getItemId:s,getItemLevel:i,isLoading:r=!1,onChangeView:o,onChangeSelection:a,selection:l,setOpenedFilter:c,onClickItem:u,isItemClickable:h,view:p}){var f;const m=(0,d.useRef)(new Map),g=(0,d.useRef)(),[v,x]=(0,d.useState)(),w=Nj(e,t);(0,d.useEffect)((()=>{g.current&&(g.current.focus(),g.current=void 0)}));const _=(0,d.useId)();if(v)return g.current=v,void x(void 0);const j=e=>{const t=m.current.get(e.id),n=t?m.current.get(t.fallback):void 0;x(n?.node)},S=!!t?.length,C=n.find((e=>e.id===p.titleField)),k=n.find((e=>e.id===p.mediaField)),E=n.find((e=>e.id===p.descriptionField)),{showTitle:P=!0,showMedia:I=!0,showDescription:T=!0}=p,O=C&&P||k&&I||E&&T,A=null!==(f=p.fields)&&void 0!==f?f:[],N=(e,t)=>n=>{n?m.current.set(e,{node:n,fallback:A[t>0?t-1:1]}):m.current.delete(e)};return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsxs)("table",{className:Ut("dataviews-view-table",{[`has-${p.layout?.density}-density`]:p.layout?.density&&["compact","comfortable"].includes(p.layout.density)}),"aria-busy":r,"aria-describedby":_,children:[(0,oe.jsx)("thead",{children:(0,oe.jsxs)("tr",{className:"dataviews-view-table__row",children:[w&&(0,oe.jsx)("th",{className:"dataviews-view-table__checkbox-column",style:{width:"1%"},scope:"col",children:(0,oe.jsx)(Mj,{selection:l,onChangeSelection:a,data:t,actions:e,getItemId:s})}),O&&(0,oe.jsx)("th",{scope:"col",children:(0,oe.jsx)("span",{className:"dataviews-view-table-header",children:C&&(0,oe.jsx)(Zj,{ref:N(C.id,0),fieldId:C.id,view:p,fields:n,onChangeView:o,onHide:j,setOpenedFilter:c,canMove:!1})})}),A.map(((e,t)=>{var s;const{width:i,maxWidth:r,minWidth:a}=null!==(s=p.layout?.styles?.[e])&&void 0!==s?s:{};return(0,oe.jsx)("th",{style:{width:i,maxWidth:r,minWidth:a},"aria-sort":p.sort?.direction&&p.sort?.field===e?ty[p.sort.direction]:void 0,scope:"col",children:(0,oe.jsx)(Zj,{ref:N(e,t),fieldId:e,view:p,fields:n,onChangeView:o,onHide:j,setOpenedFilter:c})},e)})),!!e?.length&&(0,oe.jsx)("th",{className:"dataviews-view-table__actions-column",children:(0,oe.jsx)("span",{className:"dataviews-view-table-header",children:(0,b.__)("Actions")})})]})}),(0,oe.jsx)("tbody",{children:S&&t.map(((t,r)=>(0,oe.jsx)(Jj,{item:t,level:p.showLevels&&"function"==typeof i?i(t):void 0,hasBulkActions:w,actions:e,fields:n,id:s(t)||r.toString(),view:p,titleField:C,mediaField:k,descriptionField:E,selection:l,getItemId:s,onChangeSelection:a,onClickItem:u,isItemClickable:h},s(t))))})]}),(0,oe.jsx)("div",{className:Ut({"dataviews-loading":r,"dataviews-no-results":!S&&!r}),id:_,children:!S&&(0,oe.jsx)("p",{children:r?(0,oe.jsx)(y.Spinner,{}):(0,b.__)("No results")})})]})},$j={xhuge:{min:3,max:6,default:5},huge:{min:2,max:4,default:4},xlarge:{min:2,max:3,default:3},large:{min:1,max:2,default:2},mobile:{min:1,max:2,default:2}},eS={xhuge:1520,huge:1140,xlarge:780,large:480,mobile:0};function tS(){const e=(0,d.useContext)(my).containerWidth;for(const[t,n]of Object.entries(eS))if(e>=n)return t;return"mobile"}const{Badge:nS}=aj(y.privateApis);function sS({view:e,selection:t,onChangeSelection:n,onClickItem:s,isItemClickable:i,getItemId:r,item:o,actions:a,mediaField:l,titleField:c,descriptionField:u,regularFields:d,badgeFields:h,hasBulkActions:p}){const{showTitle:f=!0,showMedia:m=!0,showDescription:g=!0}=e,x=Aj(a,o),w=r(o),_=(0,v.useInstanceId)(sS),j=t.includes(w),S=l?.render?(0,oe.jsx)(l.render,{item:o}):null,C=f&&c?.render?(0,oe.jsx)(c.render,{item:o}):null,k=Kj({item:o,isItemClickable:i,onClickItem:s,className:"dataviews-view-grid__media"}),E=Kj({item:o,isItemClickable:i,onClickItem:s,className:"dataviews-view-grid__title-field dataviews-title-field"});let P,I;return i(o)&&s&&(C?(P={"aria-labelledby":`dataviews-view-grid__title-field-${_}`},I={id:`dataviews-view-grid__title-field-${_}`}):P={"aria-label":(0,b.__)("Navigate to item")}),(0,oe.jsxs)(y.__experimentalVStack,{spacing:0,className:Ut("dataviews-view-grid__card",{"is-selected":x&&j}),onClickCapture:e=>{if(e.ctrlKey||e.metaKey){if(e.stopPropagation(),e.preventDefault(),!x)return;n(t.includes(w)?t.filter((e=>w!==e)):[...t,w])}},children:[m&&S&&(0,oe.jsx)("div",{...k,...P,children:S}),p&&m&&S&&(0,oe.jsx)(wj,{item:o,selection:t,onChangeSelection:n,getItemId:r,titleField:c,disabled:!x}),(0,oe.jsxs)(y.__experimentalHStack,{justify:"space-between",className:"dataviews-view-grid__title-actions",children:[(0,oe.jsx)("div",{...E,...I,children:C}),!!a?.length&&(0,oe.jsx)(Pj,{item:o,actions:a,isCompact:!0})]}),(0,oe.jsxs)(y.__experimentalVStack,{spacing:1,children:[g&&u?.render&&(0,oe.jsx)(u.render,{item:o}),!!h?.length&&(0,oe.jsx)(y.__experimentalHStack,{className:"dataviews-view-grid__badge-fields",spacing:2,wrap:!0,alignment:"top",justify:"flex-start",children:h.map((e=>(0,oe.jsx)(nS,{className:"dataviews-view-grid__field-value",children:(0,oe.jsx)(e.render,{item:o})},e.id)))}),!!d?.length&&(0,oe.jsx)(y.__experimentalVStack,{className:"dataviews-view-grid__fields",spacing:1,children:d.map((e=>(0,oe.jsx)(y.Flex,{className:"dataviews-view-grid__field",gap:1,justify:"flex-start",expanded:!0,style:{height:"auto"},direction:"row",children:(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(y.FlexItem,{className:"dataviews-view-grid__field-name",children:e.header}),(0,oe.jsx)(y.FlexItem,{className:"dataviews-view-grid__field-value",style:{maxHeight:"none"},children:(0,oe.jsx)(e.render,{item:o})})]})},e.id)))})]})]},w)}const{Menu:iS}=aj(y.privateApis);function rS(e){return`${e}-item-wrapper`}function oS(e){return`${e}-dropdown`}function aS({idPrefix:e,primaryAction:t,item:n}){const s=(0,l.useRegistry)(),[i,r]=(0,d.useState)(!1),o=function(e,t){return`${e}-primary-action-${t}`}(e,t.id),a="string"==typeof t.label?t.label:t.label([n]);return"RenderModal"in t?(0,oe.jsx)("div",{role:"gridcell",children:(0,oe.jsx)(y.Composite.Item,{id:o,render:(0,oe.jsx)(y.Button,{label:a,disabled:!!t.disabled,accessibleWhenDisabled:!0,icon:t.icon,isDestructive:t.isDestructive,size:"small",onClick:()=>r(!0)}),children:i&&(0,oe.jsx)(kj,{action:t,items:[n],closeModal:()=>r(!1)})})},t.id):(0,oe.jsx)("div",{role:"gridcell",children:(0,oe.jsx)(y.Composite.Item,{id:o,render:(0,oe.jsx)(y.Button,{label:a,disabled:!!t.disabled,accessibleWhenDisabled:!0,icon:t.icon,isDestructive:t.isDestructive,size:"small",onClick:()=>{t.callback([n],{registry:s})}})})},t.id)}function lS({view:e,actions:t,idPrefix:n,isSelected:s,item:i,titleField:r,mediaField:o,descriptionField:a,onSelect:c,otherFields:u,onDropdownTriggerKeyDown:h}){const{showTitle:p=!0,showMedia:f=!0,showDescription:m=!0}=e,g=(0,d.useRef)(null),v=`${n}-label`,x=`${n}-description`,w=(0,l.useRegistry)(),[_,j]=(0,d.useState)(!1),[S,C]=(0,d.useState)(null),k=({type:e})=>{j("mouseenter"===e)};(0,d.useEffect)((()=>{s&&g.current?.scrollIntoView({behavior:"auto",block:"nearest",inline:"nearest"})}),[s]);const{primaryAction:E,eligibleActions:P}=(0,d.useMemo)((()=>{const e=t.filter((e=>!e.isEligible||e.isEligible(i)));return{primaryAction:e.filter((e=>e.isPrimary&&!!e.icon))[0],eligibleActions:e}}),[t,i]),I=E&&1===t.length,T=f&&o?.render?(0,oe.jsx)("div",{className:"dataviews-view-list__media-wrapper",children:(0,oe.jsx)(o.render,{item:i})}):null,O=p&&r?.render?(0,oe.jsx)(r.render,{item:i}):null,A=P?.length>0&&(0,oe.jsxs)(y.__experimentalHStack,{spacing:3,className:"dataviews-view-list__item-actions",children:[E&&(0,oe.jsx)(aS,{idPrefix:n,primaryAction:E,item:i}),!I&&(0,oe.jsxs)("div",{role:"gridcell",children:[(0,oe.jsxs)(iS,{placement:"bottom-end",children:[(0,oe.jsx)(iS.TriggerButton,{render:(0,oe.jsx)(y.Composite.Item,{id:oS(n),render:(0,oe.jsx)(y.Button,{size:"small",icon:Da,label:(0,b.__)("Actions"),accessibleWhenDisabled:!0,disabled:!t.length,onKeyDown:h})})}),(0,oe.jsx)(iS.Popover,{children:(0,oe.jsx)(Ej,{actions:P,item:i,registry:w,setActiveModalAction:C})})]}),!!S&&(0,oe.jsx)(kj,{action:S,items:[i],closeModal:()=>C(null)})]})]});return(0,oe.jsx)(y.Composite.Row,{ref:g,render:(0,oe.jsx)("div",{}),role:"row",className:Ut({"is-selected":s,"is-hovered":_}),onMouseEnter:k,onMouseLeave:k,children:(0,oe.jsxs)(y.__experimentalHStack,{className:"dataviews-view-list__item-wrapper",spacing:0,children:[(0,oe.jsx)("div",{role:"gridcell",children:(0,oe.jsx)(y.Composite.Item,{id:rS(n),"aria-pressed":s,"aria-labelledby":v,"aria-describedby":x,className:"dataviews-view-list__item",onClick:()=>c(i)})}),(0,oe.jsxs)(y.__experimentalHStack,{spacing:3,justify:"start",alignment:"flex-start",children:[T,(0,oe.jsxs)(y.__experimentalVStack,{spacing:1,className:"dataviews-view-list__field-wrapper",children:[(0,oe.jsxs)(y.__experimentalHStack,{spacing:0,children:[(0,oe.jsx)("div",{className:"dataviews-title-field",id:v,children:O}),A]}),m&&a?.render&&(0,oe.jsx)("div",{className:"dataviews-view-list__field",children:(0,oe.jsx)(a.render,{item:i})}),(0,oe.jsx)("div",{className:"dataviews-view-list__fields",id:x,children:u.map((e=>(0,oe.jsxs)("div",{className:"dataviews-view-list__field",children:[(0,oe.jsx)(y.VisuallyHidden,{as:"span",className:"dataviews-view-list__field-label",children:e.label}),(0,oe.jsx)("span",{className:"dataviews-view-list__field-value",children:(0,oe.jsx)(e.render,{item:i})})]},e.id)))})]})]})]})})}function cS(e){return!!e}const uS=[{type:iy,label:(0,b.__)("Table"),component:Qj,icon:vj,viewConfigOptions:function(){const e=(0,d.useContext)(my),t=e.view;return(0,oe.jsxs)(y.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,size:"__unstable-large",label:(0,b.__)("Density"),value:t.layout?.density||"balanced",onChange:n=>{e.onChangeView({...t,layout:{...t.layout,density:n}})},isBlock:!0,children:[(0,oe.jsx)(y.__experimentalToggleGroupControlOption,{value:"comfortable",label:(0,b._x)("Comfortable","Density option for DataView layout")},"comfortable"),(0,oe.jsx)(y.__experimentalToggleGroupControlOption,{value:"balanced",label:(0,b._x)("Balanced","Density option for DataView layout")},"balanced"),(0,oe.jsx)(y.__experimentalToggleGroupControlOption,{value:"compact",label:(0,b._x)("Compact","Density option for DataView layout")},"compact")]})}},{type:ry,label:(0,b.__)("Grid"),component:function({actions:e,data:t,fields:n,getItemId:s,isLoading:i,onChangeSelection:r,onClickItem:o,isItemClickable:a,selection:l,view:c}){var u;const h=n.find((e=>e.id===c?.titleField)),p=n.find((e=>e.id===c?.mediaField)),f=n.find((e=>e.id===c?.descriptionField)),m=null!==(u=c.fields)&&void 0!==u?u:[],{regularFields:g,badgeFields:v}=m.reduce(((e,t)=>{const s=n.find((e=>e.id===t));if(!s)return e;return e[c.layout?.badgeFields?.includes(t)?"badgeFields":"regularFields"].push(s),e}),{regularFields:[],badgeFields:[]}),x=!!t?.length,w=function(){const e=(0,d.useContext)(my).view,t=tS();return(0,d.useMemo)((()=>{const n=e.layout?.previewSize;let s;if(!n)return;const i=$j[t];return ni.max&&(s=i.max),s}),[t,e])}(),_=Nj(e,t),j=w||c.layout?.previewSize,S=j?{gridTemplateColumns:`repeat(${j}, minmax(0, 1fr))`}:{};return(0,oe.jsxs)(oe.Fragment,{children:[x&&(0,oe.jsx)(y.__experimentalGrid,{gap:8,columns:2,alignment:"top",className:"dataviews-view-grid",style:S,"aria-busy":i,children:t.map((t=>(0,oe.jsx)(sS,{view:c,selection:l,onChangeSelection:r,onClickItem:o,isItemClickable:a,getItemId:s,item:t,actions:e,mediaField:p,titleField:h,descriptionField:f,regularFields:g,badgeFields:v,hasBulkActions:_},s(t))))}),!x&&(0,oe.jsx)("div",{className:Ut({"dataviews-loading":i,"dataviews-no-results":!i}),children:(0,oe.jsx)("p",{children:i?(0,oe.jsx)(y.Spinner,{}):(0,b.__)("No results")})})]})},icon:xj,viewConfigOptions:function(){const e=tS(),t=(0,d.useContext)(my),n=t.view,s=$j[e],i=n.layout?.previewSize||s.default,r=(0,d.useMemo)((()=>Array.from({length:s.max-s.min+1},((e,t)=>({value:s.min+t})))),[s]);return"mobile"===e?null:(0,oe.jsx)(y.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,showTooltip:!1,label:(0,b.__)("Preview size"),value:s.max+s.min-i,marks:r,min:s.min,max:s.max,withInputField:!1,onChange:(e=0)=>{t.onChangeView({...n,layout:{...n.layout,previewSize:s.max+s.min-e}})},step:1})}},{type:"list",label:(0,b.__)("List"),component:function e(t){var n;const{actions:s,data:i,fields:r,getItemId:o,isLoading:a,onChangeSelection:l,selection:c,view:u}=t,h=(0,v.useInstanceId)(e,"view-list"),p=i?.findLast((e=>c.includes(o(e)))),f=r.find((e=>e.id===u.titleField)),m=r.find((e=>e.id===u.mediaField)),g=r.find((e=>e.id===u.descriptionField)),x=(null!==(n=u?.fields)&&void 0!==n?n:[]).map((e=>r.find((t=>e===t.id)))).filter(cS),w=e=>l([o(e)]),_=(0,d.useCallback)((e=>`${h}-${o(e)}`),[h,o]),j=(0,d.useCallback)(((e,t)=>t.startsWith(_(e))),[_]),[S,C]=(0,d.useState)(void 0);(0,d.useEffect)((()=>{p&&C(rS(_(p)))}),[p,_]);const k=i.findIndex((e=>j(e,null!=S?S:""))),E=(0,v.usePrevious)(k),P=-1!==k,I=(0,d.useCallback)(((e,t)=>{const n=Math.min(i.length-1,Math.max(0,e));if(!i[n])return;const s=t(_(i[n]));C(s),document.getElementById(s)?.focus()}),[i,_]);(0,d.useEffect)((()=>{!P&&(void 0!==E&&-1!==E)&&I(E,rS)}),[P,I,E]);const T=(0,d.useCallback)((e=>{"ArrowDown"===e.key&&(e.preventDefault(),I(k+1,oS)),"ArrowUp"===e.key&&(e.preventDefault(),I(k-1,oS))}),[I,k]),O=i?.length;return O?(0,oe.jsx)(y.Composite,{id:h,render:(0,oe.jsx)("div",{}),className:"dataviews-view-list",role:"grid",activeId:S,setActiveId:C,children:i.map((e=>{const t=_(e);return(0,oe.jsx)(lS,{view:u,idPrefix:t,actions:s,item:e,isSelected:e===p,onSelect:w,mediaField:m,titleField:f,descriptionField:g,otherFields:x,onDropdownTriggerKeyDown:T},t)}))}):(0,oe.jsx)("div",{className:Ut({"dataviews-loading":a,"dataviews-no-results":!O&&!a}),children:!O&&(0,oe.jsx)("p",{children:a?(0,oe.jsx)(y.Spinner,{}):(0,b.__)("No results")})})},icon:(0,b.isRTL)()?yj:bj}];function dS(){const{actions:e=[],data:t,fields:n,getItemId:s,getItemLevel:i,isLoading:r,view:o,onChangeView:a,selection:l,onChangeSelection:c,setOpenedFilter:u,onClickItem:h,isItemClickable:p}=(0,d.useContext)(my),f=uS.find((e=>e.type===o.type))?.component;return(0,oe.jsx)(f,{actions:e,data:t,fields:n,getItemId:s,getItemLevel:i,isLoading:r,onChangeView:a,onChangeSelection:c,selection:l,setOpenedFilter:u,onClickItem:h,isItemClickable:p,view:o})}const hS=(0,d.memo)((function(){var e;const{view:t,onChangeView:n,paginationInfo:{totalItems:s=0,totalPages:i}}=(0,d.useContext)(my);if(!s||!i)return null;const r=null!==(e=t.page)&&void 0!==e?e:1,o=Array.from(Array(i)).map(((e,t)=>{const n=t+1;return{value:n.toString(),label:n.toString(),"aria-label":r===n?(0,b.sprintf)((0,b.__)("Page %1$s of %2$s"),r,i):n.toString()}}));return!!s&&1!==i&&(0,oe.jsxs)(y.__experimentalHStack,{expanded:!1,className:"dataviews-pagination",justify:"end",spacing:6,children:[(0,oe.jsx)(y.__experimentalHStack,{justify:"flex-start",expanded:!1,spacing:1,className:"dataviews-pagination__page-select",children:(0,d.createInterpolateElement)((0,b.sprintf)((0,b._x)("
    Page
    %1$s
    of %2$s
    ","paging"),"",i),{div:(0,oe.jsx)("div",{"aria-hidden":!0}),CurrentPage:(0,oe.jsx)(y.SelectControl,{"aria-label":(0,b.__)("Current page"),value:r.toString(),options:o,onChange:e=>{n({...t,page:+e})},size:"small",__nextHasNoMarginBottom:!0,variant:"minimal"})})}),(0,oe.jsxs)(y.__experimentalHStack,{expanded:!1,spacing:1,children:[(0,oe.jsx)(y.Button,{onClick:()=>n({...t,page:r-1}),disabled:1===r,accessibleWhenDisabled:!0,label:(0,b.__)("Previous page"),icon:(0,b.isRTL)()?ou:au,showTooltip:!0,size:"compact",tooltipPosition:"top"}),(0,oe.jsx)(y.Button,{onClick:()=>n({...t,page:r+1}),disabled:r>=i,accessibleWhenDisabled:!0,label:(0,b.__)("Next page"),icon:(0,b.isRTL)()?au:ou,showTooltip:!0,size:"compact",tooltipPosition:"top"})]})]})})),pS=[];function fS(){const{view:e,paginationInfo:{totalItems:t=0,totalPages:n},data:s,actions:i=pS}=(0,d.useContext)(my),r=Nj(i,s)&&[iy,ry].includes(e.type);return!t||!n||n<=1&&!r?null:!!t&&(0,oe.jsxs)(y.__experimentalHStack,{expanded:!1,justify:"end",className:"dataviews-footer",children:[r&&(0,oe.jsx)(Lj,{}),(0,oe.jsx)(hS,{})]})}const mS=(0,d.memo)((function({label:e}){const{view:t,onChangeView:n}=(0,d.useContext)(my),[s,i,r]=(0,v.useDebouncedInput)(t.search);(0,d.useEffect)((()=>{var e;i(null!==(e=t.search)&&void 0!==e?e:"")}),[t.search,i]);const o=(0,d.useRef)(n),a=(0,d.useRef)(t);(0,d.useEffect)((()=>{o.current=n,a.current=t}),[n,t]),(0,d.useEffect)((()=>{r!==a.current?.search&&o.current({...a.current,page:1,search:r})}),[r]);const l=e||(0,b.__)("Search");return(0,oe.jsx)(y.SearchControl,{className:"dataviews-search",__nextHasNoMarginBottom:!0,onChange:i,value:s,label:l,placeholder:l,size:"compact"})})),gS=mS,vS=(0,oe.jsx)(Yt.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,oe.jsx)(Yt.Path,{d:"M17 10h-1.2V7c0-2.1-1.7-3.8-3.8-3.8-2.1 0-3.8 1.7-3.8 3.8v3H7c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h10c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1zm-2.8 0H9.8V7c0-1.2 1-2.2 2.2-2.2s2.2 1 2.2 2.2v3z"})}),xS=(0,oe.jsx)(Yt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Yt.Path,{fillRule:"evenodd",d:"M10.289 4.836A1 1 0 0111.275 4h1.306a1 1 0 01.987.836l.244 1.466c.787.26 1.503.679 2.108 1.218l1.393-.522a1 1 0 011.216.437l.653 1.13a1 1 0 01-.23 1.273l-1.148.944a6.025 6.025 0 010 2.435l1.149.946a1 1 0 01.23 1.272l-.653 1.13a1 1 0 01-1.216.437l-1.394-.522c-.605.54-1.32.958-2.108 1.218l-.244 1.466a1 1 0 01-.987.836h-1.306a1 1 0 01-.986-.836l-.244-1.466a5.995 5.995 0 01-2.108-1.218l-1.394.522a1 1 0 01-1.217-.436l-.653-1.131a1 1 0 01.23-1.272l1.149-.946a6.026 6.026 0 010-2.435l-1.148-.944a1 1 0 01-.23-1.272l.653-1.131a1 1 0 011.217-.437l1.393.522a5.994 5.994 0 012.108-1.218l.244-1.466zM14.929 12a3 3 0 11-6 0 3 3 0 016 0z",clipRule:"evenodd"})}),{Menu:yS}=(window.wp.warning,aj(y.privateApis)),bS={className:"dataviews-config__popover",placement:"bottom-end",offset:9};function wS({defaultLayouts:e={list:{},grid:{},table:{}}}){const{view:t,onChangeView:n}=(0,d.useContext)(my),s=Object.keys(e);if(s.length<=1)return null;const i=uS.find((e=>t.type===e.type));return(0,oe.jsxs)(yS,{children:[(0,oe.jsx)(yS.TriggerButton,{render:(0,oe.jsx)(y.Button,{size:"compact",icon:i?.icon,label:(0,b.__)("Layout")})}),(0,oe.jsx)(yS.Popover,{children:s.map((s=>{const i=uS.find((e=>e.type===s));return i?(0,oe.jsx)(yS.RadioItem,{value:s,name:"view-actions-available-view",checked:s===t.type,hideOnClick:!0,onChange:s=>{switch(s.target.value){case"list":case"grid":case"table":const i={...t};return"layout"in i&&delete i.layout,n({...i,type:s.target.value,...e[s.target.value]})}},children:(0,oe.jsx)(yS.ItemLabel,{children:i.label})},s):null}))})]})}function _S(){const{view:e,fields:t,onChangeView:n}=(0,d.useContext)(my),s=(0,d.useMemo)((()=>t.filter((e=>!1!==e.enableSorting)).map((e=>({label:e.label,value:e.id})))),[t]);return(0,oe.jsx)(y.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,b.__)("Sort by"),value:e.sort?.field,options:s,onChange:t=>{n({...e,sort:{direction:e?.sort?.direction||"desc",field:t},showLevels:!1})}})}function jS(){const{view:e,fields:t,onChangeView:n}=(0,d.useContext)(my);if(0===t.filter((e=>!1!==e.enableSorting)).length)return null;let s=e.sort?.direction;return!s&&e.sort?.field&&(s="desc"),(0,oe.jsx)(y.__experimentalToggleGroupControl,{className:"dataviews-view-config__sort-direction",__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,isBlock:!0,label:(0,b.__)("Order"),value:s,onChange:s=>{"asc"!==s&&"desc"!==s||n({...e,sort:{direction:s,field:e.sort?.field||t.find((e=>!1!==e.enableSorting))?.id||""},showLevels:!1})},children:$x.map((e=>(0,oe.jsx)(y.__experimentalToggleGroupControlOptionIcon,{value:e,icon:sy[e],label:ny[e]},e)))})}const SS=[10,20,50,100];function CS(){const{view:e,onChangeView:t}=(0,d.useContext)(my);return(0,oe.jsx)(y.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,isBlock:!0,label:(0,b.__)("Items per page"),value:e.perPage||10,disabled:!e?.sort?.field,onChange:n=>{const s="number"==typeof n||void 0===n?n:parseInt(n,10);t({...e,perPage:s,page:1})},children:SS.map((e=>(0,oe.jsx)(y.__experimentalToggleGroupControlOption,{value:e,label:e.toString()},e)))})}function kS({previewOptions:e,onChangePreviewOption:t,onMenuOpenChange:n,activeOption:s}){return(0,oe.jsxs)(yS,{onOpenChange:n,children:[(0,oe.jsx)(yS.TriggerButton,{render:(0,oe.jsx)(y.Button,{className:"dataviews-field-control__field-preview-options-button",size:"compact",icon:Da,label:(0,b.__)("Preview")})}),(0,oe.jsx)(yS.Popover,{children:e?.map((({id:e,label:n})=>(0,oe.jsx)(yS.RadioItem,{value:e,checked:e===s,onChange:()=>{t?.(e),(e=>{setTimeout((()=>{const t=document.querySelector(`.dataviews-field-control__field-${e} .dataviews-field-control__field-preview-options-button`);t instanceof HTMLElement&&t.focus()}),50)})(e)},children:(0,oe.jsx)(yS.ItemLabel,{children:n})},e)))})]})}function ES({field:e,label:t,description:n,isVisible:s,isFirst:i,isLast:r,canMove:o=!0,onToggleVisibility:a,onMoveUp:l,onMoveDown:c,previewOptions:u,onChangePreviewOption:h}){const[p,f]=(0,d.useState)(!1);return(0,oe.jsx)(y.__experimentalItem,{children:(0,oe.jsxs)(y.__experimentalHStack,{expanded:!0,className:Ut("dataviews-field-control__field",`dataviews-field-control__field-${e.id}`,{"is-interacting":p}),justify:"flex-start",children:[(0,oe.jsx)("span",{className:"dataviews-field-control__icon",children:!o&&!e.enableHiding&&(0,oe.jsx)(y.Icon,{icon:vS})}),(0,oe.jsxs)("span",{className:"dataviews-field-control__label-sub-label-container",children:[(0,oe.jsx)("span",{className:"dataviews-field-control__label",children:t||e.label}),n&&(0,oe.jsx)("span",{className:"dataviews-field-control__sub-label",children:n})]}),(0,oe.jsxs)(y.__experimentalHStack,{justify:"flex-end",expanded:!1,className:"dataviews-field-control__actions",children:[s&&(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(y.Button,{disabled:i||!o,accessibleWhenDisabled:!0,size:"compact",onClick:l,icon:Lv,label:i||!o?(0,b.__)("This field can't be moved up"):(0,b.sprintf)((0,b.__)("Move %s up"),e.label)}),(0,oe.jsx)(y.Button,{disabled:r||!o,accessibleWhenDisabled:!0,size:"compact",onClick:c,icon:zv,label:r||!o?(0,b.__)("This field can't be moved down"):(0,b.sprintf)((0,b.__)("Move %s down"),e.label)})]}),a&&(0,oe.jsx)(y.Button,{className:"dataviews-field-control__field-visibility-button",disabled:!e.enableHiding,accessibleWhenDisabled:!0,size:"compact",onClick:()=>{a(),setTimeout((()=>{const t=document.querySelector(`.dataviews-field-control__field-${e.id} .dataviews-field-control__field-visibility-button`);t instanceof HTMLElement&&t.focus()}),50)},icon:s?Hj:Ba,label:s?(0,b.sprintf)((0,b._x)("Hide %s","field"),e.label):(0,b.sprintf)((0,b._x)("Show %s","field"),e.label)}),u&&(0,oe.jsx)(kS,{previewOptions:u,onChangePreviewOption:h,onMenuOpenChange:f,activeOption:e.id})]})]})})}function PS({index:e,field:t,view:n,onChangeView:s}){var i;const r=null!==(i=n.fields)&&void 0!==i?i:[],o=void 0!==e&&r.includes(t.id);return(0,oe.jsx)(ES,{field:t,isVisible:o,isFirst:void 0!==e&&e<1,isLast:void 0!==e&&e===r.length-1,onToggleVisibility:()=>{s({...n,fields:o?r.filter((e=>e!==t.id)):[...r,t.id]})},onMoveUp:void 0!==e?()=>{var i;s({...n,fields:[...null!==(i=r.slice(0,e-1))&&void 0!==i?i:[],t.id,r[e-1],...r.slice(e+1)]})}:void 0,onMoveDown:void 0!==e?()=>{var i;s({...n,fields:[...null!==(i=r.slice(0,e))&&void 0!==i?i:[],r[e+1],t.id,...r.slice(e+2)]})}:void 0})}function IS(e){return!!e}function TS(){var e;const{view:t,fields:n,onChangeView:s}=(0,d.useContext)(my),i=[t?.titleField,t?.mediaField,t?.descriptionField].filter(Boolean),r=null!==(e=t.fields)&&void 0!==e?e:[],o=n.filter((e=>!r.includes(e.id)&&!i.includes(e.id)&&"media"!==e.type)),a=r.map((e=>n.find((t=>t.id===e)))).filter(IS);if(!a?.length&&!o?.length)return null;const l=n.find((e=>e.id===t.titleField)),c=n.find((e=>e.id===t.mediaField)),u=n.find((e=>e.id===t.descriptionField)),h=n.filter((e=>"media"===e.type));let p;if(h.length>1){var f;const e=IS(c)&&(null===(f=t.showMedia)||void 0===f||f);p=IS(c)&&(0,oe.jsx)(ES,{field:c,label:(0,b.__)("Preview"),description:c.label,isVisible:e,onToggleVisibility:()=>{s({...t,showMedia:!e})},canMove:!1,previewOptions:h.map((e=>({label:e.label,id:e.id}))),onChangePreviewOption:e=>s({...t,mediaField:e})},c.id)}const m=[{field:l,isVisibleFlag:"showTitle"},{field:c,isVisibleFlag:"showMedia",ui:p},{field:u,isVisibleFlag:"showDescription"}].filter((({field:e})=>IS(e))),g=m.filter((({field:e,isVisibleFlag:n})=>{var s;return IS(e)&&(null===(s=t[n])||void 0===s||s)})),v=m.filter((({field:e,isVisibleFlag:n})=>{var s;return IS(e)&&!(null===(s=t[n])||void 0===s||s)}));return(0,oe.jsxs)(y.__experimentalVStack,{className:"dataviews-field-control",spacing:6,children:[(0,oe.jsx)(y.__experimentalVStack,{className:"dataviews-view-config__properties",spacing:0,children:(g.length>0||!!a?.length)&&(0,oe.jsxs)(y.__experimentalItemGroup,{isBordered:!0,isSeparated:!0,children:[g.map((({field:e,isVisibleFlag:n,ui:i})=>null!=i?i:(0,oe.jsx)(ES,{field:e,isVisible:!0,onToggleVisibility:()=>{s({...t,[n]:!1})},canMove:!1},e.id))),a.map(((e,n)=>(0,oe.jsx)(PS,{field:e,view:t,onChangeView:s,index:n},e.id)))]})}),(!!o?.length||!!v.length)&&(0,oe.jsxs)(y.__experimentalVStack,{spacing:4,children:[(0,oe.jsx)(y.BaseControl.VisualLabel,{style:{margin:0},children:(0,b.__)("Hidden")}),(0,oe.jsx)(y.__experimentalVStack,{className:"dataviews-view-config__properties",spacing:0,children:(0,oe.jsxs)(y.__experimentalItemGroup,{isBordered:!0,isSeparated:!0,children:[v.length>0&&v.map((({field:e,isVisibleFlag:n,ui:i})=>null!=i?i:(0,oe.jsx)(ES,{field:e,isVisible:!1,onToggleVisibility:()=>{s({...t,[n]:!0})},canMove:!1},e.id))),o.map((e=>(0,oe.jsx)(PS,{field:e,view:t,onChangeView:s},e.id)))]})})]})]})}function OS({title:e,description:t,children:n}){return(0,oe.jsxs)(y.__experimentalGrid,{columns:12,className:"dataviews-settings-section",gap:4,children:[(0,oe.jsxs)("div",{className:"dataviews-settings-section__sidebar",children:[(0,oe.jsx)(y.__experimentalHeading,{level:2,className:"dataviews-settings-section__title",children:e}),t&&(0,oe.jsx)(y.__experimentalText,{variant:"muted",className:"dataviews-settings-section__description",children:t})]}),(0,oe.jsx)(y.__experimentalGrid,{columns:8,gap:4,className:"dataviews-settings-section__content",children:n})]})}function AS(){const{view:e}=(0,d.useContext)(my),t=(0,v.useInstanceId)(NS,"dataviews-view-config-dropdown"),n=uS.find((t=>t.type===e.type));return(0,oe.jsx)(y.Dropdown,{expandOnMobile:!0,popoverProps:{...bS,id:t},renderToggle:({onToggle:e,isOpen:n})=>(0,oe.jsx)(y.Button,{size:"compact",icon:xS,label:(0,b._x)("View options","View is used as a noun"),onClick:e,"aria-expanded":n?"true":"false","aria-controls":t}),renderContent:()=>(0,oe.jsx)(y.__experimentalDropdownContentWrapper,{paddingSize:"medium",className:"dataviews-config__popover-content-wrapper",children:(0,oe.jsxs)(y.__experimentalVStack,{className:"dataviews-view-config",spacing:6,children:[(0,oe.jsxs)(OS,{title:(0,b.__)("Appearance"),children:[(0,oe.jsxs)(y.__experimentalHStack,{expanded:!0,className:"is-divided-in-two",children:[(0,oe.jsx)(_S,{}),(0,oe.jsx)(jS,{})]}),!!n?.viewConfigOptions&&(0,oe.jsx)(n.viewConfigOptions,{}),(0,oe.jsx)(CS,{})]}),(0,oe.jsx)(OS,{title:(0,b.__)("Properties"),children:(0,oe.jsx)(TS,{})})]})})})}function NS({defaultLayouts:e={list:{},grid:{},table:{}}}){return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(wS,{defaultLayouts:e}),(0,oe.jsx)(AS,{})]})}const MS=(0,d.memo)(NS),FS=e=>e.id,VS=()=>!0,RS=[];function BS({view:e,onChangeView:t,fields:n,search:s=!0,searchLabel:i,actions:r=RS,data:o,getItemId:a=FS,getItemLevel:l,isLoading:c=!1,paginationInfo:u,defaultLayouts:h,selection:p,onChangeSelection:f,onClickItem:m,isItemClickable:g=VS,header:x}){const[b,w]=(0,d.useState)(0),_=(0,v.useResizeObserver)((e=>{w(e[0].borderBoxSize[0].inlineSize)}),{box:"border-box"}),[j,S]=(0,d.useState)([]),C=void 0===p||void 0===f,k=C?j:p,[E,P]=(0,d.useState)(null);const I=(0,d.useMemo)((()=>dy(n)),[n]),T=(0,d.useMemo)((()=>k.filter((e=>o.some((t=>a(t)===e))))),[k,o,a]),O=pj(I,e),[A,N]=(0,d.useState)((()=>(O||[]).some((e=>e.isPrimary))));return(0,oe.jsx)(my.Provider,{value:{view:e,onChangeView:t,fields:I,actions:r,data:o,isLoading:c,paginationInfo:u,selection:T,onChangeSelection:function(e){const t="function"==typeof e?e(k):e;C&&S(t),f&&f(t)},openedFilter:E,setOpenedFilter:P,getItemId:a,getItemLevel:l,isItemClickable:g,onClickItem:m,containerWidth:b},children:(0,oe.jsxs)("div",{className:"dataviews-wrapper",ref:_,children:[(0,oe.jsxs)(y.__experimentalHStack,{alignment:"top",justify:"space-between",className:"dataviews__view-actions",spacing:1,children:[(0,oe.jsxs)(y.__experimentalHStack,{justify:"start",expanded:!1,className:"dataviews__search",children:[s&&(0,oe.jsx)(gS,{label:i}),(0,oe.jsx)(fj,{filters:O,view:e,onChangeView:t,setOpenedFilter:P,setIsShowingFilter:N,isShowingFilter:A})]}),(0,oe.jsxs)(y.__experimentalHStack,{spacing:1,expanded:!1,style:{flexShrink:0},children:[(0,oe.jsx)(MS,{defaultLayouts:h}),x]})]}),A&&(0,oe.jsx)(gj,{}),(0,oe.jsx)(dS,{}),(0,oe.jsx)(fS,{})]})})}function DS(){var e;const t=(0,l.useSelect)((e=>{const{getSettings:t}=te(e(zt));return t()}),[]),n=null!==(e=t.__experimentalAdditionalBlockPatterns)&&void 0!==e?e:t.__experimentalBlockPatterns,s=(0,l.useSelect)((e=>e(_.store).getBlockPatterns()),[]),i=(0,d.useMemo)((()=>[...n||[],...s||[]].filter(yx)),[n,s]);return(0,d.useMemo)((()=>{const{__experimentalAdditionalBlockPatterns:e,...n}=t;return{...n,__experimentalBlockPatterns:i,isPreviewMode:!0}}),[t,i])}const LS=(0,oe.jsx)(Yt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Yt.Path,{d:"M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-17.6 1L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"})}),zS=(0,oe.jsx)(Yt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Yt.Path,{d:"M18.5 15v3.5H13V6.7l4.5 4.1 1-1.1-6.2-5.8-5.8 5.8 1 1.1 4-4v11.7h-6V15H4v5h16v-5z"})}),{useHistory:GS,useLocation:HS}=te(Gt.privateApis),{CreatePatternModal:US,useAddPatternCategory:WS}=te(_e.privateApis),{CreateTemplatePartModal:qS}=te(h.privateApis);function ZS(){const e=GS(),t=HS(),[n,s]=(0,d.useState)(!1),[i,r]=(0,d.useState)(!1),{createPatternFromFile:o}=te((0,l.useDispatch)(_e.store)),{createSuccessNotice:a,createErrorNotice:c}=(0,l.useDispatch)(w.store),u=(0,d.useRef)(),{isBlockBasedTheme:h,addNewPatternLabel:p,addNewTemplatePartLabel:f,canCreatePattern:m,canCreateTemplatePart:g}=(0,l.useSelect)((e=>{const{getCurrentTheme:t,getPostType:n,canUser:s}=e(_.store);return{isBlockBasedTheme:t()?.is_block_theme,addNewPatternLabel:n(Ie.user)?.labels?.add_new_item,addNewTemplatePartLabel:n(Ce)?.labels?.add_new_item,canCreatePattern:s("create",{kind:"postType",name:Ie.user}),canCreateTemplatePart:s("create",{kind:"postType",name:Ce})}}),[]);function v(){s(!1),r(!1)}const x=[];m&&x.push({icon:qo,onClick:()=>s(!0),title:p}),h&&g&&x.push({icon:LS,onClick:()=>r(!0),title:f}),m&&x.push({icon:zS,onClick:()=>{u.current.click()},title:(0,b.__)("Import pattern from JSON")});const{categoryMap:j,findOrCreateTerm:S}=WS();return 0===x.length?null:(0,oe.jsxs)(oe.Fragment,{children:[p&&(0,oe.jsx)(y.DropdownMenu,{controls:x,icon:null,toggleProps:{variant:"primary",showTooltip:!1,__next40pxDefaultSize:!0},text:p,label:p}),n&&(0,oe.jsx)(US,{onClose:()=>s(!1),onSuccess:function({pattern:t}){s(!1),e.navigate(`/${Ie.user}/${t.id}?canvas=edit`)},onError:v}),i&&(0,oe.jsx)(qS,{closeModal:()=>r(!1),blocks:[],onCreate:function(t){r(!1),e.navigate(`/${Ce}/${t.id}?canvas=edit`)},onError:v}),(0,oe.jsx)("input",{type:"file",accept:".json",hidden:!0,ref:u,onChange:async n=>{const s=n.target.files?.[0];if(s)try{let n;if(t.query.postType!==Ce){const e=Array.from(j.values()).find((e=>e.name===t.query.categoryId));e&&(n=e.id||await S(e.label))}const i=await o(s,n?[n]:void 0);n||"my-patterns"===t.query.categoryId||e.navigate(`/pattern?categoryId=${Te}`),a((0,b.sprintf)((0,b.__)('Imported "%s" from JSON.'),i.title.raw),{type:"snackbar",id:"import-pattern-success"})}catch(e){c(e.message,{type:"snackbar",id:"import-pattern-error"})}finally{n.target.value=""}}})]})}const{RenamePatternCategoryModal:KS}=te(_e.privateApis);function YS({category:e,onClose:t}){const[n,s]=(0,d.useState)(!1);return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(y.MenuItem,{onClick:()=>s(!0),children:(0,b.__)("Rename")}),n&&(0,oe.jsx)(XS,{category:e,onClose:()=>{s(!1),t()}})]})}function XS({category:e,onClose:t}){const n={id:e.id,slug:e.slug,name:e.label},s=Vx();return(0,oe.jsx)(KS,{category:n,existingCategories:s,onClose:t,overlayClassName:"edit-site-list__rename-modal",focusOnMount:"firstContentElement",size:"small"})}const{useHistory:JS}=te(Gt.privateApis);function QS({category:e,onClose:t}){const[n,s]=(0,d.useState)(!1),i=JS(),{createSuccessNotice:r,createErrorNotice:o}=(0,l.useDispatch)(w.store),{deleteEntityRecord:a,invalidateResolution:c}=(0,l.useDispatch)(_.store);return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(y.MenuItem,{isDestructive:!0,onClick:()=>s(!0),children:(0,b.__)("Delete")}),(0,oe.jsx)(y.__experimentalConfirmDialog,{isOpen:n,onConfirm:async()=>{try{await a("taxonomy","wp_pattern_category",e.id,{force:!0},{throwOnError:!0}),c("getUserPatternCategories"),c("getEntityRecords",["postType",Ie.user,{per_page:-1}]),r((0,b.sprintf)((0,b._x)('"%s" deleted.',"pattern category"),e.label),{type:"snackbar",id:"pattern-category-delete"}),t?.(),i.navigate(`/pattern?categoryId=${Te}`)}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,b.__)("An error occurred while deleting the pattern category.");o(t,{type:"snackbar",id:"pattern-category-delete"})}},onCancel:()=>s(!1),confirmButtonText:(0,b.__)("Delete"),className:"edit-site-patterns__delete-modal",title:(0,b.sprintf)((0,b._x)('Delete "%s"?',"pattern category"),(0,Kt.decodeEntities)(e.label)),size:"medium",__experimentalHideHeader:!1,children:(0,b.sprintf)((0,b.__)('Are you sure you want to delete the category "%s"? The patterns will not be deleted.'),(0,Kt.decodeEntities)(e.label))})]})}function $S({categoryId:e,type:t,titleId:n,descriptionId:s}){const{patternCategories:i}=Vx(),r=(0,l.useSelect)((e=>e(_.store).getEntityRecord("root","__unstableBase")?.default_template_part_areas||[]),[]);let o,a,c;if(t===Ce){const t=r.find((t=>t.area===e));o=t?.label||(0,b.__)("All Template Parts"),a=t?.description||(0,b.__)("Includes every template part defined for any area.")}else t===Ie.user&&e&&(c=i.find((t=>t.name===e)),o=c?.label,a=c?.description);return o?(0,oe.jsxs)(y.__experimentalVStack,{className:"edit-site-patterns__section-header",spacing:1,children:[(0,oe.jsxs)(y.__experimentalHStack,{justify:"space-between",className:"edit-site-patterns__title",children:[(0,oe.jsx)(y.__experimentalHeading,{as:"h2",level:3,id:n,weight:500,truncate:!0,children:o}),(0,oe.jsxs)(y.__experimentalHStack,{expanded:!1,children:[(0,oe.jsx)(ZS,{}),!!c?.id&&(0,oe.jsx)(y.DropdownMenu,{icon:Da,label:(0,b.__)("Actions"),toggleProps:{className:"edit-site-patterns__button",description:(0,b.sprintf)((0,b.__)("Action menu for %s pattern category"),o),size:"compact"},children:({onClose:e})=>(0,oe.jsxs)(y.MenuGroup,{children:[(0,oe.jsx)(YS,{category:c,onClose:e}),(0,oe.jsx)(QS,{category:c,onClose:e})]})})]})]}),a?(0,oe.jsx)(y.__experimentalText,{variant:"muted",as:"p",id:s,className:"edit-site-patterns__sub-title",children:a}):null]}):null}const eC=(0,oe.jsx)(Yt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Yt.Path,{d:"m19 7-3-3-8.5 8.5-1 4 4-1L19 7Zm-7 11.5H5V20h7v-1.5Z"})}),{useHistory:tC}=te(Gt.privateApis),nC=()=>{const e=tC();return(0,d.useMemo)((()=>({id:"edit-post",label:(0,b.__)("Edit"),isPrimary:!0,icon:eC,isEligible:e=>"trash"!==e.status&&e.type!==Ie.theme,callback(t){const n=t[0];e.navigate(`/${n.type}/${n.id}?canvas=edit`)}})),[e])},sC=(0,oe.jsx)(Yt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Yt.Path,{d:"M10.5 4v4h3V4H15v4h1.5a1 1 0 011 1v4l-3 4v2a1 1 0 01-1 1h-3a1 1 0 01-1-1v-2l-3-4V9a1 1 0 011-1H9V4h1.5zm.5 12.5v2h2v-2l3-4v-3H8v3l3 4z"})}),iC=(0,oe.jsx)(Yt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Yt.Path,{d:"M12 3.3c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8s-4-8.8-8.8-8.8zm6.5 5.5h-2.6C15.4 7.3 14.8 6 14 5c2 .6 3.6 2 4.5 3.8zm.7 3.2c0 .6-.1 1.2-.2 1.8h-2.9c.1-.6.1-1.2.1-1.8s-.1-1.2-.1-1.8H19c.2.6.2 1.2.2 1.8zM12 18.7c-1-.7-1.8-1.9-2.3-3.5h4.6c-.5 1.6-1.3 2.9-2.3 3.5zm-2.6-4.9c-.1-.6-.1-1.1-.1-1.8 0-.6.1-1.2.1-1.8h5.2c.1.6.1 1.1.1 1.8s-.1 1.2-.1 1.8H9.4zM4.8 12c0-.6.1-1.2.2-1.8h2.9c-.1.6-.1 1.2-.1 1.8 0 .6.1 1.2.1 1.8H5c-.2-.6-.2-1.2-.2-1.8zM12 5.3c1 .7 1.8 1.9 2.3 3.5H9.7c.5-1.6 1.3-2.9 2.3-3.5zM10 5c-.8 1-1.4 2.3-1.8 3.8H5.5C6.4 7 8 5.6 10 5zM5.5 15.3h2.6c.4 1.5 1 2.8 1.8 3.7-1.8-.6-3.5-2-4.4-3.7zM14 19c.8-1 1.4-2.2 1.8-3.7h2.6C17.6 17 16 18.4 14 19z"})}),rC=(0,oe.jsx)(Yt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Yt.Path,{fillRule:"evenodd",d:"M7.25 16.437a6.5 6.5 0 1 1 9.5 0V16A2.75 2.75 0 0 0 14 13.25h-4A2.75 2.75 0 0 0 7.25 16v.437Zm1.5 1.193a6.47 6.47 0 0 0 3.25.87 6.47 6.47 0 0 0 3.25-.87V16c0-.69-.56-1.25-1.25-1.25h-4c-.69 0-1.25.56-1.25 1.25v1.63ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm10-2a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z",clipRule:"evenodd"})});function oC(e,t){return(0,l.useSelect)((n=>{const{getEntityRecord:s,getMedia:i,getUser:r,getEditedEntityRecord:o}=n(_.store),a=o("postType",e,t),l=a?.original_source,c=a?.author_text;switch(l){case"theme":return{type:l,icon:Wo,text:c,isCustomized:a.source===ke};case"plugin":return{type:l,icon:sC,text:c,isCustomized:a.source===ke};case"site":{const e=s("root","__unstableBase");return{type:l,icon:iC,imageUrl:e?.site_logo?i(e.site_logo)?.source_url:void 0,text:c,isCustomized:!1}}default:{const e=r(a.author);return{type:"user",icon:rC,imageUrl:e?.avatar_urls?.[48],text:c,isCustomized:!1}}}}),[e,t])}const{useGlobalStyle:aC}=te(x.privateApis);const lC={label:(0,b.__)("Preview"),id:"preview",render:function({item:e}){const t=(0,d.useId)(),n=e.description||e?.excerpt?.raw,s=e.type===Ce,[i]=aC("color.background"),r=(0,d.useMemo)((()=>{var t;return null!==(t=e.blocks)&&void 0!==t?t:(0,o.parse)(e.content.raw,{__unstableSkipMigrationLogs:!0})}),[e?.content?.raw,e.blocks]),a=!r?.length;return(0,oe.jsxs)("div",{className:"page-patterns-preview-field",style:{backgroundColor:i},"aria-describedby":n?t:void 0,children:[a&&s&&(0,b.__)("Empty template part"),a&&!s&&(0,b.__)("Empty pattern"),!a&&(0,oe.jsx)(x.BlockPreview.Async,{children:(0,oe.jsx)(x.BlockPreview,{blocks:r,viewportWidth:e.viewportWidth})}),!!n&&(0,oe.jsx)("div",{hidden:!0,id:t,children:n})]})},enableSorting:!1},cC=[{value:Ne.full,label:(0,b._x)("Synced","pattern (singular)"),description:(0,b.__)("Patterns that are kept in sync across the site.")},{value:Ne.unsynced,label:(0,b._x)("Not synced","pattern (singular)"),description:(0,b.__)("Patterns that can be changed freely without affecting the site.")}],uC={label:(0,b.__)("Sync status"),id:"sync-status",render:({item:e})=>{const t="wp_pattern_sync_status"in e?e.wp_pattern_sync_status||Ne.full:Ne.unsynced;return(0,oe.jsx)("span",{className:`edit-site-patterns__field-sync-status-${t}`,children:cC.find((({value:e})=>e===t)).label})},elements:cC,filterBy:{operators:["is"],isPrimary:!0},enableSorting:!1};const dC={label:(0,b.__)("Author"),id:"author",getValue:({item:e})=>e.author_text,render:function({item:e}){const[t,n]=(0,d.useState)(!1),{text:s,icon:i,imageUrl:r}=oC(e.type,e.id);return(0,oe.jsxs)(y.__experimentalHStack,{alignment:"left",spacing:0,children:[r&&(0,oe.jsx)("div",{className:Ut("page-templates-author-field__avatar",{"is-loaded":t}),children:(0,oe.jsx)("img",{onLoad:()=>n(!0),alt:"",src:r})}),!r&&(0,oe.jsx)("div",{className:"page-templates-author-field__icon",children:(0,oe.jsx)($o,{icon:i})}),(0,oe.jsx)("span",{className:"page-templates-author-field__name",children:s})]})},filterBy:{isPrimary:!0}},{ExperimentalBlockEditorProvider:hC}=te(x.privateApis),{usePostActions:pC,patternTitleField:fC}=te(h.privateApis),{useLocation:mC,useHistory:gC}=te(Gt.privateApis),vC=[],xC={[Re]:{layout:{styles:{author:{width:"1%"}}}},[Ve]:{layout:{badgeFields:["sync-status"]}}},yC={type:Ve,search:"",page:1,perPage:20,titleField:"title",mediaField:"preview",fields:["sync-status"],filters:[],...xC[Ve]};function bC(){const{query:{postType:e="wp_block",categoryId:t}}=mC(),n=gC(),s=t||Te,[i,r]=(0,d.useState)(yC),o=(0,v.usePrevious)(s),a=(0,v.usePrevious)(e),c=i.filters?.find((({field:e})=>"sync-status"===e))?.value,{patterns:u,isResolving:h}=Fx(e,s,{search:i.search,syncStatus:c}),{records:p}=(0,_.useEntityRecords)("postType",Ce,{per_page:-1}),f=(0,d.useMemo)((()=>{if(!p)return vC;const e=new Set;return p.forEach((t=>{e.add(t.author_text)})),Array.from(e).map((e=>({value:e,label:e})))}),[p]),m=(0,d.useMemo)((()=>{const t=[lC,fC];return e===Ie.user?t.push(uC):e===Ce&&t.push({...dC,elements:f}),t}),[e,f]);(0,d.useEffect)((()=>{o===s&&a===e||r((e=>({...e,page:1})))}),[s,o,a,e]);const{data:g,paginationInfo:x}=(0,d.useMemo)((()=>{const t={...i};return delete t.search,e!==Ce&&(t.filters=[]),fy(u,t,m)}),[u,i,m,e]),y=function(e){const t=(0,d.useMemo)((()=>{var t;return null!==(t=e?.filter((e=>e.type!==Ie.theme)).map((e=>[e.type,e.id])))&&void 0!==t?t:[]}),[e]),n=(0,l.useSelect)((e=>{const{getEntityRecordPermissions:n}=te(e(_.store));return t.reduce(((e,[t,s])=>(e[s]=n("postType",t,s),e)),{})}),[t]);return(0,d.useMemo)((()=>{var t;return null!==(t=e?.map((e=>{var t;return{...e,permissions:null!==(t=n?.[e.id])&&void 0!==t?t:{}}})))&&void 0!==t?t:[]}),[e,n])}(g),w=pC({postType:Ce,context:"list"}),j=pC({postType:Ie.user,context:"list"}),S=nC(),C=(0,d.useMemo)((()=>e===Ce?[S,...w].filter(Boolean):[S,...j].filter(Boolean)),[S,e,w,j]),k=(0,d.useId)(),E=DS();return(0,oe.jsx)(hC,{settings:E,children:(0,oe.jsxs)($m,{title:(0,b.__)("Patterns content"),className:"edit-site-page-patterns-dataviews",hideTitleFromUI:!0,children:[(0,oe.jsx)($S,{categoryId:s,type:e,titleId:`${k}-title`,descriptionId:`${k}-description`}),(0,oe.jsx)(BS,{paginationInfo:x,fields:m,actions:C,data:y||vC,getItemId:e=>{var t;return null!==(t=e.name)&&void 0!==t?t:e.id},isLoading:h,isItemClickable:e=>e.type!==Ie.theme,onClickItem:e=>{n.navigate(`/${e.type}/${[Ie.user,Ce].includes(e.type)?e.id:e.name}?canvas=edit`)},view:i,onChangeView:r,defaultLayouts:xC},s+e)]})})}const wC={name:"patterns",path:"/pattern",areas:{sidebar:(0,oe.jsx)(Lx,{backPath:"/"}),content:(0,oe.jsx)(bC,{}),mobile:(0,oe.jsx)(bC,{})}},_C={name:"pattern-item",path:"/wp_block/:postId",areas:{sidebar:(0,oe.jsx)(Lx,{backPath:"/"}),mobile:(0,oe.jsx)(Pv,{}),preview:(0,oe.jsx)(Pv,{})}},jC={name:"template-part-item",path:"/wp_template_part/*postId",areas:{sidebar:(0,oe.jsx)(Lx,{backPath:"/"}),mobile:(0,oe.jsx)(Iv,{}),preview:(0,oe.jsx)(Iv,{})}},{useLocation:SC}=te(Gt.privateApis),CC=[];function kC({template:e,isActive:t}){const{text:n,icon:s}=oC(e.type,e.id);return(0,oe.jsx)(ia,{to:(0,Qt.addQueryArgs)("/template",{activeView:n}),icon:s,"aria-current":t,children:n})}function EC(){const{query:{activeView:e="all"}}=SC(),{records:t}=(0,_.useEntityRecords)("postType",Se,{per_page:-1}),n=(0,d.useMemo)((()=>{var e;const n=t?.reduce(((e,t)=>{const n=t.author_text;return n&&!e[n]&&(e[n]=t),e}),{});return null!==(e=n&&Object.values(n))&&void 0!==e?e:CC}),[t]);return(0,oe.jsxs)(y.__experimentalItemGroup,{className:"edit-site-sidebar-navigation-screen-templates-browse",children:[(0,oe.jsx)(ia,{to:"/template",icon:Wo,"aria-current":"all"===e,children:(0,b.__)("All templates")}),n.map((t=>(0,oe.jsx)(kC,{template:t,isActive:e===t.author_text},t.author_text)))]})}function PC({backPath:e}){return(0,oe.jsx)(Qo,{title:(0,b.__)("Templates"),description:(0,b.__)("Create new templates, or reset any customizations made to the templates supplied by your theme."),backPath:e,content:(0,oe.jsx)(EC,{})})}const IC=(0,oe.jsx)(Yt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Yt.Path,{d:"M12 4L4 7.9V20h16V7.9L12 4zm6.5 14.5H14V13h-4v5.5H5.5V8.8L12 5.7l6.5 3.1v9.7z"})}),TC=(0,oe.jsx)(Yt.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,oe.jsx)(Yt.Path,{d:"M17.8 2l-.9.3c-.1 0-3.6 1-5.2 2.1C10 5.5 9.3 6.5 8.9 7.1c-.6.9-1.7 4.7-1.7 6.3l-.9 2.3c-.2.4 0 .8.4 1 .1 0 .2.1.3.1.3 0 .6-.2.7-.5l.6-1.5c.3 0 .7-.1 1.2-.2.7-.1 1.4-.3 2.2-.5.8-.2 1.6-.5 2.4-.8.7-.3 1.4-.7 1.9-1.2s.8-1.2 1-1.9c.2-.7.3-1.6.4-2.4.1-.8.1-1.7.2-2.5 0-.8.1-1.5.2-2.1V2zm-1.9 5.6c-.1.8-.2 1.5-.3 2.1-.2.6-.4 1-.6 1.3-.3.3-.8.6-1.4.9-.7.3-1.4.5-2.2.8-.6.2-1.3.3-1.8.4L15 7.5c.3-.3.6-.7 1-1.1 0 .4 0 .8-.1 1.2zM6 20h8v-1.5H6V20z"})}),OC=(0,oe.jsx)(Yt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Yt.Path,{d:"m21.5 9.1-6.6-6.6-4.2 5.6c-1.2-.1-2.4.1-3.6.7-.1 0-.1.1-.2.1-.5.3-.9.6-1.2.9l3.7 3.7-5.7 5.7v1.1h1.1l5.7-5.7 3.7 3.7c.4-.4.7-.8.9-1.2.1-.1.1-.2.2-.3.6-1.1.8-2.4.6-3.6l5.6-4.1zm-7.3 3.5.1.9c.1.9 0 1.8-.4 2.6l-6-6c.8-.4 1.7-.5 2.6-.4l.9.1L15 4.9 19.1 9l-4.9 3.6z"})}),AC=(0,oe.jsx)(Yt.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,oe.jsx)(Yt.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M11.934 7.406a1 1 0 0 0 .914.594H19a.5.5 0 0 1 .5.5v9a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .5-.5h5.764a.5.5 0 0 1 .447.276l.723 1.63Zm1.064-1.216a.5.5 0 0 0 .462.31H19a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h5.764a2 2 0 0 1 1.789 1.106l.445 1.084ZM8.5 10.5h7V12h-7v-1.5Zm7 3.5h-7v1.5h7V14Z"})}),NC=(0,oe.jsx)(Yt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Yt.Path,{d:"M19 5H5c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm.5 12c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V7c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v10zm-11-7.6h-.7l-3.1 4.3h2.8V15h1v-1.3h.7v-.8h-.7V9.4zm-.9 3.5H6.3l1.2-1.7v1.7zm5.6-3.2c-.4-.2-.8-.4-1.2-.4-.5 0-.9.1-1.2.4-.4.2-.6.6-.8 1-.2.4-.3.9-.3 1.5s.1 1.1.3 1.6c.2.4.5.8.8 1 .4.2.8.4 1.2.4.5 0 .9-.1 1.2-.4.4-.2.6-.6.8-1 .2-.4.3-1 .3-1.6 0-.6-.1-1.1-.3-1.5-.1-.5-.4-.8-.8-1zm0 3.6c-.1.3-.3.5-.5.7-.2.1-.4.2-.7.2-.3 0-.5-.1-.7-.2-.2-.1-.4-.4-.5-.7-.1-.3-.2-.7-.2-1.2 0-.7.1-1.2.4-1.5.3-.3.6-.5 1-.5s.7.2 1 .5c.3.3.4.8.4 1.5-.1.5-.1.9-.2 1.2zm5-3.9h-.7l-3.1 4.3h2.8V15h1v-1.3h.7v-.8h-.7V9.4zm-1 3.5H16l1.2-1.7v1.7z"})}),MC=(0,oe.jsx)(Yt.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,oe.jsx)(Yt.Path,{d:"M4 4v1.5h16V4H4zm8 8.5h8V11h-8v1.5zM4 20h16v-1.5H4V20zm4-8c0-1.1-.9-2-2-2s-2 .9-2 2 .9 2 2 2 2-.9 2-2z"})}),FC=(0,oe.jsx)(Yt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Yt.Path,{fillRule:"evenodd",d:"M8.95 11.25H4v1.5h4.95v4.5H13V18c0 1.1.9 2 2 2h3c1.1 0 2-.9 2-2v-3c0-1.1-.9-2-2-2h-3c-1.1 0-2 .9-2 2v.75h-2.55v-7.5H13V9c0 1.1.9 2 2 2h3c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2h-3c-1.1 0-2 .9-2 2v.75H8.95v4.5ZM14.5 15v3c0 .3.2.5.5.5h3c.3 0 .5-.2.5-.5v-3c0-.3-.2-.5-.5-.5h-3c-.3 0-.5.2-.5.5Zm0-6V6c0-.3.2-.5.5-.5h3c.3 0 .5.2.5.5v3c0 .3-.2.5-.5.5h-3c-.3 0-.5-.2-.5-.5Z",clipRule:"evenodd"})}),VC=(0,oe.jsx)(Yt.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,oe.jsx)(Yt.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 16c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V7h15v12zM9 10H7v2h2v-2zm0 4H7v2h2v-2zm4-4h-2v2h2v-2zm4 0h-2v2h2v-2zm-4 4h-2v2h2v-2zm4 0h-2v2h2v-2z"})}),RC=(0,oe.jsx)(Yt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Yt.Path,{d:"M4.75 4a.75.75 0 0 0-.75.75v7.826c0 .2.08.39.22.53l6.72 6.716a2.313 2.313 0 0 0 3.276-.001l5.61-5.611-.531-.53.532.528a2.315 2.315 0 0 0 0-3.264L13.104 4.22a.75.75 0 0 0-.53-.22H4.75ZM19 12.576a.815.815 0 0 1-.236.574l-5.61 5.611a.814.814 0 0 1-1.153 0L5.5 12.264V5.5h6.763l6.5 6.502a.816.816 0 0 1 .237.574ZM8.75 9.75a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"})}),BC=(0,oe.jsxs)(Yt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,oe.jsx)(Yt.Path,{d:"m7 6.5 4 2.5-4 2.5z"}),(0,oe.jsx)(Yt.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"m5 3c-1.10457 0-2 .89543-2 2v14c0 1.1046.89543 2 2 2h14c1.1046 0 2-.8954 2-2v-14c0-1.10457-.8954-2-2-2zm14 1.5h-14c-.27614 0-.5.22386-.5.5v10.7072l3.62953-2.6465c.25108-.1831.58905-.1924.84981-.0234l2.92666 1.8969 3.5712-3.4719c.2911-.2831.7545-.2831 1.0456 0l2.9772 2.8945v-9.3568c0-.27614-.2239-.5-.5-.5zm-14.5 14.5v-1.4364l4.09643-2.987 2.99567 1.9417c.2936.1903.6798.1523.9307-.0917l3.4772-3.3806 3.4772 3.3806.0228-.0234v2.5968c0 .2761-.2239.5-.5.5h-14c-.27614 0-.5-.2239-.5-.5z"})]}),DC=(0,oe.jsx)(Yt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Yt.Path,{d:"m7.3 9.7 1.4 1.4c.2-.2.3-.3.4-.5 0 0 0-.1.1-.1.3-.5.4-1.1.3-1.6L12 7 9 4 7.2 6.5c-.6-.1-1.1 0-1.6.3 0 0-.1 0-.1.1-.3.1-.4.2-.6.4l1.4 1.4L4 11v1h1l2.3-2.3zM4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4z"})}),LC={},zC=(e,t)=>{let n=e;return t.split(".").forEach((e=>{n=n?.[e]})),n},GC=()=>(0,l.useSelect)((e=>e(_.store).getEntityRecords("postType",Se,{per_page:-1})),[]),HC=()=>(0,l.useSelect)((e=>e(_.store).getEntityRecord("root","__unstableBase")?.default_template_types||[]),[]),UC=()=>{const e=(0,l.useSelect)((e=>e(_.store).getPostTypes({per_page:-1})),[]);return(0,d.useMemo)((()=>{const t=["attachment"];return e?.filter((({viewable:e,slug:n})=>e&&!t.includes(n)))}),[e])};function WC(){const e=UC(),t=(0,d.useMemo)((()=>e?.filter((e=>e.has_archive))),[e]),n=GC(),s=(0,d.useMemo)((()=>e?.reduce(((e,{labels:t})=>{const n=t.singular_name.toLowerCase();return e[n]=(e[n]||0)+1,e}),{})),[e]),i=(0,d.useCallback)((({labels:e,slug:t})=>{const n=e.singular_name.toLowerCase();return s[n]>1&&n!==t}),[s]);return(0,d.useMemo)((()=>t?.filter((e=>!(n||[]).some((t=>t.slug==="archive-"+e.slug)))).map((e=>{let t;return t=i(e)?(0,b.sprintf)((0,b.__)("Archive: %1$s (%2$s)"),e.labels.singular_name,e.slug):(0,b.sprintf)((0,b.__)("Archive: %s"),e.labels.singular_name),{slug:"archive-"+e.slug,description:(0,b.sprintf)((0,b.__)("Displays an archive with the latest posts of type: %s."),e.labels.singular_name),title:t,icon:"string"==typeof e.icon&&e.icon.startsWith("dashicons-")?e.icon.slice(10):AC,templatePrefix:"archive"}}))||[]),[t,n,i])}const qC=e=>{const t=(()=>{const e=(0,l.useSelect)((e=>e(_.store).getTaxonomies({per_page:-1})),[]);return(0,d.useMemo)((()=>e?.filter((({visibility:e})=>e?.publicly_queryable))),[e])})(),n=GC(),s=HC(),i=(0,d.useMemo)((()=>t?.reduce(((e,{slug:t})=>{let n=t;return["category","post_tag"].includes(t)||(n=`taxonomy-${n}`),"post_tag"===t&&(n="tag"),e[t]=n,e}),{})),[t]),r=t?.reduce(((e,{labels:t})=>{const n=(t.template_name||t.singular_name).toLowerCase();return e[n]=(e[n]||0)+1,e}),{}),o=XC("taxonomy",i),a=(n||[]).map((({slug:e})=>e)),c=(t||[]).reduce(((t,n)=>{const{slug:l,labels:c}=n,u=i[l],d=s?.find((({slug:e})=>e===u)),h=a?.includes(u),p=((e,t)=>{if(["category","post_tag"].includes(t))return!1;const n=(e.template_name||e.singular_name).toLowerCase();return r[n]>1&&n!==t})(c,l);let f=c.template_name||c.singular_name;p&&(f=c.template_name?(0,b.sprintf)((0,b._x)("%1$s (%2$s)","taxonomy template menu label"),c.template_name,l):(0,b.sprintf)((0,b._x)("%1$s (%2$s)","taxonomy menu label"),c.singular_name,l));const m=d?{...d,templatePrefix:i[l]}:{slug:u,title:f,description:(0,b.sprintf)((0,b.__)("Displays taxonomy: %s."),c.singular_name),icon:FC,templatePrefix:i[l]},g=o?.[l]?.hasEntities;return g&&(m.onClick=t=>{e({type:"taxonomy",slug:l,config:{queryArgs:({search:e})=>({_fields:"id,name,slug,link",orderBy:e?"name":"count",exclude:o[l].existingEntitiesIds}),getSpecificTemplate:e=>{const t=`${i[l]}-${e.slug}`;return{title:t,slug:t,templatePrefix:i[l]}}},labels:c,hasGeneralTemplate:h,template:t})}),h&&!g||t.push(m),t}),[]);return(0,d.useMemo)((()=>c.reduce(((e,t)=>{const{slug:n}=t;let s="taxonomiesMenuItems";return["category","tag"].includes(n)&&(s="defaultTaxonomiesMenuItems"),e[s].push(t),e}),{defaultTaxonomiesMenuItems:[],taxonomiesMenuItems:[]})),[c])},ZC={user:"author"},KC={user:{who:"authors"}};const YC=(e,t,n={})=>{const s=(e=>{const t=GC();return(0,d.useMemo)((()=>Object.entries(e||{}).reduce(((e,[n,s])=>{const i=(t||[]).reduce(((e,t)=>{const n=`${s}-`;return t.slug.startsWith(n)&&e.push(t.slug.substring(n.length)),e}),[]);return i.length&&(e[n]=i),e}),{})),[e,t])})(t);return(0,l.useSelect)((t=>Object.entries(s||{}).reduce(((s,[i,r])=>{const o=t(_.store).getEntityRecords(e,i,{_fields:"id",context:"view",slug:r,...n[i]});return o?.length&&(s[i]=o),s}),{})),[s])},XC=(e,t,n=LC)=>{const s=YC(e,t,n),i=(0,l.useSelect)((i=>Object.keys(t||{}).reduce(((t,r)=>{const o=s?.[r]?.map((({id:e})=>e))||[];return t[r]=!!i(_.store).getEntityRecords(e,r,{per_page:1,_fields:"id",context:"view",exclude:o,...n[r]})?.length,t}),{})),[t,s,e,n]);return(0,d.useMemo)((()=>Object.keys(t||{}).reduce(((e,t)=>{const n=s?.[t]?.map((({id:e})=>e))||[];return e[t]={hasEntities:i[t],existingEntitiesIds:n},e}),{})),[t,s,i])},JC=[];function QC({suggestion:e,search:t,onSelect:n,entityForSuggestions:s}){const i="edit-site-custom-template-modal__suggestions_list__list-item";return(0,oe.jsxs)(y.Composite.Item,{render:(0,oe.jsx)(y.Button,{__next40pxDefaultSize:!0,role:"option",className:i,onClick:()=>n(s.config.getSpecificTemplate(e))}),children:[(0,oe.jsx)(y.__experimentalText,{size:"body",lineHeight:1.53846153846,weight:500,className:`${i}__title`,children:(0,oe.jsx)(y.TextHighlight,{text:(0,Kt.decodeEntities)(e.name),highlight:t})}),e.link&&(0,oe.jsx)(y.__experimentalText,{size:"body",lineHeight:1.53846153846,className:`${i}__info`,children:e.link})]})}function $C(e,t){const{config:n}=e,s=(0,d.useMemo)((()=>({order:"asc",context:"view",search:t,per_page:t?20:10,...n.queryArgs(t)})),[t,n]),{records:i,hasResolved:r}=(0,_.useEntityRecords)(e.type,e.slug,s),[o,a]=(0,d.useState)(JC);return(0,d.useEffect)((()=>{if(!r)return;let e=JC;var t,s;i?.length&&(e=i,n.recordNamePath&&(t=e,s=n.recordNamePath,e=(t||[]).map((e=>({...e,name:(0,Kt.decodeEntities)(zC(e,s))}))))),a(e)}),[i,r]),o}function ek({entityForSuggestions:e,onSelect:t}){const[n,s,i]=(0,v.useDebouncedInput)(),r=$C(e,i),{labels:o}=e,[a,l]=(0,d.useState)(!1);return!a&&r?.length>9&&l(!0),(0,oe.jsxs)(oe.Fragment,{children:[a&&(0,oe.jsx)(y.SearchControl,{__nextHasNoMarginBottom:!0,onChange:s,value:n,label:o.search_items,placeholder:o.search_items}),!!r?.length&&(0,oe.jsx)(y.Composite,{orientation:"vertical",role:"listbox",className:"edit-site-custom-template-modal__suggestions_list","aria-label":(0,b.__)("Suggestions list"),children:r.map((n=>(0,oe.jsx)(QC,{suggestion:n,search:i,onSelect:t,entityForSuggestions:e},n.slug)))}),i&&!r?.length&&(0,oe.jsx)(y.__experimentalText,{as:"p",className:"edit-site-custom-template-modal__no-results",children:o.not_found})]})}const tk=function({onSelect:e,entityForSuggestions:t}){const[n,s]=(0,d.useState)(t.hasGeneralTemplate);return(0,oe.jsxs)(y.__experimentalVStack,{spacing:4,className:"edit-site-custom-template-modal__contents-wrapper",alignment:"left",children:[!n&&(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(y.__experimentalText,{as:"p",children:(0,b.__)("Select whether to create a single template for all items or a specific one.")}),(0,oe.jsxs)(y.Flex,{className:"edit-site-custom-template-modal__contents",gap:"4",align:"initial",children:[(0,oe.jsxs)(y.FlexItem,{isBlock:!0,as:y.Button,onClick:()=>{const{slug:n,title:s,description:i,templatePrefix:r}=t.template;e({slug:n,title:s,description:i,templatePrefix:r})},children:[(0,oe.jsx)(y.__experimentalText,{as:"span",weight:500,lineHeight:1.53846153846,children:t.labels.all_items}),(0,oe.jsx)(y.__experimentalText,{as:"span",lineHeight:1.53846153846,children:(0,b.__)("For all items")})]}),(0,oe.jsxs)(y.FlexItem,{isBlock:!0,as:y.Button,onClick:()=>{s(!0)},children:[(0,oe.jsx)(y.__experimentalText,{as:"span",weight:500,lineHeight:1.53846153846,children:t.labels.singular_name}),(0,oe.jsx)(y.__experimentalText,{as:"span",lineHeight:1.53846153846,children:(0,b.__)("For a specific item")})]})]})]}),n&&(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(y.__experimentalText,{as:"p",children:(0,b.__)("This template will be used only for the specific item chosen.")}),(0,oe.jsx)(ek,{entityForSuggestions:t,onSelect:e})]})]})};var nk=function(){return nk=Object.assign||function(e){for(var t,n=1,s=arguments.length;n{e()},children:(0,b.__)("Cancel")}),(0,oe.jsx)(y.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",isBusy:r,"aria-disabled":r,children:(0,b.__)("Create")})]})]})})},{useHistory:ck}=te(Gt.privateApis),uk=["front-page","home","single","page","index","archive","author","category","date","tag","search","404"],dk={"front-page":IC,home:TC,single:OC,page:Uo,archive:AC,search:Xt,404:NC,index:MC,category:xj,author:rC,taxonomy:FC,date:VC,tag:RC,attachment:BC};function hk({title:e,direction:t,className:n,description:s,icon:i,onClick:r,children:o}){return(0,oe.jsx)(y.Button,{__next40pxDefaultSize:!0,className:n,onClick:r,label:s,showTooltip:!!s,children:(0,oe.jsxs)(y.Flex,{as:"span",spacing:2,align:"center",justify:"center",style:{width:"100%"},direction:t,children:[(0,oe.jsx)("div",{className:"edit-site-add-new-template__template-icon",children:(0,oe.jsx)(y.Icon,{icon:i})}),(0,oe.jsxs)(y.__experimentalVStack,{className:"edit-site-add-new-template__template-name",alignment:"center",spacing:0,children:[(0,oe.jsx)(y.__experimentalText,{align:"center",weight:500,lineHeight:1.53846153846,children:e}),o]})]})})}const pk=1,fk=2,mk=3;function gk({onClose:e}){const[t,n]=(0,d.useState)(pk),[s,i]=(0,d.useState)({}),[r,o]=(0,d.useState)(!1),a=function(e,t){const n=GC(),s=HC(),i=(n||[]).map((({slug:e})=>e)),r=(s||[]).filter((e=>uk.includes(e.slug)&&!i.includes(e.slug))),o=n=>{t?.(),e(n)},a=[...r],{defaultTaxonomiesMenuItems:l,taxonomiesMenuItems:c}=qC(o),{defaultPostTypesMenuItems:u,postTypesMenuItems:h}=(e=>{const t=UC(),n=GC(),s=HC(),i=(0,d.useMemo)((()=>t?.reduce(((e,{labels:t})=>{const n=(t.template_name||t.singular_name).toLowerCase();return e[n]=(e[n]||0)+1,e}),{})),[t]),r=(0,d.useCallback)((({labels:e,slug:t})=>{const n=(e.template_name||e.singular_name).toLowerCase();return i[n]>1&&n!==t}),[i]),o=(0,d.useMemo)((()=>t?.reduce(((e,{slug:t})=>{let n=t;return"page"!==t&&(n=`single-${n}`),e[t]=n,e}),{})),[t]),a=XC("postType",o),l=(n||[]).map((({slug:e})=>e)),c=(t||[]).reduce(((t,n)=>{const{slug:i,labels:c,icon:u}=n,d=o[i],h=s?.find((({slug:e})=>e===d)),p=l?.includes(d),f=r(n);let m=c.template_name||(0,b.sprintf)((0,b.__)("Single item: %s"),c.singular_name);f&&(m=c.template_name?(0,b.sprintf)((0,b._x)("%1$s (%2$s)","post type menu label"),c.template_name,i):(0,b.sprintf)((0,b._x)("Single item: %1$s (%2$s)","post type menu label"),c.singular_name,i));const g=h?{...h,templatePrefix:o[i]}:{slug:d,title:m,description:(0,b.sprintf)((0,b.__)("Displays a single item: %s."),c.singular_name),icon:"string"==typeof u&&u.startsWith("dashicons-")?u.slice(10):DC,templatePrefix:o[i]},v=a?.[i]?.hasEntities;return v&&(g.onClick=t=>{e({type:"postType",slug:i,config:{recordNamePath:"title.rendered",queryArgs:({search:e})=>({_fields:"id,title,slug,link",orderBy:e?"relevance":"modified",exclude:a[i].existingEntitiesIds}),getSpecificTemplate:e=>{const t=`${o[i]}-${e.slug}`;return{title:t,slug:t,templatePrefix:o[i]}}},labels:c,hasGeneralTemplate:p,template:t})}),p&&!v||t.push(g),t}),[]),u=(0,d.useMemo)((()=>c.reduce(((e,t)=>{const{slug:n}=t;let s="postTypesMenuItems";return"page"===n&&(s="defaultPostTypesMenuItems"),e[s].push(t),e}),{defaultPostTypesMenuItems:[],postTypesMenuItems:[]})),[c]);return u})(o),p=function(e){const t=GC(),n=HC(),s=XC("root",ZC,KC);let i=n?.find((({slug:e})=>"author"===e));i||(i={description:(0,b.__)("Displays latest posts written by a single author."),slug:"author",title:"Author"});const r=!!t?.find((({slug:e})=>"author"===e));if(s.user?.hasEntities&&(i={...i,templatePrefix:"author"},i.onClick=t=>{e({type:"root",slug:"user",config:{queryArgs:({search:e})=>({_fields:"id,name,slug,link",orderBy:e?"name":"registered_date",exclude:s.user.existingEntitiesIds,who:"authors"}),getSpecificTemplate:e=>{const t=`author-${e.slug}`;return{title:t,slug:t,templatePrefix:"author"}}},labels:{singular_name:(0,b.__)("Author"),search_items:(0,b.__)("Search Authors"),not_found:(0,b.__)("No authors found."),all_items:(0,b.__)("All Authors")},hasGeneralTemplate:r,template:t})}),!r||s.user?.hasEntities)return i}(o);[...l,...u,p].forEach((e=>{if(!e)return;const t=a.findIndex((t=>t.slug===e.slug));t>-1?a[t]=e:a.push(e)})),a?.sort(((e,t)=>uk.indexOf(e.slug)-uk.indexOf(t.slug)));const f=[...a,...WC(),...h,...c];return f}(i,(()=>n(fk))),c=ck(),{saveEntityRecord:u}=(0,l.useDispatch)(_.store),{createErrorNotice:h,createSuccessNotice:p}=(0,l.useDispatch)(w.store),f=(0,v.useViewportMatch)("medium","<"),m=(0,l.useSelect)((e=>e(_.store).getEntityRecord("root","__unstableBase")?.home),[]),g={"front-page":m,date:(0,b.sprintf)((0,b.__)("E.g. %s"),m+"/"+(new Date).getFullYear())};async function x(e,t=!0){if(!r){o(!0);try{const{title:n,description:s,slug:i}=e,r=await u("postType",Se,{description:s,slug:i.toString(),status:"publish",title:n,is_wp_suggestion:t},{throwOnError:!0});c.navigate(`/${Se}/${r.id}?canvas=edit`),p((0,b.sprintf)((0,b.__)('"%s" successfully created.'),(0,Kt.decodeEntities)(r.title?.rendered||n)),{type:"snackbar"})}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,b.__)("An error occurred while creating the template.");h(t,{type:"snackbar"})}finally{o(!1)}}}const j=()=>{e(),n(pk)};let S=(0,b.__)("Add template");return t===fk?S=(0,b.sprintf)((0,b.__)("Add template: %s"),s.labels.singular_name):t===mk&&(S=(0,b.__)("Create custom template")),(0,oe.jsxs)(y.Modal,{title:S,className:Ut("edit-site-add-new-template__modal",{"edit-site-add-new-template__modal_template_list":t===pk,"edit-site-custom-template-modal":t===fk}),onRequestClose:j,overlayClassName:t===mk?"edit-site-custom-generic-template__modal":void 0,children:[t===pk&&(0,oe.jsxs)(y.__experimentalGrid,{columns:f?2:3,gap:4,align:"flex-start",justify:"center",className:"edit-site-add-new-template__template-list__contents",children:[(0,oe.jsx)(y.Flex,{className:"edit-site-add-new-template__template-list__prompt",children:(0,b.__)("Select what the new template should apply to:")}),a.map((e=>{const{title:t,slug:n,onClick:s}=e;return(0,oe.jsx)(hk,{title:t,direction:"column",className:"edit-site-add-new-template__template-button",description:g[n],icon:dk[n]||Wo,onClick:()=>s?s(e):x(e)},n)})),(0,oe.jsx)(hk,{title:(0,b.__)("Custom template"),direction:"row",className:"edit-site-add-new-template__custom-template-button",icon:eC,onClick:()=>n(mk),children:(0,oe.jsx)(y.__experimentalText,{lineHeight:1.53846153846,children:(0,b.__)("A custom template can be manually applied to any post or page.")})})]}),t===fk&&(0,oe.jsx)(tk,{onSelect:x,entityForSuggestions:s}),t===mk&&(0,oe.jsx)(lk,{onClose:j,createTemplate:x})]})}const vk=(0,d.memo)((function(){const[e,t]=(0,d.useState)(!1),{postType:n}=(0,l.useSelect)((e=>{const{getPostType:t}=e(_.store);return{postType:t(Se)}}),[]);return n?(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(y.Button,{variant:"primary",onClick:()=>t(!0),label:n.labels.add_new_item,__next40pxDefaultSize:!0,children:n.labels.add_new_item}),e&&(0,oe.jsx)(gk,{onClose:()=>t(!1)})]}):null})),{useGlobalStyle:xk}=te(x.privateApis);const yk={label:(0,b.__)("Preview"),id:"preview",render:function({item:e}){const t=DS(),[n="white"]=xk("color.background"),s=(0,d.useMemo)((()=>(0,o.parse)(e.content.raw)),[e.content.raw]),i=!s?.length;return(0,oe.jsx)(h.EditorProvider,{post:e,settings:t,children:(0,oe.jsxs)("div",{className:"page-templates-preview-field",style:{backgroundColor:n},children:[i&&(0,b.__)("Empty template"),!i&&(0,oe.jsx)(x.BlockPreview.Async,{children:(0,oe.jsx)(x.BlockPreview,{blocks:s})})]})})},enableSorting:!1},bk={label:(0,b.__)("Description"),id:"description",render:({item:e})=>e.description&&(0,oe.jsx)("span",{className:"page-templates-description",children:(0,Kt.decodeEntities)(e.description)}),enableSorting:!1,enableGlobalSearch:!0};const wk={label:(0,b.__)("Author"),id:"author",getValue:({item:e})=>e.author_text,render:function({item:e}){const[t,n]=(0,d.useState)(!1),{text:s,icon:i,imageUrl:r}=oC(e.type,e.id);return(0,oe.jsxs)(y.__experimentalHStack,{alignment:"left",spacing:0,children:[r&&(0,oe.jsx)("div",{className:Ut("page-templates-author-field__avatar",{"is-loaded":t}),children:(0,oe.jsx)("img",{onLoad:()=>n(!0),alt:"",src:r})}),!r&&(0,oe.jsx)("div",{className:"page-templates-author-field__icon",children:(0,oe.jsx)(y.Icon,{icon:i})}),(0,oe.jsx)("span",{className:"page-templates-author-field__name",children:s})]})}},{usePostActions:_k,templateTitleField:jk}=te(h.privateApis),{useHistory:Sk,useLocation:Ck}=te(Gt.privateApis),{useEntityRecordsWithPermissions:kk}=te(_.privateApis),Ek=[],Pk={[Re]:{showMedia:!1,layout:{styles:{author:{width:"1%"}}}},[Ve]:{showMedia:!0},[Be]:{showMedia:!1}},Ik={type:Ve,search:"",page:1,perPage:20,sort:{field:"title",direction:"asc"},titleField:"title",descriptionField:"description",mediaField:"preview",fields:["author"],filters:[],...Pk[Ve]};function Tk(){const{path:e,query:t}=Ck(),{activeView:n="all",layout:s,postId:i}=t,[r,o]=(0,d.useState)([i]),a=(0,d.useMemo)((()=>{const e=null!=s?s:Ik.type;return{...Ik,type:e,filters:"all"!==n?[{field:"author",operator:"isAny",value:[n]}]:[],...Pk[e]}}),[s,n]),[l,c]=(0,d.useState)(a);(0,d.useEffect)((()=>{c((e=>({...e,type:null!=s?s:Ik.type})))}),[c,s]),(0,d.useEffect)((()=>{c((e=>({...e,filters:"all"!==n?[{field:"author",operator:De,value:[n]}]:[]})))}),[c,n]);const{records:u,isResolving:h}=kk("postType",Se,{per_page:-1}),p=Sk(),f=(0,d.useCallback)((t=>{o(t),l?.type===Be&&p.navigate((0,Qt.addQueryArgs)(e,{postId:1===t.length?t[0]:void 0}))}),[p,e,l?.type]),m=(0,d.useMemo)((()=>{if(!u)return Ek;const e=new Set;return u.forEach((t=>{e.add(t.author_text)})),Array.from(e).map((e=>({value:e,label:e})))}),[u]),g=(0,d.useMemo)((()=>[yk,jk,bk,{...wk,elements:m}]),[m]),{data:x,paginationInfo:y}=(0,d.useMemo)((()=>fy(u,l,g)),[u,l,g]),w=_k({postType:Se,context:"list"}),_=nC(),j=(0,d.useMemo)((()=>[_,...w]),[w,_]),S=(0,v.useEvent)((t=>{c(t),t.type!==s&&p.navigate((0,Qt.addQueryArgs)(e,{layout:t.type}))}));return(0,oe.jsx)($m,{className:"edit-site-page-templates",title:(0,b.__)("Templates"),actions:(0,oe.jsx)(vk,{}),children:(0,oe.jsx)(BS,{paginationInfo:y,fields:g,actions:j,data:x,isLoading:h,view:l,onChangeView:S,onChangeSelection:f,isItemClickable:()=>!0,onClickItem:({id:e})=>{p.navigate(`/wp_template/${e}?canvas=edit`)},selection:r,defaultLayouts:Pk},n)})}const Ok={name:"templates",path:"/template",areas:{sidebar:(0,oe.jsx)(PC,{backPath:"/"}),content:(0,oe.jsx)(Tk,{}),preview:({query:e})=>"list"===e.layout?(0,oe.jsx)(Pv,{}):void 0,mobile:(0,oe.jsx)(Tk,{})},widths:{content:({query:e})=>"list"===e.layout?380:void 0}},Ak={name:"template-item",path:"/wp_template/*postId",areas:{sidebar:(0,oe.jsx)(PC,{backPath:"/"}),mobile:(0,oe.jsx)(Iv,{}),preview:(0,oe.jsx)(Iv,{})}},Nk=(0,oe.jsxs)(Yt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,oe.jsx)(Yt.Path,{d:"M14.5 5.5h-7V7h7V5.5ZM7.5 9h7v1.5h-7V9Zm7 3.5h-7V14h7v-1.5Z"}),(0,oe.jsx)(Yt.Path,{d:"M16 2H6a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2ZM6 3.5h10a.5.5 0 0 1 .5.5v12a.5.5 0 0 1-.5.5H6a.5.5 0 0 1-.5-.5V4a.5.5 0 0 1 .5-.5Z"}),(0,oe.jsx)(Yt.Path,{d:"M20 8v11c0 .69-.31 1-.999 1H6v1.5h13.001c1.52 0 2.499-.982 2.499-2.5V8H20Z"})]}),Mk=(0,oe.jsx)(Yt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Yt.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm11.53-1.47-1.06-1.06L11 12.94l-1.47-1.47-1.06 1.06L11 15.06l4.53-4.53Z"})}),Fk=(0,oe.jsx)(Yt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Yt.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm9 1V8h-1.5v3.5h-2V13H13Z"})}),Vk=(0,oe.jsx)(Yt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Yt.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm8 4a4 4 0 0 0 4-4H8a4 4 0 0 0 4 4Z"})}),Rk=(0,oe.jsx)(Yt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Yt.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm8 4a4 4 0 0 1-4-4h4V8a4 4 0 0 1 0 8Z"})}),Bk=(0,oe.jsx)(Yt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Yt.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 18.5A6.5 6.5 0 0 1 6.93 7.931l9.139 9.138A6.473 6.473 0 0 1 12 18.5Zm5.123-2.498a6.5 6.5 0 0 0-9.124-9.124l9.124 9.124ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Z"})}),Dk=(0,oe.jsx)(Yt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Yt.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 5.5A2.25 2.25 0 0 0 9.878 7h4.244A2.251 2.251 0 0 0 12 5.5ZM12 4a3.751 3.751 0 0 0-3.675 3H5v1.5h1.27l.818 8.997a2.75 2.75 0 0 0 2.739 2.501h4.347a2.75 2.75 0 0 0 2.738-2.5L17.73 8.5H19V7h-3.325A3.751 3.751 0 0 0 12 4Zm4.224 4.5H7.776l.806 8.861a1.25 1.25 0 0 0 1.245 1.137h4.347a1.25 1.25 0 0 0 1.245-1.137l.805-8.861Z"})}),Lk={[Re]:{},[Ve]:{},[Be]:{}},zk={type:Be,search:"",filters:[],page:1,perPage:20,sort:{field:"title",direction:"asc"},showLevels:!0,titleField:"title",mediaField:"featured_media",fields:["author","status"],...Lk[Be]};function Gk({postType:e}){const t=(0,l.useSelect)((t=>{const{getPostType:n}=t(_.store);return n(e)?.labels}),[e]);return(0,d.useMemo)((()=>[{title:t?.all_items||(0,b.__)("All items"),slug:"all",icon:Nk,view:zk},{title:(0,b.__)("Published"),slug:"published",icon:Mk,view:zk,filters:[{field:"status",operator:De,value:"publish"}]},{title:(0,b.__)("Scheduled"),slug:"future",icon:Fk,view:zk,filters:[{field:"status",operator:De,value:"future"}]},{title:(0,b.__)("Drafts"),slug:"drafts",icon:Vk,view:zk,filters:[{field:"status",operator:De,value:"draft"}]},{title:(0,b.__)("Pending"),slug:"pending",icon:Rk,view:zk,filters:[{field:"status",operator:De,value:"pending"}]},{title:(0,b.__)("Private"),slug:"private",icon:Bk,view:zk,filters:[{field:"status",operator:De,value:"private"}]},{title:(0,b.__)("Trash"),slug:"trash",icon:Dk,view:{...zk,type:Re,layout:Lk[Re].layout},filters:[{field:"status",operator:De,value:"trash"}]}]),[t])}const{useLocation:Hk}=te(Gt.privateApis);function Uk({title:e,slug:t,customViewId:n,type:s,icon:i,isActive:r,isCustom:o,suffix:a}){const{path:l}=Hk(),c=i||uS.find((e=>e.type===s)).icon;let u=o?n:t;"all"===u&&(u=void 0);const d={layout:s,activeView:u,isCustom:o?"true":void 0};return(0,oe.jsxs)(y.__experimentalHStack,{justify:"flex-start",className:Ut("edit-site-sidebar-dataviews-dataview-item",{"is-selected":r}),children:[(0,oe.jsx)(ia,{icon:c,to:(0,Qt.addQueryArgs)(l,d),"aria-current":r?"true":void 0,children:e}),a]})}const{useLocation:Wk,useHistory:qk}=te(Gt.privateApis);function Zk({type:e,setIsAdding:t}){const n=qk(),{path:s}=Wk(),{saveEntityRecord:i}=(0,l.useDispatch)(_.store),[r,o]=(0,d.useState)(""),[a,c]=(0,d.useState)(!1),u=Gk({postType:e});return(0,oe.jsx)("form",{onSubmit:async o=>{o.preventDefault(),c(!0);const{getEntityRecords:a}=(0,l.resolveSelect)(_.store);let d;const h=await a("taxonomy","wp_dataviews_type",{slug:e});if(h&&h.length>0)d=h[0].id;else{const t=await i("taxonomy","wp_dataviews_type",{name:e});t&&t.id&&(d=t.id)}const p=await i("postType","wp_dataviews",{title:r,status:"publish",wp_dataviews_type:d,content:JSON.stringify(u[0].view)});n.navigate((0,Qt.addQueryArgs)(s,{activeView:p.id,isCustom:"true"})),c(!1),t(!1)},children:(0,oe.jsxs)(y.__experimentalVStack,{spacing:"5",children:[(0,oe.jsx)(y.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,b.__)("Name"),value:r,onChange:o,placeholder:(0,b.__)("My view"),className:"patterns-create-modal__name-input"}),(0,oe.jsxs)(y.__experimentalHStack,{justify:"right",children:[(0,oe.jsx)(y.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>{t(!1)},children:(0,b.__)("Cancel")}),(0,oe.jsx)(y.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit","aria-disabled":!r||a,isBusy:a,children:(0,b.__)("Create")})]})]})})}function Kk({type:e}){const[t,n]=(0,d.useState)(!1);return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(ia,{icon:_f,onClick:()=>{n(!0)},className:"dataviews__siderbar-content-add-new-item",children:(0,b.__)("New view")}),t&&(0,oe.jsx)(y.Modal,{title:(0,b.__)("Add new view"),onRequestClose:()=>{n(!1)},children:(0,oe.jsx)(Zk,{type:e,setIsAdding:n})})]})}const{useHistory:Yk,useLocation:Xk}=te(Gt.privateApis),Jk=[];function Qk({dataviewId:e,currentTitle:t,setIsRenaming:n}){const{editEntityRecord:s}=(0,l.useDispatch)(_.store),[i,r]=(0,d.useState)(t);return(0,oe.jsx)("form",{onSubmit:async t=>{t.preventDefault(),await s("postType","wp_dataviews",e,{title:i}),n(!1)},children:(0,oe.jsxs)(y.__experimentalVStack,{spacing:"5",children:[(0,oe.jsx)(y.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,b.__)("Name"),value:i,onChange:r,placeholder:(0,b.__)("My view"),className:"patterns-create-modal__name-input"}),(0,oe.jsxs)(y.__experimentalHStack,{justify:"right",children:[(0,oe.jsx)(y.Button,{variant:"tertiary",__next40pxDefaultSize:!0,onClick:()=>{n(!1)},children:(0,b.__)("Cancel")}),(0,oe.jsx)(y.Button,{variant:"primary",type:"submit","aria-disabled":!i,__next40pxDefaultSize:!0,children:(0,b.__)("Save")})]})]})})}function $k({dataviewId:e,isActive:t}){const n=Yk(),s=Xk(),{dataview:i}=(0,l.useSelect)((t=>{const{getEditedEntityRecord:n}=t(_.store);return{dataview:n("postType","wp_dataviews",e)}}),[e]),{deleteEntityRecord:r}=(0,l.useDispatch)(_.store),o=(0,d.useMemo)((()=>JSON.parse(i.content).type),[i.content]),[a,c]=(0,d.useState)(!1);return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(Uk,{title:i.title,type:o,isActive:t,isCustom:!0,customViewId:e,suffix:(0,oe.jsx)(y.DropdownMenu,{icon:Da,label:(0,b.__)("Actions"),className:"edit-site-sidebar-dataviews-dataview-item__dropdown-menu",toggleProps:{style:{color:"inherit"},size:"small"},children:({onClose:e})=>(0,oe.jsxs)(y.MenuGroup,{children:[(0,oe.jsx)(y.MenuItem,{onClick:()=>{c(!0),e()},children:(0,b.__)("Rename")}),(0,oe.jsx)(y.MenuItem,{onClick:async()=>{await r("postType","wp_dataviews",i.id,{force:!0}),t&&n.replace({postType:s.query.postType}),e()},isDestructive:!0,children:(0,b.__)("Delete")})]})})}),a&&(0,oe.jsx)(y.Modal,{title:(0,b.__)("Rename"),onRequestClose:()=>{c(!1)},focusOnMount:"firstContentElement",size:"small",children:(0,oe.jsx)(Qk,{dataviewId:e,setIsRenaming:c,currentTitle:i.title})})]})}function eE({type:e,activeView:t,isCustom:n}){const s=function(e){return(0,l.useSelect)((t=>{const{getEntityRecords:n}=t(_.store),s=n("taxonomy","wp_dataviews_type",{slug:e});if(!s||0===s.length)return Jk;return n("postType","wp_dataviews",{wp_dataviews_type:s[0].id,orderby:"date",order:"asc"})||Jk}))}(e);return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)("div",{className:"edit-site-sidebar-navigation-screen-dataviews__group-header",children:(0,oe.jsx)(y.__experimentalHeading,{level:2,children:(0,b.__)("Custom Views")})}),(0,oe.jsxs)(y.__experimentalItemGroup,{className:"edit-site-sidebar-navigation-screen-dataviews__custom-items",children:[s.map((e=>(0,oe.jsx)($k,{dataviewId:e.id,isActive:n&&Number(t)===e.id},e.id))),(0,oe.jsx)(Kk,{type:e})]})]})}const{useLocation:tE}=te(Gt.privateApis);function nE({postType:e}){const{query:{activeView:t="all",isCustom:n="false"}}=tE(),s=Gk({postType:e});if(!e)return null;const i="true"===n;return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(y.__experimentalItemGroup,{className:"edit-site-sidebar-dataviews",children:s.map((e=>(0,oe.jsx)(Uk,{slug:e.slug,title:e.title,icon:e.icon,type:e.view.type,isActive:!i&&e.slug===t,isCustom:!1},e.slug)))}),window?.__experimentalCustomViews&&(0,oe.jsx)(eE,{activeView:t,type:e,isCustom:!0})]})}const sE=(0,oe.jsx)(Yt.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(Yt.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4 14.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h8v13zm4.5-.5c0 .3-.2.5-.5.5h-2.5v-13H18c.3 0 .5.2.5.5v12z"})});function iE({postType:e,onSave:t,onClose:n}){const s=(0,l.useSelect)((t=>t(_.store).getPostType(e)?.labels),[e]),[i,r]=(0,d.useState)(!1),[a,c]=(0,d.useState)(""),{saveEntityRecord:u}=(0,l.useDispatch)(_.store),{createErrorNotice:h,createSuccessNotice:p}=(0,l.useDispatch)(w.store),{resolveSelect:f}=(0,l.useRegistry)();return(0,oe.jsx)(y.Modal,{title:(0,b.sprintf)((0,b.__)("Draft new: %s"),s?.singular_name),onRequestClose:n,focusOnMount:"firstContentElement",size:"small",children:(0,oe.jsx)("form",{onSubmit:async function(n){if(n.preventDefault(),!i){r(!0);try{const n=await f(_.store).getPostType(e),s=await u("postType",e,{status:"draft",title:a,slug:null!=a?a:void 0,content:n.template&&n.template.length?(0,o.serialize)((0,o.synchronizeBlocksWithTemplate)([],n.template)):void 0},{throwOnError:!0});t(s),p((0,b.sprintf)((0,b.__)('"%s" successfully created.'),(0,Kt.decodeEntities)(s.title?.rendered||a)),{type:"snackbar"})}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,b.__)("An error occurred while creating the item.");h(t,{type:"snackbar"})}finally{r(!1)}}},children:(0,oe.jsxs)(y.__experimentalVStack,{spacing:4,children:[(0,oe.jsx)(y.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,b.__)("Title"),onChange:c,placeholder:(0,b.__)("No title"),value:a}),(0,oe.jsxs)(y.__experimentalHStack,{spacing:2,justify:"end",children:[(0,oe.jsx)(y.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:n,children:(0,b.__)("Cancel")}),(0,oe.jsx)(y.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",isBusy:i,"aria-disabled":i,children:(0,b.__)("Create draft")})]})]})})})}const{usePostActions:rE,usePostFields:oE}=te(h.privateApis),{useLocation:aE,useHistory:lE}=te(Gt.privateApis),{useEntityRecordsWithPermissions:cE}=te(_.privateApis),uE=[],dE=(e,t)=>e.find((({slug:e})=>e===t))?.view,hE=e=>{if(!e?.content)return;const t=JSON.parse(e.content);return t?{...t,...Lk[t.type]}:void 0};function pE(e){return e.id.toString()}function fE(e){return e.level}function mE({postType:e}){var t,n,s;const[i,r]=function(e){const{path:t,query:{activeView:n="all",isCustom:s="false",layout:i}}=aE(),r=lE(),o=Gk({postType:e}),{editEntityRecord:a}=(0,l.useDispatch)(_.store),c=(0,l.useSelect)((e=>{if("true"!==s)return;const{getEditedEntityRecord:t}=e(_.store);return t("postType","wp_dataviews",Number(n))}),[n,s]),[u,h]=(0,d.useState)((()=>{let e;var t,r;e="true"===s?null!==(t=hE(c))&&void 0!==t?t:{type:null!=i?i:Be}:null!==(r=dE(o,n))&&void 0!==r?r:{type:null!=i?i:Be};const a=null!=i?i:e.type;return{...e,type:a,...Lk[a]}})),p=(0,v.useEvent)((e=>{h(e),"true"===s&&c?.id&&a("postType","wp_dataviews",c?.id,{content:JSON.stringify(e)});const n=null!=i?i:Be;e.type!==n&&r.navigate((0,Qt.addQueryArgs)(t,{layout:e.type}))})),f=(0,v.useEvent)((()=>{h((e=>{const t=null!=i?i:Be;return t===e.type?e:{...e,type:t,...Lk[t]}}))}));(0,d.useEffect)((()=>{f()}),[f,i]);const m=(0,v.useEvent)((()=>{let e;if(e="true"===s?hE(c):dE(o,n),e){const t=null!=i?i:e.type;h({...e,type:t,...Lk[t]})}}));return(0,d.useEffect)((()=>{m()}),[m,n,s,o,c]),[u,p]}(e),o=Gk({postType:e}),a=lE(),c=aE(),{postId:u,quickEdit:h=!1,isCustom:p,activeView:f="all"}=c.query,[m,g]=(0,d.useState)(null!==(t=u?.split(","))&&void 0!==t?t:[]),x=(0,d.useCallback)((e=>{var t;g(e),"false"===(null!==(t=c.query.isCustom)&&void 0!==t?t:"false")&&a.navigate((0,Qt.addQueryArgs)(c.path,{postId:e.join(",")}))}),[c.path,c.query.isCustom,a]),w=(e,t)=>{var n;const s=e.find((({slug:e})=>e===t));return null!==(n=s?.filters)&&void 0!==n?n:[]},{isLoading:j,fields:S}=oE({postType:e}),C=(0,d.useMemo)((()=>{const e=w(o,f).map((({field:e})=>e));return S.map((t=>({...t,elements:e.includes(t.id)?[]:t.elements})))}),[S,o,f]),k=(0,d.useMemo)((()=>{const e={};i.filters?.forEach((t=>{"status"===t.field&&t.operator===De&&(e.status=t.value),"author"===t.field&&t.operator===De?e.author=t.value:"author"===t.field&&t.operator===Le&&(e.author_exclude=t.value)}));return w(o,f).forEach((t=>{"status"===t.field&&t.operator===De&&(e.status=t.value),"author"===t.field&&t.operator===De?e.author=t.value:"author"===t.field&&t.operator===Le&&(e.author_exclude=t.value)})),e.status&&""!==e.status||(e.status="draft,future,pending,private,publish"),{per_page:i.perPage,page:i.page,_embed:"author",order:i.sort?.direction,orderby:i.sort?.field,orderby_hierarchy:!!i.showLevels,search:i.search,...e}}),[i,f,o]),{records:E,isResolving:P,totalItems:I,totalPages:T}=cE("postType",e,k),O=(0,d.useMemo)((()=>j||"author"!==i?.sort?.field?E:fy(E,{sort:{...i.sort}},C).data),[E,C,j,i?.sort]),A=null!==(n=O?.map((e=>pE(e))))&&void 0!==n?n:[],N=(null!==(s=(0,v.usePrevious)(A))&&void 0!==s?s:[]).filter((e=>!A.includes(e))).includes(u);(0,d.useEffect)((()=>{N&&a.navigate((0,Qt.addQueryArgs)(c.path,{postId:void 0}))}),[a,N,c.path]);const M=(0,d.useMemo)((()=>({totalItems:I,totalPages:T})),[I,T]),{labels:F,canCreateRecord:V}=(0,l.useSelect)((t=>{const{getPostType:n,canUser:s}=t(_.store);return{labels:n(e)?.labels,canCreateRecord:s("create",{kind:"postType",name:e})}}),[e]),R=rE({postType:e,context:"list"}),B=nC(),D=(0,d.useMemo)((()=>[B,...R]),[R,B]),[L,z]=(0,d.useState)(!1),G=()=>z(!1);return(0,oe.jsx)($m,{title:F?.name,actions:F?.add_new_item&&V&&(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(y.Button,{variant:"primary",onClick:()=>z(!0),__next40pxDefaultSize:!0,children:F.add_new_item}),L&&(0,oe.jsx)(iE,{postType:e,onSave:({type:e,id:t})=>{a.navigate(`/${e}/${t}?canvas=edit`),G()},onClose:G})]}),children:(0,oe.jsx)(BS,{paginationInfo:M,fields:C,actions:D,data:O||uE,isLoading:P||j,view:i,onChangeView:r,selection:m,onChangeSelection:x,isItemClickable:e=>"trash"!==e.status,onClickItem:({id:t})=>{a.navigate(`/${e}/${t}?canvas=edit`)},getItemId:pE,getItemLevel:fE,defaultLayouts:Lk,header:window.__experimentalQuickEditDataViews&&i.type!==Be&&"page"===e&&(0,oe.jsx)(y.Button,{size:"compact",isPressed:h,icon:sE,label:(0,b.__)("Details"),onClick:()=>{a.navigate((0,Qt.addQueryArgs)(c.path,{quickEdit:!h||void 0}))}})},f+p)})}const gE=(0,d.createContext)({fields:[]});function vE({fields:e,children:t}){return(0,oe.jsx)(gE.Provider,{value:{fields:e},children:t})}const xE=gE;function yE(e){return void 0!==e.children}function bE({title:e}){return(0,oe.jsx)(y.__experimentalVStack,{className:"dataforms-layouts-regular__header",spacing:4,children:(0,oe.jsxs)(y.__experimentalHStack,{alignment:"center",children:[(0,oe.jsx)(y.__experimentalHeading,{level:2,size:13,children:e}),(0,oe.jsx)(y.__experimentalSpacer,{})]})})}function wE({title:e,onClose:t}){return(0,oe.jsx)(y.__experimentalVStack,{className:"dataforms-layouts-panel__dropdown-header",spacing:4,children:(0,oe.jsxs)(y.__experimentalHStack,{alignment:"center",children:[e&&(0,oe.jsx)(y.__experimentalHeading,{level:2,size:13,children:e}),(0,oe.jsx)(y.__experimentalSpacer,{}),t&&(0,oe.jsx)(y.Button,{label:(0,b.__)("Close"),icon:Fo,onClick:t,size:"small"})]})})}function _E({fieldDefinition:e,popoverAnchor:t,labelPosition:n="side",data:s,onChange:i,field:r}){const o=yE(r)?r.label:e?.label,a=(0,d.useMemo)((()=>yE(r)?{type:"regular",fields:r.children.map((e=>"string"==typeof e?{id:e}:e))}:{type:"regular",fields:[{id:r.id}]}),[r]),l=(0,d.useMemo)((()=>({anchor:t,placement:"left-start",offset:36,shift:!0})),[t]);return(0,oe.jsx)(y.Dropdown,{contentClassName:"dataforms-layouts-panel__field-dropdown",popoverProps:l,focusOnMount:!0,toggleProps:{size:"compact",variant:"tertiary",tooltipPosition:"middle left"},renderToggle:({isOpen:t,onToggle:i})=>(0,oe.jsx)(y.Button,{className:"dataforms-layouts-panel__field-control",size:"compact",variant:["none","top"].includes(n)?"link":"tertiary","aria-expanded":t,"aria-label":(0,b.sprintf)((0,b._x)("Edit %s","field"),o),onClick:i,children:(0,oe.jsx)(e.render,{item:s})}),renderContent:({onClose:e})=>(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(wE,{title:o,onClose:e}),(0,oe.jsx)(SE,{data:s,form:a,onChange:i,children:(e,t)=>{var n;return(0,oe.jsx)(e,{data:s,field:t,onChange:i,hideLabelFromVision:(null!==(n=a?.fields)&&void 0!==n?n:[]).length<2},t.id)}})]})})}const jE=[{type:"regular",component:function({data:e,field:t,onChange:n,hideLabelFromVision:s}){var i;const{fields:r}=(0,d.useContext)(xE),o=(0,d.useMemo)((()=>yE(t)?{fields:t.children.map((e=>"string"==typeof e?{id:e}:e)),type:"regular"}:{type:"regular",fields:[]}),[t]);if(yE(t))return(0,oe.jsxs)(oe.Fragment,{children:[!s&&t.label&&(0,oe.jsx)(bE,{title:t.label}),(0,oe.jsx)(SE,{data:e,form:o,onChange:n})]});const a=null!==(i=t.labelPosition)&&void 0!==i?i:"top",l=r.find((e=>e.id===t.id));return l?"side"===a?(0,oe.jsxs)(y.__experimentalHStack,{className:"dataforms-layouts-regular__field",children:[(0,oe.jsx)("div",{className:"dataforms-layouts-regular__field-label",children:l.label}),(0,oe.jsx)("div",{className:"dataforms-layouts-regular__field-control",children:(0,oe.jsx)(l.Edit,{data:e,field:l,onChange:n,hideLabelFromVision:!0},l.id)})]}):(0,oe.jsx)("div",{className:"dataforms-layouts-regular__field",children:(0,oe.jsx)(l.Edit,{data:e,field:l,onChange:n,hideLabelFromVision:"none"===a||s})}):null}},{type:"panel",component:function({data:e,field:t,onChange:n}){var s;const{fields:i}=(0,d.useContext)(xE),r=i.find((e=>{if(yE(t)){const n=t.children.filter((e=>"string"==typeof e||!yE(e))),s="string"==typeof n[0]?n[0]:n[0].id;return e.id===s}return e.id===t.id})),o=null!==(s=t.labelPosition)&&void 0!==s?s:"side",[a,l]=(0,d.useState)(null);if(!r)return null;const c=yE(t)?t.label:r?.label;return"top"===o?(0,oe.jsxs)(y.__experimentalVStack,{className:"dataforms-layouts-panel__field",spacing:0,children:[(0,oe.jsx)("div",{className:"dataforms-layouts-panel__field-label",style:{paddingBottom:0},children:c}),(0,oe.jsx)("div",{className:"dataforms-layouts-panel__field-control",children:(0,oe.jsx)(_E,{field:t,popoverAnchor:a,fieldDefinition:r,data:e,onChange:n,labelPosition:o})})]}):"none"===o?(0,oe.jsx)("div",{className:"dataforms-layouts-panel__field",children:(0,oe.jsx)(_E,{field:t,popoverAnchor:a,fieldDefinition:r,data:e,onChange:n,labelPosition:o})}):(0,oe.jsxs)(y.__experimentalHStack,{ref:l,className:"dataforms-layouts-panel__field",children:[(0,oe.jsx)("div",{className:"dataforms-layouts-panel__field-label",children:c}),(0,oe.jsx)("div",{className:"dataforms-layouts-panel__field-control",children:(0,oe.jsx)(_E,{field:t,popoverAnchor:a,fieldDefinition:r,data:e,onChange:n,labelPosition:o})})]})}}];function SE({data:e,form:t,onChange:n,children:s}){const{fields:i}=(0,d.useContext)(xE);const r=(0,d.useMemo)((()=>function(e){var t,n,s;let i="regular";["regular","panel"].includes(null!==(t=e.type)&&void 0!==t?t:"")&&(i=e.type);const r=null!==(n=e.labelPosition)&&void 0!==n?n:"regular"===i?"top":"side";return(null!==(s=e.fields)&&void 0!==s?s:[]).map((e=>{var t,n;if("string"==typeof e)return{id:e,layout:i,labelPosition:r};const s=null!==(t=e.layout)&&void 0!==t?t:i,o=null!==(n=e.labelPosition)&&void 0!==n?n:"regular"===s?"top":"side";return{...e,layout:s,labelPosition:o}}))}(t)),[t]);return(0,oe.jsx)(y.__experimentalVStack,{spacing:2,children:r.map((t=>{const r=(o=t.layout,jE.find((e=>e.type===o)))?.component;var o;if(!r)return null;const a=yE(t)?void 0:function(e){const t="string"==typeof e?e:e.id;return i.find((e=>e.id===t))}(t);return a&&a.isVisible&&!a.isVisible(e)?null:s?s(r,t):(0,oe.jsx)(r,{data:e,field:t,onChange:n},t.id)}))})}function CE({data:e,form:t,fields:n,onChange:s}){const i=(0,d.useMemo)((()=>dy(n)),[n]);return t.fields?(0,oe.jsx)(vE,{fields:i,children:(0,oe.jsx)(SE,{data:e,form:t,onChange:s})}):null}const{usePostFields:kE,PostCardPanel:EE}=te(h.privateApis),PE=["title","status","date","author","comment_status"];function IE({postType:e,postId:t}){const n=(0,d.useMemo)((()=>t.split(",")),[t]),{record:s,hasFinishedResolution:i}=(0,l.useSelect)((t=>{const s=["postType",e,n[0]],{getEditedEntityRecord:i,hasFinishedResolution:r}=t(_.store);return{record:1===n.length?i(...s):null,hasFinishedResolution:r("getEditedEntityRecord",s)}}),[e,n]),[r,o]=(0,d.useState)({}),{editEntityRecord:a}=(0,l.useDispatch)(_.store),{fields:c}=kE({postType:e}),u=(0,d.useMemo)((()=>c?.map((e=>"status"===e.id?{...e,elements:e.elements.filter((e=>"trash"!==e.value))}:e))),[c]),h=(0,d.useMemo)((()=>({type:"panel",fields:[{id:"featured_media",layout:"regular"},{id:"status",label:(0,b.__)("Status & Visibility"),children:["status","password"]},"author","date","slug","parent","comment_status",{label:(0,b.__)("Template"),labelPosition:"side",id:"template",layout:"regular"}].filter((e=>1===n.length||PE.includes(e)))})),[n]);(0,d.useEffect)((()=>{o({})}),[n]);const{ExperimentalBlockEditorProvider:p}=te(x.privateApis),f=DS(),m=(0,d.useMemo)((()=>u.map((e=>"template"===e.id?{...e,Edit:t=>(0,oe.jsx)(p,{settings:f,children:(0,oe.jsx)(e.Edit,{...t})})}:e))),[u,f]);return(0,oe.jsxs)(y.__experimentalVStack,{spacing:4,children:[(0,oe.jsx)(EE,{postType:e,postId:n}),i&&(0,oe.jsx)(CE,{data:1===n.length?s:r,fields:m,form:h,onChange:t=>{for(const i of n)t.status&&"future"!==t.status&&"future"===s?.status&&new Date(s.date)>new Date&&(t.date=null),t.status&&"private"===t.status&&s.password&&(t.password=""),a("postType",e,i,t),n.length>1&&o((e=>({...e,...t})))}})]})}function TE({postType:e,postId:t}){return(0,oe.jsxs)($m,{className:Ut("edit-site-post-edit",{"is-empty":!t}),label:(0,b.__)("Post Edit"),children:[t&&(0,oe.jsx)(IE,{postType:e,postId:t}),!t&&(0,oe.jsx)("p",{children:(0,b.__)("Select a page to edit")})]})}const{useLocation:OE}=te(Gt.privateApis);function AE(){const{query:e={}}=OE(),{canvas:t="view"}=e;return"edit"===t?(0,oe.jsx)(Pv,{}):(0,oe.jsx)(mE,{postType:"page"})}const NE={name:"pages",path:"/page",areas:{sidebar:(0,oe.jsx)(Qo,{title:(0,b.__)("Pages"),backPath:"/",content:(0,oe.jsx)(nE,{postType:"page"})}),content:(0,oe.jsx)(mE,{postType:"page"}),preview:({query:e})=>("list"===e.layout||!e.layout)&&"true"!==e.isCustom?(0,oe.jsx)(Pv,{}):void 0,mobile:(0,oe.jsx)(AE,{}),edit({query:e}){var t;return"list"!==(null!==(t=e.layout)&&void 0!==t?t:"list")&&!!e.quickEdit?(0,oe.jsx)(TE,{postType:"page",postId:e.postId}):void 0}},widths:{content:({query:e})=>("list"===e.layout||!e.layout)&&"true"!==e.isCustom?380:void 0,edit({query:e}){var t;return"list"!==(null!==(t=e.layout)&&void 0!==t?t:"list")&&!!e.quickEdit?380:void 0}}},ME=[{name:"page-item",path:"/page/:postId",areas:{sidebar:(0,oe.jsx)(Qo,{title:(0,b.__)("Pages"),backPath:"/",content:(0,oe.jsx)(nE,{postType:"page"})}),mobile:(0,oe.jsx)(Pv,{}),preview:(0,oe.jsx)(Pv,{})}},NE,Ak,Ok,jC,_C,wC,gx,px,Nv,Tv,{name:"stylebook",path:"/stylebook",areas:{sidebar:(0,oe.jsx)(Qo,{title:(0,b.__)("Styles"),backPath:"/",description:(0,b.__)("Preview your website's visual identity: colors, typography, and blocks.")}),preview:(0,oe.jsx)(gg,{isStatic:!0}),mobile:(0,oe.jsx)(gg,{isStatic:!0})}}];const{RouterProvider:FE}=te(Gt.privateApis);function VE(){return function(){const e=(0,l.useSelect)((e=>e(_.store).getEntityRecord("root","__unstableBase")?.home),[]);(0,Wt.useCommand)({name:"core/edit-site/view-site",label:(0,b.__)("View site"),callback:({close:t})=>{t(),window.open(e,"_blank")},icon:ko}),(0,Wt.useCommandLoader)({name:"core/edit-site/open-styles",hook:To()}),(0,Wt.useCommandLoader)({name:"core/edit-site/toggle-styles-welcome-guide",hook:Oo()}),(0,Wt.useCommandLoader)({name:"core/edit-site/reset-global-styles",hook:Ao()}),(0,Wt.useCommandLoader)({name:"core/edit-site/open-styles-css",hook:No()}),(0,Wt.useCommandLoader)({name:"core/edit-site/open-styles-revisions",hook:Mo()})}(),function(){const{query:e={}}=Go(),{canvas:t="view"}=e;let n="site-editor";"edit"===t&&(n="entity-edit"),(0,l.useSelect)((e=>e(x.store).getBlockSelectionStart()),[])&&(n="block-selection-edit"),Do()&&(n=""),zo(n)}(),(0,oe.jsx)(yo,{})}function RE(){!function(){const e=(0,l.useRegistry)(),{registerRoute:t}=te((0,l.useDispatch)(zt));(0,d.useEffect)((()=>{e.batch((()=>{ME.forEach(t)}))}),[e,t])}();const e=(0,l.useSelect)((e=>te(e(zt)).getRoutes()),[]),t=(0,d.useCallback)((({path:e,query:t})=>Xr()?{path:e,query:{...t,wp_theme_preview:"wp_theme_preview"in t?t.wp_theme_preview:Jr()}}:{path:e,query:t}),[]);return(0,oe.jsx)(FE,{routes:e,pathArg:"p",beforeNavigate:t,children:(0,oe.jsx)(VE,{})})}const BE=(0,Qt.getPath)(window.location.href)?.includes("site-editor.php"),DE=e=>{u()(`wp.editPost.${e}`,{since:"6.6",alternative:`wp.editor.${e}`})};function LE(e){return BE?(DE("PluginMoreMenuItem"),(0,oe.jsx)(h.PluginMoreMenuItem,{...e})):null}function zE(e){return BE?(DE("PluginSidebar"),(0,oe.jsx)(h.PluginSidebar,{...e})):null}function GE(e){return BE?(DE("PluginSidebarMoreMenuItem"),(0,oe.jsx)(h.PluginSidebarMoreMenuItem,{...e})):null}const{useLocation:HE}=te(Gt.privateApis);function UE(){const{query:e={}}=HE(),{canvas:t="view"}=e;return"edit"===t?(0,oe.jsx)(Pv,{}):(0,oe.jsx)(mE,{postType:"post"})}const WE={name:"posts",path:"/",areas:{sidebar:(0,oe.jsx)(Qo,{title:(0,b.__)("Posts"),isRoot:!0,content:(0,oe.jsx)(nE,{postType:"post"})}),content:(0,oe.jsx)(mE,{postType:"post"}),preview:({query:e})=>("list"===e.layout||!e.layout)&&"true"!==e.isCustom?(0,oe.jsx)(Pv,{isPostsList:!0}):void 0,mobile:(0,oe.jsx)(UE,{}),edit({query:e}){var t;return"list"===(null!==(t=e.layout)&&void 0!==t?t:"list")&&!!e.quickEdit?(0,oe.jsx)(TE,{postType:"post",postId:e.postId}):void 0}},widths:{content:({query:e})=>("list"===e.layout||!e.layout)&&"true"!==e.isCustom?380:void 0,edit({query:e}){var t;return"list"===(null!==(t=e.layout)&&void 0!==t?t:"list")&&!!e.quickEdit?380:void 0}}};(0,b.__)("Posts");const{RouterProvider:qE}=te(Gt.privateApis);function ZE(e,t){}const{registerCoreBlockBindingsSources:KE}=te(h.privateApis);function YE(e,t){const n=document.getElementById(e),s=(0,d.createRoot)(n);(0,l.dispatch)(o.store).reapplyBlockTypeFilters();const i=(0,a.__experimentalGetCoreBlocks)().filter((({name:e})=>"core/freeform"!==e));return(0,a.registerCoreBlocks)(i),KE(),(0,l.dispatch)(o.store).setFreeformFallbackBlockName("core/html"),(0,m.registerLegacyWidgetBlock)({inserter:!1}),(0,m.registerWidgetGroupBlock)({inserter:!1}),(0,l.dispatch)(f.store).setDefaults("core/edit-site",{welcomeGuide:!0,welcomeGuideStyles:!0,welcomeGuidePage:!0,welcomeGuideTemplate:!0}),(0,l.dispatch)(f.store).setDefaults("core",{allowRightClickOverrides:!0,distractionFree:!1,editorMode:"visual",editorTool:"edit",fixedToolbar:!1,focusMode:!1,inactivePanels:[],keepCaretInsideBlock:!1,openPanels:["post-status"],showBlockBreadcrumbs:!0,showListViewByDefault:!1,enableChoosePatternModal:!0}),window.__experimentalMediaProcessing&&(0,l.dispatch)(f.store).setDefaults("core/media",{requireApproval:!0,optimizeOnUpload:!0}),(0,l.dispatch)(zt).updateSettings(t),window.addEventListener("dragover",(e=>e.preventDefault()),!1),window.addEventListener("drop",(e=>e.preventDefault()),!1),s.render((0,oe.jsx)(d.StrictMode,{children:(0,oe.jsx)(RE,{})})),s}function XE(){u()("wp.editSite.reinitializeEditor",{since:"6.2",version:"6.3"})}})(),(window.wp=window.wp||{}).editSite=r})(); \ No newline at end of file diff --git a/wp-includes/js/dist/edit-widgets.js b/wp-includes/js/dist/edit-widgets.js index 7aaf8be4fa..135dcd1c2b 100644 --- a/wp-includes/js/dist/edit-widgets.js +++ b/wp-includes/js/dist/edit-widgets.js @@ -340,6 +340,8 @@ const starEmpty = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)( const external_wp_viewport_namespaceObject = window["wp"]["viewport"]; ;// external ["wp","compose"] const external_wp_compose_namespaceObject = window["wp"]["compose"]; +;// external ["wp","plugins"] +const external_wp_plugins_namespaceObject = window["wp"]["plugins"]; ;// ./node_modules/@wordpress/icons/build-module/library/close-small.js /** * WordPress dependencies @@ -788,20 +790,6 @@ const store = (0,external_wp_data_namespaceObject.createReduxStore)(STORE_NAME, // we'd be able to replace this with a register call. (0,external_wp_data_namespaceObject.register)(store); -;// external ["wp","plugins"] -const external_wp_plugins_namespaceObject = window["wp"]["plugins"]; -;// ./node_modules/@wordpress/interface/build-module/components/complementary-area-context/index.js -/** - * WordPress dependencies - */ - -/* harmony default export */ const complementary_area_context = ((0,external_wp_plugins_namespaceObject.withPluginContext)((context, ownProps) => { - return { - icon: ownProps.icon || context.icon, - identifier: ownProps.identifier || `${context.name}/${ownProps.name}` - }; -})); - ;// ./node_modules/@wordpress/interface/build-module/components/complementary-area-toggle/index.js /** * WordPress dependencies @@ -809,18 +797,18 @@ const external_wp_plugins_namespaceObject = window["wp"]["plugins"]; + /** * Internal dependencies */ - /** * Whether the role supports checked state. * + * @see https://www.w3.org/TR/wai-aria-1.1/#aria-checked * @param {import('react').AriaRole} role Role. * @return {boolean} Whether the role supports checked state. - * @see https://www.w3.org/TR/wai-aria-1.1/#aria-checked */ function roleSupportsCheckedState(role) { @@ -829,14 +817,17 @@ function roleSupportsCheckedState(role) { function ComplementaryAreaToggle({ as = external_wp_components_namespaceObject.Button, scope, - identifier, - icon, + identifier: identifierProp, + icon: iconProp, selectedIcon, name, shortcut, ...props }) { const ComponentToUse = as; + const context = (0,external_wp_plugins_namespaceObject.usePluginContext)(); + const icon = iconProp || context.icon; + const identifier = identifierProp || `${context.name}/${name}`; const isSelected = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).getActiveComplementaryArea(scope) === identifier, [identifier, scope]); const { enableComplementaryArea, @@ -859,7 +850,6 @@ function ComplementaryAreaToggle({ ...props }); } -/* harmony default export */ const complementary_area_toggle = (complementary_area_context(ComplementaryAreaToggle)); ;// ./node_modules/@wordpress/interface/build-module/components/complementary-area-header/index.js /** @@ -877,35 +867,25 @@ function ComplementaryAreaToggle({ */ - - const ComplementaryAreaHeader = ({ - smallScreenTitle, children, className, toggleButtonProps }) => { - const toggleButton = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(complementary_area_toggle, { + const toggleButton = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ComplementaryAreaToggle, { icon: close_small, ...toggleButtonProps }); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { - className: "components-panel__header interface-complementary-area-header__small", - children: [smallScreenTitle && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h2", { - className: "interface-complementary-area-header__small-title", - children: smallScreenTitle - }), toggleButton] - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { - className: dist_clsx('components-panel__header', 'interface-complementary-area-header', className), - tabIndex: -1, - children: [children, toggleButton] - })] + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { + className: dist_clsx('components-panel__header', 'interface-complementary-area-header', className), + tabIndex: -1, + children: [children, toggleButton] }); }; /* harmony default export */ const complementary_area_header = (ComplementaryAreaHeader); ;// ./node_modules/@wordpress/interface/build-module/components/action-item/index.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -915,7 +895,7 @@ const ComplementaryAreaHeader = ({ const noop = () => {}; function ActionItemSlot({ name, - as: Component = external_wp_components_namespaceObject.ButtonGroup, + as: Component = external_wp_components_namespaceObject.MenuGroup, fillProps = {}, bubblesVirtually, ...props @@ -1011,7 +991,7 @@ function ComplementaryAreaMoreMenuItem({ __unstableExplicitMenuItem, ...props }) { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(complementary_area_toggle, { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ComplementaryAreaToggle, { as: toggleProps => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(action_item, { __unstableExplicitMenuItem: __unstableExplicitMenuItem, @@ -1084,6 +1064,7 @@ PinnedItems.Slot = PinnedItemsSlot; + /** * Internal dependencies */ @@ -1093,9 +1074,6 @@ PinnedItems.Slot = PinnedItemsSlot; - - - const ANIMATION_DURATION = 0.3; function ComplementaryAreaSlot({ scope, @@ -1206,19 +1184,22 @@ function ComplementaryArea({ children, className, closeLabel = (0,external_wp_i18n_namespaceObject.__)('Close plugin'), - identifier, + identifier: identifierProp, header, headerClassName, - icon, + icon: iconProp, isPinnable = true, panelClassName, scope, name, - smallScreenTitle, title, toggleShortcut, isActiveByDefault }) { + const context = (0,external_wp_plugins_namespaceObject.usePluginContext)(); + const icon = iconProp || context.icon; + const identifier = identifierProp || `${context.name}/${name}`; + // This state is used to delay the rendering of the Fill // until the initial effect runs. // This prevents the animation from running on mount if @@ -1252,6 +1233,7 @@ function ComplementaryArea({ showIconLabels: get('core', 'showIconLabels') }; }, [identifier, scope]); + const isMobileViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<'); useAdjustComplementaryListener(scope, identifier, activeArea, isActive, isSmall); const { enableComplementaryArea, @@ -1275,7 +1257,7 @@ function ComplementaryArea({ return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [isPinnable && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(pinned_items, { scope: scope, - children: isPinned && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(complementary_area_toggle, { + children: isPinned && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ComplementaryAreaToggle, { scope: scope, identifier: identifier, isPressed: isActive && (!showIconLabels || isLarge), @@ -1303,10 +1285,9 @@ function ComplementaryArea({ className: headerClassName, closeLabel: closeLabel, onClose: () => disableComplementaryArea(scope), - smallScreenTitle: smallScreenTitle, toggleButtonProps: { label: closeLabel, - size: 'small', + size: 'compact', shortcut: toggleShortcut, scope, identifier @@ -1315,7 +1296,7 @@ function ComplementaryArea({ children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h2", { className: "interface-complementary-area-header__title", children: title - }), isPinnable && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + }), isPinnable && !isMobileViewport && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { className: "interface-complementary-area__pin-unpin-item", icon: isPinned ? star_filled : star_empty, label: isPinned ? (0,external_wp_i18n_namespaceObject.__)('Unpin from toolbar') : (0,external_wp_i18n_namespaceObject.__)('Pin to toolbar'), @@ -1332,9 +1313,8 @@ function ComplementaryArea({ })] }); } -const ComplementaryAreaWrapped = complementary_area_context(ComplementaryArea); -ComplementaryAreaWrapped.Slot = ComplementaryAreaSlot; -/* harmony default export */ const complementary_area = (ComplementaryAreaWrapped); +ComplementaryArea.Slot = ComplementaryAreaSlot; +/* harmony default export */ const complementary_area = (ComplementaryArea); ;// ./node_modules/@wordpress/interface/build-module/components/navigable-region/index.js /** @@ -1386,7 +1366,6 @@ NavigableRegion.displayName = 'NavigableRegion'; */ - const interface_skeleton_ANIMATION_DURATION = 0.25; const commonTransition = { type: 'tween', @@ -1616,7 +1595,7 @@ function transformWidgetToBlock(widget) { * Converts a block to a widget entity record. * * @param {Object} block The block. - * @param {Object?} relatedWidget A related widget entity record from the API (optional). + * @param {?Object} relatedWidget A related widget entity record from the API (optional). * @return {Object} the widget object (converted from block). */ function transformBlockToWidget(block, relatedWidget = {}) { @@ -1734,6 +1713,7 @@ const createStubPost = (id, blocks) => ({ const constants_STORE_NAME = 'core/edit-widgets'; ;// ./node_modules/@wordpress/edit-widgets/build-module/store/actions.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -1792,7 +1772,7 @@ const saveEditedWidgetAreas = () => async ({ type: 'snackbar' }); } catch (e) { - registry.dispatch(external_wp_notices_namespaceObject.store).createErrorNotice( /* translators: %s: The error message. */ + registry.dispatch(external_wp_notices_namespaceObject.store).createErrorNotice(/* translators: %s: The error message. */ (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('There was an error. %s'), e.message), { type: 'snackbar' }); @@ -1942,7 +1922,7 @@ const saveWidgetArea = widgetAreaId => async ({ } } if (failedWidgetNames.length) { - throw new Error((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: List of widget names */ + throw new Error((0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: List of widget names */ (0,external_wp_i18n_namespaceObject.__)('Could not save the following widgets: %s.'), failedWidgetNames.join(', '))); } registry.dispatch(external_wp_coreData_namespaceObject.store).editEntityRecord(KIND, WIDGET_AREA_ENTITY_TYPE, widgetAreaId, { @@ -2171,6 +2151,7 @@ const getWidgets = () => async ({ }; ;// ./node_modules/@wordpress/edit-widgets/build-module/store/selectors.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -2492,8 +2473,6 @@ const external_wp_hooks_namespaceObject = window["wp"]["hooks"]; */ - - const withMoveToWidgetAreaToolbarItem = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(BlockEdit => props => { const { clientId, @@ -3083,7 +3062,6 @@ const ENABLE_EXPERIMENTAL_FSE_BLOCKS = false; - const { ExperimentalBlockEditorProvider } = unlock(external_wp_blockEditor_namespaceObject.privateApis); @@ -3158,7 +3136,8 @@ function WidgetAreasBlockEditorProvider({ templateLock: 'all', __experimentalSetIsInserterOpened: setIsInserterOpened, pageOnFront, - pageForPosts + pageForPosts, + editorTool: 'edit' }; }, [hasUploadPermissions, blockEditorSettings, isFixedToolbarActive, isLargeViewport, keepCaretInsideBlock, reusableBlocks, setIsInserterOpened, pageOnFront, pageForPosts]); const widgetAreaId = use_last_selected_widget_area(); @@ -3255,7 +3234,6 @@ const external_wp_dom_namespaceObject = window["wp"]["dom"]; */ - function WidgetAreas({ selectedWidgetAreaId }) { @@ -3317,7 +3295,7 @@ const SIDEBAR_ACTIVE_BY_DEFAULT = external_wp_element_namespaceObject.Platform.s }); const BLOCK_INSPECTOR_IDENTIFIER = 'edit-widgets/block-inspector'; -// Widget areas were one called block areas, so use 'edit-widgets/block-areas' +// Widget areas were once called block areas, so use 'edit-widgets/block-areas' // for backwards compatibility. const WIDGET_AREAS_IDENTIFIER = 'edit-widgets/block-areas'; @@ -3328,7 +3306,6 @@ const WIDGET_AREAS_IDENTIFIER = 'edit-widgets/block-areas'; - const { Tabs } = unlock(external_wp_components_namespaceObject.privateApis); @@ -3364,7 +3341,6 @@ function SidebarContent({ // We're intentionally leaving `currentArea` and `isGeneralSidebarOpen` // out of the dep array because we want this effect to run based on // block selection changes, not sidebar state changes. - // eslint-disable-next-line react-hooks/exhaustive-deps }, [hasSelectedNonAreaBlock, enableComplementaryArea]); const tabsContextValue = (0,external_wp_element_namespaceObject.useContext)(Tabs.Context); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(complementary_area, { @@ -3450,10 +3426,10 @@ function Sidebar() { enableComplementaryArea } = (0,external_wp_data_namespaceObject.useDispatch)(store); - // `newSelectedTabId` could technically be falsey if no tab is selected (i.e. + // `newSelectedTabId` could technically be falsy if no tab is selected (i.e. // the initial render) or when we don't want a tab displayed (i.e. the // sidebar is closed). These cases should both be covered by the `!!` check - // below, so we shouldn't need any additional falsey handling. + // below, so we shouldn't need any additional falsy handling. const onTabSelect = (0,external_wp_element_namespaceObject.useCallback)(newSelectedTabId => { if (!!newSelectedTabId) { enableComplementaryArea(store_store.name, newSelectedTabId); @@ -3627,8 +3603,6 @@ function RedoButton(props, ref) { - - function DocumentTools() { const isMediumViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium'); const { @@ -3673,7 +3647,7 @@ function DocumentTools() { icon: library_plus /* translators: button label text should, if possible, be under 16 characters. */, - label: (0,external_wp_i18n_namespaceObject._x)('Toggle block inserter', 'Generic label for block inserter button'), + label: (0,external_wp_i18n_namespaceObject._x)('Block Inserter', 'Generic label for block inserter button'), size: "compact" }), isMediumViewport && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarItem, { @@ -3845,14 +3819,13 @@ const textFormattingShortcuts = [{ }]; ;// ./node_modules/@wordpress/edit-widgets/build-module/components/keyboard-shortcut-help-modal/shortcut.js +/* wp:polyfill */ /** * WordPress dependencies */ - - function KeyCombination({ keyCombination, forceAriaLabel @@ -3943,6 +3916,7 @@ function DynamicShortcut({ /* harmony default export */ const dynamic_shortcut = (DynamicShortcut); ;// ./node_modules/@wordpress/edit-widgets/build-module/components/keyboard-shortcut-help-modal/index.js +/* wp:polyfill */ /** * External dependencies */ @@ -3963,7 +3937,6 @@ function DynamicShortcut({ - const ShortcutList = ({ shortcuts }) => @@ -4093,8 +4066,6 @@ ToolsMoreMenuGroup.Slot = ({ - - function MoreMenu() { const [isKeyboardShortcutsModalActive, setIsKeyboardShortcutsModalVisible] = (0,external_wp_element_namespaceObject.useState)(false); const toggleKeyboardShortcutsModal = () => setIsKeyboardShortcutsModalVisible(!isKeyboardShortcutsModalActive); @@ -4202,8 +4173,6 @@ function MoreMenu() { - - function Header() { const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium'); const blockToolbarRef = (0,external_wp_element_namespaceObject.useRef)(); @@ -4247,6 +4216,7 @@ function Header() { /* harmony default export */ const header = (Header); ;// ./node_modules/@wordpress/edit-widgets/build-module/components/notices/index.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -4256,8 +4226,6 @@ function Header() { // Last three notices. Slices from the tail end of the list. - - const MAX_VISIBLE_NOTICES = -3; function Notices() { const { @@ -4314,7 +4282,6 @@ function Notices() { - function WidgetAreasBlockEditorContent({ blockEditorSettings }) { @@ -4342,21 +4309,6 @@ function WidgetAreasBlockEditorContent({ }); } -;// ./node_modules/@wordpress/icons/build-module/library/close.js -/** - * WordPress dependencies - */ - - -const close_close = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - d: "m13.06 12 6.47-6.47-1.06-1.06L12 10.94 5.53 4.47 4.47 5.53 10.94 12l-6.47 6.47 1.06 1.06L12 13.06l6.47 6.47 1.06-1.06L13.06 12Z" - }) -}); -/* harmony default export */ const library_close = (close_close); - ;// ./node_modules/@wordpress/edit-widgets/build-module/hooks/use-widget-library-insertion-point.js /** * WordPress dependencies @@ -4422,16 +4374,12 @@ const useWidgetLibraryInsertionPoint = () => { - - - /** * Internal dependencies */ - function InserterSidebar() { const isMobileViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<'); const { @@ -4444,34 +4392,26 @@ function InserterSidebar() { const closeInserter = (0,external_wp_element_namespaceObject.useCallback)(() => { return setIsInserterOpened(false); }, [setIsInserterOpened]); - const TagName = !isMobileViewport ? external_wp_components_namespaceObject.VisuallyHidden : 'div'; const [inserterDialogRef, inserterDialogProps] = (0,external_wp_compose_namespaceObject.__experimentalUseDialog)({ onClose: closeInserter, focusOnMount: true }); const libraryRef = (0,external_wp_element_namespaceObject.useRef)(); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ref: inserterDialogRef, ...inserterDialogProps, className: "edit-widgets-layout__inserter-panel", - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { - className: "edit-widgets-layout__inserter-panel-header", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - __next40pxDefaultSize: true, - icon: library_close, - onClick: closeInserter, - label: (0,external_wp_i18n_namespaceObject.__)('Close block inserter') - }) - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "edit-widgets-layout__inserter-panel-content", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalLibrary, { showInserterHelpPanel: true, shouldFocusBlock: isMobileViewport, rootClientId: rootClientId, __experimentalInsertionIndex: insertionIndex, - ref: libraryRef + ref: libraryRef, + onClose: closeInserter }) - })] + }) }); } @@ -4494,7 +4434,6 @@ function InserterSidebar() { - function ListViewSidebar() { const { setIsListViewOpened @@ -4530,10 +4469,10 @@ function ListViewSidebar() { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("strong", { children: (0,external_wp_i18n_namespaceObject.__)('List View') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - __next40pxDefaultSize: true, icon: close_small, label: (0,external_wp_i18n_namespaceObject.__)('Close'), - onClick: closeListView + onClick: closeListView, + size: "compact" })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "edit-widgets-editor__list-view-panel-content", @@ -4605,7 +4544,6 @@ function SecondarySidebar() { - const interfaceLabels = { /* translators: accessibility text for the widgets screen top bar landmark region. */ header: (0,external_wp_i18n_namespaceObject.__)('Widgets top bar'), @@ -4729,6 +4667,7 @@ function UnsavedChangesWarning() { } ;// ./node_modules/@wordpress/edit-widgets/build-module/components/welcome-guide/index.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -4743,8 +4682,6 @@ function UnsavedChangesWarning() { */ - - function WelcomeGuide() { var _widgetAreas$filter$l; const isActive = (0,external_wp_data_namespaceObject.useSelect)(select => !!select(external_wp_preferences_namespaceObject.store).get('core/edit-widgets', 'welcomeGuide'), []); @@ -4803,7 +4740,7 @@ function WelcomeGuide() { content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h1", { className: "edit-widgets-welcome-guide__heading", - children: (0,external_wp_i18n_namespaceObject.__)('Make each block your own') + children: (0,external_wp_i18n_namespaceObject.__)('Customize each block') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "edit-widgets-welcome-guide__text", children: (0,external_wp_i18n_namespaceObject.__)('Each block comes with its own set of controls for changing things like color, width, and alignment. These will show and hide automatically when you have a block selected.') @@ -4817,7 +4754,7 @@ function WelcomeGuide() { content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h1", { className: "edit-widgets-welcome-guide__heading", - children: (0,external_wp_i18n_namespaceObject.__)('Get to know the block library') + children: (0,external_wp_i18n_namespaceObject.__)('Explore all blocks') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "edit-widgets-welcome-guide__text", children: (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.__)('All of the blocks available to you live in the block library. You’ll find it wherever you see the icon.'), { @@ -4837,7 +4774,7 @@ function WelcomeGuide() { content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h1", { className: "edit-widgets-welcome-guide__heading", - children: (0,external_wp_i18n_namespaceObject.__)('Learn how to use the block editor') + children: (0,external_wp_i18n_namespaceObject.__)('Learn more') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "edit-widgets-welcome-guide__text", children: (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.__)("New to the block editor? Want to learn more about using it? Here's a detailed guide."), { @@ -4888,7 +4825,6 @@ function WelcomeGuideImage({ - function Layout({ blockEditorSettings }) { @@ -4896,7 +4832,7 @@ function Layout({ createErrorNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); function onPluginAreaError(name) { - createErrorNotice((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: plugin name */ + createErrorNotice((0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: plugin name */ (0,external_wp_i18n_namespaceObject.__)('The "%s" plugin has encountered an error and cannot be rendered.'), name)); } const navigateRegionsProps = (0,external_wp_components_namespaceObject.__unstableUseNavigateRegions)(); @@ -4919,6 +4855,7 @@ function Layout({ /* harmony default export */ const layout = (Layout); ;// ./node_modules/@wordpress/edit-widgets/build-module/index.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -4974,7 +4911,7 @@ function initializeEditor(id, settings) { // do this will result in errors in the default block parser. // see: https://github.com/WordPress/gutenberg/issues/33097 (0,external_wp_blocks_namespaceObject.setFreeformContentHandlerName)('core/html'); - root.render( /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.StrictMode, { + root.render(/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.StrictMode, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(layout, { blockEditorSettings: settings }) diff --git a/wp-includes/js/dist/edit-widgets.min.js b/wp-includes/js/dist/edit-widgets.min.js index ea202d6c7a..a4af5a5fd0 100644 --- a/wp-includes/js/dist/edit-widgets.min.js +++ b/wp-includes/js/dist/edit-widgets.min.js @@ -1,2 +1,2 @@ /*! This file is auto-generated */ -(()=>{"use strict";var e={n:t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},d:(t,r)=>{for(var i in r)e.o(r,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:r[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{initialize:()=>Ir,initializeEditor:()=>Er,reinitializeEditor:()=>Cr,store:()=>at});var r={};e.r(r),e.d(r,{closeModal:()=>U,disableComplementaryArea:()=>O,enableComplementaryArea:()=>M,openModal:()=>H,pinItem:()=>V,setDefaultComplementaryArea:()=>P,setFeatureDefaults:()=>z,setFeatureValue:()=>G,toggleFeature:()=>F,unpinItem:()=>D});var i={};e.r(i),e.d(i,{getActiveComplementaryArea:()=>$,isComplementaryAreaLoading:()=>Y,isFeatureActive:()=>K,isItemPinned:()=>Z,isModalActive:()=>q});var s={};e.r(s),e.d(s,{closeGeneralSidebar:()=>Me,moveBlockToWidgetArea:()=>Oe,persistStubPost:()=>Ee,saveEditedWidgetAreas:()=>Ie,saveWidgetArea:()=>Ne,saveWidgetAreas:()=>Ce,setIsInserterOpened:()=>We,setIsListViewOpened:()=>Pe,setIsWidgetAreaOpen:()=>Re,setWidgetAreasOpenState:()=>Le,setWidgetIdForClientId:()=>Te});var o={};e.r(o),e.d(o,{getWidgetAreas:()=>Ve,getWidgets:()=>De});var n={};e.r(n),e.d(n,{__experimentalGetInsertionPoint:()=>Qe,canInsertBlockInWidgetArea:()=>Xe,getEditedWidgetAreas:()=>Ye,getIsWidgetAreaOpen:()=>qe,getParentWidgetAreaBlock:()=>$e,getReferenceWidgetBlocks:()=>Ze,getWidget:()=>ze,getWidgetAreaForWidgetId:()=>Ue,getWidgetAreas:()=>He,getWidgets:()=>Ge,isInserterOpened:()=>Je,isListViewOpened:()=>et,isSavingWidgetAreas:()=>Ke});var a={};e.r(a),e.d(a,{getInserterSidebarToggleRef:()=>rt,getListViewToggleRef:()=>tt});var c={};e.r(c),e.d(c,{metadata:()=>ht,name:()=>mt,settings:()=>_t});const d=window.wp.blocks,l=window.wp.data,u=window.wp.deprecated;var g=e.n(u);const p=window.wp.element,h=window.wp.blockLibrary,m=window.wp.coreData,_=window.wp.widgets,w=window.wp.preferences,b=window.wp.apiFetch;var f=e.n(b);const x=(0,l.combineReducers)({blockInserterPanel:function(e=!1,t){switch(t.type){case"SET_IS_LIST_VIEW_OPENED":return!t.isOpen&&e;case"SET_IS_INSERTER_OPENED":return t.value}return e},inserterSidebarToggleRef:function(e={current:null}){return e},listViewPanel:function(e=!1,t){switch(t.type){case"SET_IS_INSERTER_OPENED":return!t.value&&e;case"SET_IS_LIST_VIEW_OPENED":return t.isOpen}return e},listViewToggleRef:function(e={current:null}){return e},widgetAreasOpenState:function(e={},t){const{type:r}=t;switch(r){case"SET_WIDGET_AREAS_OPEN_STATE":return t.widgetAreasOpenState;case"SET_IS_WIDGET_AREA_OPEN":{const{clientId:r,isOpen:i}=t;return{...e,[r]:i}}default:return e}}}),y=window.wp.i18n,v=window.wp.notices;function k(e){var t,r,i="";if("string"==typeof e||"number"==typeof e)i+=e;else if("object"==typeof e)if(Array.isArray(e)){var s=e.length;for(t=0;t({type:"SET_DEFAULT_COMPLEMENTARY_AREA",scope:e=R(e),area:t=W(e,t)}),M=(e,t)=>({registry:r,dispatch:i})=>{if(!t)return;e=R(e),t=W(e,t);r.select(w.store).get(e,"isComplementaryAreaVisible")||r.dispatch(w.store).set(e,"isComplementaryAreaVisible",!0),i({type:"ENABLE_COMPLEMENTARY_AREA",scope:e,area:t})},O=e=>({registry:t})=>{e=R(e);t.select(w.store).get(e,"isComplementaryAreaVisible")&&t.dispatch(w.store).set(e,"isComplementaryAreaVisible",!1)},V=(e,t)=>({registry:r})=>{if(!t)return;e=R(e),t=W(e,t);const i=r.select(w.store).get(e,"pinnedItems");!0!==i?.[t]&&r.dispatch(w.store).set(e,"pinnedItems",{...i,[t]:!0})},D=(e,t)=>({registry:r})=>{if(!t)return;e=R(e),t=W(e,t);const i=r.select(w.store).get(e,"pinnedItems");r.dispatch(w.store).set(e,"pinnedItems",{...i,[t]:!1})};function F(e,t){return function({registry:r}){g()("dispatch( 'core/interface' ).toggleFeature",{since:"6.0",alternative:"dispatch( 'core/preferences' ).toggle"}),r.dispatch(w.store).toggle(e,t)}}function G(e,t,r){return function({registry:i}){g()("dispatch( 'core/interface' ).setFeatureValue",{since:"6.0",alternative:"dispatch( 'core/preferences' ).set"}),i.dispatch(w.store).set(e,t,!!r)}}function z(e,t){return function({registry:r}){g()("dispatch( 'core/interface' ).setFeatureDefaults",{since:"6.0",alternative:"dispatch( 'core/preferences' ).setDefaults"}),r.dispatch(w.store).setDefaults(e,t)}}function H(e){return{type:"OPEN_MODAL",name:e}}function U(){return{type:"CLOSE_MODAL"}}const $=(0,l.createRegistrySelector)((e=>(t,r)=>{r=R(r);const i=e(w.store).get(r,"isComplementaryAreaVisible");if(void 0!==i)return!1===i?null:t?.complementaryAreas?.[r]})),Y=(0,l.createRegistrySelector)((e=>(t,r)=>{r=R(r);const i=e(w.store).get(r,"isComplementaryAreaVisible"),s=t?.complementaryAreas?.[r];return i&&void 0===s})),Z=(0,l.createRegistrySelector)((e=>(t,r,i)=>{var s;i=W(r=R(r),i);const o=e(w.store).get(r,"pinnedItems");return null===(s=o?.[i])||void 0===s||s})),K=(0,l.createRegistrySelector)((e=>(t,r,i)=>(g()("select( 'core/interface' ).isFeatureActive( scope, featureName )",{since:"6.0",alternative:"select( 'core/preferences' ).get( scope, featureName )"}),!!e(w.store).get(r,i))));function q(e,t){return e.activeModal===t}const J=(0,l.combineReducers)({complementaryAreas:function(e={},t){switch(t.type){case"SET_DEFAULT_COMPLEMENTARY_AREA":{const{scope:r,area:i}=t;return e[r]?e:{...e,[r]:i}}case"ENABLE_COMPLEMENTARY_AREA":{const{scope:r,area:i}=t;return{...e,[r]:i}}}return e},activeModal:function(e=null,t){switch(t.type){case"OPEN_MODAL":return t.name;case"CLOSE_MODAL":return null}return e}}),Q=(0,l.createReduxStore)("core/interface",{reducer:J,actions:r,selectors:i});(0,l.register)(Q);const X=window.wp.plugins,ee=(0,X.withPluginContext)(((e,t)=>({icon:t.icon||e.icon,identifier:t.identifier||`${e.name}/${t.name}`})));const te=ee((function({as:e=S.Button,scope:t,identifier:r,icon:i,selectedIcon:s,name:o,shortcut:n,...a}){const c=e,d=(0,l.useSelect)((e=>e(Q).getActiveComplementaryArea(t)===r),[r,t]),{enableComplementaryArea:u,disableComplementaryArea:g}=(0,l.useDispatch)(Q);return(0,E.jsx)(c,{icon:s&&d?s:i,"aria-controls":r.replace("/",":"),"aria-checked":(p=a.role,["checkbox","option","radio","switch","menuitemcheckbox","menuitemradio","treeitem"].includes(p)?d:void 0),onClick:()=>{d?g(t):u(t,r)},shortcut:n,...a});var p})),re=({smallScreenTitle:e,children:t,className:r,toggleButtonProps:i})=>{const s=(0,E.jsx)(te,{icon:L,...i});return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)("div",{className:"components-panel__header interface-complementary-area-header__small",children:[e&&(0,E.jsx)("h2",{className:"interface-complementary-area-header__small-title",children:e}),s]}),(0,E.jsxs)("div",{className:j("components-panel__header","interface-complementary-area-header",r),tabIndex:-1,children:[t,s]})]})},ie=()=>{};function se({name:e,as:t=S.Button,onClick:r,...i}){return(0,E.jsx)(S.Fill,{name:e,children:({onClick:e})=>(0,E.jsx)(t,{onClick:r||e?(...t)=>{(r||ie)(...t),(e||ie)(...t)}:void 0,...i})})}se.Slot=function({name:e,as:t=S.ButtonGroup,fillProps:r={},bubblesVirtually:i,...s}){return(0,E.jsx)(S.Slot,{name:e,bubblesVirtually:i,fillProps:r,children:e=>{if(!p.Children.toArray(e).length)return null;const r=[];p.Children.forEach(e,(({props:{__unstableExplicitMenuItem:e,__unstableTarget:t}})=>{t&&e&&r.push(t)}));const i=p.Children.map(e,(e=>!e.props.__unstableExplicitMenuItem&&r.includes(e.props.__unstableTarget)?null:e));return(0,E.jsx)(t,{...s,children:i})}})};const oe=se,ne=({__unstableExplicitMenuItem:e,__unstableTarget:t,...r})=>(0,E.jsx)(S.MenuItem,{...r});function ae({scope:e,target:t,__unstableExplicitMenuItem:r,...i}){return(0,E.jsx)(te,{as:i=>(0,E.jsx)(oe,{__unstableExplicitMenuItem:r,__unstableTarget:`${e}/${t}`,as:ne,name:`${e}/plugin-more-menu`,...i}),role:"menuitemcheckbox",selectedIcon:I,name:t,scope:e,...i})}function ce({scope:e,...t}){return(0,E.jsx)(S.Fill,{name:`PinnedItems/${e}`,...t})}ce.Slot=function({scope:e,className:t,...r}){return(0,E.jsx)(S.Slot,{name:`PinnedItems/${e}`,...r,children:e=>e?.length>0&&(0,E.jsx)("div",{className:j(t,"interface-pinned-items"),children:e})})};const de=ce;const le={open:{width:280},closed:{width:0},mobileOpen:{width:"100vw"}};function ue({activeArea:e,isActive:t,scope:r,children:i,className:s,id:o}){const n=(0,T.useReducedMotion)(),a=(0,T.useViewportMatch)("medium","<"),c=(0,T.usePrevious)(e),d=(0,T.usePrevious)(t),[,l]=(0,p.useState)({});(0,p.useEffect)((()=>{l({})}),[t]);const u={type:"tween",duration:n||a||c&&e&&e!==c?0:.3,ease:[.6,0,.4,1]};return(0,E.jsx)(S.Fill,{name:`ComplementaryArea/${r}`,children:(0,E.jsx)(S.__unstableAnimatePresence,{initial:!1,children:(d||t)&&(0,E.jsx)(S.__unstableMotion.div,{variants:le,initial:"closed",animate:a?"mobileOpen":"open",exit:"closed",transition:u,className:"interface-complementary-area__fill",children:(0,E.jsx)("div",{id:o,className:s,style:{width:a?"100vw":280},children:i})})})})}const ge=ee((function({children:e,className:t,closeLabel:r=(0,y.__)("Close plugin"),identifier:i,header:s,headerClassName:o,icon:n,isPinnable:a=!0,panelClassName:c,scope:d,name:u,smallScreenTitle:g,title:h,toggleShortcut:m,isActiveByDefault:_}){const[b,f]=(0,p.useState)(!1),{isLoading:x,isActive:v,isPinned:k,activeArea:A,isSmall:T,isLarge:L,showIconLabels:R}=(0,l.useSelect)((e=>{const{getActiveComplementaryArea:t,isComplementaryAreaLoading:r,isItemPinned:s}=e(Q),{get:o}=e(w.store),n=t(d);return{isLoading:r(d),isActive:n===i,isPinned:s(d,i),activeArea:n,isSmall:e(B.store).isViewportMatch("< medium"),isLarge:e(B.store).isViewportMatch("large"),showIconLabels:o("core","showIconLabels")}}),[i,d]);!function(e,t,r,i,s){const o=(0,p.useRef)(!1),n=(0,p.useRef)(!1),{enableComplementaryArea:a,disableComplementaryArea:c}=(0,l.useDispatch)(Q);(0,p.useEffect)((()=>{i&&s&&!o.current?(c(e),n.current=!0):n.current&&!s&&o.current?(n.current=!1,a(e,t)):n.current&&r&&r!==t&&(n.current=!1),s!==o.current&&(o.current=s)}),[i,s,e,t,r,c,a])}(d,i,A,v,T);const{enableComplementaryArea:W,disableComplementaryArea:P,pinItem:M,unpinItem:O}=(0,l.useDispatch)(Q);if((0,p.useEffect)((()=>{_&&void 0===A&&!T?W(d,i):void 0===A&&T&&P(d,i),f(!0)}),[A,_,d,i,T,W,P]),b)return(0,E.jsxs)(E.Fragment,{children:[a&&(0,E.jsx)(de,{scope:d,children:k&&(0,E.jsx)(te,{scope:d,identifier:i,isPressed:v&&(!R||L),"aria-expanded":v,"aria-disabled":x,label:h,icon:R?I:n,showTooltip:!R,variant:R?"tertiary":void 0,size:"compact",shortcut:m})}),u&&a&&(0,E.jsx)(ae,{target:u,scope:d,icon:n,children:h}),(0,E.jsxs)(ue,{activeArea:A,isActive:v,className:j("interface-complementary-area",t),scope:d,id:i.replace("/",":"),children:[(0,E.jsx)(re,{className:o,closeLabel:r,onClose:()=>P(d),smallScreenTitle:g,toggleButtonProps:{label:r,size:"small",shortcut:m,scope:d,identifier:i},children:s||(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("h2",{className:"interface-complementary-area-header__title",children:h}),a&&(0,E.jsx)(S.Button,{className:"interface-complementary-area__pin-unpin-item",icon:k?C:N,label:k?(0,y.__)("Unpin from toolbar"):(0,y.__)("Pin to toolbar"),onClick:()=>(k?O:M)(d,i),isPressed:k,"aria-expanded":k,size:"compact"})]})}),(0,E.jsx)(S.Panel,{className:c,children:e})]})]})}));ge.Slot=function({scope:e,...t}){return(0,E.jsx)(S.Slot,{name:`ComplementaryArea/${e}`,...t})};const pe=ge,he=(0,p.forwardRef)((({children:e,className:t,ariaLabel:r,as:i="div",...s},o)=>(0,E.jsx)(i,{ref:o,className:j("interface-navigable-region",t),"aria-label":r,role:"region",tabIndex:"-1",...s,children:e})));he.displayName="NavigableRegion";const me=he,_e={type:"tween",duration:.25,ease:[.6,0,.4,1]};const we={hidden:{opacity:1,marginTop:-60},visible:{opacity:1,marginTop:0},distractionFreeHover:{opacity:1,marginTop:0,transition:{..._e,delay:.2,delayChildren:.2}},distractionFreeHidden:{opacity:0,marginTop:-60},distractionFreeDisabled:{opacity:0,marginTop:0,transition:{..._e,delay:.8,delayChildren:.8}}};const be=(0,p.forwardRef)((function({isDistractionFree:e,footer:t,header:r,editorNotices:i,sidebar:s,secondarySidebar:o,content:n,actions:a,labels:c,className:d},l){const[u,g]=(0,T.useResizeObserver)(),h=(0,T.useViewportMatch)("medium","<"),m={type:"tween",duration:(0,T.useReducedMotion)()?0:.25,ease:[.6,0,.4,1]};!function(e){(0,p.useEffect)((()=>{const t=document&&document.querySelector(`html:not(.${e})`);if(t)return t.classList.toggle(e),()=>{t.classList.toggle(e)}}),[e])}("interface-interface-skeleton__html-container");const _={...{header:(0,y._x)("Header","header landmark area"),body:(0,y.__)("Content"),secondarySidebar:(0,y.__)("Block Library"),sidebar:(0,y._x)("Settings","settings landmark area"),actions:(0,y.__)("Publish"),footer:(0,y.__)("Footer")},...c};return(0,E.jsxs)("div",{ref:l,className:j(d,"interface-interface-skeleton",!!t&&"has-footer"),children:[(0,E.jsxs)("div",{className:"interface-interface-skeleton__editor",children:[(0,E.jsx)(S.__unstableAnimatePresence,{initial:!1,children:!!r&&(0,E.jsx)(me,{as:S.__unstableMotion.div,className:"interface-interface-skeleton__header","aria-label":_.header,initial:e&&!h?"distractionFreeHidden":"hidden",whileHover:e&&!h?"distractionFreeHover":"visible",animate:e&&!h?"distractionFreeDisabled":"visible",exit:e&&!h?"distractionFreeHidden":"hidden",variants:we,transition:m,children:r})}),e&&(0,E.jsx)("div",{className:"interface-interface-skeleton__header",children:i}),(0,E.jsxs)("div",{className:"interface-interface-skeleton__body",children:[(0,E.jsx)(S.__unstableAnimatePresence,{initial:!1,children:!!o&&(0,E.jsx)(me,{className:"interface-interface-skeleton__secondary-sidebar",ariaLabel:_.secondarySidebar,as:S.__unstableMotion.div,initial:"closed",animate:"open",exit:"closed",variants:{open:{width:g.width},closed:{width:0}},transition:m,children:(0,E.jsxs)(S.__unstableMotion.div,{style:{position:"absolute",width:h?"100vw":"fit-content",height:"100%",left:0},variants:{open:{x:0},closed:{x:"-100%"}},transition:m,children:[u,o]})})}),(0,E.jsx)(me,{className:"interface-interface-skeleton__content",ariaLabel:_.body,children:n}),!!s&&(0,E.jsx)(me,{className:"interface-interface-skeleton__sidebar",ariaLabel:_.sidebar,children:s}),!!a&&(0,E.jsx)(me,{className:"interface-interface-skeleton__actions",ariaLabel:_.actions,children:a})]})]}),!!t&&(0,E.jsx)(me,{className:"interface-interface-skeleton__footer",ariaLabel:_.footer,children:t})]})})),fe=window.wp.blockEditor;function xe(e){if("block"===e.id_base){const t=(0,d.parse)(e.instance.raw.content,{__unstableSkipAutop:!0});return t.length?(0,_.addWidgetIdToBlock)(t[0],e.id):(0,_.addWidgetIdToBlock)((0,d.createBlock)("core/paragraph",{},[]),e.id)}let t;return t=e._embedded.about[0].is_multi?{idBase:e.id_base,instance:e.instance}:{id:e.id},(0,_.addWidgetIdToBlock)((0,d.createBlock)("core/legacy-widget",t,[]),e.id)}function ye(e,t={}){let r;var i,s,o;"core/legacy-widget"===e.name&&(e.attributes.id||e.attributes.instance)?r={...t,id:null!==(i=e.attributes.id)&&void 0!==i?i:t.id,id_base:null!==(s=e.attributes.idBase)&&void 0!==s?s:t.id_base,instance:null!==(o=e.attributes.instance)&&void 0!==o?o:t.instance}:r={...t,id_base:"block",instance:{raw:{content:(0,d.serialize)(e)}}};return delete r.rendered,delete r.rendered_form,r}const ve="root",ke="sidebar",je="postType",Se=e=>`widget-area-${e}`;const Ae="core/edit-widgets",Ee=(e,t)=>({registry:r})=>{const i=((e,t)=>({id:e,slug:e,status:"draft",type:"page",blocks:t,meta:{widgetAreaId:e}}))(e,t);return r.dispatch(m.store).receiveEntityRecords(ve,je,i,{id:i.id},!1),i},Ie=()=>async({select:e,dispatch:t,registry:r})=>{const i=e.getEditedWidgetAreas();if(i?.length)try{await t.saveWidgetAreas(i),r.dispatch(v.store).createSuccessNotice((0,y.__)("Widgets saved."),{type:"snackbar"})}catch(e){r.dispatch(v.store).createErrorNotice((0,y.sprintf)((0,y.__)("There was an error. %s"),e.message),{type:"snackbar"})}},Ce=e=>async({dispatch:t,registry:r})=>{try{for(const r of e)await t.saveWidgetArea(r.id)}finally{await r.dispatch(m.store).finishResolution("getEntityRecord",ve,ke,{per_page:-1})}},Ne=e=>async({dispatch:t,select:r,registry:i})=>{const s=r.getWidgets(),o=i.select(m.store).getEditedEntityRecord(ve,je,Se(e)),n=Object.values(s).filter((({sidebar:t})=>t===e)),a=[],c=o.blocks.filter((e=>{const{id:t}=e.attributes;if("core/legacy-widget"===e.name&&t){if(a.includes(t))return!1;a.push(t)}return!0})),d=[];for(const e of n){r.getWidgetAreaForWidgetId(e.id)||d.push(e)}const l=[],u=[],g=[];for(let t=0;te("root","widget",o)))}else u.push((({saveEntityRecord:t})=>t("root","widget",{...a,sidebar:e})));l.push({block:r,position:t,clientId:r.clientId})}for(const e of d)u.push((({deleteEntityRecord:t})=>t("root","widget",e.id,{force:!0})));const p=(await i.dispatch(m.store).__experimentalBatch(u)).filter((e=>!e.hasOwnProperty("deleted"))),h=[];for(let e=0;e({registry:t})=>{t.dispatch(m.store).saveEditedEntityRecord(ve,ke,e,{throwOnError:!0})};function Te(e,t){return{type:"SET_WIDGET_ID_FOR_CLIENT_ID",clientId:e,widgetId:t}}function Le(e){return{type:"SET_WIDGET_AREAS_OPEN_STATE",widgetAreasOpenState:e}}function Re(e,t){return{type:"SET_IS_WIDGET_AREA_OPEN",clientId:e,isOpen:t}}function We(e){return{type:"SET_IS_INSERTER_OPENED",value:e}}function Pe(e){return{type:"SET_IS_LIST_VIEW_OPENED",isOpen:e}}const Me=()=>({registry:e})=>{e.dispatch(Q).disableComplementaryArea(Ae)},Oe=(e,t)=>async({dispatch:r,select:i,registry:s})=>{const o=s.select(fe.store).getBlockRootClientId(e),n=s.select(fe.store).getBlocks().find((({attributes:e})=>e.id===t)).clientId,a=s.select(fe.store).getBlockOrder(n).length;i.getIsWidgetAreaOpen(n)||r.setIsWidgetAreaOpen(n,!0),s.dispatch(fe.store).moveBlocksToPosition([e],o,n,a)},Ve=()=>async({dispatch:e,registry:t})=>{const r={per_page:-1},i=[],s=(await t.resolveSelect(m.store).getEntityRecords(ve,ke,r)).sort(((e,t)=>"wp_inactive_widgets"===e.id?1:"wp_inactive_widgets"===t.id?-1:0));for(const t of s)i.push((0,d.createBlock)("core/widget-area",{id:t.id,name:t.name})),t.widgets.length||e(Ee(Se(t.id),[]));const o={};i.forEach(((e,t)=>{o[e.clientId]=0===t})),e(Le(o)),e(Ee("widget-areas",i))},De=()=>async({dispatch:e,registry:t})=>{const r={per_page:-1,_embed:"about"},i=await t.resolveSelect(m.store).getEntityRecords("root","widget",r),s={};for(const e of i){const t=xe(e);s[e.sidebar]=s[e.sidebar]||[],s[e.sidebar].push(t)}for(const t in s)s.hasOwnProperty(t)&&e(Ee(Se(t),s[t]))},Fe={rootClientId:void 0,insertionIndex:void 0},Ge=(0,l.createRegistrySelector)((e=>(0,l.createSelector)((()=>{var t;const r=e(m.store).getEntityRecords("root","widget",{per_page:-1,_embed:"about"});return null!==(t=r?.reduce(((e,t)=>({...e,[t.id]:t})),{}))&&void 0!==t?t:{}}),(()=>[e(m.store).getEntityRecords("root","widget",{per_page:-1,_embed:"about"})])))),ze=(0,l.createRegistrySelector)((e=>(t,r)=>e(Ae).getWidgets()[r])),He=(0,l.createRegistrySelector)((e=>()=>{const t={per_page:-1};return e(m.store).getEntityRecords(ve,ke,t)})),Ue=(0,l.createRegistrySelector)((e=>(t,r)=>e(Ae).getWidgetAreas().find((t=>e(m.store).getEditedEntityRecord(ve,je,Se(t.id)).blocks.map((e=>(0,_.getWidgetIdFromBlock)(e))).includes(r))))),$e=(0,l.createRegistrySelector)((e=>(t,r)=>{const{getBlock:i,getBlockName:s,getBlockParents:o}=e(fe.store);return i(o(r).find((e=>"core/widget-area"===s(e))))})),Ye=(0,l.createRegistrySelector)((e=>(t,r)=>{let i=e(Ae).getWidgetAreas();return i?(r&&(i=i.filter((({id:e})=>r.includes(e)))),i.filter((({id:t})=>e(m.store).hasEditsForEntityRecord(ve,je,Se(t)))).map((({id:t})=>e(m.store).getEditedEntityRecord(ve,ke,t)))):[]})),Ze=(0,l.createRegistrySelector)((e=>(t,r=null)=>{const i=[],s=e(Ae).getWidgetAreas();for(const t of s){const s=e(m.store).getEditedEntityRecord(ve,je,Se(t.id));for(const e of s.blocks)"core/legacy-widget"!==e.name||r&&e.attributes?.referenceWidgetName!==r||i.push(e)}return i})),Ke=(0,l.createRegistrySelector)((e=>()=>{const t=e(Ae).getWidgetAreas()?.map((({id:e})=>e));if(!t)return!1;for(const r of t){if(e(m.store).isSavingEntityRecord(ve,ke,r))return!0}const r=[...Object.keys(e(Ae).getWidgets()),void 0];for(const t of r){if(e(m.store).isSavingEntityRecord("root","widget",t))return!0}return!1})),qe=(e,t)=>{const{widgetAreasOpenState:r}=e;return!!r[t]};function Je(e){return!!e.blockInserterPanel}function Qe(e){return"boolean"==typeof e.blockInserterPanel?Fe:e.blockInserterPanel}const Xe=(0,l.createRegistrySelector)((e=>(t,r)=>{const i=e(fe.store).getBlocks(),[s]=i;return e(fe.store).canInsertBlockType(r,s.clientId)}));function et(e){return e.listViewPanel}function tt(e){return e.listViewToggleRef}function rt(e){return e.inserterSidebarToggleRef}const it=window.wp.privateApis,{lock:st,unlock:ot}=(0,it.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/edit-widgets"),nt={reducer:x,selectors:n,resolvers:o,actions:s},at=(0,l.createReduxStore)(Ae,nt);(0,l.register)(at),f().use((function(e,t){return 0===e.path?.indexOf("/wp/v2/types/widget-area")?Promise.resolve({}):t(e)})),ot(at).registerPrivateSelectors(a);const ct=window.wp.hooks,dt=(0,T.createHigherOrderComponent)((e=>t=>{const{clientId:r,name:i}=t,{widgetAreas:s,currentWidgetAreaId:o,canInsertBlockInWidgetArea:n}=(0,l.useSelect)((e=>{if("core/widget-area"===i)return{};const t=e(at),s=t.getParentWidgetAreaBlock(r);return{widgetAreas:t.getWidgetAreas(),currentWidgetAreaId:s?.attributes?.id,canInsertBlockInWidgetArea:t.canInsertBlockInWidgetArea(i)}}),[r,i]),{moveBlockToWidgetArea:a}=(0,l.useDispatch)(at),c="core/widget-area"!==i&&s?.length>1&&n;return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(e,{...t},"edit"),c&&(0,E.jsx)(fe.BlockControls,{children:(0,E.jsx)(_.MoveToWidgetArea,{widgetAreas:s,currentWidgetAreaId:o,onSelect:e=>{a(t.clientId,e)}})})]})}),"withMoveToWidgetAreaToolbarItem");(0,ct.addFilter)("editor.BlockEdit","core/edit-widgets/block-edit",dt);const lt=window.wp.mediaUtils;(0,ct.addFilter)("editor.MediaUpload","core/edit-widgets/replace-media-upload",(()=>lt.MediaUpload));const ut=e=>{const[t,r]=(0,p.useState)(!1);return(0,p.useEffect)((()=>{const{ownerDocument:t}=e.current;function i(e){o(e)}function s(){r(!1)}function o(t){e.current.contains(t.target)?r(!0):r(!1)}return t.addEventListener("dragstart",i),t.addEventListener("dragend",s),t.addEventListener("dragenter",o),()=>{t.removeEventListener("dragstart",i),t.removeEventListener("dragend",s),t.removeEventListener("dragenter",o)}}),[]),t};function gt({id:e}){const[t,r,i]=(0,m.useEntityBlockEditor)("root","postType"),s=(0,p.useRef)(),o=ut(s),n=(0,fe.useInnerBlocksProps)({ref:s},{value:t,onInput:r,onChange:i,templateLock:!1,renderAppender:fe.InnerBlocks.ButtonBlockAppender});return(0,E.jsx)("div",{"data-widget-area-id":e,className:j("wp-block-widget-area__inner-blocks block-editor-inner-blocks editor-styles-wrapper",{"wp-block-widget-area__highlight-drop-zone":o}),children:(0,E.jsx)("div",{...n})})}const pt=e=>{const[t,r]=(0,p.useState)(!1);return(0,p.useEffect)((()=>{const{ownerDocument:t}=e.current;function i(){r(!0)}function s(){r(!1)}return t.addEventListener("dragstart",i),t.addEventListener("dragend",s),()=>{t.removeEventListener("dragstart",i),t.removeEventListener("dragend",s)}}),[]),t},ht={$schema:"https://schemas.wp.org/trunk/block.json",name:"core/widget-area",title:"Widget Area",category:"widgets",attributes:{id:{type:"string"},name:{type:"string"}},supports:{html:!1,inserter:!1,customClassName:!1,reusable:!1,__experimentalToolbar:!1,__experimentalParentSelector:!1,__experimentalDisableBlockOverlay:!0},editorStyle:"wp-block-widget-area-editor",style:"wp-block-widget-area"},{name:mt}=ht,_t={title:(0,y.__)("Widget Area"),description:(0,y.__)("A widget area container."),__experimentalLabel:({name:e})=>e,edit:function({clientId:e,className:t,attributes:{id:r,name:i}}){const s=(0,l.useSelect)((t=>t(at).getIsWidgetAreaOpen(e)),[e]),{setIsWidgetAreaOpen:o}=(0,l.useDispatch)(at),n=(0,p.useRef)(),a=(0,p.useCallback)((t=>o(e,t)),[e]),c=pt(n),d=ut(n),[u,g]=(0,p.useState)(!1);return(0,p.useEffect)((()=>{c?d&&!s?(a(!0),g(!0)):!d&&s&&u&&a(!1):g(!1)}),[s,c,d,u]),(0,E.jsx)(S.Panel,{className:t,ref:n,children:(0,E.jsx)(S.PanelBody,{title:i,opened:s,onToggle:()=>{o(e,!s)},scrollAfterOpen:!c,children:({opened:e})=>(0,E.jsx)(S.__unstableDisclosureContent,{className:"wp-block-widget-area__panel-body-content",visible:e,children:(0,E.jsx)(m.EntityProvider,{kind:"root",type:"postType",id:`widget-area-${r}`,children:(0,E.jsx)(gt,{id:r})})})})})}};function wt({text:e,children:t}){const r=(0,T.useCopyToClipboard)(e);return(0,E.jsx)(S.Button,{__next40pxDefaultSize:!0,variant:"secondary",ref:r,children:t})}function bt({message:e,error:t}){const r=[(0,E.jsx)(wt,{text:t.stack,children:(0,y.__)("Copy Error")},"copy-error")];return(0,E.jsx)(fe.Warning,{className:"edit-widgets-error-boundary",actions:r,children:e})}class ft extends p.Component{constructor(){super(...arguments),this.state={error:null}}componentDidCatch(e){(0,ct.doAction)("editor.ErrorBoundary.errorLogged",e)}static getDerivedStateFromError(e){return{error:e}}render(){return this.state.error?(0,E.jsx)(bt,{message:(0,y.__)("The editor has encountered an unexpected error."),error:this.state.error}):this.props.children}}const xt=window.wp.patterns,yt=window.wp.keyboardShortcuts,vt=window.wp.keycodes;function kt(){const{redo:e,undo:t}=(0,l.useDispatch)(m.store),{saveEditedWidgetAreas:r}=(0,l.useDispatch)(at);return(0,yt.useShortcut)("core/edit-widgets/undo",(e=>{t(),e.preventDefault()})),(0,yt.useShortcut)("core/edit-widgets/redo",(t=>{e(),t.preventDefault()})),(0,yt.useShortcut)("core/edit-widgets/save",(e=>{e.preventDefault(),r()})),null}kt.Register=function(){const{registerShortcut:e}=(0,l.useDispatch)(yt.store);return(0,p.useEffect)((()=>{e({name:"core/edit-widgets/undo",category:"global",description:(0,y.__)("Undo your last changes."),keyCombination:{modifier:"primary",character:"z"}}),e({name:"core/edit-widgets/redo",category:"global",description:(0,y.__)("Redo your last undo."),keyCombination:{modifier:"primaryShift",character:"z"},aliases:(0,vt.isAppleOS)()?[]:[{modifier:"primary",character:"y"}]}),e({name:"core/edit-widgets/save",category:"global",description:(0,y.__)("Save your changes."),keyCombination:{modifier:"primary",character:"s"}}),e({name:"core/edit-widgets/keyboard-shortcuts",category:"main",description:(0,y.__)("Display these keyboard shortcuts."),keyCombination:{modifier:"access",character:"h"}}),e({name:"core/edit-widgets/next-region",category:"global",description:(0,y.__)("Navigate to the next part of the editor."),keyCombination:{modifier:"ctrl",character:"`"},aliases:[{modifier:"access",character:"n"}]}),e({name:"core/edit-widgets/previous-region",category:"global",description:(0,y.__)("Navigate to the previous part of the editor."),keyCombination:{modifier:"ctrlShift",character:"`"},aliases:[{modifier:"access",character:"p"},{modifier:"ctrlShift",character:"~"}]})}),[e]),null};const jt=kt,St=()=>(0,l.useSelect)((e=>{const{getBlockSelectionEnd:t,getBlockName:r}=e(fe.store),i=t();if("core/widget-area"===r(i))return i;const{getParentWidgetAreaBlock:s}=e(at),o=s(i),n=o?.clientId;if(n)return n;const{getEntityRecord:a}=e(m.store),c=a(ve,je,"widget-areas");return c?.blocks[0]?.clientId}),[]),{ExperimentalBlockEditorProvider:At}=ot(fe.privateApis),{PatternsMenuItems:Et}=ot(xt.privateApis),{BlockKeyboardShortcuts:It}=ot(h.privateApis),Ct=[];function Nt({blockEditorSettings:e,children:t,...r}){const i=(0,T.useViewportMatch)("medium"),{hasUploadPermissions:s,reusableBlocks:o,isFixedToolbarActive:n,keepCaretInsideBlock:a,pageOnFront:c,pageForPosts:d}=(0,l.useSelect)((e=>{var t;const{canUser:r,getEntityRecord:i,getEntityRecords:s}=e(m.store),o=r("read",{kind:"root",name:"site"})?i("root","site"):void 0;return{hasUploadPermissions:null===(t=r("create",{kind:"root",name:"media"}))||void 0===t||t,reusableBlocks:Ct,isFixedToolbarActive:!!e(w.store).get("core/edit-widgets","fixedToolbar"),keepCaretInsideBlock:!!e(w.store).get("core/edit-widgets","keepCaretInsideBlock"),pageOnFront:o?.page_on_front,pageForPosts:o?.page_for_posts}}),[]),{setIsInserterOpened:u}=(0,l.useDispatch)(at),g=(0,p.useMemo)((()=>{let t;return s&&(t=({onError:t,...r})=>{(0,lt.uploadMedia)({wpAllowedMimeTypes:e.allowedMimeTypes,onError:({message:e})=>t(e),...r})}),{...e,__experimentalReusableBlocks:o,hasFixedToolbar:n||!i,keepCaretInsideBlock:a,mediaUpload:t,templateLock:"all",__experimentalSetIsInserterOpened:u,pageOnFront:c,pageForPosts:d}}),[s,e,n,i,a,o,u,c,d]),h=St(),[_,b,f]=(0,m.useEntityBlockEditor)(ve,je,{id:"widget-areas"});return(0,E.jsxs)(S.SlotFillProvider,{children:[(0,E.jsx)(jt.Register,{}),(0,E.jsx)(It,{}),(0,E.jsxs)(At,{value:_,onInput:b,onChange:f,settings:g,useSubRegistry:!1,...r,children:[t,(0,E.jsx)(Et,{rootClientId:h})]})]})}const Bt=(0,E.jsx)(A.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,E.jsx)(A.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zM8.5 18.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h2.5v13zm10-.5c0 .3-.2.5-.5.5h-8v-13h8c.3 0 .5.2.5.5v12z"})}),Tt=(0,E.jsx)(A.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,E.jsx)(A.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4 14.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h8v13zm4.5-.5c0 .3-.2.5-.5.5h-2.5v-13H18c.3 0 .5.2.5.5v12z"})}),Lt=(0,E.jsx)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,E.jsx)(A.Path,{d:"M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z"})}),Rt=window.wp.url,Wt=window.wp.dom;function Pt({selectedWidgetAreaId:e}){const t=(0,l.useSelect)((e=>e(at).getWidgetAreas()),[]),r=(0,p.useMemo)((()=>e&&t?.find((t=>t.id===e))),[e,t]);let i;return i=r?"wp_inactive_widgets"===e?(0,y.__)("Blocks in this Widget Area will not be displayed in your site."):r.description:(0,y.__)("Widget Areas are global parts in your site’s layout that can accept blocks. These vary by theme, but are typically parts like your Sidebar or Footer."),(0,E.jsx)("div",{className:"edit-widgets-widget-areas",children:(0,E.jsxs)("div",{className:"edit-widgets-widget-areas__top-container",children:[(0,E.jsx)(fe.BlockIcon,{icon:Lt}),(0,E.jsxs)("div",{children:[(0,E.jsx)("p",{dangerouslySetInnerHTML:{__html:(0,Wt.safeHTML)(i)}}),0===t?.length&&(0,E.jsx)("p",{children:(0,y.__)("Your theme does not contain any Widget Areas.")}),!r&&(0,E.jsx)(S.Button,{__next40pxDefaultSize:!0,href:(0,Rt.addQueryArgs)("customize.php",{"autofocus[panel]":"widgets",return:window.location.pathname}),variant:"tertiary",children:(0,y.__)("Manage with live preview")})]})]})})}const Mt=p.Platform.select({web:!0,native:!1}),Ot="edit-widgets/block-inspector",Vt="edit-widgets/block-areas",{Tabs:Dt}=ot(S.privateApis);function Ft({selectedWidgetAreaBlock:e}){return(0,E.jsxs)(Dt.TabList,{children:[(0,E.jsx)(Dt.Tab,{tabId:Vt,children:e?e.attributes.name:(0,y.__)("Widget Areas")}),(0,E.jsx)(Dt.Tab,{tabId:Ot,children:(0,y.__)("Block")})]})}function Gt({hasSelectedNonAreaBlock:e,currentArea:t,isGeneralSidebarOpen:r,selectedWidgetAreaBlock:i}){const{enableComplementaryArea:s}=(0,l.useDispatch)(Q);(0,p.useEffect)((()=>{e&&t===Vt&&r&&s("core/edit-widgets",Ot),!e&&t===Ot&&r&&s("core/edit-widgets",Vt)}),[e,s]);const o=(0,p.useContext)(Dt.Context);return(0,E.jsx)(pe,{className:"edit-widgets-sidebar",header:(0,E.jsx)(Dt.Context.Provider,{value:o,children:(0,E.jsx)(Ft,{selectedWidgetAreaBlock:i})}),headerClassName:"edit-widgets-sidebar__panel-tabs",title:(0,y.__)("Settings"),closeLabel:(0,y.__)("Close Settings"),scope:"core/edit-widgets",identifier:t,icon:(0,y.isRTL)()?Bt:Tt,isActiveByDefault:Mt,children:(0,E.jsxs)(Dt.Context.Provider,{value:o,children:[(0,E.jsx)(Dt.TabPanel,{tabId:Vt,focusable:!1,children:(0,E.jsx)(Pt,{selectedWidgetAreaId:i?.attributes.id})}),(0,E.jsx)(Dt.TabPanel,{tabId:Ot,focusable:!1,children:e?(0,E.jsx)(fe.BlockInspector,{}):(0,E.jsx)("span",{className:"block-editor-block-inspector__no-blocks",children:(0,y.__)("No block selected.")})})]})})}function zt(){const{currentArea:e,hasSelectedNonAreaBlock:t,isGeneralSidebarOpen:r,selectedWidgetAreaBlock:i}=(0,l.useSelect)((e=>{const{getSelectedBlock:t,getBlock:r,getBlockParentsByBlockName:i}=e(fe.store),{getActiveComplementaryArea:s}=e(Q),o=t(),n=s(at.name);let a,c=n;return c||(c=o?Ot:Vt),o&&(a="core/widget-area"===o.name?o:r(i(o.clientId,"core/widget-area")[0])),{currentArea:c,hasSelectedNonAreaBlock:!(!o||"core/widget-area"===o.name),isGeneralSidebarOpen:!!n,selectedWidgetAreaBlock:a}}),[]),{enableComplementaryArea:s}=(0,l.useDispatch)(Q),o=(0,p.useCallback)((e=>{e&&s(at.name,e)}),[s]);return(0,E.jsx)(Dt,{selectedTabId:r?e:null,onSelect:o,selectOnMove:!1,children:(0,E.jsx)(Gt,{hasSelectedNonAreaBlock:t,currentArea:e,isGeneralSidebarOpen:r,selectedWidgetAreaBlock:i})})}const Ht=(0,E.jsx)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,E.jsx)(A.Path,{d:"M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z"})}),Ut=(0,E.jsx)(A.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,E.jsx)(A.Path,{d:"M3 6h11v1.5H3V6Zm3.5 5.5h11V13h-11v-1.5ZM21 17H10v1.5h11V17Z"})}),$t=(0,E.jsx)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,E.jsx)(A.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"})}),Yt=(0,E.jsx)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,E.jsx)(A.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"})});const Zt=(0,p.forwardRef)((function(e,t){const r=(0,l.useSelect)((e=>e(m.store).hasUndo()),[]),{undo:i}=(0,l.useDispatch)(m.store);return(0,E.jsx)(S.Button,{...e,ref:t,icon:(0,y.isRTL)()?Yt:$t,label:(0,y.__)("Undo"),shortcut:vt.displayShortcut.primary("z"),"aria-disabled":!r,onClick:r?i:void 0,size:"compact"})}));const Kt=(0,p.forwardRef)((function(e,t){const r=(0,vt.isAppleOS)()?vt.displayShortcut.primaryShift("z"):vt.displayShortcut.primary("y"),i=(0,l.useSelect)((e=>e(m.store).hasRedo()),[]),{redo:s}=(0,l.useDispatch)(m.store);return(0,E.jsx)(S.Button,{...e,ref:t,icon:(0,y.isRTL)()?$t:Yt,label:(0,y.__)("Redo"),shortcut:r,"aria-disabled":!i,onClick:i?s:void 0,size:"compact"})}));const qt=function(){const e=(0,T.useViewportMatch)("medium"),{isInserterOpen:t,isListViewOpen:r,inserterSidebarToggleRef:i,listViewToggleRef:s}=(0,l.useSelect)((e=>{const{isInserterOpened:t,getInserterSidebarToggleRef:r,isListViewOpened:i,getListViewToggleRef:s}=ot(e(at));return{isInserterOpen:t(),isListViewOpen:i(),inserterSidebarToggleRef:r(),listViewToggleRef:s()}}),[]),{setIsInserterOpened:o,setIsListViewOpened:n}=(0,l.useDispatch)(at),a=(0,p.useCallback)((()=>n(!r)),[n,r]),c=(0,p.useCallback)((()=>o(!t)),[o,t]);return(0,E.jsxs)(fe.NavigableToolbar,{className:"edit-widgets-header-toolbar","aria-label":(0,y.__)("Document tools"),variant:"unstyled",children:[(0,E.jsx)(S.ToolbarItem,{ref:i,as:S.Button,className:"edit-widgets-header-toolbar__inserter-toggle",variant:"primary",isPressed:t,onMouseDown:e=>{e.preventDefault()},onClick:c,icon:Ht,label:(0,y._x)("Toggle block inserter","Generic label for block inserter button"),size:"compact"}),e&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(S.ToolbarItem,{as:Zt}),(0,E.jsx)(S.ToolbarItem,{as:Kt}),(0,E.jsx)(S.ToolbarItem,{as:S.Button,className:"edit-widgets-header-toolbar__list-view-toggle",icon:Ut,isPressed:r,label:(0,y.__)("List View"),onClick:a,ref:s,size:"compact"})]})]})};const Jt=function(){const{hasEditedWidgetAreaIds:e,isSaving:t}=(0,l.useSelect)((e=>{const{getEditedWidgetAreas:t,isSavingWidgetAreas:r}=e(at);return{hasEditedWidgetAreaIds:t()?.length>0,isSaving:r()}}),[]),{saveEditedWidgetAreas:r}=(0,l.useDispatch)(at),i=t||!e;return(0,E.jsx)(S.Button,{variant:"primary",isBusy:t,"aria-disabled":i,onClick:i?void 0:r,size:"compact",children:t?(0,y.__)("Saving…"):(0,y.__)("Update")})},Qt=(0,E.jsx)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,E.jsx)(A.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"})}),Xt=(0,E.jsx)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,E.jsx)(A.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"})}),er=[{keyCombination:{modifier:"primary",character:"b"},description:(0,y.__)("Make the selected text bold.")},{keyCombination:{modifier:"primary",character:"i"},description:(0,y.__)("Make the selected text italic.")},{keyCombination:{modifier:"primary",character:"k"},description:(0,y.__)("Convert the selected text into a link.")},{keyCombination:{modifier:"primaryShift",character:"k"},description:(0,y.__)("Remove a link.")},{keyCombination:{character:"[["},description:(0,y.__)("Insert a link to a post or page.")},{keyCombination:{modifier:"primary",character:"u"},description:(0,y.__)("Underline the selected text.")},{keyCombination:{modifier:"access",character:"d"},description:(0,y.__)("Strikethrough the selected text.")},{keyCombination:{modifier:"access",character:"x"},description:(0,y.__)("Make the selected text inline code.")},{keyCombination:{modifier:"access",character:"0"},aliases:[{modifier:"access",character:"7"}],description:(0,y.__)("Convert the current heading to a paragraph.")},{keyCombination:{modifier:"access",character:"1-6"},description:(0,y.__)("Convert the current paragraph or heading to a heading of level 1 to 6.")},{keyCombination:{modifier:"primaryShift",character:"SPACE"},description:(0,y.__)("Add non breaking space.")}];function tr({keyCombination:e,forceAriaLabel:t}){const r=e.modifier?vt.displayShortcutList[e.modifier](e.character):e.character,i=e.modifier?vt.shortcutAriaLabel[e.modifier](e.character):e.character,s=Array.isArray(r)?r:[r];return(0,E.jsx)("kbd",{className:"edit-widgets-keyboard-shortcut-help-modal__shortcut-key-combination","aria-label":t||i,children:s.map(((e,t)=>"+"===e?(0,E.jsx)(p.Fragment,{children:e},t):(0,E.jsx)("kbd",{className:"edit-widgets-keyboard-shortcut-help-modal__shortcut-key",children:e},t)))})}const rr=function({description:e,keyCombination:t,aliases:r=[],ariaLabel:i}){return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("div",{className:"edit-widgets-keyboard-shortcut-help-modal__shortcut-description",children:e}),(0,E.jsxs)("div",{className:"edit-widgets-keyboard-shortcut-help-modal__shortcut-term",children:[(0,E.jsx)(tr,{keyCombination:t,forceAriaLabel:i}),r.map(((e,t)=>(0,E.jsx)(tr,{keyCombination:e,forceAriaLabel:i},t)))]})]})};const ir=function({name:e}){const{keyCombination:t,description:r,aliases:i}=(0,l.useSelect)((t=>{const{getShortcutKeyCombination:r,getShortcutDescription:i,getShortcutAliases:s}=t(yt.store);return{keyCombination:r(e),aliases:s(e),description:i(e)}}),[e]);return t?(0,E.jsx)(rr,{keyCombination:t,description:r,aliases:i}):null},sr=({shortcuts:e})=>(0,E.jsx)("ul",{className:"edit-widgets-keyboard-shortcut-help-modal__shortcut-list",role:"list",children:e.map(((e,t)=>(0,E.jsx)("li",{className:"edit-widgets-keyboard-shortcut-help-modal__shortcut",children:"string"==typeof e?(0,E.jsx)(ir,{name:e}):(0,E.jsx)(rr,{...e})},t)))}),or=({title:e,shortcuts:t,className:r})=>(0,E.jsxs)("section",{className:j("edit-widgets-keyboard-shortcut-help-modal__section",r),children:[!!e&&(0,E.jsx)("h2",{className:"edit-widgets-keyboard-shortcut-help-modal__section-title",children:e}),(0,E.jsx)(sr,{shortcuts:t})]}),nr=({title:e,categoryName:t,additionalShortcuts:r=[]})=>{const i=(0,l.useSelect)((e=>e(yt.store).getCategoryShortcuts(t)),[t]);return(0,E.jsx)(or,{title:e,shortcuts:i.concat(r)})};function ar({isModalActive:e,toggleModal:t}){return(0,yt.useShortcut)("core/edit-widgets/keyboard-shortcuts",t,{bindGlobal:!0}),e?(0,E.jsxs)(S.Modal,{className:"edit-widgets-keyboard-shortcut-help-modal",title:(0,y.__)("Keyboard shortcuts"),onRequestClose:t,children:[(0,E.jsx)(or,{className:"edit-widgets-keyboard-shortcut-help-modal__main-shortcuts",shortcuts:["core/edit-widgets/keyboard-shortcuts"]}),(0,E.jsx)(nr,{title:(0,y.__)("Global shortcuts"),categoryName:"global"}),(0,E.jsx)(nr,{title:(0,y.__)("Selection shortcuts"),categoryName:"selection"}),(0,E.jsx)(nr,{title:(0,y.__)("Block shortcuts"),categoryName:"block",additionalShortcuts:[{keyCombination:{character:"/"},description:(0,y.__)("Change the block type after adding a new paragraph."),ariaLabel:(0,y.__)("Forward-slash")}]}),(0,E.jsx)(or,{title:(0,y.__)("Text formatting"),shortcuts:er}),(0,E.jsx)(nr,{title:(0,y.__)("List View shortcuts"),categoryName:"list-view"})]}):null}const{Fill:cr,Slot:dr}=(0,S.createSlotFill)("EditWidgetsToolsMoreMenuGroup");cr.Slot=({fillProps:e})=>(0,E.jsx)(dr,{fillProps:e,children:e=>e.length>0&&e});const lr=cr;function ur(){const[e,t]=(0,p.useState)(!1),r=()=>t(!e);(0,yt.useShortcut)("core/edit-widgets/keyboard-shortcuts",r);const i=(0,T.useViewportMatch)("medium");return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(S.DropdownMenu,{icon:Qt,label:(0,y.__)("Options"),popoverProps:{placement:"bottom-end",className:"more-menu-dropdown__content"},toggleProps:{tooltipPosition:"bottom",size:"compact"},children:e=>(0,E.jsxs)(E.Fragment,{children:[i&&(0,E.jsx)(S.MenuGroup,{label:(0,y._x)("View","noun"),children:(0,E.jsx)(w.PreferenceToggleMenuItem,{scope:"core/edit-widgets",name:"fixedToolbar",label:(0,y.__)("Top toolbar"),info:(0,y.__)("Access all block and document tools in a single place"),messageActivated:(0,y.__)("Top toolbar activated"),messageDeactivated:(0,y.__)("Top toolbar deactivated")})}),(0,E.jsxs)(S.MenuGroup,{label:(0,y.__)("Tools"),children:[(0,E.jsx)(S.MenuItem,{onClick:()=>{t(!0)},shortcut:vt.displayShortcut.access("h"),children:(0,y.__)("Keyboard shortcuts")}),(0,E.jsx)(w.PreferenceToggleMenuItem,{scope:"core/edit-widgets",name:"welcomeGuide",label:(0,y.__)("Welcome Guide")}),(0,E.jsxs)(S.MenuItem,{role:"menuitem",icon:Xt,href:(0,y.__)("https://wordpress.org/documentation/article/block-based-widgets-editor/"),target:"_blank",rel:"noopener noreferrer",children:[(0,y.__)("Help"),(0,E.jsx)(S.VisuallyHidden,{as:"span",children:(0,y.__)("(opens in a new tab)")})]}),(0,E.jsx)(lr.Slot,{fillProps:{onClose:e}})]}),(0,E.jsxs)(S.MenuGroup,{label:(0,y.__)("Preferences"),children:[(0,E.jsx)(w.PreferenceToggleMenuItem,{scope:"core/edit-widgets",name:"keepCaretInsideBlock",label:(0,y.__)("Contain text cursor inside block"),info:(0,y.__)("Aids screen readers by stopping text caret from leaving blocks."),messageActivated:(0,y.__)("Contain text cursor inside block activated"),messageDeactivated:(0,y.__)("Contain text cursor inside block deactivated")}),(0,E.jsx)(w.PreferenceToggleMenuItem,{scope:"core/edit-widgets",name:"themeStyles",info:(0,y.__)("Make the editor look like your theme."),label:(0,y.__)("Use theme styles")}),i&&(0,E.jsx)(w.PreferenceToggleMenuItem,{scope:"core/edit-widgets",name:"showBlockBreadcrumbs",label:(0,y.__)("Display block breadcrumbs"),info:(0,y.__)("Shows block breadcrumbs at the bottom of the editor."),messageActivated:(0,y.__)("Display block breadcrumbs activated"),messageDeactivated:(0,y.__)("Display block breadcrumbs deactivated")})]})]})}),(0,E.jsx)(ar,{isModalActive:e,toggleModal:r})]})}const gr=function(){const e=(0,T.useViewportMatch)("medium"),t=(0,p.useRef)(),{hasFixedToolbar:r}=(0,l.useSelect)((e=>({hasFixedToolbar:!!e(w.store).get("core/edit-widgets","fixedToolbar")})),[]);return(0,E.jsx)(E.Fragment,{children:(0,E.jsxs)("div",{className:"edit-widgets-header",children:[(0,E.jsxs)("div",{className:"edit-widgets-header__navigable-toolbar-wrapper",children:[e&&(0,E.jsx)("h1",{className:"edit-widgets-header__title",children:(0,y.__)("Widgets")}),!e&&(0,E.jsx)(S.VisuallyHidden,{as:"h1",className:"edit-widgets-header__title",children:(0,y.__)("Widgets")}),(0,E.jsx)(qt,{}),r&&e&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("div",{className:"selected-block-tools-wrapper",children:(0,E.jsx)(fe.BlockToolbar,{hideDragHandle:!0})}),(0,E.jsx)(S.Popover.Slot,{ref:t,name:"block-toolbar"})]})]}),(0,E.jsxs)("div",{className:"edit-widgets-header__actions",children:[(0,E.jsx)(de.Slot,{scope:"core/edit-widgets"}),(0,E.jsx)(Jt,{}),(0,E.jsx)(ur,{})]})]})})};const pr=function(){const{removeNotice:e}=(0,l.useDispatch)(v.store),{notices:t}=(0,l.useSelect)((e=>({notices:e(v.store).getNotices()})),[]),r=t.filter((({isDismissible:e,type:t})=>e&&"default"===t)),i=t.filter((({isDismissible:e,type:t})=>!e&&"default"===t)),s=t.filter((({type:e})=>"snackbar"===e)).slice(-3);return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(S.NoticeList,{notices:i,className:"edit-widgets-notices__pinned"}),(0,E.jsx)(S.NoticeList,{notices:r,className:"edit-widgets-notices__dismissible",onRemove:e}),(0,E.jsx)(S.SnackbarList,{notices:s,className:"edit-widgets-notices__snackbar",onRemove:e})]})};function hr({blockEditorSettings:e}){const t=(0,l.useSelect)((e=>!!e(w.store).get("core/edit-widgets","themeStyles")),[]),r=(0,T.useViewportMatch)("medium"),i=(0,p.useMemo)((()=>t?e.styles:[]),[e,t]);return(0,E.jsxs)("div",{className:"edit-widgets-block-editor",children:[(0,E.jsx)(pr,{}),!r&&(0,E.jsx)(fe.BlockToolbar,{hideDragHandle:!0}),(0,E.jsxs)(fe.BlockTools,{children:[(0,E.jsx)(jt,{}),(0,E.jsx)(fe.__unstableEditorStyles,{styles:i,scope:":where(.editor-styles-wrapper)"}),(0,E.jsx)(fe.BlockSelectionClearer,{children:(0,E.jsx)(fe.WritingFlow,{children:(0,E.jsx)(fe.BlockList,{className:"edit-widgets-main-block-list"})})})]})]})}const mr=(0,E.jsx)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,E.jsx)(A.Path,{d:"m13.06 12 6.47-6.47-1.06-1.06L12 10.94 5.53 4.47 4.47 5.53 10.94 12l-6.47 6.47 1.06 1.06L12 13.06l6.47 6.47 1.06-1.06L13.06 12Z"})}),_r=()=>{const e=(0,l.useSelect)((e=>{const{getEntityRecord:t}=e(m.store),r=t(ve,je,"widget-areas");return r?.blocks[0]?.clientId}),[]);return(0,l.useSelect)((t=>{const{getBlockRootClientId:r,getBlockSelectionEnd:i,getBlockOrder:s,getBlockIndex:o}=t(fe.store),n=t(at).__experimentalGetInsertionPoint();if(n.rootClientId)return n;const a=i()||e,c=r(a);return a&&""===c?{rootClientId:a,insertionIndex:s(a).length}:{rootClientId:c,insertionIndex:o(a)+1}}),[e])};function wr(){const e=(0,T.useViewportMatch)("medium","<"),{rootClientId:t,insertionIndex:r}=_r(),{setIsInserterOpened:i}=(0,l.useDispatch)(at),s=(0,p.useCallback)((()=>i(!1)),[i]),o=e?"div":S.VisuallyHidden,[n,a]=(0,T.__experimentalUseDialog)({onClose:s,focusOnMount:!0}),c=(0,p.useRef)();return(0,E.jsxs)("div",{ref:n,...a,className:"edit-widgets-layout__inserter-panel",children:[(0,E.jsx)(o,{className:"edit-widgets-layout__inserter-panel-header",children:(0,E.jsx)(S.Button,{__next40pxDefaultSize:!0,icon:mr,onClick:s,label:(0,y.__)("Close block inserter")})}),(0,E.jsx)("div",{className:"edit-widgets-layout__inserter-panel-content",children:(0,E.jsx)(fe.__experimentalLibrary,{showInserterHelpPanel:!0,shouldFocusBlock:e,rootClientId:t,__experimentalInsertionIndex:r,ref:c})})]})}function br(){const{setIsListViewOpened:e}=(0,l.useDispatch)(at),{getListViewToggleRef:t}=ot((0,l.useSelect)(at)),[r,i]=(0,p.useState)(null),s=(0,T.useFocusOnMount)("firstElement"),o=(0,p.useCallback)((()=>{e(!1),t().current?.focus()}),[t,e]),n=(0,p.useCallback)((e=>{e.keyCode!==vt.ESCAPE||e.defaultPrevented||(e.preventDefault(),o())}),[o]);return(0,E.jsxs)("div",{className:"edit-widgets-editor__list-view-panel",onKeyDown:n,children:[(0,E.jsxs)("div",{className:"edit-widgets-editor__list-view-panel-header",children:[(0,E.jsx)("strong",{children:(0,y.__)("List View")}),(0,E.jsx)(S.Button,{__next40pxDefaultSize:!0,icon:L,label:(0,y.__)("Close"),onClick:o})]}),(0,E.jsx)("div",{className:"edit-widgets-editor__list-view-panel-content",ref:(0,T.useMergeRefs)([s,i]),children:(0,E.jsx)(fe.__experimentalListView,{dropZoneElement:r})})]})}function fr(){const{isInserterOpen:e,isListViewOpen:t}=(0,l.useSelect)((e=>{const{isInserterOpened:t,isListViewOpened:r}=e(at);return{isInserterOpen:t(),isListViewOpen:r()}}),[]);return e?(0,E.jsx)(wr,{}):t?(0,E.jsx)(br,{}):null}const xr={header:(0,y.__)("Widgets top bar"),body:(0,y.__)("Widgets and blocks"),sidebar:(0,y.__)("Widgets settings"),footer:(0,y.__)("Widgets footer")};const yr=function({blockEditorSettings:e}){const t=(0,T.useViewportMatch)("medium","<"),r=(0,T.useViewportMatch)("huge",">="),{setIsInserterOpened:i,setIsListViewOpened:s,closeGeneralSidebar:o}=(0,l.useDispatch)(at),{hasBlockBreadCrumbsEnabled:n,hasSidebarEnabled:a,isInserterOpened:c,isListViewOpened:d}=(0,l.useSelect)((e=>({hasSidebarEnabled:!!e(Q).getActiveComplementaryArea(at.name),isInserterOpened:!!e(at).isInserterOpened(),isListViewOpened:!!e(at).isListViewOpened(),hasBlockBreadCrumbsEnabled:!!e(w.store).get("core/edit-widgets","showBlockBreadcrumbs")})),[]);(0,p.useEffect)((()=>{a&&!r&&(i(!1),s(!1))}),[a,r]),(0,p.useEffect)((()=>{!c&&!d||r||o()}),[c,d,r]);const u=d?(0,y.__)("List View"):(0,y.__)("Block Library"),g=d||c;return(0,E.jsx)(be,{labels:{...xr,secondarySidebar:u},header:(0,E.jsx)(gr,{}),secondarySidebar:g&&(0,E.jsx)(fr,{}),sidebar:(0,E.jsx)(pe.Slot,{scope:"core/edit-widgets"}),content:(0,E.jsx)(E.Fragment,{children:(0,E.jsx)(hr,{blockEditorSettings:e})}),footer:n&&!t&&(0,E.jsx)("div",{className:"edit-widgets-layout__footer",children:(0,E.jsx)(fe.BlockBreadcrumb,{rootLabelText:(0,y.__)("Widgets")})})})};function vr(){const e=(0,l.useSelect)((e=>{const{getEditedWidgetAreas:t}=e(at),r=t();return r?.length>0}),[]);return(0,p.useEffect)((()=>{const t=t=>{if(e)return t.returnValue=(0,y.__)("You have unsaved changes. If you proceed, they will be lost."),t.returnValue};return window.addEventListener("beforeunload",t),()=>{window.removeEventListener("beforeunload",t)}}),[e]),null}function kr(){var e;const t=(0,l.useSelect)((e=>!!e(w.store).get("core/edit-widgets","welcomeGuide")),[]),{toggle:r}=(0,l.useDispatch)(w.store),i=(0,l.useSelect)((e=>e(at).getWidgetAreas({per_page:-1})),[]);if(!t)return null;const s=i?.every((e=>"wp_inactive_widgets"===e.id||e.widgets.every((e=>e.startsWith("block-"))))),o=null!==(e=i?.filter((e=>"wp_inactive_widgets"!==e.id)).length)&&void 0!==e?e:0;return(0,E.jsx)(S.Guide,{className:"edit-widgets-welcome-guide",contentLabel:(0,y.__)("Welcome to block Widgets"),finishButtonText:(0,y.__)("Get started"),onFinish:()=>r("core/edit-widgets","welcomeGuide"),pages:[{image:(0,E.jsx)(jr,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-canvas.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-canvas.gif"}),content:(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("h1",{className:"edit-widgets-welcome-guide__heading",children:(0,y.__)("Welcome to block Widgets")}),s?(0,E.jsx)(E.Fragment,{children:(0,E.jsx)("p",{className:"edit-widgets-welcome-guide__text",children:(0,y.sprintf)((0,y._n)("Your theme provides %s “block” area for you to add and edit content. Try adding a search bar, social icons, or other types of blocks here and see how they’ll look on your site.","Your theme provides %s different “block” areas for you to add and edit content. Try adding a search bar, social icons, or other types of blocks here and see how they’ll look on your site.",o),o)})}):(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("p",{className:"edit-widgets-welcome-guide__text",children:(0,y.__)("You can now add any block to your site’s widget areas. Don’t worry, all of your favorite widgets still work flawlessly.")}),(0,E.jsxs)("p",{className:"edit-widgets-welcome-guide__text",children:[(0,E.jsx)("strong",{children:(0,y.__)("Want to stick with the old widgets?")})," ",(0,E.jsx)(S.ExternalLink,{href:(0,y.__)("https://wordpress.org/plugins/classic-widgets/"),children:(0,y.__)("Get the Classic Widgets plugin.")})]})]})]})},{image:(0,E.jsx)(jr,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-editor.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-editor.gif"}),content:(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("h1",{className:"edit-widgets-welcome-guide__heading",children:(0,y.__)("Make each block your own")}),(0,E.jsx)("p",{className:"edit-widgets-welcome-guide__text",children:(0,y.__)("Each block comes with its own set of controls for changing things like color, width, and alignment. These will show and hide automatically when you have a block selected.")})]})},{image:(0,E.jsx)(jr,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-library.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-library.gif"}),content:(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("h1",{className:"edit-widgets-welcome-guide__heading",children:(0,y.__)("Get to know the block library")}),(0,E.jsx)("p",{className:"edit-widgets-welcome-guide__text",children:(0,p.createInterpolateElement)((0,y.__)("All of the blocks available to you live in the block library. You’ll find it wherever you see the icon."),{InserterIconImage:(0,E.jsx)("img",{className:"edit-widgets-welcome-guide__inserter-icon",alt:(0,y.__)("inserter"),src:"data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='18' height='18' rx='2' fill='%231E1E1E'/%3E%3Cpath d='M9.22727 4V14M4 8.77273H14' stroke='white' stroke-width='1.5'/%3E%3C/svg%3E%0A"})})})]})},{image:(0,E.jsx)(jr,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-documentation.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-documentation.gif"}),content:(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("h1",{className:"edit-widgets-welcome-guide__heading",children:(0,y.__)("Learn how to use the block editor")}),(0,E.jsx)("p",{className:"edit-widgets-welcome-guide__text",children:(0,p.createInterpolateElement)((0,y.__)("New to the block editor? Want to learn more about using it? Here's a detailed guide."),{a:(0,E.jsx)(S.ExternalLink,{href:(0,y.__)("https://wordpress.org/documentation/article/wordpress-block-editor/")})})})]})}]})}function jr({nonAnimatedSrc:e,animatedSrc:t}){return(0,E.jsxs)("picture",{className:"edit-widgets-welcome-guide__image",children:[(0,E.jsx)("source",{srcSet:e,media:"(prefers-reduced-motion: reduce)"}),(0,E.jsx)("img",{src:t,width:"312",height:"240",alt:""})]})}const Sr=function({blockEditorSettings:e}){const{createErrorNotice:t}=(0,l.useDispatch)(v.store),r=(0,S.__unstableUseNavigateRegions)();return(0,E.jsx)(ft,{children:(0,E.jsx)("div",{className:r.className,...r,ref:r.ref,children:(0,E.jsxs)(Nt,{blockEditorSettings:e,children:[(0,E.jsx)(yr,{blockEditorSettings:e}),(0,E.jsx)(zt,{}),(0,E.jsx)(X.PluginArea,{onError:function(e){t((0,y.sprintf)((0,y.__)('The "%s" plugin has encountered an error and cannot be rendered.'),e))}}),(0,E.jsx)(vr,{}),(0,E.jsx)(kr,{})]})})})},Ar=["core/more","core/freeform","core/template-part","core/block"];function Er(e,t){const r=document.getElementById(e),i=(0,p.createRoot)(r),s=(0,h.__experimentalGetCoreBlocks)().filter((e=>!(Ar.includes(e.name)||e.name.startsWith("core/post")||e.name.startsWith("core/query")||e.name.startsWith("core/site")||e.name.startsWith("core/navigation"))));return(0,l.dispatch)(w.store).setDefaults("core/edit-widgets",{fixedToolbar:!1,welcomeGuide:!0,showBlockBreadcrumbs:!0,themeStyles:!0}),(0,l.dispatch)(d.store).reapplyBlockTypeFilters(),(0,h.registerCoreBlocks)(s),(0,_.registerLegacyWidgetBlock)(),(0,_.registerLegacyWidgetVariations)(t),Nr(c),(0,_.registerWidgetGroupBlock)(),t.__experimentalFetchLinkSuggestions=(e,r)=>(0,m.__experimentalFetchLinkSuggestions)(e,r,t),(0,d.setFreeformContentHandlerName)("core/html"),i.render((0,E.jsx)(p.StrictMode,{children:(0,E.jsx)(Sr,{blockEditorSettings:t})})),i}const Ir=Er;function Cr(){g()("wp.editWidgets.reinitializeEditor",{since:"6.2",version:"6.3"})}const Nr=e=>{if(!e)return;const{metadata:t,settings:r,name:i}=e;t&&(0,d.unstable__bootstrapServerSideBlockDefinitions)({[i]:t}),(0,d.registerBlockType)(i,r)};(window.wp=window.wp||{}).editWidgets=t})(); \ No newline at end of file +(()=>{"use strict";var e={n:t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},d:(t,r)=>{for(var i in r)e.o(r,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:r[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{initialize:()=>Er,initializeEditor:()=>Sr,reinitializeEditor:()=>Ar,store:()=>nt});var r={};e.r(r),e.d(r,{closeModal:()=>$,disableComplementaryArea:()=>V,enableComplementaryArea:()=>O,openModal:()=>U,pinItem:()=>D,setDefaultComplementaryArea:()=>M,setFeatureDefaults:()=>H,setFeatureValue:()=>z,toggleFeature:()=>G,unpinItem:()=>F});var i={};e.r(i),e.d(i,{getActiveComplementaryArea:()=>Y,isComplementaryAreaLoading:()=>Z,isFeatureActive:()=>q,isItemPinned:()=>K,isModalActive:()=>J});var s={};e.r(s),e.d(s,{closeGeneralSidebar:()=>Pe,moveBlockToWidgetArea:()=>Me,persistStubPost:()=>Ee,saveEditedWidgetAreas:()=>Ae,saveWidgetArea:()=>Ce,saveWidgetAreas:()=>Ie,setIsInserterOpened:()=>Re,setIsListViewOpened:()=>We,setIsWidgetAreaOpen:()=>Le,setWidgetAreasOpenState:()=>Te,setWidgetIdForClientId:()=>Be});var o={};e.r(o),e.d(o,{getWidgetAreas:()=>Oe,getWidgets:()=>Ve});var n={};e.r(n),e.d(n,{__experimentalGetInsertionPoint:()=>Je,canInsertBlockInWidgetArea:()=>Qe,getEditedWidgetAreas:()=>$e,getIsWidgetAreaOpen:()=>Ke,getParentWidgetAreaBlock:()=>Ue,getReferenceWidgetBlocks:()=>Ye,getWidget:()=>Ge,getWidgetAreaForWidgetId:()=>He,getWidgetAreas:()=>ze,getWidgets:()=>Fe,isInserterOpened:()=>qe,isListViewOpened:()=>Xe,isSavingWidgetAreas:()=>Ze});var a={};e.r(a),e.d(a,{getInserterSidebarToggleRef:()=>tt,getListViewToggleRef:()=>et});var c={};e.r(c),e.d(c,{metadata:()=>pt,name:()=>ht,settings:()=>mt});const d=window.wp.blocks,l=window.wp.data,u=window.wp.deprecated;var g=e.n(u);const p=window.wp.element,h=window.wp.blockLibrary,m=window.wp.coreData,w=window.wp.widgets,_=window.wp.preferences,b=window.wp.apiFetch;var f=e.n(b);const x=(0,l.combineReducers)({blockInserterPanel:function(e=!1,t){switch(t.type){case"SET_IS_LIST_VIEW_OPENED":return!t.isOpen&&e;case"SET_IS_INSERTER_OPENED":return t.value}return e},inserterSidebarToggleRef:function(e={current:null}){return e},listViewPanel:function(e=!1,t){switch(t.type){case"SET_IS_INSERTER_OPENED":return!t.value&&e;case"SET_IS_LIST_VIEW_OPENED":return t.isOpen}return e},listViewToggleRef:function(e={current:null}){return e},widgetAreasOpenState:function(e={},t){const{type:r}=t;switch(r){case"SET_WIDGET_AREAS_OPEN_STATE":return t.widgetAreasOpenState;case"SET_IS_WIDGET_AREA_OPEN":{const{clientId:r,isOpen:i}=t;return{...e,[r]:i}}default:return e}}}),y=window.wp.i18n,v=window.wp.notices;function k(e){var t,r,i="";if("string"==typeof e||"number"==typeof e)i+=e;else if("object"==typeof e)if(Array.isArray(e)){var s=e.length;for(t=0;t({type:"SET_DEFAULT_COMPLEMENTARY_AREA",scope:e=W(e),area:t=P(e,t)}),O=(e,t)=>({registry:r,dispatch:i})=>{if(!t)return;e=W(e),t=P(e,t);r.select(_.store).get(e,"isComplementaryAreaVisible")||r.dispatch(_.store).set(e,"isComplementaryAreaVisible",!0),i({type:"ENABLE_COMPLEMENTARY_AREA",scope:e,area:t})},V=e=>({registry:t})=>{e=W(e);t.select(_.store).get(e,"isComplementaryAreaVisible")&&t.dispatch(_.store).set(e,"isComplementaryAreaVisible",!1)},D=(e,t)=>({registry:r})=>{if(!t)return;e=W(e),t=P(e,t);const i=r.select(_.store).get(e,"pinnedItems");!0!==i?.[t]&&r.dispatch(_.store).set(e,"pinnedItems",{...i,[t]:!0})},F=(e,t)=>({registry:r})=>{if(!t)return;e=W(e),t=P(e,t);const i=r.select(_.store).get(e,"pinnedItems");r.dispatch(_.store).set(e,"pinnedItems",{...i,[t]:!1})};function G(e,t){return function({registry:r}){g()("dispatch( 'core/interface' ).toggleFeature",{since:"6.0",alternative:"dispatch( 'core/preferences' ).toggle"}),r.dispatch(_.store).toggle(e,t)}}function z(e,t,r){return function({registry:i}){g()("dispatch( 'core/interface' ).setFeatureValue",{since:"6.0",alternative:"dispatch( 'core/preferences' ).set"}),i.dispatch(_.store).set(e,t,!!r)}}function H(e,t){return function({registry:r}){g()("dispatch( 'core/interface' ).setFeatureDefaults",{since:"6.0",alternative:"dispatch( 'core/preferences' ).setDefaults"}),r.dispatch(_.store).setDefaults(e,t)}}function U(e){return{type:"OPEN_MODAL",name:e}}function $(){return{type:"CLOSE_MODAL"}}const Y=(0,l.createRegistrySelector)((e=>(t,r)=>{r=W(r);const i=e(_.store).get(r,"isComplementaryAreaVisible");if(void 0!==i)return!1===i?null:t?.complementaryAreas?.[r]})),Z=(0,l.createRegistrySelector)((e=>(t,r)=>{r=W(r);const i=e(_.store).get(r,"isComplementaryAreaVisible"),s=t?.complementaryAreas?.[r];return i&&void 0===s})),K=(0,l.createRegistrySelector)((e=>(t,r,i)=>{var s;i=P(r=W(r),i);const o=e(_.store).get(r,"pinnedItems");return null===(s=o?.[i])||void 0===s||s})),q=(0,l.createRegistrySelector)((e=>(t,r,i)=>(g()("select( 'core/interface' ).isFeatureActive( scope, featureName )",{since:"6.0",alternative:"select( 'core/preferences' ).get( scope, featureName )"}),!!e(_.store).get(r,i))));function J(e,t){return e.activeModal===t}const Q=(0,l.combineReducers)({complementaryAreas:function(e={},t){switch(t.type){case"SET_DEFAULT_COMPLEMENTARY_AREA":{const{scope:r,area:i}=t;return e[r]?e:{...e,[r]:i}}case"ENABLE_COMPLEMENTARY_AREA":{const{scope:r,area:i}=t;return{...e,[r]:i}}}return e},activeModal:function(e=null,t){switch(t.type){case"OPEN_MODAL":return t.name;case"CLOSE_MODAL":return null}return e}}),X=(0,l.createReduxStore)("core/interface",{reducer:Q,actions:r,selectors:i});function ee({as:e=S.Button,scope:t,identifier:r,icon:i,selectedIcon:s,name:o,shortcut:n,...a}){const c=e,d=(0,L.usePluginContext)(),u=i||d.icon,g=r||`${d.name}/${o}`,p=(0,l.useSelect)((e=>e(X).getActiveComplementaryArea(t)===g),[g,t]),{enableComplementaryArea:h,disableComplementaryArea:m}=(0,l.useDispatch)(X);return(0,A.jsx)(c,{icon:s&&p?s:u,"aria-controls":g.replace("/",":"),"aria-checked":(w=a.role,["checkbox","option","radio","switch","menuitemcheckbox","menuitemradio","treeitem"].includes(w)?p:void 0),onClick:()=>{p?m(t):h(t,g)},shortcut:n,...a});var w}(0,l.register)(X);const te=({children:e,className:t,toggleButtonProps:r})=>{const i=(0,A.jsx)(ee,{icon:R,...r});return(0,A.jsxs)("div",{className:j("components-panel__header","interface-complementary-area-header",t),tabIndex:-1,children:[e,i]})},re=()=>{};function ie({name:e,as:t=S.Button,onClick:r,...i}){return(0,A.jsx)(S.Fill,{name:e,children:({onClick:e})=>(0,A.jsx)(t,{onClick:r||e?(...t)=>{(r||re)(...t),(e||re)(...t)}:void 0,...i})})}ie.Slot=function({name:e,as:t=S.MenuGroup,fillProps:r={},bubblesVirtually:i,...s}){return(0,A.jsx)(S.Slot,{name:e,bubblesVirtually:i,fillProps:r,children:e=>{if(!p.Children.toArray(e).length)return null;const r=[];p.Children.forEach(e,(({props:{__unstableExplicitMenuItem:e,__unstableTarget:t}})=>{t&&e&&r.push(t)}));const i=p.Children.map(e,(e=>!e.props.__unstableExplicitMenuItem&&r.includes(e.props.__unstableTarget)?null:e));return(0,A.jsx)(t,{...s,children:i})}})};const se=ie,oe=({__unstableExplicitMenuItem:e,__unstableTarget:t,...r})=>(0,A.jsx)(S.MenuItem,{...r});function ne({scope:e,target:t,__unstableExplicitMenuItem:r,...i}){return(0,A.jsx)(ee,{as:i=>(0,A.jsx)(se,{__unstableExplicitMenuItem:r,__unstableTarget:`${e}/${t}`,as:oe,name:`${e}/plugin-more-menu`,...i}),role:"menuitemcheckbox",selectedIcon:I,name:t,scope:e,...i})}function ae({scope:e,...t}){return(0,A.jsx)(S.Fill,{name:`PinnedItems/${e}`,...t})}ae.Slot=function({scope:e,className:t,...r}){return(0,A.jsx)(S.Slot,{name:`PinnedItems/${e}`,...r,children:e=>e?.length>0&&(0,A.jsx)("div",{className:j(t,"interface-pinned-items"),children:e})})};const ce=ae;const de={open:{width:280},closed:{width:0},mobileOpen:{width:"100vw"}};function le({activeArea:e,isActive:t,scope:r,children:i,className:s,id:o}){const n=(0,T.useReducedMotion)(),a=(0,T.useViewportMatch)("medium","<"),c=(0,T.usePrevious)(e),d=(0,T.usePrevious)(t),[,l]=(0,p.useState)({});(0,p.useEffect)((()=>{l({})}),[t]);const u={type:"tween",duration:n||a||c&&e&&e!==c?0:.3,ease:[.6,0,.4,1]};return(0,A.jsx)(S.Fill,{name:`ComplementaryArea/${r}`,children:(0,A.jsx)(S.__unstableAnimatePresence,{initial:!1,children:(d||t)&&(0,A.jsx)(S.__unstableMotion.div,{variants:de,initial:"closed",animate:a?"mobileOpen":"open",exit:"closed",transition:u,className:"interface-complementary-area__fill",children:(0,A.jsx)("div",{id:o,className:s,style:{width:a?"100vw":280},children:i})})})})}function ue({children:e,className:t,closeLabel:r=(0,y.__)("Close plugin"),identifier:i,header:s,headerClassName:o,icon:n,isPinnable:a=!0,panelClassName:c,scope:d,name:u,title:g,toggleShortcut:h,isActiveByDefault:m}){const w=(0,L.usePluginContext)(),b=n||w.icon,f=i||`${w.name}/${u}`,[x,v]=(0,p.useState)(!1),{isLoading:k,isActive:E,isPinned:R,activeArea:W,isSmall:P,isLarge:M,showIconLabels:O}=(0,l.useSelect)((e=>{const{getActiveComplementaryArea:t,isComplementaryAreaLoading:r,isItemPinned:i}=e(X),{get:s}=e(_.store),o=t(d);return{isLoading:r(d),isActive:o===f,isPinned:i(d,f),activeArea:o,isSmall:e(B.store).isViewportMatch("< medium"),isLarge:e(B.store).isViewportMatch("large"),showIconLabels:s("core","showIconLabels")}}),[f,d]),V=(0,T.useViewportMatch)("medium","<");!function(e,t,r,i,s){const o=(0,p.useRef)(!1),n=(0,p.useRef)(!1),{enableComplementaryArea:a,disableComplementaryArea:c}=(0,l.useDispatch)(X);(0,p.useEffect)((()=>{i&&s&&!o.current?(c(e),n.current=!0):n.current&&!s&&o.current?(n.current=!1,a(e,t)):n.current&&r&&r!==t&&(n.current=!1),s!==o.current&&(o.current=s)}),[i,s,e,t,r,c,a])}(d,f,W,E,P);const{enableComplementaryArea:D,disableComplementaryArea:F,pinItem:G,unpinItem:z}=(0,l.useDispatch)(X);if((0,p.useEffect)((()=>{m&&void 0===W&&!P?D(d,f):void 0===W&&P&&F(d,f),v(!0)}),[W,m,d,f,P,D,F]),x)return(0,A.jsxs)(A.Fragment,{children:[a&&(0,A.jsx)(ce,{scope:d,children:R&&(0,A.jsx)(ee,{scope:d,identifier:f,isPressed:E&&(!O||M),"aria-expanded":E,"aria-disabled":k,label:g,icon:O?I:b,showTooltip:!O,variant:O?"tertiary":void 0,size:"compact",shortcut:h})}),u&&a&&(0,A.jsx)(ne,{target:u,scope:d,icon:b,children:g}),(0,A.jsxs)(le,{activeArea:W,isActive:E,className:j("interface-complementary-area",t),scope:d,id:f.replace("/",":"),children:[(0,A.jsx)(te,{className:o,closeLabel:r,onClose:()=>F(d),toggleButtonProps:{label:r,size:"compact",shortcut:h,scope:d,identifier:f},children:s||(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)("h2",{className:"interface-complementary-area-header__title",children:g}),a&&!V&&(0,A.jsx)(S.Button,{className:"interface-complementary-area__pin-unpin-item",icon:R?C:N,label:R?(0,y.__)("Unpin from toolbar"):(0,y.__)("Pin to toolbar"),onClick:()=>(R?z:G)(d,f),isPressed:R,"aria-expanded":R,size:"compact"})]})}),(0,A.jsx)(S.Panel,{className:c,children:e})]})]})}ue.Slot=function({scope:e,...t}){return(0,A.jsx)(S.Slot,{name:`ComplementaryArea/${e}`,...t})};const ge=ue,pe=(0,p.forwardRef)((({children:e,className:t,ariaLabel:r,as:i="div",...s},o)=>(0,A.jsx)(i,{ref:o,className:j("interface-navigable-region",t),"aria-label":r,role:"region",tabIndex:"-1",...s,children:e})));pe.displayName="NavigableRegion";const he=pe,me={type:"tween",duration:.25,ease:[.6,0,.4,1]};const we={hidden:{opacity:1,marginTop:-60},visible:{opacity:1,marginTop:0},distractionFreeHover:{opacity:1,marginTop:0,transition:{...me,delay:.2,delayChildren:.2}},distractionFreeHidden:{opacity:0,marginTop:-60},distractionFreeDisabled:{opacity:0,marginTop:0,transition:{...me,delay:.8,delayChildren:.8}}};const _e=(0,p.forwardRef)((function({isDistractionFree:e,footer:t,header:r,editorNotices:i,sidebar:s,secondarySidebar:o,content:n,actions:a,labels:c,className:d},l){const[u,g]=(0,T.useResizeObserver)(),h=(0,T.useViewportMatch)("medium","<"),m={type:"tween",duration:(0,T.useReducedMotion)()?0:.25,ease:[.6,0,.4,1]};!function(e){(0,p.useEffect)((()=>{const t=document&&document.querySelector(`html:not(.${e})`);if(t)return t.classList.toggle(e),()=>{t.classList.toggle(e)}}),[e])}("interface-interface-skeleton__html-container");const w={...{header:(0,y._x)("Header","header landmark area"),body:(0,y.__)("Content"),secondarySidebar:(0,y.__)("Block Library"),sidebar:(0,y._x)("Settings","settings landmark area"),actions:(0,y.__)("Publish"),footer:(0,y.__)("Footer")},...c};return(0,A.jsxs)("div",{ref:l,className:j(d,"interface-interface-skeleton",!!t&&"has-footer"),children:[(0,A.jsxs)("div",{className:"interface-interface-skeleton__editor",children:[(0,A.jsx)(S.__unstableAnimatePresence,{initial:!1,children:!!r&&(0,A.jsx)(he,{as:S.__unstableMotion.div,className:"interface-interface-skeleton__header","aria-label":w.header,initial:e&&!h?"distractionFreeHidden":"hidden",whileHover:e&&!h?"distractionFreeHover":"visible",animate:e&&!h?"distractionFreeDisabled":"visible",exit:e&&!h?"distractionFreeHidden":"hidden",variants:we,transition:m,children:r})}),e&&(0,A.jsx)("div",{className:"interface-interface-skeleton__header",children:i}),(0,A.jsxs)("div",{className:"interface-interface-skeleton__body",children:[(0,A.jsx)(S.__unstableAnimatePresence,{initial:!1,children:!!o&&(0,A.jsx)(he,{className:"interface-interface-skeleton__secondary-sidebar",ariaLabel:w.secondarySidebar,as:S.__unstableMotion.div,initial:"closed",animate:"open",exit:"closed",variants:{open:{width:g.width},closed:{width:0}},transition:m,children:(0,A.jsxs)(S.__unstableMotion.div,{style:{position:"absolute",width:h?"100vw":"fit-content",height:"100%",left:0},variants:{open:{x:0},closed:{x:"-100%"}},transition:m,children:[u,o]})})}),(0,A.jsx)(he,{className:"interface-interface-skeleton__content",ariaLabel:w.body,children:n}),!!s&&(0,A.jsx)(he,{className:"interface-interface-skeleton__sidebar",ariaLabel:w.sidebar,children:s}),!!a&&(0,A.jsx)(he,{className:"interface-interface-skeleton__actions",ariaLabel:w.actions,children:a})]})]}),!!t&&(0,A.jsx)(he,{className:"interface-interface-skeleton__footer",ariaLabel:w.footer,children:t})]})})),be=window.wp.blockEditor;function fe(e){if("block"===e.id_base){const t=(0,d.parse)(e.instance.raw.content,{__unstableSkipAutop:!0});return t.length?(0,w.addWidgetIdToBlock)(t[0],e.id):(0,w.addWidgetIdToBlock)((0,d.createBlock)("core/paragraph",{},[]),e.id)}let t;return t=e._embedded.about[0].is_multi?{idBase:e.id_base,instance:e.instance}:{id:e.id},(0,w.addWidgetIdToBlock)((0,d.createBlock)("core/legacy-widget",t,[]),e.id)}function xe(e,t={}){let r;var i,s,o;"core/legacy-widget"===e.name&&(e.attributes.id||e.attributes.instance)?r={...t,id:null!==(i=e.attributes.id)&&void 0!==i?i:t.id,id_base:null!==(s=e.attributes.idBase)&&void 0!==s?s:t.id_base,instance:null!==(o=e.attributes.instance)&&void 0!==o?o:t.instance}:r={...t,id_base:"block",instance:{raw:{content:(0,d.serialize)(e)}}};return delete r.rendered,delete r.rendered_form,r}const ye="root",ve="sidebar",ke="postType",je=e=>`widget-area-${e}`;const Se="core/edit-widgets",Ee=(e,t)=>({registry:r})=>{const i=((e,t)=>({id:e,slug:e,status:"draft",type:"page",blocks:t,meta:{widgetAreaId:e}}))(e,t);return r.dispatch(m.store).receiveEntityRecords(ye,ke,i,{id:i.id},!1),i},Ae=()=>async({select:e,dispatch:t,registry:r})=>{const i=e.getEditedWidgetAreas();if(i?.length)try{await t.saveWidgetAreas(i),r.dispatch(v.store).createSuccessNotice((0,y.__)("Widgets saved."),{type:"snackbar"})}catch(e){r.dispatch(v.store).createErrorNotice((0,y.sprintf)((0,y.__)("There was an error. %s"),e.message),{type:"snackbar"})}},Ie=e=>async({dispatch:t,registry:r})=>{try{for(const r of e)await t.saveWidgetArea(r.id)}finally{await r.dispatch(m.store).finishResolution("getEntityRecord",ye,ve,{per_page:-1})}},Ce=e=>async({dispatch:t,select:r,registry:i})=>{const s=r.getWidgets(),o=i.select(m.store).getEditedEntityRecord(ye,ke,je(e)),n=Object.values(s).filter((({sidebar:t})=>t===e)),a=[],c=o.blocks.filter((e=>{const{id:t}=e.attributes;if("core/legacy-widget"===e.name&&t){if(a.includes(t))return!1;a.push(t)}return!0})),d=[];for(const e of n){r.getWidgetAreaForWidgetId(e.id)||d.push(e)}const l=[],u=[],g=[];for(let t=0;te("root","widget",o)))}else u.push((({saveEntityRecord:t})=>t("root","widget",{...a,sidebar:e})));l.push({block:r,position:t,clientId:r.clientId})}for(const e of d)u.push((({deleteEntityRecord:t})=>t("root","widget",e.id,{force:!0})));const p=(await i.dispatch(m.store).__experimentalBatch(u)).filter((e=>!e.hasOwnProperty("deleted"))),h=[];for(let e=0;e({registry:t})=>{t.dispatch(m.store).saveEditedEntityRecord(ye,ve,e,{throwOnError:!0})};function Be(e,t){return{type:"SET_WIDGET_ID_FOR_CLIENT_ID",clientId:e,widgetId:t}}function Te(e){return{type:"SET_WIDGET_AREAS_OPEN_STATE",widgetAreasOpenState:e}}function Le(e,t){return{type:"SET_IS_WIDGET_AREA_OPEN",clientId:e,isOpen:t}}function Re(e){return{type:"SET_IS_INSERTER_OPENED",value:e}}function We(e){return{type:"SET_IS_LIST_VIEW_OPENED",isOpen:e}}const Pe=()=>({registry:e})=>{e.dispatch(X).disableComplementaryArea(Se)},Me=(e,t)=>async({dispatch:r,select:i,registry:s})=>{const o=s.select(be.store).getBlockRootClientId(e),n=s.select(be.store).getBlocks().find((({attributes:e})=>e.id===t)).clientId,a=s.select(be.store).getBlockOrder(n).length;i.getIsWidgetAreaOpen(n)||r.setIsWidgetAreaOpen(n,!0),s.dispatch(be.store).moveBlocksToPosition([e],o,n,a)},Oe=()=>async({dispatch:e,registry:t})=>{const r={per_page:-1},i=[],s=(await t.resolveSelect(m.store).getEntityRecords(ye,ve,r)).sort(((e,t)=>"wp_inactive_widgets"===e.id?1:"wp_inactive_widgets"===t.id?-1:0));for(const t of s)i.push((0,d.createBlock)("core/widget-area",{id:t.id,name:t.name})),t.widgets.length||e(Ee(je(t.id),[]));const o={};i.forEach(((e,t)=>{o[e.clientId]=0===t})),e(Te(o)),e(Ee("widget-areas",i))},Ve=()=>async({dispatch:e,registry:t})=>{const r={per_page:-1,_embed:"about"},i=await t.resolveSelect(m.store).getEntityRecords("root","widget",r),s={};for(const e of i){const t=fe(e);s[e.sidebar]=s[e.sidebar]||[],s[e.sidebar].push(t)}for(const t in s)s.hasOwnProperty(t)&&e(Ee(je(t),s[t]))},De={rootClientId:void 0,insertionIndex:void 0},Fe=(0,l.createRegistrySelector)((e=>(0,l.createSelector)((()=>{var t;const r=e(m.store).getEntityRecords("root","widget",{per_page:-1,_embed:"about"});return null!==(t=r?.reduce(((e,t)=>({...e,[t.id]:t})),{}))&&void 0!==t?t:{}}),(()=>[e(m.store).getEntityRecords("root","widget",{per_page:-1,_embed:"about"})])))),Ge=(0,l.createRegistrySelector)((e=>(t,r)=>e(Se).getWidgets()[r])),ze=(0,l.createRegistrySelector)((e=>()=>{const t={per_page:-1};return e(m.store).getEntityRecords(ye,ve,t)})),He=(0,l.createRegistrySelector)((e=>(t,r)=>e(Se).getWidgetAreas().find((t=>e(m.store).getEditedEntityRecord(ye,ke,je(t.id)).blocks.map((e=>(0,w.getWidgetIdFromBlock)(e))).includes(r))))),Ue=(0,l.createRegistrySelector)((e=>(t,r)=>{const{getBlock:i,getBlockName:s,getBlockParents:o}=e(be.store);return i(o(r).find((e=>"core/widget-area"===s(e))))})),$e=(0,l.createRegistrySelector)((e=>(t,r)=>{let i=e(Se).getWidgetAreas();return i?(r&&(i=i.filter((({id:e})=>r.includes(e)))),i.filter((({id:t})=>e(m.store).hasEditsForEntityRecord(ye,ke,je(t)))).map((({id:t})=>e(m.store).getEditedEntityRecord(ye,ve,t)))):[]})),Ye=(0,l.createRegistrySelector)((e=>(t,r=null)=>{const i=[],s=e(Se).getWidgetAreas();for(const t of s){const s=e(m.store).getEditedEntityRecord(ye,ke,je(t.id));for(const e of s.blocks)"core/legacy-widget"!==e.name||r&&e.attributes?.referenceWidgetName!==r||i.push(e)}return i})),Ze=(0,l.createRegistrySelector)((e=>()=>{const t=e(Se).getWidgetAreas()?.map((({id:e})=>e));if(!t)return!1;for(const r of t){if(e(m.store).isSavingEntityRecord(ye,ve,r))return!0}const r=[...Object.keys(e(Se).getWidgets()),void 0];for(const t of r){if(e(m.store).isSavingEntityRecord("root","widget",t))return!0}return!1})),Ke=(e,t)=>{const{widgetAreasOpenState:r}=e;return!!r[t]};function qe(e){return!!e.blockInserterPanel}function Je(e){return"boolean"==typeof e.blockInserterPanel?De:e.blockInserterPanel}const Qe=(0,l.createRegistrySelector)((e=>(t,r)=>{const i=e(be.store).getBlocks(),[s]=i;return e(be.store).canInsertBlockType(r,s.clientId)}));function Xe(e){return e.listViewPanel}function et(e){return e.listViewToggleRef}function tt(e){return e.inserterSidebarToggleRef}const rt=window.wp.privateApis,{lock:it,unlock:st}=(0,rt.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/edit-widgets"),ot={reducer:x,selectors:n,resolvers:o,actions:s},nt=(0,l.createReduxStore)(Se,ot);(0,l.register)(nt),f().use((function(e,t){return 0===e.path?.indexOf("/wp/v2/types/widget-area")?Promise.resolve({}):t(e)})),st(nt).registerPrivateSelectors(a);const at=window.wp.hooks,ct=(0,T.createHigherOrderComponent)((e=>t=>{const{clientId:r,name:i}=t,{widgetAreas:s,currentWidgetAreaId:o,canInsertBlockInWidgetArea:n}=(0,l.useSelect)((e=>{if("core/widget-area"===i)return{};const t=e(nt),s=t.getParentWidgetAreaBlock(r);return{widgetAreas:t.getWidgetAreas(),currentWidgetAreaId:s?.attributes?.id,canInsertBlockInWidgetArea:t.canInsertBlockInWidgetArea(i)}}),[r,i]),{moveBlockToWidgetArea:a}=(0,l.useDispatch)(nt),c="core/widget-area"!==i&&s?.length>1&&n;return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(e,{...t},"edit"),c&&(0,A.jsx)(be.BlockControls,{children:(0,A.jsx)(w.MoveToWidgetArea,{widgetAreas:s,currentWidgetAreaId:o,onSelect:e=>{a(t.clientId,e)}})})]})}),"withMoveToWidgetAreaToolbarItem");(0,at.addFilter)("editor.BlockEdit","core/edit-widgets/block-edit",ct);const dt=window.wp.mediaUtils;(0,at.addFilter)("editor.MediaUpload","core/edit-widgets/replace-media-upload",(()=>dt.MediaUpload));const lt=e=>{const[t,r]=(0,p.useState)(!1);return(0,p.useEffect)((()=>{const{ownerDocument:t}=e.current;function i(e){o(e)}function s(){r(!1)}function o(t){e.current.contains(t.target)?r(!0):r(!1)}return t.addEventListener("dragstart",i),t.addEventListener("dragend",s),t.addEventListener("dragenter",o),()=>{t.removeEventListener("dragstart",i),t.removeEventListener("dragend",s),t.removeEventListener("dragenter",o)}}),[]),t};function ut({id:e}){const[t,r,i]=(0,m.useEntityBlockEditor)("root","postType"),s=(0,p.useRef)(),o=lt(s),n=(0,be.useInnerBlocksProps)({ref:s},{value:t,onInput:r,onChange:i,templateLock:!1,renderAppender:be.InnerBlocks.ButtonBlockAppender});return(0,A.jsx)("div",{"data-widget-area-id":e,className:j("wp-block-widget-area__inner-blocks block-editor-inner-blocks editor-styles-wrapper",{"wp-block-widget-area__highlight-drop-zone":o}),children:(0,A.jsx)("div",{...n})})}const gt=e=>{const[t,r]=(0,p.useState)(!1);return(0,p.useEffect)((()=>{const{ownerDocument:t}=e.current;function i(){r(!0)}function s(){r(!1)}return t.addEventListener("dragstart",i),t.addEventListener("dragend",s),()=>{t.removeEventListener("dragstart",i),t.removeEventListener("dragend",s)}}),[]),t},pt={$schema:"https://schemas.wp.org/trunk/block.json",name:"core/widget-area",title:"Widget Area",category:"widgets",attributes:{id:{type:"string"},name:{type:"string"}},supports:{html:!1,inserter:!1,customClassName:!1,reusable:!1,__experimentalToolbar:!1,__experimentalParentSelector:!1,__experimentalDisableBlockOverlay:!0},editorStyle:"wp-block-widget-area-editor",style:"wp-block-widget-area"},{name:ht}=pt,mt={title:(0,y.__)("Widget Area"),description:(0,y.__)("A widget area container."),__experimentalLabel:({name:e})=>e,edit:function({clientId:e,className:t,attributes:{id:r,name:i}}){const s=(0,l.useSelect)((t=>t(nt).getIsWidgetAreaOpen(e)),[e]),{setIsWidgetAreaOpen:o}=(0,l.useDispatch)(nt),n=(0,p.useRef)(),a=(0,p.useCallback)((t=>o(e,t)),[e]),c=gt(n),d=lt(n),[u,g]=(0,p.useState)(!1);return(0,p.useEffect)((()=>{c?d&&!s?(a(!0),g(!0)):!d&&s&&u&&a(!1):g(!1)}),[s,c,d,u]),(0,A.jsx)(S.Panel,{className:t,ref:n,children:(0,A.jsx)(S.PanelBody,{title:i,opened:s,onToggle:()=>{o(e,!s)},scrollAfterOpen:!c,children:({opened:e})=>(0,A.jsx)(S.__unstableDisclosureContent,{className:"wp-block-widget-area__panel-body-content",visible:e,children:(0,A.jsx)(m.EntityProvider,{kind:"root",type:"postType",id:`widget-area-${r}`,children:(0,A.jsx)(ut,{id:r})})})})})}};function wt({text:e,children:t}){const r=(0,T.useCopyToClipboard)(e);return(0,A.jsx)(S.Button,{__next40pxDefaultSize:!0,variant:"secondary",ref:r,children:t})}function _t({message:e,error:t}){const r=[(0,A.jsx)(wt,{text:t.stack,children:(0,y.__)("Copy Error")},"copy-error")];return(0,A.jsx)(be.Warning,{className:"edit-widgets-error-boundary",actions:r,children:e})}class bt extends p.Component{constructor(){super(...arguments),this.state={error:null}}componentDidCatch(e){(0,at.doAction)("editor.ErrorBoundary.errorLogged",e)}static getDerivedStateFromError(e){return{error:e}}render(){return this.state.error?(0,A.jsx)(_t,{message:(0,y.__)("The editor has encountered an unexpected error."),error:this.state.error}):this.props.children}}const ft=window.wp.patterns,xt=window.wp.keyboardShortcuts,yt=window.wp.keycodes;function vt(){const{redo:e,undo:t}=(0,l.useDispatch)(m.store),{saveEditedWidgetAreas:r}=(0,l.useDispatch)(nt);return(0,xt.useShortcut)("core/edit-widgets/undo",(e=>{t(),e.preventDefault()})),(0,xt.useShortcut)("core/edit-widgets/redo",(t=>{e(),t.preventDefault()})),(0,xt.useShortcut)("core/edit-widgets/save",(e=>{e.preventDefault(),r()})),null}vt.Register=function(){const{registerShortcut:e}=(0,l.useDispatch)(xt.store);return(0,p.useEffect)((()=>{e({name:"core/edit-widgets/undo",category:"global",description:(0,y.__)("Undo your last changes."),keyCombination:{modifier:"primary",character:"z"}}),e({name:"core/edit-widgets/redo",category:"global",description:(0,y.__)("Redo your last undo."),keyCombination:{modifier:"primaryShift",character:"z"},aliases:(0,yt.isAppleOS)()?[]:[{modifier:"primary",character:"y"}]}),e({name:"core/edit-widgets/save",category:"global",description:(0,y.__)("Save your changes."),keyCombination:{modifier:"primary",character:"s"}}),e({name:"core/edit-widgets/keyboard-shortcuts",category:"main",description:(0,y.__)("Display these keyboard shortcuts."),keyCombination:{modifier:"access",character:"h"}}),e({name:"core/edit-widgets/next-region",category:"global",description:(0,y.__)("Navigate to the next part of the editor."),keyCombination:{modifier:"ctrl",character:"`"},aliases:[{modifier:"access",character:"n"}]}),e({name:"core/edit-widgets/previous-region",category:"global",description:(0,y.__)("Navigate to the previous part of the editor."),keyCombination:{modifier:"ctrlShift",character:"`"},aliases:[{modifier:"access",character:"p"},{modifier:"ctrlShift",character:"~"}]})}),[e]),null};const kt=vt,jt=()=>(0,l.useSelect)((e=>{const{getBlockSelectionEnd:t,getBlockName:r}=e(be.store),i=t();if("core/widget-area"===r(i))return i;const{getParentWidgetAreaBlock:s}=e(nt),o=s(i),n=o?.clientId;if(n)return n;const{getEntityRecord:a}=e(m.store),c=a(ye,ke,"widget-areas");return c?.blocks[0]?.clientId}),[]),{ExperimentalBlockEditorProvider:St}=st(be.privateApis),{PatternsMenuItems:Et}=st(ft.privateApis),{BlockKeyboardShortcuts:At}=st(h.privateApis),It=[];function Ct({blockEditorSettings:e,children:t,...r}){const i=(0,T.useViewportMatch)("medium"),{hasUploadPermissions:s,reusableBlocks:o,isFixedToolbarActive:n,keepCaretInsideBlock:a,pageOnFront:c,pageForPosts:d}=(0,l.useSelect)((e=>{var t;const{canUser:r,getEntityRecord:i,getEntityRecords:s}=e(m.store),o=r("read",{kind:"root",name:"site"})?i("root","site"):void 0;return{hasUploadPermissions:null===(t=r("create",{kind:"root",name:"media"}))||void 0===t||t,reusableBlocks:It,isFixedToolbarActive:!!e(_.store).get("core/edit-widgets","fixedToolbar"),keepCaretInsideBlock:!!e(_.store).get("core/edit-widgets","keepCaretInsideBlock"),pageOnFront:o?.page_on_front,pageForPosts:o?.page_for_posts}}),[]),{setIsInserterOpened:u}=(0,l.useDispatch)(nt),g=(0,p.useMemo)((()=>{let t;return s&&(t=({onError:t,...r})=>{(0,dt.uploadMedia)({wpAllowedMimeTypes:e.allowedMimeTypes,onError:({message:e})=>t(e),...r})}),{...e,__experimentalReusableBlocks:o,hasFixedToolbar:n||!i,keepCaretInsideBlock:a,mediaUpload:t,templateLock:"all",__experimentalSetIsInserterOpened:u,pageOnFront:c,pageForPosts:d,editorTool:"edit"}}),[s,e,n,i,a,o,u,c,d]),h=jt(),[w,b,f]=(0,m.useEntityBlockEditor)(ye,ke,{id:"widget-areas"});return(0,A.jsxs)(S.SlotFillProvider,{children:[(0,A.jsx)(kt.Register,{}),(0,A.jsx)(At,{}),(0,A.jsxs)(St,{value:w,onInput:b,onChange:f,settings:g,useSubRegistry:!1,...r,children:[t,(0,A.jsx)(Et,{rootClientId:h})]})]})}const Nt=(0,A.jsx)(E.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,A.jsx)(E.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zM8.5 18.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h2.5v13zm10-.5c0 .3-.2.5-.5.5h-8v-13h8c.3 0 .5.2.5.5v12z"})}),Bt=(0,A.jsx)(E.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,A.jsx)(E.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4 14.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h8v13zm4.5-.5c0 .3-.2.5-.5.5h-2.5v-13H18c.3 0 .5.2.5.5v12z"})}),Tt=(0,A.jsx)(E.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,A.jsx)(E.Path,{d:"M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z"})}),Lt=window.wp.url,Rt=window.wp.dom;function Wt({selectedWidgetAreaId:e}){const t=(0,l.useSelect)((e=>e(nt).getWidgetAreas()),[]),r=(0,p.useMemo)((()=>e&&t?.find((t=>t.id===e))),[e,t]);let i;return i=r?"wp_inactive_widgets"===e?(0,y.__)("Blocks in this Widget Area will not be displayed in your site."):r.description:(0,y.__)("Widget Areas are global parts in your site’s layout that can accept blocks. These vary by theme, but are typically parts like your Sidebar or Footer."),(0,A.jsx)("div",{className:"edit-widgets-widget-areas",children:(0,A.jsxs)("div",{className:"edit-widgets-widget-areas__top-container",children:[(0,A.jsx)(be.BlockIcon,{icon:Tt}),(0,A.jsxs)("div",{children:[(0,A.jsx)("p",{dangerouslySetInnerHTML:{__html:(0,Rt.safeHTML)(i)}}),0===t?.length&&(0,A.jsx)("p",{children:(0,y.__)("Your theme does not contain any Widget Areas.")}),!r&&(0,A.jsx)(S.Button,{__next40pxDefaultSize:!0,href:(0,Lt.addQueryArgs)("customize.php",{"autofocus[panel]":"widgets",return:window.location.pathname}),variant:"tertiary",children:(0,y.__)("Manage with live preview")})]})]})})}const Pt=p.Platform.select({web:!0,native:!1}),Mt="edit-widgets/block-inspector",Ot="edit-widgets/block-areas",{Tabs:Vt}=st(S.privateApis);function Dt({selectedWidgetAreaBlock:e}){return(0,A.jsxs)(Vt.TabList,{children:[(0,A.jsx)(Vt.Tab,{tabId:Ot,children:e?e.attributes.name:(0,y.__)("Widget Areas")}),(0,A.jsx)(Vt.Tab,{tabId:Mt,children:(0,y.__)("Block")})]})}function Ft({hasSelectedNonAreaBlock:e,currentArea:t,isGeneralSidebarOpen:r,selectedWidgetAreaBlock:i}){const{enableComplementaryArea:s}=(0,l.useDispatch)(X);(0,p.useEffect)((()=>{e&&t===Ot&&r&&s("core/edit-widgets",Mt),!e&&t===Mt&&r&&s("core/edit-widgets",Ot)}),[e,s]);const o=(0,p.useContext)(Vt.Context);return(0,A.jsx)(ge,{className:"edit-widgets-sidebar",header:(0,A.jsx)(Vt.Context.Provider,{value:o,children:(0,A.jsx)(Dt,{selectedWidgetAreaBlock:i})}),headerClassName:"edit-widgets-sidebar__panel-tabs",title:(0,y.__)("Settings"),closeLabel:(0,y.__)("Close Settings"),scope:"core/edit-widgets",identifier:t,icon:(0,y.isRTL)()?Nt:Bt,isActiveByDefault:Pt,children:(0,A.jsxs)(Vt.Context.Provider,{value:o,children:[(0,A.jsx)(Vt.TabPanel,{tabId:Ot,focusable:!1,children:(0,A.jsx)(Wt,{selectedWidgetAreaId:i?.attributes.id})}),(0,A.jsx)(Vt.TabPanel,{tabId:Mt,focusable:!1,children:e?(0,A.jsx)(be.BlockInspector,{}):(0,A.jsx)("span",{className:"block-editor-block-inspector__no-blocks",children:(0,y.__)("No block selected.")})})]})})}function Gt(){const{currentArea:e,hasSelectedNonAreaBlock:t,isGeneralSidebarOpen:r,selectedWidgetAreaBlock:i}=(0,l.useSelect)((e=>{const{getSelectedBlock:t,getBlock:r,getBlockParentsByBlockName:i}=e(be.store),{getActiveComplementaryArea:s}=e(X),o=t(),n=s(nt.name);let a,c=n;return c||(c=o?Mt:Ot),o&&(a="core/widget-area"===o.name?o:r(i(o.clientId,"core/widget-area")[0])),{currentArea:c,hasSelectedNonAreaBlock:!(!o||"core/widget-area"===o.name),isGeneralSidebarOpen:!!n,selectedWidgetAreaBlock:a}}),[]),{enableComplementaryArea:s}=(0,l.useDispatch)(X),o=(0,p.useCallback)((e=>{e&&s(nt.name,e)}),[s]);return(0,A.jsx)(Vt,{selectedTabId:r?e:null,onSelect:o,selectOnMove:!1,children:(0,A.jsx)(Ft,{hasSelectedNonAreaBlock:t,currentArea:e,isGeneralSidebarOpen:r,selectedWidgetAreaBlock:i})})}const zt=(0,A.jsx)(E.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,A.jsx)(E.Path,{d:"M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z"})}),Ht=(0,A.jsx)(E.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,A.jsx)(E.Path,{d:"M3 6h11v1.5H3V6Zm3.5 5.5h11V13h-11v-1.5ZM21 17H10v1.5h11V17Z"})}),Ut=(0,A.jsx)(E.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,A.jsx)(E.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"})}),$t=(0,A.jsx)(E.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,A.jsx)(E.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"})});const Yt=(0,p.forwardRef)((function(e,t){const r=(0,l.useSelect)((e=>e(m.store).hasUndo()),[]),{undo:i}=(0,l.useDispatch)(m.store);return(0,A.jsx)(S.Button,{...e,ref:t,icon:(0,y.isRTL)()?$t:Ut,label:(0,y.__)("Undo"),shortcut:yt.displayShortcut.primary("z"),"aria-disabled":!r,onClick:r?i:void 0,size:"compact"})}));const Zt=(0,p.forwardRef)((function(e,t){const r=(0,yt.isAppleOS)()?yt.displayShortcut.primaryShift("z"):yt.displayShortcut.primary("y"),i=(0,l.useSelect)((e=>e(m.store).hasRedo()),[]),{redo:s}=(0,l.useDispatch)(m.store);return(0,A.jsx)(S.Button,{...e,ref:t,icon:(0,y.isRTL)()?Ut:$t,label:(0,y.__)("Redo"),shortcut:r,"aria-disabled":!i,onClick:i?s:void 0,size:"compact"})}));const Kt=function(){const e=(0,T.useViewportMatch)("medium"),{isInserterOpen:t,isListViewOpen:r,inserterSidebarToggleRef:i,listViewToggleRef:s}=(0,l.useSelect)((e=>{const{isInserterOpened:t,getInserterSidebarToggleRef:r,isListViewOpened:i,getListViewToggleRef:s}=st(e(nt));return{isInserterOpen:t(),isListViewOpen:i(),inserterSidebarToggleRef:r(),listViewToggleRef:s()}}),[]),{setIsInserterOpened:o,setIsListViewOpened:n}=(0,l.useDispatch)(nt),a=(0,p.useCallback)((()=>n(!r)),[n,r]),c=(0,p.useCallback)((()=>o(!t)),[o,t]);return(0,A.jsxs)(be.NavigableToolbar,{className:"edit-widgets-header-toolbar","aria-label":(0,y.__)("Document tools"),variant:"unstyled",children:[(0,A.jsx)(S.ToolbarItem,{ref:i,as:S.Button,className:"edit-widgets-header-toolbar__inserter-toggle",variant:"primary",isPressed:t,onMouseDown:e=>{e.preventDefault()},onClick:c,icon:zt,label:(0,y._x)("Block Inserter","Generic label for block inserter button"),size:"compact"}),e&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(S.ToolbarItem,{as:Yt}),(0,A.jsx)(S.ToolbarItem,{as:Zt}),(0,A.jsx)(S.ToolbarItem,{as:S.Button,className:"edit-widgets-header-toolbar__list-view-toggle",icon:Ht,isPressed:r,label:(0,y.__)("List View"),onClick:a,ref:s,size:"compact"})]})]})};const qt=function(){const{hasEditedWidgetAreaIds:e,isSaving:t}=(0,l.useSelect)((e=>{const{getEditedWidgetAreas:t,isSavingWidgetAreas:r}=e(nt);return{hasEditedWidgetAreaIds:t()?.length>0,isSaving:r()}}),[]),{saveEditedWidgetAreas:r}=(0,l.useDispatch)(nt),i=t||!e;return(0,A.jsx)(S.Button,{variant:"primary",isBusy:t,"aria-disabled":i,onClick:i?void 0:r,size:"compact",children:t?(0,y.__)("Saving…"):(0,y.__)("Update")})},Jt=(0,A.jsx)(E.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,A.jsx)(E.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"})}),Qt=(0,A.jsx)(E.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,A.jsx)(E.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"})}),Xt=[{keyCombination:{modifier:"primary",character:"b"},description:(0,y.__)("Make the selected text bold.")},{keyCombination:{modifier:"primary",character:"i"},description:(0,y.__)("Make the selected text italic.")},{keyCombination:{modifier:"primary",character:"k"},description:(0,y.__)("Convert the selected text into a link.")},{keyCombination:{modifier:"primaryShift",character:"k"},description:(0,y.__)("Remove a link.")},{keyCombination:{character:"[["},description:(0,y.__)("Insert a link to a post or page.")},{keyCombination:{modifier:"primary",character:"u"},description:(0,y.__)("Underline the selected text.")},{keyCombination:{modifier:"access",character:"d"},description:(0,y.__)("Strikethrough the selected text.")},{keyCombination:{modifier:"access",character:"x"},description:(0,y.__)("Make the selected text inline code.")},{keyCombination:{modifier:"access",character:"0"},aliases:[{modifier:"access",character:"7"}],description:(0,y.__)("Convert the current heading to a paragraph.")},{keyCombination:{modifier:"access",character:"1-6"},description:(0,y.__)("Convert the current paragraph or heading to a heading of level 1 to 6.")},{keyCombination:{modifier:"primaryShift",character:"SPACE"},description:(0,y.__)("Add non breaking space.")}];function er({keyCombination:e,forceAriaLabel:t}){const r=e.modifier?yt.displayShortcutList[e.modifier](e.character):e.character,i=e.modifier?yt.shortcutAriaLabel[e.modifier](e.character):e.character,s=Array.isArray(r)?r:[r];return(0,A.jsx)("kbd",{className:"edit-widgets-keyboard-shortcut-help-modal__shortcut-key-combination","aria-label":t||i,children:s.map(((e,t)=>"+"===e?(0,A.jsx)(p.Fragment,{children:e},t):(0,A.jsx)("kbd",{className:"edit-widgets-keyboard-shortcut-help-modal__shortcut-key",children:e},t)))})}const tr=function({description:e,keyCombination:t,aliases:r=[],ariaLabel:i}){return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)("div",{className:"edit-widgets-keyboard-shortcut-help-modal__shortcut-description",children:e}),(0,A.jsxs)("div",{className:"edit-widgets-keyboard-shortcut-help-modal__shortcut-term",children:[(0,A.jsx)(er,{keyCombination:t,forceAriaLabel:i}),r.map(((e,t)=>(0,A.jsx)(er,{keyCombination:e,forceAriaLabel:i},t)))]})]})};const rr=function({name:e}){const{keyCombination:t,description:r,aliases:i}=(0,l.useSelect)((t=>{const{getShortcutKeyCombination:r,getShortcutDescription:i,getShortcutAliases:s}=t(xt.store);return{keyCombination:r(e),aliases:s(e),description:i(e)}}),[e]);return t?(0,A.jsx)(tr,{keyCombination:t,description:r,aliases:i}):null},ir=({shortcuts:e})=>(0,A.jsx)("ul",{className:"edit-widgets-keyboard-shortcut-help-modal__shortcut-list",role:"list",children:e.map(((e,t)=>(0,A.jsx)("li",{className:"edit-widgets-keyboard-shortcut-help-modal__shortcut",children:"string"==typeof e?(0,A.jsx)(rr,{name:e}):(0,A.jsx)(tr,{...e})},t)))}),sr=({title:e,shortcuts:t,className:r})=>(0,A.jsxs)("section",{className:j("edit-widgets-keyboard-shortcut-help-modal__section",r),children:[!!e&&(0,A.jsx)("h2",{className:"edit-widgets-keyboard-shortcut-help-modal__section-title",children:e}),(0,A.jsx)(ir,{shortcuts:t})]}),or=({title:e,categoryName:t,additionalShortcuts:r=[]})=>{const i=(0,l.useSelect)((e=>e(xt.store).getCategoryShortcuts(t)),[t]);return(0,A.jsx)(sr,{title:e,shortcuts:i.concat(r)})};function nr({isModalActive:e,toggleModal:t}){return(0,xt.useShortcut)("core/edit-widgets/keyboard-shortcuts",t,{bindGlobal:!0}),e?(0,A.jsxs)(S.Modal,{className:"edit-widgets-keyboard-shortcut-help-modal",title:(0,y.__)("Keyboard shortcuts"),onRequestClose:t,children:[(0,A.jsx)(sr,{className:"edit-widgets-keyboard-shortcut-help-modal__main-shortcuts",shortcuts:["core/edit-widgets/keyboard-shortcuts"]}),(0,A.jsx)(or,{title:(0,y.__)("Global shortcuts"),categoryName:"global"}),(0,A.jsx)(or,{title:(0,y.__)("Selection shortcuts"),categoryName:"selection"}),(0,A.jsx)(or,{title:(0,y.__)("Block shortcuts"),categoryName:"block",additionalShortcuts:[{keyCombination:{character:"/"},description:(0,y.__)("Change the block type after adding a new paragraph."),ariaLabel:(0,y.__)("Forward-slash")}]}),(0,A.jsx)(sr,{title:(0,y.__)("Text formatting"),shortcuts:Xt}),(0,A.jsx)(or,{title:(0,y.__)("List View shortcuts"),categoryName:"list-view"})]}):null}const{Fill:ar,Slot:cr}=(0,S.createSlotFill)("EditWidgetsToolsMoreMenuGroup");ar.Slot=({fillProps:e})=>(0,A.jsx)(cr,{fillProps:e,children:e=>e.length>0&&e});const dr=ar;function lr(){const[e,t]=(0,p.useState)(!1),r=()=>t(!e);(0,xt.useShortcut)("core/edit-widgets/keyboard-shortcuts",r);const i=(0,T.useViewportMatch)("medium");return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(S.DropdownMenu,{icon:Jt,label:(0,y.__)("Options"),popoverProps:{placement:"bottom-end",className:"more-menu-dropdown__content"},toggleProps:{tooltipPosition:"bottom",size:"compact"},children:e=>(0,A.jsxs)(A.Fragment,{children:[i&&(0,A.jsx)(S.MenuGroup,{label:(0,y._x)("View","noun"),children:(0,A.jsx)(_.PreferenceToggleMenuItem,{scope:"core/edit-widgets",name:"fixedToolbar",label:(0,y.__)("Top toolbar"),info:(0,y.__)("Access all block and document tools in a single place"),messageActivated:(0,y.__)("Top toolbar activated"),messageDeactivated:(0,y.__)("Top toolbar deactivated")})}),(0,A.jsxs)(S.MenuGroup,{label:(0,y.__)("Tools"),children:[(0,A.jsx)(S.MenuItem,{onClick:()=>{t(!0)},shortcut:yt.displayShortcut.access("h"),children:(0,y.__)("Keyboard shortcuts")}),(0,A.jsx)(_.PreferenceToggleMenuItem,{scope:"core/edit-widgets",name:"welcomeGuide",label:(0,y.__)("Welcome Guide")}),(0,A.jsxs)(S.MenuItem,{role:"menuitem",icon:Qt,href:(0,y.__)("https://wordpress.org/documentation/article/block-based-widgets-editor/"),target:"_blank",rel:"noopener noreferrer",children:[(0,y.__)("Help"),(0,A.jsx)(S.VisuallyHidden,{as:"span",children:(0,y.__)("(opens in a new tab)")})]}),(0,A.jsx)(dr.Slot,{fillProps:{onClose:e}})]}),(0,A.jsxs)(S.MenuGroup,{label:(0,y.__)("Preferences"),children:[(0,A.jsx)(_.PreferenceToggleMenuItem,{scope:"core/edit-widgets",name:"keepCaretInsideBlock",label:(0,y.__)("Contain text cursor inside block"),info:(0,y.__)("Aids screen readers by stopping text caret from leaving blocks."),messageActivated:(0,y.__)("Contain text cursor inside block activated"),messageDeactivated:(0,y.__)("Contain text cursor inside block deactivated")}),(0,A.jsx)(_.PreferenceToggleMenuItem,{scope:"core/edit-widgets",name:"themeStyles",info:(0,y.__)("Make the editor look like your theme."),label:(0,y.__)("Use theme styles")}),i&&(0,A.jsx)(_.PreferenceToggleMenuItem,{scope:"core/edit-widgets",name:"showBlockBreadcrumbs",label:(0,y.__)("Display block breadcrumbs"),info:(0,y.__)("Shows block breadcrumbs at the bottom of the editor."),messageActivated:(0,y.__)("Display block breadcrumbs activated"),messageDeactivated:(0,y.__)("Display block breadcrumbs deactivated")})]})]})}),(0,A.jsx)(nr,{isModalActive:e,toggleModal:r})]})}const ur=function(){const e=(0,T.useViewportMatch)("medium"),t=(0,p.useRef)(),{hasFixedToolbar:r}=(0,l.useSelect)((e=>({hasFixedToolbar:!!e(_.store).get("core/edit-widgets","fixedToolbar")})),[]);return(0,A.jsx)(A.Fragment,{children:(0,A.jsxs)("div",{className:"edit-widgets-header",children:[(0,A.jsxs)("div",{className:"edit-widgets-header__navigable-toolbar-wrapper",children:[e&&(0,A.jsx)("h1",{className:"edit-widgets-header__title",children:(0,y.__)("Widgets")}),!e&&(0,A.jsx)(S.VisuallyHidden,{as:"h1",className:"edit-widgets-header__title",children:(0,y.__)("Widgets")}),(0,A.jsx)(Kt,{}),r&&e&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)("div",{className:"selected-block-tools-wrapper",children:(0,A.jsx)(be.BlockToolbar,{hideDragHandle:!0})}),(0,A.jsx)(S.Popover.Slot,{ref:t,name:"block-toolbar"})]})]}),(0,A.jsxs)("div",{className:"edit-widgets-header__actions",children:[(0,A.jsx)(ce.Slot,{scope:"core/edit-widgets"}),(0,A.jsx)(qt,{}),(0,A.jsx)(lr,{})]})]})})};const gr=function(){const{removeNotice:e}=(0,l.useDispatch)(v.store),{notices:t}=(0,l.useSelect)((e=>({notices:e(v.store).getNotices()})),[]),r=t.filter((({isDismissible:e,type:t})=>e&&"default"===t)),i=t.filter((({isDismissible:e,type:t})=>!e&&"default"===t)),s=t.filter((({type:e})=>"snackbar"===e)).slice(-3);return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(S.NoticeList,{notices:i,className:"edit-widgets-notices__pinned"}),(0,A.jsx)(S.NoticeList,{notices:r,className:"edit-widgets-notices__dismissible",onRemove:e}),(0,A.jsx)(S.SnackbarList,{notices:s,className:"edit-widgets-notices__snackbar",onRemove:e})]})};function pr({blockEditorSettings:e}){const t=(0,l.useSelect)((e=>!!e(_.store).get("core/edit-widgets","themeStyles")),[]),r=(0,T.useViewportMatch)("medium"),i=(0,p.useMemo)((()=>t?e.styles:[]),[e,t]);return(0,A.jsxs)("div",{className:"edit-widgets-block-editor",children:[(0,A.jsx)(gr,{}),!r&&(0,A.jsx)(be.BlockToolbar,{hideDragHandle:!0}),(0,A.jsxs)(be.BlockTools,{children:[(0,A.jsx)(kt,{}),(0,A.jsx)(be.__unstableEditorStyles,{styles:i,scope:":where(.editor-styles-wrapper)"}),(0,A.jsx)(be.BlockSelectionClearer,{children:(0,A.jsx)(be.WritingFlow,{children:(0,A.jsx)(be.BlockList,{className:"edit-widgets-main-block-list"})})})]})]})}const hr=()=>{const e=(0,l.useSelect)((e=>{const{getEntityRecord:t}=e(m.store),r=t(ye,ke,"widget-areas");return r?.blocks[0]?.clientId}),[]);return(0,l.useSelect)((t=>{const{getBlockRootClientId:r,getBlockSelectionEnd:i,getBlockOrder:s,getBlockIndex:o}=t(be.store),n=t(nt).__experimentalGetInsertionPoint();if(n.rootClientId)return n;const a=i()||e,c=r(a);return a&&""===c?{rootClientId:a,insertionIndex:s(a).length}:{rootClientId:c,insertionIndex:o(a)+1}}),[e])};function mr(){const e=(0,T.useViewportMatch)("medium","<"),{rootClientId:t,insertionIndex:r}=hr(),{setIsInserterOpened:i}=(0,l.useDispatch)(nt),s=(0,p.useCallback)((()=>i(!1)),[i]),[o,n]=(0,T.__experimentalUseDialog)({onClose:s,focusOnMount:!0}),a=(0,p.useRef)();return(0,A.jsx)("div",{ref:o,...n,className:"edit-widgets-layout__inserter-panel",children:(0,A.jsx)("div",{className:"edit-widgets-layout__inserter-panel-content",children:(0,A.jsx)(be.__experimentalLibrary,{showInserterHelpPanel:!0,shouldFocusBlock:e,rootClientId:t,__experimentalInsertionIndex:r,ref:a,onClose:s})})})}function wr(){const{setIsListViewOpened:e}=(0,l.useDispatch)(nt),{getListViewToggleRef:t}=st((0,l.useSelect)(nt)),[r,i]=(0,p.useState)(null),s=(0,T.useFocusOnMount)("firstElement"),o=(0,p.useCallback)((()=>{e(!1),t().current?.focus()}),[t,e]),n=(0,p.useCallback)((e=>{e.keyCode!==yt.ESCAPE||e.defaultPrevented||(e.preventDefault(),o())}),[o]);return(0,A.jsxs)("div",{className:"edit-widgets-editor__list-view-panel",onKeyDown:n,children:[(0,A.jsxs)("div",{className:"edit-widgets-editor__list-view-panel-header",children:[(0,A.jsx)("strong",{children:(0,y.__)("List View")}),(0,A.jsx)(S.Button,{icon:R,label:(0,y.__)("Close"),onClick:o,size:"compact"})]}),(0,A.jsx)("div",{className:"edit-widgets-editor__list-view-panel-content",ref:(0,T.useMergeRefs)([s,i]),children:(0,A.jsx)(be.__experimentalListView,{dropZoneElement:r})})]})}function _r(){const{isInserterOpen:e,isListViewOpen:t}=(0,l.useSelect)((e=>{const{isInserterOpened:t,isListViewOpened:r}=e(nt);return{isInserterOpen:t(),isListViewOpen:r()}}),[]);return e?(0,A.jsx)(mr,{}):t?(0,A.jsx)(wr,{}):null}const br={header:(0,y.__)("Widgets top bar"),body:(0,y.__)("Widgets and blocks"),sidebar:(0,y.__)("Widgets settings"),footer:(0,y.__)("Widgets footer")};const fr=function({blockEditorSettings:e}){const t=(0,T.useViewportMatch)("medium","<"),r=(0,T.useViewportMatch)("huge",">="),{setIsInserterOpened:i,setIsListViewOpened:s,closeGeneralSidebar:o}=(0,l.useDispatch)(nt),{hasBlockBreadCrumbsEnabled:n,hasSidebarEnabled:a,isInserterOpened:c,isListViewOpened:d}=(0,l.useSelect)((e=>({hasSidebarEnabled:!!e(X).getActiveComplementaryArea(nt.name),isInserterOpened:!!e(nt).isInserterOpened(),isListViewOpened:!!e(nt).isListViewOpened(),hasBlockBreadCrumbsEnabled:!!e(_.store).get("core/edit-widgets","showBlockBreadcrumbs")})),[]);(0,p.useEffect)((()=>{a&&!r&&(i(!1),s(!1))}),[a,r]),(0,p.useEffect)((()=>{!c&&!d||r||o()}),[c,d,r]);const u=d?(0,y.__)("List View"):(0,y.__)("Block Library"),g=d||c;return(0,A.jsx)(_e,{labels:{...br,secondarySidebar:u},header:(0,A.jsx)(ur,{}),secondarySidebar:g&&(0,A.jsx)(_r,{}),sidebar:(0,A.jsx)(ge.Slot,{scope:"core/edit-widgets"}),content:(0,A.jsx)(A.Fragment,{children:(0,A.jsx)(pr,{blockEditorSettings:e})}),footer:n&&!t&&(0,A.jsx)("div",{className:"edit-widgets-layout__footer",children:(0,A.jsx)(be.BlockBreadcrumb,{rootLabelText:(0,y.__)("Widgets")})})})};function xr(){const e=(0,l.useSelect)((e=>{const{getEditedWidgetAreas:t}=e(nt),r=t();return r?.length>0}),[]);return(0,p.useEffect)((()=>{const t=t=>{if(e)return t.returnValue=(0,y.__)("You have unsaved changes. If you proceed, they will be lost."),t.returnValue};return window.addEventListener("beforeunload",t),()=>{window.removeEventListener("beforeunload",t)}}),[e]),null}function yr(){var e;const t=(0,l.useSelect)((e=>!!e(_.store).get("core/edit-widgets","welcomeGuide")),[]),{toggle:r}=(0,l.useDispatch)(_.store),i=(0,l.useSelect)((e=>e(nt).getWidgetAreas({per_page:-1})),[]);if(!t)return null;const s=i?.every((e=>"wp_inactive_widgets"===e.id||e.widgets.every((e=>e.startsWith("block-"))))),o=null!==(e=i?.filter((e=>"wp_inactive_widgets"!==e.id)).length)&&void 0!==e?e:0;return(0,A.jsx)(S.Guide,{className:"edit-widgets-welcome-guide",contentLabel:(0,y.__)("Welcome to block Widgets"),finishButtonText:(0,y.__)("Get started"),onFinish:()=>r("core/edit-widgets","welcomeGuide"),pages:[{image:(0,A.jsx)(vr,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-canvas.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-canvas.gif"}),content:(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)("h1",{className:"edit-widgets-welcome-guide__heading",children:(0,y.__)("Welcome to block Widgets")}),s?(0,A.jsx)(A.Fragment,{children:(0,A.jsx)("p",{className:"edit-widgets-welcome-guide__text",children:(0,y.sprintf)((0,y._n)("Your theme provides %s “block” area for you to add and edit content. Try adding a search bar, social icons, or other types of blocks here and see how they’ll look on your site.","Your theme provides %s different “block” areas for you to add and edit content. Try adding a search bar, social icons, or other types of blocks here and see how they’ll look on your site.",o),o)})}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)("p",{className:"edit-widgets-welcome-guide__text",children:(0,y.__)("You can now add any block to your site’s widget areas. Don’t worry, all of your favorite widgets still work flawlessly.")}),(0,A.jsxs)("p",{className:"edit-widgets-welcome-guide__text",children:[(0,A.jsx)("strong",{children:(0,y.__)("Want to stick with the old widgets?")})," ",(0,A.jsx)(S.ExternalLink,{href:(0,y.__)("https://wordpress.org/plugins/classic-widgets/"),children:(0,y.__)("Get the Classic Widgets plugin.")})]})]})]})},{image:(0,A.jsx)(vr,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-editor.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-editor.gif"}),content:(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)("h1",{className:"edit-widgets-welcome-guide__heading",children:(0,y.__)("Customize each block")}),(0,A.jsx)("p",{className:"edit-widgets-welcome-guide__text",children:(0,y.__)("Each block comes with its own set of controls for changing things like color, width, and alignment. These will show and hide automatically when you have a block selected.")})]})},{image:(0,A.jsx)(vr,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-library.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-library.gif"}),content:(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)("h1",{className:"edit-widgets-welcome-guide__heading",children:(0,y.__)("Explore all blocks")}),(0,A.jsx)("p",{className:"edit-widgets-welcome-guide__text",children:(0,p.createInterpolateElement)((0,y.__)("All of the blocks available to you live in the block library. You’ll find it wherever you see the icon."),{InserterIconImage:(0,A.jsx)("img",{className:"edit-widgets-welcome-guide__inserter-icon",alt:(0,y.__)("inserter"),src:"data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='18' height='18' rx='2' fill='%231E1E1E'/%3E%3Cpath d='M9.22727 4V14M4 8.77273H14' stroke='white' stroke-width='1.5'/%3E%3C/svg%3E%0A"})})})]})},{image:(0,A.jsx)(vr,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-documentation.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-documentation.gif"}),content:(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)("h1",{className:"edit-widgets-welcome-guide__heading",children:(0,y.__)("Learn more")}),(0,A.jsx)("p",{className:"edit-widgets-welcome-guide__text",children:(0,p.createInterpolateElement)((0,y.__)("New to the block editor? Want to learn more about using it? Here's a detailed guide."),{a:(0,A.jsx)(S.ExternalLink,{href:(0,y.__)("https://wordpress.org/documentation/article/wordpress-block-editor/")})})})]})}]})}function vr({nonAnimatedSrc:e,animatedSrc:t}){return(0,A.jsxs)("picture",{className:"edit-widgets-welcome-guide__image",children:[(0,A.jsx)("source",{srcSet:e,media:"(prefers-reduced-motion: reduce)"}),(0,A.jsx)("img",{src:t,width:"312",height:"240",alt:""})]})}const kr=function({blockEditorSettings:e}){const{createErrorNotice:t}=(0,l.useDispatch)(v.store),r=(0,S.__unstableUseNavigateRegions)();return(0,A.jsx)(bt,{children:(0,A.jsx)("div",{className:r.className,...r,ref:r.ref,children:(0,A.jsxs)(Ct,{blockEditorSettings:e,children:[(0,A.jsx)(fr,{blockEditorSettings:e}),(0,A.jsx)(Gt,{}),(0,A.jsx)(L.PluginArea,{onError:function(e){t((0,y.sprintf)((0,y.__)('The "%s" plugin has encountered an error and cannot be rendered.'),e))}}),(0,A.jsx)(xr,{}),(0,A.jsx)(yr,{})]})})})},jr=["core/more","core/freeform","core/template-part","core/block"];function Sr(e,t){const r=document.getElementById(e),i=(0,p.createRoot)(r),s=(0,h.__experimentalGetCoreBlocks)().filter((e=>!(jr.includes(e.name)||e.name.startsWith("core/post")||e.name.startsWith("core/query")||e.name.startsWith("core/site")||e.name.startsWith("core/navigation"))));return(0,l.dispatch)(_.store).setDefaults("core/edit-widgets",{fixedToolbar:!1,welcomeGuide:!0,showBlockBreadcrumbs:!0,themeStyles:!0}),(0,l.dispatch)(d.store).reapplyBlockTypeFilters(),(0,h.registerCoreBlocks)(s),(0,w.registerLegacyWidgetBlock)(),(0,w.registerLegacyWidgetVariations)(t),Ir(c),(0,w.registerWidgetGroupBlock)(),t.__experimentalFetchLinkSuggestions=(e,r)=>(0,m.__experimentalFetchLinkSuggestions)(e,r,t),(0,d.setFreeformContentHandlerName)("core/html"),i.render((0,A.jsx)(p.StrictMode,{children:(0,A.jsx)(kr,{blockEditorSettings:t})})),i}const Er=Sr;function Ar(){g()("wp.editWidgets.reinitializeEditor",{since:"6.2",version:"6.3"})}const Ir=e=>{if(!e)return;const{metadata:t,settings:r,name:i}=e;t&&(0,d.unstable__bootstrapServerSideBlockDefinitions)({[i]:t}),(0,d.registerBlockType)(i,r)};(window.wp=window.wp||{}).editWidgets=t})(); \ No newline at end of file diff --git a/wp-includes/js/dist/editor.js b/wp-includes/js/dist/editor.js index 177a1e0e97..8c77925891 100644 --- a/wp-includes/js/dist/editor.js +++ b/wp-includes/js/dist/editor.js @@ -1510,11 +1510,11 @@ __webpack_require__.d(__webpack_exports__, { PlainText: () => (/* reexport */ PlainText), PluginBlockSettingsMenuItem: () => (/* reexport */ plugin_block_settings_menu_item), PluginDocumentSettingPanel: () => (/* reexport */ plugin_document_setting_panel), - PluginMoreMenuItem: () => (/* reexport */ plugin_more_menu_item), + PluginMoreMenuItem: () => (/* reexport */ PluginMoreMenuItem), PluginPostPublishPanel: () => (/* reexport */ plugin_post_publish_panel), PluginPostStatusInfo: () => (/* reexport */ plugin_post_status_info), PluginPrePublishPanel: () => (/* reexport */ plugin_pre_publish_panel), - PluginPreviewMenuItem: () => (/* reexport */ plugin_preview_menu_item), + PluginPreviewMenuItem: () => (/* reexport */ PluginPreviewMenuItem), PluginSidebar: () => (/* reexport */ PluginSidebar), PluginSidebarMoreMenuItem: () => (/* reexport */ PluginSidebarMoreMenuItem), PostAuthor: () => (/* reexport */ post_author), @@ -1529,7 +1529,7 @@ __webpack_require__.d(__webpack_exports__, { PostFeaturedImageCheck: () => (/* reexport */ post_featured_image_check), PostFeaturedImagePanel: () => (/* reexport */ PostFeaturedImagePanel), PostFormat: () => (/* reexport */ PostFormat), - PostFormatCheck: () => (/* reexport */ post_format_check), + PostFormatCheck: () => (/* reexport */ PostFormatCheck), PostLastRevision: () => (/* reexport */ post_last_revision), PostLastRevisionCheck: () => (/* reexport */ post_last_revision_check), PostLastRevisionPanel: () => (/* reexport */ post_last_revision_panel), @@ -1546,8 +1546,6 @@ __webpack_require__.d(__webpack_exports__, { PostScheduleCheck: () => (/* reexport */ PostScheduleCheck), PostScheduleLabel: () => (/* reexport */ PostScheduleLabel), PostSchedulePanel: () => (/* reexport */ PostSchedulePanel), - PostSlug: () => (/* reexport */ PostSlug), - PostSlugCheck: () => (/* reexport */ PostSlugCheck), PostSticky: () => (/* reexport */ PostSticky), PostStickyCheck: () => (/* reexport */ PostStickyCheck), PostSwitchToDraftButton: () => (/* reexport */ PostSwitchToDraftButton), @@ -1556,7 +1554,7 @@ __webpack_require__.d(__webpack_exports__, { PostTaxonomiesCheck: () => (/* reexport */ PostTaxonomiesCheck), PostTaxonomiesFlatTermSelector: () => (/* reexport */ FlatTermSelector), PostTaxonomiesHierarchicalTermSelector: () => (/* reexport */ HierarchicalTermSelector), - PostTaxonomiesPanel: () => (/* reexport */ post_taxonomies_panel), + PostTaxonomiesPanel: () => (/* reexport */ panel_PostTaxonomies), PostTemplatePanel: () => (/* reexport */ PostTemplatePanel), PostTextEditor: () => (/* reexport */ PostTextEditor), PostTitle: () => (/* reexport */ post_title), @@ -1600,10 +1598,12 @@ __webpack_require__.d(__webpack_exports__, { mediaUpload: () => (/* reexport */ mediaUpload), privateApis: () => (/* reexport */ privateApis), registerEntityAction: () => (/* reexport */ api_registerEntityAction), + registerEntityField: () => (/* reexport */ api_registerEntityField), store: () => (/* reexport */ store_store), storeConfig: () => (/* reexport */ storeConfig), transformStyles: () => (/* reexport */ external_wp_blockEditor_namespaceObject.transformStyles), unregisterEntityAction: () => (/* reexport */ api_unregisterEntityAction), + unregisterEntityField: () => (/* reexport */ api_unregisterEntityField), useEntitiesSavedStatesIsDirty: () => (/* reexport */ useIsDirty), usePostScheduleLabel: () => (/* reexport */ usePostScheduleLabel), usePostURLLabel: () => (/* reexport */ usePostURLLabel), @@ -1804,6 +1804,8 @@ __webpack_require__.d(actions_namespaceObject, { toggleEditorPanelOpened: () => (toggleEditorPanelOpened), togglePublishSidebar: () => (togglePublishSidebar), toggleSelection: () => (toggleSelection), + toggleSpotlightMode: () => (toggleSpotlightMode), + toggleTopToolbar: () => (toggleTopToolbar), trashPost: () => (trashPost), undo: () => (undo), unlockPostAutosaving: () => (unlockPostAutosaving), @@ -1816,37 +1818,6 @@ __webpack_require__.d(actions_namespaceObject, { updatePostLock: () => (updatePostLock) }); -// NAMESPACE OBJECT: ./node_modules/@wordpress/editor/build-module/store/private-actions.js -var store_private_actions_namespaceObject = {}; -__webpack_require__.r(store_private_actions_namespaceObject); -__webpack_require__.d(store_private_actions_namespaceObject, { - createTemplate: () => (createTemplate), - hideBlockTypes: () => (hideBlockTypes), - registerEntityAction: () => (registerEntityAction), - registerPostTypeActions: () => (registerPostTypeActions), - removeTemplates: () => (removeTemplates), - revertTemplate: () => (revertTemplate), - saveDirtyEntities: () => (saveDirtyEntities), - setCurrentTemplateId: () => (setCurrentTemplateId), - setIsReady: () => (setIsReady), - showBlockTypes: () => (showBlockTypes), - unregisterEntityAction: () => (unregisterEntityAction) -}); - -// NAMESPACE OBJECT: ./node_modules/@wordpress/editor/build-module/store/private-selectors.js -var store_private_selectors_namespaceObject = {}; -__webpack_require__.r(store_private_selectors_namespaceObject); -__webpack_require__.d(store_private_selectors_namespaceObject, { - getEntityActions: () => (private_selectors_getEntityActions), - getInserterSidebarToggleRef: () => (getInserterSidebarToggleRef), - getInsertionPoint: () => (getInsertionPoint), - getListViewToggleRef: () => (getListViewToggleRef), - getPostBlocksByName: () => (getPostBlocksByName), - getPostIcon: () => (getPostIcon), - hasPostMetaChanges: () => (hasPostMetaChanges), - isEntityReady: () => (private_selectors_isEntityReady) -}); - // NAMESPACE OBJECT: ./node_modules/@wordpress/interface/build-module/store/actions.js var store_actions_namespaceObject = {}; __webpack_require__.r(store_actions_namespaceObject); @@ -1888,6 +1859,40 @@ __webpack_require__.d(build_module_namespaceObject, { store: () => (store) }); +// NAMESPACE OBJECT: ./node_modules/@wordpress/editor/build-module/store/private-actions.js +var store_private_actions_namespaceObject = {}; +__webpack_require__.r(store_private_actions_namespaceObject); +__webpack_require__.d(store_private_actions_namespaceObject, { + createTemplate: () => (createTemplate), + hideBlockTypes: () => (hideBlockTypes), + registerEntityAction: () => (registerEntityAction), + registerEntityField: () => (registerEntityField), + registerPostTypeSchema: () => (registerPostTypeSchema), + removeTemplates: () => (removeTemplates), + revertTemplate: () => (private_actions_revertTemplate), + saveDirtyEntities: () => (saveDirtyEntities), + setCurrentTemplateId: () => (setCurrentTemplateId), + setIsReady: () => (setIsReady), + showBlockTypes: () => (showBlockTypes), + unregisterEntityAction: () => (unregisterEntityAction), + unregisterEntityField: () => (unregisterEntityField) +}); + +// NAMESPACE OBJECT: ./node_modules/@wordpress/editor/build-module/store/private-selectors.js +var store_private_selectors_namespaceObject = {}; +__webpack_require__.r(store_private_selectors_namespaceObject); +__webpack_require__.d(store_private_selectors_namespaceObject, { + getEntityActions: () => (private_selectors_getEntityActions), + getEntityFields: () => (private_selectors_getEntityFields), + getInserter: () => (getInserter), + getInserterSidebarToggleRef: () => (getInserterSidebarToggleRef), + getListViewToggleRef: () => (getListViewToggleRef), + getPostBlocksByName: () => (getPostBlocksByName), + getPostIcon: () => (getPostIcon), + hasPostMetaChanges: () => (hasPostMetaChanges), + isEntityReady: () => (private_selectors_isEntityReady) +}); + ;// external ["wp","data"] const external_wp_data_namespaceObject = window["wp"]["data"]; ;// external ["wp","coreData"] @@ -1935,6 +1940,7 @@ const EDITOR_SETTINGS_DEFAULTS = { }; ;// ./node_modules/@wordpress/editor/build-module/dataviews/store/reducer.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -1977,12 +1983,36 @@ function actions(state = {}, action) { } return state; } +function fields(state = {}, action) { + var _state$action$kind$ac3, _state$action$kind$ac4; + switch (action.type) { + case 'REGISTER_ENTITY_FIELD': + return { + ...state, + [action.kind]: { + ...state[action.kind], + [action.name]: [...((_state$action$kind$ac3 = state[action.kind]?.[action.name]) !== null && _state$action$kind$ac3 !== void 0 ? _state$action$kind$ac3 : []).filter(_field => _field.id !== action.config.id), action.config] + } + }; + case 'UNREGISTER_ENTITY_FIELD': + return { + ...state, + [action.kind]: { + ...state[action.kind], + [action.name]: ((_state$action$kind$ac4 = state[action.kind]?.[action.name]) !== null && _state$action$kind$ac4 !== void 0 ? _state$action$kind$ac4 : []).filter(_field => _field.id !== action.fieldId) + } + }; + } + return state; +} /* harmony default export */ const reducer = ((0,external_wp_data_namespaceObject.combineReducers)({ actions, + fields, isReady })); ;// ./node_modules/@wordpress/editor/build-module/store/reducer.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -2392,25 +2422,6 @@ const external_wp_url_namespaceObject = window["wp"]["url"]; ;// external ["wp","deprecated"] const external_wp_deprecated_namespaceObject = window["wp"]["deprecated"]; var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject); -;// external ["wp","primitives"] -const external_wp_primitives_namespaceObject = window["wp"]["primitives"]; -;// external "ReactJSXRuntime" -const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"]; -;// ./node_modules/@wordpress/icons/build-module/library/layout.js -/** - * WordPress dependencies - */ - - -const layout = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - d: "M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z" - }) -}); -/* harmony default export */ const library_layout = (layout); - ;// external ["wp","preferences"] const external_wp_preferences_namespaceObject = window["wp"]["preferences"]; ;// ./node_modules/@wordpress/editor/build-module/store/constants.js @@ -2424,12 +2435,8 @@ const EDIT_MERGE_PROPERTIES = new Set(['meta']); /** * Constant for the store module (or reducer) key. - * - * @type {string} */ const STORE_NAME = 'core/editor'; -const SAVE_POST_NOTICE_ID = 'SAVE_POST_NOTICE_ID'; -const TRASH_POST_NOTICE_ID = 'TRASH_POST_NOTICE_ID'; const PERMALINK_POSTNAME_REGEX = /%(?:postname|pagename)%/; const ONE_MINUTE_IN_MS = 60 * 1000; const AUTOSAVE_PROPERTIES = ['title', 'excerpt', 'content']; @@ -2446,6 +2453,10 @@ const TEMPLATE_ORIGINS = { const TEMPLATE_POST_TYPES = ['wp_template', 'wp_template_part']; const GLOBAL_POST_TYPES = [...TEMPLATE_POST_TYPES, 'wp_block', 'wp_navigation']; +;// external ["wp","primitives"] +const external_wp_primitives_namespaceObject = window["wp"]["primitives"]; +;// external "ReactJSXRuntime" +const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"]; ;// ./node_modules/@wordpress/icons/build-module/library/header.js /** * WordPress dependencies @@ -2530,11 +2541,91 @@ function getTemplatePartIcon(iconName) { return symbol_filled; } -;// ./node_modules/@wordpress/editor/build-module/store/selectors.js +;// external ["wp","privateApis"] +const external_wp_privateApis_namespaceObject = window["wp"]["privateApis"]; +;// ./node_modules/@wordpress/editor/build-module/lock-unlock.js /** * WordPress dependencies */ +const { + lock, + unlock +} = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/editor'); + +;// ./node_modules/@wordpress/icons/build-module/library/layout.js +/** + * WordPress dependencies + */ + + +const layout = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z" + }) +}); +/* harmony default export */ const library_layout = (layout); + +;// ./node_modules/@wordpress/editor/build-module/utils/get-template-info.js +/* wp:polyfill */ +/** + * WordPress dependencies + */ + +/** + * Internal dependencies + */ + +const EMPTY_OBJECT = {}; + +/** + * Helper function to retrieve the corresponding template info for a given template. + * @param {Object} params + * @param {Array} params.templateTypes + * @param {Array} [params.templateAreas] + * @param {Object} params.template + */ +const getTemplateInfo = params => { + var _Object$values$find; + if (!params) { + return EMPTY_OBJECT; + } + const { + templateTypes, + templateAreas, + template + } = params; + const { + description, + slug, + title, + area + } = template; + const { + title: defaultTitle, + description: defaultDescription + } = (_Object$values$find = Object.values(templateTypes).find(type => type.slug === slug)) !== null && _Object$values$find !== void 0 ? _Object$values$find : EMPTY_OBJECT; + const templateTitle = typeof title === 'string' ? title : title?.rendered; + const templateDescription = typeof description === 'string' ? description : description?.raw; + const templateAreasWithIcon = templateAreas?.map(item => ({ + ...item, + icon: getTemplatePartIcon(item.icon) + })); + const templateIcon = templateAreasWithIcon?.find(item => area === item.area)?.icon || library_layout; + return { + title: templateTitle && templateTitle !== slug ? templateTitle : defaultTitle || slug, + description: templateDescription || defaultDescription, + icon: templateIcon + }; +}; + +;// ./node_modules/@wordpress/editor/build-module/store/selectors.js +/* wp:polyfill */ +/** + * WordPress dependencies + */ @@ -2552,6 +2643,8 @@ function getTemplatePartIcon(iconName) { + + /** * Shared reference to an empty object for cases where it is important to avoid * returning a new object reference on every invocation, as in a connected or @@ -2559,7 +2652,7 @@ function getTemplatePartIcon(iconName) { * This should be used as a last resort, since the normalized data should be * maintained by the reducer result in state. */ -const EMPTY_OBJECT = {}; +const selectors_EMPTY_OBJECT = {}; /** * Returns true if any past editor history snapshots exist, or false otherwise. @@ -2674,7 +2767,7 @@ const getCurrentPost = (0,external_wp_data_namespaceObject.createRegistrySelecto // This exists for compatibility with the previous selector behavior // which would guarantee an object return based on the editor reducer's // default empty object state. - return EMPTY_OBJECT; + return selectors_EMPTY_OBJECT; }); /** @@ -2682,6 +2775,11 @@ const getCurrentPost = (0,external_wp_data_namespaceObject.createRegistrySelecto * * @param {Object} state Global application state. * + * @example + * + *```js + * const currentPostType = wp.data.select( 'core/editor' ).getCurrentPostType(); + *``` * @return {string} Post type. */ function getCurrentPostType(state) { @@ -2705,7 +2803,7 @@ function getCurrentPostId(state) { * * @param {Object} state Global application state. * - * @return {string?} Template ID. + * @return {?string} Template ID. */ function getCurrentTemplateId(state) { return state.templateId; @@ -2747,7 +2845,7 @@ function getCurrentPostLastRevisionId(state) { const getPostEdits = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => state => { const postType = getCurrentPostType(state); const postId = getCurrentPostId(state); - return select(external_wp_coreData_namespaceObject.store).getEntityRecordEdits('postType', postType, postId) || EMPTY_OBJECT; + return select(external_wp_coreData_namespaceObject.store).getEntityRecordEdits('postType', postType, postId) || selectors_EMPTY_OBJECT; }); /** @@ -2802,6 +2900,22 @@ const getNestedEditedPostProperty = (0,external_wp_data_namespaceObject.createSe * @param {Object} state Global application state. * @param {string} attributeName Post attribute name. * + * @example + * + *```js + * // Get specific media size based on the featured media ID + * // Note: change sizes?.large for any registered size + * const getFeaturedMediaUrl = useSelect( ( select ) => { + * const getFeaturedMediaId = + * select( 'core/editor' ).getEditedPostAttribute( 'featured_media' ); + * const getMedia = select( 'core' ).getMedia( getFeaturedMediaId ); + * + * return ( + * getMedia?.media_details?.sizes?.large?.source_url || getMedia?.source_url || '' + * ); + * }, [] ); + *``` + * * @return {*} Post attribute value. */ function getEditedPostAttribute(state, attributeName) { @@ -2891,8 +3005,8 @@ function isCurrentPostPending(state) { /** * Return true if the current post has already been published. * - * @param {Object} state Global application state. - * @param {Object?} currentPost Explicit current post for bypassing registry selector. + * @param {Object} state Global application state. + * @param {Object} [currentPost] Explicit current post for bypassing registry selector. * * @return {boolean} Whether the post has been published. */ @@ -3541,10 +3655,10 @@ const isEditorPanelOpened = (0,external_wp_data_namespaceObject.createRegistrySe /** * Returns the current selection start. * + * @deprecated since Gutenberg 10.0.0. + * * @param {Object} state * @return {WPBlockSelection} The selection start. - * - * @deprecated since Gutenberg 10.0.0. */ function getEditorSelectionStart(state) { external_wp_deprecated_default()("select('core/editor').getEditorSelectionStart", { @@ -3557,10 +3671,10 @@ function getEditorSelectionStart(state) { /** * Returns the current selection end. * + * @deprecated since Gutenberg 10.0.0. + * * @param {Object} state * @return {WPBlockSelection} The selection end. - * - * @deprecated since Gutenberg 10.0.0. */ function getEditorSelectionEnd(state) { external_wp_deprecated_default()("select('core/editor').getEditorSelectionStart", { @@ -3620,8 +3734,8 @@ function getRenderingMode(state) { * @return {string} Device type. */ const getDeviceType = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => state => { - const editorMode = select(external_wp_blockEditor_namespaceObject.store).__unstableGetEditorMode(); - if (editorMode === 'zoom-out') { + const isZoomOut = unlock(select(external_wp_blockEditor_namespaceObject.store)).isZoomOut(); + if (isZoomOut) { return 'Desktop'; } return state.deviceType; @@ -3956,17 +4070,13 @@ const hasInserterItems = getBlockEditorSelector('hasInserterItems'); * @see getBlockListSettings in core/block-editor store. */ const getBlockListSettings = getBlockEditorSelector('getBlockListSettings'); - -/** - * Returns the default template types. - * - * @param {Object} state Global application state. - * - * @return {Object} The template types. - */ -function __experimentalGetDefaultTemplateTypes(state) { - return getEditorSettings(state)?.defaultTemplateTypes; -} +const __experimentalGetDefaultTemplateTypes = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => { + external_wp_deprecated_default()("select('core/editor').__experimentalGetDefaultTemplateTypes", { + since: '6.8', + alternative: "select('core/core-data').getEntityRecord( 'root', '__unstableBase' )?.default_template_types" + }); + return select(external_wp_coreData_namespaceObject.store).getEntityRecord('root', '__unstableBase')?.default_template_types; +}); /** * Returns the default template part areas. @@ -3975,16 +4085,19 @@ function __experimentalGetDefaultTemplateTypes(state) { * * @return {Array} The template part areas. */ -const __experimentalGetDefaultTemplatePartAreas = (0,external_wp_data_namespaceObject.createSelector)(state => { - var _getEditorSettings$de; - const areas = (_getEditorSettings$de = getEditorSettings(state)?.defaultTemplatePartAreas) !== null && _getEditorSettings$de !== void 0 ? _getEditorSettings$de : []; +const __experimentalGetDefaultTemplatePartAreas = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (0,external_wp_data_namespaceObject.createSelector)(() => { + external_wp_deprecated_default()("select('core/editor').__experimentalGetDefaultTemplatePartAreas", { + since: '6.8', + alternative: "select('core/core-data').getEntityRecord( 'root', '__unstableBase' )?.default_template_part_areas" + }); + const areas = select(external_wp_coreData_namespaceObject.store).getEntityRecord('root', '__unstableBase')?.default_template_part_areas || []; return areas.map(item => { return { ...item, icon: getTemplatePartIcon(item.icon) }; }); -}, state => [getEditorSettings(state)?.defaultTemplatePartAreas]); +})); /** * Returns a default template type searched by slug. @@ -3994,14 +4107,17 @@ const __experimentalGetDefaultTemplatePartAreas = (0,external_wp_data_namespaceO * * @return {Object} The template type. */ -const __experimentalGetDefaultTemplateType = (0,external_wp_data_namespaceObject.createSelector)((state, slug) => { +const __experimentalGetDefaultTemplateType = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (0,external_wp_data_namespaceObject.createSelector)((state, slug) => { var _Object$values$find; - const templateTypes = __experimentalGetDefaultTemplateTypes(state); + external_wp_deprecated_default()("select('core/editor').__experimentalGetDefaultTemplateType", { + since: '6.8' + }); + const templateTypes = select(external_wp_coreData_namespaceObject.store).getEntityRecord('root', '__unstableBase')?.default_template_types; if (!templateTypes) { - return EMPTY_OBJECT; + return selectors_EMPTY_OBJECT; } - return (_Object$values$find = Object.values(templateTypes).find(type => type.slug === slug)) !== null && _Object$values$find !== void 0 ? _Object$values$find : EMPTY_OBJECT; -}, state => [__experimentalGetDefaultTemplateTypes(state)]); + return (_Object$values$find = Object.values(templateTypes).find(type => type.slug === slug)) !== null && _Object$values$find !== void 0 ? _Object$values$find : selectors_EMPTY_OBJECT; +})); /** * Given a template entity, return information about it which is ready to be @@ -4011,29 +4127,21 @@ const __experimentalGetDefaultTemplateType = (0,external_wp_data_namespaceObject * @param {Object} template The template for which we need information. * @return {Object} Information about the template, including title, description, and icon. */ -const __experimentalGetTemplateInfo = (0,external_wp_data_namespaceObject.createSelector)((state, template) => { +const __experimentalGetTemplateInfo = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (0,external_wp_data_namespaceObject.createSelector)((state, template) => { + external_wp_deprecated_default()("select('core/editor').__experimentalGetTemplateInfo", { + since: '6.8' + }); if (!template) { - return EMPTY_OBJECT; + return selectors_EMPTY_OBJECT; } - const { - description, - slug, - title, - area - } = template; - const { - title: defaultTitle, - description: defaultDescription - } = __experimentalGetDefaultTemplateType(state, slug); - const templateTitle = typeof title === 'string' ? title : title?.rendered; - const templateDescription = typeof description === 'string' ? description : description?.raw; - const templateIcon = __experimentalGetDefaultTemplatePartAreas(state).find(item => area === item.area)?.icon || library_layout; - return { - title: templateTitle && templateTitle !== slug ? templateTitle : defaultTitle || slug, - description: templateDescription || defaultDescription, - icon: templateIcon - }; -}, state => [__experimentalGetDefaultTemplateTypes(state), __experimentalGetDefaultTemplatePartAreas(state)]); + const templateTypes = select(external_wp_coreData_namespaceObject.store).getEntityRecord('root', '__unstableBase')?.default_template_types || []; + const templateAreas = select(external_wp_coreData_namespaceObject.store).getEntityRecord('root', '__unstableBase')?.default_template_part_areas || []; + return getTemplateInfo({ + template, + templateAreas, + templateTypes + }); +})); /** * Returns a post type label depending on the current post. @@ -4108,11 +4216,6 @@ function localAutosaveClear(postId, isPostNew) { */ -/** - * Internal dependencies - */ - - /** * Builds the arguments for a success notification dispatch. * @@ -4172,7 +4275,7 @@ function getNotificationArgumentsForSaveSuccess(data) { }); } return [noticeMessage, { - id: SAVE_POST_NOTICE_ID, + id: 'editor-save', type: 'snackbar', actions }]; @@ -4214,7 +4317,7 @@ function getNotificationArgumentsForSaveFail(data) { noticeMessage = [noticeMessage, error.message].join(' '); } return [noticeMessage, { - id: SAVE_POST_NOTICE_ID + id: 'editor-save' }]; } @@ -4227,11 +4330,12 @@ function getNotificationArgumentsForSaveFail(data) { */ function getNotificationArgumentsForTrashFail(data) { return [data.error.message && data.error.code !== 'unknown_error' ? data.error.message : (0,external_wp_i18n_namespaceObject.__)('Trashing failed'), { - id: TRASH_POST_NOTICE_ID + id: 'editor-trash-fail' }]; } ;// ./node_modules/@wordpress/editor/build-module/store/actions.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -4252,14 +4356,13 @@ function getNotificationArgumentsForTrashFail(data) { - /** * Returns an action generator used in signalling that editor has initialized with * the specified post object and editor settings. * - * @param {Object} post Post object. - * @param {Object} edits Initial edited attributes object. - * @param {Array?} template Block Template. + * @param {Object} post Post object. + * @param {Object} edits Initial edited attributes object. + * @param {Array} [template] Block Template. */ const setupEditor = (post, edits, template) => ({ dispatch @@ -4377,8 +4480,31 @@ function setEditedPost(postType, postId) { * Returns an action object used in signalling that attributes of the post have * been edited. * - * @param {Object} edits Post attributes to edit. - * @param {Object} options Options for the edit. + * @param {Object} edits Post attributes to edit. + * @param {Object} [options] Options for the edit. + * + * @example + * ```js + * // Update the post title + * wp.data.dispatch( 'core/editor' ).editPost( { title: `${ newTitle }` } ); + * ``` + * + * @example + *```js + * // Get specific media size based on the featured media ID + * // Note: change sizes?.large for any registered size + * const getFeaturedMediaUrl = useSelect( ( select ) => { + * const getFeaturedMediaId = + * select( 'core/editor' ).getEditedPostAttribute( 'featured_media' ); + * const getMedia = select( 'core' ).getMedia( getFeaturedMediaId ); + * + * return ( + * getMedia?.media_details?.sizes?.large?.source_url || getMedia?.source_url || '' + * ); + * }, [] ); + * ``` + * + * @return {Object} Action object */ const editPost = (edits, options) => ({ select, @@ -4394,7 +4520,7 @@ const editPost = (edits, options) => ({ /** * Action for saving the current post in the editor. * - * @param {Object} options + * @param {Object} [options] */ const savePost = (options = {}) => async ({ select, @@ -4514,7 +4640,6 @@ const trashPost = () => async ({ }) => { const postTypeSlug = select.getCurrentPostType(); const postType = await registry.resolveSelect(external_wp_coreData_namespaceObject.store).getPostType(postTypeSlug); - registry.dispatch(external_wp_notices_namespaceObject.store).removeNotice(TRASH_POST_NOTICE_ID); const { rest_base: restBase, rest_namespace: restNamespace = 'wp/v2' @@ -4545,7 +4670,8 @@ const trashPost = () => async ({ * autosaving (e.g. on the Web, the post might be committed to Session * Storage). * - * @param {Object?} options Extra flags to identify the autosave. + * @param {Object} [options] Extra flags to identify the autosave. + * @param {boolean} [options.local] Whether to perform a local autosave. */ const autosave = ({ local = false, @@ -4772,8 +4898,8 @@ function unlockPostAutosaving(lockName) { /** * Returns an action object used to signal that the blocks have been updated. * - * @param {Array} blocks Block Array. - * @param {?Object} options Optional options. + * @param {Array} blocks Block Array. + * @param {Object} [options] Optional options. */ const resetEditorBlocks = (blocks, options = {}) => ({ select, @@ -4936,15 +5062,28 @@ function removeEditorPanel(panelName) { * use an object. * @param {string} value.rootClientId The root client ID to insert at. * @param {number} value.insertionIndex The index to insert at. + * @param {string} value.filterValue A query to filter the inserter results. + * @param {Function} value.onSelect A callback when an item is selected. + * @param {string} value.tab The tab to open in the inserter. + * @param {string} value.category The category to initialize in the inserter. * * @return {Object} Action object. */ -function setIsInserterOpened(value) { - return { +const setIsInserterOpened = value => ({ + dispatch, + registry +}) => { + if (typeof value === 'object' && value.hasOwnProperty('rootClientId') && value.hasOwnProperty('insertionIndex')) { + unlock(registry.dispatch(external_wp_blockEditor_namespaceObject.store)).setInsertionPoint({ + rootClientId: value.rootClientId, + index: value.insertionIndex + }); + } + dispatch({ type: 'SET_IS_INSERTER_OPENED', value - }; -} + }); +}; /** * Returns an action object used to open/close the list view. @@ -4963,8 +5102,13 @@ function setIsListViewOpened(isOpen) { * Action that toggles Distraction free mode. * Distraction free mode expects there are no sidebars, as due to the * z-index values set, you can't close sidebars. + * + * @param {Object} [options={}] Optional configuration object + * @param {boolean} [options.createNotice=true] Whether to create a notice */ -const toggleDistractionFree = () => ({ +const toggleDistractionFree = ({ + createNotice = true +} = {}) => ({ dispatch, registry }) => { @@ -4977,23 +5121,66 @@ const toggleDistractionFree = () => ({ registry.dispatch(external_wp_preferences_namespaceObject.store).set('core', 'fixedToolbar', true); dispatch.setIsInserterOpened(false); dispatch.setIsListViewOpened(false); + unlock(registry.dispatch(external_wp_blockEditor_namespaceObject.store)).resetZoomLevel(); }); } registry.batch(() => { registry.dispatch(external_wp_preferences_namespaceObject.store).set('core', 'distractionFree', !isDistractionFree); - registry.dispatch(external_wp_notices_namespaceObject.store).createInfoNotice(isDistractionFree ? (0,external_wp_i18n_namespaceObject.__)('Distraction free off.') : (0,external_wp_i18n_namespaceObject.__)('Distraction free on.'), { - id: 'core/editor/distraction-free-mode/notice', - type: 'snackbar', - actions: [{ - label: (0,external_wp_i18n_namespaceObject.__)('Undo'), - onClick: () => { - registry.batch(() => { - registry.dispatch(external_wp_preferences_namespaceObject.store).set('core', 'fixedToolbar', isDistractionFree ? true : false); - registry.dispatch(external_wp_preferences_namespaceObject.store).toggle('core', 'distractionFree'); - }); - } - }] - }); + if (createNotice) { + registry.dispatch(external_wp_notices_namespaceObject.store).createInfoNotice(isDistractionFree ? (0,external_wp_i18n_namespaceObject.__)('Distraction free mode deactivated.') : (0,external_wp_i18n_namespaceObject.__)('Distraction free mode activated.'), { + id: 'core/editor/distraction-free-mode/notice', + type: 'snackbar', + actions: [{ + label: (0,external_wp_i18n_namespaceObject.__)('Undo'), + onClick: () => { + registry.batch(() => { + registry.dispatch(external_wp_preferences_namespaceObject.store).set('core', 'fixedToolbar', isDistractionFree); + registry.dispatch(external_wp_preferences_namespaceObject.store).toggle('core', 'distractionFree'); + }); + } + }] + }); + } + }); +}; + +/** + * Action that toggles the Spotlight Mode view option. + */ +const toggleSpotlightMode = () => ({ + registry +}) => { + registry.dispatch(external_wp_preferences_namespaceObject.store).toggle('core', 'focusMode'); + const isFocusMode = registry.select(external_wp_preferences_namespaceObject.store).get('core', 'focusMode'); + registry.dispatch(external_wp_notices_namespaceObject.store).createInfoNotice(isFocusMode ? (0,external_wp_i18n_namespaceObject.__)('Spotlight mode activated.') : (0,external_wp_i18n_namespaceObject.__)('Spotlight mode deactivated.'), { + id: 'core/editor/toggle-spotlight-mode/notice', + type: 'snackbar', + actions: [{ + label: (0,external_wp_i18n_namespaceObject.__)('Undo'), + onClick: () => { + registry.dispatch(external_wp_preferences_namespaceObject.store).toggle('core', 'focusMode'); + } + }] + }); +}; + +/** + * Action that toggles the Top Toolbar view option. + */ +const toggleTopToolbar = () => ({ + registry +}) => { + registry.dispatch(external_wp_preferences_namespaceObject.store).toggle('core', 'fixedToolbar'); + const isTopToolbar = registry.select(external_wp_preferences_namespaceObject.store).get('core', 'fixedToolbar'); + registry.dispatch(external_wp_notices_namespaceObject.store).createInfoNotice(isTopToolbar ? (0,external_wp_i18n_namespaceObject.__)('Top toolbar activated.') : (0,external_wp_i18n_namespaceObject.__)('Top toolbar deactivated.'), { + id: 'core/editor/toggle-top-toolbar/notice', + type: 'snackbar', + actions: [{ + label: (0,external_wp_i18n_namespaceObject.__)('Undo'), + onClick: () => { + registry.dispatch(external_wp_preferences_namespaceObject.store).toggle('core', 'fixedToolbar'); + } + }] }); }; @@ -5007,10 +5194,11 @@ const switchEditorMode = mode => ({ registry }) => { registry.dispatch(external_wp_preferences_namespaceObject.store).set('core', 'editorMode', mode); - - // Unselect blocks when we switch to a non visual mode. if (mode !== 'visual') { + // Unselect blocks when we switch to a non visual mode. registry.dispatch(external_wp_blockEditor_namespaceObject.store).clearSelectedBlock(); + // Exit zoom out state when switching to a non visual mode. + unlock(registry.dispatch(external_wp_blockEditor_namespaceObject.store)).resetZoomLevel(); } if (mode === 'visual') { (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('Visual editor selected'), 'assertive'); @@ -5251,6 +5439,104 @@ function isTemplateRevertable(templateOrTemplatePart) { return templateOrTemplatePart.source === TEMPLATE_ORIGINS.custom && (Boolean(templateOrTemplatePart?.plugin) || templateOrTemplatePart?.has_theme_file); } +;// ./node_modules/@wordpress/icons/build-module/library/external.js +/** + * WordPress dependencies + */ + + +const external = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.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" + }) +}); +/* harmony default export */ const library_external = (external); + +;// ./node_modules/@wordpress/fields/build-module/actions/view-post.js +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + +const viewPost = { + id: 'view-post', + label: (0,external_wp_i18n_namespaceObject._x)('View', 'verb'), + isPrimary: true, + icon: library_external, + isEligible(post) { + return post.status !== 'trash'; + }, + callback(posts, { + onActionPerformed + }) { + const post = posts[0]; + window.open(post?.link, '_blank'); + if (onActionPerformed) { + onActionPerformed(posts); + } + } +}; + +/** + * View post action for BasePost. + */ +/* harmony default export */ const view_post = (viewPost); + +;// ./node_modules/@wordpress/fields/build-module/actions/view-post-revisions.js +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + +const viewPostRevisions = { + id: 'view-post-revisions', + context: 'list', + label(items) { + var _items$0$_links$versi; + const revisionsCount = (_items$0$_links$versi = items[0]._links?.['version-history']?.[0]?.count) !== null && _items$0$_links$versi !== void 0 ? _items$0$_links$versi : 0; + return (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: number of revisions. */ + (0,external_wp_i18n_namespaceObject.__)('View revisions (%s)'), revisionsCount); + }, + isEligible(post) { + var _post$_links$predeces, _post$_links$version; + if (post.status === 'trash') { + return false; + } + const lastRevisionId = (_post$_links$predeces = post?._links?.['predecessor-version']?.[0]?.id) !== null && _post$_links$predeces !== void 0 ? _post$_links$predeces : null; + const revisionsCount = (_post$_links$version = post?._links?.['version-history']?.[0]?.count) !== null && _post$_links$version !== void 0 ? _post$_links$version : 0; + return !!lastRevisionId && revisionsCount > 1; + }, + callback(posts, { + onActionPerformed + }) { + const post = posts[0]; + const href = (0,external_wp_url_namespaceObject.addQueryArgs)('revision.php', { + revision: post?._links?.['predecessor-version']?.[0]?.id + }); + document.location.href = href; + if (onActionPerformed) { + onActionPerformed(posts); + } + } +}; + +/** + * View post revisions action for Post. + */ +/* harmony default export */ const view_post_revisions = (viewPostRevisions); + ;// external ["wp","components"] const external_wp_components_namespaceObject = window["wp"]["components"]; ;// ./node_modules/@wordpress/icons/build-module/library/check.js @@ -5534,10 +5820,19 @@ var __setModuleDefault = Object.create ? (function(o, v) { o["default"] = v; }; +var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); +}; + function __importStar(mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); __setModuleDefault(result, mod); return result; } @@ -5618,12 +5913,25 @@ function __disposeResources(env) { return next(); } +function __rewriteRelativeImportExtension(path, preserveJsx) { + if (typeof path === "string" && /^\.\.?\//.test(path)) { + return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) { + return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js"); + }); + } + return path; +} + /* harmony default export */ const tslib_es6 = ({ __extends, __assign, __rest, __decorate, __param, + __esDecorate, + __runInitializers, + __propKey, + __setFunctionName, __metadata, __awaiter, __generator, @@ -5646,6 +5954,7 @@ function __disposeResources(env) { __classPrivateFieldIn, __addDisposableResource, __disposeResources, + __rewriteRelativeImportExtension, }); ;// ./node_modules/lower-case/dist.es2015/index.js @@ -5745,7 +6054,8 @@ function paramCase(input, options) { return dotCase(input, __assign({ delimiter: "-" }, options)); } -;// ./node_modules/@wordpress/editor/build-module/components/create-template-part-modal/utils.js +;// ./node_modules/@wordpress/fields/build-module/components/create-template-part-modal/utils.js +/* wp:polyfill */ /** * External dependencies */ @@ -5762,9 +6072,10 @@ function paramCase(input, options) { */ const useExistingTemplateParts = () => { - return (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getEntityRecords('postType', TEMPLATE_PART_POST_TYPE, { + var _useSelect; + return (_useSelect = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getEntityRecords('postType', 'wp_template_part', { per_page: -1 - }), []); + }), [])) !== null && _useSelect !== void 0 ? _useSelect : []; }; /** @@ -5800,7 +6111,8 @@ const getCleanTemplatePartSlug = title => { return paramCase(title).replace(/[^\w-]+/g, '') || 'wp-custom-part'; }; -;// ./node_modules/@wordpress/editor/build-module/components/create-template-part-modal/index.js +;// ./node_modules/@wordpress/fields/build-module/components/create-template-part-modal/index.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -5812,6 +6124,7 @@ const getCleanTemplatePartSlug = title => { +// @ts-expect-error serialize is not typed /** @@ -5819,18 +6132,27 @@ const getCleanTemplatePartSlug = title => { */ - - - +function getAreaRadioId(value, instanceId) { + return `fields-create-template-part-modal__area-option-${value}-${instanceId}`; +} +function getAreaRadioDescriptionId(value, instanceId) { + return `fields-create-template-part-modal__area-option-description-${value}-${instanceId}`; +} +/** + * A React component that renders a modal for creating a template part. The modal displays a title and the contents for creating the template part. + * This component should not live in this package, it should be moved to a dedicated package responsible for managing template. + * @param {Object} props The component props. + * @param props.modalTitle + */ function CreateTemplatePartModal({ modalTitle, ...restProps }) { - const defaultModalTitle = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getPostType(TEMPLATE_PART_POST_TYPE)?.labels?.add_new_item, []); + const defaultModalTitle = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getPostType('wp_template_part')?.labels?.add_new_item, []); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Modal, { title: modalTitle || defaultModalTitle, onRequestClose: restProps.closeModal, - overlayClassName: "editor-create-template-part-modal", + overlayClassName: "fields-create-template-part-modal", focusOnMount: "firstContentElement", size: "medium", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CreateTemplatePartModalContents, { @@ -5838,8 +6160,32 @@ function CreateTemplatePartModal({ }) }); } +const create_template_part_modal_getTemplatePartIcon = iconName => { + if ('header' === iconName) { + return library_header; + } else if ('footer' === iconName) { + return library_footer; + } else if ('sidebar' === iconName) { + return library_sidebar; + } + return symbol_filled; +}; + +/** + * A React component that renders the content of a model for creating a template part. + * This component should not live in this package; it should be moved to a dedicated package responsible for managing template. + * + * @param {Object} props - The component props. + * @param {string} [props.defaultArea=uncategorized] - The default area for the template part. + * @param {Array} [props.blocks=[]] - The blocks to be included in the template part. + * @param {string} [props.confirmLabel='Add'] - The label for the confirm button. + * @param {Function} props.closeModal - Function to close the modal. + * @param {Function} props.onCreate - Function to call when the template part is successfully created. + * @param {Function} [props.onError] - Function to call when there is an error creating the template part. + * @param {string} [props.defaultTitle=''] - The default title for the template part. + */ function CreateTemplatePartModalContents({ - defaultArea = TEMPLATE_PART_AREA_DEFAULT_CATEGORY, + defaultArea = 'uncategorized', blocks = [], confirmLabel = (0,external_wp_i18n_namespaceObject.__)('Add'), closeModal, @@ -5858,7 +6204,7 @@ function CreateTemplatePartModalContents({ const [area, setArea] = (0,external_wp_element_namespaceObject.useState)(defaultArea); const [isSubmitting, setIsSubmitting] = (0,external_wp_element_namespaceObject.useState)(false); const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(CreateTemplatePartModal); - const templatePartAreas = (0,external_wp_data_namespaceObject.useSelect)(select => select(store_store).__experimentalGetDefaultTemplatePartAreas(), []); + const defaultTemplatePartAreas = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getEntityRecord('root', '__unstableBase')?.default_template_part_areas, []); async function createTemplatePart() { if (!title || isSubmitting) { return; @@ -5867,7 +6213,7 @@ function CreateTemplatePartModalContents({ setIsSubmitting(true); const uniqueTitle = getUniqueTemplatePartTitle(title, existingTemplateParts); const cleanSlug = getCleanTemplatePartSlug(uniqueTitle); - const templatePart = await saveEntityRecord('postType', TEMPLATE_PART_POST_TYPE, { + const templatePart = await saveEntityRecord('postType', 'wp_template_part', { slug: cleanSlug, title: uniqueTitle, content: (0,external_wp_blocks_namespaceObject.serialize)(blocks), @@ -5879,7 +6225,7 @@ function CreateTemplatePartModalContents({ // TODO: Add a success notice? } catch (error) { - const errorMessage = error.message && error.code !== 'unknown_error' ? error.message : (0,external_wp_i18n_namespaceObject.__)('An error occurred while creating the template part.'); + const errorMessage = error instanceof Error && 'code' in error && error.message && error.code !== 'unknown_error' ? error.message : (0,external_wp_i18n_namespaceObject.__)('An error occurred while creating the template part.'); createErrorNotice(errorMessage, { type: 'snackbar' }); @@ -5902,46 +6248,44 @@ function CreateTemplatePartModalContents({ value: title, onChange: setTitle, required: true - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.BaseControl, { - __nextHasNoMarginBottom: true, - label: (0,external_wp_i18n_namespaceObject.__)('Area'), - id: `editor-create-template-part-modal__area-selection-${instanceId}`, - className: "editor-create-template-part-modal__area-base-control", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalRadioGroup, { - label: (0,external_wp_i18n_namespaceObject.__)('Area'), - className: "editor-create-template-part-modal__area-radio-group", - id: `editor-create-template-part-modal__area-selection-${instanceId}`, - onChange: setArea, - checked: area, - children: templatePartAreas.map(({ - icon, - label, - area: value, - description - }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalRadio, { - value: value, - className: "editor-create-template-part-modal__area-radio", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Flex, { - align: "start", - justify: "start", - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { - icon: icon - }) - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.FlexBlock, { - className: "editor-create-template-part-modal__option-label", - children: [label, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { - children: description - })] - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { - className: "editor-create-template-part-modal__checkbox", - children: area === value && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { - icon: library_check - }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("fieldset", { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.BaseControl.VisualLabel, { + as: "legend", + children: (0,external_wp_i18n_namespaceObject.__)('Area') + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: "fields-create-template-part-modal__area-radio-group", + children: (defaultTemplatePartAreas !== null && defaultTemplatePartAreas !== void 0 ? defaultTemplatePartAreas : []).map(item => { + const icon = create_template_part_modal_getTemplatePartIcon(item.icon); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { + className: "fields-create-template-part-modal__area-radio-wrapper", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("input", { + type: "radio", + id: getAreaRadioId(item.area, instanceId), + name: `fields-create-template-part-modal__area-${instanceId}`, + value: item.area, + checked: area === item.area, + onChange: () => { + setArea(item.area); + }, + "aria-describedby": getAreaRadioDescriptionId(item.area, instanceId) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { + icon: icon, + className: "fields-create-template-part-modal__area-radio-icon" + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("label", { + htmlFor: getAreaRadioId(item.area, instanceId), + className: "fields-create-template-part-modal__area-radio-label", + children: item.label + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { + icon: library_check, + className: "fields-create-template-part-modal__area-radio-checkmark" + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { + className: "fields-create-template-part-modal__area-radio-description", + id: getAreaRadioDescriptionId(item.area, instanceId), + children: item.description })] - }) - }, label)) - }) + }, item.area); + }) + })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "right", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { @@ -5964,7 +6308,7 @@ function CreateTemplatePartModalContents({ }); } -;// ./node_modules/@wordpress/editor/build-module/dataviews/actions/utils.js +;// ./node_modules/@wordpress/fields/build-module/actions/utils.js /** * WordPress dependencies */ @@ -5975,22 +6319,22 @@ function CreateTemplatePartModalContents({ */ function isTemplate(post) { - return post.type === TEMPLATE_POST_TYPE; + return post.type === 'wp_template'; } function isTemplatePart(post) { - return post.type === TEMPLATE_PART_POST_TYPE; + return post.type === 'wp_template_part'; } function isTemplateOrTemplatePart(p) { - return p.type === TEMPLATE_POST_TYPE || p.type === TEMPLATE_PART_POST_TYPE; + return p.type === 'wp_template' || p.type === 'wp_template_part'; } function getItemTitle(item) { if (typeof item.title === 'string') { return (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(item.title); } - if ('rendered' in item.title) { + if (item.title && 'rendered' in item.title) { return (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(item.title.rendered); } - if ('raw' in item.title) { + if (item.title && 'raw' in item.title) { return (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(item.title.raw); } return ''; @@ -6009,10 +6353,10 @@ function isTemplateRemovable(template) { // In patterns list page we map the templates parts to a different object // than the one returned from the endpoint. This is why we need to check for // two props whether is custom or has a theme file. - return [template.source, template.source].includes(TEMPLATE_ORIGINS.custom) && !Boolean(template.type === 'wp_template' && template?.plugin) && !template.has_theme_file; + return [template.source, template.source].includes('custom') && !Boolean(template.type === 'wp_template' && template?.plugin) && !template.has_theme_file; } -;// ./node_modules/@wordpress/editor/build-module/dataviews/actions/duplicate-template-part.js +;// ./node_modules/@wordpress/fields/build-module/actions/duplicate-template-part.js /** * WordPress dependencies */ @@ -6022,6 +6366,7 @@ function isTemplateRemovable(template) { // @ts-ignore + /** * Internal dependencies */ @@ -6029,10 +6374,14 @@ function isTemplateRemovable(template) { +/** + * This action is used to duplicate a template part. + */ + const duplicateTemplatePart = { id: 'duplicate-template-part', label: (0,external_wp_i18n_namespaceObject._x)('Duplicate', 'action label'), - isEligible: item => item.type === TEMPLATE_PART_POST_TYPE, + isEligible: item => item.type === 'wp_template_part', modalHeader: (0,external_wp_i18n_namespaceObject._x)('Duplicate template part', 'action label'), RenderModal: ({ items, @@ -6048,10 +6397,10 @@ const duplicateTemplatePart = { const { createSuccessNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); - function onTemplatePartSuccess() { + function onTemplatePartSuccess(templatePart) { createSuccessNotice((0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: The new template part's title e.g. 'Call to action (copy)'. - (0,external_wp_i18n_namespaceObject._x)('"%s" duplicated.', 'template part'), getItemTitle(item)), { + (0,external_wp_i18n_namespaceObject._x)('"%s" duplicated.', 'template part'), getItemTitle(templatePart)), { type: 'snackbar', id: 'edit-site-patterns-success' }); @@ -6060,309 +6409,77 @@ const duplicateTemplatePart = { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CreateTemplatePartModalContents, { blocks: blocks, defaultArea: item.area, - defaultTitle: (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: Existing template part title */ + defaultTitle: (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: Existing template part title */ (0,external_wp_i18n_namespaceObject._x)('%s (Copy)', 'template part'), getItemTitle(item)), onCreate: onTemplatePartSuccess, onError: closeModal, confirmLabel: (0,external_wp_i18n_namespaceObject._x)('Duplicate', 'action label'), - closeModal: closeModal + closeModal: closeModal !== null && closeModal !== void 0 ? closeModal : () => {} }); } }; +/** + * Duplicate action for TemplatePart. + */ /* harmony default export */ const duplicate_template_part = (duplicateTemplatePart); -;// ./node_modules/@wordpress/icons/build-module/library/backup.js -/** - * WordPress dependencies - */ - - -const backup = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - d: "M5.5 12h1.75l-2.5 3-2.5-3H4a8 8 0 113.134 6.35l.907-1.194A6.5 6.5 0 105.5 12zm9.53 1.97l-2.28-2.28V8.5a.75.75 0 00-1.5 0V12a.747.747 0 00.218.529l1.282-.84-1.28.842 2.5 2.5a.75.75 0 101.06-1.061z" - }) -}); -/* harmony default export */ const library_backup = (backup); - -;// external ["wp","privateApis"] -const external_wp_privateApis_namespaceObject = window["wp"]["privateApis"]; -;// ./node_modules/@wordpress/editor/build-module/lock-unlock.js +;// external ["wp","patterns"] +const external_wp_patterns_namespaceObject = window["wp"]["patterns"]; +;// ./node_modules/@wordpress/fields/build-module/lock-unlock.js /** * WordPress dependencies */ const { - lock, - unlock -} = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/editor'); + lock: lock_unlock_lock, + unlock: lock_unlock_unlock +} = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/fields'); -;// ./node_modules/@wordpress/editor/build-module/dataviews/actions/reset-post.js +;// ./node_modules/@wordpress/fields/build-module/actions/duplicate-pattern.js /** * WordPress dependencies */ - - - - - +// @ts-ignore /** * Internal dependencies */ - - - - -const reset_post_resetPost = { - id: 'reset-post', - label: (0,external_wp_i18n_namespaceObject.__)('Reset'), - isEligible: item => { - return isTemplateOrTemplatePart(item) && item?.source === TEMPLATE_ORIGINS.custom && (Boolean(item.type === 'wp_template' && item?.plugin) || item?.has_theme_file); - }, - icon: library_backup, - supportsBulk: true, - hideModalHeader: true, +// Patterns. +const { + CreatePatternModalContents, + useDuplicatePatternProps +} = lock_unlock_unlock(external_wp_patterns_namespaceObject.privateApis); +const duplicatePattern = { + id: 'duplicate-pattern', + label: (0,external_wp_i18n_namespaceObject._x)('Duplicate', 'action label'), + isEligible: item => item.type !== 'wp_template_part', + modalHeader: (0,external_wp_i18n_namespaceObject._x)('Duplicate pattern', 'action label'), RenderModal: ({ items, - closeModal, - onActionPerformed + closeModal }) => { - const [isBusy, setIsBusy] = (0,external_wp_element_namespaceObject.useState)(false); - const { - revertTemplate - } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store_store)); - const { - saveEditedEntityRecord - } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); - const { - createSuccessNotice, - createErrorNotice - } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); - const onConfirm = async () => { - try { - for (const template of items) { - await revertTemplate(template, { - allowUndo: false - }); - await saveEditedEntityRecord('postType', template.type, template.id); - } - createSuccessNotice(items.length > 1 ? (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: The number of items. */ - (0,external_wp_i18n_namespaceObject.__)('%s items reset.'), items.length) : (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: The template/part's name. */ - (0,external_wp_i18n_namespaceObject.__)('"%s" reset.'), getItemTitle(items[0])), { - type: 'snackbar', - id: 'revert-template-action' - }); - } catch (error) { - let fallbackErrorMessage; - if (items[0].type === TEMPLATE_POST_TYPE) { - fallbackErrorMessage = items.length === 1 ? (0,external_wp_i18n_namespaceObject.__)('An error occurred while reverting the template.') : (0,external_wp_i18n_namespaceObject.__)('An error occurred while reverting the templates.'); - } else { - fallbackErrorMessage = items.length === 1 ? (0,external_wp_i18n_namespaceObject.__)('An error occurred while reverting the template part.') : (0,external_wp_i18n_namespaceObject.__)('An error occurred while reverting the template parts.'); - } - const typedError = error; - const errorMessage = typedError.message && typedError.code !== 'unknown_error' ? typedError.message : fallbackErrorMessage; - createErrorNotice(errorMessage, { - type: 'snackbar' - }); - } - }; - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { - spacing: "5", - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { - children: (0,external_wp_i18n_namespaceObject.__)('Reset to default and clear all customizations?') - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { - justify: "right", - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - __next40pxDefaultSize: true, - variant: "tertiary", - onClick: closeModal, - disabled: isBusy, - accessibleWhenDisabled: true, - children: (0,external_wp_i18n_namespaceObject.__)('Cancel') - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - __next40pxDefaultSize: true, - variant: "primary", - onClick: async () => { - setIsBusy(true); - await onConfirm(); - onActionPerformed?.(items); - setIsBusy(false); - closeModal?.(); - }, - isBusy: isBusy, - disabled: isBusy, - accessibleWhenDisabled: true, - children: (0,external_wp_i18n_namespaceObject.__)('Reset') - })] - })] + const [item] = items; + const duplicatedProps = useDuplicatePatternProps({ + pattern: item, + onSuccess: () => closeModal?.() + }); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CreatePatternModalContents, { + onClose: closeModal, + confirmLabel: (0,external_wp_i18n_namespaceObject._x)('Duplicate', 'action label'), + ...duplicatedProps }); } }; -/* harmony default export */ const reset_post = (reset_post_resetPost); - -;// ./node_modules/@wordpress/icons/build-module/library/trash.js -/** - * WordPress dependencies - */ - - -const trash = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M12 5.5A2.25 2.25 0 0 0 9.878 7h4.244A2.251 2.251 0 0 0 12 5.5ZM12 4a3.751 3.751 0 0 0-3.675 3H5v1.5h1.27l.818 8.997a2.75 2.75 0 0 0 2.739 2.501h4.347a2.75 2.75 0 0 0 2.738-2.5L17.73 8.5H19V7h-3.325A3.751 3.751 0 0 0 12 4Zm4.224 4.5H7.776l.806 8.861a1.25 1.25 0 0 0 1.245 1.137h4.347a1.25 1.25 0 0 0 1.245-1.137l.805-8.861Z" - }) -}); -/* harmony default export */ const library_trash = (trash); - -;// ./node_modules/@wordpress/editor/build-module/dataviews/actions/trash-post.js -/** - * WordPress dependencies - */ - - - - - - /** - * Internal dependencies + * Duplicate action for Pattern. */ +/* harmony default export */ const duplicate_pattern = (duplicatePattern); - - -const trash_post_trashPost = { - id: 'move-to-trash', - label: (0,external_wp_i18n_namespaceObject.__)('Move to trash'), - isPrimary: true, - icon: library_trash, - isEligible(item) { - if (isTemplateOrTemplatePart(item) || item.type === 'wp_block') { - return false; - } - return !!item.status && !['auto-draft', 'trash'].includes(item.status) && item.permissions?.delete; - }, - supportsBulk: true, - hideModalHeader: true, - RenderModal: ({ - items, - closeModal, - onActionPerformed - }) => { - const [isBusy, setIsBusy] = (0,external_wp_element_namespaceObject.useState)(false); - const { - createSuccessNotice, - createErrorNotice - } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); - const { - deleteEntityRecord - } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { - spacing: "5", - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { - children: items.length === 1 ? (0,external_wp_i18n_namespaceObject.sprintf)( - // translators: %s: The item's title. - (0,external_wp_i18n_namespaceObject.__)('Are you sure you want to move "%s" to the trash?'), getItemTitle(items[0])) : (0,external_wp_i18n_namespaceObject.sprintf)( - // translators: %d: The number of items (2 or more). - (0,external_wp_i18n_namespaceObject._n)('Are you sure you want to move %d item to the trash ?', 'Are you sure you want to move %d items to the trash ?', items.length), items.length) - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { - justify: "right", - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - __next40pxDefaultSize: true, - variant: "tertiary", - onClick: closeModal, - disabled: isBusy, - accessibleWhenDisabled: true, - children: (0,external_wp_i18n_namespaceObject.__)('Cancel') - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - __next40pxDefaultSize: true, - variant: "primary", - onClick: async () => { - setIsBusy(true); - const promiseResult = await Promise.allSettled(items.map(item => deleteEntityRecord('postType', item.type, item.id.toString(), {}, { - throwOnError: true - }))); - // If all the promises were fulfilled with success. - if (promiseResult.every(({ - status - }) => status === 'fulfilled')) { - let successMessage; - if (promiseResult.length === 1) { - successMessage = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: The item's title. */ - (0,external_wp_i18n_namespaceObject.__)('"%s" moved to the trash.'), getItemTitle(items[0])); - } else { - successMessage = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: The number of items. */ - (0,external_wp_i18n_namespaceObject._n)('%s item moved to the trash.', '%s items moved to the trash.', items.length), items.length); - } - createSuccessNotice(successMessage, { - type: 'snackbar', - id: 'move-to-trash-action' - }); - } else { - // If there was at least one failure. - let errorMessage; - // If we were trying to delete a single item. - if (promiseResult.length === 1) { - const typedError = promiseResult[0]; - if (typedError.reason?.message) { - errorMessage = typedError.reason.message; - } else { - errorMessage = (0,external_wp_i18n_namespaceObject.__)('An error occurred while moving the item to the trash.'); - } - // If we were trying to delete multiple items. - } else { - const errorMessages = new Set(); - const failedPromises = promiseResult.filter(({ - status - }) => status === 'rejected'); - for (const failedPromise of failedPromises) { - const typedError = failedPromise; - if (typedError.reason?.message) { - errorMessages.add(typedError.reason.message); - } - } - if (errorMessages.size === 0) { - errorMessage = (0,external_wp_i18n_namespaceObject.__)('An error occurred while moving the items to the trash.'); - } else if (errorMessages.size === 1) { - errorMessage = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: an error message */ - (0,external_wp_i18n_namespaceObject.__)('An error occurred while moving the item to the trash: %s'), [...errorMessages][0]); - } else { - errorMessage = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: a list of comma separated error messages */ - (0,external_wp_i18n_namespaceObject.__)('Some errors occurred while moving the items to the trash: %s'), [...errorMessages].join(',')); - } - } - createErrorNotice(errorMessage, { - type: 'snackbar' - }); - } - if (onActionPerformed) { - onActionPerformed(items); - } - setIsBusy(false); - closeModal?.(); - }, - isBusy: isBusy, - disabled: isBusy, - accessibleWhenDisabled: true, - children: (0,external_wp_i18n_namespaceObject._x)('Trash', 'verb') - })] - })] - }); - } -}; -/* harmony default export */ const trash_post = (trash_post_trashPost); - -;// external ["wp","patterns"] -const external_wp_patterns_namespaceObject = window["wp"]["patterns"]; -;// ./node_modules/@wordpress/editor/build-module/dataviews/actions/rename-post.js +;// ./node_modules/@wordpress/fields/build-module/actions/rename-post.js /** * WordPress dependencies */ @@ -6382,11 +6499,10 @@ const external_wp_patterns_namespaceObject = window["wp"]["patterns"]; - // Patterns. const { PATTERN_TYPES -} = unlock(external_wp_patterns_namespaceObject.privateApis); +} = lock_unlock_unlock(external_wp_patterns_namespaceObject.privateApis); const renamePost = { id: 'rename-post', label: (0,external_wp_i18n_namespaceObject.__)('Rename'), @@ -6395,7 +6511,7 @@ const renamePost = { return false; } // Templates, template parts and patterns have special checks for renaming. - if (![TEMPLATE_POST_TYPE, TEMPLATE_PART_POST_TYPE, ...Object.values(PATTERN_TYPES)].includes(post.type)) { + if (!['wp_template', 'wp_template_part', ...Object.values(PATTERN_TYPES)].includes(post.type)) { return post.permissions?.update; } @@ -6404,7 +6520,7 @@ const renamePost = { return isTemplateRemovable(post) && post.is_custom && post.permissions?.update; } if (isTemplatePart(post)) { - return post.source === TEMPLATE_ORIGINS.custom && !post?.has_theme_file && post.permissions?.update; + return post.source === 'custom' && !post?.has_theme_file && post.permissions?.update; } return post.type === PATTERN_TYPES.user && post.permissions?.update; }, @@ -6479,253 +6595,12 @@ const renamePost = { }); } }; + +/** + * Rename action for PostWithPermissions. + */ /* harmony default export */ const rename_post = (renamePost); -;// ./node_modules/@wordpress/editor/build-module/dataviews/actions/restore-post.js -/** - * WordPress dependencies - */ - - - - -/** - * Internal dependencies - */ - -const restorePost = { - id: 'restore', - label: (0,external_wp_i18n_namespaceObject.__)('Restore'), - isPrimary: true, - icon: library_backup, - supportsBulk: true, - isEligible(item) { - return !isTemplateOrTemplatePart(item) && item.type !== 'wp_block' && item.status === 'trash' && item.permissions?.update; - }, - async callback(posts, { - registry, - onActionPerformed - }) { - const { - createSuccessNotice, - createErrorNotice - } = registry.dispatch(external_wp_notices_namespaceObject.store); - const { - editEntityRecord, - saveEditedEntityRecord - } = registry.dispatch(external_wp_coreData_namespaceObject.store); - await Promise.allSettled(posts.map(post => { - return editEntityRecord('postType', post.type, post.id, { - status: 'draft' - }); - })); - const promiseResult = await Promise.allSettled(posts.map(post => { - return saveEditedEntityRecord('postType', post.type, post.id, { - throwOnError: true - }); - })); - if (promiseResult.every(({ - status - }) => status === 'fulfilled')) { - let successMessage; - if (posts.length === 1) { - successMessage = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: The number of posts. */ - (0,external_wp_i18n_namespaceObject.__)('"%s" has been restored.'), getItemTitle(posts[0])); - } else if (posts[0].type === 'page') { - successMessage = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: The number of posts. */ - (0,external_wp_i18n_namespaceObject.__)('%d pages have been restored.'), posts.length); - } else { - successMessage = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: The number of posts. */ - (0,external_wp_i18n_namespaceObject.__)('%d posts have been restored.'), posts.length); - } - createSuccessNotice(successMessage, { - type: 'snackbar', - id: 'restore-post-action' - }); - if (onActionPerformed) { - onActionPerformed(posts); - } - } else { - // If there was at lease one failure. - let errorMessage; - // If we were trying to move a single post to the trash. - if (promiseResult.length === 1) { - const typedError = promiseResult[0]; - if (typedError.reason?.message) { - errorMessage = typedError.reason.message; - } else { - errorMessage = (0,external_wp_i18n_namespaceObject.__)('An error occurred while restoring the post.'); - } - // If we were trying to move multiple posts to the trash - } else { - const errorMessages = new Set(); - const failedPromises = promiseResult.filter(({ - status - }) => status === 'rejected'); - for (const failedPromise of failedPromises) { - const typedError = failedPromise; - if (typedError.reason?.message) { - errorMessages.add(typedError.reason.message); - } - } - if (errorMessages.size === 0) { - errorMessage = (0,external_wp_i18n_namespaceObject.__)('An error occurred while restoring the posts.'); - } else if (errorMessages.size === 1) { - errorMessage = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: an error message */ - (0,external_wp_i18n_namespaceObject.__)('An error occurred while restoring the posts: %s'), [...errorMessages][0]); - } else { - errorMessage = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: a list of comma separated error messages */ - (0,external_wp_i18n_namespaceObject.__)('Some errors occurred while restoring the posts: %s'), [...errorMessages].join(',')); - } - } - createErrorNotice(errorMessage, { - type: 'snackbar' - }); - } - } -}; -/* harmony default export */ const restore_post = (restorePost); - -;// ./node_modules/@wordpress/icons/build-module/library/external.js -/** - * WordPress dependencies - */ - - -const external = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.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" - }) -}); -/* harmony default export */ const library_external = (external); - -;// ./node_modules/@wordpress/fields/build-module/actions/base-post/view-post.js -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - -const viewPost = { - id: 'view-post', - label: (0,external_wp_i18n_namespaceObject._x)('View', 'verb'), - isPrimary: true, - icon: library_external, - isEligible(post) { - return post.status !== 'trash'; - }, - callback(posts, { - onActionPerformed - }) { - const post = posts[0]; - window.open(post?.link, '_blank'); - if (onActionPerformed) { - onActionPerformed(posts); - } - } -}; -/* harmony default export */ const view_post = (viewPost); - -;// ./node_modules/@wordpress/fields/build-module/actions/common/view-post-revisions.js -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - -const viewPostRevisions = { - id: 'view-post-revisions', - context: 'list', - label(items) { - var _items$0$_links$versi; - const revisionsCount = (_items$0$_links$versi = items[0]._links?.['version-history']?.[0]?.count) !== null && _items$0$_links$versi !== void 0 ? _items$0$_links$versi : 0; - return (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: number of revisions. */ - (0,external_wp_i18n_namespaceObject.__)('View revisions (%s)'), revisionsCount); - }, - isEligible(post) { - var _post$_links$predeces, _post$_links$version; - if (post.status === 'trash') { - return false; - } - const lastRevisionId = (_post$_links$predeces = post?._links?.['predecessor-version']?.[0]?.id) !== null && _post$_links$predeces !== void 0 ? _post$_links$predeces : null; - const revisionsCount = (_post$_links$version = post?._links?.['version-history']?.[0]?.count) !== null && _post$_links$version !== void 0 ? _post$_links$version : 0; - return !!lastRevisionId && revisionsCount > 1; - }, - callback(posts, { - onActionPerformed - }) { - const post = posts[0]; - const href = (0,external_wp_url_namespaceObject.addQueryArgs)('revision.php', { - revision: post?._links?.['predecessor-version']?.[0]?.id - }); - document.location.href = href; - if (onActionPerformed) { - onActionPerformed(posts); - } - } -}; -/* harmony default export */ const view_post_revisions = (viewPostRevisions); - -;// ./node_modules/@wordpress/fields/build-module/lock-unlock.js -/** - * WordPress dependencies - */ - -const { - lock: lock_unlock_lock, - unlock: lock_unlock_unlock -} = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/fields'); - -;// ./node_modules/@wordpress/fields/build-module/actions/pattern/duplicate-pattern.js -/** - * WordPress dependencies - */ - -// @ts-ignore - -/** - * Internal dependencies - */ - - -// Patterns. -const { - CreatePatternModalContents, - useDuplicatePatternProps -} = lock_unlock_unlock(external_wp_patterns_namespaceObject.privateApis); -const duplicatePattern = { - id: 'duplicate-pattern', - label: (0,external_wp_i18n_namespaceObject._x)('Duplicate', 'action label'), - isEligible: item => item.type !== 'wp_template_part', - modalHeader: (0,external_wp_i18n_namespaceObject._x)('Duplicate pattern', 'action label'), - RenderModal: ({ - items, - closeModal - }) => { - const [item] = items; - const duplicatedProps = useDuplicatePatternProps({ - pattern: item, - onSuccess: () => closeModal?.() - }); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CreatePatternModalContents, { - onClose: closeModal, - confirmLabel: (0,external_wp_i18n_namespaceObject._x)('Duplicate', 'action label'), - ...duplicatedProps - }); - } -}; -/* harmony default export */ const duplicate_pattern = (duplicatePattern); - ;// ./node_modules/@wordpress/dataviews/build-module/field-types/integer.js /** * Internal dependencies @@ -6735,7 +6610,7 @@ function sort(a, b, direction) { return direction === 'asc' ? a - b : b - a; } function isValid(value, context) { - // TODO: this implicitely means the value is required. + // TODO: this implicitly means the value is required. if (value === '') { return false; } @@ -6860,7 +6735,6 @@ function getFieldTypeDefinition(type) { * Internal dependencies */ - function DateTime({ data, field, @@ -7106,11 +6980,26 @@ function getControlByType(type) { } ;// ./node_modules/@wordpress/dataviews/build-module/normalize-fields.js +/* wp:polyfill */ /** * Internal dependencies */ +const getValueFromId = id => ({ + item +}) => { + const path = id.split('.'); + let value = item; + for (const segment of path) { + if (value.hasOwnProperty(segment)) { + value = value[segment]; + } else { + value = undefined; + } + } + return value; +}; /** * Apply default values and normalize the fields config. @@ -7122,9 +7011,7 @@ function normalizeFields(fields) { return fields.map(field => { var _field$sort, _field$isValid, _field$enableHiding, _field$enableSorting; const fieldTypeDefinition = getFieldTypeDefinition(field.type); - const getValue = field.getValue || (({ - item - }) => item[field.id]); + const getValue = field.getValue || getValueFromId(field.id); const sort = (_field$sort = field.sort) !== null && _field$sort !== void 0 ? _field$sort : function sort(a, b, direction) { return fieldTypeDefinition.sort(getValue({ item: a @@ -7165,10 +7052,20 @@ function normalizeFields(fields) { } ;// ./node_modules/@wordpress/dataviews/build-module/validation.js +/* wp:polyfill */ /** * Internal dependencies */ +/** + * Whether or not the given item's value is valid according to the fields and form config. + * + * @param item The item to validate. + * @param fields Fields config. + * @param form Form config. + * + * @return A boolean indicating if the item is valid (true) or not (false). + */ function isItemValid(item, fields, form) { const _fields = normalizeFields(fields.filter(({ id @@ -7180,7 +7077,43 @@ function isItemValid(item, fields, form) { }); } +;// ./node_modules/@wordpress/dataviews/build-module/components/dataform-context/index.js +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + +const DataFormContext = (0,external_wp_element_namespaceObject.createContext)({ + fields: [] +}); +function DataFormProvider({ + fields, + children +}) { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataFormContext.Provider, { + value: { + fields + }, + children: children + }); +} +/* harmony default export */ const dataform_context = (DataFormContext); + +;// ./node_modules/@wordpress/dataviews/build-module/dataforms-layouts/is-combined-field.js +/** + * Internal dependencies + */ + +function isCombinedField(field) { + return field.children !== undefined; +} + ;// ./node_modules/@wordpress/dataviews/build-module/dataforms-layouts/regular/index.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -7192,26 +7125,94 @@ function isItemValid(item, fields, form) { */ -function FormRegular({ - data, - fields, - form, - onChange + + + +function Header({ + title }) { - const visibleFields = (0,external_wp_element_namespaceObject.useMemo)(() => { - var _form$fields; - return normalizeFields(((_form$fields = form.fields) !== null && _form$fields !== void 0 ? _form$fields : []).map(fieldId => fields.find(({ - id - }) => id === fieldId)).filter(field => !!field)); - }, [fields, form.fields]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalVStack, { + className: "dataforms-layouts-regular__header", spacing: 4, - children: visibleFields.map(field => { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(field.Edit, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { + alignment: "center", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHeading, { + level: 2, + size: 13, + children: title + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalSpacer, {})] + }) + }); +} +function FormRegularField({ + data, + field, + onChange, + hideLabelFromVision +}) { + var _field$labelPosition; + const { + fields + } = (0,external_wp_element_namespaceObject.useContext)(dataform_context); + const form = (0,external_wp_element_namespaceObject.useMemo)(() => { + if (isCombinedField(field)) { + return { + fields: field.children.map(child => { + if (typeof child === 'string') { + return { + id: child + }; + } + return child; + }), + type: 'regular' + }; + } + return { + type: 'regular', + fields: [] + }; + }, [field]); + if (isCombinedField(field)) { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [!hideLabelFromVision && field.label && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Header, { + title: field.label + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataFormLayout, { data: data, - field: field, + form: form, onChange: onChange - }, field.id); + })] + }); + } + const labelPosition = (_field$labelPosition = field.labelPosition) !== null && _field$labelPosition !== void 0 ? _field$labelPosition : 'top'; + const fieldDefinition = fields.find(fieldDef => fieldDef.id === field.id); + if (!fieldDefinition) { + return null; + } + if (labelPosition === 'side') { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { + className: "dataforms-layouts-regular__field", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: "dataforms-layouts-regular__field-label", + children: fieldDefinition.label + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: "dataforms-layouts-regular__field-control", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(fieldDefinition.Edit, { + data: data, + field: fieldDefinition, + onChange: onChange, + hideLabelFromVision: true + }, fieldDefinition.id) + })] + }); + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: "dataforms-layouts-regular__field", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(fieldDefinition.Edit, { + data: data, + field: fieldDefinition, + onChange: onChange, + hideLabelFromVision: labelPosition === 'none' ? true : hideLabelFromVision }) }); } @@ -7232,6 +7233,7 @@ const closeSmall = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx) /* harmony default export */ const close_small = (closeSmall); ;// ./node_modules/@wordpress/dataviews/build-module/dataforms-layouts/panel/index.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -7247,6 +7249,7 @@ const closeSmall = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx) + function DropdownHeader({ title, onClose @@ -7256,7 +7259,7 @@ function DropdownHeader({ spacing: 4, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { alignment: "center", - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHeading, { + children: [title && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHeading, { level: 2, size: 13, children: title @@ -7269,14 +7272,38 @@ function DropdownHeader({ }) }); } -function FormField({ +function PanelDropdown({ + fieldDefinition, + popoverAnchor, + labelPosition = 'side', data, - field, - onChange + onChange, + field }) { - // Use internal state instead of a ref to make sure that the component - // re-renders when the popover's anchor updates. - const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null); + const fieldLabel = isCombinedField(field) ? field.label : fieldDefinition?.label; + const form = (0,external_wp_element_namespaceObject.useMemo)(() => { + if (isCombinedField(field)) { + return { + type: 'regular', + fields: field.children.map(child => { + if (typeof child === 'string') { + return { + id: child + }; + } + return child; + }) + }; + } + // If not explicit children return the field id itself. + return { + type: 'regular', + fields: [{ + id: field.id + }] + }; + }, [field]); + // Memoize popoverProps to avoid returning a new object every time. const popoverProps = (0,external_wp_element_namespaceObject.useMemo)(() => ({ // Anchor the popover to the middle of the entire row so that it doesn't @@ -7286,115 +7313,274 @@ function FormField({ offset: 36, shift: true }), [popoverAnchor]); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Dropdown, { + contentClassName: "dataforms-layouts-panel__field-dropdown", + popoverProps: popoverProps, + focusOnMount: true, + toggleProps: { + size: 'compact', + variant: 'tertiary', + tooltipPosition: 'middle left' + }, + renderToggle: ({ + isOpen, + onToggle + }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + className: "dataforms-layouts-panel__field-control", + size: "compact", + variant: ['none', 'top'].includes(labelPosition) ? 'link' : 'tertiary', + "aria-expanded": isOpen, + "aria-label": (0,external_wp_i18n_namespaceObject.sprintf)( + // translators: %s: Field name. + (0,external_wp_i18n_namespaceObject._x)('Edit %s', 'field'), fieldLabel), + onClick: onToggle, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(fieldDefinition.render, { + item: data + }) + }), + renderContent: ({ + onClose + }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DropdownHeader, { + title: fieldLabel, + onClose: onClose + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataFormLayout, { + data: data, + form: form, + onChange: onChange, + children: (FieldLayout, nestedField) => { + var _form$fields; + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(FieldLayout, { + data: data, + field: nestedField, + onChange: onChange, + hideLabelFromVision: ((_form$fields = form?.fields) !== null && _form$fields !== void 0 ? _form$fields : []).length < 2 + }, nestedField.id); + } + })] + }) + }); +} +function FormPanelField({ + data, + field, + onChange +}) { + var _field$labelPosition; + const { + fields + } = (0,external_wp_element_namespaceObject.useContext)(dataform_context); + const fieldDefinition = fields.find(fieldDef => { + // Default to the first child if it is a combined field. + if (isCombinedField(field)) { + const children = field.children.filter(child => typeof child === 'string' || !isCombinedField(child)); + const firstChildFieldId = typeof children[0] === 'string' ? children[0] : children[0].id; + return fieldDef.id === firstChildFieldId; + } + return fieldDef.id === field.id; + }); + const labelPosition = (_field$labelPosition = field.labelPosition) !== null && _field$labelPosition !== void 0 ? _field$labelPosition : 'side'; + + // Use internal state instead of a ref to make sure that the component + // re-renders when the popover's anchor updates. + const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null); + if (!fieldDefinition) { + return null; + } + const fieldLabel = isCombinedField(field) ? field.label : fieldDefinition?.label; + if (labelPosition === 'top') { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { + className: "dataforms-layouts-panel__field", + spacing: 0, + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: "dataforms-layouts-panel__field-label", + style: { + paddingBottom: 0 + }, + children: fieldLabel + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: "dataforms-layouts-panel__field-control", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PanelDropdown, { + field: field, + popoverAnchor: popoverAnchor, + fieldDefinition: fieldDefinition, + data: data, + onChange: onChange, + labelPosition: labelPosition + }) + })] + }); + } + if (labelPosition === 'none') { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: "dataforms-layouts-panel__field", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PanelDropdown, { + field: field, + popoverAnchor: popoverAnchor, + fieldDefinition: fieldDefinition, + data: data, + onChange: onChange, + labelPosition: labelPosition + }) + }); + } + + // Defaults to label position side. return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { ref: setPopoverAnchor, className: "dataforms-layouts-panel__field", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "dataforms-layouts-panel__field-label", - children: field.label + children: fieldLabel }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Dropdown, { - contentClassName: "dataforms-layouts-panel__field-dropdown", - popoverProps: popoverProps, - focusOnMount: true, - toggleProps: { - size: 'compact', - variant: 'tertiary', - tooltipPosition: 'middle left' - }, - renderToggle: ({ - isOpen, - onToggle - }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - className: "dataforms-layouts-panel__field-control", - size: "compact", - variant: "tertiary", - "aria-expanded": isOpen, - "aria-label": (0,external_wp_i18n_namespaceObject.sprintf)( - // translators: %s: Field name. - (0,external_wp_i18n_namespaceObject._x)('Edit %s', 'field'), field.label), - onClick: onToggle, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(field.render, { - item: data - }) - }), - renderContent: ({ - onClose - }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DropdownHeader, { - title: field.label, - onClose: onClose - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(field.Edit, { - data: data, - field: field, - onChange: onChange, - hideLabelFromVision: true - }, field.id)] - }) + className: "dataforms-layouts-panel__field-control", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PanelDropdown, { + field: field, + popoverAnchor: popoverAnchor, + fieldDefinition: fieldDefinition, + data: data, + onChange: onChange, + labelPosition: labelPosition }) })] }); } -function FormPanel({ + +;// ./node_modules/@wordpress/dataviews/build-module/dataforms-layouts/index.js +/* wp:polyfill */ +/** + * Internal dependencies + */ + + +const FORM_FIELD_LAYOUTS = [{ + type: 'regular', + component: FormRegularField +}, { + type: 'panel', + component: FormPanelField +}]; +function getFormFieldLayout(type) { + return FORM_FIELD_LAYOUTS.find(layout => layout.type === type); +} + +;// ./node_modules/@wordpress/dataviews/build-module/normalize-form-fields.js +/* wp:polyfill */ +/** + * Internal dependencies + */ + +function normalizeFormFields(form) { + var _form$type, _form$labelPosition, _form$fields; + let layout = 'regular'; + if (['regular', 'panel'].includes((_form$type = form.type) !== null && _form$type !== void 0 ? _form$type : '')) { + layout = form.type; + } + const labelPosition = (_form$labelPosition = form.labelPosition) !== null && _form$labelPosition !== void 0 ? _form$labelPosition : layout === 'regular' ? 'top' : 'side'; + return ((_form$fields = form.fields) !== null && _form$fields !== void 0 ? _form$fields : []).map(field => { + var _field$layout, _field$labelPosition; + if (typeof field === 'string') { + return { + id: field, + layout, + labelPosition + }; + } + const fieldLayout = (_field$layout = field.layout) !== null && _field$layout !== void 0 ? _field$layout : layout; + const fieldLabelPosition = (_field$labelPosition = field.labelPosition) !== null && _field$labelPosition !== void 0 ? _field$labelPosition : fieldLayout === 'regular' ? 'top' : 'side'; + return { + ...field, + layout: fieldLayout, + labelPosition: fieldLabelPosition + }; + }); +} + +;// ./node_modules/@wordpress/dataviews/build-module/dataforms-layouts/data-form-layout.js +/* wp:polyfill */ +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + + + + + +function DataFormLayout({ data, - fields, form, - onChange + onChange, + children }) { - const visibleFields = (0,external_wp_element_namespaceObject.useMemo)(() => { - var _form$fields; - return normalizeFields(((_form$fields = form.fields) !== null && _form$fields !== void 0 ? _form$fields : []).map(fieldId => fields.find(({ - id - }) => id === fieldId)).filter(field => !!field)); - }, [fields, form.fields]); + const { + fields: fieldDefinitions + } = (0,external_wp_element_namespaceObject.useContext)(dataform_context); + function getFieldDefinition(field) { + const fieldId = typeof field === 'string' ? field : field.id; + return fieldDefinitions.find(fieldDefinition => fieldDefinition.id === fieldId); + } + const normalizedFormFields = (0,external_wp_element_namespaceObject.useMemo)(() => normalizeFormFields(form), [form]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 2, - children: visibleFields.map(field => { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(FormField, { + children: normalizedFormFields.map(formField => { + const FieldLayout = getFormFieldLayout(formField.layout)?.component; + if (!FieldLayout) { + return null; + } + const fieldDefinition = !isCombinedField(formField) ? getFieldDefinition(formField) : undefined; + if (fieldDefinition && fieldDefinition.isVisible && !fieldDefinition.isVisible(data)) { + return null; + } + if (children) { + return children(FieldLayout, formField); + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(FieldLayout, { data: data, - field: field, + field: formField, onChange: onChange - }, field.id); + }, formField.id); }) }); } -;// ./node_modules/@wordpress/dataviews/build-module/dataforms-layouts/index.js -/** - * Internal dependencies - */ - - -const FORM_LAYOUTS = [{ - type: 'regular', - component: FormRegular -}, { - type: 'panel', - component: FormPanel -}]; -function getFormLayout(type) { - return FORM_LAYOUTS.find(layout => layout.type === type); -} - ;// ./node_modules/@wordpress/dataviews/build-module/components/dataform/index.js +/** + * WordPress dependencies + */ + + /** * Internal dependencies */ + + function DataForm({ + data, form, - ...props + fields, + onChange }) { - var _form$type; - const layout = getFormLayout((_form$type = form.type) !== null && _form$type !== void 0 ? _form$type : 'regular'); - if (!layout) { + const normalizedFields = (0,external_wp_element_namespaceObject.useMemo)(() => normalizeFields(fields), [fields]); + if (!form.fields) { return null; } - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(layout.component, { - form: form, - ...props + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataFormProvider, { + fields: normalizedFields, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataFormLayout, { + data: data, + form: form, + onChange: onChange + }) }); } @@ -7404,19 +7590,24 @@ function DataForm({ */ + /** * Internal dependencies */ const orderField = { - type: 'integer', id: 'menu_order', + type: 'integer', label: (0,external_wp_i18n_namespaceObject.__)('Order'), description: (0,external_wp_i18n_namespaceObject.__)('Determines the order of pages.') }; + +/** + * Order field for BasePost. + */ /* harmony default export */ const order = (orderField); -;// ./node_modules/@wordpress/fields/build-module/actions/base-post/reorder-page.js +;// ./node_modules/@wordpress/fields/build-module/actions/reorder-page.js /** * WordPress dependencies */ @@ -7434,8 +7625,7 @@ const orderField = { - -const fields = [order]; +const reorder_page_fields = [order]; const formOrderAction = { fields: ['menu_order'] }; @@ -7456,7 +7646,7 @@ function ReorderModal({ } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); async function onOrder(event) { event.preventDefault(); - if (!isItemValid(item, fields, formOrderAction)) { + if (!isItemValid(item, reorder_page_fields, formOrderAction)) { return; } try { @@ -7480,7 +7670,7 @@ function ReorderModal({ }); } } - const isSaveDisabled = !isItemValid(item, fields, formOrderAction); + const isSaveDisabled = !isItemValid(item, reorder_page_fields, formOrderAction); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("form", { onSubmit: onOrder, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { @@ -7489,7 +7679,7 @@ function ReorderModal({ children: (0,external_wp_i18n_namespaceObject.__)('Determines the order of pages. Pages with the same order value are sorted alphabetically. Negative order values are supported.') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataForm, { data: item, - fields: fields, + fields: reorder_page_fields, form: formOrderAction, onChange: changes => setItem({ ...item, @@ -7526,6 +7716,10 @@ const reorderPage = { }, RenderModal: ReorderModal }; + +/** + * Reorder action for BasePost. + */ /* harmony default export */ const reorder_page = (reorderPage); ;// ./node_modules/client-zip/index.js @@ -7547,62 +7741,8 @@ const download = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(e }); /* harmony default export */ const library_download = (download); -;// ./node_modules/@wordpress/fields/build-module/actions/utils.js -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - -const utils_TEMPLATE_POST_TYPE = 'wp_template'; -const utils_TEMPLATE_PART_POST_TYPE = 'wp_template_part'; -const utils_TEMPLATE_ORIGINS = { - custom: 'custom', - theme: 'theme', - plugin: 'plugin' -}; -function utils_isTemplate(post) { - return post.type === utils_TEMPLATE_POST_TYPE; -} -function utils_isTemplatePart(post) { - return post.type === utils_TEMPLATE_PART_POST_TYPE; -} -function utils_isTemplateOrTemplatePart(p) { - return p.type === utils_TEMPLATE_POST_TYPE || p.type === utils_TEMPLATE_PART_POST_TYPE; -} -function utils_getItemTitle(item) { - if (typeof item.title === 'string') { - return (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(item.title); - } - if ('rendered' in item.title) { - return (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(item.title.rendered); - } - if ('raw' in item.title) { - return (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(item.title.raw); - } - return ''; -} - -/** - * Check if a template is removable. - * - * @param template The template entity to check. - * @return Whether the template is removable. - */ -function utils_isTemplateRemovable(template) { - if (!template) { - return false; - } - // In patterns list page we map the templates parts to a different object - // than the one returned from the endpoint. This is why we need to check for - // two props whether is custom or has a theme file. - return [template.source, template.source].includes(utils_TEMPLATE_ORIGINS.custom) && !Boolean(template.type === 'wp_template' && template?.plugin) && !template.has_theme_file; -} - -;// ./node_modules/@wordpress/fields/build-module/actions/pattern/export-pattern.js +;// ./node_modules/@wordpress/fields/build-module/actions/export-pattern.js +/* wp:polyfill */ /** * External dependencies */ @@ -7624,7 +7764,7 @@ function utils_isTemplateRemovable(template) { function getJsonFromItem(item) { return JSON.stringify({ __file: item.type, - title: utils_getItemTitle(item), + title: getItemTitle(item), content: typeof item.content === 'string' ? item.content : item.content?.raw, syncStatus: item.wp_pattern_sync_status }, null, 2); @@ -7637,11 +7777,11 @@ const exportPattern = { isEligible: item => item.type === 'wp_block', callback: async items => { if (items.length === 1) { - return (0,external_wp_blob_namespaceObject.downloadBlob)(`${paramCase(utils_getItemTitle(items[0]) || items[0].slug)}.json`, getJsonFromItem(items[0]), 'application/json'); + return (0,external_wp_blob_namespaceObject.downloadBlob)(`${paramCase(getItemTitle(items[0]) || items[0].slug)}.json`, getJsonFromItem(items[0]), 'application/json'); } const nameCount = {}; const filesToZip = items.map(item => { - const name = paramCase(utils_getItemTitle(item) || item.slug); + const name = paramCase(getItemTitle(item) || item.slug); nameCount[name] = (nameCount[name] || 0) + 1; return { name: `${name + (nameCount[name] > 1 ? '-' + (nameCount[name] - 1) : '')}.json`, @@ -7652,14 +7792,33 @@ const exportPattern = { return (0,external_wp_blob_namespaceObject.downloadBlob)((0,external_wp_i18n_namespaceObject.__)('patterns-export') + '.zip', await A(filesToZip).blob(), 'application/zip'); } }; + +/** + * Export action as JSON for Pattern. + */ /* harmony default export */ const export_pattern = (exportPattern); -;// ./node_modules/@wordpress/fields/build-module/actions/common/permanently-delete-post.js +;// ./node_modules/@wordpress/icons/build-module/library/backup.js /** * WordPress dependencies */ +const backup = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "M5.5 12h1.75l-2.5 3-2.5-3H4a8 8 0 113.134 6.35l.907-1.194A6.5 6.5 0 105.5 12zm9.53 1.97l-2.28-2.28V8.5a.75.75 0 00-1.5 0V12a.747.747 0 00.218.529l1.282-.84-1.28.842 2.5 2.5a.75.75 0 101.06-1.061z" + }) +}); +/* harmony default export */ const library_backup = (backup); + +;// ./node_modules/@wordpress/fields/build-module/actions/restore-post.js +/* wp:polyfill */ +/** + * WordPress dependencies + */ + @@ -7667,20 +7826,14 @@ const exportPattern = { * Internal dependencies */ -const permanentlyDeletePost = { - id: 'permanently-delete', - label: (0,external_wp_i18n_namespaceObject.__)('Permanently delete'), +const restorePost = { + id: 'restore', + label: (0,external_wp_i18n_namespaceObject.__)('Restore'), + isPrimary: true, + icon: library_backup, supportsBulk: true, - icon: library_trash, isEligible(item) { - if (utils_isTemplateOrTemplatePart(item) || item.type === 'wp_block') { - return false; - } - const { - status, - permissions - } = item; - return status === 'trash' && permissions?.delete; + return !isTemplateOrTemplatePart(item) && item.type !== 'wp_block' && item.status === 'trash' && item.permissions?.update; }, async callback(posts, { registry, @@ -7691,43 +7844,52 @@ const permanentlyDeletePost = { createErrorNotice } = registry.dispatch(external_wp_notices_namespaceObject.store); const { - deleteEntityRecord + editEntityRecord, + saveEditedEntityRecord } = registry.dispatch(external_wp_coreData_namespaceObject.store); + await Promise.allSettled(posts.map(post => { + return editEntityRecord('postType', post.type, post.id, { + status: 'draft' + }); + })); const promiseResult = await Promise.allSettled(posts.map(post => { - return deleteEntityRecord('postType', post.type, post.id, { - force: true - }, { + return saveEditedEntityRecord('postType', post.type, post.id, { throwOnError: true }); })); - // If all the promises were fulfilled with success. if (promiseResult.every(({ status }) => status === 'fulfilled')) { let successMessage; - if (promiseResult.length === 1) { - successMessage = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: The posts's title. */ - (0,external_wp_i18n_namespaceObject.__)('"%s" permanently deleted.'), utils_getItemTitle(posts[0])); + if (posts.length === 1) { + successMessage = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: The number of posts. */ + (0,external_wp_i18n_namespaceObject.__)('"%s" has been restored.'), getItemTitle(posts[0])); + } else if (posts[0].type === 'page') { + successMessage = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: The number of posts. */ + (0,external_wp_i18n_namespaceObject.__)('%d pages have been restored.'), posts.length); } else { - successMessage = (0,external_wp_i18n_namespaceObject.__)('The items were permanently deleted.'); + successMessage = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: The number of posts. */ + (0,external_wp_i18n_namespaceObject.__)('%d posts have been restored.'), posts.length); } createSuccessNotice(successMessage, { type: 'snackbar', - id: 'permanently-delete-post-action' + id: 'restore-post-action' }); - onActionPerformed?.(posts); + if (onActionPerformed) { + onActionPerformed(posts); + } } else { // If there was at lease one failure. let errorMessage; - // If we were trying to permanently delete a single post. + // If we were trying to move a single post to the trash. if (promiseResult.length === 1) { const typedError = promiseResult[0]; if (typedError.reason?.message) { errorMessage = typedError.reason.message; } else { - errorMessage = (0,external_wp_i18n_namespaceObject.__)('An error occurred while permanently deleting the item.'); + errorMessage = (0,external_wp_i18n_namespaceObject.__)('An error occurred while restoring the post.'); } - // If we were trying to permanently delete multiple posts + // If we were trying to move multiple posts to the trash } else { const errorMessages = new Set(); const failedPromises = promiseResult.filter(({ @@ -7740,13 +7902,13 @@ const permanentlyDeletePost = { } } if (errorMessages.size === 0) { - errorMessage = (0,external_wp_i18n_namespaceObject.__)('An error occurred while permanently deleting the items.'); + errorMessage = (0,external_wp_i18n_namespaceObject.__)('An error occurred while restoring the posts.'); } else if (errorMessages.size === 1) { - errorMessage = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: an error message */ - (0,external_wp_i18n_namespaceObject.__)('An error occurred while permanently deleting the items: %s'), [...errorMessages][0]); + errorMessage = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: an error message */ + (0,external_wp_i18n_namespaceObject.__)('An error occurred while restoring the posts: %s'), [...errorMessages][0]); } else { - errorMessage = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: a list of comma separated error messages */ - (0,external_wp_i18n_namespaceObject.__)('Some errors occurred while permanently deleting the items: %s'), [...errorMessages].join(',')); + errorMessage = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: a list of comma separated error messages */ + (0,external_wp_i18n_namespaceObject.__)('Some errors occurred while restoring the posts: %s'), [...errorMessages].join(',')); } } createErrorNotice(errorMessage, { @@ -7755,9 +7917,13 @@ const permanentlyDeletePost = { } } }; -/* harmony default export */ const permanently_delete_post = (permanentlyDeletePost); -;// ./node_modules/@wordpress/editor/build-module/dataviews/actions/delete-post.js +/** + * Restore action for PostWithPermissions. + */ +/* harmony default export */ const restore_post = (restorePost); + +;// ./node_modules/@wordpress/fields/build-module/actions/reset-post.js /** * WordPress dependencies */ @@ -7766,20 +7932,372 @@ const permanentlyDeletePost = { + // @ts-ignore + + + + /** * Internal dependencies */ + +const reset_post_isTemplateRevertable = templateOrTemplatePart => { + if (!templateOrTemplatePart) { + return false; + } + return templateOrTemplatePart.source === 'custom' && (Boolean(templateOrTemplatePart?.plugin) || templateOrTemplatePart?.has_theme_file); +}; + +/** + * Copied - pasted from https://github.com/WordPress/gutenberg/blob/bf1462ad37d4637ebbf63270b9c244b23c69e2a8/packages/editor/src/store/private-actions.js#L233-L365 + * + * @param {Object} template The template to revert. + * @param {Object} [options] + * @param {boolean} [options.allowUndo] Whether to allow the user to undo + * reverting the template. Default true. + */ +const revertTemplate = async (template, { + allowUndo = true +} = {}) => { + const noticeId = 'edit-site-template-reverted'; + (0,external_wp_data_namespaceObject.dispatch)(external_wp_notices_namespaceObject.store).removeNotice(noticeId); + if (!reset_post_isTemplateRevertable(template)) { + (0,external_wp_data_namespaceObject.dispatch)(external_wp_notices_namespaceObject.store).createErrorNotice((0,external_wp_i18n_namespaceObject.__)('This template is not revertable.'), { + type: 'snackbar' + }); + return; + } + try { + const templateEntityConfig = (0,external_wp_data_namespaceObject.select)(external_wp_coreData_namespaceObject.store).getEntityConfig('postType', template.type); + if (!templateEntityConfig) { + (0,external_wp_data_namespaceObject.dispatch)(external_wp_notices_namespaceObject.store).createErrorNotice((0,external_wp_i18n_namespaceObject.__)('The editor has encountered an unexpected error. Please reload.'), { + type: 'snackbar' + }); + return; + } + const fileTemplatePath = (0,external_wp_url_namespaceObject.addQueryArgs)(`${templateEntityConfig.baseURL}/${template.id}`, { + context: 'edit', + source: template.origin + }); + const fileTemplate = await external_wp_apiFetch_default()({ + path: fileTemplatePath + }); + if (!fileTemplate) { + (0,external_wp_data_namespaceObject.dispatch)(external_wp_notices_namespaceObject.store).createErrorNotice((0,external_wp_i18n_namespaceObject.__)('The editor has encountered an unexpected error. Please reload.'), { + type: 'snackbar' + }); + return; + } + const serializeBlocks = ({ + blocks: blocksForSerialization = [] + }) => (0,external_wp_blocks_namespaceObject.__unstableSerializeAndClean)(blocksForSerialization); + const edited = (0,external_wp_data_namespaceObject.select)(external_wp_coreData_namespaceObject.store).getEditedEntityRecord('postType', template.type, template.id); + + // We are fixing up the undo level here to make sure we can undo + // the revert in the header toolbar correctly. + (0,external_wp_data_namespaceObject.dispatch)(external_wp_coreData_namespaceObject.store).editEntityRecord('postType', template.type, template.id, { + content: serializeBlocks, + // Required to make the `undo` behave correctly. + blocks: edited.blocks, + // Required to revert the blocks in the editor. + source: 'custom' // required to avoid turning the editor into a dirty state + }, { + undoIgnore: true // Required to merge this edit with the last undo level. + }); + const blocks = (0,external_wp_blocks_namespaceObject.parse)(fileTemplate?.content?.raw); + (0,external_wp_data_namespaceObject.dispatch)(external_wp_coreData_namespaceObject.store).editEntityRecord('postType', template.type, fileTemplate.id, { + content: serializeBlocks, + blocks, + source: 'theme' + }); + if (allowUndo) { + const undoRevert = () => { + (0,external_wp_data_namespaceObject.dispatch)(external_wp_coreData_namespaceObject.store).editEntityRecord('postType', template.type, edited.id, { + content: serializeBlocks, + blocks: edited.blocks, + source: 'custom' + }); + }; + (0,external_wp_data_namespaceObject.dispatch)(external_wp_notices_namespaceObject.store).createSuccessNotice((0,external_wp_i18n_namespaceObject.__)('Template reset.'), { + type: 'snackbar', + id: noticeId, + actions: [{ + label: (0,external_wp_i18n_namespaceObject.__)('Undo'), + onClick: undoRevert + }] + }); + } + } catch (error) { + const errorMessage = error.message && error.code !== 'unknown_error' ? error.message : (0,external_wp_i18n_namespaceObject.__)('Template revert failed. Please reload.'); + (0,external_wp_data_namespaceObject.dispatch)(external_wp_notices_namespaceObject.store).createErrorNotice(errorMessage, { + type: 'snackbar' + }); + } +}; +const resetPostAction = { + id: 'reset-post', + label: (0,external_wp_i18n_namespaceObject.__)('Reset'), + isEligible: item => { + return isTemplateOrTemplatePart(item) && item?.source === 'custom' && (Boolean(item.type === 'wp_template' && item?.plugin) || item?.has_theme_file); + }, + icon: library_backup, + supportsBulk: true, + hideModalHeader: true, + RenderModal: ({ + items, + closeModal, + onActionPerformed + }) => { + const [isBusy, setIsBusy] = (0,external_wp_element_namespaceObject.useState)(false); + const { + saveEditedEntityRecord + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); + const { + createSuccessNotice, + createErrorNotice + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); + const onConfirm = async () => { + try { + for (const template of items) { + await revertTemplate(template, { + allowUndo: false + }); + await saveEditedEntityRecord('postType', template.type, template.id); + } + createSuccessNotice(items.length > 1 ? (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: The number of items. */ + (0,external_wp_i18n_namespaceObject.__)('%s items reset.'), items.length) : (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: The template/part's name. */ + (0,external_wp_i18n_namespaceObject.__)('"%s" reset.'), getItemTitle(items[0])), { + type: 'snackbar', + id: 'revert-template-action' + }); + } catch (error) { + let fallbackErrorMessage; + if (items[0].type === 'wp_template') { + fallbackErrorMessage = items.length === 1 ? (0,external_wp_i18n_namespaceObject.__)('An error occurred while reverting the template.') : (0,external_wp_i18n_namespaceObject.__)('An error occurred while reverting the templates.'); + } else { + fallbackErrorMessage = items.length === 1 ? (0,external_wp_i18n_namespaceObject.__)('An error occurred while reverting the template part.') : (0,external_wp_i18n_namespaceObject.__)('An error occurred while reverting the template parts.'); + } + const typedError = error; + const errorMessage = typedError.message && typedError.code !== 'unknown_error' ? typedError.message : fallbackErrorMessage; + createErrorNotice(errorMessage, { + type: 'snackbar' + }); + } + }; + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { + spacing: "5", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { + children: (0,external_wp_i18n_namespaceObject.__)('Reset to default and clear all customizations?') + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { + justify: "right", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + __next40pxDefaultSize: true, + variant: "tertiary", + onClick: closeModal, + disabled: isBusy, + accessibleWhenDisabled: true, + children: (0,external_wp_i18n_namespaceObject.__)('Cancel') + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + __next40pxDefaultSize: true, + variant: "primary", + onClick: async () => { + setIsBusy(true); + await onConfirm(); + onActionPerformed?.(items); + setIsBusy(false); + closeModal?.(); + }, + isBusy: isBusy, + disabled: isBusy, + accessibleWhenDisabled: true, + children: (0,external_wp_i18n_namespaceObject.__)('Reset') + })] + })] + }); + } +}; + +/** + * Reset action for Template and TemplatePart. + */ +/* harmony default export */ const reset_post = (resetPostAction); + +;// ./node_modules/@wordpress/icons/build-module/library/trash.js +/** + * WordPress dependencies + */ + + +const trash = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M12 5.5A2.25 2.25 0 0 0 9.878 7h4.244A2.251 2.251 0 0 0 12 5.5ZM12 4a3.751 3.751 0 0 0-3.675 3H5v1.5h1.27l.818 8.997a2.75 2.75 0 0 0 2.739 2.501h4.347a2.75 2.75 0 0 0 2.738-2.5L17.73 8.5H19V7h-3.325A3.751 3.751 0 0 0 12 4Zm4.224 4.5H7.776l.806 8.861a1.25 1.25 0 0 0 1.245 1.137h4.347a1.25 1.25 0 0 0 1.245-1.137l.805-8.861Z" + }) +}); +/* harmony default export */ const library_trash = (trash); + +;// ./node_modules/@wordpress/fields/build-module/mutation/index.js +/* wp:polyfill */ +/** + * WordPress dependencies + */ + + + + +/** + * Internal dependencies + */ + +function getErrorMessagesFromPromises(allSettledResults) { + const errorMessages = new Set(); + // If there was at lease one failure. + if (allSettledResults.length === 1) { + const typedError = allSettledResults[0]; + if (typedError.reason?.message) { + errorMessages.add(typedError.reason.message); + } + } else { + const failedPromises = allSettledResults.filter(({ + status + }) => status === 'rejected'); + for (const failedPromise of failedPromises) { + const typedError = failedPromise; + if (typedError.reason?.message) { + errorMessages.add(typedError.reason.message); + } + } + } + return errorMessages; +} +const deletePostWithNotices = async (posts, notice, callbacks) => { + const { + createSuccessNotice, + createErrorNotice + } = (0,external_wp_data_namespaceObject.dispatch)(external_wp_notices_namespaceObject.store); + const { + deleteEntityRecord + } = (0,external_wp_data_namespaceObject.dispatch)(external_wp_coreData_namespaceObject.store); + const allSettledResults = await Promise.allSettled(posts.map(post => { + return deleteEntityRecord('postType', post.type, post.id, { + force: true + }, { + throwOnError: true + }); + })); + // If all the promises were fulfilled with success. + if (allSettledResults.every(({ + status + }) => status === 'fulfilled')) { + var _notice$success$type; + let successMessage; + if (allSettledResults.length === 1) { + successMessage = notice.success.messages.getMessage(posts[0]); + } else { + successMessage = notice.success.messages.getBatchMessage(posts); + } + createSuccessNotice(successMessage, { + type: (_notice$success$type = notice.success.type) !== null && _notice$success$type !== void 0 ? _notice$success$type : 'snackbar', + id: notice.success.id + }); + callbacks.onActionPerformed?.(posts); + } else { + var _notice$error$type; + const errorMessages = getErrorMessagesFromPromises(allSettledResults); + let errorMessage = ''; + if (allSettledResults.length === 1) { + errorMessage = notice.error.messages.getMessage(errorMessages); + } else { + errorMessage = notice.error.messages.getBatchMessage(errorMessages); + } + createErrorNotice(errorMessage, { + type: (_notice$error$type = notice.error.type) !== null && _notice$error$type !== void 0 ? _notice$error$type : 'snackbar', + id: notice.error.id + }); + callbacks.onActionError?.(); + } +}; +const editPostWithNotices = async (postsWithUpdates, notice, callbacks) => { + const { + createSuccessNotice, + createErrorNotice + } = dispatch(noticesStore); + const { + editEntityRecord, + saveEditedEntityRecord + } = dispatch(coreStore); + await Promise.allSettled(postsWithUpdates.map(post => { + return editEntityRecord('postType', post.originalPost.type, post.originalPost.id, { + ...post.changes + }); + })); + const allSettledResults = await Promise.allSettled(postsWithUpdates.map(post => { + return saveEditedEntityRecord('postType', post.originalPost.type, post.originalPost.id, { + throwOnError: true + }); + })); + // If all the promises were fulfilled with success. + if (allSettledResults.every(({ + status + }) => status === 'fulfilled')) { + var _notice$success$type2; + let successMessage; + if (allSettledResults.length === 1) { + successMessage = notice.success.messages.getMessage(postsWithUpdates[0].originalPost); + } else { + successMessage = notice.success.messages.getBatchMessage(postsWithUpdates.map(post => post.originalPost)); + } + createSuccessNotice(successMessage, { + type: (_notice$success$type2 = notice.success.type) !== null && _notice$success$type2 !== void 0 ? _notice$success$type2 : 'snackbar', + id: notice.success.id + }); + callbacks.onActionPerformed?.(postsWithUpdates.map(post => post.originalPost)); + } else { + var _notice$error$type2; + const errorMessages = getErrorMessagesFromPromises(allSettledResults); + let errorMessage = ''; + if (allSettledResults.length === 1) { + errorMessage = notice.error.messages.getMessage(errorMessages); + } else { + errorMessage = notice.error.messages.getBatchMessage(errorMessages); + } + createErrorNotice(errorMessage, { + type: (_notice$error$type2 = notice.error.type) !== null && _notice$error$type2 !== void 0 ? _notice$error$type2 : 'snackbar', + id: notice.error.id + }); + callbacks.onActionError?.(); + } +}; + +;// ./node_modules/@wordpress/fields/build-module/actions/delete-post.js +/* wp:polyfill */ +/** + * WordPress dependencies + */ + + + + // @ts-ignore +/** + * Internal dependencies + */ + + + const { PATTERN_TYPES: delete_post_PATTERN_TYPES -} = unlock(external_wp_patterns_namespaceObject.privateApis); +} = lock_unlock_unlock(external_wp_patterns_namespaceObject.privateApis); // This action is used for templates, patterns and template parts. // Every other post type uses the similar `trashPostAction` which @@ -7804,9 +8322,7 @@ const deletePostAction = { onActionPerformed }) => { const [isBusy, setIsBusy] = (0,external_wp_element_namespaceObject.useState)(false); - const { - removeTemplates - } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store_store)); + const isResetting = items.every(item => isTemplateOrTemplatePart(item) && item?.has_theme_file); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: "5", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { @@ -7828,10 +8344,46 @@ const deletePostAction = { variant: "primary", onClick: async () => { setIsBusy(true); - await removeTemplates(items, { - allowUndo: false + const notice = { + success: { + messages: { + getMessage: item => { + return isResetting ? (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: The template/part's name. */ + (0,external_wp_i18n_namespaceObject.__)('"%s" reset.'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(getItemTitle(item))) : (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: The template/part's name. */ + (0,external_wp_i18n_namespaceObject._x)('"%s" deleted.', 'template part'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(getItemTitle(item))); + }, + getBatchMessage: () => { + return isResetting ? (0,external_wp_i18n_namespaceObject.__)('Items reset.') : (0,external_wp_i18n_namespaceObject.__)('Items deleted.'); + } + } + }, + error: { + messages: { + getMessage: error => { + if (error.size === 1) { + return [...error][0]; + } + return isResetting ? (0,external_wp_i18n_namespaceObject.__)('An error occurred while reverting the item.') : (0,external_wp_i18n_namespaceObject.__)('An error occurred while deleting the item.'); + }, + getBatchMessage: errors => { + if (errors.size === 0) { + return isResetting ? (0,external_wp_i18n_namespaceObject.__)('An error occurred while reverting the items.') : (0,external_wp_i18n_namespaceObject.__)('An error occurred while deleting the items.'); + } + if (errors.size === 1) { + return isResetting ? (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: an error message */ + (0,external_wp_i18n_namespaceObject.__)('An error occurred while reverting the items: %s'), [...errors][0]) : (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: an error message */ + (0,external_wp_i18n_namespaceObject.__)('An error occurred while deleting the items: %s'), [...errors][0]); + } + return isResetting ? (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: a list of comma separated error messages */ + (0,external_wp_i18n_namespaceObject.__)('Some errors occurred while reverting the items: %s'), [...errors].join(',')) : (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: a list of comma separated error messages */ + (0,external_wp_i18n_namespaceObject.__)('Some errors occurred while deleting the items: %s'), [...errors].join(',')); + } + } + } + }; + await deletePostWithNotices(items, notice, { + onActionPerformed }); - onActionPerformed?.(items); setIsBusy(false); closeModal?.(); }, @@ -7845,79 +8397,156 @@ const deletePostAction = { }); } }; + +/** + * Delete action for Templates, Patterns and Template Parts. + */ /* harmony default export */ const delete_post = (deletePostAction); -;// ./node_modules/@wordpress/editor/build-module/dataviews/store/private-actions.js +;// ./node_modules/@wordpress/fields/build-module/actions/trash-post.js +/* wp:polyfill */ /** * WordPress dependencies */ + + + + /** * Internal dependencies */ - - - - - - - -function registerEntityAction(kind, name, config) { - return { - type: 'REGISTER_ENTITY_ACTION', - kind, - name, - config - }; -} -function unregisterEntityAction(kind, name, actionId) { - return { - type: 'UNREGISTER_ENTITY_ACTION', - kind, - name, - actionId - }; -} -function setIsReady(kind, name) { - return { - type: 'SET_IS_READY', - kind, - name - }; -} -const registerPostTypeActions = postType => async ({ - registry -}) => { - const isReady = unlock(registry.select(store_store)).isEntityReady('postType', postType); - if (isReady) { - return; - } - unlock(registry.dispatch(store_store)).setIsReady('postType', postType); - const postTypeConfig = await registry.resolveSelect(external_wp_coreData_namespaceObject.store).getPostType(postType); - const canCreate = await registry.resolveSelect(external_wp_coreData_namespaceObject.store).canUser('create', { - kind: 'postType', - name: postType - }); - const currentTheme = await registry.resolveSelect(external_wp_coreData_namespaceObject.store).getCurrentTheme(); - const actions = [postTypeConfig.viewable ? view_post : undefined, !!postTypeConfig?.supports?.revisions ? view_post_revisions : undefined, - // @ts-ignore - false ? 0 : undefined, postTypeConfig.slug === 'wp_template_part' && canCreate && currentTheme?.is_block_theme ? duplicate_template_part : undefined, canCreate && postTypeConfig.slug === 'wp_block' ? duplicate_pattern : undefined, postTypeConfig.supports?.title ? rename_post : undefined, postTypeConfig?.supports?.['page-attributes'] ? reorder_page : undefined, postTypeConfig.slug === 'wp_block' ? export_pattern : undefined, reset_post, restore_post, delete_post, trash_post, permanently_delete_post]; - registry.batch(() => { - actions.forEach(action => { - if (!action) { - return; - } - unlock(registry.dispatch(store_store)).registerEntityAction('postType', postType, action); +const trash_post_trashPost = { + id: 'move-to-trash', + label: (0,external_wp_i18n_namespaceObject.__)('Move to trash'), + isPrimary: true, + icon: library_trash, + isEligible(item) { + if (isTemplateOrTemplatePart(item) || item.type === 'wp_block') { + return false; + } + return !!item.status && !['auto-draft', 'trash'].includes(item.status) && item.permissions?.delete; + }, + supportsBulk: true, + hideModalHeader: true, + RenderModal: ({ + items, + closeModal, + onActionPerformed + }) => { + const [isBusy, setIsBusy] = (0,external_wp_element_namespaceObject.useState)(false); + const { + createSuccessNotice, + createErrorNotice + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); + const { + deleteEntityRecord + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { + spacing: "5", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { + children: items.length === 1 ? (0,external_wp_i18n_namespaceObject.sprintf)( + // translators: %s: The item's title. + (0,external_wp_i18n_namespaceObject.__)('Are you sure you want to move "%s" to the trash?'), getItemTitle(items[0])) : (0,external_wp_i18n_namespaceObject.sprintf)( + // translators: %d: The number of items (2 or more). + (0,external_wp_i18n_namespaceObject._n)('Are you sure you want to move %d item to the trash ?', 'Are you sure you want to move %d items to the trash ?', items.length), items.length) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { + justify: "right", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + __next40pxDefaultSize: true, + variant: "tertiary", + onClick: closeModal, + disabled: isBusy, + accessibleWhenDisabled: true, + children: (0,external_wp_i18n_namespaceObject.__)('Cancel') + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + __next40pxDefaultSize: true, + variant: "primary", + onClick: async () => { + setIsBusy(true); + const promiseResult = await Promise.allSettled(items.map(item => deleteEntityRecord('postType', item.type, item.id.toString(), {}, { + throwOnError: true + }))); + // If all the promises were fulfilled with success. + if (promiseResult.every(({ + status + }) => status === 'fulfilled')) { + let successMessage; + if (promiseResult.length === 1) { + successMessage = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: The item's title. */ + (0,external_wp_i18n_namespaceObject.__)('"%s" moved to the trash.'), getItemTitle(items[0])); + } else { + successMessage = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: The number of items. */ + (0,external_wp_i18n_namespaceObject._n)('%s item moved to the trash.', '%s items moved to the trash.', items.length), items.length); + } + createSuccessNotice(successMessage, { + type: 'snackbar', + id: 'move-to-trash-action' + }); + } else { + // If there was at least one failure. + let errorMessage; + // If we were trying to delete a single item. + if (promiseResult.length === 1) { + const typedError = promiseResult[0]; + if (typedError.reason?.message) { + errorMessage = typedError.reason.message; + } else { + errorMessage = (0,external_wp_i18n_namespaceObject.__)('An error occurred while moving the item to the trash.'); + } + // If we were trying to delete multiple items. + } else { + const errorMessages = new Set(); + const failedPromises = promiseResult.filter(({ + status + }) => status === 'rejected'); + for (const failedPromise of failedPromises) { + const typedError = failedPromise; + if (typedError.reason?.message) { + errorMessages.add(typedError.reason.message); + } + } + if (errorMessages.size === 0) { + errorMessage = (0,external_wp_i18n_namespaceObject.__)('An error occurred while moving the items to the trash.'); + } else if (errorMessages.size === 1) { + errorMessage = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: an error message */ + (0,external_wp_i18n_namespaceObject.__)('An error occurred while moving the item to the trash: %s'), [...errorMessages][0]); + } else { + errorMessage = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: a list of comma separated error messages */ + (0,external_wp_i18n_namespaceObject.__)('Some errors occurred while moving the items to the trash: %s'), [...errorMessages].join(',')); + } + } + createErrorNotice(errorMessage, { + type: 'snackbar' + }); + } + if (onActionPerformed) { + onActionPerformed(items); + } + setIsBusy(false); + closeModal?.(); + }, + isBusy: isBusy, + disabled: isBusy, + accessibleWhenDisabled: true, + children: (0,external_wp_i18n_namespaceObject._x)('Trash', 'verb') + })] + })] }); - }); - (0,external_wp_hooks_namespaceObject.doAction)('core.registerPostTypeActions', postType); + } }; -;// ./node_modules/@wordpress/editor/build-module/store/private-actions.js +/** + * Trash action for PostWithPermissions. + */ +/* harmony default export */ const trash_post = (trash_post_trashPost); + +;// ./node_modules/@wordpress/fields/build-module/actions/permanently-delete-post.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -7930,327 +8559,3087 @@ const registerPostTypeActions = postType => async ({ - /** * Internal dependencies */ +const permanentlyDeletePost = { + id: 'permanently-delete', + label: (0,external_wp_i18n_namespaceObject.__)('Permanently delete'), + supportsBulk: true, + icon: library_trash, + isEligible(item) { + if (isTemplateOrTemplatePart(item) || item.type === 'wp_block') { + return false; + } + const { + status, + permissions + } = item; + return status === 'trash' && permissions?.delete; + }, + hideModalHeader: true, + RenderModal: ({ + items, + closeModal, + onActionPerformed + }) => { + const [isBusy, setIsBusy] = (0,external_wp_element_namespaceObject.useState)(false); + const { + createSuccessNotice, + createErrorNotice + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); + const { + deleteEntityRecord + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { + spacing: "5", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { + children: items.length > 1 ? (0,external_wp_i18n_namespaceObject.sprintf)( + // translators: %d: number of items to delete. + (0,external_wp_i18n_namespaceObject._n)('Are you sure you want to permanently delete %d item?', 'Are you sure you want to permanently delete %d items?', items.length), items.length) : (0,external_wp_i18n_namespaceObject.sprintf)( + // translators: %s: The post's title + (0,external_wp_i18n_namespaceObject.__)('Are you sure you want to permanently delete "%s"?'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(getItemTitle(items[0]))) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { + justify: "right", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + variant: "tertiary", + onClick: closeModal, + disabled: isBusy, + accessibleWhenDisabled: true, + __next40pxDefaultSize: true, + children: (0,external_wp_i18n_namespaceObject.__)('Cancel') + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + variant: "primary", + onClick: async () => { + setIsBusy(true); + const promiseResult = await Promise.allSettled(items.map(post => deleteEntityRecord('postType', post.type, post.id, { + force: true + }, { + throwOnError: true + }))); + + // If all the promises were fulfilled with success. + if (promiseResult.every(({ + status + }) => status === 'fulfilled')) { + let successMessage; + if (promiseResult.length === 1) { + successMessage = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: The posts's title. */ + (0,external_wp_i18n_namespaceObject.__)('"%s" permanently deleted.'), getItemTitle(items[0])); + } else { + successMessage = (0,external_wp_i18n_namespaceObject.__)('The items were permanently deleted.'); + } + createSuccessNotice(successMessage, { + type: 'snackbar', + id: 'permanently-delete-post-action' + }); + onActionPerformed?.(items); + } else { + // If there was at lease one failure. + let errorMessage; + // If we were trying to permanently delete a single post. + if (promiseResult.length === 1) { + const typedError = promiseResult[0]; + if (typedError.reason?.message) { + errorMessage = typedError.reason.message; + } else { + errorMessage = (0,external_wp_i18n_namespaceObject.__)('An error occurred while permanently deleting the item.'); + } + // If we were trying to permanently delete multiple posts + } else { + const errorMessages = new Set(); + const failedPromises = promiseResult.filter(({ + status + }) => status === 'rejected'); + for (const failedPromise of failedPromises) { + const typedError = failedPromise; + if (typedError.reason?.message) { + errorMessages.add(typedError.reason.message); + } + } + if (errorMessages.size === 0) { + errorMessage = (0,external_wp_i18n_namespaceObject.__)('An error occurred while permanently deleting the items.'); + } else if (errorMessages.size === 1) { + errorMessage = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: an error message */ + (0,external_wp_i18n_namespaceObject.__)('An error occurred while permanently deleting the items: %s'), [...errorMessages][0]); + } else { + errorMessage = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: a list of comma separated error messages */ + (0,external_wp_i18n_namespaceObject.__)('Some errors occurred while permanently deleting the items: %s'), [...errorMessages].join(',')); + } + } + createErrorNotice(errorMessage, { + type: 'snackbar' + }); + } + setIsBusy(false); + closeModal?.(); + }, + isBusy: isBusy, + disabled: isBusy, + accessibleWhenDisabled: true, + __next40pxDefaultSize: true, + children: (0,external_wp_i18n_namespaceObject.__)('Delete permanently') + })] + })] + }); + } +}; /** - * Returns an action object used to set which template is currently being used/edited. - * - * @param {string} id Template Id. - * - * @return {Object} Action object. + * Delete action for PostWithPermissions. */ -function setCurrentTemplateId(id) { - return { - type: 'SET_CURRENT_TEMPLATE_ID', +/* harmony default export */ const permanently_delete_post = (permanentlyDeletePost); + +;// external ["wp","mediaUtils"] +const external_wp_mediaUtils_namespaceObject = window["wp"]["mediaUtils"]; +;// ./node_modules/@wordpress/icons/build-module/library/line-solid.js +/** + * WordPress dependencies + */ + + +const lineSolid = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "M5 11.25h14v1.5H5z" + }) +}); +/* harmony default export */ const line_solid = (lineSolid); + +;// ./node_modules/@wordpress/fields/build-module/fields/featured-image/featured-image-edit.js +/** + * WordPress dependencies + */ + + + +// @ts-ignore + + + + + +/** + * Internal dependencies + */ + +const FeaturedImageEdit = ({ + data, + field, + onChange +}) => { + const { id - }; + } = field; + const value = field.getValue({ + item: data + }); + const media = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getEntityRecord + } = select(external_wp_coreData_namespaceObject.store); + return getEntityRecord('root', 'media', value); + }, [value]); + const onChangeControl = (0,external_wp_element_namespaceObject.useCallback)(newValue => onChange({ + [id]: newValue + }), [id, onChange]); + const url = media?.source_url; + const title = media?.title?.rendered; + const ref = (0,external_wp_element_namespaceObject.useRef)(null); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("fieldset", { + className: "fields-controls__featured-image", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: "fields-controls__featured-image-container", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_mediaUtils_namespaceObject.MediaUpload, { + onSelect: selectedMedia => { + onChangeControl(selectedMedia.id); + }, + allowedTypes: ['image'], + render: ({ + open + }) => { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + ref: ref, + role: "button", + tabIndex: -1, + onClick: () => { + open(); + }, + onKeyDown: open, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalGrid, { + rowGap: 0, + columnGap: 8, + templateColumns: "24px 1fr 24px", + children: [url && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { + className: "fields-controls__featured-image-image", + alt: "", + width: 24, + height: 24, + src: url + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { + className: "fields-controls__featured-image-title", + children: title + })] + }), !url && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { + className: "fields-controls__featured-image-placeholder", + style: { + width: '24px', + height: '24px' + } + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { + className: "fields-controls__featured-image-title", + children: (0,external_wp_i18n_namespaceObject.__)('Choose an image…') + })] + }), url && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + size: "small", + className: "fields-controls__featured-image-remove-button", + icon: line_solid, + onClick: event => { + event.stopPropagation(); + onChangeControl(0); + } + }) + })] + }) + }); + } + }) + }) + }); +}; + +;// ./node_modules/@wordpress/fields/build-module/fields/featured-image/featured-image-view.js +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + +const FeaturedImageView = ({ + item +}) => { + const mediaId = item.featured_media; + const media = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getEntityRecord + } = select(external_wp_coreData_namespaceObject.store); + return mediaId ? getEntityRecord('root', 'media', mediaId) : null; + }, [mediaId]); + const url = media?.source_url; + if (url) { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { + className: "fields-controls__featured-image-image", + src: url, + alt: "" + }); + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { + className: "fields-controls__featured-image-placeholder" + }); +}; + +;// ./node_modules/@wordpress/fields/build-module/fields/featured-image/index.js +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + + +const featuredImageField = { + id: 'featured_media', + type: 'media', + label: (0,external_wp_i18n_namespaceObject.__)('Featured Image'), + Edit: FeaturedImageEdit, + render: FeaturedImageView, + enableSorting: false +}; + +/** + * Featured Image field for BasePost. + */ +/* harmony default export */ const featured_image = (featuredImageField); + +;// ./node_modules/clsx/dist/clsx.mjs +function clsx_r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t { + const { + getEntityRecord + } = select(external_wp_coreData_namespaceObject.store); + let user; + if (!!item.author) { + user = getEntityRecord('root', 'user', item.author); + } + return { + imageUrl: user?.avatar_urls?.[48], + text: user?.name + }; + }, [item]); + const [isImageLoaded, setIsImageLoaded] = (0,external_wp_element_namespaceObject.useState)(false); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { + alignment: "left", + spacing: 0, + children: [!!imageUrl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: dist_clsx('page-templates-author-field__avatar', { + 'is-loaded': isImageLoaded + }), + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { + onLoad: () => setIsImageLoaded(true), + alt: (0,external_wp_i18n_namespaceObject.__)('Author avatar'), + src: imageUrl + }) + }), !imageUrl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: "page-templates-author-field__icon", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { + icon: comment_author_avatar + }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { + className: "page-templates-author-field__name", + children: text + })] + }); +} +/* harmony default export */ const author_view = (AuthorView); + +;// ./node_modules/@wordpress/fields/build-module/fields/author/index.js +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + +const authorField = { + label: (0,external_wp_i18n_namespaceObject.__)('Author'), + id: 'author', + type: 'integer', + elements: [], + render: author_view, + sort: (a, b, direction) => { + const nameA = a._embedded?.author?.[0]?.name || ''; + const nameB = b._embedded?.author?.[0]?.name || ''; + return direction === 'asc' ? nameA.localeCompare(nameB) : nameB.localeCompare(nameA); + } +}; + +/** + * Author field for BasePost. + */ +/* harmony default export */ const author = (authorField); + +;// ./node_modules/@wordpress/icons/build-module/library/drafts.js +/** + * WordPress dependencies + */ + + +const drafts = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm8 4a4 4 0 0 0 4-4H8a4 4 0 0 0 4 4Z" + }) +}); +/* harmony default export */ const library_drafts = (drafts); + +;// ./node_modules/@wordpress/icons/build-module/library/scheduled.js +/** + * WordPress dependencies + */ + + +const scheduled = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm9 1V8h-1.5v3.5h-2V13H13Z" + }) +}); +/* harmony default export */ const library_scheduled = (scheduled); + +;// ./node_modules/@wordpress/icons/build-module/library/pending.js +/** + * WordPress dependencies + */ + + +const pending = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm8 4a4 4 0 0 1-4-4h4V8a4 4 0 0 1 0 8Z" + }) +}); +/* harmony default export */ const library_pending = (pending); + +;// ./node_modules/@wordpress/icons/build-module/library/not-allowed.js +/** + * WordPress dependencies + */ + + +const notAllowed = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M12 18.5A6.5 6.5 0 0 1 6.93 7.931l9.139 9.138A6.473 6.473 0 0 1 12 18.5Zm5.123-2.498a6.5 6.5 0 0 0-9.124-9.124l9.124 9.124ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Z" + }) +}); +/* harmony default export */ const not_allowed = (notAllowed); + +;// ./node_modules/@wordpress/icons/build-module/library/published.js +/** + * WordPress dependencies + */ + + +const published = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm11.53-1.47-1.06-1.06L11 12.94l-1.47-1.47-1.06 1.06L11 15.06l4.53-4.53Z" + }) +}); +/* harmony default export */ const library_published = (published); + +;// ./node_modules/@wordpress/fields/build-module/fields/status/status-elements.js +/** + * WordPress dependencies + */ + + + +// See https://github.com/WordPress/gutenberg/issues/55886 +// We do not support custom statutes at the moment. +const STATUSES = [{ + value: 'draft', + label: (0,external_wp_i18n_namespaceObject.__)('Draft'), + icon: library_drafts, + description: (0,external_wp_i18n_namespaceObject.__)('Not ready to publish.') +}, { + value: 'future', + label: (0,external_wp_i18n_namespaceObject.__)('Scheduled'), + icon: library_scheduled, + description: (0,external_wp_i18n_namespaceObject.__)('Publish automatically on a chosen date.') +}, { + value: 'pending', + label: (0,external_wp_i18n_namespaceObject.__)('Pending Review'), + icon: library_pending, + description: (0,external_wp_i18n_namespaceObject.__)('Waiting for review before publishing.') +}, { + value: 'private', + label: (0,external_wp_i18n_namespaceObject.__)('Private'), + icon: not_allowed, + description: (0,external_wp_i18n_namespaceObject.__)('Only visible to site admins and editors.') +}, { + value: 'publish', + label: (0,external_wp_i18n_namespaceObject.__)('Published'), + icon: library_published, + description: (0,external_wp_i18n_namespaceObject.__)('Visible to everyone.') +}, { + value: 'trash', + label: (0,external_wp_i18n_namespaceObject.__)('Trash'), + icon: library_trash +}]; +/* harmony default export */ const status_elements = (STATUSES); + +;// ./node_modules/@wordpress/fields/build-module/fields/status/status-view.js +/* wp:polyfill */ +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + + +function StatusView({ + item +}) { + const status = status_elements.find(({ + value + }) => value === item.status); + const label = status?.label || item.status; + const icon = status?.icon; + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { + alignment: "left", + spacing: 0, + children: [icon && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: "edit-site-post-list__status-icon", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { + icon: icon + }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { + children: label + })] + }); +} +/* harmony default export */ const status_view = (StatusView); + +;// ./node_modules/@wordpress/fields/build-module/fields/status/index.js +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + + +const OPERATOR_IS_ANY = 'isAny'; +const statusField = { + label: (0,external_wp_i18n_namespaceObject.__)('Status'), + id: 'status', + type: 'text', + elements: status_elements, + render: status_view, + Edit: 'radio', + enableSorting: false, + filterBy: { + operators: [OPERATOR_IS_ANY] + } +}; + +/** + * Status field for BasePost. + */ +/* harmony default export */ const fields_status = (statusField); + +;// ./node_modules/@wordpress/fields/build-module/fields/date/date-view.js +/** + * WordPress dependencies + */ + + + + +/** + * Internal dependencies + */ + +const getFormattedDate = dateToDisplay => (0,external_wp_date_namespaceObject.dateI18n)((0,external_wp_date_namespaceObject.getSettings)().formats.datetimeAbbreviated, (0,external_wp_date_namespaceObject.getDate)(dateToDisplay)); +const DateView = ({ + item +}) => { + var _item$status, _item$modified, _item$date4, _item$date5; + const isDraftOrPrivate = ['draft', 'private'].includes((_item$status = item.status) !== null && _item$status !== void 0 ? _item$status : ''); + if (isDraftOrPrivate) { + var _item$date; + return (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: page creation or modification date. */ + (0,external_wp_i18n_namespaceObject.__)('Modified: '), getFormattedDate((_item$date = item.date) !== null && _item$date !== void 0 ? _item$date : null)), { + span: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {}), + time: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("time", {}) + }); + } + const isScheduled = item.status === 'future'; + if (isScheduled) { + var _item$date2; + return (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: page creation date */ + (0,external_wp_i18n_namespaceObject.__)('Scheduled: '), getFormattedDate((_item$date2 = item.date) !== null && _item$date2 !== void 0 ? _item$date2 : null)), { + span: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {}), + time: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("time", {}) + }); + } + const isPublished = item.status === 'publish'; + if (isPublished) { + var _item$date3; + return (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: page creation time */ + (0,external_wp_i18n_namespaceObject.__)('Published: '), getFormattedDate((_item$date3 = item.date) !== null && _item$date3 !== void 0 ? _item$date3 : null)), { + span: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {}), + time: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("time", {}) + }); + } + + // Pending posts show the modified date if it's newer. + const dateToDisplay = (0,external_wp_date_namespaceObject.getDate)((_item$modified = item.modified) !== null && _item$modified !== void 0 ? _item$modified : null) > (0,external_wp_date_namespaceObject.getDate)((_item$date4 = item.date) !== null && _item$date4 !== void 0 ? _item$date4 : null) ? item.modified : item.date; + const isPending = item.status === 'pending'; + if (isPending) { + return (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: page creation or modification date. */ + (0,external_wp_i18n_namespaceObject.__)('Modified: '), getFormattedDate(dateToDisplay !== null && dateToDisplay !== void 0 ? dateToDisplay : null)), { + span: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {}), + time: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("time", {}) + }); + } + + // Unknow status. + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("time", { + children: getFormattedDate((_item$date5 = item.date) !== null && _item$date5 !== void 0 ? _item$date5 : null) + }); +}; +/* harmony default export */ const date_view = (DateView); + +;// ./node_modules/@wordpress/fields/build-module/fields/date/index.js +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + +const dateField = { + id: 'date', + type: 'datetime', + label: (0,external_wp_i18n_namespaceObject.__)('Date'), + render: date_view +}; + +/** + * Date field for BasePost. + */ +/* harmony default export */ const date = (dateField); + +;// ./node_modules/@wordpress/icons/build-module/library/copy-small.js +/** + * WordPress dependencies + */ + + +const copySmall = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M5.625 5.5h9.75c.069 0 .125.056.125.125v9.75a.125.125 0 0 1-.125.125h-9.75a.125.125 0 0 1-.125-.125v-9.75c0-.069.056-.125.125-.125ZM4 5.625C4 4.728 4.728 4 5.625 4h9.75C16.273 4 17 4.728 17 5.625v9.75c0 .898-.727 1.625-1.625 1.625h-9.75A1.625 1.625 0 0 1 4 15.375v-9.75Zm14.5 11.656v-9H20v9C20 18.8 18.77 20 17.251 20H6.25v-1.5h11.001c.69 0 1.249-.528 1.249-1.219Z" + }) +}); +/* harmony default export */ const copy_small = (copySmall); + +;// ./node_modules/@wordpress/fields/build-module/fields/slug/utils.js +/** + * WordPress dependencies + */ + +/** + * Internal dependencies + */ + + +const getSlug = item => { + if (typeof item !== 'object') { + return ''; + } + return item.slug || (0,external_wp_url_namespaceObject.cleanForSlug)(getItemTitle(item)) || item.id.toString(); +}; + +;// ./node_modules/@wordpress/fields/build-module/fields/slug/slug-edit.js +/** + * WordPress dependencies + */ + + + + + + + + + +/** + * Internal dependencies + */ + + + +const SlugEdit = ({ + field, + onChange, + data +}) => { + const { + id + } = field; + const slug = field.getValue({ + item: data + }) || getSlug(data); + const permalinkTemplate = data.permalink_template || ''; + const PERMALINK_POSTNAME_REGEX = /%(?:postname|pagename)%/; + const [prefix, suffix] = permalinkTemplate.split(PERMALINK_POSTNAME_REGEX); + const permalinkPrefix = prefix; + const permalinkSuffix = suffix; + const isEditable = PERMALINK_POSTNAME_REGEX.test(permalinkTemplate); + const originalSlugRef = (0,external_wp_element_namespaceObject.useRef)(slug); + const slugToDisplay = slug || originalSlugRef.current; + const permalink = isEditable ? `${permalinkPrefix}${slugToDisplay}${permalinkSuffix}` : (0,external_wp_url_namespaceObject.safeDecodeURIComponent)(data.link || ''); + (0,external_wp_element_namespaceObject.useEffect)(() => { + if (slug && originalSlugRef.current === undefined) { + originalSlugRef.current = slug; + } + }, [slug]); + const onChangeControl = (0,external_wp_element_namespaceObject.useCallback)(newValue => onChange({ + [id]: newValue + }), [id, onChange]); + const { + createNotice + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); + const copyButtonRef = (0,external_wp_compose_namespaceObject.useCopyToClipboard)(permalink, () => { + createNotice('info', (0,external_wp_i18n_namespaceObject.__)('Copied Permalink to clipboard.'), { + isDismissible: true, + type: 'snackbar' + }); + }); + const postUrlSlugDescriptionId = 'editor-post-url__slug-description-' + (0,external_wp_compose_namespaceObject.useInstanceId)(SlugEdit); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("fieldset", { + className: "fields-controls__slug", + children: [isEditable && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { + spacing: "0px", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { + children: (0,external_wp_i18n_namespaceObject.__)('Customize the last part of the Permalink.') + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, { + href: "https://wordpress.org/documentation/article/page-post-settings-sidebar/#permalink", + children: (0,external_wp_i18n_namespaceObject.__)('Learn more') + })] + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalInputControl, { + __next40pxDefaultSize: true, + prefix: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalInputControlPrefixWrapper, { + children: "/" + }), + suffix: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + __next40pxDefaultSize: true, + icon: copy_small, + ref: copyButtonRef, + label: (0,external_wp_i18n_namespaceObject.__)('Copy') + }), + label: (0,external_wp_i18n_namespaceObject.__)('Link'), + hideLabelFromVision: true, + value: slug, + autoComplete: "off", + spellCheck: "false", + type: "text", + className: "fields-controls__slug-input", + onChange: newValue => { + onChangeControl(newValue); + }, + onBlur: () => { + if (slug === '') { + onChangeControl(originalSlugRef.current); + } + }, + "aria-describedby": postUrlSlugDescriptionId + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { + className: "fields-controls__slug-help", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { + className: "fields-controls__slug-help-visual-label", + children: (0,external_wp_i18n_namespaceObject.__)('Permalink:') + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.ExternalLink, { + className: "fields-controls__slug-help-link", + href: permalink, + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { + className: "fields-controls__slug-help-prefix", + children: permalinkPrefix + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { + className: "fields-controls__slug-help-slug", + children: slugToDisplay + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { + className: "fields-controls__slug-help-suffix", + children: permalinkSuffix + })] + })] + })] + }), !isEditable && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, { + className: "fields-controls__slug-help", + href: permalink, + children: permalink + })] + }); +}; +/* harmony default export */ const slug_edit = (SlugEdit); + +;// ./node_modules/@wordpress/fields/build-module/fields/slug/slug-view.js +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + +const SlugView = ({ + item +}) => { + const slug = getSlug(item); + const originalSlugRef = (0,external_wp_element_namespaceObject.useRef)(slug); + (0,external_wp_element_namespaceObject.useEffect)(() => { + if (slug && originalSlugRef.current === undefined) { + originalSlugRef.current = slug; + } + }, [slug]); + const slugToDisplay = slug || originalSlugRef.current; + return `${slugToDisplay}`; +}; +/* harmony default export */ const slug_view = (SlugView); + +;// ./node_modules/@wordpress/fields/build-module/fields/slug/index.js +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + + +const slugField = { + id: 'slug', + type: 'text', + label: (0,external_wp_i18n_namespaceObject.__)('Slug'), + Edit: slug_edit, + render: slug_view +}; + +/** + * Slug field for BasePost. + */ +/* harmony default export */ const slug = (slugField); + +// EXTERNAL MODULE: ./node_modules/remove-accents/index.js +var remove_accents = __webpack_require__(9681); +var remove_accents_default = /*#__PURE__*/__webpack_require__.n(remove_accents); +;// ./node_modules/@wordpress/fields/build-module/fields/parent/utils.js +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + +function getTitleWithFallbackName(post) { + return typeof post.title === 'object' && 'rendered' in post.title && post.title.rendered ? (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(post.title.rendered) : `#${post?.id} (${(0,external_wp_i18n_namespaceObject.__)('no title')})`; } +;// ./node_modules/@wordpress/fields/build-module/fields/parent/parent-edit.js +/* wp:polyfill */ /** - * Create a block based template. - * - * @param {Object?} template Template to create and assign. + * External dependencies */ -const createTemplate = template => async ({ - select, - dispatch, - registry -}) => { - const savedTemplate = await registry.dispatch(external_wp_coreData_namespaceObject.store).saveEntityRecord('postType', 'wp_template', template); - registry.dispatch(external_wp_coreData_namespaceObject.store).editEntityRecord('postType', select.getCurrentPostType(), select.getCurrentPostId(), { - template: savedTemplate.slug - }); - registry.dispatch(external_wp_notices_namespaceObject.store).createSuccessNotice((0,external_wp_i18n_namespaceObject.__)("Custom template created. You're in template mode now."), { - type: 'snackbar', - actions: [{ - label: (0,external_wp_i18n_namespaceObject.__)('Go back'), - onClick: () => dispatch.setRenderingMode(select.getEditorSettings().defaultRenderingMode) - }] - }); - return savedTemplate; -}; + /** - * Update the provided block types to be visible. - * - * @param {string[]} blockNames Names of block types to show. + * WordPress dependencies */ -const showBlockTypes = blockNames => ({ - registry -}) => { - var _registry$select$get; - const existingBlockNames = (_registry$select$get = registry.select(external_wp_preferences_namespaceObject.store).get('core', 'hiddenBlockTypes')) !== null && _registry$select$get !== void 0 ? _registry$select$get : []; - const newBlockNames = existingBlockNames.filter(type => !(Array.isArray(blockNames) ? blockNames : [blockNames]).includes(type)); - registry.dispatch(external_wp_preferences_namespaceObject.store).set('core', 'hiddenBlockTypes', newBlockNames); -}; + + + +// @ts-ignore + + + + + /** - * Update the provided block types to be hidden. - * - * @param {string[]} blockNames Names of block types to hide. + * Internal dependencies */ -const hideBlockTypes = blockNames => ({ - registry -}) => { - var _registry$select$get2; - const existingBlockNames = (_registry$select$get2 = registry.select(external_wp_preferences_namespaceObject.store).get('core', 'hiddenBlockTypes')) !== null && _registry$select$get2 !== void 0 ? _registry$select$get2 : []; - const mergedBlockNames = new Set([...existingBlockNames, ...(Array.isArray(blockNames) ? blockNames : [blockNames])]); - registry.dispatch(external_wp_preferences_namespaceObject.store).set('core', 'hiddenBlockTypes', [...mergedBlockNames]); -}; -/** - * Save entity records marked as dirty. - * - * @param {Object} options Options for the action. - * @param {Function} [options.onSave] Callback when saving happens. - * @param {object[]} [options.dirtyEntityRecords] Array of dirty entities. - * @param {object[]} [options.entitiesToSkip] Array of entities to skip saving. - * @param {Function} [options.close] Callback when the actions is called. It should be consolidated with `onSave`. - */ -const saveDirtyEntities = ({ - onSave, - dirtyEntityRecords = [], - entitiesToSkip = [], - close -} = {}) => ({ - registry -}) => { - const PUBLISH_ON_SAVE_ENTITIES = [{ - kind: 'postType', - name: 'wp_navigation' - }]; - const saveNoticeId = 'site-editor-save-success'; - const homeUrl = registry.select(external_wp_coreData_namespaceObject.store).getEntityRecord('root', '__unstableBase')?.home; - registry.dispatch(external_wp_notices_namespaceObject.store).removeNotice(saveNoticeId); - const entitiesToSave = dirtyEntityRecords.filter(({ - kind, - name, - key, - property - }) => { - return !entitiesToSkip.some(elt => elt.kind === kind && elt.name === name && elt.key === key && elt.property === property); + + +function buildTermsTree(flatTerms) { + const flatTermsWithParentAndChildren = flatTerms.map(term => { + return { + children: [], + ...term + }; }); - close?.(entitiesToSave); - const siteItemsToSave = []; - const pendingSavedRecords = []; - entitiesToSave.forEach(({ - kind, - name, - key, - property - }) => { - if ('root' === kind && 'site' === name) { - siteItemsToSave.push(property); - } else { - if (PUBLISH_ON_SAVE_ENTITIES.some(typeToPublish => typeToPublish.kind === kind && typeToPublish.name === name)) { - registry.dispatch(external_wp_coreData_namespaceObject.store).editEntityRecord(kind, name, key, { - status: 'publish' - }); - } - pendingSavedRecords.push(registry.dispatch(external_wp_coreData_namespaceObject.store).saveEditedEntityRecord(kind, name, key)); - } - }); - if (siteItemsToSave.length) { - pendingSavedRecords.push(registry.dispatch(external_wp_coreData_namespaceObject.store).__experimentalSaveSpecifiedEntityEdits('root', 'site', undefined, siteItemsToSave)); + + // All terms should have a `parent` because we're about to index them by it. + if (flatTermsWithParentAndChildren.some(({ + parent + }) => parent === null || parent === undefined)) { + return flatTermsWithParentAndChildren; } - registry.dispatch(external_wp_blockEditor_namespaceObject.store).__unstableMarkLastChangeAsPersistent(); - Promise.all(pendingSavedRecords).then(values => { - return onSave ? onSave(values) : values; - }).then(values => { - if (values.some(value => typeof value === 'undefined')) { - registry.dispatch(external_wp_notices_namespaceObject.store).createErrorNotice((0,external_wp_i18n_namespaceObject.__)('Saving failed.')); - } else { - registry.dispatch(external_wp_notices_namespaceObject.store).createSuccessNotice((0,external_wp_i18n_namespaceObject.__)('Site updated.'), { - type: 'snackbar', - id: saveNoticeId, - actions: [{ - label: (0,external_wp_i18n_namespaceObject.__)('View site'), - url: homeUrl - }] - }); + const termsByParent = flatTermsWithParentAndChildren.reduce((acc, term) => { + const { + parent + } = term; + if (!acc[parent]) { + acc[parent] = []; } - }).catch(error => registry.dispatch(external_wp_notices_namespaceObject.store).createErrorNotice(`${(0,external_wp_i18n_namespaceObject.__)('Saving failed.')} ${error}`)); -}; - -/** - * Reverts a template to its original theme-provided file. - * - * @param {Object} template The template to revert. - * @param {Object} [options] - * @param {boolean} [options.allowUndo] Whether to allow the user to undo - * reverting the template. Default true. - */ -const revertTemplate = (template, { - allowUndo = true -} = {}) => async ({ - registry -}) => { - const noticeId = 'edit-site-template-reverted'; - registry.dispatch(external_wp_notices_namespaceObject.store).removeNotice(noticeId); - if (!isTemplateRevertable(template)) { - registry.dispatch(external_wp_notices_namespaceObject.store).createErrorNotice((0,external_wp_i18n_namespaceObject.__)('This template is not revertable.'), { - type: 'snackbar' - }); - return; - } - try { - const templateEntityConfig = registry.select(external_wp_coreData_namespaceObject.store).getEntityConfig('postType', template.type); - if (!templateEntityConfig) { - registry.dispatch(external_wp_notices_namespaceObject.store).createErrorNotice((0,external_wp_i18n_namespaceObject.__)('The editor has encountered an unexpected error. Please reload.'), { - type: 'snackbar' - }); - return; - } - const fileTemplatePath = (0,external_wp_url_namespaceObject.addQueryArgs)(`${templateEntityConfig.baseURL}/${template.id}`, { - context: 'edit', - source: template.origin - }); - const fileTemplate = await external_wp_apiFetch_default()({ - path: fileTemplatePath - }); - if (!fileTemplate) { - registry.dispatch(external_wp_notices_namespaceObject.store).createErrorNotice((0,external_wp_i18n_namespaceObject.__)('The editor has encountered an unexpected error. Please reload.'), { - type: 'snackbar' - }); - return; - } - const serializeBlocks = ({ - blocks: blocksForSerialization = [] - }) => (0,external_wp_blocks_namespaceObject.__unstableSerializeAndClean)(blocksForSerialization); - const edited = registry.select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord('postType', template.type, template.id); - - // We are fixing up the undo level here to make sure we can undo - // the revert in the header toolbar correctly. - registry.dispatch(external_wp_coreData_namespaceObject.store).editEntityRecord('postType', template.type, template.id, { - content: serializeBlocks, - // Required to make the `undo` behave correctly. - blocks: edited.blocks, - // Required to revert the blocks in the editor. - source: 'custom' // required to avoid turning the editor into a dirty state - }, { - undoIgnore: true // Required to merge this edit with the last undo level. - }); - const blocks = (0,external_wp_blocks_namespaceObject.parse)(fileTemplate?.content?.raw); - registry.dispatch(external_wp_coreData_namespaceObject.store).editEntityRecord('postType', template.type, fileTemplate.id, { - content: serializeBlocks, - blocks, - source: 'theme' - }); - if (allowUndo) { - const undoRevert = () => { - registry.dispatch(external_wp_coreData_namespaceObject.store).editEntityRecord('postType', template.type, edited.id, { - content: serializeBlocks, - blocks: edited.blocks, - source: 'custom' - }); + acc[parent].push(term); + return acc; + }, {}); + const fillWithChildren = terms => { + return terms.map(term => { + const children = termsByParent[term.id]; + return { + ...term, + children: children && children.length ? fillWithChildren(children) : [] }; - registry.dispatch(external_wp_notices_namespaceObject.store).createSuccessNotice((0,external_wp_i18n_namespaceObject.__)('Template reset.'), { - type: 'snackbar', - id: noticeId, - actions: [{ - label: (0,external_wp_i18n_namespaceObject.__)('Undo'), - onClick: undoRevert - }] + }); + }; + return fillWithChildren(termsByParent['0'] || []); +} +const getItemPriority = (name, searchValue) => { + const normalizedName = remove_accents_default()(name || '').toLowerCase(); + const normalizedSearch = remove_accents_default()(searchValue || '').toLowerCase(); + if (normalizedName === normalizedSearch) { + return 0; + } + if (normalizedName.startsWith(normalizedSearch)) { + return normalizedName.length; + } + return Infinity; +}; +function PageAttributesParent({ + data, + onChangeControl +}) { + const [fieldValue, setFieldValue] = (0,external_wp_element_namespaceObject.useState)(null); + const pageId = data.parent; + const postId = data.id; + const postTypeSlug = data.type; + const { + parentPostTitle, + pageItems, + isHierarchical + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getEntityRecord, + getEntityRecords, + getPostType + } = select(external_wp_coreData_namespaceObject.store); + const postTypeInfo = getPostType(postTypeSlug); + const postIsHierarchical = postTypeInfo?.hierarchical && postTypeInfo.viewable; + const parentPost = pageId ? getEntityRecord('postType', postTypeSlug, pageId) : null; + const query = { + per_page: 100, + exclude: postId, + parent_exclude: postId, + orderby: 'menu_order', + order: 'asc', + _fields: 'id,title,parent', + ...(fieldValue !== null && { + search: fieldValue + }) + }; + return { + isHierarchical: postIsHierarchical, + parentPostTitle: parentPost ? getTitleWithFallbackName(parentPost) : '', + pageItems: postIsHierarchical ? getEntityRecords('postType', postTypeSlug, query) : null + }; + }, [fieldValue, pageId, postId, postTypeSlug]); + + /** + * This logic has been copied from https://github.com/WordPress/gutenberg/blob/0249771b519d5646171fb9fae422006c8ab773f2/packages/editor/src/components/page-attributes/parent.js#L106. + */ + const parentOptions = (0,external_wp_element_namespaceObject.useMemo)(() => { + const getOptionsFromTree = (tree, level = 0) => { + const mappedNodes = tree.map(treeNode => [{ + value: treeNode.id, + label: '— '.repeat(level) + (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(treeNode.name), + rawName: treeNode.name + }, ...getOptionsFromTree(treeNode.children || [], level + 1)]); + const sortedNodes = mappedNodes.sort(([a], [b]) => { + const priorityA = getItemPriority(a.rawName, fieldValue !== null && fieldValue !== void 0 ? fieldValue : ''); + const priorityB = getItemPriority(b.rawName, fieldValue !== null && fieldValue !== void 0 ? fieldValue : ''); + return priorityA >= priorityB ? 1 : -1; + }); + return sortedNodes.flat(); + }; + if (!pageItems) { + return []; + } + let tree = pageItems.map(item => { + var _item$parent; + return { + id: item.id, + parent: (_item$parent = item.parent) !== null && _item$parent !== void 0 ? _item$parent : null, + name: getTitleWithFallbackName(item) + }; + }); + + // Only build a hierarchical tree when not searching. + if (!fieldValue) { + tree = buildTermsTree(tree); + } + const opts = getOptionsFromTree(tree); + + // Ensure the current parent is in the options list. + const optsHasParent = opts.find(item => item.value === pageId); + if (pageId && parentPostTitle && !optsHasParent) { + opts.unshift({ + value: pageId, + label: parentPostTitle, + rawName: '' }); } - } catch (error) { - const errorMessage = error.message && error.code !== 'unknown_error' ? error.message : (0,external_wp_i18n_namespaceObject.__)('Template revert failed. Please reload.'); - registry.dispatch(external_wp_notices_namespaceObject.store).createErrorNotice(errorMessage, { - type: 'snackbar' + return opts.map(option => ({ + ...option, + value: option.value.toString() + })); + }, [pageItems, fieldValue, parentPostTitle, pageId]); + if (!isHierarchical) { + return null; + } + + /** + * Handle user input. + * + * @param {string} inputValue The current value of the input field. + */ + const handleKeydown = inputValue => { + setFieldValue(inputValue); + }; + + /** + * Handle author selection. + * + * @param {Object} selectedPostId The selected Author. + */ + const handleChange = selectedPostId => { + if (selectedPostId) { + var _parseInt; + return onChangeControl((_parseInt = parseInt(selectedPostId, 10)) !== null && _parseInt !== void 0 ? _parseInt : 0); + } + onChangeControl(0); + }; + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ComboboxControl, { + __nextHasNoMarginBottom: true, + __next40pxDefaultSize: true, + label: (0,external_wp_i18n_namespaceObject.__)('Parent'), + help: (0,external_wp_i18n_namespaceObject.__)('Choose a parent page.'), + value: pageId?.toString(), + options: parentOptions, + onFilterValueChange: (0,external_wp_compose_namespaceObject.debounce)(value => handleKeydown(value), 300), + onChange: handleChange, + hideLabelFromVision: true + }); +} +const ParentEdit = ({ + data, + field, + onChange +}) => { + const { + id + } = field; + const homeUrl = (0,external_wp_data_namespaceObject.useSelect)(select => { + return select(external_wp_coreData_namespaceObject.store).getEntityRecord('root', '__unstableBase')?.home; + }, []); + const onChangeControl = (0,external_wp_element_namespaceObject.useCallback)(newValue => onChange({ + [id]: newValue + }), [id, onChange]); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("fieldset", { + className: "fields-controls__parent", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { + children: [(0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %1$s The home URL of the WordPress installation without the scheme. */ + (0,external_wp_i18n_namespaceObject.__)('Child pages inherit characteristics from their parent, such as URL structure. For instance, if "Pricing" is a child of "Services", its URL would be %1$s/services/pricing.'), (0,external_wp_url_namespaceObject.filterURLForDisplay)(homeUrl).replace(/([/.])/g, '$1')), { + wbr: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("wbr", {}) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { + children: (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.__)('They also show up as sub-items in the default navigation menu. Learn more.'), { + a: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, { + href: (0,external_wp_i18n_namespaceObject.__)('https://wordpress.org/documentation/article/page-post-settings-sidebar/#page-attributes'), + children: undefined + }) + }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PageAttributesParent, { + data: data, + onChangeControl: onChangeControl + })] + }) + }); +}; + +;// ./node_modules/@wordpress/fields/build-module/fields/parent/parent-view.js +/** + * WordPress dependencies + */ + + + + +/** + * Internal dependencies + */ + + + +const ParentView = ({ + item +}) => { + const parent = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getEntityRecord + } = select(external_wp_coreData_namespaceObject.store); + return item?.parent ? getEntityRecord('postType', item.type, item.parent) : null; + }, [item.parent, item.type]); + if (parent) { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: getTitleWithFallbackName(parent) }); } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: (0,external_wp_i18n_namespaceObject.__)('None') + }); +}; + +;// ./node_modules/@wordpress/fields/build-module/fields/parent/index.js +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + + +const parentField = { + id: 'parent', + type: 'text', + label: (0,external_wp_i18n_namespaceObject.__)('Parent'), + Edit: ParentEdit, + render: ParentView, + enableSorting: true }; /** - * Action that removes an array of templates, template parts or patterns. - * - * @param {Array} items An array of template,template part or pattern objects to remove. + * Parent field for BasePost. */ -const removeTemplates = items => async ({ - registry -}) => { - const isResetting = items.every(item => item?.has_theme_file); - const promiseResult = await Promise.allSettled(items.map(item => { - return registry.dispatch(external_wp_coreData_namespaceObject.store).deleteEntityRecord('postType', item.type, item.id, { - force: true - }, { - throwOnError: true - }); - })); +/* harmony default export */ const fields_parent = (parentField); - // If all the promises were fulfilled with sucess. - if (promiseResult.every(({ - status - }) => status === 'fulfilled')) { - let successMessage; - if (items.length === 1) { - // Depending on how the entity was retrieved its title might be - // an object or simple string. - let title; - if (typeof items[0].title === 'string') { - title = items[0].title; - } else if (typeof items[0].title?.rendered === 'string') { - title = items[0].title?.rendered; - } else if (typeof items[0].title?.raw === 'string') { - title = items[0].title?.raw; - } - successMessage = isResetting ? (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: The template/part's name. */ - (0,external_wp_i18n_namespaceObject.__)('"%s" reset.'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title)) : (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: The template/part's name. */ - (0,external_wp_i18n_namespaceObject._x)('"%s" deleted.', 'template part'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title)); - } else { - successMessage = isResetting ? (0,external_wp_i18n_namespaceObject.__)('Items reset.') : (0,external_wp_i18n_namespaceObject.__)('Items deleted.'); +;// ./node_modules/@wordpress/fields/build-module/fields/comment-status/index.js +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + +const commentStatusField = { + id: 'comment_status', + label: (0,external_wp_i18n_namespaceObject.__)('Discussion'), + type: 'text', + Edit: 'radio', + enableSorting: false, + filterBy: { + operators: [] + }, + elements: [{ + value: 'open', + label: (0,external_wp_i18n_namespaceObject.__)('Open'), + description: (0,external_wp_i18n_namespaceObject.__)('Visitors can add new comments and replies.') + }, { + value: 'closed', + label: (0,external_wp_i18n_namespaceObject.__)('Closed'), + description: (0,external_wp_i18n_namespaceObject.__)('Visitors cannot add new comments or replies. Existing comments remain visible.') + }] +}; + +/** + * Comment status field for BasePost. + */ +/* harmony default export */ const comment_status = (commentStatusField); + +;// ./node_modules/@wordpress/fields/build-module/fields/template/template-edit.js +/* wp:polyfill */ +/** + * WordPress dependencies + */ + +// @ts-ignore + + +/** + * Internal dependencies + */ +// @ts-expect-error block-editor is not typed correctly. + + + + + + + + + +const TemplateEdit = ({ + data, + field, + onChange +}) => { + const { + id + } = field; + const postType = data.type; + const postId = typeof data.id === 'number' ? data.id : parseInt(data.id, 10); + const slug = data.slug; + const { + availableTemplates, + templates + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + var _select$getEntityReco; + const allTemplates = (_select$getEntityReco = select(external_wp_coreData_namespaceObject.store).getEntityRecords('postType', 'wp_template', { + per_page: -1, + post_type: postType + })) !== null && _select$getEntityReco !== void 0 ? _select$getEntityReco : []; + const { + getHomePage, + getPostsPageId + } = lock_unlock_unlock(select(external_wp_coreData_namespaceObject.store)); + const isPostsPage = getPostsPageId() === +postId; + const isFrontPage = postType === 'page' && getHomePage()?.postId === +postId; + const allowSwitchingTemplate = !isPostsPage && !isFrontPage; + return { + templates: allTemplates, + availableTemplates: allowSwitchingTemplate ? allTemplates.filter(template => template.is_custom && template.slug !== data.template && !!template.content.raw // Skip empty templates. + ) : [] + }; + }, [data.template, postId, postType]); + const templatesAsPatterns = (0,external_wp_element_namespaceObject.useMemo)(() => availableTemplates.map(template => ({ + name: template.slug, + blocks: (0,external_wp_blocks_namespaceObject.parse)(template.content.raw), + title: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(template.title.rendered), + id: template.id + })), [availableTemplates]); + const shownTemplates = (0,external_wp_compose_namespaceObject.useAsyncList)(templatesAsPatterns); + const value = field.getValue({ + item: data + }); + const currentTemplate = (0,external_wp_data_namespaceObject.useSelect)(select => { + const foundTemplate = templates?.find(template => template.slug === value); + if (foundTemplate) { + return foundTemplate; } - registry.dispatch(external_wp_notices_namespaceObject.store).createSuccessNotice(successMessage, { - type: 'snackbar', - id: 'editor-template-deleted-success' - }); - } else { - // If there was at lease one failure. - let errorMessage; - // If we were trying to delete a single template. - if (promiseResult.length === 1) { - if (promiseResult[0].reason?.message) { - errorMessage = promiseResult[0].reason.message; - } else { - errorMessage = isResetting ? (0,external_wp_i18n_namespaceObject.__)('An error occurred while reverting the item.') : (0,external_wp_i18n_namespaceObject.__)('An error occurred while deleting the item.'); - } - // If we were trying to delete a multiple templates + let slugToCheck; + // In `draft` status we might not have a slug available, so we use the `single` + // post type templates slug(ex page, single-post, single-product etc..). + // Pages do not need the `single` prefix in the slug to be prioritized + // through template hierarchy. + if (slug) { + slugToCheck = postType === 'page' ? `${postType}-${slug}` : `single-${postType}-${slug}`; } else { - const errorMessages = new Set(); - const failedPromises = promiseResult.filter(({ - status - }) => status === 'rejected'); - for (const failedPromise of failedPromises) { - if (failedPromise.reason?.message) { - errorMessages.add(failedPromise.reason.message); + slugToCheck = postType === 'page' ? 'page' : `single-${postType}`; + } + if (postType) { + const templateId = select(external_wp_coreData_namespaceObject.store).getDefaultTemplateId({ + slug: slugToCheck + }); + return select(external_wp_coreData_namespaceObject.store).getEntityRecord('postType', 'wp_template', templateId); + } + }, [postType, slug, templates, value]); + const [showModal, setShowModal] = (0,external_wp_element_namespaceObject.useState)(false); + const onChangeControl = (0,external_wp_element_namespaceObject.useCallback)(newValue => onChange({ + [id]: newValue + }), [id, onChange]); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("fieldset", { + className: "fields-controls__template", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Dropdown, { + popoverProps: { + placement: 'bottom-start' + }, + renderToggle: ({ + onToggle + }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + __next40pxDefaultSize: true, + variant: "tertiary", + size: "compact", + onClick: onToggle, + children: currentTemplate ? getItemTitle(currentTemplate) : '' + }), + renderContent: ({ + onToggle + }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.MenuGroup, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { + onClick: () => { + setShowModal(true); + onToggle(); + }, + children: (0,external_wp_i18n_namespaceObject.__)('Change template') + }), + // The default template in a post is indicated by an empty string + value !== '' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { + onClick: () => { + onChangeControl(''); + onToggle(); + }, + children: (0,external_wp_i18n_namespaceObject.__)('Use default template') + })] + }) + }), showModal && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Modal, { + title: (0,external_wp_i18n_namespaceObject.__)('Choose a template'), + onRequestClose: () => setShowModal(false), + overlayClassName: "fields-controls__template-modal", + isFullScreen: true, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: "fields-controls__template-content", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalBlockPatternsList, { + label: (0,external_wp_i18n_namespaceObject.__)('Templates'), + blockPatterns: templatesAsPatterns, + shownPatterns: shownTemplates, + onClickPattern: template => { + onChangeControl(template.name); + setShowModal(false); + } + }) + }) + })] + }); +}; + +;// ./node_modules/@wordpress/fields/build-module/fields/template/index.js +/** + * WordPress dependencies + */ + +/** + * Internal dependencies + */ + + +const templateField = { + id: 'template', + type: 'text', + label: (0,external_wp_i18n_namespaceObject.__)('Template'), + Edit: TemplateEdit, + enableSorting: false +}; + +/** + * Template field for BasePost. + */ +/* harmony default export */ const fields_template = (templateField); + +;// ./node_modules/@wordpress/fields/build-module/fields/password/edit.js +/** + * WordPress dependencies + */ + + + + +/** + * Internal dependencies + */ + +function PasswordEdit({ + data, + onChange, + field +}) { + const [showPassword, setShowPassword] = (0,external_wp_element_namespaceObject.useState)(!!field.getValue({ + item: data + })); + const handleTogglePassword = value => { + setShowPassword(value); + if (!value) { + onChange({ + password: '' + }); + } + }; + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { + as: "fieldset", + spacing: 4, + className: "fields-controls__password", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.CheckboxControl, { + __nextHasNoMarginBottom: true, + label: (0,external_wp_i18n_namespaceObject.__)('Password protected'), + help: (0,external_wp_i18n_namespaceObject.__)('Only visible to those who know the password'), + checked: showPassword, + onChange: handleTogglePassword + }), showPassword && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: "fields-controls__password-input", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { + label: (0,external_wp_i18n_namespaceObject.__)('Password'), + onChange: value => onChange({ + password: value + }), + value: field.getValue({ + item: data + }) || '', + placeholder: (0,external_wp_i18n_namespaceObject.__)('Use a secure password'), + type: "text", + __next40pxDefaultSize: true, + __nextHasNoMarginBottom: true, + maxLength: 255 + }) + })] + }); +} +/* harmony default export */ const edit = (PasswordEdit); + +;// ./node_modules/@wordpress/fields/build-module/fields/password/index.js +/** + * WordPress dependencies + */ + +/** + * Internal dependencies + */ + + +const passwordField = { + id: 'password', + type: 'text', + Edit: edit, + enableSorting: false, + enableHiding: false, + isVisible: item => item.status !== 'private' +}; + +/** + * Password field for BasePost. + */ +/* harmony default export */ const fields_password = (passwordField); + +;// ./node_modules/@wordpress/fields/build-module/fields/title/view.js +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + + +function BaseTitleView({ + item, + className, + children +}) { + const renderedTitle = getItemTitle(item); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { + className: dist_clsx('fields-field__title', className), + alignment: "center", + justify: "flex-start", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { + children: renderedTitle || (0,external_wp_i18n_namespaceObject.__)('(no title)') + }), children] + }); +} +function TitleView({ + item +}) { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BaseTitleView, { + item: item + }); +} + +;// ./node_modules/@wordpress/fields/build-module/fields/page-title/view.js +/** + * WordPress dependencies + */ + + + + + +/** + * Internal dependencies + */ + + + + +const { + Badge +} = lock_unlock_unlock(external_wp_components_namespaceObject.privateApis); +function PageTitleView({ + item +}) { + const { + frontPageId, + postsPageId + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getEntityRecord + } = select(external_wp_coreData_namespaceObject.store); + const siteSettings = getEntityRecord('root', 'site'); + return { + frontPageId: siteSettings?.page_on_front, + postsPageId: siteSettings?.page_for_posts + }; + }, []); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BaseTitleView, { + item: item, + className: "fields-field__page-title", + children: [frontPageId, postsPageId].includes(item.id) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Badge, { + children: item.id === frontPageId ? (0,external_wp_i18n_namespaceObject.__)('Homepage') : (0,external_wp_i18n_namespaceObject.__)('Posts Page') + }) + }); +} + +;// ./node_modules/@wordpress/fields/build-module/fields/page-title/index.js +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + + +const pageTitleField = { + type: 'text', + id: 'title', + label: (0,external_wp_i18n_namespaceObject.__)('Title'), + placeholder: (0,external_wp_i18n_namespaceObject.__)('No title'), + getValue: ({ + item + }) => getItemTitle(item), + render: PageTitleView, + enableHiding: false, + enableGlobalSearch: true +}; + +/** + * Title for the page entity. + */ +/* harmony default export */ const page_title = (pageTitleField); + +;// ./node_modules/@wordpress/fields/build-module/fields/template-title/index.js +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + + +const templateTitleField = { + type: 'text', + label: (0,external_wp_i18n_namespaceObject.__)('Template'), + placeholder: (0,external_wp_i18n_namespaceObject.__)('No title'), + id: 'title', + getValue: ({ + item + }) => getItemTitle(item), + render: TitleView, + enableHiding: false, + enableGlobalSearch: true +}; + +/** + * Title for the template entity. + */ +/* harmony default export */ const template_title = (templateTitleField); + +;// ./node_modules/@wordpress/icons/build-module/icon/index.js +/** + * WordPress dependencies + */ + + +/** @typedef {{icon: JSX.Element, size?: number} & import('@wordpress/primitives').SVGProps} IconProps */ + +/** + * Return an SVG icon. + * + * @param {IconProps} props icon is the SVG component to render + * size is a number specifying the icon size in pixels + * Other props will be passed to wrapped SVG component + * @param {import('react').ForwardedRef} ref The forwarded ref to the SVG element. + * + * @return {JSX.Element} Icon component + */ +function Icon({ + icon, + size = 24, + ...props +}, ref) { + return (0,external_wp_element_namespaceObject.cloneElement)(icon, { + width: size, + height: size, + ...props, + ref + }); +} +/* harmony default export */ const icon = ((0,external_wp_element_namespaceObject.forwardRef)(Icon)); + +;// ./node_modules/@wordpress/icons/build-module/library/lock-small.js +/** + * WordPress dependencies + */ + + +const lockSmall = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + viewBox: "0 0 24 24", + xmlns: "http://www.w3.org/2000/svg", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M15 11h-.2V9c0-1.5-1.2-2.8-2.8-2.8S9.2 7.5 9.2 9v2H9c-.6 0-1 .4-1 1v4c0 .6.4 1 1 1h6c.6 0 1-.4 1-1v-4c0-.6-.4-1-1-1zm-1.8 0h-2.5V9c0-.7.6-1.2 1.2-1.2s1.2.6 1.2 1.2v2z" + }) +}); +/* harmony default export */ const lock_small = (lockSmall); + +;// ./node_modules/@wordpress/fields/build-module/fields/pattern-title/view.js +/** + * WordPress dependencies + */ + + + +// @ts-ignore + + +/** + * Internal dependencies + */ + + + + +const { + PATTERN_TYPES: view_PATTERN_TYPES +} = lock_unlock_unlock(external_wp_patterns_namespaceObject.privateApis); +function PatternTitleView({ + item +}) { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BaseTitleView, { + item: item, + className: "fields-field__pattern-title", + children: item.type === view_PATTERN_TYPES.theme && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Tooltip, { + placement: "top", + text: (0,external_wp_i18n_namespaceObject.__)('This pattern cannot be edited.'), + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(icon, { + icon: lock_small, + size: 24 + }) + }) + }); +} + +;// ./node_modules/@wordpress/fields/build-module/fields/pattern-title/index.js +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + + +const patternTitleField = { + type: 'text', + id: 'title', + label: (0,external_wp_i18n_namespaceObject.__)('Title'), + placeholder: (0,external_wp_i18n_namespaceObject.__)('No title'), + getValue: ({ + item + }) => getItemTitle(item), + render: PatternTitleView, + enableHiding: false, + enableGlobalSearch: true +}; + +/** + * Title for the pattern entity. + */ +/* harmony default export */ const pattern_title = (patternTitleField); + +;// ./node_modules/@wordpress/fields/build-module/fields/title/index.js +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + + +const titleField = { + type: 'text', + id: 'title', + label: (0,external_wp_i18n_namespaceObject.__)('Title'), + placeholder: (0,external_wp_i18n_namespaceObject.__)('No title'), + getValue: ({ + item + }) => getItemTitle(item), + render: TitleView, + enableHiding: false, + enableGlobalSearch: true +}; + +/** + * Title for the any entity with a `title` property. + * For patterns, pages or templates you should use the respective field + * because there are some differences in the rendering, labels, etc. + */ +/* harmony default export */ const title = (titleField); + +;// ./node_modules/@wordpress/editor/build-module/components/provider/with-registry-provider.js +/** + * WordPress dependencies + */ + + + + + +/** + * Internal dependencies + */ + + +function getSubRegistry(subRegistries, registry, useSubRegistry) { + if (!useSubRegistry) { + return registry; + } + let subRegistry = subRegistries.get(registry); + if (!subRegistry) { + subRegistry = (0,external_wp_data_namespaceObject.createRegistry)({ + 'core/block-editor': external_wp_blockEditor_namespaceObject.storeConfig + }, registry); + // Todo: The interface store should also be created per instance. + subRegistry.registerStore('core/editor', storeConfig); + subRegistries.set(registry, subRegistry); + } + return subRegistry; +} +const withRegistryProvider = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(WrappedComponent => ({ + useSubRegistry = true, + ...props +}) => { + const registry = (0,external_wp_data_namespaceObject.useRegistry)(); + const [subRegistries] = (0,external_wp_element_namespaceObject.useState)(() => new WeakMap()); + const subRegistry = getSubRegistry(subRegistries, registry, useSubRegistry); + if (subRegistry === registry) { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WrappedComponent, { + registry: registry, + ...props + }); + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_data_namespaceObject.RegistryProvider, { + value: subRegistry, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WrappedComponent, { + registry: subRegistry, + ...props + }) + }); +}, 'withRegistryProvider'); +/* harmony default export */ const with_registry_provider = (withRegistryProvider); + +;// ./node_modules/@wordpress/editor/build-module/components/media-categories/index.js +/* wp:polyfill */ +/** + * The `editor` settings here need to be in sync with the corresponding ones in `editor` package. + * See `packages/editor/src/components/media-categories/index.js`. + * + * In the future we could consider creating an Openvese package that can be used in both `editor` and `site-editor`. + * The rest of the settings would still need to be in sync though. + */ + +/** + * WordPress dependencies + */ + + + + +/** + * Internal dependencies + */ + + +/** @typedef {import('@wordpress/block-editor').InserterMediaRequest} InserterMediaRequest */ +/** @typedef {import('@wordpress/block-editor').InserterMediaItem} InserterMediaItem */ +/** @typedef {import('@wordpress/block-editor').InserterMediaCategory} InserterMediaCategory */ + +const getExternalLink = (url, text) => `${text}`; +const getExternalLinkAttributes = url => `href="${url}" target="_blank" rel="noreferrer noopener"`; +const getOpenverseLicense = (license, licenseVersion) => { + let licenseName = license.trim(); + // PDM has no abbreviation + if (license !== 'pdm') { + licenseName = license.toUpperCase().replace('SAMPLING', 'Sampling'); + } + // If version is known, append version to the name. + // The license has to have a version to be valid. Only + // PDM (public domain mark) doesn't have a version. + if (licenseVersion) { + licenseName += ` ${licenseVersion}`; + } + // For licenses other than public-domain marks, prepend 'CC' to the name. + if (!['pdm', 'cc0'].includes(license)) { + licenseName = `CC ${licenseName}`; + } + return licenseName; +}; +const getOpenverseCaption = item => { + const { + title, + foreign_landing_url: foreignLandingUrl, + creator, + creator_url: creatorUrl, + license, + license_version: licenseVersion, + license_url: licenseUrl + } = item; + const fullLicense = getOpenverseLicense(license, licenseVersion); + const _creator = (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(creator); + let _caption; + if (_creator) { + _caption = title ? (0,external_wp_i18n_namespaceObject.sprintf)( + // translators: %1s: Title of a media work from Openverse; %2s: Name of the work's creator; %3s: Work's licence e.g: "CC0 1.0". + (0,external_wp_i18n_namespaceObject._x)('"%1$s" by %2$s/ %3$s', 'caption'), getExternalLink(foreignLandingUrl, (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title)), creatorUrl ? getExternalLink(creatorUrl, _creator) : _creator, licenseUrl ? getExternalLink(`${licenseUrl}?ref=openverse`, fullLicense) : fullLicense) : (0,external_wp_i18n_namespaceObject.sprintf)( + // translators: %1s: Link attributes for a given Openverse media work; %2s: Name of the work's creator; %3s: Works's licence e.g: "CC0 1.0". + (0,external_wp_i18n_namespaceObject._x)('Work by %2$s/ %3$s', 'caption'), getExternalLinkAttributes(foreignLandingUrl), creatorUrl ? getExternalLink(creatorUrl, _creator) : _creator, licenseUrl ? getExternalLink(`${licenseUrl}?ref=openverse`, fullLicense) : fullLicense); + } else { + _caption = title ? (0,external_wp_i18n_namespaceObject.sprintf)( + // translators: %1s: Title of a media work from Openverse; %2s: Work's licence e.g: "CC0 1.0". + (0,external_wp_i18n_namespaceObject._x)('"%1$s"/ %2$s', 'caption'), getExternalLink(foreignLandingUrl, (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title)), licenseUrl ? getExternalLink(`${licenseUrl}?ref=openverse`, fullLicense) : fullLicense) : (0,external_wp_i18n_namespaceObject.sprintf)( + // translators: %1s: Link attributes for a given Openverse media work; %2s: Works's licence e.g: "CC0 1.0". + (0,external_wp_i18n_namespaceObject._x)('Work/ %2$s', 'caption'), getExternalLinkAttributes(foreignLandingUrl), licenseUrl ? getExternalLink(`${licenseUrl}?ref=openverse`, fullLicense) : fullLicense); + } + return _caption.replace(/\s{2}/g, ' '); +}; +const coreMediaFetch = async (query = {}) => { + const mediaItems = await (0,external_wp_data_namespaceObject.resolveSelect)(external_wp_coreData_namespaceObject.store).getMediaItems({ + ...query, + orderBy: !!query?.search ? 'relevance' : 'date' + }); + return mediaItems.map(mediaItem => ({ + ...mediaItem, + alt: mediaItem.alt_text, + url: mediaItem.source_url, + previewUrl: mediaItem.media_details?.sizes?.medium?.source_url, + caption: mediaItem.caption?.raw + })); +}; + +/** @type {InserterMediaCategory[]} */ +const inserterMediaCategories = [{ + name: 'images', + labels: { + name: (0,external_wp_i18n_namespaceObject.__)('Images'), + search_items: (0,external_wp_i18n_namespaceObject.__)('Search images') + }, + mediaType: 'image', + async fetch(query = {}) { + return coreMediaFetch({ + ...query, + media_type: 'image' + }); + } +}, { + name: 'videos', + labels: { + name: (0,external_wp_i18n_namespaceObject.__)('Videos'), + search_items: (0,external_wp_i18n_namespaceObject.__)('Search videos') + }, + mediaType: 'video', + async fetch(query = {}) { + return coreMediaFetch({ + ...query, + media_type: 'video' + }); + } +}, { + name: 'audio', + labels: { + name: (0,external_wp_i18n_namespaceObject.__)('Audio'), + search_items: (0,external_wp_i18n_namespaceObject.__)('Search audio') + }, + mediaType: 'audio', + async fetch(query = {}) { + return coreMediaFetch({ + ...query, + media_type: 'audio' + }); + } +}, { + name: 'openverse', + labels: { + name: (0,external_wp_i18n_namespaceObject.__)('Openverse'), + search_items: (0,external_wp_i18n_namespaceObject.__)('Search Openverse') + }, + mediaType: 'image', + async fetch(query = {}) { + const defaultArgs = { + mature: false, + excluded_source: 'flickr,inaturalist,wikimedia', + license: 'pdm,cc0' + }; + const finalQuery = { + ...query, + ...defaultArgs + }; + const mapFromInserterMediaRequest = { + per_page: 'page_size', + search: 'q' + }; + const url = new URL('https://api.openverse.org/v1/images/'); + Object.entries(finalQuery).forEach(([key, value]) => { + const queryKey = mapFromInserterMediaRequest[key] || key; + url.searchParams.set(queryKey, value); + }); + const response = await window.fetch(url, { + headers: { + 'User-Agent': 'WordPress/inserter-media-fetch' + } + }); + const jsonResponse = await response.json(); + const results = jsonResponse.results; + return results.map(result => ({ + ...result, + // This is a temp solution for better titles, until Openverse API + // completes the cleaning up of some titles of their upstream data. + title: result.title?.toLowerCase().startsWith('file:') ? result.title.slice(5) : result.title, + sourceId: result.id, + id: undefined, + caption: getOpenverseCaption(result), + previewUrl: result.thumbnail + })); + }, + getReportUrl: ({ + sourceId + }) => `https://wordpress.org/openverse/image/${sourceId}/report/`, + isExternalResource: true +}]; +/* harmony default export */ const media_categories = (inserterMediaCategories); + +;// ./node_modules/@wordpress/editor/node_modules/uuid/dist/esm-browser/native.js +const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto); +/* harmony default export */ const esm_browser_native = ({ + randomUUID +}); +;// ./node_modules/@wordpress/editor/node_modules/uuid/dist/esm-browser/rng.js +// Unique ID creation requires a high quality random # generator. In the browser we therefore +// require the crypto API and do not support built-in fallback to lower quality random number +// generators (like Math.random()). +let getRandomValues; +const rnds8 = new Uint8Array(16); +function rng() { + // lazy load so that environments that need to polyfill have a chance to do so + if (!getRandomValues) { + // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. + getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto); + + if (!getRandomValues) { + throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported'); + } + } + + return getRandomValues(rnds8); +} +;// ./node_modules/@wordpress/editor/node_modules/uuid/dist/esm-browser/stringify.js + +/** + * Convert array of 16 byte values to UUID string format of the form: + * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX + */ + +const byteToHex = []; + +for (let i = 0; i < 256; ++i) { + byteToHex.push((i + 0x100).toString(16).slice(1)); +} + +function unsafeStringify(arr, offset = 0) { + // Note: Be careful editing this code! It's been tuned for performance + // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434 + return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]; +} + +function stringify(arr, offset = 0) { + const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one + // of the following: + // - One or more input array values don't map to a hex octet (leading to + // "undefined" in the uuid) + // - Invalid input values for the RFC `version` or `variant` fields + + if (!validate(uuid)) { + throw TypeError('Stringified UUID is invalid'); + } + + return uuid; +} + +/* harmony default export */ const esm_browser_stringify = ((/* unused pure expression or super */ null && (stringify))); +;// ./node_modules/@wordpress/editor/node_modules/uuid/dist/esm-browser/v4.js + + + + +function v4(options, buf, offset) { + if (esm_browser_native.randomUUID && !buf && !options) { + return esm_browser_native.randomUUID(); + } + + options = options || {}; + const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` + + rnds[6] = rnds[6] & 0x0f | 0x40; + rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided + + if (buf) { + offset = offset || 0; + + for (let i = 0; i < 16; ++i) { + buf[offset + i] = rnds[i]; + } + + return buf; + } + + return unsafeStringify(rnds); +} + +/* harmony default export */ const esm_browser_v4 = (v4); +;// ./node_modules/@wordpress/editor/build-module/utils/media-upload/index.js +/** + * External dependencies + */ + + +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + +const noop = () => {}; + +/** + * Upload a media file when the file upload button is activated. + * Wrapper around mediaUpload() that injects the current post ID. + * + * @param {Object} $0 Parameters object passed to the function. + * @param {?Object} $0.additionalData Additional data to include in the request. + * @param {string} $0.allowedTypes Array with the types of media that can be uploaded, if unset all types are allowed. + * @param {Array} $0.filesList List of files. + * @param {?number} $0.maxUploadFileSize Maximum upload size in bytes allowed for the site. + * @param {Function} $0.onError Function called when an error happens. + * @param {Function} $0.onFileChange Function called each time a file or a temporary representation of the file is available. + * @param {Function} $0.onSuccess Function called after the final representation of the file is available. + */ +function mediaUpload({ + additionalData = {}, + allowedTypes, + filesList, + maxUploadFileSize, + onError = noop, + onFileChange, + onSuccess +}) { + const { + getCurrentPost, + getEditorSettings + } = (0,external_wp_data_namespaceObject.select)(store_store); + const { + lockPostAutosaving, + unlockPostAutosaving, + lockPostSaving, + unlockPostSaving + } = (0,external_wp_data_namespaceObject.dispatch)(store_store); + const wpAllowedMimeTypes = getEditorSettings().allowedMimeTypes; + const lockKey = `image-upload-${esm_browser_v4()}`; + let imageIsUploading = false; + maxUploadFileSize = maxUploadFileSize || getEditorSettings().maxUploadFileSize; + const currentPost = getCurrentPost(); + // Templates and template parts' numerical ID is stored in `wp_id`. + const currentPostId = typeof currentPost?.id === 'number' ? currentPost.id : currentPost?.wp_id; + const setSaveLock = () => { + lockPostSaving(lockKey); + lockPostAutosaving(lockKey); + imageIsUploading = true; + }; + const postData = currentPostId ? { + post: currentPostId + } : {}; + const clearSaveLock = () => { + unlockPostSaving(lockKey); + unlockPostAutosaving(lockKey); + imageIsUploading = false; + }; + (0,external_wp_mediaUtils_namespaceObject.uploadMedia)({ + allowedTypes, + filesList, + onFileChange: file => { + if (!imageIsUploading) { + setSaveLock(); + } else { + clearSaveLock(); + } + onFileChange?.(file); + }, + onSuccess, + additionalData: { + ...postData, + ...additionalData + }, + maxUploadFileSize, + onError: ({ + message + }) => { + clearSaveLock(); + onError(message); + }, + wpAllowedMimeTypes + }); +} + +;// ./node_modules/@wordpress/editor/build-module/utils/media-sideload/index.js +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + +const { + sideloadMedia: mediaSideload +} = unlock(external_wp_mediaUtils_namespaceObject.privateApis); +/* harmony default export */ const media_sideload = (mediaSideload); + +// EXTERNAL MODULE: ./node_modules/deepmerge/dist/cjs.js +var cjs = __webpack_require__(66); +var cjs_default = /*#__PURE__*/__webpack_require__.n(cjs); +;// ./node_modules/is-plain-object/dist/is-plain-object.mjs +/*! + * is-plain-object + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */ + +function isObject(o) { + return Object.prototype.toString.call(o) === '[object Object]'; +} + +function isPlainObject(o) { + var ctor,prot; + + if (isObject(o) === false) return false; + + // If has modified constructor + ctor = o.constructor; + if (ctor === undefined) return true; + + // If has modified prototype + prot = ctor.prototype; + if (isObject(prot) === false) return false; + + // If constructor does not have an Object-specific method + if (prot.hasOwnProperty('isPrototypeOf') === false) { + return false; + } + + // Most likely a plain Object + return true; +} + + + +;// ./node_modules/@wordpress/editor/build-module/components/global-styles-provider/index.js +/** + * External dependencies + */ + + + +/** + * WordPress dependencies + */ + + + + + +/** + * Internal dependencies + */ + + +const { + GlobalStylesContext, + cleanEmptyObject +} = unlock(external_wp_blockEditor_namespaceObject.privateApis); +function mergeBaseAndUserConfigs(base, user) { + return cjs_default()(base, user, { + /* + * We only pass as arrays the presets, + * in which case we want the new array of values + * to override the old array (no merging). + */ + isMergeableObject: isPlainObject, + /* + * Exceptions to the above rule. + * Background images should be replaced, not merged, + * as they themselves are specific object definitions for the style. + */ + customMerge: key => { + if (key === 'backgroundImage') { + return (baseConfig, userConfig) => userConfig; + } + return undefined; + } + }); +} +function useGlobalStylesUserConfig() { + const { + globalStylesId, + isReady, + settings, + styles, + _links + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getEntityRecord, + getEditedEntityRecord, + hasFinishedResolution, + canUser + } = select(external_wp_coreData_namespaceObject.store); + const _globalStylesId = select(external_wp_coreData_namespaceObject.store).__experimentalGetCurrentGlobalStylesId(); + let record; + + /* + * Ensure that the global styles ID request is complete by testing `_globalStylesId`, + * before firing off the `canUser` OPTIONS request for user capabilities, otherwise it will + * fetch `/wp/v2/global-styles` instead of `/wp/v2/global-styles/{id}`. + * NOTE: Please keep in sync any preload paths sent to `block_editor_rest_api_preload()`, + * or set using the `block_editor_rest_api_preload_paths` filter, if this changes. + */ + const userCanEditGlobalStyles = _globalStylesId ? canUser('update', { + kind: 'root', + name: 'globalStyles', + id: _globalStylesId + }) : null; + if (_globalStylesId && + /* + * Test that the OPTIONS request for user capabilities is complete + * before fetching the global styles entity record. + * This is to avoid fetching the global styles entity unnecessarily. + */ + typeof userCanEditGlobalStyles === 'boolean') { + /* + * Fetch the global styles entity record based on the user's capabilities. + * The default context is `edit` for users who can edit global styles. + * Otherwise, the context is `view`. + * NOTE: There is an equivalent conditional check using `current_user_can()` in the backend + * to preload the global styles entity. Please keep in sync any preload paths sent to `block_editor_rest_api_preload()`, + * or set using `block_editor_rest_api_preload_paths` filter, if this changes. + */ + if (userCanEditGlobalStyles) { + record = getEditedEntityRecord('root', 'globalStyles', _globalStylesId); + } else { + record = getEntityRecord('root', 'globalStyles', _globalStylesId, { + context: 'view' + }); + } + } + let hasResolved = false; + if (hasFinishedResolution('__experimentalGetCurrentGlobalStylesId')) { + if (_globalStylesId) { + hasResolved = userCanEditGlobalStyles ? hasFinishedResolution('getEditedEntityRecord', ['root', 'globalStyles', _globalStylesId]) : hasFinishedResolution('getEntityRecord', ['root', 'globalStyles', _globalStylesId, { + context: 'view' + }]); + } else { + hasResolved = true; + } + } + return { + globalStylesId: _globalStylesId, + isReady: hasResolved, + settings: record?.settings, + styles: record?.styles, + _links: record?._links + }; + }, []); + const { + getEditedEntityRecord + } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_coreData_namespaceObject.store); + const { + editEntityRecord + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); + const config = (0,external_wp_element_namespaceObject.useMemo)(() => { + return { + settings: settings !== null && settings !== void 0 ? settings : {}, + styles: styles !== null && styles !== void 0 ? styles : {}, + _links: _links !== null && _links !== void 0 ? _links : {} + }; + }, [settings, styles, _links]); + const setConfig = (0,external_wp_element_namespaceObject.useCallback)( + /** + * Set the global styles config. + * @param {Function|Object} callbackOrObject If the callbackOrObject is a function, pass the current config to the callback so the consumer can merge values. + * Otherwise, overwrite the current config with the incoming object. + * @param {Object} options Options for editEntityRecord Core selector. + */ + (callbackOrObject, options = {}) => { + var _record$styles, _record$settings, _record$_links; + const record = getEditedEntityRecord('root', 'globalStyles', globalStylesId); + const currentConfig = { + styles: (_record$styles = record?.styles) !== null && _record$styles !== void 0 ? _record$styles : {}, + settings: (_record$settings = record?.settings) !== null && _record$settings !== void 0 ? _record$settings : {}, + _links: (_record$_links = record?._links) !== null && _record$_links !== void 0 ? _record$_links : {} + }; + const updatedConfig = typeof callbackOrObject === 'function' ? callbackOrObject(currentConfig) : callbackOrObject; + editEntityRecord('root', 'globalStyles', globalStylesId, { + styles: cleanEmptyObject(updatedConfig.styles) || {}, + settings: cleanEmptyObject(updatedConfig.settings) || {}, + _links: cleanEmptyObject(updatedConfig._links) || {} + }, options); + }, [globalStylesId, editEntityRecord, getEditedEntityRecord]); + return [isReady, config, setConfig]; +} +function useGlobalStylesBaseConfig() { + const baseConfig = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).__experimentalGetCurrentThemeBaseGlobalStyles(), []); + return [!!baseConfig, baseConfig]; +} +function useGlobalStylesContext() { + const [isUserConfigReady, userConfig, setUserConfig] = useGlobalStylesUserConfig(); + const [isBaseConfigReady, baseConfig] = useGlobalStylesBaseConfig(); + const mergedConfig = (0,external_wp_element_namespaceObject.useMemo)(() => { + if (!baseConfig || !userConfig) { + return {}; + } + return mergeBaseAndUserConfigs(baseConfig, userConfig); + }, [userConfig, baseConfig]); + const context = (0,external_wp_element_namespaceObject.useMemo)(() => { + return { + isReady: isUserConfigReady && isBaseConfigReady, + user: userConfig, + base: baseConfig, + merged: mergedConfig, + setUserConfig + }; + }, [mergedConfig, userConfig, baseConfig, setUserConfig, isUserConfigReady, isBaseConfigReady]); + return context; +} +function GlobalStylesProvider({ + children +}) { + const context = useGlobalStylesContext(); + if (!context.isReady) { + return null; + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(GlobalStylesContext.Provider, { + value: context, + children: children + }); +} + +;// ./node_modules/@wordpress/editor/build-module/components/provider/use-block-editor-settings.js +/* wp:polyfill */ +/** + * WordPress dependencies + */ + + + + + + + + + +/** + * Internal dependencies + */ + + + + + + +const use_block_editor_settings_EMPTY_OBJECT = {}; +function __experimentalReusableBlocksSelect(select) { + const { + RECEIVE_INTERMEDIATE_RESULTS + } = unlock(external_wp_coreData_namespaceObject.privateApis); + const { + getEntityRecords + } = select(external_wp_coreData_namespaceObject.store); + return getEntityRecords('postType', 'wp_block', { + per_page: -1, + [RECEIVE_INTERMEDIATE_RESULTS]: true + }); +} +const BLOCK_EDITOR_SETTINGS = ['__experimentalBlockDirectory', '__experimentalDiscussionSettings', '__experimentalFeatures', '__experimentalGlobalStylesBaseStyles', 'alignWide', 'blockInspectorTabs', 'maxUploadFileSize', 'allowedMimeTypes', 'bodyPlaceholder', 'canLockBlocks', 'canUpdateBlockBindings', 'capabilities', 'clearBlockSelection', 'codeEditingEnabled', 'colors', 'disableCustomColors', 'disableCustomFontSizes', 'disableCustomSpacingSizes', 'disableCustomGradients', 'disableLayoutStyles', 'enableCustomLineHeight', 'enableCustomSpacing', 'enableCustomUnits', 'enableOpenverseMediaCategory', 'fontSizes', 'gradients', 'generateAnchors', 'onNavigateToEntityRecord', 'imageDefaultSize', 'imageDimensions', 'imageEditing', 'imageSizes', 'isPreviewMode', 'isRTL', 'locale', 'maxWidth', 'postContentAttributes', 'postsPerPage', 'readOnly', 'styles', 'titlePlaceholder', 'supportsLayout', 'widgetTypesToHideFromLegacyWidgetBlock', '__unstableHasCustomAppender', '__unstableResolvedAssets', '__unstableIsBlockBasedTheme']; +const { + globalStylesDataKey, + globalStylesLinksDataKey, + selectBlockPatternsKey, + reusableBlocksSelectKey, + sectionRootClientIdKey +} = unlock(external_wp_blockEditor_namespaceObject.privateApis); + +/** + * React hook used to compute the block editor settings to use for the post editor. + * + * @param {Object} settings EditorProvider settings prop. + * @param {string} postType Editor root level post type. + * @param {string} postId Editor root level post ID. + * @param {string} renderingMode Editor rendering mode. + * + * @return {Object} Block Editor Settings. + */ +function useBlockEditorSettings(settings, postType, postId, renderingMode) { + var _mergedGlobalStyles$s, _mergedGlobalStyles$_, _settings$__experimen, _settings$__experimen2; + const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium'); + const { + allowRightClickOverrides, + blockTypes, + focusMode, + hasFixedToolbar, + isDistractionFree, + keepCaretInsideBlock, + hasUploadPermissions, + hiddenBlockTypes, + canUseUnfilteredHTML, + userCanCreatePages, + pageOnFront, + pageForPosts, + userPatternCategories, + restBlockPatternCategories, + sectionRootClientId + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + var _canUser; + const { + canUser, + getRawEntityRecord, + getEntityRecord, + getUserPatternCategories, + getBlockPatternCategories + } = select(external_wp_coreData_namespaceObject.store); + const { + get + } = select(external_wp_preferences_namespaceObject.store); + const { + getBlockTypes + } = select(external_wp_blocks_namespaceObject.store); + const { + getBlocksByName, + getBlockAttributes + } = select(external_wp_blockEditor_namespaceObject.store); + const siteSettings = canUser('read', { + kind: 'root', + name: 'site' + }) ? getEntityRecord('root', 'site') : undefined; + function getSectionRootBlock() { + var _getBlocksByName$find; + if (renderingMode === 'template-locked') { + var _getBlocksByName$; + return (_getBlocksByName$ = getBlocksByName('core/post-content')?.[0]) !== null && _getBlocksByName$ !== void 0 ? _getBlocksByName$ : ''; + } + return (_getBlocksByName$find = getBlocksByName('core/group').find(clientId => getBlockAttributes(clientId)?.tagName === 'main')) !== null && _getBlocksByName$find !== void 0 ? _getBlocksByName$find : ''; + } + return { + allowRightClickOverrides: get('core', 'allowRightClickOverrides'), + blockTypes: getBlockTypes(), + canUseUnfilteredHTML: getRawEntityRecord('postType', postType, postId)?._links?.hasOwnProperty('wp:action-unfiltered-html'), + focusMode: get('core', 'focusMode'), + hasFixedToolbar: get('core', 'fixedToolbar') || !isLargeViewport, + hiddenBlockTypes: get('core', 'hiddenBlockTypes'), + isDistractionFree: get('core', 'distractionFree'), + keepCaretInsideBlock: get('core', 'keepCaretInsideBlock'), + hasUploadPermissions: (_canUser = canUser('create', { + kind: 'root', + name: 'media' + })) !== null && _canUser !== void 0 ? _canUser : true, + userCanCreatePages: canUser('create', { + kind: 'postType', + name: 'page' + }), + pageOnFront: siteSettings?.page_on_front, + pageForPosts: siteSettings?.page_for_posts, + userPatternCategories: getUserPatternCategories(), + restBlockPatternCategories: getBlockPatternCategories(), + sectionRootClientId: getSectionRootBlock() + }; + }, [postType, postId, isLargeViewport, renderingMode]); + const { + merged: mergedGlobalStyles + } = useGlobalStylesContext(); + const globalStylesData = (_mergedGlobalStyles$s = mergedGlobalStyles.styles) !== null && _mergedGlobalStyles$s !== void 0 ? _mergedGlobalStyles$s : use_block_editor_settings_EMPTY_OBJECT; + const globalStylesLinksData = (_mergedGlobalStyles$_ = mergedGlobalStyles._links) !== null && _mergedGlobalStyles$_ !== void 0 ? _mergedGlobalStyles$_ : use_block_editor_settings_EMPTY_OBJECT; + const settingsBlockPatterns = (_settings$__experimen = settings.__experimentalAdditionalBlockPatterns) !== null && _settings$__experimen !== void 0 ? _settings$__experimen : + // WP 6.0 + settings.__experimentalBlockPatterns; // WP 5.9 + const settingsBlockPatternCategories = (_settings$__experimen2 = settings.__experimentalAdditionalBlockPatternCategories) !== null && _settings$__experimen2 !== void 0 ? _settings$__experimen2 : + // WP 6.0 + settings.__experimentalBlockPatternCategories; // WP 5.9 + + const blockPatterns = (0,external_wp_element_namespaceObject.useMemo)(() => [...(settingsBlockPatterns || [])].filter(({ + postTypes + }) => { + return !postTypes || Array.isArray(postTypes) && postTypes.includes(postType); + }), [settingsBlockPatterns, postType]); + const blockPatternCategories = (0,external_wp_element_namespaceObject.useMemo)(() => [...(settingsBlockPatternCategories || []), ...(restBlockPatternCategories || [])].filter((x, index, arr) => index === arr.findIndex(y => x.name === y.name)), [settingsBlockPatternCategories, restBlockPatternCategories]); + const { + undo, + setIsInserterOpened + } = (0,external_wp_data_namespaceObject.useDispatch)(store_store); + const { + saveEntityRecord + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); + + /** + * Creates a Post entity. + * This is utilised by the Link UI to allow for on-the-fly creation of Posts/Pages. + * + * @param {Object} options parameters for the post being created. These mirror those used on 3rd param of saveEntityRecord. + * @return {Object} the post type object that was created. + */ + const createPageEntity = (0,external_wp_element_namespaceObject.useCallback)(options => { + if (!userCanCreatePages) { + return Promise.reject({ + message: (0,external_wp_i18n_namespaceObject.__)('You do not have permission to create Pages.') + }); + } + return saveEntityRecord('postType', 'page', options); + }, [saveEntityRecord, userCanCreatePages]); + const allowedBlockTypes = (0,external_wp_element_namespaceObject.useMemo)(() => { + // Omit hidden block types if exists and non-empty. + if (hiddenBlockTypes && hiddenBlockTypes.length > 0) { + // Defer to passed setting for `allowedBlockTypes` if provided as + // anything other than `true` (where `true` is equivalent to allow + // all block types). + const defaultAllowedBlockTypes = true === settings.allowedBlockTypes ? blockTypes.map(({ + name + }) => name) : settings.allowedBlockTypes || []; + return defaultAllowedBlockTypes.filter(type => !hiddenBlockTypes.includes(type)); + } + return settings.allowedBlockTypes; + }, [settings.allowedBlockTypes, hiddenBlockTypes, blockTypes]); + const forceDisableFocusMode = settings.focusMode === false; + return (0,external_wp_element_namespaceObject.useMemo)(() => { + const blockEditorSettings = { + ...Object.fromEntries(Object.entries(settings).filter(([key]) => BLOCK_EDITOR_SETTINGS.includes(key))), + [globalStylesDataKey]: globalStylesData, + [globalStylesLinksDataKey]: globalStylesLinksData, + allowedBlockTypes, + allowRightClickOverrides, + focusMode: focusMode && !forceDisableFocusMode, + hasFixedToolbar, + isDistractionFree, + keepCaretInsideBlock, + mediaUpload: hasUploadPermissions ? mediaUpload : undefined, + mediaSideload: hasUploadPermissions ? media_sideload : undefined, + __experimentalBlockPatterns: blockPatterns, + [selectBlockPatternsKey]: select => { + const { + hasFinishedResolution, + getBlockPatternsForPostType + } = unlock(select(external_wp_coreData_namespaceObject.store)); + const patterns = getBlockPatternsForPostType(postType); + return hasFinishedResolution('getBlockPatterns') ? patterns : undefined; + }, + [reusableBlocksSelectKey]: __experimentalReusableBlocksSelect, + __experimentalBlockPatternCategories: blockPatternCategories, + __experimentalUserPatternCategories: userPatternCategories, + __experimentalFetchLinkSuggestions: (search, searchOptions) => (0,external_wp_coreData_namespaceObject.__experimentalFetchLinkSuggestions)(search, searchOptions, settings), + inserterMediaCategories: media_categories, + __experimentalFetchRichUrlData: external_wp_coreData_namespaceObject.__experimentalFetchUrlData, + // Todo: This only checks the top level post, not the post within a template or any other entity that can be edited. + // This might be better as a generic "canUser" selector. + __experimentalCanUserUseUnfilteredHTML: canUseUnfilteredHTML, + //Todo: this is only needed for native and should probably be removed. + __experimentalUndo: undo, + // Check whether we want all site editor frames to have outlines + // including the navigation / pattern / parts editors. + outlineMode: !isDistractionFree && postType === 'wp_template', + // Check these two properties: they were not present in the site editor. + __experimentalCreatePageEntity: createPageEntity, + __experimentalUserCanCreatePages: userCanCreatePages, + pageOnFront, + pageForPosts, + __experimentalPreferPatternsOnRoot: postType === 'wp_template', + templateLock: postType === 'wp_navigation' ? 'insert' : settings.templateLock, + template: postType === 'wp_navigation' ? [['core/navigation', {}, []]] : settings.template, + __experimentalSetIsInserterOpened: setIsInserterOpened, + [sectionRootClientIdKey]: sectionRootClientId, + editorTool: renderingMode === 'post-only' && postType !== 'wp_template' ? 'edit' : undefined + }; + return blockEditorSettings; + }, [allowedBlockTypes, allowRightClickOverrides, focusMode, forceDisableFocusMode, hasFixedToolbar, isDistractionFree, keepCaretInsideBlock, settings, hasUploadPermissions, userPatternCategories, blockPatterns, blockPatternCategories, canUseUnfilteredHTML, undo, createPageEntity, userCanCreatePages, pageOnFront, pageForPosts, postType, setIsInserterOpened, sectionRootClientId, globalStylesData, globalStylesLinksData, renderingMode]); +} +/* harmony default export */ const use_block_editor_settings = (useBlockEditorSettings); + +;// ./node_modules/@wordpress/editor/build-module/components/provider/use-post-content-blocks.js +/** + * WordPress dependencies + */ + + + + +/** + * Internal dependencies + */ + + +const POST_CONTENT_BLOCK_TYPES = ['core/post-title', 'core/post-featured-image', 'core/post-content']; +function usePostContentBlocks() { + const contentOnlyBlockTypes = (0,external_wp_element_namespaceObject.useMemo)(() => [...(0,external_wp_hooks_namespaceObject.applyFilters)('editor.postContentBlockTypes', POST_CONTENT_BLOCK_TYPES)], []); + + // Note that there are two separate subscriptions because the result for each + // returns a new array. + const contentOnlyIds = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getPostBlocksByName + } = unlock(select(store_store)); + return getPostBlocksByName(contentOnlyBlockTypes); + }, [contentOnlyBlockTypes]); + return contentOnlyIds; +} + +;// ./node_modules/@wordpress/editor/build-module/components/provider/disable-non-page-content-blocks.js +/* wp:polyfill */ +/** + * WordPress dependencies + */ + + + + +/** + * Internal dependencies + */ + + +/** + * Component that when rendered, makes it so that the site editor allows only + * page content to be edited. + */ +function DisableNonPageContentBlocks() { + const contentOnlyIds = usePostContentBlocks(); + const { + templateParts, + isNavigationMode + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getBlocksByName, + isNavigationMode: _isNavigationMode + } = select(external_wp_blockEditor_namespaceObject.store); + return { + templateParts: getBlocksByName('core/template-part'), + isNavigationMode: _isNavigationMode() + }; + }, []); + const disabledIds = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getBlockOrder + } = select(external_wp_blockEditor_namespaceObject.store); + return templateParts.flatMap(clientId => getBlockOrder(clientId)); + }, [templateParts]); + const registry = (0,external_wp_data_namespaceObject.useRegistry)(); + + // The code here is split into multiple `useEffects` calls. + // This is done to avoid setting/unsetting block editing modes multiple times unnecessarily. + // + // For example, the block editing mode of the root block (clientId: '') only + // needs to be set once, not when `contentOnlyIds` or `disabledIds` change. + // + // It's also unlikely that these different types of blocks are being inserted + // or removed at the same time, so using different effects reflects that. + (0,external_wp_element_namespaceObject.useEffect)(() => { + const { + setBlockEditingMode, + unsetBlockEditingMode + } = registry.dispatch(external_wp_blockEditor_namespaceObject.store); + setBlockEditingMode('', 'disabled'); + return () => { + unsetBlockEditingMode(''); + }; + }, [registry]); + (0,external_wp_element_namespaceObject.useEffect)(() => { + const { + setBlockEditingMode, + unsetBlockEditingMode + } = registry.dispatch(external_wp_blockEditor_namespaceObject.store); + registry.batch(() => { + for (const clientId of contentOnlyIds) { + setBlockEditingMode(clientId, 'contentOnly'); + } + }); + return () => { + registry.batch(() => { + for (const clientId of contentOnlyIds) { + unsetBlockEditingMode(clientId); + } + }); + }; + }, [contentOnlyIds, registry]); + (0,external_wp_element_namespaceObject.useEffect)(() => { + const { + setBlockEditingMode, + unsetBlockEditingMode + } = registry.dispatch(external_wp_blockEditor_namespaceObject.store); + registry.batch(() => { + if (!isNavigationMode) { + for (const clientId of templateParts) { + setBlockEditingMode(clientId, 'contentOnly'); } } - if (errorMessages.size === 0) { - errorMessage = (0,external_wp_i18n_namespaceObject.__)('An error occurred while deleting the items.'); - } else if (errorMessages.size === 1) { - errorMessage = isResetting ? (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: an error message */ - (0,external_wp_i18n_namespaceObject.__)('An error occurred while reverting the items: %s'), [...errorMessages][0]) : (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: an error message */ - (0,external_wp_i18n_namespaceObject.__)('An error occurred while deleting the items: %s'), [...errorMessages][0]); - } else { - errorMessage = isResetting ? (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: a list of comma separated error messages */ - (0,external_wp_i18n_namespaceObject.__)('Some errors occurred while reverting the items: %s'), [...errorMessages].join(',')) : (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: a list of comma separated error messages */ - (0,external_wp_i18n_namespaceObject.__)('Some errors occurred while deleting the items: %s'), [...errorMessages].join(',')); - } - } - registry.dispatch(external_wp_notices_namespaceObject.store).createErrorNotice(errorMessage, { - type: 'snackbar' }); - } -}; + return () => { + registry.batch(() => { + if (!isNavigationMode) { + for (const clientId of templateParts) { + unsetBlockEditingMode(clientId); + } + } + }); + }; + }, [templateParts, isNavigationMode, registry]); + (0,external_wp_element_namespaceObject.useEffect)(() => { + const { + setBlockEditingMode, + unsetBlockEditingMode + } = registry.dispatch(external_wp_blockEditor_namespaceObject.store); + registry.batch(() => { + for (const clientId of disabledIds) { + setBlockEditingMode(clientId, 'disabled'); + } + }); + return () => { + registry.batch(() => { + for (const clientId of disabledIds) { + unsetBlockEditingMode(clientId); + } + }); + }; + }, [disabledIds, registry]); + return null; +} + +;// ./node_modules/@wordpress/editor/build-module/components/provider/navigation-block-editing-mode.js +/** + * WordPress dependencies + */ + + + + +/** + * For the Navigation block editor, we need to force the block editor to contentOnly for that block. + * + * Set block editing mode to contentOnly when entering Navigation focus mode. + * this ensures that non-content controls on the block will be hidden and thus + * the user can focus on editing the Navigation Menu content only. + */ + +function NavigationBlockEditingMode() { + // In the navigation block editor, + // the navigation block is the only root block. + const blockClientId = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getBlockOrder()?.[0], []); + const { + setBlockEditingMode, + unsetBlockEditingMode + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); + (0,external_wp_element_namespaceObject.useEffect)(() => { + if (!blockClientId) { + return; + } + setBlockEditingMode(blockClientId, 'contentOnly'); + return () => { + unsetBlockEditingMode(blockClientId); + }; + }, [blockClientId, unsetBlockEditingMode, setBlockEditingMode]); +} + +;// ./node_modules/@wordpress/editor/build-module/components/provider/use-hide-blocks-from-inserter.js +/** + * WordPress dependencies + */ + + + +// These post types are "structural" block lists. +// We should be allowed to use +// the post content and template parts blocks within them. +const POST_TYPES_ALLOWING_POST_CONTENT_TEMPLATE_PART = ['wp_block', 'wp_template', 'wp_template_part']; + +/** + * In some specific contexts, + * the template part and post content blocks need to be hidden. + * + * @param {string} postType Post Type + * @param {string} mode Rendering mode + */ +function useHideBlocksFromInserter(postType, mode) { + (0,external_wp_element_namespaceObject.useEffect)(() => { + /* + * Prevent adding template part in the editor. + */ + (0,external_wp_hooks_namespaceObject.addFilter)('blockEditor.__unstableCanInsertBlockType', 'removeTemplatePartsFromInserter', (canInsert, blockType) => { + if (!POST_TYPES_ALLOWING_POST_CONTENT_TEMPLATE_PART.includes(postType) && blockType.name === 'core/template-part' && mode === 'post-only') { + return false; + } + return canInsert; + }); + + /* + * Prevent adding post content block (except in query block) in the editor. + */ + (0,external_wp_hooks_namespaceObject.addFilter)('blockEditor.__unstableCanInsertBlockType', 'removePostContentFromInserter', (canInsert, blockType, rootClientId, { + getBlockParentsByBlockName + }) => { + if (!POST_TYPES_ALLOWING_POST_CONTENT_TEMPLATE_PART.includes(postType) && blockType.name === 'core/post-content') { + return getBlockParentsByBlockName(rootClientId, 'core/query').length > 0; + } + return canInsert; + }); + return () => { + (0,external_wp_hooks_namespaceObject.removeFilter)('blockEditor.__unstableCanInsertBlockType', 'removeTemplatePartsFromInserter'); + (0,external_wp_hooks_namespaceObject.removeFilter)('blockEditor.__unstableCanInsertBlockType', 'removePostContentFromInserter'); + }; + }, [postType, mode]); +} + +;// ./node_modules/@wordpress/icons/build-module/library/keyboard.js +/** + * WordPress dependencies + */ + + +const keyboard = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "m16 15.5h-8v-1.5h8zm-7.5-2.5h-2v-2h2zm3 0h-2v-2h2zm3 0h-2v-2h2zm3 0h-2v-2h2zm-9-3h-2v-2h2zm3 0h-2v-2h2zm3 0h-2v-2h2zm3 0h-2v-2h2z" + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "m18.5 6.5h-13a.5.5 0 0 0 -.5.5v9.5a.5.5 0 0 0 .5.5h13a.5.5 0 0 0 .5-.5v-9.5a.5.5 0 0 0 -.5-.5zm-13-1.5h13a2 2 0 0 1 2 2v9.5a2 2 0 0 1 -2 2h-13a2 2 0 0 1 -2-2v-9.5a2 2 0 0 1 2-2z" + })] +}); +/* harmony default export */ const library_keyboard = (keyboard); + +;// ./node_modules/@wordpress/icons/build-module/library/list-view.js +/** + * WordPress dependencies + */ + + +const listView = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + viewBox: "0 0 24 24", + xmlns: "http://www.w3.org/2000/svg", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "M3 6h11v1.5H3V6Zm3.5 5.5h11V13h-11v-1.5ZM21 17H10v1.5h11V17Z" + }) +}); +/* harmony default export */ const list_view = (listView); + +;// ./node_modules/@wordpress/icons/build-module/library/code.js +/** + * WordPress dependencies + */ + + +const code = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + viewBox: "0 0 24 24", + xmlns: "http://www.w3.org/2000/svg", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "M20.8 10.7l-4.3-4.3-1.1 1.1 4.3 4.3c.1.1.1.3 0 .4l-4.3 4.3 1.1 1.1 4.3-4.3c.7-.8.7-1.9 0-2.6zM4.2 11.8l4.3-4.3-1-1-4.3 4.3c-.7.7-.7 1.8 0 2.5l4.3 4.3 1.1-1.1-4.3-4.3c-.2-.1-.2-.3-.1-.4z" + }) +}); +/* harmony default export */ const library_code = (code); + +;// ./node_modules/@wordpress/icons/build-module/library/drawer-left.js +/** + * WordPress dependencies + */ + + +const drawerLeft = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + width: "24", + height: "24", + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zM8.5 18.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h2.5v13zm10-.5c0 .3-.2.5-.5.5h-8v-13h8c.3 0 .5.2.5.5v12z" + }) +}); +/* harmony default export */ const drawer_left = (drawerLeft); + +;// ./node_modules/@wordpress/icons/build-module/library/drawer-right.js +/** + * WordPress dependencies + */ + + +const drawerRight = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + width: "24", + height: "24", + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4 14.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h8v13zm4.5-.5c0 .3-.2.5-.5.5h-2.5v-13H18c.3 0 .5.2.5.5v12z" + }) +}); +/* harmony default export */ const drawer_right = (drawerRight); + +;// ./node_modules/@wordpress/icons/build-module/library/block-default.js +/** + * WordPress dependencies + */ + + +const blockDefault = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z" + }) +}); +/* harmony default export */ const block_default = (blockDefault); + +;// ./node_modules/@wordpress/icons/build-module/library/format-list-bullets.js +/** + * WordPress dependencies + */ + + +const formatListBullets = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "M11.1 15.8H20v-1.5h-8.9v1.5zm0-8.6v1.5H20V7.2h-8.9zM6 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-7c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z" + }) +}); +/* harmony default export */ const format_list_bullets = (formatListBullets); + +;// ./node_modules/@wordpress/icons/build-module/library/pencil.js +/** + * WordPress dependencies + */ + + +const pencil = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "m19 7-3-3-8.5 8.5-1 4 4-1L19 7Zm-7 11.5H5V20h7v-1.5Z" + }) +}); +/* harmony default export */ const library_pencil = (pencil); + +;// ./node_modules/@wordpress/icons/build-module/library/edit.js +/** + * Internal dependencies + */ + + +/* harmony default export */ const library_edit = (library_pencil); -// EXTERNAL MODULE: ./node_modules/fast-deep-equal/index.js -var fast_deep_equal = __webpack_require__(5215); -var fast_deep_equal_default = /*#__PURE__*/__webpack_require__.n(fast_deep_equal); ;// ./node_modules/@wordpress/icons/build-module/library/symbol.js /** * WordPress dependencies @@ -8266,28 +11655,12 @@ const symbol = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ext }); /* harmony default export */ const library_symbol = (symbol); -;// ./node_modules/@wordpress/icons/build-module/library/navigation.js -/** - * WordPress dependencies - */ - - -const navigation = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - viewBox: "0 0 24 24", - xmlns: "http://www.w3.org/2000/svg", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - d: "M12 4c-4.4 0-8 3.6-8 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8zm0 14.5c-3.6 0-6.5-2.9-6.5-6.5S8.4 5.5 12 5.5s6.5 2.9 6.5 6.5-2.9 6.5-6.5 6.5zM9 16l4.5-3L15 8.4l-4.5 3L9 16z" - }) -}); -/* harmony default export */ const library_navigation = (navigation); - ;// ./node_modules/@wordpress/icons/build-module/library/page.js /** * WordPress dependencies */ - const page = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", @@ -8299,505 +11672,38 @@ const page = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(exte }); /* harmony default export */ const library_page = (page); -;// ./node_modules/@wordpress/icons/build-module/library/verse.js +;// ./node_modules/@wordpress/icons/build-module/library/rotate-right.js /** * WordPress dependencies */ -const verse = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - viewBox: "0 0 24 24", +const rotateRight = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - d: "M17.8 2l-.9.3c-.1 0-3.6 1-5.2 2.1C10 5.5 9.3 6.5 8.9 7.1c-.6.9-1.7 4.7-1.7 6.3l-.9 2.3c-.2.4 0 .8.4 1 .1 0 .2.1.3.1.3 0 .6-.2.7-.5l.6-1.5c.3 0 .7-.1 1.2-.2.7-.1 1.4-.3 2.2-.5.8-.2 1.6-.5 2.4-.8.7-.3 1.4-.7 1.9-1.2s.8-1.2 1-1.9c.2-.7.3-1.6.4-2.4.1-.8.1-1.7.2-2.5 0-.8.1-1.5.2-2.1V2zm-1.9 5.6c-.1.8-.2 1.5-.3 2.1-.2.6-.4 1-.6 1.3-.3.3-.8.6-1.4.9-.7.3-1.4.5-2.2.8-.6.2-1.3.3-1.8.4L15 7.5c.3-.3.6-.7 1-1.1 0 .4 0 .8-.1 1.2zM6 20h8v-1.5H6V20z" + d: "M15.1 4.8l-3-2.5V4c-4.4 0-8 3.6-8 8 0 3.7 2.5 6.9 6 7.7.3.1.6.1 1 .2l.2-1.5c-.4 0-.7-.1-1.1-.2l-.1.2v-.2c-2.6-.8-4.5-3.3-4.5-6.2 0-3.6 2.9-6.5 6.5-6.5v1.8l3-2.5zM20 11c-.2-1.4-.7-2.7-1.6-3.8l-1.2.8c.7.9 1.1 2 1.3 3.1L20 11zm-1.5 1.8c-.1.5-.2 1.1-.4 1.6s-.5 1-.8 1.5l1.2.9c.4-.5.8-1.1 1-1.8s.5-1.3.5-2l-1.5-.2zm-5.6 5.6l.2 1.5c1.4-.2 2.7-.7 3.8-1.6l-.9-1.1c-.9.7-2 1.1-3.1 1.2z" }) }); -/* harmony default export */ const library_verse = (verse); - -;// ./node_modules/@wordpress/editor/build-module/dataviews/store/private-selectors.js -/** - * Internal dependencies - */ - -const EMPTY_ARRAY = []; -function getEntityActions(state, kind, name) { - var _state$actions$kind$n; - return (_state$actions$kind$n = state.actions[kind]?.[name]) !== null && _state$actions$kind$n !== void 0 ? _state$actions$kind$n : EMPTY_ARRAY; -} -function isEntityReady(state, kind, name) { - return state.isReady[kind]?.[name]; -} - -;// ./node_modules/@wordpress/editor/build-module/store/private-selectors.js -/** - * External dependencies - */ - +/* harmony default export */ const rotate_right = (rotateRight); +;// ./node_modules/@wordpress/icons/build-module/library/rotate-left.js /** * WordPress dependencies */ - - - -/** - * Internal dependencies - */ - - -const EMPTY_INSERTION_POINT = { - rootClientId: undefined, - insertionIndex: undefined, - filterValue: undefined -}; - -/** - * Get the insertion point for the inserter. - * - * @param {Object} state Global application state. - * - * @return {Object} The root client ID, index to insert at and starting filter value. - */ -const getInsertionPoint = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (0,external_wp_data_namespaceObject.createSelector)(state => { - if (typeof state.blockInserterPanel === 'object') { - return state.blockInserterPanel; - } - if (getRenderingMode(state) === 'template-locked') { - const [postContentClientId] = select(external_wp_blockEditor_namespaceObject.store).getBlocksByName('core/post-content'); - if (postContentClientId) { - return { - rootClientId: postContentClientId, - insertionIndex: undefined, - filterValue: undefined - }; - } - } - return EMPTY_INSERTION_POINT; -}, state => { - const [postContentClientId] = select(external_wp_blockEditor_namespaceObject.store).getBlocksByName('core/post-content'); - return [state.blockInserterPanel, getRenderingMode(state), postContentClientId]; -})); -function getListViewToggleRef(state) { - return state.listViewToggleRef; -} -function getInserterSidebarToggleRef(state) { - return state.inserterSidebarToggleRef; -} -const CARD_ICONS = { - wp_block: library_symbol, - wp_navigation: library_navigation, - page: library_page, - post: library_verse -}; -const getPostIcon = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, postType, options) => { - { - if (postType === 'wp_template_part' || postType === 'wp_template') { - return __experimentalGetDefaultTemplatePartAreas(state).find(item => options.area === item.area)?.icon || library_layout; - } - if (CARD_ICONS[postType]) { - return CARD_ICONS[postType]; - } - const postTypeEntity = select(external_wp_coreData_namespaceObject.store).getPostType(postType); - // `icon` is the `menu_icon` property of a post type. We - // only handle `dashicons` for now, even if the `menu_icon` - // also supports urls and svg as values. - if (typeof postTypeEntity?.icon === 'string' && postTypeEntity.icon.startsWith('dashicons-')) { - return postTypeEntity.icon.slice(10); - } - return library_page; - } +const rotateLeft = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "M12 4V2.2L9 4.8l3 2.5V5.5c3.6 0 6.5 2.9 6.5 6.5 0 2.9-1.9 5.3-4.5 6.2v.2l-.1-.2c-.4.1-.7.2-1.1.2l.2 1.5c.3 0 .6-.1 1-.2 3.5-.9 6-4 6-7.7 0-4.4-3.6-8-8-8zm-7.9 7l1.5.2c.1-1.2.5-2.3 1.2-3.2l-1.1-.9C4.8 8.2 4.3 9.6 4.1 11zm1.5 1.8l-1.5.2c.1.7.3 1.4.5 2 .3.7.6 1.3 1 1.8l1.2-.8c-.3-.5-.6-1-.8-1.5s-.4-1.1-.4-1.7zm1.5 5.5c1.1.9 2.4 1.4 3.8 1.6l.2-1.5c-1.1-.1-2.2-.5-3.1-1.2l-.9 1.1z" + }) }); +/* harmony default export */ const rotate_left = (rotateLeft); -/** - * Returns true if there are unsaved changes to the - * post's meta fields, and false otherwise. - * - * @param {Object} state Global application state. - * @param {string} postType The post type of the post. - * @param {number} postId The ID of the post. - * - * @return {boolean} Whether there are edits or not in the meta fields of the relevant post. - */ -const hasPostMetaChanges = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, postType, postId) => { - const { - type: currentPostType, - id: currentPostId - } = getCurrentPost(state); - // If no postType or postId is passed, use the current post. - const edits = select(external_wp_coreData_namespaceObject.store).getEntityRecordNonTransientEdits('postType', postType || currentPostType, postId || currentPostId); - if (!edits?.meta) { - return false; - } - - // Compare if anything apart from `footnotes` has changed. - const originalPostMeta = select(external_wp_coreData_namespaceObject.store).getEntityRecord('postType', postType || currentPostType, postId || currentPostId)?.meta; - return !fast_deep_equal_default()({ - ...originalPostMeta, - footnotes: undefined - }, { - ...edits.meta, - footnotes: undefined - }); -}); -function private_selectors_getEntityActions(state, ...args) { - return getEntityActions(state.dataviews, ...args); -} -function private_selectors_isEntityReady(state, ...args) { - return isEntityReady(state.dataviews, ...args); -} - -/** - * Similar to getBlocksByName in @wordpress/block-editor, but only returns the top-most - * blocks that aren't descendants of the query block. - * - * @param {Object} state Global application state. - * @param {Array|string} blockNames Block names of the blocks to retrieve. - * - * @return {Array} Block client IDs. - */ -const getPostBlocksByName = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (0,external_wp_data_namespaceObject.createSelector)((state, blockNames) => { - blockNames = Array.isArray(blockNames) ? blockNames : [blockNames]; - const { - getBlocksByName, - getBlockParents, - getBlockName - } = select(external_wp_blockEditor_namespaceObject.store); - return getBlocksByName(blockNames).filter(clientId => getBlockParents(clientId).every(parentClientId => { - const parentBlockName = getBlockName(parentClientId); - return ( - // Ignore descendents of the query block. - parentBlockName !== 'core/query' && - // Enable only the top-most block. - !blockNames.includes(parentBlockName) - ); - })); -}, () => [select(external_wp_blockEditor_namespaceObject.store).getBlocks()])); - -;// ./node_modules/@wordpress/editor/build-module/store/index.js -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - - - - - - - - -/** - * Post editor data store configuration. - * - * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#registerStore - * - * @type {Object} - */ -const storeConfig = { - reducer: store_reducer, - selectors: selectors_namespaceObject, - actions: actions_namespaceObject -}; - -/** - * Store definition for the editor namespace. - * - * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore - * - * @type {Object} - */ -const store_store = (0,external_wp_data_namespaceObject.createReduxStore)(STORE_NAME, { - ...storeConfig -}); -(0,external_wp_data_namespaceObject.register)(store_store); -unlock(store_store).registerPrivateActions(store_private_actions_namespaceObject); -unlock(store_store).registerPrivateSelectors(store_private_selectors_namespaceObject); - -;// ./node_modules/@wordpress/editor/build-module/hooks/custom-sources-backwards-compatibility.js -/** - * WordPress dependencies - */ - - - - - - -/** - * Internal dependencies - */ - - -/** @typedef {import('@wordpress/compose').WPHigherOrderComponent} WPHigherOrderComponent */ -/** @typedef {import('@wordpress/blocks').WPBlockSettings} WPBlockSettings */ - -/** - * Object whose keys are the names of block attributes, where each value - * represents the meta key to which the block attribute is intended to save. - * - * @see https://developer.wordpress.org/reference/functions/register_meta/ - * - * @typedef {Object} WPMetaAttributeMapping - */ - -/** - * Given a mapping of attribute names (meta source attributes) to their - * associated meta key, returns a higher order component that overrides its - * `attributes` and `setAttributes` props to sync any changes with the edited - * post's meta keys. - * - * @param {WPMetaAttributeMapping} metaAttributes Meta attribute mapping. - * - * @return {WPHigherOrderComponent} Higher-order component. - */ - -const createWithMetaAttributeSource = metaAttributes => (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(BlockEdit => ({ - attributes, - setAttributes, - ...props -}) => { - const postType = (0,external_wp_data_namespaceObject.useSelect)(select => select(store_store).getCurrentPostType(), []); - const [meta, setMeta] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'meta'); - const mergedAttributes = (0,external_wp_element_namespaceObject.useMemo)(() => ({ - ...attributes, - ...Object.fromEntries(Object.entries(metaAttributes).map(([attributeKey, metaKey]) => [attributeKey, meta[metaKey]])) - }), [attributes, meta]); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockEdit, { - attributes: mergedAttributes, - setAttributes: nextAttributes => { - const nextMeta = Object.fromEntries(Object.entries(nextAttributes !== null && nextAttributes !== void 0 ? nextAttributes : {}).filter( - // Filter to intersection of keys between the updated - // attributes and those with an associated meta key. - ([key]) => key in metaAttributes).map(([attributeKey, value]) => [ - // Rename the keys to the expected meta key name. - metaAttributes[attributeKey], value])); - if (Object.entries(nextMeta).length) { - setMeta(nextMeta); - } - setAttributes(nextAttributes); - }, - ...props - }); -}, 'withMetaAttributeSource'); - -/** - * Filters a registered block's settings to enhance a block's `edit` component - * to upgrade meta-sourced attributes to use the post's meta entity property. - * - * @param {WPBlockSettings} settings Registered block settings. - * - * @return {WPBlockSettings} Filtered block settings. - */ -function shimAttributeSource(settings) { - var _settings$attributes; - /** @type {WPMetaAttributeMapping} */ - const metaAttributes = Object.fromEntries(Object.entries((_settings$attributes = settings.attributes) !== null && _settings$attributes !== void 0 ? _settings$attributes : {}).filter(([, { - source - }]) => source === 'meta').map(([attributeKey, { - meta - }]) => [attributeKey, meta])); - if (Object.entries(metaAttributes).length) { - settings.edit = createWithMetaAttributeSource(metaAttributes)(settings.edit); - } - return settings; -} -(0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/editor/custom-sources-backwards-compatibility/shim-attribute-source', shimAttributeSource); - -;// ./node_modules/@wordpress/editor/build-module/components/autocompleters/user.js -/** - * WordPress dependencies - */ - - - - -/** @typedef {import('@wordpress/components').WPCompleter} WPCompleter */ - - - -function getUserLabel(user) { - const avatar = user.avatar_urls && user.avatar_urls[24] ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { - className: "editor-autocompleters__user-avatar", - alt: "", - src: user.avatar_urls[24] - }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { - className: "editor-autocompleters__no-avatar" - }); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: [avatar, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { - className: "editor-autocompleters__user-name", - children: user.name - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { - className: "editor-autocompleters__user-slug", - children: user.slug - })] - }); -} - -/** - * A user mentions completer. - * - * @type {WPCompleter} - */ -/* harmony default export */ const user = ({ - name: 'users', - className: 'editor-autocompleters__user', - triggerPrefix: '@', - useItems(filterValue) { - const users = (0,external_wp_data_namespaceObject.useSelect)(select => { - const { - getUsers - } = select(external_wp_coreData_namespaceObject.store); - return getUsers({ - context: 'view', - search: encodeURIComponent(filterValue) - }); - }, [filterValue]); - const options = (0,external_wp_element_namespaceObject.useMemo)(() => users ? users.map(user => ({ - key: `user-${user.slug}`, - value: user, - label: getUserLabel(user) - })) : [], [users]); - return [options]; - }, - getOptionCompletion(user) { - return `@${user.slug}`; - } -}); - -;// ./node_modules/@wordpress/editor/build-module/hooks/default-autocompleters.js -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - -function setDefaultCompleters(completers = []) { - // Provide copies so filters may directly modify them. - completers.push({ - ...user - }); - return completers; -} -(0,external_wp_hooks_namespaceObject.addFilter)('editor.Autocomplete.completers', 'editor/autocompleters/set-default-completers', setDefaultCompleters); - -;// external ["wp","mediaUtils"] -const external_wp_mediaUtils_namespaceObject = window["wp"]["mediaUtils"]; -;// ./node_modules/@wordpress/editor/build-module/hooks/media-upload.js -/** - * WordPress dependencies - */ - - -(0,external_wp_hooks_namespaceObject.addFilter)('editor.MediaUpload', 'core/editor/components/media-upload', () => external_wp_mediaUtils_namespaceObject.MediaUpload); - -;// ./node_modules/@wordpress/editor/build-module/hooks/pattern-overrides.js -/** - * WordPress dependencies - */ - - - - - - - -/** - * Internal dependencies - */ - - - -/** @typedef {import('@wordpress/blocks').WPBlockSettings} WPBlockSettings */ - - - -const { - PatternOverridesControls, - ResetOverridesControl, - PatternOverridesBlockControls, - PATTERN_TYPES: pattern_overrides_PATTERN_TYPES, - PARTIAL_SYNCING_SUPPORTED_BLOCKS, - PATTERN_SYNC_TYPES -} = unlock(external_wp_patterns_namespaceObject.privateApis); - -/** - * Override the default edit UI to include a new block inspector control for - * assigning a partial syncing controls to supported blocks in the pattern editor. - * Currently, only the `core/paragraph` block is supported. - * - * @param {Component} BlockEdit Original component. - * - * @return {Component} Wrapped component. - */ -const withPatternOverrideControls = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(BlockEdit => props => { - const isSupportedBlock = !!PARTIAL_SYNCING_SUPPORTED_BLOCKS[props.name]; - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockEdit, { - ...props - }, "edit"), props.isSelected && isSupportedBlock && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ControlsWithStoreSubscription, { - ...props - }), isSupportedBlock && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PatternOverridesBlockControls, {})] - }); -}, 'withPatternOverrideControls'); - -// Split into a separate component to avoid a store subscription -// on every block. -function ControlsWithStoreSubscription(props) { - const blockEditingMode = (0,external_wp_blockEditor_namespaceObject.useBlockEditingMode)(); - const { - hasPatternOverridesSource, - isEditingSyncedPattern - } = (0,external_wp_data_namespaceObject.useSelect)(select => { - const { - getCurrentPostType, - getEditedPostAttribute - } = select(store_store); - return { - // For editing link to the site editor if the theme and user permissions support it. - hasPatternOverridesSource: !!(0,external_wp_blocks_namespaceObject.getBlockBindingsSource)('core/pattern-overrides'), - isEditingSyncedPattern: getCurrentPostType() === pattern_overrides_PATTERN_TYPES.user && getEditedPostAttribute('meta')?.wp_pattern_sync_status !== PATTERN_SYNC_TYPES.unsynced && getEditedPostAttribute('wp_pattern_sync_status') !== PATTERN_SYNC_TYPES.unsynced - }; - }, []); - const bindings = props.attributes.metadata?.bindings; - const hasPatternBindings = !!bindings && Object.values(bindings).some(binding => binding.source === 'core/pattern-overrides'); - const shouldShowPatternOverridesControls = isEditingSyncedPattern && blockEditingMode === 'default'; - const shouldShowResetOverridesControl = !isEditingSyncedPattern && !!props.attributes.metadata?.name && blockEditingMode !== 'disabled' && hasPatternBindings; - if (!hasPatternOverridesSource) { - return null; - } - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: [shouldShowPatternOverridesControls && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PatternOverridesControls, { - ...props - }), shouldShowResetOverridesControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ResetOverridesControl, { - ...props - })] - }); -} -(0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockEdit', 'core/editor/with-pattern-override-controls', withPatternOverrideControls); - -;// ./node_modules/@wordpress/editor/build-module/hooks/index.js -/** - * Internal dependencies - */ - - - - - -;// external ["wp","keyboardShortcuts"] -const external_wp_keyboardShortcuts_namespaceObject = window["wp"]["keyboardShortcuts"]; -;// ./node_modules/clsx/dist/clsx.mjs -function clsx_r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t { - return { - icon: ownProps.icon || context.icon, - identifier: ownProps.identifier || `${context.name}/${ownProps.name}` - }; -})); - ;// ./node_modules/@wordpress/interface/build-module/components/complementary-area-toggle/index.js /** * WordPress dependencies @@ -9286,18 +12180,18 @@ const external_wp_plugins_namespaceObject = window["wp"]["plugins"]; + /** * Internal dependencies */ - /** * Whether the role supports checked state. * + * @see https://www.w3.org/TR/wai-aria-1.1/#aria-checked * @param {import('react').AriaRole} role Role. * @return {boolean} Whether the role supports checked state. - * @see https://www.w3.org/TR/wai-aria-1.1/#aria-checked */ function roleSupportsCheckedState(role) { @@ -9306,14 +12200,17 @@ function roleSupportsCheckedState(role) { function ComplementaryAreaToggle({ as = external_wp_components_namespaceObject.Button, scope, - identifier, - icon, + identifier: identifierProp, + icon: iconProp, selectedIcon, name, shortcut, ...props }) { const ComponentToUse = as; + const context = (0,external_wp_plugins_namespaceObject.usePluginContext)(); + const icon = iconProp || context.icon; + const identifier = identifierProp || `${context.name}/${name}`; const isSelected = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).getActiveComplementaryArea(scope) === identifier, [identifier, scope]); const { enableComplementaryArea, @@ -9336,7 +12233,6 @@ function ComplementaryAreaToggle({ ...props }); } -/* harmony default export */ const complementary_area_toggle = (complementary_area_context(ComplementaryAreaToggle)); ;// ./node_modules/@wordpress/interface/build-module/components/complementary-area-header/index.js /** @@ -9354,45 +12250,35 @@ function ComplementaryAreaToggle({ */ - - const ComplementaryAreaHeader = ({ - smallScreenTitle, children, className, toggleButtonProps }) => { - const toggleButton = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(complementary_area_toggle, { + const toggleButton = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ComplementaryAreaToggle, { icon: close_small, ...toggleButtonProps }); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { - className: "components-panel__header interface-complementary-area-header__small", - children: [smallScreenTitle && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h2", { - className: "interface-complementary-area-header__small-title", - children: smallScreenTitle - }), toggleButton] - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { - className: dist_clsx('components-panel__header', 'interface-complementary-area-header', className), - tabIndex: -1, - children: [children, toggleButton] - })] + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { + className: dist_clsx('components-panel__header', 'interface-complementary-area-header', className), + tabIndex: -1, + children: [children, toggleButton] }); }; /* harmony default export */ const complementary_area_header = (ComplementaryAreaHeader); ;// ./node_modules/@wordpress/interface/build-module/components/action-item/index.js +/* wp:polyfill */ /** * WordPress dependencies */ -const noop = () => {}; +const action_item_noop = () => {}; function ActionItemSlot({ name, - as: Component = external_wp_components_namespaceObject.ButtonGroup, + as: Component = external_wp_components_namespaceObject.MenuGroup, fillProps = {}, bubblesVirtually, ...props @@ -9448,8 +12334,8 @@ function ActionItem({ }) => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Component, { onClick: onClick || fpOnClick ? (...args) => { - (onClick || noop)(...args); - (fpOnClick || noop)(...args); + (onClick || action_item_noop)(...args); + (fpOnClick || action_item_noop)(...args); } : undefined, ...props }); @@ -9488,7 +12374,7 @@ function ComplementaryAreaMoreMenuItem({ __unstableExplicitMenuItem, ...props }) { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(complementary_area_toggle, { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ComplementaryAreaToggle, { as: toggleProps => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(action_item, { __unstableExplicitMenuItem: __unstableExplicitMenuItem, @@ -9561,6 +12447,7 @@ PinnedItems.Slot = PinnedItemsSlot; + /** * Internal dependencies */ @@ -9570,9 +12457,6 @@ PinnedItems.Slot = PinnedItemsSlot; - - - const ANIMATION_DURATION = 0.3; function ComplementaryAreaSlot({ scope, @@ -9683,19 +12567,22 @@ function ComplementaryArea({ children, className, closeLabel = (0,external_wp_i18n_namespaceObject.__)('Close plugin'), - identifier, + identifier: identifierProp, header, headerClassName, - icon, + icon: iconProp, isPinnable = true, panelClassName, scope, name, - smallScreenTitle, title, toggleShortcut, isActiveByDefault }) { + const context = (0,external_wp_plugins_namespaceObject.usePluginContext)(); + const icon = iconProp || context.icon; + const identifier = identifierProp || `${context.name}/${name}`; + // This state is used to delay the rendering of the Fill // until the initial effect runs. // This prevents the animation from running on mount if @@ -9729,6 +12616,7 @@ function ComplementaryArea({ showIconLabels: get('core', 'showIconLabels') }; }, [identifier, scope]); + const isMobileViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<'); useAdjustComplementaryListener(scope, identifier, activeArea, isActive, isSmall); const { enableComplementaryArea, @@ -9752,7 +12640,7 @@ function ComplementaryArea({ return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [isPinnable && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(pinned_items, { scope: scope, - children: isPinned && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(complementary_area_toggle, { + children: isPinned && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ComplementaryAreaToggle, { scope: scope, identifier: identifier, isPressed: isActive && (!showIconLabels || isLarge), @@ -9780,10 +12668,9 @@ function ComplementaryArea({ className: headerClassName, closeLabel: closeLabel, onClose: () => disableComplementaryArea(scope), - smallScreenTitle: smallScreenTitle, toggleButtonProps: { label: closeLabel, - size: 'small', + size: 'compact', shortcut: toggleShortcut, scope, identifier @@ -9792,7 +12679,7 @@ function ComplementaryArea({ children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h2", { className: "interface-complementary-area-header__title", children: title - }), isPinnable && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + }), isPinnable && !isMobileViewport && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { className: "interface-complementary-area__pin-unpin-item", icon: isPinned ? star_filled : star_empty, label: isPinned ? (0,external_wp_i18n_namespaceObject.__)('Unpin from toolbar') : (0,external_wp_i18n_namespaceObject.__)('Pin to toolbar'), @@ -9809,9 +12696,8 @@ function ComplementaryArea({ })] }); } -const ComplementaryAreaWrapped = complementary_area_context(ComplementaryArea); -ComplementaryAreaWrapped.Slot = ComplementaryAreaSlot; -/* harmony default export */ const complementary_area = (ComplementaryAreaWrapped); +ComplementaryArea.Slot = ComplementaryAreaSlot; +/* harmony default export */ const complementary_area = (ComplementaryArea); ;// ./node_modules/@wordpress/interface/build-module/components/fullscreen-mode/index.js /** @@ -9903,7 +12789,6 @@ NavigableRegion.displayName = 'NavigableRegion'; */ - const interface_skeleton_ANIMATION_DURATION = 0.25; const commonTransition = { type: 'tween', @@ -10090,6 +12975,1330 @@ function InterfaceSkeleton({ +;// ./node_modules/@wordpress/editor/build-module/components/pattern-rename-modal/index.js +/** + * WordPress dependencies + */ + + + + + +/** + * Internal dependencies + */ + + + + +const { + RenamePatternModal +} = unlock(external_wp_patterns_namespaceObject.privateApis); +const modalName = 'editor/pattern-rename'; +function PatternRenameModal() { + const { + record, + postType + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getCurrentPostType, + getCurrentPostId + } = select(store_store); + const { + getEditedEntityRecord + } = select(external_wp_coreData_namespaceObject.store); + const _postType = getCurrentPostType(); + return { + record: getEditedEntityRecord('postType', _postType, getCurrentPostId()), + postType: _postType + }; + }, []); + const { + closeModal + } = (0,external_wp_data_namespaceObject.useDispatch)(store); + const isActive = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).isModalActive(modalName)); + if (!isActive || postType !== PATTERN_POST_TYPE) { + return null; + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(RenamePatternModal, { + onClose: closeModal, + pattern: record + }); +} + +;// ./node_modules/@wordpress/editor/build-module/components/pattern-duplicate-modal/index.js +/** + * WordPress dependencies + */ + + + + + +/** + * Internal dependencies + */ + + + + +const { + DuplicatePatternModal +} = unlock(external_wp_patterns_namespaceObject.privateApis); +const pattern_duplicate_modal_modalName = 'editor/pattern-duplicate'; +function PatternDuplicateModal() { + const { + record, + postType + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getCurrentPostType, + getCurrentPostId + } = select(store_store); + const { + getEditedEntityRecord + } = select(external_wp_coreData_namespaceObject.store); + const _postType = getCurrentPostType(); + return { + record: getEditedEntityRecord('postType', _postType, getCurrentPostId()), + postType: _postType + }; + }, []); + const { + closeModal + } = (0,external_wp_data_namespaceObject.useDispatch)(store); + const isActive = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).isModalActive(pattern_duplicate_modal_modalName)); + if (!isActive || postType !== PATTERN_POST_TYPE) { + return null; + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DuplicatePatternModal, { + onClose: closeModal, + onSuccess: () => closeModal(), + pattern: record + }); +} + +;// ./node_modules/@wordpress/editor/build-module/components/commands/index.js +/** + * WordPress dependencies + */ + + + + + + + + + + + + +/** + * Internal dependencies + */ + + + + + + +const getEditorCommandLoader = () => function useEditorCommandLoader() { + const { + editorMode, + isListViewOpen, + showBlockBreadcrumbs, + isDistractionFree, + isFocusMode, + isPreviewMode, + isViewable, + isCodeEditingEnabled, + isRichEditingEnabled, + isPublishSidebarEnabled + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + var _get, _getPostType$viewable; + const { + get + } = select(external_wp_preferences_namespaceObject.store); + const { + isListViewOpened, + getCurrentPostType, + getEditorSettings + } = select(store_store); + const { + getSettings + } = select(external_wp_blockEditor_namespaceObject.store); + const { + getPostType + } = select(external_wp_coreData_namespaceObject.store); + return { + editorMode: (_get = get('core', 'editorMode')) !== null && _get !== void 0 ? _get : 'visual', + isListViewOpen: isListViewOpened(), + showBlockBreadcrumbs: get('core', 'showBlockBreadcrumbs'), + isDistractionFree: get('core', 'distractionFree'), + isFocusMode: get('core', 'focusMode'), + isPreviewMode: getSettings().isPreviewMode, + isViewable: (_getPostType$viewable = getPostType(getCurrentPostType())?.viewable) !== null && _getPostType$viewable !== void 0 ? _getPostType$viewable : false, + isCodeEditingEnabled: getEditorSettings().codeEditingEnabled, + isRichEditingEnabled: getEditorSettings().richEditingEnabled, + isPublishSidebarEnabled: select(store_store).isPublishSidebarEnabled() + }; + }, []); + const { + getActiveComplementaryArea + } = (0,external_wp_data_namespaceObject.useSelect)(store); + const { + toggle + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_preferences_namespaceObject.store); + const { + createInfoNotice + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); + const { + __unstableSaveForPreview, + setIsListViewOpened, + switchEditorMode, + toggleDistractionFree, + toggleSpotlightMode, + toggleTopToolbar + } = (0,external_wp_data_namespaceObject.useDispatch)(store_store); + const { + openModal, + enableComplementaryArea, + disableComplementaryArea + } = (0,external_wp_data_namespaceObject.useDispatch)(store); + const { + getCurrentPostId + } = (0,external_wp_data_namespaceObject.useSelect)(store_store); + const { + isBlockBasedTheme, + canCreateTemplate + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + return { + isBlockBasedTheme: select(external_wp_coreData_namespaceObject.store).getCurrentTheme()?.is_block_theme, + canCreateTemplate: select(external_wp_coreData_namespaceObject.store).canUser('create', { + kind: 'postType', + name: 'wp_template' + }) + }; + }, []); + const allowSwitchEditorMode = isCodeEditingEnabled && isRichEditingEnabled; + if (isPreviewMode) { + return { + commands: [], + isLoading: false + }; + } + const commands = []; + commands.push({ + name: 'core/open-shortcut-help', + label: (0,external_wp_i18n_namespaceObject.__)('Keyboard shortcuts'), + icon: library_keyboard, + callback: ({ + close + }) => { + close(); + openModal('editor/keyboard-shortcut-help'); + } + }); + commands.push({ + name: 'core/toggle-distraction-free', + label: isDistractionFree ? (0,external_wp_i18n_namespaceObject.__)('Exit Distraction free') : (0,external_wp_i18n_namespaceObject.__)('Enter Distraction free'), + callback: ({ + close + }) => { + toggleDistractionFree(); + close(); + } + }); + commands.push({ + name: 'core/open-preferences', + label: (0,external_wp_i18n_namespaceObject.__)('Editor preferences'), + callback: ({ + close + }) => { + close(); + openModal('editor/preferences'); + } + }); + commands.push({ + name: 'core/toggle-spotlight-mode', + label: isFocusMode ? (0,external_wp_i18n_namespaceObject.__)('Exit Spotlight mode') : (0,external_wp_i18n_namespaceObject.__)('Enter Spotlight mode'), + callback: ({ + close + }) => { + toggleSpotlightMode(); + close(); + } + }); + commands.push({ + name: 'core/toggle-list-view', + label: isListViewOpen ? (0,external_wp_i18n_namespaceObject.__)('Close List View') : (0,external_wp_i18n_namespaceObject.__)('Open List View'), + icon: list_view, + callback: ({ + close + }) => { + setIsListViewOpened(!isListViewOpen); + close(); + createInfoNotice(isListViewOpen ? (0,external_wp_i18n_namespaceObject.__)('List View off.') : (0,external_wp_i18n_namespaceObject.__)('List View on.'), { + id: 'core/editor/toggle-list-view/notice', + type: 'snackbar' + }); + } + }); + commands.push({ + name: 'core/toggle-top-toolbar', + label: (0,external_wp_i18n_namespaceObject.__)('Top toolbar'), + callback: ({ + close + }) => { + toggleTopToolbar(); + close(); + } + }); + if (allowSwitchEditorMode) { + commands.push({ + name: 'core/toggle-code-editor', + label: editorMode === 'visual' ? (0,external_wp_i18n_namespaceObject.__)('Open code editor') : (0,external_wp_i18n_namespaceObject.__)('Exit code editor'), + icon: library_code, + callback: ({ + close + }) => { + switchEditorMode(editorMode === 'visual' ? 'text' : 'visual'); + close(); + } + }); + } + commands.push({ + name: 'core/toggle-breadcrumbs', + label: showBlockBreadcrumbs ? (0,external_wp_i18n_namespaceObject.__)('Hide block breadcrumbs') : (0,external_wp_i18n_namespaceObject.__)('Show block breadcrumbs'), + callback: ({ + close + }) => { + toggle('core', 'showBlockBreadcrumbs'); + close(); + createInfoNotice(showBlockBreadcrumbs ? (0,external_wp_i18n_namespaceObject.__)('Breadcrumbs hidden.') : (0,external_wp_i18n_namespaceObject.__)('Breadcrumbs visible.'), { + id: 'core/editor/toggle-breadcrumbs/notice', + type: 'snackbar' + }); + } + }); + commands.push({ + name: 'core/open-settings-sidebar', + label: (0,external_wp_i18n_namespaceObject.__)('Show or hide the Settings panel.'), + icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? drawer_left : drawer_right, + callback: ({ + close + }) => { + const activeSidebar = getActiveComplementaryArea('core'); + close(); + if (activeSidebar === 'edit-post/document') { + disableComplementaryArea('core'); + } else { + enableComplementaryArea('core', 'edit-post/document'); + } + } + }); + commands.push({ + name: 'core/open-block-inspector', + label: (0,external_wp_i18n_namespaceObject.__)('Show or hide the Block settings panel'), + icon: block_default, + callback: ({ + close + }) => { + const activeSidebar = getActiveComplementaryArea('core'); + close(); + if (activeSidebar === 'edit-post/block') { + disableComplementaryArea('core'); + } else { + enableComplementaryArea('core', 'edit-post/block'); + } + } + }); + commands.push({ + name: 'core/toggle-publish-sidebar', + label: isPublishSidebarEnabled ? (0,external_wp_i18n_namespaceObject.__)('Disable pre-publish checks') : (0,external_wp_i18n_namespaceObject.__)('Enable pre-publish checks'), + icon: format_list_bullets, + callback: ({ + close + }) => { + close(); + toggle('core', 'isPublishSidebarEnabled'); + createInfoNotice(isPublishSidebarEnabled ? (0,external_wp_i18n_namespaceObject.__)('Pre-publish checks disabled.') : (0,external_wp_i18n_namespaceObject.__)('Pre-publish checks enabled.'), { + id: 'core/editor/publish-sidebar/notice', + type: 'snackbar' + }); + } + }); + if (isViewable) { + commands.push({ + name: 'core/preview-link', + label: (0,external_wp_i18n_namespaceObject.__)('Preview in a new tab'), + icon: library_external, + callback: async ({ + close + }) => { + close(); + const postId = getCurrentPostId(); + const link = await __unstableSaveForPreview(); + window.open(link, `wp-preview-${postId}`); + } + }); + } + if (canCreateTemplate && isBlockBasedTheme) { + const isSiteEditor = (0,external_wp_url_namespaceObject.getPath)(window.location.href)?.includes('site-editor.php'); + if (!isSiteEditor) { + commands.push({ + name: 'core/go-to-site-editor', + label: (0,external_wp_i18n_namespaceObject.__)('Open Site Editor'), + callback: ({ + close + }) => { + close(); + document.location = 'site-editor.php'; + } + }); + } + } + return { + commands, + isLoading: false + }; +}; +const getEditedEntityContextualCommands = () => function useEditedEntityContextualCommands() { + const { + postType + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getCurrentPostType + } = select(store_store); + return { + postType: getCurrentPostType() + }; + }, []); + const { + openModal + } = (0,external_wp_data_namespaceObject.useDispatch)(store); + const commands = []; + if (postType === PATTERN_POST_TYPE) { + commands.push({ + name: 'core/rename-pattern', + label: (0,external_wp_i18n_namespaceObject.__)('Rename pattern'), + icon: library_edit, + callback: ({ + close + }) => { + openModal(modalName); + close(); + } + }); + commands.push({ + name: 'core/duplicate-pattern', + label: (0,external_wp_i18n_namespaceObject.__)('Duplicate pattern'), + icon: library_symbol, + callback: ({ + close + }) => { + openModal(pattern_duplicate_modal_modalName); + close(); + } + }); + } + return { + isLoading: false, + commands + }; +}; +const getPageContentFocusCommands = () => function usePageContentFocusCommands() { + const { + onNavigateToEntityRecord, + goBack, + templateId, + isPreviewMode + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getRenderingMode, + getEditorSettings: _getEditorSettings, + getCurrentTemplateId + } = unlock(select(store_store)); + const editorSettings = _getEditorSettings(); + return { + isTemplateHidden: getRenderingMode() === 'post-only', + onNavigateToEntityRecord: editorSettings.onNavigateToEntityRecord, + getEditorSettings: _getEditorSettings, + goBack: editorSettings.onNavigateToPreviousEntityRecord, + templateId: getCurrentTemplateId(), + isPreviewMode: editorSettings.isPreviewMode + }; + }, []); + const { + editedRecord: template, + hasResolved + } = (0,external_wp_coreData_namespaceObject.useEntityRecord)('postType', 'wp_template', templateId); + if (isPreviewMode) { + return { + isLoading: false, + commands: [] + }; + } + const commands = []; + if (templateId && hasResolved) { + commands.push({ + name: 'core/switch-to-template-focus', + label: (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: template title */ + (0,external_wp_i18n_namespaceObject.__)('Edit template: %s'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(template.title)), + icon: library_layout, + callback: ({ + close + }) => { + onNavigateToEntityRecord({ + postId: templateId, + postType: 'wp_template' + }); + close(); + } + }); + } + if (!!goBack) { + commands.push({ + name: 'core/switch-to-previous-entity', + label: (0,external_wp_i18n_namespaceObject.__)('Go back'), + icon: library_page, + callback: ({ + close + }) => { + goBack(); + close(); + } + }); + } + return { + isLoading: false, + commands + }; +}; +const getManipulateDocumentCommands = () => function useManipulateDocumentCommands() { + const { + postType, + postId + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getCurrentPostId, + getCurrentPostType + } = select(store_store); + return { + postType: getCurrentPostType(), + postId: getCurrentPostId() + }; + }, []); + const { + editedRecord: template, + hasResolved + } = (0,external_wp_coreData_namespaceObject.useEntityRecord)('postType', postType, postId); + // eslint-disable-next-line @wordpress/no-unused-vars-before-return + const { + revertTemplate + } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store_store)); + if (!hasResolved || ![TEMPLATE_PART_POST_TYPE, TEMPLATE_POST_TYPE].includes(postType)) { + return { + isLoading: true, + commands: [] + }; + } + const commands = []; + if (isTemplateRevertable(template)) { + const label = template.type === TEMPLATE_POST_TYPE ? (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: template title */ + (0,external_wp_i18n_namespaceObject.__)('Reset template: %s'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(template.title)) : (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: template part title */ + (0,external_wp_i18n_namespaceObject.__)('Reset template part: %s'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(template.title)); + commands.push({ + name: 'core/reset-template', + label, + icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? rotate_right : rotate_left, + callback: ({ + close + }) => { + revertTemplate(template); + close(); + } + }); + } + return { + isLoading: !hasResolved, + commands + }; +}; +function useCommands() { + (0,external_wp_commands_namespaceObject.useCommandLoader)({ + name: 'core/editor/edit-ui', + hook: getEditorCommandLoader() + }); + (0,external_wp_commands_namespaceObject.useCommandLoader)({ + name: 'core/editor/contextual-commands', + hook: getEditedEntityContextualCommands(), + context: 'entity-edit' + }); + (0,external_wp_commands_namespaceObject.useCommandLoader)({ + name: 'core/editor/page-content-focus', + hook: getPageContentFocusCommands(), + context: 'entity-edit' + }); + (0,external_wp_commands_namespaceObject.useCommandLoader)({ + name: 'core/edit-site/manipulate-document', + hook: getManipulateDocumentCommands() + }); +} + +;// ./node_modules/@wordpress/editor/build-module/components/block-removal-warnings/index.js +/* wp:polyfill */ +/** + * WordPress dependencies + */ + + + + + + +/** + * Internal dependencies + */ + + + +const { + BlockRemovalWarningModal +} = unlock(external_wp_blockEditor_namespaceObject.privateApis); + +// Prevent accidental removal of certain blocks, asking the user for confirmation first. +const TEMPLATE_BLOCKS = ['core/post-content', 'core/post-template', 'core/query']; +const BLOCK_REMOVAL_RULES = [{ + // Template blocks. + // The warning is only shown when a user manipulates templates or template parts. + postTypes: ['wp_template', 'wp_template_part'], + callback(removedBlocks) { + const removedTemplateBlocks = removedBlocks.filter(({ + name + }) => TEMPLATE_BLOCKS.includes(name)); + if (removedTemplateBlocks.length) { + return (0,external_wp_i18n_namespaceObject._n)('Deleting this block will stop your post or page content from displaying on this template. It is not recommended.', 'Some of the deleted blocks will stop your post or page content from displaying on this template. It is not recommended.', removedBlocks.length); + } + } +}, { + // Pattern overrides. + // The warning is only shown when the user edits a pattern. + postTypes: ['wp_block'], + callback(removedBlocks) { + const removedBlocksWithOverrides = removedBlocks.filter(({ + attributes + }) => attributes?.metadata?.bindings && Object.values(attributes.metadata.bindings).some(binding => binding.source === 'core/pattern-overrides')); + if (removedBlocksWithOverrides.length) { + return (0,external_wp_i18n_namespaceObject._n)('The deleted block allows instance overrides. Removing it may result in content not displaying where this pattern is used. Are you sure you want to proceed?', 'Some of the deleted blocks allow instance overrides. Removing them may result in content not displaying where this pattern is used. Are you sure you want to proceed?', removedBlocks.length); + } + } +}]; +function BlockRemovalWarnings() { + const currentPostType = (0,external_wp_data_namespaceObject.useSelect)(select => select(store_store).getCurrentPostType(), []); + const removalRulesForPostType = (0,external_wp_element_namespaceObject.useMemo)(() => BLOCK_REMOVAL_RULES.filter(rule => rule.postTypes.includes(currentPostType)), [currentPostType]); + + // `BlockRemovalWarnings` is rendered in the editor provider, a shared component + // across react native and web. However, `BlockRemovalWarningModal` is web only. + // Check it exists before trying to render it. + if (!BlockRemovalWarningModal) { + return null; + } + if (!removalRulesForPostType) { + return null; + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockRemovalWarningModal, { + rules: removalRulesForPostType + }); +} + +;// ./node_modules/@wordpress/editor/build-module/components/start-page-options/index.js +/** + * WordPress dependencies + */ + + + + + +/** + * Internal dependencies + */ + +function StartPageOptions() { + const { + postId, + enabled + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getCurrentPostId, + getCurrentPostType + } = select(store_store); + const preferencesModalActive = select(store).isModalActive('editor/preferences'); + const choosePatternModalEnabled = select(external_wp_preferences_namespaceObject.store).get('core', 'enableChoosePatternModal'); + return { + postId: getCurrentPostId(), + enabled: choosePatternModalEnabled && !preferencesModalActive && 'page' === getCurrentPostType() + }; + }, []); + const { + isEditedPostDirty, + isEditedPostEmpty + } = (0,external_wp_data_namespaceObject.useSelect)(store_store); + const { + setIsInserterOpened + } = (0,external_wp_data_namespaceObject.useDispatch)(store_store); + (0,external_wp_element_namespaceObject.useEffect)(() => { + if (!enabled) { + return; + } + const isFreshPage = !isEditedPostDirty() && isEditedPostEmpty(); + if (isFreshPage) { + setIsInserterOpened({ + tab: 'patterns', + category: 'core/starter-content' + }); + } + + // Note: The `postId` ensures the effect re-runs when pages are switched without remounting the component. + // Examples: changing pages in the List View, creating a new page via Command Palette. + }, [postId, enabled, setIsInserterOpened, isEditedPostDirty, isEditedPostEmpty]); + return null; +} + +;// external ["wp","keyboardShortcuts"] +const external_wp_keyboardShortcuts_namespaceObject = window["wp"]["keyboardShortcuts"]; +;// ./node_modules/@wordpress/editor/build-module/components/keyboard-shortcut-help-modal/config.js +/** + * WordPress dependencies + */ + +const textFormattingShortcuts = [{ + keyCombination: { + modifier: 'primary', + character: 'b' + }, + description: (0,external_wp_i18n_namespaceObject.__)('Make the selected text bold.') +}, { + keyCombination: { + modifier: 'primary', + character: 'i' + }, + description: (0,external_wp_i18n_namespaceObject.__)('Make the selected text italic.') +}, { + keyCombination: { + modifier: 'primary', + character: 'k' + }, + description: (0,external_wp_i18n_namespaceObject.__)('Convert the selected text into a link.') +}, { + keyCombination: { + modifier: 'primaryShift', + character: 'k' + }, + description: (0,external_wp_i18n_namespaceObject.__)('Remove a link.') +}, { + keyCombination: { + character: '[[' + }, + description: (0,external_wp_i18n_namespaceObject.__)('Insert a link to a post or page.') +}, { + keyCombination: { + modifier: 'primary', + character: 'u' + }, + description: (0,external_wp_i18n_namespaceObject.__)('Underline the selected text.') +}, { + keyCombination: { + modifier: 'access', + character: 'd' + }, + description: (0,external_wp_i18n_namespaceObject.__)('Strikethrough the selected text.') +}, { + keyCombination: { + modifier: 'access', + character: 'x' + }, + description: (0,external_wp_i18n_namespaceObject.__)('Make the selected text inline code.') +}, { + keyCombination: { + modifier: 'access', + character: '0' + }, + aliases: [{ + modifier: 'access', + character: '7' + }], + description: (0,external_wp_i18n_namespaceObject.__)('Convert the current heading to a paragraph.') +}, { + keyCombination: { + modifier: 'access', + character: '1-6' + }, + description: (0,external_wp_i18n_namespaceObject.__)('Convert the current paragraph or heading to a heading of level 1 to 6.') +}, { + keyCombination: { + modifier: 'primaryShift', + character: 'SPACE' + }, + description: (0,external_wp_i18n_namespaceObject.__)('Add non breaking space.') +}]; + +;// external ["wp","keycodes"] +const external_wp_keycodes_namespaceObject = window["wp"]["keycodes"]; +;// ./node_modules/@wordpress/editor/build-module/components/keyboard-shortcut-help-modal/shortcut.js +/* wp:polyfill */ +/** + * WordPress dependencies + */ + + + +function KeyCombination({ + keyCombination, + forceAriaLabel +}) { + const shortcut = keyCombination.modifier ? external_wp_keycodes_namespaceObject.displayShortcutList[keyCombination.modifier](keyCombination.character) : keyCombination.character; + const ariaLabel = keyCombination.modifier ? external_wp_keycodes_namespaceObject.shortcutAriaLabel[keyCombination.modifier](keyCombination.character) : keyCombination.character; + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("kbd", { + className: "editor-keyboard-shortcut-help-modal__shortcut-key-combination", + "aria-label": forceAriaLabel || ariaLabel, + children: (Array.isArray(shortcut) ? shortcut : [shortcut]).map((character, index) => { + if (character === '+') { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.Fragment, { + children: character + }, index); + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("kbd", { + className: "editor-keyboard-shortcut-help-modal__shortcut-key", + children: character + }, index); + }) + }); +} +function Shortcut({ + description, + keyCombination, + aliases = [], + ariaLabel +}) { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: "editor-keyboard-shortcut-help-modal__shortcut-description", + children: description + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { + className: "editor-keyboard-shortcut-help-modal__shortcut-term", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(KeyCombination, { + keyCombination: keyCombination, + forceAriaLabel: ariaLabel + }), aliases.map((alias, index) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(KeyCombination, { + keyCombination: alias, + forceAriaLabel: ariaLabel + }, index))] + })] + }); +} +/* harmony default export */ const keyboard_shortcut_help_modal_shortcut = (Shortcut); + +;// ./node_modules/@wordpress/editor/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + +function DynamicShortcut({ + name +}) { + const { + keyCombination, + description, + aliases + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getShortcutKeyCombination, + getShortcutDescription, + getShortcutAliases + } = select(external_wp_keyboardShortcuts_namespaceObject.store); + return { + keyCombination: getShortcutKeyCombination(name), + aliases: getShortcutAliases(name), + description: getShortcutDescription(name) + }; + }, [name]); + if (!keyCombination) { + return null; + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(keyboard_shortcut_help_modal_shortcut, { + keyCombination: keyCombination, + description: description, + aliases: aliases + }); +} +/* harmony default export */ const dynamic_shortcut = (DynamicShortcut); + +;// ./node_modules/@wordpress/editor/build-module/components/keyboard-shortcut-help-modal/index.js +/* wp:polyfill */ +/** + * External dependencies + */ + + +/** + * WordPress dependencies + */ + + + + + + +/** + * Internal dependencies + */ + + + + +const KEYBOARD_SHORTCUT_HELP_MODAL_NAME = 'editor/keyboard-shortcut-help'; +const ShortcutList = ({ + shortcuts +}) => +/*#__PURE__*/ +/* + * Disable reason: The `list` ARIA role is redundant but + * Safari+VoiceOver won't announce the list otherwise. + */ +/* eslint-disable jsx-a11y/no-redundant-roles */ +(0,external_ReactJSXRuntime_namespaceObject.jsx)("ul", { + className: "editor-keyboard-shortcut-help-modal__shortcut-list", + role: "list", + children: shortcuts.map((shortcut, index) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("li", { + className: "editor-keyboard-shortcut-help-modal__shortcut", + children: typeof shortcut === 'string' ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(dynamic_shortcut, { + name: shortcut + }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(keyboard_shortcut_help_modal_shortcut, { + ...shortcut + }) + }, index)) +}) +/* eslint-enable jsx-a11y/no-redundant-roles */; +const ShortcutSection = ({ + title, + shortcuts, + className +}) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("section", { + className: dist_clsx('editor-keyboard-shortcut-help-modal__section', className), + children: [!!title && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h2", { + className: "editor-keyboard-shortcut-help-modal__section-title", + children: title + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ShortcutList, { + shortcuts: shortcuts + })] +}); +const ShortcutCategorySection = ({ + title, + categoryName, + additionalShortcuts = [] +}) => { + const categoryShortcuts = (0,external_wp_data_namespaceObject.useSelect)(select => { + return select(external_wp_keyboardShortcuts_namespaceObject.store).getCategoryShortcuts(categoryName); + }, [categoryName]); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ShortcutSection, { + title: title, + shortcuts: categoryShortcuts.concat(additionalShortcuts) + }); +}; +function KeyboardShortcutHelpModal() { + const isModalActive = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).isModalActive(KEYBOARD_SHORTCUT_HELP_MODAL_NAME), []); + const { + openModal, + closeModal + } = (0,external_wp_data_namespaceObject.useDispatch)(store); + const toggleModal = () => { + if (isModalActive) { + closeModal(); + } else { + openModal(KEYBOARD_SHORTCUT_HELP_MODAL_NAME); + } + }; + (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/editor/keyboard-shortcuts', toggleModal); + if (!isModalActive) { + return null; + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Modal, { + className: "editor-keyboard-shortcut-help-modal", + title: (0,external_wp_i18n_namespaceObject.__)('Keyboard shortcuts'), + closeButtonLabel: (0,external_wp_i18n_namespaceObject.__)('Close'), + onRequestClose: toggleModal, + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ShortcutSection, { + className: "editor-keyboard-shortcut-help-modal__main-shortcuts", + shortcuts: ['core/editor/keyboard-shortcuts'] + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ShortcutCategorySection, { + title: (0,external_wp_i18n_namespaceObject.__)('Global shortcuts'), + categoryName: "global" + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ShortcutCategorySection, { + title: (0,external_wp_i18n_namespaceObject.__)('Selection shortcuts'), + categoryName: "selection" + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ShortcutCategorySection, { + title: (0,external_wp_i18n_namespaceObject.__)('Block shortcuts'), + categoryName: "block", + additionalShortcuts: [{ + keyCombination: { + character: '/' + }, + description: (0,external_wp_i18n_namespaceObject.__)('Change the block type after adding a new paragraph.'), + /* translators: The forward-slash character. e.g. '/'. */ + ariaLabel: (0,external_wp_i18n_namespaceObject.__)('Forward-slash') + }] + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ShortcutSection, { + title: (0,external_wp_i18n_namespaceObject.__)('Text formatting'), + shortcuts: textFormattingShortcuts + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ShortcutCategorySection, { + title: (0,external_wp_i18n_namespaceObject.__)('List View shortcuts'), + categoryName: "list-view" + })] + }); +} +/* harmony default export */ const keyboard_shortcut_help_modal = (KeyboardShortcutHelpModal); + +;// ./node_modules/@wordpress/editor/build-module/components/block-settings-menu/content-only-settings-menu.js +/* wp:polyfill */ +/** + * WordPress dependencies + */ + + + + + + +/** + * Internal dependencies + */ + + + + +function ContentOnlySettingsMenuItems({ + clientId, + onClose +}) { + const postContentBlocks = usePostContentBlocks(); + const { + entity, + onNavigateToEntityRecord, + canEditTemplates + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getBlockParentsByBlockName, + getSettings, + getBlockAttributes, + getBlockParents + } = select(external_wp_blockEditor_namespaceObject.store); + const { + getCurrentTemplateId, + getRenderingMode + } = select(store_store); + const patternParent = getBlockParentsByBlockName(clientId, 'core/block', true)[0]; + let record; + if (patternParent) { + record = select(external_wp_coreData_namespaceObject.store).getEntityRecord('postType', 'wp_block', getBlockAttributes(patternParent).ref); + } else if (getRenderingMode() === 'template-locked' && !getBlockParents(clientId).some(parent => postContentBlocks.includes(parent))) { + record = select(external_wp_coreData_namespaceObject.store).getEntityRecord('postType', 'wp_template', getCurrentTemplateId()); + } + if (!record) { + return {}; + } + const _canEditTemplates = select(external_wp_coreData_namespaceObject.store).canUser('create', { + kind: 'postType', + name: 'wp_template' + }); + return { + canEditTemplates: _canEditTemplates, + entity: record, + onNavigateToEntityRecord: getSettings().onNavigateToEntityRecord + }; + }, [clientId, postContentBlocks]); + if (!entity) { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TemplateLockContentOnlyMenuItems, { + clientId: clientId, + onClose: onClose + }); + } + const isPattern = entity.type === 'wp_block'; + let helpText = isPattern ? (0,external_wp_i18n_namespaceObject.__)('Edit the pattern to move, delete, or make further changes to this block.') : (0,external_wp_i18n_namespaceObject.__)('Edit the template to move, delete, or make further changes to this block.'); + if (!canEditTemplates) { + helpText = (0,external_wp_i18n_namespaceObject.__)('Only users with permissions to edit the template can move or delete this block'); + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__unstableBlockSettingsMenuFirstItem, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { + onClick: () => { + onNavigateToEntityRecord({ + postId: entity.id, + postType: entity.type + }); + }, + disabled: !canEditTemplates, + children: isPattern ? (0,external_wp_i18n_namespaceObject.__)('Edit pattern') : (0,external_wp_i18n_namespaceObject.__)('Edit template') + }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { + variant: "muted", + as: "p", + className: "editor-content-only-settings-menu__description", + children: helpText + })] + }); +} +function TemplateLockContentOnlyMenuItems({ + clientId, + onClose +}) { + const { + contentLockingParent + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getContentLockingParent + } = unlock(select(external_wp_blockEditor_namespaceObject.store)); + return { + contentLockingParent: getContentLockingParent(clientId) + }; + }, [clientId]); + const blockDisplayInformation = (0,external_wp_blockEditor_namespaceObject.useBlockDisplayInformation)(contentLockingParent); + const blockEditorActions = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); + if (!blockDisplayInformation?.title) { + return null; + } + const { + modifyContentLockBlock + } = unlock(blockEditorActions); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__unstableBlockSettingsMenuFirstItem, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { + onClick: () => { + modifyContentLockBlock(contentLockingParent); + onClose(); + }, + children: (0,external_wp_i18n_namespaceObject._x)('Unlock', 'Unlock content locked blocks') + }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { + variant: "muted", + as: "p", + className: "editor-content-only-settings-menu__description", + children: (0,external_wp_i18n_namespaceObject.__)('Temporarily unlock the parent block to edit, delete or make further changes to this block.') + })] + }); +} +function ContentOnlySettingsMenu() { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockSettingsMenuControls, { + children: ({ + selectedClientIds, + onClose + }) => selectedClientIds.length === 1 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ContentOnlySettingsMenuItems, { + clientId: selectedClientIds[0], + onClose: onClose + }) + }); +} + +;// ./node_modules/@wordpress/editor/build-module/components/start-template-options/index.js +/* wp:polyfill */ +/** + * WordPress dependencies + */ + + + + + + + + +/** + * Internal dependencies + */ + + + +function useFallbackTemplateContent(slug, isCustom = false) { + return (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getEntityRecord, + getDefaultTemplateId + } = select(external_wp_coreData_namespaceObject.store); + const templateId = getDefaultTemplateId({ + slug, + is_custom: isCustom, + ignore_empty: true + }); + return templateId ? getEntityRecord('postType', TEMPLATE_POST_TYPE, templateId)?.content?.raw : undefined; + }, [slug, isCustom]); +} +function useStartPatterns(fallbackContent) { + const { + slug, + patterns + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getCurrentPostType, + getCurrentPostId + } = select(store_store); + const { + getEntityRecord, + getBlockPatterns + } = select(external_wp_coreData_namespaceObject.store); + const postId = getCurrentPostId(); + const postType = getCurrentPostType(); + const record = getEntityRecord('postType', postType, postId); + return { + slug: record.slug, + patterns: getBlockPatterns() + }; + }, []); + const currentThemeStylesheet = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getCurrentTheme().stylesheet); + + // Duplicated from packages/block-library/src/pattern/edit.js. + function injectThemeAttributeInBlockTemplateContent(block) { + if (block.innerBlocks.find(innerBlock => innerBlock.name === 'core/template-part')) { + block.innerBlocks = block.innerBlocks.map(innerBlock => { + if (innerBlock.name === 'core/template-part' && innerBlock.attributes.theme === undefined) { + innerBlock.attributes.theme = currentThemeStylesheet; + } + return innerBlock; + }); + } + if (block.name === 'core/template-part' && block.attributes.theme === undefined) { + block.attributes.theme = currentThemeStylesheet; + } + return block; + } + return (0,external_wp_element_namespaceObject.useMemo)(() => { + // filter patterns that are supposed to be used in the current template being edited. + return [{ + name: 'fallback', + blocks: (0,external_wp_blocks_namespaceObject.parse)(fallbackContent), + title: (0,external_wp_i18n_namespaceObject.__)('Fallback content') + }, ...patterns.filter(pattern => { + return Array.isArray(pattern.templateTypes) && pattern.templateTypes.some(templateType => slug.startsWith(templateType)); + }).map(pattern => { + return { + ...pattern, + blocks: (0,external_wp_blocks_namespaceObject.parse)(pattern.content).map(block => injectThemeAttributeInBlockTemplateContent(block)) + }; + })]; + }, [fallbackContent, slug, patterns]); +} +function PatternSelection({ + fallbackContent, + onChoosePattern, + postType +}) { + const [,, onChange] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)('postType', postType); + const blockPatterns = useStartPatterns(fallbackContent); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalBlockPatternsList, { + blockPatterns: blockPatterns, + onClickPattern: (pattern, blocks) => { + onChange(blocks, { + selection: undefined + }); + onChoosePattern(); + } + }); +} +function StartModal({ + slug, + isCustom, + onClose, + postType +}) { + const fallbackContent = useFallbackTemplateContent(slug, isCustom); + if (!fallbackContent) { + return null; + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Modal, { + className: "editor-start-template-options__modal", + title: (0,external_wp_i18n_namespaceObject.__)('Choose a pattern'), + closeLabel: (0,external_wp_i18n_namespaceObject.__)('Cancel'), + focusOnMount: "firstElement", + onRequestClose: onClose, + isFullScreen: true, + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: "editor-start-template-options__modal-content", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PatternSelection, { + fallbackContent: fallbackContent, + slug: slug, + isCustom: isCustom, + postType: postType, + onChoosePattern: () => { + onClose(); + } + }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Flex, { + className: "editor-start-template-options__modal__actions", + justify: "flex-end", + expanded: false, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + __next40pxDefaultSize: true, + variant: "tertiary", + onClick: onClose, + children: (0,external_wp_i18n_namespaceObject.__)('Skip') + }) + }) + })] + }); +} +function StartTemplateOptions() { + const [isClosed, setIsClosed] = (0,external_wp_element_namespaceObject.useState)(false); + const { + shouldOpenModal, + slug, + isCustom, + postType, + postId + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getCurrentPostType, + getCurrentPostId + } = select(store_store); + const _postType = getCurrentPostType(); + const _postId = getCurrentPostId(); + const { + getEditedEntityRecord, + hasEditsForEntityRecord + } = select(external_wp_coreData_namespaceObject.store); + const templateRecord = getEditedEntityRecord('postType', _postType, _postId); + const hasEdits = hasEditsForEntityRecord('postType', _postType, _postId); + return { + shouldOpenModal: !hasEdits && '' === templateRecord.content && TEMPLATE_POST_TYPE === _postType, + slug: templateRecord.slug, + isCustom: templateRecord.is_custom, + postType: _postType, + postId: _postId + }; + }, []); + (0,external_wp_element_namespaceObject.useEffect)(() => { + // Should reset the modal state when navigating to a new page/post. + setIsClosed(false); + }, [postType, postId]); + if (!shouldOpenModal || isClosed) { + return null; + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(StartModal, { + slug: slug, + isCustom: isCustom, + postType: postType, + onClose: () => setIsClosed(true) + }); +} + ;// ./node_modules/@wordpress/editor/build-module/components/global-keyboard-shortcuts/index.js /** * WordPress dependencies @@ -10202,6 +14411,1559 @@ function EditorKeyboardShortcuts() { return null; } +;// ./node_modules/@wordpress/editor/build-module/components/template-part-menu-items/convert-to-regular.js +/** + * WordPress dependencies + */ + + + + + +function ConvertToRegularBlocks({ + clientId, + onClose +}) { + const { + getBlocks + } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store); + const { + replaceBlocks + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); + const canRemove = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).canRemoveBlock(clientId), [clientId]); + if (!canRemove) { + return null; + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { + onClick: () => { + replaceBlocks(clientId, getBlocks(clientId)); + onClose(); + }, + children: (0,external_wp_i18n_namespaceObject.__)('Detach') + }); +} + +;// ./node_modules/@wordpress/editor/build-module/components/template-part-menu-items/convert-to-template-part.js +/** + * WordPress dependencies + */ + + + + + + + + + +/** + * Internal dependencies + */ + + +function ConvertToTemplatePart({ + clientIds, + blocks +}) { + const [isModalOpen, setIsModalOpen] = (0,external_wp_element_namespaceObject.useState)(false); + const { + replaceBlocks + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); + const { + createSuccessNotice + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); + const { + canCreate + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + return { + canCreate: select(external_wp_blockEditor_namespaceObject.store).canInsertBlockType('core/template-part') + }; + }, []); + if (!canCreate) { + return null; + } + const onConvert = async templatePart => { + replaceBlocks(clientIds, (0,external_wp_blocks_namespaceObject.createBlock)('core/template-part', { + slug: templatePart.slug, + theme: templatePart.theme + })); + createSuccessNotice((0,external_wp_i18n_namespaceObject.__)('Template part created.'), { + type: 'snackbar' + }); + + // The modal and this component will be unmounted because of `replaceBlocks` above, + // so no need to call `closeModal` or `onClose`. + }; + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { + icon: symbol_filled, + onClick: () => { + setIsModalOpen(true); + }, + "aria-expanded": isModalOpen, + "aria-haspopup": "dialog", + children: (0,external_wp_i18n_namespaceObject.__)('Create template part') + }), isModalOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CreateTemplatePartModal, { + closeModal: () => { + setIsModalOpen(false); + }, + blocks: blocks, + onCreate: onConvert + })] + }); +} + +;// ./node_modules/@wordpress/editor/build-module/components/template-part-menu-items/index.js +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + + +function TemplatePartMenuItems() { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockSettingsMenuControls, { + children: ({ + selectedClientIds, + onClose + }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TemplatePartConverterMenuItem, { + clientIds: selectedClientIds, + onClose: onClose + }) + }); +} +function TemplatePartConverterMenuItem({ + clientIds, + onClose +}) { + const { + blocks + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getBlocksByClientId + } = select(external_wp_blockEditor_namespaceObject.store); + return { + blocks: getBlocksByClientId(clientIds) + }; + }, [clientIds]); + + // Allow converting a single template part to standard blocks. + if (blocks.length === 1 && blocks[0]?.name === 'core/template-part') { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ConvertToRegularBlocks, { + clientId: clientIds[0], + onClose: onClose + }); + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ConvertToTemplatePart, { + clientIds: clientIds, + blocks: blocks + }); +} + +;// ./node_modules/@wordpress/editor/build-module/components/provider/index.js +/* wp:polyfill */ +/** + * WordPress dependencies + */ + + + + + + + + + +/** + * Internal dependencies + */ + + + + + + + + + + + + + + + + + + +const { + ExperimentalBlockEditorProvider +} = unlock(external_wp_blockEditor_namespaceObject.privateApis); +const { + PatternsMenuItems +} = unlock(external_wp_patterns_namespaceObject.privateApis); +const provider_noop = () => {}; + +/** + * These are global entities that are only there to split blocks into logical units + * They don't provide a "context" for the current post/page being rendered. + * So we should not use their ids as post context. This is important to allow post blocks + * (post content, post title) to be used within them without issues. + */ +const NON_CONTEXTUAL_POST_TYPES = ['wp_block', 'wp_navigation', 'wp_template_part']; + +/** + * These are rendering modes that the editor supports. + */ +const RENDERING_MODES = ['post-only', 'template-locked']; + +/** + * Depending on the post, template and template mode, + * returns the appropriate blocks and change handlers for the block editor provider. + * + * @param {Array} post Block list. + * @param {boolean} template Whether the page content has focus (and the surrounding template is inert). If `true` return page content blocks. Default `false`. + * @param {string} mode Rendering mode. + * + * @example + * ```jsx + * const [ blocks, onInput, onChange ] = useBlockEditorProps( post, template, mode ); + * ``` + * + * @return {Array} Block editor props. + */ +function useBlockEditorProps(post, template, mode) { + const rootLevelPost = mode === 'template-locked' ? 'template' : 'post'; + const [postBlocks, onInput, onChange] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)('postType', post.type, { + id: post.id + }); + const [templateBlocks, onInputTemplate, onChangeTemplate] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)('postType', template?.type, { + id: template?.id + }); + const maybeNavigationBlocks = (0,external_wp_element_namespaceObject.useMemo)(() => { + if (post.type === 'wp_navigation') { + return [(0,external_wp_blocks_namespaceObject.createBlock)('core/navigation', { + ref: post.id, + // As the parent editor is locked with `templateLock`, the template locking + // must be explicitly "unset" on the block itself to allow the user to modify + // the block's content. + templateLock: false + })]; + } + }, [post.type, post.id]); + + // It is important that we don't create a new instance of blocks on every change + // We should only create a new instance if the blocks them selves change, not a dependency of them. + const blocks = (0,external_wp_element_namespaceObject.useMemo)(() => { + if (maybeNavigationBlocks) { + return maybeNavigationBlocks; + } + if (rootLevelPost === 'template') { + return templateBlocks; + } + return postBlocks; + }, [maybeNavigationBlocks, rootLevelPost, templateBlocks, postBlocks]); + + // Handle fallback to postBlocks outside of the above useMemo, to ensure + // that constructed block templates that call `createBlock` are not generated + // too frequently. This ensures that clientIds are stable. + const disableRootLevelChanges = !!template && mode === 'template-locked' || post.type === 'wp_navigation'; + if (disableRootLevelChanges) { + return [blocks, provider_noop, provider_noop]; + } + return [blocks, rootLevelPost === 'post' ? onInput : onInputTemplate, rootLevelPost === 'post' ? onChange : onChangeTemplate]; +} + +/** + * This component provides the editor context and manages the state of the block editor. + * + * @param {Object} props The component props. + * @param {Object} props.post The post object. + * @param {Object} props.settings The editor settings. + * @param {boolean} props.recovery Indicates if the editor is in recovery mode. + * @param {Array} props.initialEdits The initial edits for the editor. + * @param {Object} props.children The child components. + * @param {Object} [props.BlockEditorProviderComponent] The block editor provider component to use. Defaults to ExperimentalBlockEditorProvider. + * @param {Object} [props.__unstableTemplate] The template object. + * + * @example + * ```jsx + * + * { children } + * + * + * @return {Object} The rendered ExperimentalEditorProvider component. + */ +const ExperimentalEditorProvider = with_registry_provider(({ + post, + settings, + recovery, + initialEdits, + children, + BlockEditorProviderComponent = ExperimentalBlockEditorProvider, + __unstableTemplate: template +}) => { + const hasTemplate = !!template; + const { + editorSettings, + selection, + isReady, + mode, + defaultMode, + postTypeEntities + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getEditorSettings, + getEditorSelection, + getRenderingMode, + __unstableIsEditorReady + } = select(store_store); + const { + getEntitiesConfig, + getPostType, + hasFinishedResolution + } = select(external_wp_coreData_namespaceObject.store); + const postTypeSupports = getPostType(post.type)?.supports; + const hasLoadedPostObject = hasFinishedResolution('getPostType', [post.type]); + const _defaultMode = Array.isArray(postTypeSupports?.editor) ? postTypeSupports.editor.find(features => 'default-mode' in features)?.['default-mode'] : undefined; + const hasDefaultMode = RENDERING_MODES.includes(_defaultMode); + return { + editorSettings: getEditorSettings(), + isReady: __unstableIsEditorReady() && hasLoadedPostObject, + mode: getRenderingMode(), + defaultMode: hasTemplate && hasDefaultMode ? _defaultMode : 'post-only', + selection: getEditorSelection(), + postTypeEntities: post.type === 'wp_template' ? getEntitiesConfig('postType') : null + }; + }, [post.type, hasTemplate]); + const shouldRenderTemplate = !!template && mode !== 'post-only'; + const rootLevelPost = shouldRenderTemplate ? template : post; + const defaultBlockContext = (0,external_wp_element_namespaceObject.useMemo)(() => { + const postContext = {}; + // If it is a template, try to inherit the post type from the name. + if (post.type === 'wp_template') { + if (post.slug === 'page') { + postContext.postType = 'page'; + } else if (post.slug === 'single') { + postContext.postType = 'post'; + } else if (post.slug.split('-')[0] === 'single') { + // If the slug is single-{postType}, infer the post type from the name. + const postTypeNames = postTypeEntities?.map(entity => entity.name) || []; + const match = post.slug.match(`^single-(${postTypeNames.join('|')})(?:-.+)?$`); + if (match) { + postContext.postType = match[1]; + } + } + } else if (!NON_CONTEXTUAL_POST_TYPES.includes(rootLevelPost.type) || shouldRenderTemplate) { + postContext.postId = post.id; + postContext.postType = post.type; + } + return { + ...postContext, + templateSlug: rootLevelPost.type === 'wp_template' ? rootLevelPost.slug : undefined + }; + }, [shouldRenderTemplate, post.id, post.type, post.slug, rootLevelPost.type, rootLevelPost.slug, postTypeEntities]); + const { + id, + type + } = rootLevelPost; + const blockEditorSettings = use_block_editor_settings(editorSettings, type, id, mode); + const [blocks, onInput, onChange] = useBlockEditorProps(post, template, mode); + const { + updatePostLock, + setupEditor, + updateEditorSettings, + setCurrentTemplateId, + setEditedPost, + setRenderingMode + } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store_store)); + const { + createWarningNotice + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); + + // Ideally this should be synced on each change and not just something you do once. + (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { + // Assume that we don't need to initialize in the case of an error recovery. + if (recovery) { + return; + } + updatePostLock(settings.postLock); + setupEditor(post, initialEdits, settings.template); + if (settings.autosave) { + createWarningNotice((0,external_wp_i18n_namespaceObject.__)('There is an autosave of this post that is more recent than the version below.'), { + id: 'autosave-exists', + actions: [{ + label: (0,external_wp_i18n_namespaceObject.__)('View the autosave'), + url: settings.autosave.editLink + }] + }); + } + + // The dependencies of the hook are omitted deliberately + // We only want to run setupEditor (with initialEdits) only once per post. + // A better solution in the future would be to split this effect into multiple ones. + }, []); + + // Synchronizes the active post with the state + (0,external_wp_element_namespaceObject.useEffect)(() => { + setEditedPost(post.type, post.id); + }, [post.type, post.id, setEditedPost]); + + // Synchronize the editor settings as they change. + (0,external_wp_element_namespaceObject.useEffect)(() => { + updateEditorSettings(settings); + }, [settings, updateEditorSettings]); + + // Synchronizes the active template with the state. + (0,external_wp_element_namespaceObject.useEffect)(() => { + setCurrentTemplateId(template?.id); + }, [template?.id, setCurrentTemplateId]); + + // Sets the right rendering mode when loading the editor. + (0,external_wp_element_namespaceObject.useEffect)(() => { + setRenderingMode(defaultMode); + }, [defaultMode, setRenderingMode]); + useHideBlocksFromInserter(post.type, mode); + + // Register the editor commands. + useCommands(); + if (!isReady || !mode) { + return null; + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_coreData_namespaceObject.EntityProvider, { + kind: "root", + type: "site", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_coreData_namespaceObject.EntityProvider, { + kind: "postType", + type: post.type, + id: post.id, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockContextProvider, { + value: defaultBlockContext, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(BlockEditorProviderComponent, { + value: blocks, + onChange: onChange, + onInput: onInput, + selection: selection, + settings: blockEditorSettings, + useSubRegistry: false, + children: [children, !settings.isPreviewMode && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PatternsMenuItems, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TemplatePartMenuItems, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ContentOnlySettingsMenu, {}), mode === 'template-locked' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DisableNonPageContentBlocks, {}), type === 'wp_navigation' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationBlockEditingMode, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditorKeyboardShortcuts, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(keyboard_shortcut_help_modal, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockRemovalWarnings, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(StartPageOptions, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(StartTemplateOptions, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PatternRenameModal, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PatternDuplicateModal, {})] + })] + }) + }) + }) + }); +}); + +/** + * This component establishes a new post editing context, and serves as the entry point for a new post editor (or post with template editor). + * + * It supports a large number of post types, including post, page, templates, + * custom post types, patterns, template parts. + * + * All modification and changes are performed to the `@wordpress/core-data` store. + * + * @param {Object} props The component props. + * @param {Object} [props.post] The post object to edit. This is required. + * @param {Object} [props.__unstableTemplate] The template object wrapper the edited post. + * This is optional and can only be used when the post type supports templates (like posts and pages). + * @param {Object} [props.settings] The settings object to use for the editor. + * This is optional and can be used to override the default settings. + * @param {React.ReactNode} [props.children] Children elements for which the BlockEditorProvider context should apply. + * This is optional. + * + * @example + * ```jsx + * + * { children } + * + * ``` + * + * @return {React.ReactNode} The rendered EditorProvider component. + */ +function EditorProvider(props) { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ExperimentalEditorProvider, { + ...props, + BlockEditorProviderComponent: external_wp_blockEditor_namespaceObject.BlockEditorProvider, + children: props.children + }); +} +/* harmony default export */ const provider = (EditorProvider); + +;// ./node_modules/@wordpress/editor/build-module/dataviews/fields/content-preview/content-preview-view.js +/** + * WordPress dependencies + */ + + + + + +/** + * Internal dependencies + */ + + +// @ts-ignore + + +const { + useGlobalStyle +} = unlock(external_wp_blockEditor_namespaceObject.privateApis); +function PostPreviewContainer({ + template, + post +}) { + const [backgroundColor = 'white'] = useGlobalStyle('color.background'); + const [postBlocks] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)('postType', post.type, { + id: post.id + }); + const [templateBlocks] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)('postType', template?.type, { + id: template?.id + }); + const blocks = template && templateBlocks ? templateBlocks : postBlocks; + const isEmpty = !blocks?.length; + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { + className: "editor-fields-content-preview", + style: { + backgroundColor + }, + children: [isEmpty && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { + className: "editor-fields-content-preview__empty", + children: (0,external_wp_i18n_namespaceObject.__)('Empty content') + }), !isEmpty && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockPreview.Async, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockPreview, { + blocks: blocks + }) + })] + }); +} +function PostPreviewView({ + item +}) { + const { + settings, + template + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + var _getPostType$viewable; + const { + canUser, + getPostType, + getTemplateId, + getEntityRecord + } = unlock(select(external_wp_coreData_namespaceObject.store)); + const canViewTemplate = canUser('read', { + kind: 'postType', + name: 'wp_template' + }); + const _settings = select(store_store).getEditorSettings(); + // @ts-ignore + const supportsTemplateMode = _settings.supportsTemplateMode; + const isViewable = (_getPostType$viewable = getPostType(item.type)?.viewable) !== null && _getPostType$viewable !== void 0 ? _getPostType$viewable : false; + const templateId = supportsTemplateMode && isViewable && canViewTemplate ? getTemplateId(item.type, item.id) : null; + return { + settings: _settings, + template: templateId ? getEntityRecord('postType', 'wp_template', templateId) : undefined + }; + }, [item.type, item.id]); + // Wrap everything in a block editor provider to ensure 'styles' that are needed + // for the previews are synced between the site editor store and the block editor store. + // Additionally we need to have the `__experimentalBlockPatterns` setting in order to + // render patterns inside the previews. + // TODO: Same approach is used in the patterns list and it becomes obvious that some of + // the block editor settings are needed in context where we don't have the block editor. + // Explore how we can solve this in a better way. + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditorProvider, { + post: item, + settings: settings, + __unstableTemplate: template, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostPreviewContainer, { + template: template, + post: item + }) + }); +} + +;// ./node_modules/@wordpress/editor/build-module/dataviews/fields/content-preview/index.js +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + +const postPreviewField = { + type: 'media', + id: 'content-preview', + label: (0,external_wp_i18n_namespaceObject.__)('Content preview'), + render: PostPreviewView, + enableSorting: false +}; +/* harmony default export */ const content_preview = (postPreviewField); + +;// ./node_modules/@wordpress/editor/build-module/dataviews/store/private-actions.js +/* wp:polyfill */ +/** + * WordPress dependencies + */ + + + + +/** + * Internal dependencies + */ + + + +function registerEntityAction(kind, name, config) { + return { + type: 'REGISTER_ENTITY_ACTION', + kind, + name, + config + }; +} +function unregisterEntityAction(kind, name, actionId) { + return { + type: 'UNREGISTER_ENTITY_ACTION', + kind, + name, + actionId + }; +} +function registerEntityField(kind, name, config) { + return { + type: 'REGISTER_ENTITY_FIELD', + kind, + name, + config + }; +} +function unregisterEntityField(kind, name, fieldId) { + return { + type: 'UNREGISTER_ENTITY_FIELD', + kind, + name, + fieldId + }; +} +function setIsReady(kind, name) { + return { + type: 'SET_IS_READY', + kind, + name + }; +} +const registerPostTypeSchema = postType => async ({ + registry +}) => { + const isReady = unlock(registry.select(store_store)).isEntityReady('postType', postType); + if (isReady) { + return; + } + unlock(registry.dispatch(store_store)).setIsReady('postType', postType); + const postTypeConfig = await registry.resolveSelect(external_wp_coreData_namespaceObject.store).getPostType(postType); + const canCreate = await registry.resolveSelect(external_wp_coreData_namespaceObject.store).canUser('create', { + kind: 'postType', + name: postType + }); + const currentTheme = await registry.resolveSelect(external_wp_coreData_namespaceObject.store).getCurrentTheme(); + const actions = [postTypeConfig.viewable ? view_post : undefined, !!postTypeConfig.supports?.revisions ? view_post_revisions : undefined, + // @ts-ignore + false ? 0 : undefined, postTypeConfig.slug === 'wp_template_part' && canCreate && currentTheme?.is_block_theme ? duplicate_template_part : undefined, canCreate && postTypeConfig.slug === 'wp_block' ? duplicate_pattern : undefined, postTypeConfig.supports?.title ? rename_post : undefined, postTypeConfig.supports?.['page-attributes'] ? reorder_page : undefined, postTypeConfig.slug === 'wp_block' ? export_pattern : undefined, restore_post, reset_post, delete_post, trash_post, permanently_delete_post].filter(Boolean); + const fields = [postTypeConfig.supports?.thumbnail && currentTheme?.theme_supports?.['post-thumbnails'] && featured_image, postTypeConfig.supports?.author && author, fields_status, date, slug, postTypeConfig.supports?.['page-attributes'] && fields_parent, postTypeConfig.supports?.comments && comment_status, fields_template, fields_password, postTypeConfig.supports?.editor && postTypeConfig.viewable && content_preview].filter(Boolean); + if (postTypeConfig.supports?.title) { + let _titleField; + if (postType === 'page') { + _titleField = page_title; + } else if (postType === 'wp_template') { + _titleField = template_title; + } else if (postType === 'wp_block') { + _titleField = pattern_title; + } else { + _titleField = title; + } + fields.push(_titleField); + } + registry.batch(() => { + actions.forEach(action => { + unlock(registry.dispatch(store_store)).registerEntityAction('postType', postType, action); + }); + fields.forEach(field => { + unlock(registry.dispatch(store_store)).registerEntityField('postType', postType, field); + }); + }); + (0,external_wp_hooks_namespaceObject.doAction)('core.registerPostTypeSchema', postType); +}; + +;// ./node_modules/@wordpress/editor/build-module/store/private-actions.js +/* wp:polyfill */ +/** + * WordPress dependencies + */ + + + + + + + + + + +/** + * Internal dependencies + */ + + + +/** + * Returns an action object used to set which template is currently being used/edited. + * + * @param {string} id Template Id. + * + * @return {Object} Action object. + */ +function setCurrentTemplateId(id) { + return { + type: 'SET_CURRENT_TEMPLATE_ID', + id + }; +} + +/** + * Create a block based template. + * + * @param {?Object} template Template to create and assign. + */ +const createTemplate = template => async ({ + select, + dispatch, + registry +}) => { + const savedTemplate = await registry.dispatch(external_wp_coreData_namespaceObject.store).saveEntityRecord('postType', 'wp_template', template); + registry.dispatch(external_wp_coreData_namespaceObject.store).editEntityRecord('postType', select.getCurrentPostType(), select.getCurrentPostId(), { + template: savedTemplate.slug + }); + registry.dispatch(external_wp_notices_namespaceObject.store).createSuccessNotice((0,external_wp_i18n_namespaceObject.__)("Custom template created. You're in template mode now."), { + type: 'snackbar', + actions: [{ + label: (0,external_wp_i18n_namespaceObject.__)('Go back'), + onClick: () => dispatch.setRenderingMode(select.getEditorSettings().defaultRenderingMode) + }] + }); + return savedTemplate; +}; + +/** + * Update the provided block types to be visible. + * + * @param {string[]} blockNames Names of block types to show. + */ +const showBlockTypes = blockNames => ({ + registry +}) => { + var _registry$select$get; + const existingBlockNames = (_registry$select$get = registry.select(external_wp_preferences_namespaceObject.store).get('core', 'hiddenBlockTypes')) !== null && _registry$select$get !== void 0 ? _registry$select$get : []; + const newBlockNames = existingBlockNames.filter(type => !(Array.isArray(blockNames) ? blockNames : [blockNames]).includes(type)); + registry.dispatch(external_wp_preferences_namespaceObject.store).set('core', 'hiddenBlockTypes', newBlockNames); +}; + +/** + * Update the provided block types to be hidden. + * + * @param {string[]} blockNames Names of block types to hide. + */ +const hideBlockTypes = blockNames => ({ + registry +}) => { + var _registry$select$get2; + const existingBlockNames = (_registry$select$get2 = registry.select(external_wp_preferences_namespaceObject.store).get('core', 'hiddenBlockTypes')) !== null && _registry$select$get2 !== void 0 ? _registry$select$get2 : []; + const mergedBlockNames = new Set([...existingBlockNames, ...(Array.isArray(blockNames) ? blockNames : [blockNames])]); + registry.dispatch(external_wp_preferences_namespaceObject.store).set('core', 'hiddenBlockTypes', [...mergedBlockNames]); +}; + +/** + * Save entity records marked as dirty. + * + * @param {Object} options Options for the action. + * @param {Function} [options.onSave] Callback when saving happens. + * @param {object[]} [options.dirtyEntityRecords] Array of dirty entities. + * @param {object[]} [options.entitiesToSkip] Array of entities to skip saving. + * @param {Function} [options.close] Callback when the actions is called. It should be consolidated with `onSave`. + */ +const saveDirtyEntities = ({ + onSave, + dirtyEntityRecords = [], + entitiesToSkip = [], + close +} = {}) => ({ + registry +}) => { + const PUBLISH_ON_SAVE_ENTITIES = [{ + kind: 'postType', + name: 'wp_navigation' + }]; + const saveNoticeId = 'site-editor-save-success'; + const homeUrl = registry.select(external_wp_coreData_namespaceObject.store).getEntityRecord('root', '__unstableBase')?.home; + registry.dispatch(external_wp_notices_namespaceObject.store).removeNotice(saveNoticeId); + const entitiesToSave = dirtyEntityRecords.filter(({ + kind, + name, + key, + property + }) => { + return !entitiesToSkip.some(elt => elt.kind === kind && elt.name === name && elt.key === key && elt.property === property); + }); + close?.(entitiesToSave); + const siteItemsToSave = []; + const pendingSavedRecords = []; + entitiesToSave.forEach(({ + kind, + name, + key, + property + }) => { + if ('root' === kind && 'site' === name) { + siteItemsToSave.push(property); + } else { + if (PUBLISH_ON_SAVE_ENTITIES.some(typeToPublish => typeToPublish.kind === kind && typeToPublish.name === name)) { + registry.dispatch(external_wp_coreData_namespaceObject.store).editEntityRecord(kind, name, key, { + status: 'publish' + }); + } + pendingSavedRecords.push(registry.dispatch(external_wp_coreData_namespaceObject.store).saveEditedEntityRecord(kind, name, key)); + } + }); + if (siteItemsToSave.length) { + pendingSavedRecords.push(registry.dispatch(external_wp_coreData_namespaceObject.store).__experimentalSaveSpecifiedEntityEdits('root', 'site', undefined, siteItemsToSave)); + } + registry.dispatch(external_wp_blockEditor_namespaceObject.store).__unstableMarkLastChangeAsPersistent(); + Promise.all(pendingSavedRecords).then(values => { + return onSave ? onSave(values) : values; + }).then(values => { + if (values.some(value => typeof value === 'undefined')) { + registry.dispatch(external_wp_notices_namespaceObject.store).createErrorNotice((0,external_wp_i18n_namespaceObject.__)('Saving failed.')); + } else { + registry.dispatch(external_wp_notices_namespaceObject.store).createSuccessNotice((0,external_wp_i18n_namespaceObject.__)('Site updated.'), { + type: 'snackbar', + id: saveNoticeId, + actions: [{ + label: (0,external_wp_i18n_namespaceObject.__)('View site'), + url: homeUrl + }] + }); + } + }).catch(error => registry.dispatch(external_wp_notices_namespaceObject.store).createErrorNotice(`${(0,external_wp_i18n_namespaceObject.__)('Saving failed.')} ${error}`)); +}; + +/** + * Reverts a template to its original theme-provided file. + * + * @param {Object} template The template to revert. + * @param {Object} [options] + * @param {boolean} [options.allowUndo] Whether to allow the user to undo + * reverting the template. Default true. + */ +const private_actions_revertTemplate = (template, { + allowUndo = true +} = {}) => async ({ + registry +}) => { + const noticeId = 'edit-site-template-reverted'; + registry.dispatch(external_wp_notices_namespaceObject.store).removeNotice(noticeId); + if (!isTemplateRevertable(template)) { + registry.dispatch(external_wp_notices_namespaceObject.store).createErrorNotice((0,external_wp_i18n_namespaceObject.__)('This template is not revertable.'), { + type: 'snackbar' + }); + return; + } + try { + const templateEntityConfig = registry.select(external_wp_coreData_namespaceObject.store).getEntityConfig('postType', template.type); + if (!templateEntityConfig) { + registry.dispatch(external_wp_notices_namespaceObject.store).createErrorNotice((0,external_wp_i18n_namespaceObject.__)('The editor has encountered an unexpected error. Please reload.'), { + type: 'snackbar' + }); + return; + } + const fileTemplatePath = (0,external_wp_url_namespaceObject.addQueryArgs)(`${templateEntityConfig.baseURL}/${template.id}`, { + context: 'edit', + source: template.origin + }); + const fileTemplate = await external_wp_apiFetch_default()({ + path: fileTemplatePath + }); + if (!fileTemplate) { + registry.dispatch(external_wp_notices_namespaceObject.store).createErrorNotice((0,external_wp_i18n_namespaceObject.__)('The editor has encountered an unexpected error. Please reload.'), { + type: 'snackbar' + }); + return; + } + const serializeBlocks = ({ + blocks: blocksForSerialization = [] + }) => (0,external_wp_blocks_namespaceObject.__unstableSerializeAndClean)(blocksForSerialization); + const edited = registry.select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord('postType', template.type, template.id); + + // We are fixing up the undo level here to make sure we can undo + // the revert in the header toolbar correctly. + registry.dispatch(external_wp_coreData_namespaceObject.store).editEntityRecord('postType', template.type, template.id, { + content: serializeBlocks, + // Required to make the `undo` behave correctly. + blocks: edited.blocks, + // Required to revert the blocks in the editor. + source: 'custom' // required to avoid turning the editor into a dirty state + }, { + undoIgnore: true // Required to merge this edit with the last undo level. + }); + const blocks = (0,external_wp_blocks_namespaceObject.parse)(fileTemplate?.content?.raw); + registry.dispatch(external_wp_coreData_namespaceObject.store).editEntityRecord('postType', template.type, fileTemplate.id, { + content: serializeBlocks, + blocks, + source: 'theme' + }); + if (allowUndo) { + const undoRevert = () => { + registry.dispatch(external_wp_coreData_namespaceObject.store).editEntityRecord('postType', template.type, edited.id, { + content: serializeBlocks, + blocks: edited.blocks, + source: 'custom' + }); + }; + registry.dispatch(external_wp_notices_namespaceObject.store).createSuccessNotice((0,external_wp_i18n_namespaceObject.__)('Template reset.'), { + type: 'snackbar', + id: noticeId, + actions: [{ + label: (0,external_wp_i18n_namespaceObject.__)('Undo'), + onClick: undoRevert + }] + }); + } + } catch (error) { + const errorMessage = error.message && error.code !== 'unknown_error' ? error.message : (0,external_wp_i18n_namespaceObject.__)('Template revert failed. Please reload.'); + registry.dispatch(external_wp_notices_namespaceObject.store).createErrorNotice(errorMessage, { + type: 'snackbar' + }); + } +}; + +/** + * Action that removes an array of templates, template parts or patterns. + * + * @param {Array} items An array of template,template part or pattern objects to remove. + */ +const removeTemplates = items => async ({ + registry +}) => { + const isResetting = items.every(item => item?.has_theme_file); + const promiseResult = await Promise.allSettled(items.map(item => { + return registry.dispatch(external_wp_coreData_namespaceObject.store).deleteEntityRecord('postType', item.type, item.id, { + force: true + }, { + throwOnError: true + }); + })); + + // If all the promises were fulfilled with success. + if (promiseResult.every(({ + status + }) => status === 'fulfilled')) { + let successMessage; + if (items.length === 1) { + // Depending on how the entity was retrieved its title might be + // an object or simple string. + let title; + if (typeof items[0].title === 'string') { + title = items[0].title; + } else if (typeof items[0].title?.rendered === 'string') { + title = items[0].title?.rendered; + } else if (typeof items[0].title?.raw === 'string') { + title = items[0].title?.raw; + } + successMessage = isResetting ? (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: The template/part's name. */ + (0,external_wp_i18n_namespaceObject.__)('"%s" reset.'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title)) : (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: The template/part's name. */ + (0,external_wp_i18n_namespaceObject._x)('"%s" deleted.', 'template part'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title)); + } else { + successMessage = isResetting ? (0,external_wp_i18n_namespaceObject.__)('Items reset.') : (0,external_wp_i18n_namespaceObject.__)('Items deleted.'); + } + registry.dispatch(external_wp_notices_namespaceObject.store).createSuccessNotice(successMessage, { + type: 'snackbar', + id: 'editor-template-deleted-success' + }); + } else { + // If there was at lease one failure. + let errorMessage; + // If we were trying to delete a single template. + if (promiseResult.length === 1) { + if (promiseResult[0].reason?.message) { + errorMessage = promiseResult[0].reason.message; + } else { + errorMessage = isResetting ? (0,external_wp_i18n_namespaceObject.__)('An error occurred while reverting the item.') : (0,external_wp_i18n_namespaceObject.__)('An error occurred while deleting the item.'); + } + // If we were trying to delete a multiple templates + } else { + const errorMessages = new Set(); + const failedPromises = promiseResult.filter(({ + status + }) => status === 'rejected'); + for (const failedPromise of failedPromises) { + if (failedPromise.reason?.message) { + errorMessages.add(failedPromise.reason.message); + } + } + if (errorMessages.size === 0) { + errorMessage = (0,external_wp_i18n_namespaceObject.__)('An error occurred while deleting the items.'); + } else if (errorMessages.size === 1) { + errorMessage = isResetting ? (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: an error message */ + (0,external_wp_i18n_namespaceObject.__)('An error occurred while reverting the items: %s'), [...errorMessages][0]) : (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: an error message */ + (0,external_wp_i18n_namespaceObject.__)('An error occurred while deleting the items: %s'), [...errorMessages][0]); + } else { + errorMessage = isResetting ? (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: a list of comma separated error messages */ + (0,external_wp_i18n_namespaceObject.__)('Some errors occurred while reverting the items: %s'), [...errorMessages].join(',')) : (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: a list of comma separated error messages */ + (0,external_wp_i18n_namespaceObject.__)('Some errors occurred while deleting the items: %s'), [...errorMessages].join(',')); + } + } + registry.dispatch(external_wp_notices_namespaceObject.store).createErrorNotice(errorMessage, { + type: 'snackbar' + }); + } +}; + +// EXTERNAL MODULE: ./node_modules/fast-deep-equal/index.js +var fast_deep_equal = __webpack_require__(5215); +var fast_deep_equal_default = /*#__PURE__*/__webpack_require__.n(fast_deep_equal); +;// ./node_modules/@wordpress/icons/build-module/library/navigation.js +/** + * WordPress dependencies + */ + + +const navigation = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + viewBox: "0 0 24 24", + xmlns: "http://www.w3.org/2000/svg", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "M12 4c-4.4 0-8 3.6-8 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8zm0 14.5c-3.6 0-6.5-2.9-6.5-6.5S8.4 5.5 12 5.5s6.5 2.9 6.5 6.5-2.9 6.5-6.5 6.5zM9 16l4.5-3L15 8.4l-4.5 3L9 16z" + }) +}); +/* harmony default export */ const library_navigation = (navigation); + +;// ./node_modules/@wordpress/icons/build-module/library/verse.js +/** + * WordPress dependencies + */ + + +const verse = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + viewBox: "0 0 24 24", + xmlns: "http://www.w3.org/2000/svg", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "M17.8 2l-.9.3c-.1 0-3.6 1-5.2 2.1C10 5.5 9.3 6.5 8.9 7.1c-.6.9-1.7 4.7-1.7 6.3l-.9 2.3c-.2.4 0 .8.4 1 .1 0 .2.1.3.1.3 0 .6-.2.7-.5l.6-1.5c.3 0 .7-.1 1.2-.2.7-.1 1.4-.3 2.2-.5.8-.2 1.6-.5 2.4-.8.7-.3 1.4-.7 1.9-1.2s.8-1.2 1-1.9c.2-.7.3-1.6.4-2.4.1-.8.1-1.7.2-2.5 0-.8.1-1.5.2-2.1V2zm-1.9 5.6c-.1.8-.2 1.5-.3 2.1-.2.6-.4 1-.6 1.3-.3.3-.8.6-1.4.9-.7.3-1.4.5-2.2.8-.6.2-1.3.3-1.8.4L15 7.5c.3-.3.6-.7 1-1.1 0 .4 0 .8-.1 1.2zM6 20h8v-1.5H6V20z" + }) +}); +/* harmony default export */ const library_verse = (verse); + +;// ./node_modules/@wordpress/editor/build-module/dataviews/store/private-selectors.js +/** + * Internal dependencies + */ + +const EMPTY_ARRAY = []; +function getEntityActions(state, kind, name) { + var _state$actions$kind$n; + return (_state$actions$kind$n = state.actions[kind]?.[name]) !== null && _state$actions$kind$n !== void 0 ? _state$actions$kind$n : EMPTY_ARRAY; +} +function getEntityFields(state, kind, name) { + var _state$fields$kind$na; + return (_state$fields$kind$na = state.fields[kind]?.[name]) !== null && _state$fields$kind$na !== void 0 ? _state$fields$kind$na : EMPTY_ARRAY; +} +function isEntityReady(state, kind, name) { + return state.isReady[kind]?.[name]; +} + +;// ./node_modules/@wordpress/editor/build-module/store/private-selectors.js +/* wp:polyfill */ +/** + * External dependencies + */ + + +/** + * WordPress dependencies + */ + + + + + +/** + * Internal dependencies + */ + + + +const EMPTY_INSERTION_POINT = { + rootClientId: undefined, + insertionIndex: undefined, + filterValue: undefined +}; + +/** + * Get the inserter. + * + * @param {Object} state Global application state. + * + * @return {Object} The root client ID, index to insert at and starting filter value. + */ +const getInserter = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (0,external_wp_data_namespaceObject.createSelector)(state => { + if (typeof state.blockInserterPanel === 'object') { + return state.blockInserterPanel; + } + if (getRenderingMode(state) === 'template-locked') { + const [postContentClientId] = select(external_wp_blockEditor_namespaceObject.store).getBlocksByName('core/post-content'); + if (postContentClientId) { + return { + rootClientId: postContentClientId, + insertionIndex: undefined, + filterValue: undefined + }; + } + } + return EMPTY_INSERTION_POINT; +}, state => { + const [postContentClientId] = select(external_wp_blockEditor_namespaceObject.store).getBlocksByName('core/post-content'); + return [state.blockInserterPanel, getRenderingMode(state), postContentClientId]; +})); +function getListViewToggleRef(state) { + return state.listViewToggleRef; +} +function getInserterSidebarToggleRef(state) { + return state.inserterSidebarToggleRef; +} +const CARD_ICONS = { + wp_block: library_symbol, + wp_navigation: library_navigation, + page: library_page, + post: library_verse +}; +const getPostIcon = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, postType, options) => { + { + if (postType === 'wp_template_part' || postType === 'wp_template') { + const templateAreas = select(external_wp_coreData_namespaceObject.store).getEntityRecord('root', '__unstableBase')?.default_template_part_areas || []; + const areaData = templateAreas.find(item => options.area === item.area); + if (areaData?.icon) { + return getTemplatePartIcon(areaData.icon); + } + return library_layout; + } + if (CARD_ICONS[postType]) { + return CARD_ICONS[postType]; + } + const postTypeEntity = select(external_wp_coreData_namespaceObject.store).getPostType(postType); + // `icon` is the `menu_icon` property of a post type. We + // only handle `dashicons` for now, even if the `menu_icon` + // also supports urls and svg as values. + if (typeof postTypeEntity?.icon === 'string' && postTypeEntity.icon.startsWith('dashicons-')) { + return postTypeEntity.icon.slice(10); + } + return library_page; + } +}); + +/** + * Returns true if there are unsaved changes to the + * post's meta fields, and false otherwise. + * + * @param {Object} state Global application state. + * @param {string} postType The post type of the post. + * @param {number} postId The ID of the post. + * + * @return {boolean} Whether there are edits or not in the meta fields of the relevant post. + */ +const hasPostMetaChanges = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, postType, postId) => { + const { + type: currentPostType, + id: currentPostId + } = getCurrentPost(state); + // If no postType or postId is passed, use the current post. + const edits = select(external_wp_coreData_namespaceObject.store).getEntityRecordNonTransientEdits('postType', postType || currentPostType, postId || currentPostId); + if (!edits?.meta) { + return false; + } + + // Compare if anything apart from `footnotes` has changed. + const originalPostMeta = select(external_wp_coreData_namespaceObject.store).getEntityRecord('postType', postType || currentPostType, postId || currentPostId)?.meta; + return !fast_deep_equal_default()({ + ...originalPostMeta, + footnotes: undefined + }, { + ...edits.meta, + footnotes: undefined + }); +}); +function private_selectors_getEntityActions(state, ...args) { + return getEntityActions(state.dataviews, ...args); +} +function private_selectors_isEntityReady(state, ...args) { + return isEntityReady(state.dataviews, ...args); +} +function private_selectors_getEntityFields(state, ...args) { + return getEntityFields(state.dataviews, ...args); +} + +/** + * Similar to getBlocksByName in @wordpress/block-editor, but only returns the top-most + * blocks that aren't descendants of the query block. + * + * @param {Object} state Global application state. + * @param {Array|string} blockNames Block names of the blocks to retrieve. + * + * @return {Array} Block client IDs. + */ +const getPostBlocksByName = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (0,external_wp_data_namespaceObject.createSelector)((state, blockNames) => { + blockNames = Array.isArray(blockNames) ? blockNames : [blockNames]; + const { + getBlocksByName, + getBlockParents, + getBlockName + } = select(external_wp_blockEditor_namespaceObject.store); + return getBlocksByName(blockNames).filter(clientId => getBlockParents(clientId).every(parentClientId => { + const parentBlockName = getBlockName(parentClientId); + return ( + // Ignore descendents of the query block. + parentBlockName !== 'core/query' && + // Enable only the top-most block. + !blockNames.includes(parentBlockName) + ); + })); +}, () => [select(external_wp_blockEditor_namespaceObject.store).getBlocks()])); + +;// ./node_modules/@wordpress/editor/build-module/store/index.js +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + + + + + + + +/** + * Post editor data store configuration. + * + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#registerStore + */ +const storeConfig = { + reducer: store_reducer, + selectors: selectors_namespaceObject, + actions: actions_namespaceObject +}; + +/** + * Store definition for the editor namespace. + * + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore + */ +const store_store = (0,external_wp_data_namespaceObject.createReduxStore)(STORE_NAME, { + ...storeConfig +}); +(0,external_wp_data_namespaceObject.register)(store_store); +unlock(store_store).registerPrivateActions(store_private_actions_namespaceObject); +unlock(store_store).registerPrivateSelectors(store_private_selectors_namespaceObject); + +;// ./node_modules/@wordpress/editor/build-module/hooks/custom-sources-backwards-compatibility.js +/* wp:polyfill */ +/** + * WordPress dependencies + */ + + + + + + +/** + * Internal dependencies + */ + + +/** @typedef {import('@wordpress/compose').WPHigherOrderComponent} WPHigherOrderComponent */ +/** @typedef {import('@wordpress/blocks').WPBlockSettings} WPBlockSettings */ + +/** + * Object whose keys are the names of block attributes, where each value + * represents the meta key to which the block attribute is intended to save. + * + * @see https://developer.wordpress.org/reference/functions/register_meta/ + * + * @typedef {Object} WPMetaAttributeMapping + */ + +/** + * Given a mapping of attribute names (meta source attributes) to their + * associated meta key, returns a higher order component that overrides its + * `attributes` and `setAttributes` props to sync any changes with the edited + * post's meta keys. + * + * @param {WPMetaAttributeMapping} metaAttributes Meta attribute mapping. + * + * @return {WPHigherOrderComponent} Higher-order component. + */ + +const createWithMetaAttributeSource = metaAttributes => (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(BlockEdit => ({ + attributes, + setAttributes, + ...props +}) => { + const postType = (0,external_wp_data_namespaceObject.useSelect)(select => select(store_store).getCurrentPostType(), []); + const [meta, setMeta] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'meta'); + const mergedAttributes = (0,external_wp_element_namespaceObject.useMemo)(() => ({ + ...attributes, + ...Object.fromEntries(Object.entries(metaAttributes).map(([attributeKey, metaKey]) => [attributeKey, meta[metaKey]])) + }), [attributes, meta]); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockEdit, { + attributes: mergedAttributes, + setAttributes: nextAttributes => { + const nextMeta = Object.fromEntries(Object.entries(nextAttributes !== null && nextAttributes !== void 0 ? nextAttributes : {}).filter( + // Filter to intersection of keys between the updated + // attributes and those with an associated meta key. + ([key]) => key in metaAttributes).map(([attributeKey, value]) => [ + // Rename the keys to the expected meta key name. + metaAttributes[attributeKey], value])); + if (Object.entries(nextMeta).length) { + setMeta(nextMeta); + } + setAttributes(nextAttributes); + }, + ...props + }); +}, 'withMetaAttributeSource'); + +/** + * Filters a registered block's settings to enhance a block's `edit` component + * to upgrade meta-sourced attributes to use the post's meta entity property. + * + * @param {WPBlockSettings} settings Registered block settings. + * + * @return {WPBlockSettings} Filtered block settings. + */ +function shimAttributeSource(settings) { + var _settings$attributes; + /** @type {WPMetaAttributeMapping} */ + const metaAttributes = Object.fromEntries(Object.entries((_settings$attributes = settings.attributes) !== null && _settings$attributes !== void 0 ? _settings$attributes : {}).filter(([, { + source + }]) => source === 'meta').map(([attributeKey, { + meta + }]) => [attributeKey, meta])); + if (Object.entries(metaAttributes).length) { + settings.edit = createWithMetaAttributeSource(metaAttributes)(settings.edit); + } + return settings; +} +(0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/editor/custom-sources-backwards-compatibility/shim-attribute-source', shimAttributeSource); + +;// ./node_modules/@wordpress/editor/build-module/components/autocompleters/user.js +/* wp:polyfill */ +/** + * WordPress dependencies + */ + + + + +function getUserLabel(user) { + const avatar = user.avatar_urls && user.avatar_urls[24] ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { + className: "editor-autocompleters__user-avatar", + alt: "", + src: user.avatar_urls[24] + }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { + className: "editor-autocompleters__no-avatar" + }); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [avatar, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { + className: "editor-autocompleters__user-name", + children: user.name + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { + className: "editor-autocompleters__user-slug", + children: user.slug + })] + }); +} + +/** + * A user mentions completer. + * + * @type {Object} + */ +/* harmony default export */ const user = ({ + name: 'users', + className: 'editor-autocompleters__user', + triggerPrefix: '@', + useItems(filterValue) { + const users = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getUsers + } = select(external_wp_coreData_namespaceObject.store); + return getUsers({ + context: 'view', + search: encodeURIComponent(filterValue) + }); + }, [filterValue]); + const options = (0,external_wp_element_namespaceObject.useMemo)(() => users ? users.map(user => ({ + key: `user-${user.slug}`, + value: user, + label: getUserLabel(user) + })) : [], [users]); + return [options]; + }, + getOptionCompletion(user) { + return `@${user.slug}`; + } +}); + +;// ./node_modules/@wordpress/editor/build-module/hooks/default-autocompleters.js +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + +function setDefaultCompleters(completers = []) { + // Provide copies so filters may directly modify them. + completers.push({ + ...user + }); + return completers; +} +(0,external_wp_hooks_namespaceObject.addFilter)('editor.Autocomplete.completers', 'editor/autocompleters/set-default-completers', setDefaultCompleters); + +;// ./node_modules/@wordpress/editor/build-module/hooks/media-upload.js +/** + * WordPress dependencies + */ + + +(0,external_wp_hooks_namespaceObject.addFilter)('editor.MediaUpload', 'core/editor/components/media-upload', () => external_wp_mediaUtils_namespaceObject.MediaUpload); + +;// ./node_modules/@wordpress/editor/build-module/hooks/pattern-overrides.js +/* wp:polyfill */ +/** + * WordPress dependencies + */ + + + + + + + +/** + * Internal dependencies + */ + + + +/** @typedef {import('@wordpress/blocks').WPBlockSettings} WPBlockSettings */ + +const { + PatternOverridesControls, + ResetOverridesControl, + PatternOverridesBlockControls, + PATTERN_TYPES: pattern_overrides_PATTERN_TYPES, + PARTIAL_SYNCING_SUPPORTED_BLOCKS, + PATTERN_SYNC_TYPES +} = unlock(external_wp_patterns_namespaceObject.privateApis); + +/** + * Override the default edit UI to include a new block inspector control for + * assigning a partial syncing controls to supported blocks in the pattern editor. + * Currently, only the `core/paragraph` block is supported. + * + * @param {Component} BlockEdit Original component. + * + * @return {Component} Wrapped component. + */ +const withPatternOverrideControls = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(BlockEdit => props => { + const isSupportedBlock = !!PARTIAL_SYNCING_SUPPORTED_BLOCKS[props.name]; + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockEdit, { + ...props + }, "edit"), props.isSelected && isSupportedBlock && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ControlsWithStoreSubscription, { + ...props + }), isSupportedBlock && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PatternOverridesBlockControls, {})] + }); +}, 'withPatternOverrideControls'); + +// Split into a separate component to avoid a store subscription +// on every block. +function ControlsWithStoreSubscription(props) { + const blockEditingMode = (0,external_wp_blockEditor_namespaceObject.useBlockEditingMode)(); + const { + hasPatternOverridesSource, + isEditingSyncedPattern + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getCurrentPostType, + getEditedPostAttribute + } = select(store_store); + return { + // For editing link to the site editor if the theme and user permissions support it. + hasPatternOverridesSource: !!(0,external_wp_blocks_namespaceObject.getBlockBindingsSource)('core/pattern-overrides'), + isEditingSyncedPattern: getCurrentPostType() === pattern_overrides_PATTERN_TYPES.user && getEditedPostAttribute('meta')?.wp_pattern_sync_status !== PATTERN_SYNC_TYPES.unsynced && getEditedPostAttribute('wp_pattern_sync_status') !== PATTERN_SYNC_TYPES.unsynced + }; + }, []); + const bindings = props.attributes.metadata?.bindings; + const hasPatternBindings = !!bindings && Object.values(bindings).some(binding => binding.source === 'core/pattern-overrides'); + const shouldShowPatternOverridesControls = isEditingSyncedPattern && blockEditingMode === 'default'; + const shouldShowResetOverridesControl = !isEditingSyncedPattern && !!props.attributes.metadata?.name && blockEditingMode !== 'disabled' && hasPatternBindings; + if (!hasPatternOverridesSource) { + return null; + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [shouldShowPatternOverridesControls && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PatternOverridesControls, { + ...props + }), shouldShowResetOverridesControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ResetOverridesControl, { + ...props + })] + }); +} +(0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockEdit', 'core/editor/with-pattern-override-controls', withPatternOverrideControls); + +;// ./node_modules/@wordpress/editor/build-module/hooks/index.js +/** + * Internal dependencies + */ + + + + + ;// ./node_modules/@wordpress/editor/build-module/components/autocompleters/index.js @@ -10357,10 +16119,48 @@ const chevronLeftSmall = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObjec }); /* harmony default export */ const chevron_left_small = (chevronLeftSmall); -;// external ["wp","keycodes"] -const external_wp_keycodes_namespaceObject = window["wp"]["keycodes"]; -;// external ["wp","commands"] -const external_wp_commands_namespaceObject = window["wp"]["commands"]; +;// external ["wp","dom"] +const external_wp_dom_namespaceObject = window["wp"]["dom"]; +;// ./node_modules/@wordpress/editor/build-module/utils/pageTypeBadge.js +/** + * WordPress dependencies + */ + + + + +/** + * Custom hook to get the page type badge for the current post on edit site view. + * + * @param {number|string} postId postId of the current post being edited. + */ +function usePageTypeBadge(postId) { + const { + isFrontPage, + isPostsPage + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + canUser, + getEditedEntityRecord + } = select(external_wp_coreData_namespaceObject.store); + const siteSettings = canUser('read', { + kind: 'root', + name: 'site' + }) ? getEditedEntityRecord('root', 'site') : undefined; + const _postId = parseInt(postId, 10); + return { + isFrontPage: siteSettings?.page_on_front === _postId, + isPostsPage: siteSettings?.page_for_posts === _postId + }; + }); + if (isFrontPage) { + return (0,external_wp_i18n_namespaceObject.__)('Homepage'); + } else if (isPostsPage) { + return (0,external_wp_i18n_namespaceObject.__)('Posts Page'); + } + return false; +} + ;// ./node_modules/@wordpress/editor/build-module/components/document-bar/index.js /** * External dependencies @@ -10382,15 +16182,17 @@ const external_wp_commands_namespaceObject = window["wp"]["commands"]; + /** * Internal dependencies */ -/** @typedef {import("@wordpress/components").IconType} IconType */ +/** @typedef {import("@wordpress/components").IconType} IconType */ + const MotionButton = (0,external_wp_components_namespaceObject.__unstableMotion)(external_wp_components_namespaceObject.Button); /** @@ -10408,23 +16210,25 @@ const MotionButton = (0,external_wp_components_namespaceObject.__unstableMotion) * @param {IconType} props.icon An icon for the document, no default. * (A default icon indicating the document post type is no longer used.) * - * @return {JSX.Element} The rendered DocumentBar component. + * @return {React.ReactNode} The rendered DocumentBar component. */ function DocumentBar(props) { const { + postId, postType, postTypeLabel, documentTitle, isNotFound, - isUnsyncedPattern, templateTitle, - onNavigateToPreviousEntityRecord + onNavigateToPreviousEntityRecord, + isTemplatePreview } = (0,external_wp_data_namespaceObject.useSelect)(select => { + var _select$getEntityReco; const { getCurrentPostType, getCurrentPostId, getEditorSettings, - __experimentalGetTemplateInfo: getTemplateInfo + getRenderingMode } = select(store_store); const { getEditedEntityRecord, @@ -10434,16 +16238,23 @@ function DocumentBar(props) { const _postType = getCurrentPostType(); const _postId = getCurrentPostId(); const _document = getEditedEntityRecord('postType', _postType, _postId); - const _templateInfo = getTemplateInfo(_document); + const { + default_template_types: templateTypes = [] + } = (_select$getEntityReco = select(external_wp_coreData_namespaceObject.store).getEntityRecord('root', '__unstableBase')) !== null && _select$getEntityReco !== void 0 ? _select$getEntityReco : {}; + const _templateInfo = getTemplateInfo({ + templateTypes, + template: _document + }); const _postTypeLabel = getPostType(_postType)?.labels?.singular_name; return { + postId: _postId, postType: _postType, postTypeLabel: _postTypeLabel, documentTitle: _document.title, isNotFound: !_document && !isResolvingSelector('getEditedEntityRecord', 'postType', _postType, _postId), - isUnsyncedPattern: _document?.wp_pattern_sync_status === 'unsynced', templateTitle: _templateInfo.title, - onNavigateToPreviousEntityRecord: getEditorSettings().onNavigateToPreviousEntityRecord + onNavigateToPreviousEntityRecord: getEditorSettings().onNavigateToPreviousEntityRecord, + isTemplatePreview: getRenderingMode() === 'template-locked' }; }, []); const { @@ -10451,19 +16262,18 @@ function DocumentBar(props) { } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_commands_namespaceObject.store); const isReducedMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)(); const isTemplate = TEMPLATE_POST_TYPES.includes(postType); - const isGlobalEntity = GLOBAL_POST_TYPES.includes(postType); const hasBackButton = !!onNavigateToPreviousEntityRecord; const entityTitle = isTemplate ? templateTitle : documentTitle; const title = props.title || entityTitle; const icon = props.icon; + const pageTypeBadge = usePageTypeBadge(postId); const mountedRef = (0,external_wp_element_namespaceObject.useRef)(false); (0,external_wp_element_namespaceObject.useEffect)(() => { mountedRef.current = true; }, []); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: dist_clsx('editor-document-bar', { - 'has-back-button': hasBackButton, - 'is-global': isGlobalEntity && !isUnsyncedPattern + 'has-back-button': hasBackButton }), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableAnimatePresence, { children: hasBackButton && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MotionButton, { @@ -10492,6 +16302,9 @@ function DocumentBar(props) { } : undefined, children: (0,external_wp_i18n_namespaceObject.__)('Back') }) + }), !isTemplate && isTemplatePreview && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockIcon, { + icon: library_layout, + className: "editor-document-bar__icon-layout" }), isNotFound ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { children: (0,external_wp_i18n_namespaceObject.__)('Document not found') }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Button, { @@ -10522,10 +16335,13 @@ function DocumentBar(props) { as: "h1", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "editor-document-bar__post-title", - children: title ? (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title) : (0,external_wp_i18n_namespaceObject.__)('No title') - }), postTypeLabel && !props.title && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { + children: title ? (0,external_wp_dom_namespaceObject.__unstableStripHTML)(title) : (0,external_wp_i18n_namespaceObject.__)('No title') + }), pageTypeBadge && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "editor-document-bar__post-type-label", - children: '· ' + (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(postTypeLabel) + children: `· ${pageTypeBadge}` + }), postTypeLabel && !props.title && !pageTypeBadge && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { + className: "editor-document-bar__post-type-label", + children: `· ${(0,external_wp_htmlEntities_namespaceObject.decodeEntities)(postTypeLabel)}` })] })] }, hasBackButton), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { @@ -10544,7 +16360,6 @@ const external_wp_richText_namespaceObject = window["wp"]["richText"]; */ - const TableOfContentsItem = ({ children, isValid, @@ -10574,6 +16389,7 @@ const TableOfContentsItem = ({ /* harmony default export */ const document_outline_item = (TableOfContentsItem); ;// ./node_modules/@wordpress/editor/build-module/components/document-outline/index.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -10584,6 +16400,7 @@ const TableOfContentsItem = ({ + /** * Internal dependencies */ @@ -10594,7 +16411,6 @@ const TableOfContentsItem = ({ * Module constants */ - const emptyHeadingContent = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("em", { children: (0,external_wp_i18n_namespaceObject.__)('(Empty heading)') }); @@ -10714,15 +16530,13 @@ const isEmptyHeading = heading => !heading.attributes.content || heading.attribu * Renders a document outline component. * * @param {Object} props Props. - * @param {Function} props.onSelect Function to be called when an outline item is selected. - * @param {boolean} props.isTitleSupported Indicates whether the title is supported. + * @param {Function} props.onSelect Function to be called when an outline item is selected * @param {boolean} props.hasOutlineItemsDisabled Indicates whether the outline items are disabled. * - * @return {Component} The component to be rendered. + * @return {React.ReactNode} The rendered component. */ function DocumentOutline({ onSelect, - isTitleSupported, hasOutlineItemsDisabled }) { const { @@ -10730,7 +16544,8 @@ function DocumentOutline({ } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); const { blocks, - title + title, + isTitleSupported } = (0,external_wp_data_namespaceObject.useSelect)(select => { var _postType$supports$ti; const { @@ -10749,6 +16564,7 @@ function DocumentOutline({ isTitleSupported: (_postType$supports$ti = postType?.supports?.title) !== null && _postType$supports$ti !== void 0 ? _postType$supports$ti : false }; }); + const prevHeadingLevelRef = (0,external_wp_element_namespaceObject.useRef)(1); const headings = computeOutlineHeadings(blocks); if (headings.length < 1) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { @@ -10758,7 +16574,6 @@ function DocumentOutline({ })] }); } - let prevHeadingLevel = 1; // Not great but it's the simplest way to locate the title right now. const titleNode = document.querySelector('.editor-post-title__input'); @@ -10778,12 +16593,12 @@ function DocumentOutline({ href: `#${titleNode.id}`, isDisabled: hasOutlineItemsDisabled, children: title - }), headings.map((item, index) => { + }), headings.map(item => { // Headings remain the same, go up by one, or down by any amount. // Otherwise there are missing levels. - const isIncorrectLevel = item.level > prevHeadingLevel + 1; + const isIncorrectLevel = item.level > prevHeadingLevelRef.current + 1; const isValid = !item.isEmpty && !isIncorrectLevel && !!item.level && (item.level !== 1 || !hasMultipleH1 && !hasTitle); - prevHeadingLevel = item.level; + prevHeadingLevelRef.current = item.level; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(document_outline_item, { level: `H${item.level}`, isValid: isValid, @@ -10796,7 +16611,7 @@ function DocumentOutline({ children: [item.isEmpty ? emptyHeadingContent : (0,external_wp_richText_namespaceObject.getTextContent)((0,external_wp_richText_namespaceObject.create)({ html: item.attributes.content })), isIncorrectLevel && incorrectLevelContent, item.level === 1 && hasMultipleH1 && multipleH1Headings, hasTitle && item.level === 1 && !hasMultipleH1 && singleH1Headings] - }, index); + }, item.clientId); })] }) }); @@ -10812,10 +16627,10 @@ function DocumentOutline({ /** * Component check if there are any headings (core/heading blocks) present in the document. * - * @param {Object} props Props. - * @param {Element} props.children Children to be rendered. + * @param {Object} props Props. + * @param {React.ReactNode} props.children Children to be rendered. * - * @return {Component|null} The component to be rendered or null if there are headings. + * @return {React.ReactNode} The component to be rendered or null if there are headings. */ function DocumentOutlineCheck({ children @@ -10826,7 +16641,7 @@ function DocumentOutlineCheck({ } = select(external_wp_blockEditor_namespaceObject.store); return getGlobalBlockCount('core/heading') > 0; }); - if (hasHeadings) { + if (!hasHeadings) { return null; } return children; @@ -10902,7 +16717,7 @@ function EditorKeyboardShortcutsRegister() { registerShortcut({ name: 'core/editor/toggle-list-view', category: 'global', - description: (0,external_wp_i18n_namespaceObject.__)('Open the List View.'), + description: (0,external_wp_i18n_namespaceObject.__)('Show or hide the List View.'), keyCombination: { modifier: 'access', character: 'o' @@ -10911,7 +16726,7 @@ function EditorKeyboardShortcutsRegister() { registerShortcut({ name: 'core/editor/toggle-distraction-free', category: 'global', - description: (0,external_wp_i18n_namespaceObject.__)('Toggle distraction free mode.'), + description: (0,external_wp_i18n_namespaceObject.__)('Enter or exit distraction free mode.'), keyCombination: { modifier: 'primaryShift', character: '\\' @@ -10920,7 +16735,7 @@ function EditorKeyboardShortcutsRegister() { registerShortcut({ name: 'core/editor/toggle-sidebar', category: 'global', - description: (0,external_wp_i18n_namespaceObject.__)('Show or hide the Settings sidebar.'), + description: (0,external_wp_i18n_namespaceObject.__)('Show or hide the Settings panel.'), keyCombination: { modifier: 'primaryShift', character: ',' @@ -11047,7 +16862,7 @@ function EditorHistoryRedo(props, ref) { * @param {Object} props - Props. * @param {Ref} ref - Forwarded ref. * - * @return {Component} The component to be rendered. + * @return {React.ReactNode} The rendered component. */ /* harmony default export */ const editor_history_redo = ((0,external_wp_element_namespaceObject.forwardRef)(EditorHistoryRedo)); @@ -11098,7 +16913,7 @@ function EditorHistoryUndo(props, ref) { * @param {Object} props - Props. * @param {Ref} ref - Forwarded ref. * - * @return {Component} The component to be rendered. + * @return {React.ReactNode} The rendered component. */ /* harmony default export */ const editor_history_undo = ((0,external_wp_element_namespaceObject.forwardRef)(EditorHistoryUndo)); @@ -11112,8 +16927,6 @@ function EditorHistoryUndo(props, ref) { - - function TemplateValidationNotice() { const [showConfirmDialog, setShowConfirmDialog] = (0,external_wp_element_namespaceObject.useState)(false); const isValid = (0,external_wp_data_namespaceObject.useSelect)(select => { @@ -11154,6 +16967,7 @@ function TemplateValidationNotice() { } ;// ./node_modules/@wordpress/editor/build-module/components/editor-notices/index.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -11174,11 +16988,9 @@ function TemplateValidationNotice() { * * ``` * - * @return {JSX.Element} The rendered EditorNotices component. + * @return {React.ReactNode} The rendered EditorNotices component. */ - - function EditorNotices() { const { notices @@ -11211,6 +17023,7 @@ function EditorNotices() { /* harmony default export */ const editor_notices = (EditorNotices); ;// ./node_modules/@wordpress/editor/build-module/components/editor-snackbars/index.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -11225,7 +17038,7 @@ const MAX_VISIBLE_NOTICES = -3; /** * Renders the editor snackbars component. * - * @return {JSX.Element} The rendered component. + * @return {React.ReactNode} The rendered component. */ function EditorSnackbars() { const notices = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_notices_namespaceObject.store).getNotices(), []); @@ -11259,7 +17072,6 @@ function EditorSnackbars() { - function EntityRecordItem({ record, checked, @@ -11277,6 +17089,7 @@ function EntityRecordItem({ entityRecordTitle, hasPostMetaChanges } = (0,external_wp_data_namespaceObject.useSelect)(select => { + var _select$getEntityReco; if ('postType' !== kind || 'wp_template' !== name) { return { entityRecordTitle: title, @@ -11284,8 +17097,14 @@ function EntityRecordItem({ }; } const template = select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord(kind, name, key); + const { + default_template_types: templateTypes = [] + } = (_select$getEntityReco = select(external_wp_coreData_namespaceObject.store).getEntityRecord('root', '__unstableBase')) !== null && _select$getEntityReco !== void 0 ? _select$getEntityReco : {}; return { - entityRecordTitle: select(store_store).__experimentalGetTemplateInfo(template).title, + entityRecordTitle: getTemplateInfo({ + template, + templateTypes + }).title, hasPostMetaChanges: unlock(select(store_store)).hasPostMetaChanges(name, key) }; }, [name, kind, title, key]); @@ -11307,6 +17126,7 @@ function EntityRecordItem({ } ;// ./node_modules/@wordpress/editor/build-module/components/entities-saved-states/entity-type-list.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -11323,10 +17143,9 @@ function EntityRecordItem({ - const { getGlobalStylesChanges, - GlobalStylesContext + GlobalStylesContext: entity_type_list_GlobalStylesContext } = unlock(external_wp_blockEditor_namespaceObject.privateApis); function getEntityDescription(entity, count) { switch (entity) { @@ -11344,7 +17163,7 @@ function GlobalStylesDescription({ }) { const { user: currentEditorGlobalStyles - } = (0,external_wp_element_namespaceObject.useContext)(GlobalStylesContext); + } = (0,external_wp_element_namespaceObject.useContext)(entity_type_list_GlobalStylesContext); const savedRecord = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getEntityRecord(record.kind, record.name, record.key), [record.kind, record.name, record.key]); const globalStylesChanges = getGlobalStylesChanges(currentEditorGlobalStyles, savedRecord, { maxResults: 10 @@ -11399,6 +17218,7 @@ function EntityTypeList({ } ;// ./node_modules/@wordpress/editor/build-module/components/entities-saved-states/hooks/use-is-dirty.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -11478,6 +17298,7 @@ const useIsDirty = () => { }; ;// ./node_modules/@wordpress/editor/build-module/components/entities-saved-states/index.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -11495,7 +17316,6 @@ const useIsDirty = () => { - function identity(values) { return values; } @@ -11505,13 +17325,13 @@ function identity(values) { * * @param {Object} props The component props. * @param {Function} props.close The function to close the dialog. - * @param {Function} props.renderDialog The function to render the dialog. + * @param {boolean} props.renderDialog Whether to render the component with modal dialog behavior. * - * @return {JSX.Element} The rendered component. + * @return {React.ReactNode} The rendered component. */ function EntitiesSavedStates({ close, - renderDialog = undefined + renderDialog }) { const isDirtyProps = useIsDirty(); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EntitiesSavedStatesExtensible, { @@ -11530,13 +17350,13 @@ function EntitiesSavedStates({ * @param {Function} props.onSave Function to call when saving entities. * @param {boolean} props.saveEnabled Flag indicating if save is enabled. * @param {string} props.saveLabel Label for the save button. - * @param {Function} props.renderDialog Function to render a custom dialog. + * @param {boolean} props.renderDialog Whether to render the component with modal dialog behavior. * @param {Array} props.dirtyEntityRecords Array of dirty entity records. * @param {boolean} props.isDirty Flag indicating if there are dirty entities. * @param {Function} props.setUnselectedEntities Function to set unselected entities. * @param {Array} props.unselectedEntities Array of unselected entities. * - * @return {JSX.Element} The rendered component. + * @return {React.ReactNode} The rendered component. */ function EntitiesSavedStatesExtensible({ additionalPrompt = undefined, @@ -11544,7 +17364,7 @@ function EntitiesSavedStatesExtensible({ onSave = identity, saveEnabled: saveEnabledProp = undefined, saveLabel = (0,external_wp_i18n_namespaceObject.__)('Save'), - renderDialog = undefined, + renderDialog, dirtyEntityRecords, isDirty, setUnselectedEntities, @@ -11583,9 +17403,10 @@ function EntitiesSavedStatesExtensible({ }); const dialogLabel = (0,external_wp_compose_namespaceObject.useInstanceId)(EntitiesSavedStatesExtensible, 'label'); const dialogDescription = (0,external_wp_compose_namespaceObject.useInstanceId)(EntitiesSavedStatesExtensible, 'description'); + const selectItemsToSaveDescription = !!dirtyEntityRecords.length ? (0,external_wp_i18n_namespaceObject.__)('Select the items you want to save.') : undefined; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { - ref: saveDialogRef, - ...saveDialogProps, + ref: renderDialog ? saveDialogRef : undefined, + ...(renderDialog && saveDialogProps), className: "entities-saved-states__panel", role: renderDialog ? 'dialog' : undefined, "aria-labelledby": renderDialog ? dialogLabel : undefined, @@ -11628,10 +17449,10 @@ function EntitiesSavedStatesExtensible({ }), additionalPrompt] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { id: renderDialog ? dialogDescription : undefined, - children: isDirty ? (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %d: number of site changes waiting to be saved. */ - (0,external_wp_i18n_namespaceObject._n)('There is %d site change waiting to be saved.', 'There are %d site changes waiting to be saved.', sortedPartitionedSavables.length), sortedPartitionedSavables.length), { + children: isDirty ? (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %d: number of site changes waiting to be saved. */ + (0,external_wp_i18n_namespaceObject._n)('There is %d site change waiting to be saved.', 'There are %d site changes waiting to be saved.', dirtyEntityRecords.length), dirtyEntityRecords.length), { strong: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("strong", {}) - }) : (0,external_wp_i18n_namespaceObject.__)('Select the items you want to save.') + }) : selectItemsToSaveDescription })] }), sortedPartitionedSavables.map(list => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EntityTypeList, { @@ -11654,7 +17475,6 @@ function EntitiesSavedStatesExtensible({ - /** * Internal dependencies */ @@ -11673,12 +17493,13 @@ function getContent() { } function CopyButton({ text, - children + children, + variant = 'secondary' }) { const ref = (0,external_wp_compose_namespaceObject.useCopyToClipboard)(text); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, - variant: "secondary", + variant: variant, ref: ref, children: children }); @@ -11702,20 +17523,33 @@ class ErrorBoundary extends external_wp_element_namespaceObject.Component { const { error } = this.state; + const { + canCopyContent = false + } = this.props; if (!error) { return this.props.children; } - const actions = [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CopyButton, { - text: getContent, - children: (0,external_wp_i18n_namespaceObject.__)('Copy Post Text') - }, "copy-post"), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CopyButton, { - text: error.stack, - children: (0,external_wp_i18n_namespaceObject.__)('Copy Error') - }, "copy-error")]; - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.Warning, { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { className: "editor-error-boundary", - actions: actions, - children: (0,external_wp_i18n_namespaceObject.__)('The editor has encountered an unexpected error.') + alignment: "baseline", + spacing: 4, + justify: "space-between", + expanded: false, + wrap: true, + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { + as: "p", + children: (0,external_wp_i18n_namespaceObject.__)('The editor has encountered an unexpected error.') + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { + expanded: false, + children: [canCopyContent && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CopyButton, { + text: getContent, + children: (0,external_wp_i18n_namespaceObject.__)('Copy contents') + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CopyButton, { + variant: "primary", + text: error?.stack, + children: (0,external_wp_i18n_namespaceObject.__)('Copy error') + })] + })] }); } } @@ -11733,6 +17567,7 @@ class ErrorBoundary extends external_wp_element_namespaceObject.Component { /* harmony default export */ const error_boundary = (ErrorBoundary); ;// ./node_modules/@wordpress/editor/build-module/components/local-autosave-monitor/index.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -11938,10 +17773,10 @@ function LocalAutosaveMonitor() { /** * Wrapper component that renders its children only if the post type supports page attributes. * - * @param {Object} props - The component props. - * @param {Element} props.children - The child components to render. + * @param {Object} props - The component props. + * @param {React.ReactNode} props.children - The child components to render. * - * @return {Component|null} The rendered child components or null if page attributes are not supported. + * @return {React.ReactNode} The rendered child components or null if page attributes are not supported. */ function PageAttributesCheck({ children @@ -11966,6 +17801,7 @@ function PageAttributesCheck({ /* harmony default export */ const page_attributes_check = (PageAttributesCheck); ;// ./node_modules/@wordpress/editor/build-module/components/post-type-support-check/index.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -11982,12 +17818,12 @@ function PageAttributesCheck({ * type supports one of the given `supportKeys` prop. * * @param {Object} props Props. - * @param {Element} props.children Children to be rendered if post + * @param {React.ReactNode} props.children Children to be rendered if post * type supports. * @param {(string|string[])} props.supportKeys String or string array of keys * to test. * - * @return {Component} The component to be rendered. + * @return {React.ReactNode} The component to be rendered. */ function PostTypeSupportCheck({ children, @@ -12069,7 +17905,7 @@ function PageAttributesOrder() { * for setting the order of a given page. * The component is now not used in core but was kept for backward compatibility. * - * @return {Component} The component to be rendered. + * @return {React.ReactNode} The rendered component. */ function PageAttributesOrderWithChecks() { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_type_support_check, { @@ -12078,9 +17914,6 @@ function PageAttributesOrderWithChecks() { }); } -// EXTERNAL MODULE: ./node_modules/remove-accents/index.js -var remove_accents = __webpack_require__(9681); -var remove_accents_default = /*#__PURE__*/__webpack_require__.n(remove_accents); ;// ./node_modules/@wordpress/editor/build-module/components/post-panel-row/index.js /** * External dependencies @@ -12093,7 +17926,6 @@ var remove_accents_default = /*#__PURE__*/__webpack_require__.n(remove_accents); - const PostPanelRow = (0,external_wp_element_namespaceObject.forwardRef)(({ className, label, @@ -12114,6 +17946,7 @@ const PostPanelRow = (0,external_wp_element_namespaceObject.forwardRef)(({ /* harmony default export */ const post_panel_row = (PostPanelRow); ;// ./node_modules/@wordpress/editor/build-module/utils/terms.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -12126,11 +17959,11 @@ const PostPanelRow = (0,external_wp_element_namespaceObject.forwardRef)(({ * * @return {Array} Array of terms in tree format. */ -function buildTermsTree(flatTerms) { +function terms_buildTermsTree(flatTerms) { const flatTermsWithParentAndChildren = flatTerms.map(term => { return { children: [], - parent: null, + parent: undefined, ...term }; }); @@ -12138,7 +17971,7 @@ function buildTermsTree(flatTerms) { // All terms should have a `parent` because we're about to index them by it. if (flatTermsWithParentAndChildren.some(({ parent - }) => parent === null)) { + }) => parent === undefined)) { return flatTermsWithParentAndChildren; } const termsByParent = flatTermsWithParentAndChildren.reduce((acc, term) => { @@ -12193,6 +18026,7 @@ const unescapeTerms = terms => { }; ;// ./node_modules/@wordpress/editor/build-module/components/page-attributes/parent.js +/* wp:polyfill */ /** * External dependencies */ @@ -12218,11 +18052,10 @@ const unescapeTerms = terms => { - function getTitle(post) { return post?.title?.rendered ? (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(post.title.rendered) : `#${post.id} (${(0,external_wp_i18n_namespaceObject.__)('no title')})`; } -const getItemPriority = (name, searchValue) => { +const parent_getItemPriority = (name, searchValue) => { const normalizedName = remove_accents_default()(name || '').toLowerCase(); const normalizedSearch = remove_accents_default()(searchValue || '').toLowerCase(); if (normalizedName === normalizedSearch) { @@ -12238,9 +18071,9 @@ const getItemPriority = (name, searchValue) => { * Renders the Page Attributes Parent component. A dropdown menu in an editor interface * for selecting the parent page of a given page. * - * @return {Component|null} The component to be rendered. Return null if post type is not hierarchical. + * @return {React.ReactNode} The component to be rendered. Return null if post type is not hierarchical. */ -function PageAttributesParent() { +function parent_PageAttributesParent() { const { editPost } = (0,external_wp_data_namespaceObject.useDispatch)(store_store); @@ -12295,8 +18128,8 @@ function PageAttributesParent() { rawName: treeNode.name }, ...getOptionsFromTree(treeNode.children || [], level + 1)]); const sortedNodes = mappedNodes.sort(([a], [b]) => { - const priorityA = getItemPriority(a.rawName, fieldValue); - const priorityB = getItemPriority(b.rawName, fieldValue); + const priorityA = parent_getItemPriority(a.rawName, fieldValue); + const priorityB = parent_getItemPriority(b.rawName, fieldValue); return priorityA >= priorityB ? 1 : -1; }); return sortedNodes.flat(); @@ -12312,7 +18145,7 @@ function PageAttributesParent() { // Only build a hierarchical tree when not searching. if (!fieldValue) { - tree = buildTermsTree(tree); + tree = terms_buildTermsTree(tree); } const opts = getOptionsFromTree(tree); @@ -12432,7 +18265,7 @@ function ParentRow() { title: (0,external_wp_i18n_namespaceObject.__)('Parent'), onClose: onClose }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { - children: [(0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: The home URL of the WordPress installation without the scheme. */ + children: [(0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: The home URL of the WordPress installation without the scheme. */ (0,external_wp_i18n_namespaceObject.__)('Child pages inherit characteristics from their parent, such as URL structure. For instance, if "Pricing" is a child of "Services", its URL would be %s/services/pricing.'), (0,external_wp_url_namespaceObject.filterURLForDisplay)(homeUrl).replace(/([/.])/g, '$1')), { wbr: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("wbr", {}) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { @@ -12442,12 +18275,12 @@ function ParentRow() { }) }) })] - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PageAttributesParent, {})] + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(parent_PageAttributesParent, {})] }) }) }); } -/* harmony default export */ const page_attributes_parent = (PageAttributesParent); +/* harmony default export */ const page_attributes_parent = (parent_PageAttributesParent); ;// ./node_modules/@wordpress/editor/build-module/components/page-attributes/panel.js /** @@ -12489,7 +18322,7 @@ function AttributesPanel() { /** * Renders the Page Attributes Panel component. * - * @return {Component} The component to be rendered. + * @return {React.ReactNode} The rendered component. */ function PageAttributesPanel() { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(page_attributes_check, { @@ -12531,7 +18364,6 @@ const addTemplate = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx - const DEFAULT_TITLE = (0,external_wp_i18n_namespaceObject.__)('Custom Template'); function CreateNewTemplateModal({ onClose @@ -12717,6 +18549,7 @@ function useCurrentTemplateSlug() { } ;// ./node_modules/@wordpress/editor/build-module/components/post-template/classic-theme.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -12736,7 +18569,6 @@ function useCurrentTemplateSlug() { - const POPOVER_PROPS = { className: 'editor-post-template__dropdown', placement: 'bottom-start' @@ -12776,7 +18608,7 @@ function PostTemplateToggle({ * @param {Object} props The component props. * @param {Function} props.onClose The function to close the dropdown. * - * @return {JSX.Element} The rendered dropdown content. + * @return {React.ReactNode} The rendered dropdown content. */ function PostTemplateDropdownContent({ onClose @@ -12862,10 +18694,8 @@ function PostTemplateDropdownContent({ template: slug || '' }) }), canEdit && onNavigateToEntityRecord && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button - // TODO: Switch to `true` (40px size) if possible - , { - __next40pxDefaultSize: false, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + __next40pxDefaultSize: true, variant: "link", onClick: () => { onNavigateToEntityRecord({ @@ -12912,7 +18742,7 @@ function ClassicThemeControl() { * * The dropdown menu includes a button for toggling the menu, a list of available templates, and options for creating and editing templates. * - * @return {JSX.Element} The rendered ClassicThemeControl component. + * @return {React.ReactNode} The rendered ClassicThemeControl component. */ /* harmony default export */ const classic_theme = (ClassicThemeControl); @@ -12926,33 +18756,41 @@ var external_wp_warning_default = /*#__PURE__*/__webpack_require__.n(external_wp - /** * Internal dependencies */ + const { PreferenceBaseOption } = unlock(external_wp_preferences_namespaceObject.privateApis); -/* harmony default export */ const enable_panel = ((0,external_wp_compose_namespaceObject.compose)((0,external_wp_data_namespaceObject.withSelect)((select, { - panelName -}) => { +function EnablePanelOption(props) { const { - isEditorPanelEnabled, - isEditorPanelRemoved - } = select(store_store); - return { - isRemoved: isEditorPanelRemoved(panelName), - isChecked: isEditorPanelEnabled(panelName) - }; -}), (0,external_wp_compose_namespaceObject.ifCondition)(({ - isRemoved -}) => !isRemoved), (0,external_wp_data_namespaceObject.withDispatch)((dispatch, { - panelName -}) => ({ - onChange: () => dispatch(store_store).toggleEditorPanelEnabled(panelName) -})))(PreferenceBaseOption)); + toggleEditorPanelEnabled + } = (0,external_wp_data_namespaceObject.useDispatch)(store_store); + const { + isChecked, + isRemoved + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + isEditorPanelEnabled, + isEditorPanelRemoved + } = select(store_store); + return { + isChecked: isEditorPanelEnabled(props.panelName), + isRemoved: isEditorPanelRemoved(props.panelName) + }; + }, [props.panelName]); + if (isRemoved) { + return null; + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreferenceBaseOption, { + isChecked: isChecked, + onChange: () => toggleEditorPanelEnabled(props.panelName), + ...props + }); +} ;// ./node_modules/@wordpress/editor/build-module/components/preferences-modal/enable-plugin-document-setting-panel.js /** @@ -12973,7 +18811,7 @@ const EnablePluginDocumentSettingPanelOption = ({ label, panelName }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Fill, { - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(enable_panel, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EnablePanelOption, { label: label, panelName: panelName }) @@ -12996,8 +18834,6 @@ EnablePluginDocumentSettingPanelOption.Slot = Slot; - - const { Fill: plugin_document_setting_panel_Fill, Slot: plugin_document_setting_panel_Slot @@ -13011,7 +18847,7 @@ const { * @param {string} [props.className] An optional class name added to the row. * @param {string} [props.title] The title of the panel * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered when the sidebar is pinned to toolbar. - * @param {Element} props.children Children to be rendered + * @param {React.ReactNode} props.children Children to be rendered * * @example * ```js @@ -13053,7 +18889,7 @@ const { * registerPlugin( 'document-setting-test', { render: MyDocumentSettingTest } ); * ``` * - * @return {Component} The component to be rendered. + * @return {React.ReactNode} The component to be rendered. */ const PluginDocumentSettingPanel = ({ name, @@ -13105,6 +18941,7 @@ PluginDocumentSettingPanel.Slot = plugin_document_setting_panel_Slot; /* harmony default export */ const plugin_document_setting_panel = (PluginDocumentSettingPanel); ;// ./node_modules/@wordpress/editor/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -13180,7 +19017,7 @@ const shouldRenderItem = (selectedBlocks, allowedBlocks) => !Array.isArray(allow * ); * ``` * - * @return {Component} The component to be rendered. + * @return {React.ReactNode} The rendered component. */ const PluginBlockSettingsMenuItem = ({ allowedBlocks, @@ -13216,12 +19053,12 @@ const PluginBlockSettingsMenuItem = ({ - /** * Renders a menu item in `Plugins` group in `More Menu` drop down, and can be used to as a button or link depending on the props provided. * The text within the component appears as the menu item label. * * @param {Object} props Component properties. + * @param {React.ReactNode} [props.children] Children to be rendered. * @param {string} [props.href] When `href` is provided then the menu item is represented as an anchor rather than button. It corresponds to the `href` attribute of the anchor. * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered to the left of the menu item label. * @param {Function} [props.onClick=noop] The callback function to be executed when the user clicks the menu item. @@ -13271,16 +19108,19 @@ const PluginBlockSettingsMenuItem = ({ * ); * ``` * - * @return {Component} The component to be rendered. + * @return {React.ReactNode} The rendered component. */ -/* harmony default export */ const plugin_more_menu_item = ((0,external_wp_compose_namespaceObject.compose)((0,external_wp_plugins_namespaceObject.withPluginContext)((context, ownProps) => { - var _ownProps$as; - return { - as: (_ownProps$as = ownProps.as) !== null && _ownProps$as !== void 0 ? _ownProps$as : external_wp_components_namespaceObject.MenuItem, - icon: ownProps.icon || context.icon, - name: 'core/plugin-more-menu' - }; -}))(action_item)); + +function PluginMoreMenuItem(props) { + var _props$as; + const context = (0,external_wp_plugins_namespaceObject.usePluginContext)(); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(action_item, { + name: "core/plugin-more-menu", + as: (_props$as = props.as) !== null && _props$as !== void 0 ? _props$as : external_wp_components_namespaceObject.MenuItem, + icon: props.icon || context.icon, + ...props + }); +} ;// ./node_modules/@wordpress/editor/build-module/components/plugin-post-publish-panel/index.js /** @@ -13303,7 +19143,7 @@ const { * @param {string} [props.title] Title displayed at the top of the panel. * @param {boolean} [props.initialOpen=false] Whether to have the panel initially opened. When no title is provided it is always opened. * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered when the sidebar is pinned to toolbar. - * @param {Element} props.children Children to be rendered + * @param {React.ReactNode} props.children Children to be rendered * * @example * ```jsx @@ -13322,7 +19162,7 @@ const { * ); * ``` * - * @return {Component} The component to be rendered. + * @return {React.ReactNode} The rendered component. */ const PluginPostPublishPanel = ({ children, @@ -13367,9 +19207,9 @@ const { * It should be noted that this is named and implemented around the function it serves * and not its location, which may change in future iterations. * - * @param {Object} props Component properties. - * @param {string} [props.className] An optional class name added to the row. - * @param {Element} props.children Children to be rendered. + * @param {Object} props Component properties. + * @param {string} [props.className] An optional class name added to the row. + * @param {React.ReactNode} props.children Children to be rendered. * * @example * ```js @@ -13403,7 +19243,7 @@ const { * ); * ``` * - * @return {Component} The component to be rendered. + * @return {React.ReactNode} The rendered component. */ const PluginPostStatusInfo = ({ children, @@ -13441,7 +19281,7 @@ const { * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) * icon slug string, or an SVG WP element, to be rendered when * the sidebar is pinned to toolbar. - * @param {Element} props.children Children to be rendered + * @param {React.ReactNode} props.children Children to be rendered * * @example * ```jsx @@ -13460,7 +19300,7 @@ const { * ); * ``` * - * @return {Component} The component to be rendered. + * @return {React.ReactNode} The rendered component. */ const PluginPrePublishPanel = ({ children, @@ -13493,12 +19333,12 @@ PluginPrePublishPanel.Slot = plugin_pre_publish_panel_Slot; - /** * Renders a menu item in the Preview dropdown, which can be used as a button or link depending on the props provided. * The text within the component appears as the menu item label. * * @param {Object} props Component properties. + * @param {React.ReactNode} [props.children] Children to be rendered. * @param {string} [props.href] When `href` is provided, the menu item is rendered as an anchor instead of a button. It corresponds to the `href` attribute of the anchor. * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The icon to be rendered to the left of the menu item label. Can be a Dashicon slug or an SVG WP element. * @param {Function} [props.onClick] The callback function to be executed when the user clicks the menu item. @@ -13515,28 +19355,31 @@ PluginPrePublishPanel.Slot = plugin_pre_publish_panel_Slot; * } * * const ExternalPreviewMenuItem = () => ( - * * { __( 'Preview in new tab' ) } - * + * * ); * registerPlugin( 'external-preview-menu-item', { * render: ExternalPreviewMenuItem, * } ); * ``` * - * @return {Component} The rendered menu item component. + * @return {React.ReactNode} The rendered menu item component. */ -/* harmony default export */ const plugin_preview_menu_item = ((0,external_wp_compose_namespaceObject.compose)((0,external_wp_plugins_namespaceObject.withPluginContext)((context, ownProps) => { - var _ownProps$as; - return { - as: (_ownProps$as = ownProps.as) !== null && _ownProps$as !== void 0 ? _ownProps$as : external_wp_components_namespaceObject.MenuItem, - icon: ownProps.icon || context.icon, - name: 'core/plugin-preview-menu' - }; -}))(action_item)); + +function PluginPreviewMenuItem(props) { + var _props$as; + const context = (0,external_wp_plugins_namespaceObject.usePluginContext)(); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(action_item, { + name: "core/plugin-preview-menu", + as: (_props$as = props.as) !== null && _props$as !== void 0 ? _props$as : external_wp_components_namespaceObject.MenuItem, + icon: props.icon || context.icon, + ...props + }); +} ;// ./node_modules/@wordpress/editor/build-module/components/plugin-sidebar/index.js /** @@ -13544,13 +19387,6 @@ PluginPrePublishPanel.Slot = plugin_pre_publish_panel_Slot; */ - - -/** - * Internal dependencies - */ - - /** * Renders a sidebar when activated. The contents within the `PluginSidebar` will appear as content within the sidebar. * It also automatically renders a corresponding `PluginSidebarMenuItem` component when `isPinnable` flag is set to `true`. @@ -13564,6 +19400,7 @@ PluginPrePublishPanel.Slot = plugin_pre_publish_panel_Slot; * * @param {Object} props Element props. * @param {string} props.name A string identifying the sidebar. Must be unique for every sidebar registered within the scope of your plugin. + * @param {React.ReactNode} [props.children] Children to be rendered. * @param {string} [props.className] An optional class name added to the sidebar body. * @param {string} props.title Title displayed at the top of the sidebar. * @param {boolean} [props.isPinnable=true] Whether to allow to pin sidebar to the toolbar. When set to `true` it also automatically renders a corresponding menu item. @@ -13621,17 +19458,9 @@ function PluginSidebar({ className, ...props }) { - const { - postTitle - } = (0,external_wp_data_namespaceObject.useSelect)(select => { - return { - postTitle: select(store_store).getEditedPostAttribute('title') - }; - }, []); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(complementary_area, { panelClassName: className, className: "editor-sidebar", - smallScreenTitle: postTitle || (0,external_wp_i18n_namespaceObject.__)('(no title)'), scope: "core", ...props }); @@ -13650,6 +19479,7 @@ function PluginSidebar({ * * @param {Object} props Component props. * @param {string} props.target A string identifying the target sidebar you wish to be activated by this menu item. Must be the same as the `name` prop you have given to that sidebar. + * @param {React.ReactNode} [props.children] Children to be rendered. * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered to the left of the menu item label. * * @example @@ -13688,7 +19518,7 @@ function PluginSidebar({ * ); * ``` * - * @return {Component} The component to be rendered. + * @return {React.ReactNode} The rendered component. */ function PluginSidebarMoreMenuItem(props) { @@ -13703,6 +19533,7 @@ function PluginSidebarMoreMenuItem(props) { } ;// ./node_modules/@wordpress/editor/build-module/components/post-template/swap-template-button.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -13715,14 +19546,11 @@ function PluginSidebarMoreMenuItem(props) { - /** * Internal dependencies */ - - function SwapTemplateButton({ onClick }) { @@ -13750,7 +19578,7 @@ function SwapTemplateButton({ return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { onClick: () => setShowModal(true), - children: (0,external_wp_i18n_namespaceObject.__)('Swap template') + children: (0,external_wp_i18n_namespaceObject.__)('Change template') }), showModal && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Modal, { title: (0,external_wp_i18n_namespaceObject.__)('Choose a template'), onRequestClose: () => setShowModal(false), @@ -13777,11 +19605,9 @@ function TemplatesList({ title: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(template.title.rendered), id: template.id })), [availableTemplates]); - const shownTemplates = (0,external_wp_compose_namespaceObject.useAsyncList)(templatesAsPatterns); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalBlockPatternsList, { label: (0,external_wp_i18n_namespaceObject.__)('Templates'), blockPatterns: templatesAsPatterns, - shownPatterns: shownTemplates, onClickPattern: onSelect }); } @@ -13845,8 +19671,6 @@ function ResetDefaultTemplate({ - - function CreateNewTemplate({ onClick }) { @@ -13907,8 +19731,6 @@ function CreateNewTemplate({ - - const block_theme_POPOVER_PROPS = { className: 'editor-post-template__dropdown', placement: 'bottom-start' @@ -14035,7 +19857,7 @@ function BlockThemeControl({ /** * Displays the template controls based on the current editor settings and user permissions. * - * @return {JSX.Element|null} The rendered PostTemplatePanel component. + * @return {React.ReactNode} The rendered PostTemplatePanel component. */ function PostTemplatePanel() { @@ -14104,11 +19926,12 @@ const BASE_QUERY = { }; const AUTHORS_QUERY = { who: 'authors', - per_page: 50, + per_page: 100, ...BASE_QUERY }; ;// ./node_modules/@wordpress/editor/build-module/components/post-author/hook.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -14142,6 +19965,7 @@ function useAuthorsQuery(search) { }; if (search) { query.search = search; + query.search_columns = ['name']; } return { authorId: _authorId, @@ -14302,7 +20126,7 @@ const minimumUsersForCombobox = 25; /** * Renders the component for selecting the post author. * - * @return {Component} The component to be rendered. + * @return {React.ReactNode} The rendered component. */ function PostAuthor() { const showCombobox = (0,external_wp_data_namespaceObject.useSelect)(select => { @@ -14333,10 +20157,10 @@ function PostAuthor() { /** * Wrapper component that renders its children only if the post type supports the author. * - * @param {Object} props The component props. - * @param {Element} props.children Children to be rendered. + * @param {Object} props The component props. + * @param {React.ReactNode} props.children Children to be rendered. * - * @return {Component|null} The component to be rendered. Return `null` if the post type doesn't + * @return {React.ReactNode} The component to be rendered. Return `null` if the post type doesn't * supports the author or if there are no authors available. */ @@ -14382,7 +20206,6 @@ function PostAuthorCheck({ - function PostAuthorToggle({ isOpen, onClick @@ -14407,7 +20230,7 @@ function PostAuthorToggle({ /** * Renders the Post Author Panel component. * - * @return {Component} The component to be rendered. + * @return {React.ReactNode} The rendered component. */ function panel_PostAuthor() { // Use internal state instead of a ref to make sure that the component @@ -14505,7 +20328,7 @@ function PostComments() { /** * A form for managing comment status. * - * @return {JSX.Element} The rendered PostComments component. + * @return {React.ReactNode} The rendered PostComments component. */ /* harmony default export */ const post_comments = (PostComments); @@ -14573,7 +20396,6 @@ function PostPingbacks() { - const panel_PANEL_NAME = 'discussion-panel'; function ModalContents({ onClose @@ -14649,7 +20471,7 @@ function PostDiscussionToggle({ * checks whether the current post has support for the * above and if the `discussion-panel` panel is enabled. * - * @return {JSX.Element|null} The rendered PostDiscussionPanel component. + * @return {React.ReactNode} The rendered PostDiscussionPanel component. */ function PostDiscussionPanel() { const { @@ -14746,7 +20568,7 @@ function PostExcerpt({ } = select(store_store); const postType = getCurrentPostType(); // This special case is unfortunate, but the REST API of wp_template and wp_template_part - // support the excerpt field throught the "description" field rather than "excerpt". + // support the excerpt field through the "description" field rather than "excerpt". const _usedAttribute = ['wp_template', 'wp_template_part'].includes(postType) ? 'description' : 'excerpt'; return { excerpt: getEditedPostAttribute(_usedAttribute), @@ -14792,10 +20614,10 @@ function PostExcerpt({ /** * Component for checking if the post type supports the excerpt field. * - * @param {Object} props Props. - * @param {Element} props.children Children to be rendered. + * @param {Object} props Props. + * @param {React.ReactNode} props.children Children to be rendered. * - * @return {Component} The component to be rendered. + * @return {React.ReactNode} The rendered component. */ function PostExcerptCheck({ @@ -14826,9 +20648,9 @@ const { /** * Renders a post excerpt panel in the post sidebar. * - * @param {Object} props Component properties. - * @param {string} [props.className] An optional class name added to the row. - * @param {Element} props.children Children to be rendered. + * @param {Object} props Component properties. + * @param {string} [props.className] An optional class name added to the row. + * @param {React.ReactNode} props.children Children to be rendered. * * @example * ```js @@ -14860,7 +20682,7 @@ const { * ); * ``` * - * @return {Component} The component to be rendered. + * @return {React.ReactNode} The rendered component. */ const PluginPostExcerpt = ({ children, @@ -14901,8 +20723,6 @@ PluginPostExcerpt.Slot = plugin_Slot; * Module Constants */ - - const post_excerpt_panel_PANEL_NAME = 'post-excerpt'; function ExcerptPanel() { const { @@ -14946,7 +20766,7 @@ function ExcerptPanel() { /** * Is rendered if the post type supports excerpts and allows editing the excerpt. * - * @return {JSX.Element} The rendered PostExcerptPanel component. + * @return {React.ReactNode} The rendered PostExcerptPanel component. */ function PostExcerptPanel() { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_excerpt_check, { @@ -15057,6 +20877,7 @@ function PrivateExcerpt() { } ;// ./node_modules/@wordpress/editor/build-module/components/theme-support-check/index.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -15072,10 +20893,10 @@ function PrivateExcerpt() { * Checks if the current theme supports specific features and renders the children if supported. * * @param {Object} props The component props. - * @param {Element} props.children The children to render if the theme supports the specified features. + * @param {React.ReactNode} props.children The children to render if the theme supports the specified features. * @param {string|string[]} props.supportKeys The key(s) of the theme support(s) to check. * - * @return {JSX.Element|null} The rendered children if the theme supports the specified features, otherwise null. + * @return {React.ReactNode} The rendered children if the theme supports the specified features, otherwise null. */ function ThemeSupportCheck({ children, @@ -15119,10 +20940,10 @@ function ThemeSupportCheck({ * Wrapper component that renders its children only if the post type supports a featured image * and the theme supports post thumbnails. * - * @param {Object} props Props. - * @param {Element} props.children Children to be rendered. + * @param {Object} props Props. + * @param {React.ReactNode} props.children Children to be rendered. * - * @return {Component} The component to be rendered. + * @return {React.ReactNode} The rendered component. */ function PostFeaturedImageCheck({ @@ -15139,6 +20960,11 @@ function PostFeaturedImageCheck({ /* harmony default export */ const post_featured_image_check = (PostFeaturedImageCheck); ;// ./node_modules/@wordpress/editor/build-module/components/post-featured-image/index.js +/** + * External dependencies + */ + + /** * WordPress dependencies */ @@ -15158,7 +20984,6 @@ function PostFeaturedImageCheck({ - const ALLOWED_MEDIA_TYPES = ['image']; // Used when labels from post type were not yet loaded or when they are not present. @@ -15206,9 +21031,10 @@ function PostFeaturedImage({ media, postType, noticeUI, - noticeOperations + noticeOperations, + isRequestingFeaturedImageMedia }) { - const toggleRef = (0,external_wp_element_namespaceObject.useRef)(); + const returnsFocusRef = (0,external_wp_element_namespaceObject.useRef)(false); const [isLoading, setIsLoading] = (0,external_wp_element_namespaceObject.useState)(false); const { getSettings @@ -15236,17 +21062,43 @@ function PostFeaturedImage({ } }); } + + /** + * Generates the featured image alt text for this editing context. + * + * @param {Object} imageMedia The image media object. + * @param {string} imageMedia.alt_text The alternative text of the image. + * @param {Object} imageMedia.media_details The media details of the image. + * @param {Object} imageMedia.media_details.sizes The sizes of the image. + * @param {Object} imageMedia.media_details.sizes.full The full size details of the image. + * @param {string} imageMedia.media_details.sizes.full.file The file name of the full size image. + * @param {string} imageMedia.slug The slug of the image. + * @return {string} The featured image alt text. + */ + function getImageDescription(imageMedia) { + if (imageMedia.alt_text) { + return (0,external_wp_i18n_namespaceObject.sprintf)( + // Translators: %s: The selected image alt text. + (0,external_wp_i18n_namespaceObject.__)('Current image: %s'), imageMedia.alt_text); + } + return (0,external_wp_i18n_namespaceObject.sprintf)( + // Translators: %s: The selected image filename. + (0,external_wp_i18n_namespaceObject.__)('The current image has no alternative text. The file name is: %s'), imageMedia.media_details.sizes?.full?.file || imageMedia.slug); + } + function returnFocus(node) { + if (returnsFocusRef.current && node) { + node.focus(); + returnsFocusRef.current = false; + } + } + const isMissingMedia = !isRequestingFeaturedImageMedia && !!featuredImageId && !media; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(post_featured_image_check, { children: [noticeUI, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "editor-post-featured-image", - children: [media && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { + children: [media && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { id: `editor-post-featured-image-${featuredImageId}-describedby`, className: "hidden", - children: [media.alt_text && (0,external_wp_i18n_namespaceObject.sprintf)( - // Translators: %s: The selected image alt text. - (0,external_wp_i18n_namespaceObject.__)('Current image: %s'), media.alt_text), !media.alt_text && (0,external_wp_i18n_namespaceObject.sprintf)( - // Translators: %s: The selected image filename. - (0,external_wp_i18n_namespaceObject.__)('The current image has no alternative text. The file name is: %s'), media.media_details.sizes?.full?.file || media.slug)] + children: getImageDescription(media) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.MediaUploadCheck, { fallback: instructions, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.MediaUpload, { @@ -15259,9 +21111,13 @@ function PostFeaturedImage({ open }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "editor-post-featured-image__container", - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Button, { + children: [isMissingMedia ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Notice, { + status: "warning", + isDismissible: false, + children: (0,external_wp_i18n_namespaceObject.__)('Could not retrieve the featured image data.') + }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, - ref: toggleRef, + ref: returnFocus, className: !featuredImageId ? 'editor-post-featured-image__toggle' : 'editor-post-featured-image__preview', onClick: open, "aria-label": !featuredImageId ? null : (0,external_wp_i18n_namespaceObject.__)('Edit or replace the featured image'), @@ -15272,23 +21128,32 @@ function PostFeaturedImage({ children: [!!featuredImageId && media && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { className: "editor-post-featured-image__preview-image", src: mediaSourceUrl, - alt: "" - }), isLoading && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}), !featuredImageId && !isLoading && (postType?.labels?.set_featured_image || DEFAULT_SET_FEATURE_IMAGE_LABEL)] + alt: getImageDescription(media) + }), (isLoading || isRequestingFeaturedImageMedia) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}), !featuredImageId && !isLoading && (postType?.labels?.set_featured_image || DEFAULT_SET_FEATURE_IMAGE_LABEL)] }), !!featuredImageId && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { - className: "editor-post-featured-image__actions", + className: dist_clsx('editor-post-featured-image__actions', { + 'editor-post-featured-image__actions-missing-image': isMissingMedia, + 'editor-post-featured-image__actions-is-requesting-image': isRequestingFeaturedImageMedia + }), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, className: "editor-post-featured-image__action", onClick: open, "aria-haspopup": "dialog", + variant: isMissingMedia ? 'secondary' : undefined, children: (0,external_wp_i18n_namespaceObject.__)('Replace') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, className: "editor-post-featured-image__action", onClick: () => { onRemoveImage(); - toggleRef.current.focus(); + // Signal that the toggle button should be focused, + // when it is rendered. Can't focus it directly here + // because it's rendered conditionally. + returnsFocusRef.current = true; }, + variant: isMissingMedia ? 'secondary' : undefined, + isDestructive: isMissingMedia, children: (0,external_wp_i18n_namespaceObject.__)('Remove') })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.DropZone, { @@ -15304,7 +21169,8 @@ function PostFeaturedImage({ const applyWithSelect = (0,external_wp_data_namespaceObject.withSelect)(select => { const { getMedia, - getPostType + getPostType, + hasFinishedResolution } = select(external_wp_coreData_namespaceObject.store); const { getCurrentPostId, @@ -15317,7 +21183,10 @@ const applyWithSelect = (0,external_wp_data_namespaceObject.withSelect)(select = }) : null, currentPostId: getCurrentPostId(), postType: getPostType(getEditedPostAttribute('type')), - featuredImageId + featuredImageId, + isRequestingFeaturedImageMedia: !!featuredImageId && !hasFinishedResolution('getMedia', [featuredImageId, { + context: 'view' + }]) }; }); const applyWithDispatch = (0,external_wp_data_namespaceObject.withDispatch)((dispatch, { @@ -15398,7 +21267,7 @@ const post_featured_image_panel_PANEL_NAME = 'featured-image'; * @param {Object} props Props. * @param {boolean} props.withPanelBody Whether to include the panel body. Default true. * - * @return {Component|null} The component to be rendered. + * @return {React.ReactNode} The component to be rendered. * Return Null if the editor panel is disabled for featured image. */ function PostFeaturedImagePanel({ @@ -15457,6 +21326,15 @@ function PostFeaturedImagePanel({ +/** + * Component check if there are any post formats. + * + * @param {Object} props The component props. + * @param {React.ReactNode} props.children The child elements to render. + * + * @return {React.ReactNode} The rendered component or null if post formats are disabled. + */ + function PostFormatCheck({ children }) { @@ -15470,17 +21348,8 @@ function PostFormatCheck({ }); } -/** - * Component check if there are any post formats. - * - * @param {Object} props The component props. - * @param {Element} props.children The child elements to render. - * - * @return {Component|null} The rendered component or null if post formats are disabled. - */ -/* harmony default export */ const post_format_check = (PostFormatCheck); - ;// ./node_modules/@wordpress/editor/build-module/components/post-format/index.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -15498,7 +21367,6 @@ function PostFormatCheck({ // All WP post formats, sorted alphabetically by translated name. - const POST_FORMATS = [{ id: 'aside', caption: (0,external_wp_i18n_namespaceObject.__)('Aside') @@ -15549,7 +21417,7 @@ const POST_FORMATS = [{ * * ``` * - * @return {JSX.Element} The rendered PostFormat component. + * @return {React.ReactNode} The rendered PostFormat component. */ function PostFormat() { const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(PostFormat); @@ -15583,7 +21451,7 @@ function PostFormat() { const onUpdatePostFormat = format => editPost({ format }); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_format_check, { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostFormatCheck, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "editor-post-format", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RadioControl, { @@ -15603,7 +21471,7 @@ function PostFormat() { __next40pxDefaultSize: true, variant: "link", onClick: () => onUpdatePostFormat(suggestion.id), - children: (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: post format */ + children: (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: post format */ (0,external_wp_i18n_namespaceObject.__)('Apply suggested format: %s'), suggestion.caption) }) })] @@ -15626,10 +21494,10 @@ function PostFormat() { /** * Wrapper component that renders its children if the post has more than one revision. * - * @param {Object} props Props. - * @param {Element} props.children Children to be rendered. + * @param {Object} props Props. + * @param {React.ReactNode} props.children Children to be rendered. * - * @return {Component|null} Rendered child components if post has more than one revision, otherwise null. + * @return {React.ReactNode} Rendered child components if post has more than one revision, otherwise null. */ function PostLastRevisionCheck({ @@ -15691,7 +21559,7 @@ function usePostLastRevisionInfo() { /** * Renders the component for displaying the last revision of a post. * - * @return {Component} The component to be rendered. + * @return {React.ReactNode} The rendered component. */ function PostLastRevision() { const { @@ -15707,7 +21575,7 @@ function PostLastRevision() { className: "editor-post-last-revision__title", icon: library_backup, iconPosition: "right", - text: (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: number of revisions. */ + text: (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: number of revisions. */ (0,external_wp_i18n_namespaceObject.__)('Revisions (%s)'), revisionsCount) }) }); @@ -15749,7 +21617,7 @@ function PrivatePostLastRevision() { /** * Renders the panel for displaying the last revision of a post. * - * @return {Component} The component to be rendered. + * @return {React.ReactNode} The rendered component. */ function PostLastRevisionPanel() { @@ -15784,11 +21652,9 @@ function PostLastRevisionPanel() { * A modal component that is displayed when a post is locked for editing by another user. * The modal provides information about the lock status and options to take over or exit the editor. * - * @return {JSX.Element|null} The rendered PostLockedModal component. + * @return {React.ReactNode} The rendered PostLockedModal component. */ - - function PostLockedModal() { const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(PostLockedModal); const hookName = 'core/editor/post-locked-modal-' + instanceId; @@ -15947,7 +21813,7 @@ function PostLockedModal() { height: 64 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { children: [!!isTakeover && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { - children: (0,external_wp_element_namespaceObject.createInterpolateElement)(userDisplayName ? (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: user's display name */ + children: (0,external_wp_element_namespaceObject.createInterpolateElement)(userDisplayName ? (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: user's display name */ (0,external_wp_i18n_namespaceObject.__)('%s now has editing control of this post (). Don’t worry, your changes up to this moment have been saved.'), userDisplayName) : (0,external_wp_i18n_namespaceObject.__)('Another user now has editing control of this post (). Don’t worry, your changes up to this moment have been saved.'), { strong: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("strong", {}), PreviewLink: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, { @@ -15957,7 +21823,7 @@ function PostLockedModal() { }) }), !isTakeover && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { - children: (0,external_wp_element_namespaceObject.createInterpolateElement)(userDisplayName ? (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: user's display name */ + children: (0,external_wp_element_namespaceObject.createInterpolateElement)(userDisplayName ? (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: user's display name */ (0,external_wp_i18n_namespaceObject.__)('%s is currently working on this post (), which means you cannot make changes, unless you take over.'), userDisplayName) : (0,external_wp_i18n_namespaceObject.__)('Another user is currently working on this post (), which means you cannot make changes, unless you take over.'), { strong: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("strong", {}), PreviewLink: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, { @@ -16004,10 +21870,10 @@ function PostLockedModal() { * If the post is already published or the user doesn't have the * capability to publish, it returns null. * - * @param {Object} props Component properties. - * @param {Element} props.children Children to be rendered. + * @param {Object} props Component properties. + * @param {React.ReactNode} props.children Children to be rendered. * - * @return {JSX.Element|null} The rendered child elements or null if the post is already published or the user doesn't have the capability to publish. + * @return {React.ReactNode} The rendered child elements or null if the post is already published or the user doesn't have the capability to publish. */ function PostPendingStatusCheck({ children @@ -16050,7 +21916,7 @@ function PostPendingStatusCheck({ /** * A component for displaying and toggling the pending status of a post. * - * @return {JSX.Element} The rendered component. + * @return {React.ReactNode} The rendered component. */ function PostPendingStatus() { @@ -16091,10 +21957,8 @@ function PostPendingStatus() { */ - - function writeInterstitialMessage(targetDocument) { - let markup = (0,external_wp_element_namespaceObject.renderToString)( /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { + let markup = (0,external_wp_element_namespaceObject.renderToString)(/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "editor-post-preview-button__interstitial-message", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", @@ -16191,7 +22055,7 @@ function writeInterstitialMessage(targetDocument) { * @param {string} props.role The role attribute for the button. * @param {Function} props.onPreview The callback function for preview event. * - * @return {JSX.Element|null} The rendered button component. + * @return {React.ReactNode} The rendered button component. */ function PostPreviewButton({ className, @@ -16211,12 +22075,18 @@ function PostPreviewButton({ const editor = select(store_store); const core = select(external_wp_coreData_namespaceObject.store); const postType = core.getPostType(editor.getCurrentPostType('type')); + const canView = (_postType$viewable = postType?.viewable) !== null && _postType$viewable !== void 0 ? _postType$viewable : false; + if (!canView) { + return { + isViewable: canView + }; + } return { postId: editor.getCurrentPostId(), currentPostLink: editor.getCurrentPostAttribute('link'), previewLink: editor.getEditedPostPreviewLink(), isSaveable: editor.isEditedPostSaveable(), - isViewable: (_postType$viewable = postType?.viewable) !== null && _postType$viewable !== void 0 ? _postType$viewable : false + isViewable: canView }; }, []); const { @@ -16351,6 +22221,7 @@ function PublishButtonLabel() { } ;// ./node_modules/@wordpress/editor/build-module/components/post-publish-button/index.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -16365,7 +22236,6 @@ function PublishButtonLabel() { - const post_publish_button_noop = () => {}; class PostPublishButton extends external_wp_element_namespaceObject.Component { constructor(props) { @@ -16447,10 +22317,10 @@ class PostPublishButton extends external_wp_element_namespaceObject.Component { const isButtonDisabled = (isSaving || !isSaveable || isPostSavingLocked || !isPublishable && !forceIsDirty) && (!hasNonPostEntityChanges || isSavingNonPostEntityChanges); const isToggleDisabled = (isPublished || isSaving || !isSaveable || !isPublishable && !forceIsDirty) && (!hasNonPostEntityChanges || isSavingNonPostEntityChanges); - // If the new status has not changed explicitely, we derive it from + // If the new status has not changed explicitly, we derive it from // other factors, like having a publish action, etc.. We need to preserve // this because it affects when to show the pre and post publish panels. - // If it has changed though explicitely, we need to respect that. + // If it has changed though explicitly, we need to respect that. let publishStatus = 'publish'; if (postStatusHasChanged) { publishStatus = postStatus; @@ -16481,7 +22351,8 @@ class PostPublishButton extends external_wp_element_namespaceObject.Component { className: 'editor-post-publish-button', isBusy: !isAutoSaving && isSaving, variant: 'primary', - onClick: this.createOnClick(onClickButton) + onClick: this.createOnClick(onClickButton), + 'aria-haspopup': hasNonPostEntityChanges ? 'dialog' : undefined }; const toggleProps = { 'aria-disabled': isToggleDisabled, @@ -16490,7 +22361,8 @@ class PostPublishButton extends external_wp_element_namespaceObject.Component { isBusy: isSaving && isPublished, variant: 'primary', size: 'compact', - onClick: this.createOnClick(onClickToggle) + onClick: this.createOnClick(onClickToggle), + 'aria-haspopup': hasNonPostEntityChanges ? 'dialog' : undefined }; const componentProps = isToggle ? toggleProps : buttonProps; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { @@ -16617,10 +22489,9 @@ const visibilityOptions = { * * @param {Object} props The component props. * @param {Function} props.onClose Function to call when the popover is closed. - * @return {JSX.Element} The rendered component. + * @return {React.ReactNode} The rendered component. */ - function PostVisibility({ onClose }) { @@ -17423,6 +23294,7 @@ function validateTimezone(_hours, minutes) { /* harmony default export */ const date_fns_parseISO = ((/* unused pure expression or super */ null && (parseISO))); ;// ./node_modules/@wordpress/editor/build-module/components/post-schedule/index.js +/* wp:polyfill */ /** * External dependencies */ @@ -17454,7 +23326,7 @@ const { * @param {Object} props Props. * @param {Function} props.onClose Function to close the component. * - * @return {Component} The component to be rendered. + * @return {React.ReactNode} The rendered component. */ function PostSchedule(props) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PrivatePostSchedule, { @@ -17483,7 +23355,7 @@ function PrivatePostSchedule({ }); const [previewedMonth, setPreviewedMonth] = (0,external_wp_element_namespaceObject.useState)(startOfMonth(new Date(postDate))); - // Pick up published and schduled site posts. + // Pick up published and scheduled site posts. const eventsByPostType = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getEntityRecords('postType', postType, { status: 'publish,future', after: startOfMonth(previewedMonth).toISOString(), @@ -17537,7 +23409,7 @@ function PrivatePostSchedule({ * * @param {Object} props Props. * - * @return {Component} The component to be rendered. + * @return {React.ReactNode} The rendered component. */ function PostScheduleLabel(props) { return usePostScheduleLabel(props); @@ -17635,6 +23507,7 @@ function isSameDay(left, right) { } ;// ./node_modules/@wordpress/editor/build-module/components/post-taxonomies/most-used-terms.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -17647,7 +23520,6 @@ function isSameDay(left, right) { */ - const MIN_MOST_USED_TERMS = 3; const DEFAULT_QUERY = { per_page: 10, @@ -17697,6 +23569,7 @@ function MostUsedTerms({ } ;// ./node_modules/@wordpress/editor/build-module/components/post-taxonomies/flat-term-selector.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -17724,7 +23597,6 @@ function MostUsedTerms({ * @type {Array} */ - const flat_term_selector_EMPTY_ARRAY = []; /** @@ -17760,7 +23632,7 @@ const Wrapper = ({ * @param {string} props.slug The slug of the taxonomy. * @param {boolean} props.__nextHasNoMarginBottom Start opting into the new margin-free styles that will become the default in a future version, currently scheduled to be WordPress 7.0. (The prop can be safely removed once this happens.) * - * @return {JSX.Element} The rendered flat term selector component. + * @return {React.ReactNode} The rendered flat term selector component. */ function FlatTermSelector({ slug, @@ -17912,18 +23784,18 @@ function FlatTermSelector({ } const newTermIds = [...termIds, newTerm.id]; const defaultName = slug === 'post_tag' ? (0,external_wp_i18n_namespaceObject.__)('Tag') : (0,external_wp_i18n_namespaceObject.__)('Term'); - const termAddedMessage = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: term name. */ + const termAddedMessage = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: term name. */ (0,external_wp_i18n_namespaceObject._x)('%s added', 'term'), (_taxonomy$labels$sing = taxonomy?.labels?.singular_name) !== null && _taxonomy$labels$sing !== void 0 ? _taxonomy$labels$sing : defaultName); (0,external_wp_a11y_namespaceObject.speak)(termAddedMessage, 'assertive'); onUpdateTerms(newTermIds); } const newTermLabel = (_taxonomy$labels$add_ = taxonomy?.labels?.add_new_item) !== null && _taxonomy$labels$add_ !== void 0 ? _taxonomy$labels$add_ : slug === 'post_tag' ? (0,external_wp_i18n_namespaceObject.__)('Add new tag') : (0,external_wp_i18n_namespaceObject.__)('Add new Term'); const singularName = (_taxonomy$labels$sing2 = taxonomy?.labels?.singular_name) !== null && _taxonomy$labels$sing2 !== void 0 ? _taxonomy$labels$sing2 : slug === 'post_tag' ? (0,external_wp_i18n_namespaceObject.__)('Tag') : (0,external_wp_i18n_namespaceObject.__)('Term'); - const termAddedLabel = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: term name. */ + const termAddedLabel = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: term name. */ (0,external_wp_i18n_namespaceObject._x)('%s added', 'term'), singularName); - const termRemovedLabel = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: term name. */ + const termRemovedLabel = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: term name. */ (0,external_wp_i18n_namespaceObject._x)('%s removed', 'term'), singularName); - const removeTermLabel = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: term name. */ + const removeTermLabel = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: term name. */ (0,external_wp_i18n_namespaceObject._x)('Remove %s', 'term'), singularName); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(Wrapper, { __nextHasNoMarginBottom: __nextHasNoMarginBottom, @@ -17965,7 +23837,6 @@ function FlatTermSelector({ - const TagsPanel = () => { const panelBodyTitle = [(0,external_wp_i18n_namespaceObject.__)('Suggestion:'), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "editor-post-publish-panel__link", @@ -18020,6 +23891,7 @@ const MaybeTagsPanel = () => { /* harmony default export */ const maybe_tags_panel = (MaybeTagsPanel); ;// ./node_modules/@wordpress/editor/build-module/components/post-publish-panel/maybe-post-format-panel.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -18034,7 +23906,6 @@ const MaybeTagsPanel = () => { - const getSuggestion = (supportedFormats, suggestedPostFormat) => { const formats = POST_FORMATS.filter(format => supportedFormats?.includes(format.id)); return formats.find(format => format.id === suggestedPostFormat); @@ -18087,7 +23958,7 @@ function PostFormatPanel() { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostFormatSuggestion, { onUpdatePostFormat: onUpdatePostFormat, suggestedPostFormat: suggestion.id, - suggestionText: (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: post format */ + suggestionText: (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: post format */ (0,external_wp_i18n_namespaceObject.__)('Apply the "%1$s" format.'), suggestion.caption) }) })] @@ -18095,6 +23966,7 @@ function PostFormatPanel() { } ;// ./node_modules/@wordpress/editor/build-module/components/post-taxonomies/hierarchical-term-selector.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -18118,7 +23990,6 @@ function PostFormatPanel() { * Module Constants */ - const hierarchical_term_selector_DEFAULT_QUERY = { per_page: -1, orderby: 'name', @@ -18273,7 +24144,7 @@ function HierarchicalTermSelector({ const { saveEntityRecord } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); - const availableTermsTree = (0,external_wp_element_namespaceObject.useMemo)(() => sortBySelected(buildTermsTree(availableTerms), terms), + const availableTermsTree = (0,external_wp_element_namespaceObject.useMemo)(() => sortBySelected(terms_buildTermsTree(availableTerms), terms), // Remove `terms` from the dependency list to avoid reordering every time // checking or unchecking a term. [availableTerms]); @@ -18364,7 +24235,7 @@ function HierarchicalTermSelector({ return; } const defaultName = slug === 'category' ? (0,external_wp_i18n_namespaceObject.__)('Category') : (0,external_wp_i18n_namespaceObject.__)('Term'); - const termAddedMessage = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: term name. */ + const termAddedMessage = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: term name. */ (0,external_wp_i18n_namespaceObject._x)('%s added', 'term'), (_taxonomy$labels$sing = taxonomy?.labels?.singular_name) !== null && _taxonomy$labels$sing !== void 0 ? _taxonomy$labels$sing : defaultName); (0,external_wp_a11y_namespaceObject.speak)(termAddedMessage, 'assertive'); setAdding(false); @@ -18387,7 +24258,7 @@ function HierarchicalTermSelector({ setFilterValue(value); setFilteredTermsTree(newFilteredTermsTree); const resultCount = getResultCount(newFilteredTermsTree); - const resultsFoundMessage = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %d: number of results. */ + const resultsFoundMessage = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %d: number of results. */ (0,external_wp_i18n_namespaceObject._n)('%d result found.', '%d results found.', resultCount), resultCount); debouncedSpeak(resultsFoundMessage, 'assertive'); }; @@ -18429,6 +24300,7 @@ function HierarchicalTermSelector({ __next40pxDefaultSize: true, __nextHasNoMarginBottom: true, label: filterLabel, + placeholder: filterLabel, value: filterValue, onChange: setFilter }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { @@ -18483,6 +24355,7 @@ function HierarchicalTermSelector({ /* harmony default export */ const hierarchical_term_selector = ((0,external_wp_components_namespaceObject.withFilters)('editor.PostTaxonomyType')(HierarchicalTermSelector)); ;// ./node_modules/@wordpress/editor/build-module/components/post-publish-panel/maybe-category-panel.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -18498,7 +24371,6 @@ function HierarchicalTermSelector({ - function MaybeCategoryPanel() { const hasNoCategory = (0,external_wp_data_namespaceObject.useSelect)(select => { const postType = select(store_store).getCurrentPostType(); @@ -18548,95 +24420,8 @@ function MaybeCategoryPanel() { } /* harmony default export */ const maybe_category_panel = (MaybeCategoryPanel); -;// ./node_modules/@wordpress/editor/node_modules/uuid/dist/esm-browser/native.js -const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto); -/* harmony default export */ const esm_browser_native = ({ - randomUUID -}); -;// ./node_modules/@wordpress/editor/node_modules/uuid/dist/esm-browser/rng.js -// Unique ID creation requires a high quality random # generator. In the browser we therefore -// require the crypto API and do not support built-in fallback to lower quality random number -// generators (like Math.random()). -let getRandomValues; -const rnds8 = new Uint8Array(16); -function rng() { - // lazy load so that environments that need to polyfill have a chance to do so - if (!getRandomValues) { - // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. - getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto); - - if (!getRandomValues) { - throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported'); - } - } - - return getRandomValues(rnds8); -} -;// ./node_modules/@wordpress/editor/node_modules/uuid/dist/esm-browser/stringify.js - -/** - * Convert array of 16 byte values to UUID string format of the form: - * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX - */ - -const byteToHex = []; - -for (let i = 0; i < 256; ++i) { - byteToHex.push((i + 0x100).toString(16).slice(1)); -} - -function unsafeStringify(arr, offset = 0) { - // Note: Be careful editing this code! It's been tuned for performance - // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434 - return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]; -} - -function stringify(arr, offset = 0) { - const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one - // of the following: - // - One or more input array values don't map to a hex octet (leading to - // "undefined" in the uuid) - // - Invalid input values for the RFC `version` or `variant` fields - - if (!validate(uuid)) { - throw TypeError('Stringified UUID is invalid'); - } - - return uuid; -} - -/* harmony default export */ const esm_browser_stringify = ((/* unused pure expression or super */ null && (stringify))); -;// ./node_modules/@wordpress/editor/node_modules/uuid/dist/esm-browser/v4.js - - - - -function v4(options, buf, offset) { - if (esm_browser_native.randomUUID && !buf && !options) { - return esm_browser_native.randomUUID(); - } - - options = options || {}; - const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` - - rnds[6] = rnds[6] & 0x0f | 0x40; - rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided - - if (buf) { - offset = offset || 0; - - for (let i = 0; i < 16; ++i) { - buf[offset + i] = rnds[i]; - } - - return buf; - } - - return unsafeStringify(rnds); -} - -/* harmony default export */ const esm_browser_v4 = (v4); ;// ./node_modules/@wordpress/editor/build-module/components/post-publish-panel/media-util.js +/* wp:polyfill */ /** * External dependencies */ @@ -18710,6 +24495,7 @@ function fetchMedia(urls) { } ;// ./node_modules/@wordpress/editor/build-module/components/post-publish-panel/maybe-upload-media.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -18725,7 +24511,6 @@ function fetchMedia(urls) { */ - function flattenBlocks(blocks) { const result = []; blocks.forEach(block => { @@ -18956,7 +24741,7 @@ function MaybeUploadMediaPanel() { size: "compact", variant: "primary", onClick: uploadImages, - children: (0,external_wp_i18n_namespaceObject.__)('Upload') + children: (0,external_wp_i18n_namespaceObject._x)('Upload', 'verb') })] }), hadUploadError && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { children: (0,external_wp_i18n_namespaceObject.__)('Upload failed, try again.') @@ -18989,8 +24774,6 @@ function MaybeUploadMediaPanel() { - - function PostPublishPanelPrepublish({ children }) { @@ -19039,7 +24822,7 @@ function PostPublishPanelPrepublish({ let prePublishTitle, prePublishBodyText; if (!hasPublishAction) { prePublishTitle = (0,external_wp_i18n_namespaceObject.__)('Are you ready to submit for review?'); - prePublishBodyText = (0,external_wp_i18n_namespaceObject.__)('When you’re ready, submit your work for review, and an Editor will be able to approve it for you.'); + prePublishBodyText = (0,external_wp_i18n_namespaceObject.__)('Your work will be reviewed and then approved.'); } else if (isBeingScheduled) { prePublishTitle = (0,external_wp_i18n_namespaceObject.__)('Are you ready to schedule?'); prePublishBodyText = (0,external_wp_i18n_namespaceObject.__)('Your work will be published at the specified date and time.'); @@ -19107,8 +24890,6 @@ function PostPublishPanelPrepublish({ - - const POSTNAME = '%postname%'; const PAGENAME = '%pagename%'; @@ -19133,134 +24914,120 @@ const getFuturePostUrl = post => { return post.permalink_template; }; function postpublish_CopyButton({ - text, - onCopy, - children + text }) { - const ref = (0,external_wp_compose_namespaceObject.useCopyToClipboard)(text, onCopy); + const [showCopyConfirmation, setShowCopyConfirmation] = (0,external_wp_element_namespaceObject.useState)(false); + const timeoutIdRef = (0,external_wp_element_namespaceObject.useRef)(); + const ref = (0,external_wp_compose_namespaceObject.useCopyToClipboard)(text, () => { + setShowCopyConfirmation(true); + if (timeoutIdRef.current) { + clearTimeout(timeoutIdRef.current); + } + timeoutIdRef.current = setTimeout(() => { + setShowCopyConfirmation(false); + }, 4000); + }); + (0,external_wp_element_namespaceObject.useEffect)(() => { + return () => { + if (timeoutIdRef.current) { + clearTimeout(timeoutIdRef.current); + } + }; + }, []); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, variant: "secondary", ref: ref, - children: children + children: showCopyConfirmation ? (0,external_wp_i18n_namespaceObject.__)('Copied!') : (0,external_wp_i18n_namespaceObject.__)('Copy') }); } -class PostPublishPanelPostpublish extends external_wp_element_namespaceObject.Component { - constructor() { - super(...arguments); - this.state = { - showCopyConfirmation: false - }; - this.onCopy = this.onCopy.bind(this); - this.onSelectInput = this.onSelectInput.bind(this); - this.postLink = (0,external_wp_element_namespaceObject.createRef)(); - } - componentDidMount() { - if (this.props.focusOnMount) { - this.postLink.current.focus(); - } - } - componentWillUnmount() { - clearTimeout(this.dismissCopyConfirmation); - } - onCopy() { - this.setState({ - showCopyConfirmation: true - }); - clearTimeout(this.dismissCopyConfirmation); - this.dismissCopyConfirmation = setTimeout(() => { - this.setState({ - showCopyConfirmation: false - }); - }, 4000); - } - onSelectInput(event) { - event.target.select(); - } - render() { +function PostPublishPanelPostpublish({ + focusOnMount, + children +}) { + const { + post, + postType, + isScheduled + } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { - children, - isScheduled, - post, - postType - } = this.props; - const postLabel = postType?.labels?.singular_name; - const viewPostLabel = postType?.labels?.view_item; - const addNewPostLabel = postType?.labels?.add_new_item; - const link = post.status === 'future' ? getFuturePostUrl(post) : post.link; - const addLink = (0,external_wp_url_namespaceObject.addQueryArgs)('post-new.php', { - post_type: post.type - }); - const postPublishNonLinkHeader = isScheduled ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: [(0,external_wp_i18n_namespaceObject.__)('is now scheduled. It will go live on'), ' ', /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostScheduleLabel, {}), "."] - }) : (0,external_wp_i18n_namespaceObject.__)('is now live.'); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { - className: "post-publish-panel__postpublish", - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, { - className: "post-publish-panel__postpublish-header", - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { - ref: this.postLink, - href: link, - children: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(post.title) || (0,external_wp_i18n_namespaceObject.__)('(no title)') - }), ' ', postPublishNonLinkHeader] - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, { - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { - className: "post-publish-panel__postpublish-subheader", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("strong", { - children: (0,external_wp_i18n_namespaceObject.__)('What’s next?') + getEditedPostAttribute, + getCurrentPost, + isCurrentPostScheduled + } = select(store_store); + const { + getPostType + } = select(external_wp_coreData_namespaceObject.store); + return { + post: getCurrentPost(), + postType: getPostType(getEditedPostAttribute('type')), + isScheduled: isCurrentPostScheduled() + }; + }, []); + const postLabel = postType?.labels?.singular_name; + const viewPostLabel = postType?.labels?.view_item; + const addNewPostLabel = postType?.labels?.add_new_item; + const link = post.status === 'future' ? getFuturePostUrl(post) : post.link; + const addLink = (0,external_wp_url_namespaceObject.addQueryArgs)('post-new.php', { + post_type: post.type + }); + const postLinkRef = (0,external_wp_element_namespaceObject.useCallback)(node => { + if (focusOnMount && node) { + node.focus(); + } + }, [focusOnMount]); + const postPublishNonLinkHeader = isScheduled ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [(0,external_wp_i18n_namespaceObject.__)('is now scheduled. It will go live on'), ' ', /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostScheduleLabel, {}), "."] + }) : (0,external_wp_i18n_namespaceObject.__)('is now live.'); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { + className: "post-publish-panel__postpublish", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, { + className: "post-publish-panel__postpublish-header", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { + ref: postLinkRef, + href: link, + children: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(post.title) || (0,external_wp_i18n_namespaceObject.__)('(no title)') + }), ' ', postPublishNonLinkHeader] + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { + className: "post-publish-panel__postpublish-subheader", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("strong", { + children: (0,external_wp_i18n_namespaceObject.__)('What’s next?') + }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { + className: "post-publish-panel__postpublish-post-address-container", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { + __next40pxDefaultSize: true, + __nextHasNoMarginBottom: true, + className: "post-publish-panel__postpublish-post-address", + readOnly: true, + label: (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: post type singular name */ + (0,external_wp_i18n_namespaceObject.__)('%s address'), postLabel), + value: (0,external_wp_url_namespaceObject.safeDecodeURIComponent)(link), + onFocus: event => event.target.select() + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: "post-publish-panel__postpublish-post-address__copy-button-wrap", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(postpublish_CopyButton, { + text: link }) - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { - className: "post-publish-panel__postpublish-post-address-container", - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { - __next40pxDefaultSize: true, - __nextHasNoMarginBottom: true, - className: "post-publish-panel__postpublish-post-address", - readOnly: true, - label: (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: post type singular name */ - (0,external_wp_i18n_namespaceObject.__)('%s address'), postLabel), - value: (0,external_wp_url_namespaceObject.safeDecodeURIComponent)(link), - onFocus: this.onSelectInput - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { - className: "post-publish-panel__postpublish-post-address__copy-button-wrap", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(postpublish_CopyButton, { - text: link, - onCopy: this.onCopy, - children: this.state.showCopyConfirmation ? (0,external_wp_i18n_namespaceObject.__)('Copied!') : (0,external_wp_i18n_namespaceObject.__)('Copy') - }) - })] - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { - className: "post-publish-panel__postpublish-buttons", - children: [!isScheduled && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - variant: "primary", - href: link, - __next40pxDefaultSize: true, - children: viewPostLabel - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - variant: isScheduled ? 'primary' : 'secondary', - __next40pxDefaultSize: true, - href: addLink, - children: addNewPostLabel - })] })] - }), children] - }); - } + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { + className: "post-publish-panel__postpublish-buttons", + children: [!isScheduled && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + variant: "primary", + href: link, + __next40pxDefaultSize: true, + children: viewPostLabel + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + variant: isScheduled ? 'primary' : 'secondary', + __next40pxDefaultSize: true, + href: addLink, + children: addNewPostLabel + })] + })] + }), children] + }); } -/* harmony default export */ const postpublish = ((0,external_wp_data_namespaceObject.withSelect)(select => { - const { - getEditedPostAttribute, - getCurrentPost, - isCurrentPostScheduled - } = select(store_store); - const { - getPostType - } = select(external_wp_coreData_namespaceObject.store); - return { - post: getCurrentPost(), - postType: getPostType(getEditedPostAttribute('type')), - isScheduled: isCurrentPostScheduled() - }; -})(PostPublishPanelPostpublish)); ;// ./node_modules/@wordpress/editor/build-module/components/post-publish-panel/index.js /** @@ -19282,8 +25049,6 @@ class PostPublishPanelPostpublish extends external_wp_element_namespaceObject.Co - - class PostPublishPanel extends external_wp_element_namespaceObject.Component { constructor() { super(...arguments); @@ -19304,7 +25069,7 @@ class PostPublishPanel extends external_wp_element_namespaceObject.Component { componentDidUpdate(prevProps) { // Automatically collapse the publish sidebar when a post // is published and the user makes an edit. - if (prevProps.isPublished && !this.props.isSaving && this.props.isDirty) { + if (prevProps.isPublished && !this.props.isSaving && this.props.isDirty || this.props.currentPostId !== prevProps.currentPostId) { this.props.onClose(); } } @@ -19331,6 +25096,7 @@ class PostPublishPanel extends external_wp_element_namespaceObject.Component { onTogglePublishSidebar, PostPublishExtension, PrePublishExtension, + currentPostId, ...additionalProps } = this.props; const { @@ -19376,7 +25142,7 @@ class PostPublishPanel extends external_wp_element_namespaceObject.Component { className: "editor-post-publish-panel__content", children: [isPrePublish && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(prepublish, { children: PrePublishExtension && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PrePublishExtension, {}) - }), isPostPublish && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(postpublish, { + }), isPostPublish && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostPublishPanelPostpublish, { focusOnMount: true, children: PostPublishExtension && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostPublishExtension, {}) }), isSaving && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {})] @@ -19403,6 +25169,7 @@ class PostPublishPanel extends external_wp_element_namespaceObject.Component { } = select(external_wp_coreData_namespaceObject.store); const { getCurrentPost, + getCurrentPostId, getEditedPostAttribute, isCurrentPostPublished, isCurrentPostScheduled, @@ -19425,7 +25192,8 @@ class PostPublishPanel extends external_wp_element_namespaceObject.Component { isPublishSidebarEnabled: isPublishSidebarEnabled(), isSaving: isSavingPost() && !isAutosavingPost(), isSavingNonPostEntityChanges: isSavingNonPostEntityChanges(), - isScheduled: isCurrentPostScheduled() + isScheduled: isCurrentPostScheduled(), + currentPostId: getCurrentPostId() }; }), (0,external_wp_data_namespaceObject.withDispatch)((dispatch, { isPublishSidebarEnabled @@ -19455,43 +25223,11 @@ const cloudUpload = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - d: "M17.3 10.1c0-2.5-2.1-4.4-4.8-4.4-2.2 0-4.1 1.4-4.6 3.3h-.2C5.7 9 4 10.7 4 12.8c0 2.1 1.7 3.8 3.7 3.8h9c1.8 0 3.2-1.5 3.2-3.3.1-1.6-1.1-2.9-2.6-3.2zm-.5 5.1h-4v-2.4L14 14l1-1-3-3-3 3 1 1 1.2-1.2v2.4H7.7c-1.2 0-2.2-1.1-2.2-2.3s1-2.4 2.2-2.4H9l.3-1.1c.4-1.3 1.7-2.2 3.2-2.2 1.8 0 3.3 1.3 3.3 2.9v1.3l1.3.2c.8.1 1.4.9 1.4 1.8 0 1-.8 1.8-1.7 1.8z" + d: "M17.3 10.1C17.3 7.60001 15.2 5.70001 12.5 5.70001C10.3 5.70001 8.4 7.10001 7.9 9.00001H7.7C5.7 9.00001 4 10.7 4 12.8C4 14.9 5.7 16.6 7.7 16.6H9.5V15.2H7.7C6.5 15.2 5.5 14.1 5.5 12.9C5.5 11.7 6.5 10.5 7.7 10.5H9L9.3 9.40001C9.7 8.10001 11 7.20001 12.5 7.20001C14.3 7.20001 15.8 8.50001 15.8 10.1V11.4L17.1 11.6C17.9 11.7 18.5 12.5 18.5 13.4C18.5 14.4 17.7 15.2 16.8 15.2H14.5V16.6H16.7C18.5 16.6 19.9 15.1 19.9 13.3C20 11.7 18.8 10.4 17.3 10.1Z M14.1245 14.2426L15.1852 13.182L12.0032 10L8.82007 13.1831L9.88072 14.2438L11.25 12.8745V18H12.75V12.8681L14.1245 14.2426Z" }) }); /* harmony default export */ const cloud_upload = (cloudUpload); -;// ./node_modules/@wordpress/icons/build-module/icon/index.js -/** - * WordPress dependencies - */ - - -/** @typedef {{icon: JSX.Element, size?: number} & import('@wordpress/primitives').SVGProps} IconProps */ - -/** - * Return an SVG icon. - * - * @param {IconProps} props icon is the SVG component to render - * size is a number specifiying the icon size in pixels - * Other props will be passed to wrapped SVG component - * @param {import('react').ForwardedRef} ref The forwarded ref to the SVG element. - * - * @return {JSX.Element} Icon component - */ -function Icon({ - icon, - size = 24, - ...props -}, ref) { - return (0,external_wp_element_namespaceObject.cloneElement)(icon, { - width: size, - height: size, - ...props, - ref - }); -} -/* harmony default export */ const icon = ((0,external_wp_element_namespaceObject.forwardRef)(Icon)); - ;// ./node_modules/@wordpress/icons/build-module/library/cloud.js /** * WordPress dependencies @@ -19507,91 +25243,6 @@ const cloud = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(exte }); /* harmony default export */ const library_cloud = (cloud); -;// ./node_modules/@wordpress/icons/build-module/library/drafts.js -/** - * WordPress dependencies - */ - - -const drafts = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm8 4a4 4 0 0 0 4-4H8a4 4 0 0 0 4 4Z" - }) -}); -/* harmony default export */ const library_drafts = (drafts); - -;// ./node_modules/@wordpress/icons/build-module/library/pending.js -/** - * WordPress dependencies - */ - - -const pending = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm8 4a4 4 0 0 1-4-4h4V8a4 4 0 0 1 0 8Z" - }) -}); -/* harmony default export */ const library_pending = (pending); - -;// ./node_modules/@wordpress/icons/build-module/library/not-allowed.js -/** - * WordPress dependencies - */ - - -const notAllowed = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M12 18.5A6.5 6.5 0 0 1 6.93 7.931l9.139 9.138A6.473 6.473 0 0 1 12 18.5Zm5.123-2.498a6.5 6.5 0 0 0-9.124-9.124l9.124 9.124ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Z" - }) -}); -/* harmony default export */ const not_allowed = (notAllowed); - -;// ./node_modules/@wordpress/icons/build-module/library/scheduled.js -/** - * WordPress dependencies - */ - - -const scheduled = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm9 1V8h-1.5v3.5h-2V13H13Z" - }) -}); -/* harmony default export */ const library_scheduled = (scheduled); - -;// ./node_modules/@wordpress/icons/build-module/library/published.js -/** - * WordPress dependencies - */ - - -const published = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm11.53-1.47-1.06-1.06L11 12.94l-1.47-1.47-1.06 1.06L11 15.06l4.53-4.53Z" - }) -}); -/* harmony default export */ const library_published = (published); - ;// ./node_modules/@wordpress/editor/build-module/components/post-sticky/check.js /** * WordPress dependencies @@ -19606,10 +25257,10 @@ const published = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)( /** * Wrapper component that renders its children only if post has a sticky action. * - * @param {Object} props Props. - * @param {Element} props.children Children to be rendered. + * @param {Object} props Props. + * @param {React.ReactNode} props.children Children to be rendered. * - * @return {Component} The component to be rendered or null if post type is not 'post' or hasStickyAction is false. + * @return {React.ReactNode} The component to be rendered or null if post type is not 'post' or hasStickyAction is false. */ function PostStickyCheck({ children @@ -19648,7 +25299,7 @@ function PostStickyCheck({ /** * Renders the PostSticky component. It provides a checkbox control for the sticky post feature. * - * @return {Component} The component to be rendered. + * @return {React.ReactNode} The rendered component. */ function PostSticky() { @@ -19695,8 +25346,6 @@ function PostSticky() { - - const postStatusesInfo = { 'auto-draft': { label: (0,external_wp_i18n_namespaceObject.__)('Draft'), @@ -19907,6 +25556,7 @@ function PostStatus() { } ;// ./node_modules/@wordpress/editor/build-module/components/post-saved-state/index.js +/* wp:polyfill */ /** * External dependencies */ @@ -19940,7 +25590,6 @@ function PostStatus() { * @return {import('react').ComponentType} The component. */ - function PostSavedState({ forceIsDirty }) { @@ -20086,10 +25735,10 @@ function PostSavedState({ /** * Wrapper component that renders its children only if post has a publish action. * - * @param {Object} props Props. - * @param {Element} props.children Children to be rendered. + * @param {Object} props Props. + * @param {React.ReactNode} props.children Children to be rendered. * - * @return {Component} - The component to be rendered or null if there is no publish action. + * @return {React.ReactNode} - The component to be rendered or null if there is no publish action. */ function PostScheduleCheck({ children @@ -20128,7 +25777,7 @@ const panel_DESIGN_POST_TYPES = [TEMPLATE_POST_TYPE, TEMPLATE_PART_POST_TYPE, PA /** * Renders the Post Schedule Panel component. * - * @return {Component} The component to be rendered. + * @return {React.ReactNode} The rendered component. */ function PostSchedulePanel() { const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null); @@ -20186,102 +25835,6 @@ function PostSchedulePanel() { }); } -;// ./node_modules/@wordpress/editor/build-module/components/post-slug/check.js -/** - * Internal dependencies - */ - - -/** - * Wrapper component that renders its children only if the post type supports the slug. - * - * @param {Object} props Props. - * @param {Element} props.children Children to be rendered. - * - * @return {Component} The component to be rendered. - */ - -function PostSlugCheck({ - children -}) { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_type_support_check, { - supportKeys: "slug", - children: children - }); -} - -;// ./node_modules/@wordpress/editor/build-module/components/post-slug/index.js -/** - * WordPress dependencies - */ - - - - - - -/** - * Internal dependencies - */ - - - -function PostSlugControl() { - const postSlug = (0,external_wp_data_namespaceObject.useSelect)(select => { - return (0,external_wp_url_namespaceObject.safeDecodeURIComponent)(select(store_store).getEditedPostSlug()); - }, []); - const { - editPost - } = (0,external_wp_data_namespaceObject.useDispatch)(store_store); - const [forceEmptyField, setForceEmptyField] = (0,external_wp_element_namespaceObject.useState)(false); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { - __next40pxDefaultSize: true, - __nextHasNoMarginBottom: true, - label: (0,external_wp_i18n_namespaceObject.__)('Slug'), - autoComplete: "off", - spellCheck: "false", - value: forceEmptyField ? '' : postSlug, - onChange: newValue => { - editPost({ - slug: newValue - }); - // When we delete the field the permalink gets - // reverted to the original value. - // The forceEmptyField logic allows the user to have - // the field temporarily empty while typing. - if (!newValue) { - if (!forceEmptyField) { - setForceEmptyField(true); - } - return; - } - if (forceEmptyField) { - setForceEmptyField(false); - } - }, - onBlur: event => { - editPost({ - slug: (0,external_wp_url_namespaceObject.cleanForSlug)(event.target.value) - }); - if (forceEmptyField) { - setForceEmptyField(false); - } - }, - className: "editor-post-slug" - }); -} - -/** - * Renders the PostSlug component. It provide a control for editing the post slug. - * - * @return {Component} The component to be rendered. - */ -function PostSlug() { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostSlugCheck, { - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostSlugControl, {}) - }); -} - ;// ./node_modules/@wordpress/editor/build-module/components/post-switch-to-draft-button/index.js /** * WordPress dependencies @@ -20300,11 +25853,9 @@ function PostSlug() { /** * Renders a button component that allows the user to switch a post to draft status. * - * @return {JSX.Element} The rendered component. + * @return {React.ReactNode} The rendered component. */ - - function PostSwitchToDraftButton() { external_wp_deprecated_default()('wp.editor.PostSwitchToDraftButton', { since: '6.7', @@ -20390,7 +25941,7 @@ function PostSwitchToDraftButton() { /** * Renders the sync status of a post. * - * @return {JSX.Element|null} The rendered sync status component. + * @return {React.ReactNode} The rendered sync status component. */ function PostSyncStatus() { @@ -20423,6 +25974,7 @@ function PostSyncStatus() { } ;// ./node_modules/@wordpress/editor/build-module/components/post-taxonomies/index.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -20465,7 +26017,7 @@ function PostTaxonomies({ }) }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.Fragment, { - children: taxonomyWrapper( /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TaxonomyComponent, { + children: taxonomyWrapper(/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TaxonomyComponent, { ...taxonomyComponentProps }), taxonomy) }, `taxonomy-${taxonomy.slug}`); @@ -20497,10 +26049,10 @@ function PostTaxonomies({ /** * Renders the children components only if the current post type has taxonomies. * - * @param {Object} props The component props. - * @param {Element} props.children The children components to render. + * @param {Object} props The component props. + * @param {React.ReactNode} props.children The children components to render. * - * @return {Component|null} The rendered children components or null if the current post type has no taxonomies. + * @return {React.ReactNode} The rendered children components or null if the current post type has no taxonomies. */ function PostTaxonomiesCheck({ children @@ -20532,6 +26084,16 @@ function PostTaxonomiesCheck({ +/** + * Renders a panel for a specific taxonomy. + * + * @param {Object} props The component props. + * @param {Object} props.taxonomy The taxonomy object. + * @param {React.ReactNode} props.children The child components. + * + * @return {React.ReactNode} The rendered taxonomy panel. + */ + function TaxonomyPanel({ taxonomy, children @@ -20568,6 +26130,12 @@ function TaxonomyPanel({ children: children }); } + +/** + * Component that renders the post taxonomies panel. + * + * @return {React.ReactNode} The rendered component. + */ function panel_PostTaxonomies() { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostTaxonomiesCheck, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_taxonomies, { @@ -20581,17 +26149,6 @@ function panel_PostTaxonomies() { }); } -/** - * Renders a panel for a specific taxonomy. - * - * @param {Object} props The component props. - * @param {Object} props.taxonomy The taxonomy object. - * @param {Element} props.children The child components. - * - * @return {Component} The rendered taxonomy panel. - */ -/* harmony default export */ const post_taxonomies_panel = (panel_PostTaxonomies); - // EXTERNAL MODULE: ./node_modules/react-autosize-textarea/lib/index.js var lib = __webpack_require__(4132); ;// ./node_modules/@wordpress/editor/build-module/components/post-text-editor/index.js @@ -20619,11 +26176,9 @@ var lib = __webpack_require__(4132); /** * Displays the Post Text Editor along with content in Visual and Text mode. * - * @return {JSX.Element|null} The rendered PostTextEditor component. + * @return {React.ReactNode} The rendered PostTextEditor component. */ - - function PostTextEditor() { const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(PostTextEditor); const { @@ -20689,8 +26244,6 @@ function PostTextEditor() { }); } -;// external ["wp","dom"] -const external_wp_dom_namespaceObject = window["wp"]["dom"]; ;// ./node_modules/@wordpress/editor/build-module/components/post-title/constants.js const DEFAULT_CLASSNAMES = 'wp-block wp-block-post-title block-editor-block-list__block editor-post-title editor-post-title__input rich-text'; const REGEXP_NEWLINES = /[\r\n]+/g; @@ -20828,7 +26381,7 @@ function usePostTitle() { -function PostTitle(_, forwardedRef) { +const PostTitle = (0,external_wp_element_namespaceObject.forwardRef)((_, forwardedRef) => { const { placeholder } = (0,external_wp_data_namespaceObject.useSelect)(select => { @@ -20959,27 +26512,20 @@ function PostTitle(_, forwardedRef) { const className = dist_clsx(DEFAULT_CLASSNAMES, { 'is-selected': isSelected }); - return ( - /*#__PURE__*/ - /* eslint-disable jsx-a11y/heading-has-content, jsx-a11y/no-noninteractive-element-to-interactive-role */ - (0,external_ReactJSXRuntime_namespaceObject.jsx)(post_type_support_check, { - supportKeys: "title", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h1", { - ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([richTextRef, focusRef]), - contentEditable: true, - className: className, - "aria-label": decodedPlaceholder, - role: "textbox", - "aria-multiline": "true", - onFocus: onSelect, - onBlur: onUnselect, - onKeyDown: onKeyDown, - onPaste: onPaste - }) - }) - /* eslint-enable jsx-a11y/heading-has-content, jsx-a11y/no-noninteractive-element-to-interactive-role */ - ); -} + return /*#__PURE__*/ /* eslint-disable jsx-a11y/heading-has-content, jsx-a11y/no-noninteractive-element-to-interactive-role */(0,external_ReactJSXRuntime_namespaceObject.jsx)("h1", { + ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([richTextRef, focusRef]), + contentEditable: true, + className: className, + "aria-label": decodedPlaceholder, + role: "textbox", + "aria-multiline": "true", + onFocus: onSelect, + onBlur: onUnselect, + onKeyDown: onKeyDown, + onPaste: onPaste + }) + /* eslint-enable jsx-a11y/heading-has-content, jsx-a11y/no-noninteractive-element-to-interactive-role */; +}); /** * Renders the `PostTitle` component. @@ -20987,9 +26533,14 @@ function PostTitle(_, forwardedRef) { * @param {Object} _ Unused parameter. * @param {Element} forwardedRef Forwarded ref for the component. * - * @return {Component} The rendered PostTitle component. + * @return {React.ReactNode} The rendered PostTitle component. */ -/* harmony default export */ const post_title = ((0,external_wp_element_namespaceObject.forwardRef)(PostTitle)); +/* harmony default export */ const post_title = ((0,external_wp_element_namespaceObject.forwardRef)((_, forwardedRef) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_type_support_check, { + supportKeys: "title", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostTitle, { + ref: forwardedRef + }) +}))); ;// ./node_modules/@wordpress/editor/build-module/components/post-title/post-title-raw.js /** @@ -21020,7 +26571,7 @@ function PostTitle(_, forwardedRef) { * @param {Object} _ Unused parameter. * @param {Element} forwardedRef Reference to the component's DOM node. * - * @return {Component} The rendered component. + * @return {React.ReactNode} The rendered component. */ function PostTitleRaw(_, forwardedRef) { @@ -21094,12 +26645,12 @@ function PostTitleRaw(_, forwardedRef) { /** - * Wrapper component that renders its children only if the post can trashed. + * Wrapper component that renders its children only if the post can be trashed. * - * @param {Object} props - The component props. - * @param {Element} props.children - The child components to render. + * @param {Object} props The component props. + * @param {React.ReactNode} props.children The child components. * - * @return {Component|null} The rendered child components or null if the post can not trashed. + * @return {React.ReactNode} The rendered child components or null if the post can't be trashed. */ function PostTrashCheck({ children @@ -21152,10 +26703,9 @@ function PostTrashCheck({ * Displays the Post Trash Button and Confirm Dialog in the Editor. * * @param {?{onActionPerformed: Object}} An object containing the onActionPerformed function. - * @return {JSX.Element|null} The rendered PostTrash component. + * @return {React.ReactNode} The rendered PostTrash component. */ - function PostTrash({ onActionPerformed }) { @@ -21212,23 +26762,6 @@ function PostTrash({ }); } -;// ./node_modules/@wordpress/icons/build-module/library/copy-small.js -/** - * WordPress dependencies - */ - - -const copySmall = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M5.625 5.5h9.75c.069 0 .125.056.125.125v9.75a.125.125 0 0 1-.125.125h-9.75a.125.125 0 0 1-.125-.125v-9.75c0-.069.056-.125.125-.125ZM4 5.625C4 4.728 4.728 4 5.625 4h9.75C16.273 4 17 4.728 17 5.625v9.75c0 .898-.727 1.625-1.625 1.625h-9.75A1.625 1.625 0 0 1 4 15.375v-9.75Zm14.5 11.656v-9H20v9C20 18.8 18.77 20 17.251 20H6.25v-1.5h11.001c.69 0 1.249-.528 1.249-1.219Z" - }) -}); -/* harmony default export */ const copy_small = (copySmall); - ;// ./node_modules/@wordpress/editor/build-module/components/post-url/index.js /** * WordPress dependencies @@ -21257,12 +26790,12 @@ const copySmall = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)( * * ``` * - * @param {Function} onClose Callback function to be executed when the popover is closed. + * @param {{ onClose: () => void }} props The props for the component. + * @param {() => void} props.onClose Callback function to be executed when the popover is closed. * - * @return {Component} The rendered PostURL component. + * @return {React.ReactNode} The rendered PostURL component. */ - function PostURL({ onClose }) { @@ -21298,87 +26831,100 @@ function PostURL({ } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); const [forceEmptyField, setForceEmptyField] = (0,external_wp_element_namespaceObject.useState)(false); const copyButtonRef = (0,external_wp_compose_namespaceObject.useCopyToClipboard)(permalink, () => { - createNotice('info', (0,external_wp_i18n_namespaceObject.__)('Copied URL to clipboard.'), { + createNotice('info', (0,external_wp_i18n_namespaceObject.__)('Copied Permalink to clipboard.'), { isDismissible: true, type: 'snackbar' }); }); + const postUrlSlugDescriptionId = 'editor-post-url__slug-description-' + (0,external_wp_compose_namespaceObject.useInstanceId)(PostURL); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "editor-post-url", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalInspectorPopoverHeader, { - title: (0,external_wp_i18n_namespaceObject.__)('Link'), + title: (0,external_wp_i18n_namespaceObject.__)('Slug'), onClose: onClose }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 3, - children: [isEditable && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { - children: (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.__)('Customize the last part of the URL. Learn more.'), { + children: [isEditable && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { + className: "editor-post-url__intro", + children: (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.__)('Customize the last part of the Permalink. Learn more.'), { + span: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { + id: postUrlSlugDescriptionId + }), a: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, { href: (0,external_wp_i18n_namespaceObject.__)('https://wordpress.org/documentation/article/page-post-settings-sidebar/#permalink') }) }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { - children: [isEditable && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalInputControl, { - __next40pxDefaultSize: true, - prefix: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalInputControlPrefixWrapper, { - children: "/" - }), - suffix: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalInputControlSuffixWrapper, { - variant: "control", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - icon: copy_small, - ref: copyButtonRef, - size: "small", - label: "Copy" - }) - }), - label: (0,external_wp_i18n_namespaceObject.__)('Link'), - hideLabelFromVision: true, - value: forceEmptyField ? '' : postSlug, - autoComplete: "off", - spellCheck: "false", - type: "text", - className: "editor-post-url__input", - onChange: newValue => { - editPost({ - slug: newValue - }); - // When we delete the field the permalink gets - // reverted to the original value. - // The forceEmptyField logic allows the user to have - // the field temporarily empty while typing. - if (!newValue) { - if (!forceEmptyField) { - setForceEmptyField(true); + children: [isEditable && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalInputControl, { + __next40pxDefaultSize: true, + prefix: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalInputControlPrefixWrapper, { + children: "/" + }), + suffix: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalInputControlSuffixWrapper, { + variant: "control", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + icon: copy_small, + ref: copyButtonRef, + size: "small", + label: "Copy" + }) + }), + label: (0,external_wp_i18n_namespaceObject.__)('Slug'), + hideLabelFromVision: true, + value: forceEmptyField ? '' : postSlug, + autoComplete: "off", + spellCheck: "false", + type: "text", + className: "editor-post-url__input", + onChange: newValue => { + editPost({ + slug: newValue + }); + // When we delete the field the permalink gets + // reverted to the original value. + // The forceEmptyField logic allows the user to have + // the field temporarily empty while typing. + if (!newValue) { + if (!forceEmptyField) { + setForceEmptyField(true); + } + return; } - return; - } - if (forceEmptyField) { - setForceEmptyField(false); - } - }, - onBlur: event => { - editPost({ - slug: (0,external_wp_url_namespaceObject.cleanForSlug)(event.target.value) - }); - if (forceEmptyField) { - setForceEmptyField(false); - } - }, - help: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.ExternalLink, { - className: "editor-post-url__link", - href: postLink, - target: "_blank", + if (forceEmptyField) { + setForceEmptyField(false); + } + }, + onBlur: event => { + editPost({ + slug: (0,external_wp_url_namespaceObject.cleanForSlug)(event.target.value) + }); + if (forceEmptyField) { + setForceEmptyField(false); + } + }, + "aria-describedby": postUrlSlugDescriptionId + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("p", { + className: "editor-post-url__permalink", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { - className: "editor-post-url__link-prefix", - children: permalinkPrefix - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { - className: "editor-post-url__link-slug", - children: postSlug - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { - className: "editor-post-url__link-suffix", - children: permalinkSuffix + className: "editor-post-url__permalink-visual-label", + children: (0,external_wp_i18n_namespaceObject.__)('Permalink:') + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.ExternalLink, { + className: "editor-post-url__link", + href: postLink, + target: "_blank", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { + className: "editor-post-url__link-prefix", + children: permalinkPrefix + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { + className: "editor-post-url__link-slug", + children: postSlug + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { + className: "editor-post-url__link-suffix", + children: permalinkSuffix + })] })] - }) + })] }), !isEditable && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, { className: "editor-post-url__link", href: postLink, @@ -21405,10 +26951,10 @@ function PostURL({ /** * Check if the post URL is valid and visible. * - * @param {Object} props The component props. - * @param {Element} props.children The child components. + * @param {Object} props The component props. + * @param {React.ReactNode} props.children The child components. * - * @return {Component|null} The child components if the post URL is valid and visible, otherwise null. + * @return {React.ReactNode} The child components if the post URL is valid and visible, otherwise null. */ function PostURLCheck({ children @@ -21450,7 +26996,7 @@ function PostURLCheck({ /** * Represents a label component for a post URL. * - * @return {Component} The PostURLLabel component. + * @return {React.ReactNode} The PostURLLabel component. */ function PostURLLabel() { return usePostURLLabel(); @@ -21488,10 +27034,29 @@ function usePostURLLabel() { /** * Renders the `PostURLPanel` component. * - * @return {JSX.Element} The rendered PostURLPanel component. + * @return {React.ReactNode} The rendered PostURLPanel component. */ function PostURLPanel() { + const { + isFrontPage + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getCurrentPostId + } = select(store_store); + const { + getEditedEntityRecord, + canUser + } = select(external_wp_coreData_namespaceObject.store); + const siteSettings = canUser('read', { + kind: 'root', + name: 'site' + }) ? getEditedEntityRecord('root', 'site') : undefined; + const _id = getCurrentPostId(); + return { + isFrontPage: siteSettings?.page_on_front === _id + }; + }, []); // Use internal state instead of a ref to make sure that the component // re-renders when the popover's anchor updates. const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null); @@ -21504,11 +27069,12 @@ function PostURLPanel() { offset: 36, shift: true }), [popoverAnchor]); + const label = isFrontPage ? (0,external_wp_i18n_namespaceObject.__)('Link') : (0,external_wp_i18n_namespaceObject.__)('Slug'); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostURLCheck, { - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_panel_row, { - label: (0,external_wp_i18n_namespaceObject.__)('Link'), + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(post_panel_row, { + label: label, ref: setPopoverAnchor, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Dropdown, { + children: [!isFrontPage && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Dropdown, { popoverProps: popoverProps, className: "editor-post-url__panel-dropdown", contentClassName: "editor-post-url__panel-dialog", @@ -21525,7 +27091,7 @@ function PostURLPanel() { }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostURL, { onClose: onClose }) - }) + }), isFrontPage && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(FrontPageLink, {})] }) }); } @@ -21534,27 +27100,10 @@ function PostURLToggle({ onClick }) { const { - slug, - isFrontPage, - postLink + slug } = (0,external_wp_data_namespaceObject.useSelect)(select => { - const { - getCurrentPostId, - getCurrentPost - } = select(store_store); - const { - getEditedEntityRecord, - canUser - } = select(external_wp_coreData_namespaceObject.store); - const siteSettings = canUser('read', { - kind: 'root', - name: 'site' - }) ? getEditedEntityRecord('root', 'site') : undefined; - const _id = getCurrentPostId(); return { - slug: select(store_store).getEditedPostSlug(), - isFrontPage: siteSettings?.page_on_front === _id, - postLink: getCurrentPost()?.link + slug: select(store_store).getEditedPostSlug() }; }, []); const decodedSlug = (0,external_wp_url_namespaceObject.safeDecodeURIComponent)(slug); @@ -21567,12 +27116,29 @@ function PostURLToggle({ // translators: %s: Current post link. (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('Change link: %s'), decodedSlug), onClick: onClick, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalTruncate, { - numberOfLines: 1, - children: isFrontPage ? postLink : `/${decodedSlug}` + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: decodedSlug }) }); } +function FrontPageLink() { + const { + postLink + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getCurrentPost + } = select(store_store); + return { + postLink: getCurrentPost()?.link + }; + }, []); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, { + className: "editor-post-url__front-page-link", + href: postLink, + target: "_blank", + children: postLink + }); +} ;// ./node_modules/@wordpress/editor/build-module/components/post-visibility/check.js /** @@ -21592,7 +27158,7 @@ function PostURLToggle({ * @param {Object} props The component props. * @param {Function} props.render Function to render the component. * Receives an object with a `canEdit` property. - * @return {JSX.Element} The rendered component. + * @return {React.ReactNode} The rendered component. */ function PostVisibilityCheck({ render @@ -21613,10 +27179,12 @@ function PostVisibilityCheck({ const info = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", + xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - d: "M12 3.2c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8 0-4.8-4-8.8-8.8-8.8zm0 16c-4 0-7.2-3.3-7.2-7.2C4.8 8 8 4.8 12 4.8s7.2 3.3 7.2 7.2c0 4-3.2 7.2-7.2 7.2zM11 17h2v-6h-2v6zm0-8h2V7h-2v2z" + fillRule: "evenodd", + clipRule: "evenodd", + d: "M5.5 12a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0ZM12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm.75 4v1.5h-1.5V8h1.5Zm0 8v-5h-1.5v5h1.5Z" }) }); /* harmony default export */ const library_info = (info); @@ -21639,7 +27207,7 @@ const external_wp_wordcount_namespaceObject = window["wp"]["wordcount"]; /** * Renders the word count of the post content. * - * @return {JSX.Element|null} The rendered WordCount component. + * @return {React.ReactNode} The rendered WordCount component. */ function WordCount() { @@ -21684,7 +27252,7 @@ const AVERAGE_READING_RATE = 189; /** * Component for showing Time To Read in Content. * - * @return {JSX.Element} The rendered TimeToRead component. + * @return {React.ReactNode} The rendered TimeToRead component. */ function TimeToRead() { const content = (0,external_wp_data_namespaceObject.useSelect)(select => select(store_store).getEditedPostAttribute('content'), []); @@ -21698,7 +27266,7 @@ function TimeToRead() { const minutesToRead = Math.round((0,external_wp_wordcount_namespaceObject.count)(content, wordCountType) / AVERAGE_READING_RATE); const minutesToReadString = minutesToRead === 0 ? (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.__)('< 1 minute'), { span: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {}) - }) : (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: the number of minutes to read the post. */ + }) : (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: the number of minutes to read the post. */ (0,external_wp_i18n_namespaceObject._n)('%s minute', '%s minutes', minutesToRead), minutesToRead), { span: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {}) }); @@ -21746,8 +27314,6 @@ function CharacterCount() { - - function TableOfContentsPanel({ hasOutlineItemsDisabled, onRequestClose @@ -21890,7 +27456,7 @@ function TableOfContents({ * @param {boolean} props.repositionDropdown Whether to reposition the dropdown. * @param {Element.ref} ref The component's ref. * - * @return {JSX.Element} The rendered table of contents component. + * @return {React.ReactNode} The rendered table of contents component. */ /* harmony default export */ const table_of_contents = ((0,external_wp_element_namespaceObject.forwardRef)(TableOfContents)); @@ -21907,7 +27473,7 @@ function TableOfContents({ * Warns the user if there are unsaved changes before leaving the editor. * Compatible with Post Editor and Site Editor. * - * @return {Component} The component. + * @return {React.ReactNode} The component. */ function UnsavedChangesWarning() { const { @@ -21940,2843 +27506,11 @@ function UnsavedChangesWarning() { return null; } -;// ./node_modules/@wordpress/editor/build-module/components/provider/with-registry-provider.js -/** - * WordPress dependencies - */ - - - - - -/** - * Internal dependencies - */ - - -function getSubRegistry(subRegistries, registry, useSubRegistry) { - if (!useSubRegistry) { - return registry; - } - let subRegistry = subRegistries.get(registry); - if (!subRegistry) { - subRegistry = (0,external_wp_data_namespaceObject.createRegistry)({ - 'core/block-editor': external_wp_blockEditor_namespaceObject.storeConfig - }, registry); - // Todo: The interface store should also be created per instance. - subRegistry.registerStore('core/editor', storeConfig); - subRegistries.set(registry, subRegistry); - } - return subRegistry; -} -const withRegistryProvider = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(WrappedComponent => ({ - useSubRegistry = true, - ...props -}) => { - const registry = (0,external_wp_data_namespaceObject.useRegistry)(); - const [subRegistries] = (0,external_wp_element_namespaceObject.useState)(() => new WeakMap()); - const subRegistry = getSubRegistry(subRegistries, registry, useSubRegistry); - if (subRegistry === registry) { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WrappedComponent, { - registry: registry, - ...props - }); - } - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_data_namespaceObject.RegistryProvider, { - value: subRegistry, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WrappedComponent, { - registry: subRegistry, - ...props - }) - }); -}, 'withRegistryProvider'); -/* harmony default export */ const with_registry_provider = (withRegistryProvider); - -;// ./node_modules/@wordpress/editor/build-module/components/media-categories/index.js -/* wp:polyfill */ -/** - * The `editor` settings here need to be in sync with the corresponding ones in `editor` package. - * See `packages/editor/src/components/media-categories/index.js`. - * - * In the future we could consider creating an Openvese package that can be used in both `editor` and `site-editor`. - * The rest of the settings would still need to be in sync though. - */ - -/** - * WordPress dependencies - */ - - - - -/** - * Internal dependencies - */ - - -/** @typedef {import('@wordpress/block-editor').InserterMediaRequest} InserterMediaRequest */ -/** @typedef {import('@wordpress/block-editor').InserterMediaItem} InserterMediaItem */ -/** @typedef {import('@wordpress/block-editor').InserterMediaCategory} InserterMediaCategory */ - -const getExternalLink = (url, text) => `${text}`; -const getExternalLinkAttributes = url => `href="${url}" target="_blank" rel="noreferrer noopener"`; -const getOpenverseLicense = (license, licenseVersion) => { - let licenseName = license.trim(); - // PDM has no abbreviation - if (license !== 'pdm') { - licenseName = license.toUpperCase().replace('SAMPLING', 'Sampling'); - } - // If version is known, append version to the name. - // The license has to have a version to be valid. Only - // PDM (public domain mark) doesn't have a version. - if (licenseVersion) { - licenseName += ` ${licenseVersion}`; - } - // For licenses other than public-domain marks, prepend 'CC' to the name. - if (!['pdm', 'cc0'].includes(license)) { - licenseName = `CC ${licenseName}`; - } - return licenseName; -}; -const getOpenverseCaption = item => { - const { - title, - foreign_landing_url: foreignLandingUrl, - creator, - creator_url: creatorUrl, - license, - license_version: licenseVersion, - license_url: licenseUrl - } = item; - const fullLicense = getOpenverseLicense(license, licenseVersion); - const _creator = (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(creator); - let _caption; - if (_creator) { - _caption = title ? (0,external_wp_i18n_namespaceObject.sprintf)( - // translators: %1s: Title of a media work from Openverse; %2s: Name of the work's creator; %3s: Work's licence e.g: "CC0 1.0". - (0,external_wp_i18n_namespaceObject._x)('"%1$s" by %2$s/ %3$s', 'caption'), getExternalLink(foreignLandingUrl, (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title)), creatorUrl ? getExternalLink(creatorUrl, _creator) : _creator, licenseUrl ? getExternalLink(`${licenseUrl}?ref=openverse`, fullLicense) : fullLicense) : (0,external_wp_i18n_namespaceObject.sprintf)( - // translators: %1s: Link attributes for a given Openverse media work; %2s: Name of the work's creator; %3s: Works's licence e.g: "CC0 1.0". - (0,external_wp_i18n_namespaceObject._x)('Work by %2$s/ %3$s', 'caption'), getExternalLinkAttributes(foreignLandingUrl), creatorUrl ? getExternalLink(creatorUrl, _creator) : _creator, licenseUrl ? getExternalLink(`${licenseUrl}?ref=openverse`, fullLicense) : fullLicense); - } else { - _caption = title ? (0,external_wp_i18n_namespaceObject.sprintf)( - // translators: %1s: Title of a media work from Openverse; %2s: Work's licence e.g: "CC0 1.0". - (0,external_wp_i18n_namespaceObject._x)('"%1$s"/ %2$s', 'caption'), getExternalLink(foreignLandingUrl, (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title)), licenseUrl ? getExternalLink(`${licenseUrl}?ref=openverse`, fullLicense) : fullLicense) : (0,external_wp_i18n_namespaceObject.sprintf)( - // translators: %1s: Link attributes for a given Openverse media work; %2s: Works's licence e.g: "CC0 1.0". - (0,external_wp_i18n_namespaceObject._x)('Work/ %2$s', 'caption'), getExternalLinkAttributes(foreignLandingUrl), licenseUrl ? getExternalLink(`${licenseUrl}?ref=openverse`, fullLicense) : fullLicense); - } - return _caption.replace(/\s{2}/g, ' '); -}; -const coreMediaFetch = async (query = {}) => { - const mediaItems = await (0,external_wp_data_namespaceObject.resolveSelect)(external_wp_coreData_namespaceObject.store).getMediaItems({ - ...query, - orderBy: !!query?.search ? 'relevance' : 'date' - }); - return mediaItems.map(mediaItem => ({ - ...mediaItem, - alt: mediaItem.alt_text, - url: mediaItem.source_url, - previewUrl: mediaItem.media_details?.sizes?.medium?.source_url, - caption: mediaItem.caption?.raw - })); -}; - -/** @type {InserterMediaCategory[]} */ -const inserterMediaCategories = [{ - name: 'images', - labels: { - name: (0,external_wp_i18n_namespaceObject.__)('Images'), - search_items: (0,external_wp_i18n_namespaceObject.__)('Search images') - }, - mediaType: 'image', - async fetch(query = {}) { - return coreMediaFetch({ - ...query, - media_type: 'image' - }); - } -}, { - name: 'videos', - labels: { - name: (0,external_wp_i18n_namespaceObject.__)('Videos'), - search_items: (0,external_wp_i18n_namespaceObject.__)('Search videos') - }, - mediaType: 'video', - async fetch(query = {}) { - return coreMediaFetch({ - ...query, - media_type: 'video' - }); - } -}, { - name: 'audio', - labels: { - name: (0,external_wp_i18n_namespaceObject.__)('Audio'), - search_items: (0,external_wp_i18n_namespaceObject.__)('Search audio') - }, - mediaType: 'audio', - async fetch(query = {}) { - return coreMediaFetch({ - ...query, - media_type: 'audio' - }); - } -}, { - name: 'openverse', - labels: { - name: (0,external_wp_i18n_namespaceObject.__)('Openverse'), - search_items: (0,external_wp_i18n_namespaceObject.__)('Search Openverse') - }, - mediaType: 'image', - async fetch(query = {}) { - const defaultArgs = { - mature: false, - excluded_source: 'flickr,inaturalist,wikimedia', - license: 'pdm,cc0' - }; - const finalQuery = { - ...query, - ...defaultArgs - }; - const mapFromInserterMediaRequest = { - per_page: 'page_size', - search: 'q' - }; - const url = new URL('https://api.openverse.org/v1/images/'); - Object.entries(finalQuery).forEach(([key, value]) => { - const queryKey = mapFromInserterMediaRequest[key] || key; - url.searchParams.set(queryKey, value); - }); - const response = await window.fetch(url, { - headers: { - 'User-Agent': 'WordPress/inserter-media-fetch' - } - }); - const jsonResponse = await response.json(); - const results = jsonResponse.results; - return results.map(result => ({ - ...result, - // This is a temp solution for better titles, until Openverse API - // completes the cleaning up of some titles of their upstream data. - title: result.title?.toLowerCase().startsWith('file:') ? result.title.slice(5) : result.title, - sourceId: result.id, - id: undefined, - caption: getOpenverseCaption(result), - previewUrl: result.thumbnail - })); - }, - getReportUrl: ({ - sourceId - }) => `https://wordpress.org/openverse/image/${sourceId}/report/`, - isExternalResource: true -}]; -/* harmony default export */ const media_categories = (inserterMediaCategories); - -;// ./node_modules/@wordpress/editor/build-module/utils/media-upload/index.js -/** - * External dependencies - */ - - -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - -const media_upload_noop = () => {}; - -/** - * Upload a media file when the file upload button is activated. - * Wrapper around mediaUpload() that injects the current post ID. - * - * @param {Object} $0 Parameters object passed to the function. - * @param {?Object} $0.additionalData Additional data to include in the request. - * @param {string} $0.allowedTypes Array with the types of media that can be uploaded, if unset all types are allowed. - * @param {Array} $0.filesList List of files. - * @param {?number} $0.maxUploadFileSize Maximum upload size in bytes allowed for the site. - * @param {Function} $0.onError Function called when an error happens. - * @param {Function} $0.onFileChange Function called each time a file or a temporary representation of the file is available. - */ -function mediaUpload({ - additionalData = {}, - allowedTypes, - filesList, - maxUploadFileSize, - onError = media_upload_noop, - onFileChange -}) { - const { - getCurrentPost, - getEditorSettings - } = (0,external_wp_data_namespaceObject.select)(store_store); - const { - lockPostAutosaving, - unlockPostAutosaving, - lockPostSaving, - unlockPostSaving - } = (0,external_wp_data_namespaceObject.dispatch)(store_store); - const wpAllowedMimeTypes = getEditorSettings().allowedMimeTypes; - const lockKey = `image-upload-${esm_browser_v4()}`; - let imageIsUploading = false; - maxUploadFileSize = maxUploadFileSize || getEditorSettings().maxUploadFileSize; - const currentPost = getCurrentPost(); - // Templates and template parts' numerical ID is stored in `wp_id`. - const currentPostId = typeof currentPost?.id === 'number' ? currentPost.id : currentPost?.wp_id; - const setSaveLock = () => { - lockPostSaving(lockKey); - lockPostAutosaving(lockKey); - imageIsUploading = true; - }; - const postData = currentPostId ? { - post: currentPostId - } : {}; - const clearSaveLock = () => { - unlockPostSaving(lockKey); - unlockPostAutosaving(lockKey); - imageIsUploading = false; - }; - (0,external_wp_mediaUtils_namespaceObject.uploadMedia)({ - allowedTypes, - filesList, - onFileChange: file => { - if (!imageIsUploading) { - setSaveLock(); - } else { - clearSaveLock(); - } - onFileChange(file); - }, - additionalData: { - ...postData, - ...additionalData - }, - maxUploadFileSize, - onError: ({ - message - }) => { - clearSaveLock(); - onError(message); - }, - wpAllowedMimeTypes - }); -} - -// EXTERNAL MODULE: ./node_modules/deepmerge/dist/cjs.js -var cjs = __webpack_require__(66); -var cjs_default = /*#__PURE__*/__webpack_require__.n(cjs); -;// ./node_modules/is-plain-object/dist/is-plain-object.mjs -/*! - * is-plain-object - * - * Copyright (c) 2014-2017, Jon Schlinkert. - * Released under the MIT License. - */ - -function isObject(o) { - return Object.prototype.toString.call(o) === '[object Object]'; -} - -function isPlainObject(o) { - var ctor,prot; - - if (isObject(o) === false) return false; - - // If has modified constructor - ctor = o.constructor; - if (ctor === undefined) return true; - - // If has modified prototype - prot = ctor.prototype; - if (isObject(prot) === false) return false; - - // If constructor does not have an Object-specific method - if (prot.hasOwnProperty('isPrototypeOf') === false) { - return false; - } - - // Most likely a plain Object - return true; -} - - - -;// ./node_modules/@wordpress/editor/build-module/components/global-styles-provider/index.js -/** - * External dependencies - */ - - - -/** - * WordPress dependencies - */ - - - - - -/** - * Internal dependencies - */ - - -const { - GlobalStylesContext: global_styles_provider_GlobalStylesContext, - cleanEmptyObject -} = unlock(external_wp_blockEditor_namespaceObject.privateApis); -function mergeBaseAndUserConfigs(base, user) { - return cjs_default()(base, user, { - /* - * We only pass as arrays the presets, - * in which case we want the new array of values - * to override the old array (no merging). - */ - isMergeableObject: isPlainObject, - /* - * Exceptions to the above rule. - * Background images should be replaced, not merged, - * as they themselves are specific object definitions for the style. - */ - customMerge: key => { - if (key === 'backgroundImage') { - return (baseConfig, userConfig) => userConfig; - } - return undefined; - } - }); -} -function useGlobalStylesUserConfig() { - const { - globalStylesId, - isReady, - settings, - styles, - _links - } = (0,external_wp_data_namespaceObject.useSelect)(select => { - const { - getEntityRecord, - getEditedEntityRecord, - hasFinishedResolution, - canUser - } = select(external_wp_coreData_namespaceObject.store); - const _globalStylesId = select(external_wp_coreData_namespaceObject.store).__experimentalGetCurrentGlobalStylesId(); - let record; - - // We want the global styles ID request to finish before triggering - // the OPTIONS request for user capabilities, otherwise it will - // fetch `/wp/v2/global-styles` instead of - // `/wp/v2/global-styles/{id}`! - // Please adjust the preloaded requests if this changes! - const userCanEditGlobalStyles = _globalStylesId ? canUser('update', { - kind: 'root', - name: 'globalStyles', - id: _globalStylesId - }) : null; - if (_globalStylesId && - // We want the OPTIONS request for user capabilities to finish - // before getting the records, otherwise we'll fetch both! - typeof userCanEditGlobalStyles === 'boolean') { - // Please adjust the preloaded requests if this changes! - if (userCanEditGlobalStyles) { - record = getEditedEntityRecord('root', 'globalStyles', _globalStylesId); - } else { - record = getEntityRecord('root', 'globalStyles', _globalStylesId, { - context: 'view' - }); - } - } - let hasResolved = false; - if (hasFinishedResolution('__experimentalGetCurrentGlobalStylesId')) { - if (_globalStylesId) { - hasResolved = userCanEditGlobalStyles ? hasFinishedResolution('getEditedEntityRecord', ['root', 'globalStyles', _globalStylesId]) : hasFinishedResolution('getEntityRecord', ['root', 'globalStyles', _globalStylesId, { - context: 'view' - }]); - } else { - hasResolved = true; - } - } - return { - globalStylesId: _globalStylesId, - isReady: hasResolved, - settings: record?.settings, - styles: record?.styles, - _links: record?._links - }; - }, []); - const { - getEditedEntityRecord - } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_coreData_namespaceObject.store); - const { - editEntityRecord - } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); - const config = (0,external_wp_element_namespaceObject.useMemo)(() => { - return { - settings: settings !== null && settings !== void 0 ? settings : {}, - styles: styles !== null && styles !== void 0 ? styles : {}, - _links: _links !== null && _links !== void 0 ? _links : {} - }; - }, [settings, styles, _links]); - const setConfig = (0,external_wp_element_namespaceObject.useCallback)( - /** - * Set the global styles config. - * @param {Function|Object} callbackOrObject If the callbackOrObject is a function, pass the current config to the callback so the consumer can merge values. - * Otherwise, overwrite the current config with the incoming object. - * @param {Object} options Options for editEntityRecord Core selector. - */ - (callbackOrObject, options = {}) => { - var _record$styles, _record$settings, _record$_links; - const record = getEditedEntityRecord('root', 'globalStyles', globalStylesId); - const currentConfig = { - styles: (_record$styles = record?.styles) !== null && _record$styles !== void 0 ? _record$styles : {}, - settings: (_record$settings = record?.settings) !== null && _record$settings !== void 0 ? _record$settings : {}, - _links: (_record$_links = record?._links) !== null && _record$_links !== void 0 ? _record$_links : {} - }; - const updatedConfig = typeof callbackOrObject === 'function' ? callbackOrObject(currentConfig) : callbackOrObject; - editEntityRecord('root', 'globalStyles', globalStylesId, { - styles: cleanEmptyObject(updatedConfig.styles) || {}, - settings: cleanEmptyObject(updatedConfig.settings) || {}, - _links: cleanEmptyObject(updatedConfig._links) || {} - }, options); - }, [globalStylesId, editEntityRecord, getEditedEntityRecord]); - return [isReady, config, setConfig]; -} -function useGlobalStylesBaseConfig() { - const baseConfig = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).__experimentalGetCurrentThemeBaseGlobalStyles(), []); - return [!!baseConfig, baseConfig]; -} -function useGlobalStylesContext() { - const [isUserConfigReady, userConfig, setUserConfig] = useGlobalStylesUserConfig(); - const [isBaseConfigReady, baseConfig] = useGlobalStylesBaseConfig(); - const mergedConfig = (0,external_wp_element_namespaceObject.useMemo)(() => { - if (!baseConfig || !userConfig) { - return {}; - } - return mergeBaseAndUserConfigs(baseConfig, userConfig); - }, [userConfig, baseConfig]); - const context = (0,external_wp_element_namespaceObject.useMemo)(() => { - return { - isReady: isUserConfigReady && isBaseConfigReady, - user: userConfig, - base: baseConfig, - merged: mergedConfig, - setUserConfig - }; - }, [mergedConfig, userConfig, baseConfig, setUserConfig, isUserConfigReady, isBaseConfigReady]); - return context; -} -function GlobalStylesProvider({ - children -}) { - const context = useGlobalStylesContext(); - if (!context.isReady) { - return null; - } - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(global_styles_provider_GlobalStylesContext.Provider, { - value: context, - children: children - }); -} - -;// ./node_modules/@wordpress/editor/build-module/components/provider/use-block-editor-settings.js -/** - * WordPress dependencies - */ - - - - - - - - - -/** - * Internal dependencies - */ - - - - - -const use_block_editor_settings_EMPTY_OBJECT = {}; -function __experimentalReusableBlocksSelect(select) { - const { - getEntityRecords, - hasFinishedResolution - } = select(external_wp_coreData_namespaceObject.store); - const reusableBlocks = getEntityRecords('postType', 'wp_block', { - per_page: -1 - }); - return hasFinishedResolution('getEntityRecords', ['postType', 'wp_block', { - per_page: -1 - }]) ? reusableBlocks : undefined; -} -const BLOCK_EDITOR_SETTINGS = ['__experimentalBlockDirectory', '__experimentalDiscussionSettings', '__experimentalFeatures', '__experimentalGlobalStylesBaseStyles', 'alignWide', 'blockInspectorTabs', 'allowedMimeTypes', 'bodyPlaceholder', 'canLockBlocks', 'canUpdateBlockBindings', 'capabilities', 'clearBlockSelection', 'codeEditingEnabled', 'colors', 'disableCustomColors', 'disableCustomFontSizes', 'disableCustomSpacingSizes', 'disableCustomGradients', 'disableLayoutStyles', 'enableCustomLineHeight', 'enableCustomSpacing', 'enableCustomUnits', 'enableOpenverseMediaCategory', 'fontSizes', 'gradients', 'generateAnchors', 'onNavigateToEntityRecord', 'imageDefaultSize', 'imageDimensions', 'imageEditing', 'imageSizes', 'isRTL', 'locale', 'maxWidth', 'postContentAttributes', 'postsPerPage', 'readOnly', 'styles', 'titlePlaceholder', 'supportsLayout', 'widgetTypesToHideFromLegacyWidgetBlock', '__unstableHasCustomAppender', '__unstableIsPreviewMode', '__unstableResolvedAssets', '__unstableIsBlockBasedTheme']; -const { - globalStylesDataKey, - globalStylesLinksDataKey, - selectBlockPatternsKey, - reusableBlocksSelectKey, - sectionRootClientIdKey -} = unlock(external_wp_blockEditor_namespaceObject.privateApis); - -/** - * React hook used to compute the block editor settings to use for the post editor. - * - * @param {Object} settings EditorProvider settings prop. - * @param {string} postType Editor root level post type. - * @param {string} postId Editor root level post ID. - * @param {string} renderingMode Editor rendering mode. - * - * @return {Object} Block Editor Settings. - */ -function useBlockEditorSettings(settings, postType, postId, renderingMode) { - var _mergedGlobalStyles$s, _mergedGlobalStyles$_, _settings$__experimen, _settings$__experimen2; - const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium'); - const { - allowRightClickOverrides, - blockTypes, - focusMode, - hasFixedToolbar, - isDistractionFree, - keepCaretInsideBlock, - hasUploadPermissions, - hiddenBlockTypes, - canUseUnfilteredHTML, - userCanCreatePages, - pageOnFront, - pageForPosts, - userPatternCategories, - restBlockPatternCategories, - sectionRootClientId - } = (0,external_wp_data_namespaceObject.useSelect)(select => { - var _canUser; - const { - canUser, - getRawEntityRecord, - getEntityRecord, - getUserPatternCategories, - getBlockPatternCategories - } = select(external_wp_coreData_namespaceObject.store); - const { - get - } = select(external_wp_preferences_namespaceObject.store); - const { - getBlockTypes - } = select(external_wp_blocks_namespaceObject.store); - const { - getBlocksByName, - getBlockAttributes - } = select(external_wp_blockEditor_namespaceObject.store); - const siteSettings = canUser('read', { - kind: 'root', - name: 'site' - }) ? getEntityRecord('root', 'site') : undefined; - function getSectionRootBlock() { - var _getBlocksByName$find; - if (renderingMode === 'template-locked') { - var _getBlocksByName$; - return (_getBlocksByName$ = getBlocksByName('core/post-content')?.[0]) !== null && _getBlocksByName$ !== void 0 ? _getBlocksByName$ : ''; - } - return (_getBlocksByName$find = getBlocksByName('core/group').find(clientId => getBlockAttributes(clientId)?.tagName === 'main')) !== null && _getBlocksByName$find !== void 0 ? _getBlocksByName$find : ''; - } - return { - allowRightClickOverrides: get('core', 'allowRightClickOverrides'), - blockTypes: getBlockTypes(), - canUseUnfilteredHTML: getRawEntityRecord('postType', postType, postId)?._links?.hasOwnProperty('wp:action-unfiltered-html'), - focusMode: get('core', 'focusMode'), - hasFixedToolbar: get('core', 'fixedToolbar') || !isLargeViewport, - hiddenBlockTypes: get('core', 'hiddenBlockTypes'), - isDistractionFree: get('core', 'distractionFree'), - keepCaretInsideBlock: get('core', 'keepCaretInsideBlock'), - hasUploadPermissions: (_canUser = canUser('create', { - kind: 'root', - name: 'media' - })) !== null && _canUser !== void 0 ? _canUser : true, - userCanCreatePages: canUser('create', { - kind: 'postType', - name: 'page' - }), - pageOnFront: siteSettings?.page_on_front, - pageForPosts: siteSettings?.page_for_posts, - userPatternCategories: getUserPatternCategories(), - restBlockPatternCategories: getBlockPatternCategories(), - sectionRootClientId: getSectionRootBlock() - }; - }, [postType, postId, isLargeViewport, renderingMode]); - const { - merged: mergedGlobalStyles - } = useGlobalStylesContext(); - const globalStylesData = (_mergedGlobalStyles$s = mergedGlobalStyles.styles) !== null && _mergedGlobalStyles$s !== void 0 ? _mergedGlobalStyles$s : use_block_editor_settings_EMPTY_OBJECT; - const globalStylesLinksData = (_mergedGlobalStyles$_ = mergedGlobalStyles._links) !== null && _mergedGlobalStyles$_ !== void 0 ? _mergedGlobalStyles$_ : use_block_editor_settings_EMPTY_OBJECT; - const settingsBlockPatterns = (_settings$__experimen = settings.__experimentalAdditionalBlockPatterns) !== null && _settings$__experimen !== void 0 ? _settings$__experimen : - // WP 6.0 - settings.__experimentalBlockPatterns; // WP 5.9 - const settingsBlockPatternCategories = (_settings$__experimen2 = settings.__experimentalAdditionalBlockPatternCategories) !== null && _settings$__experimen2 !== void 0 ? _settings$__experimen2 : - // WP 6.0 - settings.__experimentalBlockPatternCategories; // WP 5.9 - - const blockPatterns = (0,external_wp_element_namespaceObject.useMemo)(() => [...(settingsBlockPatterns || [])].filter(({ - postTypes - }) => { - return !postTypes || Array.isArray(postTypes) && postTypes.includes(postType); - }), [settingsBlockPatterns, postType]); - const blockPatternCategories = (0,external_wp_element_namespaceObject.useMemo)(() => [...(settingsBlockPatternCategories || []), ...(restBlockPatternCategories || [])].filter((x, index, arr) => index === arr.findIndex(y => x.name === y.name)), [settingsBlockPatternCategories, restBlockPatternCategories]); - const { - undo, - setIsInserterOpened - } = (0,external_wp_data_namespaceObject.useDispatch)(store_store); - const { - saveEntityRecord - } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); - - /** - * Creates a Post entity. - * This is utilised by the Link UI to allow for on-the-fly creation of Posts/Pages. - * - * @param {Object} options parameters for the post being created. These mirror those used on 3rd param of saveEntityRecord. - * @return {Object} the post type object that was created. - */ - const createPageEntity = (0,external_wp_element_namespaceObject.useCallback)(options => { - if (!userCanCreatePages) { - return Promise.reject({ - message: (0,external_wp_i18n_namespaceObject.__)('You do not have permission to create Pages.') - }); - } - return saveEntityRecord('postType', 'page', options); - }, [saveEntityRecord, userCanCreatePages]); - const allowedBlockTypes = (0,external_wp_element_namespaceObject.useMemo)(() => { - // Omit hidden block types if exists and non-empty. - if (hiddenBlockTypes && hiddenBlockTypes.length > 0) { - // Defer to passed setting for `allowedBlockTypes` if provided as - // anything other than `true` (where `true` is equivalent to allow - // all block types). - const defaultAllowedBlockTypes = true === settings.allowedBlockTypes ? blockTypes.map(({ - name - }) => name) : settings.allowedBlockTypes || []; - return defaultAllowedBlockTypes.filter(type => !hiddenBlockTypes.includes(type)); - } - return settings.allowedBlockTypes; - }, [settings.allowedBlockTypes, hiddenBlockTypes, blockTypes]); - const forceDisableFocusMode = settings.focusMode === false; - return (0,external_wp_element_namespaceObject.useMemo)(() => { - const blockEditorSettings = { - ...Object.fromEntries(Object.entries(settings).filter(([key]) => BLOCK_EDITOR_SETTINGS.includes(key))), - [globalStylesDataKey]: globalStylesData, - [globalStylesLinksDataKey]: globalStylesLinksData, - allowedBlockTypes, - allowRightClickOverrides, - focusMode: focusMode && !forceDisableFocusMode, - hasFixedToolbar, - isDistractionFree, - keepCaretInsideBlock, - mediaUpload: hasUploadPermissions ? mediaUpload : undefined, - __experimentalBlockPatterns: blockPatterns, - [selectBlockPatternsKey]: select => { - const { - hasFinishedResolution, - getBlockPatternsForPostType - } = unlock(select(external_wp_coreData_namespaceObject.store)); - const patterns = getBlockPatternsForPostType(postType); - return hasFinishedResolution('getBlockPatterns') ? patterns : undefined; - }, - [reusableBlocksSelectKey]: __experimentalReusableBlocksSelect, - __experimentalBlockPatternCategories: blockPatternCategories, - __experimentalUserPatternCategories: userPatternCategories, - __experimentalFetchLinkSuggestions: (search, searchOptions) => (0,external_wp_coreData_namespaceObject.__experimentalFetchLinkSuggestions)(search, searchOptions, settings), - inserterMediaCategories: media_categories, - __experimentalFetchRichUrlData: external_wp_coreData_namespaceObject.__experimentalFetchUrlData, - // Todo: This only checks the top level post, not the post within a template or any other entity that can be edited. - // This might be better as a generic "canUser" selector. - __experimentalCanUserUseUnfilteredHTML: canUseUnfilteredHTML, - //Todo: this is only needed for native and should probably be removed. - __experimentalUndo: undo, - // Check whether we want all site editor frames to have outlines - // including the navigation / pattern / parts editors. - outlineMode: !isDistractionFree && postType === 'wp_template', - // Check these two properties: they were not present in the site editor. - __experimentalCreatePageEntity: createPageEntity, - __experimentalUserCanCreatePages: userCanCreatePages, - pageOnFront, - pageForPosts, - __experimentalPreferPatternsOnRoot: postType === 'wp_template', - templateLock: postType === 'wp_navigation' ? 'insert' : settings.templateLock, - template: postType === 'wp_navigation' ? [['core/navigation', {}, []]] : settings.template, - __experimentalSetIsInserterOpened: setIsInserterOpened, - [sectionRootClientIdKey]: sectionRootClientId - }; - return blockEditorSettings; - }, [allowedBlockTypes, allowRightClickOverrides, focusMode, forceDisableFocusMode, hasFixedToolbar, isDistractionFree, keepCaretInsideBlock, settings, hasUploadPermissions, userPatternCategories, blockPatterns, blockPatternCategories, canUseUnfilteredHTML, undo, createPageEntity, userCanCreatePages, pageOnFront, pageForPosts, postType, setIsInserterOpened, sectionRootClientId, globalStylesData, globalStylesLinksData]); -} -/* harmony default export */ const use_block_editor_settings = (useBlockEditorSettings); - -;// ./node_modules/@wordpress/editor/build-module/components/provider/disable-non-page-content-blocks.js -/** - * WordPress dependencies - */ - - - - - -/** - * Internal dependencies - */ - - -const POST_CONTENT_BLOCK_TYPES = ['core/post-title', 'core/post-featured-image', 'core/post-content']; - -/** - * Component that when rendered, makes it so that the site editor allows only - * page content to be edited. - */ -function DisableNonPageContentBlocks() { - const contentOnlyBlockTypes = (0,external_wp_element_namespaceObject.useMemo)(() => [...(0,external_wp_hooks_namespaceObject.applyFilters)('editor.postContentBlockTypes', POST_CONTENT_BLOCK_TYPES), 'core/template-part'], []); - - // Note that there are two separate subscriptions because the result for each - // returns a new array. - const contentOnlyIds = (0,external_wp_data_namespaceObject.useSelect)(select => { - const { - getPostBlocksByName - } = unlock(select(store_store)); - return getPostBlocksByName(contentOnlyBlockTypes); - }, [contentOnlyBlockTypes]); - const disabledIds = (0,external_wp_data_namespaceObject.useSelect)(select => { - const { - getBlocksByName, - getBlockOrder - } = select(external_wp_blockEditor_namespaceObject.store); - return getBlocksByName('core/template-part').flatMap(clientId => getBlockOrder(clientId)); - }, []); - const registry = (0,external_wp_data_namespaceObject.useRegistry)(); - (0,external_wp_element_namespaceObject.useEffect)(() => { - const { - setBlockEditingMode, - unsetBlockEditingMode - } = registry.dispatch(external_wp_blockEditor_namespaceObject.store); - registry.batch(() => { - setBlockEditingMode('', 'disabled'); - for (const clientId of contentOnlyIds) { - setBlockEditingMode(clientId, 'contentOnly'); - } - for (const clientId of disabledIds) { - setBlockEditingMode(clientId, 'disabled'); - } - }); - return () => { - registry.batch(() => { - unsetBlockEditingMode(''); - for (const clientId of contentOnlyIds) { - unsetBlockEditingMode(clientId); - } - for (const clientId of disabledIds) { - unsetBlockEditingMode(clientId); - } - }); - }; - }, [contentOnlyIds, disabledIds, registry]); - return null; -} - -;// ./node_modules/@wordpress/editor/build-module/components/provider/navigation-block-editing-mode.js -/** - * WordPress dependencies - */ - - - - -/** - * For the Navigation block editor, we need to force the block editor to contentOnly for that block. - * - * Set block editing mode to contentOnly when entering Navigation focus mode. - * this ensures that non-content controls on the block will be hidden and thus - * the user can focus on editing the Navigation Menu content only. - */ - -function NavigationBlockEditingMode() { - // In the navigation block editor, - // the navigation block is the only root block. - const blockClientId = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getBlockOrder()?.[0], []); - const { - setBlockEditingMode, - unsetBlockEditingMode - } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); - (0,external_wp_element_namespaceObject.useEffect)(() => { - if (!blockClientId) { - return; - } - setBlockEditingMode(blockClientId, 'contentOnly'); - return () => { - unsetBlockEditingMode(blockClientId); - }; - }, [blockClientId, unsetBlockEditingMode, setBlockEditingMode]); -} - -;// ./node_modules/@wordpress/editor/build-module/components/provider/use-hide-blocks-from-inserter.js -/** - * WordPress dependencies - */ - - - -// These post types are "structural" block lists. -// We should be allowed to use -// the post content and template parts blocks within them. -const POST_TYPES_ALLOWING_POST_CONTENT_TEMPLATE_PART = ['wp_block', 'wp_template', 'wp_template_part']; - -/** - * In some specific contexts, - * the template part and post content blocks need to be hidden. - * - * @param {string} postType Post Type - * @param {string} mode Rendering mode - */ -function useHideBlocksFromInserter(postType, mode) { - (0,external_wp_element_namespaceObject.useEffect)(() => { - /* - * Prevent adding template part in the editor. - */ - (0,external_wp_hooks_namespaceObject.addFilter)('blockEditor.__unstableCanInsertBlockType', 'removeTemplatePartsFromInserter', (canInsert, blockType) => { - if (!POST_TYPES_ALLOWING_POST_CONTENT_TEMPLATE_PART.includes(postType) && blockType.name === 'core/template-part' && mode === 'post-only') { - return false; - } - return canInsert; - }); - - /* - * Prevent adding post content block (except in query block) in the editor. - */ - (0,external_wp_hooks_namespaceObject.addFilter)('blockEditor.__unstableCanInsertBlockType', 'removePostContentFromInserter', (canInsert, blockType, rootClientId, { - getBlockParentsByBlockName - }) => { - if (!POST_TYPES_ALLOWING_POST_CONTENT_TEMPLATE_PART.includes(postType) && blockType.name === 'core/post-content') { - return getBlockParentsByBlockName(rootClientId, 'core/query').length > 0; - } - return canInsert; - }); - return () => { - (0,external_wp_hooks_namespaceObject.removeFilter)('blockEditor.__unstableCanInsertBlockType', 'removeTemplatePartsFromInserter'); - (0,external_wp_hooks_namespaceObject.removeFilter)('blockEditor.__unstableCanInsertBlockType', 'removePostContentFromInserter'); - }; - }, [postType, mode]); -} - -;// ./node_modules/@wordpress/icons/build-module/library/keyboard.js -/** - * WordPress dependencies - */ - - - -const keyboard = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - d: "m16 15.5h-8v-1.5h8zm-7.5-2.5h-2v-2h2zm3 0h-2v-2h2zm3 0h-2v-2h2zm3 0h-2v-2h2zm-9-3h-2v-2h2zm3 0h-2v-2h2zm3 0h-2v-2h2zm3 0h-2v-2h2z" - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - d: "m18.5 6.5h-13a.5.5 0 0 0 -.5.5v9.5a.5.5 0 0 0 .5.5h13a.5.5 0 0 0 .5-.5v-9.5a.5.5 0 0 0 -.5-.5zm-13-1.5h13a2 2 0 0 1 2 2v9.5a2 2 0 0 1 -2 2h-13a2 2 0 0 1 -2-2v-9.5a2 2 0 0 1 2-2z" - })] -}); -/* harmony default export */ const library_keyboard = (keyboard); - -;// ./node_modules/@wordpress/icons/build-module/library/list-view.js -/** - * WordPress dependencies - */ - - -const listView = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - viewBox: "0 0 24 24", - xmlns: "http://www.w3.org/2000/svg", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - d: "M3 6h11v1.5H3V6Zm3.5 5.5h11V13h-11v-1.5ZM21 17H10v1.5h11V17Z" - }) -}); -/* harmony default export */ const list_view = (listView); - -;// ./node_modules/@wordpress/icons/build-module/library/code.js -/** - * WordPress dependencies - */ - - -const code = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - viewBox: "0 0 24 24", - xmlns: "http://www.w3.org/2000/svg", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - d: "M20.8 10.7l-4.3-4.3-1.1 1.1 4.3 4.3c.1.1.1.3 0 .4l-4.3 4.3 1.1 1.1 4.3-4.3c.7-.8.7-1.9 0-2.6zM4.2 11.8l4.3-4.3-1-1-4.3 4.3c-.7.7-.7 1.8 0 2.5l4.3 4.3 1.1-1.1-4.3-4.3c-.2-.1-.2-.3-.1-.4z" - }) -}); -/* harmony default export */ const library_code = (code); - -;// ./node_modules/@wordpress/icons/build-module/library/drawer-left.js -/** - * WordPress dependencies - */ - - -const drawerLeft = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - width: "24", - height: "24", - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zM8.5 18.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h2.5v13zm10-.5c0 .3-.2.5-.5.5h-8v-13h8c.3 0 .5.2.5.5v12z" - }) -}); -/* harmony default export */ const drawer_left = (drawerLeft); - -;// ./node_modules/@wordpress/icons/build-module/library/drawer-right.js -/** - * WordPress dependencies - */ - - -const drawerRight = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - width: "24", - height: "24", - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4 14.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h8v13zm4.5-.5c0 .3-.2.5-.5.5h-2.5v-13H18c.3 0 .5.2.5.5v12z" - }) -}); -/* harmony default export */ const drawer_right = (drawerRight); - -;// ./node_modules/@wordpress/icons/build-module/library/block-default.js -/** - * WordPress dependencies - */ - - -const blockDefault = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - d: "M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z" - }) -}); -/* harmony default export */ const block_default = (blockDefault); - -;// ./node_modules/@wordpress/icons/build-module/library/format-list-bullets.js -/** - * WordPress dependencies - */ - - -const formatListBullets = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - d: "M11.1 15.8H20v-1.5h-8.9v1.5zm0-8.6v1.5H20V7.2h-8.9zM6 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-7c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z" - }) -}); -/* harmony default export */ const format_list_bullets = (formatListBullets); - -;// ./node_modules/@wordpress/icons/build-module/library/pencil.js -/** - * WordPress dependencies - */ - - -const pencil = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - d: "m19 7-3-3-8.5 8.5-1 4 4-1L19 7Zm-7 11.5H5V20h7v-1.5Z" - }) -}); -/* harmony default export */ const library_pencil = (pencil); - -;// ./node_modules/@wordpress/icons/build-module/library/edit.js -/** - * Internal dependencies - */ - - -/* harmony default export */ const edit = (library_pencil); - -;// ./node_modules/@wordpress/editor/build-module/components/pattern-rename-modal/index.js -/** - * WordPress dependencies - */ - - - - - -/** - * Internal dependencies - */ - - - - -const { - RenamePatternModal -} = unlock(external_wp_patterns_namespaceObject.privateApis); -const modalName = 'editor/pattern-rename'; -function PatternRenameModal() { - const { - record, - postType - } = (0,external_wp_data_namespaceObject.useSelect)(select => { - const { - getCurrentPostType, - getCurrentPostId - } = select(store_store); - const { - getEditedEntityRecord - } = select(external_wp_coreData_namespaceObject.store); - const _postType = getCurrentPostType(); - return { - record: getEditedEntityRecord('postType', _postType, getCurrentPostId()), - postType: _postType - }; - }, []); - const { - closeModal - } = (0,external_wp_data_namespaceObject.useDispatch)(store); - const isActive = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).isModalActive(modalName)); - if (!isActive || postType !== PATTERN_POST_TYPE) { - return null; - } - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(RenamePatternModal, { - onClose: closeModal, - pattern: record - }); -} - -;// ./node_modules/@wordpress/editor/build-module/components/pattern-duplicate-modal/index.js -/** - * WordPress dependencies - */ - - - - - -/** - * Internal dependencies - */ - - - - -const { - DuplicatePatternModal -} = unlock(external_wp_patterns_namespaceObject.privateApis); -const pattern_duplicate_modal_modalName = 'editor/pattern-duplicate'; -function PatternDuplicateModal() { - const { - record, - postType - } = (0,external_wp_data_namespaceObject.useSelect)(select => { - const { - getCurrentPostType, - getCurrentPostId - } = select(store_store); - const { - getEditedEntityRecord - } = select(external_wp_coreData_namespaceObject.store); - const _postType = getCurrentPostType(); - return { - record: getEditedEntityRecord('postType', _postType, getCurrentPostId()), - postType: _postType - }; - }, []); - const { - closeModal - } = (0,external_wp_data_namespaceObject.useDispatch)(store); - const isActive = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).isModalActive(pattern_duplicate_modal_modalName)); - if (!isActive || postType !== PATTERN_POST_TYPE) { - return null; - } - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DuplicatePatternModal, { - onClose: closeModal, - onSuccess: () => closeModal(), - pattern: record - }); -} - -;// ./node_modules/@wordpress/editor/build-module/components/commands/index.js -/** - * WordPress dependencies - */ - - - - - - - - - - -/** - * Internal dependencies - */ - - - - -function useEditorCommandLoader() { - const { - editorMode, - isListViewOpen, - showBlockBreadcrumbs, - isDistractionFree, - isTopToolbar, - isFocusMode, - isPreviewMode, - isViewable, - isCodeEditingEnabled, - isRichEditingEnabled, - isPublishSidebarEnabled - } = (0,external_wp_data_namespaceObject.useSelect)(select => { - var _get, _getPostType$viewable; - const { - get - } = select(external_wp_preferences_namespaceObject.store); - const { - isListViewOpened, - getCurrentPostType, - getEditorSettings - } = select(store_store); - const { - getSettings - } = select(external_wp_blockEditor_namespaceObject.store); - const { - getPostType - } = select(external_wp_coreData_namespaceObject.store); - return { - editorMode: (_get = get('core', 'editorMode')) !== null && _get !== void 0 ? _get : 'visual', - isListViewOpen: isListViewOpened(), - showBlockBreadcrumbs: get('core', 'showBlockBreadcrumbs'), - isDistractionFree: get('core', 'distractionFree'), - isFocusMode: get('core', 'focusMode'), - isTopToolbar: get('core', 'fixedToolbar'), - isPreviewMode: getSettings().__unstableIsPreviewMode, - isViewable: (_getPostType$viewable = getPostType(getCurrentPostType())?.viewable) !== null && _getPostType$viewable !== void 0 ? _getPostType$viewable : false, - isCodeEditingEnabled: getEditorSettings().codeEditingEnabled, - isRichEditingEnabled: getEditorSettings().richEditingEnabled, - isPublishSidebarEnabled: select(store_store).isPublishSidebarEnabled() - }; - }, []); - const { - getActiveComplementaryArea - } = (0,external_wp_data_namespaceObject.useSelect)(store); - const { - toggle - } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_preferences_namespaceObject.store); - const { - createInfoNotice - } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); - const { - __unstableSaveForPreview, - setIsListViewOpened, - switchEditorMode, - toggleDistractionFree - } = (0,external_wp_data_namespaceObject.useDispatch)(store_store); - const { - openModal, - enableComplementaryArea, - disableComplementaryArea - } = (0,external_wp_data_namespaceObject.useDispatch)(store); - const { - getCurrentPostId - } = (0,external_wp_data_namespaceObject.useSelect)(store_store); - const allowSwitchEditorMode = isCodeEditingEnabled && isRichEditingEnabled; - if (isPreviewMode) { - return { - commands: [], - isLoading: false - }; - } - const commands = []; - commands.push({ - name: 'core/open-shortcut-help', - label: (0,external_wp_i18n_namespaceObject.__)('Keyboard shortcuts'), - icon: library_keyboard, - callback: ({ - close - }) => { - close(); - openModal('editor/keyboard-shortcut-help'); - } - }); - commands.push({ - name: 'core/toggle-distraction-free', - label: isDistractionFree ? (0,external_wp_i18n_namespaceObject.__)('Exit Distraction Free') : (0,external_wp_i18n_namespaceObject.__)('Enter Distraction Free'), - callback: ({ - close - }) => { - toggleDistractionFree(); - close(); - } - }); - commands.push({ - name: 'core/open-preferences', - label: (0,external_wp_i18n_namespaceObject.__)('Editor preferences'), - callback: ({ - close - }) => { - close(); - openModal('editor/preferences'); - } - }); - commands.push({ - name: 'core/toggle-spotlight-mode', - label: (0,external_wp_i18n_namespaceObject.__)('Toggle spotlight'), - callback: ({ - close - }) => { - toggle('core', 'focusMode'); - close(); - createInfoNotice(isFocusMode ? (0,external_wp_i18n_namespaceObject.__)('Spotlight off.') : (0,external_wp_i18n_namespaceObject.__)('Spotlight on.'), { - id: 'core/editor/toggle-spotlight-mode/notice', - type: 'snackbar', - actions: [{ - label: (0,external_wp_i18n_namespaceObject.__)('Undo'), - onClick: () => { - toggle('core', 'focusMode'); - } - }] - }); - } - }); - commands.push({ - name: 'core/toggle-list-view', - label: isListViewOpen ? (0,external_wp_i18n_namespaceObject.__)('Close List View') : (0,external_wp_i18n_namespaceObject.__)('Open List View'), - icon: list_view, - callback: ({ - close - }) => { - setIsListViewOpened(!isListViewOpen); - close(); - createInfoNotice(isListViewOpen ? (0,external_wp_i18n_namespaceObject.__)('List View off.') : (0,external_wp_i18n_namespaceObject.__)('List View on.'), { - id: 'core/editor/toggle-list-view/notice', - type: 'snackbar' - }); - } - }); - commands.push({ - name: 'core/toggle-top-toolbar', - label: (0,external_wp_i18n_namespaceObject.__)('Toggle top toolbar'), - callback: ({ - close - }) => { - toggle('core', 'fixedToolbar'); - if (isDistractionFree) { - toggleDistractionFree(); - } - close(); - createInfoNotice(isTopToolbar ? (0,external_wp_i18n_namespaceObject.__)('Top toolbar off.') : (0,external_wp_i18n_namespaceObject.__)('Top toolbar on.'), { - id: 'core/editor/toggle-top-toolbar/notice', - type: 'snackbar', - actions: [{ - label: (0,external_wp_i18n_namespaceObject.__)('Undo'), - onClick: () => { - toggle('core', 'fixedToolbar'); - } - }] - }); - } - }); - if (allowSwitchEditorMode) { - commands.push({ - name: 'core/toggle-code-editor', - label: editorMode === 'visual' ? (0,external_wp_i18n_namespaceObject.__)('Open code editor') : (0,external_wp_i18n_namespaceObject.__)('Exit code editor'), - icon: library_code, - callback: ({ - close - }) => { - switchEditorMode(editorMode === 'visual' ? 'text' : 'visual'); - close(); - } - }); - } - commands.push({ - name: 'core/toggle-breadcrumbs', - label: showBlockBreadcrumbs ? (0,external_wp_i18n_namespaceObject.__)('Hide block breadcrumbs') : (0,external_wp_i18n_namespaceObject.__)('Show block breadcrumbs'), - callback: ({ - close - }) => { - toggle('core', 'showBlockBreadcrumbs'); - close(); - createInfoNotice(showBlockBreadcrumbs ? (0,external_wp_i18n_namespaceObject.__)('Breadcrumbs hidden.') : (0,external_wp_i18n_namespaceObject.__)('Breadcrumbs visible.'), { - id: 'core/editor/toggle-breadcrumbs/notice', - type: 'snackbar' - }); - } - }); - commands.push({ - name: 'core/open-settings-sidebar', - label: (0,external_wp_i18n_namespaceObject.__)('Toggle settings sidebar'), - icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? drawer_left : drawer_right, - callback: ({ - close - }) => { - const activeSidebar = getActiveComplementaryArea('core'); - close(); - if (activeSidebar === 'edit-post/document') { - disableComplementaryArea('core'); - } else { - enableComplementaryArea('core', 'edit-post/document'); - } - } - }); - commands.push({ - name: 'core/open-block-inspector', - label: (0,external_wp_i18n_namespaceObject.__)('Toggle block inspector'), - icon: block_default, - callback: ({ - close - }) => { - const activeSidebar = getActiveComplementaryArea('core'); - close(); - if (activeSidebar === 'edit-post/block') { - disableComplementaryArea('core'); - } else { - enableComplementaryArea('core', 'edit-post/block'); - } - } - }); - commands.push({ - name: 'core/toggle-publish-sidebar', - label: isPublishSidebarEnabled ? (0,external_wp_i18n_namespaceObject.__)('Disable pre-publish checks') : (0,external_wp_i18n_namespaceObject.__)('Enable pre-publish checks'), - icon: format_list_bullets, - callback: ({ - close - }) => { - close(); - toggle('core', 'isPublishSidebarEnabled'); - createInfoNotice(isPublishSidebarEnabled ? (0,external_wp_i18n_namespaceObject.__)('Pre-publish checks disabled.') : (0,external_wp_i18n_namespaceObject.__)('Pre-publish checks enabled.'), { - id: 'core/editor/publish-sidebar/notice', - type: 'snackbar' - }); - } - }); - if (isViewable) { - commands.push({ - name: 'core/preview-link', - label: (0,external_wp_i18n_namespaceObject.__)('Preview in a new tab'), - icon: library_external, - callback: async ({ - close - }) => { - close(); - const postId = getCurrentPostId(); - const link = await __unstableSaveForPreview(); - window.open(link, `wp-preview-${postId}`); - } - }); - } - return { - commands, - isLoading: false - }; -} -function useEditedEntityContextualCommands() { - const { - postType - } = (0,external_wp_data_namespaceObject.useSelect)(select => { - const { - getCurrentPostType - } = select(store_store); - return { - postType: getCurrentPostType() - }; - }, []); - const { - openModal - } = (0,external_wp_data_namespaceObject.useDispatch)(store); - const commands = []; - if (postType === PATTERN_POST_TYPE) { - commands.push({ - name: 'core/rename-pattern', - label: (0,external_wp_i18n_namespaceObject.__)('Rename pattern'), - icon: edit, - callback: ({ - close - }) => { - openModal(modalName); - close(); - } - }); - commands.push({ - name: 'core/duplicate-pattern', - label: (0,external_wp_i18n_namespaceObject.__)('Duplicate pattern'), - icon: library_symbol, - callback: ({ - close - }) => { - openModal(pattern_duplicate_modal_modalName); - close(); - } - }); - } - return { - isLoading: false, - commands - }; -} -function useCommands() { - (0,external_wp_commands_namespaceObject.useCommandLoader)({ - name: 'core/editor/edit-ui', - hook: useEditorCommandLoader - }); - (0,external_wp_commands_namespaceObject.useCommandLoader)({ - name: 'core/editor/contextual-commands', - hook: useEditedEntityContextualCommands, - context: 'entity-edit' - }); -} - -;// ./node_modules/@wordpress/editor/build-module/components/block-removal-warnings/index.js -/** - * WordPress dependencies - */ - - - - - - -/** - * Internal dependencies - */ - - - -const { - BlockRemovalWarningModal -} = unlock(external_wp_blockEditor_namespaceObject.privateApis); - -// Prevent accidental removal of certain blocks, asking the user for confirmation first. -const TEMPLATE_BLOCKS = ['core/post-content', 'core/post-template', 'core/query']; -const BLOCK_REMOVAL_RULES = [{ - // Template blocks. - // The warning is only shown when a user manipulates templates or template parts. - postTypes: ['wp_template', 'wp_template_part'], - callback(removedBlocks) { - const removedTemplateBlocks = removedBlocks.filter(({ - name - }) => TEMPLATE_BLOCKS.includes(name)); - if (removedTemplateBlocks.length) { - return (0,external_wp_i18n_namespaceObject._n)('Deleting this block will stop your post or page content from displaying on this template. It is not recommended.', 'Some of the deleted blocks will stop your post or page content from displaying on this template. It is not recommended.', removedBlocks.length); - } - } -}, { - // Pattern overrides. - // The warning is only shown when the user edits a pattern. - postTypes: ['wp_block'], - callback(removedBlocks) { - const removedBlocksWithOverrides = removedBlocks.filter(({ - attributes - }) => attributes?.metadata?.bindings && Object.values(attributes.metadata.bindings).some(binding => binding.source === 'core/pattern-overrides')); - if (removedBlocksWithOverrides.length) { - return (0,external_wp_i18n_namespaceObject._n)('The deleted block allows instance overrides. Removing it may result in content not displaying where this pattern is used. Are you sure you want to proceed?', 'Some of the deleted blocks allow instance overrides. Removing them may result in content not displaying where this pattern is used. Are you sure you want to proceed?', removedBlocks.length); - } - } -}]; -function BlockRemovalWarnings() { - const currentPostType = (0,external_wp_data_namespaceObject.useSelect)(select => select(store_store).getCurrentPostType(), []); - const removalRulesForPostType = (0,external_wp_element_namespaceObject.useMemo)(() => BLOCK_REMOVAL_RULES.filter(rule => rule.postTypes.includes(currentPostType)), [currentPostType]); - - // `BlockRemovalWarnings` is rendered in the editor provider, a shared component - // across react native and web. However, `BlockRemovalWarningModal` is web only. - // Check it exists before trying to render it. - if (!BlockRemovalWarningModal) { - return null; - } - if (!removalRulesForPostType) { - return null; - } - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockRemovalWarningModal, { - rules: removalRulesForPostType - }); -} - -;// ./node_modules/@wordpress/editor/build-module/components/start-page-options/index.js -/** - * WordPress dependencies - */ - - - - - - - - - - - -/** - * Internal dependencies - */ - - - -function useStartPatterns() { - // A pattern is a start pattern if it includes 'core/post-content' in its blockTypes, - // and it has no postTypes declared and the current post type is page or if - // the current post type is part of the postTypes declared. - const { - blockPatternsWithPostContentBlockType, - postType - } = (0,external_wp_data_namespaceObject.useSelect)(select => { - const { - getPatternsByBlockTypes, - getBlocksByName - } = select(external_wp_blockEditor_namespaceObject.store); - const { - getCurrentPostType, - getRenderingMode - } = select(store_store); - const rootClientId = getRenderingMode() === 'post-only' ? '' : getBlocksByName('core/post-content')?.[0]; - return { - blockPatternsWithPostContentBlockType: getPatternsByBlockTypes('core/post-content', rootClientId), - postType: getCurrentPostType() - }; - }, []); - return (0,external_wp_element_namespaceObject.useMemo)(() => { - if (!blockPatternsWithPostContentBlockType?.length) { - return []; - } - - /* - * Filter patterns without postTypes declared if the current postType is page - * or patterns that declare the current postType in its post type array. - */ - return blockPatternsWithPostContentBlockType.filter(pattern => { - return postType === 'page' && !pattern.postTypes || Array.isArray(pattern.postTypes) && pattern.postTypes.includes(postType); - }); - }, [postType, blockPatternsWithPostContentBlockType]); -} -function PatternSelection({ - blockPatterns, - onChoosePattern -}) { - const shownBlockPatterns = (0,external_wp_compose_namespaceObject.useAsyncList)(blockPatterns); - const { - editEntityRecord - } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); - const { - postType, - postId - } = (0,external_wp_data_namespaceObject.useSelect)(select => { - const { - getCurrentPostType, - getCurrentPostId - } = select(store_store); - return { - postType: getCurrentPostType(), - postId: getCurrentPostId() - }; - }, []); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalBlockPatternsList, { - blockPatterns: blockPatterns, - shownPatterns: shownBlockPatterns, - onClickPattern: (_pattern, blocks) => { - editEntityRecord('postType', postType, postId, { - blocks, - content: ({ - blocks: blocksForSerialization = [] - }) => (0,external_wp_blocks_namespaceObject.__unstableSerializeAndClean)(blocksForSerialization) - }); - onChoosePattern(); - } - }); -} -function StartPageOptionsModal({ - onClose -}) { - const startPatterns = useStartPatterns(); - const hasStartPattern = startPatterns.length > 0; - if (!hasStartPattern) { - return null; - } - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Modal, { - title: (0,external_wp_i18n_namespaceObject.__)('Choose a pattern'), - isFullScreen: true, - onRequestClose: onClose, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { - className: "editor-start-page-options__modal-content", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PatternSelection, { - blockPatterns: startPatterns, - onChoosePattern: onClose - }) - }) - }); -} -function StartPageOptions() { - const [isClosed, setIsClosed] = (0,external_wp_element_namespaceObject.useState)(false); - const shouldEnableModal = (0,external_wp_data_namespaceObject.useSelect)(select => { - const { - isEditedPostDirty, - isEditedPostEmpty, - getCurrentPostType - } = select(store_store); - const preferencesModalActive = select(store).isModalActive('editor/preferences'); - const choosePatternModalEnabled = select(external_wp_preferences_namespaceObject.store).get('core', 'enableChoosePatternModal'); - return choosePatternModalEnabled && !preferencesModalActive && !isEditedPostDirty() && isEditedPostEmpty() && TEMPLATE_POST_TYPE !== getCurrentPostType(); - }, []); - if (!shouldEnableModal || isClosed) { - return null; - } - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(StartPageOptionsModal, { - onClose: () => setIsClosed(true) - }); -} - -;// ./node_modules/@wordpress/editor/build-module/components/keyboard-shortcut-help-modal/config.js -/** - * WordPress dependencies - */ - -const textFormattingShortcuts = [{ - keyCombination: { - modifier: 'primary', - character: 'b' - }, - description: (0,external_wp_i18n_namespaceObject.__)('Make the selected text bold.') -}, { - keyCombination: { - modifier: 'primary', - character: 'i' - }, - description: (0,external_wp_i18n_namespaceObject.__)('Make the selected text italic.') -}, { - keyCombination: { - modifier: 'primary', - character: 'k' - }, - description: (0,external_wp_i18n_namespaceObject.__)('Convert the selected text into a link.') -}, { - keyCombination: { - modifier: 'primaryShift', - character: 'k' - }, - description: (0,external_wp_i18n_namespaceObject.__)('Remove a link.') -}, { - keyCombination: { - character: '[[' - }, - description: (0,external_wp_i18n_namespaceObject.__)('Insert a link to a post or page.') -}, { - keyCombination: { - modifier: 'primary', - character: 'u' - }, - description: (0,external_wp_i18n_namespaceObject.__)('Underline the selected text.') -}, { - keyCombination: { - modifier: 'access', - character: 'd' - }, - description: (0,external_wp_i18n_namespaceObject.__)('Strikethrough the selected text.') -}, { - keyCombination: { - modifier: 'access', - character: 'x' - }, - description: (0,external_wp_i18n_namespaceObject.__)('Make the selected text inline code.') -}, { - keyCombination: { - modifier: 'access', - character: '0' - }, - aliases: [{ - modifier: 'access', - character: '7' - }], - description: (0,external_wp_i18n_namespaceObject.__)('Convert the current heading to a paragraph.') -}, { - keyCombination: { - modifier: 'access', - character: '1-6' - }, - description: (0,external_wp_i18n_namespaceObject.__)('Convert the current paragraph or heading to a heading of level 1 to 6.') -}, { - keyCombination: { - modifier: 'primaryShift', - character: 'SPACE' - }, - description: (0,external_wp_i18n_namespaceObject.__)('Add non breaking space.') -}]; - -;// ./node_modules/@wordpress/editor/build-module/components/keyboard-shortcut-help-modal/shortcut.js -/** - * WordPress dependencies - */ - - - - - -function KeyCombination({ - keyCombination, - forceAriaLabel -}) { - const shortcut = keyCombination.modifier ? external_wp_keycodes_namespaceObject.displayShortcutList[keyCombination.modifier](keyCombination.character) : keyCombination.character; - const ariaLabel = keyCombination.modifier ? external_wp_keycodes_namespaceObject.shortcutAriaLabel[keyCombination.modifier](keyCombination.character) : keyCombination.character; - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("kbd", { - className: "editor-keyboard-shortcut-help-modal__shortcut-key-combination", - "aria-label": forceAriaLabel || ariaLabel, - children: (Array.isArray(shortcut) ? shortcut : [shortcut]).map((character, index) => { - if (character === '+') { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.Fragment, { - children: character - }, index); - } - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("kbd", { - className: "editor-keyboard-shortcut-help-modal__shortcut-key", - children: character - }, index); - }) - }); -} -function Shortcut({ - description, - keyCombination, - aliases = [], - ariaLabel -}) { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { - className: "editor-keyboard-shortcut-help-modal__shortcut-description", - children: description - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { - className: "editor-keyboard-shortcut-help-modal__shortcut-term", - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(KeyCombination, { - keyCombination: keyCombination, - forceAriaLabel: ariaLabel - }), aliases.map((alias, index) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(KeyCombination, { - keyCombination: alias, - forceAriaLabel: ariaLabel - }, index))] - })] - }); -} -/* harmony default export */ const keyboard_shortcut_help_modal_shortcut = (Shortcut); - -;// ./node_modules/@wordpress/editor/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - - -function DynamicShortcut({ - name -}) { - const { - keyCombination, - description, - aliases - } = (0,external_wp_data_namespaceObject.useSelect)(select => { - const { - getShortcutKeyCombination, - getShortcutDescription, - getShortcutAliases - } = select(external_wp_keyboardShortcuts_namespaceObject.store); - return { - keyCombination: getShortcutKeyCombination(name), - aliases: getShortcutAliases(name), - description: getShortcutDescription(name) - }; - }, [name]); - if (!keyCombination) { - return null; - } - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(keyboard_shortcut_help_modal_shortcut, { - keyCombination: keyCombination, - description: description, - aliases: aliases - }); -} -/* harmony default export */ const dynamic_shortcut = (DynamicShortcut); - -;// ./node_modules/@wordpress/editor/build-module/components/keyboard-shortcut-help-modal/index.js -/** - * External dependencies - */ - - -/** - * WordPress dependencies - */ - - - - - - -/** - * Internal dependencies - */ - - - - - -const KEYBOARD_SHORTCUT_HELP_MODAL_NAME = 'editor/keyboard-shortcut-help'; -const ShortcutList = ({ - shortcuts -}) => -/*#__PURE__*/ -/* - * Disable reason: The `list` ARIA role is redundant but - * Safari+VoiceOver won't announce the list otherwise. - */ -/* eslint-disable jsx-a11y/no-redundant-roles */ -(0,external_ReactJSXRuntime_namespaceObject.jsx)("ul", { - className: "editor-keyboard-shortcut-help-modal__shortcut-list", - role: "list", - children: shortcuts.map((shortcut, index) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("li", { - className: "editor-keyboard-shortcut-help-modal__shortcut", - children: typeof shortcut === 'string' ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(dynamic_shortcut, { - name: shortcut - }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(keyboard_shortcut_help_modal_shortcut, { - ...shortcut - }) - }, index)) -}) -/* eslint-enable jsx-a11y/no-redundant-roles */; -const ShortcutSection = ({ - title, - shortcuts, - className -}) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("section", { - className: dist_clsx('editor-keyboard-shortcut-help-modal__section', className), - children: [!!title && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h2", { - className: "editor-keyboard-shortcut-help-modal__section-title", - children: title - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ShortcutList, { - shortcuts: shortcuts - })] -}); -const ShortcutCategorySection = ({ - title, - categoryName, - additionalShortcuts = [] -}) => { - const categoryShortcuts = (0,external_wp_data_namespaceObject.useSelect)(select => { - return select(external_wp_keyboardShortcuts_namespaceObject.store).getCategoryShortcuts(categoryName); - }, [categoryName]); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ShortcutSection, { - title: title, - shortcuts: categoryShortcuts.concat(additionalShortcuts) - }); -}; -function KeyboardShortcutHelpModal() { - const isModalActive = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).isModalActive(KEYBOARD_SHORTCUT_HELP_MODAL_NAME), []); - const { - openModal, - closeModal - } = (0,external_wp_data_namespaceObject.useDispatch)(store); - const toggleModal = () => { - if (isModalActive) { - closeModal(); - } else { - openModal(KEYBOARD_SHORTCUT_HELP_MODAL_NAME); - } - }; - (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/editor/keyboard-shortcuts', toggleModal); - if (!isModalActive) { - return null; - } - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Modal, { - className: "editor-keyboard-shortcut-help-modal", - title: (0,external_wp_i18n_namespaceObject.__)('Keyboard shortcuts'), - closeButtonLabel: (0,external_wp_i18n_namespaceObject.__)('Close'), - onRequestClose: toggleModal, - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ShortcutSection, { - className: "editor-keyboard-shortcut-help-modal__main-shortcuts", - shortcuts: ['core/editor/keyboard-shortcuts'] - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ShortcutCategorySection, { - title: (0,external_wp_i18n_namespaceObject.__)('Global shortcuts'), - categoryName: "global" - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ShortcutCategorySection, { - title: (0,external_wp_i18n_namespaceObject.__)('Selection shortcuts'), - categoryName: "selection" - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ShortcutCategorySection, { - title: (0,external_wp_i18n_namespaceObject.__)('Block shortcuts'), - categoryName: "block", - additionalShortcuts: [{ - keyCombination: { - character: '/' - }, - description: (0,external_wp_i18n_namespaceObject.__)('Change the block type after adding a new paragraph.'), - /* translators: The forward-slash character. e.g. '/'. */ - ariaLabel: (0,external_wp_i18n_namespaceObject.__)('Forward-slash') - }] - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ShortcutSection, { - title: (0,external_wp_i18n_namespaceObject.__)('Text formatting'), - shortcuts: textFormattingShortcuts - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ShortcutCategorySection, { - title: (0,external_wp_i18n_namespaceObject.__)('List View shortcuts'), - categoryName: "list-view" - })] - }); -} -/* harmony default export */ const keyboard_shortcut_help_modal = (KeyboardShortcutHelpModal); - -;// ./node_modules/@wordpress/editor/build-module/components/block-settings-menu/content-only-settings-menu.js -/** - * WordPress dependencies - */ - - - - - - -/** - * Internal dependencies - */ - - - - - -function ContentOnlySettingsMenuItems({ - clientId, - onClose -}) { - const { - entity, - onNavigateToEntityRecord, - canEditTemplates - } = (0,external_wp_data_namespaceObject.useSelect)(select => { - const { - getBlockEditingMode, - getBlockParentsByBlockName, - getSettings, - getBlockAttributes - } = select(external_wp_blockEditor_namespaceObject.store); - const contentOnly = getBlockEditingMode(clientId) === 'contentOnly'; - if (!contentOnly) { - return {}; - } - const patternParent = getBlockParentsByBlockName(clientId, 'core/block', true)[0]; - let record; - if (patternParent) { - record = select(external_wp_coreData_namespaceObject.store).getEntityRecord('postType', 'wp_block', getBlockAttributes(patternParent).ref); - } else { - const { - getCurrentTemplateId, - getRenderingMode - } = select(store_store); - const templateId = getCurrentTemplateId(); - const { - getContentLockingParent - } = unlock(select(external_wp_blockEditor_namespaceObject.store)); - if (getRenderingMode() === 'template-locked' && !getContentLockingParent(clientId) && templateId) { - record = select(external_wp_coreData_namespaceObject.store).getEntityRecord('postType', 'wp_template', templateId); - } - } - const _canEditTemplates = select(external_wp_coreData_namespaceObject.store).canUser('create', { - kind: 'postType', - name: 'wp_template' - }); - return { - canEditTemplates: _canEditTemplates, - entity: record, - onNavigateToEntityRecord: getSettings().onNavigateToEntityRecord - }; - }, [clientId]); - if (!entity) { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TemplateLockContentOnlyMenuItems, { - clientId: clientId, - onClose: onClose - }); - } - const isPattern = entity.type === 'wp_block'; - let helpText = isPattern ? (0,external_wp_i18n_namespaceObject.__)('Edit the pattern to move, delete, or make further changes to this block.') : (0,external_wp_i18n_namespaceObject.__)('Edit the template to move, delete, or make further changes to this block.'); - if (!canEditTemplates) { - helpText = (0,external_wp_i18n_namespaceObject.__)('Only users with permissions to edit the template can move or delete this block'); - } - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__unstableBlockSettingsMenuFirstItem, { - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { - onClick: () => { - onNavigateToEntityRecord({ - postId: entity.id, - postType: entity.type - }); - }, - disabled: !canEditTemplates, - children: isPattern ? (0,external_wp_i18n_namespaceObject.__)('Edit pattern') : (0,external_wp_i18n_namespaceObject.__)('Edit template') - }) - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { - variant: "muted", - as: "p", - className: "editor-content-only-settings-menu__description", - children: helpText - })] - }); -} -function TemplateLockContentOnlyMenuItems({ - clientId, - onClose -}) { - const { - contentLockingParent - } = (0,external_wp_data_namespaceObject.useSelect)(select => { - const { - getContentLockingParent - } = unlock(select(external_wp_blockEditor_namespaceObject.store)); - return { - contentLockingParent: getContentLockingParent(clientId) - }; - }, [clientId]); - const blockDisplayInformation = (0,external_wp_blockEditor_namespaceObject.useBlockDisplayInformation)(contentLockingParent); - const blockEditorActions = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); - if (!blockDisplayInformation?.title) { - return null; - } - const { - modifyContentLockBlock - } = unlock(blockEditorActions); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__unstableBlockSettingsMenuFirstItem, { - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { - onClick: () => { - modifyContentLockBlock(contentLockingParent); - onClose(); - }, - children: (0,external_wp_i18n_namespaceObject._x)('Unlock', 'Unlock content locked blocks') - }) - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { - variant: "muted", - as: "p", - className: "editor-content-only-settings-menu__description", - children: (0,external_wp_i18n_namespaceObject.__)('Temporarily unlock the parent block to edit, delete or make further changes to this block.') - })] - }); -} -function ContentOnlySettingsMenu() { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockSettingsMenuControls, { - children: ({ - selectedClientIds, - onClose - }) => selectedClientIds.length === 1 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ContentOnlySettingsMenuItems, { - clientId: selectedClientIds[0], - onClose: onClose - }) - }); -} - -;// ./node_modules/@wordpress/editor/build-module/components/start-template-options/index.js -/** - * WordPress dependencies - */ - - - - - - - - - -/** - * Internal dependencies - */ - - - - -function useFallbackTemplateContent(slug, isCustom = false) { - return (0,external_wp_data_namespaceObject.useSelect)(select => { - const { - getEntityRecord, - getDefaultTemplateId - } = select(external_wp_coreData_namespaceObject.store); - const templateId = getDefaultTemplateId({ - slug, - is_custom: isCustom, - ignore_empty: true - }); - return templateId ? getEntityRecord('postType', TEMPLATE_POST_TYPE, templateId)?.content?.raw : undefined; - }, [slug, isCustom]); -} -function start_template_options_useStartPatterns(fallbackContent) { - const { - slug, - patterns - } = (0,external_wp_data_namespaceObject.useSelect)(select => { - const { - getCurrentPostType, - getCurrentPostId - } = select(store_store); - const { - getEntityRecord, - getBlockPatterns - } = select(external_wp_coreData_namespaceObject.store); - const postId = getCurrentPostId(); - const postType = getCurrentPostType(); - const record = getEntityRecord('postType', postType, postId); - return { - slug: record.slug, - patterns: getBlockPatterns() - }; - }, []); - const currentThemeStylesheet = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getCurrentTheme().stylesheet); - - // Duplicated from packages/block-library/src/pattern/edit.js. - function injectThemeAttributeInBlockTemplateContent(block) { - if (block.innerBlocks.find(innerBlock => innerBlock.name === 'core/template-part')) { - block.innerBlocks = block.innerBlocks.map(innerBlock => { - if (innerBlock.name === 'core/template-part' && innerBlock.attributes.theme === undefined) { - innerBlock.attributes.theme = currentThemeStylesheet; - } - return innerBlock; - }); - } - if (block.name === 'core/template-part' && block.attributes.theme === undefined) { - block.attributes.theme = currentThemeStylesheet; - } - return block; - } - return (0,external_wp_element_namespaceObject.useMemo)(() => { - // filter patterns that are supposed to be used in the current template being edited. - return [{ - name: 'fallback', - blocks: (0,external_wp_blocks_namespaceObject.parse)(fallbackContent), - title: (0,external_wp_i18n_namespaceObject.__)('Fallback content') - }, ...patterns.filter(pattern => { - return Array.isArray(pattern.templateTypes) && pattern.templateTypes.some(templateType => slug.startsWith(templateType)); - }).map(pattern => { - return { - ...pattern, - blocks: (0,external_wp_blocks_namespaceObject.parse)(pattern.content).map(block => injectThemeAttributeInBlockTemplateContent(block)) - }; - })]; - }, [fallbackContent, slug, patterns]); -} -function start_template_options_PatternSelection({ - fallbackContent, - onChoosePattern, - postType -}) { - const [,, onChange] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)('postType', postType); - const blockPatterns = start_template_options_useStartPatterns(fallbackContent); - const shownBlockPatterns = (0,external_wp_compose_namespaceObject.useAsyncList)(blockPatterns); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalBlockPatternsList, { - blockPatterns: blockPatterns, - shownPatterns: shownBlockPatterns, - onClickPattern: (pattern, blocks) => { - onChange(blocks, { - selection: undefined - }); - onChoosePattern(); - } - }); -} -function StartModal({ - slug, - isCustom, - onClose, - postType -}) { - const fallbackContent = useFallbackTemplateContent(slug, isCustom); - if (!fallbackContent) { - return null; - } - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Modal, { - className: "editor-start-template-options__modal", - title: (0,external_wp_i18n_namespaceObject.__)('Choose a pattern'), - closeLabel: (0,external_wp_i18n_namespaceObject.__)('Cancel'), - focusOnMount: "firstElement", - onRequestClose: onClose, - isFullScreen: true, - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { - className: "editor-start-template-options__modal-content", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(start_template_options_PatternSelection, { - fallbackContent: fallbackContent, - slug: slug, - isCustom: isCustom, - postType: postType, - onChoosePattern: () => { - onClose(); - } - }) - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Flex, { - className: "editor-start-template-options__modal__actions", - justify: "flex-end", - expanded: false, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - __next40pxDefaultSize: true, - variant: "tertiary", - onClick: onClose, - children: (0,external_wp_i18n_namespaceObject.__)('Skip') - }) - }) - })] - }); -} -function StartTemplateOptions() { - const [isClosed, setIsClosed] = (0,external_wp_element_namespaceObject.useState)(false); - const { - shouldOpenModal, - slug, - isCustom, - postType, - postId - } = (0,external_wp_data_namespaceObject.useSelect)(select => { - const { - getCurrentPostType, - getCurrentPostId - } = select(store_store); - const _postType = getCurrentPostType(); - const _postId = getCurrentPostId(); - const { - getEditedEntityRecord, - hasEditsForEntityRecord - } = select(external_wp_coreData_namespaceObject.store); - const templateRecord = getEditedEntityRecord('postType', _postType, _postId); - const hasEdits = hasEditsForEntityRecord('postType', _postType, _postId); - return { - shouldOpenModal: !hasEdits && '' === templateRecord.content && TEMPLATE_POST_TYPE === _postType, - slug: templateRecord.slug, - isCustom: templateRecord.is_custom, - postType: _postType, - postId: _postId - }; - }, []); - (0,external_wp_element_namespaceObject.useEffect)(() => { - // Should reset the modal state when navigating to a new page/post. - setIsClosed(false); - }, [postType, postId]); - if (!shouldOpenModal || isClosed) { - return null; - } - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(StartModal, { - slug: slug, - isCustom: isCustom, - postType: postType, - onClose: () => setIsClosed(true) - }); -} - -;// ./node_modules/@wordpress/editor/build-module/components/template-part-menu-items/convert-to-regular.js -/** - * WordPress dependencies - */ - - - - - -function ConvertToRegularBlocks({ - clientId, - onClose -}) { - const { - getBlocks - } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store); - const { - replaceBlocks - } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); - const canRemove = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).canRemoveBlock(clientId), [clientId]); - if (!canRemove) { - return null; - } - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { - onClick: () => { - replaceBlocks(clientId, getBlocks(clientId)); - onClose(); - }, - children: (0,external_wp_i18n_namespaceObject.__)('Detach') - }); -} - -;// ./node_modules/@wordpress/editor/build-module/components/template-part-menu-items/convert-to-template-part.js -/** - * WordPress dependencies - */ - - - - - - - - - -/** - * Internal dependencies - */ - - - - -function ConvertToTemplatePart({ - clientIds, - blocks -}) { - const [isModalOpen, setIsModalOpen] = (0,external_wp_element_namespaceObject.useState)(false); - const { - replaceBlocks - } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); - const { - createSuccessNotice - } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); - const { - canCreate - } = (0,external_wp_data_namespaceObject.useSelect)(select => { - return { - canCreate: select(external_wp_blockEditor_namespaceObject.store).canInsertBlockType('core/template-part') - }; - }, []); - if (!canCreate) { - return null; - } - const onConvert = async templatePart => { - replaceBlocks(clientIds, (0,external_wp_blocks_namespaceObject.createBlock)('core/template-part', { - slug: templatePart.slug, - theme: templatePart.theme - })); - createSuccessNotice((0,external_wp_i18n_namespaceObject.__)('Template part created.'), { - type: 'snackbar' - }); - - // The modal and this component will be unmounted because of `replaceBlocks` above, - // so no need to call `closeModal` or `onClose`. - }; - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { - icon: symbol_filled, - onClick: () => { - setIsModalOpen(true); - }, - "aria-expanded": isModalOpen, - "aria-haspopup": "dialog", - children: (0,external_wp_i18n_namespaceObject.__)('Create template part') - }), isModalOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CreateTemplatePartModal, { - closeModal: () => { - setIsModalOpen(false); - }, - blocks: blocks, - onCreate: onConvert - })] - }); -} - -;// ./node_modules/@wordpress/editor/build-module/components/template-part-menu-items/index.js -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - - - -function TemplatePartMenuItems() { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockSettingsMenuControls, { - children: ({ - selectedClientIds, - onClose - }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TemplatePartConverterMenuItem, { - clientIds: selectedClientIds, - onClose: onClose - }) - }); -} -function TemplatePartConverterMenuItem({ - clientIds, - onClose -}) { - const { - isContentOnly, - blocks - } = (0,external_wp_data_namespaceObject.useSelect)(select => { - const { - getBlocksByClientId, - getBlockEditingMode - } = select(external_wp_blockEditor_namespaceObject.store); - return { - blocks: getBlocksByClientId(clientIds), - isContentOnly: clientIds.length === 1 && getBlockEditingMode(clientIds[0]) === 'contentOnly' - }; - }, [clientIds]); - - // Do not show the convert button if the block is in content-only mode. - if (isContentOnly) { - return null; - } - - // Allow converting a single template part to standard blocks. - if (blocks.length === 1 && blocks[0]?.name === 'core/template-part') { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ConvertToRegularBlocks, { - clientId: clientIds[0], - onClose: onClose - }); - } - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ConvertToTemplatePart, { - clientIds: clientIds, - blocks: blocks - }); -} - -;// ./node_modules/@wordpress/editor/build-module/components/provider/index.js -/** - * WordPress dependencies - */ - - - - - - - - - -/** - * Internal dependencies - */ - - - - - - - - - - - - - - - - - - - - -const { - ExperimentalBlockEditorProvider -} = unlock(external_wp_blockEditor_namespaceObject.privateApis); -const { - PatternsMenuItems -} = unlock(external_wp_patterns_namespaceObject.privateApis); -const provider_noop = () => {}; - -/** - * These are global entities that are only there to split blocks into logical units - * They don't provide a "context" for the current post/page being rendered. - * So we should not use their ids as post context. This is important to allow post blocks - * (post content, post title) to be used within them without issues. - */ -const NON_CONTEXTUAL_POST_TYPES = ['wp_block', 'wp_navigation', 'wp_template_part']; - -/** - * Depending on the post, template and template mode, - * returns the appropriate blocks and change handlers for the block editor provider. - * - * @param {Array} post Block list. - * @param {boolean} template Whether the page content has focus (and the surrounding template is inert). If `true` return page content blocks. Default `false`. - * @param {string} mode Rendering mode. - * - * @example - * ```jsx - * const [ blocks, onInput, onChange ] = useBlockEditorProps( post, template, mode ); - * ``` - * - * @return {Array} Block editor props. - */ -function useBlockEditorProps(post, template, mode) { - const rootLevelPost = mode === 'post-only' || !template ? 'post' : 'template'; - const [postBlocks, onInput, onChange] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)('postType', post.type, { - id: post.id - }); - const [templateBlocks, onInputTemplate, onChangeTemplate] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)('postType', template?.type, { - id: template?.id - }); - const maybeNavigationBlocks = (0,external_wp_element_namespaceObject.useMemo)(() => { - if (post.type === 'wp_navigation') { - return [(0,external_wp_blocks_namespaceObject.createBlock)('core/navigation', { - ref: post.id, - // As the parent editor is locked with `templateLock`, the template locking - // must be explicitly "unset" on the block itself to allow the user to modify - // the block's content. - templateLock: false - })]; - } - }, [post.type, post.id]); - - // It is important that we don't create a new instance of blocks on every change - // We should only create a new instance if the blocks them selves change, not a dependency of them. - const blocks = (0,external_wp_element_namespaceObject.useMemo)(() => { - if (maybeNavigationBlocks) { - return maybeNavigationBlocks; - } - if (rootLevelPost === 'template') { - return templateBlocks; - } - return postBlocks; - }, [maybeNavigationBlocks, rootLevelPost, templateBlocks, postBlocks]); - - // Handle fallback to postBlocks outside of the above useMemo, to ensure - // that constructed block templates that call `createBlock` are not generated - // too frequently. This ensures that clientIds are stable. - const disableRootLevelChanges = !!template && mode === 'template-locked' || post.type === 'wp_navigation'; - if (disableRootLevelChanges) { - return [blocks, provider_noop, provider_noop]; - } - return [blocks, rootLevelPost === 'post' ? onInput : onInputTemplate, rootLevelPost === 'post' ? onChange : onChangeTemplate]; -} - -/** - * This component provides the editor context and manages the state of the block editor. - * - * @param {Object} props The component props. - * @param {Object} props.post The post object. - * @param {Object} props.settings The editor settings. - * @param {boolean} props.recovery Indicates if the editor is in recovery mode. - * @param {Array} props.initialEdits The initial edits for the editor. - * @param {Object} props.children The child components. - * @param {Object} [props.BlockEditorProviderComponent] The block editor provider component to use. Defaults to ExperimentalBlockEditorProvider. - * @param {Object} [props.__unstableTemplate] The template object. - * - * @example - * ```jsx - * - * { children } - * - * - * @return {Object} The rendered ExperimentalEditorProvider component. - */ -const ExperimentalEditorProvider = with_registry_provider(({ - post, - settings, - recovery, - initialEdits, - children, - BlockEditorProviderComponent = ExperimentalBlockEditorProvider, - __unstableTemplate: template -}) => { - const { - editorSettings, - selection, - isReady, - mode, - postTypeEntities - } = (0,external_wp_data_namespaceObject.useSelect)(select => { - const { - getEditorSettings, - getEditorSelection, - getRenderingMode, - __unstableIsEditorReady - } = select(store_store); - const { - getEntitiesConfig - } = select(external_wp_coreData_namespaceObject.store); - return { - editorSettings: getEditorSettings(), - isReady: __unstableIsEditorReady(), - mode: getRenderingMode(), - selection: getEditorSelection(), - postTypeEntities: post.type === 'wp_template' ? getEntitiesConfig('postType') : null - }; - }, [post.type]); - const isZoomOut = (0,external_wp_data_namespaceObject.useSelect)(select => { - const { - __unstableGetEditorMode - } = unlock(select(external_wp_blockEditor_namespaceObject.store)); - return __unstableGetEditorMode() === 'zoom-out'; - }); - const shouldRenderTemplate = !!template && mode !== 'post-only'; - const rootLevelPost = shouldRenderTemplate ? template : post; - const defaultBlockContext = (0,external_wp_element_namespaceObject.useMemo)(() => { - const postContext = {}; - // If it is a template, try to inherit the post type from the name. - if (post.type === 'wp_template') { - if (post.slug === 'page') { - postContext.postType = 'page'; - } else if (post.slug === 'single') { - postContext.postType = 'post'; - } else if (post.slug.split('-')[0] === 'single') { - // If the slug is single-{postType}, infer the post type from the name. - const postTypeNames = postTypeEntities?.map(entity => entity.name) || []; - const match = post.slug.match(`^single-(${postTypeNames.join('|')})(?:-.+)?$`); - if (match) { - postContext.postType = match[1]; - } - } - } else if (!NON_CONTEXTUAL_POST_TYPES.includes(rootLevelPost.type) || shouldRenderTemplate) { - postContext.postId = post.id; - postContext.postType = post.type; - } - return { - ...postContext, - templateSlug: rootLevelPost.type === 'wp_template' ? rootLevelPost.slug : undefined - }; - }, [shouldRenderTemplate, post.id, post.type, post.slug, rootLevelPost.type, rootLevelPost.slug, postTypeEntities]); - const { - id, - type - } = rootLevelPost; - const blockEditorSettings = use_block_editor_settings(editorSettings, type, id, mode); - const [blocks, onInput, onChange] = useBlockEditorProps(post, template, mode); - const { - updatePostLock, - setupEditor, - updateEditorSettings, - setCurrentTemplateId, - setEditedPost, - setRenderingMode - } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store_store)); - const { - createWarningNotice - } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); - - // Ideally this should be synced on each change and not just something you do once. - (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { - // Assume that we don't need to initialize in the case of an error recovery. - if (recovery) { - return; - } - updatePostLock(settings.postLock); - setupEditor(post, initialEdits, settings.template); - if (settings.autosave) { - createWarningNotice((0,external_wp_i18n_namespaceObject.__)('There is an autosave of this post that is more recent than the version below.'), { - id: 'autosave-exists', - actions: [{ - label: (0,external_wp_i18n_namespaceObject.__)('View the autosave'), - url: settings.autosave.editLink - }] - }); - } - }, []); - - // Synchronizes the active post with the state - (0,external_wp_element_namespaceObject.useEffect)(() => { - setEditedPost(post.type, post.id); - }, [post.type, post.id, setEditedPost]); - - // Synchronize the editor settings as they change. - (0,external_wp_element_namespaceObject.useEffect)(() => { - updateEditorSettings(settings); - }, [settings, updateEditorSettings]); - - // Synchronizes the active template with the state. - (0,external_wp_element_namespaceObject.useEffect)(() => { - setCurrentTemplateId(template?.id); - }, [template?.id, setCurrentTemplateId]); - - // Sets the right rendering mode when loading the editor. - (0,external_wp_element_namespaceObject.useEffect)(() => { - var _settings$defaultRend; - setRenderingMode((_settings$defaultRend = settings.defaultRenderingMode) !== null && _settings$defaultRend !== void 0 ? _settings$defaultRend : 'post-only'); - }, [settings.defaultRenderingMode, setRenderingMode]); - useHideBlocksFromInserter(post.type, mode); - - // Register the editor commands. - useCommands(); - if (!isReady) { - return null; - } - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_coreData_namespaceObject.EntityProvider, { - kind: "root", - type: "site", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_coreData_namespaceObject.EntityProvider, { - kind: "postType", - type: post.type, - id: post.id, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockContextProvider, { - value: defaultBlockContext, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(BlockEditorProviderComponent, { - value: blocks, - onChange: onChange, - onInput: onInput, - selection: selection, - settings: blockEditorSettings, - useSubRegistry: false, - children: [children, !settings.__unstableIsPreviewMode && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: [!isZoomOut && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PatternsMenuItems, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TemplatePartMenuItems, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ContentOnlySettingsMenu, {})] - }), mode === 'template-locked' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DisableNonPageContentBlocks, {}), type === 'wp_navigation' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationBlockEditingMode, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditorKeyboardShortcuts, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(keyboard_shortcut_help_modal, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockRemovalWarnings, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(StartPageOptions, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(StartTemplateOptions, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PatternRenameModal, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PatternDuplicateModal, {})] - })] - }) - }) - }) - }); -}); - -/** - * This component establishes a new post editing context, and serves as the entry point for a new post editor (or post with template editor). - * - * It supports a large number of post types, including post, page, templates, - * custom post types, patterns, template parts. - * - * All modification and changes are performed to the `@wordpress/core-data` store. - * - * @param {Object} props The component props. - * @param {Object} [props.post] The post object to edit. This is required. - * @param {Object} [props.__unstableTemplate] The template object wrapper the edited post. - * This is optional and can only be used when the post type supports templates (like posts and pages). - * @param {Object} [props.settings] The settings object to use for the editor. - * This is optional and can be used to override the default settings. - * @param {Element} [props.children] Children elements for which the BlockEditorProvider context should apply. - * This is optional. - * - * @example - * ```jsx - * - * { children } - * - * ``` - * - * @return {JSX.Element} The rendered EditorProvider component. - */ -function EditorProvider(props) { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ExperimentalEditorProvider, { - ...props, - BlockEditorProviderComponent: external_wp_blockEditor_namespaceObject.BlockEditorProvider, - children: props.children - }); -} -/* harmony default export */ const provider = (EditorProvider); - ;// external ["wp","serverSideRender"] const external_wp_serverSideRender_namespaceObject = window["wp"]["serverSideRender"]; var external_wp_serverSideRender_default = /*#__PURE__*/__webpack_require__.n(external_wp_serverSideRender_namespaceObject); ;// ./node_modules/@wordpress/editor/build-module/components/deprecated.js +/* wp:polyfill */ // Block Creation Components. /** * WordPress dependencies @@ -25121,8 +27855,6 @@ const withFontSizes = deprecateFunction('withFontSizes', external_wp_blockEditor - - @@ -25194,16 +27926,7 @@ function cleanForSlug(string) { * WordPress dependencies */ - -/** - * Internal dependencies - */ - -const { - createPrivateSlotFill -} = unlock(external_wp_components_namespaceObject.privateApis); -const SLOT_FILL_NAME = 'EditCanvasContainerSlot'; -const EditorContentSlotFill = createPrivateSlotFill(SLOT_FILL_NAME); +const EditorContentSlotFill = (0,external_wp_components_namespaceObject.createSlotFill)(Symbol('EditCanvasContainerSlot')); /* harmony default export */ const content_slot_fill = (EditorContentSlotFill); ;// ./node_modules/@wordpress/editor/build-module/components/header/back-button.js @@ -25236,6 +27959,957 @@ const BackButtonSlot = () => { BackButton.Slot = BackButtonSlot; /* harmony default export */ const back_button = (BackButton); +;// ./node_modules/@wordpress/icons/build-module/library/comment.js +/** + * WordPress dependencies + */ + + +const comment = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + viewBox: "0 0 24 24", + xmlns: "http://www.w3.org/2000/svg", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "M18 4H6c-1.1 0-2 .9-2 2v12.9c0 .6.5 1.1 1.1 1.1.3 0 .5-.1.8-.3L8.5 17H18c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5H7.9l-2.4 2.4V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v9z" + }) +}); +/* harmony default export */ const library_comment = (comment); + +;// ./node_modules/@wordpress/editor/build-module/components/collab-sidebar/constants.js +const collabHistorySidebarName = 'edit-post/collab-history-sidebar'; +const collabSidebarName = 'edit-post/collab-sidebar'; + +;// ./node_modules/@wordpress/icons/build-module/library/more-vertical.js +/** + * WordPress dependencies + */ + + +const moreVertical = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z" + }) +}); +/* harmony default export */ const more_vertical = (moreVertical); + +;// ./node_modules/@wordpress/editor/build-module/components/collab-sidebar/comment-author-info.js +/** + * WordPress dependencies + */ + + + + + + + +/** + * Render author information for a comment. + * + * @param {Object} props - Component properties. + * @param {string} props.avatar - URL of the author's avatar. + * @param {string} props.name - Name of the author. + * @param {string} props.date - Date of the comment. + * + * @return {React.ReactNode} The JSX element representing the author's information. + */ + +function CommentAuthorInfo({ + avatar, + name, + date +}) { + const dateSettings = (0,external_wp_date_namespaceObject.getSettings)(); + const [dateTimeFormat = dateSettings.formats.time] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'site', 'time_format'); + const { + currentUserAvatar, + currentUserName + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + var _userData$avatar_urls; + const userData = select(external_wp_coreData_namespaceObject.store).getCurrentUser(); + const { + getSettings + } = select(external_wp_blockEditor_namespaceObject.store); + const { + __experimentalDiscussionSettings + } = getSettings(); + const defaultAvatar = __experimentalDiscussionSettings?.avatarURL; + return { + currentUserAvatar: (_userData$avatar_urls = userData?.avatar_urls[48]) !== null && _userData$avatar_urls !== void 0 ? _userData$avatar_urls : defaultAvatar, + currentUserName: userData?.name + }; + }, []); + const currentDate = new Date(); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { + src: avatar !== null && avatar !== void 0 ? avatar : currentUserAvatar, + className: "editor-collab-sidebar-panel__user-avatar" + // translators: alt text for user avatar image + , + alt: (0,external_wp_i18n_namespaceObject.__)('User avatar'), + width: 32, + height: 32 + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { + spacing: "0", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { + className: "editor-collab-sidebar-panel__user-name", + children: name !== null && name !== void 0 ? name : currentUserName + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("time", { + dateTime: (0,external_wp_date_namespaceObject.dateI18n)('c', date !== null && date !== void 0 ? date : currentDate), + className: "editor-collab-sidebar-panel__user-time", + children: (0,external_wp_date_namespaceObject.dateI18n)(dateTimeFormat, date !== null && date !== void 0 ? date : currentDate) + })] + })] + }); +} +/* harmony default export */ const comment_author_info = (CommentAuthorInfo); + +;// ./node_modules/@wordpress/editor/build-module/components/collab-sidebar/utils.js +/* wp:polyfill */ +/** + * Sanitizes a comment string by removing non-printable ASCII characters. + * + * @param {string} str - The comment string to sanitize. + * @return {string} - The sanitized comment string. + */ +function sanitizeCommentString(str) { + return str.trim(); +} + +/** + * Extracts comment IDs from an array of blocks. + * + * This function recursively traverses the blocks and their inner blocks to + * collect all comment IDs found in the block attributes. + * + * @param {Array} blocks - The array of blocks to extract comment IDs from. + * @return {Array} An array of comment IDs extracted from the blocks. + */ +function getCommentIdsFromBlocks(blocks) { + // Recursive function to extract comment IDs from blocks + const extractCommentIds = items => { + return items.reduce((commentIds, block) => { + // Check for comment IDs in the current block's attributes + if (block.attributes && block.attributes.blockCommentId && !commentIds.includes(block.attributes.blockCommentId)) { + commentIds.push(block.attributes.blockCommentId); + } + + // Recursively check inner blocks + if (block.innerBlocks && block.innerBlocks.length > 0) { + const innerCommentIds = extractCommentIds(block.innerBlocks); + commentIds.push(...innerCommentIds); + } + return commentIds; + }, []); + }; + + // Extract all comment IDs recursively + return extractCommentIds(blocks); +} + +;// ./node_modules/@wordpress/editor/build-module/components/collab-sidebar/comment-form.js +/** + * WordPress dependencies + */ + + + + +/** + * Internal dependencies + */ + + +/** + * EditComment component. + * + * @param {Object} props - The component props. + * @param {Function} props.onSubmit - The function to call when updating the comment. + * @param {Function} props.onCancel - The function to call when canceling the comment update. + * @param {Object} props.thread - The comment thread object. + * @param {string} props.submitButtonText - The text to display on the submit button. + * @return {React.ReactNode} The CommentForm component. + */ + +function CommentForm({ + onSubmit, + onCancel, + thread, + submitButtonText +}) { + var _thread$content$raw; + const [inputComment, setInputComment] = (0,external_wp_element_namespaceObject.useState)((_thread$content$raw = thread?.content?.raw) !== null && _thread$content$raw !== void 0 ? _thread$content$raw : ''); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextareaControl, { + __next40pxDefaultSize: true, + __nextHasNoMarginBottom: true, + value: inputComment !== null && inputComment !== void 0 ? inputComment : '', + onChange: setInputComment + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { + alignment: "left", + spacing: "3", + justify: "flex-start", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + __next40pxDefaultSize: true, + accessibleWhenDisabled: true, + variant: "primary", + onClick: () => { + onSubmit(inputComment); + setInputComment(''); + }, + disabled: 0 === sanitizeCommentString(inputComment).length, + text: submitButtonText + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + __next40pxDefaultSize: true, + variant: "tertiary", + onClick: onCancel, + text: (0,external_wp_i18n_namespaceObject._x)('Cancel', 'Cancel comment button') + })] + })] + }); +} +/* harmony default export */ const comment_form = (CommentForm); + +;// ./node_modules/@wordpress/editor/build-module/components/collab-sidebar/comments.js +/* wp:polyfill */ +/** + * External dependencies + */ + + +/** + * WordPress dependencies + */ + + + + + + + +/** + * Internal dependencies + */ + + + +/** + * Renders the Comments component. + * + * @param {Object} props - The component props. + * @param {Array} props.threads - The array of comment threads. + * @param {Function} props.onEditComment - The function to handle comment editing. + * @param {Function} props.onAddReply - The function to add a reply to a comment. + * @param {Function} props.onCommentDelete - The function to delete a comment. + * @param {Function} props.onCommentResolve - The function to mark a comment as resolved. + * @param {boolean} props.showCommentBoard - Whether to show the comment board. + * @param {Function} props.setShowCommentBoard - The function to set the comment board visibility. + * @return {React.ReactNode} The rendered Comments component. + */ + +function Comments({ + threads, + onEditComment, + onAddReply, + onCommentDelete, + onCommentResolve, + showCommentBoard, + setShowCommentBoard +}) { + const { + blockCommentId + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getBlockAttributes, + getSelectedBlockClientId + } = select(external_wp_blockEditor_namespaceObject.store); + const _clientId = getSelectedBlockClientId(); + return { + blockCommentId: _clientId ? getBlockAttributes(_clientId)?.blockCommentId : null + }; + }, []); + const [focusThread, setFocusThread] = (0,external_wp_element_namespaceObject.useState)(showCommentBoard && blockCommentId ? blockCommentId : null); + const clearThreadFocus = () => { + setFocusThread(null); + setShowCommentBoard(false); + }; + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [ + // If there are no comments, show a message indicating no comments are available. + (!Array.isArray(threads) || threads.length === 0) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalVStack, { + alignment: "left", + className: "editor-collab-sidebar-panel__thread", + justify: "flex-start", + spacing: "3", + children: + // translators: message displayed when there are no comments available + (0,external_wp_i18n_namespaceObject.__)('No comments available') + }), Array.isArray(threads) && threads.length > 0 && threads.map(thread => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalVStack, { + className: dist_clsx('editor-collab-sidebar-panel__thread', { + 'editor-collab-sidebar-panel__active-thread': blockCommentId && blockCommentId === thread.id, + 'editor-collab-sidebar-panel__focus-thread': focusThread && focusThread === thread.id + }), + id: thread.id, + spacing: "3", + onClick: () => setFocusThread(thread.id), + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Thread, { + thread: thread, + onAddReply: onAddReply, + onCommentDelete: onCommentDelete, + onCommentResolve: onCommentResolve, + onEditComment: onEditComment, + isFocused: focusThread === thread.id, + clearThreadFocus: clearThreadFocus + }) + }, thread.id))] + }); +} +function Thread({ + thread, + onEditComment, + onAddReply, + onCommentDelete, + onCommentResolve, + isFocused, + clearThreadFocus +}) { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CommentBoard, { + thread: thread, + onResolve: onCommentResolve, + onEdit: onEditComment, + onDelete: onCommentDelete, + status: thread.status + }), 0 < thread?.reply?.length && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [!isFocused && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalVStack, { + className: "editor-collab-sidebar-panel__show-more-reply", + children: (0,external_wp_i18n_namespaceObject.sprintf)( + // translators: 1: number of replies. + (0,external_wp_i18n_namespaceObject._x)('%s more replies..', 'Show replies button'), thread?.reply?.length) + }), isFocused && thread.reply.map(reply => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { + className: "editor-collab-sidebar-panel__child-thread", + id: reply.id, + spacing: "2", + children: ['approved' !== thread.status && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CommentBoard, { + thread: reply, + onEdit: onEditComment, + onDelete: onCommentDelete + }), 'approved' === thread.status && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CommentBoard, { + thread: reply + })] + }, reply.id))] + }), 'approved' !== thread.status && isFocused && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { + className: "editor-collab-sidebar-panel__child-thread", + spacing: "2", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHStack, { + alignment: "left", + spacing: "3", + justify: "flex-start", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(comment_author_info, {}) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalVStack, { + spacing: "3", + className: "editor-collab-sidebar-panel__comment-field", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(comment_form, { + onSubmit: inputComment => { + onAddReply(inputComment, thread.id); + }, + onCancel: event => { + event.stopPropagation(); // Prevent the parent onClick from being triggered + clearThreadFocus(); + }, + submitButtonText: (0,external_wp_i18n_namespaceObject._x)('Reply', 'Add reply comment') + }) + })] + })] + }); +} +const CommentBoard = ({ + thread, + onResolve, + onEdit, + onDelete, + status +}) => { + const [actionState, setActionState] = (0,external_wp_element_namespaceObject.useState)(false); + const [showConfirmDialog, setShowConfirmDialog] = (0,external_wp_element_namespaceObject.useState)(false); + const handleConfirmDelete = () => { + onDelete(thread.id); + setActionState(false); + setShowConfirmDialog(false); + }; + const handleConfirmResolve = () => { + onResolve(thread.id); + setActionState(false); + setShowConfirmDialog(false); + }; + const handleCancel = () => { + setActionState(false); + setShowConfirmDialog(false); + }; + const actions = [onEdit && { + title: (0,external_wp_i18n_namespaceObject._x)('Edit', 'Edit comment'), + onClick: () => { + setActionState('edit'); + } + }, onDelete && { + title: (0,external_wp_i18n_namespaceObject._x)('Delete', 'Delete comment'), + onClick: () => { + setActionState('delete'); + setShowConfirmDialog(true); + } + }]; + const moreActions = actions.filter(item => item?.onClick); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { + alignment: "left", + spacing: "3", + justify: "flex-start", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(comment_author_info, { + avatar: thread?.author_avatar_urls?.[48], + name: thread?.author_name, + date: thread?.date + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("span", { + className: "editor-collab-sidebar-panel__comment-status", + children: [status !== 'approved' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { + alignment: "right", + justify: "flex-end", + spacing: "0", + children: [0 === thread?.parent && onResolve && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + label: (0,external_wp_i18n_namespaceObject._x)('Resolve', 'Mark comment as resolved'), + __next40pxDefaultSize: true, + icon: library_published, + onClick: () => { + setActionState('resolve'); + setShowConfirmDialog(true); + }, + showTooltip: true + }), 0 < moreActions.length && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.DropdownMenu, { + icon: more_vertical, + label: (0,external_wp_i18n_namespaceObject._x)('Select an action', 'Select comment action'), + className: "editor-collab-sidebar-panel__comment-dropdown-menu", + controls: moreActions + })] + }), status === 'approved' && + /*#__PURE__*/ + // translators: tooltip for resolved comment + (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Tooltip, { + text: (0,external_wp_i18n_namespaceObject.__)('Resolved'), + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(icon, { + icon: library_check + }) + })] + })] + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHStack, { + alignment: "left", + spacing: "3", + justify: "flex-start", + className: "editor-collab-sidebar-panel__user-comment", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { + spacing: "3", + className: "editor-collab-sidebar-panel__comment-field", + children: ['edit' === actionState && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(comment_form, { + onSubmit: value => { + onEdit(thread.id, value); + setActionState(false); + }, + onCancel: () => handleCancel(), + thread: thread, + submitButtonText: (0,external_wp_i18n_namespaceObject._x)('Update', 'verb') + }), 'edit' !== actionState && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.RawHTML, { + children: thread?.content?.raw + })] + }) + }), 'resolve' === actionState && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalConfirmDialog, { + isOpen: showConfirmDialog, + onConfirm: handleConfirmResolve, + onCancel: handleCancel, + confirmButtonText: "Yes", + cancelButtonText: "No", + children: + // translators: message displayed when confirming an action + (0,external_wp_i18n_namespaceObject.__)('Are you sure you want to mark this comment as resolved?') + }), 'delete' === actionState && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalConfirmDialog, { + isOpen: showConfirmDialog, + onConfirm: handleConfirmDelete, + onCancel: handleCancel, + confirmButtonText: "Yes", + cancelButtonText: "No", + children: + // translators: message displayed when confirming an action + (0,external_wp_i18n_namespaceObject.__)('Are you sure you want to delete this comment?') + })] + }); +}; + +;// ./node_modules/@wordpress/editor/build-module/components/collab-sidebar/add-comment.js +/** + * WordPress dependencies + */ + + + + + +/** + * Internal dependencies + */ + + + +/** + * Renders the UI for adding a comment in the Gutenberg editor's collaboration sidebar. + * + * @param {Object} props - The component props. + * @param {Function} props.onSubmit - A callback function to be called when the user submits a comment. + * @param {boolean} props.showCommentBoard - The function to edit the comment. + * @param {Function} props.setShowCommentBoard - The function to delete the comment. + * @return {React.ReactNode} The rendered comment input UI. + */ + +function AddComment({ + onSubmit, + showCommentBoard, + setShowCommentBoard +}) { + const { + clientId, + blockCommentId + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getSelectedBlock + } = select(external_wp_blockEditor_namespaceObject.store); + const selectedBlock = getSelectedBlock(); + return { + clientId: selectedBlock?.clientId, + blockCommentId: selectedBlock?.attributes?.blockCommentId + }; + }); + if (!showCommentBoard || !clientId || undefined !== blockCommentId) { + return null; + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { + spacing: "3", + className: "editor-collab-sidebar-panel__thread editor-collab-sidebar-panel__active-thread editor-collab-sidebar-panel__focus-thread", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHStack, { + alignment: "left", + spacing: "3", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(comment_author_info, {}) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(comment_form, { + onSubmit: inputComment => { + onSubmit(inputComment); + }, + onCancel: () => { + setShowCommentBoard(false); + }, + submitButtonText: (0,external_wp_i18n_namespaceObject._x)('Comment', 'Add comment button') + })] + }); +} + +;// ./node_modules/@wordpress/editor/build-module/components/collab-sidebar/comment-button.js +/** + * WordPress dependencies + */ + + + + + +/** + * Internal dependencies + */ + + +const { + CommentIconSlotFill +} = unlock(external_wp_blockEditor_namespaceObject.privateApis); +const AddCommentButton = ({ + onClick +}) => { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CommentIconSlotFill.Fill, { + children: ({ + onClose + }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { + icon: library_comment, + onClick: () => { + onClick(); + onClose(); + }, + "aria-haspopup": "dialog", + children: (0,external_wp_i18n_namespaceObject._x)('Comment', 'Add comment button') + }) + }); +}; +/* harmony default export */ const comment_button = (AddCommentButton); + +;// ./node_modules/@wordpress/editor/build-module/components/collab-sidebar/comment-button-toolbar.js +/** + * WordPress dependencies + */ + + + + + +/** + * Internal dependencies + */ + + +const { + CommentIconToolbarSlotFill +} = unlock(external_wp_blockEditor_namespaceObject.privateApis); +const AddCommentToolbarButton = ({ + onClick +}) => { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CommentIconToolbarSlotFill.Fill, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { + accessibleWhenDisabled: true, + icon: library_comment, + label: (0,external_wp_i18n_namespaceObject._x)('Comment', 'View comment'), + onClick: onClick + }) + }); +}; +/* harmony default export */ const comment_button_toolbar = (AddCommentToolbarButton); + +;// ./node_modules/@wordpress/editor/build-module/components/collab-sidebar/index.js +/* wp:polyfill */ +/** + * WordPress dependencies + */ + + + + + + + + + + +/** + * Internal dependencies + */ + + + + + + + + + + +const modifyBlockCommentAttributes = settings => { + if (!settings.attributes.blockCommentId) { + settings.attributes = { + ...settings.attributes, + blockCommentId: { + type: 'number' + } + }; + } + return settings; +}; + +// Apply the filter to all core blocks +(0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'block-comment/modify-core-block-attributes', modifyBlockCommentAttributes); +function CollabSidebarContent({ + showCommentBoard, + setShowCommentBoard, + styles, + comments +}) { + const { + createNotice + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); + const { + saveEntityRecord, + deleteEntityRecord + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); + const { + getEntityRecord + } = (0,external_wp_data_namespaceObject.resolveSelect)(external_wp_coreData_namespaceObject.store); + const { + postId + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getCurrentPostId + } = select(store_store); + const _postId = getCurrentPostId(); + return { + postId: _postId + }; + }, []); + const { + getSelectedBlockClientId + } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store); + const { + updateBlockAttributes + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); + + // Function to save the comment. + const addNewComment = async (comment, parentCommentId) => { + const args = { + post: postId, + content: comment, + comment_type: 'block_comment', + comment_approved: 0 + }; + + // Create a new object, conditionally including the parent property + const updatedArgs = { + ...args, + ...(parentCommentId ? { + parent: parentCommentId + } : {}) + }; + const savedRecord = await saveEntityRecord('root', 'comment', updatedArgs); + if (savedRecord) { + // If it's a main comment, update the block attributes with the comment id. + if (!parentCommentId) { + updateBlockAttributes(getSelectedBlockClientId(), { + blockCommentId: savedRecord?.id + }); + } + createNotice('snackbar', parentCommentId ? + // translators: Reply added successfully + (0,external_wp_i18n_namespaceObject.__)('Reply added successfully.') : + // translators: Comment added successfully + (0,external_wp_i18n_namespaceObject.__)('Comment added successfully.'), { + type: 'snackbar', + isDismissible: true + }); + } else { + onError(); + } + }; + const onCommentResolve = async commentId => { + const savedRecord = await saveEntityRecord('root', 'comment', { + id: commentId, + status: 'approved' + }); + if (savedRecord) { + // translators: Comment resolved successfully + createNotice('snackbar', (0,external_wp_i18n_namespaceObject.__)('Comment marked as resolved.'), { + type: 'snackbar', + isDismissible: true + }); + } else { + onError(); + } + }; + const onEditComment = async (commentId, comment) => { + const savedRecord = await saveEntityRecord('root', 'comment', { + id: commentId, + content: comment + }); + if (savedRecord) { + createNotice('snackbar', + // translators: Comment edited successfully + (0,external_wp_i18n_namespaceObject.__)('Comment edited successfully.'), { + type: 'snackbar', + isDismissible: true + }); + } else { + onError(); + } + }; + const onError = () => { + createNotice('error', + // translators: Error message when comment submission fails + (0,external_wp_i18n_namespaceObject.__)('Something went wrong. Please try publishing the post, or you may have already submitted your comment earlier.'), { + isDismissible: true + }); + }; + const onCommentDelete = async commentId => { + const childComment = await getEntityRecord('root', 'comment', commentId); + await deleteEntityRecord('root', 'comment', commentId); + if (childComment && !childComment.parent) { + updateBlockAttributes(getSelectedBlockClientId(), { + blockCommentId: undefined + }); + } + createNotice('snackbar', + // translators: Comment deleted successfully + (0,external_wp_i18n_namespaceObject.__)('Comment deleted successfully.'), { + type: 'snackbar', + isDismissible: true + }); + }; + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { + className: "editor-collab-sidebar-panel", + style: styles, + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(AddComment, { + onSubmit: addNewComment, + showCommentBoard: showCommentBoard, + setShowCommentBoard: setShowCommentBoard + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Comments, { + threads: comments, + onEditComment: onEditComment, + onAddReply: addNewComment, + onCommentDelete: onCommentDelete, + onCommentResolve: onCommentResolve, + showCommentBoard: showCommentBoard, + setShowCommentBoard: setShowCommentBoard + }, getSelectedBlockClientId())] + }); +} + +/** + * Renders the Collab sidebar. + */ +function CollabSidebar() { + const [showCommentBoard, setShowCommentBoard] = (0,external_wp_element_namespaceObject.useState)(false); + const { + enableComplementaryArea + } = (0,external_wp_data_namespaceObject.useDispatch)(store); + const { + getActiveComplementaryArea + } = (0,external_wp_data_namespaceObject.useSelect)(store); + const { + postId, + postType, + postStatus, + threads + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getCurrentPostId, + getCurrentPostType + } = select(store_store); + const _postId = getCurrentPostId(); + const data = !!_postId && typeof _postId === 'number' ? select(external_wp_coreData_namespaceObject.store).getEntityRecords('root', 'comment', { + post: _postId, + type: 'block_comment', + status: 'any', + per_page: 100 + }) : null; + return { + postId: _postId, + postType: getCurrentPostType(), + postStatus: select(store_store).getEditedPostAttribute('status'), + threads: data + }; + }, []); + const { + blockCommentId + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getBlockAttributes, + getSelectedBlockClientId + } = select(external_wp_blockEditor_namespaceObject.store); + const _clientId = getSelectedBlockClientId(); + return { + blockCommentId: _clientId ? getBlockAttributes(_clientId)?.blockCommentId : null + }; + }, []); + const openCollabBoard = () => { + setShowCommentBoard(true); + enableComplementaryArea('core', 'edit-post/collab-sidebar'); + }; + const [blocks] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)('postType', postType, { + id: postId + }); + + // Process comments to build the tree structure + const { + resultComments, + sortedThreads + } = (0,external_wp_element_namespaceObject.useMemo)(() => { + // Create a compare to store the references to all objects by id + const compare = {}; + const result = []; + const filteredComments = (threads !== null && threads !== void 0 ? threads : []).filter(comment => comment.status !== 'trash'); + + // Initialize each object with an empty `reply` array + filteredComments.forEach(item => { + compare[item.id] = { + ...item, + reply: [] + }; + }); + + // Iterate over the data to build the tree structure + filteredComments.forEach(item => { + if (item.parent === 0) { + // If parent is 0, it's a root item, push it to the result array + result.push(compare[item.id]); + } else if (compare[item.parent]) { + // Otherwise, find its parent and push it to the parent's `reply` array + compare[item.parent].reply.push(compare[item.id]); + } + }); + if (0 === result?.length) { + return { + resultComments: [], + sortedThreads: [] + }; + } + const updatedResult = result.map(item => ({ + ...item, + reply: [...item.reply].reverse() + })); + const blockCommentIds = getCommentIdsFromBlocks(blocks); + const threadIdMap = new Map(updatedResult.map(thread => [thread.id, thread])); + const sortedComments = blockCommentIds.map(id => threadIdMap.get(id)).filter(thread => thread !== undefined); + return { + resultComments: updatedResult, + sortedThreads: sortedComments + }; + }, [threads, blocks]); + + // Get the global styles to set the background color of the sidebar. + const { + merged: GlobalStyles + } = useGlobalStylesContext(); + const backgroundColor = GlobalStyles?.styles?.color?.background; + if (0 < resultComments.length) { + const unsubscribe = (0,external_wp_data_namespaceObject.subscribe)(() => { + const activeSidebar = getActiveComplementaryArea('core'); + if (!activeSidebar) { + enableComplementaryArea('core', collabSidebarName); + unsubscribe(); + } + }); + } + if (postStatus === 'publish') { + return null; // or maybe return some message indicating no threads are available. + } + const AddCommentComponent = blockCommentId ? comment_button_toolbar : comment_button; + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(AddCommentComponent, { + onClick: openCollabBoard + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PluginSidebar, { + identifier: collabHistorySidebarName + // translators: Comments sidebar title + , + title: (0,external_wp_i18n_namespaceObject.__)('Comments'), + icon: library_comment, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CollabSidebarContent, { + comments: resultComments, + showCommentBoard: showCommentBoard, + setShowCommentBoard: setShowCommentBoard + }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PluginSidebar, { + isPinnable: false, + header: false, + identifier: collabSidebarName, + className: "editor-collab-sidebar", + headerClassName: "editor-collab-sidebar__header", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CollabSidebarContent, { + comments: sortedThreads, + showCommentBoard: showCommentBoard, + setShowCommentBoard: setShowCommentBoard, + styles: { + backgroundColor + } + }) + })] + }); +} + ;// ./node_modules/@wordpress/icons/build-module/library/next.js /** * WordPress dependencies @@ -25287,8 +28961,6 @@ const previous = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(e */ - - const { useHasBlockToolbar } = unlock(external_wp_blockEditor_namespaceObject.privateApis); @@ -25378,8 +29050,6 @@ const plus = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(exter - - function DocumentTools({ className, disableBlockTools = false @@ -25395,12 +29065,9 @@ function DocumentTools({ listViewShortcut, inserterSidebarToggleRef, listViewToggleRef, - hasFixedToolbar, - showIconLabels + showIconLabels, + showTools } = (0,external_wp_data_namespaceObject.useSelect)(select => { - const { - getSettings - } = select(external_wp_blockEditor_namespaceObject.store); const { get } = select(external_wp_preferences_namespaceObject.store); @@ -25408,25 +29075,23 @@ function DocumentTools({ isListViewOpened, getEditorMode, getInserterSidebarToggleRef, - getListViewToggleRef + getListViewToggleRef, + getRenderingMode, + getCurrentPostType } = unlock(select(store_store)); const { getShortcutRepresentation } = select(external_wp_keyboardShortcuts_namespaceObject.store); - const { - __unstableGetEditorMode - } = select(external_wp_blockEditor_namespaceObject.store); return { isInserterOpened: select(store_store).isInserterOpened(), isListViewOpen: isListViewOpened(), listViewShortcut: getShortcutRepresentation('core/editor/toggle-list-view'), inserterSidebarToggleRef: getInserterSidebarToggleRef(), listViewToggleRef: getListViewToggleRef(), - hasFixedToolbar: getSettings().hasFixedToolbar, showIconLabels: get('core', 'showIconLabels'), isDistractionFree: get('core', 'distractionFree'), isVisualMode: getEditorMode() === 'visual', - isZoomedOutView: __unstableGetEditorMode() === 'zoom-out' + showTools: !!window?.__experimentalEditorWriteMode && (getRenderingMode() !== 'post-only' || getCurrentPostType() === 'wp_template') }; }, []); const preventDefault = event => { @@ -25450,7 +29115,7 @@ function DocumentTools({ const toggleInserter = (0,external_wp_element_namespaceObject.useCallback)(() => setIsInserterOpened(!isInserterOpened), [isInserterOpened, setIsInserterOpened]); /* translators: button label text should, if possible, be under 16 characters. */ - const longLabel = (0,external_wp_i18n_namespaceObject._x)('Toggle block inserter', 'Generic label for block inserter button'); + const longLabel = (0,external_wp_i18n_namespaceObject._x)('Block Inserter', 'Generic label for block inserter button'); const shortLabel = !isInserterOpened ? (0,external_wp_i18n_namespaceObject.__)('Add') : (0,external_wp_i18n_namespaceObject.__)('Close'); return ( /*#__PURE__*/ @@ -25464,9 +29129,8 @@ function DocumentTools({ variant: "unstyled", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "editor-document-tools__left", - children: [!isDistractionFree && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarItem, { + children: [!isDistractionFree && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { ref: inserterSidebarToggleRef, - as: external_wp_components_namespaceObject.Button, className: "editor-document-tools__inserter-toggle", variant: "primary", isPressed: isInserterOpened, @@ -25478,7 +29142,7 @@ function DocumentTools({ showTooltip: !showIconLabels, "aria-expanded": isInserterOpened }), (isWideViewport || !showIconLabels) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: [isLargeViewport && !hasFixedToolbar && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarItem, { + children: [showTools && isLargeViewport && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarItem, { as: external_wp_blockEditor_namespaceObject.ToolSelector, showTooltip: !showIconLabels, variant: showIconLabels ? 'tertiary' : undefined, @@ -25494,8 +29158,7 @@ function DocumentTools({ showTooltip: !showIconLabels, variant: showIconLabels ? 'tertiary' : undefined, size: "compact" - }), !isDistractionFree && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarItem, { - as: external_wp_components_namespaceObject.Button, + }), !isDistractionFree && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { className: "editor-document-tools__document-overview-toggle", icon: list_view, disabled: disableBlockTools, @@ -25507,8 +29170,7 @@ function DocumentTools({ showTooltip: !showIconLabels, variant: showIconLabels ? 'tertiary' : undefined, "aria-expanded": isListViewOpen, - ref: listViewToggleRef, - size: "compact" + ref: listViewToggleRef })] })] }) @@ -25517,21 +29179,6 @@ function DocumentTools({ } /* harmony default export */ const document_tools = (DocumentTools); -;// ./node_modules/@wordpress/icons/build-module/library/more-vertical.js -/** - * WordPress dependencies - */ - - -const moreVertical = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - d: "M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z" - }) -}); -/* harmony default export */ const more_vertical = (moreVertical); - ;// ./node_modules/@wordpress/editor/build-module/components/more-menu/copy-content-menu-item.js /** * WordPress dependencies @@ -25587,6 +29234,7 @@ function CopyContentMenuItem() { } ;// ./node_modules/@wordpress/editor/build-module/components/mode-switcher/index.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -25724,8 +29372,6 @@ ViewMoreMenuGroup.Slot = ({ - - function MoreMenu() { const { openModal @@ -25767,25 +29413,27 @@ function MoreMenu() { onToggle: turnOffDistractionFree, label: (0,external_wp_i18n_namespaceObject.__)('Top toolbar'), info: (0,external_wp_i18n_namespaceObject.__)('Access all block and document tools in a single place'), - messageActivated: (0,external_wp_i18n_namespaceObject.__)('Top toolbar activated'), - messageDeactivated: (0,external_wp_i18n_namespaceObject.__)('Top toolbar deactivated') + messageActivated: (0,external_wp_i18n_namespaceObject.__)('Top toolbar activated.'), + messageDeactivated: (0,external_wp_i18n_namespaceObject.__)('Top toolbar deactivated.') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_preferences_namespaceObject.PreferenceToggleMenuItem, { scope: "core", name: "distractionFree", label: (0,external_wp_i18n_namespaceObject.__)('Distraction free'), info: (0,external_wp_i18n_namespaceObject.__)('Write with calmness'), handleToggling: false, - onToggle: toggleDistractionFree, - messageActivated: (0,external_wp_i18n_namespaceObject.__)('Distraction free mode activated'), - messageDeactivated: (0,external_wp_i18n_namespaceObject.__)('Distraction free mode deactivated'), + onToggle: () => toggleDistractionFree({ + createNotice: false + }), + messageActivated: (0,external_wp_i18n_namespaceObject.__)('Distraction free mode activated.'), + messageDeactivated: (0,external_wp_i18n_namespaceObject.__)('Distraction free mode deactivated.'), shortcut: external_wp_keycodes_namespaceObject.displayShortcut.primaryShift('\\') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_preferences_namespaceObject.PreferenceToggleMenuItem, { scope: "core", name: "focusMode", label: (0,external_wp_i18n_namespaceObject.__)('Spotlight mode'), info: (0,external_wp_i18n_namespaceObject.__)('Focus on one block at a time'), - messageActivated: (0,external_wp_i18n_namespaceObject.__)('Spotlight mode activated'), - messageDeactivated: (0,external_wp_i18n_namespaceObject.__)('Spotlight mode deactivated') + messageActivated: (0,external_wp_i18n_namespaceObject.__)('Spotlight mode activated.'), + messageDeactivated: (0,external_wp_i18n_namespaceObject.__)('Spotlight mode deactivated.') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(view_more_menu_group.Slot, { fillProps: { onClose @@ -25794,7 +29442,6 @@ function MoreMenu() { }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(mode_switcher, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(action_item.Slot, { name: "core/plugin-more-menu", label: (0,external_wp_i18n_namespaceObject.__)('Plugins'), - as: external_wp_components_namespaceObject.MenuGroup, fillProps: { onClick: onClose } @@ -25843,24 +29490,41 @@ function MoreMenu() { +const IS_TOGGLE = 'toggle'; +const IS_BUTTON = 'button'; function PostPublishButtonOrToggle({ forceIsDirty, - hasPublishAction, - isBeingScheduled, - isPending, - isPublished, - isPublishSidebarEnabled, - isPublishSidebarOpened, - isScheduled, - togglePublishSidebar, - setEntitiesSavedStatesCallback, - postStatusHasChanged, - postStatus + setEntitiesSavedStatesCallback }) { - const IS_TOGGLE = 'toggle'; - const IS_BUTTON = 'button'; - const isSmallerThanMediumViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<'); let component; + const isSmallerThanMediumViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<'); + const { + togglePublishSidebar + } = (0,external_wp_data_namespaceObject.useDispatch)(store_store); + const { + hasPublishAction, + isBeingScheduled, + isPending, + isPublished, + isPublishSidebarEnabled, + isPublishSidebarOpened, + isScheduled, + postStatus, + postStatusHasChanged + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + var _select$getCurrentPos; + return { + hasPublishAction: (_select$getCurrentPos = !!select(store_store).getCurrentPost()?._links?.['wp:action-publish']) !== null && _select$getCurrentPos !== void 0 ? _select$getCurrentPos : false, + isBeingScheduled: select(store_store).isEditedPostBeingScheduled(), + isPending: select(store_store).isCurrentPostPending(), + isPublished: select(store_store).isCurrentPostPublished(), + isPublishSidebarEnabled: select(store_store).isPublishSidebarEnabled(), + isPublishSidebarOpened: select(store_store).isPublishSidebarOpened(), + isScheduled: select(store_store).isCurrentPostScheduled(), + postStatus: select(store_store).getEditedPostAttribute('status'), + postStatusHasChanged: select(store_store).getPostEdits()?.status + }; + }, []); /** * Conditions to show a BUTTON (publish directly) or a TOGGLE (open publish sidebar): @@ -25869,7 +29533,7 @@ function PostPublishButtonOrToggle({ * for a particular role (see https://wordpress.org/documentation/article/post-status/): * * - is published - * - post status has changed explicitely to something different than 'future' or 'publish' + * - post status has changed explicitly to something different than 'future' or 'publish' * - is scheduled to be published * - is pending and can't be published (but only for viewports >= medium). * Originally, we considered showing a button for pending posts that couldn't be published @@ -25900,27 +29564,6 @@ function PostPublishButtonOrToggle({ setEntitiesSavedStatesCallback: setEntitiesSavedStatesCallback }); } -/* harmony default export */ const post_publish_button_or_toggle = ((0,external_wp_compose_namespaceObject.compose)((0,external_wp_data_namespaceObject.withSelect)(select => { - var _select$getCurrentPos; - return { - hasPublishAction: (_select$getCurrentPos = select(store_store).getCurrentPost()?._links?.['wp:action-publish']) !== null && _select$getCurrentPos !== void 0 ? _select$getCurrentPos : false, - isBeingScheduled: select(store_store).isEditedPostBeingScheduled(), - isPending: select(store_store).isCurrentPostPending(), - isPublished: select(store_store).isCurrentPostPublished(), - isPublishSidebarEnabled: select(store_store).isPublishSidebarEnabled(), - isPublishSidebarOpened: select(store_store).isPublishSidebarOpened(), - isScheduled: select(store_store).isCurrentPostScheduled(), - postStatus: select(store_store).getEditedPostAttribute('status'), - postStatusHasChanged: select(store_store).getPostEdits()?.status - }; -}), (0,external_wp_data_namespaceObject.withDispatch)(dispatch => { - const { - togglePublishSidebar - } = dispatch(store_store); - return { - togglePublishSidebar - }; -}))(PostPublishButtonOrToggle)); ;// ./node_modules/@wordpress/editor/build-module/components/post-view-link/index.js /** @@ -26046,8 +29689,6 @@ const tablet = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ext - - function PreviewDropdown({ forceIsAutosaveable, disabled @@ -26057,13 +29698,19 @@ function PreviewDropdown({ homeUrl, isTemplate, isViewable, - showIconLabels + showIconLabels, + isTemplateHidden, + templateId } = (0,external_wp_data_namespaceObject.useSelect)(select => { var _getPostType$viewable; const { getDeviceType, - getCurrentPostType + getCurrentPostType, + getCurrentTemplateId } = select(store_store); + const { + getRenderingMode + } = unlock(select(store_store)); const { getEntityRecord, getPostType @@ -26077,21 +29724,20 @@ function PreviewDropdown({ homeUrl: getEntityRecord('root', '__unstableBase')?.home, isTemplate: _currentPostType === 'wp_template', isViewable: (_getPostType$viewable = getPostType(_currentPostType)?.viewable) !== null && _getPostType$viewable !== void 0 ? _getPostType$viewable : false, - showIconLabels: get('core', 'showIconLabels') + showIconLabels: get('core', 'showIconLabels'), + isTemplateHidden: getRenderingMode() === 'post-only', + templateId: getCurrentTemplateId() }; }, []); const { - setDeviceType + setDeviceType, + setRenderingMode } = (0,external_wp_data_namespaceObject.useDispatch)(store_store); - const { - __unstableSetEditorMode - } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); const { resetZoomLevel } = unlock((0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store)); const handleDevicePreviewChange = newDeviceType => { setDeviceType(newDeviceType); - __unstableSetEditorMode('edit'); resetZoomLevel(); }; const isMobile = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<'); @@ -26165,6 +29811,16 @@ function PreviewDropdown({ (0,external_wp_i18n_namespaceObject.__)('(opens in a new tab)') })] }) + }), !isTemplate && !!templateId && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { + icon: !isTemplateHidden ? library_check : undefined, + isSelected: !isTemplateHidden, + role: "menuitemcheckbox", + onClick: () => { + setRenderingMode(isTemplateHidden ? 'template-locked' : 'post-only'); + }, + children: (0,external_wp_i18n_namespaceObject.__)('Show template') + }) }), isViewable && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostPreviewButton, { className: "editor-preview-dropdown__button-external", @@ -26180,7 +29836,6 @@ function PreviewDropdown({ }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(action_item.Slot, { name: "core/plugin-preview-menu", - as: external_wp_components_namespaceObject.MenuGroup, fillProps: { onClick: onClose } @@ -26220,6 +29875,9 @@ const square = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ext + + + /** * Internal dependencies */ @@ -26230,23 +29888,52 @@ const ZoomOutToggle = ({ }) => { const { isZoomOut, - showIconLabels + showIconLabels, + isDistractionFree } = (0,external_wp_data_namespaceObject.useSelect)(select => ({ isZoomOut: unlock(select(external_wp_blockEditor_namespaceObject.store)).isZoomOut(), - showIconLabels: select(external_wp_preferences_namespaceObject.store).get('core', 'showIconLabels') + showIconLabels: select(external_wp_preferences_namespaceObject.store).get('core', 'showIconLabels'), + isDistractionFree: select(external_wp_preferences_namespaceObject.store).get('core', 'distractionFree') })); const { resetZoomLevel, - setZoomLevel, - __unstableSetEditorMode + setZoomLevel } = unlock((0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store)); + const { + registerShortcut, + unregisterShortcut + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_keyboardShortcuts_namespaceObject.store); + (0,external_wp_element_namespaceObject.useEffect)(() => { + registerShortcut({ + name: 'core/editor/zoom', + category: 'global', + description: (0,external_wp_i18n_namespaceObject.__)('Enter or exit zoom out.'), + keyCombination: { + // `primaryShift+0` (`ctrl+shift+0`) is the shortcut for switching + // to input mode in Windows, so apply a different key combination. + modifier: (0,external_wp_keycodes_namespaceObject.isAppleOS)() ? 'primaryShift' : 'secondary', + character: '0' + } + }); + return () => { + unregisterShortcut('core/editor/zoom'); + }; + }, [registerShortcut, unregisterShortcut]); + (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/editor/zoom', () => { + if (isZoomOut) { + resetZoomLevel(); + } else { + setZoomLevel('auto-scaled'); + } + }, { + isDisabled: isDistractionFree + }); const handleZoomOut = () => { if (isZoomOut) { resetZoomLevel(); } else { - setZoomLevel(50); + setZoomLevel('auto-scaled'); } - __unstableSetEditorMode(isZoomOut ? 'edit' : 'zoom-out'); }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { accessibleWhenDisabled: true, @@ -26256,7 +29943,8 @@ const ZoomOutToggle = ({ label: (0,external_wp_i18n_namespaceObject.__)('Zoom Out'), isPressed: isZoomOut, size: "compact", - showTooltip: !showIconLabels + showTooltip: !showIconLabels, + className: "editor-zoom-out-toggle" }); }; /* harmony default export */ const zoom_out_toggle = (ZoomOutToggle); @@ -26290,6 +29978,9 @@ const ZoomOutToggle = ({ + + +const isBlockCommentExperimentEnabled = window?.__experimentalEnableBlockComment; const toolbarVariations = { distractionFreeDisabled: { y: '-50px' @@ -26324,52 +30015,57 @@ const backButtonVariations = { x: 0 } }; -function Header({ +function header_Header({ customSaveButton, forceIsDirty, forceDisableBlockTools, setEntitiesSavedStatesCallback, - title, - isEditorIframed + title }) { const isWideViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('large'); const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium'); const isTooNarrowForDocumentBar = (0,external_wp_compose_namespaceObject.useMediaQuery)('(max-width: 403px)'); const { + postType, isTextEditor, isPublishSidebarOpened, showIconLabels, hasFixedToolbar, hasBlockSelection, - isNestedEntity + hasSectionRootClientId } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { get: getPreference } = select(external_wp_preferences_namespaceObject.store); const { getEditorMode, - getEditorSettings, + getCurrentPostType, isPublishSidebarOpened: _isPublishSidebarOpened } = select(store_store); const { - __unstableGetEditorMode - } = select(external_wp_blockEditor_namespaceObject.store); + getBlockSelectionStart, + getSectionRootClientId + } = unlock(select(external_wp_blockEditor_namespaceObject.store)); return { + postType: getCurrentPostType(), isTextEditor: getEditorMode() === 'text', isPublishSidebarOpened: _isPublishSidebarOpened(), showIconLabels: getPreference('core', 'showIconLabels'), hasFixedToolbar: getPreference('core', 'fixedToolbar'), - hasBlockSelection: !!select(external_wp_blockEditor_namespaceObject.store).getBlockSelectionStart(), - isNestedEntity: !!getEditorSettings().onNavigateToPreviousEntityRecord, - isZoomedOutView: __unstableGetEditorMode() === 'zoom-out' + hasBlockSelection: !!getBlockSelectionStart(), + hasSectionRootClientId: !!getSectionRootClientId() }; }, []); + const canBeZoomedOut = ['post', 'page', 'wp_template'].includes(postType) && hasSectionRootClientId; + const disablePreviewOption = [NAVIGATION_POST_TYPE, TEMPLATE_PART_POST_TYPE, PATTERN_POST_TYPE].includes(postType) || forceDisableBlockTools; const [isBlockToolsCollapsed, setIsBlockToolsCollapsed] = (0,external_wp_element_namespaceObject.useState)(true); - const hasCenter = (!hasBlockSelection || isBlockToolsCollapsed) && !isTooNarrowForDocumentBar; + const hasCenter = !isTooNarrowForDocumentBar && (!hasFixedToolbar || hasFixedToolbar && (!hasBlockSelection || isBlockToolsCollapsed)); const hasBackButton = useHasBackButton(); - // The edit-post-header classname is only kept for backward compatibilty - // as some plugins might be relying on its presence. + /* + * The edit-post-header classname is only kept for backward compatibility + * as some plugins might be relying on its presence. + */ return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "editor-header edit-post-header", children: [hasBackButton && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableMotion.div, { @@ -26408,31 +30104,33 @@ function Header({ className: "editor-header__settings", children: [!customSaveButton && !isPublishSidebarOpened && /*#__PURE__*/ - // This button isn't completely hidden by the publish sidebar. - // We can't hide the whole toolbar when the publish sidebar is open because - // we want to prevent mounting/unmounting the PostPublishButtonOrToggle DOM node. - // We track that DOM node to return focus to the PostPublishButtonOrToggle - // when the publish sidebar has been closed. + /* + * This button isn't completely hidden by the publish sidebar. + * We can't hide the whole toolbar when the publish sidebar is open because + * we want to prevent mounting/unmounting the PostPublishButtonOrToggle DOM node. + * We track that DOM node to return focus to the PostPublishButtonOrToggle + * when the publish sidebar has been closed. + */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PostSavedState, { forceIsDirty: forceIsDirty - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreviewDropdown, { + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostViewLink, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreviewDropdown, { forceIsAutosaveable: forceIsDirty, - disabled: isNestedEntity + disabled: disablePreviewOption }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostPreviewButton, { className: "editor-header__post-preview-button", forceIsAutosaveable: forceIsDirty - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostViewLink, {}), isEditorIframed && isWideViewport && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(zoom_out_toggle, { + }), isWideViewport && canBeZoomedOut && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(zoom_out_toggle, { disabled: forceDisableBlockTools }), (isWideViewport || !showIconLabels) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(pinned_items.Slot, { scope: "core" - }), !customSaveButton && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_publish_button_or_toggle, { + }), !customSaveButton && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostPublishButtonOrToggle, { forceIsDirty: forceIsDirty, setEntitiesSavedStatesCallback: setEntitiesSavedStatesCallback - }), customSaveButton, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MoreMenu, {})] + }), isBlockCommentExperimentEnabled ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CollabSidebar, {}) : undefined, customSaveButton, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MoreMenu, {})] })] }); } -/* harmony default export */ const components_header = (Header); +/* harmony default export */ const components_header = (header_Header); ;// ./node_modules/@wordpress/editor/build-module/components/inserter-sidebar/index.js /** @@ -26459,18 +30157,18 @@ function InserterSidebar() { const { blockSectionRootClientId, inserterSidebarToggleRef, - insertionPoint, + inserter, showMostUsedBlocks, sidebarIsOpened } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getInserterSidebarToggleRef, - getInsertionPoint, + getInserter, isPublishSidebarOpened } = unlock(select(store_store)); const { getBlockRootClientId, - __unstableGetEditorMode, + isZoomOut, getSectionRootClientId } = unlock(select(external_wp_blockEditor_namespaceObject.store)); const { @@ -26480,7 +30178,7 @@ function InserterSidebar() { getActiveComplementaryArea } = select(store); const getBlockSectionRootClientId = () => { - if (__unstableGetEditorMode() === 'zoom-out') { + if (isZoomOut()) { const sectionRootClientId = getSectionRootClientId(); if (sectionRootClientId) { return sectionRootClientId; @@ -26490,7 +30188,7 @@ function InserterSidebar() { }; return { inserterSidebarToggleRef: getInserterSidebarToggleRef(), - insertionPoint: getInsertionPoint(), + inserter: getInserter(), showMostUsedBlocks: get('core', 'mostUsedBlocks'), blockSectionRootClientId: getBlockSectionRootClientId(), sidebarIsOpened: !!(getActiveComplementaryArea('core') || isPublishSidebarOpened()) @@ -26522,12 +30220,11 @@ function InserterSidebar() { showMostUsedBlocks: showMostUsedBlocks, showInserterHelpPanel: true, shouldFocusBlock: isMobileViewport, - rootClientId: blockSectionRootClientId !== null && blockSectionRootClientId !== void 0 ? blockSectionRootClientId : insertionPoint.rootClientId, - __experimentalInsertionIndex: insertionPoint.insertionIndex, - onSelect: insertionPoint.onSelect, - __experimentalInitialTab: insertionPoint.tab, - __experimentalInitialCategory: insertionPoint.category, - __experimentalFilterValue: insertionPoint.filterValue, + rootClientId: blockSectionRootClientId, + onSelect: inserter.onSelect, + __experimentalInitialTab: inserter.tab, + __experimentalInitialCategory: inserter.category, + __experimentalFilterValue: inserter.filterValue, onPatternCategorySelection: sidebarIsOpened ? () => disableComplementaryArea('core') : undefined, ref: libraryRef, onClose: closeInserterSidebar @@ -26559,8 +30256,6 @@ function InserterSidebar() { - - function ListViewOutline() { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { @@ -26585,6 +30280,7 @@ function ListViewOutline() { } ;// ./node_modules/@wordpress/editor/build-module/components/list-view-sidebar/index.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -26737,8 +30433,6 @@ function ListViewSidebar() { - - const { Fill: save_publish_panels_Fill, Slot: save_publish_panels_Slot @@ -26806,6 +30500,7 @@ function SavePublishPanels({ variant: "secondary", onClick: openEntitiesSavedStates, "aria-expanded": false, + "aria-haspopup": "dialog", disabled: !isDirty, accessibleWhenDisabled: true, children: (0,external_wp_i18n_namespaceObject.__)('Open save panel') @@ -26817,7 +30512,8 @@ function SavePublishPanels({ // always mounted to retain its own component state (such as checkboxes). return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [isEntitiesSavedStatesOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EntitiesSavedStates, { - close: closeEntitiesSavedStates + close: closeEntitiesSavedStates, + renderDialog: true }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(save_publish_panels_Slot, { bubblesVirtually: true }), !isEntitiesSavedStatesOpen && unmountableContent] @@ -26834,7 +30530,6 @@ function SavePublishPanels({ - /** * Internal dependencies */ @@ -26842,8 +30537,6 @@ function SavePublishPanels({ - - function TextEditor({ autoFocus = false }) { @@ -26865,19 +30558,13 @@ function TextEditor({ isRichEditingEnabled: getEditorSettings().richEditingEnabled }; }, []); - const { - resetZoomLevel, - __unstableSetEditorMode - } = unlock((0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store)); const titleRef = (0,external_wp_element_namespaceObject.useRef)(); (0,external_wp_element_namespaceObject.useEffect)(() => { - resetZoomLevel(); - __unstableSetEditorMode('edit'); if (autoFocus) { return; } titleRef?.current?.focus(); - }, [autoFocus, resetZoomLevel, __unstableSetEditorMode]); + }, [autoFocus]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "editor-text-editor", children: [isRichEditingEnabled && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { @@ -26922,7 +30609,7 @@ function TextEditor({ * user is focusing on editing page content and clicks on a disabled template * block. * - Displays a 'Edit your template to edit this block' dialog when the user - * is focusing on editing page conetnt and double clicks on a disabled + * is focusing on editing page content and double clicks on a disabled * template block. * * @param {Object} props @@ -26997,8 +30684,6 @@ function EditTemplateBlocksNotification({ - - const DELTA_DISTANCE = 20; // The distance to resize per keydown in pixels. function ResizeHandle({ @@ -27009,6 +30694,10 @@ function ResizeHandle({ const { keyCode } = event; + if (keyCode !== external_wp_keycodes_namespaceObject.LEFT && keyCode !== external_wp_keycodes_namespaceObject.RIGHT) { + return; + } + event.preventDefault(); if (direction === 'left' && keyCode === external_wp_keycodes_namespaceObject.LEFT || direction === 'right' && keyCode === external_wp_keycodes_namespaceObject.RIGHT) { resizeWidthBy(DELTA_DISTANCE); } else if (direction === 'left' && keyCode === external_wp_keycodes_namespaceObject.RIGHT || direction === 'right' && keyCode === external_wp_keycodes_namespaceObject.LEFT) { @@ -27135,6 +30824,7 @@ function ResizableEditor({ /* harmony default export */ const resizable_editor = (ResizableEditor); ;// ./node_modules/@wordpress/editor/build-module/components/visual-editor/use-select-nearest-editable-block.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -27215,6 +30905,53 @@ function useSelectNearestEditableBlock({ }, [isEnabled]); } +;// ./node_modules/@wordpress/editor/build-module/components/visual-editor/use-zoom-out-mode-exit.js +/** + * WordPress dependencies + */ + + + + +/** + * Internal dependencies + */ + + +/** + * Allows Zoom Out mode to be exited by double clicking in the selected block. + */ +function useZoomOutModeExit() { + const { + getSettings, + isZoomOut + } = unlock((0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store)); + const { + resetZoomLevel + } = unlock((0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store)); + return (0,external_wp_compose_namespaceObject.useRefEffect)(node => { + function onDoubleClick(event) { + if (!isZoomOut()) { + return; + } + if (!event.defaultPrevented) { + event.preventDefault(); + const { + __experimentalSetIsInserterOpened + } = getSettings(); + if (typeof __experimentalSetIsInserterOpened === 'function') { + __experimentalSetIsInserterOpened(false); + } + resetZoomLevel(); + } + } + node.addEventListener('dblclick', onDoubleClick); + return () => { + node.removeEventListener('dblclick', onDoubleClick); + }; + }, [getSettings, isZoomOut, resetZoomLevel]); +} + ;// ./node_modules/@wordpress/editor/build-module/components/visual-editor/index.js /** * External dependencies @@ -27243,14 +30980,12 @@ function useSelectNearestEditableBlock({ - const { LayoutStyle, useLayoutClasses, useLayoutStyles, ExperimentalBlockCanvas: BlockCanvas, - useFlashEditableBlocks, - useZoomOutModeExit + useFlashEditableBlocks } = unlock(external_wp_blockEditor_namespaceObject.privateApis); /** @@ -27298,9 +31033,11 @@ function VisualEditor({ contentRef, className }) { - const [resizeObserver, sizes] = (0,external_wp_compose_namespaceObject.useResizeObserver)(); + const [contentHeight, setContentHeight] = (0,external_wp_element_namespaceObject.useState)(''); + const effectContentHeight = (0,external_wp_compose_namespaceObject.useResizeObserver)(([entry]) => { + setContentHeight(entry.borderBoxSize[0].blockSize); + }); const isMobileViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('small', '<'); - const isTabletViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<'); const { renderingMode, postContentAttributes, @@ -27350,7 +31087,7 @@ function VisualEditor({ deviceType: getDeviceType(), isFocusedEntity: !!editorSettings.onNavigateToPreviousEntityRecord, postType: postTypeSlug, - isPreview: editorSettings.__unstableIsPreviewMode + isPreview: editorSettings.isPreviewMode }; }, []); const { @@ -27465,26 +31202,14 @@ function VisualEditor({ .is-root-container.alignwide:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: var(--wp--style--global--wide-size);} .is-root-container.alignfull { max-width: none; margin-left: auto; margin-right: auto;} .is-root-container.alignfull:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: none;}`; - const localRef = (0,external_wp_element_namespaceObject.useRef)(); - const typewriterRef = (0,external_wp_blockEditor_namespaceObject.__unstableUseTypewriter)(); - contentRef = (0,external_wp_compose_namespaceObject.useMergeRefs)([localRef, contentRef, renderingMode === 'post-only' ? typewriterRef : null, useFlashEditableBlocks({ - isEnabled: renderingMode === 'template-locked' - }), useSelectNearestEditableBlock({ - isEnabled: renderingMode === 'template-locked' - }), useZoomOutModeExit()]); - const zoomOutProps = isZoomedOut && !isTabletViewport ? { - scale: 'default', - frameSize: '40px' - } : {}; const forceFullHeight = postType === NAVIGATION_POST_TYPE; const enableResizing = [NAVIGATION_POST_TYPE, TEMPLATE_PART_POST_TYPE, PATTERN_POST_TYPE].includes(postType) && // Disable in previews / view mode. !isPreview && // Disable resizing in mobile viewport. !isMobileViewport && - // Dsiable resizing in zoomed-out mode. + // Disable resizing in zoomed-out mode. !isZoomedOut; - const shouldIframe = !disableIframe || ['Tablet', 'Mobile'].includes(deviceType); const iframeStyles = (0,external_wp_element_namespaceObject.useMemo)(() => { return [...(styles !== null && styles !== void 0 ? styles : []), { // Ensures margins of children are contained so that the body background paints behind them. @@ -27496,25 +31221,35 @@ function VisualEditor({ enableResizing ? 'min-height:0!important;' : ''}}` }]; }, [styles, enableResizing]); + const localRef = (0,external_wp_element_namespaceObject.useRef)(); + const typewriterRef = (0,external_wp_blockEditor_namespaceObject.__unstableUseTypewriter)(); + contentRef = (0,external_wp_compose_namespaceObject.useMergeRefs)([localRef, contentRef, renderingMode === 'post-only' ? typewriterRef : null, useFlashEditableBlocks({ + isEnabled: renderingMode === 'template-locked' + }), useSelectNearestEditableBlock({ + isEnabled: renderingMode === 'template-locked' + }), useZoomOutModeExit(), + // Avoid resize listeners when not needed, these will trigger + // unnecessary re-renders when animating the iframe width. + enableResizing ? effectContentHeight : null]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: dist_clsx('editor-visual-editor', // this class is here for backward compatibility reasons. 'edit-post-visual-editor', className, { 'has-padding': isFocusedEntity || enableResizing, 'is-resizable': enableResizing, - 'is-iframed': shouldIframe + 'is-iframed': !disableIframe, + 'is-scrollable': disableIframe || deviceType !== 'Desktop' }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(resizable_editor, { enableResizing: enableResizing, - height: sizes.height && !forceFullHeight ? sizes.height : '100%', + height: contentHeight && !forceFullHeight ? contentHeight : '100%', children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(BlockCanvas, { - shouldIframe: shouldIframe, + shouldIframe: !disableIframe, contentRef: contentRef, styles: iframeStyles, height: "100%", iframeProps: { ...iframeProps, - ...zoomOutProps, style: { ...iframeProps?.style, ...deviceStyles @@ -27535,7 +31270,7 @@ function VisualEditor({ })] }), renderingMode === 'post-only' && !isDesignPostType && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: dist_clsx('editor-visual-editor__post-title-wrapper', - // The following class is only here for backward comapatibility + // The following class is only here for backward compatibility // some themes might be using it to style the post title. 'edit-post-visual-editor__post-title-wrapper', { 'has-global-padding': hasRootPaddingAwareAlignments @@ -27554,8 +31289,11 @@ function VisualEditor({ blockName: wrapperBlockName, uniqueId: wrapperUniqueId, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockList, { - className: dist_clsx('is-' + deviceType.toLowerCase() + '-preview', renderingMode !== 'post-only' || isDesignPostType ? 'wp-site-blocks' : `${blockListLayoutClass} wp-block-post-content` // Ensure root level blocks receive default/flow blockGap styling rules. - ), + className: dist_clsx('is-' + deviceType.toLowerCase() + '-preview', renderingMode !== 'post-only' || isDesignPostType ? 'wp-site-blocks' : `${blockListLayoutClass} wp-block-post-content`, + // Ensure root level blocks receive default/flow blockGap styling rules. + { + 'has-global-padding': renderingMode === 'post-only' && !isDesignPostType && hasRootPaddingAwareAlignments + }), layout: blockListLayout, dropZoneElement: // When iframed, pass in the html element of the iframe to @@ -27567,11 +31305,7 @@ function VisualEditor({ }), renderingMode === 'template-locked' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditTemplateBlocksNotification, { contentRef: localRef })] - }), - // Avoid resize listeners when not needed, - // these will trigger unnecessary re-renders - // when animating the iframe width. - enableResizing && resizeObserver] + })] }) }) }); @@ -27608,9 +31342,6 @@ function VisualEditor({ - - - const interfaceLabels = { /* translators: accessibility text for the editor top bar landmark region. */ header: (0,external_wp_i18n_namespaceObject.__)('Editor top bar'), @@ -27645,8 +31376,7 @@ function EditorInterface({ isDistractionFree, isPreviewMode, showBlockBreadcrumbs, - documentLabel, - isZoomOut + documentLabel } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { get @@ -27657,21 +31387,17 @@ function EditorInterface({ } = select(store_store); const editorSettings = getEditorSettings(); const postTypeLabel = getPostTypeLabel(); - const { - isZoomOut: _isZoomOut - } = unlock(select(external_wp_blockEditor_namespaceObject.store)); return { mode: select(store_store).getEditorMode(), isRichEditingEnabled: editorSettings.richEditingEnabled, isInserterOpened: select(store_store).isInserterOpened(), isListViewOpened: select(store_store).isListViewOpened(), isDistractionFree: get('core', 'distractionFree'), - isPreviewMode: editorSettings.__unstableIsPreviewMode, + isPreviewMode: editorSettings.isPreviewMode, showBlockBreadcrumbs: get('core', 'showBlockBreadcrumbs'), documentLabel: // translators: Default label for the Document in the Block Breadcrumb. - postTypeLabel || (0,external_wp_i18n_namespaceObject._x)('Document', 'noun, breadcrumb'), - isZoomOut: _isZoomOut() + postTypeLabel || (0,external_wp_i18n_namespaceObject._x)('Document', 'noun, breadcrumb') }; }, []); const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium'); @@ -27701,8 +31427,7 @@ function EditorInterface({ setEntitiesSavedStatesCallback: setEntitiesSavedStatesCallback, customSaveButton: customSaveButton, forceDisableBlockTools: forceDisableBlockTools, - title: title, - isEditorIframed: !disableIframe + title: title }), editorNotices: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(editor_notices, {}), secondarySidebar: !isPreviewMode && mode === 'visual' && (isInserterOpened && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(InserterSidebar, {}) || isListViewOpened && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ListViewSidebar, {})), @@ -27732,7 +31457,7 @@ function EditorInterface({ }) })] }), - footer: !isPreviewMode && !isDistractionFree && isLargeViewport && showBlockBreadcrumbs && isRichEditingEnabled && !isZoomOut && mode === 'visual' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockBreadcrumb, { + footer: !isPreviewMode && !isDistractionFree && isLargeViewport && showBlockBreadcrumbs && isRichEditingEnabled && mode === 'visual' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockBreadcrumb, { rootLabelText: documentLabel }), actions: !isPreviewMode ? customSavePanel || /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SavePublishPanels, { @@ -27768,18 +31493,348 @@ function PatternOverridesPanel() { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(OverridesPanel, {}); } -;// ./node_modules/@wordpress/editor/build-module/components/post-actions/actions.js +;// ./node_modules/@wordpress/editor/build-module/utils/get-item-title.js +/** + * WordPress dependencies + */ + + +/** + * Helper function to get the title of a post item. + * This is duplicated from the `@wordpress/fields` package. + * `packages/fields/src/actions/utils.ts` + * + * @param {Object} item The post item. + * @return {string} The title of the item, or an empty string if the title is not found. + */ +function get_item_title_getItemTitle(item) { + if (typeof item.title === 'string') { + return (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(item.title); + } + if (item.title && 'rendered' in item.title) { + return (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(item.title.rendered); + } + if (item.title && 'raw' in item.title) { + return (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(item.title.raw); + } + return ''; +} + +;// ./node_modules/@wordpress/editor/build-module/components/post-actions/set-as-homepage.js /** * WordPress dependencies */ + + + + /** * Internal dependencies */ +const SetAsHomepageModal = ({ + items, + closeModal +}) => { + const [item] = items; + const pageTitle = get_item_title_getItemTitle(item); + const { + showOnFront, + currentHomePage, + isSaving + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getEntityRecord, + isSavingEntityRecord + } = select(external_wp_coreData_namespaceObject.store); + const siteSettings = getEntityRecord('root', 'site'); + const currentHomePageItem = getEntityRecord('postType', 'page', siteSettings?.page_on_front); + return { + showOnFront: siteSettings?.show_on_front, + currentHomePage: currentHomePageItem, + isSaving: isSavingEntityRecord('root', 'site') + }; + }); + const { + saveEntityRecord + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); + const { + createSuccessNotice, + createErrorNotice + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); + async function onSetPageAsHomepage(event) { + event.preventDefault(); + try { + await saveEntityRecord('root', 'site', { + page_on_front: item.id, + show_on_front: 'page' + }); + createSuccessNotice((0,external_wp_i18n_namespaceObject.__)('Homepage updated.'), { + type: 'snackbar' + }); + } catch (error) { + const errorMessage = error.message && error.code !== 'unknown_error' ? error.message : (0,external_wp_i18n_namespaceObject.__)('An error occurred while setting the homepage.'); + createErrorNotice(errorMessage, { + type: 'snackbar' + }); + } finally { + closeModal?.(); + } + } + let modalWarning = ''; + if ('posts' === showOnFront) { + modalWarning = (0,external_wp_i18n_namespaceObject.__)('This will replace the current homepage which is set to display latest posts.'); + } else if (currentHomePage) { + modalWarning = (0,external_wp_i18n_namespaceObject.sprintf)( + // translators: %s: title of the current home page. + (0,external_wp_i18n_namespaceObject.__)('This will replace the current homepage: "%s"'), get_item_title_getItemTitle(currentHomePage)); + } + const modalText = (0,external_wp_i18n_namespaceObject.sprintf)( + // translators: %1$s: title of the page to be set as the homepage, %2$s: homepage replacement warning message. + (0,external_wp_i18n_namespaceObject.__)('Set "%1$s" as the site homepage? %2$s'), pageTitle, modalWarning).trim(); + + // translators: Button label to confirm setting the specified page as the homepage. + const modalButtonLabel = (0,external_wp_i18n_namespaceObject.__)('Set homepage'); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("form", { + onSubmit: onSetPageAsHomepage, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { + spacing: "5", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { + children: modalText + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { + justify: "right", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + __next40pxDefaultSize: true, + variant: "tertiary", + onClick: () => { + closeModal?.(); + }, + disabled: isSaving, + accessibleWhenDisabled: true, + children: (0,external_wp_i18n_namespaceObject.__)('Cancel') + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + __next40pxDefaultSize: true, + variant: "primary", + type: "submit", + disabled: isSaving, + accessibleWhenDisabled: true, + children: modalButtonLabel + })] + })] + }) + }); +}; +const useSetAsHomepageAction = () => { + const { + pageOnFront, + pageForPosts + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getEntityRecord, + canUser + } = select(external_wp_coreData_namespaceObject.store); + const siteSettings = canUser('read', { + kind: 'root', + name: 'site' + }) ? getEntityRecord('root', 'site') : undefined; + return { + pageOnFront: siteSettings?.page_on_front, + pageForPosts: siteSettings?.page_for_posts + }; + }); + return (0,external_wp_element_namespaceObject.useMemo)(() => ({ + id: 'set-as-homepage', + label: (0,external_wp_i18n_namespaceObject.__)('Set as homepage'), + isEligible(post) { + if (post.status !== 'publish') { + return false; + } + if (post.type !== 'page') { + return false; + } + + // Don't show the action if the page is already set as the homepage. + if (pageOnFront === post.id) { + return false; + } + + // Don't show the action if the page is already set as the page for posts. + if (pageForPosts === post.id) { + return false; + } + return true; + }, + RenderModal: SetAsHomepageModal + }), [pageForPosts, pageOnFront]); +}; + +;// ./node_modules/@wordpress/editor/build-module/components/post-actions/set-as-posts-page.js +/** + * WordPress dependencies + */ + + + + + + + +/** + * Internal dependencies + */ + + +const SetAsPostsPageModal = ({ + items, + closeModal +}) => { + const [item] = items; + const pageTitle = get_item_title_getItemTitle(item); + const { + currentPostsPage, + isPageForPostsSet, + isSaving + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getEntityRecord, + isSavingEntityRecord + } = select(external_wp_coreData_namespaceObject.store); + const siteSettings = getEntityRecord('root', 'site'); + const currentPostsPageItem = getEntityRecord('postType', 'page', siteSettings?.page_for_posts); + return { + currentPostsPage: currentPostsPageItem, + isPageForPostsSet: siteSettings?.page_for_posts !== 0, + isSaving: isSavingEntityRecord('root', 'site') + }; + }); + const { + saveEntityRecord + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); + const { + createSuccessNotice, + createErrorNotice + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); + async function onSetPageAsPostsPage(event) { + event.preventDefault(); + try { + await saveEntityRecord('root', 'site', { + page_for_posts: item.id, + show_on_front: 'page' + }); + createSuccessNotice((0,external_wp_i18n_namespaceObject.__)('Posts page updated.'), { + type: 'snackbar' + }); + } catch (error) { + const errorMessage = error.message && error.code !== 'unknown_error' ? error.message : (0,external_wp_i18n_namespaceObject.__)('An error occurred while setting the posts page.'); + createErrorNotice(errorMessage, { + type: 'snackbar' + }); + } finally { + closeModal?.(); + } + } + const modalWarning = isPageForPostsSet && currentPostsPage ? (0,external_wp_i18n_namespaceObject.sprintf)( + // translators: %s: title of the current posts page. + (0,external_wp_i18n_namespaceObject.__)('This will replace the current posts page: "%s"'), get_item_title_getItemTitle(currentPostsPage)) : (0,external_wp_i18n_namespaceObject.__)('This page will show the latest posts.'); + const modalText = (0,external_wp_i18n_namespaceObject.sprintf)( + // translators: %1$s: title of the page to be set as the posts page, %2$s: posts page replacement warning message. + (0,external_wp_i18n_namespaceObject.__)('Set "%1$s" as the posts page? %2$s'), pageTitle, modalWarning); + + // translators: Button label to confirm setting the specified page as the posts page. + const modalButtonLabel = (0,external_wp_i18n_namespaceObject.__)('Set posts page'); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("form", { + onSubmit: onSetPageAsPostsPage, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { + spacing: "5", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { + children: modalText + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { + justify: "right", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + __next40pxDefaultSize: true, + variant: "tertiary", + onClick: () => { + closeModal?.(); + }, + disabled: isSaving, + accessibleWhenDisabled: true, + children: (0,external_wp_i18n_namespaceObject.__)('Cancel') + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + __next40pxDefaultSize: true, + variant: "primary", + type: "submit", + disabled: isSaving, + accessibleWhenDisabled: true, + children: modalButtonLabel + })] + })] + }) + }); +}; +const useSetAsPostsPageAction = () => { + const { + pageOnFront, + pageForPosts + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getEntityRecord, + canUser + } = select(external_wp_coreData_namespaceObject.store); + const siteSettings = canUser('read', { + kind: 'root', + name: 'site' + }) ? getEntityRecord('root', 'site') : undefined; + return { + pageOnFront: siteSettings?.page_on_front, + pageForPosts: siteSettings?.page_for_posts + }; + }); + return (0,external_wp_element_namespaceObject.useMemo)(() => ({ + id: 'set-as-posts-page', + label: (0,external_wp_i18n_namespaceObject.__)('Set as posts page'), + isEligible(post) { + if (post.status !== 'publish') { + return false; + } + if (post.type !== 'page') { + return false; + } + + // Don't show the action if the page is already set as the homepage. + if (pageOnFront === post.id) { + return false; + } + + // Don't show the action if the page is already set as the page for posts. + if (pageForPosts === post.id) { + return false; + } + return true; + }, + RenderModal: SetAsPostsPageModal + }), [pageForPosts, pageOnFront]); +}; + +;// ./node_modules/@wordpress/editor/build-module/components/post-actions/actions.js +/* wp:polyfill */ +/** + * WordPress dependencies + */ + + + + +/** + * Internal dependencies + */ + + + + function usePostActions({ postType, @@ -27797,19 +31852,48 @@ function usePostActions({ }; }, [postType]); const { - registerPostTypeActions + canManageOptions, + hasFrontPageTemplate + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getEntityRecords + } = select(external_wp_coreData_namespaceObject.store); + const templates = getEntityRecords('postType', 'wp_template', { + per_page: -1 + }); + return { + canManageOptions: select(external_wp_coreData_namespaceObject.store).canUser('update', { + kind: 'root', + name: 'site' + }), + hasFrontPageTemplate: !!templates?.find(template => template?.slug === 'front-page') + }; + }); + const setAsHomepageAction = useSetAsHomepageAction(); + const setAsPostsPageAction = useSetAsPostsPageAction(); + const shouldShowHomepageActions = canManageOptions && !hasFrontPageTemplate; + const { + registerPostTypeSchema } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store_store)); (0,external_wp_element_namespaceObject.useEffect)(() => { - registerPostTypeActions(postType); - }, [registerPostTypeActions, postType]); + registerPostTypeSchema(postType); + }, [registerPostTypeSchema, postType]); return (0,external_wp_element_namespaceObject.useMemo)(() => { + let actions = [...defaultActions]; + if (shouldShowHomepageActions) { + actions.push(setAsHomepageAction, setAsPostsPageAction); + } + + // Ensure "Move to trash" is always the last action. + actions = actions.sort((a, b) => b.id === 'move-to-trash' ? -1 : 0); + // Filter actions based on provided context. If not provided // all actions are returned. We'll have a single entry for getting the actions // and the consumer should provide the context to filter the actions, if needed. // Actions should also provide the `context` they support, if it's specific, to // compare with the provided context to get all the actions. // Right now the only supported context is `list`. - const actions = defaultActions.filter(action => { + actions = actions.filter(action => { if (!action.context) { return true; } @@ -27854,10 +31938,11 @@ function usePostActions({ } } return actions; - }, [defaultActions, onActionPerformed, context]); + }, [context, defaultActions, onActionPerformed, setAsHomepageAction, setAsPostsPageAction, shouldShowHomepageActions]); } ;// ./node_modules/@wordpress/editor/build-module/components/post-actions/index.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -27874,20 +31959,13 @@ function usePostActions({ - - const { - DropdownMenuV2, + Menu, kebabCase } = unlock(external_wp_components_namespaceObject.privateApis); -function PostActions({ - postType, - postId, - onActionPerformed -}) { - const [isActionsMenuOpen, setIsActionsMenuOpen] = (0,external_wp_element_namespaceObject.useState)(false); +function useEditedEntityRecordsWithPermissions(postType, postIds) { const { - item, + items, permissions } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { @@ -27895,45 +31973,63 @@ function PostActions({ getEntityRecordPermissions } = unlock(select(external_wp_coreData_namespaceObject.store)); return { - item: getEditedEntityRecord('postType', postType, postId), - permissions: getEntityRecordPermissions('postType', postType, postId) + items: postIds.map(postId => getEditedEntityRecord('postType', postType, postId)), + permissions: postIds.map(postId => getEntityRecordPermissions('postType', postType, postId)) }; - }, [postId, postType]); - const itemWithPermissions = (0,external_wp_element_namespaceObject.useMemo)(() => { - return { + }, [postIds, postType]); + return (0,external_wp_element_namespaceObject.useMemo)(() => { + return items.map((item, index) => ({ ...item, - permissions - }; - }, [item, permissions]); + permissions: permissions[index] + })); + }, [items, permissions]); +} +function PostActions({ + postType, + postId, + onActionPerformed +}) { + const [activeModalAction, setActiveModalAction] = (0,external_wp_element_namespaceObject.useState)(null); + const _postIds = (0,external_wp_element_namespaceObject.useMemo)(() => { + if (Array.isArray(postId)) { + return postId; + } + return postId ? [postId] : []; + }, [postId]); + const itemsWithPermissions = useEditedEntityRecordsWithPermissions(postType, _postIds); const allActions = usePostActions({ postType, onActionPerformed }); const actions = (0,external_wp_element_namespaceObject.useMemo)(() => { return allActions.filter(action => { - return !action.isEligible || action.isEligible(itemWithPermissions); + return (!action.isEligible || itemsWithPermissions.some(itemWithPermissions => action.isEligible(itemWithPermissions))) && (itemsWithPermissions.length < 2 || action.supportsBulk); }); - }, [allActions, itemWithPermissions]); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DropdownMenuV2, { - open: isActionsMenuOpen, - trigger: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - size: "small", - icon: more_vertical, - label: (0,external_wp_i18n_namespaceObject.__)('Actions'), - disabled: !actions.length, - accessibleWhenDisabled: true, - className: "editor-all-actions-button", - onClick: () => setIsActionsMenuOpen(!isActionsMenuOpen) - }), - onOpenChange: setIsActionsMenuOpen, - placement: "bottom-end", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ActionsDropdownMenuGroup, { - actions: actions, - item: itemWithPermissions, - onClose: () => { - setIsActionsMenuOpen(false); - } - }) + }, [allActions, itemsWithPermissions]); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(Menu, { + placement: "bottom-end", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Menu.TriggerButton, { + render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + size: "small", + icon: more_vertical, + label: (0,external_wp_i18n_namespaceObject.__)('Actions'), + disabled: !actions.length, + accessibleWhenDisabled: true, + className: "editor-all-actions-button" + }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Menu.Popover, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ActionsDropdownMenuGroup, { + actions: actions, + items: itemsWithPermissions, + setActiveModalAction: setActiveModalAction + }) + })] + }), !!activeModalAction && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ActionModal, { + action: activeModalAction, + items: itemsWithPermissions, + closeModal: () => setActiveModalAction(null) + })] }); } @@ -27942,94 +32038,64 @@ function PostActions({ // and the dataviews package should not be using the editor packages directly, // so duplicating the code here seems like the least bad option. -// Copied as is from packages/dataviews/src/item-actions.js function DropdownMenuItemTrigger({ action, onClick, items }) { const label = typeof action.label === 'string' ? action.label : action.label(items); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DropdownMenuV2.Item, { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Menu.Item, { onClick: onClick, - hideOnClick: !action.RenderModal, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DropdownMenuV2.ItemLabel, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Menu.ItemLabel, { children: label }) }); } - -// Copied as is from packages/dataviews/src/item-actions.js -// With an added onClose prop. -function ActionWithModal({ +function ActionModal({ action, - item, - ActionTrigger, - onClose + items, + closeModal }) { - const [isModalOpen, setIsModalOpen] = (0,external_wp_element_namespaceObject.useState)(false); - const actionTriggerProps = { - action, - onClick: () => setIsModalOpen(true), - items: [item] - }; - const { - RenderModal, - hideModalHeader - } = action; - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ActionTrigger, { - ...actionTriggerProps - }), isModalOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Modal, { - title: action.modalHeader || action.label, - __experimentalHideHeader: !!hideModalHeader, - onRequestClose: () => { - setIsModalOpen(false); - }, - overlayClassName: `editor-action-modal editor-action-modal__${kebabCase(action.id)}`, - focusOnMount: "firstContentElement", - size: "small", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(RenderModal, { - items: [item], - closeModal: () => { - setIsModalOpen(false); - onClose(); - } - }) - })] + const label = typeof action.label === 'string' ? action.label : action.label(items); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Modal, { + title: action.modalHeader || label, + __experimentalHideHeader: !!action.hideModalHeader, + onRequestClose: closeModal !== null && closeModal !== void 0 ? closeModal : () => {}, + focusOnMount: "firstContentElement", + size: "medium", + overlayClassName: `editor-action-modal editor-action-modal__${kebabCase(action.id)}`, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(action.RenderModal, { + items: items, + closeModal: closeModal + }) }); } - -// Copied as is from packages/dataviews/src/item-actions.js -// With an added onClose prop. function ActionsDropdownMenuGroup({ actions, - item, - onClose + items, + setActiveModalAction }) { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DropdownMenuV2.Group, { + const registry = (0,external_wp_data_namespaceObject.useRegistry)(); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Menu.Group, { children: actions.map(action => { - if (action.RenderModal) { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ActionWithModal, { - action: action, - item: item, - ActionTrigger: DropdownMenuItemTrigger, - onClose: onClose - }, action.id); - } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DropdownMenuItemTrigger, { action: action, - onClick: () => action.callback([item]), - items: [item] + onClick: () => { + if ('RenderModal' in action) { + setActiveModalAction(action); + return; + } + action.callback(items, { + registry + }); + }, + items: items }, action.id); }) }); } ;// ./node_modules/@wordpress/editor/build-module/components/post-card-panel/index.js -/** - * External dependencies - */ - /** * WordPress dependencies */ @@ -28039,6 +32105,7 @@ function ActionsDropdownMenuGroup({ + /** * Internal dependencies */ @@ -28048,82 +32115,101 @@ function ActionsDropdownMenuGroup({ + +const { + Badge: post_card_panel_Badge +} = unlock(external_wp_components_namespaceObject.privateApis); + +/** + * Renders a title of the post type and the available quick actions available within a 3-dot dropdown. + * + * @param {Object} props - Component props. + * @param {string} [props.postType] - The post type string. + * @param {string|string[]} [props.postId] - The post id or list of post ids. + * @param {Function} [props.onActionPerformed] - A callback function for when a quick action is performed. + * @return {React.ReactNode} The rendered component. + */ function PostCardPanel({ postType, postId, onActionPerformed }) { + const postIds = (0,external_wp_element_namespaceObject.useMemo)(() => Array.isArray(postId) ? postId : [postId], [postId]); const { - isFrontPage, - isPostsPage, - title, + postTitle, icon, - isSync + labels } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { - __experimentalGetTemplateInfo - } = select(store_store); - const { - canUser, - getEditedEntityRecord + getEditedEntityRecord, + getEntityRecord, + getPostType } = select(external_wp_coreData_namespaceObject.store); - const siteSettings = canUser('read', { - kind: 'root', - name: 'site' - }) ? getEditedEntityRecord('root', 'site') : undefined; - const _record = getEditedEntityRecord('postType', postType, postId); - const _templateInfo = [TEMPLATE_POST_TYPE, TEMPLATE_PART_POST_TYPE].includes(postType) && __experimentalGetTemplateInfo(_record); - let _isSync = false; - if (GLOBAL_POST_TYPES.includes(postType)) { - if (PATTERN_POST_TYPE === postType) { - // When the post is first created, the top level wp_pattern_sync_status is not set so get meta value instead. - const currentSyncStatus = _record?.meta?.wp_pattern_sync_status === 'unsynced' ? 'unsynced' : _record?.wp_pattern_sync_status; - _isSync = currentSyncStatus !== 'unsynced'; - } else { - _isSync = true; - } + const { + getPostIcon + } = unlock(select(store_store)); + let _title = ''; + const _record = getEditedEntityRecord('postType', postType, postIds[0]); + if (postIds.length === 1) { + var _getEntityRecord; + const { + default_template_types: templateTypes = [] + } = (_getEntityRecord = getEntityRecord('root', '__unstableBase')) !== null && _getEntityRecord !== void 0 ? _getEntityRecord : {}; + const _templateInfo = [TEMPLATE_POST_TYPE, TEMPLATE_PART_POST_TYPE].includes(postType) ? getTemplateInfo({ + template: _record, + templateTypes + }) : {}; + _title = _templateInfo?.title || _record?.title; } return { - title: _templateInfo?.title || _record?.title, - icon: unlock(select(store_store)).getPostIcon(postType, { + postTitle: _title, + icon: getPostIcon(postType, { area: _record?.area }), - isSync: _isSync, - isFrontPage: siteSettings?.page_on_front === postId, - isPostsPage: siteSettings?.page_for_posts === postId + labels: getPostType(postType)?.labels }; - }, [postId, postType]); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + }, [postIds, postType]); + const pageTypeBadge = usePageTypeBadge(postId); + let title = (0,external_wp_i18n_namespaceObject.__)('No title'); + if (labels?.name && postIds.length > 1) { + title = (0,external_wp_i18n_namespaceObject.sprintf)( + // translators: %i number of selected items %s: Name of the plural post type e.g: "Posts". + (0,external_wp_i18n_namespaceObject.__)('%i %s'), postId.length, labels?.name); + } else if (postTitle) { + title = (0,external_wp_dom_namespaceObject.__unstableStripHTML)(postTitle); + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { + spacing: 1, className: "editor-post-card-panel", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { spacing: 2, className: "editor-post-card-panel__header", align: "flex-start", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { - className: dist_clsx('editor-post-card-panel__icon', { - 'is-sync': isSync - }), + className: "editor-post-card-panel__icon", icon: icon }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalText, { numberOfLines: 2, truncate: true, className: "editor-post-card-panel__title", - weight: 500, as: "h2", - lineHeight: "20px", - children: [title ? (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title) : (0,external_wp_i18n_namespaceObject.__)('No title'), isFrontPage && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { - className: "editor-post-card-panel__title-badge", - children: (0,external_wp_i18n_namespaceObject.__)('Homepage') - }), isPostsPage && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { - className: "editor-post-card-panel__title-badge", - children: (0,external_wp_i18n_namespaceObject.__)('Posts Page') + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { + className: "editor-post-card-panel__title-name", + children: title + }), pageTypeBadge && postIds.length === 1 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_card_panel_Badge, { + children: pageTypeBadge })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostActions, { postType: postType, postId: postId, onActionPerformed: onActionPerformed })] - }) + }), postIds.length > 1 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { + className: "editor-post-card-panel__description", + children: (0,external_wp_i18n_namespaceObject.sprintf)( + // translators: %s: Name of the plural post type e.g: "Posts". + (0,external_wp_i18n_namespaceObject.__)('Changes will be applied to all selected %s.'), labels?.name.toLowerCase()) + })] }); } @@ -28191,18 +32277,19 @@ function PostContentInformation() { const wordsCountText = (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: the number of words in the post. (0,external_wp_i18n_namespaceObject._n)('%s word', '%s words', wordsCounted), wordsCounted.toLocaleString()); - const minutesText = readingTime <= 1 ? (0,external_wp_i18n_namespaceObject.__)('1 minute') : (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: the number of minutes to read the post. */ + const minutesText = readingTime <= 1 ? (0,external_wp_i18n_namespaceObject.__)('1 minute') : (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: the number of minutes to read the post. */ (0,external_wp_i18n_namespaceObject._n)('%s minute', '%s minutes', readingTime), readingTime.toLocaleString()); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "editor-post-content-information", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { - children: (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: 1: How many words a post has. 2: the number of minutes to read the post (e.g. 130 words, 2 minutes read time.) */ + children: (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: 1: How many words a post has. 2: the number of minutes to read the post (e.g. 130 words, 2 minutes read time.) */ (0,external_wp_i18n_namespaceObject.__)('%1$s, %2$s read time.'), wordsCountText, minutesText) }) }); } ;// ./node_modules/@wordpress/editor/build-module/components/post-format/panel.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -28223,10 +32310,9 @@ function PostContentInformation() { /** * Renders the Post Author Panel component. * - * @return {Component} The component to be rendered. + * @return {React.ReactNode} The rendered component. */ - function panel_PostFormat() { const { postFormat @@ -28253,7 +32339,7 @@ function panel_PostFormat() { offset: 36, shift: true }), [popoverAnchor]); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_format_check, { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostFormatCheck, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_panel_row, { label: (0,external_wp_i18n_namespaceObject.__)('Format'), ref: setPopoverAnchor, @@ -28361,8 +32447,6 @@ function PostPanelSection({ - - const blog_title_EMPTY_OBJECT = {}; function BlogTitle() { const { @@ -28474,8 +32558,6 @@ function BlogTitle() { - - function PostsPerPage() { const { editEntityRecord @@ -28582,8 +32664,6 @@ function PostsPerPage() { - - const site_discussion_COMMENT_OPTIONS = [{ label: (0,external_wp_i18n_namespaceObject._x)('Open', 'Adjective: e.g. "Comments are open"'), value: 'open', @@ -28719,8 +32799,6 @@ function SiteDiscussion() { * Module Constants */ - - const post_summary_PANEL_NAME = 'post-status'; function PostSummary({ onActionPerformed @@ -28730,7 +32808,7 @@ function PostSummary({ postType, postId } = (0,external_wp_data_namespaceObject.useSelect)(select => { - // We use isEditorPanelRemoved to hide the panel if it was programatically removed. We do + // We use isEditorPanelRemoved to hide the panel if it was programmatically removed. We do // not use isEditorPanelEnabled since this panel should not be disabled through the UI. const { isEditorPanelRemoved, @@ -28774,6 +32852,7 @@ function PostSummary({ } ;// ./node_modules/@wordpress/editor/build-module/components/post-transform-panel/hooks.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -28868,7 +32947,6 @@ function useAvailablePatterns(template) { - /** * Internal dependencies */ @@ -28880,14 +32958,12 @@ function post_transform_panel_TemplatesList({ availableTemplates, onSelect }) { - const shownTemplates = (0,external_wp_compose_namespaceObject.useAsyncList)(availableTemplates); if (!availableTemplates || availableTemplates?.length === 0) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalBlockPatternsList, { label: (0,external_wp_i18n_namespaceObject.__)('Templates'), blockPatterns: availableTemplates, - shownPatterns: shownTemplates, onClickPattern: onSelect, showTitlesAsTooltip: true }); @@ -28974,7 +33050,6 @@ const sidebars = { - const { Tabs } = unlock(external_wp_components_namespaceObject.privateApis); @@ -29071,6 +33146,7 @@ function TemplateContentPanel() { } ;// ./node_modules/@wordpress/editor/build-module/components/template-part-content-panel/index.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -29182,6 +33258,7 @@ function useAutoSwitchEditorSidebars() { /* harmony default export */ const use_auto_switch_editor_sidebars = (useAutoSwitchEditorSidebars); ;// ./node_modules/@wordpress/editor/build-module/components/sidebar/index.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -29212,7 +33289,6 @@ function useAutoSwitchEditorSidebars() { - const { Tabs: sidebar_Tabs } = unlock(external_wp_components_namespaceObject.privateApis); @@ -29278,7 +33354,7 @@ const SidebarContent = ({ focusable: false, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostSummary, { onActionPerformed: onActionPerformed - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(plugin_document_setting_panel.Slot, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TemplateContentPanel, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TemplatePartContentPanel, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostTransformPanel, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_taxonomies_panel, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PatternOverridesPanel, {}), extraPanels] + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(plugin_document_setting_panel.Slot, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TemplateContentPanel, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TemplatePartContentPanel, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostTransformPanel, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(panel_PostTaxonomies, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PatternOverridesPanel, {}), extraPanels] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(sidebar_Tabs.TabPanel, { tabId: sidebars.block, focusable: false, @@ -29350,8 +33426,6 @@ const Sidebar = ({ - - function Editor({ postType, postId, @@ -29412,58 +33486,32 @@ function Editor({ - /** * Internal dependencies */ + const { PreferenceBaseOption: enable_publish_sidebar_PreferenceBaseOption } = unlock(external_wp_preferences_namespaceObject.privateApis); -/* harmony default export */ const enable_publish_sidebar = ((0,external_wp_compose_namespaceObject.compose)((0,external_wp_data_namespaceObject.withSelect)(select => ({ - isChecked: select(store_store).isPublishSidebarEnabled() -})), (0,external_wp_data_namespaceObject.withDispatch)(dispatch => { +function EnablePublishSidebarOption(props) { + const isChecked = (0,external_wp_data_namespaceObject.useSelect)(select => { + return select(store_store).isPublishSidebarEnabled(); + }, []); const { enablePublishSidebar, disablePublishSidebar - } = dispatch(store_store); - return { - onChange: isEnabled => isEnabled ? enablePublishSidebar() : disablePublishSidebar() - }; -}))(enable_publish_sidebar_PreferenceBaseOption)); - -;// ./node_modules/@wordpress/editor/build-module/components/block-manager/checklist.js -/** - * WordPress dependencies - */ - - - - -function BlockTypesChecklist({ - blockTypes, - value, - onItemChange -}) { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ul", { - className: "editor-block-manager__checklist", - children: blockTypes.map(blockType => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("li", { - className: "editor-block-manager__checklist-item", - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.CheckboxControl, { - __nextHasNoMarginBottom: true, - label: blockType.title, - checked: value.includes(blockType.name), - onChange: (...args) => onItemChange(blockType.name, ...args) - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockIcon, { - icon: blockType.icon - })] - }, blockType.name)) + } = (0,external_wp_data_namespaceObject.useDispatch)(store_store); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(enable_publish_sidebar_PreferenceBaseOption, { + isChecked: isChecked, + onChange: isEnabled => isEnabled ? enablePublishSidebar() : disablePublishSidebar(), + ...props }); } -/* harmony default export */ const checklist = (BlockTypesChecklist); -;// ./node_modules/@wordpress/editor/build-module/components/block-manager/category.js +;// ./node_modules/@wordpress/editor/build-module/components/preferences-modal/block-visibility.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -29479,201 +33527,73 @@ function BlockTypesChecklist({ - - -function BlockManagerCategory({ - title, - blockTypes -}) { - const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(BlockManagerCategory); +const { + BlockManager +} = unlock(external_wp_blockEditor_namespaceObject.privateApis); +function BlockVisibility() { const { - allowedBlockTypes, - hiddenBlockTypes + showBlockTypes, + hideBlockTypes + } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store_store)); + const { + blockTypes, + allowedBlockTypes: _allowedBlockTypes, + hiddenBlockTypes: _hiddenBlockTypes } = (0,external_wp_data_namespaceObject.useSelect)(select => { - const { - getEditorSettings - } = select(store_store); - const { - get - } = select(external_wp_preferences_namespaceObject.store); + var _select$get; return { - allowedBlockTypes: getEditorSettings().allowedBlockTypes, - hiddenBlockTypes: get('core', 'hiddenBlockTypes') + blockTypes: select(external_wp_blocks_namespaceObject.store).getBlockTypes(), + allowedBlockTypes: select(store_store).getEditorSettings().allowedBlockTypes, + hiddenBlockTypes: (_select$get = select(external_wp_preferences_namespaceObject.store).get('core', 'hiddenBlockTypes')) !== null && _select$get !== void 0 ? _select$get : [] }; }, []); - const filteredBlockTypes = (0,external_wp_element_namespaceObject.useMemo)(() => { - if (allowedBlockTypes === true) { + const allowedBlockTypes = (0,external_wp_element_namespaceObject.useMemo)(() => { + if (_allowedBlockTypes === true) { return blockTypes; } return blockTypes.filter(({ name }) => { - return allowedBlockTypes?.includes(name); + return _allowedBlockTypes?.includes(name); }); - }, [allowedBlockTypes, blockTypes]); - const { - showBlockTypes, - hideBlockTypes - } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store_store)); - const toggleVisible = (0,external_wp_element_namespaceObject.useCallback)((blockName, nextIsChecked) => { - if (nextIsChecked) { - showBlockTypes(blockName); - } else { - hideBlockTypes(blockName); - } - }, [showBlockTypes, hideBlockTypes]); - const toggleAllVisible = (0,external_wp_element_namespaceObject.useCallback)(nextIsChecked => { - const blockNames = blockTypes.map(({ - name - }) => name); - if (nextIsChecked) { - showBlockTypes(blockNames); - } else { - hideBlockTypes(blockNames); - } - }, [blockTypes, showBlockTypes, hideBlockTypes]); - if (!filteredBlockTypes.length) { - return null; - } - const checkedBlockNames = filteredBlockTypes.map(({ - name - }) => name).filter(type => !(hiddenBlockTypes !== null && hiddenBlockTypes !== void 0 ? hiddenBlockTypes : []).includes(type)); - const titleId = 'editor-block-manager__category-title-' + instanceId; - const isAllChecked = checkedBlockNames.length === filteredBlockTypes.length; - const isIndeterminate = !isAllChecked && checkedBlockNames.length > 0; - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { - role: "group", - "aria-labelledby": titleId, - className: "editor-block-manager__category", - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.CheckboxControl, { - __nextHasNoMarginBottom: true, - checked: isAllChecked, - onChange: toggleAllVisible, - className: "editor-block-manager__category-title", - indeterminate: isIndeterminate, - label: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { - id: titleId, - children: title - }) - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(checklist, { - blockTypes: filteredBlockTypes, - value: checkedBlockNames, - onItemChange: toggleVisible - })] + }, [_allowedBlockTypes, blockTypes]); + const filteredBlockTypes = allowedBlockTypes.filter(blockType => (0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType, 'inserter', true) && (!blockType.parent || blockType.parent.includes('core/post-content'))); + + // Some hidden blocks become unregistered + // by removing for instance the plugin that registered them, yet + // they're still remain as hidden by the user's action. + // We consider "hidden", blocks which were hidden and + // are still registered. + const hiddenBlockTypes = _hiddenBlockTypes.filter(hiddenBlock => { + return filteredBlockTypes.some(registeredBlock => registeredBlock.name === hiddenBlock); }); -} -/* harmony default export */ const block_manager_category = (BlockManagerCategory); - -;// ./node_modules/@wordpress/editor/build-module/components/block-manager/index.js -/** - * WordPress dependencies - */ - - - - - - - - - -/** - * Internal dependencies - */ - - - - - -function BlockManager() { - const debouncedSpeak = (0,external_wp_compose_namespaceObject.useDebounce)(external_wp_a11y_namespaceObject.speak, 500); - const [search, setSearch] = (0,external_wp_element_namespaceObject.useState)(''); - const { - showBlockTypes - } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store_store)); - const { - blockTypes, - categories, - hasBlockSupport, - isMatchingSearchTerm, - numberOfHiddenBlocks - } = (0,external_wp_data_namespaceObject.useSelect)(select => { - var _select$get; - // Some hidden blocks become unregistered - // by removing for instance the plugin that registered them, yet - // they're still remain as hidden by the user's action. - // We consider "hidden", blocks which were hidden and - // are still registered. - const _blockTypes = select(external_wp_blocks_namespaceObject.store).getBlockTypes(); - const hiddenBlockTypes = ((_select$get = select(external_wp_preferences_namespaceObject.store).get('core', 'hiddenBlockTypes')) !== null && _select$get !== void 0 ? _select$get : []).filter(hiddenBlock => { - return _blockTypes.some(registeredBlock => registeredBlock.name === hiddenBlock); - }); - return { - blockTypes: _blockTypes, - categories: select(external_wp_blocks_namespaceObject.store).getCategories(), - hasBlockSupport: select(external_wp_blocks_namespaceObject.store).hasBlockSupport, - isMatchingSearchTerm: select(external_wp_blocks_namespaceObject.store).isMatchingSearchTerm, - numberOfHiddenBlocks: Array.isArray(hiddenBlockTypes) && hiddenBlockTypes.length - }; - }, []); - function enableAllBlockTypes(newBlockTypes) { - const blockNames = newBlockTypes.map(({ - name - }) => name); - showBlockTypes(blockNames); - } - const filteredBlockTypes = blockTypes.filter(blockType => hasBlockSupport(blockType, 'inserter', true) && (!search || isMatchingSearchTerm(blockType, search)) && (!blockType.parent || blockType.parent.includes('core/post-content'))); - - // Announce search results on change - (0,external_wp_element_namespaceObject.useEffect)(() => { - if (!search) { - return; + const selectedBlockTypes = filteredBlockTypes.filter(blockType => !hiddenBlockTypes.includes(blockType.name)); + const onChangeSelectedBlockTypes = newSelectedBlockTypes => { + if (selectedBlockTypes.length > newSelectedBlockTypes.length) { + const blockTypesToHide = selectedBlockTypes.filter(blockType => !newSelectedBlockTypes.find(({ + name + }) => name === blockType.name)); + hideBlockTypes(blockTypesToHide.map(({ + name + }) => name)); + } else if (selectedBlockTypes.length < newSelectedBlockTypes.length) { + const blockTypesToShow = newSelectedBlockTypes.filter(blockType => !selectedBlockTypes.find(({ + name + }) => name === blockType.name)); + showBlockTypes(blockTypesToShow.map(({ + name + }) => name)); } - const count = filteredBlockTypes.length; - const resultsFoundMessage = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %d: number of results. */ - (0,external_wp_i18n_namespaceObject._n)('%d result found.', '%d results found.', count), count); - debouncedSpeak(resultsFoundMessage); - }, [filteredBlockTypes?.length, search, debouncedSpeak]); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { - className: "editor-block-manager__content", - children: [!!numberOfHiddenBlocks && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { - className: "editor-block-manager__disabled-blocks-count", - children: [(0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %d: number of blocks. */ - (0,external_wp_i18n_namespaceObject._n)('%d block is hidden.', '%d blocks are hidden.', numberOfHiddenBlocks), numberOfHiddenBlocks), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - __next40pxDefaultSize: true, - variant: "link", - onClick: () => enableAllBlockTypes(filteredBlockTypes), - children: (0,external_wp_i18n_namespaceObject.__)('Reset') - })] - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SearchControl, { - __nextHasNoMarginBottom: true, - label: (0,external_wp_i18n_namespaceObject.__)('Search for a block'), - placeholder: (0,external_wp_i18n_namespaceObject.__)('Search for a block'), - value: search, - onChange: nextSearch => setSearch(nextSearch), - className: "editor-block-manager__search" - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { - tabIndex: "0", - role: "region", - "aria-label": (0,external_wp_i18n_namespaceObject.__)('Available block types'), - className: "editor-block-manager__results", - children: [filteredBlockTypes.length === 0 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { - className: "editor-block-manager__no-results", - children: (0,external_wp_i18n_namespaceObject.__)('No blocks found.') - }), categories.map(category => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_manager_category, { - title: category.title, - blockTypes: filteredBlockTypes.filter(blockType => blockType.category === category.slug) - }, category.slug)), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_manager_category, { - title: (0,external_wp_i18n_namespaceObject.__)('Uncategorized'), - blockTypes: filteredBlockTypes.filter(({ - category - }) => !category) - })] - })] + }; + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockManager, { + blockTypes: filteredBlockTypes, + selectedBlockTypes: selectedBlockTypes, + onChange: onChangeSelectedBlockTypes }); } ;// ./node_modules/@wordpress/editor/build-module/components/preferences-modal/index.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -29700,9 +33620,6 @@ function BlockManager() { - - - const { PreferencesModal, PreferencesModalTabs, @@ -29753,7 +33670,6 @@ function PreferencesModalContents({ const { set: setPreference } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_preferences_namespaceObject.store); - const hasStarterPatterns = !!useStartPatterns().length; const sections = (0,external_wp_element_namespaceObject.useMemo)(() => [{ name: 'general', tabLabel: (0,external_wp_i18n_namespaceObject.__)('General'), @@ -29775,7 +33691,7 @@ function PreferencesModalContents({ featureName: "allowRightClickOverrides", help: (0,external_wp_i18n_namespaceObject.__)('Allows contextual List View menus via right-click, overriding browser defaults.'), label: (0,external_wp_i18n_namespaceObject.__)('Allow right-click contextual menus') - }), hasStarterPatterns && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreferenceToggleControl, { + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreferenceToggleControl, { scope: "core", featureName: "enableChoosePatternModal", help: (0,external_wp_i18n_namespaceObject.__)('Shows starter patterns when creating a new page.'), @@ -29785,35 +33701,35 @@ function PreferencesModalContents({ title: (0,external_wp_i18n_namespaceObject.__)('Document settings'), description: (0,external_wp_i18n_namespaceObject.__)('Select what settings are shown in the document panel.'), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(enable_plugin_document_setting_panel.Slot, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_taxonomies, { - taxonomyWrapper: (content, taxonomy) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(enable_panel, { + taxonomyWrapper: (content, taxonomy) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EnablePanelOption, { label: taxonomy.labels.menu_name, panelName: `taxonomy-panel-${taxonomy.slug}` }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_featured_image_check, { - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(enable_panel, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EnablePanelOption, { label: (0,external_wp_i18n_namespaceObject.__)('Featured image'), panelName: "featured-image" }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_excerpt_check, { - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(enable_panel, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EnablePanelOption, { label: (0,external_wp_i18n_namespaceObject.__)('Excerpt'), panelName: "post-excerpt" }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_type_support_check, { supportKeys: ['comments', 'trackbacks'], - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(enable_panel, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EnablePanelOption, { label: (0,external_wp_i18n_namespaceObject.__)('Discussion'), panelName: "discussion-panel" }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(page_attributes_check, { - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(enable_panel, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EnablePanelOption, { label: (0,external_wp_i18n_namespaceObject.__)('Page attributes'), panelName: "page-attributes" }) })] }), isLargeViewport && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreferencesModalSection, { title: (0,external_wp_i18n_namespaceObject.__)('Publishing'), - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(enable_publish_sidebar, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EnablePublishSidebarOption, { help: (0,external_wp_i18n_namespaceObject.__)('Review settings, such as visibility and tags.'), label: (0,external_wp_i18n_namespaceObject.__)('Enable pre-publish checks') }) @@ -29858,7 +33774,7 @@ function PreferencesModalContents({ children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreferenceToggleControl, { scope: "core", featureName: "keepCaretInsideBlock", - help: (0,external_wp_i18n_namespaceObject.__)('Keeps the text cursor within the block boundaries, aiding users with screen readers by preventing unintentional cursor movement outside the block.'), + help: (0,external_wp_i18n_namespaceObject.__)('Keeps the text cursor within blocks while navigating with arrow keys, preventing it from moving to other blocks and enhancing accessibility for keyboard users.'), label: (0,external_wp_i18n_namespaceObject.__)('Contain text cursor inside block') }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreferencesModalSection, { @@ -29886,7 +33802,7 @@ function PreferencesModalContents({ }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreferencesModalSection, { title: (0,external_wp_i18n_namespaceObject.__)('Manage block visibility'), description: (0,external_wp_i18n_namespaceObject.__)("Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later."), - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockManager, {}) + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockVisibility, {}) })] }) }, window.__experimentalMediaProcessing && { @@ -29909,13 +33825,78 @@ function PreferencesModalContents({ })] }) }) - }].filter(Boolean), [showBlockBreadcrumbsOption, extraSections, setIsInserterOpened, setIsListViewOpened, setPreference, isLargeViewport, hasStarterPatterns]); + }].filter(Boolean), [showBlockBreadcrumbsOption, extraSections, setIsInserterOpened, setIsListViewOpened, setPreference, isLargeViewport]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreferencesModalTabs, { sections: sections }); } +;// ./node_modules/@wordpress/editor/build-module/components/post-fields/index.js +/* wp:polyfill */ +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + +function usePostFields({ + postType +}) { + const { + registerPostTypeSchema + } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store_store)); + (0,external_wp_element_namespaceObject.useEffect)(() => { + registerPostTypeSchema(postType); + }, [registerPostTypeSchema, postType]); + const { + defaultFields + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getEntityFields + } = unlock(select(store_store)); + return { + defaultFields: getEntityFields('postType', postType) + }; + }, [postType]); + const { + records: authors, + isResolving: isLoadingAuthors + } = (0,external_wp_coreData_namespaceObject.useEntityRecords)('root', 'user', { + per_page: -1 + }); + const fields = (0,external_wp_element_namespaceObject.useMemo)(() => defaultFields.map(field => { + if (field.id === 'author') { + return { + ...field, + elements: authors?.map(({ + id, + name + }) => ({ + value: id, + label: name + })) + }; + } + return field; + }), [authors, defaultFields]); + return { + isLoading: isLoadingAuthors, + fields + }; +} + +/** + * Hook to get the fields for a post (BasePost or BasePostWithEmbeddedAuthor). + */ +/* harmony default export */ const post_fields = (usePostFields); + ;// ./node_modules/@wordpress/editor/build-module/bindings/pattern-overrides.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -29938,7 +33919,7 @@ const CONTENT = 'content'; for (const attributeName of Object.keys(bindings)) { const overridableValue = patternOverridesContent?.[currentBlockAttributes?.metadata?.name]?.[attributeName]; - // If it has not been overriden, return the original value. + // If it has not been overridden, return the original value. // Check undefined because empty string is a valid value. if (overridableValue === undefined) { overridesValues[attributeName] = currentBlockAttributes[attributeName]; @@ -30010,6 +33991,7 @@ const CONTENT = 'content'; }); ;// ./node_modules/@wordpress/editor/build-module/bindings/post-meta.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -30125,10 +34107,9 @@ function getPostMetaFields(select, context) { if (context?.query || context?.queryId) { return false; } - const postType = context?.postType || select(store_store).getCurrentPostType(); - // Check that editing is happening in the post editor and not a template. - if (postType === 'wp_template') { + // Lock editing when `postType` is not defined. + if (!context?.postType) { return false; } const fieldValue = getPostMetaFields(select, context)?.[args.key]?.value; @@ -30212,6 +34193,8 @@ function registerCoreBlockBindingsSources() { + + const { store: interfaceStore, ...remainingInterfaceApis @@ -30219,6 +34202,8 @@ const { const privateApis = {}; lock(privateApis, { CreateTemplatePartModal: CreateTemplatePartModal, + patternTitleField: pattern_title, + templateTitleField: template_title, BackButton: back_button, EntitiesSavedStatesExtensible: EntitiesSavedStatesExtensible, Editor: editor, @@ -30229,10 +34214,12 @@ lock(privateApis, { PostCardPanel: PostCardPanel, PreferencesModal: EditorPreferencesModal, usePostActions: usePostActions, + usePostFields: post_fields, ToolsMoreMenuGroup: tools_more_menu_group, ViewMoreMenuGroup: view_more_menu_group, ResizableEditor: resizable_editor, registerCoreBlockBindingsSources: registerCoreBlockBindingsSources, + getTemplateInfo: getTemplateInfo, // This is a temporary private API while we're updating the site editor to use EditorProvider. interfaceStore, ...remainingInterfaceApis @@ -30252,6 +34239,7 @@ lock(privateApis, { /** * @typedef {import('@wordpress/dataviews').Action} Action + * @typedef {import('@wordpress/dataviews').Field} Field */ /** @@ -30289,6 +34277,40 @@ function api_unregisterEntityAction(kind, name, actionId) { if (false) {} } +/** + * Registers a new DataViews field. + * + * This is an experimental API and is subject to change. + * it's only available in the Gutenberg plugin for now. + * + * @param {string} kind Entity kind. + * @param {string} name Entity name. + * @param {Field} config Field configuration. + */ +function api_registerEntityField(kind, name, config) { + const { + registerEntityField: _registerEntityField + } = unlock((0,external_wp_data_namespaceObject.dispatch)(store_store)); + if (false) {} +} + +/** + * Unregisters a DataViews field. + * + * This is an experimental API and is subject to change. + * it's only available in the Gutenberg plugin for now. + * + * @param {string} kind Entity kind. + * @param {string} name Entity name. + * @param {string} fieldId Field ID. + */ +function api_unregisterEntityField(kind, name, fieldId) { + const { + unregisterEntityField: _unregisterEntityField + } = unlock((0,external_wp_data_namespaceObject.dispatch)(store_store)); + if (false) {} +} + ;// ./node_modules/@wordpress/editor/build-module/index.js /** * Internal dependencies diff --git a/wp-includes/js/dist/editor.min.js b/wp-includes/js/dist/editor.min.js index 002df5ac38..be7adfaab2 100644 --- a/wp-includes/js/dist/editor.min.js +++ b/wp-includes/js/dist/editor.min.js @@ -4,11 +4,11 @@ autosize 4.0.4 license: MIT http://www.jacklmoore.com/autosize -*/o=[e,t],s=function(e,t){"use strict";var s,o,n="function"==typeof Map?new Map:(s=[],o=[],{has:function(e){return s.indexOf(e)>-1},get:function(e){return o[s.indexOf(e)]},set:function(e,t){-1===s.indexOf(e)&&(s.push(e),o.push(t))},delete:function(e){var t=s.indexOf(e);t>-1&&(s.splice(t,1),o.splice(t,1))}}),i=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(e){i=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}function r(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!n.has(e)){var t=null,s=null,o=null,r=function(){e.clientWidth!==s&&p()},a=function(t){window.removeEventListener("resize",r,!1),e.removeEventListener("input",p,!1),e.removeEventListener("keyup",p,!1),e.removeEventListener("autosize:destroy",a,!1),e.removeEventListener("autosize:update",p,!1),Object.keys(t).forEach((function(s){e.style[s]=t[s]})),n.delete(e)}.bind(e,{height:e.style.height,resize:e.style.resize,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",a,!1),"onpropertychange"in e&&"oninput"in e&&e.addEventListener("keyup",p,!1),window.addEventListener("resize",r,!1),e.addEventListener("input",p,!1),e.addEventListener("autosize:update",p,!1),e.style.overflowX="hidden",e.style.wordWrap="break-word",n.set(e,{destroy:a,update:p}),l()}function l(){var s=window.getComputedStyle(e,null);"vertical"===s.resize?e.style.resize="none":"both"===s.resize&&(e.style.resize="horizontal"),t="content-box"===s.boxSizing?-(parseFloat(s.paddingTop)+parseFloat(s.paddingBottom)):parseFloat(s.borderTopWidth)+parseFloat(s.borderBottomWidth),isNaN(t)&&(t=0),p()}function c(t){var s=e.style.width;e.style.width="0px",e.offsetWidth,e.style.width=s,e.style.overflowY=t}function d(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push({node:e.parentNode,scrollTop:e.parentNode.scrollTop}),e=e.parentNode;return t}function u(){if(0!==e.scrollHeight){var o=d(e),n=document.documentElement&&document.documentElement.scrollTop;e.style.height="",e.style.height=e.scrollHeight+t+"px",s=e.clientWidth,o.forEach((function(e){e.node.scrollTop=e.scrollTop})),n&&(document.documentElement.scrollTop=n)}}function p(){u();var t=Math.round(parseFloat(e.style.height)),s=window.getComputedStyle(e,null),n="content-box"===s.boxSizing?Math.round(parseFloat(s.height)):e.offsetHeight;if(n{e.exports=function(e,t,s){return((s=window.getComputedStyle)?s(e):e.currentStyle)[t.replace(/-(\w)/gi,(function(e,t){return t.toUpperCase()}))]}},66:e=>{"use strict";var t=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===s}(e)}(e)};var s="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function o(e,t){return!1!==t.clone&&t.isMergeableObject(e)?l((s=e,Array.isArray(s)?[]:{}),e,t):e;var s}function n(e,t,s){return e.concat(t).map((function(e){return o(e,s)}))}function i(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return Object.propertyIsEnumerable.call(e,t)})):[]}(e))}function r(e,t){try{return t in e}catch(e){return!1}}function a(e,t,s){var n={};return s.isMergeableObject(e)&&i(e).forEach((function(t){n[t]=o(e[t],s)})),i(t).forEach((function(i){(function(e,t){return r(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,i)||(r(e,i)&&s.isMergeableObject(t[i])?n[i]=function(e,t){if(!t.customMerge)return l;var s=t.customMerge(e);return"function"==typeof s?s:l}(i,s)(e[i],t[i],s):n[i]=o(t[i],s))})),n}function l(e,s,i){(i=i||{}).arrayMerge=i.arrayMerge||n,i.isMergeableObject=i.isMergeableObject||t,i.cloneUnlessOtherwiseSpecified=o;var r=Array.isArray(s);return r===Array.isArray(e)?r?i.arrayMerge(e,s,i):a(e,s,i):o(s,i)}l.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,s){return l(e,s,t)}),{})};var c=l;e.exports=c},5215:e=>{"use strict";e.exports=function e(t,s){if(t===s)return!0;if(t&&s&&"object"==typeof t&&"object"==typeof s){if(t.constructor!==s.constructor)return!1;var o,n,i;if(Array.isArray(t)){if((o=t.length)!=s.length)return!1;for(n=o;0!=n--;)if(!e(t[n],s[n]))return!1;return!0}if(t.constructor===RegExp)return t.source===s.source&&t.flags===s.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===s.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===s.toString();if((o=(i=Object.keys(t)).length)!==Object.keys(s).length)return!1;for(n=o;0!=n--;)if(!Object.prototype.hasOwnProperty.call(s,i[n]))return!1;for(n=o;0!=n--;){var r=i[n];if(!e(t[r],s[r]))return!1}return!0}return t!=t&&s!=s}},461:(e,t,s)=>{var o=s(6109);e.exports=function(e){var t=o(e,"line-height"),s=parseFloat(t,10);if(t===s+""){var n=e.style.lineHeight;e.style.lineHeight=t+"em",t=o(e,"line-height"),s=parseFloat(t,10),n?e.style.lineHeight=n:delete e.style.lineHeight}if(-1!==t.indexOf("pt")?(s*=4,s/=3):-1!==t.indexOf("mm")?(s*=96,s/=25.4):-1!==t.indexOf("cm")?(s*=96,s/=2.54):-1!==t.indexOf("in")?s*=96:-1!==t.indexOf("pc")&&(s*=16),s=Math.round(s),"normal"===t){var i=e.nodeName,r=document.createElement(i);r.innerHTML=" ","TEXTAREA"===i.toUpperCase()&&r.setAttribute("rows","1");var a=o(e,"font-size");r.style.fontSize=a,r.style.padding="0px",r.style.border="0px";var l=document.body;l.appendChild(r),s=r.offsetHeight,l.removeChild(r)}return s}},628:(e,t,s)=>{"use strict";var o=s(4067);function n(){}function i(){}i.resetWarningCache=n,e.exports=function(){function e(e,t,s,n,i,r){if(r!==o){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var s={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:n};return s.PropTypes=s,s}},5826:(e,t,s)=>{e.exports=s(628)()},4067:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},4462:function(e,t,s){"use strict";var o,n=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var s in t)t.hasOwnProperty(s)&&(e[s]=t[s])},function(e,t){function s(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(s.prototype=t.prototype,new s)}),i=this&&this.__assign||Object.assign||function(e){for(var t,s=1,o=arguments.length;s{"use strict";var o=s(4462);t.A=o.TextareaAutosize},9681:e=>{var t={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ả:"A",Ạ:"A",Ẩ:"A",Ẫ:"A",Ậ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ẻ:"E",Ẽ:"E",Ẹ:"E",Ể:"E",Ễ:"E",Ệ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ỉ:"I",Ị:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ỏ:"O",Ọ:"O",Ổ:"O",Ỗ:"O",Ộ:"O",Ờ:"O",Ở:"O",Ỡ:"O",Ớ:"O",Ợ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ủ:"U",Ụ:"U",Ử:"U",Ữ:"U",Ự:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ả:"a",ạ:"a",ẩ:"a",ẫ:"a",ậ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ẻ:"e",ẽ:"e",ẹ:"e",ể:"e",ễ:"e",ệ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ỉ:"i",ị:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ỏ:"o",ọ:"o",ổ:"o",ỗ:"o",ộ:"o",ờ:"o",ở:"o",ỡ:"o",ớ:"o",ợ:"o",ù:"u",ú:"u",û:"u",ü:"u",ủ:"u",ụ:"u",ử:"u",ữ:"u",ự:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"C",ċ:"c",Č:"C",č:"c",C̆:"C",c̆:"c",Ď:"D",ď:"d",Đ:"D",đ:"d",Ē:"E",ē:"e",Ĕ:"E",ĕ:"e",Ė:"E",ė:"e",Ę:"E",ę:"e",Ě:"E",ě:"e",Ĝ:"G",Ǵ:"G",ĝ:"g",ǵ:"g",Ğ:"G",ğ:"g",Ġ:"G",ġ:"g",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",Ḫ:"H",ḫ:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",IJ:"IJ",ij:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",Ḱ:"K",ḱ:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",Ḿ:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ʼn:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",Ẃ:"W",ẃ:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",Ứ:"U",ứ:"u",Ṹ:"U",ṹ:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",Ṕ:"P",ṕ:"p",Ṥ:"S",ṥ:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",Ồ:"O",ồ:"o",Ṑ:"O",ṑ:"o",Ừ:"U",ừ:"u",Ẁ:"W",ẁ:"w",Ỳ:"Y",ỳ:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",Ṧ:"S",ṧ:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",Ḑ:"D",ḑ:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z",й:"и",Й:"И",ё:"е",Ё:"Е"},s=Object.keys(t).join("|"),o=new RegExp(s,"g"),n=new RegExp(s,"");function i(e){return t[e]}var r=function(e){return e.replace(o,i)};e.exports=r,e.exports.has=function(e){return!!e.match(n)},e.exports.remove=r},1609:e=>{"use strict";e.exports=window.React}},t={};function s(o){var n=t[o];if(void 0!==n)return n.exports;var i=t[o]={exports:{}};return e[o].call(i.exports,i,i.exports,s),i.exports}s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.d=(e,t)=>{for(var o in t)s.o(t,o)&&!s.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};(()=>{"use strict";s.r(o),s.d(o,{AlignmentToolbar:()=>Kh,Autocomplete:()=>Yh,AutosaveMonitor:()=>Xr,BlockAlignmentToolbar:()=>qh,BlockControls:()=>Qh,BlockEdit:()=>Xh,BlockEditorKeyboardShortcuts:()=>Jh,BlockFormatControls:()=>em,BlockIcon:()=>tm,BlockInspector:()=>sm,BlockList:()=>om,BlockMover:()=>nm,BlockNavigationDropdown:()=>im,BlockSelectionClearer:()=>rm,BlockSettingsMenu:()=>am,BlockTitle:()=>lm,BlockToolbar:()=>cm,CharacterCount:()=>mp,ColorPalette:()=>dm,ContrastChecker:()=>um,CopyHandler:()=>pm,DefaultBlockAppender:()=>hm,DocumentBar:()=>na,DocumentOutline:()=>ma,DocumentOutlineCheck:()=>ga,EditorHistoryRedo:()=>ya,EditorHistoryUndo:()=>xa,EditorKeyboardShortcuts:()=>qr,EditorKeyboardShortcutsRegister:()=>_a,EditorNotices:()=>wa,EditorProvider:()=>Uh,EditorSnackbars:()=>ka,EntitiesSavedStates:()=>Aa,ErrorBoundary:()=>La,FontSizePicker:()=>mm,InnerBlocks:()=>_m,Inserter:()=>gm,InspectorAdvancedControls:()=>fm,InspectorControls:()=>bm,LocalAutosaveMonitor:()=>Ua,MediaPlaceholder:()=>km,MediaUpload:()=>Pm,MediaUploadCheck:()=>Cm,MultiSelectScrollIntoView:()=>jm,NavigableToolbar:()=>Em,ObserveTyping:()=>Tm,PageAttributesCheck:()=>Ha,PageAttributesOrder:()=>Wa,PageAttributesPanel:()=>ll,PageAttributesParent:()=>il,PageTemplate:()=>xl,PanelColorSettings:()=>ym,PlainText:()=>xm,PluginBlockSettingsMenuItem:()=>Il,PluginDocumentSettingPanel:()=>Bl,PluginMoreMenuItem:()=>Nl,PluginPostPublishPanel:()=>Ml,PluginPostStatusInfo:()=>Vl,PluginPrePublishPanel:()=>Gl,PluginPreviewMenuItem:()=>$l,PluginSidebar:()=>Wl,PluginSidebarMoreMenuItem:()=>Zl,PostAuthor:()=>rc,PostAuthorCheck:()=>ac,PostAuthorPanel:()=>cc,PostComments:()=>uc,PostDiscussionPanel:()=>_c,PostExcerpt:()=>fc,PostExcerptCheck:()=>bc,PostExcerptPanel:()=>Pc,PostFeaturedImage:()=>Mc,PostFeaturedImageCheck:()=>Tc,PostFeaturedImagePanel:()=>Lc,PostFormat:()=>zc,PostFormatCheck:()=>Fc,PostLastRevision:()=>$c,PostLastRevisionCheck:()=>Uc,PostLastRevisionPanel:()=>Wc,PostLockedModal:()=>Zc,PostPendingStatus:()=>Kc,PostPendingStatusCheck:()=>Yc,PostPingbacks:()=>pc,PostPreviewButton:()=>qc,PostPublishButton:()=>ed,PostPublishButtonLabel:()=>Qc,PostPublishPanel:()=>gu,PostSavedState:()=>Bu,PostSchedule:()=>wd,PostScheduleCheck:()=>Iu,PostScheduleLabel:()=>kd,PostSchedulePanel:()=>Au,PostSlug:()=>Mu,PostSlugCheck:()=>Du,PostSticky:()=>Pu,PostStickyCheck:()=>ku,PostSwitchToDraftButton:()=>Ou,PostSyncStatus:()=>Lu,PostTaxonomies:()=>Vu,PostTaxonomiesCheck:()=>zu,PostTaxonomiesFlatTermSelector:()=>Od,PostTaxonomiesHierarchicalTermSelector:()=>Zd,PostTaxonomiesPanel:()=>Hu,PostTemplatePanel:()=>ec,PostTextEditor:()=>$u,PostTitle:()=>Qu,PostTitleRaw:()=>Xu,PostTrash:()=>ep,PostTrashCheck:()=>Ju,PostTypeSupportCheck:()=>Ga,PostURL:()=>sp,PostURLCheck:()=>op,PostURLLabel:()=>np,PostURLPanel:()=>rp,PostVisibility:()=>od,PostVisibilityCheck:()=>lp,PostVisibilityLabel:()=>id,RichText:()=>Zh,RichTextShortcut:()=>vm,RichTextToolbarButton:()=>wm,ServerSideRender:()=>Gh(),SkipToSelectedBlock:()=>Bm,TableOfContents:()=>_p,TextEditorGlobalKeyboardShortcuts:()=>Wm,ThemeSupportCheck:()=>Ec,TimeToRead:()=>hp,URLInput:()=>Im,URLInputButton:()=>Nm,URLPopover:()=>Am,UnsavedChangesWarning:()=>fp,VisualEditorGlobalKeyboardShortcuts:()=>$m,Warning:()=>Dm,WordCount:()=>up,WritingFlow:()=>Rm,__unstableRichTextInputEvent:()=>Sm,cleanForSlug:()=>Zm,createCustomColorsHOC:()=>Mm,getColorClassName:()=>Om,getColorObjectByAttributeValues:()=>Lm,getColorObjectByColorValue:()=>Fm,getFontSize:()=>Vm,getFontSizeClass:()=>zm,getTemplatePartIcon:()=>$,mediaUpload:()=>Pp,privateApis:()=>cf,registerEntityAction:()=>df,store:()=>Wi,storeConfig:()=>$i,transformStyles:()=>m.transformStyles,unregisterEntityAction:()=>uf,useEntitiesSavedStatesIsDirty:()=>Ia,usePostScheduleLabel:()=>Pd,usePostURLLabel:()=>ip,usePostVisibilityLabel:()=>rd,userAutocompleter:()=>Yi,withColorContext:()=>Um,withColors:()=>Hm,withFontSizes:()=>Gm});var e={};s.r(e),s.d(e,{__experimentalGetDefaultTemplatePartAreas:()=>is,__experimentalGetDefaultTemplateType:()=>rs,__experimentalGetDefaultTemplateTypes:()=>ns,__experimentalGetTemplateInfo:()=>as,__unstableIsEditorReady:()=>Qe,canInsertBlockType:()=>es,canUserUseUnfilteredHTML:()=>Ue,didPostSaveRequestFail:()=>Pe,didPostSaveRequestSucceed:()=>ke,getActivePostLock:()=>ze,getAdjacentBlockClientId:()=>Pt,getAutosaveAttribute:()=>de,getBlock:()=>dt,getBlockAttributes:()=>ct,getBlockCount:()=>_t,getBlockHierarchyRootClientId:()=>kt,getBlockIndex:()=>Ft,getBlockInsertionPoint:()=>Kt,getBlockListSettings:()=>os,getBlockMode:()=>Wt,getBlockName:()=>at,getBlockOrder:()=>Lt,getBlockRootClientId:()=>St,getBlockSelectionEnd:()=>bt,getBlockSelectionStart:()=>ft,getBlocks:()=>ut,getBlocksByClientId:()=>gt,getClientIdsOfDescendants:()=>pt,getClientIdsWithDescendants:()=>ht,getCurrentPost:()=>ee,getCurrentPostAttribute:()=>ae,getCurrentPostId:()=>se,getCurrentPostLastRevisionId:()=>ie,getCurrentPostRevisionsCount:()=>ne,getCurrentPostType:()=>te,getCurrentTemplateId:()=>oe,getDeviceType:()=>et,getEditedPostAttribute:()=>ce,getEditedPostContent:()=>Be,getEditedPostPreviewLink:()=>Ee,getEditedPostSlug:()=>De,getEditedPostVisibility:()=>ue,getEditorBlocks:()=>Ge,getEditorMode:()=>ot,getEditorSelection:()=>qe,getEditorSelectionEnd:()=>Ke,getEditorSelectionStart:()=>Ye,getEditorSettings:()=>Xe,getFirstMultiSelectedBlockClientId:()=>It,getGlobalBlockCount:()=>mt,getInserterItems:()=>ts,getLastMultiSelectedBlockClientId:()=>Nt,getMultiSelectedBlockClientIds:()=>Tt,getMultiSelectedBlocks:()=>Bt,getMultiSelectedBlocksEndClientId:()=>Ot,getMultiSelectedBlocksStartClientId:()=>Mt,getNextBlockClientId:()=>jt,getPermalink:()=>Ae,getPermalinkParts:()=>Re,getPostEdits:()=>re,getPostLockUser:()=>Ve,getPostTypeLabel:()=>ls,getPreviousBlockClientId:()=>Ct,getRenderingMode:()=>Je,getSelectedBlock:()=>wt,getSelectedBlockClientId:()=>vt,getSelectedBlockCount:()=>yt,getSelectedBlocksInitialCaretPosition:()=>Et,getStateBeforeOptimisticTransaction:()=>nt,getSuggestedPostFormat:()=>Te,getTemplate:()=>Xt,getTemplateLock:()=>Jt,hasChangedContent:()=>q,hasEditorRedo:()=>Y,hasEditorUndo:()=>Z,hasInserterItems:()=>ss,hasMultiSelection:()=>Ht,hasNonPostEntityChanges:()=>X,hasSelectedBlock:()=>xt,hasSelectedInnerBlock:()=>zt,inSomeHistory:()=>it,isAncestorMultiSelected:()=>Rt,isAutosavingPost:()=>Ce,isBlockInsertionPointVisible:()=>qt,isBlockMultiSelected:()=>Dt,isBlockSelected:()=>Vt,isBlockValid:()=>lt,isBlockWithinSelection:()=>Ut,isCaretWithinFormattedText:()=>Yt,isCleanNewPost:()=>J,isCurrentPostPending:()=>pe,isCurrentPostPublished:()=>he,isCurrentPostScheduled:()=>me,isDeletingPost:()=>ve,isEditedPostAutosaveable:()=>be,isEditedPostBeingScheduled:()=>ye,isEditedPostDateFloating:()=>xe,isEditedPostDirty:()=>Q,isEditedPostEmpty:()=>fe,isEditedPostNew:()=>K,isEditedPostPublishable:()=>ge,isEditedPostSaveable:()=>_e,isEditorPanelEnabled:()=>We,isEditorPanelOpened:()=>Ze,isEditorPanelRemoved:()=>$e,isFirstMultiSelectedBlock:()=>At,isInserterOpened:()=>st,isListViewOpened:()=>tt,isMultiSelecting:()=>Gt,isPermalinkEditable:()=>Ne,isPostAutosavingLocked:()=>Le,isPostLockTakeover:()=>Fe,isPostLocked:()=>Me,isPostSavingLocked:()=>Oe,isPreviewingPost:()=>je,isPublishSidebarEnabled:()=>He,isPublishSidebarOpened:()=>cs,isPublishingPost:()=>Ie,isSavingNonPostEntityChanges:()=>Se,isSavingPost:()=>we,isSelectionEnabled:()=>$t,isTyping:()=>Zt,isValidTemplate:()=>Qt});var t={};s.r(t),s.d(t,{__experimentalTearDownEditor:()=>bs,__unstableSaveForPreview:()=>Es,autosave:()=>js,clearSelectedBlock:()=>lo,closePublishSidebar:()=>Qs,createUndoLevel:()=>Is,disablePublishSidebar:()=>Ds,editPost:()=>Ss,enablePublishSidebar:()=>As,enterFormattedText:()=>Eo,exitFormattedText:()=>To,hideInsertionPoint:()=>yo,insertBlock:()=>_o,insertBlocks:()=>fo,insertDefaultBlock:()=>Bo,lockPostAutosaving:()=>Os,lockPostSaving:()=>Rs,mergeBlocks:()=>wo,moveBlockToPosition:()=>go,moveBlocksDown:()=>ho,moveBlocksUp:()=>mo,multiSelect:()=>ao,openPublishSidebar:()=>qs,receiveBlocks:()=>to,redo:()=>Ts,refreshPost:()=>Ps,removeBlock:()=>ko,removeBlocks:()=>So,removeEditorPanel:()=>$s,replaceBlock:()=>po,replaceBlocks:()=>uo,resetBlocks:()=>eo,resetEditorBlocks:()=>Fs,resetPost:()=>ys,savePost:()=>ks,selectBlock:()=>no,setDeviceType:()=>Us,setEditedPost:()=>ws,setIsInserterOpened:()=>Ws,setIsListViewOpened:()=>Zs,setRenderingMode:()=>zs,setTemplateValidity:()=>xo,setupEditor:()=>fs,setupEditorState:()=>vs,showInsertionPoint:()=>bo,startMultiSelect:()=>io,startTyping:()=>Co,stopMultiSelect:()=>ro,stopTyping:()=>jo,switchEditorMode:()=>Ks,synchronizeTemplate:()=>vo,toggleBlockMode:()=>Po,toggleDistractionFree:()=>Ys,toggleEditorPanelEnabled:()=>Hs,toggleEditorPanelOpened:()=>Gs,togglePublishSidebar:()=>Xs,toggleSelection:()=>co,trashPost:()=>Cs,undo:()=>Bs,unlockPostAutosaving:()=>Ls,unlockPostSaving:()=>Ms,updateBlock:()=>so,updateBlockAttributes:()=>oo,updateBlockListSettings:()=>Io,updateEditorSettings:()=>Vs,updatePost:()=>xs,updatePostLock:()=>Ns});var n={};s.r(n),s.d(n,{createTemplate:()=>wi,hideBlockTypes:()=>ki,registerEntityAction:()=>fi,registerPostTypeActions:()=>xi,removeTemplates:()=>ji,revertTemplate:()=>Ci,saveDirtyEntities:()=>Pi,setCurrentTemplateId:()=>vi,setIsReady:()=>yi,showBlockTypes:()=>Si,unregisterEntityAction:()=>bi});var i={};s.r(i),s.d(i,{getEntityActions:()=>Ui,getInserterSidebarToggleRef:()=>Li,getInsertionPoint:()=>Mi,getListViewToggleRef:()=>Oi,getPostBlocksByName:()=>Gi,getPostIcon:()=>Vi,hasPostMetaChanges:()=>zi,isEntityReady:()=>Hi});var r={};s.r(r),s.d(r,{closeModal:()=>vr,disableComplementaryArea:()=>mr,enableComplementaryArea:()=>hr,openModal:()=>xr,pinItem:()=>gr,setDefaultComplementaryArea:()=>pr,setFeatureDefaults:()=>yr,setFeatureValue:()=>br,toggleFeature:()=>fr,unpinItem:()=>_r});var a={};s.r(a),s.d(a,{getActiveComplementaryArea:()=>wr,isComplementaryAreaLoading:()=>Sr,isFeatureActive:()=>Pr,isItemPinned:()=>kr,isModalActive:()=>Cr});var l={};s.r(l),s.d(l,{ActionItem:()=>Rr,ComplementaryArea:()=>Hr,ComplementaryAreaMoreMenuItem:()=>Or,FullscreenMode:()=>Gr,InterfaceSkeleton:()=>Kr,NavigableRegion:()=>Wr,PinnedItems:()=>Fr,store:()=>Er});const c=window.wp.data,d=window.wp.coreData,u=window.wp.element,p=window.wp.compose,h=window.wp.hooks,m=window.wp.blockEditor,g={...m.SETTINGS_DEFAULTS,richEditingEnabled:!0,codeEditingEnabled:!0,fontLibraryEnabled:!0,enableCustomFields:void 0,defaultRenderingMode:"post-only"};const _=(0,c.combineReducers)({actions:function(e={},t){var s;switch(t.type){case"REGISTER_ENTITY_ACTION":return{...e,[t.kind]:{...e[t.kind],[t.name]:[...(null!==(s=e[t.kind]?.[t.name])&&void 0!==s?s:[]).filter((e=>e.id!==t.config.id)),t.config]}};case"UNREGISTER_ENTITY_ACTION":var o;return{...e,[t.kind]:{...e[t.kind],[t.name]:(null!==(o=e[t.kind]?.[t.name])&&void 0!==o?o:[]).filter((e=>e.id!==t.actionId))}}}return e},isReady:function(e={},t){return"SET_IS_READY"===t.type?{...e,[t.kind]:{...e[t.kind],[t.name]:!0}}:e}});function f(e){return e&&"object"==typeof e&&"raw"in e?e.raw:e}const b=(0,c.combineReducers)({postId:function(e=null,t){return"SET_EDITED_POST"===t.type?t.postId:e},postType:function(e=null,t){return"SET_EDITED_POST"===t.type?t.postType:e},templateId:function(e=null,t){return"SET_CURRENT_TEMPLATE_ID"===t.type?t.id:e},saving:function(e={},t){switch(t.type){case"REQUEST_POST_UPDATE_START":case"REQUEST_POST_UPDATE_FINISH":return{pending:"REQUEST_POST_UPDATE_START"===t.type,options:t.options||{}}}return e},deleting:function(e={},t){switch(t.type){case"REQUEST_POST_DELETE_START":case"REQUEST_POST_DELETE_FINISH":return{pending:"REQUEST_POST_DELETE_START"===t.type}}return e},postLock:function(e={isLocked:!1},t){return"UPDATE_POST_LOCK"===t.type?t.lock:e},template:function(e={isValid:!0},t){return"SET_TEMPLATE_VALIDITY"===t.type?{...e,isValid:t.isValid}:e},postSavingLock:function(e={},t){switch(t.type){case"LOCK_POST_SAVING":return{...e,[t.lockName]:!0};case"UNLOCK_POST_SAVING":{const{[t.lockName]:s,...o}=e;return o}}return e},editorSettings:function(e=g,t){return"UPDATE_EDITOR_SETTINGS"===t.type?{...e,...t.settings}:e},postAutosavingLock:function(e={},t){switch(t.type){case"LOCK_POST_AUTOSAVING":return{...e,[t.lockName]:!0};case"UNLOCK_POST_AUTOSAVING":{const{[t.lockName]:s,...o}=e;return o}}return e},renderingMode:function(e="post-only",t){return"SET_RENDERING_MODE"===t.type?t.mode:e},deviceType:function(e="Desktop",t){return"SET_DEVICE_TYPE"===t.type?t.deviceType:e},removedPanels:function(e=[],t){if("REMOVE_PANEL"===t.type)if(!e.includes(t.panelName))return[...e,t.panelName];return e},blockInserterPanel:function(e=!1,t){switch(t.type){case"SET_IS_LIST_VIEW_OPENED":return!t.isOpen&&e;case"SET_IS_INSERTER_OPENED":return t.value}return e},inserterSidebarToggleRef:function(e={current:null}){return e},listViewPanel:function(e=!1,t){switch(t.type){case"SET_IS_INSERTER_OPENED":return!t.value&&e;case"SET_IS_LIST_VIEW_OPENED":return t.isOpen}return e},listViewToggleRef:function(e={current:null}){return e},publishSidebarActive:function(e=!1,t){switch(t.type){case"OPEN_PUBLISH_SIDEBAR":return!0;case"CLOSE_PUBLISH_SIDEBAR":return!1;case"TOGGLE_PUBLISH_SIDEBAR":return!e}return e},dataviews:_}),y=window.wp.blocks,x=window.wp.date,v=window.wp.url,w=window.wp.deprecated;var S=s.n(w);const k=window.wp.primitives,P=window.ReactJSXRuntime,C=(0,P.jsx)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,P.jsx)(k.Path,{d:"M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"})}),j=window.wp.preferences,E=new Set(["meta"]),T="SAVE_POST_NOTICE_ID",B="TRASH_POST_NOTICE_ID",I=/%(?:postname|pagename)%/,N=6e4,A=["title","excerpt","content"],D="wp_template",R="wp_template_part",M="wp_block",O="wp_navigation",L="custom",F=["wp_template","wp_template_part"],V=[...F,"wp_block","wp_navigation"],z=(0,P.jsx)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,P.jsx)(k.Path,{d:"M18.5 10.5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"})}),U=(0,P.jsx)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,P.jsx)(k.Path,{fillRule:"evenodd",d:"M18 5.5h-8v8h8.5V6a.5.5 0 00-.5-.5zm-9.5 8h-3V6a.5.5 0 01.5-.5h2.5v8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"})}),H=(0,P.jsx)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,P.jsx)(k.Path,{d:"M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"})}),G=(0,P.jsx)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,P.jsx)(k.Path,{d:"M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-17.6 1L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"})});function $(e){return"header"===e?z:"footer"===e?U:"sidebar"===e?H:G}const W={},Z=(0,c.createRegistrySelector)((e=>()=>e(d.store).hasUndo())),Y=(0,c.createRegistrySelector)((e=>()=>e(d.store).hasRedo()));function K(e){return"auto-draft"===ee(e).status}function q(e){return"content"in re(e)}const Q=(0,c.createRegistrySelector)((e=>t=>{const s=te(t),o=se(t);return e(d.store).hasEditsForEntityRecord("postType",s,o)})),X=(0,c.createRegistrySelector)((e=>t=>{const s=e(d.store).__experimentalGetDirtyEntityRecords(),{type:o,id:n}=ee(t);return s.some((e=>"postType"!==e.kind||e.name!==o||e.key!==n))}));function J(e){return!Q(e)&&K(e)}const ee=(0,c.createRegistrySelector)((e=>t=>{const s=se(t),o=te(t),n=e(d.store).getRawEntityRecord("postType",o,s);return n||W}));function te(e){return e.postType}function se(e){return e.postId}function oe(e){return e.templateId}function ne(e){var t;return null!==(t=ee(e)._links?.["version-history"]?.[0]?.count)&&void 0!==t?t:0}function ie(e){var t;return null!==(t=ee(e)._links?.["predecessor-version"]?.[0]?.id)&&void 0!==t?t:null}const re=(0,c.createRegistrySelector)((e=>t=>{const s=te(t),o=se(t);return e(d.store).getEntityRecordEdits("postType",s,o)||W}));function ae(e,t){switch(t){case"type":return te(e);case"id":return se(e);default:const s=ee(e);if(!s.hasOwnProperty(t))break;return f(s[t])}}const le=(0,c.createSelector)(((e,t)=>{const s=re(e);return s.hasOwnProperty(t)?{...ae(e,t),...s[t]}:ae(e,t)}),((e,t)=>[ae(e,t),re(e)[t]]));function ce(e,t){if("content"===t)return Be(e);const s=re(e);return s.hasOwnProperty(t)?E.has(t)?le(e,t):s[t]:ae(e,t)}const de=(0,c.createRegistrySelector)((e=>(t,s)=>{if(!A.includes(s)&&"preview_link"!==s)return;const o=te(t);if("wp_template"===o)return!1;const n=se(t),i=e(d.store).getCurrentUser()?.id,r=e(d.store).getAutosave(o,n,i);return r?f(r[s]):void 0}));function ue(e){if("private"===ce(e,"status"))return"private";return ce(e,"password")?"password":"public"}function pe(e){return"pending"===ee(e).status}function he(e,t){const s=t||ee(e);return-1!==["publish","private"].indexOf(s.status)||"future"===s.status&&!(0,x.isInTheFuture)(new Date(Number((0,x.getDate)(s.date))-N))}function me(e){return"future"===ee(e).status&&!he(e)}function ge(e){const t=ee(e);return Q(e)||-1===["publish","private","future"].indexOf(t.status)}function _e(e){return!we(e)&&(!!ce(e,"title")||!!ce(e,"excerpt")||!fe(e)||"native"===u.Platform.OS)}const fe=(0,c.createRegistrySelector)((e=>t=>{const s=se(t),o=te(t),n=e(d.store).getEditedEntityRecord("postType",o,s);if("function"!=typeof n.content)return!n.content;const i=ce(t,"blocks");if(0===i.length)return!0;if(i.length>1)return!1;const r=i[0].name;return(r===(0,y.getDefaultBlockName)()||r===(0,y.getFreeformContentHandlerName)())&&!Be(t)})),be=(0,c.createRegistrySelector)((e=>t=>{if(!_e(t))return!1;if(Le(t))return!1;const s=te(t);if("wp_template"===s)return!1;const o=se(t),n=e(d.store).hasFetchedAutosaves(s,o),i=e(d.store).getCurrentUser()?.id,r=e(d.store).getAutosave(s,o,i);return!!n&&(!r||(!!q(t)||["title","excerpt","meta"].some((e=>f(r[e])!==ce(t,e)))))}));function ye(e){const t=ce(e,"date"),s=new Date(Number((0,x.getDate)(t))-N);return(0,x.isInTheFuture)(s)}function xe(e){const t=ce(e,"date"),s=ce(e,"modified"),o=ee(e).status;return("draft"===o||"auto-draft"===o||"pending"===o)&&(t===s||null===t)}function ve(e){return!!e.deleting.pending}function we(e){return!!e.saving.pending}const Se=(0,c.createRegistrySelector)((e=>t=>{const s=e(d.store).__experimentalGetEntitiesBeingSaved(),{type:o,id:n}=ee(t);return s.some((e=>"postType"!==e.kind||e.name!==o||e.key!==n))})),ke=(0,c.createRegistrySelector)((e=>t=>{const s=te(t),o=se(t);return!e(d.store).getLastEntitySaveError("postType",s,o)})),Pe=(0,c.createRegistrySelector)((e=>t=>{const s=te(t),o=se(t);return!!e(d.store).getLastEntitySaveError("postType",s,o)}));function Ce(e){return we(e)&&Boolean(e.saving.options?.isAutosave)}function je(e){return we(e)&&Boolean(e.saving.options?.isPreview)}function Ee(e){if(e.saving.pending||we(e))return;let t=de(e,"preview_link");t&&"draft"!==ee(e).status||(t=ce(e,"link"),t&&(t=(0,v.addQueryArgs)(t,{preview:!0})));const s=ce(e,"featured_media");return t&&s?(0,v.addQueryArgs)(t,{_thumbnail_id:s}):t}const Te=(0,c.createRegistrySelector)((e=>()=>{const t=e(m.store).getBlocks();if(t.length>2)return null;let s;if(1===t.length&&(s=t[0].name,"core/embed"===s)){const e=t[0].attributes?.providerNameSlug;["youtube","vimeo"].includes(e)?s="core/video":["spotify","soundcloud"].includes(e)&&(s="core/audio")}switch(2===t.length&&"core/paragraph"===t[1].name&&(s=t[0].name),s){case"core/image":return"image";case"core/quote":case"core/pullquote":return"quote";case"core/gallery":return"gallery";case"core/video":return"video";case"core/audio":return"audio";default:return null}})),Be=(0,c.createRegistrySelector)((e=>t=>{const s=se(t),o=te(t),n=e(d.store).getEditedEntityRecord("postType",o,s);if(n){if("function"==typeof n.content)return n.content(n);if(n.blocks)return(0,y.__unstableSerializeAndClean)(n.blocks);if(n.content)return n.content}return""}));function Ie(e){return we(e)&&!he(e)&&"publish"===ce(e,"status")}function Ne(e){const t=ce(e,"permalink_template");return I.test(t)}function Ae(e){const t=Re(e);if(!t)return null;const{prefix:s,postName:o,suffix:n}=t;return Ne(e)?s+o+n:s}function De(e){return ce(e,"slug")||(0,v.cleanForSlug)(ce(e,"title"))||se(e)}function Re(e){const t=ce(e,"permalink_template");if(!t)return null;const s=ce(e,"slug")||ce(e,"generated_slug"),[o,n]=t.split(I);return{prefix:o,postName:s,suffix:n}}function Me(e){return e.postLock.isLocked}function Oe(e){return Object.keys(e.postSavingLock).length>0}function Le(e){return Object.keys(e.postAutosavingLock).length>0}function Fe(e){return e.postLock.isTakeover}function Ve(e){return e.postLock.user}function ze(e){return e.postLock.activePostLock}function Ue(e){return Boolean(ee(e)._links?.hasOwnProperty("wp:action-unfiltered-html"))}const He=(0,c.createRegistrySelector)((e=>()=>!!e(j.store).get("core","isPublishSidebarEnabled"))),Ge=(0,c.createSelector)((e=>ce(e,"blocks")||(0,y.parse)(Be(e))),(e=>[ce(e,"blocks"),Be(e)]));function $e(e,t){return e.removedPanels.includes(t)}const We=(0,c.createRegistrySelector)((e=>(t,s)=>{const o=e(j.store).get("core","inactivePanels");return!$e(t,s)&&!o?.includes(s)})),Ze=(0,c.createRegistrySelector)((e=>(t,s)=>{const o=e(j.store).get("core","openPanels");return!!o?.includes(s)}));function Ye(e){return S()("select('core/editor').getEditorSelectionStart",{since:"5.8",alternative:"select('core/editor').getEditorSelection"}),ce(e,"selection")?.selectionStart}function Ke(e){return S()("select('core/editor').getEditorSelectionStart",{since:"5.8",alternative:"select('core/editor').getEditorSelection"}),ce(e,"selection")?.selectionEnd}function qe(e){return ce(e,"selection")}function Qe(e){return!!e.postId}function Xe(e){return e.editorSettings}function Je(e){return e.renderingMode}const et=(0,c.createRegistrySelector)((e=>t=>"zoom-out"===e(m.store).__unstableGetEditorMode()?"Desktop":t.deviceType));function tt(e){return e.listViewPanel}function st(e){return!!e.blockInserterPanel}const ot=(0,c.createRegistrySelector)((e=>()=>{var t;return null!==(t=e(j.store).get("core","editorMode"))&&void 0!==t?t:"visual"}));function nt(){return S()("select('core/editor').getStateBeforeOptimisticTransaction",{since:"5.7",hint:"No state history is kept on this store anymore"}),null}function it(){return S()("select('core/editor').inSomeHistory",{since:"5.7",hint:"No state history is kept on this store anymore"}),!1}function rt(e){return(0,c.createRegistrySelector)((t=>(s,...o)=>(S()("`wp.data.select( 'core/editor' )."+e+"`",{since:"5.3",alternative:"`wp.data.select( 'core/block-editor' )."+e+"`",version:"6.2"}),t(m.store)[e](...o))))}const at=rt("getBlockName"),lt=rt("isBlockValid"),ct=rt("getBlockAttributes"),dt=rt("getBlock"),ut=rt("getBlocks"),pt=rt("getClientIdsOfDescendants"),ht=rt("getClientIdsWithDescendants"),mt=rt("getGlobalBlockCount"),gt=rt("getBlocksByClientId"),_t=rt("getBlockCount"),ft=rt("getBlockSelectionStart"),bt=rt("getBlockSelectionEnd"),yt=rt("getSelectedBlockCount"),xt=rt("hasSelectedBlock"),vt=rt("getSelectedBlockClientId"),wt=rt("getSelectedBlock"),St=rt("getBlockRootClientId"),kt=rt("getBlockHierarchyRootClientId"),Pt=rt("getAdjacentBlockClientId"),Ct=rt("getPreviousBlockClientId"),jt=rt("getNextBlockClientId"),Et=rt("getSelectedBlocksInitialCaretPosition"),Tt=rt("getMultiSelectedBlockClientIds"),Bt=rt("getMultiSelectedBlocks"),It=rt("getFirstMultiSelectedBlockClientId"),Nt=rt("getLastMultiSelectedBlockClientId"),At=rt("isFirstMultiSelectedBlock"),Dt=rt("isBlockMultiSelected"),Rt=rt("isAncestorMultiSelected"),Mt=rt("getMultiSelectedBlocksStartClientId"),Ot=rt("getMultiSelectedBlocksEndClientId"),Lt=rt("getBlockOrder"),Ft=rt("getBlockIndex"),Vt=rt("isBlockSelected"),zt=rt("hasSelectedInnerBlock"),Ut=rt("isBlockWithinSelection"),Ht=rt("hasMultiSelection"),Gt=rt("isMultiSelecting"),$t=rt("isSelectionEnabled"),Wt=rt("getBlockMode"),Zt=rt("isTyping"),Yt=rt("isCaretWithinFormattedText"),Kt=rt("getBlockInsertionPoint"),qt=rt("isBlockInsertionPointVisible"),Qt=rt("isValidTemplate"),Xt=rt("getTemplate"),Jt=rt("getTemplateLock"),es=rt("canInsertBlockType"),ts=rt("getInserterItems"),ss=rt("hasInserterItems"),os=rt("getBlockListSettings");function ns(e){return Xe(e)?.defaultTemplateTypes}const is=(0,c.createSelector)((e=>{var t;return(null!==(t=Xe(e)?.defaultTemplatePartAreas)&&void 0!==t?t:[]).map((e=>({...e,icon:$(e.icon)})))}),(e=>[Xe(e)?.defaultTemplatePartAreas])),rs=(0,c.createSelector)(((e,t)=>{var s;const o=ns(e);return o&&null!==(s=Object.values(o).find((e=>e.slug===t)))&&void 0!==s?s:W}),(e=>[ns(e)])),as=(0,c.createSelector)(((e,t)=>{if(!t)return W;const{description:s,slug:o,title:n,area:i}=t,{title:r,description:a}=rs(e,o),l="string"==typeof n?n:n?.rendered;return{title:l&&l!==o?l:r||o,description:("string"==typeof s?s:s?.raw)||a,icon:is(e).find((e=>i===e.area))?.icon||C}}),(e=>[ns(e),is(e)])),ls=(0,c.createRegistrySelector)((e=>t=>{const s=te(t),o=e(d.store).getPostType(s);return o?.labels?.singular_name}));function cs(e){return e.publishSidebarActive}const ds=window.wp.a11y,us=window.wp.apiFetch;var ps=s.n(us);const hs=window.wp.notices,ms=window.wp.i18n;function gs(e,t){return`wp-autosave-block-editor-post-${t?"auto-draft":e}`}function _s(e,t){window.sessionStorage.removeItem(gs(e,t))}const fs=(e,t,s)=>({dispatch:o})=>{o.setEditedPost(e.type,e.id);if("auto-draft"===e.status&&s){let n;n="content"in t?t.content:e.content.raw;let i=(0,y.parse)(n);i=(0,y.synchronizeBlocksWithTemplate)(i,s),o.resetEditorBlocks(i,{__unstableShouldCreateUndoLevel:!1})}t&&Object.values(t).some((([t,s])=>{var o;return s!==(null!==(o=e[t]?.raw)&&void 0!==o?o:e[t])}))&&o.editPost(t)};function bs(){return S()("wp.data.dispatch( 'core/editor' ).__experimentalTearDownEditor",{since:"6.5"}),{type:"DO_NOTHING"}}function ys(){return S()("wp.data.dispatch( 'core/editor' ).resetPost",{since:"6.0",version:"6.3",alternative:"Initialize the editor with the setupEditorState action"}),{type:"DO_NOTHING"}}function xs(){return S()("wp.data.dispatch( 'core/editor' ).updatePost",{since:"5.7",alternative:"Use the core entities store instead"}),{type:"DO_NOTHING"}}function vs(e){return S()("wp.data.dispatch( 'core/editor' ).setupEditorState",{since:"6.5",alternative:"wp.data.dispatch( 'core/editor' ).setEditedPost"}),ws(e.type,e.id)}function ws(e,t){return{type:"SET_EDITED_POST",postType:e,postId:t}}const Ss=(e,t)=>({select:s,registry:o})=>{const{id:n,type:i}=s.getCurrentPost();o.dispatch(d.store).editEntityRecord("postType",i,n,e,t)},ks=(e={})=>async({select:t,dispatch:s,registry:o})=>{if(!t.isEditedPostSaveable())return;const n=t.getEditedPostContent();e.isAutosave||s.editPost({content:n},{undoIgnore:!0});const i=t.getCurrentPost();let r={id:i.id,...o.select(d.store).getEntityRecordNonTransientEdits("postType",i.type,i.id),content:n};s({type:"REQUEST_POST_UPDATE_START",options:e});let a=!1;try{r=await(0,h.applyFiltersAsync)("editor.preSavePost",r,e)}catch(e){a=e}if(!a)try{await o.dispatch(d.store).saveEntityRecord("postType",i.type,r,e)}catch(e){a=e.message&&"unknown_error"!==e.code?e.message:(0,ms.__)("An error occurred while updating.")}if(a||(a=o.select(d.store).getLastEntitySaveError("postType",i.type,i.id)),!a)try{await(0,h.applyFilters)("editor.__unstableSavePost",Promise.resolve(),e)}catch(e){a=e}if(!a)try{await(0,h.doActionAsync)("editor.savePost",{id:i.id},e)}catch(e){a=e}if(s({type:"REQUEST_POST_UPDATE_FINISH",options:e}),a){const e=function(e){const{post:t,edits:s,error:o}=e;if(o&&"rest_autosave_no_changes"===o.code)return[];const n=["publish","private","future"],i=-1!==n.indexOf(t.status),r={publish:(0,ms.__)("Publishing failed."),private:(0,ms.__)("Publishing failed."),future:(0,ms.__)("Scheduling failed.")};let a=i||-1===n.indexOf(s.status)?(0,ms.__)("Updating failed."):r[s.status];return o.message&&!/<\/?[^>]*>/.test(o.message)&&(a=[a,o.message].join(" ")),[a,{id:T}]}({post:i,edits:r,error:a});e.length&&o.dispatch(hs.store).createErrorNotice(...e)}else{const s=t.getCurrentPost(),n=function(e){var t;const{previousPost:s,post:o,postType:n}=e;if(e.options?.isAutosave)return[];const i=["publish","private","future"],r=i.includes(s.status),a=i.includes(o.status),l="trash"===o.status&&"trash"!==s.status;let c,d,u=null!==(t=n?.viewable)&&void 0!==t&&t;l?(c=n.labels.item_trashed,u=!1):r||a?r&&!a?(c=n.labels.item_reverted_to_draft,u=!1):c=!r&&a?{publish:n.labels.item_published,private:n.labels.item_published_privately,future:n.labels.item_scheduled}[o.status]:n.labels.item_updated:(c=(0,ms.__)("Draft saved."),d=!0);const p=[];return u&&p.push({label:d?(0,ms.__)("View Preview"):n.labels.view_item,url:o.link}),[c,{id:T,type:"snackbar",actions:p}]}({previousPost:i,post:s,postType:await o.resolveSelect(d.store).getPostType(s.type),options:e});n.length&&o.dispatch(hs.store).createSuccessNotice(...n),e.isAutosave||o.dispatch(m.store).__unstableMarkLastChangeAsPersistent()}};function Ps(){return S()("wp.data.dispatch( 'core/editor' ).refreshPost",{since:"6.0",version:"6.3",alternative:"Use the core entities store instead"}),{type:"DO_NOTHING"}}const Cs=()=>async({select:e,dispatch:t,registry:s})=>{const o=e.getCurrentPostType(),n=await s.resolveSelect(d.store).getPostType(o);s.dispatch(hs.store).removeNotice(B);const{rest_base:i,rest_namespace:r="wp/v2"}=n;t({type:"REQUEST_POST_DELETE_START"});try{const s=e.getCurrentPost();await ps()({path:`/${r}/${i}/${s.id}`,method:"DELETE"}),await t.savePost()}catch(e){s.dispatch(hs.store).createErrorNotice(...(a={error:e},[a.error.message&&"unknown_error"!==a.error.code?a.error.message:(0,ms.__)("Trashing failed"),{id:B}]))}var a;t({type:"REQUEST_POST_DELETE_FINISH"})},js=({local:e=!1,...t}={})=>async({select:s,dispatch:o})=>{const n=s.getCurrentPost();if("wp_template"!==n.type)if(e){const e=s.isEditedPostNew(),t=s.getEditedPostAttribute("title"),o=s.getEditedPostAttribute("content"),i=s.getEditedPostAttribute("excerpt");!function(e,t,s,o,n){window.sessionStorage.setItem(gs(e,t),JSON.stringify({post_title:s,content:o,excerpt:n}))}(n.id,e,t,o,i)}else await o.savePost({isAutosave:!0,...t})},Es=({forceIsAutosaveable:e}={})=>async({select:t,dispatch:s})=>{if((e||t.isEditedPostAutosaveable())&&!t.isPostLocked()){["draft","auto-draft"].includes(t.getEditedPostAttribute("status"))?await s.savePost({isPreview:!0}):await s.autosave({isPreview:!0})}return t.getEditedPostPreviewLink()},Ts=()=>({registry:e})=>{e.dispatch(d.store).redo()},Bs=()=>({registry:e})=>{e.dispatch(d.store).undo()};function Is(){return S()("wp.data.dispatch( 'core/editor' ).createUndoLevel",{since:"6.0",version:"6.3",alternative:"Use the core entities store instead"}),{type:"DO_NOTHING"}}function Ns(e){return{type:"UPDATE_POST_LOCK",lock:e}}const As=()=>({registry:e})=>{e.dispatch(j.store).set("core","isPublishSidebarEnabled",!0)},Ds=()=>({registry:e})=>{e.dispatch(j.store).set("core","isPublishSidebarEnabled",!1)};function Rs(e){return{type:"LOCK_POST_SAVING",lockName:e}}function Ms(e){return{type:"UNLOCK_POST_SAVING",lockName:e}}function Os(e){return{type:"LOCK_POST_AUTOSAVING",lockName:e}}function Ls(e){return{type:"UNLOCK_POST_AUTOSAVING",lockName:e}}const Fs=(e,t={})=>({select:s,dispatch:o,registry:n})=>{const{__unstableShouldCreateUndoLevel:i,selection:r}=t,a={blocks:e,selection:r};if(!1!==i){const{id:e,type:t}=s.getCurrentPost();if(n.select(d.store).getEditedEntityRecord("postType",t,e).blocks===a.blocks)return void n.dispatch(d.store).__unstableCreateUndoLevel("postType",t,e);a.content=({blocks:e=[]})=>(0,y.__unstableSerializeAndClean)(e)}o.editPost(a)};function Vs(e){return{type:"UPDATE_EDITOR_SETTINGS",settings:e}}const zs=e=>({dispatch:t,registry:s,select:o})=>{o.__unstableIsEditorReady()&&(s.dispatch(m.store).clearSelectedBlock(),t.editPost({selection:void 0},{undoIgnore:!0})),t({type:"SET_RENDERING_MODE",mode:e})};function Us(e){return{type:"SET_DEVICE_TYPE",deviceType:e}}const Hs=e=>({registry:t})=>{var s;const o=null!==(s=t.select(j.store).get("core","inactivePanels"))&&void 0!==s?s:[];let n;n=!!o?.includes(e)?o.filter((t=>t!==e)):[...o,e],t.dispatch(j.store).set("core","inactivePanels",n)},Gs=e=>({registry:t})=>{var s;const o=null!==(s=t.select(j.store).get("core","openPanels"))&&void 0!==s?s:[];let n;n=!!o?.includes(e)?o.filter((t=>t!==e)):[...o,e],t.dispatch(j.store).set("core","openPanels",n)};function $s(e){return{type:"REMOVE_PANEL",panelName:e}}function Ws(e){return{type:"SET_IS_INSERTER_OPENED",value:e}}function Zs(e){return{type:"SET_IS_LIST_VIEW_OPENED",isOpen:e}}const Ys=()=>({dispatch:e,registry:t})=>{const s=t.select(j.store).get("core","distractionFree");s&&t.dispatch(j.store).set("core","fixedToolbar",!1),s||t.batch((()=>{t.dispatch(j.store).set("core","fixedToolbar",!0),e.setIsInserterOpened(!1),e.setIsListViewOpened(!1)})),t.batch((()=>{t.dispatch(j.store).set("core","distractionFree",!s),t.dispatch(hs.store).createInfoNotice(s?(0,ms.__)("Distraction free off."):(0,ms.__)("Distraction free on."),{id:"core/editor/distraction-free-mode/notice",type:"snackbar",actions:[{label:(0,ms.__)("Undo"),onClick:()=>{t.batch((()=>{t.dispatch(j.store).set("core","fixedToolbar",!!s),t.dispatch(j.store).toggle("core","distractionFree")}))}}]})}))},Ks=e=>({dispatch:t,registry:s})=>{if(s.dispatch(j.store).set("core","editorMode",e),"visual"!==e&&s.dispatch(m.store).clearSelectedBlock(),"visual"===e)(0,ds.speak)((0,ms.__)("Visual editor selected"),"assertive");else if("text"===e){s.select(j.store).get("core","distractionFree")&&t.toggleDistractionFree(),(0,ds.speak)((0,ms.__)("Code editor selected"),"assertive")}};function qs(){return{type:"OPEN_PUBLISH_SIDEBAR"}}function Qs(){return{type:"CLOSE_PUBLISH_SIDEBAR"}}function Xs(){return{type:"TOGGLE_PUBLISH_SIDEBAR"}}const Js=e=>(...t)=>({registry:s})=>{S()("`wp.data.dispatch( 'core/editor' )."+e+"`",{since:"5.3",alternative:"`wp.data.dispatch( 'core/block-editor' )."+e+"`",version:"6.2"}),s.dispatch(m.store)[e](...t)},eo=Js("resetBlocks"),to=Js("receiveBlocks"),so=Js("updateBlock"),oo=Js("updateBlockAttributes"),no=Js("selectBlock"),io=Js("startMultiSelect"),ro=Js("stopMultiSelect"),ao=Js("multiSelect"),lo=Js("clearSelectedBlock"),co=Js("toggleSelection"),uo=Js("replaceBlocks"),po=Js("replaceBlock"),ho=Js("moveBlocksDown"),mo=Js("moveBlocksUp"),go=Js("moveBlockToPosition"),_o=Js("insertBlock"),fo=Js("insertBlocks"),bo=Js("showInsertionPoint"),yo=Js("hideInsertionPoint"),xo=Js("setTemplateValidity"),vo=Js("synchronizeTemplate"),wo=Js("mergeBlocks"),So=Js("removeBlocks"),ko=Js("removeBlock"),Po=Js("toggleBlockMode"),Co=Js("startTyping"),jo=Js("stopTyping"),Eo=Js("enterFormattedText"),To=Js("exitFormattedText"),Bo=Js("insertDefaultBlock"),Io=Js("updateBlockListSettings"),No=window.wp.htmlEntities;const Ao=window.wp.components,Do=(0,P.jsx)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,P.jsx)(k.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})});var Ro=function(){return Ro=Object.assign||function(e){for(var t,s=1,o=arguments.length;se(d.store).getPostType(R)?.labels?.add_new_item),[]);return(0,P.jsx)(Ao.Modal,{title:e||s,onRequestClose:t.closeModal,overlayClassName:"editor-create-template-part-modal",focusOnMount:"firstContentElement",size:"medium",children:(0,P.jsx)(Ho,{...t})})}function Ho({defaultArea:e="uncategorized",blocks:t=[],confirmLabel:s=(0,ms.__)("Add"),closeModal:o,onCreate:n,onError:i,defaultTitle:r=""}){const{createErrorNotice:a}=(0,c.useDispatch)(hs.store),{saveEntityRecord:l}=(0,c.useDispatch)(d.store),h=(0,c.useSelect)((e=>e(d.store).getEntityRecords("postType",R,{per_page:-1})),[]),[m,g]=(0,u.useState)(r),[_,f]=(0,u.useState)(e),[b,x]=(0,u.useState)(!1),v=(0,p.useInstanceId)(Uo),w=(0,c.useSelect)((e=>e(Wi).__experimentalGetDefaultTemplatePartAreas()),[]);async function S(){if(m&&!b)try{x(!0);const e=((e,t)=>{const s=e.toLowerCase(),o=t.map((e=>e.title.rendered.toLowerCase()));if(!o.includes(s))return e;let n=2;for(;o.includes(`${s} ${n}`);)n++;return`${e} ${n}`})(m,h),s=(e=>zo(e).replace(/[^\w-]+/g,"")||"wp-custom-part")(e),o=await l("postType",R,{slug:s,title:e,content:(0,y.serialize)(t),area:_},{throwOnError:!0});await n(o)}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,ms.__)("An error occurred while creating the template part.");a(t,{type:"snackbar"}),i?.()}finally{x(!1)}}return(0,P.jsx)("form",{onSubmit:async e=>{e.preventDefault(),await S()},children:(0,P.jsxs)(Ao.__experimentalVStack,{spacing:"4",children:[(0,P.jsx)(Ao.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,ms.__)("Name"),value:m,onChange:g,required:!0}),(0,P.jsx)(Ao.BaseControl,{__nextHasNoMarginBottom:!0,label:(0,ms.__)("Area"),id:`editor-create-template-part-modal__area-selection-${v}`,className:"editor-create-template-part-modal__area-base-control",children:(0,P.jsx)(Ao.__experimentalRadioGroup,{label:(0,ms.__)("Area"),className:"editor-create-template-part-modal__area-radio-group",id:`editor-create-template-part-modal__area-selection-${v}`,onChange:f,checked:_,children:w.map((({icon:e,label:t,area:s,description:o})=>(0,P.jsx)(Ao.__experimentalRadio,{value:s,className:"editor-create-template-part-modal__area-radio",children:(0,P.jsxs)(Ao.Flex,{align:"start",justify:"start",children:[(0,P.jsx)(Ao.FlexItem,{children:(0,P.jsx)(Ao.Icon,{icon:e})}),(0,P.jsxs)(Ao.FlexBlock,{className:"editor-create-template-part-modal__option-label",children:[t,(0,P.jsx)("div",{children:o})]}),(0,P.jsx)(Ao.FlexItem,{className:"editor-create-template-part-modal__checkbox",children:_===s&&(0,P.jsx)(Ao.Icon,{icon:Do})})]})},t)))})}),(0,P.jsxs)(Ao.__experimentalHStack,{justify:"right",children:[(0,P.jsx)(Ao.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>{o()},children:(0,ms.__)("Cancel")}),(0,P.jsx)(Ao.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit","aria-disabled":!m||b,isBusy:b,children:s})]})]})})}function Go(e){return e.type===D||e.type===R}function $o(e){return"string"==typeof e.title?(0,No.decodeEntities)(e.title):"rendered"in e.title?(0,No.decodeEntities)(e.title.rendered):"raw"in e.title?(0,No.decodeEntities)(e.title.raw):""}function Wo(e){return!!e&&([e.source,e.source].includes(L)&&!Boolean("wp_template"===e.type&&e?.plugin)&&!e.has_theme_file)}const Zo={id:"duplicate-template-part",label:(0,ms._x)("Duplicate","action label"),isEligible:e=>e.type===R,modalHeader:(0,ms._x)("Duplicate template part","action label"),RenderModal:({items:e,closeModal:t})=>{const[s]=e,o=(0,u.useMemo)((()=>{var e;return null!==(e=s.blocks)&&void 0!==e?e:(0,y.parse)("string"==typeof s.content?s.content:s.content.raw,{__unstableSkipMigrationLogs:!0})}),[s.content,s.blocks]),{createSuccessNotice:n}=(0,c.useDispatch)(hs.store);return(0,P.jsx)(Ho,{blocks:o,defaultArea:s.area,defaultTitle:(0,ms.sprintf)((0,ms._x)("%s (Copy)","template part"),$o(s)),onCreate:function(){n((0,ms.sprintf)((0,ms._x)('"%s" duplicated.',"template part"),$o(s)),{type:"snackbar",id:"edit-site-patterns-success"}),t?.()},onError:t,confirmLabel:(0,ms._x)("Duplicate","action label"),closeModal:t})}},Yo=Zo,Ko=(0,P.jsx)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,P.jsx)(k.Path,{d:"M5.5 12h1.75l-2.5 3-2.5-3H4a8 8 0 113.134 6.35l.907-1.194A6.5 6.5 0 105.5 12zm9.53 1.97l-2.28-2.28V8.5a.75.75 0 00-1.5 0V12a.747.747 0 00.218.529l1.282-.84-1.28.842 2.5 2.5a.75.75 0 101.06-1.061z"})}),qo=window.wp.privateApis,{lock:Qo,unlock:Xo}=(0,qo.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/editor"),Jo={id:"reset-post",label:(0,ms.__)("Reset"),isEligible:e=>Go(e)&&e?.source===L&&(Boolean("wp_template"===e.type&&e?.plugin)||e?.has_theme_file),icon:Ko,supportsBulk:!0,hideModalHeader:!0,RenderModal:({items:e,closeModal:t,onActionPerformed:s})=>{const[o,n]=(0,u.useState)(!1),{revertTemplate:i}=Xo((0,c.useDispatch)(Wi)),{saveEditedEntityRecord:r}=(0,c.useDispatch)(d.store),{createSuccessNotice:a,createErrorNotice:l}=(0,c.useDispatch)(hs.store);return(0,P.jsxs)(Ao.__experimentalVStack,{spacing:"5",children:[(0,P.jsx)(Ao.__experimentalText,{children:(0,ms.__)("Reset to default and clear all customizations?")}),(0,P.jsxs)(Ao.__experimentalHStack,{justify:"right",children:[(0,P.jsx)(Ao.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:t,disabled:o,accessibleWhenDisabled:!0,children:(0,ms.__)("Cancel")}),(0,P.jsx)(Ao.Button,{__next40pxDefaultSize:!0,variant:"primary",onClick:async()=>{n(!0),await(async()=>{try{for(const t of e)await i(t,{allowUndo:!1}),await r("postType",t.type,t.id);a(e.length>1?(0,ms.sprintf)((0,ms.__)("%s items reset."),e.length):(0,ms.sprintf)((0,ms.__)('"%s" reset.'),$o(e[0])),{type:"snackbar",id:"revert-template-action"})}catch(t){let s;s=e[0].type===D?1===e.length?(0,ms.__)("An error occurred while reverting the template."):(0,ms.__)("An error occurred while reverting the templates."):1===e.length?(0,ms.__)("An error occurred while reverting the template part."):(0,ms.__)("An error occurred while reverting the template parts.");const o=t,n=o.message&&"unknown_error"!==o.code?o.message:s;l(n,{type:"snackbar"})}})(),s?.(e),n(!1),t?.()},isBusy:o,disabled:o,accessibleWhenDisabled:!0,children:(0,ms.__)("Reset")})]})]})}},en=Jo,tn=(0,P.jsx)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,P.jsx)(k.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 5.5A2.25 2.25 0 0 0 9.878 7h4.244A2.251 2.251 0 0 0 12 5.5ZM12 4a3.751 3.751 0 0 0-3.675 3H5v1.5h1.27l.818 8.997a2.75 2.75 0 0 0 2.739 2.501h4.347a2.75 2.75 0 0 0 2.738-2.5L17.73 8.5H19V7h-3.325A3.751 3.751 0 0 0 12 4Zm4.224 4.5H7.776l.806 8.861a1.25 1.25 0 0 0 1.245 1.137h4.347a1.25 1.25 0 0 0 1.245-1.137l.805-8.861Z"})}),sn={id:"move-to-trash",label:(0,ms.__)("Move to trash"),isPrimary:!0,icon:tn,isEligible:e=>!Go(e)&&"wp_block"!==e.type&&(!!e.status&&!["auto-draft","trash"].includes(e.status)&&e.permissions?.delete),supportsBulk:!0,hideModalHeader:!0,RenderModal:({items:e,closeModal:t,onActionPerformed:s})=>{const[o,n]=(0,u.useState)(!1),{createSuccessNotice:i,createErrorNotice:r}=(0,c.useDispatch)(hs.store),{deleteEntityRecord:a}=(0,c.useDispatch)(d.store);return(0,P.jsxs)(Ao.__experimentalVStack,{spacing:"5",children:[(0,P.jsx)(Ao.__experimentalText,{children:1===e.length?(0,ms.sprintf)((0,ms.__)('Are you sure you want to move "%s" to the trash?'),$o(e[0])):(0,ms.sprintf)((0,ms._n)("Are you sure you want to move %d item to the trash ?","Are you sure you want to move %d items to the trash ?",e.length),e.length)}),(0,P.jsxs)(Ao.__experimentalHStack,{justify:"right",children:[(0,P.jsx)(Ao.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:t,disabled:o,accessibleWhenDisabled:!0,children:(0,ms.__)("Cancel")}),(0,P.jsx)(Ao.Button,{__next40pxDefaultSize:!0,variant:"primary",onClick:async()=>{n(!0);const o=await Promise.allSettled(e.map((e=>a("postType",e.type,e.id.toString(),{},{throwOnError:!0}))));if(o.every((({status:e})=>"fulfilled"===e))){let t;t=1===o.length?(0,ms.sprintf)((0,ms.__)('"%s" moved to the trash.'),$o(e[0])):(0,ms.sprintf)((0,ms._n)("%s item moved to the trash.","%s items moved to the trash.",e.length),e.length),i(t,{type:"snackbar",id:"move-to-trash-action"})}else{let e;if(1===o.length){const t=o[0];e=t.reason?.message?t.reason.message:(0,ms.__)("An error occurred while moving the item to the trash.")}else{const t=new Set,s=o.filter((({status:e})=>"rejected"===e));for(const e of s){const s=e;s.reason?.message&&t.add(s.reason.message)}e=0===t.size?(0,ms.__)("An error occurred while moving the items to the trash."):1===t.size?(0,ms.sprintf)((0,ms.__)("An error occurred while moving the item to the trash: %s"),[...t][0]):(0,ms.sprintf)((0,ms.__)("Some errors occurred while moving the items to the trash: %s"),[...t].join(","))}r(e,{type:"snackbar"})}s&&s(e),n(!1),t?.()},isBusy:o,disabled:o,accessibleWhenDisabled:!0,children:(0,ms._x)("Trash","verb")})]})]})}},on=sn,nn=window.wp.patterns,{PATTERN_TYPES:rn}=Xo(nn.privateApis),an={id:"rename-post",label:(0,ms.__)("Rename"),isEligible:e=>"trash"!==e.status&&([D,R,...Object.values(rn)].includes(e.type)?function(e){return e.type===D}(e)?Wo(e)&&e.is_custom&&e.permissions?.update:function(e){return e.type===R}(e)?e.source===L&&!e?.has_theme_file&&e.permissions?.update:e.type===rn.user&&e.permissions?.update:e.permissions?.update),RenderModal:({items:e,closeModal:t,onActionPerformed:s})=>{const[o]=e,[n,i]=(0,u.useState)((()=>$o(o))),{editEntityRecord:r,saveEditedEntityRecord:a}=(0,c.useDispatch)(d.store),{createSuccessNotice:l,createErrorNotice:p}=(0,c.useDispatch)(hs.store);return(0,P.jsx)("form",{onSubmit:async function(c){c.preventDefault();try{await r("postType",o.type,o.id,{title:n}),i(""),t?.(),await a("postType",o.type,o.id,{throwOnError:!0}),l((0,ms.__)("Name updated"),{type:"snackbar"}),s?.(e)}catch(e){const t=e,s=t.message&&"unknown_error"!==t.code?t.message:(0,ms.__)("An error occurred while updating the name");p(s,{type:"snackbar"})}},children:(0,P.jsxs)(Ao.__experimentalVStack,{spacing:"5",children:[(0,P.jsx)(Ao.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,ms.__)("Name"),value:n,onChange:i,required:!0}),(0,P.jsxs)(Ao.__experimentalHStack,{justify:"right",children:[(0,P.jsx)(Ao.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>{t?.()},children:(0,ms.__)("Cancel")}),(0,P.jsx)(Ao.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",children:(0,ms.__)("Save")})]})]})})}},ln=an,cn={id:"restore",label:(0,ms.__)("Restore"),isPrimary:!0,icon:Ko,supportsBulk:!0,isEligible:e=>!Go(e)&&"wp_block"!==e.type&&"trash"===e.status&&e.permissions?.update,async callback(e,{registry:t,onActionPerformed:s}){const{createSuccessNotice:o,createErrorNotice:n}=t.dispatch(hs.store),{editEntityRecord:i,saveEditedEntityRecord:r}=t.dispatch(d.store);await Promise.allSettled(e.map((e=>i("postType",e.type,e.id,{status:"draft"}))));const a=await Promise.allSettled(e.map((e=>r("postType",e.type,e.id,{throwOnError:!0}))));if(a.every((({status:e})=>"fulfilled"===e))){let t;t=1===e.length?(0,ms.sprintf)((0,ms.__)('"%s" has been restored.'),$o(e[0])):"page"===e[0].type?(0,ms.sprintf)((0,ms.__)("%d pages have been restored."),e.length):(0,ms.sprintf)((0,ms.__)("%d posts have been restored."),e.length),o(t,{type:"snackbar",id:"restore-post-action"}),s&&s(e)}else{let e;if(1===a.length){const t=a[0];e=t.reason?.message?t.reason.message:(0,ms.__)("An error occurred while restoring the post.")}else{const t=new Set,s=a.filter((({status:e})=>"rejected"===e));for(const e of s){const s=e;s.reason?.message&&t.add(s.reason.message)}e=0===t.size?(0,ms.__)("An error occurred while restoring the posts."):1===t.size?(0,ms.sprintf)((0,ms.__)("An error occurred while restoring the posts: %s"),[...t][0]):(0,ms.sprintf)((0,ms.__)("Some errors occurred while restoring the posts: %s"),[...t].join(","))}n(e,{type:"snackbar"})}}},dn=(0,P.jsx)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,P.jsx)(k.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"})}),un={id:"view-post",label:(0,ms._x)("View","verb"),isPrimary:!0,icon:dn,isEligible:e=>"trash"!==e.status,callback(e,{onActionPerformed:t}){const s=e[0];window.open(s?.link,"_blank"),t&&t(e)}},pn={id:"view-post-revisions",context:"list",label(e){var t;const s=null!==(t=e[0]._links?.["version-history"]?.[0]?.count)&&void 0!==t?t:0;return(0,ms.sprintf)((0,ms.__)("View revisions (%s)"),s)},isEligible(e){var t,s;if("trash"===e.status)return!1;const o=null!==(t=e?._links?.["predecessor-version"]?.[0]?.id)&&void 0!==t?t:null,n=null!==(s=e?._links?.["version-history"]?.[0]?.count)&&void 0!==s?s:0;return!!o&&n>1},callback(e,{onActionPerformed:t}){const s=e[0],o=(0,v.addQueryArgs)("revision.php",{revision:s?._links?.["predecessor-version"]?.[0]?.id});document.location.href=o,t&&t(e)}},{lock:hn,unlock:mn}=(0,qo.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/fields"),{CreatePatternModalContents:gn,useDuplicatePatternProps:_n}=mn(nn.privateApis),fn={id:"duplicate-pattern",label:(0,ms._x)("Duplicate","action label"),isEligible:e=>"wp_template_part"!==e.type,modalHeader:(0,ms._x)("Duplicate pattern","action label"),RenderModal:({items:e,closeModal:t})=>{const[s]=e,o=_n({pattern:s,onSuccess:()=>t?.()});return(0,P.jsx)(gn,{onClose:t,confirmLabel:(0,ms._x)("Duplicate","action label"),...o})}},bn=fn;const yn={sort:function(e,t,s){return"asc"===s?e-t:t-e},isValid:function(e,t){if(""===e)return!1;if(!Number.isInteger(Number(e)))return!1;if(t?.elements){const s=t?.elements.map((e=>e.value));if(!s.includes(Number(e)))return!1}return!0},Edit:"integer"};const xn={sort:function(e,t,s){return"asc"===s?e.localeCompare(t):t.localeCompare(e)},isValid:function(e,t){if(t?.elements){const s=t?.elements?.map((e=>e.value));if(!s.includes(e))return!1}return!0},Edit:"text"};const vn={sort:function(e,t,s){const o=new Date(e).getTime(),n=new Date(t).getTime();return"asc"===s?o-n:n-o},isValid:function(e,t){if(t?.elements){const s=t?.elements.map((e=>e.value));if(!s.includes(e))return!1}return!0},Edit:"datetime"};const wn={datetime:function({data:e,field:t,onChange:s,hideLabelFromVision:o}){const{id:n,label:i}=t,r=t.getValue({item:e}),a=(0,u.useCallback)((e=>s({[n]:e})),[n,s]);return(0,P.jsxs)("fieldset",{className:"dataviews-controls__datetime",children:[!o&&(0,P.jsx)(Ao.BaseControl.VisualLabel,{as:"legend",children:i}),o&&(0,P.jsx)(Ao.VisuallyHidden,{as:"legend",children:i}),(0,P.jsx)(Ao.TimePicker,{currentTime:r,onChange:a,hideLabelFromVision:!0})]})},integer:function({data:e,field:t,onChange:s,hideLabelFromVision:o}){var n;const{id:i,label:r,description:a}=t,l=null!==(n=t.getValue({item:e}))&&void 0!==n?n:"",c=(0,u.useCallback)((e=>s({[i]:Number(e)})),[i,s]);return(0,P.jsx)(Ao.__experimentalNumberControl,{label:r,help:a,value:l,onChange:c,__next40pxDefaultSize:!0,hideLabelFromVision:o})},radio:function({data:e,field:t,onChange:s,hideLabelFromVision:o}){const{id:n,label:i}=t,r=t.getValue({item:e}),a=(0,u.useCallback)((e=>s({[n]:e})),[n,s]);return t.elements?(0,P.jsx)(Ao.RadioControl,{label:i,onChange:a,options:t.elements,selected:r,hideLabelFromVision:o}):null},select:function({data:e,field:t,onChange:s,hideLabelFromVision:o}){var n,i;const{id:r,label:a}=t,l=null!==(n=t.getValue({item:e}))&&void 0!==n?n:"",c=(0,u.useCallback)((e=>s({[r]:e})),[r,s]),d=[{label:(0,ms.__)("Select item"),value:""},...null!==(i=t?.elements)&&void 0!==i?i:[]];return(0,P.jsx)(Ao.SelectControl,{label:a,value:l,options:d,onChange:c,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,hideLabelFromVision:o})},text:function({data:e,field:t,onChange:s,hideLabelFromVision:o}){const{id:n,label:i,placeholder:r}=t,a=t.getValue({item:e}),l=(0,u.useCallback)((e=>s({[n]:e})),[n,s]);return(0,P.jsx)(Ao.TextControl,{label:i,placeholder:r,value:null!=a?a:"",onChange:l,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,hideLabelFromVision:o})}};function Sn(e){if(Object.keys(wn).includes(e))return wn[e];throw"Control "+e+" not found"}function kn(e){return e.map((e=>{var t,s,o,n;const i="integer"===(r=e.type)?yn:"text"===r?xn:"datetime"===r?vn:{sort:(e,t,s)=>"number"==typeof e&&"number"==typeof t?"asc"===s?e-t:t-e:"asc"===s?e.localeCompare(t):t.localeCompare(e),isValid:(e,t)=>{if(t?.elements){const s=t?.elements?.map((e=>e.value));if(!s.includes(e))return!1}return!0},Edit:()=>null};var r;const a=e.getValue||(({item:t})=>t[e.id]),l=null!==(t=e.sort)&&void 0!==t?t:function(e,t,s){return i.sort(a({item:e}),a({item:t}),s)},c=null!==(s=e.isValid)&&void 0!==s?s:function(e,t){return i.isValid(a({item:e}),t)},d=function(e,t){return"function"==typeof e.Edit?e.Edit:"string"==typeof e.Edit?Sn(e.Edit):e.elements?Sn("select"):"string"==typeof t.Edit?Sn(t.Edit):t.Edit}(e,i),u=e.render||(e.elements?({item:t})=>{const s=a({item:t});return e?.elements?.find((e=>e.value===s))?.label||a({item:t})}:a);return{...e,label:e.label||e.id,header:e.header||e.label||e.id,getValue:a,render:u,sort:l,isValid:c,Edit:d,enableHiding:null===(o=e.enableHiding)||void 0===o||o,enableSorting:null===(n=e.enableSorting)||void 0===n||n}}))}function Pn(e,t,s){return kn(t.filter((({id:e})=>!!s.fields?.includes(e)))).every((t=>t.isValid(e,{elements:t.elements})))}const Cn=(0,P.jsx)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,P.jsx)(k.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"})});function jn({title:e,onClose:t}){return(0,P.jsx)(Ao.__experimentalVStack,{className:"dataforms-layouts-panel__dropdown-header",spacing:4,children:(0,P.jsxs)(Ao.__experimentalHStack,{alignment:"center",children:[(0,P.jsx)(Ao.__experimentalHeading,{level:2,size:13,children:e}),(0,P.jsx)(Ao.__experimentalSpacer,{}),t&&(0,P.jsx)(Ao.Button,{label:(0,ms.__)("Close"),icon:Cn,onClick:t,size:"small"})]})})}function En({data:e,field:t,onChange:s}){const[o,n]=(0,u.useState)(null),i=(0,u.useMemo)((()=>({anchor:o,placement:"left-start",offset:36,shift:!0})),[o]);return(0,P.jsxs)(Ao.__experimentalHStack,{ref:n,className:"dataforms-layouts-panel__field",children:[(0,P.jsx)("div",{className:"dataforms-layouts-panel__field-label",children:t.label}),(0,P.jsx)("div",{children:(0,P.jsx)(Ao.Dropdown,{contentClassName:"dataforms-layouts-panel__field-dropdown",popoverProps:i,focusOnMount:!0,toggleProps:{size:"compact",variant:"tertiary",tooltipPosition:"middle left"},renderToggle:({isOpen:s,onToggle:o})=>(0,P.jsx)(Ao.Button,{className:"dataforms-layouts-panel__field-control",size:"compact",variant:"tertiary","aria-expanded":s,"aria-label":(0,ms.sprintf)((0,ms._x)("Edit %s","field"),t.label),onClick:o,children:(0,P.jsx)(t.render,{item:e})}),renderContent:({onClose:o})=>(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(jn,{title:t.label,onClose:o}),(0,P.jsx)(t.Edit,{data:e,field:t,onChange:s,hideLabelFromVision:!0},t.id)]})})})]})}const Tn=[{type:"regular",component:function({data:e,fields:t,form:s,onChange:o}){const n=(0,u.useMemo)((()=>{var e;return kn((null!==(e=s.fields)&&void 0!==e?e:[]).map((e=>t.find((({id:t})=>t===e)))).filter((e=>!!e)))}),[t,s.fields]);return(0,P.jsx)(Ao.__experimentalVStack,{spacing:4,children:n.map((t=>(0,P.jsx)(t.Edit,{data:e,field:t,onChange:o},t.id)))})}},{type:"panel",component:function({data:e,fields:t,form:s,onChange:o}){const n=(0,u.useMemo)((()=>{var e;return kn((null!==(e=s.fields)&&void 0!==e?e:[]).map((e=>t.find((({id:t})=>t===e)))).filter((e=>!!e)))}),[t,s.fields]);return(0,P.jsx)(Ao.__experimentalVStack,{spacing:2,children:n.map((t=>(0,P.jsx)(En,{data:e,field:t,onChange:o},t.id)))})}}];function Bn({form:e,...t}){var s;const o=(n=null!==(s=e.type)&&void 0!==s?s:"regular",Tn.find((e=>e.type===n)));var n;return o?(0,P.jsx)(o.component,{form:e,...t}):null}const In=[{type:"integer",id:"menu_order",label:(0,ms.__)("Order"),description:(0,ms.__)("Determines the order of pages.")}],Nn={fields:["menu_order"]};const An={id:"order-pages",label:(0,ms.__)("Order"),isEligible:({status:e})=>"trash"!==e,RenderModal:function({items:e,closeModal:t,onActionPerformed:s}){const[o,n]=(0,u.useState)(e[0]),i=o.menu_order,{editEntityRecord:r,saveEditedEntityRecord:a}=(0,c.useDispatch)(d.store),{createSuccessNotice:l,createErrorNotice:p}=(0,c.useDispatch)(hs.store),h=!Pn(o,In,Nn);return(0,P.jsx)("form",{onSubmit:async function(n){if(n.preventDefault(),Pn(o,In,Nn))try{await r("postType",o.type,o.id,{menu_order:i}),t?.(),await a("postType",o.type,o.id,{throwOnError:!0}),l((0,ms.__)("Order updated."),{type:"snackbar"}),s?.(e)}catch(e){const t=e,s=t.message&&"unknown_error"!==t.code?t.message:(0,ms.__)("An error occurred while updating the order");p(s,{type:"snackbar"})}},children:(0,P.jsxs)(Ao.__experimentalVStack,{spacing:"5",children:[(0,P.jsx)("div",{children:(0,ms.__)("Determines the order of pages. Pages with the same order value are sorted alphabetically. Negative order values are supported.")}),(0,P.jsx)(Bn,{data:o,fields:In,form:Nn,onChange:e=>n({...o,...e})}),(0,P.jsxs)(Ao.__experimentalHStack,{justify:"right",children:[(0,P.jsx)(Ao.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>{t?.()},children:(0,ms.__)("Cancel")}),(0,P.jsx)(Ao.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",accessibleWhenDisabled:!0,disabled:h,children:(0,ms.__)("Save")})]})]})})}},Dn=An;"stream"in Blob.prototype||Object.defineProperty(Blob.prototype,"stream",{value(){return new Response(this).body}}),"setBigUint64"in DataView.prototype||Object.defineProperty(DataView.prototype,"setBigUint64",{value(e,t,s){const o=Number(0xffffffffn&t),n=Number(t>>32n);this.setUint32(e+(s?0:4),o,s),this.setUint32(e+(s?4:0),n,s)}});var Rn=e=>new DataView(new ArrayBuffer(e)),Mn=e=>new Uint8Array(e.buffer||e),On=e=>(new TextEncoder).encode(String(e)),Ln=e=>Math.min(4294967295,Number(e)),Fn=e=>Math.min(65535,Number(e));function Vn(e,t){if(void 0===t||t instanceof Date||(t=new Date(t)),e instanceof File)return{isFile:1,t:t||new Date(e.lastModified),i:e.stream()};if(e instanceof Response)return{isFile:1,t:t||new Date(e.headers.get("Last-Modified")||Date.now()),i:e.body};if(void 0===t)t=new Date;else if(isNaN(t))throw new Error("Invalid modification date.");if(void 0===e)return{isFile:0,t};if("string"==typeof e)return{isFile:1,t,i:On(e)};if(e instanceof Blob)return{isFile:1,t,i:e.stream()};if(e instanceof Uint8Array||e instanceof ReadableStream)return{isFile:1,t,i:e};if(e instanceof ArrayBuffer||ArrayBuffer.isView(e))return{isFile:1,t,i:Mn(e)};if(Symbol.asyncIterator in e)return{isFile:1,t,i:zn(e[Symbol.asyncIterator]())};throw new TypeError("Unsupported input format.")}function zn(e,t=e){return new ReadableStream({async pull(t){let s=0;for(;t.desiredSize>s;){const o=await e.next();if(!o.value){t.close();break}{const e=Un(o.value);t.enqueue(e),s+=e.byteLength}}},cancel(e){t.throw?.(e)}})}function Un(e){return"string"==typeof e?On(e):e instanceof Uint8Array?e:Mn(e)}function Hn(e,t,s){let[o,n]=function(e){return e?e instanceof Uint8Array?[e,1]:ArrayBuffer.isView(e)||e instanceof ArrayBuffer?[Mn(e),1]:[On(e),0]:[void 0,0]}(t);if(e instanceof File)return{o:$n(o||On(e.name)),u:BigInt(e.size),l:n};if(e instanceof Response){const t=e.headers.get("content-disposition"),i=t&&t.match(/;\s*filename\*?\s*=\s*(?:UTF-\d+''|)["']?([^;"'\r\n]*)["']?(?:;|$)/i),r=i&&i[1]||e.url&&new URL(e.url).pathname.split("/").findLast(Boolean),a=r&&decodeURIComponent(r),l=s||+e.headers.get("content-length");return{o:$n(o||On(a)),u:BigInt(l),l:n}}return o=$n(o,void 0!==e||void 0!==s),"string"==typeof e?{o,u:BigInt(On(e).length),l:n}:e instanceof Blob?{o,u:BigInt(e.size),l:n}:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?{o,u:BigInt(e.byteLength),l:n}:{o,u:Gn(e,s),l:n}}function Gn(e,t){return t>-1?BigInt(t):e?void 0:0n}function $n(e,t=1){if(!e||e.every((e=>47===e)))throw new Error("The file must have a name.");if(t)for(;47===e[e.length-1];)e=e.subarray(0,-1);else 47!==e[e.length-1]&&(e=new Uint8Array([...e,47]));return e}var Wn=new Uint32Array(256);for(let e=0;e<256;++e){let t=e;for(let e=0;e<8;++e)t=t>>>1^(1&t&&3988292384);Wn[e]=t}function Zn(e,t=0){t^=-1;for(var s=0,o=e.length;s>>8^Wn[255&t^e[s]];return~t>>>0}function Yn(e,t,s=0){const o=e.getSeconds()>>1|e.getMinutes()<<5|e.getHours()<<11,n=e.getDate()|e.getMonth()+1<<5|e.getFullYear()-1980<<9;t.setUint16(s,o,1),t.setUint16(s+2,n,1)}function Kn({o:e,l:t},s){return 8*(!t||(s??function(e){try{qn.decode(e)}catch{return 0}return 1}(e)))}var qn=new TextDecoder("utf8",{fatal:1});function Qn(e,t=0){const s=Rn(30);return s.setUint32(0,1347093252),s.setUint32(4,754976768|t),Yn(e.t,s,10),s.setUint16(26,e.o.length,1),Mn(s)}async function*Xn(e){let{i:t}=e;if("then"in t&&(t=await t),t instanceof Uint8Array)yield t,e.m=Zn(t,0),e.u=BigInt(t.length);else{e.u=0n;const s=t.getReader();for(;;){const{value:t,done:o}=await s.read();if(o)break;e.m=Zn(t,e.m),e.u+=BigInt(t.length),yield t}}}function Jn(e,t){const s=Rn(16+(t?8:0));return s.setUint32(0,1347094280),s.setUint32(4,e.isFile?e.m:0,1),t?(s.setBigUint64(8,e.u,1),s.setBigUint64(16,e.u,1)):(s.setUint32(8,Ln(e.u),1),s.setUint32(12,Ln(e.u),1)),Mn(s)}function ei(e,t,s=0,o=0){const n=Rn(46);return n.setUint32(0,1347092738),n.setUint32(4,755182848),n.setUint16(8,2048|s),Yn(e.t,n,12),n.setUint32(16,e.isFile?e.m:0,1),n.setUint32(20,Ln(e.u),1),n.setUint32(24,Ln(e.u),1),n.setUint16(28,e.o.length,1),n.setUint16(30,o,1),n.setUint16(40,e.isFile?33204:16893,1),n.setUint32(42,Ln(t),1),Mn(n)}function ti(e,t,s){const o=Rn(s);return o.setUint16(0,1,1),o.setUint16(2,s-4,1),16&s&&(o.setBigUint64(4,e.u,1),o.setBigUint64(12,e.u,1)),o.setBigUint64(s-8,t,1),Mn(o)}function si(e){return e instanceof File||e instanceof Response?[[e],[e]]:[[e.input,e.name,e.size],[e.input,e.lastModified]]}function oi(e,t={}){const s={"Content-Type":"application/zip","Content-Disposition":"attachment"};return("bigint"==typeof t.length||Number.isInteger(t.length))&&t.length>0&&(s["Content-Length"]=String(t.length)),t.metadata&&(s["Content-Length"]=String((e=>function(e){let t=BigInt(22),s=0n,o=0;for(const n of e){if(!n.o)throw new Error("Every file must have a non-empty name.");if(void 0===n.u)throw new Error(`Missing size for file "${(new TextDecoder).decode(n.o)}".`);const e=n.u>=0xffffffffn,i=s>=0xffffffffn;s+=BigInt(46+n.o.length+(e&&8))+n.u,t+=BigInt(n.o.length+46+(12*i|28*e)),o||(o=e)}return(o||s>=0xffffffffn)&&(t+=BigInt(76)),t+s}(function*(e){for(const t of e)yield Hn(...si(t)[0])}(e)))(t.metadata))),new Response(ni(e,t),{headers:s})}function ni(e,t={}){const s=function(e){const t=e[Symbol.iterator in e?Symbol.iterator:Symbol.asyncIterator]();return{async next(){const e=await t.next();if(e.done)return e;const[s,o]=si(e.value);return{done:0,value:Object.assign(Vn(...o),Hn(...s))}},throw:t.throw?.bind(t),[Symbol.asyncIterator](){return this}}}(e);return zn(async function*(e,t){const s=[];let o=0n,n=0n,i=0;for await(const r of e){const e=Kn(r,t.buffersAreUTF8);yield Qn(r,e),yield new Uint8Array(r.o),r.isFile&&(yield*Xn(r));const a=r.u>=0xffffffffn,l=12*(o>=0xffffffffn)|28*a;yield Jn(r,a),s.push(ei(r,o,e,l)),s.push(r.o),l&&s.push(ti(r,o,l)),a&&(o+=8n),n++,o+=BigInt(46+r.o.length)+r.u,i||(i=a)}let r=0n;for(const e of s)yield e,r+=BigInt(e.length);if(i||o>=0xffffffffn){const e=Rn(76);e.setUint32(0,1347094022),e.setBigUint64(4,BigInt(44),1),e.setUint32(12,755182848),e.setBigUint64(24,n,1),e.setBigUint64(32,n,1),e.setBigUint64(40,r,1),e.setBigUint64(48,o,1),e.setUint32(56,1347094023),e.setBigUint64(64,o+r,1),e.setUint32(72,1,1),yield Mn(e)}const a=Rn(22);a.setUint32(0,1347093766),a.setUint16(8,Fn(n),1),a.setUint16(10,Fn(n),1),a.setUint32(12,Ln(r),1),a.setUint32(16,Ln(o),1),yield Mn(a)}(s,t),s)}const ii=window.wp.blob,ri=(0,P.jsx)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,P.jsx)(k.Path,{d:"M18 11.3l-1-1.1-4 4V3h-1.5v11.3L7 10.2l-1 1.1 6.2 5.8 5.8-5.8zm.5 3.7v3.5h-13V15H4v5h16v-5h-1.5z"})}),ai="wp_template",li="wp_template_part";function ci(e){return"string"==typeof e.title?(0,No.decodeEntities)(e.title):"rendered"in e.title?(0,No.decodeEntities)(e.title.rendered):"raw"in e.title?(0,No.decodeEntities)(e.title.raw):""}function di(e){return JSON.stringify({__file:e.type,title:ci(e),content:"string"==typeof e.content?e.content:e.content?.raw,syncStatus:e.wp_pattern_sync_status},null,2)}const ui={id:"export-pattern",label:(0,ms.__)("Export as JSON"),icon:ri,supportsBulk:!0,isEligible:e=>"wp_block"===e.type,callback:async e=>{if(1===e.length)return(0,ii.downloadBlob)(`${zo(ci(e[0])||e[0].slug)}.json`,di(e[0]),"application/json");const t={},s=e.map((e=>{const s=zo(ci(e)||e.slug);return t[s]=(t[s]||0)+1,{name:s+(t[s]>1?"-"+(t[s]-1):"")+".json",lastModified:new Date,input:di(e)}}));return(0,ii.downloadBlob)((0,ms.__)("patterns-export")+".zip",await oi(s).blob(),"application/zip")}},pi={id:"permanently-delete",label:(0,ms.__)("Permanently delete"),supportsBulk:!0,icon:tn,isEligible(e){if(function(e){return e.type===ai||e.type===li}(e)||"wp_block"===e.type)return!1;const{status:t,permissions:s}=e;return"trash"===t&&s?.delete},async callback(e,{registry:t,onActionPerformed:s}){const{createSuccessNotice:o,createErrorNotice:n}=t.dispatch(hs.store),{deleteEntityRecord:i}=t.dispatch(d.store),r=await Promise.allSettled(e.map((e=>i("postType",e.type,e.id,{force:!0},{throwOnError:!0}))));if(r.every((({status:e})=>"fulfilled"===e))){let t;t=1===r.length?(0,ms.sprintf)((0,ms.__)('"%s" permanently deleted.'),ci(e[0])):(0,ms.__)("The items were permanently deleted."),o(t,{type:"snackbar",id:"permanently-delete-post-action"}),s?.(e)}else{let e;if(1===r.length){const t=r[0];e=t.reason?.message?t.reason.message:(0,ms.__)("An error occurred while permanently deleting the item.")}else{const t=new Set,s=r.filter((({status:e})=>"rejected"===e));for(const e of s){const s=e;s.reason?.message&&t.add(s.reason.message)}e=0===t.size?(0,ms.__)("An error occurred while permanently deleting the items."):1===t.size?(0,ms.sprintf)((0,ms.__)("An error occurred while permanently deleting the items: %s"),[...t][0]):(0,ms.sprintf)((0,ms.__)("Some errors occurred while permanently deleting the items: %s"),[...t].join(","))}n(e,{type:"snackbar"})}}},hi=pi,{PATTERN_TYPES:mi}=Xo(nn.privateApis),gi={id:"delete-post",label:(0,ms.__)("Delete"),isPrimary:!0,icon:tn,isEligible:e=>Go(e)?Wo(e):e.type===mi.user,supportsBulk:!0,hideModalHeader:!0,RenderModal:({items:e,closeModal:t,onActionPerformed:s})=>{const[o,n]=(0,u.useState)(!1),{removeTemplates:i}=Xo((0,c.useDispatch)(Wi));return(0,P.jsxs)(Ao.__experimentalVStack,{spacing:"5",children:[(0,P.jsx)(Ao.__experimentalText,{children:e.length>1?(0,ms.sprintf)((0,ms._n)("Delete %d item?","Delete %d items?",e.length),e.length):(0,ms.sprintf)((0,ms._x)('Delete "%s"?',"template part"),$o(e[0]))}),(0,P.jsxs)(Ao.__experimentalHStack,{justify:"right",children:[(0,P.jsx)(Ao.Button,{variant:"tertiary",onClick:t,disabled:o,accessibleWhenDisabled:!0,__next40pxDefaultSize:!0,children:(0,ms.__)("Cancel")}),(0,P.jsx)(Ao.Button,{variant:"primary",onClick:async()=>{n(!0),await i(e,{allowUndo:!1}),s?.(e),n(!1),t?.()},isBusy:o,disabled:o,accessibleWhenDisabled:!0,__next40pxDefaultSize:!0,children:(0,ms.__)("Delete")})]})]})}},_i=gi;function fi(e,t,s){return{type:"REGISTER_ENTITY_ACTION",kind:e,name:t,config:s}}function bi(e,t,s){return{type:"UNREGISTER_ENTITY_ACTION",kind:e,name:t,actionId:s}}function yi(e,t){return{type:"SET_IS_READY",kind:e,name:t}}const xi=e=>async({registry:t})=>{if(Xo(t.select(Wi)).isEntityReady("postType",e))return;Xo(t.dispatch(Wi)).setIsReady("postType",e);const s=await t.resolveSelect(d.store).getPostType(e),o=await t.resolveSelect(d.store).canUser("create",{kind:"postType",name:e}),n=await t.resolveSelect(d.store).getCurrentTheme(),i=[s.viewable?un:void 0,s?.supports?.revisions?pn:void 0,void 0,"wp_template_part"===s.slug&&o&&n?.is_block_theme?Yo:void 0,o&&"wp_block"===s.slug?bn:void 0,s.supports?.title?ln:void 0,s?.supports?.["page-attributes"]?Dn:void 0,"wp_block"===s.slug?ui:void 0,en,cn,_i,on,hi];t.batch((()=>{i.forEach((s=>{s&&Xo(t.dispatch(Wi)).registerEntityAction("postType",e,s)}))})),(0,h.doAction)("core.registerPostTypeActions",e)};function vi(e){return{type:"SET_CURRENT_TEMPLATE_ID",id:e}}const wi=e=>async({select:t,dispatch:s,registry:o})=>{const n=await o.dispatch(d.store).saveEntityRecord("postType","wp_template",e);return o.dispatch(d.store).editEntityRecord("postType",t.getCurrentPostType(),t.getCurrentPostId(),{template:n.slug}),o.dispatch(hs.store).createSuccessNotice((0,ms.__)("Custom template created. You're in template mode now."),{type:"snackbar",actions:[{label:(0,ms.__)("Go back"),onClick:()=>s.setRenderingMode(t.getEditorSettings().defaultRenderingMode)}]}),n},Si=e=>({registry:t})=>{var s;const o=(null!==(s=t.select(j.store).get("core","hiddenBlockTypes"))&&void 0!==s?s:[]).filter((t=>!(Array.isArray(e)?e:[e]).includes(t)));t.dispatch(j.store).set("core","hiddenBlockTypes",o)},ki=e=>({registry:t})=>{var s;const o=null!==(s=t.select(j.store).get("core","hiddenBlockTypes"))&&void 0!==s?s:[],n=new Set([...o,...Array.isArray(e)?e:[e]]);t.dispatch(j.store).set("core","hiddenBlockTypes",[...n])},Pi=({onSave:e,dirtyEntityRecords:t=[],entitiesToSkip:s=[],close:o}={})=>({registry:n})=>{const i=[{kind:"postType",name:"wp_navigation"}],r="site-editor-save-success",a=n.select(d.store).getEntityRecord("root","__unstableBase")?.home;n.dispatch(hs.store).removeNotice(r);const l=t.filter((({kind:e,name:t,key:o,property:n})=>!s.some((s=>s.kind===e&&s.name===t&&s.key===o&&s.property===n))));o?.(l);const c=[],u=[];l.forEach((({kind:e,name:t,key:s,property:o})=>{"root"===e&&"site"===t?c.push(o):(i.some((s=>s.kind===e&&s.name===t))&&n.dispatch(d.store).editEntityRecord(e,t,s,{status:"publish"}),u.push(n.dispatch(d.store).saveEditedEntityRecord(e,t,s)))})),c.length&&u.push(n.dispatch(d.store).__experimentalSaveSpecifiedEntityEdits("root","site",void 0,c)),n.dispatch(m.store).__unstableMarkLastChangeAsPersistent(),Promise.all(u).then((t=>e?e(t):t)).then((e=>{e.some((e=>void 0===e))?n.dispatch(hs.store).createErrorNotice((0,ms.__)("Saving failed.")):n.dispatch(hs.store).createSuccessNotice((0,ms.__)("Site updated."),{type:"snackbar",id:r,actions:[{label:(0,ms.__)("View site"),url:a}]})})).catch((e=>n.dispatch(hs.store).createErrorNotice(`${(0,ms.__)("Saving failed.")} ${e}`)))},Ci=(e,{allowUndo:t=!0}={})=>async({registry:s})=>{const o="edit-site-template-reverted";var n;if(s.dispatch(hs.store).removeNotice(o),(n=e)&&n.source===L&&(Boolean(n?.plugin)||n?.has_theme_file))try{const n=s.select(d.store).getEntityConfig("postType",e.type);if(!n)return void s.dispatch(hs.store).createErrorNotice((0,ms.__)("The editor has encountered an unexpected error. Please reload."),{type:"snackbar"});const i=(0,v.addQueryArgs)(`${n.baseURL}/${e.id}`,{context:"edit",source:e.origin}),r=await ps()({path:i});if(!r)return void s.dispatch(hs.store).createErrorNotice((0,ms.__)("The editor has encountered an unexpected error. Please reload."),{type:"snackbar"});const a=({blocks:e=[]})=>(0,y.__unstableSerializeAndClean)(e),l=s.select(d.store).getEditedEntityRecord("postType",e.type,e.id);s.dispatch(d.store).editEntityRecord("postType",e.type,e.id,{content:a,blocks:l.blocks,source:"custom"},{undoIgnore:!0});const c=(0,y.parse)(r?.content?.raw);if(s.dispatch(d.store).editEntityRecord("postType",e.type,r.id,{content:a,blocks:c,source:"theme"}),t){const t=()=>{s.dispatch(d.store).editEntityRecord("postType",e.type,l.id,{content:a,blocks:l.blocks,source:"custom"})};s.dispatch(hs.store).createSuccessNotice((0,ms.__)("Template reset."),{type:"snackbar",id:o,actions:[{label:(0,ms.__)("Undo"),onClick:t}]})}}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,ms.__)("Template revert failed. Please reload.");s.dispatch(hs.store).createErrorNotice(t,{type:"snackbar"})}else s.dispatch(hs.store).createErrorNotice((0,ms.__)("This template is not revertable."),{type:"snackbar"})},ji=e=>async({registry:t})=>{const s=e.every((e=>e?.has_theme_file)),o=await Promise.allSettled(e.map((e=>t.dispatch(d.store).deleteEntityRecord("postType",e.type,e.id,{force:!0},{throwOnError:!0}))));if(o.every((({status:e})=>"fulfilled"===e))){let o;if(1===e.length){let t;"string"==typeof e[0].title?t=e[0].title:"string"==typeof e[0].title?.rendered?t=e[0].title?.rendered:"string"==typeof e[0].title?.raw&&(t=e[0].title?.raw),o=s?(0,ms.sprintf)((0,ms.__)('"%s" reset.'),(0,No.decodeEntities)(t)):(0,ms.sprintf)((0,ms._x)('"%s" deleted.',"template part"),(0,No.decodeEntities)(t))}else o=s?(0,ms.__)("Items reset."):(0,ms.__)("Items deleted.");t.dispatch(hs.store).createSuccessNotice(o,{type:"snackbar",id:"editor-template-deleted-success"})}else{let e;if(1===o.length)e=o[0].reason?.message?o[0].reason.message:s?(0,ms.__)("An error occurred while reverting the item."):(0,ms.__)("An error occurred while deleting the item.");else{const t=new Set,n=o.filter((({status:e})=>"rejected"===e));for(const e of n)e.reason?.message&&t.add(e.reason.message);e=0===t.size?(0,ms.__)("An error occurred while deleting the items."):1===t.size?s?(0,ms.sprintf)((0,ms.__)("An error occurred while reverting the items: %s"),[...t][0]):(0,ms.sprintf)((0,ms.__)("An error occurred while deleting the items: %s"),[...t][0]):s?(0,ms.sprintf)((0,ms.__)("Some errors occurred while reverting the items: %s"),[...t].join(",")):(0,ms.sprintf)((0,ms.__)("Some errors occurred while deleting the items: %s"),[...t].join(","))}t.dispatch(hs.store).createErrorNotice(e,{type:"snackbar"})}};var Ei=s(5215),Ti=s.n(Ei);const Bi=(0,P.jsx)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,P.jsx)(k.Path,{d:"M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-1 1.4l-5.6 5.6c-.1.1-.3.1-.4 0l-5.6-5.6c-.1-.1-.1-.3 0-.4l5.6-5.6s.1-.1.2-.1.1 0 .2.1l5.6 5.6c.1.1.1.3 0 .4zm-16.6-.4L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"})}),Ii=(0,P.jsx)(k.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,P.jsx)(k.Path,{d:"M12 4c-4.4 0-8 3.6-8 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8zm0 14.5c-3.6 0-6.5-2.9-6.5-6.5S8.4 5.5 12 5.5s6.5 2.9 6.5 6.5-2.9 6.5-6.5 6.5zM9 16l4.5-3L15 8.4l-4.5 3L9 16z"})}),Ni=(0,P.jsxs)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,P.jsx)(k.Path,{d:"M15.5 7.5h-7V9h7V7.5Zm-7 3.5h7v1.5h-7V11Zm7 3.5h-7V16h7v-1.5Z"}),(0,P.jsx)(k.Path,{d:"M17 4H7a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2ZM7 5.5h10a.5.5 0 0 1 .5.5v12a.5.5 0 0 1-.5.5H7a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .5-.5Z"})]}),Ai=(0,P.jsx)(k.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,P.jsx)(k.Path,{d:"M17.8 2l-.9.3c-.1 0-3.6 1-5.2 2.1C10 5.5 9.3 6.5 8.9 7.1c-.6.9-1.7 4.7-1.7 6.3l-.9 2.3c-.2.4 0 .8.4 1 .1 0 .2.1.3.1.3 0 .6-.2.7-.5l.6-1.5c.3 0 .7-.1 1.2-.2.7-.1 1.4-.3 2.2-.5.8-.2 1.6-.5 2.4-.8.7-.3 1.4-.7 1.9-1.2s.8-1.2 1-1.9c.2-.7.3-1.6.4-2.4.1-.8.1-1.7.2-2.5 0-.8.1-1.5.2-2.1V2zm-1.9 5.6c-.1.8-.2 1.5-.3 2.1-.2.6-.4 1-.6 1.3-.3.3-.8.6-1.4.9-.7.3-1.4.5-2.2.8-.6.2-1.3.3-1.8.4L15 7.5c.3-.3.6-.7 1-1.1 0 .4 0 .8-.1 1.2zM6 20h8v-1.5H6V20z"})}),Di=[];const Ri={rootClientId:void 0,insertionIndex:void 0,filterValue:void 0},Mi=(0,c.createRegistrySelector)((e=>(0,c.createSelector)((t=>{if("object"==typeof t.blockInserterPanel)return t.blockInserterPanel;if("template-locked"===Je(t)){const[t]=e(m.store).getBlocksByName("core/post-content");if(t)return{rootClientId:t,insertionIndex:void 0,filterValue:void 0}}return Ri}),(t=>{const[s]=e(m.store).getBlocksByName("core/post-content");return[t.blockInserterPanel,Je(t),s]}))));function Oi(e){return e.listViewToggleRef}function Li(e){return e.inserterSidebarToggleRef}const Fi={wp_block:Bi,wp_navigation:Ii,page:Ni,post:Ai},Vi=(0,c.createRegistrySelector)((e=>(t,s,o)=>{{if("wp_template_part"===s||"wp_template"===s)return is(t).find((e=>o.area===e.area))?.icon||C;if(Fi[s])return Fi[s];const n=e(d.store).getPostType(s);return"string"==typeof n?.icon&&n.icon.startsWith("dashicons-")?n.icon.slice(10):Ni}})),zi=(0,c.createRegistrySelector)((e=>(t,s,o)=>{const{type:n,id:i}=ee(t),r=e(d.store).getEntityRecordNonTransientEdits("postType",s||n,o||i);if(!r?.meta)return!1;const a=e(d.store).getEntityRecord("postType",s||n,o||i)?.meta;return!Ti()({...a,footnotes:void 0},{...r.meta,footnotes:void 0})}));function Ui(e,...t){return function(e,t,s){var o;return null!==(o=e.actions[t]?.[s])&&void 0!==o?o:Di}(e.dataviews,...t)}function Hi(e,...t){return function(e,t,s){return e.isReady[t]?.[s]}(e.dataviews,...t)}const Gi=(0,c.createRegistrySelector)((e=>(0,c.createSelector)(((t,s)=>{s=Array.isArray(s)?s:[s];const{getBlocksByName:o,getBlockParents:n,getBlockName:i}=e(m.store);return o(s).filter((e=>n(e).every((e=>{const t=i(e);return"core/query"!==t&&!s.includes(t)}))))}),(()=>[e(m.store).getBlocks()])))),$i={reducer:b,selectors:e,actions:t},Wi=(0,c.createReduxStore)("core/editor",{...$i});(0,c.register)(Wi),Xo(Wi).registerPrivateActions(n),Xo(Wi).registerPrivateSelectors(i);function Zi(e){const t=e.avatar_urls&&e.avatar_urls[24]?(0,P.jsx)("img",{className:"editor-autocompleters__user-avatar",alt:"",src:e.avatar_urls[24]}):(0,P.jsx)("span",{className:"editor-autocompleters__no-avatar"});return(0,P.jsxs)(P.Fragment,{children:[t,(0,P.jsx)("span",{className:"editor-autocompleters__user-name",children:e.name}),(0,P.jsx)("span",{className:"editor-autocompleters__user-slug",children:e.slug})]})}(0,h.addFilter)("blocks.registerBlockType","core/editor/custom-sources-backwards-compatibility/shim-attribute-source",(function(e){var t;const s=Object.fromEntries(Object.entries(null!==(t=e.attributes)&&void 0!==t?t:{}).filter((([,{source:e}])=>"meta"===e)).map((([e,{meta:t}])=>[e,t])));return Object.entries(s).length&&(e.edit=(e=>(0,p.createHigherOrderComponent)((t=>({attributes:s,setAttributes:o,...n})=>{const i=(0,c.useSelect)((e=>e(Wi).getCurrentPostType()),[]),[r,a]=(0,d.useEntityProp)("postType",i,"meta"),l=(0,u.useMemo)((()=>({...s,...Object.fromEntries(Object.entries(e).map((([e,t])=>[e,r[t]])))})),[s,r]);return(0,P.jsx)(t,{attributes:l,setAttributes:t=>{const s=Object.fromEntries(Object.entries(null!=t?t:{}).filter((([t])=>t in e)).map((([t,s])=>[e[t],s])));Object.entries(s).length&&a(s),o(t)},...n})}),"withMetaAttributeSource"))(s)(e.edit)),e}));const Yi={name:"users",className:"editor-autocompleters__user",triggerPrefix:"@",useItems(e){const t=(0,c.useSelect)((t=>{const{getUsers:s}=t(d.store);return s({context:"view",search:encodeURIComponent(e)})}),[e]),s=(0,u.useMemo)((()=>t?t.map((e=>({key:`user-${e.slug}`,value:e,label:Zi(e)}))):[]),[t]);return[s]},getOptionCompletion:e=>`@${e.slug}`};(0,h.addFilter)("editor.Autocomplete.completers","editor/autocompleters/set-default-completers",(function(e=[]){return e.push({...Yi}),e}));const Ki=window.wp.mediaUtils;(0,h.addFilter)("editor.MediaUpload","core/editor/components/media-upload",(()=>Ki.MediaUpload));const{PatternOverridesControls:qi,ResetOverridesControl:Qi,PatternOverridesBlockControls:Xi,PATTERN_TYPES:Ji,PARTIAL_SYNCING_SUPPORTED_BLOCKS:er,PATTERN_SYNC_TYPES:tr}=Xo(nn.privateApis),sr=(0,p.createHigherOrderComponent)((e=>t=>{const s=!!er[t.name];return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(e,{...t},"edit"),t.isSelected&&s&&(0,P.jsx)(or,{...t}),s&&(0,P.jsx)(Xi,{})]})}),"withPatternOverrideControls");function or(e){const t=(0,m.useBlockEditingMode)(),{hasPatternOverridesSource:s,isEditingSyncedPattern:o}=(0,c.useSelect)((e=>{const{getCurrentPostType:t,getEditedPostAttribute:s}=e(Wi);return{hasPatternOverridesSource:!!(0,y.getBlockBindingsSource)("core/pattern-overrides"),isEditingSyncedPattern:t()===Ji.user&&s("meta")?.wp_pattern_sync_status!==tr.unsynced&&s("wp_pattern_sync_status")!==tr.unsynced}}),[]),n=e.attributes.metadata?.bindings,i=!!n&&Object.values(n).some((e=>"core/pattern-overrides"===e.source)),r=o&&"default"===t,a=!o&&!!e.attributes.metadata?.name&&"disabled"!==t&&i;return s?(0,P.jsxs)(P.Fragment,{children:[r&&(0,P.jsx)(qi,{...e}),a&&(0,P.jsx)(Qi,{...e})]}):null}(0,h.addFilter)("editor.BlockEdit","core/editor/with-pattern-override-controls",sr);const nr=window.wp.keyboardShortcuts;function ir(e){var t,s,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e)){var n=e.length;for(t=0;t({type:"SET_DEFAULT_COMPLEMENTARY_AREA",scope:e=dr(e),area:t=ur(e,t)}),hr=(e,t)=>({registry:s,dispatch:o})=>{if(!t)return;e=dr(e),t=ur(e,t);s.select(j.store).get(e,"isComplementaryAreaVisible")||s.dispatch(j.store).set(e,"isComplementaryAreaVisible",!0),o({type:"ENABLE_COMPLEMENTARY_AREA",scope:e,area:t})},mr=e=>({registry:t})=>{e=dr(e);t.select(j.store).get(e,"isComplementaryAreaVisible")&&t.dispatch(j.store).set(e,"isComplementaryAreaVisible",!1)},gr=(e,t)=>({registry:s})=>{if(!t)return;e=dr(e),t=ur(e,t);const o=s.select(j.store).get(e,"pinnedItems");!0!==o?.[t]&&s.dispatch(j.store).set(e,"pinnedItems",{...o,[t]:!0})},_r=(e,t)=>({registry:s})=>{if(!t)return;e=dr(e),t=ur(e,t);const o=s.select(j.store).get(e,"pinnedItems");s.dispatch(j.store).set(e,"pinnedItems",{...o,[t]:!1})};function fr(e,t){return function({registry:s}){S()("dispatch( 'core/interface' ).toggleFeature",{since:"6.0",alternative:"dispatch( 'core/preferences' ).toggle"}),s.dispatch(j.store).toggle(e,t)}}function br(e,t,s){return function({registry:o}){S()("dispatch( 'core/interface' ).setFeatureValue",{since:"6.0",alternative:"dispatch( 'core/preferences' ).set"}),o.dispatch(j.store).set(e,t,!!s)}}function yr(e,t){return function({registry:s}){S()("dispatch( 'core/interface' ).setFeatureDefaults",{since:"6.0",alternative:"dispatch( 'core/preferences' ).setDefaults"}),s.dispatch(j.store).setDefaults(e,t)}}function xr(e){return{type:"OPEN_MODAL",name:e}}function vr(){return{type:"CLOSE_MODAL"}}const wr=(0,c.createRegistrySelector)((e=>(t,s)=>{s=dr(s);const o=e(j.store).get(s,"isComplementaryAreaVisible");if(void 0!==o)return!1===o?null:t?.complementaryAreas?.[s]})),Sr=(0,c.createRegistrySelector)((e=>(t,s)=>{s=dr(s);const o=e(j.store).get(s,"isComplementaryAreaVisible"),n=t?.complementaryAreas?.[s];return o&&void 0===n})),kr=(0,c.createRegistrySelector)((e=>(t,s,o)=>{var n;o=ur(s=dr(s),o);const i=e(j.store).get(s,"pinnedItems");return null===(n=i?.[o])||void 0===n||n})),Pr=(0,c.createRegistrySelector)((e=>(t,s,o)=>(S()("select( 'core/interface' ).isFeatureActive( scope, featureName )",{since:"6.0",alternative:"select( 'core/preferences' ).get( scope, featureName )"}),!!e(j.store).get(s,o))));function Cr(e,t){return e.activeModal===t}const jr=(0,c.combineReducers)({complementaryAreas:function(e={},t){switch(t.type){case"SET_DEFAULT_COMPLEMENTARY_AREA":{const{scope:s,area:o}=t;return e[s]?e:{...e,[s]:o}}case"ENABLE_COMPLEMENTARY_AREA":{const{scope:s,area:o}=t;return{...e,[s]:o}}}return e},activeModal:function(e=null,t){switch(t.type){case"OPEN_MODAL":return t.name;case"CLOSE_MODAL":return null}return e}}),Er=(0,c.createReduxStore)("core/interface",{reducer:jr,actions:r,selectors:a});(0,c.register)(Er);const Tr=window.wp.plugins,Br=(0,Tr.withPluginContext)(((e,t)=>({icon:t.icon||e.icon,identifier:t.identifier||`${e.name}/${t.name}`})));const Ir=Br((function({as:e=Ao.Button,scope:t,identifier:s,icon:o,selectedIcon:n,name:i,shortcut:r,...a}){const l=e,d=(0,c.useSelect)((e=>e(Er).getActiveComplementaryArea(t)===s),[s,t]),{enableComplementaryArea:u,disableComplementaryArea:p}=(0,c.useDispatch)(Er);return(0,P.jsx)(l,{icon:n&&d?n:o,"aria-controls":s.replace("/",":"),"aria-checked":(h=a.role,["checkbox","option","radio","switch","menuitemcheckbox","menuitemradio","treeitem"].includes(h)?d:void 0),onClick:()=>{d?p(t):u(t,s)},shortcut:r,...a});var h})),Nr=({smallScreenTitle:e,children:t,className:s,toggleButtonProps:o})=>{const n=(0,P.jsx)(Ir,{icon:Cn,...o});return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)("div",{className:"components-panel__header interface-complementary-area-header__small",children:[e&&(0,P.jsx)("h2",{className:"interface-complementary-area-header__small-title",children:e}),n]}),(0,P.jsxs)("div",{className:rr("components-panel__header","interface-complementary-area-header",s),tabIndex:-1,children:[t,n]})]})},Ar=()=>{};function Dr({name:e,as:t=Ao.Button,onClick:s,...o}){return(0,P.jsx)(Ao.Fill,{name:e,children:({onClick:e})=>(0,P.jsx)(t,{onClick:s||e?(...t)=>{(s||Ar)(...t),(e||Ar)(...t)}:void 0,...o})})}Dr.Slot=function({name:e,as:t=Ao.ButtonGroup,fillProps:s={},bubblesVirtually:o,...n}){return(0,P.jsx)(Ao.Slot,{name:e,bubblesVirtually:o,fillProps:s,children:e=>{if(!u.Children.toArray(e).length)return null;const s=[];u.Children.forEach(e,(({props:{__unstableExplicitMenuItem:e,__unstableTarget:t}})=>{t&&e&&s.push(t)}));const o=u.Children.map(e,(e=>!e.props.__unstableExplicitMenuItem&&s.includes(e.props.__unstableTarget)?null:e));return(0,P.jsx)(t,{...n,children:o})}})};const Rr=Dr,Mr=({__unstableExplicitMenuItem:e,__unstableTarget:t,...s})=>(0,P.jsx)(Ao.MenuItem,{...s});function Or({scope:e,target:t,__unstableExplicitMenuItem:s,...o}){return(0,P.jsx)(Ir,{as:o=>(0,P.jsx)(Rr,{__unstableExplicitMenuItem:s,__unstableTarget:`${e}/${t}`,as:Mr,name:`${e}/plugin-more-menu`,...o}),role:"menuitemcheckbox",selectedIcon:Do,name:t,scope:e,...o})}function Lr({scope:e,...t}){return(0,P.jsx)(Ao.Fill,{name:`PinnedItems/${e}`,...t})}Lr.Slot=function({scope:e,className:t,...s}){return(0,P.jsx)(Ao.Slot,{name:`PinnedItems/${e}`,...s,children:e=>e?.length>0&&(0,P.jsx)("div",{className:rr(t,"interface-pinned-items"),children:e})})};const Fr=Lr;const Vr={open:{width:280},closed:{width:0},mobileOpen:{width:"100vw"}};function zr({activeArea:e,isActive:t,scope:s,children:o,className:n,id:i}){const r=(0,p.useReducedMotion)(),a=(0,p.useViewportMatch)("medium","<"),l=(0,p.usePrevious)(e),c=(0,p.usePrevious)(t),[,d]=(0,u.useState)({});(0,u.useEffect)((()=>{d({})}),[t]);const h={type:"tween",duration:r||a||l&&e&&e!==l?0:.3,ease:[.6,0,.4,1]};return(0,P.jsx)(Ao.Fill,{name:`ComplementaryArea/${s}`,children:(0,P.jsx)(Ao.__unstableAnimatePresence,{initial:!1,children:(c||t)&&(0,P.jsx)(Ao.__unstableMotion.div,{variants:Vr,initial:"closed",animate:a?"mobileOpen":"open",exit:"closed",transition:h,className:"interface-complementary-area__fill",children:(0,P.jsx)("div",{id:i,className:n,style:{width:a?"100vw":280},children:o})})})})}const Ur=Br((function({children:e,className:t,closeLabel:s=(0,ms.__)("Close plugin"),identifier:o,header:n,headerClassName:i,icon:r,isPinnable:a=!0,panelClassName:l,scope:d,name:p,smallScreenTitle:h,title:m,toggleShortcut:g,isActiveByDefault:_}){const[f,b]=(0,u.useState)(!1),{isLoading:y,isActive:x,isPinned:v,activeArea:w,isSmall:S,isLarge:k,showIconLabels:C}=(0,c.useSelect)((e=>{const{getActiveComplementaryArea:t,isComplementaryAreaLoading:s,isItemPinned:n}=e(Er),{get:i}=e(j.store),r=t(d);return{isLoading:s(d),isActive:r===o,isPinned:n(d,o),activeArea:r,isSmall:e(cr.store).isViewportMatch("< medium"),isLarge:e(cr.store).isViewportMatch("large"),showIconLabels:i("core","showIconLabels")}}),[o,d]);!function(e,t,s,o,n){const i=(0,u.useRef)(!1),r=(0,u.useRef)(!1),{enableComplementaryArea:a,disableComplementaryArea:l}=(0,c.useDispatch)(Er);(0,u.useEffect)((()=>{o&&n&&!i.current?(l(e),r.current=!0):r.current&&!n&&i.current?(r.current=!1,a(e,t)):r.current&&s&&s!==t&&(r.current=!1),n!==i.current&&(i.current=n)}),[o,n,e,t,s,l,a])}(d,o,w,x,S);const{enableComplementaryArea:E,disableComplementaryArea:T,pinItem:B,unpinItem:I}=(0,c.useDispatch)(Er);if((0,u.useEffect)((()=>{_&&void 0===w&&!S?E(d,o):void 0===w&&S&&T(d,o),b(!0)}),[w,_,d,o,S,E,T]),f)return(0,P.jsxs)(P.Fragment,{children:[a&&(0,P.jsx)(Fr,{scope:d,children:v&&(0,P.jsx)(Ir,{scope:d,identifier:o,isPressed:x&&(!C||k),"aria-expanded":x,"aria-disabled":y,label:m,icon:C?Do:r,showTooltip:!C,variant:C?"tertiary":void 0,size:"compact",shortcut:g})}),p&&a&&(0,P.jsx)(Or,{target:p,scope:d,icon:r,children:m}),(0,P.jsxs)(zr,{activeArea:w,isActive:x,className:rr("interface-complementary-area",t),scope:d,id:o.replace("/",":"),children:[(0,P.jsx)(Nr,{className:i,closeLabel:s,onClose:()=>T(d),smallScreenTitle:h,toggleButtonProps:{label:s,size:"small",shortcut:g,scope:d,identifier:o},children:n||(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)("h2",{className:"interface-complementary-area-header__title",children:m}),a&&(0,P.jsx)(Ao.Button,{className:"interface-complementary-area__pin-unpin-item",icon:v?ar:lr,label:v?(0,ms.__)("Unpin from toolbar"):(0,ms.__)("Pin to toolbar"),onClick:()=>(v?I:B)(d,o),isPressed:v,"aria-expanded":v,size:"compact"})]})}),(0,P.jsx)(Ao.Panel,{className:l,children:e})]})]})}));Ur.Slot=function({scope:e,...t}){return(0,P.jsx)(Ao.Slot,{name:`ComplementaryArea/${e}`,...t})};const Hr=Ur,Gr=({isActive:e})=>((0,u.useEffect)((()=>{let e=!1;return document.body.classList.contains("sticky-menu")&&(e=!0,document.body.classList.remove("sticky-menu")),()=>{e&&document.body.classList.add("sticky-menu")}}),[]),(0,u.useEffect)((()=>(e?document.body.classList.add("is-fullscreen-mode"):document.body.classList.remove("is-fullscreen-mode"),()=>{e&&document.body.classList.remove("is-fullscreen-mode")})),[e]),null),$r=(0,u.forwardRef)((({children:e,className:t,ariaLabel:s,as:o="div",...n},i)=>(0,P.jsx)(o,{ref:i,className:rr("interface-navigable-region",t),"aria-label":s,role:"region",tabIndex:"-1",...n,children:e})));$r.displayName="NavigableRegion";const Wr=$r,Zr={type:"tween",duration:.25,ease:[.6,0,.4,1]};const Yr={hidden:{opacity:1,marginTop:-60},visible:{opacity:1,marginTop:0},distractionFreeHover:{opacity:1,marginTop:0,transition:{...Zr,delay:.2,delayChildren:.2}},distractionFreeHidden:{opacity:0,marginTop:-60},distractionFreeDisabled:{opacity:0,marginTop:0,transition:{...Zr,delay:.8,delayChildren:.8}}};const Kr=(0,u.forwardRef)((function({isDistractionFree:e,footer:t,header:s,editorNotices:o,sidebar:n,secondarySidebar:i,content:r,actions:a,labels:l,className:c},d){const[h,m]=(0,p.useResizeObserver)(),g=(0,p.useViewportMatch)("medium","<"),_={type:"tween",duration:(0,p.useReducedMotion)()?0:.25,ease:[.6,0,.4,1]};!function(e){(0,u.useEffect)((()=>{const t=document&&document.querySelector(`html:not(.${e})`);if(t)return t.classList.toggle(e),()=>{t.classList.toggle(e)}}),[e])}("interface-interface-skeleton__html-container");const f={...{header:(0,ms._x)("Header","header landmark area"),body:(0,ms.__)("Content"),secondarySidebar:(0,ms.__)("Block Library"),sidebar:(0,ms._x)("Settings","settings landmark area"),actions:(0,ms.__)("Publish"),footer:(0,ms.__)("Footer")},...l};return(0,P.jsxs)("div",{ref:d,className:rr(c,"interface-interface-skeleton",!!t&&"has-footer"),children:[(0,P.jsxs)("div",{className:"interface-interface-skeleton__editor",children:[(0,P.jsx)(Ao.__unstableAnimatePresence,{initial:!1,children:!!s&&(0,P.jsx)(Wr,{as:Ao.__unstableMotion.div,className:"interface-interface-skeleton__header","aria-label":f.header,initial:e&&!g?"distractionFreeHidden":"hidden",whileHover:e&&!g?"distractionFreeHover":"visible",animate:e&&!g?"distractionFreeDisabled":"visible",exit:e&&!g?"distractionFreeHidden":"hidden",variants:Yr,transition:_,children:s})}),e&&(0,P.jsx)("div",{className:"interface-interface-skeleton__header",children:o}),(0,P.jsxs)("div",{className:"interface-interface-skeleton__body",children:[(0,P.jsx)(Ao.__unstableAnimatePresence,{initial:!1,children:!!i&&(0,P.jsx)(Wr,{className:"interface-interface-skeleton__secondary-sidebar",ariaLabel:f.secondarySidebar,as:Ao.__unstableMotion.div,initial:"closed",animate:"open",exit:"closed",variants:{open:{width:m.width},closed:{width:0}},transition:_,children:(0,P.jsxs)(Ao.__unstableMotion.div,{style:{position:"absolute",width:g?"100vw":"fit-content",height:"100%",left:0},variants:{open:{x:0},closed:{x:"-100%"}},transition:_,children:[h,i]})})}),(0,P.jsx)(Wr,{className:"interface-interface-skeleton__content",ariaLabel:f.body,children:r}),!!n&&(0,P.jsx)(Wr,{className:"interface-interface-skeleton__sidebar",ariaLabel:f.sidebar,children:n}),!!a&&(0,P.jsx)(Wr,{className:"interface-interface-skeleton__actions",ariaLabel:f.actions,children:a})]})]}),!!t&&(0,P.jsx)(Wr,{className:"interface-interface-skeleton__footer",ariaLabel:f.footer,children:t})]})}));function qr(){const e=(0,c.useSelect)((e=>{const{richEditingEnabled:t,codeEditingEnabled:s}=e(Wi).getEditorSettings();return!t||!s}),[]),{getBlockSelectionStart:t}=(0,c.useSelect)(m.store),{getActiveComplementaryArea:s}=(0,c.useSelect)(Er),{enableComplementaryArea:o,disableComplementaryArea:n}=(0,c.useDispatch)(Er),{redo:i,undo:r,savePost:a,setIsListViewOpened:l,switchEditorMode:d,toggleDistractionFree:u}=(0,c.useDispatch)(Wi),{isEditedPostDirty:p,isPostSavingLocked:h,isListViewOpened:g,getEditorMode:_}=(0,c.useSelect)(Wi);return(0,nr.useShortcut)("core/editor/toggle-mode",(()=>{d("visual"===_()?"text":"visual")}),{isDisabled:e}),(0,nr.useShortcut)("core/editor/toggle-distraction-free",(()=>{u()})),(0,nr.useShortcut)("core/editor/undo",(e=>{r(),e.preventDefault()})),(0,nr.useShortcut)("core/editor/redo",(e=>{i(),e.preventDefault()})),(0,nr.useShortcut)("core/editor/save",(e=>{e.preventDefault(),h()||p()&&a()})),(0,nr.useShortcut)("core/editor/toggle-list-view",(e=>{g()||(e.preventDefault(),l(!0))})),(0,nr.useShortcut)("core/editor/toggle-sidebar",(e=>{e.preventDefault();if(["edit-post/document","edit-post/block"].includes(s("core")))n("core");else{const e=t()?"edit-post/block":"edit-post/document";o("core",e)}})),null}class Qr extends u.Component{constructor(e){super(e),this.needsAutosave=!(!e.isDirty||!e.isAutosaveable)}componentDidMount(){this.props.disableIntervalChecks||this.setAutosaveTimer()}componentDidUpdate(e){this.props.disableIntervalChecks?this.props.editsReference!==e.editsReference&&this.props.autosave():(this.props.interval!==e.interval&&(clearTimeout(this.timerId),this.setAutosaveTimer()),this.props.isDirty&&(!this.props.isAutosaving||e.isAutosaving)?this.props.editsReference!==e.editsReference&&(this.needsAutosave=!0):this.needsAutosave=!1)}componentWillUnmount(){clearTimeout(this.timerId)}setAutosaveTimer(e=1e3*this.props.interval){this.timerId=setTimeout((()=>{this.autosaveTimerHandler()}),e)}autosaveTimerHandler(){this.props.isAutosaveable?(this.needsAutosave&&(this.needsAutosave=!1,this.props.autosave()),this.setAutosaveTimer()):this.setAutosaveTimer(1e3)}render(){return null}}const Xr=(0,p.compose)([(0,c.withSelect)(((e,t)=>{const{getReferenceByDistinctEdits:s}=e(d.store),{isEditedPostDirty:o,isEditedPostAutosaveable:n,isAutosavingPost:i,getEditorSettings:r}=e(Wi),{interval:a=r().autosaveInterval}=t;return{editsReference:s(),isDirty:o(),isAutosaveable:n(),isAutosaving:i(),interval:a}})),(0,c.withDispatch)(((e,t)=>({autosave(){const{autosave:s=e(Wi).autosave}=t;s()}})))])(Qr),Jr=(0,P.jsx)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,P.jsx)(k.Path,{d:"M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z"})}),ea=(0,P.jsx)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,P.jsx)(k.Path,{d:"m13.1 16-3.4-4 3.4-4 1.1 1-2.6 3 2.6 3-1.1 1z"})}),ta=window.wp.keycodes,sa=window.wp.commands,oa=(0,Ao.__unstableMotion)(Ao.Button);function na(e){const{postType:t,postTypeLabel:s,documentTitle:o,isNotFound:n,isUnsyncedPattern:i,templateTitle:r,onNavigateToPreviousEntityRecord:a}=(0,c.useSelect)((e=>{const{getCurrentPostType:t,getCurrentPostId:s,getEditorSettings:o,__experimentalGetTemplateInfo:n}=e(Wi),{getEditedEntityRecord:i,getPostType:r,isResolving:a}=e(d.store),l=t(),c=s(),u=i("postType",l,c),p=n(u),h=r(l)?.labels?.singular_name;return{postType:l,postTypeLabel:h,documentTitle:u.title,isNotFound:!u&&!a("getEditedEntityRecord","postType",l,c),isUnsyncedPattern:"unsynced"===u?.wp_pattern_sync_status,templateTitle:p.title,onNavigateToPreviousEntityRecord:o().onNavigateToPreviousEntityRecord}}),[]),{open:l}=(0,c.useDispatch)(sa.store),h=(0,p.useReducedMotion)(),g=F.includes(t),_=V.includes(t),f=!!a,b=g?r:o,y=e.title||b,x=e.icon,v=(0,u.useRef)(!1);return(0,u.useEffect)((()=>{v.current=!0}),[]),(0,P.jsxs)("div",{className:rr("editor-document-bar",{"has-back-button":f,"is-global":_&&!i}),children:[(0,P.jsx)(Ao.__unstableAnimatePresence,{children:f&&(0,P.jsx)(oa,{className:"editor-document-bar__back",icon:(0,ms.isRTL)()?Jr:ea,onClick:e=>{e.stopPropagation(),a()},size:"compact",initial:!!v.current&&{opacity:0,transform:"translateX(15%)"},animate:{opacity:1,transform:"translateX(0%)"},exit:{opacity:0,transform:"translateX(15%)"},transition:h?{duration:0}:void 0,children:(0,ms.__)("Back")})}),n?(0,P.jsx)(Ao.__experimentalText,{children:(0,ms.__)("Document not found")}):(0,P.jsxs)(Ao.Button,{className:"editor-document-bar__command",onClick:()=>l(),size:"compact",children:[(0,P.jsxs)(Ao.__unstableMotion.div,{className:"editor-document-bar__title",initial:!!v.current&&{opacity:0,transform:f?"translateX(15%)":"translateX(-15%)"},animate:{opacity:1,transform:"translateX(0%)"},transition:h?{duration:0}:void 0,children:[x&&(0,P.jsx)(m.BlockIcon,{icon:x}),(0,P.jsxs)(Ao.__experimentalText,{size:"body",as:"h1",children:[(0,P.jsx)("span",{className:"editor-document-bar__post-title",children:y?(0,No.decodeEntities)(y):(0,ms.__)("No title")}),s&&!e.title&&(0,P.jsx)("span",{className:"editor-document-bar__post-type-label",children:"· "+(0,No.decodeEntities)(s)})]})]},f),(0,P.jsx)("span",{className:"editor-document-bar__shortcut",children:ta.displayShortcut.primary("k")})]})]})}const ia=window.wp.richText,ra=({children:e,isValid:t,level:s,href:o,onSelect:n})=>(0,P.jsx)("li",{className:rr("document-outline__item",`is-${s.toLowerCase()}`,{"is-invalid":!t}),children:(0,P.jsxs)("a",{href:o,className:"document-outline__button",onClick:n,children:[(0,P.jsx)("span",{className:"document-outline__emdash","aria-hidden":"true"}),(0,P.jsx)("strong",{className:"document-outline__level",children:s}),(0,P.jsx)("span",{className:"document-outline__item-content",children:e})]})}),aa=(0,P.jsx)("em",{children:(0,ms.__)("(Empty heading)")}),la=[(0,P.jsx)("br",{},"incorrect-break"),(0,P.jsx)("em",{children:(0,ms.__)("(Incorrect heading level)")},"incorrect-message")],ca=[(0,P.jsx)("br",{},"incorrect-break-h1"),(0,P.jsx)("em",{children:(0,ms.__)("(Your theme may already use a H1 for the post title)")},"incorrect-message-h1")],da=[(0,P.jsx)("br",{},"incorrect-break-multiple-h1"),(0,P.jsx)("em",{children:(0,ms.__)("(Multiple H1 headings are not recommended)")},"incorrect-message-multiple-h1")];function ua(){return(0,P.jsxs)(Ao.SVG,{width:"138",height:"148",viewBox:"0 0 138 148",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,P.jsx)(Ao.Rect,{width:"138",height:"148",rx:"4",fill:"#F0F6FC"}),(0,P.jsx)(Ao.Line,{x1:"44",y1:"28",x2:"24",y2:"28",stroke:"#DDDDDD"}),(0,P.jsx)(Ao.Rect,{x:"48",y:"16",width:"27",height:"23",rx:"4",fill:"#DDDDDD"}),(0,P.jsx)(Ao.Path,{d:"M54.7585 32V23.2727H56.6037V26.8736H60.3494V23.2727H62.1903V32H60.3494V28.3949H56.6037V32H54.7585ZM67.4574 23.2727V32H65.6122V25.0241H65.5611L63.5625 26.277V24.6406L65.723 23.2727H67.4574Z",fill:"black"}),(0,P.jsx)(Ao.Line,{x1:"55",y1:"59",x2:"24",y2:"59",stroke:"#DDDDDD"}),(0,P.jsx)(Ao.Rect,{x:"59",y:"47",width:"29",height:"23",rx:"4",fill:"#DDDDDD"}),(0,P.jsx)(Ao.Path,{d:"M65.7585 63V54.2727H67.6037V57.8736H71.3494V54.2727H73.1903V63H71.3494V59.3949H67.6037V63H65.7585ZM74.6605 63V61.6705L77.767 58.794C78.0313 58.5384 78.2528 58.3082 78.4318 58.1037C78.6136 57.8991 78.7514 57.6989 78.8452 57.5028C78.9389 57.304 78.9858 57.0895 78.9858 56.8594C78.9858 56.6037 78.9276 56.3835 78.8111 56.1989C78.6946 56.0114 78.5355 55.8679 78.3338 55.7685C78.1321 55.6662 77.9034 55.6151 77.6477 55.6151C77.3807 55.6151 77.1477 55.669 76.9489 55.777C76.75 55.8849 76.5966 56.0398 76.4886 56.2415C76.3807 56.4432 76.3267 56.6832 76.3267 56.9616H74.5753C74.5753 56.3906 74.7045 55.8949 74.9631 55.4744C75.2216 55.054 75.5838 54.7287 76.0497 54.4986C76.5156 54.2685 77.0526 54.1534 77.6605 54.1534C78.2855 54.1534 78.8295 54.2642 79.2926 54.4858C79.7585 54.7045 80.1207 55.0085 80.3793 55.3977C80.6378 55.7869 80.767 56.233 80.767 56.7358C80.767 57.0653 80.7017 57.3906 80.571 57.7116C80.4432 58.0327 80.2145 58.3892 79.8849 58.7812C79.5554 59.1705 79.0909 59.6378 78.4915 60.1832L77.2173 61.4318V61.4915H80.8821V63H74.6605Z",fill:"black"}),(0,P.jsx)(Ao.Line,{x1:"80",y1:"90",x2:"24",y2:"90",stroke:"#DDDDDD"}),(0,P.jsx)(Ao.Rect,{x:"84",y:"78",width:"30",height:"23",rx:"4",fill:"#F0B849"}),(0,P.jsx)(Ao.Path,{d:"M90.7585 94V85.2727H92.6037V88.8736H96.3494V85.2727H98.1903V94H96.3494V90.3949H92.6037V94H90.7585ZM99.5284 92.4659V91.0128L103.172 85.2727H104.425V87.2841H103.683L101.386 90.919V90.9872H106.564V92.4659H99.5284ZM103.717 94V92.0227L103.751 91.3793V85.2727H105.482V94H103.717Z",fill:"black"}),(0,P.jsx)(Ao.Line,{x1:"66",y1:"121",x2:"24",y2:"121",stroke:"#DDDDDD"}),(0,P.jsx)(Ao.Rect,{x:"70",y:"109",width:"29",height:"23",rx:"4",fill:"#DDDDDD"}),(0,P.jsx)(Ao.Path,{d:"M76.7585 125V116.273H78.6037V119.874H82.3494V116.273H84.1903V125H82.3494V121.395H78.6037V125H76.7585ZM88.8864 125.119C88.25 125.119 87.6832 125.01 87.1861 124.791C86.6918 124.57 86.3011 124.266 86.0142 123.879C85.7301 123.49 85.5838 123.041 85.5753 122.533H87.4332C87.4446 122.746 87.5142 122.933 87.642 123.095C87.7727 123.254 87.946 123.378 88.1619 123.466C88.3778 123.554 88.6207 123.598 88.8906 123.598C89.1719 123.598 89.4205 123.548 89.6364 123.449C89.8523 123.349 90.0213 123.212 90.1435 123.036C90.2656 122.859 90.3267 122.656 90.3267 122.426C90.3267 122.193 90.2614 121.987 90.1307 121.808C90.0028 121.626 89.8182 121.484 89.5767 121.382C89.3381 121.28 89.054 121.229 88.7244 121.229H87.9105V119.874H88.7244C89.0028 119.874 89.2486 119.825 89.4616 119.729C89.6776 119.632 89.8452 119.499 89.9645 119.328C90.0838 119.155 90.1435 118.953 90.1435 118.723C90.1435 118.504 90.0909 118.312 89.9858 118.148C89.8835 117.98 89.7386 117.849 89.5511 117.756C89.3665 117.662 89.1506 117.615 88.9034 117.615C88.6534 117.615 88.4247 117.661 88.2173 117.751C88.0099 117.839 87.8438 117.966 87.7188 118.131C87.5938 118.295 87.527 118.489 87.5185 118.71H85.75C85.7585 118.207 85.902 117.764 86.1804 117.381C86.4588 116.997 86.8338 116.697 87.3054 116.482C87.7798 116.263 88.3153 116.153 88.9119 116.153C89.5142 116.153 90.0412 116.263 90.4929 116.482C90.9446 116.7 91.2955 116.996 91.5455 117.368C91.7983 117.737 91.9233 118.152 91.9205 118.612C91.9233 119.101 91.7713 119.509 91.4645 119.835C91.1605 120.162 90.7642 120.369 90.2756 120.457V120.526C90.9176 120.608 91.4063 120.831 91.7415 121.195C92.0795 121.555 92.2472 122.007 92.2443 122.55C92.2472 123.047 92.1037 123.489 91.8139 123.875C91.527 124.261 91.1307 124.565 90.625 124.787C90.1193 125.009 89.5398 125.119 88.8864 125.119Z",fill:"black"})]})}const pa=(e=[])=>e.flatMap(((e={})=>"core/heading"===e.name?{...e,level:e.attributes.level,isEmpty:ha(e)}:pa(e.innerBlocks))),ha=e=>!e.attributes.content||0===e.attributes.content.trim().length;function ma({onSelect:e,isTitleSupported:t,hasOutlineItemsDisabled:s}){const{selectBlock:o}=(0,c.useDispatch)(m.store),{blocks:n,title:i}=(0,c.useSelect)((e=>{var t;const{getBlocks:s}=e(m.store),{getEditedPostAttribute:o}=e(Wi),{getPostType:n}=e(d.store),i=n(o("type"));return{title:o("title"),blocks:s(),isTitleSupported:null!==(t=i?.supports?.title)&&void 0!==t&&t}})),r=pa(n);if(r.length<1)return(0,P.jsxs)("div",{className:"editor-document-outline has-no-headings",children:[(0,P.jsx)(ua,{}),(0,P.jsx)("p",{children:(0,ms.__)("Navigate the structure of your document and address issues like empty or incorrect heading levels.")})]});let a=1;const l=document.querySelector(".editor-post-title__input"),u=t&&i&&l,p=r.reduce(((e,t)=>({...e,[t.level]:(e[t.level]||0)+1})),{})[1]>1;return(0,P.jsx)("div",{className:"document-outline",children:(0,P.jsxs)("ul",{children:[u&&(0,P.jsx)(ra,{level:(0,ms.__)("Title"),isValid:!0,onSelect:e,href:`#${l.id}`,isDisabled:s,children:i}),r.map(((t,n)=>{const i=t.level>a+1,r=!(t.isEmpty||i||!t.level||1===t.level&&(p||u));return a=t.level,(0,P.jsxs)(ra,{level:`H${t.level}`,isValid:r,isDisabled:s,href:`#block-${t.clientId}`,onSelect:()=>{o(t.clientId),e?.()},children:[t.isEmpty?aa:(0,ia.getTextContent)((0,ia.create)({html:t.attributes.content})),i&&la,1===t.level&&p&&da,u&&1===t.level&&!p&&ca]},n)}))]})})}function ga({children:e}){const t=(0,c.useSelect)((e=>{const{getGlobalBlockCount:t}=e(m.store);return t("core/heading")>0}));return t?null:e}const _a=function(){const{registerShortcut:e}=(0,c.useDispatch)(nr.store);return(0,u.useEffect)((()=>{e({name:"core/editor/toggle-mode",category:"global",description:(0,ms.__)("Switch between visual editor and code editor."),keyCombination:{modifier:"secondary",character:"m"}}),e({name:"core/editor/save",category:"global",description:(0,ms.__)("Save your changes."),keyCombination:{modifier:"primary",character:"s"}}),e({name:"core/editor/undo",category:"global",description:(0,ms.__)("Undo your last changes."),keyCombination:{modifier:"primary",character:"z"}}),e({name:"core/editor/redo",category:"global",description:(0,ms.__)("Redo your last undo."),keyCombination:{modifier:"primaryShift",character:"z"},aliases:(0,ta.isAppleOS)()?[]:[{modifier:"primary",character:"y"}]}),e({name:"core/editor/toggle-list-view",category:"global",description:(0,ms.__)("Open the List View."),keyCombination:{modifier:"access",character:"o"}}),e({name:"core/editor/toggle-distraction-free",category:"global",description:(0,ms.__)("Toggle distraction free mode."),keyCombination:{modifier:"primaryShift",character:"\\"}}),e({name:"core/editor/toggle-sidebar",category:"global",description:(0,ms.__)("Show or hide the Settings sidebar."),keyCombination:{modifier:"primaryShift",character:","}}),e({name:"core/editor/keyboard-shortcuts",category:"main",description:(0,ms.__)("Display these keyboard shortcuts."),keyCombination:{modifier:"access",character:"h"}}),e({name:"core/editor/next-region",category:"global",description:(0,ms.__)("Navigate to the next part of the editor."),keyCombination:{modifier:"ctrl",character:"`"},aliases:[{modifier:"access",character:"n"}]}),e({name:"core/editor/previous-region",category:"global",description:(0,ms.__)("Navigate to the previous part of the editor."),keyCombination:{modifier:"ctrlShift",character:"`"},aliases:[{modifier:"access",character:"p"},{modifier:"ctrlShift",character:"~"}]})}),[e]),(0,P.jsx)(m.BlockEditorKeyboardShortcuts.Register,{})},fa=(0,P.jsx)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,P.jsx)(k.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"})}),ba=(0,P.jsx)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,P.jsx)(k.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"})});const ya=(0,u.forwardRef)((function(e,t){const s=(0,ta.isAppleOS)()?ta.displayShortcut.primaryShift("z"):ta.displayShortcut.primary("y"),o=(0,c.useSelect)((e=>e(Wi).hasEditorRedo()),[]),{redo:n}=(0,c.useDispatch)(Wi);return(0,P.jsx)(Ao.Button,{__next40pxDefaultSize:!0,...e,ref:t,icon:(0,ms.isRTL)()?ba:fa,label:(0,ms.__)("Redo"),shortcut:s,"aria-disabled":!o,onClick:o?n:void 0,className:"editor-history__redo"})}));const xa=(0,u.forwardRef)((function(e,t){const s=(0,c.useSelect)((e=>e(Wi).hasEditorUndo()),[]),{undo:o}=(0,c.useDispatch)(Wi);return(0,P.jsx)(Ao.Button,{__next40pxDefaultSize:!0,...e,ref:t,icon:(0,ms.isRTL)()?fa:ba,label:(0,ms.__)("Undo"),shortcut:ta.displayShortcut.primary("z"),"aria-disabled":!s,onClick:s?o:void 0,className:"editor-history__undo"})}));function va(){const[e,t]=(0,u.useState)(!1),s=(0,c.useSelect)((e=>e(m.store).isValidTemplate()),[]),{setTemplateValidity:o,synchronizeTemplate:n}=(0,c.useDispatch)(m.store);return s?null:(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(Ao.Notice,{className:"editor-template-validation-notice",isDismissible:!1,status:"warning",actions:[{label:(0,ms.__)("Keep it as is"),onClick:()=>o(!0)},{label:(0,ms.__)("Reset the template"),onClick:()=>t(!0)}],children:(0,ms.__)("The content of your post doesn’t match the template assigned to your post type.")}),(0,P.jsx)(Ao.__experimentalConfirmDialog,{isOpen:e,confirmButtonText:(0,ms.__)("Reset"),onConfirm:()=>{t(!1),n()},onCancel:()=>t(!1),size:"medium",children:(0,ms.__)("Resetting the template may result in loss of content, do you want to continue?")})]})}const wa=function(){const{notices:e}=(0,c.useSelect)((e=>({notices:e(hs.store).getNotices()})),[]),{removeNotice:t}=(0,c.useDispatch)(hs.store),s=e.filter((({isDismissible:e,type:t})=>e&&"default"===t)),o=e.filter((({isDismissible:e,type:t})=>!e&&"default"===t));return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(Ao.NoticeList,{notices:o,className:"components-editor-notices__pinned"}),(0,P.jsx)(Ao.NoticeList,{notices:s,className:"components-editor-notices__dismissible",onRemove:t,children:(0,P.jsx)(va,{})})]})},Sa=-3;function ka(){const e=(0,c.useSelect)((e=>e(hs.store).getNotices()),[]),{removeNotice:t}=(0,c.useDispatch)(hs.store),s=e.filter((({type:e})=>"snackbar"===e)).slice(Sa);return(0,P.jsx)(Ao.SnackbarList,{notices:s,className:"components-editor-notices__snackbar",onRemove:t})}function Pa({record:e,checked:t,onChange:s}){const{name:o,kind:n,title:i,key:r}=e,{entityRecordTitle:a,hasPostMetaChanges:l}=(0,c.useSelect)((e=>{if("postType"!==n||"wp_template"!==o)return{entityRecordTitle:i,hasPostMetaChanges:Xo(e(Wi)).hasPostMetaChanges(o,r)};const t=e(d.store).getEditedEntityRecord(n,o,r);return{entityRecordTitle:e(Wi).__experimentalGetTemplateInfo(t).title,hasPostMetaChanges:Xo(e(Wi)).hasPostMetaChanges(o,r)}}),[o,n,i,r]);return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(Ao.PanelRow,{children:(0,P.jsx)(Ao.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,No.decodeEntities)(a)||(0,ms.__)("Untitled"),checked:t,onChange:s})}),l&&(0,P.jsx)("ul",{className:"entities-saved-states__changes",children:(0,P.jsx)("li",{children:(0,ms.__)("Post Meta.")})})]})}const{getGlobalStylesChanges:Ca,GlobalStylesContext:ja}=Xo(m.privateApis);function Ea({record:e}){const{user:t}=(0,u.useContext)(ja),s=(0,c.useSelect)((t=>t(d.store).getEntityRecord(e.kind,e.name,e.key)),[e.kind,e.name,e.key]),o=Ca(t,s,{maxResults:10});return o.length?(0,P.jsx)("ul",{className:"entities-saved-states__changes",children:o.map((e=>(0,P.jsx)("li",{children:e},e)))}):null}function Ta({record:e,count:t}){if("globalStyles"===e?.name)return null;const s=function(e,t){switch(e){case"site":return 1===t?(0,ms.__)("This change will affect your whole site."):(0,ms.__)("These changes will affect your whole site.");case"wp_template":return(0,ms.__)("This change will affect pages and posts that use this template.");case"page":case"post":return(0,ms.__)("The following has been modified.")}}(e?.name,t);return s?(0,P.jsx)(Ao.PanelRow,{children:s}):null}function Ba({list:e,unselectedEntities:t,setUnselectedEntities:s}){const o=e.length,n=e[0];let i=(0,c.useSelect)((e=>e(d.store).getEntityConfig(n.kind,n.name)),[n.kind,n.name]).label;return"wp_template_part"===n?.name&&(i=1===o?(0,ms.__)("Template Part"):(0,ms.__)("Template Parts")),(0,P.jsxs)(Ao.PanelBody,{title:i,initialOpen:!0,children:[(0,P.jsx)(Ta,{record:n,count:o}),e.map((e=>(0,P.jsx)(Pa,{record:e,checked:!t.some((t=>t.kind===e.kind&&t.name===e.name&&t.key===e.key&&t.property===e.property)),onChange:t=>s(e,t)},e.key||e.property))),"globalStyles"===n?.name&&(0,P.jsx)(Ea,{record:n})]})}const Ia=()=>{const{editedEntities:e,siteEdits:t,siteEntityConfig:s}=(0,c.useSelect)((e=>{const{__experimentalGetDirtyEntityRecords:t,getEntityRecordEdits:s,getEntityConfig:o}=e(d.store);return{editedEntities:t(),siteEdits:s("root","site"),siteEntityConfig:o("root","site")}}),[]),o=(0,u.useMemo)((()=>{var o;const n=e.filter((e=>!("root"===e.kind&&"site"===e.name))),i=null!==(o=s?.meta?.labels)&&void 0!==o?o:{},r=[];for(const e in t)r.push({kind:"root",name:"site",title:i[e]||e,property:e});return[...n,...r]}),[e,t,s]),[n,i]=(0,u.useState)([]);return{dirtyEntityRecords:o,isDirty:o.length-n.length>0,setUnselectedEntities:({kind:e,name:t,key:s,property:o},r)=>{i(r?n.filter((n=>n.kind!==e||n.name!==t||n.key!==s||n.property!==o)):[...n,{kind:e,name:t,key:s,property:o}])},unselectedEntities:n}};function Na(e){return e}function Aa({close:e,renderDialog:t}){const s=Ia();return(0,P.jsx)(Da,{close:e,renderDialog:t,...s})}function Da({additionalPrompt:e,close:t,onSave:s=Na,saveEnabled:o,saveLabel:n=(0,ms.__)("Save"),renderDialog:i,dirtyEntityRecords:r,isDirty:a,setUnselectedEntities:l,unselectedEntities:d}){const h=(0,u.useRef)(),{saveDirtyEntities:m}=Xo((0,c.useDispatch)(Wi)),g=r.reduce(((e,t)=>{const{name:s}=t;return e[s]||(e[s]=[]),e[s].push(t),e}),{}),{site:_,wp_template:f,wp_template_part:b,...y}=g,x=[_,f,b,...Object.values(y)].filter(Array.isArray),v=null!=o?o:a,w=(0,u.useCallback)((()=>t()),[t]),[S,k]=(0,p.__experimentalUseDialog)({onClose:()=>w()}),C=(0,p.useInstanceId)(Da,"label"),j=(0,p.useInstanceId)(Da,"description");return(0,P.jsxs)("div",{ref:S,...k,className:"entities-saved-states__panel",role:i?"dialog":void 0,"aria-labelledby":i?C:void 0,"aria-describedby":i?j:void 0,children:[(0,P.jsxs)(Ao.Flex,{className:"entities-saved-states__panel-header",gap:2,children:[(0,P.jsx)(Ao.FlexItem,{isBlock:!0,as:Ao.Button,variant:"secondary",size:"compact",onClick:w,children:(0,ms.__)("Cancel")}),(0,P.jsx)(Ao.FlexItem,{isBlock:!0,as:Ao.Button,ref:h,variant:"primary",size:"compact",disabled:!v,accessibleWhenDisabled:!0,onClick:()=>m({onSave:s,dirtyEntityRecords:r,entitiesToSkip:d,close:t}),className:"editor-entities-saved-states__save-button",children:n})]}),(0,P.jsxs)("div",{className:"entities-saved-states__text-prompt",children:[(0,P.jsxs)("div",{className:"entities-saved-states__text-prompt--header-wrapper",id:i?C:void 0,children:[(0,P.jsx)("strong",{className:"entities-saved-states__text-prompt--header",children:(0,ms.__)("Are you ready to save?")}),e]}),(0,P.jsx)("p",{id:i?j:void 0,children:a?(0,u.createInterpolateElement)((0,ms.sprintf)((0,ms._n)("There is %d site change waiting to be saved.","There are %d site changes waiting to be saved.",x.length),x.length),{strong:(0,P.jsx)("strong",{})}):(0,ms.__)("Select the items you want to save.")})]}),x.map((e=>(0,P.jsx)(Ba,{list:e,unselectedEntities:d,setUnselectedEntities:l},e[0].name)))]})}function Ra(){try{return(0,c.select)(Wi).getEditedPostContent()}catch(e){}}function Ma({text:e,children:t}){const s=(0,p.useCopyToClipboard)(e);return(0,P.jsx)(Ao.Button,{__next40pxDefaultSize:!0,variant:"secondary",ref:s,children:t})}class Oa extends u.Component{constructor(){super(...arguments),this.state={error:null}}componentDidCatch(e){(0,h.doAction)("editor.ErrorBoundary.errorLogged",e)}static getDerivedStateFromError(e){return{error:e}}render(){const{error:e}=this.state;if(!e)return this.props.children;const t=[(0,P.jsx)(Ma,{text:Ra,children:(0,ms.__)("Copy Post Text")},"copy-post"),(0,P.jsx)(Ma,{text:e.stack,children:(0,ms.__)("Copy Error")},"copy-error")];return(0,P.jsx)(m.Warning,{className:"editor-error-boundary",actions:t,children:(0,ms.__)("The editor has encountered an unexpected error.")})}}const La=Oa,Fa=window.requestIdleCallback?window.requestIdleCallback:window.requestAnimationFrame;let Va;function za(){const{postId:e,isEditedPostNew:t,hasRemoteAutosave:s}=(0,c.useSelect)((e=>({postId:e(Wi).getCurrentPostId(),isEditedPostNew:e(Wi).isEditedPostNew(),hasRemoteAutosave:!!e(Wi).getEditorSettings().autosave})),[]),{getEditedPostAttribute:o}=(0,c.useSelect)(Wi),{createWarningNotice:n,removeNotice:i}=(0,c.useDispatch)(hs.store),{editPost:r,resetEditorBlocks:a}=(0,c.useDispatch)(Wi);(0,u.useEffect)((()=>{let l=function(e,t){return window.sessionStorage.getItem(gs(e,t))}(e,t);if(!l)return;try{l=JSON.parse(l)}catch{return}const{post_title:c,content:d,excerpt:u}=l,p={title:c,content:d,excerpt:u};if(!Object.keys(p).some((e=>p[e]!==o(e))))return void _s(e,t);if(s)return;const h="wpEditorAutosaveRestore";n((0,ms.__)("The backup of this post in your browser is different from the version below."),{id:h,actions:[{label:(0,ms.__)("Restore the backup"),onClick(){const{content:e,...t}=p;r(t),a((0,y.parse)(p.content)),i(h)}}]})}),[t,e])}const Ua=(0,p.ifCondition)((()=>{if(void 0!==Va)return Va;try{window.sessionStorage.setItem("__wpEditorTestSessionStorage",""),window.sessionStorage.removeItem("__wpEditorTestSessionStorage"),Va=!0}catch{Va=!1}return Va}))((function(){const{autosave:e}=(0,c.useDispatch)(Wi),t=(0,u.useCallback)((()=>{Fa((()=>e({local:!0})))}),[]);za(),function(){const{postId:e,isEditedPostNew:t,isDirty:s,isAutosaving:o,didError:n}=(0,c.useSelect)((e=>({postId:e(Wi).getCurrentPostId(),isEditedPostNew:e(Wi).isEditedPostNew(),isDirty:e(Wi).isEditedPostDirty(),isAutosaving:e(Wi).isAutosavingPost(),didError:e(Wi).didPostSaveRequestFail()})),[]),i=(0,u.useRef)(s),r=(0,u.useRef)(o);(0,u.useEffect)((()=>{!n&&(r.current&&!o||i.current&&!s)&&_s(e,t),i.current=s,r.current=o}),[s,o,n]);const a=(0,p.usePrevious)(t),l=(0,p.usePrevious)(e);(0,u.useEffect)((()=>{l===e&&a&&!t&&_s(e,!0)}),[t,e])}();const s=(0,c.useSelect)((e=>e(Wi).getEditorSettings().localAutosaveInterval),[]);return(0,P.jsx)(Xr,{interval:s,autosave:t})}));const Ha=function({children:e}){const t=(0,c.useSelect)((e=>{const{getEditedPostAttribute:t}=e(Wi),{getPostType:s}=e(d.store),o=s(t("type"));return!!o?.supports?.["page-attributes"]}),[]);return t?e:null};const Ga=function({children:e,supportKeys:t}){const s=(0,c.useSelect)((e=>{const{getEditedPostAttribute:t}=e(Wi),{getPostType:s}=e(d.store);return s(t("type"))}),[]);let o=!!s;return s&&(o=(Array.isArray(t)?t:[t]).some((e=>!!s.supports[e]))),o?e:null};function $a(){const e=(0,c.useSelect)((e=>{var t;return null!==(t=e(Wi).getEditedPostAttribute("menu_order"))&&void 0!==t?t:0}),[]),{editPost:t}=(0,c.useDispatch)(Wi),[s,o]=(0,u.useState)(null),n=null!=s?s:e;return(0,P.jsx)(Ao.Flex,{children:(0,P.jsx)(Ao.FlexBlock,{children:(0,P.jsx)(Ao.__experimentalNumberControl,{__next40pxDefaultSize:!0,label:(0,ms.__)("Order"),help:(0,ms.__)("Set the page order."),value:n,onChange:e=>{o(e);const s=Number(e);Number.isInteger(s)&&""!==e.trim?.()&&t({menu_order:s})},hideLabelFromVision:!0,onBlur:()=>{o(null)}})})})}function Wa(){return(0,P.jsx)(Ga,{supportKeys:"page-attributes",children:(0,P.jsx)($a,{})})}var Za=s(9681),Ya=s.n(Za);const Ka=(0,u.forwardRef)((({className:e,label:t,children:s},o)=>(0,P.jsxs)(Ao.__experimentalHStack,{className:rr("editor-post-panel__row",e),ref:o,children:[t&&(0,P.jsx)("div",{className:"editor-post-panel__row-label",children:t}),(0,P.jsx)("div",{className:"editor-post-panel__row-control",children:s})]})));function qa(e){const t=e.map((e=>({children:[],parent:null,...e})));if(t.some((({parent:e})=>null===e)))return t;const s=t.reduce(((e,t)=>{const{parent:s}=t;return e[s]||(e[s]=[]),e[s].push(t),e}),{}),o=e=>e.map((e=>{const t=s[e.id];return{...e,children:t&&t.length?o(t):[]}}));return o(s[0]||[])}const Qa=e=>(0,No.decodeEntities)(e),Xa=e=>({...e,name:Qa(e.name)}),Ja=e=>(null!=e?e:[]).map(Xa);function el(e){return e?.title?.rendered?(0,No.decodeEntities)(e.title.rendered):`#${e.id} (${(0,ms.__)("no title")})`}const tl=(e,t)=>{const s=Ya()(e||"").toLowerCase(),o=Ya()(t||"").toLowerCase();return s===o?0:s.startsWith(o)?s.length:1/0};function sl(){const{editPost:e}=(0,c.useDispatch)(Wi),[t,s]=(0,u.useState)(!1),{isHierarchical:o,parentPostId:n,parentPostTitle:i,pageItems:r}=(0,c.useSelect)((e=>{var s;const{getPostType:o,getEntityRecords:n,getEntityRecord:i}=e(d.store),{getCurrentPostId:r,getEditedPostAttribute:a}=e(Wi),l=a("type"),c=a("parent"),u=o(l),p=r(),h=null!==(s=u?.hierarchical)&&void 0!==s&&s,m={per_page:100,exclude:p,parent_exclude:p,orderby:"menu_order",order:"asc",_fields:"id,title,parent"};t&&(m.search=t);const g=c?i("postType",l,c):null;return{isHierarchical:h,parentPostId:c,parentPostTitle:g?el(g):"",pageItems:h?n("postType",l,m):null}}),[t]),a=(0,u.useMemo)((()=>{const e=(s,o=0)=>{const n=s.map((t=>[{value:t.id,label:"— ".repeat(o)+(0,No.decodeEntities)(t.name),rawName:t.name},...e(t.children||[],o+1)])).sort((([e],[s])=>tl(e.rawName,t)>=tl(s.rawName,t)?1:-1));return n.flat()};if(!r)return[];let s=r.map((e=>({id:e.id,parent:e.parent,name:el(e)})));t||(s=qa(s));const o=e(s),a=o.find((e=>e.value===n));return i&&!a&&o.unshift({value:n,label:i}),o}),[r,t,i,n]);if(!o)return null;return(0,P.jsx)(Ao.ComboboxControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,className:"editor-page-attributes__parent",label:(0,ms.__)("Parent"),help:(0,ms.__)("Choose a parent page."),value:n,options:a,onFilterValueChange:(0,p.debounce)((e=>{s(e)}),300),onChange:t=>{e({parent:t})},hideLabelFromVision:!0})}function ol({isOpen:e,onClick:t}){const s=(0,c.useSelect)((e=>{const{getEditedPostAttribute:t}=e(Wi),s=t("parent");if(!s)return null;const{getEntityRecord:o}=e(d.store);return o("postType",t("type"),s)}),[]),o=(0,u.useMemo)((()=>s?el(s):(0,ms.__)("None")),[s]);return(0,P.jsx)(Ao.Button,{size:"compact",className:"editor-post-parent__panel-toggle",variant:"tertiary","aria-expanded":e,"aria-label":(0,ms.sprintf)((0,ms.__)("Change parent: %s"),o),onClick:t,children:o})}function nl(){const e=(0,c.useSelect)((e=>e(d.store).getEntityRecord("root","__unstableBase")?.home),[]),[t,s]=(0,u.useState)(null),o=(0,u.useMemo)((()=>({anchor:t,placement:"left-start",offset:36,shift:!0})),[t]);return(0,P.jsx)(Ka,{label:(0,ms.__)("Parent"),ref:s,children:(0,P.jsx)(Ao.Dropdown,{popoverProps:o,className:"editor-post-parent__panel-dropdown",contentClassName:"editor-post-parent__panel-dialog",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,P.jsx)(ol,{isOpen:e,onClick:t}),renderContent:({onClose:t})=>(0,P.jsxs)("div",{className:"editor-post-parent",children:[(0,P.jsx)(m.__experimentalInspectorPopoverHeader,{title:(0,ms.__)("Parent"),onClose:t}),(0,P.jsxs)("div",{children:[(0,u.createInterpolateElement)((0,ms.sprintf)((0,ms.__)('Child pages inherit characteristics from their parent, such as URL structure. For instance, if "Pricing" is a child of "Services", its URL would be %s/services/pricing.'),(0,v.filterURLForDisplay)(e).replace(/([/.])/g,"$1")),{wbr:(0,P.jsx)("wbr",{})}),(0,P.jsx)("p",{children:(0,u.createInterpolateElement)((0,ms.__)("They also show up as sub-items in the default navigation menu. Learn more."),{a:(0,P.jsx)(Ao.ExternalLink,{href:(0,ms.__)("https://wordpress.org/documentation/article/page-post-settings-sidebar/#page-attributes")})})})]}),(0,P.jsx)(sl,{})]})})})}const il=sl,rl="page-attributes";function al(){const{isEnabled:e,postType:t}=(0,c.useSelect)((e=>{const{getEditedPostAttribute:t,isEditorPanelEnabled:s}=e(Wi),{getPostType:o}=e(d.store);return{isEnabled:s(rl),postType:o(t("type"))}}),[]);return e&&t?(0,P.jsx)(nl,{}):null}function ll(){return(0,P.jsx)(Ha,{children:(0,P.jsx)(al,{})})}const cl=(0,P.jsx)(k.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,P.jsx)(k.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M18.5 5.5V8H20V5.5H22.5V4H20V1.5H18.5V4H16V5.5H18.5ZM13.9624 4H6C4.89543 4 4 4.89543 4 6V18C4 19.1046 4.89543 20 6 20H18C19.1046 20 20 19.1046 20 18V10.0391H18.5V18C18.5 18.2761 18.2761 18.5 18 18.5H10L10 10.4917L16.4589 10.5139L16.4641 9.01389L5.5 8.97618V6C5.5 5.72386 5.72386 5.5 6 5.5H13.9624V4ZM5.5 10.4762V18C5.5 18.2761 5.72386 18.5 6 18.5H8.5L8.5 10.4865L5.5 10.4762Z"})}),dl=(0,ms.__)("Custom Template");function ul({onClose:e}){const{defaultBlockTemplate:t,onNavigateToEntityRecord:s}=(0,c.useSelect)((e=>{const{getEditorSettings:t,getCurrentTemplateId:s}=e(Wi);return{defaultBlockTemplate:t().defaultBlockTemplate,onNavigateToEntityRecord:t().onNavigateToEntityRecord,getTemplateId:s}})),{createTemplate:o}=Xo((0,c.useDispatch)(Wi)),[n,i]=(0,u.useState)(""),[r,a]=(0,u.useState)(!1),l=()=>{i(""),e()};return(0,P.jsx)(Ao.Modal,{title:(0,ms.__)("Create custom template"),onRequestClose:l,focusOnMount:"firstContentElement",size:"small",children:(0,P.jsx)("form",{className:"editor-post-template__create-form",onSubmit:async e=>{if(e.preventDefault(),r)return;a(!0);const i=null!=t?t:(0,y.serialize)([(0,y.createBlock)("core/group",{tagName:"header",layout:{inherit:!0}},[(0,y.createBlock)("core/site-title"),(0,y.createBlock)("core/site-tagline")]),(0,y.createBlock)("core/separator"),(0,y.createBlock)("core/group",{tagName:"main"},[(0,y.createBlock)("core/group",{layout:{inherit:!0}},[(0,y.createBlock)("core/post-title")]),(0,y.createBlock)("core/post-content",{layout:{inherit:!0}})])]),c=await o({slug:(0,v.cleanForSlug)(n||dl),content:i,title:n||dl});a(!1),s({postId:c.id,postType:"wp_template"}),l()},children:(0,P.jsxs)(Ao.__experimentalVStack,{spacing:"3",children:[(0,P.jsx)(Ao.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,ms.__)("Name"),value:n,onChange:i,placeholder:dl,disabled:r,help:(0,ms.__)('Describe the template, e.g. "Post with sidebar". A custom template can be manually applied to any post or page.')}),(0,P.jsxs)(Ao.__experimentalHStack,{justify:"right",children:[(0,P.jsx)(Ao.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:l,children:(0,ms.__)("Cancel")}),(0,P.jsx)(Ao.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",isBusy:r,"aria-disabled":r,children:(0,ms.__)("Create")})]})]})})})}function pl(){return(0,c.useSelect)((e=>{const{getCurrentPostId:t,getCurrentPostType:s}=e(Wi);return{postId:t(),postType:s()}}),[])}function hl(){const{postType:e,postId:t}=pl();return(0,c.useSelect)((s=>{const{canUser:o,getEntityRecord:n,getEntityRecords:i}=s(d.store),r=o("read",{kind:"root",name:"site"})?n("root","site"):void 0,a=i("postType","wp_template",{per_page:-1}),l=+t===r?.page_for_posts,c="page"===e&&+t===r?.page_on_front&&a?.some((({slug:e})=>"front-page"===e));return!l&&!c}),[t,e])}function ml(e){return(0,c.useSelect)((t=>t(d.store).getEntityRecords("postType","wp_template",{per_page:-1,post_type:e})),[e])}function gl(e){const t=_l(),s=hl(),o=ml(e);return(0,u.useMemo)((()=>s&&o?.filter((e=>e.is_custom&&e.slug!==t&&!!e.content.raw))),[o,t,s])}function _l(){const{postType:e,postId:t}=pl(),s=ml(e),o=(0,c.useSelect)((s=>{const o=s(d.store).getEditedEntityRecord("postType",e,t);return o?.template}),[e,t]);if(o)return s?.find((e=>e.slug===o))?.slug}const fl={className:"editor-post-template__dropdown",placement:"bottom-start"};function bl({isOpen:e,onClick:t}){const s=(0,c.useSelect)((e=>{const t=e(Wi).getEditedPostAttribute("template"),{supportsTemplateMode:s,availableTemplates:o}=e(Wi).getEditorSettings();if(!s&&o[t])return o[t];const n=e(d.store).canUser("create",{kind:"postType",name:"wp_template"})&&e(Wi).getCurrentTemplateId();return n?.title||n?.slug||o?.[t]}),[]);return(0,P.jsx)(Ao.Button,{__next40pxDefaultSize:!0,variant:"tertiary","aria-expanded":e,"aria-label":(0,ms.__)("Template options"),onClick:t,children:null!=s?s:(0,ms.__)("Default template")})}function yl({onClose:e}){var t,s;const o=hl(),{availableTemplates:n,fetchedTemplates:i,selectedTemplateSlug:r,canCreate:a,canEdit:l,currentTemplateId:p,onNavigateToEntityRecord:h,getEditorSettings:g}=(0,c.useSelect)((e=>{const{canUser:t,getEntityRecords:s}=e(d.store),n=e(Wi).getEditorSettings(),i=t("create",{kind:"postType",name:"wp_template"}),r=e(Wi).getCurrentTemplateId();return{availableTemplates:n.availableTemplates,fetchedTemplates:i?s("postType","wp_template",{post_type:e(Wi).getCurrentPostType(),per_page:-1}):void 0,selectedTemplateSlug:e(Wi).getEditedPostAttribute("template"),canCreate:o&&i&&n.supportsTemplateMode,canEdit:o&&i&&n.supportsTemplateMode&&!!r,currentTemplateId:r,onNavigateToEntityRecord:n.onNavigateToEntityRecord,getEditorSettings:e(Wi).getEditorSettings}}),[o]),_=(0,u.useMemo)((()=>Object.entries({...n,...Object.fromEntries((null!=i?i:[]).map((({slug:e,title:t})=>[e,t.rendered])))}).map((([e,t])=>({value:e,label:t})))),[n,i]),f=null!==(t=_.find((e=>e.value===r)))&&void 0!==t?t:_.find((e=>!e.value)),{editPost:b}=(0,c.useDispatch)(Wi),{createSuccessNotice:y}=(0,c.useDispatch)(hs.store),[x,v]=(0,u.useState)(!1);return(0,P.jsxs)("div",{className:"editor-post-template__classic-theme-dropdown",children:[(0,P.jsx)(m.__experimentalInspectorPopoverHeader,{title:(0,ms.__)("Template"),help:(0,ms.__)("Templates define the way content is displayed when viewing your site."),actions:a?[{icon:cl,label:(0,ms.__)("Add template"),onClick:()=>v(!0)}]:[],onClose:e}),o?(0,P.jsx)(Ao.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,hideLabelFromVision:!0,label:(0,ms.__)("Template"),value:null!==(s=f?.value)&&void 0!==s?s:"",options:_,onChange:e=>b({template:e||""})}):(0,P.jsx)(Ao.Notice,{status:"warning",isDismissible:!1,children:(0,ms.__)("The posts page template cannot be changed.")}),l&&h&&(0,P.jsx)("p",{children:(0,P.jsx)(Ao.Button,{__next40pxDefaultSize:!1,variant:"link",onClick:()=>{h({postId:p,postType:"wp_template"}),e(),y((0,ms.__)("Editing template. Changes made here affect all posts and pages that use the template."),{type:"snackbar",actions:[{label:(0,ms.__)("Go back"),onClick:()=>g().onNavigateToPreviousEntityRecord()}]})},children:(0,ms.__)("Edit template")})}),x&&(0,P.jsx)(ul,{onClose:()=>v(!1)})]})}const xl=function(){return(0,P.jsx)(Ao.Dropdown,{popoverProps:fl,focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,P.jsx)(bl,{isOpen:e,onClick:t}),renderContent:({onClose:e})=>(0,P.jsx)(yl,{onClose:e})})},{PreferenceBaseOption:vl}=(window.wp.warning,Xo(j.privateApis)),wl=(0,p.compose)((0,c.withSelect)(((e,{panelName:t})=>{const{isEditorPanelEnabled:s,isEditorPanelRemoved:o}=e(Wi);return{isRemoved:o(t),isChecked:s(t)}})),(0,p.ifCondition)((({isRemoved:e})=>!e)),(0,c.withDispatch)(((e,{panelName:t})=>({onChange:()=>e(Wi).toggleEditorPanelEnabled(t)}))))(vl),{Fill:Sl,Slot:kl}=(0,Ao.createSlotFill)("EnablePluginDocumentSettingPanelOption"),Pl=({label:e,panelName:t})=>(0,P.jsx)(Sl,{children:(0,P.jsx)(wl,{label:e,panelName:t})});Pl.Slot=kl;const Cl=Pl,{Fill:jl,Slot:El}=(0,Ao.createSlotFill)("PluginDocumentSettingPanel"),Tl=({name:e,className:t,title:s,icon:o,children:n})=>{const{name:i}=(0,Tr.usePluginContext)(),r=`${i}/${e}`,{opened:a,isEnabled:l}=(0,c.useSelect)((e=>{const{isEditorPanelOpened:t,isEditorPanelEnabled:s}=e(Wi);return{opened:t(r),isEnabled:s(r)}}),[r]),{toggleEditorPanelOpened:d}=(0,c.useDispatch)(Wi);return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(Cl,{label:s,panelName:r}),(0,P.jsx)(jl,{children:l&&(0,P.jsx)(Ao.PanelBody,{className:t,title:s,icon:o,opened:a,onToggle:()=>d(r),children:n})})]})};Tl.Slot=El;const Bl=Tl,Il=({allowedBlocks:e,icon:t,label:s,onClick:o,small:n,role:i})=>(0,P.jsx)(m.BlockSettingsMenuControls,{children:({selectedBlocks:r,onClose:a})=>((e,t)=>{return!Array.isArray(t)||(s=t,0===e.filter((e=>!s.includes(e))).length);var s})(r,e)?(0,P.jsx)(Ao.MenuItem,{onClick:(0,p.compose)(o,a),icon:t,label:n?s:void 0,role:i,children:!n&&s}):null}),Nl=(0,p.compose)((0,Tr.withPluginContext)(((e,t)=>{var s;return{as:null!==(s=t.as)&&void 0!==s?s:Ao.MenuItem,icon:t.icon||e.icon,name:"core/plugin-more-menu"}})))(Rr),{Fill:Al,Slot:Dl}=(0,Ao.createSlotFill)("PluginPostPublishPanel"),Rl=({children:e,className:t,title:s,initialOpen:o=!1,icon:n})=>{const{icon:i}=(0,Tr.usePluginContext)();return(0,P.jsx)(Al,{children:(0,P.jsx)(Ao.PanelBody,{className:t,initialOpen:o||!s,title:s,icon:null!=n?n:i,children:e})})};Rl.Slot=Dl;const Ml=Rl,{Fill:Ol,Slot:Ll}=(0,Ao.createSlotFill)("PluginPostStatusInfo"),Fl=({children:e,className:t})=>(0,P.jsx)(Ol,{children:(0,P.jsx)(Ao.PanelRow,{className:t,children:e})});Fl.Slot=Ll;const Vl=Fl,{Fill:zl,Slot:Ul}=(0,Ao.createSlotFill)("PluginPrePublishPanel"),Hl=({children:e,className:t,title:s,initialOpen:o=!1,icon:n})=>{const{icon:i}=(0,Tr.usePluginContext)();return(0,P.jsx)(zl,{children:(0,P.jsx)(Ao.PanelBody,{className:t,initialOpen:o||!s,title:s,icon:null!=n?n:i,children:e})})};Hl.Slot=Ul;const Gl=Hl,$l=(0,p.compose)((0,Tr.withPluginContext)(((e,t)=>{var s;return{as:null!==(s=t.as)&&void 0!==s?s:Ao.MenuItem,icon:t.icon||e.icon,name:"core/plugin-preview-menu"}})))(Rr);function Wl({className:e,...t}){const{postTitle:s}=(0,c.useSelect)((e=>({postTitle:e(Wi).getEditedPostAttribute("title")})),[]);return(0,P.jsx)(Hr,{panelClassName:e,className:"editor-sidebar",smallScreenTitle:s||(0,ms.__)("(no title)"),scope:"core",...t})}function Zl(e){return(0,P.jsx)(Or,{__unstableExplicitMenuItem:!0,scope:"core",...e})}function Yl({onClick:e}){const[t,s]=(0,u.useState)(!1),{postType:o,postId:n}=pl(),i=gl(o),{editEntityRecord:r}=(0,c.useDispatch)(d.store);if(!i?.length)return null;return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(Ao.MenuItem,{onClick:()=>s(!0),children:(0,ms.__)("Swap template")}),t&&(0,P.jsx)(Ao.Modal,{title:(0,ms.__)("Choose a template"),onRequestClose:()=>s(!1),overlayClassName:"editor-post-template__swap-template-modal",isFullScreen:!0,children:(0,P.jsx)("div",{className:"editor-post-template__swap-template-modal-content",children:(0,P.jsx)(Kl,{postType:o,onSelect:async t=>{r("postType",o,n,{template:t.name},{undoIgnore:!0}),s(!1),e()}})})})]})}function Kl({postType:e,onSelect:t}){const s=gl(e),o=(0,u.useMemo)((()=>s.map((e=>({name:e.slug,blocks:(0,y.parse)(e.content.raw),title:(0,No.decodeEntities)(e.title.rendered),id:e.id})))),[s]),n=(0,p.useAsyncList)(o);return(0,P.jsx)(m.__experimentalBlockPatternsList,{label:(0,ms.__)("Templates"),blockPatterns:o,shownPatterns:n,onClickPattern:t})}function ql({onClick:e}){const t=_l(),s=hl(),{postType:o,postId:n}=pl(),{editEntityRecord:i}=(0,c.useDispatch)(d.store);return t&&s?(0,P.jsx)(Ao.MenuItem,{onClick:()=>{i("postType",o,n,{template:""},{undoIgnore:!0}),e()},children:(0,ms.__)("Use default template")}):null}function Ql({onClick:e}){const{canCreateTemplates:t}=(0,c.useSelect)((e=>{const{canUser:t}=e(d.store);return{canCreateTemplates:t("create",{kind:"postType",name:"wp_template"})}}),[]),[s,o]=(0,u.useState)(!1),n=hl();return t&&n?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(Ao.MenuItem,{onClick:()=>{o(!0)},children:(0,ms.__)("Create new template")}),s&&(0,P.jsx)(ul,{onClose:()=>{o(!1),e()}})]}):null}const Xl={className:"editor-post-template__dropdown",placement:"bottom-start"};function Jl({id:e}){const{isTemplateHidden:t,onNavigateToEntityRecord:s,getEditorSettings:o,hasGoBack:n}=(0,c.useSelect)((e=>{const{getRenderingMode:t,getEditorSettings:s}=Xo(e(Wi)),o=s();return{isTemplateHidden:"post-only"===t(),onNavigateToEntityRecord:o.onNavigateToEntityRecord,getEditorSettings:s,hasGoBack:o.hasOwnProperty("onNavigateToPreviousEntityRecord")}}),[]),{get:i}=(0,c.useSelect)(j.store),{editedRecord:r,hasResolved:a}=(0,d.useEntityRecord)("postType","wp_template",e),{createSuccessNotice:l}=(0,c.useDispatch)(hs.store),{setRenderingMode:u}=(0,c.useDispatch)(Wi),p=(0,c.useSelect)((e=>!!e(d.store).canUser("create",{kind:"postType",name:"wp_template"})),[]);if(!a)return null;const h=n?[{label:(0,ms.__)("Go back"),onClick:()=>o().onNavigateToPreviousEntityRecord()}]:void 0;return(0,P.jsx)(Ao.DropdownMenu,{popoverProps:Xl,focusOnMount:!0,toggleProps:{size:"compact",variant:"tertiary",tooltipPosition:"middle left"},label:(0,ms.__)("Template options"),text:(0,No.decodeEntities)(r.title),icon:null,children:({onClose:e})=>(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(Ao.MenuGroup,{children:[p&&(0,P.jsx)(Ao.MenuItem,{onClick:()=>{s({postId:r.id,postType:"wp_template"}),e(),i("core/edit-site","welcomeGuideTemplate")||l((0,ms.__)("Editing template. Changes made here affect all posts and pages that use the template."),{type:"snackbar",actions:h})},children:(0,ms.__)("Edit template")}),(0,P.jsx)(Yl,{onClick:e}),(0,P.jsx)(ql,{onClick:e}),p&&(0,P.jsx)(Ql,{onClick:e})]}),(0,P.jsx)(Ao.MenuGroup,{children:(0,P.jsx)(Ao.MenuItem,{icon:t?void 0:Do,isSelected:!t,role:"menuitemcheckbox",onClick:()=>{u(t?"template-locked":"post-only")},children:(0,ms.__)("Show template")})})]})})}function ec(){const{templateId:e,isBlockTheme:t}=(0,c.useSelect)((e=>{const{getCurrentTemplateId:t,getEditorSettings:s}=e(Wi);return{templateId:t(),isBlockTheme:s().__unstableIsBlockBasedTheme}}),[]),s=(0,c.useSelect)((e=>{var t;const s=e(Wi).getCurrentPostType(),o=e(d.store).getPostType(s);if(!o?.viewable)return!1;const n=e(Wi).getEditorSettings();if(!!n.availableTemplates&&Object.keys(n.availableTemplates).length>0)return!0;if(!n.supportsTemplateMode)return!1;return null!==(t=e(d.store).canUser("create",{kind:"postType",name:"wp_template"}))&&void 0!==t&&t}),[]),o=(0,c.useSelect)((e=>{var t;return null!==(t=e(d.store).canUser("read",{kind:"postType",name:"wp_template"}))&&void 0!==t&&t}),[]);return t&&o||!s?t&&e?(0,P.jsx)(Ka,{label:(0,ms.__)("Template"),children:(0,P.jsx)(Jl,{id:e})}):null:(0,P.jsx)(Ka,{label:(0,ms.__)("Template"),children:(0,P.jsx)(xl,{})})}const tc={_fields:"id,name",context:"view"},sc={who:"authors",per_page:50,...tc};function oc(e){const{authorId:t,authors:s,postAuthor:o}=(0,c.useSelect)((t=>{const{getUser:s,getUsers:o}=t(d.store),{getEditedPostAttribute:n}=t(Wi),i=n("author"),r={...sc};return e&&(r.search=e),{authorId:i,authors:o(r),postAuthor:s(i,tc)}}),[e]);return{authorId:t,authorOptions:(0,u.useMemo)((()=>{const e=(null!=s?s:[]).map((e=>({value:e.id,label:(0,No.decodeEntities)(e.name)}))),t=e.findIndex((({value:e})=>o?.id===e));let n=[];return t<0&&o?n=[{value:o.id,label:(0,No.decodeEntities)(o.name)}]:t<0&&!o&&(n=[{value:0,label:(0,ms.__)("(No author)")}]),[...n,...e]}),[s,o]),postAuthor:o}}function nc(){const[e,t]=(0,u.useState)(),{editPost:s}=(0,c.useDispatch)(Wi),{authorId:o,authorOptions:n}=oc(e);return(0,P.jsx)(Ao.ComboboxControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,ms.__)("Author"),options:n,value:o,onFilterValueChange:(0,p.debounce)((e=>{t(e)}),300),onChange:e=>{e&&s({author:e})},allowReset:!1,hideLabelFromVision:!0})}function ic(){const{editPost:e}=(0,c.useDispatch)(Wi),{authorId:t,authorOptions:s}=oc();return(0,P.jsx)(Ao.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,className:"post-author-selector",label:(0,ms.__)("Author"),options:s,onChange:t=>{const s=Number(t);e({author:s})},value:t,hideLabelFromVision:!0})}const rc=function(){return(0,c.useSelect)((e=>{const t=e(d.store).getUsers(sc);return t?.length>=25}),[])?(0,P.jsx)(nc,{}):(0,P.jsx)(ic,{})};function ac({children:e}){const{hasAssignAuthorAction:t,hasAuthors:s}=(0,c.useSelect)((e=>{var t;const s=e(Wi).getCurrentPost(),o=e(d.store).getUsers(sc);return{hasAssignAuthorAction:null!==(t=s._links?.["wp:action-assign-author"])&&void 0!==t&&t,hasAuthors:o?.length>=1}}),[]);return t&&s?(0,P.jsx)(Ga,{supportKeys:"author",children:e}):null}function lc({isOpen:e,onClick:t}){const{postAuthor:s}=oc(),o=(0,No.decodeEntities)(s?.name)||(0,ms.__)("(No author)");return(0,P.jsx)(Ao.Button,{size:"compact",className:"editor-post-author__panel-toggle",variant:"tertiary","aria-expanded":e,"aria-label":(0,ms.sprintf)((0,ms.__)("Change author: %s"),o),onClick:t,children:o})}const cc=function(){const[e,t]=(0,u.useState)(null),s=(0,u.useMemo)((()=>({anchor:e,placement:"left-start",offset:36,shift:!0})),[e]);return(0,P.jsx)(ac,{children:(0,P.jsx)(Ka,{label:(0,ms.__)("Author"),ref:t,children:(0,P.jsx)(Ao.Dropdown,{popoverProps:s,contentClassName:"editor-post-author__panel-dialog",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,P.jsx)(lc,{isOpen:e,onClick:t}),renderContent:({onClose:e})=>(0,P.jsxs)("div",{className:"editor-post-author",children:[(0,P.jsx)(m.__experimentalInspectorPopoverHeader,{title:(0,ms.__)("Author"),onClose:e}),(0,P.jsx)(rc,{onClose:e})]})})})})},dc=[{label:(0,ms._x)("Open",'Adjective: e.g. "Comments are open"'),value:"open",description:(0,ms.__)("Visitors can add new comments and replies.")},{label:(0,ms.__)("Closed"),value:"closed",description:[(0,ms.__)("Visitors cannot add new comments or replies."),(0,ms.__)("Existing comments remain visible.")].join(" ")}];const uc=function(){const e=(0,c.useSelect)((e=>{var t;return null!==(t=e(Wi).getEditedPostAttribute("comment_status"))&&void 0!==t?t:"open"}),[]),{editPost:t}=(0,c.useDispatch)(Wi);return(0,P.jsx)("form",{children:(0,P.jsx)(Ao.__experimentalVStack,{spacing:4,children:(0,P.jsx)(Ao.RadioControl,{className:"editor-change-status__options",hideLabelFromVision:!0,label:(0,ms.__)("Comment status"),options:dc,onChange:e=>t({comment_status:e}),selected:e})})})};const pc=function(){const e=(0,c.useSelect)((e=>{var t;return null!==(t=e(Wi).getEditedPostAttribute("ping_status"))&&void 0!==t?t:"open"}),[]),{editPost:t}=(0,c.useDispatch)(Wi);return(0,P.jsx)(Ao.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,ms.__)("Enable pingbacks & trackbacks"),checked:"open"===e,onChange:()=>t({ping_status:"open"===e?"closed":"open"}),help:(0,P.jsx)(Ao.ExternalLink,{href:(0,ms.__)("https://wordpress.org/documentation/article/trackbacks-and-pingbacks/"),children:(0,ms.__)("Learn more about pingbacks & trackbacks")})})},hc="discussion-panel";function mc({onClose:e}){return(0,P.jsxs)("div",{className:"editor-post-discussion",children:[(0,P.jsx)(m.__experimentalInspectorPopoverHeader,{title:(0,ms.__)("Discussion"),onClose:e}),(0,P.jsxs)(Ao.__experimentalVStack,{spacing:4,children:[(0,P.jsx)(Ga,{supportKeys:"comments",children:(0,P.jsx)(uc,{})}),(0,P.jsx)(Ga,{supportKeys:"trackbacks",children:(0,P.jsx)(pc,{})})]})]})}function gc({isOpen:e,onClick:t}){const{commentStatus:s,pingStatus:o,commentsSupported:n,trackbacksSupported:i}=(0,c.useSelect)((e=>{var t,s;const{getEditedPostAttribute:o}=e(Wi),{getPostType:n}=e(d.store),i=n(o("type"));return{commentStatus:null!==(t=o("comment_status"))&&void 0!==t?t:"open",pingStatus:null!==(s=o("ping_status"))&&void 0!==s?s:"open",commentsSupported:!!i.supports.comments,trackbacksSupported:!!i.supports.trackbacks}}),[]);let r;return r="open"===s?"open"===o?(0,ms._x)("Open",'Adjective: e.g. "Comments are open"'):i?(0,ms.__)("Comments only"):(0,ms._x)("Open",'Adjective: e.g. "Comments are open"'):"open"===o?n?(0,ms.__)("Pings only"):(0,ms.__)("Pings enabled"):(0,ms.__)("Closed"),(0,P.jsx)(Ao.Button,{size:"compact",className:"editor-post-discussion__panel-toggle",variant:"tertiary","aria-label":(0,ms.__)("Change discussion options"),"aria-expanded":e,onClick:t,children:r})}function _c(){const{isEnabled:e}=(0,c.useSelect)((e=>{const{isEditorPanelEnabled:t}=e(Wi);return{isEnabled:t(hc)}}),[]),[t,s]=(0,u.useState)(null),o=(0,u.useMemo)((()=>({anchor:t,placement:"left-start",offset:36,shift:!0})),[t]);return e?(0,P.jsx)(Ga,{supportKeys:["comments","trackbacks"],children:(0,P.jsx)(Ka,{label:(0,ms.__)("Discussion"),ref:s,children:(0,P.jsx)(Ao.Dropdown,{popoverProps:o,className:"editor-post-discussion__panel-dropdown",contentClassName:"editor-post-discussion__panel-dialog",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,P.jsx)(gc,{isOpen:e,onClick:t}),renderContent:({onClose:e})=>(0,P.jsx)(mc,{onClose:e})})})}):null}function fc({hideLabelFromVision:e=!1,updateOnBlur:t=!1}){const{excerpt:s,shouldUseDescriptionLabel:o,usedAttribute:n}=(0,c.useSelect)((e=>{const{getCurrentPostType:t,getEditedPostAttribute:s}=e(Wi),o=t(),n=["wp_template","wp_template_part"].includes(o)?"description":"excerpt";return{excerpt:s(n),shouldUseDescriptionLabel:["wp_template","wp_template_part","wp_block"].includes(o),usedAttribute:n}}),[]),{editPost:i}=(0,c.useDispatch)(Wi),[r,a]=(0,u.useState)((0,No.decodeEntities)(s)),l=e=>{i({[n]:e})},d=o?(0,ms.__)("Write a description (optional)"):(0,ms.__)("Write an excerpt (optional)");return(0,P.jsx)("div",{className:"editor-post-excerpt",children:(0,P.jsx)(Ao.TextareaControl,{__nextHasNoMarginBottom:!0,label:d,hideLabelFromVision:e,className:"editor-post-excerpt__textarea",onChange:t?a:l,onBlur:t?()=>l(r):void 0,value:t?r:s,help:o?(0,ms.__)("Write a description"):(0,P.jsx)(Ao.ExternalLink,{href:(0,ms.__)("https://wordpress.org/documentation/article/page-post-settings-sidebar/#excerpt"),children:(0,ms.__)("Learn more about manual excerpts")})})})}const bc=function({children:e}){return(0,P.jsx)(Ga,{supportKeys:"excerpt",children:e})},{Fill:yc,Slot:xc}=(0,Ao.createSlotFill)("PluginPostExcerpt"),vc=({children:e,className:t})=>(0,P.jsx)(yc,{children:(0,P.jsx)(Ao.PanelRow,{className:t,children:e})});vc.Slot=xc;const wc=vc,Sc="post-excerpt";function kc(){const{isOpened:e,isEnabled:t,postType:s}=(0,c.useSelect)((e=>{const{isEditorPanelOpened:t,isEditorPanelEnabled:s,getCurrentPostType:o}=e(Wi);return{isOpened:t(Sc),isEnabled:s(Sc),postType:o()}}),[]),{toggleEditorPanelOpened:o}=(0,c.useDispatch)(Wi);if(!t)return null;const n=["wp_template","wp_template_part","wp_block"].includes(s);return(0,P.jsx)(Ao.PanelBody,{title:n?(0,ms.__)("Description"):(0,ms.__)("Excerpt"),opened:e,onToggle:()=>o(Sc),children:(0,P.jsx)(wc.Slot,{children:e=>(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(fc,{}),e]})})})}function Pc(){return(0,P.jsx)(bc,{children:(0,P.jsx)(kc,{})})}function Cc(){return(0,P.jsx)(bc,{children:(0,P.jsx)(jc,{})})}function jc(){const{shouldRender:e,excerpt:t,shouldBeUsedAsDescription:s,allowEditing:o}=(0,c.useSelect)((e=>{const{getCurrentPostType:t,getCurrentPostId:s,getEditedPostAttribute:o,isEditorPanelEnabled:n}=e(Wi),i=t(),r=["wp_template","wp_template_part"].includes(i),a="wp_block"===i,l=r||a,c=r?"description":"excerpt",u=r&&e(d.store).getEntityRecord("postType",i,s()),p=n(Sc)||l;return{excerpt:o(c),shouldRender:p,shouldBeUsedAsDescription:l,allowEditing:p&&(!l||a||u&&u.source===L&&!u.has_theme_file&&u.is_custom)}}),[]),[n,i]=(0,u.useState)(null),r=s?(0,ms.__)("Description"):(0,ms.__)("Excerpt"),a=(0,u.useMemo)((()=>({anchor:n,"aria-label":r,headerTitle:r,placement:"left-start",offset:36,shift:!0})),[n,r]);if(!e)return!1;const l=!!t&&(0,P.jsx)(Ao.__experimentalText,{align:"left",numberOfLines:4,truncate:o,children:(0,No.decodeEntities)(t)});if(!o)return l;const p=s?(0,ms.__)("Add a description…"):(0,ms.__)("Add an excerpt…"),h=s?(0,ms.__)("Edit description"):(0,ms.__)("Edit excerpt");return(0,P.jsxs)(Ao.__experimentalVStack,{children:[l,(0,P.jsx)(Ao.Dropdown,{className:"editor-post-excerpt__dropdown",contentClassName:"editor-post-excerpt__dropdown__content",popoverProps:a,focusOnMount:!0,ref:i,renderToggle:({onToggle:e})=>(0,P.jsx)(Ao.Button,{__next40pxDefaultSize:!0,onClick:e,variant:"link",children:l?h:p}),renderContent:({onClose:e})=>(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(m.__experimentalInspectorPopoverHeader,{title:r,onClose:e}),(0,P.jsx)(Ao.__experimentalVStack,{spacing:4,children:(0,P.jsx)(wc.Slot,{children:e=>(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(fc,{hideLabelFromVision:!0,updateOnBlur:!0}),e]})})})]})})]})}function Ec({children:e,supportKeys:t}){const{postType:s,themeSupports:o}=(0,c.useSelect)((e=>({postType:e(Wi).getEditedPostAttribute("type"),themeSupports:e(d.store).getThemeSupports()})),[]);return(Array.isArray(t)?t:[t]).some((e=>{var t;const n=null!==(t=o?.[e])&&void 0!==t&&t;return"post-thumbnails"===e&&Array.isArray(n)?n.includes(s):n}))?e:null}const Tc=function({children:e}){return(0,P.jsx)(Ec,{supportKeys:"post-thumbnails",children:(0,P.jsx)(Ga,{supportKeys:"thumbnail",children:e})})},Bc=["image"],Ic=(0,ms.__)("Featured image"),Nc=(0,ms.__)("Add a featured image"),Ac=(0,P.jsx)("p",{children:(0,ms.__)("To edit the featured image, you need permission to upload media.")});const Dc=(0,c.withSelect)((e=>{const{getMedia:t,getPostType:s}=e(d.store),{getCurrentPostId:o,getEditedPostAttribute:n}=e(Wi),i=n("featured_media");return{media:i?t(i,{context:"view"}):null,currentPostId:o(),postType:s(n("type")),featuredImageId:i}})),Rc=(0,c.withDispatch)(((e,{noticeOperations:t},{select:s})=>{const{editPost:o}=e(Wi);return{onUpdateImage(e){o({featured_media:e.id})},onDropImage(e){s(m.store).getSettings().mediaUpload({allowedTypes:["image"],filesList:e,onFileChange([e]){o({featured_media:e.id})},onError(e){t.removeAllNotices(),t.createErrorNotice(e)}})},onRemoveImage(){o({featured_media:0})}}})),Mc=(0,p.compose)(Ao.withNotices,Dc,Rc,(0,Ao.withFilters)("editor.PostFeaturedImage"))((function({currentPostId:e,featuredImageId:t,onUpdateImage:s,onRemoveImage:o,media:n,postType:i,noticeUI:r,noticeOperations:a}){const l=(0,u.useRef)(),[d,p]=(0,u.useState)(!1),{getSettings:g}=(0,c.useSelect)(m.store),{mediaSourceUrl:_}=function(e,t){var s,o;if(!e)return{};const n=(0,h.applyFilters)("editor.PostFeaturedImage.imageSize","large",e.id,t);if(n in(null!==(s=e?.media_details?.sizes)&&void 0!==s?s:{}))return{mediaWidth:e.media_details.sizes[n].width,mediaHeight:e.media_details.sizes[n].height,mediaSourceUrl:e.media_details.sizes[n].source_url};const i=(0,h.applyFilters)("editor.PostFeaturedImage.imageSize","thumbnail",e.id,t);return i in(null!==(o=e?.media_details?.sizes)&&void 0!==o?o:{})?{mediaWidth:e.media_details.sizes[i].width,mediaHeight:e.media_details.sizes[i].height,mediaSourceUrl:e.media_details.sizes[i].source_url}:{mediaWidth:e.media_details.width,mediaHeight:e.media_details.height,mediaSourceUrl:e.source_url}}(n,e);function f(e){g().mediaUpload({allowedTypes:Bc,filesList:e,onFileChange([e]){(0,ii.isBlobURL)(e?.url)?p(!0):(e&&s(e),p(!1))},onError(e){a.removeAllNotices(),a.createErrorNotice(e)}})}return(0,P.jsxs)(Tc,{children:[r,(0,P.jsxs)("div",{className:"editor-post-featured-image",children:[n&&(0,P.jsxs)("div",{id:`editor-post-featured-image-${t}-describedby`,className:"hidden",children:[n.alt_text&&(0,ms.sprintf)((0,ms.__)("Current image: %s"),n.alt_text),!n.alt_text&&(0,ms.sprintf)((0,ms.__)("The current image has no alternative text. The file name is: %s"),n.media_details.sizes?.full?.file||n.slug)]}),(0,P.jsx)(m.MediaUploadCheck,{fallback:Ac,children:(0,P.jsx)(m.MediaUpload,{title:i?.labels?.featured_image||Ic,onSelect:s,unstableFeaturedImageFlow:!0,allowedTypes:Bc,modalClass:"editor-post-featured-image__media-modal",render:({open:e})=>(0,P.jsxs)("div",{className:"editor-post-featured-image__container",children:[(0,P.jsxs)(Ao.Button,{__next40pxDefaultSize:!0,ref:l,className:t?"editor-post-featured-image__preview":"editor-post-featured-image__toggle",onClick:e,"aria-label":t?(0,ms.__)("Edit or replace the featured image"):null,"aria-describedby":t?`editor-post-featured-image-${t}-describedby`:null,"aria-haspopup":"dialog",disabled:d,accessibleWhenDisabled:!0,children:[!!t&&n&&(0,P.jsx)("img",{className:"editor-post-featured-image__preview-image",src:_,alt:""}),d&&(0,P.jsx)(Ao.Spinner,{}),!t&&!d&&(i?.labels?.set_featured_image||Nc)]}),!!t&&(0,P.jsxs)(Ao.__experimentalHStack,{className:"editor-post-featured-image__actions",children:[(0,P.jsx)(Ao.Button,{__next40pxDefaultSize:!0,className:"editor-post-featured-image__action",onClick:e,"aria-haspopup":"dialog",children:(0,ms.__)("Replace")}),(0,P.jsx)(Ao.Button,{__next40pxDefaultSize:!0,className:"editor-post-featured-image__action",onClick:()=>{o(),l.current.focus()},children:(0,ms.__)("Remove")})]}),(0,P.jsx)(Ao.DropZone,{onFilesDrop:f})]}),value:t})})]})]})})),Oc="featured-image";function Lc({withPanelBody:e=!0}){var t;const{postType:s,isEnabled:o,isOpened:n}=(0,c.useSelect)((e=>{const{getEditedPostAttribute:t,isEditorPanelEnabled:s,isEditorPanelOpened:o}=e(Wi),{getPostType:n}=e(d.store);return{postType:n(t("type")),isEnabled:s(Oc),isOpened:o(Oc)}}),[]),{toggleEditorPanelOpened:i}=(0,c.useDispatch)(Wi);return o?e?(0,P.jsx)(Tc,{children:(0,P.jsx)(Ao.PanelBody,{title:null!==(t=s?.labels?.featured_image)&&void 0!==t?t:(0,ms.__)("Featured image"),opened:n,onToggle:()=>i(Oc),children:(0,P.jsx)(Mc,{})})}):(0,P.jsx)(Tc,{children:(0,P.jsx)(Mc,{})}):null}const Fc=function({children:e}){return(0,c.useSelect)((e=>e(Wi).getEditorSettings().disablePostFormats),[])?null:(0,P.jsx)(Ga,{supportKeys:"post-formats",children:e})},Vc=[{id:"aside",caption:(0,ms.__)("Aside")},{id:"audio",caption:(0,ms.__)("Audio")},{id:"chat",caption:(0,ms.__)("Chat")},{id:"gallery",caption:(0,ms.__)("Gallery")},{id:"image",caption:(0,ms.__)("Image")},{id:"link",caption:(0,ms.__)("Link")},{id:"quote",caption:(0,ms.__)("Quote")},{id:"standard",caption:(0,ms.__)("Standard")},{id:"status",caption:(0,ms.__)("Status")},{id:"video",caption:(0,ms.__)("Video")}].sort(((e,t)=>{const s=e.caption.toUpperCase(),o=t.caption.toUpperCase();return so?1:0}));function zc(){const e=`post-format-selector-${(0,p.useInstanceId)(zc)}`,{postFormat:t,suggestedFormat:s,supportedFormats:o}=(0,c.useSelect)((e=>{const{getEditedPostAttribute:t,getSuggestedPostFormat:s}=e(Wi),o=t("format"),n=e(d.store).getThemeSupports();return{postFormat:null!=o?o:"standard",suggestedFormat:s(),supportedFormats:n.formats}}),[]),n=Vc.filter((e=>o?.includes(e.id)||t===e.id)),i=n.find((e=>e.id===s)),{editPost:r}=(0,c.useDispatch)(Wi),a=e=>r({format:e});return(0,P.jsx)(Fc,{children:(0,P.jsxs)("div",{className:"editor-post-format",children:[(0,P.jsx)(Ao.RadioControl,{className:"editor-post-format__options",label:(0,ms.__)("Post Format"),selected:t,onChange:e=>a(e),id:e,options:n.map((e=>({label:e.caption,value:e.id}))),hideLabelFromVision:!0}),i&&i.id!==t&&(0,P.jsx)("p",{className:"editor-post-format__suggestion",children:(0,P.jsx)(Ao.Button,{__next40pxDefaultSize:!0,variant:"link",onClick:()=>a(i.id),children:(0,ms.sprintf)((0,ms.__)("Apply suggested format: %s"),i.caption)})})]})})}const Uc=function({children:e}){const{lastRevisionId:t,revisionsCount:s}=(0,c.useSelect)((e=>{const{getCurrentPostLastRevisionId:t,getCurrentPostRevisionsCount:s}=e(Wi);return{lastRevisionId:t(),revisionsCount:s()}}),[]);return!t||s<2?null:(0,P.jsx)(Ga,{supportKeys:"revisions",children:e})};function Hc(){return(0,c.useSelect)((e=>{const{getCurrentPostLastRevisionId:t,getCurrentPostRevisionsCount:s}=e(Wi);return{lastRevisionId:t(),revisionsCount:s()}}),[])}function Gc(){const{lastRevisionId:e,revisionsCount:t}=Hc();return(0,P.jsx)(Uc,{children:(0,P.jsx)(Ka,{label:(0,ms.__)("Revisions"),children:(0,P.jsx)(Ao.Button,{href:(0,v.addQueryArgs)("revision.php",{revision:e}),className:"editor-private-post-last-revision__button",text:t,variant:"tertiary",size:"compact"})})})}const $c=function(){const{lastRevisionId:e,revisionsCount:t}=Hc();return(0,P.jsx)(Uc,{children:(0,P.jsx)(Ao.Button,{__next40pxDefaultSize:!0,href:(0,v.addQueryArgs)("revision.php",{revision:e}),className:"editor-post-last-revision__title",icon:Ko,iconPosition:"right",text:(0,ms.sprintf)((0,ms.__)("Revisions (%s)"),t)})})};const Wc=function(){return(0,P.jsx)(Uc,{children:(0,P.jsx)(Ao.PanelBody,{className:"editor-post-last-revision__panel",children:(0,P.jsx)($c,{})})})};function Zc(){const e="core/editor/post-locked-modal-"+(0,p.useInstanceId)(Zc),{autosave:t,updatePostLock:s}=(0,c.useDispatch)(Wi),{isLocked:o,isTakeover:n,user:i,postId:r,postLockUtils:a,activePostLock:l,postType:m,previewLink:g}=(0,c.useSelect)((e=>{const{isPostLocked:t,isPostLockTakeover:s,getPostLockUser:o,getCurrentPostId:n,getActivePostLock:i,getEditedPostAttribute:r,getEditedPostPreviewLink:a,getEditorSettings:l}=e(Wi),{getPostType:c}=e(d.store);return{isLocked:t(),isTakeover:s(),user:o(),postId:n(),postLockUtils:l().postLockUtils,activePostLock:i(),postType:c(r("type")),previewLink:a()}}),[]);if((0,u.useEffect)((()=>{function n(){if(o||!l)return;const e=new window.FormData;if(e.append("action","wp-remove-post-lock"),e.append("_wpnonce",a.unlockNonce),e.append("post_ID",r),e.append("active_post_lock",l),window.navigator.sendBeacon)window.navigator.sendBeacon(a.ajaxUrl,e);else{const t=new window.XMLHttpRequest;t.open("POST",a.ajaxUrl,!1),t.send(e)}}return(0,h.addAction)("heartbeat.send",e,(function(e){o||(e["wp-refresh-post-lock"]={lock:l,post_id:r})})),(0,h.addAction)("heartbeat.tick",e,(function(e){if(!e["wp-refresh-post-lock"])return;const o=e["wp-refresh-post-lock"];o.lock_error?(t(),s({isLocked:!0,isTakeover:!0,user:{name:o.lock_error.name,avatar:o.lock_error.avatar_src_2x}})):o.new_lock&&s({isLocked:!1,activePostLock:o.new_lock})})),window.addEventListener("beforeunload",n),()=>{(0,h.removeAction)("heartbeat.send",e),(0,h.removeAction)("heartbeat.tick",e),window.removeEventListener("beforeunload",n)}}),[]),!o)return null;const _=i.name,f=i.avatar,b=(0,v.addQueryArgs)("post.php",{"get-post-lock":"1",lockKey:!0,post:r,action:"edit",_wpnonce:a.nonce}),y=(0,v.addQueryArgs)("edit.php",{post_type:m?.slug}),x=(0,ms.__)("Exit editor");return(0,P.jsx)(Ao.Modal,{title:n?(0,ms.__)("Someone else has taken over this post"):(0,ms.__)("This post is already being edited"),focusOnMount:!0,shouldCloseOnClickOutside:!1,shouldCloseOnEsc:!1,isDismissible:!1,className:"editor-post-locked-modal",size:"medium",children:(0,P.jsxs)(Ao.__experimentalHStack,{alignment:"top",spacing:6,children:[!!f&&(0,P.jsx)("img",{src:f,alt:(0,ms.__)("Avatar"),className:"editor-post-locked-modal__avatar",width:64,height:64}),(0,P.jsxs)("div",{children:[!!n&&(0,P.jsx)("p",{children:(0,u.createInterpolateElement)(_?(0,ms.sprintf)((0,ms.__)("%s now has editing control of this post (). Don’t worry, your changes up to this moment have been saved."),_):(0,ms.__)("Another user now has editing control of this post (). Don’t worry, your changes up to this moment have been saved."),{strong:(0,P.jsx)("strong",{}),PreviewLink:(0,P.jsx)(Ao.ExternalLink,{href:g,children:(0,ms.__)("preview")})})}),!n&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)("p",{children:(0,u.createInterpolateElement)(_?(0,ms.sprintf)((0,ms.__)("%s is currently working on this post (), which means you cannot make changes, unless you take over."),_):(0,ms.__)("Another user is currently working on this post (), which means you cannot make changes, unless you take over."),{strong:(0,P.jsx)("strong",{}),PreviewLink:(0,P.jsx)(Ao.ExternalLink,{href:g,children:(0,ms.__)("preview")})})}),(0,P.jsx)("p",{children:(0,ms.__)("If you take over, the other user will lose editing control to the post, but their changes will be saved.")})]}),(0,P.jsxs)(Ao.__experimentalHStack,{className:"editor-post-locked-modal__buttons",justify:"flex-end",children:[!n&&(0,P.jsx)(Ao.Button,{__next40pxDefaultSize:!0,variant:"tertiary",href:b,children:(0,ms.__)("Take over")}),(0,P.jsx)(Ao.Button,{__next40pxDefaultSize:!0,variant:"primary",href:y,children:x})]})]})]})})}const Yc=function({children:e}){const{hasPublishAction:t,isPublished:s}=(0,c.useSelect)((e=>{var t;const{isCurrentPostPublished:s,getCurrentPost:o}=e(Wi);return{hasPublishAction:null!==(t=o()._links?.["wp:action-publish"])&&void 0!==t&&t,isPublished:s()}}),[]);return s||!t?null:e};const Kc=function(){const e=(0,c.useSelect)((e=>e(Wi).getEditedPostAttribute("status")),[]),{editPost:t}=(0,c.useDispatch)(Wi);return(0,P.jsx)(Yc,{children:(0,P.jsx)(Ao.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,ms.__)("Pending review"),checked:"pending"===e,onChange:()=>{t({status:"pending"===e?"draft":"pending"})}})})};function qc({className:e,textContent:t,forceIsAutosaveable:s,role:o,onPreview:n}){const{postId:i,currentPostLink:r,previewLink:a,isSaveable:l,isViewable:p}=(0,c.useSelect)((e=>{var t;const s=e(Wi),o=e(d.store).getPostType(s.getCurrentPostType("type"));return{postId:s.getCurrentPostId(),currentPostLink:s.getCurrentPostAttribute("link"),previewLink:s.getEditedPostPreviewLink(),isSaveable:s.isEditedPostSaveable(),isViewable:null!==(t=o?.viewable)&&void 0!==t&&t}}),[]),{__unstableSaveForPreview:m}=(0,c.useDispatch)(Wi);if(!p)return null;const g=`wp-preview-${i}`,_=a||r;return(0,P.jsx)(Ao.Button,{variant:e?void 0:"tertiary",className:e||"editor-post-preview",href:_,target:g,accessibleWhenDisabled:!0,disabled:!l,onClick:async e=>{e.preventDefault();const t=window.open("",g);t.focus(),function(e){let t=(0,u.renderToString)((0,P.jsxs)("div",{className:"editor-post-preview-button__interstitial-message",children:[(0,P.jsxs)(Ao.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 96 96",children:[(0,P.jsx)(Ao.Path,{className:"outer",d:"M48 12c19.9 0 36 16.1 36 36S67.9 84 48 84 12 67.9 12 48s16.1-36 36-36",fill:"none"}),(0,P.jsx)(Ao.Path,{className:"inner",d:"M69.5 46.4c0-3.9-1.4-6.7-2.6-8.8-1.6-2.6-3.1-4.9-3.1-7.5 0-2.9 2.2-5.7 5.4-5.7h.4C63.9 19.2 56.4 16 48 16c-11.2 0-21 5.7-26.7 14.4h2.1c3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3L40 67.5l7-20.9L42 33c-1.7-.1-3.3-.3-3.3-.3-1.7-.1-1.5-2.7.2-2.6 0 0 5.3.4 8.4.4 3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3l11.5 34.3 3.3-10.4c1.6-4.5 2.4-7.8 2.4-10.5zM16.1 48c0 12.6 7.3 23.5 18 28.7L18.8 35c-1.7 4-2.7 8.4-2.7 13zm32.5 2.8L39 78.6c2.9.8 5.9 1.3 9 1.3 3.7 0 7.3-.6 10.6-1.8-.1-.1-.2-.3-.2-.4l-9.8-26.9zM76.2 36c0 3.2-.6 6.9-2.4 11.4L64 75.6c9.5-5.5 15.9-15.8 15.9-27.6 0-5.5-1.4-10.8-3.9-15.3.1 1 .2 2.1.2 3.3z",fill:"none"})]}),(0,P.jsx)("p",{children:(0,ms.__)("Generating preview…")})]}));t+='\n\t\t\n\t',t=(0,h.applyFilters)("editor.PostPreview.interstitialMarkup",t),e.write(t),e.title=(0,ms.__)("Generating preview…"),e.close()}(t.document);const o=await m({forceIsAutosaveable:s});t.location=o,n?.()},role:o,size:"compact",children:t||(0,P.jsxs)(P.Fragment,{children:[(0,ms._x)("Preview","imperative verb"),(0,P.jsx)(Ao.VisuallyHidden,{as:"span",children:(0,ms.__)("(opens in a new tab)")})]})})}function Qc(){const e=(0,p.useViewportMatch)("medium","<"),{isPublished:t,isBeingScheduled:s,isSaving:o,isPublishing:n,hasPublishAction:i,isAutosaving:r,hasNonPostEntityChanges:a,postStatusHasChanged:l,postStatus:d}=(0,c.useSelect)((e=>{var t;const{isCurrentPostPublished:s,isEditedPostBeingScheduled:o,isSavingPost:n,isPublishingPost:i,getCurrentPost:r,getCurrentPostType:a,isAutosavingPost:l,getPostEdits:c,getEditedPostAttribute:d}=e(Wi);return{isPublished:s(),isBeingScheduled:o(),isSaving:n(),isPublishing:i(),hasPublishAction:null!==(t=r()._links?.["wp:action-publish"])&&void 0!==t&&t,postType:a(),isAutosaving:l(),hasNonPostEntityChanges:e(Wi).hasNonPostEntityChanges(),postStatusHasChanged:!!c()?.status,postStatus:d("status")}}),[]);return n?(0,ms.__)("Publishing…"):(t||s)&&o&&!r?(0,ms.__)("Saving…"):i?a||t||l&&!["future","publish"].includes(d)||!l&&"future"===d?(0,ms.__)("Save"):s?(0,ms.__)("Schedule"):(0,ms.__)("Publish"):e?(0,ms.__)("Publish"):(0,ms.__)("Submit for Review")}const Xc=()=>{};class Jc extends u.Component{constructor(e){super(e),this.createOnClick=this.createOnClick.bind(this),this.closeEntitiesSavedStates=this.closeEntitiesSavedStates.bind(this),this.state={entitiesSavedStatesCallback:!1}}createOnClick(e){return(...t)=>{const{hasNonPostEntityChanges:s,setEntitiesSavedStatesCallback:o}=this.props;return s&&o?(this.setState({entitiesSavedStatesCallback:()=>e(...t)}),o((()=>this.closeEntitiesSavedStates)),Xc):e(...t)}}closeEntitiesSavedStates(e){const{postType:t,postId:s}=this.props,{entitiesSavedStatesCallback:o}=this.state;this.setState({entitiesSavedStatesCallback:!1},(()=>{e&&e.some((e=>"postType"===e.kind&&e.name===t&&e.key===s))&&o()}))}render(){const{forceIsDirty:e,hasPublishAction:t,isBeingScheduled:s,isOpen:o,isPostSavingLocked:n,isPublishable:i,isPublished:r,isSaveable:a,isSaving:l,isAutoSaving:c,isToggle:d,savePostStatus:u,onSubmit:p=Xc,onToggle:h,visibility:m,hasNonPostEntityChanges:g,isSavingNonPostEntityChanges:_,postStatus:f,postStatusHasChanged:b}=this.props,y=(l||!a||n||!i&&!e)&&(!g||_),x=(r||l||!a||!i&&!e)&&(!g||_);let v="publish";b?v=f:t?"private"===m?v="private":s&&(v="future"):v="pending";const w={"aria-disabled":y,className:"editor-post-publish-button",isBusy:!c&&l,variant:"primary",onClick:this.createOnClick((()=>{y||(p(),u(v))}))},S={"aria-disabled":x,"aria-expanded":o,className:"editor-post-publish-panel__toggle",isBusy:l&&r,variant:"primary",size:"compact",onClick:this.createOnClick((()=>{x||h()}))},k=d?S:w;return(0,P.jsx)(P.Fragment,{children:(0,P.jsx)(Ao.Button,{...k,className:`${k.className} editor-post-publish-button__button`,size:"compact",children:(0,P.jsx)(Qc,{})})})}}const ed=(0,p.compose)([(0,c.withSelect)((e=>{var t;const{isSavingPost:s,isAutosavingPost:o,isEditedPostBeingScheduled:n,getEditedPostVisibility:i,isCurrentPostPublished:r,isEditedPostSaveable:a,isEditedPostPublishable:l,isPostSavingLocked:c,getCurrentPost:d,getCurrentPostType:u,getCurrentPostId:p,hasNonPostEntityChanges:h,isSavingNonPostEntityChanges:m,getEditedPostAttribute:g,getPostEdits:_}=e(Wi);return{isSaving:s(),isAutoSaving:o(),isBeingScheduled:n(),visibility:i(),isSaveable:a(),isPostSavingLocked:c(),isPublishable:l(),isPublished:r(),hasPublishAction:null!==(t=d()._links?.["wp:action-publish"])&&void 0!==t&&t,postType:u(),postId:p(),postStatus:g("status"),postStatusHasChanged:_()?.status,hasNonPostEntityChanges:h(),isSavingNonPostEntityChanges:m()}})),(0,c.withDispatch)((e=>{const{editPost:t,savePost:s}=e(Wi);return{savePostStatus:e=>{t({status:e},{undoIgnore:!0}),s()}}}))])(Jc),td=(0,P.jsx)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24",children:(0,P.jsx)(k.Path,{d:"M20 10c0-5.51-4.49-10-10-10C4.48 0 0 4.49 0 10c0 5.52 4.48 10 10 10 5.51 0 10-4.48 10-10zM7.78 15.37L4.37 6.22c.55-.02 1.17-.08 1.17-.08.5-.06.44-1.13-.06-1.11 0 0-1.45.11-2.37.11-.18 0-.37 0-.58-.01C4.12 2.69 6.87 1.11 10 1.11c2.33 0 4.45.87 6.05 2.34-.68-.11-1.65.39-1.65 1.58 0 .74.45 1.36.9 2.1.35.61.55 1.36.55 2.46 0 1.49-1.4 5-1.4 5l-3.03-8.37c.54-.02.82-.17.82-.17.5-.05.44-1.25-.06-1.22 0 0-1.44.12-2.38.12-.87 0-2.33-.12-2.33-.12-.5-.03-.56 1.2-.06 1.22l.92.08 1.26 3.41zM17.41 10c.24-.64.74-1.87.43-4.25.7 1.29 1.05 2.71 1.05 4.25 0 3.29-1.73 6.24-4.4 7.78.97-2.59 1.94-5.2 2.92-7.78zM6.1 18.09C3.12 16.65 1.11 13.53 1.11 10c0-1.3.23-2.48.72-3.59C3.25 10.3 4.67 14.2 6.1 18.09zm4.03-6.63l2.58 6.98c-.86.29-1.76.45-2.71.45-.79 0-1.57-.11-2.29-.33.81-2.38 1.62-4.74 2.42-7.1z"})}),sd={public:{label:(0,ms.__)("Public"),info:(0,ms.__)("Visible to everyone.")},private:{label:(0,ms.__)("Private"),info:(0,ms.__)("Only visible to site admins and editors.")},password:{label:(0,ms.__)("Password protected"),info:(0,ms.__)("Only those with the password can view this post.")}};function od({onClose:e}){const t=(0,p.useInstanceId)(od),{status:s,visibility:o,password:n}=(0,c.useSelect)((e=>({status:e(Wi).getEditedPostAttribute("status"),visibility:e(Wi).getEditedPostVisibility(),password:e(Wi).getEditedPostAttribute("password")}))),{editPost:i,savePost:r}=(0,c.useDispatch)(Wi),[a,l]=(0,u.useState)(!!n),[d,h]=(0,u.useState)(!1);return(0,P.jsxs)("div",{className:"editor-post-visibility",children:[(0,P.jsx)(m.__experimentalInspectorPopoverHeader,{title:(0,ms.__)("Visibility"),help:(0,ms.__)("Control how this post is viewed."),onClose:e}),(0,P.jsxs)("fieldset",{className:"editor-post-visibility__fieldset",children:[(0,P.jsx)(Ao.VisuallyHidden,{as:"legend",children:(0,ms.__)("Visibility")}),(0,P.jsx)(nd,{instanceId:t,value:"public",label:sd.public.label,info:sd.public.info,checked:"public"===o&&!a,onChange:()=>{i({status:"private"===o?"draft":s,password:""}),l(!1)}}),(0,P.jsx)(nd,{instanceId:t,value:"private",label:sd.private.label,info:sd.private.info,checked:"private"===o,onChange:()=>{h(!0)}}),(0,P.jsx)(nd,{instanceId:t,value:"password",label:sd.password.label,info:sd.password.info,checked:a,onChange:()=>{i({status:"private"===o?"draft":s,password:n||""}),l(!0)}}),a&&(0,P.jsxs)("div",{className:"editor-post-visibility__password",children:[(0,P.jsx)(Ao.VisuallyHidden,{as:"label",htmlFor:`editor-post-visibility__password-input-${t}`,children:(0,ms.__)("Create password")}),(0,P.jsx)("input",{className:"editor-post-visibility__password-input",id:`editor-post-visibility__password-input-${t}`,type:"text",onChange:e=>{i({password:e.target.value})},value:n,placeholder:(0,ms.__)("Use a secure password")})]})]}),(0,P.jsx)(Ao.__experimentalConfirmDialog,{isOpen:d,onConfirm:()=>{i({status:"private",password:""}),l(!1),h(!1),r()},onCancel:()=>{h(!1)},confirmButtonText:(0,ms.__)("Publish"),size:"medium",children:(0,ms.__)("Would you like to privately publish this post now?")})]})}function nd({instanceId:e,value:t,label:s,info:o,...n}){return(0,P.jsxs)("div",{className:"editor-post-visibility__choice",children:[(0,P.jsx)("input",{type:"radio",name:`editor-post-visibility__setting-${e}`,value:t,id:`editor-post-${t}-${e}`,"aria-describedby":`editor-post-${t}-${e}-description`,className:"editor-post-visibility__radio",...n}),(0,P.jsx)("label",{htmlFor:`editor-post-${t}-${e}`,className:"editor-post-visibility__label",children:s}),(0,P.jsx)("p",{id:`editor-post-${t}-${e}-description`,className:"editor-post-visibility__info",children:o})]})}function id(){return rd()}function rd(){const e=(0,c.useSelect)((e=>e(Wi).getEditedPostVisibility()));return sd[e]?.label}function ad(e){const t=Object.prototype.toString.call(e);return e instanceof Date||"object"==typeof e&&"[object Date]"===t?new e.constructor(+e):"number"==typeof e||"[object Number]"===t||"string"==typeof e||"[object String]"===t?new Date(e):new Date(NaN)}function ld(e){const t=ad(e);return t.setDate(1),t.setHours(0,0,0,0),t}function cd(e){const t=ad(e),s=t.getMonth();return t.setFullYear(t.getFullYear(),s+1,0),t.setHours(23,59,59,999),t}Math.pow(10,8);const dd=6e4,ud=36e5;function pd(e,t){const s=t?.additionalDigits??2,o=function(e){const t={},s=e.split(hd.dateTimeDelimiter);let o;if(s.length>2)return t;/:/.test(s[0])?o=s[0]:(t.date=s[0],o=s[1],hd.timeZoneDelimiter.test(t.date)&&(t.date=e.split(hd.timeZoneDelimiter)[0],o=e.substr(t.date.length,e.length)));if(o){const e=hd.timezone.exec(o);e?(t.time=o.replace(e[1],""),t.timezone=e[1]):t.time=o}return t}(e);let n;if(o.date){const e=function(e,t){const s=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),o=e.match(s);if(!o)return{year:NaN,restDateString:""};const n=o[1]?parseInt(o[1]):null,i=o[2]?parseInt(o[2]):null;return{year:null===i?n:100*i,restDateString:e.slice((o[1]||o[2]).length)}}(o.date,s);n=function(e,t){if(null===t)return new Date(NaN);const s=e.match(md);if(!s)return new Date(NaN);const o=!!s[4],n=fd(s[1]),i=fd(s[2])-1,r=fd(s[3]),a=fd(s[4]),l=fd(s[5])-1;if(o)return function(e,t,s){return t>=1&&t<=53&&s>=0&&s<=6}(0,a,l)?function(e,t,s){const o=new Date(0);o.setUTCFullYear(e,0,4);const n=o.getUTCDay()||7,i=7*(t-1)+s+1-n;return o.setUTCDate(o.getUTCDate()+i),o}(t,a,l):new Date(NaN);{const e=new Date(0);return function(e,t,s){return t>=0&&t<=11&&s>=1&&s<=(yd[t]||(xd(e)?29:28))}(t,i,r)&&function(e,t){return t>=1&&t<=(xd(e)?366:365)}(t,n)?(e.setUTCFullYear(t,i,Math.max(n,r)),e):new Date(NaN)}}(e.restDateString,e.year)}if(!n||isNaN(n.getTime()))return new Date(NaN);const i=n.getTime();let r,a=0;if(o.time&&(a=function(e){const t=e.match(gd);if(!t)return NaN;const s=bd(t[1]),o=bd(t[2]),n=bd(t[3]);if(!function(e,t,s){if(24===e)return 0===t&&0===s;return s>=0&&s<60&&t>=0&&t<60&&e>=0&&e<25}(s,o,n))return NaN;return s*ud+o*dd+1e3*n}(o.time),isNaN(a)))return new Date(NaN);if(!o.timezone){const e=new Date(i+a),t=new Date(0);return t.setFullYear(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()),t.setHours(e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds()),t}return r=function(e){if("Z"===e)return 0;const t=e.match(_d);if(!t)return 0;const s="+"===t[1]?-1:1,o=parseInt(t[2]),n=t[3]&&parseInt(t[3])||0;if(!function(e,t){return t>=0&&t<=59}(0,n))return NaN;return s*(o*ud+n*dd)}(o.timezone),isNaN(r)?new Date(NaN):new Date(i+a+r)}const hd={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},md=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,gd=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,_d=/^([+-])(\d{2})(?::?(\d{2}))?$/;function fd(e){return e?parseInt(e):1}function bd(e){return e&&parseFloat(e.replace(",","."))||0}const yd=[31,null,31,30,31,30,31,31,30,31,30,31];function xd(e){return e%400==0||e%4==0&&e%100!=0}const{PrivatePublishDateTimePicker:vd}=Xo(m.privateApis);function wd(e){return(0,P.jsx)(Sd,{...e,showPopoverHeaderActions:!0,isCompact:!1})}function Sd({onClose:e,showPopoverHeaderActions:t,isCompact:s}){const{postDate:o,postType:n}=(0,c.useSelect)((e=>({postDate:e(Wi).getEditedPostAttribute("date"),postType:e(Wi).getCurrentPostType()})),[]),{editPost:i}=(0,c.useDispatch)(Wi),[r,a]=(0,u.useState)(ld(new Date(o))),l=(0,c.useSelect)((e=>e(d.store).getEntityRecords("postType",n,{status:"publish,future",after:ld(r).toISOString(),before:cd(r).toISOString(),exclude:[e(Wi).getCurrentPostId()],per_page:100,_fields:"id,date"})),[r,n]),p=(0,u.useMemo)((()=>(l||[]).map((({date:e})=>({date:new Date(e)})))),[l]),h=(0,x.getSettings)(),m=/a(?!\\)/i.test(h.formats.time.toLowerCase().replace(/\\\\/g,"").split("").reverse().join(""));return(0,P.jsx)(vd,{currentDate:o,onChange:e=>i({date:e}),is12Hour:m,dateOrder:(0,ms._x)("dmy","date order"),events:p,onMonthPreviewed:e=>a(pd(e)),onClose:e,isCompact:s,showPopoverHeaderActions:t})}function kd(e){return Pd(e)}function Pd({full:e=!1}={}){const{date:t,isFloating:s}=(0,c.useSelect)((e=>({date:e(Wi).getEditedPostAttribute("date"),isFloating:e(Wi).isEditedPostDateFloating()})),[]);return e?Cd(t):function(e,{isFloating:t=!1,now:s=new Date}={}){if(!e||t)return(0,ms.__)("Immediately");if(!function(e){const{timezone:t}=(0,x.getSettings)(),s=Number(t.offset),o=e.getTimezoneOffset()/60*-1;return s===o}(s))return Cd(e);const o=(0,x.getDate)(e);if(jd(o,s))return(0,ms.sprintf)((0,ms.__)("Today at %s"),(0,x.dateI18n)((0,ms._x)("g:i a","post schedule time format"),o));const n=new Date(s);if(n.setDate(n.getDate()+1),jd(o,n))return(0,ms.sprintf)((0,ms.__)("Tomorrow at %s"),(0,x.dateI18n)((0,ms._x)("g:i a","post schedule time format"),o));if(o.getFullYear()===s.getFullYear())return(0,x.dateI18n)((0,ms._x)("F j g:i a","post schedule date format without year"),o);return(0,x.dateI18n)((0,ms._x)("F j, Y g:i a","post schedule full date format"),o)}(t,{isFloating:s})}function Cd(e){const t=(0,x.getDate)(e),s=function(){const{timezone:e}=(0,x.getSettings)();if(e.abbr&&isNaN(Number(e.abbr)))return e.abbr;const t=e.offset<0?"":"+";return`UTC${t}${e.offsetFormatted}`}(),o=(0,x.dateI18n)((0,ms._x)("F j, Y g:i a","post schedule full date format"),t);return(0,ms.isRTL)()?`${s} ${o}`:`${o} ${s}`}function jd(e,t){return e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}const Ed=3,Td={per_page:10,orderby:"count",order:"desc",hide_empty:!0,_fields:"id,name,count",context:"view"};function Bd({onSelect:e,taxonomy:t}){const{_terms:s,showTerms:o}=(0,c.useSelect)((e=>{const s=e(d.store).getEntityRecords("taxonomy",t.slug,Td);return{_terms:s,showTerms:s?.length>=Ed}}),[t.slug]);if(!o)return null;const n=Ja(s);return(0,P.jsxs)("div",{className:"editor-post-taxonomies__flat-term-most-used",children:[(0,P.jsx)(Ao.BaseControl.VisualLabel,{as:"h3",className:"editor-post-taxonomies__flat-term-most-used-label",children:t.labels.most_used}),(0,P.jsx)("ul",{role:"list",className:"editor-post-taxonomies__flat-term-most-used-list",children:n.map((t=>(0,P.jsx)("li",{children:(0,P.jsx)(Ao.Button,{__next40pxDefaultSize:!0,variant:"link",onClick:()=>e(t),children:t.name})},t.id)))})]})}const Id=[],Nd=100,Ad={per_page:Nd,_fields:"id,name",context:"view"},Dd=(e,t)=>Qa(e).toLowerCase()===Qa(t).toLowerCase(),Rd=(e,t)=>e.map((e=>t.find((t=>Dd(t.name,e)))?.id)).filter((e=>void 0!==e)),Md=({children:e,__nextHasNoMarginBottom:t})=>t?(0,P.jsx)(Ao.__experimentalVStack,{spacing:4,children:e}):(0,P.jsx)(u.Fragment,{children:e});function Od({slug:e,__nextHasNoMarginBottom:t}){var s,o;const[n,i]=(0,u.useState)([]),[r,a]=(0,u.useState)(""),l=(0,p.useDebounce)(a,500);t||S()("Bottom margin styles for wp.editor.PostTaxonomiesFlatTermSelector",{since:"6.7",version:"7.0",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version."});const{terms:h,termIds:m,taxonomy:g,hasAssignAction:_,hasCreateAction:f,hasResolvedTerms:b}=(0,c.useSelect)((t=>{var s,o;const{getCurrentPost:n,getEditedPostAttribute:i}=t(Wi),{getEntityRecords:r,getTaxonomy:a,hasFinishedResolution:l}=t(d.store),c=n(),u=a(e),p=u?i(u.rest_base):Id,h={...Ad,include:p?.join(","),per_page:-1};return{hasCreateAction:!!u&&(null!==(s=c._links?.["wp:action-create-"+u.rest_base])&&void 0!==s&&s),hasAssignAction:!!u&&(null!==(o=c._links?.["wp:action-assign-"+u.rest_base])&&void 0!==o&&o),taxonomy:u,termIds:p,terms:p?.length?r("taxonomy",e,h):Id,hasResolvedTerms:l("getEntityRecords",["taxonomy",e,h])}}),[e]),{searchResults:y}=(0,c.useSelect)((t=>{const{getEntityRecords:s}=t(d.store);return{searchResults:r?s("taxonomy",e,{...Ad,search:r}):Id}}),[r,e]);(0,u.useEffect)((()=>{if(b){const e=(null!=h?h:[]).map((e=>Qa(e.name)));i(e)}}),[h,b]);const x=(0,u.useMemo)((()=>(null!=y?y:[]).map((e=>Qa(e.name)))),[y]),{editPost:v}=(0,c.useDispatch)(Wi),{saveEntityRecord:w}=(0,c.useDispatch)(d.store),{createErrorNotice:k}=(0,c.useDispatch)(hs.store);if(!_)return null;function C(e){v({[g.rest_base]:e})}const j=null!==(s=g?.labels?.add_new_item)&&void 0!==s?s:"post_tag"===e?(0,ms.__)("Add new tag"):(0,ms.__)("Add new Term"),E=null!==(o=g?.labels?.singular_name)&&void 0!==o?o:"post_tag"===e?(0,ms.__)("Tag"):(0,ms.__)("Term"),T=(0,ms.sprintf)((0,ms._x)("%s added","term"),E),B=(0,ms.sprintf)((0,ms._x)("%s removed","term"),E),I=(0,ms.sprintf)((0,ms._x)("Remove %s","term"),E);return(0,P.jsxs)(Md,{__nextHasNoMarginBottom:t,children:[(0,P.jsx)(Ao.FormTokenField,{__next40pxDefaultSize:!0,value:n,suggestions:x,onChange:function(t){const s=[...null!=h?h:[],...null!=y?y:[]],o=t.reduce(((e,t)=>(e.some((e=>e.toLowerCase()===t.toLowerCase()))||e.push(t),e)),[]),n=o.filter((e=>!s.find((t=>Dd(t.name,e)))));i(o),0!==n.length?f&&Promise.all(n.map((t=>async function(t){try{const s=await w("taxonomy",e,t,{throwOnError:!0});return Xa(s)}catch(e){if("term_exists"!==e.code)throw e;return{id:e.data.term_id,name:t.name}}}({name:t})))).then((e=>{const t=s.concat(e);C(Rd(o,t))})).catch((e=>{k(e.message,{type:"snackbar"}),C(Rd(o,s))})):C(Rd(o,s))},onInputChange:l,maxSuggestions:Nd,label:j,messages:{added:T,removed:B,remove:I},__nextHasNoMarginBottom:t}),(0,P.jsx)(Bd,{taxonomy:g,onSelect:function(t){var s;if(m.includes(t.id))return;const o=[...m,t.id],n="post_tag"===e?(0,ms.__)("Tag"):(0,ms.__)("Term"),i=(0,ms.sprintf)((0,ms._x)("%s added","term"),null!==(s=g?.labels?.singular_name)&&void 0!==s?s:n);(0,ds.speak)(i,"assertive"),C(o)}})]})}const Ld=(0,Ao.withFilters)("editor.PostTaxonomyType")(Od),Fd=()=>{const e=[(0,ms.__)("Suggestion:"),(0,P.jsx)("span",{className:"editor-post-publish-panel__link",children:(0,ms.__)("Add tags")},"label")];return(0,P.jsxs)(Ao.PanelBody,{initialOpen:!1,title:e,children:[(0,P.jsx)("p",{children:(0,ms.__)("Tags help users and search engines navigate your site and find your content. Add a few keywords to describe your post.")}),(0,P.jsx)(Ld,{slug:"post_tag",__nextHasNoMarginBottom:!0})]})},Vd=()=>{const{hasTags:e,isPostTypeSupported:t}=(0,c.useSelect)((e=>{const t=e(Wi).getCurrentPostType(),s=e(d.store).getTaxonomy("post_tag"),o=s?.types?.includes(t),n=void 0!==s,i=s&&e(Wi).getEditedPostAttribute(s.rest_base);return{hasTags:!!i?.length,isPostTypeSupported:n&&o}}),[]),[s]=(0,u.useState)(e);return t?s?null:(0,P.jsx)(Fd,{}):null},zd=(e,t)=>Vc.filter((t=>e?.includes(t.id))).find((e=>e.id===t)),Ud=({suggestedPostFormat:e,suggestionText:t,onUpdatePostFormat:s})=>(0,P.jsx)(Ao.Button,{__next40pxDefaultSize:!0,variant:"link",onClick:()=>s(e),children:t});function Hd(){const{currentPostFormat:e,suggestion:t}=(0,c.useSelect)((e=>{var t;const{getEditedPostAttribute:s,getSuggestedPostFormat:o}=e(Wi),n=null!==(t=e(d.store).getThemeSupports().formats)&&void 0!==t?t:[];return{currentPostFormat:s("format"),suggestion:zd(n,o())}}),[]),{editPost:s}=(0,c.useDispatch)(Wi),o=[(0,ms.__)("Suggestion:"),(0,P.jsx)("span",{className:"editor-post-publish-panel__link",children:(0,ms.__)("Use a post format")},"label")];return t&&t.id!==e?(0,P.jsxs)(Ao.PanelBody,{initialOpen:!1,title:o,children:[(0,P.jsx)("p",{children:(0,ms.__)("Your theme uses post formats to highlight different kinds of content, like images or videos. Apply a post format to see this special styling.")}),(0,P.jsx)("p",{children:(0,P.jsx)(Ud,{onUpdatePostFormat:e=>s({format:e}),suggestedPostFormat:t.id,suggestionText:(0,ms.sprintf)((0,ms.__)('Apply the "%1$s" format.'),t.caption)})})]}):null}const Gd={per_page:-1,orderby:"name",order:"asc",_fields:"id,name,parent",context:"view"},$d=8,Wd=[];function Zd({slug:e}){var t,s;const[o,n]=(0,u.useState)(!1),[i,r]=(0,u.useState)(""),[a,l]=(0,u.useState)(""),[h,m]=(0,u.useState)(!1),[g,_]=(0,u.useState)(""),[f,b]=(0,u.useState)([]),y=(0,p.useDebounce)(ds.speak,500),{hasCreateAction:x,hasAssignAction:v,terms:w,loading:S,availableTerms:k,taxonomy:C}=(0,c.useSelect)((t=>{var s,o;const{getCurrentPost:n,getEditedPostAttribute:i}=t(Wi),{getTaxonomy:r,getEntityRecords:a,isResolving:l}=t(d.store),c=r(e),u=n();return{hasCreateAction:!!c&&(null!==(s=u._links?.["wp:action-create-"+c.rest_base])&&void 0!==s&&s),hasAssignAction:!!c&&(null!==(o=u._links?.["wp:action-assign-"+c.rest_base])&&void 0!==o&&o),terms:c?i(c.rest_base):Wd,loading:l("getEntityRecords",["taxonomy",e,Gd]),availableTerms:a("taxonomy",e,Gd)||Wd,taxonomy:c}}),[e]),{editPost:j}=(0,c.useDispatch)(Wi),{saveEntityRecord:E}=(0,c.useDispatch)(d.store),T=(0,u.useMemo)((()=>function(e,t){const s=e=>-1!==t.indexOf(e.id)||void 0!==e.children&&e.children.map(s).filter((e=>e)).length>0,o=[...e];return o.sort(((e,t)=>{const o=s(e),n=s(t);return o===n?0:o&&!n?-1:!o&&n?1:0})),o}(qa(k),w)),[k]),{createErrorNotice:B}=(0,c.useDispatch)(hs.store);if(!v)return null;const I=e=>{j({[C.rest_base]:e})},N=e=>e.map((e=>(0,P.jsxs)("div",{className:"editor-post-taxonomies__hierarchical-terms-choice",children:[(0,P.jsx)(Ao.CheckboxControl,{__nextHasNoMarginBottom:!0,checked:-1!==w.indexOf(e.id),onChange:()=>{(e=>{const t=w.includes(e)?w.filter((t=>t!==e)):[...w,e];I(t)})(parseInt(e.id,10))},label:(0,No.decodeEntities)(e.name)}),!!e.children.length&&(0,P.jsx)("div",{className:"editor-post-taxonomies__hierarchical-terms-subchoices",children:N(e.children)})]},e.id))),A=(t,s,o)=>{var n;return null!==(n=C?.labels?.[t])&&void 0!==n?n:"category"===e?s:o},D=A("add_new_item",(0,ms.__)("Add new category"),(0,ms.__)("Add new term")),R=A("new_item_name",(0,ms.__)("Add new category"),(0,ms.__)("Add new term")),M=A("parent_item",(0,ms.__)("Parent Category"),(0,ms.__)("Parent Term")),O=`— ${M} —`,L=D,F=null!==(t=C?.labels?.search_items)&&void 0!==t?t:(0,ms.__)("Search Terms"),V=null!==(s=C?.name)&&void 0!==s?s:(0,ms.__)("Terms"),z=k.length>=$d;return(0,P.jsxs)(Ao.Flex,{direction:"column",gap:"4",children:[z&&(0,P.jsx)(Ao.SearchControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:F,value:g,onChange:e=>{const t=T.map(function(e){const t=s=>{if(""===e)return s;const o={...s};return o.children.length>0&&(o.children=o.children.map(t).filter((e=>e))),(-1!==o.name.toLowerCase().indexOf(e.toLowerCase())||o.children.length>0)&&o};return t}(e)).filter((e=>e)),s=e=>{let t=0;for(let o=0;o{m(!h)},className:"editor-post-taxonomies__hierarchical-terms-add","aria-expanded":h,variant:"link",children:D})}),h&&(0,P.jsx)("form",{onSubmit:async t=>{var s;if(t.preventDefault(),""===i||o)return;const c=function(e,t,s){return e.find((e=>(!e.parent&&!t||parseInt(e.parent)===parseInt(t))&&e.name.toLowerCase()===s.toLowerCase()))}(k,a,i);if(c)return w.some((e=>e===c.id))||I([...w,c.id]),r(""),void l("");let d;n(!0);try{d=await(u={name:i,parent:a||void 0},E("taxonomy",e,u,{throwOnError:!0}))}catch(e){return void B(e.message,{type:"snackbar"})}var u;const p="category"===e?(0,ms.__)("Category"):(0,ms.__)("Term"),h=(0,ms.sprintf)((0,ms._x)("%s added","term"),null!==(s=C?.labels?.singular_name)&&void 0!==s?s:p);(0,ds.speak)(h,"assertive"),n(!1),r(""),l(""),I([...w,d.id])},children:(0,P.jsxs)(Ao.Flex,{direction:"column",gap:"4",children:[(0,P.jsx)(Ao.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,className:"editor-post-taxonomies__hierarchical-terms-input",label:R,value:i,onChange:e=>{r(e)},required:!0}),!!k.length&&(0,P.jsx)(Ao.TreeSelect,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:M,noOptionLabel:O,onChange:e=>{l(e)},selectedId:a,tree:T}),(0,P.jsx)(Ao.FlexItem,{children:(0,P.jsx)(Ao.Button,{__next40pxDefaultSize:!0,variant:"secondary",type:"submit",className:"editor-post-taxonomies__hierarchical-terms-submit",children:L})})]})})]})}const Yd=(0,Ao.withFilters)("editor.PostTaxonomyType")(Zd);const Kd=function(){const e=(0,c.useSelect)((e=>{const t=e(Wi).getCurrentPostType(),{canUser:s,getEntityRecord:o,getTaxonomy:n}=e(d.store),i=n("category"),r=s("read",{kind:"root",name:"site"})?o("root","site")?.default_category:void 0,a=r?o("taxonomy","category",r):void 0,l=i&&i.types.some((e=>e===t)),c=i&&e(Wi).getEditedPostAttribute(i.rest_base);return!!i&&!!a&&l&&(0===c?.length||1===c?.length&&a?.id===c[0])}),[]),[t,s]=(0,u.useState)(!1);if((0,u.useEffect)((()=>{e&&s(!0)}),[e]),!t)return null;const o=[(0,ms.__)("Suggestion:"),(0,P.jsx)("span",{className:"editor-post-publish-panel__link",children:(0,ms.__)("Assign a category")},"label")];return(0,P.jsxs)(Ao.PanelBody,{initialOpen:!1,title:o,children:[(0,P.jsx)("p",{children:(0,ms.__)("Categories provide a helpful way to group related posts together and to quickly tell readers what a post is about.")}),(0,P.jsx)(Yd,{slug:"category"})]})},qd={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let Qd;const Xd=new Uint8Array(16);function Jd(){if(!Qd&&(Qd="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Qd))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Qd(Xd)}const eu=[];for(let e=0;e<256;++e)eu.push((e+256).toString(16).slice(1));function tu(e,t=0){return eu[e[t+0]]+eu[e[t+1]]+eu[e[t+2]]+eu[e[t+3]]+"-"+eu[e[t+4]]+eu[e[t+5]]+"-"+eu[e[t+6]]+eu[e[t+7]]+"-"+eu[e[t+8]]+eu[e[t+9]]+"-"+eu[e[t+10]]+eu[e[t+11]]+eu[e[t+12]]+eu[e[t+13]]+eu[e[t+14]]+eu[e[t+15]]}const su=function(e,t,s){if(qd.randomUUID&&!t&&!e)return qd.randomUUID();const o=(e=e||{}).random||(e.rng||Jd)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,t){s=s||0;for(let e=0;e<16;++e)t[s+e]=o[e];return t}return tu(o)};function ou(e){return Object.fromEntries(Object.entries(function(e){const t=new Set;return Object.fromEntries(e.map((e=>{const s=(0,v.getFilename)(e);let o="";if(s){const e=s.split(".");e.length>1&&e.pop(),o=e.join(".")}return o||(o=su()),t.has(o)&&(o=`${o}-${su()}`),t.add(o),[e,o]})))}(e)).map((([e,t])=>{const s=window.fetch(e.includes("?")?e:e+"?").then((e=>e.blob())).then((e=>new File([e],`${t}.png`,{type:e.type})));return[e,s]})))}function nu(e){const t=[];return e.forEach((e=>{t.push(e),t.push(...nu(e.innerBlocks))})),t}function iu(e){if("core/image"===e.name||"core/cover"===e.name){const{url:t,alt:s,id:o}=e.attributes;return{url:t,alt:s,id:o}}if("core/media-text"===e.name){const{mediaUrl:t,mediaAlt:s,mediaId:o}=e.attributes;return{url:t,alt:s,id:o}}return{}}function ru({clientId:e,alt:t,url:s}){const{selectBlock:o}=(0,c.useDispatch)(m.store);return(0,P.jsx)(Ao.__unstableMotion.img,{tabIndex:0,role:"button","aria-label":(0,ms.__)("Select image block."),onClick:()=>{o(e)},onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||(o(e),t.preventDefault())},alt:t,src:s,animate:{opacity:1},exit:{opacity:0,scale:0},style:{width:"32px",height:"32px",objectFit:"cover",borderRadius:"2px",cursor:"pointer"},whileHover:{scale:1.08}},e)}function au(){const[e,t]=(0,u.useState)(!1),[s,o]=(0,u.useState)(!1),[n,i]=(0,u.useState)(!1),{editorBlocks:r,mediaUpload:a}=(0,c.useSelect)((e=>({editorBlocks:e(m.store).getBlocks(),mediaUpload:e(m.store).getSettings().mediaUpload})),[]),l=nu(r).filter((e=>function(e){return"core/image"===e.name||"core/cover"===e.name?e.attributes.url&&!e.attributes.id:"core/media-text"===e.name?e.attributes.mediaUrl&&!e.attributes.mediaId:void 0}(e))),{updateBlockAttributes:d}=(0,c.useDispatch)(m.store);if(!a||!l.length)return null;const p=[(0,ms.__)("Suggestion:"),(0,P.jsx)("span",{className:"editor-post-publish-panel__link",children:(0,ms.__)("External media")},"label")];return(0,P.jsxs)(Ao.PanelBody,{initialOpen:!0,title:p,children:[(0,P.jsx)("p",{children:(0,ms.__)("Upload external images to the Media Library. Images from different domains may load slowly, display incorrectly, or be removed unexpectedly.")}),(0,P.jsxs)("div",{style:{display:"inline-flex",flexWrap:"wrap",gap:"8px"},children:[(0,P.jsx)(Ao.__unstableAnimatePresence,{onExitComplete:()=>o(!1),children:l.map((e=>{const{url:t,alt:s}=iu(e);return(0,P.jsx)(ru,{clientId:e.clientId,url:t,alt:s},e.clientId)}))}),e||s?(0,P.jsx)(Ao.Spinner,{}):(0,P.jsx)(Ao.Button,{size:"compact",variant:"primary",onClick:function(){t(!0),i(!1);const e=new Set(l.map((e=>{const{url:t}=iu(e);return t}))),s=Object.fromEntries(Object.entries(ou([...e])).map((([e,t])=>[e,t.then((e=>new Promise(((t,s)=>{a({filesList:[e],onFileChange:([e])=>{(0,ii.isBlobURL)(e.url)||t(e)},onError(){s()}})}))))])));Promise.allSettled(l.map((e=>{const{url:t}=iu(e);return s[t].then((t=>function(e,t){"core/image"!==e.name&&"core/cover"!==e.name||d(e.clientId,{id:t.id,url:t.url}),"core/media-text"===e.name&&d(e.clientId,{mediaId:t.id,mediaUrl:t.url})}(e,t))).then((()=>o(!0))).catch((()=>i(!0)))}))).finally((()=>{t(!1)}))},children:(0,ms.__)("Upload")})]}),n&&(0,P.jsx)("p",{children:(0,ms.__)("Upload failed, try again.")})]})}const lu=function({children:e}){const{isBeingScheduled:t,isRequestingSiteIcon:s,hasPublishAction:o,siteIconUrl:n,siteTitle:i,siteHome:r}=(0,c.useSelect)((e=>{var t;const{getCurrentPost:s,isEditedPostBeingScheduled:o}=e(Wi),{getEntityRecord:n,isResolving:i}=e(d.store),r=n("root","__unstableBase",void 0)||{};return{hasPublishAction:null!==(t=s()._links?.["wp:action-publish"])&&void 0!==t&&t,isBeingScheduled:o(),isRequestingSiteIcon:i("getEntityRecord",["root","__unstableBase",void 0]),siteIconUrl:r.site_icon_url,siteTitle:r.name,siteHome:r.home&&(0,v.filterURLForDisplay)(r.home)}}),[]);let a,l,u=(0,P.jsx)(Ao.Icon,{className:"components-site-icon",size:"36px",icon:td});return n&&(u=(0,P.jsx)("img",{alt:(0,ms.__)("Site Icon"),className:"components-site-icon",src:n})),s&&(u=null),o?t?(a=(0,ms.__)("Are you ready to schedule?"),l=(0,ms.__)("Your work will be published at the specified date and time.")):(a=(0,ms.__)("Are you ready to publish?"),l=(0,ms.__)("Double-check your settings before publishing.")):(a=(0,ms.__)("Are you ready to submit for review?"),l=(0,ms.__)("When you’re ready, submit your work for review, and an Editor will be able to approve it for you.")),(0,P.jsxs)("div",{className:"editor-post-publish-panel__prepublish",children:[(0,P.jsx)("div",{children:(0,P.jsx)("strong",{children:a})}),(0,P.jsx)("p",{children:l}),(0,P.jsxs)("div",{className:"components-site-card",children:[u,(0,P.jsxs)("div",{className:"components-site-info",children:[(0,P.jsx)("span",{className:"components-site-name",children:(0,No.decodeEntities)(i)||(0,ms.__)("(Untitled)")}),(0,P.jsx)("span",{className:"components-site-home",children:r})]})]}),(0,P.jsx)(au,{}),o&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(Ao.PanelBody,{initialOpen:!1,title:[(0,ms.__)("Visibility:"),(0,P.jsx)("span",{className:"editor-post-publish-panel__link",children:(0,P.jsx)(id,{})},"label")],children:(0,P.jsx)(od,{})}),(0,P.jsx)(Ao.PanelBody,{initialOpen:!1,title:[(0,ms.__)("Publish:"),(0,P.jsx)("span",{className:"editor-post-publish-panel__link",children:(0,P.jsx)(kd,{})},"label")],children:(0,P.jsx)(wd,{})})]}),(0,P.jsx)(Hd,{}),(0,P.jsx)(Vd,{}),(0,P.jsx)(Kd,{}),e]})},cu="%postname%",du="%pagename%";function uu({text:e,onCopy:t,children:s}){const o=(0,p.useCopyToClipboard)(e,t);return(0,P.jsx)(Ao.Button,{__next40pxDefaultSize:!0,variant:"secondary",ref:o,children:s})}class pu extends u.Component{constructor(){super(...arguments),this.state={showCopyConfirmation:!1},this.onCopy=this.onCopy.bind(this),this.onSelectInput=this.onSelectInput.bind(this),this.postLink=(0,u.createRef)()}componentDidMount(){this.props.focusOnMount&&this.postLink.current.focus()}componentWillUnmount(){clearTimeout(this.dismissCopyConfirmation)}onCopy(){this.setState({showCopyConfirmation:!0}),clearTimeout(this.dismissCopyConfirmation),this.dismissCopyConfirmation=setTimeout((()=>{this.setState({showCopyConfirmation:!1})}),4e3)}onSelectInput(e){e.target.select()}render(){const{children:e,isScheduled:t,post:s,postType:o}=this.props,n=o?.labels?.singular_name,i=o?.labels?.view_item,r=o?.labels?.add_new_item,a="future"===s.status?(e=>{const{slug:t}=e;return e.permalink_template.includes(cu)?e.permalink_template.replace(cu,t):e.permalink_template.includes(du)?e.permalink_template.replace(du,t):e.permalink_template})(s):s.link,l=(0,v.addQueryArgs)("post-new.php",{post_type:s.type}),c=t?(0,P.jsxs)(P.Fragment,{children:[(0,ms.__)("is now scheduled. It will go live on")," ",(0,P.jsx)(kd,{}),"."]}):(0,ms.__)("is now live.");return(0,P.jsxs)("div",{className:"post-publish-panel__postpublish",children:[(0,P.jsxs)(Ao.PanelBody,{className:"post-publish-panel__postpublish-header",children:[(0,P.jsx)("a",{ref:this.postLink,href:a,children:(0,No.decodeEntities)(s.title)||(0,ms.__)("(no title)")})," ",c]}),(0,P.jsxs)(Ao.PanelBody,{children:[(0,P.jsx)("p",{className:"post-publish-panel__postpublish-subheader",children:(0,P.jsx)("strong",{children:(0,ms.__)("What’s next?")})}),(0,P.jsxs)("div",{className:"post-publish-panel__postpublish-post-address-container",children:[(0,P.jsx)(Ao.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,className:"post-publish-panel__postpublish-post-address",readOnly:!0,label:(0,ms.sprintf)((0,ms.__)("%s address"),n),value:(0,v.safeDecodeURIComponent)(a),onFocus:this.onSelectInput}),(0,P.jsx)("div",{className:"post-publish-panel__postpublish-post-address__copy-button-wrap",children:(0,P.jsx)(uu,{text:a,onCopy:this.onCopy,children:this.state.showCopyConfirmation?(0,ms.__)("Copied!"):(0,ms.__)("Copy")})})]}),(0,P.jsxs)("div",{className:"post-publish-panel__postpublish-buttons",children:[!t&&(0,P.jsx)(Ao.Button,{variant:"primary",href:a,__next40pxDefaultSize:!0,children:i}),(0,P.jsx)(Ao.Button,{variant:t?"primary":"secondary",__next40pxDefaultSize:!0,href:l,children:r})]})]}),e]})}}const hu=(0,c.withSelect)((e=>{const{getEditedPostAttribute:t,getCurrentPost:s,isCurrentPostScheduled:o}=e(Wi),{getPostType:n}=e(d.store);return{post:s(),postType:n(t("type")),isScheduled:o()}}))(pu);class mu extends u.Component{constructor(){super(...arguments),this.onSubmit=this.onSubmit.bind(this),this.cancelButtonNode=(0,u.createRef)()}componentDidMount(){this.timeoutID=setTimeout((()=>{this.cancelButtonNode.current.focus()}),0)}componentWillUnmount(){clearTimeout(this.timeoutID)}componentDidUpdate(e){e.isPublished&&!this.props.isSaving&&this.props.isDirty&&this.props.onClose()}onSubmit(){const{onClose:e,hasPublishAction:t,isPostTypeViewable:s}=this.props;t&&s||e()}render(){const{forceIsDirty:e,isBeingScheduled:t,isPublished:s,isPublishSidebarEnabled:o,isScheduled:n,isSaving:i,isSavingNonPostEntityChanges:r,onClose:a,onTogglePublishSidebar:l,PostPublishExtension:c,PrePublishExtension:d,...u}=this.props,{hasPublishAction:p,isDirty:h,isPostTypeViewable:m,...g}=u,_=s||n&&t,f=!_&&!i,b=_&&!i;return(0,P.jsxs)("div",{className:"editor-post-publish-panel",...g,children:[(0,P.jsx)("div",{className:"editor-post-publish-panel__header",children:b?(0,P.jsx)(Ao.Button,{size:"compact",onClick:a,icon:Cn,label:(0,ms.__)("Close panel")}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)("div",{className:"editor-post-publish-panel__header-cancel-button",children:(0,P.jsx)(Ao.Button,{ref:this.cancelButtonNode,accessibleWhenDisabled:!0,disabled:r,onClick:a,variant:"secondary",size:"compact",children:(0,ms.__)("Cancel")})}),(0,P.jsx)("div",{className:"editor-post-publish-panel__header-publish-button",children:(0,P.jsx)(ed,{onSubmit:this.onSubmit,forceIsDirty:e})})]})}),(0,P.jsxs)("div",{className:"editor-post-publish-panel__content",children:[f&&(0,P.jsx)(lu,{children:d&&(0,P.jsx)(d,{})}),b&&(0,P.jsx)(hu,{focusOnMount:!0,children:c&&(0,P.jsx)(c,{})}),i&&(0,P.jsx)(Ao.Spinner,{})]}),(0,P.jsx)("div",{className:"editor-post-publish-panel__footer",children:(0,P.jsx)(Ao.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,ms.__)("Always show pre-publish checks."),checked:o,onChange:l})})]})}}const gu=(0,p.compose)([(0,c.withSelect)((e=>{var t;const{getPostType:s}=e(d.store),{getCurrentPost:o,getEditedPostAttribute:n,isCurrentPostPublished:i,isCurrentPostScheduled:r,isEditedPostBeingScheduled:a,isEditedPostDirty:l,isAutosavingPost:c,isSavingPost:u,isSavingNonPostEntityChanges:p}=e(Wi),{isPublishSidebarEnabled:h}=e(Wi),m=s(n("type"));return{hasPublishAction:null!==(t=o()._links?.["wp:action-publish"])&&void 0!==t&&t,isPostTypeViewable:m?.viewable,isBeingScheduled:a(),isDirty:l(),isPublished:i(),isPublishSidebarEnabled:h(),isSaving:u()&&!c(),isSavingNonPostEntityChanges:p(),isScheduled:r()}})),(0,c.withDispatch)(((e,{isPublishSidebarEnabled:t})=>{const{disablePublishSidebar:s,enablePublishSidebar:o}=e(Wi);return{onTogglePublishSidebar:()=>{t?s():o()}}})),Ao.withFocusReturn,Ao.withConstrainedTabbing])(mu),_u=(0,P.jsx)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,P.jsx)(k.Path,{d:"M17.3 10.1c0-2.5-2.1-4.4-4.8-4.4-2.2 0-4.1 1.4-4.6 3.3h-.2C5.7 9 4 10.7 4 12.8c0 2.1 1.7 3.8 3.7 3.8h9c1.8 0 3.2-1.5 3.2-3.3.1-1.6-1.1-2.9-2.6-3.2zm-.5 5.1h-4v-2.4L14 14l1-1-3-3-3 3 1 1 1.2-1.2v2.4H7.7c-1.2 0-2.2-1.1-2.2-2.3s1-2.4 2.2-2.4H9l.3-1.1c.4-1.3 1.7-2.2 3.2-2.2 1.8 0 3.3 1.3 3.3 2.9v1.3l1.3.2c.8.1 1.4.9 1.4 1.8 0 1-.8 1.8-1.7 1.8z"})});const fu=(0,u.forwardRef)((function({icon:e,size:t=24,...s},o){return(0,u.cloneElement)(e,{width:t,height:t,...s,ref:o})})),bu=(0,P.jsx)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,P.jsx)(k.Path,{d:"M17.3 10.1c0-2.5-2.1-4.4-4.8-4.4-2.2 0-4.1 1.4-4.6 3.3h-.2C5.7 9 4 10.7 4 12.8c0 2.1 1.7 3.8 3.7 3.8h9c1.8 0 3.2-1.5 3.2-3.3.1-1.6-1.1-2.9-2.6-3.2zm-.5 5.1h-9c-1.2 0-2.2-1.1-2.2-2.3s1-2.4 2.2-2.4h1.3l.3-1.1c.4-1.3 1.7-2.2 3.2-2.2 1.8 0 3.3 1.3 3.3 2.9v1.3l1.3.2c.8.1 1.4.9 1.4 1.8-.1 1-.9 1.8-1.8 1.8z"})}),yu=(0,P.jsx)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,P.jsx)(k.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm8 4a4 4 0 0 0 4-4H8a4 4 0 0 0 4 4Z"})}),xu=(0,P.jsx)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,P.jsx)(k.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm8 4a4 4 0 0 1-4-4h4V8a4 4 0 0 1 0 8Z"})}),vu=(0,P.jsx)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,P.jsx)(k.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 18.5A6.5 6.5 0 0 1 6.93 7.931l9.139 9.138A6.473 6.473 0 0 1 12 18.5Zm5.123-2.498a6.5 6.5 0 0 0-9.124-9.124l9.124 9.124ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Z"})}),wu=(0,P.jsx)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,P.jsx)(k.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm9 1V8h-1.5v3.5h-2V13H13Z"})}),Su=(0,P.jsx)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,P.jsx)(k.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm11.53-1.47-1.06-1.06L11 12.94l-1.47-1.47-1.06 1.06L11 15.06l4.53-4.53Z"})});function ku({children:e}){const{hasStickyAction:t,postType:s}=(0,c.useSelect)((e=>{var t;const s=e(Wi).getCurrentPost();return{hasStickyAction:null!==(t=s._links?.["wp:action-sticky"])&&void 0!==t&&t,postType:e(Wi).getCurrentPostType()}}),[]);return"post"===s&&t?e:null}function Pu(){const e=(0,c.useSelect)((e=>{var t;return null!==(t=e(Wi).getEditedPostAttribute("sticky"))&&void 0!==t&&t}),[]),{editPost:t}=(0,c.useDispatch)(Wi);return(0,P.jsx)(ku,{children:(0,P.jsx)(Ao.CheckboxControl,{className:"editor-post-sticky__checkbox-control",label:(0,ms.__)("Sticky"),help:(0,ms.__)("Pin this post to the top of the blog"),checked:e,onChange:()=>t({sticky:!e}),__nextHasNoMarginBottom:!0})})}const Cu={"auto-draft":{label:(0,ms.__)("Draft"),icon:yu},draft:{label:(0,ms.__)("Draft"),icon:yu},pending:{label:(0,ms.__)("Pending"),icon:xu},private:{label:(0,ms.__)("Private"),icon:vu},future:{label:(0,ms.__)("Scheduled"),icon:wu},publish:{label:(0,ms.__)("Published"),icon:Su}},ju=[{label:(0,ms.__)("Draft"),value:"draft",description:(0,ms.__)("Not ready to publish.")},{label:(0,ms.__)("Pending"),value:"pending",description:(0,ms.__)("Waiting for review before publishing.")},{label:(0,ms.__)("Private"),value:"private",description:(0,ms.__)("Only visible to site admins and editors.")},{label:(0,ms.__)("Scheduled"),value:"future",description:(0,ms.__)("Publish automatically on a chosen date.")},{label:(0,ms.__)("Published"),value:"publish",description:(0,ms.__)("Visible to everyone.")}],Eu=[D,R,M,O];function Tu(){const{status:e,date:t,password:s,postId:o,postType:n,canEdit:i}=(0,c.useSelect)((e=>{var t;const{getEditedPostAttribute:s,getCurrentPostId:o,getCurrentPostType:n,getCurrentPost:i}=e(Wi);return{status:s("status"),date:s("date"),password:s("password"),postId:o(),postType:n(),canEdit:null!==(t=i()._links?.["wp:action-publish"])&&void 0!==t&&t}}),[]),[r,a]=(0,u.useState)(!!s),l=(0,p.useInstanceId)(Tu,"editor-change-status__password-input"),{editEntityRecord:h}=(0,c.useDispatch)(d.store),[g,_]=(0,u.useState)(null),f=(0,u.useMemo)((()=>({anchor:g,"aria-label":(0,ms.__)("Status & visibility"),headerTitle:(0,ms.__)("Status & visibility"),placement:"left-start",offset:36,shift:!0})),[g]);if(Eu.includes(n))return null;const b=({status:i=e,password:r=s,date:a=t})=>{h("postType",n,o,{status:i,date:a,password:r})},y=e=>{a(e),e||b({password:""})},x=o=>{let n=t,i=s;"future"===e&&new Date(t)>new Date&&(n=null),"private"===o&&s&&(i=""),b({status:o,date:n,password:i})};return(0,P.jsx)(Ka,{label:(0,ms.__)("Status"),ref:_,children:i?(0,P.jsx)(Ao.Dropdown,{className:"editor-post-status",contentClassName:"editor-change-status__content",popoverProps:f,focusOnMount:!0,renderToggle:({onToggle:t,isOpen:s})=>(0,P.jsx)(Ao.Button,{className:"editor-post-status__toggle",variant:"tertiary",size:"compact",onClick:t,icon:Cu[e]?.icon,"aria-label":(0,ms.sprintf)((0,ms.__)("Change status: %s"),Cu[e]?.label),"aria-expanded":s,children:Cu[e]?.label}),renderContent:({onClose:t})=>(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(m.__experimentalInspectorPopoverHeader,{title:(0,ms.__)("Status & visibility"),onClose:t}),(0,P.jsx)("form",{children:(0,P.jsxs)(Ao.__experimentalVStack,{spacing:4,children:[(0,P.jsx)(Ao.RadioControl,{className:"editor-change-status__options",hideLabelFromVision:!0,label:(0,ms.__)("Status"),options:ju,onChange:x,selected:"auto-draft"===e?"draft":e}),"future"===e&&(0,P.jsx)("div",{className:"editor-change-status__publish-date-wrapper",children:(0,P.jsx)(Sd,{showPopoverHeaderActions:!1,isCompact:!0})}),"private"!==e&&(0,P.jsxs)(Ao.__experimentalVStack,{as:"fieldset",spacing:4,className:"editor-change-status__password-fieldset",children:[(0,P.jsx)(Ao.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,ms.__)("Password protected"),help:(0,ms.__)("Only visible to those who know the password"),checked:r,onChange:y}),r&&(0,P.jsx)("div",{className:"editor-change-status__password-input",children:(0,P.jsx)(Ao.TextControl,{label:(0,ms.__)("Password"),onChange:e=>b({password:e}),value:s,placeholder:(0,ms.__)("Use a secure password"),type:"text",id:l,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,maxLength:255})})]}),(0,P.jsx)(Pu,{})]})})]})}):(0,P.jsx)("div",{className:"editor-post-status is-read-only",children:Cu[e]?.label})})}function Bu({forceIsDirty:e}){const[t,s]=(0,u.useState)(!1),o=(0,p.useViewportMatch)("small"),{isAutosaving:n,isDirty:i,isNew:r,isPublished:a,isSaveable:l,isSaving:d,isScheduled:h,hasPublishAction:m,showIconLabels:g,postStatus:_,postStatusHasChanged:f}=(0,c.useSelect)((t=>{var s;const{isEditedPostNew:o,isCurrentPostPublished:n,isCurrentPostScheduled:i,isEditedPostDirty:r,isSavingPost:a,isEditedPostSaveable:l,getCurrentPost:c,isAutosavingPost:d,getEditedPostAttribute:u,getPostEdits:p}=t(Wi),{get:h}=t(j.store);return{isAutosaving:d(),isDirty:e||r(),isNew:o(),isPublished:n(),isSaving:a(),isSaveable:l(),isScheduled:i(),hasPublishAction:null!==(s=c()?._links?.["wp:action-publish"])&&void 0!==s&&s,showIconLabels:h("core","showIconLabels"),postStatus:u("status"),postStatusHasChanged:!!p()?.status}}),[e]),b="pending"===_,{savePost:y}=(0,c.useDispatch)(Wi),x=(0,p.usePrevious)(d);if((0,u.useEffect)((()=>{let e;return x&&!d&&(s(!0),e=setTimeout((()=>{s(!1)}),1e3)),()=>clearTimeout(e)}),[d]),!m&&b)return null;const v=!["pending","draft","auto-draft"].includes(_)&&ju.map((({value:e})=>e)).includes(_);if(a||h||v||f&&["pending","draft"].includes(_))return null;const w=b?(0,ms.__)("Save as pending"):(0,ms.__)("Save draft"),S=(0,ms.__)("Save"),k=t||!r&&!i,C=d||k,E=d||k||!l;let T;return d?T=n?(0,ms.__)("Autosaving"):(0,ms.__)("Saving"):k?T=(0,ms.__)("Saved"):o?T=w:g&&(T=S),(0,P.jsxs)(Ao.Button,{className:l||d?rr({"editor-post-save-draft":!C,"editor-post-saved-state":C,"is-saving":d,"is-autosaving":n,"is-saved":k,[(0,Ao.__unstableGetAnimateClassName)({type:"loading"})]:d}):void 0,onClick:E?void 0:()=>y(),shortcut:E?void 0:ta.displayShortcut.primary("s"),variant:"tertiary",size:"compact",icon:o?void 0:_u,label:T||w,"aria-disabled":E,children:[C&&(0,P.jsx)(fu,{icon:k?Do:bu}),T]})}function Iu({children:e}){return(0,c.useSelect)((e=>{var t;return null!==(t=e(Wi).getCurrentPost()._links?.["wp:action-publish"])&&void 0!==t&&t}),[])?e:null}const Nu=[D,R,M,O];function Au(){const[e,t]=(0,u.useState)(null),s=(0,c.useSelect)((e=>e(Wi).getCurrentPostType()),[]),o=(0,u.useMemo)((()=>({anchor:e,"aria-label":(0,ms.__)("Change publish date"),placement:"left-start",offset:36,shift:!0})),[e]),n=Pd(),i=Pd({full:!0});return Nu.includes(s)?null:(0,P.jsx)(Iu,{children:(0,P.jsx)(Ka,{label:(0,ms.__)("Publish"),ref:t,children:(0,P.jsx)(Ao.Dropdown,{popoverProps:o,focusOnMount:!0,className:"editor-post-schedule__panel-dropdown",contentClassName:"editor-post-schedule__dialog",renderToggle:({onToggle:e,isOpen:t})=>(0,P.jsx)(Ao.Button,{size:"compact",className:"editor-post-schedule__dialog-toggle",variant:"tertiary",tooltipPosition:"middle left",onClick:e,"aria-label":(0,ms.sprintf)((0,ms.__)("Change date: %s"),n),label:i,showTooltip:n!==i,"aria-expanded":t,children:n}),renderContent:({onClose:e})=>(0,P.jsx)(wd,{onClose:e})})})})}function Du({children:e}){return(0,P.jsx)(Ga,{supportKeys:"slug",children:e})}function Ru(){const e=(0,c.useSelect)((e=>(0,v.safeDecodeURIComponent)(e(Wi).getEditedPostSlug())),[]),{editPost:t}=(0,c.useDispatch)(Wi),[s,o]=(0,u.useState)(!1);return(0,P.jsx)(Ao.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,ms.__)("Slug"),autoComplete:"off",spellCheck:"false",value:s?"":e,onChange:e=>{t({slug:e}),e?s&&o(!1):s||o(!0)},onBlur:e=>{t({slug:(0,v.cleanForSlug)(e.target.value)}),s&&o(!1)},className:"editor-post-slug"})}function Mu(){return(0,P.jsx)(Du,{children:(0,P.jsx)(Ru,{})})}function Ou(){S()("wp.editor.PostSwitchToDraftButton",{since:"6.7",version:"6.9"});const[e,t]=(0,u.useState)(!1),{editPost:s,savePost:o}=(0,c.useDispatch)(Wi),{isSaving:n,isPublished:i,isScheduled:r}=(0,c.useSelect)((e=>{const{isSavingPost:t,isCurrentPostPublished:s,isCurrentPostScheduled:o}=e(Wi);return{isSaving:t(),isPublished:s(),isScheduled:o()}}),[]),a=n||!i&&!r;let l,d;i?(l=(0,ms.__)("Are you sure you want to unpublish this post?"),d=(0,ms.__)("Unpublish")):r&&(l=(0,ms.__)("Are you sure you want to unschedule this post?"),d=(0,ms.__)("Unschedule"));return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(Ao.Button,{__next40pxDefaultSize:!0,className:"editor-post-switch-to-draft",onClick:()=>{a||t(!0)},"aria-disabled":a,variant:"secondary",style:{flexGrow:"1",justifyContent:"center"},children:(0,ms.__)("Switch to draft")}),(0,P.jsx)(Ao.__experimentalConfirmDialog,{isOpen:e,onConfirm:()=>{t(!1),s({status:"draft"}),o()},onCancel:()=>t(!1),confirmButtonText:d,children:l})]})}function Lu(){const{syncStatus:e,postType:t}=(0,c.useSelect)((e=>{const{getEditedPostAttribute:t}=e(Wi),s=t("meta");return{syncStatus:"unsynced"===s?.wp_pattern_sync_status?"unsynced":t("wp_pattern_sync_status"),postType:t("type")}}));return"wp_block"!==t?null:(0,P.jsx)(Ka,{label:(0,ms.__)("Sync status"),children:(0,P.jsx)("div",{className:"editor-post-sync-status__value",children:"unsynced"===e?(0,ms._x)("Not synced","pattern (singular)"):(0,ms._x)("Synced","pattern (singular)")})})}const Fu=e=>e;const Vu=function({taxonomyWrapper:e=Fu}){const{postType:t,taxonomies:s}=(0,c.useSelect)((e=>({postType:e(Wi).getCurrentPostType(),taxonomies:e(d.store).getTaxonomies({per_page:-1})})),[]);return(null!=s?s:[]).filter((e=>e.types.includes(t)&&e.visibility?.show_ui)).map((t=>{const s=t.hierarchical?Yd:Ld,o={slug:t.slug,...t.hierarchical?{}:{__nextHasNoMarginBottom:!0}};return(0,P.jsx)(u.Fragment,{children:e((0,P.jsx)(s,{...o}),t)},`taxonomy-${t.slug}`)}))};function zu({children:e}){const t=(0,c.useSelect)((e=>{const t=e(Wi).getCurrentPostType(),s=e(d.store).getTaxonomies({per_page:-1});return s?.some((e=>e.types.includes(t)))}),[]);return t?e:null}function Uu({taxonomy:e,children:t}){const s=e?.slug,o=s?`taxonomy-panel-${s}`:"",{isEnabled:n,isOpened:i}=(0,c.useSelect)((e=>{const{isEditorPanelEnabled:t,isEditorPanelOpened:n}=e(Wi);return{isEnabled:!!s&&t(o),isOpened:!!s&&n(o)}}),[o,s]),{toggleEditorPanelOpened:r}=(0,c.useDispatch)(Wi);if(!n)return null;const a=e?.labels?.menu_name;return a?(0,P.jsx)(Ao.PanelBody,{title:a,opened:i,onToggle:()=>r(o),children:t}):null}const Hu=function(){return(0,P.jsx)(zu,{children:(0,P.jsx)(Vu,{taxonomyWrapper:(e,t)=>(0,P.jsx)(Uu,{taxonomy:t,children:e})})})};var Gu=s(4132);function $u(){const e=(0,p.useInstanceId)($u),{content:t,blocks:s,type:o,id:n}=(0,c.useSelect)((e=>{const{getEditedEntityRecord:t}=e(d.store),{getCurrentPostType:s,getCurrentPostId:o}=e(Wi),n=s(),i=o(),r=t("postType",n,i);return{content:r?.content,blocks:r?.blocks,type:n,id:i}}),[]),{editEntityRecord:i}=(0,c.useDispatch)(d.store),r=(0,u.useMemo)((()=>t instanceof Function?t({blocks:s}):s?(0,y.__unstableSerializeAndClean)(s):t),[t,s]);return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(Ao.VisuallyHidden,{as:"label",htmlFor:`post-content-${e}`,children:(0,ms.__)("Type text or HTML")}),(0,P.jsx)(Gu.A,{autoComplete:"off",dir:"auto",value:r,onChange:e=>{i("postType",o,n,{content:e.target.value,blocks:void 0,selection:void 0})},className:"editor-post-text-editor",id:`post-content-${e}`,placeholder:(0,ms.__)("Start writing with text or HTML")})]})}const Wu=window.wp.dom,Zu="wp-block wp-block-post-title block-editor-block-list__block editor-post-title editor-post-title__input rich-text",Yu=/[\r\n]+/g;function Ku(e){const t=(0,u.useRef)(),{isCleanNewPost:s}=(0,c.useSelect)((e=>{const{isCleanNewPost:t}=e(Wi);return{isCleanNewPost:t()}}),[]);return(0,u.useImperativeHandle)(e,(()=>({focus:()=>{t?.current?.focus()}}))),(0,u.useEffect)((()=>{if(!t.current)return;const{defaultView:e}=t.current.ownerDocument,{name:o,parent:n}=e,i="editor-canvas"===o?n.document:e.document,{activeElement:r,body:a}=i;!s||r&&a!==r||t.current.focus()}),[s]),{ref:t}}function qu(){const{editPost:e}=(0,c.useDispatch)(Wi),{title:t}=(0,c.useSelect)((e=>{const{getEditedPostAttribute:t}=e(Wi);return{title:t("title")}}),[]);return{title:t,setTitle:function(t){e({title:t})}}}const Qu=(0,u.forwardRef)((function(e,t){const{placeholder:s}=(0,c.useSelect)((e=>{const{getSettings:t}=e(m.store),{titlePlaceholder:s}=t();return{placeholder:s}}),[]),[o,n]=(0,u.useState)(!1),{ref:i}=Ku(t),{title:r,setTitle:a}=qu(),[l,d]=(0,u.useState)({}),{clearSelectedBlock:h,insertBlocks:g,insertDefaultBlock:_}=(0,c.useDispatch)(m.store),f=(0,No.decodeEntities)(s)||(0,ms.__)("Add title"),{value:b,onChange:x,ref:v}=(0,ia.__unstableUseRichText)({value:r,onChange(e){a(e.replace(Yu," "))},placeholder:f,selectionStart:l.start,selectionEnd:l.end,onSelectionChange(e,t){d((s=>{const{start:o,end:n}=s;return o===e&&n===t?s:{start:e,end:t}}))},__unstableDisableFormats:!1});function w(e){g(e,0)}const S=rr(Zu,{"is-selected":o});return(0,P.jsx)(Ga,{supportKeys:"title",children:(0,P.jsx)("h1",{ref:(0,p.useMergeRefs)([v,i]),contentEditable:!0,className:S,"aria-label":f,role:"textbox","aria-multiline":"true",onFocus:function(){n(!0),h()},onBlur:function(){n(!1),d({})},onKeyDown:function(e){e.keyCode===ta.ENTER&&(e.preventDefault(),_(void 0,void 0,0))},onPaste:function(e){const t=e.clipboardData;let s="",o="";try{s=t.getData("text/plain"),o=t.getData("text/html")}catch(e){return}window.console.log("Received HTML:\n\n",o),window.console.log("Received plain text:\n\n",s);const n=(0,y.pasteHandler)({HTML:o,plainText:s});if(e.preventDefault(),n.length)if("string"!=typeof n){const[e]=n;if(r||"core/heading"!==e.name&&"core/paragraph"!==e.name)w(n);else{const t=(0,Wu.__unstableStripHTML)(e.attributes.content);a(t),w(n.slice(1))}}else{const e=(0,Wu.__unstableStripHTML)(n);x((0,ia.insert)(b,(0,ia.create)({html:e})))}}})})}));const Xu=(0,u.forwardRef)((function(e,t){const{placeholder:s}=(0,c.useSelect)((e=>{const{getSettings:t}=e(m.store),{titlePlaceholder:s}=t();return{placeholder:s}}),[]),[o,n]=(0,u.useState)(!1),{title:i,setTitle:r}=qu(),{ref:a}=Ku(t),l=rr(Zu,{"is-selected":o,"is-raw-text":!0}),d=(0,No.decodeEntities)(s)||(0,ms.__)("Add title");return(0,P.jsx)(Ao.TextareaControl,{ref:a,value:i,onChange:function(e){r(e.replace(Yu," "))},onFocus:function(){n(!0)},onBlur:function(){n(!1)},label:s,className:l,placeholder:d,hideLabelFromVision:!0,autoComplete:"off",dir:"auto",rows:1,__nextHasNoMarginBottom:!0})}));function Ju({children:e}){const{canTrashPost:t}=(0,c.useSelect)((e=>{const{isEditedPostNew:t,getCurrentPostId:s,getCurrentPostType:o}=e(Wi),{canUser:n}=e(d.store),i=o(),r=s(),a=t(),l=!!r&&n("delete",{kind:"postType",name:i,id:r});return{canTrashPost:(!a||r)&&l&&!V.includes(i)}}),[]);return t?e:null}function ep({onActionPerformed:e}){const t=(0,c.useRegistry)(),{isNew:s,isDeleting:o,postId:n,title:i}=(0,c.useSelect)((e=>{const t=e(Wi);return{isNew:t.isEditedPostNew(),isDeleting:t.isDeletingPost(),postId:t.getCurrentPostId(),title:t.getCurrentPostAttribute("title")}}),[]),{trashPost:r}=(0,c.useDispatch)(Wi),[a,l]=(0,u.useState)(!1);if(s||!n)return null;return(0,P.jsxs)(Ju,{children:[(0,P.jsx)(Ao.Button,{__next40pxDefaultSize:!0,className:"editor-post-trash",isDestructive:!0,variant:"secondary",isBusy:o,"aria-disabled":o,onClick:o?void 0:()=>l(!0),children:(0,ms.__)("Move to trash")}),(0,P.jsx)(Ao.__experimentalConfirmDialog,{isOpen:a,onConfirm:async()=>{l(!1),await r();const s=await t.resolveSelect(Wi).getCurrentPost();e?.("move-to-trash",[s])},onCancel:()=>l(!1),confirmButtonText:(0,ms.__)("Move to trash"),size:"small",children:(0,ms.sprintf)((0,ms.__)('Are you sure you want to move "%s" to the trash?'),i)})]})}const tp=(0,P.jsx)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,P.jsx)(k.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M5.625 5.5h9.75c.069 0 .125.056.125.125v9.75a.125.125 0 0 1-.125.125h-9.75a.125.125 0 0 1-.125-.125v-9.75c0-.069.056-.125.125-.125ZM4 5.625C4 4.728 4.728 4 5.625 4h9.75C16.273 4 17 4.728 17 5.625v9.75c0 .898-.727 1.625-1.625 1.625h-9.75A1.625 1.625 0 0 1 4 15.375v-9.75Zm14.5 11.656v-9H20v9C20 18.8 18.77 20 17.251 20H6.25v-1.5h11.001c.69 0 1.249-.528 1.249-1.219Z"})});function sp({onClose:e}){const{isEditable:t,postSlug:s,postLink:o,permalinkPrefix:n,permalinkSuffix:i,permalink:r}=(0,c.useSelect)((e=>{var t;const s=e(Wi).getCurrentPost(),o=e(Wi).getCurrentPostType(),n=e(d.store).getPostType(o),i=e(Wi).getPermalinkParts(),r=null!==(t=s?._links?.["wp:action-publish"])&&void 0!==t&&t;return{isEditable:e(Wi).isPermalinkEditable()&&r,postSlug:(0,v.safeDecodeURIComponent)(e(Wi).getEditedPostSlug()),viewPostLabel:n?.labels.view_item,postLink:s.link,permalinkPrefix:i?.prefix,permalinkSuffix:i?.suffix,permalink:(0,v.safeDecodeURIComponent)(e(Wi).getPermalink())}}),[]),{editPost:a}=(0,c.useDispatch)(Wi),{createNotice:l}=(0,c.useDispatch)(hs.store),[h,g]=(0,u.useState)(!1),_=(0,p.useCopyToClipboard)(r,(()=>{l("info",(0,ms.__)("Copied URL to clipboard."),{isDismissible:!0,type:"snackbar"})}));return(0,P.jsxs)("div",{className:"editor-post-url",children:[(0,P.jsx)(m.__experimentalInspectorPopoverHeader,{title:(0,ms.__)("Link"),onClose:e}),(0,P.jsxs)(Ao.__experimentalVStack,{spacing:3,children:[t&&(0,P.jsx)("div",{children:(0,u.createInterpolateElement)((0,ms.__)("Customize the last part of the URL. Learn more."),{a:(0,P.jsx)(Ao.ExternalLink,{href:(0,ms.__)("https://wordpress.org/documentation/article/page-post-settings-sidebar/#permalink")})})}),(0,P.jsxs)("div",{children:[t&&(0,P.jsx)(Ao.__experimentalInputControl,{__next40pxDefaultSize:!0,prefix:(0,P.jsx)(Ao.__experimentalInputControlPrefixWrapper,{children:"/"}),suffix:(0,P.jsx)(Ao.__experimentalInputControlSuffixWrapper,{variant:"control",children:(0,P.jsx)(Ao.Button,{icon:tp,ref:_,size:"small",label:"Copy"})}),label:(0,ms.__)("Link"),hideLabelFromVision:!0,value:h?"":s,autoComplete:"off",spellCheck:"false",type:"text",className:"editor-post-url__input",onChange:e=>{a({slug:e}),e?h&&g(!1):h||g(!0)},onBlur:e=>{a({slug:(0,v.cleanForSlug)(e.target.value)}),h&&g(!1)},help:(0,P.jsxs)(Ao.ExternalLink,{className:"editor-post-url__link",href:o,target:"_blank",children:[(0,P.jsx)("span",{className:"editor-post-url__link-prefix",children:n}),(0,P.jsx)("span",{className:"editor-post-url__link-slug",children:s}),(0,P.jsx)("span",{className:"editor-post-url__link-suffix",children:i})]})}),!t&&(0,P.jsx)(Ao.ExternalLink,{className:"editor-post-url__link",href:o,target:"_blank",children:o})]})]})]})}function op({children:e}){const t=(0,c.useSelect)((e=>{const t=e(Wi).getCurrentPostType(),s=e(d.store).getPostType(t);if(!s?.viewable)return!1;if(!e(Wi).getCurrentPost().link)return!1;return!!e(Wi).getPermalinkParts()}),[]);return t?e:null}function np(){return ip()}function ip(){const e=(0,c.useSelect)((e=>e(Wi).getPermalink()),[]);return(0,v.filterURLForDisplay)((0,v.safeDecodeURIComponent)(e))}function rp(){const[e,t]=(0,u.useState)(null),s=(0,u.useMemo)((()=>({anchor:e,placement:"left-start",offset:36,shift:!0})),[e]);return(0,P.jsx)(op,{children:(0,P.jsx)(Ka,{label:(0,ms.__)("Link"),ref:t,children:(0,P.jsx)(Ao.Dropdown,{popoverProps:s,className:"editor-post-url__panel-dropdown",contentClassName:"editor-post-url__panel-dialog",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,P.jsx)(ap,{isOpen:e,onClick:t}),renderContent:({onClose:e})=>(0,P.jsx)(sp,{onClose:e})})})})}function ap({isOpen:e,onClick:t}){const{slug:s,isFrontPage:o,postLink:n}=(0,c.useSelect)((e=>{const{getCurrentPostId:t,getCurrentPost:s}=e(Wi),{getEditedEntityRecord:o,canUser:n}=e(d.store),i=n("read",{kind:"root",name:"site"})?o("root","site"):void 0,r=t();return{slug:e(Wi).getEditedPostSlug(),isFrontPage:i?.page_on_front===r,postLink:s()?.link}}),[]),i=(0,v.safeDecodeURIComponent)(s);return(0,P.jsx)(Ao.Button,{size:"compact",className:"editor-post-url__panel-toggle",variant:"tertiary","aria-expanded":e,"aria-label":(0,ms.sprintf)((0,ms.__)("Change link: %s"),i),onClick:t,children:(0,P.jsx)(Ao.__experimentalTruncate,{numberOfLines:1,children:o?n:`/${i}`})})}function lp({render:e}){return e({canEdit:(0,c.useSelect)((e=>{var t;return null!==(t=e(Wi).getCurrentPost()._links?.["wp:action-publish"])&&void 0!==t&&t}))})}const cp=(0,P.jsx)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,P.jsx)(k.Path,{d:"M12 3.2c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8 0-4.8-4-8.8-8.8-8.8zm0 16c-4 0-7.2-3.3-7.2-7.2C4.8 8 8 4.8 12 4.8s7.2 3.3 7.2 7.2c0 4-3.2 7.2-7.2 7.2zM11 17h2v-6h-2v6zm0-8h2V7h-2v2z"})}),dp=window.wp.wordcount;function up(){const e=(0,c.useSelect)((e=>e(Wi).getEditedPostAttribute("content")),[]),t=(0,ms._x)("words","Word count type. Do not translate!");return(0,P.jsx)("span",{className:"word-count",children:(0,dp.count)(e,t)})}const pp=189;function hp(){const e=(0,c.useSelect)((e=>e(Wi).getEditedPostAttribute("content")),[]),t=(0,ms._x)("words","Word count type. Do not translate!"),s=Math.round((0,dp.count)(e,t)/pp),o=0===s?(0,u.createInterpolateElement)((0,ms.__)("< 1 minute"),{span:(0,P.jsx)("span",{})}):(0,u.createInterpolateElement)((0,ms.sprintf)((0,ms._n)("%s minute","%s minutes",s),s),{span:(0,P.jsx)("span",{})});return(0,P.jsx)("span",{className:"time-to-read",children:o})}function mp(){const e=(0,c.useSelect)((e=>e(Wi).getEditedPostAttribute("content")),[]);return(0,dp.count)(e,"characters_including_spaces")}const gp=function({hasOutlineItemsDisabled:e,onRequestClose:t}){const{headingCount:s,paragraphCount:o,numberOfBlocks:n}=(0,c.useSelect)((e=>{const{getGlobalBlockCount:t}=e(m.store);return{headingCount:t("core/heading"),paragraphCount:t("core/paragraph"),numberOfBlocks:t()}}),[]);return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)("div",{className:"table-of-contents__wrapper",role:"note","aria-label":(0,ms.__)("Document Statistics"),tabIndex:"0",children:(0,P.jsxs)("ul",{role:"list",className:"table-of-contents__counts",children:[(0,P.jsxs)("li",{className:"table-of-contents__count",children:[(0,ms.__)("Words"),(0,P.jsx)(up,{})]}),(0,P.jsxs)("li",{className:"table-of-contents__count",children:[(0,ms.__)("Characters"),(0,P.jsx)("span",{className:"table-of-contents__number",children:(0,P.jsx)(mp,{})})]}),(0,P.jsxs)("li",{className:"table-of-contents__count",children:[(0,ms.__)("Time to read"),(0,P.jsx)(hp,{})]}),(0,P.jsxs)("li",{className:"table-of-contents__count",children:[(0,ms.__)("Headings"),(0,P.jsx)("span",{className:"table-of-contents__number",children:s})]}),(0,P.jsxs)("li",{className:"table-of-contents__count",children:[(0,ms.__)("Paragraphs"),(0,P.jsx)("span",{className:"table-of-contents__number",children:o})]}),(0,P.jsxs)("li",{className:"table-of-contents__count",children:[(0,ms.__)("Blocks"),(0,P.jsx)("span",{className:"table-of-contents__number",children:n})]})]})}),s>0&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)("hr",{}),(0,P.jsx)("h2",{className:"table-of-contents__title",children:(0,ms.__)("Document Outline")}),(0,P.jsx)(ma,{onSelect:t,hasOutlineItemsDisabled:e})]})]})};const _p=(0,u.forwardRef)((function({hasOutlineItemsDisabled:e,repositionDropdown:t,...s},o){const n=(0,c.useSelect)((e=>!!e(m.store).getBlockCount()),[]);return(0,P.jsx)(Ao.Dropdown,{popoverProps:{placement:t?"right":"bottom"},className:"table-of-contents",contentClassName:"table-of-contents__popover",renderToggle:({isOpen:e,onToggle:t})=>(0,P.jsx)(Ao.Button,{__next40pxDefaultSize:!0,...s,ref:o,onClick:n?t:void 0,icon:cp,"aria-expanded":e,"aria-haspopup":"true",label:(0,ms.__)("Details"),tooltipPosition:"bottom","aria-disabled":!n}),renderContent:({onClose:t})=>(0,P.jsx)(gp,{onRequestClose:t,hasOutlineItemsDisabled:e})})}));function fp(){const{__experimentalGetDirtyEntityRecords:e}=(0,c.useSelect)(d.store);return(0,u.useEffect)((()=>{const t=t=>{if(e().length>0)return t.returnValue=(0,ms.__)("You have unsaved changes. If you proceed, they will be lost."),t.returnValue};return window.addEventListener("beforeunload",t),()=>{window.removeEventListener("beforeunload",t)}}),[e]),null}const bp=(0,p.createHigherOrderComponent)((e=>({useSubRegistry:t=!0,...s})=>{const o=(0,c.useRegistry)(),[n]=(0,u.useState)((()=>new WeakMap)),i=function(e,t,s){if(!s)return t;let o=e.get(t);return o||(o=(0,c.createRegistry)({"core/block-editor":m.storeConfig},t),o.registerStore("core/editor",$i),e.set(t,o)),o}(n,o,t);return i===o?(0,P.jsx)(e,{registry:o,...s}):(0,P.jsx)(c.RegistryProvider,{value:i,children:(0,P.jsx)(e,{registry:i,...s})})}),"withRegistryProvider"),yp=(e,t)=>`${t}`,xp=e=>`href="${e}" target="_blank" rel="noreferrer noopener"`,vp=e=>{const{title:t,foreign_landing_url:s,creator:o,creator_url:n,license:i,license_version:r,license_url:a}=e,l=((e,t)=>{let s=e.trim();return"pdm"!==e&&(s=e.toUpperCase().replace("SAMPLING","Sampling")),t&&(s+=` ${t}`),["pdm","cc0"].includes(e)||(s=`CC ${s}`),s})(i,r),c=(0,No.decodeEntities)(o);let d;return d=c?t?(0,ms.sprintf)((0,ms._x)('"%1$s" by %2$s/ %3$s',"caption"),yp(s,(0,No.decodeEntities)(t)),n?yp(n,c):c,a?yp(`${a}?ref=openverse`,l):l):(0,ms.sprintf)((0,ms._x)("Work by %2$s/ %3$s","caption"),xp(s),n?yp(n,c):c,a?yp(`${a}?ref=openverse`,l):l):t?(0,ms.sprintf)((0,ms._x)('"%1$s"/ %2$s',"caption"),yp(s,(0,No.decodeEntities)(t)),a?yp(`${a}?ref=openverse`,l):l):(0,ms.sprintf)((0,ms._x)("Work/ %2$s","caption"),xp(s),a?yp(`${a}?ref=openverse`,l):l),d.replace(/\s{2}/g," ")},wp=async(e={})=>(await(0,c.resolveSelect)(d.store).getMediaItems({...e,orderBy:e?.search?"relevance":"date"})).map((e=>({...e,alt:e.alt_text,url:e.source_url,previewUrl:e.media_details?.sizes?.medium?.source_url,caption:e.caption?.raw}))),Sp=[{name:"images",labels:{name:(0,ms.__)("Images"),search_items:(0,ms.__)("Search images")},mediaType:"image",fetch:async(e={})=>wp({...e,media_type:"image"})},{name:"videos",labels:{name:(0,ms.__)("Videos"),search_items:(0,ms.__)("Search videos")},mediaType:"video",fetch:async(e={})=>wp({...e,media_type:"video"})},{name:"audio",labels:{name:(0,ms.__)("Audio"),search_items:(0,ms.__)("Search audio")},mediaType:"audio",fetch:async(e={})=>wp({...e,media_type:"audio"})},{name:"openverse",labels:{name:(0,ms.__)("Openverse"),search_items:(0,ms.__)("Search Openverse")},mediaType:"image",async fetch(e={}){const t={...e,mature:!1,excluded_source:"flickr,inaturalist,wikimedia",license:"pdm,cc0"},s={per_page:"page_size",search:"q"},o=new URL("https://api.openverse.org/v1/images/");Object.entries(t).forEach((([e,t])=>{const n=s[e]||e;o.searchParams.set(n,t)}));const n=await window.fetch(o,{headers:{"User-Agent":"WordPress/inserter-media-fetch"}});return(await n.json()).results.map((e=>({...e,title:e.title?.toLowerCase().startsWith("file:")?e.title.slice(5):e.title,sourceId:e.id,id:void 0,caption:vp(e),previewUrl:e.thumbnail})))},getReportUrl:({sourceId:e})=>`https://wordpress.org/openverse/image/${e}/report/`,isExternalResource:!0}],kp=()=>{};function Pp({additionalData:e={},allowedTypes:t,filesList:s,maxUploadFileSize:o,onError:n=kp,onFileChange:i}){const{getCurrentPost:r,getEditorSettings:a}=(0,c.select)(Wi),{lockPostAutosaving:l,unlockPostAutosaving:d,lockPostSaving:u,unlockPostSaving:p}=(0,c.dispatch)(Wi),h=a().allowedMimeTypes,m=`image-upload-${su()}`;let g=!1;o=o||a().maxUploadFileSize;const _=r(),f="number"==typeof _?.id?_.id:_?.wp_id,b=f?{post:f}:{},y=()=>{p(m),d(m),g=!1};(0,Ki.uploadMedia)({allowedTypes:t,filesList:s,onFileChange:e=>{g?y():(u(m),l(m),g=!0),i(e)},additionalData:{...b,...e},maxUploadFileSize:o,onError:({message:e})=>{y(),n(e)},wpAllowedMimeTypes:h})}var Cp=s(66),jp=s.n(Cp); +*/o=[e,t],s=function(e,t){"use strict";var s,o,n="function"==typeof Map?new Map:(s=[],o=[],{has:function(e){return s.indexOf(e)>-1},get:function(e){return o[s.indexOf(e)]},set:function(e,t){-1===s.indexOf(e)&&(s.push(e),o.push(t))},delete:function(e){var t=s.indexOf(e);t>-1&&(s.splice(t,1),o.splice(t,1))}}),i=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(e){i=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}function r(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!n.has(e)){var t=null,s=null,o=null,r=function(){e.clientWidth!==s&&p()},a=function(t){window.removeEventListener("resize",r,!1),e.removeEventListener("input",p,!1),e.removeEventListener("keyup",p,!1),e.removeEventListener("autosize:destroy",a,!1),e.removeEventListener("autosize:update",p,!1),Object.keys(t).forEach((function(s){e.style[s]=t[s]})),n.delete(e)}.bind(e,{height:e.style.height,resize:e.style.resize,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",a,!1),"onpropertychange"in e&&"oninput"in e&&e.addEventListener("keyup",p,!1),window.addEventListener("resize",r,!1),e.addEventListener("input",p,!1),e.addEventListener("autosize:update",p,!1),e.style.overflowX="hidden",e.style.wordWrap="break-word",n.set(e,{destroy:a,update:p}),l()}function l(){var s=window.getComputedStyle(e,null);"vertical"===s.resize?e.style.resize="none":"both"===s.resize&&(e.style.resize="horizontal"),t="content-box"===s.boxSizing?-(parseFloat(s.paddingTop)+parseFloat(s.paddingBottom)):parseFloat(s.borderTopWidth)+parseFloat(s.borderBottomWidth),isNaN(t)&&(t=0),p()}function c(t){var s=e.style.width;e.style.width="0px",e.offsetWidth,e.style.width=s,e.style.overflowY=t}function d(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push({node:e.parentNode,scrollTop:e.parentNode.scrollTop}),e=e.parentNode;return t}function u(){if(0!==e.scrollHeight){var o=d(e),n=document.documentElement&&document.documentElement.scrollTop;e.style.height="",e.style.height=e.scrollHeight+t+"px",s=e.clientWidth,o.forEach((function(e){e.node.scrollTop=e.scrollTop})),n&&(document.documentElement.scrollTop=n)}}function p(){u();var t=Math.round(parseFloat(e.style.height)),s=window.getComputedStyle(e,null),n="content-box"===s.boxSizing?Math.round(parseFloat(s.height)):e.offsetHeight;if(n{e.exports=function(e,t,s){return((s=window.getComputedStyle)?s(e):e.currentStyle)[t.replace(/-(\w)/gi,(function(e,t){return t.toUpperCase()}))]}},66:e=>{"use strict";var t=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===s}(e)}(e)};var s="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function o(e,t){return!1!==t.clone&&t.isMergeableObject(e)?l((s=e,Array.isArray(s)?[]:{}),e,t):e;var s}function n(e,t,s){return e.concat(t).map((function(e){return o(e,s)}))}function i(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return Object.propertyIsEnumerable.call(e,t)})):[]}(e))}function r(e,t){try{return t in e}catch(e){return!1}}function a(e,t,s){var n={};return s.isMergeableObject(e)&&i(e).forEach((function(t){n[t]=o(e[t],s)})),i(t).forEach((function(i){(function(e,t){return r(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,i)||(r(e,i)&&s.isMergeableObject(t[i])?n[i]=function(e,t){if(!t.customMerge)return l;var s=t.customMerge(e);return"function"==typeof s?s:l}(i,s)(e[i],t[i],s):n[i]=o(t[i],s))})),n}function l(e,s,i){(i=i||{}).arrayMerge=i.arrayMerge||n,i.isMergeableObject=i.isMergeableObject||t,i.cloneUnlessOtherwiseSpecified=o;var r=Array.isArray(s);return r===Array.isArray(e)?r?i.arrayMerge(e,s,i):a(e,s,i):o(s,i)}l.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,s){return l(e,s,t)}),{})};var c=l;e.exports=c},5215:e=>{"use strict";e.exports=function e(t,s){if(t===s)return!0;if(t&&s&&"object"==typeof t&&"object"==typeof s){if(t.constructor!==s.constructor)return!1;var o,n,i;if(Array.isArray(t)){if((o=t.length)!=s.length)return!1;for(n=o;0!=n--;)if(!e(t[n],s[n]))return!1;return!0}if(t.constructor===RegExp)return t.source===s.source&&t.flags===s.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===s.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===s.toString();if((o=(i=Object.keys(t)).length)!==Object.keys(s).length)return!1;for(n=o;0!=n--;)if(!Object.prototype.hasOwnProperty.call(s,i[n]))return!1;for(n=o;0!=n--;){var r=i[n];if(!e(t[r],s[r]))return!1}return!0}return t!=t&&s!=s}},461:(e,t,s)=>{var o=s(6109);e.exports=function(e){var t=o(e,"line-height"),s=parseFloat(t,10);if(t===s+""){var n=e.style.lineHeight;e.style.lineHeight=t+"em",t=o(e,"line-height"),s=parseFloat(t,10),n?e.style.lineHeight=n:delete e.style.lineHeight}if(-1!==t.indexOf("pt")?(s*=4,s/=3):-1!==t.indexOf("mm")?(s*=96,s/=25.4):-1!==t.indexOf("cm")?(s*=96,s/=2.54):-1!==t.indexOf("in")?s*=96:-1!==t.indexOf("pc")&&(s*=16),s=Math.round(s),"normal"===t){var i=e.nodeName,r=document.createElement(i);r.innerHTML=" ","TEXTAREA"===i.toUpperCase()&&r.setAttribute("rows","1");var a=o(e,"font-size");r.style.fontSize=a,r.style.padding="0px",r.style.border="0px";var l=document.body;l.appendChild(r),s=r.offsetHeight,l.removeChild(r)}return s}},628:(e,t,s)=>{"use strict";var o=s(4067);function n(){}function i(){}i.resetWarningCache=n,e.exports=function(){function e(e,t,s,n,i,r){if(r!==o){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var s={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:n};return s.PropTypes=s,s}},5826:(e,t,s)=>{e.exports=s(628)()},4067:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},4462:function(e,t,s){"use strict";var o,n=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var s in t)t.hasOwnProperty(s)&&(e[s]=t[s])},function(e,t){function s(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(s.prototype=t.prototype,new s)}),i=this&&this.__assign||Object.assign||function(e){for(var t,s=1,o=arguments.length;s{"use strict";var o=s(4462);t.A=o.TextareaAutosize},9681:e=>{var t={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ả:"A",Ạ:"A",Ẩ:"A",Ẫ:"A",Ậ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ẻ:"E",Ẽ:"E",Ẹ:"E",Ể:"E",Ễ:"E",Ệ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ỉ:"I",Ị:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ỏ:"O",Ọ:"O",Ổ:"O",Ỗ:"O",Ộ:"O",Ờ:"O",Ở:"O",Ỡ:"O",Ớ:"O",Ợ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ủ:"U",Ụ:"U",Ử:"U",Ữ:"U",Ự:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ả:"a",ạ:"a",ẩ:"a",ẫ:"a",ậ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ẻ:"e",ẽ:"e",ẹ:"e",ể:"e",ễ:"e",ệ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ỉ:"i",ị:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ỏ:"o",ọ:"o",ổ:"o",ỗ:"o",ộ:"o",ờ:"o",ở:"o",ỡ:"o",ớ:"o",ợ:"o",ù:"u",ú:"u",û:"u",ü:"u",ủ:"u",ụ:"u",ử:"u",ữ:"u",ự:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"C",ċ:"c",Č:"C",č:"c",C̆:"C",c̆:"c",Ď:"D",ď:"d",Đ:"D",đ:"d",Ē:"E",ē:"e",Ĕ:"E",ĕ:"e",Ė:"E",ė:"e",Ę:"E",ę:"e",Ě:"E",ě:"e",Ĝ:"G",Ǵ:"G",ĝ:"g",ǵ:"g",Ğ:"G",ğ:"g",Ġ:"G",ġ:"g",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",Ḫ:"H",ḫ:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",IJ:"IJ",ij:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",Ḱ:"K",ḱ:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",Ḿ:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ʼn:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",Ẃ:"W",ẃ:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",Ứ:"U",ứ:"u",Ṹ:"U",ṹ:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",Ṕ:"P",ṕ:"p",Ṥ:"S",ṥ:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",Ồ:"O",ồ:"o",Ṑ:"O",ṑ:"o",Ừ:"U",ừ:"u",Ẁ:"W",ẁ:"w",Ỳ:"Y",ỳ:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",Ṧ:"S",ṧ:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",Ḑ:"D",ḑ:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z",й:"и",Й:"И",ё:"е",Ё:"Е"},s=Object.keys(t).join("|"),o=new RegExp(s,"g"),n=new RegExp(s,"");function i(e){return t[e]}var r=function(e){return e.replace(o,i)};e.exports=r,e.exports.has=function(e){return!!e.match(n)},e.exports.remove=r},1609:e=>{"use strict";e.exports=window.React}},t={};function s(o){var n=t[o];if(void 0!==n)return n.exports;var i=t[o]={exports:{}};return e[o].call(i.exports,i,i.exports,s),i.exports}s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.d=(e,t)=>{for(var o in t)s.o(t,o)&&!s.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};(()=>{"use strict";s.r(o),s.d(o,{AlignmentToolbar:()=>Yh,Autocomplete:()=>Zh,AutosaveMonitor:()=>zc,BlockAlignmentToolbar:()=>Kh,BlockControls:()=>qh,BlockEdit:()=>Qh,BlockEditorKeyboardShortcuts:()=>Xh,BlockFormatControls:()=>Jh,BlockIcon:()=>eg,BlockInspector:()=>tg,BlockList:()=>sg,BlockMover:()=>og,BlockNavigationDropdown:()=>ng,BlockSelectionClearer:()=>ig,BlockSettingsMenu:()=>rg,BlockTitle:()=>ag,BlockToolbar:()=>lg,CharacterCount:()=>Oh,ColorPalette:()=>cg,ContrastChecker:()=>dg,CopyHandler:()=>ug,DefaultBlockAppender:()=>pg,DocumentBar:()=>Zc,DocumentOutline:()=>od,DocumentOutlineCheck:()=>nd,EditorHistoryRedo:()=>ld,EditorHistoryUndo:()=>cd,EditorKeyboardShortcuts:()=>Ml,EditorKeyboardShortcutsRegister:()=>id,EditorNotices:()=>ud,EditorProvider:()=>Yl,EditorSnackbars:()=>md,EntitiesSavedStates:()=>wd,ErrorBoundary:()=>jd,FontSizePicker:()=>mg,InnerBlocks:()=>gg,Inserter:()=>hg,InspectorAdvancedControls:()=>_g,InspectorControls:()=>fg,LocalAutosaveMonitor:()=>Id,MediaPlaceholder:()=>Sg,MediaUpload:()=>kg,MediaUploadCheck:()=>Cg,MultiSelectScrollIntoView:()=>Pg,NavigableToolbar:()=>jg,ObserveTyping:()=>Eg,PageAttributesCheck:()=>Nd,PageAttributesOrder:()=>Rd,PageAttributesPanel:()=>Kd,PageAttributesParent:()=>Wd,PageTemplate:()=>au,PanelColorSettings:()=>bg,PlainText:()=>yg,PluginBlockSettingsMenuItem:()=>bu,PluginDocumentSettingPanel:()=>fu,PluginMoreMenuItem:()=>yu,PluginPostPublishPanel:()=>Su,PluginPostStatusInfo:()=>ju,PluginPrePublishPanel:()=>Iu,PluginPreviewMenuItem:()=>Nu,PluginSidebar:()=>Au,PluginSidebarMoreMenuItem:()=>Du,PostAuthor:()=>Zu,PostAuthorCheck:()=>Yu,PostAuthorPanel:()=>qu,PostComments:()=>Xu,PostDiscussionPanel:()=>op,PostExcerpt:()=>np,PostExcerptCheck:()=>ip,PostExcerptPanel:()=>pp,PostFeaturedImage:()=>Sp,PostFeaturedImageCheck:()=>_p,PostFeaturedImagePanel:()=>Cp,PostFormat:()=>Ep,PostFormatCheck:()=>Pp,PostLastRevision:()=>Np,PostLastRevisionCheck:()=>Tp,PostLastRevisionPanel:()=>Ap,PostLockedModal:()=>Dp,PostPendingStatus:()=>Mp,PostPendingStatusCheck:()=>Rp,PostPingbacks:()=>Ju,PostPreviewButton:()=>Lp,PostPublishButton:()=>zp,PostPublishButtonLabel:()=>Op,PostPublishPanel:()=>Ym,PostSavedState:()=>oh,PostSchedule:()=>cm,PostScheduleCheck:()=>nh,PostScheduleLabel:()=>um,PostSchedulePanel:()=>rh,PostSticky:()=>Xm,PostStickyCheck:()=>Qm,PostSwitchToDraftButton:()=>ah,PostSyncStatus:()=>lh,PostTaxonomies:()=>dh,PostTaxonomiesCheck:()=>uh,PostTaxonomiesFlatTermSelector:()=>km,PostTaxonomiesHierarchicalTermSelector:()=>Dm,PostTaxonomiesPanel:()=>mh,PostTemplatePanel:()=>zu,PostTextEditor:()=>gh,PostTitle:()=>vh,PostTitleRaw:()=>wh,PostTrash:()=>kh,PostTrashCheck:()=>Sh,PostTypeSupportCheck:()=>Ad,PostURL:()=>Ch,PostURLCheck:()=>Ph,PostURLLabel:()=>jh,PostURLPanel:()=>Th,PostVisibility:()=>Gp,PostVisibilityCheck:()=>Nh,PostVisibilityLabel:()=>Wp,RichText:()=>Wh,RichTextShortcut:()=>xg,RichTextToolbarButton:()=>vg,ServerSideRender:()=>Hh(),SkipToSelectedBlock:()=>Tg,TableOfContents:()=>Vh,TextEditorGlobalKeyboardShortcuts:()=>$g,ThemeSupportCheck:()=>gp,TimeToRead:()=>Lh,URLInput:()=>Bg,URLInputButton:()=>Ig,URLPopover:()=>Ng,UnsavedChangesWarning:()=>zh,VisualEditorGlobalKeyboardShortcuts:()=>Gg,Warning:()=>Ag,WordCount:()=>Rh,WritingFlow:()=>Dg,__unstableRichTextInputEvent:()=>wg,cleanForSlug:()=>Wg,createCustomColorsHOC:()=>Rg,getColorClassName:()=>Mg,getColorObjectByAttributeValues:()=>Lg,getColorObjectByColorValue:()=>Og,getFontSize:()=>Fg,getFontSizeClass:()=>Vg,getTemplatePartIcon:()=>U,mediaUpload:()=>Rr,privateApis:()=>Eb,registerEntityAction:()=>Tb,registerEntityField:()=>Ib,store:()=>Tc,storeConfig:()=>Ec,transformStyles:()=>h.transformStyles,unregisterEntityAction:()=>Bb,unregisterEntityField:()=>Nb,useEntitiesSavedStatesIsDirty:()=>xd,usePostScheduleLabel:()=>pm,usePostURLLabel:()=>Eh,usePostVisibilityLabel:()=>Zp,userAutocompleter:()=>Ic,withColorContext:()=>zg,withColors:()=>Ug,withFontSizes:()=>Hg});var e={};s.r(e),s.d(e,{__experimentalGetDefaultTemplatePartAreas:()=>ls,__experimentalGetDefaultTemplateType:()=>cs,__experimentalGetDefaultTemplateTypes:()=>as,__experimentalGetTemplateInfo:()=>ds,__unstableIsEditorReady:()=>et,canInsertBlockType:()=>os,canUserUseUnfilteredHTML:()=>$e,didPostSaveRequestFail:()=>Ee,didPostSaveRequestSucceed:()=>je,getActivePostLock:()=>Ge,getAdjacentBlockClientId:()=>Et,getAutosaveAttribute:()=>me,getBlock:()=>mt,getBlockAttributes:()=>pt,getBlockCount:()=>yt,getBlockHierarchyRootClientId:()=>jt,getBlockIndex:()=>Ut,getBlockInsertionPoint:()=>Xt,getBlockListSettings:()=>rs,getBlockMode:()=>Kt,getBlockName:()=>dt,getBlockOrder:()=>zt,getBlockRootClientId:()=>Pt,getBlockSelectionEnd:()=>vt,getBlockSelectionStart:()=>xt,getBlocks:()=>ht,getBlocksByClientId:()=>bt,getClientIdsOfDescendants:()=>gt,getClientIdsWithDescendants:()=>_t,getCurrentPost:()=>oe,getCurrentPostAttribute:()=>de,getCurrentPostId:()=>ie,getCurrentPostLastRevisionId:()=>le,getCurrentPostRevisionsCount:()=>ae,getCurrentPostType:()=>ne,getCurrentTemplateId:()=>re,getDeviceType:()=>ot,getEditedPostAttribute:()=>pe,getEditedPostContent:()=>Ae,getEditedPostPreviewLink:()=>Ie,getEditedPostSlug:()=>Le,getEditedPostVisibility:()=>he,getEditorBlocks:()=>Ze,getEditorMode:()=>rt,getEditorSelection:()=>Je,getEditorSelectionEnd:()=>Xe,getEditorSelectionStart:()=>Qe,getEditorSettings:()=>tt,getFirstMultiSelectedBlockClientId:()=>Dt,getGlobalBlockCount:()=>ft,getInserterItems:()=>ns,getLastMultiSelectedBlockClientId:()=>Rt,getMultiSelectedBlockClientIds:()=>Nt,getMultiSelectedBlocks:()=>At,getMultiSelectedBlocksEndClientId:()=>Vt,getMultiSelectedBlocksStartClientId:()=>Ft,getNextBlockClientId:()=>Bt,getPermalink:()=>Me,getPermalinkParts:()=>Oe,getPostEdits:()=>ce,getPostLockUser:()=>He,getPostTypeLabel:()=>us,getPreviousBlockClientId:()=>Tt,getRenderingMode:()=>st,getSelectedBlock:()=>Ct,getSelectedBlockClientId:()=>kt,getSelectedBlockCount:()=>wt,getSelectedBlocksInitialCaretPosition:()=>It,getStateBeforeOptimisticTransaction:()=>at,getSuggestedPostFormat:()=>Ne,getTemplate:()=>ts,getTemplateLock:()=>ss,hasChangedContent:()=>J,hasEditorRedo:()=>Q,hasEditorUndo:()=>q,hasInserterItems:()=>is,hasMultiSelection:()=>Wt,hasNonPostEntityChanges:()=>te,hasSelectedBlock:()=>St,hasSelectedInnerBlock:()=>Gt,inSomeHistory:()=>lt,isAncestorMultiSelected:()=>Ot,isAutosavingPost:()=>Te,isBlockInsertionPointVisible:()=>Jt,isBlockMultiSelected:()=>Lt,isBlockSelected:()=>Ht,isBlockValid:()=>ut,isBlockWithinSelection:()=>$t,isCaretWithinFormattedText:()=>Qt,isCleanNewPost:()=>se,isCurrentPostPending:()=>ge,isCurrentPostPublished:()=>_e,isCurrentPostScheduled:()=>fe,isDeletingPost:()=>ke,isEditedPostAutosaveable:()=>ve,isEditedPostBeingScheduled:()=>we,isEditedPostDateFloating:()=>Se,isEditedPostDirty:()=>ee,isEditedPostEmpty:()=>xe,isEditedPostNew:()=>X,isEditedPostPublishable:()=>be,isEditedPostSaveable:()=>ye,isEditorPanelEnabled:()=>Ke,isEditorPanelOpened:()=>qe,isEditorPanelRemoved:()=>Ye,isFirstMultiSelectedBlock:()=>Mt,isInserterOpened:()=>it,isListViewOpened:()=>nt,isMultiSelecting:()=>Zt,isPermalinkEditable:()=>Re,isPostAutosavingLocked:()=>ze,isPostLockTakeover:()=>Ue,isPostLocked:()=>Fe,isPostSavingLocked:()=>Ve,isPreviewingPost:()=>Be,isPublishSidebarEnabled:()=>We,isPublishSidebarOpened:()=>ps,isPublishingPost:()=>De,isSavingNonPostEntityChanges:()=>Pe,isSavingPost:()=>Ce,isSelectionEnabled:()=>Yt,isTyping:()=>qt,isValidTemplate:()=>es});var t={};s.r(t),s.d(t,{__experimentalTearDownEditor:()=>vs,__unstableSaveForPreview:()=>Is,autosave:()=>Bs,clearSelectedBlock:()=>ho,closePublishSidebar:()=>so,createUndoLevel:()=>Ds,disablePublishSidebar:()=>Ls,editPost:()=>Ps,enablePublishSidebar:()=>Ms,enterFormattedText:()=>Ao,exitFormattedText:()=>Do,hideInsertionPoint:()=>ko,insertBlock:()=>vo,insertBlocks:()=>wo,insertDefaultBlock:()=>Ro,lockPostAutosaving:()=>Vs,lockPostSaving:()=>Os,mergeBlocks:()=>jo,moveBlockToPosition:()=>xo,moveBlocksDown:()=>bo,moveBlocksUp:()=>yo,multiSelect:()=>mo,openPublishSidebar:()=>to,receiveBlocks:()=>ro,redo:()=>Ns,refreshPost:()=>Es,removeBlock:()=>To,removeBlocks:()=>Eo,removeEditorPanel:()=>Ys,replaceBlock:()=>fo,replaceBlocks:()=>_o,resetBlocks:()=>io,resetEditorBlocks:()=>Us,resetPost:()=>ws,savePost:()=>js,selectBlock:()=>co,setDeviceType:()=>$s,setEditedPost:()=>Cs,setIsInserterOpened:()=>Ks,setIsListViewOpened:()=>qs,setRenderingMode:()=>Gs,setTemplateValidity:()=>Co,setupEditor:()=>xs,setupEditorState:()=>ks,showInsertionPoint:()=>So,startMultiSelect:()=>uo,startTyping:()=>Io,stopMultiSelect:()=>po,stopTyping:()=>No,switchEditorMode:()=>eo,synchronizeTemplate:()=>Po,toggleBlockMode:()=>Bo,toggleDistractionFree:()=>Qs,toggleEditorPanelEnabled:()=>Ws,toggleEditorPanelOpened:()=>Zs,togglePublishSidebar:()=>oo,toggleSelection:()=>go,toggleSpotlightMode:()=>Xs,toggleTopToolbar:()=>Js,trashPost:()=>Ts,undo:()=>As,unlockPostAutosaving:()=>zs,unlockPostSaving:()=>Fs,updateBlock:()=>ao,updateBlockAttributes:()=>lo,updateBlockListSettings:()=>Mo,updateEditorSettings:()=>Hs,updatePost:()=>Ss,updatePostLock:()=>Rs});var n={};s.r(n),s.d(n,{closeModal:()=>Da,disableComplementaryArea:()=>ja,enableComplementaryArea:()=>Pa,openModal:()=>Aa,pinItem:()=>Ea,setDefaultComplementaryArea:()=>Ca,setFeatureDefaults:()=>Na,setFeatureValue:()=>Ia,toggleFeature:()=>Ba,unpinItem:()=>Ta});var i={};s.r(i),s.d(i,{getActiveComplementaryArea:()=>Ra,isComplementaryAreaLoading:()=>Ma,isFeatureActive:()=>Oa,isItemPinned:()=>La,isModalActive:()=>Fa});var r={};s.r(r),s.d(r,{ActionItem:()=>Wa,ComplementaryArea:()=>el,ComplementaryAreaMoreMenuItem:()=>Ya,FullscreenMode:()=>tl,InterfaceSkeleton:()=>rl,NavigableRegion:()=>ol,PinnedItems:()=>qa,store:()=>za});var a={};s.r(a),s.d(a,{createTemplate:()=>rc,hideBlockTypes:()=>lc,registerEntityAction:()=>Jl,registerEntityField:()=>tc,registerPostTypeSchema:()=>nc,removeTemplates:()=>uc,revertTemplate:()=>dc,saveDirtyEntities:()=>cc,setCurrentTemplateId:()=>ic,setIsReady:()=>oc,showBlockTypes:()=>ac,unregisterEntityAction:()=>ec,unregisterEntityField:()=>sc});var l={};s.r(l),s.d(l,{getEntityActions:()=>kc,getEntityFields:()=>Pc,getInserter:()=>bc,getInserterSidebarToggleRef:()=>xc,getListViewToggleRef:()=>yc,getPostBlocksByName:()=>jc,getPostIcon:()=>wc,hasPostMetaChanges:()=>Sc,isEntityReady:()=>Cc});const c=window.wp.data,d=window.wp.coreData,u=window.wp.element,p=window.wp.compose,m=window.wp.hooks,h=window.wp.blockEditor,g={...h.SETTINGS_DEFAULTS,richEditingEnabled:!0,codeEditingEnabled:!0,fontLibraryEnabled:!0,enableCustomFields:void 0,defaultRenderingMode:"post-only"};const _=(0,c.combineReducers)({actions:function(e={},t){var s;switch(t.type){case"REGISTER_ENTITY_ACTION":return{...e,[t.kind]:{...e[t.kind],[t.name]:[...(null!==(s=e[t.kind]?.[t.name])&&void 0!==s?s:[]).filter((e=>e.id!==t.config.id)),t.config]}};case"UNREGISTER_ENTITY_ACTION":var o;return{...e,[t.kind]:{...e[t.kind],[t.name]:(null!==(o=e[t.kind]?.[t.name])&&void 0!==o?o:[]).filter((e=>e.id!==t.actionId))}}}return e},fields:function(e={},t){var s,o;switch(t.type){case"REGISTER_ENTITY_FIELD":return{...e,[t.kind]:{...e[t.kind],[t.name]:[...(null!==(s=e[t.kind]?.[t.name])&&void 0!==s?s:[]).filter((e=>e.id!==t.config.id)),t.config]}};case"UNREGISTER_ENTITY_FIELD":return{...e,[t.kind]:{...e[t.kind],[t.name]:(null!==(o=e[t.kind]?.[t.name])&&void 0!==o?o:[]).filter((e=>e.id!==t.fieldId))}}}return e},isReady:function(e={},t){return"SET_IS_READY"===t.type?{...e,[t.kind]:{...e[t.kind],[t.name]:!0}}:e}});function f(e){return e&&"object"==typeof e&&"raw"in e?e.raw:e}const b=(0,c.combineReducers)({postId:function(e=null,t){return"SET_EDITED_POST"===t.type?t.postId:e},postType:function(e=null,t){return"SET_EDITED_POST"===t.type?t.postType:e},templateId:function(e=null,t){return"SET_CURRENT_TEMPLATE_ID"===t.type?t.id:e},saving:function(e={},t){switch(t.type){case"REQUEST_POST_UPDATE_START":case"REQUEST_POST_UPDATE_FINISH":return{pending:"REQUEST_POST_UPDATE_START"===t.type,options:t.options||{}}}return e},deleting:function(e={},t){switch(t.type){case"REQUEST_POST_DELETE_START":case"REQUEST_POST_DELETE_FINISH":return{pending:"REQUEST_POST_DELETE_START"===t.type}}return e},postLock:function(e={isLocked:!1},t){return"UPDATE_POST_LOCK"===t.type?t.lock:e},template:function(e={isValid:!0},t){return"SET_TEMPLATE_VALIDITY"===t.type?{...e,isValid:t.isValid}:e},postSavingLock:function(e={},t){switch(t.type){case"LOCK_POST_SAVING":return{...e,[t.lockName]:!0};case"UNLOCK_POST_SAVING":{const{[t.lockName]:s,...o}=e;return o}}return e},editorSettings:function(e=g,t){return"UPDATE_EDITOR_SETTINGS"===t.type?{...e,...t.settings}:e},postAutosavingLock:function(e={},t){switch(t.type){case"LOCK_POST_AUTOSAVING":return{...e,[t.lockName]:!0};case"UNLOCK_POST_AUTOSAVING":{const{[t.lockName]:s,...o}=e;return o}}return e},renderingMode:function(e="post-only",t){return"SET_RENDERING_MODE"===t.type?t.mode:e},deviceType:function(e="Desktop",t){return"SET_DEVICE_TYPE"===t.type?t.deviceType:e},removedPanels:function(e=[],t){if("REMOVE_PANEL"===t.type)if(!e.includes(t.panelName))return[...e,t.panelName];return e},blockInserterPanel:function(e=!1,t){switch(t.type){case"SET_IS_LIST_VIEW_OPENED":return!t.isOpen&&e;case"SET_IS_INSERTER_OPENED":return t.value}return e},inserterSidebarToggleRef:function(e={current:null}){return e},listViewPanel:function(e=!1,t){switch(t.type){case"SET_IS_INSERTER_OPENED":return!t.value&&e;case"SET_IS_LIST_VIEW_OPENED":return t.isOpen}return e},listViewToggleRef:function(e={current:null}){return e},publishSidebarActive:function(e=!1,t){switch(t.type){case"OPEN_PUBLISH_SIDEBAR":return!0;case"CLOSE_PUBLISH_SIDEBAR":return!1;case"TOGGLE_PUBLISH_SIDEBAR":return!e}return e},dataviews:_}),y=window.wp.blocks,x=window.wp.date,v=window.wp.url,w=window.wp.deprecated;var S=s.n(w);const k=window.wp.preferences,C=new Set(["meta"]),P=/%(?:postname|pagename)%/,j=6e4,E=["title","excerpt","content"],T="wp_template",B="wp_template_part",I="wp_block",N="wp_navigation",A="custom",D=["wp_template","wp_template_part"],R=[...D,"wp_block","wp_navigation"],M=window.wp.primitives,L=window.ReactJSXRuntime,O=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.Path,{d:"M18.5 10.5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"})}),F=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.Path,{fillRule:"evenodd",d:"M18 5.5h-8v8h8.5V6a.5.5 0 00-.5-.5zm-9.5 8h-3V6a.5.5 0 01.5-.5h2.5v8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"})}),V=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.Path,{d:"M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"})}),z=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.Path,{d:"M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-17.6 1L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"})});function U(e){return"header"===e?O:"footer"===e?F:"sidebar"===e?V:z}const H=window.wp.privateApis,{lock:G,unlock:$}=(0,H.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/editor"),W=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.Path,{d:"M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"})}),Z={},Y=e=>{var t;if(!e)return Z;const{templateTypes:s,templateAreas:o,template:n}=e,{description:i,slug:r,title:a,area:l}=n,{title:c,description:d}=null!==(t=Object.values(s).find((e=>e.slug===r)))&&void 0!==t?t:Z,u="string"==typeof a?a:a?.rendered,p="string"==typeof i?i:i?.raw,m=o?.map((e=>({...e,icon:U(e.icon)}))),h=m?.find((e=>l===e.area))?.icon||W;return{title:u&&u!==r?u:c||r,description:p||d,icon:h}},K={},q=(0,c.createRegistrySelector)((e=>()=>e(d.store).hasUndo())),Q=(0,c.createRegistrySelector)((e=>()=>e(d.store).hasRedo()));function X(e){return"auto-draft"===oe(e).status}function J(e){return"content"in ce(e)}const ee=(0,c.createRegistrySelector)((e=>t=>{const s=ne(t),o=ie(t);return e(d.store).hasEditsForEntityRecord("postType",s,o)})),te=(0,c.createRegistrySelector)((e=>t=>{const s=e(d.store).__experimentalGetDirtyEntityRecords(),{type:o,id:n}=oe(t);return s.some((e=>"postType"!==e.kind||e.name!==o||e.key!==n))}));function se(e){return!ee(e)&&X(e)}const oe=(0,c.createRegistrySelector)((e=>t=>{const s=ie(t),o=ne(t),n=e(d.store).getRawEntityRecord("postType",o,s);return n||K}));function ne(e){return e.postType}function ie(e){return e.postId}function re(e){return e.templateId}function ae(e){var t;return null!==(t=oe(e)._links?.["version-history"]?.[0]?.count)&&void 0!==t?t:0}function le(e){var t;return null!==(t=oe(e)._links?.["predecessor-version"]?.[0]?.id)&&void 0!==t?t:null}const ce=(0,c.createRegistrySelector)((e=>t=>{const s=ne(t),o=ie(t);return e(d.store).getEntityRecordEdits("postType",s,o)||K}));function de(e,t){switch(t){case"type":return ne(e);case"id":return ie(e);default:const s=oe(e);if(!s.hasOwnProperty(t))break;return f(s[t])}}const ue=(0,c.createSelector)(((e,t)=>{const s=ce(e);return s.hasOwnProperty(t)?{...de(e,t),...s[t]}:de(e,t)}),((e,t)=>[de(e,t),ce(e)[t]]));function pe(e,t){if("content"===t)return Ae(e);const s=ce(e);return s.hasOwnProperty(t)?C.has(t)?ue(e,t):s[t]:de(e,t)}const me=(0,c.createRegistrySelector)((e=>(t,s)=>{if(!E.includes(s)&&"preview_link"!==s)return;const o=ne(t);if("wp_template"===o)return!1;const n=ie(t),i=e(d.store).getCurrentUser()?.id,r=e(d.store).getAutosave(o,n,i);return r?f(r[s]):void 0}));function he(e){if("private"===pe(e,"status"))return"private";return pe(e,"password")?"password":"public"}function ge(e){return"pending"===oe(e).status}function _e(e,t){const s=t||oe(e);return-1!==["publish","private"].indexOf(s.status)||"future"===s.status&&!(0,x.isInTheFuture)(new Date(Number((0,x.getDate)(s.date))-j))}function fe(e){return"future"===oe(e).status&&!_e(e)}function be(e){const t=oe(e);return ee(e)||-1===["publish","private","future"].indexOf(t.status)}function ye(e){return!Ce(e)&&(!!pe(e,"title")||!!pe(e,"excerpt")||!xe(e)||"native"===u.Platform.OS)}const xe=(0,c.createRegistrySelector)((e=>t=>{const s=ie(t),o=ne(t),n=e(d.store).getEditedEntityRecord("postType",o,s);if("function"!=typeof n.content)return!n.content;const i=pe(t,"blocks");if(0===i.length)return!0;if(i.length>1)return!1;const r=i[0].name;return(r===(0,y.getDefaultBlockName)()||r===(0,y.getFreeformContentHandlerName)())&&!Ae(t)})),ve=(0,c.createRegistrySelector)((e=>t=>{if(!ye(t))return!1;if(ze(t))return!1;const s=ne(t);if("wp_template"===s)return!1;const o=ie(t),n=e(d.store).hasFetchedAutosaves(s,o),i=e(d.store).getCurrentUser()?.id,r=e(d.store).getAutosave(s,o,i);return!!n&&(!r||(!!J(t)||["title","excerpt","meta"].some((e=>f(r[e])!==pe(t,e)))))}));function we(e){const t=pe(e,"date"),s=new Date(Number((0,x.getDate)(t))-j);return(0,x.isInTheFuture)(s)}function Se(e){const t=pe(e,"date"),s=pe(e,"modified"),o=oe(e).status;return("draft"===o||"auto-draft"===o||"pending"===o)&&(t===s||null===t)}function ke(e){return!!e.deleting.pending}function Ce(e){return!!e.saving.pending}const Pe=(0,c.createRegistrySelector)((e=>t=>{const s=e(d.store).__experimentalGetEntitiesBeingSaved(),{type:o,id:n}=oe(t);return s.some((e=>"postType"!==e.kind||e.name!==o||e.key!==n))})),je=(0,c.createRegistrySelector)((e=>t=>{const s=ne(t),o=ie(t);return!e(d.store).getLastEntitySaveError("postType",s,o)})),Ee=(0,c.createRegistrySelector)((e=>t=>{const s=ne(t),o=ie(t);return!!e(d.store).getLastEntitySaveError("postType",s,o)}));function Te(e){return Ce(e)&&Boolean(e.saving.options?.isAutosave)}function Be(e){return Ce(e)&&Boolean(e.saving.options?.isPreview)}function Ie(e){if(e.saving.pending||Ce(e))return;let t=me(e,"preview_link");t&&"draft"!==oe(e).status||(t=pe(e,"link"),t&&(t=(0,v.addQueryArgs)(t,{preview:!0})));const s=pe(e,"featured_media");return t&&s?(0,v.addQueryArgs)(t,{_thumbnail_id:s}):t}const Ne=(0,c.createRegistrySelector)((e=>()=>{const t=e(h.store).getBlocks();if(t.length>2)return null;let s;if(1===t.length&&(s=t[0].name,"core/embed"===s)){const e=t[0].attributes?.providerNameSlug;["youtube","vimeo"].includes(e)?s="core/video":["spotify","soundcloud"].includes(e)&&(s="core/audio")}switch(2===t.length&&"core/paragraph"===t[1].name&&(s=t[0].name),s){case"core/image":return"image";case"core/quote":case"core/pullquote":return"quote";case"core/gallery":return"gallery";case"core/video":return"video";case"core/audio":return"audio";default:return null}})),Ae=(0,c.createRegistrySelector)((e=>t=>{const s=ie(t),o=ne(t),n=e(d.store).getEditedEntityRecord("postType",o,s);if(n){if("function"==typeof n.content)return n.content(n);if(n.blocks)return(0,y.__unstableSerializeAndClean)(n.blocks);if(n.content)return n.content}return""}));function De(e){return Ce(e)&&!_e(e)&&"publish"===pe(e,"status")}function Re(e){const t=pe(e,"permalink_template");return P.test(t)}function Me(e){const t=Oe(e);if(!t)return null;const{prefix:s,postName:o,suffix:n}=t;return Re(e)?s+o+n:s}function Le(e){return pe(e,"slug")||(0,v.cleanForSlug)(pe(e,"title"))||ie(e)}function Oe(e){const t=pe(e,"permalink_template");if(!t)return null;const s=pe(e,"slug")||pe(e,"generated_slug"),[o,n]=t.split(P);return{prefix:o,postName:s,suffix:n}}function Fe(e){return e.postLock.isLocked}function Ve(e){return Object.keys(e.postSavingLock).length>0}function ze(e){return Object.keys(e.postAutosavingLock).length>0}function Ue(e){return e.postLock.isTakeover}function He(e){return e.postLock.user}function Ge(e){return e.postLock.activePostLock}function $e(e){return Boolean(oe(e)._links?.hasOwnProperty("wp:action-unfiltered-html"))}const We=(0,c.createRegistrySelector)((e=>()=>!!e(k.store).get("core","isPublishSidebarEnabled"))),Ze=(0,c.createSelector)((e=>pe(e,"blocks")||(0,y.parse)(Ae(e))),(e=>[pe(e,"blocks"),Ae(e)]));function Ye(e,t){return e.removedPanels.includes(t)}const Ke=(0,c.createRegistrySelector)((e=>(t,s)=>{const o=e(k.store).get("core","inactivePanels");return!Ye(t,s)&&!o?.includes(s)})),qe=(0,c.createRegistrySelector)((e=>(t,s)=>{const o=e(k.store).get("core","openPanels");return!!o?.includes(s)}));function Qe(e){return S()("select('core/editor').getEditorSelectionStart",{since:"5.8",alternative:"select('core/editor').getEditorSelection"}),pe(e,"selection")?.selectionStart}function Xe(e){return S()("select('core/editor').getEditorSelectionStart",{since:"5.8",alternative:"select('core/editor').getEditorSelection"}),pe(e,"selection")?.selectionEnd}function Je(e){return pe(e,"selection")}function et(e){return!!e.postId}function tt(e){return e.editorSettings}function st(e){return e.renderingMode}const ot=(0,c.createRegistrySelector)((e=>t=>$(e(h.store)).isZoomOut()?"Desktop":t.deviceType));function nt(e){return e.listViewPanel}function it(e){return!!e.blockInserterPanel}const rt=(0,c.createRegistrySelector)((e=>()=>{var t;return null!==(t=e(k.store).get("core","editorMode"))&&void 0!==t?t:"visual"}));function at(){return S()("select('core/editor').getStateBeforeOptimisticTransaction",{since:"5.7",hint:"No state history is kept on this store anymore"}),null}function lt(){return S()("select('core/editor').inSomeHistory",{since:"5.7",hint:"No state history is kept on this store anymore"}),!1}function ct(e){return(0,c.createRegistrySelector)((t=>(s,...o)=>(S()("`wp.data.select( 'core/editor' )."+e+"`",{since:"5.3",alternative:"`wp.data.select( 'core/block-editor' )."+e+"`",version:"6.2"}),t(h.store)[e](...o))))}const dt=ct("getBlockName"),ut=ct("isBlockValid"),pt=ct("getBlockAttributes"),mt=ct("getBlock"),ht=ct("getBlocks"),gt=ct("getClientIdsOfDescendants"),_t=ct("getClientIdsWithDescendants"),ft=ct("getGlobalBlockCount"),bt=ct("getBlocksByClientId"),yt=ct("getBlockCount"),xt=ct("getBlockSelectionStart"),vt=ct("getBlockSelectionEnd"),wt=ct("getSelectedBlockCount"),St=ct("hasSelectedBlock"),kt=ct("getSelectedBlockClientId"),Ct=ct("getSelectedBlock"),Pt=ct("getBlockRootClientId"),jt=ct("getBlockHierarchyRootClientId"),Et=ct("getAdjacentBlockClientId"),Tt=ct("getPreviousBlockClientId"),Bt=ct("getNextBlockClientId"),It=ct("getSelectedBlocksInitialCaretPosition"),Nt=ct("getMultiSelectedBlockClientIds"),At=ct("getMultiSelectedBlocks"),Dt=ct("getFirstMultiSelectedBlockClientId"),Rt=ct("getLastMultiSelectedBlockClientId"),Mt=ct("isFirstMultiSelectedBlock"),Lt=ct("isBlockMultiSelected"),Ot=ct("isAncestorMultiSelected"),Ft=ct("getMultiSelectedBlocksStartClientId"),Vt=ct("getMultiSelectedBlocksEndClientId"),zt=ct("getBlockOrder"),Ut=ct("getBlockIndex"),Ht=ct("isBlockSelected"),Gt=ct("hasSelectedInnerBlock"),$t=ct("isBlockWithinSelection"),Wt=ct("hasMultiSelection"),Zt=ct("isMultiSelecting"),Yt=ct("isSelectionEnabled"),Kt=ct("getBlockMode"),qt=ct("isTyping"),Qt=ct("isCaretWithinFormattedText"),Xt=ct("getBlockInsertionPoint"),Jt=ct("isBlockInsertionPointVisible"),es=ct("isValidTemplate"),ts=ct("getTemplate"),ss=ct("getTemplateLock"),os=ct("canInsertBlockType"),ns=ct("getInserterItems"),is=ct("hasInserterItems"),rs=ct("getBlockListSettings"),as=(0,c.createRegistrySelector)((e=>()=>(S()("select('core/editor').__experimentalGetDefaultTemplateTypes",{since:"6.8",alternative:"select('core/core-data').getEntityRecord( 'root', '__unstableBase' )?.default_template_types"}),e(d.store).getEntityRecord("root","__unstableBase")?.default_template_types))),ls=(0,c.createRegistrySelector)((e=>(0,c.createSelector)((()=>{S()("select('core/editor').__experimentalGetDefaultTemplatePartAreas",{since:"6.8",alternative:"select('core/core-data').getEntityRecord( 'root', '__unstableBase' )?.default_template_part_areas"});return(e(d.store).getEntityRecord("root","__unstableBase")?.default_template_part_areas||[]).map((e=>({...e,icon:U(e.icon)})))})))),cs=(0,c.createRegistrySelector)((e=>(0,c.createSelector)(((t,s)=>{var o;S()("select('core/editor').__experimentalGetDefaultTemplateType",{since:"6.8"});const n=e(d.store).getEntityRecord("root","__unstableBase")?.default_template_types;return n&&null!==(o=Object.values(n).find((e=>e.slug===s)))&&void 0!==o?o:K})))),ds=(0,c.createRegistrySelector)((e=>(0,c.createSelector)(((t,s)=>{if(S()("select('core/editor').__experimentalGetTemplateInfo",{since:"6.8"}),!s)return K;const o=e(d.store).getEntityRecord("root","__unstableBase")?.default_template_types||[],n=e(d.store).getEntityRecord("root","__unstableBase")?.default_template_part_areas||[];return Y({template:s,templateAreas:n,templateTypes:o})})))),us=(0,c.createRegistrySelector)((e=>t=>{const s=ne(t),o=e(d.store).getPostType(s);return o?.labels?.singular_name}));function ps(e){return e.publishSidebarActive}const ms=window.wp.a11y,hs=window.wp.apiFetch;var gs=s.n(hs);const _s=window.wp.notices,fs=window.wp.i18n;function bs(e,t){return`wp-autosave-block-editor-post-${t?"auto-draft":e}`}function ys(e,t){window.sessionStorage.removeItem(bs(e,t))}const xs=(e,t,s)=>({dispatch:o})=>{o.setEditedPost(e.type,e.id);if("auto-draft"===e.status&&s){let n;n="content"in t?t.content:e.content.raw;let i=(0,y.parse)(n);i=(0,y.synchronizeBlocksWithTemplate)(i,s),o.resetEditorBlocks(i,{__unstableShouldCreateUndoLevel:!1})}t&&Object.values(t).some((([t,s])=>{var o;return s!==(null!==(o=e[t]?.raw)&&void 0!==o?o:e[t])}))&&o.editPost(t)};function vs(){return S()("wp.data.dispatch( 'core/editor' ).__experimentalTearDownEditor",{since:"6.5"}),{type:"DO_NOTHING"}}function ws(){return S()("wp.data.dispatch( 'core/editor' ).resetPost",{since:"6.0",version:"6.3",alternative:"Initialize the editor with the setupEditorState action"}),{type:"DO_NOTHING"}}function Ss(){return S()("wp.data.dispatch( 'core/editor' ).updatePost",{since:"5.7",alternative:"Use the core entities store instead"}),{type:"DO_NOTHING"}}function ks(e){return S()("wp.data.dispatch( 'core/editor' ).setupEditorState",{since:"6.5",alternative:"wp.data.dispatch( 'core/editor' ).setEditedPost"}),Cs(e.type,e.id)}function Cs(e,t){return{type:"SET_EDITED_POST",postType:e,postId:t}}const Ps=(e,t)=>({select:s,registry:o})=>{const{id:n,type:i}=s.getCurrentPost();o.dispatch(d.store).editEntityRecord("postType",i,n,e,t)},js=(e={})=>async({select:t,dispatch:s,registry:o})=>{if(!t.isEditedPostSaveable())return;const n=t.getEditedPostContent();e.isAutosave||s.editPost({content:n},{undoIgnore:!0});const i=t.getCurrentPost();let r={id:i.id,...o.select(d.store).getEntityRecordNonTransientEdits("postType",i.type,i.id),content:n};s({type:"REQUEST_POST_UPDATE_START",options:e});let a=!1;try{r=await(0,m.applyFiltersAsync)("editor.preSavePost",r,e)}catch(e){a=e}if(!a)try{await o.dispatch(d.store).saveEntityRecord("postType",i.type,r,e)}catch(e){a=e.message&&"unknown_error"!==e.code?e.message:(0,fs.__)("An error occurred while updating.")}if(a||(a=o.select(d.store).getLastEntitySaveError("postType",i.type,i.id)),!a)try{await(0,m.applyFilters)("editor.__unstableSavePost",Promise.resolve(),e)}catch(e){a=e}if(!a)try{await(0,m.doActionAsync)("editor.savePost",{id:i.id},e)}catch(e){a=e}if(s({type:"REQUEST_POST_UPDATE_FINISH",options:e}),a){const e=function(e){const{post:t,edits:s,error:o}=e;if(o&&"rest_autosave_no_changes"===o.code)return[];const n=["publish","private","future"],i=-1!==n.indexOf(t.status),r={publish:(0,fs.__)("Publishing failed."),private:(0,fs.__)("Publishing failed."),future:(0,fs.__)("Scheduling failed.")};let a=i||-1===n.indexOf(s.status)?(0,fs.__)("Updating failed."):r[s.status];return o.message&&!/<\/?[^>]*>/.test(o.message)&&(a=[a,o.message].join(" ")),[a,{id:"editor-save"}]}({post:i,edits:r,error:a});e.length&&o.dispatch(_s.store).createErrorNotice(...e)}else{const s=t.getCurrentPost(),n=function(e){var t;const{previousPost:s,post:o,postType:n}=e;if(e.options?.isAutosave)return[];const i=["publish","private","future"],r=i.includes(s.status),a=i.includes(o.status),l="trash"===o.status&&"trash"!==s.status;let c,d,u=null!==(t=n?.viewable)&&void 0!==t&&t;l?(c=n.labels.item_trashed,u=!1):r||a?r&&!a?(c=n.labels.item_reverted_to_draft,u=!1):c=!r&&a?{publish:n.labels.item_published,private:n.labels.item_published_privately,future:n.labels.item_scheduled}[o.status]:n.labels.item_updated:(c=(0,fs.__)("Draft saved."),d=!0);const p=[];return u&&p.push({label:d?(0,fs.__)("View Preview"):n.labels.view_item,url:o.link}),[c,{id:"editor-save",type:"snackbar",actions:p}]}({previousPost:i,post:s,postType:await o.resolveSelect(d.store).getPostType(s.type),options:e});n.length&&o.dispatch(_s.store).createSuccessNotice(...n),e.isAutosave||o.dispatch(h.store).__unstableMarkLastChangeAsPersistent()}};function Es(){return S()("wp.data.dispatch( 'core/editor' ).refreshPost",{since:"6.0",version:"6.3",alternative:"Use the core entities store instead"}),{type:"DO_NOTHING"}}const Ts=()=>async({select:e,dispatch:t,registry:s})=>{const o=e.getCurrentPostType(),n=await s.resolveSelect(d.store).getPostType(o),{rest_base:i,rest_namespace:r="wp/v2"}=n;t({type:"REQUEST_POST_DELETE_START"});try{const s=e.getCurrentPost();await gs()({path:`/${r}/${i}/${s.id}`,method:"DELETE"}),await t.savePost()}catch(e){s.dispatch(_s.store).createErrorNotice(...(a={error:e},[a.error.message&&"unknown_error"!==a.error.code?a.error.message:(0,fs.__)("Trashing failed"),{id:"editor-trash-fail"}]))}var a;t({type:"REQUEST_POST_DELETE_FINISH"})},Bs=({local:e=!1,...t}={})=>async({select:s,dispatch:o})=>{const n=s.getCurrentPost();if("wp_template"!==n.type)if(e){const e=s.isEditedPostNew(),t=s.getEditedPostAttribute("title"),o=s.getEditedPostAttribute("content"),i=s.getEditedPostAttribute("excerpt");!function(e,t,s,o,n){window.sessionStorage.setItem(bs(e,t),JSON.stringify({post_title:s,content:o,excerpt:n}))}(n.id,e,t,o,i)}else await o.savePost({isAutosave:!0,...t})},Is=({forceIsAutosaveable:e}={})=>async({select:t,dispatch:s})=>{if((e||t.isEditedPostAutosaveable())&&!t.isPostLocked()){["draft","auto-draft"].includes(t.getEditedPostAttribute("status"))?await s.savePost({isPreview:!0}):await s.autosave({isPreview:!0})}return t.getEditedPostPreviewLink()},Ns=()=>({registry:e})=>{e.dispatch(d.store).redo()},As=()=>({registry:e})=>{e.dispatch(d.store).undo()};function Ds(){return S()("wp.data.dispatch( 'core/editor' ).createUndoLevel",{since:"6.0",version:"6.3",alternative:"Use the core entities store instead"}),{type:"DO_NOTHING"}}function Rs(e){return{type:"UPDATE_POST_LOCK",lock:e}}const Ms=()=>({registry:e})=>{e.dispatch(k.store).set("core","isPublishSidebarEnabled",!0)},Ls=()=>({registry:e})=>{e.dispatch(k.store).set("core","isPublishSidebarEnabled",!1)};function Os(e){return{type:"LOCK_POST_SAVING",lockName:e}}function Fs(e){return{type:"UNLOCK_POST_SAVING",lockName:e}}function Vs(e){return{type:"LOCK_POST_AUTOSAVING",lockName:e}}function zs(e){return{type:"UNLOCK_POST_AUTOSAVING",lockName:e}}const Us=(e,t={})=>({select:s,dispatch:o,registry:n})=>{const{__unstableShouldCreateUndoLevel:i,selection:r}=t,a={blocks:e,selection:r};if(!1!==i){const{id:e,type:t}=s.getCurrentPost();if(n.select(d.store).getEditedEntityRecord("postType",t,e).blocks===a.blocks)return void n.dispatch(d.store).__unstableCreateUndoLevel("postType",t,e);a.content=({blocks:e=[]})=>(0,y.__unstableSerializeAndClean)(e)}o.editPost(a)};function Hs(e){return{type:"UPDATE_EDITOR_SETTINGS",settings:e}}const Gs=e=>({dispatch:t,registry:s,select:o})=>{o.__unstableIsEditorReady()&&(s.dispatch(h.store).clearSelectedBlock(),t.editPost({selection:void 0},{undoIgnore:!0})),t({type:"SET_RENDERING_MODE",mode:e})};function $s(e){return{type:"SET_DEVICE_TYPE",deviceType:e}}const Ws=e=>({registry:t})=>{var s;const o=null!==(s=t.select(k.store).get("core","inactivePanels"))&&void 0!==s?s:[];let n;n=!!o?.includes(e)?o.filter((t=>t!==e)):[...o,e],t.dispatch(k.store).set("core","inactivePanels",n)},Zs=e=>({registry:t})=>{var s;const o=null!==(s=t.select(k.store).get("core","openPanels"))&&void 0!==s?s:[];let n;n=!!o?.includes(e)?o.filter((t=>t!==e)):[...o,e],t.dispatch(k.store).set("core","openPanels",n)};function Ys(e){return{type:"REMOVE_PANEL",panelName:e}}const Ks=e=>({dispatch:t,registry:s})=>{"object"==typeof e&&e.hasOwnProperty("rootClientId")&&e.hasOwnProperty("insertionIndex")&&$(s.dispatch(h.store)).setInsertionPoint({rootClientId:e.rootClientId,index:e.insertionIndex}),t({type:"SET_IS_INSERTER_OPENED",value:e})};function qs(e){return{type:"SET_IS_LIST_VIEW_OPENED",isOpen:e}}const Qs=({createNotice:e=!0}={})=>({dispatch:t,registry:s})=>{const o=s.select(k.store).get("core","distractionFree");o&&s.dispatch(k.store).set("core","fixedToolbar",!1),o||s.batch((()=>{s.dispatch(k.store).set("core","fixedToolbar",!0),t.setIsInserterOpened(!1),t.setIsListViewOpened(!1),$(s.dispatch(h.store)).resetZoomLevel()})),s.batch((()=>{s.dispatch(k.store).set("core","distractionFree",!o),e&&s.dispatch(_s.store).createInfoNotice(o?(0,fs.__)("Distraction free mode deactivated."):(0,fs.__)("Distraction free mode activated."),{id:"core/editor/distraction-free-mode/notice",type:"snackbar",actions:[{label:(0,fs.__)("Undo"),onClick:()=>{s.batch((()=>{s.dispatch(k.store).set("core","fixedToolbar",o),s.dispatch(k.store).toggle("core","distractionFree")}))}}]})}))},Xs=()=>({registry:e})=>{e.dispatch(k.store).toggle("core","focusMode");const t=e.select(k.store).get("core","focusMode");e.dispatch(_s.store).createInfoNotice(t?(0,fs.__)("Spotlight mode activated."):(0,fs.__)("Spotlight mode deactivated."),{id:"core/editor/toggle-spotlight-mode/notice",type:"snackbar",actions:[{label:(0,fs.__)("Undo"),onClick:()=>{e.dispatch(k.store).toggle("core","focusMode")}}]})},Js=()=>({registry:e})=>{e.dispatch(k.store).toggle("core","fixedToolbar");const t=e.select(k.store).get("core","fixedToolbar");e.dispatch(_s.store).createInfoNotice(t?(0,fs.__)("Top toolbar activated."):(0,fs.__)("Top toolbar deactivated."),{id:"core/editor/toggle-top-toolbar/notice",type:"snackbar",actions:[{label:(0,fs.__)("Undo"),onClick:()=>{e.dispatch(k.store).toggle("core","fixedToolbar")}}]})},eo=e=>({dispatch:t,registry:s})=>{if(s.dispatch(k.store).set("core","editorMode",e),"visual"!==e&&(s.dispatch(h.store).clearSelectedBlock(),$(s.dispatch(h.store)).resetZoomLevel()),"visual"===e)(0,ms.speak)((0,fs.__)("Visual editor selected"),"assertive");else if("text"===e){s.select(k.store).get("core","distractionFree")&&t.toggleDistractionFree(),(0,ms.speak)((0,fs.__)("Code editor selected"),"assertive")}};function to(){return{type:"OPEN_PUBLISH_SIDEBAR"}}function so(){return{type:"CLOSE_PUBLISH_SIDEBAR"}}function oo(){return{type:"TOGGLE_PUBLISH_SIDEBAR"}}const no=e=>(...t)=>({registry:s})=>{S()("`wp.data.dispatch( 'core/editor' )."+e+"`",{since:"5.3",alternative:"`wp.data.dispatch( 'core/block-editor' )."+e+"`",version:"6.2"}),s.dispatch(h.store)[e](...t)},io=no("resetBlocks"),ro=no("receiveBlocks"),ao=no("updateBlock"),lo=no("updateBlockAttributes"),co=no("selectBlock"),uo=no("startMultiSelect"),po=no("stopMultiSelect"),mo=no("multiSelect"),ho=no("clearSelectedBlock"),go=no("toggleSelection"),_o=no("replaceBlocks"),fo=no("replaceBlock"),bo=no("moveBlocksDown"),yo=no("moveBlocksUp"),xo=no("moveBlockToPosition"),vo=no("insertBlock"),wo=no("insertBlocks"),So=no("showInsertionPoint"),ko=no("hideInsertionPoint"),Co=no("setTemplateValidity"),Po=no("synchronizeTemplate"),jo=no("mergeBlocks"),Eo=no("removeBlocks"),To=no("removeBlock"),Bo=no("toggleBlockMode"),Io=no("startTyping"),No=no("stopTyping"),Ao=no("enterFormattedText"),Do=no("exitFormattedText"),Ro=no("insertDefaultBlock"),Mo=no("updateBlockListSettings"),Lo=window.wp.htmlEntities;function Oo(e){return!!e&&(e.source===A&&(Boolean(e?.plugin)||e?.has_theme_file))}const Fo=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.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"})}),Vo={id:"view-post",label:(0,fs._x)("View","verb"),isPrimary:!0,icon:Fo,isEligible:e=>"trash"!==e.status,callback(e,{onActionPerformed:t}){const s=e[0];window.open(s?.link,"_blank"),t&&t(e)}},zo={id:"view-post-revisions",context:"list",label(e){var t;const s=null!==(t=e[0]._links?.["version-history"]?.[0]?.count)&&void 0!==t?t:0;return(0,fs.sprintf)((0,fs.__)("View revisions (%s)"),s)},isEligible(e){var t,s;if("trash"===e.status)return!1;const o=null!==(t=e?._links?.["predecessor-version"]?.[0]?.id)&&void 0!==t?t:null,n=null!==(s=e?._links?.["version-history"]?.[0]?.count)&&void 0!==s?s:0;return!!o&&n>1},callback(e,{onActionPerformed:t}){const s=e[0],o=(0,v.addQueryArgs)("revision.php",{revision:s?._links?.["predecessor-version"]?.[0]?.id});document.location.href=o,t&&t(e)}},Uo=window.wp.components,Ho=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})});var Go=function(){return Go=Object.assign||function(e){for(var t,s=1,o=arguments.length;se(d.store).getPostType("wp_template_part")?.labels?.add_new_item),[]);return(0,L.jsx)(Uo.Modal,{title:e||s,onRequestClose:t.closeModal,overlayClassName:"fields-create-template-part-modal",focusOnMount:"firstContentElement",size:"medium",children:(0,L.jsx)(tn,{...t})})}const en=e=>"header"===e?O:"footer"===e?F:"sidebar"===e?V:z;function tn({defaultArea:e="uncategorized",blocks:t=[],confirmLabel:s=(0,fs.__)("Add"),closeModal:o,onCreate:n,onError:i,defaultTitle:r=""}){const{createErrorNotice:a}=(0,c.useDispatch)(_s.store),{saveEntityRecord:l}=(0,c.useDispatch)(d.store),m=null!==(h=(0,c.useSelect)((e=>e(d.store).getEntityRecords("postType","wp_template_part",{per_page:-1})),[]))&&void 0!==h?h:[];var h;const[g,_]=(0,u.useState)(r),[f,b]=(0,u.useState)(e),[x,v]=(0,u.useState)(!1),w=(0,p.useInstanceId)(Jo),S=(0,c.useSelect)((e=>e(d.store).getEntityRecord("root","__unstableBase")?.default_template_part_areas),[]);async function k(){if(g&&!x)try{v(!0);const e=((e,t)=>{const s=e.toLowerCase(),o=t.map((e=>e.title.rendered.toLowerCase()));if(!o.includes(s))return e;let n=2;for(;o.includes(`${s} ${n}`);)n++;return`${e} ${n}`})(g,m),s=(e=>qo(e).replace(/[^\w-]+/g,"")||"wp-custom-part")(e),o=await l("postType","wp_template_part",{slug:s,title:e,content:(0,y.serialize)(t),area:f},{throwOnError:!0});await n(o)}catch(e){const t=e instanceof Error&&"code"in e&&e.message&&"unknown_error"!==e.code?e.message:(0,fs.__)("An error occurred while creating the template part.");a(t,{type:"snackbar"}),i?.()}finally{v(!1)}}return(0,L.jsx)("form",{onSubmit:async e=>{e.preventDefault(),await k()},children:(0,L.jsxs)(Uo.__experimentalVStack,{spacing:"4",children:[(0,L.jsx)(Uo.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,fs.__)("Name"),value:g,onChange:_,required:!0}),(0,L.jsxs)("fieldset",{children:[(0,L.jsx)(Uo.BaseControl.VisualLabel,{as:"legend",children:(0,fs.__)("Area")}),(0,L.jsx)("div",{className:"fields-create-template-part-modal__area-radio-group",children:(null!=S?S:[]).map((e=>{const t=en(e.icon);return(0,L.jsxs)("div",{className:"fields-create-template-part-modal__area-radio-wrapper",children:[(0,L.jsx)("input",{type:"radio",id:Qo(e.area,w),name:`fields-create-template-part-modal__area-${w}`,value:e.area,checked:f===e.area,onChange:()=>{b(e.area)},"aria-describedby":Xo(e.area,w)}),(0,L.jsx)(Uo.Icon,{icon:t,className:"fields-create-template-part-modal__area-radio-icon"}),(0,L.jsx)("label",{htmlFor:Qo(e.area,w),className:"fields-create-template-part-modal__area-radio-label",children:e.label}),(0,L.jsx)(Uo.Icon,{icon:Ho,className:"fields-create-template-part-modal__area-radio-checkmark"}),(0,L.jsx)("p",{className:"fields-create-template-part-modal__area-radio-description",id:Xo(e.area,w),children:e.description})]},e.area)}))})]}),(0,L.jsxs)(Uo.__experimentalHStack,{justify:"right",children:[(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>{o()},children:(0,fs.__)("Cancel")}),(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit","aria-disabled":!g||x,isBusy:x,children:s})]})]})})}function sn(e){return"wp_template"===e.type||"wp_template_part"===e.type}function on(e){return"string"==typeof e.title?(0,Lo.decodeEntities)(e.title):e.title&&"rendered"in e.title?(0,Lo.decodeEntities)(e.title.rendered):e.title&&"raw"in e.title?(0,Lo.decodeEntities)(e.title.raw):""}function nn(e){return!!e&&([e.source,e.source].includes("custom")&&!Boolean("wp_template"===e.type&&e?.plugin)&&!e.has_theme_file)}const rn={id:"duplicate-template-part",label:(0,fs._x)("Duplicate","action label"),isEligible:e=>"wp_template_part"===e.type,modalHeader:(0,fs._x)("Duplicate template part","action label"),RenderModal:({items:e,closeModal:t})=>{const[s]=e,o=(0,u.useMemo)((()=>{var e;return null!==(e=s.blocks)&&void 0!==e?e:(0,y.parse)("string"==typeof s.content?s.content:s.content.raw,{__unstableSkipMigrationLogs:!0})}),[s.content,s.blocks]),{createSuccessNotice:n}=(0,c.useDispatch)(_s.store);return(0,L.jsx)(tn,{blocks:o,defaultArea:s.area,defaultTitle:(0,fs.sprintf)((0,fs._x)("%s (Copy)","template part"),on(s)),onCreate:function(e){n((0,fs.sprintf)((0,fs._x)('"%s" duplicated.',"template part"),on(e)),{type:"snackbar",id:"edit-site-patterns-success"}),t?.()},onError:t,confirmLabel:(0,fs._x)("Duplicate","action label"),closeModal:null!=t?t:()=>{}})}},an=rn,ln=window.wp.patterns,{lock:cn,unlock:dn}=(0,H.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/fields"),{CreatePatternModalContents:un,useDuplicatePatternProps:pn}=dn(ln.privateApis),mn={id:"duplicate-pattern",label:(0,fs._x)("Duplicate","action label"),isEligible:e=>"wp_template_part"!==e.type,modalHeader:(0,fs._x)("Duplicate pattern","action label"),RenderModal:({items:e,closeModal:t})=>{const[s]=e,o=pn({pattern:s,onSuccess:()=>t?.()});return(0,L.jsx)(un,{onClose:t,confirmLabel:(0,fs._x)("Duplicate","action label"),...o})}},hn=mn,{PATTERN_TYPES:gn}=dn(ln.privateApis),_n={id:"rename-post",label:(0,fs.__)("Rename"),isEligible:e=>"trash"!==e.status&&(["wp_template","wp_template_part",...Object.values(gn)].includes(e.type)?function(e){return"wp_template"===e.type}(e)?nn(e)&&e.is_custom&&e.permissions?.update:function(e){return"wp_template_part"===e.type}(e)?"custom"===e.source&&!e?.has_theme_file&&e.permissions?.update:e.type===gn.user&&e.permissions?.update:e.permissions?.update),RenderModal:({items:e,closeModal:t,onActionPerformed:s})=>{const[o]=e,[n,i]=(0,u.useState)((()=>on(o))),{editEntityRecord:r,saveEditedEntityRecord:a}=(0,c.useDispatch)(d.store),{createSuccessNotice:l,createErrorNotice:p}=(0,c.useDispatch)(_s.store);return(0,L.jsx)("form",{onSubmit:async function(c){c.preventDefault();try{await r("postType",o.type,o.id,{title:n}),i(""),t?.(),await a("postType",o.type,o.id,{throwOnError:!0}),l((0,fs.__)("Name updated"),{type:"snackbar"}),s?.(e)}catch(e){const t=e,s=t.message&&"unknown_error"!==t.code?t.message:(0,fs.__)("An error occurred while updating the name");p(s,{type:"snackbar"})}},children:(0,L.jsxs)(Uo.__experimentalVStack,{spacing:"5",children:[(0,L.jsx)(Uo.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,fs.__)("Name"),value:n,onChange:i,required:!0}),(0,L.jsxs)(Uo.__experimentalHStack,{justify:"right",children:[(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>{t?.()},children:(0,fs.__)("Cancel")}),(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",children:(0,fs.__)("Save")})]})]})})}},fn=_n;const bn={sort:function(e,t,s){return"asc"===s?e-t:t-e},isValid:function(e,t){if(""===e)return!1;if(!Number.isInteger(Number(e)))return!1;if(t?.elements){const s=t?.elements.map((e=>e.value));if(!s.includes(Number(e)))return!1}return!0},Edit:"integer"};const yn={sort:function(e,t,s){return"asc"===s?e.localeCompare(t):t.localeCompare(e)},isValid:function(e,t){if(t?.elements){const s=t?.elements?.map((e=>e.value));if(!s.includes(e))return!1}return!0},Edit:"text"};const xn={sort:function(e,t,s){const o=new Date(e).getTime(),n=new Date(t).getTime();return"asc"===s?o-n:n-o},isValid:function(e,t){if(t?.elements){const s=t?.elements.map((e=>e.value));if(!s.includes(e))return!1}return!0},Edit:"datetime"};const vn={datetime:function({data:e,field:t,onChange:s,hideLabelFromVision:o}){const{id:n,label:i}=t,r=t.getValue({item:e}),a=(0,u.useCallback)((e=>s({[n]:e})),[n,s]);return(0,L.jsxs)("fieldset",{className:"dataviews-controls__datetime",children:[!o&&(0,L.jsx)(Uo.BaseControl.VisualLabel,{as:"legend",children:i}),o&&(0,L.jsx)(Uo.VisuallyHidden,{as:"legend",children:i}),(0,L.jsx)(Uo.TimePicker,{currentTime:r,onChange:a,hideLabelFromVision:!0})]})},integer:function({data:e,field:t,onChange:s,hideLabelFromVision:o}){var n;const{id:i,label:r,description:a}=t,l=null!==(n=t.getValue({item:e}))&&void 0!==n?n:"",c=(0,u.useCallback)((e=>s({[i]:Number(e)})),[i,s]);return(0,L.jsx)(Uo.__experimentalNumberControl,{label:r,help:a,value:l,onChange:c,__next40pxDefaultSize:!0,hideLabelFromVision:o})},radio:function({data:e,field:t,onChange:s,hideLabelFromVision:o}){const{id:n,label:i}=t,r=t.getValue({item:e}),a=(0,u.useCallback)((e=>s({[n]:e})),[n,s]);return t.elements?(0,L.jsx)(Uo.RadioControl,{label:i,onChange:a,options:t.elements,selected:r,hideLabelFromVision:o}):null},select:function({data:e,field:t,onChange:s,hideLabelFromVision:o}){var n,i;const{id:r,label:a}=t,l=null!==(n=t.getValue({item:e}))&&void 0!==n?n:"",c=(0,u.useCallback)((e=>s({[r]:e})),[r,s]),d=[{label:(0,fs.__)("Select item"),value:""},...null!==(i=t?.elements)&&void 0!==i?i:[]];return(0,L.jsx)(Uo.SelectControl,{label:a,value:l,options:d,onChange:c,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,hideLabelFromVision:o})},text:function({data:e,field:t,onChange:s,hideLabelFromVision:o}){const{id:n,label:i,placeholder:r}=t,a=t.getValue({item:e}),l=(0,u.useCallback)((e=>s({[n]:e})),[n,s]);return(0,L.jsx)(Uo.TextControl,{label:i,placeholder:r,value:null!=a?a:"",onChange:l,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,hideLabelFromVision:o})}};function wn(e){if(Object.keys(vn).includes(e))return vn[e];throw"Control "+e+" not found"}function Sn(e){return e.map((e=>{var t,s,o,n;const i="integer"===(r=e.type)?bn:"text"===r?yn:"datetime"===r?xn:{sort:(e,t,s)=>"number"==typeof e&&"number"==typeof t?"asc"===s?e-t:t-e:"asc"===s?e.localeCompare(t):t.localeCompare(e),isValid:(e,t)=>{if(t?.elements){const s=t?.elements?.map((e=>e.value));if(!s.includes(e))return!1}return!0},Edit:()=>null};var r;const a=e.getValue||(l=e.id,({item:e})=>{const t=l.split(".");let s=e;for(const e of t)s=s.hasOwnProperty(e)?s[e]:void 0;return s});var l;const c=null!==(t=e.sort)&&void 0!==t?t:function(e,t,s){return i.sort(a({item:e}),a({item:t}),s)},d=null!==(s=e.isValid)&&void 0!==s?s:function(e,t){return i.isValid(a({item:e}),t)},u=function(e,t){return"function"==typeof e.Edit?e.Edit:"string"==typeof e.Edit?wn(e.Edit):e.elements?wn("select"):"string"==typeof t.Edit?wn(t.Edit):t.Edit}(e,i),p=e.render||(e.elements?({item:t})=>{const s=a({item:t});return e?.elements?.find((e=>e.value===s))?.label||a({item:t})}:a);return{...e,label:e.label||e.id,header:e.header||e.label||e.id,getValue:a,render:p,sort:c,isValid:d,Edit:u,enableHiding:null===(o=e.enableHiding)||void 0===o||o,enableSorting:null===(n=e.enableSorting)||void 0===n||n}}))}function kn(e,t,s){return Sn(t.filter((({id:e})=>!!s.fields?.includes(e)))).every((t=>t.isValid(e,{elements:t.elements})))}const Cn=(0,u.createContext)({fields:[]});function Pn({fields:e,children:t}){return(0,L.jsx)(Cn.Provider,{value:{fields:e},children:t})}const jn=Cn;function En(e){return void 0!==e.children}function Tn({title:e}){return(0,L.jsx)(Uo.__experimentalVStack,{className:"dataforms-layouts-regular__header",spacing:4,children:(0,L.jsxs)(Uo.__experimentalHStack,{alignment:"center",children:[(0,L.jsx)(Uo.__experimentalHeading,{level:2,size:13,children:e}),(0,L.jsx)(Uo.__experimentalSpacer,{})]})})}const Bn=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.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"})});function In({title:e,onClose:t}){return(0,L.jsx)(Uo.__experimentalVStack,{className:"dataforms-layouts-panel__dropdown-header",spacing:4,children:(0,L.jsxs)(Uo.__experimentalHStack,{alignment:"center",children:[e&&(0,L.jsx)(Uo.__experimentalHeading,{level:2,size:13,children:e}),(0,L.jsx)(Uo.__experimentalSpacer,{}),t&&(0,L.jsx)(Uo.Button,{label:(0,fs.__)("Close"),icon:Bn,onClick:t,size:"small"})]})})}function Nn({fieldDefinition:e,popoverAnchor:t,labelPosition:s="side",data:o,onChange:n,field:i}){const r=En(i)?i.label:e?.label,a=(0,u.useMemo)((()=>En(i)?{type:"regular",fields:i.children.map((e=>"string"==typeof e?{id:e}:e))}:{type:"regular",fields:[{id:i.id}]}),[i]),l=(0,u.useMemo)((()=>({anchor:t,placement:"left-start",offset:36,shift:!0})),[t]);return(0,L.jsx)(Uo.Dropdown,{contentClassName:"dataforms-layouts-panel__field-dropdown",popoverProps:l,focusOnMount:!0,toggleProps:{size:"compact",variant:"tertiary",tooltipPosition:"middle left"},renderToggle:({isOpen:t,onToggle:n})=>(0,L.jsx)(Uo.Button,{className:"dataforms-layouts-panel__field-control",size:"compact",variant:["none","top"].includes(s)?"link":"tertiary","aria-expanded":t,"aria-label":(0,fs.sprintf)((0,fs._x)("Edit %s","field"),r),onClick:n,children:(0,L.jsx)(e.render,{item:o})}),renderContent:({onClose:e})=>(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(In,{title:r,onClose:e}),(0,L.jsx)(Dn,{data:o,form:a,onChange:n,children:(e,t)=>{var s;return(0,L.jsx)(e,{data:o,field:t,onChange:n,hideLabelFromVision:(null!==(s=a?.fields)&&void 0!==s?s:[]).length<2},t.id)}})]})})}const An=[{type:"regular",component:function({data:e,field:t,onChange:s,hideLabelFromVision:o}){var n;const{fields:i}=(0,u.useContext)(jn),r=(0,u.useMemo)((()=>En(t)?{fields:t.children.map((e=>"string"==typeof e?{id:e}:e)),type:"regular"}:{type:"regular",fields:[]}),[t]);if(En(t))return(0,L.jsxs)(L.Fragment,{children:[!o&&t.label&&(0,L.jsx)(Tn,{title:t.label}),(0,L.jsx)(Dn,{data:e,form:r,onChange:s})]});const a=null!==(n=t.labelPosition)&&void 0!==n?n:"top",l=i.find((e=>e.id===t.id));return l?"side"===a?(0,L.jsxs)(Uo.__experimentalHStack,{className:"dataforms-layouts-regular__field",children:[(0,L.jsx)("div",{className:"dataforms-layouts-regular__field-label",children:l.label}),(0,L.jsx)("div",{className:"dataforms-layouts-regular__field-control",children:(0,L.jsx)(l.Edit,{data:e,field:l,onChange:s,hideLabelFromVision:!0},l.id)})]}):(0,L.jsx)("div",{className:"dataforms-layouts-regular__field",children:(0,L.jsx)(l.Edit,{data:e,field:l,onChange:s,hideLabelFromVision:"none"===a||o})}):null}},{type:"panel",component:function({data:e,field:t,onChange:s}){var o;const{fields:n}=(0,u.useContext)(jn),i=n.find((e=>{if(En(t)){const s=t.children.filter((e=>"string"==typeof e||!En(e))),o="string"==typeof s[0]?s[0]:s[0].id;return e.id===o}return e.id===t.id})),r=null!==(o=t.labelPosition)&&void 0!==o?o:"side",[a,l]=(0,u.useState)(null);if(!i)return null;const c=En(t)?t.label:i?.label;return"top"===r?(0,L.jsxs)(Uo.__experimentalVStack,{className:"dataforms-layouts-panel__field",spacing:0,children:[(0,L.jsx)("div",{className:"dataforms-layouts-panel__field-label",style:{paddingBottom:0},children:c}),(0,L.jsx)("div",{className:"dataforms-layouts-panel__field-control",children:(0,L.jsx)(Nn,{field:t,popoverAnchor:a,fieldDefinition:i,data:e,onChange:s,labelPosition:r})})]}):"none"===r?(0,L.jsx)("div",{className:"dataforms-layouts-panel__field",children:(0,L.jsx)(Nn,{field:t,popoverAnchor:a,fieldDefinition:i,data:e,onChange:s,labelPosition:r})}):(0,L.jsxs)(Uo.__experimentalHStack,{ref:l,className:"dataforms-layouts-panel__field",children:[(0,L.jsx)("div",{className:"dataforms-layouts-panel__field-label",children:c}),(0,L.jsx)("div",{className:"dataforms-layouts-panel__field-control",children:(0,L.jsx)(Nn,{field:t,popoverAnchor:a,fieldDefinition:i,data:e,onChange:s,labelPosition:r})})]})}}];function Dn({data:e,form:t,onChange:s,children:o}){const{fields:n}=(0,u.useContext)(jn);const i=(0,u.useMemo)((()=>function(e){var t,s,o;let n="regular";["regular","panel"].includes(null!==(t=e.type)&&void 0!==t?t:"")&&(n=e.type);const i=null!==(s=e.labelPosition)&&void 0!==s?s:"regular"===n?"top":"side";return(null!==(o=e.fields)&&void 0!==o?o:[]).map((e=>{var t,s;if("string"==typeof e)return{id:e,layout:n,labelPosition:i};const o=null!==(t=e.layout)&&void 0!==t?t:n,r=null!==(s=e.labelPosition)&&void 0!==s?s:"regular"===o?"top":"side";return{...e,layout:o,labelPosition:r}}))}(t)),[t]);return(0,L.jsx)(Uo.__experimentalVStack,{spacing:2,children:i.map((t=>{const i=(r=t.layout,An.find((e=>e.type===r)))?.component;var r;if(!i)return null;const a=En(t)?void 0:function(e){const t="string"==typeof e?e:e.id;return n.find((e=>e.id===t))}(t);return a&&a.isVisible&&!a.isVisible(e)?null:o?o(i,t):(0,L.jsx)(i,{data:e,field:t,onChange:s},t.id)}))})}function Rn({data:e,form:t,fields:s,onChange:o}){const n=(0,u.useMemo)((()=>Sn(s)),[s]);return t.fields?(0,L.jsx)(Pn,{fields:n,children:(0,L.jsx)(Dn,{data:e,form:t,onChange:o})}):null}const Mn=[{id:"menu_order",type:"integer",label:(0,fs.__)("Order"),description:(0,fs.__)("Determines the order of pages.")}],Ln={fields:["menu_order"]};const On={id:"order-pages",label:(0,fs.__)("Order"),isEligible:({status:e})=>"trash"!==e,RenderModal:function({items:e,closeModal:t,onActionPerformed:s}){const[o,n]=(0,u.useState)(e[0]),i=o.menu_order,{editEntityRecord:r,saveEditedEntityRecord:a}=(0,c.useDispatch)(d.store),{createSuccessNotice:l,createErrorNotice:p}=(0,c.useDispatch)(_s.store),m=!kn(o,Mn,Ln);return(0,L.jsx)("form",{onSubmit:async function(n){if(n.preventDefault(),kn(o,Mn,Ln))try{await r("postType",o.type,o.id,{menu_order:i}),t?.(),await a("postType",o.type,o.id,{throwOnError:!0}),l((0,fs.__)("Order updated."),{type:"snackbar"}),s?.(e)}catch(e){const t=e,s=t.message&&"unknown_error"!==t.code?t.message:(0,fs.__)("An error occurred while updating the order");p(s,{type:"snackbar"})}},children:(0,L.jsxs)(Uo.__experimentalVStack,{spacing:"5",children:[(0,L.jsx)("div",{children:(0,fs.__)("Determines the order of pages. Pages with the same order value are sorted alphabetically. Negative order values are supported.")}),(0,L.jsx)(Rn,{data:o,fields:Mn,form:Ln,onChange:e=>n({...o,...e})}),(0,L.jsxs)(Uo.__experimentalHStack,{justify:"right",children:[(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>{t?.()},children:(0,fs.__)("Cancel")}),(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",accessibleWhenDisabled:!0,disabled:m,children:(0,fs.__)("Save")})]})]})})}},Fn=On;"stream"in Blob.prototype||Object.defineProperty(Blob.prototype,"stream",{value(){return new Response(this).body}}),"setBigUint64"in DataView.prototype||Object.defineProperty(DataView.prototype,"setBigUint64",{value(e,t,s){const o=Number(0xffffffffn&t),n=Number(t>>32n);this.setUint32(e+(s?0:4),o,s),this.setUint32(e+(s?4:0),n,s)}});var Vn=e=>new DataView(new ArrayBuffer(e)),zn=e=>new Uint8Array(e.buffer||e),Un=e=>(new TextEncoder).encode(String(e)),Hn=e=>Math.min(4294967295,Number(e)),Gn=e=>Math.min(65535,Number(e));function $n(e,t){if(void 0===t||t instanceof Date||(t=new Date(t)),e instanceof File)return{isFile:1,t:t||new Date(e.lastModified),i:e.stream()};if(e instanceof Response)return{isFile:1,t:t||new Date(e.headers.get("Last-Modified")||Date.now()),i:e.body};if(void 0===t)t=new Date;else if(isNaN(t))throw new Error("Invalid modification date.");if(void 0===e)return{isFile:0,t};if("string"==typeof e)return{isFile:1,t,i:Un(e)};if(e instanceof Blob)return{isFile:1,t,i:e.stream()};if(e instanceof Uint8Array||e instanceof ReadableStream)return{isFile:1,t,i:e};if(e instanceof ArrayBuffer||ArrayBuffer.isView(e))return{isFile:1,t,i:zn(e)};if(Symbol.asyncIterator in e)return{isFile:1,t,i:Wn(e[Symbol.asyncIterator]())};throw new TypeError("Unsupported input format.")}function Wn(e,t=e){return new ReadableStream({async pull(t){let s=0;for(;t.desiredSize>s;){const o=await e.next();if(!o.value){t.close();break}{const e=Zn(o.value);t.enqueue(e),s+=e.byteLength}}},cancel(e){t.throw?.(e)}})}function Zn(e){return"string"==typeof e?Un(e):e instanceof Uint8Array?e:zn(e)}function Yn(e,t,s){let[o,n]=function(e){return e?e instanceof Uint8Array?[e,1]:ArrayBuffer.isView(e)||e instanceof ArrayBuffer?[zn(e),1]:[Un(e),0]:[void 0,0]}(t);if(e instanceof File)return{o:qn(o||Un(e.name)),u:BigInt(e.size),l:n};if(e instanceof Response){const t=e.headers.get("content-disposition"),i=t&&t.match(/;\s*filename\*?\s*=\s*(?:UTF-\d+''|)["']?([^;"'\r\n]*)["']?(?:;|$)/i),r=i&&i[1]||e.url&&new URL(e.url).pathname.split("/").findLast(Boolean),a=r&&decodeURIComponent(r),l=s||+e.headers.get("content-length");return{o:qn(o||Un(a)),u:BigInt(l),l:n}}return o=qn(o,void 0!==e||void 0!==s),"string"==typeof e?{o,u:BigInt(Un(e).length),l:n}:e instanceof Blob?{o,u:BigInt(e.size),l:n}:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?{o,u:BigInt(e.byteLength),l:n}:{o,u:Kn(e,s),l:n}}function Kn(e,t){return t>-1?BigInt(t):e?void 0:0n}function qn(e,t=1){if(!e||e.every((e=>47===e)))throw new Error("The file must have a name.");if(t)for(;47===e[e.length-1];)e=e.subarray(0,-1);else 47!==e[e.length-1]&&(e=new Uint8Array([...e,47]));return e}var Qn=new Uint32Array(256);for(let e=0;e<256;++e){let t=e;for(let e=0;e<8;++e)t=t>>>1^(1&t&&3988292384);Qn[e]=t}function Xn(e,t=0){t^=-1;for(var s=0,o=e.length;s>>8^Qn[255&t^e[s]];return~t>>>0}function Jn(e,t,s=0){const o=e.getSeconds()>>1|e.getMinutes()<<5|e.getHours()<<11,n=e.getDate()|e.getMonth()+1<<5|e.getFullYear()-1980<<9;t.setUint16(s,o,1),t.setUint16(s+2,n,1)}function ei({o:e,l:t},s){return 8*(!t||(s??function(e){try{ti.decode(e)}catch{return 0}return 1}(e)))}var ti=new TextDecoder("utf8",{fatal:1});function si(e,t=0){const s=Vn(30);return s.setUint32(0,1347093252),s.setUint32(4,754976768|t),Jn(e.t,s,10),s.setUint16(26,e.o.length,1),zn(s)}async function*oi(e){let{i:t}=e;if("then"in t&&(t=await t),t instanceof Uint8Array)yield t,e.m=Xn(t,0),e.u=BigInt(t.length);else{e.u=0n;const s=t.getReader();for(;;){const{value:t,done:o}=await s.read();if(o)break;e.m=Xn(t,e.m),e.u+=BigInt(t.length),yield t}}}function ni(e,t){const s=Vn(16+(t?8:0));return s.setUint32(0,1347094280),s.setUint32(4,e.isFile?e.m:0,1),t?(s.setBigUint64(8,e.u,1),s.setBigUint64(16,e.u,1)):(s.setUint32(8,Hn(e.u),1),s.setUint32(12,Hn(e.u),1)),zn(s)}function ii(e,t,s=0,o=0){const n=Vn(46);return n.setUint32(0,1347092738),n.setUint32(4,755182848),n.setUint16(8,2048|s),Jn(e.t,n,12),n.setUint32(16,e.isFile?e.m:0,1),n.setUint32(20,Hn(e.u),1),n.setUint32(24,Hn(e.u),1),n.setUint16(28,e.o.length,1),n.setUint16(30,o,1),n.setUint16(40,e.isFile?33204:16893,1),n.setUint32(42,Hn(t),1),zn(n)}function ri(e,t,s){const o=Vn(s);return o.setUint16(0,1,1),o.setUint16(2,s-4,1),16&s&&(o.setBigUint64(4,e.u,1),o.setBigUint64(12,e.u,1)),o.setBigUint64(s-8,t,1),zn(o)}function ai(e){return e instanceof File||e instanceof Response?[[e],[e]]:[[e.input,e.name,e.size],[e.input,e.lastModified]]}function li(e,t={}){const s={"Content-Type":"application/zip","Content-Disposition":"attachment"};return("bigint"==typeof t.length||Number.isInteger(t.length))&&t.length>0&&(s["Content-Length"]=String(t.length)),t.metadata&&(s["Content-Length"]=String((e=>function(e){let t=BigInt(22),s=0n,o=0;for(const n of e){if(!n.o)throw new Error("Every file must have a non-empty name.");if(void 0===n.u)throw new Error(`Missing size for file "${(new TextDecoder).decode(n.o)}".`);const e=n.u>=0xffffffffn,i=s>=0xffffffffn;s+=BigInt(46+n.o.length+(e&&8))+n.u,t+=BigInt(n.o.length+46+(12*i|28*e)),o||(o=e)}return(o||s>=0xffffffffn)&&(t+=BigInt(76)),t+s}(function*(e){for(const t of e)yield Yn(...ai(t)[0])}(e)))(t.metadata))),new Response(ci(e,t),{headers:s})}function ci(e,t={}){const s=function(e){const t=e[Symbol.iterator in e?Symbol.iterator:Symbol.asyncIterator]();return{async next(){const e=await t.next();if(e.done)return e;const[s,o]=ai(e.value);return{done:0,value:Object.assign($n(...o),Yn(...s))}},throw:t.throw?.bind(t),[Symbol.asyncIterator](){return this}}}(e);return Wn(async function*(e,t){const s=[];let o=0n,n=0n,i=0;for await(const r of e){const e=ei(r,t.buffersAreUTF8);yield si(r,e),yield new Uint8Array(r.o),r.isFile&&(yield*oi(r));const a=r.u>=0xffffffffn,l=12*(o>=0xffffffffn)|28*a;yield ni(r,a),s.push(ii(r,o,e,l)),s.push(r.o),l&&s.push(ri(r,o,l)),a&&(o+=8n),n++,o+=BigInt(46+r.o.length)+r.u,i||(i=a)}let r=0n;for(const e of s)yield e,r+=BigInt(e.length);if(i||o>=0xffffffffn){const e=Vn(76);e.setUint32(0,1347094022),e.setBigUint64(4,BigInt(44),1),e.setUint32(12,755182848),e.setBigUint64(24,n,1),e.setBigUint64(32,n,1),e.setBigUint64(40,r,1),e.setBigUint64(48,o,1),e.setUint32(56,1347094023),e.setBigUint64(64,o+r,1),e.setUint32(72,1,1),yield zn(e)}const a=Vn(22);a.setUint32(0,1347093766),a.setUint16(8,Gn(n),1),a.setUint16(10,Gn(n),1),a.setUint32(12,Hn(r),1),a.setUint32(16,Hn(o),1),yield zn(a)}(s,t),s)}const di=window.wp.blob,ui=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.Path,{d:"M18 11.3l-1-1.1-4 4V3h-1.5v11.3L7 10.2l-1 1.1 6.2 5.8 5.8-5.8zm.5 3.7v3.5h-13V15H4v5h16v-5h-1.5z"})});function pi(e){return JSON.stringify({__file:e.type,title:on(e),content:"string"==typeof e.content?e.content:e.content?.raw,syncStatus:e.wp_pattern_sync_status},null,2)}const mi={id:"export-pattern",label:(0,fs.__)("Export as JSON"),icon:ui,supportsBulk:!0,isEligible:e=>"wp_block"===e.type,callback:async e=>{if(1===e.length)return(0,di.downloadBlob)(`${qo(on(e[0])||e[0].slug)}.json`,pi(e[0]),"application/json");const t={},s=e.map((e=>{const s=qo(on(e)||e.slug);return t[s]=(t[s]||0)+1,{name:s+(t[s]>1?"-"+(t[s]-1):"")+".json",lastModified:new Date,input:pi(e)}}));return(0,di.downloadBlob)((0,fs.__)("patterns-export")+".zip",await li(s).blob(),"application/zip")}},hi=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.Path,{d:"M5.5 12h1.75l-2.5 3-2.5-3H4a8 8 0 113.134 6.35l.907-1.194A6.5 6.5 0 105.5 12zm9.53 1.97l-2.28-2.28V8.5a.75.75 0 00-1.5 0V12a.747.747 0 00.218.529l1.282-.84-1.28.842 2.5 2.5a.75.75 0 101.06-1.061z"})}),gi={id:"restore",label:(0,fs.__)("Restore"),isPrimary:!0,icon:hi,supportsBulk:!0,isEligible:e=>!sn(e)&&"wp_block"!==e.type&&"trash"===e.status&&e.permissions?.update,async callback(e,{registry:t,onActionPerformed:s}){const{createSuccessNotice:o,createErrorNotice:n}=t.dispatch(_s.store),{editEntityRecord:i,saveEditedEntityRecord:r}=t.dispatch(d.store);await Promise.allSettled(e.map((e=>i("postType",e.type,e.id,{status:"draft"}))));const a=await Promise.allSettled(e.map((e=>r("postType",e.type,e.id,{throwOnError:!0}))));if(a.every((({status:e})=>"fulfilled"===e))){let t;t=1===e.length?(0,fs.sprintf)((0,fs.__)('"%s" has been restored.'),on(e[0])):"page"===e[0].type?(0,fs.sprintf)((0,fs.__)("%d pages have been restored."),e.length):(0,fs.sprintf)((0,fs.__)("%d posts have been restored."),e.length),o(t,{type:"snackbar",id:"restore-post-action"}),s&&s(e)}else{let e;if(1===a.length){const t=a[0];e=t.reason?.message?t.reason.message:(0,fs.__)("An error occurred while restoring the post.")}else{const t=new Set,s=a.filter((({status:e})=>"rejected"===e));for(const e of s){const s=e;s.reason?.message&&t.add(s.reason.message)}e=0===t.size?(0,fs.__)("An error occurred while restoring the posts."):1===t.size?(0,fs.sprintf)((0,fs.__)("An error occurred while restoring the posts: %s"),[...t][0]):(0,fs.sprintf)((0,fs.__)("Some errors occurred while restoring the posts: %s"),[...t].join(","))}n(e,{type:"snackbar"})}}},_i=async(e,{allowUndo:t=!0}={})=>{const s="edit-site-template-reverted";var o;if((0,c.dispatch)(_s.store).removeNotice(s),(o=e)&&"custom"===o.source&&(Boolean(o?.plugin)||o?.has_theme_file))try{const o=(0,c.select)(d.store).getEntityConfig("postType",e.type);if(!o)return void(0,c.dispatch)(_s.store).createErrorNotice((0,fs.__)("The editor has encountered an unexpected error. Please reload."),{type:"snackbar"});const n=(0,v.addQueryArgs)(`${o.baseURL}/${e.id}`,{context:"edit",source:e.origin}),i=await gs()({path:n});if(!i)return void(0,c.dispatch)(_s.store).createErrorNotice((0,fs.__)("The editor has encountered an unexpected error. Please reload."),{type:"snackbar"});const r=({blocks:e=[]})=>(0,y.__unstableSerializeAndClean)(e),a=(0,c.select)(d.store).getEditedEntityRecord("postType",e.type,e.id);(0,c.dispatch)(d.store).editEntityRecord("postType",e.type,e.id,{content:r,blocks:a.blocks,source:"custom"},{undoIgnore:!0});const l=(0,y.parse)(i?.content?.raw);if((0,c.dispatch)(d.store).editEntityRecord("postType",e.type,i.id,{content:r,blocks:l,source:"theme"}),t){const t=()=>{(0,c.dispatch)(d.store).editEntityRecord("postType",e.type,a.id,{content:r,blocks:a.blocks,source:"custom"})};(0,c.dispatch)(_s.store).createSuccessNotice((0,fs.__)("Template reset."),{type:"snackbar",id:s,actions:[{label:(0,fs.__)("Undo"),onClick:t}]})}}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,fs.__)("Template revert failed. Please reload.");(0,c.dispatch)(_s.store).createErrorNotice(t,{type:"snackbar"})}else(0,c.dispatch)(_s.store).createErrorNotice((0,fs.__)("This template is not revertable."),{type:"snackbar"})},fi={id:"reset-post",label:(0,fs.__)("Reset"),isEligible:e=>sn(e)&&"custom"===e?.source&&(Boolean("wp_template"===e.type&&e?.plugin)||e?.has_theme_file),icon:hi,supportsBulk:!0,hideModalHeader:!0,RenderModal:({items:e,closeModal:t,onActionPerformed:s})=>{const[o,n]=(0,u.useState)(!1),{saveEditedEntityRecord:i}=(0,c.useDispatch)(d.store),{createSuccessNotice:r,createErrorNotice:a}=(0,c.useDispatch)(_s.store);return(0,L.jsxs)(Uo.__experimentalVStack,{spacing:"5",children:[(0,L.jsx)(Uo.__experimentalText,{children:(0,fs.__)("Reset to default and clear all customizations?")}),(0,L.jsxs)(Uo.__experimentalHStack,{justify:"right",children:[(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:t,disabled:o,accessibleWhenDisabled:!0,children:(0,fs.__)("Cancel")}),(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,variant:"primary",onClick:async()=>{n(!0),await(async()=>{try{for(const t of e)await _i(t,{allowUndo:!1}),await i("postType",t.type,t.id);r(e.length>1?(0,fs.sprintf)((0,fs.__)("%s items reset."),e.length):(0,fs.sprintf)((0,fs.__)('"%s" reset.'),on(e[0])),{type:"snackbar",id:"revert-template-action"})}catch(t){let s;s="wp_template"===e[0].type?1===e.length?(0,fs.__)("An error occurred while reverting the template."):(0,fs.__)("An error occurred while reverting the templates."):1===e.length?(0,fs.__)("An error occurred while reverting the template part."):(0,fs.__)("An error occurred while reverting the template parts.");const o=t,n=o.message&&"unknown_error"!==o.code?o.message:s;a(n,{type:"snackbar"})}})(),s?.(e),n(!1),t?.()},isBusy:o,disabled:o,accessibleWhenDisabled:!0,children:(0,fs.__)("Reset")})]})]})}},bi=fi,yi=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 5.5A2.25 2.25 0 0 0 9.878 7h4.244A2.251 2.251 0 0 0 12 5.5ZM12 4a3.751 3.751 0 0 0-3.675 3H5v1.5h1.27l.818 8.997a2.75 2.75 0 0 0 2.739 2.501h4.347a2.75 2.75 0 0 0 2.738-2.5L17.73 8.5H19V7h-3.325A3.751 3.751 0 0 0 12 4Zm4.224 4.5H7.776l.806 8.861a1.25 1.25 0 0 0 1.245 1.137h4.347a1.25 1.25 0 0 0 1.245-1.137l.805-8.861Z"})});function xi(e){const t=new Set;if(1===e.length){const s=e[0];s.reason?.message&&t.add(s.reason.message)}else{const s=e.filter((({status:e})=>"rejected"===e));for(const e of s){const s=e;s.reason?.message&&t.add(s.reason.message)}}return t}const{PATTERN_TYPES:vi}=dn(ln.privateApis),wi={id:"delete-post",label:(0,fs.__)("Delete"),isPrimary:!0,icon:yi,isEligible:e=>sn(e)?nn(e):e.type===vi.user,supportsBulk:!0,hideModalHeader:!0,RenderModal:({items:e,closeModal:t,onActionPerformed:s})=>{const[o,n]=(0,u.useState)(!1),i=e.every((e=>sn(e)&&e?.has_theme_file));return(0,L.jsxs)(Uo.__experimentalVStack,{spacing:"5",children:[(0,L.jsx)(Uo.__experimentalText,{children:e.length>1?(0,fs.sprintf)((0,fs._n)("Delete %d item?","Delete %d items?",e.length),e.length):(0,fs.sprintf)((0,fs._x)('Delete "%s"?',"template part"),on(e[0]))}),(0,L.jsxs)(Uo.__experimentalHStack,{justify:"right",children:[(0,L.jsx)(Uo.Button,{variant:"tertiary",onClick:t,disabled:o,accessibleWhenDisabled:!0,__next40pxDefaultSize:!0,children:(0,fs.__)("Cancel")}),(0,L.jsx)(Uo.Button,{variant:"primary",onClick:async()=>{n(!0);const o={success:{messages:{getMessage:e=>i?(0,fs.sprintf)((0,fs.__)('"%s" reset.'),(0,Lo.decodeEntities)(on(e))):(0,fs.sprintf)((0,fs._x)('"%s" deleted.',"template part"),(0,Lo.decodeEntities)(on(e))),getBatchMessage:()=>i?(0,fs.__)("Items reset."):(0,fs.__)("Items deleted.")}},error:{messages:{getMessage:e=>1===e.size?[...e][0]:i?(0,fs.__)("An error occurred while reverting the item."):(0,fs.__)("An error occurred while deleting the item."),getBatchMessage:e=>0===e.size?i?(0,fs.__)("An error occurred while reverting the items."):(0,fs.__)("An error occurred while deleting the items."):1===e.size?i?(0,fs.sprintf)((0,fs.__)("An error occurred while reverting the items: %s"),[...e][0]):(0,fs.sprintf)((0,fs.__)("An error occurred while deleting the items: %s"),[...e][0]):i?(0,fs.sprintf)((0,fs.__)("Some errors occurred while reverting the items: %s"),[...e].join(",")):(0,fs.sprintf)((0,fs.__)("Some errors occurred while deleting the items: %s"),[...e].join(","))}}};await(async(e,t,s)=>{const{createSuccessNotice:o,createErrorNotice:n}=(0,c.dispatch)(_s.store),{deleteEntityRecord:i}=(0,c.dispatch)(d.store),r=await Promise.allSettled(e.map((e=>i("postType",e.type,e.id,{force:!0},{throwOnError:!0}))));if(r.every((({status:e})=>"fulfilled"===e))){var a;let n;n=1===r.length?t.success.messages.getMessage(e[0]):t.success.messages.getBatchMessage(e),o(n,{type:null!==(a=t.success.type)&&void 0!==a?a:"snackbar",id:t.success.id}),s.onActionPerformed?.(e)}else{var l;const e=xi(r);let o="";o=1===r.length?t.error.messages.getMessage(e):t.error.messages.getBatchMessage(e),n(o,{type:null!==(l=t.error.type)&&void 0!==l?l:"snackbar",id:t.error.id}),s.onActionError?.()}})(e,o,{onActionPerformed:s}),n(!1),t?.()},isBusy:o,disabled:o,accessibleWhenDisabled:!0,__next40pxDefaultSize:!0,children:(0,fs.__)("Delete")})]})]})}},Si=wi,ki={id:"move-to-trash",label:(0,fs.__)("Move to trash"),isPrimary:!0,icon:yi,isEligible:e=>!sn(e)&&"wp_block"!==e.type&&(!!e.status&&!["auto-draft","trash"].includes(e.status)&&e.permissions?.delete),supportsBulk:!0,hideModalHeader:!0,RenderModal:({items:e,closeModal:t,onActionPerformed:s})=>{const[o,n]=(0,u.useState)(!1),{createSuccessNotice:i,createErrorNotice:r}=(0,c.useDispatch)(_s.store),{deleteEntityRecord:a}=(0,c.useDispatch)(d.store);return(0,L.jsxs)(Uo.__experimentalVStack,{spacing:"5",children:[(0,L.jsx)(Uo.__experimentalText,{children:1===e.length?(0,fs.sprintf)((0,fs.__)('Are you sure you want to move "%s" to the trash?'),on(e[0])):(0,fs.sprintf)((0,fs._n)("Are you sure you want to move %d item to the trash ?","Are you sure you want to move %d items to the trash ?",e.length),e.length)}),(0,L.jsxs)(Uo.__experimentalHStack,{justify:"right",children:[(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:t,disabled:o,accessibleWhenDisabled:!0,children:(0,fs.__)("Cancel")}),(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,variant:"primary",onClick:async()=>{n(!0);const o=await Promise.allSettled(e.map((e=>a("postType",e.type,e.id.toString(),{},{throwOnError:!0}))));if(o.every((({status:e})=>"fulfilled"===e))){let t;t=1===o.length?(0,fs.sprintf)((0,fs.__)('"%s" moved to the trash.'),on(e[0])):(0,fs.sprintf)((0,fs._n)("%s item moved to the trash.","%s items moved to the trash.",e.length),e.length),i(t,{type:"snackbar",id:"move-to-trash-action"})}else{let e;if(1===o.length){const t=o[0];e=t.reason?.message?t.reason.message:(0,fs.__)("An error occurred while moving the item to the trash.")}else{const t=new Set,s=o.filter((({status:e})=>"rejected"===e));for(const e of s){const s=e;s.reason?.message&&t.add(s.reason.message)}e=0===t.size?(0,fs.__)("An error occurred while moving the items to the trash."):1===t.size?(0,fs.sprintf)((0,fs.__)("An error occurred while moving the item to the trash: %s"),[...t][0]):(0,fs.sprintf)((0,fs.__)("Some errors occurred while moving the items to the trash: %s"),[...t].join(","))}r(e,{type:"snackbar"})}s&&s(e),n(!1),t?.()},isBusy:o,disabled:o,accessibleWhenDisabled:!0,children:(0,fs._x)("Trash","verb")})]})]})}},Ci=ki,Pi={id:"permanently-delete",label:(0,fs.__)("Permanently delete"),supportsBulk:!0,icon:yi,isEligible(e){if(sn(e)||"wp_block"===e.type)return!1;const{status:t,permissions:s}=e;return"trash"===t&&s?.delete},hideModalHeader:!0,RenderModal:({items:e,closeModal:t,onActionPerformed:s})=>{const[o,n]=(0,u.useState)(!1),{createSuccessNotice:i,createErrorNotice:r}=(0,c.useDispatch)(_s.store),{deleteEntityRecord:a}=(0,c.useDispatch)(d.store);return(0,L.jsxs)(Uo.__experimentalVStack,{spacing:"5",children:[(0,L.jsx)(Uo.__experimentalText,{children:e.length>1?(0,fs.sprintf)((0,fs._n)("Are you sure you want to permanently delete %d item?","Are you sure you want to permanently delete %d items?",e.length),e.length):(0,fs.sprintf)((0,fs.__)('Are you sure you want to permanently delete "%s"?'),(0,Lo.decodeEntities)(on(e[0])))}),(0,L.jsxs)(Uo.__experimentalHStack,{justify:"right",children:[(0,L.jsx)(Uo.Button,{variant:"tertiary",onClick:t,disabled:o,accessibleWhenDisabled:!0,__next40pxDefaultSize:!0,children:(0,fs.__)("Cancel")}),(0,L.jsx)(Uo.Button,{variant:"primary",onClick:async()=>{n(!0);const o=await Promise.allSettled(e.map((e=>a("postType",e.type,e.id,{force:!0},{throwOnError:!0}))));if(o.every((({status:e})=>"fulfilled"===e))){let t;t=1===o.length?(0,fs.sprintf)((0,fs.__)('"%s" permanently deleted.'),on(e[0])):(0,fs.__)("The items were permanently deleted."),i(t,{type:"snackbar",id:"permanently-delete-post-action"}),s?.(e)}else{let e;if(1===o.length){const t=o[0];e=t.reason?.message?t.reason.message:(0,fs.__)("An error occurred while permanently deleting the item.")}else{const t=new Set,s=o.filter((({status:e})=>"rejected"===e));for(const e of s){const s=e;s.reason?.message&&t.add(s.reason.message)}e=0===t.size?(0,fs.__)("An error occurred while permanently deleting the items."):1===t.size?(0,fs.sprintf)((0,fs.__)("An error occurred while permanently deleting the items: %s"),[...t][0]):(0,fs.sprintf)((0,fs.__)("Some errors occurred while permanently deleting the items: %s"),[...t].join(","))}r(e,{type:"snackbar"})}n(!1),t?.()},isBusy:o,disabled:o,accessibleWhenDisabled:!0,__next40pxDefaultSize:!0,children:(0,fs.__)("Delete permanently")})]})]})}},ji=Pi,Ei=window.wp.mediaUtils,Ti=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.Path,{d:"M5 11.25h14v1.5H5z"})}),Bi={id:"featured_media",type:"media",label:(0,fs.__)("Featured Image"),Edit:({data:e,field:t,onChange:s})=>{const{id:o}=t,n=t.getValue({item:e}),i=(0,c.useSelect)((e=>{const{getEntityRecord:t}=e(d.store);return t("root","media",n)}),[n]),r=(0,u.useCallback)((e=>s({[o]:e})),[o,s]),a=i?.source_url,l=i?.title?.rendered,p=(0,u.useRef)(null);return(0,L.jsx)("fieldset",{className:"fields-controls__featured-image",children:(0,L.jsx)("div",{className:"fields-controls__featured-image-container",children:(0,L.jsx)(Ei.MediaUpload,{onSelect:e=>{r(e.id)},allowedTypes:["image"],render:({open:e})=>(0,L.jsx)("div",{ref:p,role:"button",tabIndex:-1,onClick:()=>{e()},onKeyDown:e,children:(0,L.jsxs)(Uo.__experimentalGrid,{rowGap:0,columnGap:8,templateColumns:"24px 1fr 24px",children:[a&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)("img",{className:"fields-controls__featured-image-image",alt:"",width:24,height:24,src:a}),(0,L.jsx)("span",{className:"fields-controls__featured-image-title",children:l})]}),!a&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)("span",{className:"fields-controls__featured-image-placeholder",style:{width:"24px",height:"24px"}}),(0,L.jsx)("span",{className:"fields-controls__featured-image-title",children:(0,fs.__)("Choose an image…")})]}),a&&(0,L.jsx)(L.Fragment,{children:(0,L.jsx)(Uo.Button,{size:"small",className:"fields-controls__featured-image-remove-button",icon:Ti,onClick:e=>{e.stopPropagation(),r(0)}})})]})})})})})},render:({item:e})=>{const t=e.featured_media,s=(0,c.useSelect)((e=>{const{getEntityRecord:s}=e(d.store);return t?s("root","media",t):null}),[t]),o=s?.source_url;return o?(0,L.jsx)("img",{className:"fields-controls__featured-image-image",src:o,alt:""}):(0,L.jsx)("span",{className:"fields-controls__featured-image-placeholder"})},enableSorting:!1},Ii=Bi;function Ni(e){var t,s,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e)){var n=e.length;for(t=0;t{const{getEntityRecord:s}=t(d.store);let o;return e.author&&(o=s("root","user",e.author)),{imageUrl:o?.avatar_urls?.[48],text:o?.name}}),[e]),[o,n]=(0,u.useState)(!1);return(0,L.jsxs)(Uo.__experimentalHStack,{alignment:"left",spacing:0,children:[!!s&&(0,L.jsx)("div",{className:Ai("page-templates-author-field__avatar",{"is-loaded":o}),children:(0,L.jsx)("img",{onLoad:()=>n(!0),alt:(0,fs.__)("Author avatar"),src:s})}),!s&&(0,L.jsx)("div",{className:"page-templates-author-field__icon",children:(0,L.jsx)(Uo.Icon,{icon:Di})}),(0,L.jsx)("span",{className:"page-templates-author-field__name",children:t})]})},Mi={label:(0,fs.__)("Author"),id:"author",type:"integer",elements:[],render:Ri,sort:(e,t,s)=>{const o=e._embedded?.author?.[0]?.name||"",n=t._embedded?.author?.[0]?.name||"";return"asc"===s?o.localeCompare(n):n.localeCompare(o)}},Li=Mi,Oi=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm8 4a4 4 0 0 0 4-4H8a4 4 0 0 0 4 4Z"})}),Fi=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm9 1V8h-1.5v3.5h-2V13H13Z"})}),Vi=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm8 4a4 4 0 0 1-4-4h4V8a4 4 0 0 1 0 8Z"})}),zi=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 18.5A6.5 6.5 0 0 1 6.93 7.931l9.139 9.138A6.473 6.473 0 0 1 12 18.5Zm5.123-2.498a6.5 6.5 0 0 0-9.124-9.124l9.124 9.124ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Z"})}),Ui=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm11.53-1.47-1.06-1.06L11 12.94l-1.47-1.47-1.06 1.06L11 15.06l4.53-4.53Z"})}),Hi=[{value:"draft",label:(0,fs.__)("Draft"),icon:Oi,description:(0,fs.__)("Not ready to publish.")},{value:"future",label:(0,fs.__)("Scheduled"),icon:Fi,description:(0,fs.__)("Publish automatically on a chosen date.")},{value:"pending",label:(0,fs.__)("Pending Review"),icon:Vi,description:(0,fs.__)("Waiting for review before publishing.")},{value:"private",label:(0,fs.__)("Private"),icon:zi,description:(0,fs.__)("Only visible to site admins and editors.")},{value:"publish",label:(0,fs.__)("Published"),icon:Ui,description:(0,fs.__)("Visible to everyone.")},{value:"trash",label:(0,fs.__)("Trash"),icon:yi}];const Gi=function({item:e}){const t=Hi.find((({value:t})=>t===e.status)),s=t?.label||e.status,o=t?.icon;return(0,L.jsxs)(Uo.__experimentalHStack,{alignment:"left",spacing:0,children:[o&&(0,L.jsx)("div",{className:"edit-site-post-list__status-icon",children:(0,L.jsx)(Uo.Icon,{icon:o})}),(0,L.jsx)("span",{children:s})]})},$i={label:(0,fs.__)("Status"),id:"status",type:"text",elements:Hi,render:Gi,Edit:"radio",enableSorting:!1,filterBy:{operators:["isAny"]}},Wi=e=>(0,x.dateI18n)((0,x.getSettings)().formats.datetimeAbbreviated,(0,x.getDate)(e)),Zi=({item:e})=>{var t,s,o,n;var i;if(["draft","private"].includes(null!==(t=e.status)&&void 0!==t?t:""))return(0,u.createInterpolateElement)((0,fs.sprintf)((0,fs.__)("Modified: "),Wi(null!==(i=e.date)&&void 0!==i?i:null)),{span:(0,L.jsx)("span",{}),time:(0,L.jsx)("time",{})});var r;if("future"===e.status)return(0,u.createInterpolateElement)((0,fs.sprintf)((0,fs.__)("Scheduled: "),Wi(null!==(r=e.date)&&void 0!==r?r:null)),{span:(0,L.jsx)("span",{}),time:(0,L.jsx)("time",{})});var a;if("publish"===e.status)return(0,u.createInterpolateElement)((0,fs.sprintf)((0,fs.__)("Published: "),Wi(null!==(a=e.date)&&void 0!==a?a:null)),{span:(0,L.jsx)("span",{}),time:(0,L.jsx)("time",{})});const l=(0,x.getDate)(null!==(s=e.modified)&&void 0!==s?s:null)>(0,x.getDate)(null!==(o=e.date)&&void 0!==o?o:null)?e.modified:e.date;return"pending"===e.status?(0,u.createInterpolateElement)((0,fs.sprintf)((0,fs.__)("Modified: "),Wi(null!=l?l:null)),{span:(0,L.jsx)("span",{}),time:(0,L.jsx)("time",{})}):(0,L.jsx)("time",{children:Wi(null!==(n=e.date)&&void 0!==n?n:null)})},Yi={id:"date",type:"datetime",label:(0,fs.__)("Date"),render:Zi},Ki=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M5.625 5.5h9.75c.069 0 .125.056.125.125v9.75a.125.125 0 0 1-.125.125h-9.75a.125.125 0 0 1-.125-.125v-9.75c0-.069.056-.125.125-.125ZM4 5.625C4 4.728 4.728 4 5.625 4h9.75C16.273 4 17 4.728 17 5.625v9.75c0 .898-.727 1.625-1.625 1.625h-9.75A1.625 1.625 0 0 1 4 15.375v-9.75Zm14.5 11.656v-9H20v9C20 18.8 18.77 20 17.251 20H6.25v-1.5h11.001c.69 0 1.249-.528 1.249-1.219Z"})}),qi=e=>"object"!=typeof e?"":e.slug||(0,v.cleanForSlug)(on(e))||e.id.toString(),Qi=({field:e,onChange:t,data:s})=>{const{id:o}=e,n=e.getValue({item:s})||qi(s),i=s.permalink_template||"",r=/%(?:postname|pagename)%/,[a,l]=i.split(r),d=a,m=l,h=r.test(i),g=(0,u.useRef)(n),_=n||g.current,f=h?`${d}${_}${m}`:(0,v.safeDecodeURIComponent)(s.link||"");(0,u.useEffect)((()=>{n&&void 0===g.current&&(g.current=n)}),[n]);const b=(0,u.useCallback)((e=>t({[o]:e})),[o,t]),{createNotice:y}=(0,c.useDispatch)(_s.store),x=(0,p.useCopyToClipboard)(f,(()=>{y("info",(0,fs.__)("Copied Permalink to clipboard."),{isDismissible:!0,type:"snackbar"})})),w="editor-post-url__slug-description-"+(0,p.useInstanceId)(Qi);return(0,L.jsxs)("fieldset",{className:"fields-controls__slug",children:[h&&(0,L.jsxs)(Uo.__experimentalVStack,{children:[(0,L.jsxs)(Uo.__experimentalVStack,{spacing:"0px",children:[(0,L.jsx)("span",{children:(0,fs.__)("Customize the last part of the Permalink.")}),(0,L.jsx)(Uo.ExternalLink,{href:"https://wordpress.org/documentation/article/page-post-settings-sidebar/#permalink",children:(0,fs.__)("Learn more")})]}),(0,L.jsx)(Uo.__experimentalInputControl,{__next40pxDefaultSize:!0,prefix:(0,L.jsx)(Uo.__experimentalInputControlPrefixWrapper,{children:"/"}),suffix:(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,icon:Ki,ref:x,label:(0,fs.__)("Copy")}),label:(0,fs.__)("Link"),hideLabelFromVision:!0,value:n,autoComplete:"off",spellCheck:"false",type:"text",className:"fields-controls__slug-input",onChange:e=>{b(e)},onBlur:()=>{""===n&&b(g.current)},"aria-describedby":w}),(0,L.jsxs)("div",{className:"fields-controls__slug-help",children:[(0,L.jsx)("span",{className:"fields-controls__slug-help-visual-label",children:(0,fs.__)("Permalink:")}),(0,L.jsxs)(Uo.ExternalLink,{className:"fields-controls__slug-help-link",href:f,children:[(0,L.jsx)("span",{className:"fields-controls__slug-help-prefix",children:d}),(0,L.jsx)("span",{className:"fields-controls__slug-help-slug",children:_}),(0,L.jsx)("span",{className:"fields-controls__slug-help-suffix",children:m})]})]})]}),!h&&(0,L.jsx)(Uo.ExternalLink,{className:"fields-controls__slug-help",href:f,children:f})]})},Xi=Qi,Ji=({item:e})=>{const t=qi(e),s=(0,u.useRef)(t);(0,u.useEffect)((()=>{t&&void 0===s.current&&(s.current=t)}),[t]);return`${t||s.current}`},er={id:"slug",type:"text",label:(0,fs.__)("Slug"),Edit:Xi,render:Ji};var tr=s(9681),sr=s.n(tr);function or(e){return"object"==typeof e.title&&"rendered"in e.title&&e.title.rendered?(0,Lo.decodeEntities)(e.title.rendered):`#${e?.id} (${(0,fs.__)("no title")})`}const nr=(e,t)=>{const s=sr()(e||"").toLowerCase(),o=sr()(t||"").toLowerCase();return s===o?0:s.startsWith(o)?s.length:1/0};function ir({data:e,onChangeControl:t}){const[s,o]=(0,u.useState)(null),n=e.parent,i=e.id,r=e.type,{parentPostTitle:a,pageItems:l,isHierarchical:m}=(0,c.useSelect)((e=>{const{getEntityRecord:t,getEntityRecords:o,getPostType:a}=e(d.store),l=a(r),c=l?.hierarchical&&l.viewable,u=n?t("postType",r,n):null,p={per_page:100,exclude:i,parent_exclude:i,orderby:"menu_order",order:"asc",_fields:"id,title,parent",...null!==s&&{search:s}};return{isHierarchical:c,parentPostTitle:u?or(u):"",pageItems:c?o("postType",r,p):null}}),[s,n,i,r]),h=(0,u.useMemo)((()=>{const e=(t,o=0)=>{const n=t.map((t=>[{value:t.id,label:"— ".repeat(o)+(0,Lo.decodeEntities)(t.name),rawName:t.name},...e(t.children||[],o+1)])).sort((([e],[t])=>nr(e.rawName,null!=s?s:"")>=nr(t.rawName,null!=s?s:"")?1:-1));return n.flat()};if(!l)return[];let t=l.map((e=>{var t;return{id:e.id,parent:null!==(t=e.parent)&&void 0!==t?t:null,name:or(e)}}));s||(t=function(e){const t=e.map((e=>({children:[],...e})));if(t.some((({parent:e})=>null==e)))return t;const s=t.reduce(((e,t)=>{const{parent:s}=t;return e[s]||(e[s]=[]),e[s].push(t),e}),{}),o=e=>e.map((e=>{const t=s[e.id];return{...e,children:t&&t.length?o(t):[]}}));return o(s[0]||[])}(t));const o=e(t),i=o.find((e=>e.value===n));return n&&a&&!i&&o.unshift({value:n,label:a,rawName:""}),o.map((e=>({...e,value:e.value.toString()})))}),[l,s,a,n]);if(!m)return null;return(0,L.jsx)(Uo.ComboboxControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,fs.__)("Parent"),help:(0,fs.__)("Choose a parent page."),value:n?.toString(),options:h,onFilterValueChange:(0,p.debounce)((e=>{o(e)}),300),onChange:e=>{var s;if(e)return t(null!==(s=parseInt(e,10))&&void 0!==s?s:0);t(0)},hideLabelFromVision:!0})}const rr={id:"parent",type:"text",label:(0,fs.__)("Parent"),Edit:({data:e,field:t,onChange:s})=>{const{id:o}=t,n=(0,c.useSelect)((e=>e(d.store).getEntityRecord("root","__unstableBase")?.home),[]),i=(0,u.useCallback)((e=>s({[o]:e})),[o,s]);return(0,L.jsx)("fieldset",{className:"fields-controls__parent",children:(0,L.jsxs)("div",{children:[(0,u.createInterpolateElement)((0,fs.sprintf)((0,fs.__)('Child pages inherit characteristics from their parent, such as URL structure. For instance, if "Pricing" is a child of "Services", its URL would be %1$s/services/pricing.'),(0,v.filterURLForDisplay)(n).replace(/([/.])/g,"$1")),{wbr:(0,L.jsx)("wbr",{})}),(0,L.jsx)("p",{children:(0,u.createInterpolateElement)((0,fs.__)("They also show up as sub-items in the default navigation menu. Learn more."),{a:(0,L.jsx)(Uo.ExternalLink,{href:(0,fs.__)("https://wordpress.org/documentation/article/page-post-settings-sidebar/#page-attributes"),children:void 0})})}),(0,L.jsx)(ir,{data:e,onChangeControl:i})]})})},render:({item:e})=>{const t=(0,c.useSelect)((t=>{const{getEntityRecord:s}=t(d.store);return e?.parent?s("postType",e.type,e.parent):null}),[e.parent,e.type]);return t?(0,L.jsx)(L.Fragment,{children:or(t)}):(0,L.jsx)(L.Fragment,{children:(0,fs.__)("None")})},enableSorting:!0},ar={id:"comment_status",label:(0,fs.__)("Discussion"),type:"text",Edit:"radio",enableSorting:!1,filterBy:{operators:[]},elements:[{value:"open",label:(0,fs.__)("Open"),description:(0,fs.__)("Visitors can add new comments and replies.")},{value:"closed",label:(0,fs.__)("Closed"),description:(0,fs.__)("Visitors cannot add new comments or replies. Existing comments remain visible.")}]},lr={id:"template",type:"text",label:(0,fs.__)("Template"),Edit:({data:e,field:t,onChange:s})=>{const{id:o}=t,n=e.type,i="number"==typeof e.id?e.id:parseInt(e.id,10),r=e.slug,{availableTemplates:a,templates:l}=(0,c.useSelect)((t=>{var s;const o=null!==(s=t(d.store).getEntityRecords("postType","wp_template",{per_page:-1,post_type:n}))&&void 0!==s?s:[],{getHomePage:r,getPostsPageId:a}=dn(t(d.store)),l=a()===+i,c="page"===n&&r()?.postId===+i;return{templates:o,availableTemplates:!l&&!c?o.filter((t=>t.is_custom&&t.slug!==e.template&&!!t.content.raw)):[]}}),[e.template,i,n]),m=(0,u.useMemo)((()=>a.map((e=>({name:e.slug,blocks:(0,y.parse)(e.content.raw),title:(0,Lo.decodeEntities)(e.title.rendered),id:e.id})))),[a]),g=(0,p.useAsyncList)(m),_=t.getValue({item:e}),f=(0,c.useSelect)((e=>{const t=l?.find((e=>e.slug===_));if(t)return t;let s;if(s=r?"page"===n?`${n}-${r}`:`single-${n}-${r}`:"page"===n?"page":`single-${n}`,n){const t=e(d.store).getDefaultTemplateId({slug:s});return e(d.store).getEntityRecord("postType","wp_template",t)}}),[n,r,l,_]),[b,x]=(0,u.useState)(!1),v=(0,u.useCallback)((e=>s({[o]:e})),[o,s]);return(0,L.jsxs)("fieldset",{className:"fields-controls__template",children:[(0,L.jsx)(Uo.Dropdown,{popoverProps:{placement:"bottom-start"},renderToggle:({onToggle:e})=>(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,variant:"tertiary",size:"compact",onClick:e,children:f?on(f):""}),renderContent:({onToggle:e})=>(0,L.jsxs)(Uo.MenuGroup,{children:[(0,L.jsx)(Uo.MenuItem,{onClick:()=>{x(!0),e()},children:(0,fs.__)("Change template")}),""!==_&&(0,L.jsx)(Uo.MenuItem,{onClick:()=>{v(""),e()},children:(0,fs.__)("Use default template")})]})}),b&&(0,L.jsx)(Uo.Modal,{title:(0,fs.__)("Choose a template"),onRequestClose:()=>x(!1),overlayClassName:"fields-controls__template-modal",isFullScreen:!0,children:(0,L.jsx)("div",{className:"fields-controls__template-content",children:(0,L.jsx)(h.__experimentalBlockPatternsList,{label:(0,fs.__)("Templates"),blockPatterns:m,shownPatterns:g,onClickPattern:e=>{v(e.name),x(!1)}})})})]})},enableSorting:!1},cr=lr;const dr={id:"password",type:"text",Edit:function({data:e,onChange:t,field:s}){const[o,n]=(0,u.useState)(!!s.getValue({item:e}));return(0,L.jsxs)(Uo.__experimentalVStack,{as:"fieldset",spacing:4,className:"fields-controls__password",children:[(0,L.jsx)(Uo.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,fs.__)("Password protected"),help:(0,fs.__)("Only visible to those who know the password"),checked:o,onChange:e=>{n(e),e||t({password:""})}}),o&&(0,L.jsx)("div",{className:"fields-controls__password-input",children:(0,L.jsx)(Uo.TextControl,{label:(0,fs.__)("Password"),onChange:e=>t({password:e}),value:s.getValue({item:e})||"",placeholder:(0,fs.__)("Use a secure password"),type:"text",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,maxLength:255})})]})},enableSorting:!1,enableHiding:!1,isVisible:e=>"private"!==e.status};function ur({item:e,className:t,children:s}){const o=on(e);return(0,L.jsxs)(Uo.__experimentalHStack,{className:Ai("fields-field__title",t),alignment:"center",justify:"flex-start",children:[(0,L.jsx)("span",{children:o||(0,fs.__)("(no title)")}),s]})}function pr({item:e}){return(0,L.jsx)(ur,{item:e})}const{Badge:mr}=dn(Uo.privateApis);const hr={type:"text",id:"title",label:(0,fs.__)("Title"),placeholder:(0,fs.__)("No title"),getValue:({item:e})=>on(e),render:function({item:e}){const{frontPageId:t,postsPageId:s}=(0,c.useSelect)((e=>{const{getEntityRecord:t}=e(d.store),s=t("root","site");return{frontPageId:s?.page_on_front,postsPageId:s?.page_for_posts}}),[]);return(0,L.jsx)(ur,{item:e,className:"fields-field__page-title",children:[t,s].includes(e.id)&&(0,L.jsx)(mr,{children:e.id===t?(0,fs.__)("Homepage"):(0,fs.__)("Posts Page")})})},enableHiding:!1,enableGlobalSearch:!0},gr={type:"text",label:(0,fs.__)("Template"),placeholder:(0,fs.__)("No title"),id:"title",getValue:({item:e})=>on(e),render:pr,enableHiding:!1,enableGlobalSearch:!0};const _r=(0,u.forwardRef)((function({icon:e,size:t=24,...s},o){return(0,u.cloneElement)(e,{width:t,height:t,...s,ref:o})})),fr=(0,L.jsx)(M.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,L.jsx)(M.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M15 11h-.2V9c0-1.5-1.2-2.8-2.8-2.8S9.2 7.5 9.2 9v2H9c-.6 0-1 .4-1 1v4c0 .6.4 1 1 1h6c.6 0 1-.4 1-1v-4c0-.6-.4-1-1-1zm-1.8 0h-2.5V9c0-.7.6-1.2 1.2-1.2s1.2.6 1.2 1.2v2z"})}),{PATTERN_TYPES:br}=dn(ln.privateApis);const yr={type:"text",id:"title",label:(0,fs.__)("Title"),placeholder:(0,fs.__)("No title"),getValue:({item:e})=>on(e),render:function({item:e}){return(0,L.jsx)(ur,{item:e,className:"fields-field__pattern-title",children:e.type===br.theme&&(0,L.jsx)(Uo.Tooltip,{placement:"top",text:(0,fs.__)("This pattern cannot be edited."),children:(0,L.jsx)(_r,{icon:fr,size:24})})})},enableHiding:!1,enableGlobalSearch:!0},xr={type:"text",id:"title",label:(0,fs.__)("Title"),placeholder:(0,fs.__)("No title"),getValue:({item:e})=>on(e),render:pr,enableHiding:!1,enableGlobalSearch:!0};const vr=(0,p.createHigherOrderComponent)((e=>({useSubRegistry:t=!0,...s})=>{const o=(0,c.useRegistry)(),[n]=(0,u.useState)((()=>new WeakMap)),i=function(e,t,s){if(!s)return t;let o=e.get(t);return o||(o=(0,c.createRegistry)({"core/block-editor":h.storeConfig},t),o.registerStore("core/editor",Ec),e.set(t,o)),o}(n,o,t);return i===o?(0,L.jsx)(e,{registry:o,...s}):(0,L.jsx)(c.RegistryProvider,{value:i,children:(0,L.jsx)(e,{registry:i,...s})})}),"withRegistryProvider"),wr=(e,t)=>`${t}`,Sr=e=>`href="${e}" target="_blank" rel="noreferrer noopener"`,kr=e=>{const{title:t,foreign_landing_url:s,creator:o,creator_url:n,license:i,license_version:r,license_url:a}=e,l=((e,t)=>{let s=e.trim();return"pdm"!==e&&(s=e.toUpperCase().replace("SAMPLING","Sampling")),t&&(s+=` ${t}`),["pdm","cc0"].includes(e)||(s=`CC ${s}`),s})(i,r),c=(0,Lo.decodeEntities)(o);let d;return d=c?t?(0,fs.sprintf)((0,fs._x)('"%1$s" by %2$s/ %3$s',"caption"),wr(s,(0,Lo.decodeEntities)(t)),n?wr(n,c):c,a?wr(`${a}?ref=openverse`,l):l):(0,fs.sprintf)((0,fs._x)("Work by %2$s/ %3$s","caption"),Sr(s),n?wr(n,c):c,a?wr(`${a}?ref=openverse`,l):l):t?(0,fs.sprintf)((0,fs._x)('"%1$s"/ %2$s',"caption"),wr(s,(0,Lo.decodeEntities)(t)),a?wr(`${a}?ref=openverse`,l):l):(0,fs.sprintf)((0,fs._x)("Work/ %2$s","caption"),Sr(s),a?wr(`${a}?ref=openverse`,l):l),d.replace(/\s{2}/g," ")},Cr=async(e={})=>(await(0,c.resolveSelect)(d.store).getMediaItems({...e,orderBy:e?.search?"relevance":"date"})).map((e=>({...e,alt:e.alt_text,url:e.source_url,previewUrl:e.media_details?.sizes?.medium?.source_url,caption:e.caption?.raw}))),Pr=[{name:"images",labels:{name:(0,fs.__)("Images"),search_items:(0,fs.__)("Search images")},mediaType:"image",fetch:async(e={})=>Cr({...e,media_type:"image"})},{name:"videos",labels:{name:(0,fs.__)("Videos"),search_items:(0,fs.__)("Search videos")},mediaType:"video",fetch:async(e={})=>Cr({...e,media_type:"video"})},{name:"audio",labels:{name:(0,fs.__)("Audio"),search_items:(0,fs.__)("Search audio")},mediaType:"audio",fetch:async(e={})=>Cr({...e,media_type:"audio"})},{name:"openverse",labels:{name:(0,fs.__)("Openverse"),search_items:(0,fs.__)("Search Openverse")},mediaType:"image",async fetch(e={}){const t={...e,mature:!1,excluded_source:"flickr,inaturalist,wikimedia",license:"pdm,cc0"},s={per_page:"page_size",search:"q"},o=new URL("https://api.openverse.org/v1/images/");Object.entries(t).forEach((([e,t])=>{const n=s[e]||e;o.searchParams.set(n,t)}));const n=await window.fetch(o,{headers:{"User-Agent":"WordPress/inserter-media-fetch"}});return(await n.json()).results.map((e=>({...e,title:e.title?.toLowerCase().startsWith("file:")?e.title.slice(5):e.title,sourceId:e.id,id:void 0,caption:kr(e),previewUrl:e.thumbnail})))},getReportUrl:({sourceId:e})=>`https://wordpress.org/openverse/image/${e}/report/`,isExternalResource:!0}],jr={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let Er;const Tr=new Uint8Array(16);function Br(){if(!Er&&(Er="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Er))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Er(Tr)}const Ir=[];for(let e=0;e<256;++e)Ir.push((e+256).toString(16).slice(1));function Nr(e,t=0){return Ir[e[t+0]]+Ir[e[t+1]]+Ir[e[t+2]]+Ir[e[t+3]]+"-"+Ir[e[t+4]]+Ir[e[t+5]]+"-"+Ir[e[t+6]]+Ir[e[t+7]]+"-"+Ir[e[t+8]]+Ir[e[t+9]]+"-"+Ir[e[t+10]]+Ir[e[t+11]]+Ir[e[t+12]]+Ir[e[t+13]]+Ir[e[t+14]]+Ir[e[t+15]]}const Ar=function(e,t,s){if(jr.randomUUID&&!t&&!e)return jr.randomUUID();const o=(e=e||{}).random||(e.rng||Br)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,t){s=s||0;for(let e=0;e<16;++e)t[s+e]=o[e];return t}return Nr(o)},Dr=()=>{};function Rr({additionalData:e={},allowedTypes:t,filesList:s,maxUploadFileSize:o,onError:n=Dr,onFileChange:i,onSuccess:r}){const{getCurrentPost:a,getEditorSettings:l}=(0,c.select)(Tc),{lockPostAutosaving:d,unlockPostAutosaving:u,lockPostSaving:p,unlockPostSaving:m}=(0,c.dispatch)(Tc),h=l().allowedMimeTypes,g=`image-upload-${Ar()}`;let _=!1;o=o||l().maxUploadFileSize;const f=a(),b="number"==typeof f?.id?f.id:f?.wp_id,y=b?{post:b}:{},x=()=>{m(g),u(g),_=!1};(0,Ei.uploadMedia)({allowedTypes:t,filesList:s,onFileChange:e=>{_?x():(p(g),d(g),_=!0),i?.(e)},onSuccess:r,additionalData:{...y,...e},maxUploadFileSize:o,onError:({message:e})=>{x(),n(e)},wpAllowedMimeTypes:h})}const{sideloadMedia:Mr}=$(Ei.privateApis),Lr=Mr;var Or=s(66),Fr=s.n(Or); /*! * is-plain-object * * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. */ -function Ep(e){return"[object Object]"===Object.prototype.toString.call(e)}function Tp(e){var t,s;return!1!==Ep(e)&&(void 0===(t=e.constructor)||!1!==Ep(s=t.prototype)&&!1!==s.hasOwnProperty("isPrototypeOf"))}const{GlobalStylesContext:Bp,cleanEmptyObject:Ip}=Xo(m.privateApis);function Np(e,t){return jp()(e,t,{isMergeableObject:Tp,customMerge:e=>{if("backgroundImage"===e)return(e,t)=>t}})}function Ap(){const[e,t,s]=function(){const{globalStylesId:e,isReady:t,settings:s,styles:o,_links:n}=(0,c.useSelect)((e=>{const{getEntityRecord:t,getEditedEntityRecord:s,hasFinishedResolution:o,canUser:n}=e(d.store),i=e(d.store).__experimentalGetCurrentGlobalStylesId();let r;const a=i?n("update",{kind:"root",name:"globalStyles",id:i}):null;i&&"boolean"==typeof a&&(r=a?s("root","globalStyles",i):t("root","globalStyles",i,{context:"view"}));let l=!1;return o("__experimentalGetCurrentGlobalStylesId")&&(l=!i||(a?o("getEditedEntityRecord",["root","globalStyles",i]):o("getEntityRecord",["root","globalStyles",i,{context:"view"}]))),{globalStylesId:i,isReady:l,settings:r?.settings,styles:r?.styles,_links:r?._links}}),[]),{getEditedEntityRecord:i}=(0,c.useSelect)(d.store),{editEntityRecord:r}=(0,c.useDispatch)(d.store);return[t,(0,u.useMemo)((()=>({settings:null!=s?s:{},styles:null!=o?o:{},_links:null!=n?n:{}})),[s,o,n]),(0,u.useCallback)(((t,s={})=>{var o,n,a;const l=i("root","globalStyles",e),c={styles:null!==(o=l?.styles)&&void 0!==o?o:{},settings:null!==(n=l?.settings)&&void 0!==n?n:{},_links:null!==(a=l?._links)&&void 0!==a?a:{}},d="function"==typeof t?t(c):t;r("root","globalStyles",e,{styles:Ip(d.styles)||{},settings:Ip(d.settings)||{},_links:Ip(d._links)||{}},s)}),[e,r,i])]}(),[o,n]=function(){const e=(0,c.useSelect)((e=>e(d.store).__experimentalGetCurrentThemeBaseGlobalStyles()),[]);return[!!e,e]}(),i=(0,u.useMemo)((()=>n&&t?Np(n,t):{}),[t,n]);return(0,u.useMemo)((()=>({isReady:e&&o,user:t,base:n,merged:i,setUserConfig:s})),[i,t,n,s,e,o])}const Dp={};function Rp(e){const{getEntityRecords:t,hasFinishedResolution:s}=e(d.store),o=t("postType","wp_block",{per_page:-1});return s("getEntityRecords",["postType","wp_block",{per_page:-1}])?o:void 0}const Mp=["__experimentalBlockDirectory","__experimentalDiscussionSettings","__experimentalFeatures","__experimentalGlobalStylesBaseStyles","alignWide","blockInspectorTabs","allowedMimeTypes","bodyPlaceholder","canLockBlocks","canUpdateBlockBindings","capabilities","clearBlockSelection","codeEditingEnabled","colors","disableCustomColors","disableCustomFontSizes","disableCustomSpacingSizes","disableCustomGradients","disableLayoutStyles","enableCustomLineHeight","enableCustomSpacing","enableCustomUnits","enableOpenverseMediaCategory","fontSizes","gradients","generateAnchors","onNavigateToEntityRecord","imageDefaultSize","imageDimensions","imageEditing","imageSizes","isRTL","locale","maxWidth","postContentAttributes","postsPerPage","readOnly","styles","titlePlaceholder","supportsLayout","widgetTypesToHideFromLegacyWidgetBlock","__unstableHasCustomAppender","__unstableIsPreviewMode","__unstableResolvedAssets","__unstableIsBlockBasedTheme"],{globalStylesDataKey:Op,globalStylesLinksDataKey:Lp,selectBlockPatternsKey:Fp,reusableBlocksSelectKey:Vp,sectionRootClientIdKey:zp}=Xo(m.privateApis);const Up=function(e,t,s,o){var n,i,r,a;const l=(0,p.useViewportMatch)("medium"),{allowRightClickOverrides:h,blockTypes:g,focusMode:_,hasFixedToolbar:f,isDistractionFree:b,keepCaretInsideBlock:x,hasUploadPermissions:v,hiddenBlockTypes:w,canUseUnfilteredHTML:S,userCanCreatePages:k,pageOnFront:P,pageForPosts:C,userPatternCategories:E,restBlockPatternCategories:T,sectionRootClientId:B}=(0,c.useSelect)((e=>{var n;const{canUser:i,getRawEntityRecord:r,getEntityRecord:a,getUserPatternCategories:c,getBlockPatternCategories:u}=e(d.store),{get:p}=e(j.store),{getBlockTypes:h}=e(y.store),{getBlocksByName:g,getBlockAttributes:_}=e(m.store),f=i("read",{kind:"root",name:"site"})?a("root","site"):void 0;return{allowRightClickOverrides:p("core","allowRightClickOverrides"),blockTypes:h(),canUseUnfilteredHTML:r("postType",t,s)?._links?.hasOwnProperty("wp:action-unfiltered-html"),focusMode:p("core","focusMode"),hasFixedToolbar:p("core","fixedToolbar")||!l,hiddenBlockTypes:p("core","hiddenBlockTypes"),isDistractionFree:p("core","distractionFree"),keepCaretInsideBlock:p("core","keepCaretInsideBlock"),hasUploadPermissions:null===(n=i("create",{kind:"root",name:"media"}))||void 0===n||n,userCanCreatePages:i("create",{kind:"postType",name:"page"}),pageOnFront:f?.page_on_front,pageForPosts:f?.page_for_posts,userPatternCategories:c(),restBlockPatternCategories:u(),sectionRootClientId:"template-locked"===o?null!==(x=g("core/post-content")?.[0])&&void 0!==x?x:"":null!==(b=g("core/group").find((e=>"main"===_(e)?.tagName)))&&void 0!==b?b:""};var b,x}),[t,s,l,o]),{merged:I}=Ap(),N=null!==(n=I.styles)&&void 0!==n?n:Dp,A=null!==(i=I._links)&&void 0!==i?i:Dp,D=null!==(r=e.__experimentalAdditionalBlockPatterns)&&void 0!==r?r:e.__experimentalBlockPatterns,R=null!==(a=e.__experimentalAdditionalBlockPatternCategories)&&void 0!==a?a:e.__experimentalBlockPatternCategories,M=(0,u.useMemo)((()=>[...D||[]].filter((({postTypes:e})=>!e||Array.isArray(e)&&e.includes(t)))),[D,t]),O=(0,u.useMemo)((()=>[...R||[],...T||[]].filter(((e,t,s)=>t===s.findIndex((t=>e.name===t.name))))),[R,T]),{undo:L,setIsInserterOpened:F}=(0,c.useDispatch)(Wi),{saveEntityRecord:V}=(0,c.useDispatch)(d.store),z=(0,u.useCallback)((e=>k?V("postType","page",e):Promise.reject({message:(0,ms.__)("You do not have permission to create Pages.")})),[V,k]),U=(0,u.useMemo)((()=>{if(w&&w.length>0){return(!0===e.allowedBlockTypes?g.map((({name:e})=>e)):e.allowedBlockTypes||[]).filter((e=>!w.includes(e)))}return e.allowedBlockTypes}),[e.allowedBlockTypes,w,g]),H=!1===e.focusMode;return(0,u.useMemo)((()=>{const s={...Object.fromEntries(Object.entries(e).filter((([e])=>Mp.includes(e)))),[Op]:N,[Lp]:A,allowedBlockTypes:U,allowRightClickOverrides:h,focusMode:_&&!H,hasFixedToolbar:f,isDistractionFree:b,keepCaretInsideBlock:x,mediaUpload:v?Pp:void 0,__experimentalBlockPatterns:M,[Fp]:e=>{const{hasFinishedResolution:s,getBlockPatternsForPostType:o}=Xo(e(d.store)),n=o(t);return s("getBlockPatterns")?n:void 0},[Vp]:Rp,__experimentalBlockPatternCategories:O,__experimentalUserPatternCategories:E,__experimentalFetchLinkSuggestions:(t,s)=>(0,d.__experimentalFetchLinkSuggestions)(t,s,e),inserterMediaCategories:Sp,__experimentalFetchRichUrlData:d.__experimentalFetchUrlData,__experimentalCanUserUseUnfilteredHTML:S,__experimentalUndo:L,outlineMode:!b&&"wp_template"===t,__experimentalCreatePageEntity:z,__experimentalUserCanCreatePages:k,pageOnFront:P,pageForPosts:C,__experimentalPreferPatternsOnRoot:"wp_template"===t,templateLock:"wp_navigation"===t?"insert":e.templateLock,template:"wp_navigation"===t?[["core/navigation",{},[]]]:e.template,__experimentalSetIsInserterOpened:F,[zp]:B};return s}),[U,h,_,H,f,b,x,e,v,E,M,O,S,L,z,k,P,C,t,F,B,N,A])},Hp=["core/post-title","core/post-featured-image","core/post-content"];function Gp(){const e=(0,u.useMemo)((()=>[...(0,h.applyFilters)("editor.postContentBlockTypes",Hp),"core/template-part"]),[]),t=(0,c.useSelect)((t=>{const{getPostBlocksByName:s}=Xo(t(Wi));return s(e)}),[e]),s=(0,c.useSelect)((e=>{const{getBlocksByName:t,getBlockOrder:s}=e(m.store);return t("core/template-part").flatMap((e=>s(e)))}),[]),o=(0,c.useRegistry)();return(0,u.useEffect)((()=>{const{setBlockEditingMode:e,unsetBlockEditingMode:n}=o.dispatch(m.store);return o.batch((()=>{e("","disabled");for(const s of t)e(s,"contentOnly");for(const t of s)e(t,"disabled")})),()=>{o.batch((()=>{n("");for(const e of t)n(e);for(const e of s)n(e)}))}}),[t,s,o]),null}function $p(){const e=(0,c.useSelect)((e=>e(m.store).getBlockOrder()?.[0]),[]),{setBlockEditingMode:t,unsetBlockEditingMode:s}=(0,c.useDispatch)(m.store);(0,u.useEffect)((()=>{if(e)return t(e,"contentOnly"),()=>{s(e)}}),[e,s,t])}const Wp=["wp_block","wp_template","wp_template_part"];const Zp=(0,P.jsxs)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,P.jsx)(k.Path,{d:"m16 15.5h-8v-1.5h8zm-7.5-2.5h-2v-2h2zm3 0h-2v-2h2zm3 0h-2v-2h2zm3 0h-2v-2h2zm-9-3h-2v-2h2zm3 0h-2v-2h2zm3 0h-2v-2h2zm3 0h-2v-2h2z"}),(0,P.jsx)(k.Path,{d:"m18.5 6.5h-13a.5.5 0 0 0 -.5.5v9.5a.5.5 0 0 0 .5.5h13a.5.5 0 0 0 .5-.5v-9.5a.5.5 0 0 0 -.5-.5zm-13-1.5h13a2 2 0 0 1 2 2v9.5a2 2 0 0 1 -2 2h-13a2 2 0 0 1 -2-2v-9.5a2 2 0 0 1 2-2z"})]}),Yp=(0,P.jsx)(k.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,P.jsx)(k.Path,{d:"M3 6h11v1.5H3V6Zm3.5 5.5h11V13h-11v-1.5ZM21 17H10v1.5h11V17Z"})}),Kp=(0,P.jsx)(k.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,P.jsx)(k.Path,{d:"M20.8 10.7l-4.3-4.3-1.1 1.1 4.3 4.3c.1.1.1.3 0 .4l-4.3 4.3 1.1 1.1 4.3-4.3c.7-.8.7-1.9 0-2.6zM4.2 11.8l4.3-4.3-1-1-4.3 4.3c-.7.7-.7 1.8 0 2.5l4.3 4.3 1.1-1.1-4.3-4.3c-.2-.1-.2-.3-.1-.4z"})}),qp=(0,P.jsx)(k.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,P.jsx)(k.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zM8.5 18.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h2.5v13zm10-.5c0 .3-.2.5-.5.5h-8v-13h8c.3 0 .5.2.5.5v12z"})}),Qp=(0,P.jsx)(k.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,P.jsx)(k.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4 14.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h8v13zm4.5-.5c0 .3-.2.5-.5.5h-2.5v-13H18c.3 0 .5.2.5.5v12z"})}),Xp=(0,P.jsx)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,P.jsx)(k.Path,{d:"M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z"})}),Jp=(0,P.jsx)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,P.jsx)(k.Path,{d:"M11.1 15.8H20v-1.5h-8.9v1.5zm0-8.6v1.5H20V7.2h-8.9zM6 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-7c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})}),eh=(0,P.jsx)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,P.jsx)(k.Path,{d:"m19 7-3-3-8.5 8.5-1 4 4-1L19 7Zm-7 11.5H5V20h7v-1.5Z"})}),{RenamePatternModal:th}=Xo(nn.privateApis),sh="editor/pattern-rename";function oh(){const{record:e,postType:t}=(0,c.useSelect)((e=>{const{getCurrentPostType:t,getCurrentPostId:s}=e(Wi),{getEditedEntityRecord:o}=e(d.store),n=t();return{record:o("postType",n,s()),postType:n}}),[]),{closeModal:s}=(0,c.useDispatch)(Er);return(0,c.useSelect)((e=>e(Er).isModalActive(sh)))&&t===M?(0,P.jsx)(th,{onClose:s,pattern:e}):null}const{DuplicatePatternModal:nh}=Xo(nn.privateApis),ih="editor/pattern-duplicate";function rh(){const{record:e,postType:t}=(0,c.useSelect)((e=>{const{getCurrentPostType:t,getCurrentPostId:s}=e(Wi),{getEditedEntityRecord:o}=e(d.store),n=t();return{record:o("postType",n,s()),postType:n}}),[]),{closeModal:s}=(0,c.useDispatch)(Er);return(0,c.useSelect)((e=>e(Er).isModalActive(ih)))&&t===M?(0,P.jsx)(nh,{onClose:s,onSuccess:()=>s(),pattern:e}):null}function ah(){const{editorMode:e,isListViewOpen:t,showBlockBreadcrumbs:s,isDistractionFree:o,isTopToolbar:n,isFocusMode:i,isPreviewMode:r,isViewable:a,isCodeEditingEnabled:l,isRichEditingEnabled:u,isPublishSidebarEnabled:p}=(0,c.useSelect)((e=>{var t,s;const{get:o}=e(j.store),{isListViewOpened:n,getCurrentPostType:i,getEditorSettings:r}=e(Wi),{getSettings:a}=e(m.store),{getPostType:l}=e(d.store);return{editorMode:null!==(t=o("core","editorMode"))&&void 0!==t?t:"visual",isListViewOpen:n(),showBlockBreadcrumbs:o("core","showBlockBreadcrumbs"),isDistractionFree:o("core","distractionFree"),isFocusMode:o("core","focusMode"),isTopToolbar:o("core","fixedToolbar"),isPreviewMode:a().__unstableIsPreviewMode,isViewable:null!==(s=l(i())?.viewable)&&void 0!==s&&s,isCodeEditingEnabled:r().codeEditingEnabled,isRichEditingEnabled:r().richEditingEnabled,isPublishSidebarEnabled:e(Wi).isPublishSidebarEnabled()}}),[]),{getActiveComplementaryArea:h}=(0,c.useSelect)(Er),{toggle:g}=(0,c.useDispatch)(j.store),{createInfoNotice:_}=(0,c.useDispatch)(hs.store),{__unstableSaveForPreview:f,setIsListViewOpened:b,switchEditorMode:y,toggleDistractionFree:x}=(0,c.useDispatch)(Wi),{openModal:v,enableComplementaryArea:w,disableComplementaryArea:S}=(0,c.useDispatch)(Er),{getCurrentPostId:k}=(0,c.useSelect)(Wi),P=l&&u;if(r)return{commands:[],isLoading:!1};const C=[];return C.push({name:"core/open-shortcut-help",label:(0,ms.__)("Keyboard shortcuts"),icon:Zp,callback:({close:e})=>{e(),v("editor/keyboard-shortcut-help")}}),C.push({name:"core/toggle-distraction-free",label:o?(0,ms.__)("Exit Distraction Free"):(0,ms.__)("Enter Distraction Free"),callback:({close:e})=>{x(),e()}}),C.push({name:"core/open-preferences",label:(0,ms.__)("Editor preferences"),callback:({close:e})=>{e(),v("editor/preferences")}}),C.push({name:"core/toggle-spotlight-mode",label:(0,ms.__)("Toggle spotlight"),callback:({close:e})=>{g("core","focusMode"),e(),_(i?(0,ms.__)("Spotlight off."):(0,ms.__)("Spotlight on."),{id:"core/editor/toggle-spotlight-mode/notice",type:"snackbar",actions:[{label:(0,ms.__)("Undo"),onClick:()=>{g("core","focusMode")}}]})}}),C.push({name:"core/toggle-list-view",label:t?(0,ms.__)("Close List View"):(0,ms.__)("Open List View"),icon:Yp,callback:({close:e})=>{b(!t),e(),_(t?(0,ms.__)("List View off."):(0,ms.__)("List View on."),{id:"core/editor/toggle-list-view/notice",type:"snackbar"})}}),C.push({name:"core/toggle-top-toolbar",label:(0,ms.__)("Toggle top toolbar"),callback:({close:e})=>{g("core","fixedToolbar"),o&&x(),e(),_(n?(0,ms.__)("Top toolbar off."):(0,ms.__)("Top toolbar on."),{id:"core/editor/toggle-top-toolbar/notice",type:"snackbar",actions:[{label:(0,ms.__)("Undo"),onClick:()=>{g("core","fixedToolbar")}}]})}}),P&&C.push({name:"core/toggle-code-editor",label:"visual"===e?(0,ms.__)("Open code editor"):(0,ms.__)("Exit code editor"),icon:Kp,callback:({close:t})=>{y("visual"===e?"text":"visual"),t()}}),C.push({name:"core/toggle-breadcrumbs",label:s?(0,ms.__)("Hide block breadcrumbs"):(0,ms.__)("Show block breadcrumbs"),callback:({close:e})=>{g("core","showBlockBreadcrumbs"),e(),_(s?(0,ms.__)("Breadcrumbs hidden."):(0,ms.__)("Breadcrumbs visible."),{id:"core/editor/toggle-breadcrumbs/notice",type:"snackbar"})}}),C.push({name:"core/open-settings-sidebar",label:(0,ms.__)("Toggle settings sidebar"),icon:(0,ms.isRTL)()?qp:Qp,callback:({close:e})=>{const t=h("core");e(),"edit-post/document"===t?S("core"):w("core","edit-post/document")}}),C.push({name:"core/open-block-inspector",label:(0,ms.__)("Toggle block inspector"),icon:Xp,callback:({close:e})=>{const t=h("core");e(),"edit-post/block"===t?S("core"):w("core","edit-post/block")}}),C.push({name:"core/toggle-publish-sidebar",label:p?(0,ms.__)("Disable pre-publish checks"):(0,ms.__)("Enable pre-publish checks"),icon:Jp,callback:({close:e})=>{e(),g("core","isPublishSidebarEnabled"),_(p?(0,ms.__)("Pre-publish checks disabled."):(0,ms.__)("Pre-publish checks enabled."),{id:"core/editor/publish-sidebar/notice",type:"snackbar"})}}),a&&C.push({name:"core/preview-link",label:(0,ms.__)("Preview in a new tab"),icon:dn,callback:async({close:e})=>{e();const t=k(),s=await f();window.open(s,`wp-preview-${t}`)}}),{commands:C,isLoading:!1}}function lh(){const{postType:e}=(0,c.useSelect)((e=>{const{getCurrentPostType:t}=e(Wi);return{postType:t()}}),[]),{openModal:t}=(0,c.useDispatch)(Er),s=[];return e===M&&(s.push({name:"core/rename-pattern",label:(0,ms.__)("Rename pattern"),icon:eh,callback:({close:e})=>{t(sh),e()}}),s.push({name:"core/duplicate-pattern",label:(0,ms.__)("Duplicate pattern"),icon:Bi,callback:({close:e})=>{t(ih),e()}})),{isLoading:!1,commands:s}}const{BlockRemovalWarningModal:ch}=Xo(m.privateApis),dh=["core/post-content","core/post-template","core/query"],uh=[{postTypes:["wp_template","wp_template_part"],callback(e){if(e.filter((({name:e})=>dh.includes(e))).length)return(0,ms._n)("Deleting this block will stop your post or page content from displaying on this template. It is not recommended.","Some of the deleted blocks will stop your post or page content from displaying on this template. It is not recommended.",e.length)}},{postTypes:["wp_block"],callback(e){if(e.filter((({attributes:e})=>e?.metadata?.bindings&&Object.values(e.metadata.bindings).some((e=>"core/pattern-overrides"===e.source)))).length)return(0,ms._n)("The deleted block allows instance overrides. Removing it may result in content not displaying where this pattern is used. Are you sure you want to proceed?","Some of the deleted blocks allow instance overrides. Removing them may result in content not displaying where this pattern is used. Are you sure you want to proceed?",e.length)}}];function ph(){const e=(0,c.useSelect)((e=>e(Wi).getCurrentPostType()),[]),t=(0,u.useMemo)((()=>uh.filter((t=>t.postTypes.includes(e)))),[e]);return ch&&t?(0,P.jsx)(ch,{rules:t}):null}function hh(){const{blockPatternsWithPostContentBlockType:e,postType:t}=(0,c.useSelect)((e=>{const{getPatternsByBlockTypes:t,getBlocksByName:s}=e(m.store),{getCurrentPostType:o,getRenderingMode:n}=e(Wi);return{blockPatternsWithPostContentBlockType:t("core/post-content","post-only"===n()?"":s("core/post-content")?.[0]),postType:o()}}),[]);return(0,u.useMemo)((()=>e?.length?e.filter((e=>"page"===t&&!e.postTypes||Array.isArray(e.postTypes)&&e.postTypes.includes(t))):[]),[t,e])}function mh({blockPatterns:e,onChoosePattern:t}){const s=(0,p.useAsyncList)(e),{editEntityRecord:o}=(0,c.useDispatch)(d.store),{postType:n,postId:i}=(0,c.useSelect)((e=>{const{getCurrentPostType:t,getCurrentPostId:s}=e(Wi);return{postType:t(),postId:s()}}),[]);return(0,P.jsx)(m.__experimentalBlockPatternsList,{blockPatterns:e,shownPatterns:s,onClickPattern:(e,s)=>{o("postType",n,i,{blocks:s,content:({blocks:e=[]})=>(0,y.__unstableSerializeAndClean)(e)}),t()}})}function gh({onClose:e}){const t=hh();return t.length>0?(0,P.jsx)(Ao.Modal,{title:(0,ms.__)("Choose a pattern"),isFullScreen:!0,onRequestClose:e,children:(0,P.jsx)("div",{className:"editor-start-page-options__modal-content",children:(0,P.jsx)(mh,{blockPatterns:t,onChoosePattern:e})})}):null}function _h(){const[e,t]=(0,u.useState)(!1),s=(0,c.useSelect)((e=>{const{isEditedPostDirty:t,isEditedPostEmpty:s,getCurrentPostType:o}=e(Wi),n=e(Er).isModalActive("editor/preferences");return e(j.store).get("core","enableChoosePatternModal")&&!n&&!t()&&s()&&D!==o()}),[]);return!s||e?null:(0,P.jsx)(gh,{onClose:()=>t(!0)})}const fh=[{keyCombination:{modifier:"primary",character:"b"},description:(0,ms.__)("Make the selected text bold.")},{keyCombination:{modifier:"primary",character:"i"},description:(0,ms.__)("Make the selected text italic.")},{keyCombination:{modifier:"primary",character:"k"},description:(0,ms.__)("Convert the selected text into a link.")},{keyCombination:{modifier:"primaryShift",character:"k"},description:(0,ms.__)("Remove a link.")},{keyCombination:{character:"[["},description:(0,ms.__)("Insert a link to a post or page.")},{keyCombination:{modifier:"primary",character:"u"},description:(0,ms.__)("Underline the selected text.")},{keyCombination:{modifier:"access",character:"d"},description:(0,ms.__)("Strikethrough the selected text.")},{keyCombination:{modifier:"access",character:"x"},description:(0,ms.__)("Make the selected text inline code.")},{keyCombination:{modifier:"access",character:"0"},aliases:[{modifier:"access",character:"7"}],description:(0,ms.__)("Convert the current heading to a paragraph.")},{keyCombination:{modifier:"access",character:"1-6"},description:(0,ms.__)("Convert the current paragraph or heading to a heading of level 1 to 6.")},{keyCombination:{modifier:"primaryShift",character:"SPACE"},description:(0,ms.__)("Add non breaking space.")}];function bh({keyCombination:e,forceAriaLabel:t}){const s=e.modifier?ta.displayShortcutList[e.modifier](e.character):e.character,o=e.modifier?ta.shortcutAriaLabel[e.modifier](e.character):e.character;return(0,P.jsx)("kbd",{className:"editor-keyboard-shortcut-help-modal__shortcut-key-combination","aria-label":t||o,children:(Array.isArray(s)?s:[s]).map(((e,t)=>"+"===e?(0,P.jsx)(u.Fragment,{children:e},t):(0,P.jsx)("kbd",{className:"editor-keyboard-shortcut-help-modal__shortcut-key",children:e},t)))})}const yh=function({description:e,keyCombination:t,aliases:s=[],ariaLabel:o}){return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)("div",{className:"editor-keyboard-shortcut-help-modal__shortcut-description",children:e}),(0,P.jsxs)("div",{className:"editor-keyboard-shortcut-help-modal__shortcut-term",children:[(0,P.jsx)(bh,{keyCombination:t,forceAriaLabel:o}),s.map(((e,t)=>(0,P.jsx)(bh,{keyCombination:e,forceAriaLabel:o},t)))]})]})};const xh=function({name:e}){const{keyCombination:t,description:s,aliases:o}=(0,c.useSelect)((t=>{const{getShortcutKeyCombination:s,getShortcutDescription:o,getShortcutAliases:n}=t(nr.store);return{keyCombination:s(e),aliases:n(e),description:o(e)}}),[e]);return t?(0,P.jsx)(yh,{keyCombination:t,description:s,aliases:o}):null},vh="editor/keyboard-shortcut-help",wh=({shortcuts:e})=>(0,P.jsx)("ul",{className:"editor-keyboard-shortcut-help-modal__shortcut-list",role:"list",children:e.map(((e,t)=>(0,P.jsx)("li",{className:"editor-keyboard-shortcut-help-modal__shortcut",children:"string"==typeof e?(0,P.jsx)(xh,{name:e}):(0,P.jsx)(yh,{...e})},t)))}),Sh=({title:e,shortcuts:t,className:s})=>(0,P.jsxs)("section",{className:rr("editor-keyboard-shortcut-help-modal__section",s),children:[!!e&&(0,P.jsx)("h2",{className:"editor-keyboard-shortcut-help-modal__section-title",children:e}),(0,P.jsx)(wh,{shortcuts:t})]}),kh=({title:e,categoryName:t,additionalShortcuts:s=[]})=>{const o=(0,c.useSelect)((e=>e(nr.store).getCategoryShortcuts(t)),[t]);return(0,P.jsx)(Sh,{title:e,shortcuts:o.concat(s)})};const Ph=function(){const e=(0,c.useSelect)((e=>e(Er).isModalActive(vh)),[]),{openModal:t,closeModal:s}=(0,c.useDispatch)(Er),o=()=>{e?s():t(vh)};return(0,nr.useShortcut)("core/editor/keyboard-shortcuts",o),e?(0,P.jsxs)(Ao.Modal,{className:"editor-keyboard-shortcut-help-modal",title:(0,ms.__)("Keyboard shortcuts"),closeButtonLabel:(0,ms.__)("Close"),onRequestClose:o,children:[(0,P.jsx)(Sh,{className:"editor-keyboard-shortcut-help-modal__main-shortcuts",shortcuts:["core/editor/keyboard-shortcuts"]}),(0,P.jsx)(kh,{title:(0,ms.__)("Global shortcuts"),categoryName:"global"}),(0,P.jsx)(kh,{title:(0,ms.__)("Selection shortcuts"),categoryName:"selection"}),(0,P.jsx)(kh,{title:(0,ms.__)("Block shortcuts"),categoryName:"block",additionalShortcuts:[{keyCombination:{character:"/"},description:(0,ms.__)("Change the block type after adding a new paragraph."),ariaLabel:(0,ms.__)("Forward-slash")}]}),(0,P.jsx)(Sh,{title:(0,ms.__)("Text formatting"),shortcuts:fh}),(0,P.jsx)(kh,{title:(0,ms.__)("List View shortcuts"),categoryName:"list-view"})]}):null};function Ch({clientId:e,onClose:t}){const{entity:s,onNavigateToEntityRecord:o,canEditTemplates:n}=(0,c.useSelect)((t=>{const{getBlockEditingMode:s,getBlockParentsByBlockName:o,getSettings:n,getBlockAttributes:i}=t(m.store);if(!("contentOnly"===s(e)))return{};const r=o(e,"core/block",!0)[0];let a;if(r)a=t(d.store).getEntityRecord("postType","wp_block",i(r).ref);else{const{getCurrentTemplateId:s,getRenderingMode:o}=t(Wi),n=s(),{getContentLockingParent:i}=Xo(t(m.store));"template-locked"===o()&&!i(e)&&n&&(a=t(d.store).getEntityRecord("postType","wp_template",n))}return{canEditTemplates:t(d.store).canUser("create",{kind:"postType",name:"wp_template"}),entity:a,onNavigateToEntityRecord:n().onNavigateToEntityRecord}}),[e]);if(!s)return(0,P.jsx)(jh,{clientId:e,onClose:t});const i="wp_block"===s.type;let r=i?(0,ms.__)("Edit the pattern to move, delete, or make further changes to this block."):(0,ms.__)("Edit the template to move, delete, or make further changes to this block.");return n||(r=(0,ms.__)("Only users with permissions to edit the template can move or delete this block")),(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(m.__unstableBlockSettingsMenuFirstItem,{children:(0,P.jsx)(Ao.MenuItem,{onClick:()=>{o({postId:s.id,postType:s.type})},disabled:!n,children:i?(0,ms.__)("Edit pattern"):(0,ms.__)("Edit template")})}),(0,P.jsx)(Ao.__experimentalText,{variant:"muted",as:"p",className:"editor-content-only-settings-menu__description",children:r})]})}function jh({clientId:e,onClose:t}){const{contentLockingParent:s}=(0,c.useSelect)((t=>{const{getContentLockingParent:s}=Xo(t(m.store));return{contentLockingParent:s(e)}}),[e]),o=(0,m.useBlockDisplayInformation)(s),n=(0,c.useDispatch)(m.store);if(!o?.title)return null;const{modifyContentLockBlock:i}=Xo(n);return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(m.__unstableBlockSettingsMenuFirstItem,{children:(0,P.jsx)(Ao.MenuItem,{onClick:()=>{i(s),t()},children:(0,ms._x)("Unlock","Unlock content locked blocks")})}),(0,P.jsx)(Ao.__experimentalText,{variant:"muted",as:"p",className:"editor-content-only-settings-menu__description",children:(0,ms.__)("Temporarily unlock the parent block to edit, delete or make further changes to this block.")})]})}function Eh(){return(0,P.jsx)(m.BlockSettingsMenuControls,{children:({selectedClientIds:e,onClose:t})=>1===e.length&&(0,P.jsx)(Ch,{clientId:e[0],onClose:t})})}function Th(e){const{slug:t,patterns:s}=(0,c.useSelect)((e=>{const{getCurrentPostType:t,getCurrentPostId:s}=e(Wi),{getEntityRecord:o,getBlockPatterns:n}=e(d.store),i=s();return{slug:o("postType",t(),i).slug,patterns:n()}}),[]),o=(0,c.useSelect)((e=>e(d.store).getCurrentTheme().stylesheet));return(0,u.useMemo)((()=>[{name:"fallback",blocks:(0,y.parse)(e),title:(0,ms.__)("Fallback content")},...s.filter((e=>Array.isArray(e.templateTypes)&&e.templateTypes.some((e=>t.startsWith(e))))).map((e=>({...e,blocks:(0,y.parse)(e.content).map((e=>function(e){return e.innerBlocks.find((e=>"core/template-part"===e.name))&&(e.innerBlocks=e.innerBlocks.map((e=>("core/template-part"===e.name&&void 0===e.attributes.theme&&(e.attributes.theme=o),e)))),"core/template-part"===e.name&&void 0===e.attributes.theme&&(e.attributes.theme=o),e}(e)))})))]),[e,t,s])}function Bh({fallbackContent:e,onChoosePattern:t,postType:s}){const[,,o]=(0,d.useEntityBlockEditor)("postType",s),n=Th(e),i=(0,p.useAsyncList)(n);return(0,P.jsx)(m.__experimentalBlockPatternsList,{blockPatterns:n,shownPatterns:i,onClickPattern:(e,s)=>{o(s,{selection:void 0}),t()}})}function Ih({slug:e,isCustom:t,onClose:s,postType:o}){const n=function(e,t=!1){return(0,c.useSelect)((s=>{const{getEntityRecord:o,getDefaultTemplateId:n}=s(d.store),i=n({slug:e,is_custom:t,ignore_empty:!0});return i?o("postType",D,i)?.content?.raw:void 0}),[e,t])}(e,t);return n?(0,P.jsxs)(Ao.Modal,{className:"editor-start-template-options__modal",title:(0,ms.__)("Choose a pattern"),closeLabel:(0,ms.__)("Cancel"),focusOnMount:"firstElement",onRequestClose:s,isFullScreen:!0,children:[(0,P.jsx)("div",{className:"editor-start-template-options__modal-content",children:(0,P.jsx)(Bh,{fallbackContent:n,slug:e,isCustom:t,postType:o,onChoosePattern:()=>{s()}})}),(0,P.jsx)(Ao.Flex,{className:"editor-start-template-options__modal__actions",justify:"flex-end",expanded:!1,children:(0,P.jsx)(Ao.FlexItem,{children:(0,P.jsx)(Ao.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:s,children:(0,ms.__)("Skip")})})})]}):null}function Nh(){const[e,t]=(0,u.useState)(!1),{shouldOpenModal:s,slug:o,isCustom:n,postType:i,postId:r}=(0,c.useSelect)((e=>{const{getCurrentPostType:t,getCurrentPostId:s}=e(Wi),o=t(),n=s(),{getEditedEntityRecord:i,hasEditsForEntityRecord:r}=e(d.store),a=i("postType",o,n);return{shouldOpenModal:!r("postType",o,n)&&""===a.content&&D===o,slug:a.slug,isCustom:a.is_custom,postType:o,postId:n}}),[]);return(0,u.useEffect)((()=>{t(!1)}),[i,r]),!s||e?null:(0,P.jsx)(Ih,{slug:o,isCustom:n,postType:i,onClose:()=>t(!0)})}function Ah({clientId:e,onClose:t}){const{getBlocks:s}=(0,c.useSelect)(m.store),{replaceBlocks:o}=(0,c.useDispatch)(m.store);return(0,c.useSelect)((t=>t(m.store).canRemoveBlock(e)),[e])?(0,P.jsx)(Ao.MenuItem,{onClick:()=>{o(e,s(e)),t()},children:(0,ms.__)("Detach")}):null}function Dh({clientIds:e,blocks:t}){const[s,o]=(0,u.useState)(!1),{replaceBlocks:n}=(0,c.useDispatch)(m.store),{createSuccessNotice:i}=(0,c.useDispatch)(hs.store),{canCreate:r}=(0,c.useSelect)((e=>({canCreate:e(m.store).canInsertBlockType("core/template-part")})),[]);if(!r)return null;return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(Ao.MenuItem,{icon:G,onClick:()=>{o(!0)},"aria-expanded":s,"aria-haspopup":"dialog",children:(0,ms.__)("Create template part")}),s&&(0,P.jsx)(Uo,{closeModal:()=>{o(!1)},blocks:t,onCreate:async t=>{n(e,(0,y.createBlock)("core/template-part",{slug:t.slug,theme:t.theme})),i((0,ms.__)("Template part created."),{type:"snackbar"})}})]})}function Rh(){return(0,P.jsx)(m.BlockSettingsMenuControls,{children:({selectedClientIds:e,onClose:t})=>(0,P.jsx)(Mh,{clientIds:e,onClose:t})})}function Mh({clientIds:e,onClose:t}){const{isContentOnly:s,blocks:o}=(0,c.useSelect)((t=>{const{getBlocksByClientId:s,getBlockEditingMode:o}=t(m.store);return{blocks:s(e),isContentOnly:1===e.length&&"contentOnly"===o(e[0])}}),[e]);return s?null:1===o.length&&"core/template-part"===o[0]?.name?(0,P.jsx)(Ah,{clientId:e[0],onClose:t}):(0,P.jsx)(Dh,{clientIds:e,blocks:o})}const{ExperimentalBlockEditorProvider:Oh}=Xo(m.privateApis),{PatternsMenuItems:Lh}=Xo(nn.privateApis),Fh=()=>{},Vh=["wp_block","wp_navigation","wp_template_part"];const zh=bp((({post:e,settings:t,recovery:s,initialEdits:o,children:n,BlockEditorProviderComponent:i=Oh,__unstableTemplate:r})=>{const{editorSettings:a,selection:l,isReady:p,mode:g,postTypeEntities:_}=(0,c.useSelect)((t=>{const{getEditorSettings:s,getEditorSelection:o,getRenderingMode:n,__unstableIsEditorReady:i}=t(Wi),{getEntitiesConfig:r}=t(d.store);return{editorSettings:s(),isReady:i(),mode:n(),selection:o(),postTypeEntities:"wp_template"===e.type?r("postType"):null}}),[e.type]),f=(0,c.useSelect)((e=>{const{__unstableGetEditorMode:t}=Xo(e(m.store));return"zoom-out"===t()})),b=!!r&&"post-only"!==g,x=b?r:e,v=(0,u.useMemo)((()=>{const t={};if("wp_template"===e.type){if("page"===e.slug)t.postType="page";else if("single"===e.slug)t.postType="post";else if("single"===e.slug.split("-")[0]){const s=_?.map((e=>e.name))||[],o=e.slug.match(`^single-(${s.join("|")})(?:-.+)?$`);o&&(t.postType=o[1])}}else Vh.includes(x.type)&&!b||(t.postId=e.id,t.postType=e.type);return{...t,templateSlug:"wp_template"===x.type?x.slug:void 0}}),[b,e.id,e.type,e.slug,x.type,x.slug,_]),{id:w,type:S}=x,k=Up(a,S,w,g),[C,j,E]=function(e,t,s){const o="post-only"!==s&&t?"template":"post",[n,i,r]=(0,d.useEntityBlockEditor)("postType",e.type,{id:e.id}),[a,l,c]=(0,d.useEntityBlockEditor)("postType",t?.type,{id:t?.id}),p=(0,u.useMemo)((()=>{if("wp_navigation"===e.type)return[(0,y.createBlock)("core/navigation",{ref:e.id,templateLock:!1})]}),[e.type,e.id]),h=(0,u.useMemo)((()=>p||("template"===o?a:n)),[p,o,a,n]);return t&&"template-locked"===s||"wp_navigation"===e.type?[h,Fh,Fh]:[h,"post"===o?i:l,"post"===o?r:c]}(e,r,g),{updatePostLock:T,setupEditor:B,updateEditorSettings:I,setCurrentTemplateId:N,setEditedPost:A,setRenderingMode:D}=Xo((0,c.useDispatch)(Wi)),{createWarningNotice:R}=(0,c.useDispatch)(hs.store);return(0,u.useLayoutEffect)((()=>{s||(T(t.postLock),B(e,o,t.template),t.autosave&&R((0,ms.__)("There is an autosave of this post that is more recent than the version below."),{id:"autosave-exists",actions:[{label:(0,ms.__)("View the autosave"),url:t.autosave.editLink}]}))}),[]),(0,u.useEffect)((()=>{A(e.type,e.id)}),[e.type,e.id,A]),(0,u.useEffect)((()=>{I(t)}),[t,I]),(0,u.useEffect)((()=>{N(r?.id)}),[r?.id,N]),(0,u.useEffect)((()=>{var e;D(null!==(e=t.defaultRenderingMode)&&void 0!==e?e:"post-only")}),[t.defaultRenderingMode,D]),function(e,t){(0,u.useEffect)((()=>((0,h.addFilter)("blockEditor.__unstableCanInsertBlockType","removeTemplatePartsFromInserter",((s,o)=>!(!Wp.includes(e)&&"core/template-part"===o.name&&"post-only"===t)&&s)),(0,h.addFilter)("blockEditor.__unstableCanInsertBlockType","removePostContentFromInserter",((t,s,o,{getBlockParentsByBlockName:n})=>Wp.includes(e)||"core/post-content"!==s.name?t:n(o,"core/query").length>0)),()=>{(0,h.removeFilter)("blockEditor.__unstableCanInsertBlockType","removeTemplatePartsFromInserter"),(0,h.removeFilter)("blockEditor.__unstableCanInsertBlockType","removePostContentFromInserter")})),[e,t])}(e.type,g),(0,sa.useCommandLoader)({name:"core/editor/edit-ui",hook:ah}),(0,sa.useCommandLoader)({name:"core/editor/contextual-commands",hook:lh,context:"entity-edit"}),p?(0,P.jsx)(d.EntityProvider,{kind:"root",type:"site",children:(0,P.jsx)(d.EntityProvider,{kind:"postType",type:e.type,id:e.id,children:(0,P.jsx)(m.BlockContextProvider,{value:v,children:(0,P.jsxs)(i,{value:C,onChange:E,onInput:j,selection:l,settings:k,useSubRegistry:!1,children:[n,!t.__unstableIsPreviewMode&&(0,P.jsxs)(P.Fragment,{children:[!f&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(Lh,{}),(0,P.jsx)(Rh,{}),(0,P.jsx)(Eh,{})]}),"template-locked"===g&&(0,P.jsx)(Gp,{}),"wp_navigation"===S&&(0,P.jsx)($p,{}),(0,P.jsx)(qr,{}),(0,P.jsx)(Ph,{}),(0,P.jsx)(ph,{}),(0,P.jsx)(_h,{}),(0,P.jsx)(Nh,{}),(0,P.jsx)(oh,{}),(0,P.jsx)(rh,{})]})]})})})}):null}));const Uh=function(e){return(0,P.jsx)(zh,{...e,BlockEditorProviderComponent:m.BlockEditorProvider,children:e.children})},Hh=window.wp.serverSideRender;var Gh=s.n(Hh);function $h(e,t,s=[]){const o=(0,u.forwardRef)(((s,o)=>(S()("wp.editor."+e,{since:"5.3",alternative:"wp.blockEditor."+e,version:"6.2"}),(0,P.jsx)(t,{ref:o,...s}))));return s.forEach((s=>{o[s]=$h(e+"."+s,t[s])})),o}function Wh(e,t){return(...s)=>(S()("wp.editor."+e,{since:"5.3",alternative:"wp.blockEditor."+e,version:"6.2"}),t(...s))}const Zh=$h("RichText",m.RichText,["Content"]);Zh.isEmpty=Wh("RichText.isEmpty",m.RichText.isEmpty);const Yh=$h("Autocomplete",m.Autocomplete),Kh=$h("AlignmentToolbar",m.AlignmentToolbar),qh=$h("BlockAlignmentToolbar",m.BlockAlignmentToolbar),Qh=$h("BlockControls",m.BlockControls,["Slot"]),Xh=$h("BlockEdit",m.BlockEdit),Jh=$h("BlockEditorKeyboardShortcuts",m.BlockEditorKeyboardShortcuts),em=$h("BlockFormatControls",m.BlockFormatControls,["Slot"]),tm=$h("BlockIcon",m.BlockIcon),sm=$h("BlockInspector",m.BlockInspector),om=$h("BlockList",m.BlockList),nm=$h("BlockMover",m.BlockMover),im=$h("BlockNavigationDropdown",m.BlockNavigationDropdown),rm=$h("BlockSelectionClearer",m.BlockSelectionClearer),am=$h("BlockSettingsMenu",m.BlockSettingsMenu),lm=$h("BlockTitle",m.BlockTitle),cm=$h("BlockToolbar",m.BlockToolbar),dm=$h("ColorPalette",m.ColorPalette),um=$h("ContrastChecker",m.ContrastChecker),pm=$h("CopyHandler",m.CopyHandler),hm=$h("DefaultBlockAppender",m.DefaultBlockAppender),mm=$h("FontSizePicker",m.FontSizePicker),gm=$h("Inserter",m.Inserter),_m=$h("InnerBlocks",m.InnerBlocks,["ButtonBlockAppender","DefaultBlockAppender","Content"]),fm=$h("InspectorAdvancedControls",m.InspectorAdvancedControls,["Slot"]),bm=$h("InspectorControls",m.InspectorControls,["Slot"]),ym=$h("PanelColorSettings",m.PanelColorSettings),xm=$h("PlainText",m.PlainText),vm=$h("RichTextShortcut",m.RichTextShortcut),wm=$h("RichTextToolbarButton",m.RichTextToolbarButton),Sm=$h("__unstableRichTextInputEvent",m.__unstableRichTextInputEvent),km=$h("MediaPlaceholder",m.MediaPlaceholder),Pm=$h("MediaUpload",m.MediaUpload),Cm=$h("MediaUploadCheck",m.MediaUploadCheck),jm=$h("MultiSelectScrollIntoView",m.MultiSelectScrollIntoView),Em=$h("NavigableToolbar",m.NavigableToolbar),Tm=$h("ObserveTyping",m.ObserveTyping),Bm=$h("SkipToSelectedBlock",m.SkipToSelectedBlock),Im=$h("URLInput",m.URLInput),Nm=$h("URLInputButton",m.URLInputButton),Am=$h("URLPopover",m.URLPopover),Dm=$h("Warning",m.Warning),Rm=$h("WritingFlow",m.WritingFlow),Mm=Wh("createCustomColorsHOC",m.createCustomColorsHOC),Om=Wh("getColorClassName",m.getColorClassName),Lm=Wh("getColorObjectByAttributeValues",m.getColorObjectByAttributeValues),Fm=Wh("getColorObjectByColorValue",m.getColorObjectByColorValue),Vm=Wh("getFontSize",m.getFontSize),zm=Wh("getFontSizeClass",m.getFontSizeClass),Um=Wh("withColorContext",m.withColorContext),Hm=Wh("withColors",m.withColors),Gm=Wh("withFontSizes",m.withFontSizes),$m=qr,Wm=qr;function Zm(e){return S()("wp.editor.cleanForSlug",{since:"12.7",plugin:"Gutenberg",alternative:"wp.url.cleanForSlug"}),(0,v.cleanForSlug)(e)}const{createPrivateSlotFill:Ym}=Xo(Ao.privateApis),Km=Ym("EditCanvasContainerSlot"),qm="__experimentalMainDashboardButton",{Fill:Qm,Slot:Xm}=(0,Ao.createSlotFill)(qm),Jm=Qm;Jm.Slot=()=>{const e=(0,Ao.__experimentalUseSlotFills)(qm);return(0,P.jsx)(Xm,{bubblesVirtually:!0,fillProps:{length:e?e.length:0}})};const eg=Jm,tg=(0,P.jsx)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,P.jsx)(k.Path,{d:"M6.6 6L5.4 7l4.5 5-4.5 5 1.1 1 5.5-6-5.4-6zm6 0l-1.1 1 4.5 5-4.5 5 1.1 1 5.5-6-5.5-6z"})}),sg=(0,P.jsx)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,P.jsx)(k.Path,{d:"M11.6 7l-1.1-1L5 12l5.5 6 1.1-1L7 12l4.6-5zm6 0l-1.1-1-5.5 6 5.5 6 1.1-1-4.6-5 4.6-5z"})}),{useHasBlockToolbar:og}=Xo(m.privateApis);function ng({isCollapsed:e,onToggle:t}){const{blockSelectionStart:s}=(0,c.useSelect)((e=>({blockSelectionStart:e(m.store).getBlockSelectionStart()})),[]),o=og(),n=!!s;return(0,u.useEffect)((()=>{s&&t(!1)}),[s,t]),o?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)("div",{className:rr("editor-collapsible-block-toolbar",{"is-collapsed":e||!n}),children:(0,P.jsx)(m.BlockToolbar,{hideDragHandle:!0})}),(0,P.jsx)(Ao.Popover.Slot,{name:"block-toolbar"}),(0,P.jsx)(Ao.Button,{className:"editor-collapsible-block-toolbar__toggle",icon:e?tg:sg,onClick:()=>{t(!e)},label:e?(0,ms.__)("Show block tools"):(0,ms.__)("Hide block tools"),size:"compact"})]}):null}const ig=(0,P.jsx)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,P.jsx)(k.Path,{d:"M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z"})});const rg=function({className:e,disableBlockTools:t=!1}){const{setIsInserterOpened:s,setIsListViewOpened:o}=(0,c.useDispatch)(Wi),{isDistractionFree:n,isInserterOpened:i,isListViewOpen:r,listViewShortcut:a,inserterSidebarToggleRef:l,listViewToggleRef:d,hasFixedToolbar:h,showIconLabels:g}=(0,c.useSelect)((e=>{const{getSettings:t}=e(m.store),{get:s}=e(j.store),{isListViewOpened:o,getEditorMode:n,getInserterSidebarToggleRef:i,getListViewToggleRef:r}=Xo(e(Wi)),{getShortcutRepresentation:a}=e(nr.store),{__unstableGetEditorMode:l}=e(m.store);return{isInserterOpened:e(Wi).isInserterOpened(),isListViewOpen:o(),listViewShortcut:a("core/editor/toggle-list-view"),inserterSidebarToggleRef:i(),listViewToggleRef:r(),hasFixedToolbar:t().hasFixedToolbar,showIconLabels:s("core","showIconLabels"),isDistractionFree:s("core","distractionFree"),isVisualMode:"visual"===n(),isZoomedOutView:"zoom-out"===l()}}),[]),_=(0,p.useViewportMatch)("medium"),f=(0,p.useViewportMatch)("wide"),b=(0,ms.__)("Document tools"),y=(0,u.useCallback)((()=>o(!r)),[o,r]),x=(0,u.useCallback)((()=>s(!i)),[i,s]),v=(0,ms._x)("Toggle block inserter","Generic label for block inserter button"),w=i?(0,ms.__)("Close"):(0,ms.__)("Add");return(0,P.jsx)(m.NavigableToolbar,{className:rr("editor-document-tools","edit-post-header-toolbar",e),"aria-label":b,variant:"unstyled",children:(0,P.jsxs)("div",{className:"editor-document-tools__left",children:[!n&&(0,P.jsx)(Ao.ToolbarItem,{ref:l,as:Ao.Button,className:"editor-document-tools__inserter-toggle",variant:"primary",isPressed:i,onMouseDown:e=>{i&&e.preventDefault()},onClick:x,disabled:t,icon:ig,label:g?w:v,showTooltip:!g,"aria-expanded":i}),(f||!g)&&(0,P.jsxs)(P.Fragment,{children:[_&&!h&&(0,P.jsx)(Ao.ToolbarItem,{as:m.ToolSelector,showTooltip:!g,variant:g?"tertiary":void 0,disabled:t,size:"compact"}),(0,P.jsx)(Ao.ToolbarItem,{as:xa,showTooltip:!g,variant:g?"tertiary":void 0,size:"compact"}),(0,P.jsx)(Ao.ToolbarItem,{as:ya,showTooltip:!g,variant:g?"tertiary":void 0,size:"compact"}),!n&&(0,P.jsx)(Ao.ToolbarItem,{as:Ao.Button,className:"editor-document-tools__document-overview-toggle",icon:Yp,disabled:t,isPressed:r,label:(0,ms.__)("Document Overview"),onClick:y,shortcut:a,showTooltip:!g,variant:g?"tertiary":void 0,"aria-expanded":r,ref:d,size:"compact"})]})]})})},ag=(0,P.jsx)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,P.jsx)(k.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"})});function lg(){const{createNotice:e}=(0,c.useDispatch)(hs.store),{getCurrentPostId:t,getCurrentPostType:s}=(0,c.useSelect)(Wi),{getEditedEntityRecord:o}=(0,c.useSelect)(d.store);const n=(0,p.useCopyToClipboard)((function(){const e=o("postType",s(),t());return e?"function"==typeof e.content?e.content(e):e.blocks?(0,y.__unstableSerializeAndClean)(e.blocks):e.content?e.content:void 0:""}),(function(){e("info",(0,ms.__)("All content copied."),{isDismissible:!0,type:"snackbar"})}));return(0,P.jsx)(Ao.MenuItem,{ref:n,children:(0,ms.__)("Copy all blocks")})}const cg=[{value:"visual",label:(0,ms.__)("Visual editor")},{value:"text",label:(0,ms.__)("Code editor")}];const dg=function(){const{shortcut:e,isRichEditingEnabled:t,isCodeEditingEnabled:s,mode:o}=(0,c.useSelect)((e=>({shortcut:e(nr.store).getShortcutRepresentation("core/editor/toggle-mode"),isRichEditingEnabled:e(Wi).getEditorSettings().richEditingEnabled,isCodeEditingEnabled:e(Wi).getEditorSettings().codeEditingEnabled,mode:e(Wi).getEditorMode()})),[]),{switchEditorMode:n}=(0,c.useDispatch)(Wi);let i=o;t||"visual"!==o||(i="text"),s||"text"!==o||(i="visual");const r=cg.map((o=>(s||"text"!==o.value||(o={...o,disabled:!0}),t||"visual"!==o.value||(o={...o,disabled:!0,info:(0,ms.__)("You can enable the visual editor in your profile settings.")}),o.value===i||o.disabled?o:{...o,shortcut:e})));return(0,P.jsx)(Ao.MenuGroup,{label:(0,ms.__)("Editor"),children:(0,P.jsx)(Ao.MenuItemsChoice,{choices:r,value:i,onSelect:n})})},{Fill:ug,Slot:pg}=(0,Ao.createSlotFill)("ToolsMoreMenuGroup");ug.Slot=({fillProps:e})=>(0,P.jsx)(pg,{fillProps:e});const hg=ug,{Fill:mg,Slot:gg}=(0,Ao.createSlotFill)("web"===u.Platform.OS?Symbol("ViewMoreMenuGroup"):"ViewMoreMenuGroup");mg.Slot=({fillProps:e})=>(0,P.jsx)(gg,{fillProps:e});const _g=mg;function fg(){const{openModal:e}=(0,c.useDispatch)(Er),{set:t}=(0,c.useDispatch)(j.store),{toggleDistractionFree:s}=(0,c.useDispatch)(Wi),o=(0,c.useSelect)((e=>e(j.store).get("core","showIconLabels")),[]),n=()=>{t("core","distractionFree",!1)};return(0,P.jsx)(P.Fragment,{children:(0,P.jsx)(Ao.DropdownMenu,{icon:ag,label:(0,ms.__)("Options"),popoverProps:{placement:"bottom-end",className:"more-menu-dropdown__content"},toggleProps:{showTooltip:!o,...o&&{variant:"tertiary"},tooltipPosition:"bottom",size:"compact"},children:({onClose:t})=>(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(Ao.MenuGroup,{label:(0,ms._x)("View","noun"),children:[(0,P.jsx)(j.PreferenceToggleMenuItem,{scope:"core",name:"fixedToolbar",onToggle:n,label:(0,ms.__)("Top toolbar"),info:(0,ms.__)("Access all block and document tools in a single place"),messageActivated:(0,ms.__)("Top toolbar activated"),messageDeactivated:(0,ms.__)("Top toolbar deactivated")}),(0,P.jsx)(j.PreferenceToggleMenuItem,{scope:"core",name:"distractionFree",label:(0,ms.__)("Distraction free"),info:(0,ms.__)("Write with calmness"),handleToggling:!1,onToggle:s,messageActivated:(0,ms.__)("Distraction free mode activated"),messageDeactivated:(0,ms.__)("Distraction free mode deactivated"),shortcut:ta.displayShortcut.primaryShift("\\")}),(0,P.jsx)(j.PreferenceToggleMenuItem,{scope:"core",name:"focusMode",label:(0,ms.__)("Spotlight mode"),info:(0,ms.__)("Focus on one block at a time"),messageActivated:(0,ms.__)("Spotlight mode activated"),messageDeactivated:(0,ms.__)("Spotlight mode deactivated")}),(0,P.jsx)(_g.Slot,{fillProps:{onClose:t}})]}),(0,P.jsx)(dg,{}),(0,P.jsx)(Rr.Slot,{name:"core/plugin-more-menu",label:(0,ms.__)("Plugins"),as:Ao.MenuGroup,fillProps:{onClick:t}}),(0,P.jsxs)(Ao.MenuGroup,{label:(0,ms.__)("Tools"),children:[(0,P.jsx)(Ao.MenuItem,{onClick:()=>e("editor/keyboard-shortcut-help"),shortcut:ta.displayShortcut.access("h"),children:(0,ms.__)("Keyboard shortcuts")}),(0,P.jsx)(lg,{}),(0,P.jsxs)(Ao.MenuItem,{icon:dn,href:(0,ms.__)("https://wordpress.org/documentation/article/wordpress-block-editor/"),target:"_blank",rel:"noopener noreferrer",children:[(0,ms.__)("Help"),(0,P.jsx)(Ao.VisuallyHidden,{as:"span",children:(0,ms.__)("(opens in a new tab)")})]}),(0,P.jsx)(hg.Slot,{fillProps:{onClose:t}})]}),(0,P.jsx)(Ao.MenuGroup,{children:(0,P.jsx)(Ao.MenuItem,{onClick:()=>e("editor/preferences"),children:(0,ms.__)("Preferences")})})]})})})}const bg=(0,p.compose)((0,c.withSelect)((e=>{var t;return{hasPublishAction:null!==(t=e(Wi).getCurrentPost()?._links?.["wp:action-publish"])&&void 0!==t&&t,isBeingScheduled:e(Wi).isEditedPostBeingScheduled(),isPending:e(Wi).isCurrentPostPending(),isPublished:e(Wi).isCurrentPostPublished(),isPublishSidebarEnabled:e(Wi).isPublishSidebarEnabled(),isPublishSidebarOpened:e(Wi).isPublishSidebarOpened(),isScheduled:e(Wi).isCurrentPostScheduled(),postStatus:e(Wi).getEditedPostAttribute("status"),postStatusHasChanged:e(Wi).getPostEdits()?.status}})),(0,c.withDispatch)((e=>{const{togglePublishSidebar:t}=e(Wi);return{togglePublishSidebar:t}})))((function({forceIsDirty:e,hasPublishAction:t,isBeingScheduled:s,isPending:o,isPublished:n,isPublishSidebarEnabled:i,isPublishSidebarOpened:r,isScheduled:a,togglePublishSidebar:l,setEntitiesSavedStatesCallback:c,postStatusHasChanged:d,postStatus:u}){const h="toggle",m="button",g=(0,p.useViewportMatch)("medium","<");let _;return _=n||d&&!["future","publish"].includes(u)||a&&s||o&&!t&&!g?m:g||i?h:m,(0,P.jsx)(ed,{forceIsDirty:e,isOpen:r,isToggle:_===h,onToggle:l,setEntitiesSavedStatesCallback:c})}));function yg(){const{hasLoaded:e,permalink:t,isPublished:s,label:o,showIconLabels:n}=(0,c.useSelect)((e=>{const t=e(Wi).getCurrentPostType(),s=e(d.store).getPostType(t),{get:o}=e(j.store);return{permalink:e(Wi).getPermalink(),isPublished:e(Wi).isCurrentPostPublished(),label:s?.labels.view_item,hasLoaded:!!s,showIconLabels:o("core","showIconLabels")}}),[]);return s&&t&&e?(0,P.jsx)(Ao.Button,{icon:dn,label:o||(0,ms.__)("View post"),href:t,target:"_blank",showTooltip:!n,size:"compact"}):null}const xg=(0,P.jsx)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,P.jsx)(k.Path,{d:"M20.5 16h-.7V8c0-1.1-.9-2-2-2H6.2c-1.1 0-2 .9-2 2v8h-.7c-.8 0-1.5.7-1.5 1.5h20c0-.8-.7-1.5-1.5-1.5zM5.7 8c0-.3.2-.5.5-.5h11.6c.3 0 .5.2.5.5v7.6H5.7V8z"})}),vg=(0,P.jsx)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,P.jsx)(k.Path,{d:"M15 4H9c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h6c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H9c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h6c.3 0 .5.2.5.5v12zm-4.5-.5h2V16h-2v1.5z"})}),wg=(0,P.jsx)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,P.jsx)(k.Path,{d:"M17 4H7c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H7c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h10c.3 0 .5.2.5.5v12zm-7.5-.5h4V16h-4v1.5z"})});function Sg({forceIsAutosaveable:e,disabled:t}){const{deviceType:s,homeUrl:o,isTemplate:n,isViewable:i,showIconLabels:r}=(0,c.useSelect)((e=>{var t;const{getDeviceType:s,getCurrentPostType:o}=e(Wi),{getEntityRecord:n,getPostType:i}=e(d.store),{get:r}=e(j.store),a=o();return{deviceType:s(),homeUrl:n("root","__unstableBase")?.home,isTemplate:"wp_template"===a,isViewable:null!==(t=i(a)?.viewable)&&void 0!==t&&t,showIconLabels:r("core","showIconLabels")}}),[]),{setDeviceType:a}=(0,c.useDispatch)(Wi),{__unstableSetEditorMode:l}=(0,c.useDispatch)(m.store),{resetZoomLevel:u}=Xo((0,c.useDispatch)(m.store)),h=e=>{a(e),l("edit"),u()};if((0,p.useViewportMatch)("medium","<"))return null;const g={className:"editor-preview-dropdown__toggle",iconPosition:"right",size:"compact",showTooltip:!r,disabled:t,accessibleWhenDisabled:t},_={"aria-label":(0,ms.__)("View options")},f={desktop:xg,mobile:vg,tablet:wg},b=[{value:"Desktop",label:(0,ms.__)("Desktop"),icon:xg},{value:"Tablet",label:(0,ms.__)("Tablet"),icon:wg},{value:"Mobile",label:(0,ms.__)("Mobile"),icon:vg}];return(0,P.jsx)(Ao.DropdownMenu,{className:rr("editor-preview-dropdown",`editor-preview-dropdown--${s.toLowerCase()}`),popoverProps:{placement:"bottom-end"},toggleProps:g,menuProps:_,icon:f[s.toLowerCase()],label:(0,ms.__)("View"),disableOpenOnArrowDown:t,children:({onClose:t})=>(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(Ao.MenuGroup,{children:(0,P.jsx)(Ao.MenuItemsChoice,{choices:b,value:s,onSelect:h})}),n&&(0,P.jsx)(Ao.MenuGroup,{children:(0,P.jsxs)(Ao.MenuItem,{href:o,target:"_blank",icon:dn,onClick:t,children:[(0,ms.__)("View site"),(0,P.jsx)(Ao.VisuallyHidden,{as:"span",children:(0,ms.__)("(opens in a new tab)")})]})}),i&&(0,P.jsx)(Ao.MenuGroup,{children:(0,P.jsx)(qc,{className:"editor-preview-dropdown__button-external",role:"menuitem",forceIsAutosaveable:e,"aria-label":(0,ms.__)("Preview in new tab"),textContent:(0,P.jsxs)(P.Fragment,{children:[(0,ms.__)("Preview in new tab"),(0,P.jsx)(Ao.Icon,{icon:dn})]}),onPreview:t})}),(0,P.jsx)(Rr.Slot,{name:"core/plugin-preview-menu",as:Ao.MenuGroup,fillProps:{onClick:t}})]})})}const kg=(0,P.jsx)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",children:(0,P.jsx)(k.Path,{fill:"none",d:"M5.75 12.75V18.25H11.25M12.75 5.75H18.25V11.25",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"square"})}),Pg=({disabled:e})=>{const{isZoomOut:t,showIconLabels:s}=(0,c.useSelect)((e=>({isZoomOut:Xo(e(m.store)).isZoomOut(),showIconLabels:e(j.store).get("core","showIconLabels")}))),{resetZoomLevel:o,setZoomLevel:n,__unstableSetEditorMode:i}=Xo((0,c.useDispatch)(m.store));return(0,P.jsx)(Ao.Button,{accessibleWhenDisabled:!0,disabled:e,onClick:()=>{t?o():n(50),i(t?"edit":"zoom-out")},icon:kg,label:(0,ms.__)("Zoom Out"),isPressed:t,size:"compact",showTooltip:!s})},Cg={distractionFreeDisabled:{y:"-50px"},distractionFreeHover:{y:0},distractionFreeHidden:{y:"-50px"},visible:{y:0},hidden:{y:0}},jg={distractionFreeDisabled:{x:"-100%"},distractionFreeHover:{x:0},distractionFreeHidden:{x:"-100%"},visible:{x:0},hidden:{x:0}};const Eg=function({customSaveButton:e,forceIsDirty:t,forceDisableBlockTools:s,setEntitiesSavedStatesCallback:o,title:n,isEditorIframed:i}){const r=(0,p.useViewportMatch)("large"),a=(0,p.useViewportMatch)("medium"),l=(0,p.useMediaQuery)("(max-width: 403px)"),{isTextEditor:d,isPublishSidebarOpened:h,showIconLabels:g,hasFixedToolbar:_,hasBlockSelection:f,isNestedEntity:b}=(0,c.useSelect)((e=>{const{get:t}=e(j.store),{getEditorMode:s,getEditorSettings:o,isPublishSidebarOpened:n}=e(Wi),{__unstableGetEditorMode:i}=e(m.store);return{isTextEditor:"text"===s(),isPublishSidebarOpened:n(),showIconLabels:t("core","showIconLabels"),hasFixedToolbar:t("core","fixedToolbar"),hasBlockSelection:!!e(m.store).getBlockSelectionStart(),isNestedEntity:!!o().onNavigateToPreviousEntityRecord,isZoomedOutView:"zoom-out"===i()}}),[]),[y,x]=(0,u.useState)(!0),v=(!f||y)&&!l,w=(()=>{const e=(0,Ao.__experimentalUseSlotFills)(qm);return Boolean(e&&e.length)})();return(0,P.jsxs)("div",{className:"editor-header edit-post-header",children:[w&&(0,P.jsx)(Ao.__unstableMotion.div,{className:"editor-header__back-button",variants:jg,transition:{type:"tween"},children:(0,P.jsx)(eg.Slot,{})}),(0,P.jsxs)(Ao.__unstableMotion.div,{variants:Cg,className:"editor-header__toolbar",transition:{type:"tween"},children:[(0,P.jsx)(rg,{disableBlockTools:s||d}),_&&a&&(0,P.jsx)(ng,{isCollapsed:y,onToggle:x})]}),v&&(0,P.jsx)(Ao.__unstableMotion.div,{className:"editor-header__center",variants:Cg,transition:{type:"tween"},children:(0,P.jsx)(na,{title:n})}),(0,P.jsxs)(Ao.__unstableMotion.div,{variants:Cg,transition:{type:"tween"},className:"editor-header__settings",children:[!e&&!h&&(0,P.jsx)(Bu,{forceIsDirty:t}),(0,P.jsx)(Sg,{forceIsAutosaveable:t,disabled:b}),(0,P.jsx)(qc,{className:"editor-header__post-preview-button",forceIsAutosaveable:t}),(0,P.jsx)(yg,{}),i&&r&&(0,P.jsx)(Pg,{disabled:s}),(r||!g)&&(0,P.jsx)(Fr.Slot,{scope:"core"}),!e&&(0,P.jsx)(bg,{forceIsDirty:t,setEntitiesSavedStatesCallback:o}),e,(0,P.jsx)(fg,{})]})]})},{PrivateInserterLibrary:Tg}=Xo(m.privateApis);function Bg(){const{blockSectionRootClientId:e,inserterSidebarToggleRef:t,insertionPoint:s,showMostUsedBlocks:o,sidebarIsOpened:n}=(0,c.useSelect)((e=>{const{getInserterSidebarToggleRef:t,getInsertionPoint:s,isPublishSidebarOpened:o}=Xo(e(Wi)),{getBlockRootClientId:n,__unstableGetEditorMode:i,getSectionRootClientId:r}=Xo(e(m.store)),{get:a}=e(j.store),{getActiveComplementaryArea:l}=e(Er);return{inserterSidebarToggleRef:t(),insertionPoint:s(),showMostUsedBlocks:a("core","mostUsedBlocks"),blockSectionRootClientId:(()=>{if("zoom-out"===i()){const e=r();if(e)return e}return n()})(),sidebarIsOpened:!(!l("core")&&!o())}}),[]),{setIsInserterOpened:i}=(0,c.useDispatch)(Wi),{disableComplementaryArea:r}=(0,c.useDispatch)(Er),a=(0,p.useViewportMatch)("medium","<"),l=(0,u.useRef)(),d=(0,u.useCallback)((()=>{i(!1),t.current?.focus()}),[t,i]),h=(0,u.useCallback)((e=>{e.keyCode!==ta.ESCAPE||e.defaultPrevented||(e.preventDefault(),d())}),[d]),g=(0,P.jsx)("div",{className:"editor-inserter-sidebar__content",children:(0,P.jsx)(Tg,{showMostUsedBlocks:o,showInserterHelpPanel:!0,shouldFocusBlock:a,rootClientId:null!=e?e:s.rootClientId,__experimentalInsertionIndex:s.insertionIndex,onSelect:s.onSelect,__experimentalInitialTab:s.tab,__experimentalInitialCategory:s.category,__experimentalFilterValue:s.filterValue,onPatternCategorySelection:n?()=>r("core"):void 0,ref:l,onClose:d})});return(0,P.jsx)("div",{onKeyDown:h,className:"editor-inserter-sidebar",children:g})}function Ig(){return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)("div",{className:"editor-list-view-sidebar__outline",children:[(0,P.jsxs)("div",{children:[(0,P.jsx)(Ao.__experimentalText,{children:(0,ms.__)("Characters:")}),(0,P.jsx)(Ao.__experimentalText,{children:(0,P.jsx)(mp,{})})]}),(0,P.jsxs)("div",{children:[(0,P.jsx)(Ao.__experimentalText,{children:(0,ms.__)("Words:")}),(0,P.jsx)(up,{})]}),(0,P.jsxs)("div",{children:[(0,P.jsx)(Ao.__experimentalText,{children:(0,ms.__)("Time to read:")}),(0,P.jsx)(hp,{})]})]}),(0,P.jsx)(ma,{})]})}const{TabbedSidebar:Ng}=Xo(m.privateApis);function Ag(){const{setIsListViewOpened:e}=(0,c.useDispatch)(Wi),{getListViewToggleRef:t}=Xo((0,c.useSelect)(Wi)),s=(0,p.useFocusOnMount)("firstElement"),o=(0,u.useCallback)((()=>{e(!1),t().current?.focus()}),[t,e]),n=(0,u.useCallback)((e=>{e.keyCode!==ta.ESCAPE||e.defaultPrevented||(e.preventDefault(),o())}),[o]),[i,r]=(0,u.useState)(null),[a,l]=(0,u.useState)("list-view"),d=(0,u.useRef)(),h=(0,u.useRef)(),g=(0,u.useRef)(),_=(0,p.useMergeRefs)([s,g,r]);const f=(0,u.useCallback)((()=>{d.current.contains(d.current.ownerDocument.activeElement)?o():function(e){const t=Wu.focus.tabbable.find(h.current)[0];if("list-view"===e){const e=Wu.focus.tabbable.find(g.current)[0];(d.current.contains(e)?e:t).focus()}else t.focus()}(a)}),[o,a]);return(0,nr.useShortcut)("core/editor/toggle-list-view",f),(0,P.jsx)("div",{className:"editor-list-view-sidebar",onKeyDown:n,ref:d,children:(0,P.jsx)(Ng,{tabs:[{name:"list-view",title:(0,ms._x)("List View","Post overview"),panel:(0,P.jsx)("div",{className:"editor-list-view-sidebar__list-view-container",children:(0,P.jsx)("div",{className:"editor-list-view-sidebar__list-view-panel-content",children:(0,P.jsx)(m.__experimentalListView,{dropZoneElement:i})})}),panelRef:_},{name:"outline",title:(0,ms._x)("Outline","Post overview"),panel:(0,P.jsx)("div",{className:"editor-list-view-sidebar__list-view-container",children:(0,P.jsx)(Ig,{})})}],onClose:o,onSelect:e=>l(e),defaultTabId:"list-view",ref:h,closeButtonLabel:(0,ms.__)("Close")})})}const{Fill:Dg,Slot:Rg}=(0,Ao.createSlotFill)("ActionsPanel");function Mg({setEntitiesSavedStatesCallback:e,closeEntitiesSavedStates:t,isEntitiesSavedStatesOpen:s,forceIsDirtyPublishPanel:o}){const{closePublishSidebar:n,togglePublishSidebar:i}=(0,c.useDispatch)(Wi),{publishSidebarOpened:r,isPublishable:a,isDirty:l,hasOtherEntitiesChanges:d}=(0,c.useSelect)((e=>{const{isPublishSidebarOpened:t,isEditedPostPublishable:s,isCurrentPostPublished:o,isEditedPostDirty:n,hasNonPostEntityChanges:i}=e(Wi),r=i();return{publishSidebarOpened:t(),isPublishable:!o()&&s(),isDirty:r||n(),hasOtherEntitiesChanges:r}}),[]),p=(0,u.useCallback)((()=>e(!0)),[]);let h;return h=r?(0,P.jsx)(gu,{onClose:n,forceIsDirty:o,PrePublishExtension:Gl.Slot,PostPublishExtension:Ml.Slot}):a&&!d?(0,P.jsx)("div",{className:"editor-layout__toggle-publish-panel",children:(0,P.jsx)(Ao.Button,{__next40pxDefaultSize:!0,variant:"secondary",onClick:i,"aria-expanded":!1,children:(0,ms.__)("Open publish panel")})}):(0,P.jsx)("div",{className:"editor-layout__toggle-entities-saved-states-panel",children:(0,P.jsx)(Ao.Button,{__next40pxDefaultSize:!0,variant:"secondary",onClick:p,"aria-expanded":!1,disabled:!l,accessibleWhenDisabled:!0,children:(0,ms.__)("Open save panel")})}),(0,P.jsxs)(P.Fragment,{children:[s&&(0,P.jsx)(Aa,{close:t}),(0,P.jsx)(Rg,{bubblesVirtually:!0}),!s&&h]})}function Og({autoFocus:e=!1}){const{switchEditorMode:t}=(0,c.useDispatch)(Wi),{shortcut:s,isRichEditingEnabled:o}=(0,c.useSelect)((e=>{const{getEditorSettings:t}=e(Wi),{getShortcutRepresentation:s}=e(nr.store);return{shortcut:s("core/editor/toggle-mode"),isRichEditingEnabled:t().richEditingEnabled}}),[]),{resetZoomLevel:n,__unstableSetEditorMode:i}=Xo((0,c.useDispatch)(m.store)),r=(0,u.useRef)();return(0,u.useEffect)((()=>{n(),i("edit"),e||r?.current?.focus()}),[e,n,i]),(0,P.jsxs)("div",{className:"editor-text-editor",children:[o&&(0,P.jsxs)("div",{className:"editor-text-editor__toolbar",children:[(0,P.jsx)("h2",{children:(0,ms.__)("Editing code")}),(0,P.jsx)(Ao.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>t("visual"),shortcut:s,children:(0,ms.__)("Exit code editor")})]}),(0,P.jsxs)("div",{className:"editor-text-editor__body",children:[(0,P.jsx)(Xu,{ref:r}),(0,P.jsx)($u,{})]})]})}function Lg({contentRef:e}){const{onNavigateToEntityRecord:t,templateId:s}=(0,c.useSelect)((e=>{const{getEditorSettings:t,getCurrentTemplateId:s}=e(Wi);return{onNavigateToEntityRecord:t().onNavigateToEntityRecord,templateId:s()}}),[]),o=(0,c.useSelect)((e=>!!e(d.store).canUser("create",{kind:"postType",name:"wp_template"})),[]),[n,i]=(0,u.useState)(!1);return(0,u.useEffect)((()=>{const t=e=>{o&&e.target.classList.contains("is-root-container")&&"core/template-part"!==e.target.dataset?.type&&(e.defaultPrevented||(e.preventDefault(),i(!0)))},s=e.current;return s?.addEventListener("dblclick",t),()=>{s?.removeEventListener("dblclick",t)}}),[e,o]),o?(0,P.jsx)(Ao.__experimentalConfirmDialog,{isOpen:n,confirmButtonText:(0,ms.__)("Edit template"),onConfirm:()=>{i(!1),t({postId:s,postType:"wp_template"})},onCancel:()=>i(!1),size:"medium",children:(0,ms.__)("You’ve tried to select a block that is part of a template, which may be used on other posts and pages. Would you like to edit the template?")}):null}function Fg({direction:e,resizeWidthBy:t}){const s=`resizable-editor__resize-help-${e}`;return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(Ao.Tooltip,{text:(0,ms.__)("Drag to resize"),children:(0,P.jsx)(Ao.__unstableMotion.button,{className:`editor-resizable-editor__resize-handle is-${e}`,"aria-label":(0,ms.__)("Drag to resize"),"aria-describedby":s,onKeyDown:function(s){const{keyCode:o}=s;"left"===e&&o===ta.LEFT||"right"===e&&o===ta.RIGHT?t(20):("left"===e&&o===ta.RIGHT||"right"===e&&o===ta.LEFT)&&t(-20)},variants:{active:{opacity:1,scaleY:1.3}},whileFocus:"active",whileHover:"active",whileTap:"active",role:"separator","aria-orientation":"vertical"},"handle")}),(0,P.jsx)(Ao.VisuallyHidden,{id:s,children:(0,ms.__)("Use left and right arrow keys to resize the canvas.")})]})}const Vg={position:void 0,userSelect:void 0,cursor:void 0,width:void 0,height:void 0,top:void 0,right:void 0,bottom:void 0,left:void 0};const zg=function({className:e,enableResizing:t,height:s,children:o}){const[n,i]=(0,u.useState)("100%"),r=(0,u.useRef)(),a=(0,u.useCallback)((e=>{r.current&&i(r.current.offsetWidth+e)}),[]);return(0,P.jsx)(Ao.ResizableBox,{className:rr("editor-resizable-editor",e,{"is-resizable":t}),ref:e=>{r.current=e?.resizable},size:{width:t?n:"100%",height:t&&s?s:"100%"},onResizeStop:(e,t,s)=>{i(s.style.width)},minWidth:300,maxWidth:"100%",maxHeight:"100%",enable:{left:t,right:t},showHandle:t,resizeRatio:2,handleComponent:{left:(0,P.jsx)(Fg,{direction:"left",resizeWidthBy:a}),right:(0,P.jsx)(Fg,{direction:"right",resizeWidthBy:a})},handleClasses:void 0,handleStyles:{left:Vg,right:Vg},children:o})};function Ug(e,t,s){return Math.min(Math.max(e,t),s)}function Hg(e,t,s){const o=e-Ug(e,s.left,s.right),n=t-Ug(t,s.top,s.bottom);return Math.sqrt(o*o+n*n)}function Gg({isEnabled:e=!0}={}){const{getEnabledClientIdsTree:t,getBlockName:s,getBlockOrder:o}=Xo((0,c.useSelect)(m.store)),{selectBlock:n}=(0,c.useDispatch)(m.store);return(0,p.useRefEffect)((i=>{if(!e)return;const r=e=>{(e.target===i||e.target.classList.contains("is-root-container"))&&((e,r)=>{const a=t().flatMap((({clientId:e})=>{const t=s(e);if("core/template-part"===t)return[];if("core/post-content"===t){const t=o(e);if(t.length)return t}return[e]}));let l=1/0,c=null;for(const t of a){const s=i.querySelector(`[data-block="${t}"]`);if(!s)continue;const o=Hg(e,r,s.getBoundingClientRect());oi.removeEventListener("click",r)}),[e])}const{LayoutStyle:$g,useLayoutClasses:Wg,useLayoutStyles:Zg,ExperimentalBlockCanvas:Yg,useFlashEditableBlocks:Kg,useZoomOutModeExit:qg}=Xo(m.privateApis),Qg=[M,D,O,R];function Xg(e){for(let t=0;t{const{getCurrentPostId:t,getCurrentPostType:s,getCurrentTemplateId:o,getEditorSettings:n,getRenderingMode:i,getDeviceType:r}=e(Wi),{getPostType:a,getEditedEntityRecord:l}=e(d.store),c=s(),u=i();let p;c===M?p="core/block":"post-only"===u&&(p="core/post-content");const h=n(),m=h.supportsTemplateMode,g=a(c),_=o(),f=_?l("postType",D,_):void 0;return{renderingMode:u,postContentAttributes:h.postContentAttributes,isDesignPostType:Qg.includes(c),editedPostTemplate:g?.viewable&&m?f:void 0,wrapperBlockName:p,wrapperUniqueId:t(),deviceType:r(),isFocusedEntity:!!h.onNavigateToPreviousEntityRecord,postType:c,isPreview:h.__unstableIsPreviewMode}}),[]),{isCleanNewPost:j}=(0,c.useSelect)(Wi),{hasRootPaddingAwareAlignments:E,themeHasDisabledLayoutStyles:T,themeSupportsLayout:B,isZoomedOut:I}=(0,c.useSelect)((e=>{const{getSettings:t,isZoomOut:s}=Xo(e(m.store)),o=t();return{themeHasDisabledLayoutStyles:o.disableLayoutStyles,themeSupportsLayout:o.supportsLayout,hasRootPaddingAwareAlignments:o.__experimentalFeatures?.useRootPaddingAwareAlignments,isZoomedOut:s()}}),[]),N=(0,m.__experimentalUseResizeCanvas)(v),[A]=(0,m.useSettings)("layout"),L=(0,u.useMemo)((()=>"post-only"!==g||S?{type:"default"}:B?{...A,type:"constrained"}:{type:"default"}),[g,B,A,S]),F=(0,u.useMemo)((()=>{if(!f?.content&&!f?.blocks&&_)return _;if(f?.blocks)return Xg(f?.blocks);const e="string"==typeof f?.content?f?.content:"";return Xg((0,y.parse)(e))||{}}),[f?.content,f?.blocks,_]),V=(0,u.useMemo)((()=>{if(!f?.content&&!f?.blocks)return!1;if(f?.blocks)return Jg(f?.blocks);const e="string"==typeof f?.content?f?.content:"";return Jg((0,y.parse)(e))||!1}),[f?.content,f?.blocks]),{layout:z={},align:U=""}=F||{},H=Wg(F,"core/post-content"),G=rr({"is-layout-flow":!B},B&&H,U&&`align${U}`),$=Zg(F,"core/post-content",".block-editor-block-list__layout.is-root-container"),W=(0,u.useMemo)((()=>z&&("constrained"===z?.type||z?.inherit||z?.contentSize||z?.wideSize)?{...A,...z,type:"constrained"}:{...A,...z,type:"default"}),[z?.type,z?.inherit,z?.contentSize,z?.wideSize,A]),Z=_?W:L,Y="default"!==Z?.type||V?Z:L,K=(0,m.__unstableUseTypingObserver)(),q=(0,u.useRef)();(0,u.useEffect)((()=>{e&&j()&&q?.current?.focus()}),[e,j]);const Q=(0,u.useRef)(),X=(0,m.__unstableUseTypewriter)();n=(0,p.useMergeRefs)([Q,n,"post-only"===g?X:null,Kg({isEnabled:"template-locked"===g}),Gg({isEnabled:"template-locked"===g}),qg()]);const J=I&&!h?{scale:"default",frameSize:"40px"}:{},ee=k===O,te=[O,R,M].includes(k)&&!C&&!l&&!I,se=!s||["Tablet","Mobile"].includes(v),oe=(0,u.useMemo)((()=>[...null!=t?t:[],{css:`:where(.block-editor-iframe__body){display:flow-root;}.is-root-container{display:flow-root;${te?"min-height:0!important;":""}}`}]),[t,te]);return(0,P.jsx)("div",{className:rr("editor-visual-editor","edit-post-visual-editor",i,{"has-padding":w||te,"is-resizable":te,"is-iframed":se}),children:(0,P.jsx)(zg,{enableResizing:te,height:a.height&&!ee?a.height:"100%",children:(0,P.jsxs)(Yg,{shouldIframe:se,contentRef:n,styles:oe,height:"100%",iframeProps:{...o,...J,style:{...o?.style,...N}},children:[B&&!T&&"post-only"===g&&!S&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)($g,{selector:".editor-visual-editor__post-title-wrapper",layout:L}),(0,P.jsx)($g,{selector:".block-editor-block-list__layout.is-root-container",layout:Y}),U&&(0,P.jsx)($g,{css:".is-root-container.alignwide { max-width: var(--wp--style--global--wide-size); margin-left: auto; margin-right: auto;}\n\t\t.is-root-container.alignwide:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: var(--wp--style--global--wide-size);}\n\t\t.is-root-container.alignfull { max-width: none; margin-left: auto; margin-right: auto;}\n\t\t.is-root-container.alignfull:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: none;}"}),$&&(0,P.jsx)($g,{layout:W,css:$})]}),"post-only"===g&&!S&&(0,P.jsx)("div",{className:rr("editor-visual-editor__post-title-wrapper","edit-post-visual-editor__post-title-wrapper",{"has-global-padding":E}),contentEditable:!1,ref:K,style:{marginTop:"4rem"},children:(0,P.jsx)(Qu,{ref:q})}),(0,P.jsxs)(m.RecursionProvider,{blockName:b,uniqueId:x,children:[(0,P.jsx)(m.BlockList,{className:rr("is-"+v.toLowerCase()+"-preview","post-only"!==g||S?"wp-site-blocks":`${G} wp-block-post-content`),layout:Z,dropZoneElement:s?Q.current:Q.current?.parentNode,__unstableDisableDropZone:"template-locked"===g}),"template-locked"===g&&(0,P.jsx)(Lg,{contentRef:Q})]}),te&&r]})})})},t_={header:(0,ms.__)("Editor top bar"),body:(0,ms.__)("Editor content"),sidebar:(0,ms.__)("Editor settings"),actions:(0,ms.__)("Editor publish"),footer:(0,ms.__)("Editor footer")};function s_({className:e,styles:t,children:s,forceIsDirty:o,contentRef:n,disableIframe:i,autoFocus:r,customSaveButton:a,customSavePanel:l,forceDisableBlockTools:d,title:h,iframeProps:g}){const{mode:_,isRichEditingEnabled:f,isInserterOpened:b,isListViewOpened:y,isDistractionFree:x,isPreviewMode:v,showBlockBreadcrumbs:w,documentLabel:S,isZoomOut:k}=(0,c.useSelect)((e=>{const{get:t}=e(j.store),{getEditorSettings:s,getPostTypeLabel:o}=e(Wi),n=s(),i=o(),{isZoomOut:r}=Xo(e(m.store));return{mode:e(Wi).getEditorMode(),isRichEditingEnabled:n.richEditingEnabled,isInserterOpened:e(Wi).isInserterOpened(),isListViewOpened:e(Wi).isListViewOpened(),isDistractionFree:t("core","distractionFree"),isPreviewMode:n.__unstableIsPreviewMode,showBlockBreadcrumbs:t("core","showBlockBreadcrumbs"),documentLabel:i||(0,ms._x)("Document","noun, breadcrumb"),isZoomOut:r()}}),[]),C=(0,p.useViewportMatch)("medium"),E=y?(0,ms.__)("Document Overview"):(0,ms.__)("Block Library"),[T,B]=(0,u.useState)(!1),I=(0,u.useCallback)((e=>{"function"==typeof T&&T(e),B(!1)}),[T]);return(0,P.jsx)(Kr,{isDistractionFree:x,className:rr("editor-editor-interface",e,{"is-entity-save-view-open":!!T,"is-distraction-free":x&&!v}),labels:{...t_,secondarySidebar:E},header:!v&&(0,P.jsx)(Eg,{forceIsDirty:o,setEntitiesSavedStatesCallback:B,customSaveButton:a,forceDisableBlockTools:d,title:h,isEditorIframed:!i}),editorNotices:(0,P.jsx)(wa,{}),secondarySidebar:!v&&"visual"===_&&(b&&(0,P.jsx)(Bg,{})||y&&(0,P.jsx)(Ag,{})),sidebar:!v&&!x&&(0,P.jsx)(Hr.Slot,{scope:"core"}),content:(0,P.jsxs)(P.Fragment,{children:[!x&&!v&&(0,P.jsx)(wa,{}),(0,P.jsx)(Km.Slot,{children:([e])=>e||(0,P.jsxs)(P.Fragment,{children:[!v&&("text"===_||!f)&&(0,P.jsx)(Og,{autoFocus:r}),!v&&!C&&"visual"===_&&(0,P.jsx)(m.BlockToolbar,{hideDragHandle:!0}),(v||f&&"visual"===_)&&(0,P.jsx)(e_,{styles:t,contentRef:n,disableIframe:i,autoFocus:r,iframeProps:g}),s]})})]}),footer:!v&&!x&&C&&w&&f&&!k&&"visual"===_&&(0,P.jsx)(m.BlockBreadcrumb,{rootLabelText:S}),actions:v?void 0:l||(0,P.jsx)(Mg,{closeEntitiesSavedStates:I,isEntitiesSavedStatesOpen:T,setEntitiesSavedStatesCallback:B,forceIsDirtyPublishPanel:o})})}const{OverridesPanel:o_}=Xo(nn.privateApis);function n_(){return(0,c.useSelect)((e=>"wp_block"===e(Wi).getCurrentPostType()),[])?(0,P.jsx)(o_,{}):null}function i_({postType:e,onActionPerformed:t,context:s}){const{defaultActions:o}=(0,c.useSelect)((t=>{const{getEntityActions:s}=Xo(t(Wi));return{defaultActions:s("postType",e)}}),[e]),{registerPostTypeActions:n}=Xo((0,c.useDispatch)(Wi));return(0,u.useEffect)((()=>{n(e)}),[n,e]),(0,u.useMemo)((()=>{const e=o.filter((e=>!e.context||e.context===s));if(t)for(let s=0;s{o(n,{...i,onActionPerformed:o=>{i?.onActionPerformed&&i.onActionPerformed(o),t(e[s].id,o)}})}}}if(e[s].RenderModal){const o=e[s].RenderModal;e[s]={...e[s],RenderModal:n=>(0,P.jsx)(o,{...n,onActionPerformed:o=>{n.onActionPerformed&&n.onActionPerformed(o),t(e[s].id,o)}})}}}return e}),[o,t,s])}const{DropdownMenuV2:r_,kebabCase:a_}=Xo(Ao.privateApis);function l_({postType:e,postId:t,onActionPerformed:s}){const[o,n]=(0,u.useState)(!1),{item:i,permissions:r}=(0,c.useSelect)((s=>{const{getEditedEntityRecord:o,getEntityRecordPermissions:n}=Xo(s(d.store));return{item:o("postType",e,t),permissions:n("postType",e,t)}}),[t,e]),a=(0,u.useMemo)((()=>({...i,permissions:r})),[i,r]),l=i_({postType:e,onActionPerformed:s}),p=(0,u.useMemo)((()=>l.filter((e=>!e.isEligible||e.isEligible(a)))),[l,a]);return(0,P.jsx)(r_,{open:o,trigger:(0,P.jsx)(Ao.Button,{size:"small",icon:ag,label:(0,ms.__)("Actions"),disabled:!p.length,accessibleWhenDisabled:!0,className:"editor-all-actions-button",onClick:()=>n(!o)}),onOpenChange:n,placement:"bottom-end",children:(0,P.jsx)(u_,{actions:p,item:a,onClose:()=>{n(!1)}})})}function c_({action:e,onClick:t,items:s}){const o="string"==typeof e.label?e.label:e.label(s);return(0,P.jsx)(r_.Item,{onClick:t,hideOnClick:!e.RenderModal,children:(0,P.jsx)(r_.ItemLabel,{children:o})})}function d_({action:e,item:t,ActionTrigger:s,onClose:o}){const[n,i]=(0,u.useState)(!1),r={action:e,onClick:()=>i(!0),items:[t]},{RenderModal:a,hideModalHeader:l}=e;return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(s,{...r}),n&&(0,P.jsx)(Ao.Modal,{title:e.modalHeader||e.label,__experimentalHideHeader:!!l,onRequestClose:()=>{i(!1)},overlayClassName:`editor-action-modal editor-action-modal__${a_(e.id)}`,focusOnMount:"firstContentElement",size:"small",children:(0,P.jsx)(a,{items:[t],closeModal:()=>{i(!1),o()}})})]})}function u_({actions:e,item:t,onClose:s}){return(0,P.jsx)(r_.Group,{children:e.map((e=>e.RenderModal?(0,P.jsx)(d_,{action:e,item:t,ActionTrigger:c_,onClose:s},e.id):(0,P.jsx)(c_,{action:e,onClick:()=>e.callback([t]),items:[t]},e.id)))})}function p_({postType:e,postId:t,onActionPerformed:s}){const{isFrontPage:o,isPostsPage:n,title:i,icon:r,isSync:a}=(0,c.useSelect)((s=>{const{__experimentalGetTemplateInfo:o}=s(Wi),{canUser:n,getEditedEntityRecord:i}=s(d.store),r=n("read",{kind:"root",name:"site"})?i("root","site"):void 0,a=i("postType",e,t),l=[D,R].includes(e)&&o(a);let c=!1;if(V.includes(e))if(M===e){c="unsynced"!==("unsynced"===a?.meta?.wp_pattern_sync_status?"unsynced":a?.wp_pattern_sync_status)}else c=!0;return{title:l?.title||a?.title,icon:Xo(s(Wi)).getPostIcon(e,{area:a?.area}),isSync:c,isFrontPage:r?.page_on_front===t,isPostsPage:r?.page_for_posts===t}}),[t,e]);return(0,P.jsx)("div",{className:"editor-post-card-panel",children:(0,P.jsxs)(Ao.__experimentalHStack,{spacing:2,className:"editor-post-card-panel__header",align:"flex-start",children:[(0,P.jsx)(Ao.Icon,{className:rr("editor-post-card-panel__icon",{"is-sync":a}),icon:r}),(0,P.jsxs)(Ao.__experimentalText,{numberOfLines:2,truncate:!0,className:"editor-post-card-panel__title",weight:500,as:"h2",lineHeight:"20px",children:[i?(0,No.decodeEntities)(i):(0,ms.__)("No title"),o&&(0,P.jsx)("span",{className:"editor-post-card-panel__title-badge",children:(0,ms.__)("Homepage")}),n&&(0,P.jsx)("span",{className:"editor-post-card-panel__title-badge",children:(0,ms.__)("Posts Page")})]}),(0,P.jsx)(l_,{postType:e,postId:t,onActionPerformed:s})]})})}function h_(){const{postContent:e}=(0,c.useSelect)((e=>{const{getEditedPostAttribute:t,getCurrentPostType:s,getCurrentPostId:o}=e(Wi),{canUser:n}=e(d.store),{getEntityRecord:i}=e(d.store),r=n("read",{kind:"root",name:"site"})?i("root","site"):void 0,a=s();return{postContent:!(+o()===r?.page_for_posts)&&![D,R].includes(a)&&t("content")}}),[]),t=(0,ms._x)("words","Word count type. Do not translate!"),s=(0,u.useMemo)((()=>e?(0,dp.count)(e,t):0),[e,t]);if(!s)return null;const o=Math.round(s/189),n=(0,ms.sprintf)((0,ms._n)("%s word","%s words",s),s.toLocaleString()),i=o<=1?(0,ms.__)("1 minute"):(0,ms.sprintf)((0,ms._n)("%s minute","%s minutes",o),o.toLocaleString());return(0,P.jsx)("div",{className:"editor-post-content-information",children:(0,P.jsx)(Ao.__experimentalText,{children:(0,ms.sprintf)((0,ms.__)("%1$s, %2$s read time."),n,i)})})}const m_=function(){const{postFormat:e}=(0,c.useSelect)((e=>{const{getEditedPostAttribute:t}=e(Wi),s=t("format");return{postFormat:null!=s?s:"standard"}}),[]),t=Vc.find((t=>t.id===e)),[s,o]=(0,u.useState)(null),n=(0,u.useMemo)((()=>({anchor:s,placement:"left-start",offset:36,shift:!0})),[s]);return(0,P.jsx)(Fc,{children:(0,P.jsx)(Ka,{label:(0,ms.__)("Format"),ref:o,children:(0,P.jsx)(Ao.Dropdown,{popoverProps:n,contentClassName:"editor-post-format__dialog",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:s})=>(0,P.jsx)(Ao.Button,{size:"compact",variant:"tertiary","aria-expanded":e,"aria-label":(0,ms.sprintf)((0,ms.__)("Change format: %s"),t?.caption),onClick:s,children:t?.caption}),renderContent:({onClose:e})=>(0,P.jsxs)("div",{className:"editor-post-format__dialog-content",children:[(0,P.jsx)(m.__experimentalInspectorPopoverHeader,{title:(0,ms.__)("Format"),onClose:e}),(0,P.jsx)(zc,{})]})})})})};function g_(){const e=(0,c.useSelect)((e=>e(Wi).getEditedPostAttribute("modified")),[]),t=e&&(0,ms.sprintf)((0,ms.__)("Last edited %s."),(0,x.humanTimeDiff)(e));return t?(0,P.jsx)("div",{className:"editor-post-last-edited-panel",children:(0,P.jsx)(Ao.__experimentalText,{children:t})}):null}const __=function({className:e,children:t}){return(0,P.jsx)(Ao.__experimentalVStack,{className:rr("editor-post-panel__section",e),children:t})},f_={};function b_(){const{editEntityRecord:e}=(0,c.useDispatch)(d.store),{postsPageTitle:t,postsPageId:s,isTemplate:o,postSlug:n}=(0,c.useSelect)((e=>{const{getEntityRecord:t,getEditedEntityRecord:s,canUser:o}=e(d.store),n=o("read",{kind:"root",name:"site"})?t("root","site"):void 0,i=n?.page_for_posts?s("postType","page",n?.page_for_posts):f_,{getEditedPostAttribute:r,getCurrentPostType:a}=e(Wi);return{postsPageId:i?.id,postsPageTitle:i?.title,isTemplate:a()===D,postSlug:r("slug")}}),[]),[i,r]=(0,u.useState)(null),a=(0,u.useMemo)((()=>({anchor:i,placement:"left-start",offset:36,shift:!0})),[i]);if(!o||!["home","index"].includes(n)||!s)return null;const l=t=>{e("postType","page",s,{title:t})},h=(0,No.decodeEntities)(t);return(0,P.jsx)(Ka,{label:(0,ms.__)("Blog title"),ref:r,children:(0,P.jsx)(Ao.Dropdown,{popoverProps:a,contentClassName:"editor-blog-title-dropdown__content",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,P.jsx)(Ao.Button,{size:"compact",variant:"tertiary","aria-expanded":e,"aria-label":(0,ms.sprintf)((0,ms.__)("Change blog title: %s"),h),onClick:t,children:h}),renderContent:({onClose:e})=>(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(m.__experimentalInspectorPopoverHeader,{title:(0,ms.__)("Blog title"),onClose:e}),(0,P.jsx)(Ao.__experimentalInputControl,{placeholder:(0,ms.__)("No title"),size:"__unstable-large",value:t,onChange:(0,p.debounce)(l,300),label:(0,ms.__)("Blog title"),help:(0,ms.__)("Set the Posts Page title. Appears in search results, and when the page is shared on social media."),hideLabelFromVision:!0})]})})})}function y_(){const{editEntityRecord:e}=(0,c.useDispatch)(d.store),{postsPerPage:t,isTemplate:s,postSlug:o}=(0,c.useSelect)((e=>{const{getEditedPostAttribute:t,getCurrentPostType:s}=e(Wi),{getEditedEntityRecord:o,canUser:n}=e(d.store),i=n("read",{kind:"root",name:"site"})?o("root","site"):void 0;return{isTemplate:s()===D,postSlug:t("slug"),postsPerPage:i?.posts_per_page||1}}),[]),[n,i]=(0,u.useState)(null),r=(0,u.useMemo)((()=>({anchor:n,placement:"left-start",offset:36,shift:!0})),[n]);if(!s||!["home","index"].includes(o))return null;const a=t=>{e("root","site",void 0,{posts_per_page:t})};return(0,P.jsx)(Ka,{label:(0,ms.__)("Posts per page"),ref:i,children:(0,P.jsx)(Ao.Dropdown,{popoverProps:r,contentClassName:"editor-posts-per-page-dropdown__content",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:s})=>(0,P.jsx)(Ao.Button,{size:"compact",variant:"tertiary","aria-expanded":e,"aria-label":(0,ms.__)("Change posts per page"),onClick:s,children:t}),renderContent:({onClose:e})=>(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(m.__experimentalInspectorPopoverHeader,{title:(0,ms.__)("Posts per page"),onClose:e}),(0,P.jsx)(Ao.__experimentalNumberControl,{placeholder:0,value:t,size:"__unstable-large",spinControls:"custom",step:"1",min:"1",onChange:a,label:(0,ms.__)("Posts per page"),help:(0,ms.__)("Set the default number of posts to display on blog pages, including categories and tags. Some templates may override this setting."),hideLabelFromVision:!0})]})})})}const x_=[{label:(0,ms._x)("Open",'Adjective: e.g. "Comments are open"'),value:"open",description:(0,ms.__)("Visitors can add new comments and replies.")},{label:(0,ms.__)("Closed"),value:"",description:[(0,ms.__)("Visitors cannot add new comments or replies."),(0,ms.__)("Existing comments remain visible.")].join(" ")}];function v_(){const{editEntityRecord:e}=(0,c.useDispatch)(d.store),{allowCommentsOnNewPosts:t,isTemplate:s,postSlug:o}=(0,c.useSelect)((e=>{const{getEditedPostAttribute:t,getCurrentPostType:s}=e(Wi),{getEditedEntityRecord:o,canUser:n}=e(d.store),i=n("read",{kind:"root",name:"site"})?o("root","site"):void 0;return{isTemplate:s()===D,postSlug:t("slug"),allowCommentsOnNewPosts:i?.default_comment_status||""}}),[]),[n,i]=(0,u.useState)(null),r=(0,u.useMemo)((()=>({anchor:n,placement:"left-start",offset:36,shift:!0})),[n]);if(!s||!["home","index"].includes(o))return null;const a=t=>{e("root","site",void 0,{default_comment_status:t?"open":null})};return(0,P.jsx)(Ka,{label:(0,ms.__)("Discussion"),ref:i,children:(0,P.jsx)(Ao.Dropdown,{popoverProps:r,contentClassName:"editor-site-discussion-dropdown__content",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:s})=>(0,P.jsx)(Ao.Button,{size:"compact",variant:"tertiary","aria-expanded":e,"aria-label":(0,ms.__)("Change discussion settings"),onClick:s,children:t?(0,ms.__)("Comments open"):(0,ms.__)("Comments closed")}),renderContent:({onClose:e})=>(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(m.__experimentalInspectorPopoverHeader,{title:(0,ms.__)("Discussion"),onClose:e}),(0,P.jsxs)(Ao.__experimentalVStack,{spacing:3,children:[(0,P.jsx)(Ao.__experimentalText,{children:(0,ms.__)("Changes will apply to new posts only. Individual posts may override these settings.")}),(0,P.jsx)(Ao.RadioControl,{className:"editor-site-discussion__options",hideLabelFromVision:!0,label:(0,ms.__)("Comment status"),options:x_,onChange:a,selected:t})]})]})})})}function w_({onActionPerformed:e}){const{isRemovedPostStatusPanel:t,postType:s,postId:o}=(0,c.useSelect)((e=>{const{isEditorPanelRemoved:t,getCurrentPostType:s,getCurrentPostId:o}=e(Wi);return{isRemovedPostStatusPanel:t("post-status"),postType:s(),postId:o()}}),[]);return(0,P.jsx)(__,{className:"editor-post-summary",children:(0,P.jsx)(Vl.Slot,{children:n=>(0,P.jsx)(P.Fragment,{children:(0,P.jsxs)(Ao.__experimentalVStack,{spacing:4,children:[(0,P.jsx)(p_,{postType:s,postId:o,onActionPerformed:e}),(0,P.jsx)(Lc,{withPanelBody:!1}),(0,P.jsx)(Cc,{}),(0,P.jsxs)(Ao.__experimentalVStack,{spacing:1,children:[(0,P.jsx)(h_,{}),(0,P.jsx)(g_,{})]}),!t&&(0,P.jsxs)(Ao.__experimentalVStack,{spacing:4,children:[(0,P.jsxs)(Ao.__experimentalVStack,{spacing:1,children:[(0,P.jsx)(Tu,{}),(0,P.jsx)(Au,{}),(0,P.jsx)(rp,{}),(0,P.jsx)(cc,{}),(0,P.jsx)(ec,{}),(0,P.jsx)(_c,{}),(0,P.jsx)(Gc,{}),(0,P.jsx)(ll,{}),(0,P.jsx)(Lu,{}),(0,P.jsx)(b_,{}),(0,P.jsx)(y_,{}),(0,P.jsx)(v_,{}),(0,P.jsx)(m_,{}),n]}),(0,P.jsx)(ep,{onActionPerformed:e})]})]})})})})}const{EXCLUDED_PATTERN_SOURCES:S_,PATTERN_TYPES:k_}=Xo(nn.privateApis);function P_(e,t){return e.innerBlocks=e.innerBlocks.map((e=>P_(e,t))),"core/template-part"===e.name&&void 0===e.attributes.theme&&(e.attributes.theme=t),e}function C_(e,t){return e.filter(((e,s,o)=>((e,t,s)=>t===s.findIndex((t=>e.name===t.name)))(e,s,o)&&(e=>!S_.includes(e.source))(e)&&(e=>e.templateTypes?.includes(t.slug)||e.blockTypes?.includes("core/template-part/"+t.area))(e)))}function j_(e,t){return e.map((e=>({...e,keywords:e.keywords||[],type:k_.theme,blocks:(0,y.parse)(e.content,{__unstableSkipMigrationLogs:!0}).map((e=>P_(e,t)))})))}function E_({availableTemplates:e,onSelect:t}){const s=(0,p.useAsyncList)(e);return e&&0!==e?.length?(0,P.jsx)(m.__experimentalBlockPatternsList,{label:(0,ms.__)("Templates"),blockPatterns:e,shownPatterns:s,onClickPattern:t,showTitlesAsTooltip:!0}):null}function T_(){const{record:e,postType:t,postId:s}=(0,c.useSelect)((e=>{const{getCurrentPostType:t,getCurrentPostId:s}=e(Wi),{getEditedEntityRecord:o}=e(d.store),n=t(),i=s();return{postType:n,postId:i,record:o("postType",n,i)}}),[]),{editEntityRecord:o}=(0,c.useDispatch)(d.store),n=function(e){const{blockPatterns:t,restBlockPatterns:s,currentThemeStylesheet:o}=(0,c.useSelect)((e=>{var t;const{getEditorSettings:s}=e(Wi),o=s();return{blockPatterns:null!==(t=o.__experimentalAdditionalBlockPatterns)&&void 0!==t?t:o.__experimentalBlockPatterns,restBlockPatterns:e(d.store).getBlockPatterns(),currentThemeStylesheet:e(d.store).getCurrentTheme().stylesheet}}),[]);return(0,u.useMemo)((()=>j_(C_([...t||[],...s||[]],e),e)),[t,s,e,o])}(e);return n?.length?(0,P.jsx)(Ao.PanelBody,{title:(0,ms.__)("Design"),initialOpen:e.type===R,children:(0,P.jsx)(E_,{availableTemplates:n,onSelect:async e=>{await o("postType",t,s,{blocks:e.blocks,content:(0,y.serialize)(e.blocks)})}})}):null}function B_(){const{postType:e}=(0,c.useSelect)((e=>{const{getCurrentPostType:t}=e(Wi);return{postType:t()}}),[]);return[R,D].includes(e)?(0,P.jsx)(T_,{}):null}const I_={document:"edit-post/document",block:"edit-post/block"},{Tabs:N_}=Xo(Ao.privateApis),A_=(0,u.forwardRef)(((e,t)=>{const{documentLabel:s}=(0,c.useSelect)((e=>{const{getPostTypeLabel:t}=e(Wi);return{documentLabel:t()||(0,ms._x)("Document","noun, sidebar")}}),[]);return(0,P.jsxs)(N_.TabList,{ref:t,children:[(0,P.jsx)(N_.Tab,{tabId:I_.document,"data-tab-id":I_.document,children:s}),(0,P.jsx)(N_.Tab,{tabId:I_.block,"data-tab-id":I_.block,children:(0,ms.__)("Block")})]})})),{BlockQuickNavigation:D_}=Xo(m.privateApis),R_=["core/post-title","core/post-featured-image","core/post-content"];function M_(){const e=(0,u.useMemo)((()=>(0,h.applyFilters)("editor.postContentBlockTypes",R_)),[]),{clientIds:t,postType:s,renderingMode:o}=(0,c.useSelect)((t=>{const{getCurrentPostType:s,getPostBlocksByName:o,getRenderingMode:n}=Xo(t(Wi)),i=s();return{postType:i,clientIds:o(D===i?"core/template-part":e),renderingMode:n()}}),[e]),{enableComplementaryArea:n}=(0,c.useDispatch)(Er);return"post-only"===o&&s!==D||0===t.length?null:(0,P.jsx)(Ao.PanelBody,{title:(0,ms.__)("Content"),children:(0,P.jsx)(D_,{clientIds:t,onSelect:()=>{n("core","edit-post/document")}})})}const{BlockQuickNavigation:O_}=Xo(m.privateApis);function L_(){const e=(0,c.useSelect)((e=>{const{getBlockTypes:t}=e(y.store);return t()}),[]),t=(0,u.useMemo)((()=>e.filter((e=>"theme"===e.category)).map((({name:e})=>e))),[e]),s=(0,c.useSelect)((e=>{const{getBlocksByName:s}=e(m.store);return s(t)}),[t]);return 0===s.length?null:(0,P.jsx)(Ao.PanelBody,{title:(0,ms.__)("Content"),children:(0,P.jsx)(O_,{clientIds:s})})}function F_(){const e=(0,c.useSelect)((e=>{const{getCurrentPostType:t}=e(Wi);return t()}),[]);return e!==R?null:(0,P.jsx)(L_,{})}const V_=function(){const{hasBlockSelection:e}=(0,c.useSelect)((e=>({hasBlockSelection:!!e(m.store).getBlockSelectionStart()})),[]),{getActiveComplementaryArea:t}=(0,c.useSelect)(Er),{enableComplementaryArea:s}=(0,c.useDispatch)(Er),{get:o}=(0,c.useSelect)(j.store);(0,u.useEffect)((()=>{const n=t("core"),i=["edit-post/document","edit-post/block"].includes(n),r=o("core","distractionFree");i&&!r&&s("core",e?"edit-post/block":"edit-post/document")}),[e,t,s,o])},{Tabs:z_}=Xo(Ao.privateApis),U_=u.Platform.select({web:!0,native:!1}),H_=({tabName:e,keyboardShortcut:t,onActionPerformed:s,extraPanels:o})=>{const n=(0,u.useRef)(null),i=(0,u.useContext)(z_.Context);return(0,u.useEffect)((()=>{const t=Array.from(n.current?.querySelectorAll('[role="tab"]')||[]),s=t.find((t=>t.getAttribute("data-tab-id")===e)),o=s?.ownerDocument.activeElement;t.some((e=>o&&o.id===e.id))&&s&&s.id!==o?.id&&s?.focus()}),[e]),(0,P.jsx)(Wl,{identifier:e,header:(0,P.jsx)(z_.Context.Provider,{value:i,children:(0,P.jsx)(A_,{ref:n})}),closeLabel:(0,ms.__)("Close Settings"),className:"editor-sidebar__panel",headerClassName:"editor-sidebar__panel-tabs",title:(0,ms._x)("Settings","sidebar button label"),toggleShortcut:t,icon:(0,ms.isRTL)()?qp:Qp,isActiveByDefault:U_,children:(0,P.jsxs)(z_.Context.Provider,{value:i,children:[(0,P.jsxs)(z_.TabPanel,{tabId:I_.document,focusable:!1,children:[(0,P.jsx)(w_,{onActionPerformed:s}),(0,P.jsx)(Bl.Slot,{}),(0,P.jsx)(M_,{}),(0,P.jsx)(F_,{}),(0,P.jsx)(B_,{}),(0,P.jsx)(Hu,{}),(0,P.jsx)(n_,{}),o]}),(0,P.jsx)(z_.TabPanel,{tabId:I_.block,focusable:!1,children:(0,P.jsx)(m.BlockInspector,{})})]})})},G_=({extraPanels:e,onActionPerformed:t})=>{V_();const{tabName:s,keyboardShortcut:o,showSummary:n}=(0,c.useSelect)((e=>{const t=e(nr.store).getShortcutRepresentation("core/editor/toggle-sidebar"),s=e(Er).getActiveComplementaryArea("core");let o=s;return[I_.block,I_.document].includes(s)||(o=e(m.store).getBlockSelectionStart()?I_.block:I_.document),{tabName:o,keyboardShortcut:t,showSummary:![D,R,O].includes(e(Wi).getCurrentPostType())}}),[]),{enableComplementaryArea:i}=(0,c.useDispatch)(Er),r=(0,u.useCallback)((e=>{e&&i("core",e)}),[i]);return(0,P.jsx)(z_,{selectedTabId:s,onSelect:r,selectOnMove:!1,children:(0,P.jsx)(H_,{tabName:s,keyboardShortcut:o,showSummary:n,onActionPerformed:t,extraPanels:e})})};const $_=function({postType:e,postId:t,templateId:s,settings:o,children:n,initialEdits:i,onActionPerformed:r,extraContent:a,extraSidebarPanels:l,...u}){const{post:p,template:h,hasLoadedPost:m}=(0,c.useSelect)((o=>{const{getEntityRecord:n,hasFinishedResolution:i}=o(d.store);return{post:n("postType",e,t),template:s?n("postType",D,s):void 0,hasLoadedPost:i("getEntityRecord",["postType",e,t])}}),[e,t,s]);return(0,P.jsxs)(P.Fragment,{children:[m&&!p&&(0,P.jsx)(Ao.Notice,{status:"warning",isDismissible:!1,children:(0,ms.__)("You attempted to edit an item that doesn't exist. Perhaps it was deleted?")}),!!p&&(0,P.jsxs)(zh,{post:p,__unstableTemplate:h,settings:o,initialEdits:i,useSubRegistry:!1,children:[(0,P.jsx)(s_,{...u,children:a}),n,(0,P.jsx)(G_,{onActionPerformed:r,extraPanels:l})]})]})},{PreferenceBaseOption:W_}=Xo(j.privateApis),Z_=(0,p.compose)((0,c.withSelect)((e=>({isChecked:e(Wi).isPublishSidebarEnabled()}))),(0,c.withDispatch)((e=>{const{enablePublishSidebar:t,disablePublishSidebar:s}=e(Wi);return{onChange:e=>e?t():s()}})))(W_);const Y_=function({blockTypes:e,value:t,onItemChange:s}){return(0,P.jsx)("ul",{className:"editor-block-manager__checklist",children:e.map((e=>(0,P.jsxs)("li",{className:"editor-block-manager__checklist-item",children:[(0,P.jsx)(Ao.CheckboxControl,{__nextHasNoMarginBottom:!0,label:e.title,checked:t.includes(e.name),onChange:(...t)=>s(e.name,...t)}),(0,P.jsx)(m.BlockIcon,{icon:e.icon})]},e.name)))})};const K_=function e({title:t,blockTypes:s}){const o=(0,p.useInstanceId)(e),{allowedBlockTypes:n,hiddenBlockTypes:i}=(0,c.useSelect)((e=>{const{getEditorSettings:t}=e(Wi),{get:s}=e(j.store);return{allowedBlockTypes:t().allowedBlockTypes,hiddenBlockTypes:s("core","hiddenBlockTypes")}}),[]),r=(0,u.useMemo)((()=>!0===n?s:s.filter((({name:e})=>n?.includes(e)))),[n,s]),{showBlockTypes:a,hideBlockTypes:l}=Xo((0,c.useDispatch)(Wi)),d=(0,u.useCallback)(((e,t)=>{t?a(e):l(e)}),[a,l]),h=(0,u.useCallback)((e=>{const t=s.map((({name:e})=>e));e?a(t):l(t)}),[s,a,l]);if(!r.length)return null;const m=r.map((({name:e})=>e)).filter((e=>!(null!=i?i:[]).includes(e))),g="editor-block-manager__category-title-"+o,_=m.length===r.length,f=!_&&m.length>0;return(0,P.jsxs)("div",{role:"group","aria-labelledby":g,className:"editor-block-manager__category",children:[(0,P.jsx)(Ao.CheckboxControl,{__nextHasNoMarginBottom:!0,checked:_,onChange:h,className:"editor-block-manager__category-title",indeterminate:f,label:(0,P.jsx)("span",{id:g,children:t})}),(0,P.jsx)(Y_,{blockTypes:r,value:m,onItemChange:d})]})};function q_(){const e=(0,p.useDebounce)(ds.speak,500),[t,s]=(0,u.useState)(""),{showBlockTypes:o}=Xo((0,c.useDispatch)(Wi)),{blockTypes:n,categories:i,hasBlockSupport:r,isMatchingSearchTerm:a,numberOfHiddenBlocks:l}=(0,c.useSelect)((e=>{var t;const s=e(y.store).getBlockTypes(),o=(null!==(t=e(j.store).get("core","hiddenBlockTypes"))&&void 0!==t?t:[]).filter((e=>s.some((t=>t.name===e))));return{blockTypes:s,categories:e(y.store).getCategories(),hasBlockSupport:e(y.store).hasBlockSupport,isMatchingSearchTerm:e(y.store).isMatchingSearchTerm,numberOfHiddenBlocks:Array.isArray(o)&&o.length}}),[]);const d=n.filter((e=>r(e,"inserter",!0)&&(!t||a(e,t))&&(!e.parent||e.parent.includes("core/post-content"))));return(0,u.useEffect)((()=>{if(!t)return;const s=d.length,o=(0,ms.sprintf)((0,ms._n)("%d result found.","%d results found.",s),s);e(o)}),[d?.length,t,e]),(0,P.jsxs)("div",{className:"editor-block-manager__content",children:[!!l&&(0,P.jsxs)("div",{className:"editor-block-manager__disabled-blocks-count",children:[(0,ms.sprintf)((0,ms._n)("%d block is hidden.","%d blocks are hidden.",l),l),(0,P.jsx)(Ao.Button,{__next40pxDefaultSize:!0,variant:"link",onClick:()=>function(e){const t=e.map((({name:e})=>e));o(t)}(d),children:(0,ms.__)("Reset")})]}),(0,P.jsx)(Ao.SearchControl,{__nextHasNoMarginBottom:!0,label:(0,ms.__)("Search for a block"),placeholder:(0,ms.__)("Search for a block"),value:t,onChange:e=>s(e),className:"editor-block-manager__search"}),(0,P.jsxs)("div",{tabIndex:"0",role:"region","aria-label":(0,ms.__)("Available block types"),className:"editor-block-manager__results",children:[0===d.length&&(0,P.jsx)("p",{className:"editor-block-manager__no-results",children:(0,ms.__)("No blocks found.")}),i.map((e=>(0,P.jsx)(K_,{title:e.title,blockTypes:d.filter((t=>t.category===e.slug))},e.slug))),(0,P.jsx)(K_,{title:(0,ms.__)("Uncategorized"),blockTypes:d.filter((({category:e})=>!e))})]})]})}const{PreferencesModal:Q_,PreferencesModalTabs:X_,PreferencesModalSection:J_,PreferenceToggleControl:ef}=Xo(j.privateApis);function tf({extraSections:e={}}){const t=(0,p.useViewportMatch)("medium"),s=(0,c.useSelect)((e=>{const{getEditorSettings:s}=e(Wi),{get:o}=e(j.store),n=s().richEditingEnabled;return!o("core","distractionFree")&&t&&n}),[t]),{setIsListViewOpened:o,setIsInserterOpened:n}=(0,c.useDispatch)(Wi),{set:i}=(0,c.useDispatch)(j.store),r=!!hh().length,a=(0,u.useMemo)((()=>[{name:"general",tabLabel:(0,ms.__)("General"),content:(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(J_,{title:(0,ms.__)("Interface"),children:[(0,P.jsx)(ef,{scope:"core",featureName:"showListViewByDefault",help:(0,ms.__)("Opens the List View sidebar by default."),label:(0,ms.__)("Always open List View")}),s&&(0,P.jsx)(ef,{scope:"core",featureName:"showBlockBreadcrumbs",help:(0,ms.__)("Display the block hierarchy trail at the bottom of the editor."),label:(0,ms.__)("Show block breadcrumbs")}),(0,P.jsx)(ef,{scope:"core",featureName:"allowRightClickOverrides",help:(0,ms.__)("Allows contextual List View menus via right-click, overriding browser defaults."),label:(0,ms.__)("Allow right-click contextual menus")}),r&&(0,P.jsx)(ef,{scope:"core",featureName:"enableChoosePatternModal",help:(0,ms.__)("Shows starter patterns when creating a new page."),label:(0,ms.__)("Show starter patterns")})]}),(0,P.jsxs)(J_,{title:(0,ms.__)("Document settings"),description:(0,ms.__)("Select what settings are shown in the document panel."),children:[(0,P.jsx)(Cl.Slot,{}),(0,P.jsx)(Vu,{taxonomyWrapper:(e,t)=>(0,P.jsx)(wl,{label:t.labels.menu_name,panelName:`taxonomy-panel-${t.slug}`})}),(0,P.jsx)(Tc,{children:(0,P.jsx)(wl,{label:(0,ms.__)("Featured image"),panelName:"featured-image"})}),(0,P.jsx)(bc,{children:(0,P.jsx)(wl,{label:(0,ms.__)("Excerpt"),panelName:"post-excerpt"})}),(0,P.jsx)(Ga,{supportKeys:["comments","trackbacks"],children:(0,P.jsx)(wl,{label:(0,ms.__)("Discussion"),panelName:"discussion-panel"})}),(0,P.jsx)(Ha,{children:(0,P.jsx)(wl,{label:(0,ms.__)("Page attributes"),panelName:"page-attributes"})})]}),t&&(0,P.jsx)(J_,{title:(0,ms.__)("Publishing"),children:(0,P.jsx)(Z_,{help:(0,ms.__)("Review settings, such as visibility and tags."),label:(0,ms.__)("Enable pre-publish checks")})}),e?.general]})},{name:"appearance",tabLabel:(0,ms.__)("Appearance"),content:(0,P.jsxs)(J_,{title:(0,ms.__)("Appearance"),description:(0,ms.__)("Customize the editor interface to suit your needs."),children:[(0,P.jsx)(ef,{scope:"core",featureName:"fixedToolbar",onToggle:()=>i("core","distractionFree",!1),help:(0,ms.__)("Access all block and document tools in a single place."),label:(0,ms.__)("Top toolbar")}),(0,P.jsx)(ef,{scope:"core",featureName:"distractionFree",onToggle:()=>{i("core","fixedToolbar",!0),n(!1),o(!1)},help:(0,ms.__)("Reduce visual distractions by hiding the toolbar and other elements to focus on writing."),label:(0,ms.__)("Distraction free")}),(0,P.jsx)(ef,{scope:"core",featureName:"focusMode",help:(0,ms.__)("Highlights the current block and fades other content."),label:(0,ms.__)("Spotlight mode")}),e?.appearance]})},{name:"accessibility",tabLabel:(0,ms.__)("Accessibility"),content:(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(J_,{title:(0,ms.__)("Navigation"),description:(0,ms.__)("Optimize the editing experience for enhanced control."),children:(0,P.jsx)(ef,{scope:"core",featureName:"keepCaretInsideBlock",help:(0,ms.__)("Keeps the text cursor within the block boundaries, aiding users with screen readers by preventing unintentional cursor movement outside the block."),label:(0,ms.__)("Contain text cursor inside block")})}),(0,P.jsx)(J_,{title:(0,ms.__)("Interface"),children:(0,P.jsx)(ef,{scope:"core",featureName:"showIconLabels",label:(0,ms.__)("Show button text labels"),help:(0,ms.__)("Show text instead of icons on buttons across the interface.")})})]})},{name:"blocks",tabLabel:(0,ms.__)("Blocks"),content:(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(J_,{title:(0,ms.__)("Inserter"),children:(0,P.jsx)(ef,{scope:"core",featureName:"mostUsedBlocks",help:(0,ms.__)("Adds a category with the most frequently used blocks in the inserter."),label:(0,ms.__)("Show most used blocks")})}),(0,P.jsx)(J_,{title:(0,ms.__)("Manage block visibility"),description:(0,ms.__)("Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later."),children:(0,P.jsx)(q_,{})})]})},window.__experimentalMediaProcessing&&{name:"media",tabLabel:(0,ms.__)("Media"),content:(0,P.jsx)(P.Fragment,{children:(0,P.jsxs)(J_,{title:(0,ms.__)("General"),description:(0,ms.__)("Customize options related to the media upload flow."),children:[(0,P.jsx)(ef,{scope:"core/media",featureName:"optimizeOnUpload",help:(0,ms.__)("Compress media items before uploading to the server."),label:(0,ms.__)("Pre-upload compression")}),(0,P.jsx)(ef,{scope:"core/media",featureName:"requireApproval",help:(0,ms.__)("Require approval step when optimizing existing media."),label:(0,ms.__)("Approval step")})]})})}].filter(Boolean)),[s,e,n,o,i,t,r]);return(0,P.jsx)(X_,{sections:a})}const sf="content",of={name:"core/pattern-overrides",getValues({select:e,clientId:t,context:s,bindings:o}){const n=s["pattern/overrides"],{getBlockAttributes:i}=e(m.store),r=i(t),a={};for(const e of Object.keys(o)){const t=n?.[r?.metadata?.name]?.[e];void 0!==t?a[e]=""===t?void 0:t:a[e]=r[e]}return a},setValues({select:e,dispatch:t,clientId:s,bindings:o}){const{getBlockAttributes:n,getBlockParentsByBlockName:i,getBlocks:r}=e(m.store),a=n(s),l=a?.metadata?.name;if(!l)return;const[c]=i(s,"core/block",!0),d=Object.entries(o).reduce(((e,[t,{newValue:s}])=>(e[t]=s,e)),{});if(!c){const e=s=>{for(const o of s)o.attributes?.metadata?.name===l&&t(m.store).updateBlockAttributes(o.clientId,d),e(o.innerBlocks)};return void e(r())}const u=n(c)?.[sf];t(m.store).updateBlockAttributes(c,{[sf]:{...u,[l]:{...u?.[l],...Object.entries(d).reduce(((e,[t,s])=>(e[t]=void 0===s?"":s,e)),{})}}})},canUserEditValue:()=>!0};function nf(e,t){const{getEditedEntityRecord:s}=e(d.store),{getRegisteredPostMeta:o}=Xo(e(d.store));let n;t?.postType&&t?.postId&&(n=s("postType",t?.postType,t?.postId).meta);const i=o(t?.postType),r={};return Object.entries(i||{}).forEach((([e,t])=>{var s;"footnotes"!==e&&"_"!==e.charAt(0)&&(r[e]={label:t.title||e,value:null!==(s=n?.[e])&&void 0!==s?s:t.default||void 0,type:t.type})})),Object.keys(r||{}).length?r:null}const rf={name:"core/post-meta",getValues({select:e,context:t,bindings:s}){const o=nf(e,t),n={};for(const[e,t]of Object.entries(s)){var i;const s=t.args.key,{value:r,label:a}=o?.[s]||{};n[e]=null!==(i=null!=r?r:a)&&void 0!==i?i:s}return n},setValues({dispatch:e,context:t,bindings:s}){const o={};Object.values(s).forEach((({args:e,newValue:t})=>{o[e.key]=t})),e(d.store).editEntityRecord("postType",t?.postType,t?.postId,{meta:o})},canUserEditValue({select:e,context:t,args:s}){if(t?.query||t?.queryId)return!1;if("wp_template"===(t?.postType||e(Wi).getCurrentPostType()))return!1;const o=nf(e,t)?.[s.key]?.value;if(void 0===o)return!1;if(e(Wi).getEditorSettings().enableCustomFields)return!1;return!!e(d.store).canUser("update",{kind:"postType",name:t?.postType,id:t?.postId})},getFieldsList:({select:e,context:t})=>nf(e,t)};const{store:af,...lf}=l,cf={};function df(e,t,s){const{registerEntityAction:o}=Xo((0,c.dispatch)(Wi))}function uf(e,t,s){const{unregisterEntityAction:o}=Xo((0,c.dispatch)(Wi))}Qo(cf,{CreateTemplatePartModal:Uo,BackButton:eg,EntitiesSavedStatesExtensible:Da,Editor:$_,EditorContentSlotFill:Km,GlobalStylesProvider:function({children:e}){const t=Ap();return t.isReady?(0,P.jsx)(Bp.Provider,{value:t,children:e}):null},mergeBaseAndUserConfigs:Np,PluginPostExcerpt:wc,PostCardPanel:p_,PreferencesModal:function({extraSections:e={}}){const t=(0,c.useSelect)((e=>e(Er).isModalActive("editor/preferences")),[]),{closeModal:s}=(0,c.useDispatch)(Er);return t?(0,P.jsx)(Q_,{closeModal:s,children:(0,P.jsx)(tf,{extraSections:e})}):null},usePostActions:i_,ToolsMoreMenuGroup:hg,ViewMoreMenuGroup:_g,ResizableEditor:zg,registerCoreBlockBindingsSources:function(){(0,y.registerBlockBindingsSource)(of),(0,y.registerBlockBindingsSource)(rf)},interfaceStore:af,...lf})})(),(window.wp=window.wp||{}).editor=o})(); \ No newline at end of file +function Vr(e){return"[object Object]"===Object.prototype.toString.call(e)}function zr(e){var t,s;return!1!==Vr(e)&&(void 0===(t=e.constructor)||!1!==Vr(s=t.prototype)&&!1!==s.hasOwnProperty("isPrototypeOf"))}const{GlobalStylesContext:Ur,cleanEmptyObject:Hr}=$(h.privateApis);function Gr(e,t){return Fr()(e,t,{isMergeableObject:zr,customMerge:e=>{if("backgroundImage"===e)return(e,t)=>t}})}function $r(){const[e,t,s]=function(){const{globalStylesId:e,isReady:t,settings:s,styles:o,_links:n}=(0,c.useSelect)((e=>{const{getEntityRecord:t,getEditedEntityRecord:s,hasFinishedResolution:o,canUser:n}=e(d.store),i=e(d.store).__experimentalGetCurrentGlobalStylesId();let r;const a=i?n("update",{kind:"root",name:"globalStyles",id:i}):null;i&&"boolean"==typeof a&&(r=a?s("root","globalStyles",i):t("root","globalStyles",i,{context:"view"}));let l=!1;return o("__experimentalGetCurrentGlobalStylesId")&&(l=!i||(a?o("getEditedEntityRecord",["root","globalStyles",i]):o("getEntityRecord",["root","globalStyles",i,{context:"view"}]))),{globalStylesId:i,isReady:l,settings:r?.settings,styles:r?.styles,_links:r?._links}}),[]),{getEditedEntityRecord:i}=(0,c.useSelect)(d.store),{editEntityRecord:r}=(0,c.useDispatch)(d.store);return[t,(0,u.useMemo)((()=>({settings:null!=s?s:{},styles:null!=o?o:{},_links:null!=n?n:{}})),[s,o,n]),(0,u.useCallback)(((t,s={})=>{var o,n,a;const l=i("root","globalStyles",e),c={styles:null!==(o=l?.styles)&&void 0!==o?o:{},settings:null!==(n=l?.settings)&&void 0!==n?n:{},_links:null!==(a=l?._links)&&void 0!==a?a:{}},d="function"==typeof t?t(c):t;r("root","globalStyles",e,{styles:Hr(d.styles)||{},settings:Hr(d.settings)||{},_links:Hr(d._links)||{}},s)}),[e,r,i])]}(),[o,n]=function(){const e=(0,c.useSelect)((e=>e(d.store).__experimentalGetCurrentThemeBaseGlobalStyles()),[]);return[!!e,e]}(),i=(0,u.useMemo)((()=>n&&t?Gr(n,t):{}),[t,n]);return(0,u.useMemo)((()=>({isReady:e&&o,user:t,base:n,merged:i,setUserConfig:s})),[i,t,n,s,e,o])}const Wr={};function Zr(e){const{RECEIVE_INTERMEDIATE_RESULTS:t}=$(d.privateApis),{getEntityRecords:s}=e(d.store);return s("postType","wp_block",{per_page:-1,[t]:!0})}const Yr=["__experimentalBlockDirectory","__experimentalDiscussionSettings","__experimentalFeatures","__experimentalGlobalStylesBaseStyles","alignWide","blockInspectorTabs","maxUploadFileSize","allowedMimeTypes","bodyPlaceholder","canLockBlocks","canUpdateBlockBindings","capabilities","clearBlockSelection","codeEditingEnabled","colors","disableCustomColors","disableCustomFontSizes","disableCustomSpacingSizes","disableCustomGradients","disableLayoutStyles","enableCustomLineHeight","enableCustomSpacing","enableCustomUnits","enableOpenverseMediaCategory","fontSizes","gradients","generateAnchors","onNavigateToEntityRecord","imageDefaultSize","imageDimensions","imageEditing","imageSizes","isPreviewMode","isRTL","locale","maxWidth","postContentAttributes","postsPerPage","readOnly","styles","titlePlaceholder","supportsLayout","widgetTypesToHideFromLegacyWidgetBlock","__unstableHasCustomAppender","__unstableResolvedAssets","__unstableIsBlockBasedTheme"],{globalStylesDataKey:Kr,globalStylesLinksDataKey:qr,selectBlockPatternsKey:Qr,reusableBlocksSelectKey:Xr,sectionRootClientIdKey:Jr}=$(h.privateApis);const ea=function(e,t,s,o){var n,i,r,a;const l=(0,p.useViewportMatch)("medium"),{allowRightClickOverrides:m,blockTypes:g,focusMode:_,hasFixedToolbar:f,isDistractionFree:b,keepCaretInsideBlock:x,hasUploadPermissions:v,hiddenBlockTypes:w,canUseUnfilteredHTML:S,userCanCreatePages:C,pageOnFront:P,pageForPosts:j,userPatternCategories:E,restBlockPatternCategories:T,sectionRootClientId:B}=(0,c.useSelect)((e=>{var n;const{canUser:i,getRawEntityRecord:r,getEntityRecord:a,getUserPatternCategories:c,getBlockPatternCategories:u}=e(d.store),{get:p}=e(k.store),{getBlockTypes:m}=e(y.store),{getBlocksByName:g,getBlockAttributes:_}=e(h.store),f=i("read",{kind:"root",name:"site"})?a("root","site"):void 0;return{allowRightClickOverrides:p("core","allowRightClickOverrides"),blockTypes:m(),canUseUnfilteredHTML:r("postType",t,s)?._links?.hasOwnProperty("wp:action-unfiltered-html"),focusMode:p("core","focusMode"),hasFixedToolbar:p("core","fixedToolbar")||!l,hiddenBlockTypes:p("core","hiddenBlockTypes"),isDistractionFree:p("core","distractionFree"),keepCaretInsideBlock:p("core","keepCaretInsideBlock"),hasUploadPermissions:null===(n=i("create",{kind:"root",name:"media"}))||void 0===n||n,userCanCreatePages:i("create",{kind:"postType",name:"page"}),pageOnFront:f?.page_on_front,pageForPosts:f?.page_for_posts,userPatternCategories:c(),restBlockPatternCategories:u(),sectionRootClientId:"template-locked"===o?null!==(x=g("core/post-content")?.[0])&&void 0!==x?x:"":null!==(b=g("core/group").find((e=>"main"===_(e)?.tagName)))&&void 0!==b?b:""};var b,x}),[t,s,l,o]),{merged:I}=$r(),N=null!==(n=I.styles)&&void 0!==n?n:Wr,A=null!==(i=I._links)&&void 0!==i?i:Wr,D=null!==(r=e.__experimentalAdditionalBlockPatterns)&&void 0!==r?r:e.__experimentalBlockPatterns,R=null!==(a=e.__experimentalAdditionalBlockPatternCategories)&&void 0!==a?a:e.__experimentalBlockPatternCategories,M=(0,u.useMemo)((()=>[...D||[]].filter((({postTypes:e})=>!e||Array.isArray(e)&&e.includes(t)))),[D,t]),L=(0,u.useMemo)((()=>[...R||[],...T||[]].filter(((e,t,s)=>t===s.findIndex((t=>e.name===t.name))))),[R,T]),{undo:O,setIsInserterOpened:F}=(0,c.useDispatch)(Tc),{saveEntityRecord:V}=(0,c.useDispatch)(d.store),z=(0,u.useCallback)((e=>C?V("postType","page",e):Promise.reject({message:(0,fs.__)("You do not have permission to create Pages.")})),[V,C]),U=(0,u.useMemo)((()=>{if(w&&w.length>0){return(!0===e.allowedBlockTypes?g.map((({name:e})=>e)):e.allowedBlockTypes||[]).filter((e=>!w.includes(e)))}return e.allowedBlockTypes}),[e.allowedBlockTypes,w,g]),H=!1===e.focusMode;return(0,u.useMemo)((()=>{const s={...Object.fromEntries(Object.entries(e).filter((([e])=>Yr.includes(e)))),[Kr]:N,[qr]:A,allowedBlockTypes:U,allowRightClickOverrides:m,focusMode:_&&!H,hasFixedToolbar:f,isDistractionFree:b,keepCaretInsideBlock:x,mediaUpload:v?Rr:void 0,mediaSideload:v?Lr:void 0,__experimentalBlockPatterns:M,[Qr]:e=>{const{hasFinishedResolution:s,getBlockPatternsForPostType:o}=$(e(d.store)),n=o(t);return s("getBlockPatterns")?n:void 0},[Xr]:Zr,__experimentalBlockPatternCategories:L,__experimentalUserPatternCategories:E,__experimentalFetchLinkSuggestions:(t,s)=>(0,d.__experimentalFetchLinkSuggestions)(t,s,e),inserterMediaCategories:Pr,__experimentalFetchRichUrlData:d.__experimentalFetchUrlData,__experimentalCanUserUseUnfilteredHTML:S,__experimentalUndo:O,outlineMode:!b&&"wp_template"===t,__experimentalCreatePageEntity:z,__experimentalUserCanCreatePages:C,pageOnFront:P,pageForPosts:j,__experimentalPreferPatternsOnRoot:"wp_template"===t,templateLock:"wp_navigation"===t?"insert":e.templateLock,template:"wp_navigation"===t?[["core/navigation",{},[]]]:e.template,__experimentalSetIsInserterOpened:F,[Jr]:B,editorTool:"post-only"===o&&"wp_template"!==t?"edit":void 0};return s}),[U,m,_,H,f,b,x,e,v,E,M,L,S,O,z,C,P,j,t,F,B,N,A,o])},ta=["core/post-title","core/post-featured-image","core/post-content"];function sa(){const e=(0,u.useMemo)((()=>[...(0,m.applyFilters)("editor.postContentBlockTypes",ta)]),[]),t=(0,c.useSelect)((t=>{const{getPostBlocksByName:s}=$(t(Tc));return s(e)}),[e]);return t}function oa(){const e=sa(),{templateParts:t,isNavigationMode:s}=(0,c.useSelect)((e=>{const{getBlocksByName:t,isNavigationMode:s}=e(h.store);return{templateParts:t("core/template-part"),isNavigationMode:s()}}),[]),o=(0,c.useSelect)((e=>{const{getBlockOrder:s}=e(h.store);return t.flatMap((e=>s(e)))}),[t]),n=(0,c.useRegistry)();return(0,u.useEffect)((()=>{const{setBlockEditingMode:e,unsetBlockEditingMode:t}=n.dispatch(h.store);return e("","disabled"),()=>{t("")}}),[n]),(0,u.useEffect)((()=>{const{setBlockEditingMode:t,unsetBlockEditingMode:s}=n.dispatch(h.store);return n.batch((()=>{for(const s of e)t(s,"contentOnly")})),()=>{n.batch((()=>{for(const t of e)s(t)}))}}),[e,n]),(0,u.useEffect)((()=>{const{setBlockEditingMode:e,unsetBlockEditingMode:o}=n.dispatch(h.store);return n.batch((()=>{if(!s)for(const s of t)e(s,"contentOnly")})),()=>{n.batch((()=>{if(!s)for(const e of t)o(e)}))}}),[t,s,n]),(0,u.useEffect)((()=>{const{setBlockEditingMode:e,unsetBlockEditingMode:t}=n.dispatch(h.store);return n.batch((()=>{for(const t of o)e(t,"disabled")})),()=>{n.batch((()=>{for(const e of o)t(e)}))}}),[o,n]),null}function na(){const e=(0,c.useSelect)((e=>e(h.store).getBlockOrder()?.[0]),[]),{setBlockEditingMode:t,unsetBlockEditingMode:s}=(0,c.useDispatch)(h.store);(0,u.useEffect)((()=>{if(e)return t(e,"contentOnly"),()=>{s(e)}}),[e,s,t])}const ia=["wp_block","wp_template","wp_template_part"];const ra=(0,L.jsxs)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,L.jsx)(M.Path,{d:"m16 15.5h-8v-1.5h8zm-7.5-2.5h-2v-2h2zm3 0h-2v-2h2zm3 0h-2v-2h2zm3 0h-2v-2h2zm-9-3h-2v-2h2zm3 0h-2v-2h2zm3 0h-2v-2h2zm3 0h-2v-2h2z"}),(0,L.jsx)(M.Path,{d:"m18.5 6.5h-13a.5.5 0 0 0 -.5.5v9.5a.5.5 0 0 0 .5.5h13a.5.5 0 0 0 .5-.5v-9.5a.5.5 0 0 0 -.5-.5zm-13-1.5h13a2 2 0 0 1 2 2v9.5a2 2 0 0 1 -2 2h-13a2 2 0 0 1 -2-2v-9.5a2 2 0 0 1 2-2z"})]}),aa=(0,L.jsx)(M.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,L.jsx)(M.Path,{d:"M3 6h11v1.5H3V6Zm3.5 5.5h11V13h-11v-1.5ZM21 17H10v1.5h11V17Z"})}),la=(0,L.jsx)(M.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,L.jsx)(M.Path,{d:"M20.8 10.7l-4.3-4.3-1.1 1.1 4.3 4.3c.1.1.1.3 0 .4l-4.3 4.3 1.1 1.1 4.3-4.3c.7-.8.7-1.9 0-2.6zM4.2 11.8l4.3-4.3-1-1-4.3 4.3c-.7.7-.7 1.8 0 2.5l4.3 4.3 1.1-1.1-4.3-4.3c-.2-.1-.2-.3-.1-.4z"})}),ca=(0,L.jsx)(M.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zM8.5 18.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h2.5v13zm10-.5c0 .3-.2.5-.5.5h-8v-13h8c.3 0 .5.2.5.5v12z"})}),da=(0,L.jsx)(M.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4 14.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h8v13zm4.5-.5c0 .3-.2.5-.5.5h-2.5v-13H18c.3 0 .5.2.5.5v12z"})}),ua=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.Path,{d:"M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z"})}),pa=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.Path,{d:"M11.1 15.8H20v-1.5h-8.9v1.5zm0-8.6v1.5H20V7.2h-8.9zM6 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-7c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})}),ma=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.Path,{d:"m19 7-3-3-8.5 8.5-1 4 4-1L19 7Zm-7 11.5H5V20h7v-1.5Z"})}),ha=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.Path,{d:"M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-1 1.4l-5.6 5.6c-.1.1-.3.1-.4 0l-5.6-5.6c-.1-.1-.1-.3 0-.4l5.6-5.6s.1-.1.2-.1.1 0 .2.1l5.6 5.6c.1.1.1.3 0 .4zm-16.6-.4L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"})}),ga=(0,L.jsxs)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,L.jsx)(M.Path,{d:"M15.5 7.5h-7V9h7V7.5Zm-7 3.5h7v1.5h-7V11Zm7 3.5h-7V16h7v-1.5Z"}),(0,L.jsx)(M.Path,{d:"M17 4H7a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2ZM7 5.5h10a.5.5 0 0 1 .5.5v12a.5.5 0 0 1-.5.5H7a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .5-.5Z"})]}),_a=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.Path,{d:"M15.1 4.8l-3-2.5V4c-4.4 0-8 3.6-8 8 0 3.7 2.5 6.9 6 7.7.3.1.6.1 1 .2l.2-1.5c-.4 0-.7-.1-1.1-.2l-.1.2v-.2c-2.6-.8-4.5-3.3-4.5-6.2 0-3.6 2.9-6.5 6.5-6.5v1.8l3-2.5zM20 11c-.2-1.4-.7-2.7-1.6-3.8l-1.2.8c.7.9 1.1 2 1.3 3.1L20 11zm-1.5 1.8c-.1.5-.2 1.1-.4 1.6s-.5 1-.8 1.5l1.2.9c.4-.5.8-1.1 1-1.8s.5-1.3.5-2l-1.5-.2zm-5.6 5.6l.2 1.5c1.4-.2 2.7-.7 3.8-1.6l-.9-1.1c-.9.7-2 1.1-3.1 1.2z"})}),fa=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.Path,{d:"M12 4V2.2L9 4.8l3 2.5V5.5c3.6 0 6.5 2.9 6.5 6.5 0 2.9-1.9 5.3-4.5 6.2v.2l-.1-.2c-.4.1-.7.2-1.1.2l.2 1.5c.3 0 .6-.1 1-.2 3.5-.9 6-4 6-7.7 0-4.4-3.6-8-8-8zm-7.9 7l1.5.2c.1-1.2.5-2.3 1.2-3.2l-1.1-.9C4.8 8.2 4.3 9.6 4.1 11zm1.5 1.8l-1.5.2c.1.7.3 1.4.5 2 .3.7.6 1.3 1 1.8l1.2-.8c-.3-.5-.6-1-.8-1.5s-.4-1.1-.4-1.7zm1.5 5.5c1.1.9 2.4 1.4 3.8 1.6l.2-1.5c-1.1-.1-2.2-.5-3.1-1.2l-.9 1.1z"})}),ba=window.wp.commands,ya=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.Path,{d:"M11.776 4.454a.25.25 0 01.448 0l2.069 4.192a.25.25 0 00.188.137l4.626.672a.25.25 0 01.139.426l-3.348 3.263a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.362.263l-4.138-2.175a.25.25 0 00-.232 0l-4.138 2.175a.25.25 0 01-.363-.263l.79-4.607a.25.25 0 00-.071-.222L4.754 9.881a.25.25 0 01.139-.426l4.626-.672a.25.25 0 00.188-.137l2.069-4.192z"})}),xa=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.Path,{fillRule:"evenodd",d:"M9.706 8.646a.25.25 0 01-.188.137l-4.626.672a.25.25 0 00-.139.427l3.348 3.262a.25.25 0 01.072.222l-.79 4.607a.25.25 0 00.362.264l4.138-2.176a.25.25 0 01.233 0l4.137 2.175a.25.25 0 00.363-.263l-.79-4.607a.25.25 0 01.072-.222l3.347-3.262a.25.25 0 00-.139-.427l-4.626-.672a.25.25 0 01-.188-.137l-2.069-4.192a.25.25 0 00-.448 0L9.706 8.646zM12 7.39l-.948 1.921a1.75 1.75 0 01-1.317.957l-2.12.308 1.534 1.495c.412.402.6.982.503 1.55l-.362 2.11 1.896-.997a1.75 1.75 0 011.629 0l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39z",clipRule:"evenodd"})}),va=window.wp.viewport,wa=window.wp.plugins;function Sa(e){return["core/edit-post","core/edit-site"].includes(e)?(S()(`${e} interface scope`,{alternative:"core interface scope",hint:"core/edit-post and core/edit-site are merging.",version:"6.6"}),"core"):e}function ka(e,t){return"core"===e&&"edit-site/template"===t?(S()("edit-site/template sidebar",{alternative:"edit-post/document",version:"6.6"}),"edit-post/document"):"core"===e&&"edit-site/block-inspector"===t?(S()("edit-site/block-inspector sidebar",{alternative:"edit-post/block",version:"6.6"}),"edit-post/block"):t}const Ca=(e,t)=>({type:"SET_DEFAULT_COMPLEMENTARY_AREA",scope:e=Sa(e),area:t=ka(e,t)}),Pa=(e,t)=>({registry:s,dispatch:o})=>{if(!t)return;e=Sa(e),t=ka(e,t);s.select(k.store).get(e,"isComplementaryAreaVisible")||s.dispatch(k.store).set(e,"isComplementaryAreaVisible",!0),o({type:"ENABLE_COMPLEMENTARY_AREA",scope:e,area:t})},ja=e=>({registry:t})=>{e=Sa(e);t.select(k.store).get(e,"isComplementaryAreaVisible")&&t.dispatch(k.store).set(e,"isComplementaryAreaVisible",!1)},Ea=(e,t)=>({registry:s})=>{if(!t)return;e=Sa(e),t=ka(e,t);const o=s.select(k.store).get(e,"pinnedItems");!0!==o?.[t]&&s.dispatch(k.store).set(e,"pinnedItems",{...o,[t]:!0})},Ta=(e,t)=>({registry:s})=>{if(!t)return;e=Sa(e),t=ka(e,t);const o=s.select(k.store).get(e,"pinnedItems");s.dispatch(k.store).set(e,"pinnedItems",{...o,[t]:!1})};function Ba(e,t){return function({registry:s}){S()("dispatch( 'core/interface' ).toggleFeature",{since:"6.0",alternative:"dispatch( 'core/preferences' ).toggle"}),s.dispatch(k.store).toggle(e,t)}}function Ia(e,t,s){return function({registry:o}){S()("dispatch( 'core/interface' ).setFeatureValue",{since:"6.0",alternative:"dispatch( 'core/preferences' ).set"}),o.dispatch(k.store).set(e,t,!!s)}}function Na(e,t){return function({registry:s}){S()("dispatch( 'core/interface' ).setFeatureDefaults",{since:"6.0",alternative:"dispatch( 'core/preferences' ).setDefaults"}),s.dispatch(k.store).setDefaults(e,t)}}function Aa(e){return{type:"OPEN_MODAL",name:e}}function Da(){return{type:"CLOSE_MODAL"}}const Ra=(0,c.createRegistrySelector)((e=>(t,s)=>{s=Sa(s);const o=e(k.store).get(s,"isComplementaryAreaVisible");if(void 0!==o)return!1===o?null:t?.complementaryAreas?.[s]})),Ma=(0,c.createRegistrySelector)((e=>(t,s)=>{s=Sa(s);const o=e(k.store).get(s,"isComplementaryAreaVisible"),n=t?.complementaryAreas?.[s];return o&&void 0===n})),La=(0,c.createRegistrySelector)((e=>(t,s,o)=>{var n;o=ka(s=Sa(s),o);const i=e(k.store).get(s,"pinnedItems");return null===(n=i?.[o])||void 0===n||n})),Oa=(0,c.createRegistrySelector)((e=>(t,s,o)=>(S()("select( 'core/interface' ).isFeatureActive( scope, featureName )",{since:"6.0",alternative:"select( 'core/preferences' ).get( scope, featureName )"}),!!e(k.store).get(s,o))));function Fa(e,t){return e.activeModal===t}const Va=(0,c.combineReducers)({complementaryAreas:function(e={},t){switch(t.type){case"SET_DEFAULT_COMPLEMENTARY_AREA":{const{scope:s,area:o}=t;return e[s]?e:{...e,[s]:o}}case"ENABLE_COMPLEMENTARY_AREA":{const{scope:s,area:o}=t;return{...e,[s]:o}}}return e},activeModal:function(e=null,t){switch(t.type){case"OPEN_MODAL":return t.name;case"CLOSE_MODAL":return null}return e}}),za=(0,c.createReduxStore)("core/interface",{reducer:Va,actions:n,selectors:i});function Ua({as:e=Uo.Button,scope:t,identifier:s,icon:o,selectedIcon:n,name:i,shortcut:r,...a}){const l=e,d=(0,wa.usePluginContext)(),u=o||d.icon,p=s||`${d.name}/${i}`,m=(0,c.useSelect)((e=>e(za).getActiveComplementaryArea(t)===p),[p,t]),{enableComplementaryArea:h,disableComplementaryArea:g}=(0,c.useDispatch)(za);return(0,L.jsx)(l,{icon:n&&m?n:u,"aria-controls":p.replace("/",":"),"aria-checked":(_=a.role,["checkbox","option","radio","switch","menuitemcheckbox","menuitemradio","treeitem"].includes(_)?m:void 0),onClick:()=>{m?g(t):h(t,p)},shortcut:r,...a});var _}(0,c.register)(za);const Ha=({children:e,className:t,toggleButtonProps:s})=>{const o=(0,L.jsx)(Ua,{icon:Bn,...s});return(0,L.jsxs)("div",{className:Ai("components-panel__header","interface-complementary-area-header",t),tabIndex:-1,children:[e,o]})},Ga=()=>{};function $a({name:e,as:t=Uo.Button,onClick:s,...o}){return(0,L.jsx)(Uo.Fill,{name:e,children:({onClick:e})=>(0,L.jsx)(t,{onClick:s||e?(...t)=>{(s||Ga)(...t),(e||Ga)(...t)}:void 0,...o})})}$a.Slot=function({name:e,as:t=Uo.MenuGroup,fillProps:s={},bubblesVirtually:o,...n}){return(0,L.jsx)(Uo.Slot,{name:e,bubblesVirtually:o,fillProps:s,children:e=>{if(!u.Children.toArray(e).length)return null;const s=[];u.Children.forEach(e,(({props:{__unstableExplicitMenuItem:e,__unstableTarget:t}})=>{t&&e&&s.push(t)}));const o=u.Children.map(e,(e=>!e.props.__unstableExplicitMenuItem&&s.includes(e.props.__unstableTarget)?null:e));return(0,L.jsx)(t,{...n,children:o})}})};const Wa=$a,Za=({__unstableExplicitMenuItem:e,__unstableTarget:t,...s})=>(0,L.jsx)(Uo.MenuItem,{...s});function Ya({scope:e,target:t,__unstableExplicitMenuItem:s,...o}){return(0,L.jsx)(Ua,{as:o=>(0,L.jsx)(Wa,{__unstableExplicitMenuItem:s,__unstableTarget:`${e}/${t}`,as:Za,name:`${e}/plugin-more-menu`,...o}),role:"menuitemcheckbox",selectedIcon:Ho,name:t,scope:e,...o})}function Ka({scope:e,...t}){return(0,L.jsx)(Uo.Fill,{name:`PinnedItems/${e}`,...t})}Ka.Slot=function({scope:e,className:t,...s}){return(0,L.jsx)(Uo.Slot,{name:`PinnedItems/${e}`,...s,children:e=>e?.length>0&&(0,L.jsx)("div",{className:Ai(t,"interface-pinned-items"),children:e})})};const qa=Ka;const Qa={open:{width:280},closed:{width:0},mobileOpen:{width:"100vw"}};function Xa({activeArea:e,isActive:t,scope:s,children:o,className:n,id:i}){const r=(0,p.useReducedMotion)(),a=(0,p.useViewportMatch)("medium","<"),l=(0,p.usePrevious)(e),c=(0,p.usePrevious)(t),[,d]=(0,u.useState)({});(0,u.useEffect)((()=>{d({})}),[t]);const m={type:"tween",duration:r||a||l&&e&&e!==l?0:.3,ease:[.6,0,.4,1]};return(0,L.jsx)(Uo.Fill,{name:`ComplementaryArea/${s}`,children:(0,L.jsx)(Uo.__unstableAnimatePresence,{initial:!1,children:(c||t)&&(0,L.jsx)(Uo.__unstableMotion.div,{variants:Qa,initial:"closed",animate:a?"mobileOpen":"open",exit:"closed",transition:m,className:"interface-complementary-area__fill",children:(0,L.jsx)("div",{id:i,className:n,style:{width:a?"100vw":280},children:o})})})})}function Ja({children:e,className:t,closeLabel:s=(0,fs.__)("Close plugin"),identifier:o,header:n,headerClassName:i,icon:r,isPinnable:a=!0,panelClassName:l,scope:d,name:m,title:h,toggleShortcut:g,isActiveByDefault:_}){const f=(0,wa.usePluginContext)(),b=r||f.icon,y=o||`${f.name}/${m}`,[x,v]=(0,u.useState)(!1),{isLoading:w,isActive:S,isPinned:C,activeArea:P,isSmall:j,isLarge:E,showIconLabels:T}=(0,c.useSelect)((e=>{const{getActiveComplementaryArea:t,isComplementaryAreaLoading:s,isItemPinned:o}=e(za),{get:n}=e(k.store),i=t(d);return{isLoading:s(d),isActive:i===y,isPinned:o(d,y),activeArea:i,isSmall:e(va.store).isViewportMatch("< medium"),isLarge:e(va.store).isViewportMatch("large"),showIconLabels:n("core","showIconLabels")}}),[y,d]),B=(0,p.useViewportMatch)("medium","<");!function(e,t,s,o,n){const i=(0,u.useRef)(!1),r=(0,u.useRef)(!1),{enableComplementaryArea:a,disableComplementaryArea:l}=(0,c.useDispatch)(za);(0,u.useEffect)((()=>{o&&n&&!i.current?(l(e),r.current=!0):r.current&&!n&&i.current?(r.current=!1,a(e,t)):r.current&&s&&s!==t&&(r.current=!1),n!==i.current&&(i.current=n)}),[o,n,e,t,s,l,a])}(d,y,P,S,j);const{enableComplementaryArea:I,disableComplementaryArea:N,pinItem:A,unpinItem:D}=(0,c.useDispatch)(za);if((0,u.useEffect)((()=>{_&&void 0===P&&!j?I(d,y):void 0===P&&j&&N(d,y),v(!0)}),[P,_,d,y,j,I,N]),x)return(0,L.jsxs)(L.Fragment,{children:[a&&(0,L.jsx)(qa,{scope:d,children:C&&(0,L.jsx)(Ua,{scope:d,identifier:y,isPressed:S&&(!T||E),"aria-expanded":S,"aria-disabled":w,label:h,icon:T?Ho:b,showTooltip:!T,variant:T?"tertiary":void 0,size:"compact",shortcut:g})}),m&&a&&(0,L.jsx)(Ya,{target:m,scope:d,icon:b,children:h}),(0,L.jsxs)(Xa,{activeArea:P,isActive:S,className:Ai("interface-complementary-area",t),scope:d,id:y.replace("/",":"),children:[(0,L.jsx)(Ha,{className:i,closeLabel:s,onClose:()=>N(d),toggleButtonProps:{label:s,size:"compact",shortcut:g,scope:d,identifier:y},children:n||(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)("h2",{className:"interface-complementary-area-header__title",children:h}),a&&!B&&(0,L.jsx)(Uo.Button,{className:"interface-complementary-area__pin-unpin-item",icon:C?ya:xa,label:C?(0,fs.__)("Unpin from toolbar"):(0,fs.__)("Pin to toolbar"),onClick:()=>(C?D:A)(d,y),isPressed:C,"aria-expanded":C,size:"compact"})]})}),(0,L.jsx)(Uo.Panel,{className:l,children:e})]})]})}Ja.Slot=function({scope:e,...t}){return(0,L.jsx)(Uo.Slot,{name:`ComplementaryArea/${e}`,...t})};const el=Ja,tl=({isActive:e})=>((0,u.useEffect)((()=>{let e=!1;return document.body.classList.contains("sticky-menu")&&(e=!0,document.body.classList.remove("sticky-menu")),()=>{e&&document.body.classList.add("sticky-menu")}}),[]),(0,u.useEffect)((()=>(e?document.body.classList.add("is-fullscreen-mode"):document.body.classList.remove("is-fullscreen-mode"),()=>{e&&document.body.classList.remove("is-fullscreen-mode")})),[e]),null),sl=(0,u.forwardRef)((({children:e,className:t,ariaLabel:s,as:o="div",...n},i)=>(0,L.jsx)(o,{ref:i,className:Ai("interface-navigable-region",t),"aria-label":s,role:"region",tabIndex:"-1",...n,children:e})));sl.displayName="NavigableRegion";const ol=sl,nl={type:"tween",duration:.25,ease:[.6,0,.4,1]};const il={hidden:{opacity:1,marginTop:-60},visible:{opacity:1,marginTop:0},distractionFreeHover:{opacity:1,marginTop:0,transition:{...nl,delay:.2,delayChildren:.2}},distractionFreeHidden:{opacity:0,marginTop:-60},distractionFreeDisabled:{opacity:0,marginTop:0,transition:{...nl,delay:.8,delayChildren:.8}}};const rl=(0,u.forwardRef)((function({isDistractionFree:e,footer:t,header:s,editorNotices:o,sidebar:n,secondarySidebar:i,content:r,actions:a,labels:l,className:c},d){const[m,h]=(0,p.useResizeObserver)(),g=(0,p.useViewportMatch)("medium","<"),_={type:"tween",duration:(0,p.useReducedMotion)()?0:.25,ease:[.6,0,.4,1]};!function(e){(0,u.useEffect)((()=>{const t=document&&document.querySelector(`html:not(.${e})`);if(t)return t.classList.toggle(e),()=>{t.classList.toggle(e)}}),[e])}("interface-interface-skeleton__html-container");const f={...{header:(0,fs._x)("Header","header landmark area"),body:(0,fs.__)("Content"),secondarySidebar:(0,fs.__)("Block Library"),sidebar:(0,fs._x)("Settings","settings landmark area"),actions:(0,fs.__)("Publish"),footer:(0,fs.__)("Footer")},...l};return(0,L.jsxs)("div",{ref:d,className:Ai(c,"interface-interface-skeleton",!!t&&"has-footer"),children:[(0,L.jsxs)("div",{className:"interface-interface-skeleton__editor",children:[(0,L.jsx)(Uo.__unstableAnimatePresence,{initial:!1,children:!!s&&(0,L.jsx)(ol,{as:Uo.__unstableMotion.div,className:"interface-interface-skeleton__header","aria-label":f.header,initial:e&&!g?"distractionFreeHidden":"hidden",whileHover:e&&!g?"distractionFreeHover":"visible",animate:e&&!g?"distractionFreeDisabled":"visible",exit:e&&!g?"distractionFreeHidden":"hidden",variants:il,transition:_,children:s})}),e&&(0,L.jsx)("div",{className:"interface-interface-skeleton__header",children:o}),(0,L.jsxs)("div",{className:"interface-interface-skeleton__body",children:[(0,L.jsx)(Uo.__unstableAnimatePresence,{initial:!1,children:!!i&&(0,L.jsx)(ol,{className:"interface-interface-skeleton__secondary-sidebar",ariaLabel:f.secondarySidebar,as:Uo.__unstableMotion.div,initial:"closed",animate:"open",exit:"closed",variants:{open:{width:h.width},closed:{width:0}},transition:_,children:(0,L.jsxs)(Uo.__unstableMotion.div,{style:{position:"absolute",width:g?"100vw":"fit-content",height:"100%",left:0},variants:{open:{x:0},closed:{x:"-100%"}},transition:_,children:[m,i]})})}),(0,L.jsx)(ol,{className:"interface-interface-skeleton__content",ariaLabel:f.body,children:r}),!!n&&(0,L.jsx)(ol,{className:"interface-interface-skeleton__sidebar",ariaLabel:f.sidebar,children:n}),!!a&&(0,L.jsx)(ol,{className:"interface-interface-skeleton__actions",ariaLabel:f.actions,children:a})]})]}),!!t&&(0,L.jsx)(ol,{className:"interface-interface-skeleton__footer",ariaLabel:f.footer,children:t})]})})),{RenamePatternModal:al}=$(ln.privateApis),ll="editor/pattern-rename";function cl(){const{record:e,postType:t}=(0,c.useSelect)((e=>{const{getCurrentPostType:t,getCurrentPostId:s}=e(Tc),{getEditedEntityRecord:o}=e(d.store),n=t();return{record:o("postType",n,s()),postType:n}}),[]),{closeModal:s}=(0,c.useDispatch)(za);return(0,c.useSelect)((e=>e(za).isModalActive(ll)))&&t===I?(0,L.jsx)(al,{onClose:s,pattern:e}):null}const{DuplicatePatternModal:dl}=$(ln.privateApis),ul="editor/pattern-duplicate";function pl(){const{record:e,postType:t}=(0,c.useSelect)((e=>{const{getCurrentPostType:t,getCurrentPostId:s}=e(Tc),{getEditedEntityRecord:o}=e(d.store),n=t();return{record:o("postType",n,s()),postType:n}}),[]),{closeModal:s}=(0,c.useDispatch)(za);return(0,c.useSelect)((e=>e(za).isModalActive(ul)))&&t===I?(0,L.jsx)(dl,{onClose:s,onSuccess:()=>s(),pattern:e}):null}const{BlockRemovalWarningModal:ml}=$(h.privateApis),hl=["core/post-content","core/post-template","core/query"],gl=[{postTypes:["wp_template","wp_template_part"],callback(e){if(e.filter((({name:e})=>hl.includes(e))).length)return(0,fs._n)("Deleting this block will stop your post or page content from displaying on this template. It is not recommended.","Some of the deleted blocks will stop your post or page content from displaying on this template. It is not recommended.",e.length)}},{postTypes:["wp_block"],callback(e){if(e.filter((({attributes:e})=>e?.metadata?.bindings&&Object.values(e.metadata.bindings).some((e=>"core/pattern-overrides"===e.source)))).length)return(0,fs._n)("The deleted block allows instance overrides. Removing it may result in content not displaying where this pattern is used. Are you sure you want to proceed?","Some of the deleted blocks allow instance overrides. Removing them may result in content not displaying where this pattern is used. Are you sure you want to proceed?",e.length)}}];function _l(){const e=(0,c.useSelect)((e=>e(Tc).getCurrentPostType()),[]),t=(0,u.useMemo)((()=>gl.filter((t=>t.postTypes.includes(e)))),[e]);return ml&&t?(0,L.jsx)(ml,{rules:t}):null}function fl(){const{postId:e,enabled:t}=(0,c.useSelect)((e=>{const{getCurrentPostId:t,getCurrentPostType:s}=e(Tc),o=e(za).isModalActive("editor/preferences"),n=e(k.store).get("core","enableChoosePatternModal");return{postId:t(),enabled:n&&!o&&"page"===s()}}),[]),{isEditedPostDirty:s,isEditedPostEmpty:o}=(0,c.useSelect)(Tc),{setIsInserterOpened:n}=(0,c.useDispatch)(Tc);return(0,u.useEffect)((()=>{if(!t)return;!s()&&o()&&n({tab:"patterns",category:"core/starter-content"})}),[e,t,n,s,o]),null}const bl=window.wp.keyboardShortcuts,yl=[{keyCombination:{modifier:"primary",character:"b"},description:(0,fs.__)("Make the selected text bold.")},{keyCombination:{modifier:"primary",character:"i"},description:(0,fs.__)("Make the selected text italic.")},{keyCombination:{modifier:"primary",character:"k"},description:(0,fs.__)("Convert the selected text into a link.")},{keyCombination:{modifier:"primaryShift",character:"k"},description:(0,fs.__)("Remove a link.")},{keyCombination:{character:"[["},description:(0,fs.__)("Insert a link to a post or page.")},{keyCombination:{modifier:"primary",character:"u"},description:(0,fs.__)("Underline the selected text.")},{keyCombination:{modifier:"access",character:"d"},description:(0,fs.__)("Strikethrough the selected text.")},{keyCombination:{modifier:"access",character:"x"},description:(0,fs.__)("Make the selected text inline code.")},{keyCombination:{modifier:"access",character:"0"},aliases:[{modifier:"access",character:"7"}],description:(0,fs.__)("Convert the current heading to a paragraph.")},{keyCombination:{modifier:"access",character:"1-6"},description:(0,fs.__)("Convert the current paragraph or heading to a heading of level 1 to 6.")},{keyCombination:{modifier:"primaryShift",character:"SPACE"},description:(0,fs.__)("Add non breaking space.")}],xl=window.wp.keycodes;function vl({keyCombination:e,forceAriaLabel:t}){const s=e.modifier?xl.displayShortcutList[e.modifier](e.character):e.character,o=e.modifier?xl.shortcutAriaLabel[e.modifier](e.character):e.character;return(0,L.jsx)("kbd",{className:"editor-keyboard-shortcut-help-modal__shortcut-key-combination","aria-label":t||o,children:(Array.isArray(s)?s:[s]).map(((e,t)=>"+"===e?(0,L.jsx)(u.Fragment,{children:e},t):(0,L.jsx)("kbd",{className:"editor-keyboard-shortcut-help-modal__shortcut-key",children:e},t)))})}const wl=function({description:e,keyCombination:t,aliases:s=[],ariaLabel:o}){return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)("div",{className:"editor-keyboard-shortcut-help-modal__shortcut-description",children:e}),(0,L.jsxs)("div",{className:"editor-keyboard-shortcut-help-modal__shortcut-term",children:[(0,L.jsx)(vl,{keyCombination:t,forceAriaLabel:o}),s.map(((e,t)=>(0,L.jsx)(vl,{keyCombination:e,forceAriaLabel:o},t)))]})]})};const Sl=function({name:e}){const{keyCombination:t,description:s,aliases:o}=(0,c.useSelect)((t=>{const{getShortcutKeyCombination:s,getShortcutDescription:o,getShortcutAliases:n}=t(bl.store);return{keyCombination:s(e),aliases:n(e),description:o(e)}}),[e]);return t?(0,L.jsx)(wl,{keyCombination:t,description:s,aliases:o}):null},kl="editor/keyboard-shortcut-help",Cl=({shortcuts:e})=>(0,L.jsx)("ul",{className:"editor-keyboard-shortcut-help-modal__shortcut-list",role:"list",children:e.map(((e,t)=>(0,L.jsx)("li",{className:"editor-keyboard-shortcut-help-modal__shortcut",children:"string"==typeof e?(0,L.jsx)(Sl,{name:e}):(0,L.jsx)(wl,{...e})},t)))}),Pl=({title:e,shortcuts:t,className:s})=>(0,L.jsxs)("section",{className:Ai("editor-keyboard-shortcut-help-modal__section",s),children:[!!e&&(0,L.jsx)("h2",{className:"editor-keyboard-shortcut-help-modal__section-title",children:e}),(0,L.jsx)(Cl,{shortcuts:t})]}),jl=({title:e,categoryName:t,additionalShortcuts:s=[]})=>{const o=(0,c.useSelect)((e=>e(bl.store).getCategoryShortcuts(t)),[t]);return(0,L.jsx)(Pl,{title:e,shortcuts:o.concat(s)})};const El=function(){const e=(0,c.useSelect)((e=>e(za).isModalActive(kl)),[]),{openModal:t,closeModal:s}=(0,c.useDispatch)(za),o=()=>{e?s():t(kl)};return(0,bl.useShortcut)("core/editor/keyboard-shortcuts",o),e?(0,L.jsxs)(Uo.Modal,{className:"editor-keyboard-shortcut-help-modal",title:(0,fs.__)("Keyboard shortcuts"),closeButtonLabel:(0,fs.__)("Close"),onRequestClose:o,children:[(0,L.jsx)(Pl,{className:"editor-keyboard-shortcut-help-modal__main-shortcuts",shortcuts:["core/editor/keyboard-shortcuts"]}),(0,L.jsx)(jl,{title:(0,fs.__)("Global shortcuts"),categoryName:"global"}),(0,L.jsx)(jl,{title:(0,fs.__)("Selection shortcuts"),categoryName:"selection"}),(0,L.jsx)(jl,{title:(0,fs.__)("Block shortcuts"),categoryName:"block",additionalShortcuts:[{keyCombination:{character:"/"},description:(0,fs.__)("Change the block type after adding a new paragraph."),ariaLabel:(0,fs.__)("Forward-slash")}]}),(0,L.jsx)(Pl,{title:(0,fs.__)("Text formatting"),shortcuts:yl}),(0,L.jsx)(jl,{title:(0,fs.__)("List View shortcuts"),categoryName:"list-view"})]}):null};function Tl({clientId:e,onClose:t}){const s=sa(),{entity:o,onNavigateToEntityRecord:n,canEditTemplates:i}=(0,c.useSelect)((t=>{const{getBlockParentsByBlockName:o,getSettings:n,getBlockAttributes:i,getBlockParents:r}=t(h.store),{getCurrentTemplateId:a,getRenderingMode:l}=t(Tc),c=o(e,"core/block",!0)[0];let u;if(c?u=t(d.store).getEntityRecord("postType","wp_block",i(c).ref):"template-locked"!==l()||r(e).some((e=>s.includes(e)))||(u=t(d.store).getEntityRecord("postType","wp_template",a())),!u)return{};return{canEditTemplates:t(d.store).canUser("create",{kind:"postType",name:"wp_template"}),entity:u,onNavigateToEntityRecord:n().onNavigateToEntityRecord}}),[e,s]);if(!o)return(0,L.jsx)(Bl,{clientId:e,onClose:t});const r="wp_block"===o.type;let a=r?(0,fs.__)("Edit the pattern to move, delete, or make further changes to this block."):(0,fs.__)("Edit the template to move, delete, or make further changes to this block.");return i||(a=(0,fs.__)("Only users with permissions to edit the template can move or delete this block")),(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(h.__unstableBlockSettingsMenuFirstItem,{children:(0,L.jsx)(Uo.MenuItem,{onClick:()=>{n({postId:o.id,postType:o.type})},disabled:!i,children:r?(0,fs.__)("Edit pattern"):(0,fs.__)("Edit template")})}),(0,L.jsx)(Uo.__experimentalText,{variant:"muted",as:"p",className:"editor-content-only-settings-menu__description",children:a})]})}function Bl({clientId:e,onClose:t}){const{contentLockingParent:s}=(0,c.useSelect)((t=>{const{getContentLockingParent:s}=$(t(h.store));return{contentLockingParent:s(e)}}),[e]),o=(0,h.useBlockDisplayInformation)(s),n=(0,c.useDispatch)(h.store);if(!o?.title)return null;const{modifyContentLockBlock:i}=$(n);return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(h.__unstableBlockSettingsMenuFirstItem,{children:(0,L.jsx)(Uo.MenuItem,{onClick:()=>{i(s),t()},children:(0,fs._x)("Unlock","Unlock content locked blocks")})}),(0,L.jsx)(Uo.__experimentalText,{variant:"muted",as:"p",className:"editor-content-only-settings-menu__description",children:(0,fs.__)("Temporarily unlock the parent block to edit, delete or make further changes to this block.")})]})}function Il(){return(0,L.jsx)(h.BlockSettingsMenuControls,{children:({selectedClientIds:e,onClose:t})=>1===e.length&&(0,L.jsx)(Tl,{clientId:e[0],onClose:t})})}function Nl(e){const{slug:t,patterns:s}=(0,c.useSelect)((e=>{const{getCurrentPostType:t,getCurrentPostId:s}=e(Tc),{getEntityRecord:o,getBlockPatterns:n}=e(d.store),i=s();return{slug:o("postType",t(),i).slug,patterns:n()}}),[]),o=(0,c.useSelect)((e=>e(d.store).getCurrentTheme().stylesheet));return(0,u.useMemo)((()=>[{name:"fallback",blocks:(0,y.parse)(e),title:(0,fs.__)("Fallback content")},...s.filter((e=>Array.isArray(e.templateTypes)&&e.templateTypes.some((e=>t.startsWith(e))))).map((e=>({...e,blocks:(0,y.parse)(e.content).map((e=>function(e){return e.innerBlocks.find((e=>"core/template-part"===e.name))&&(e.innerBlocks=e.innerBlocks.map((e=>("core/template-part"===e.name&&void 0===e.attributes.theme&&(e.attributes.theme=o),e)))),"core/template-part"===e.name&&void 0===e.attributes.theme&&(e.attributes.theme=o),e}(e)))})))]),[e,t,s])}function Al({fallbackContent:e,onChoosePattern:t,postType:s}){const[,,o]=(0,d.useEntityBlockEditor)("postType",s),n=Nl(e);return(0,L.jsx)(h.__experimentalBlockPatternsList,{blockPatterns:n,onClickPattern:(e,s)=>{o(s,{selection:void 0}),t()}})}function Dl({slug:e,isCustom:t,onClose:s,postType:o}){const n=function(e,t=!1){return(0,c.useSelect)((s=>{const{getEntityRecord:o,getDefaultTemplateId:n}=s(d.store),i=n({slug:e,is_custom:t,ignore_empty:!0});return i?o("postType",T,i)?.content?.raw:void 0}),[e,t])}(e,t);return n?(0,L.jsxs)(Uo.Modal,{className:"editor-start-template-options__modal",title:(0,fs.__)("Choose a pattern"),closeLabel:(0,fs.__)("Cancel"),focusOnMount:"firstElement",onRequestClose:s,isFullScreen:!0,children:[(0,L.jsx)("div",{className:"editor-start-template-options__modal-content",children:(0,L.jsx)(Al,{fallbackContent:n,slug:e,isCustom:t,postType:o,onChoosePattern:()=>{s()}})}),(0,L.jsx)(Uo.Flex,{className:"editor-start-template-options__modal__actions",justify:"flex-end",expanded:!1,children:(0,L.jsx)(Uo.FlexItem,{children:(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:s,children:(0,fs.__)("Skip")})})})]}):null}function Rl(){const[e,t]=(0,u.useState)(!1),{shouldOpenModal:s,slug:o,isCustom:n,postType:i,postId:r}=(0,c.useSelect)((e=>{const{getCurrentPostType:t,getCurrentPostId:s}=e(Tc),o=t(),n=s(),{getEditedEntityRecord:i,hasEditsForEntityRecord:r}=e(d.store),a=i("postType",o,n);return{shouldOpenModal:!r("postType",o,n)&&""===a.content&&T===o,slug:a.slug,isCustom:a.is_custom,postType:o,postId:n}}),[]);return(0,u.useEffect)((()=>{t(!1)}),[i,r]),!s||e?null:(0,L.jsx)(Dl,{slug:o,isCustom:n,postType:i,onClose:()=>t(!0)})}function Ml(){const e=(0,c.useSelect)((e=>{const{richEditingEnabled:t,codeEditingEnabled:s}=e(Tc).getEditorSettings();return!t||!s}),[]),{getBlockSelectionStart:t}=(0,c.useSelect)(h.store),{getActiveComplementaryArea:s}=(0,c.useSelect)(za),{enableComplementaryArea:o,disableComplementaryArea:n}=(0,c.useDispatch)(za),{redo:i,undo:r,savePost:a,setIsListViewOpened:l,switchEditorMode:d,toggleDistractionFree:u}=(0,c.useDispatch)(Tc),{isEditedPostDirty:p,isPostSavingLocked:m,isListViewOpened:g,getEditorMode:_}=(0,c.useSelect)(Tc);return(0,bl.useShortcut)("core/editor/toggle-mode",(()=>{d("visual"===_()?"text":"visual")}),{isDisabled:e}),(0,bl.useShortcut)("core/editor/toggle-distraction-free",(()=>{u()})),(0,bl.useShortcut)("core/editor/undo",(e=>{r(),e.preventDefault()})),(0,bl.useShortcut)("core/editor/redo",(e=>{i(),e.preventDefault()})),(0,bl.useShortcut)("core/editor/save",(e=>{e.preventDefault(),m()||p()&&a()})),(0,bl.useShortcut)("core/editor/toggle-list-view",(e=>{g()||(e.preventDefault(),l(!0))})),(0,bl.useShortcut)("core/editor/toggle-sidebar",(e=>{e.preventDefault();if(["edit-post/document","edit-post/block"].includes(s("core")))n("core");else{const e=t()?"edit-post/block":"edit-post/document";o("core",e)}})),null}function Ll({clientId:e,onClose:t}){const{getBlocks:s}=(0,c.useSelect)(h.store),{replaceBlocks:o}=(0,c.useDispatch)(h.store);return(0,c.useSelect)((t=>t(h.store).canRemoveBlock(e)),[e])?(0,L.jsx)(Uo.MenuItem,{onClick:()=>{o(e,s(e)),t()},children:(0,fs.__)("Detach")}):null}function Ol({clientIds:e,blocks:t}){const[s,o]=(0,u.useState)(!1),{replaceBlocks:n}=(0,c.useDispatch)(h.store),{createSuccessNotice:i}=(0,c.useDispatch)(_s.store),{canCreate:r}=(0,c.useSelect)((e=>({canCreate:e(h.store).canInsertBlockType("core/template-part")})),[]);if(!r)return null;return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Uo.MenuItem,{icon:z,onClick:()=>{o(!0)},"aria-expanded":s,"aria-haspopup":"dialog",children:(0,fs.__)("Create template part")}),s&&(0,L.jsx)(Jo,{closeModal:()=>{o(!1)},blocks:t,onCreate:async t=>{n(e,(0,y.createBlock)("core/template-part",{slug:t.slug,theme:t.theme})),i((0,fs.__)("Template part created."),{type:"snackbar"})}})]})}function Fl(){return(0,L.jsx)(h.BlockSettingsMenuControls,{children:({selectedClientIds:e,onClose:t})=>(0,L.jsx)(Vl,{clientIds:e,onClose:t})})}function Vl({clientIds:e,onClose:t}){const{blocks:s}=(0,c.useSelect)((t=>{const{getBlocksByClientId:s}=t(h.store);return{blocks:s(e)}}),[e]);return 1===s.length&&"core/template-part"===s[0]?.name?(0,L.jsx)(Ll,{clientId:e[0],onClose:t}):(0,L.jsx)(Ol,{clientIds:e,blocks:s})}const{ExperimentalBlockEditorProvider:zl}=$(h.privateApis),{PatternsMenuItems:Ul}=$(ln.privateApis),Hl=()=>{},Gl=["wp_block","wp_navigation","wp_template_part"],$l=["post-only","template-locked"];const Wl=vr((({post:e,settings:t,recovery:s,initialEdits:o,children:n,BlockEditorProviderComponent:i=zl,__unstableTemplate:r})=>{const a=!!r,{editorSettings:l,selection:p,isReady:g,mode:_,defaultMode:f,postTypeEntities:b}=(0,c.useSelect)((t=>{const{getEditorSettings:s,getEditorSelection:o,getRenderingMode:n,__unstableIsEditorReady:i}=t(Tc),{getEntitiesConfig:r,getPostType:l,hasFinishedResolution:c}=t(d.store),u=l(e.type)?.supports,p=c("getPostType",[e.type]),m=Array.isArray(u?.editor)?u.editor.find((e=>"default-mode"in e))?.["default-mode"]:void 0,h=$l.includes(m);return{editorSettings:s(),isReady:i()&&p,mode:n(),defaultMode:a&&h?m:"post-only",selection:o(),postTypeEntities:"wp_template"===e.type?r("postType"):null}}),[e.type,a]),x=!!r&&"post-only"!==_,w=x?r:e,S=(0,u.useMemo)((()=>{const t={};if("wp_template"===e.type){if("page"===e.slug)t.postType="page";else if("single"===e.slug)t.postType="post";else if("single"===e.slug.split("-")[0]){const s=b?.map((e=>e.name))||[],o=e.slug.match(`^single-(${s.join("|")})(?:-.+)?$`);o&&(t.postType=o[1])}}else Gl.includes(w.type)&&!x||(t.postId=e.id,t.postType=e.type);return{...t,templateSlug:"wp_template"===w.type?w.slug:void 0}}),[x,e.id,e.type,e.slug,w.type,w.slug,b]),{id:C,type:P}=w,j=ea(l,P,C,_),[E,N,A]=function(e,t,s){const o="template-locked"===s?"template":"post",[n,i,r]=(0,d.useEntityBlockEditor)("postType",e.type,{id:e.id}),[a,l,c]=(0,d.useEntityBlockEditor)("postType",t?.type,{id:t?.id}),p=(0,u.useMemo)((()=>{if("wp_navigation"===e.type)return[(0,y.createBlock)("core/navigation",{ref:e.id,templateLock:!1})]}),[e.type,e.id]),m=(0,u.useMemo)((()=>p||("template"===o?a:n)),[p,o,a,n]);return t&&"template-locked"===s||"wp_navigation"===e.type?[m,Hl,Hl]:[m,"post"===o?i:l,"post"===o?r:c]}(e,r,_),{updatePostLock:D,setupEditor:R,updateEditorSettings:M,setCurrentTemplateId:O,setEditedPost:F,setRenderingMode:V}=$((0,c.useDispatch)(Tc)),{createWarningNotice:z}=(0,c.useDispatch)(_s.store);return(0,u.useLayoutEffect)((()=>{s||(D(t.postLock),R(e,o,t.template),t.autosave&&z((0,fs.__)("There is an autosave of this post that is more recent than the version below."),{id:"autosave-exists",actions:[{label:(0,fs.__)("View the autosave"),url:t.autosave.editLink}]}))}),[]),(0,u.useEffect)((()=>{F(e.type,e.id)}),[e.type,e.id,F]),(0,u.useEffect)((()=>{M(t)}),[t,M]),(0,u.useEffect)((()=>{O(r?.id)}),[r?.id,O]),(0,u.useEffect)((()=>{V(f)}),[f,V]),function(e,t){(0,u.useEffect)((()=>((0,m.addFilter)("blockEditor.__unstableCanInsertBlockType","removeTemplatePartsFromInserter",((s,o)=>!(!ia.includes(e)&&"core/template-part"===o.name&&"post-only"===t)&&s)),(0,m.addFilter)("blockEditor.__unstableCanInsertBlockType","removePostContentFromInserter",((t,s,o,{getBlockParentsByBlockName:n})=>ia.includes(e)||"core/post-content"!==s.name?t:n(o,"core/query").length>0)),()=>{(0,m.removeFilter)("blockEditor.__unstableCanInsertBlockType","removeTemplatePartsFromInserter"),(0,m.removeFilter)("blockEditor.__unstableCanInsertBlockType","removePostContentFromInserter")})),[e,t])}(e.type,_),(0,ba.useCommandLoader)({name:"core/editor/edit-ui",hook:function(){const{editorMode:e,isListViewOpen:t,showBlockBreadcrumbs:s,isDistractionFree:o,isFocusMode:n,isPreviewMode:i,isViewable:r,isCodeEditingEnabled:a,isRichEditingEnabled:l,isPublishSidebarEnabled:u}=(0,c.useSelect)((e=>{var t,s;const{get:o}=e(k.store),{isListViewOpened:n,getCurrentPostType:i,getEditorSettings:r}=e(Tc),{getSettings:a}=e(h.store),{getPostType:l}=e(d.store);return{editorMode:null!==(t=o("core","editorMode"))&&void 0!==t?t:"visual",isListViewOpen:n(),showBlockBreadcrumbs:o("core","showBlockBreadcrumbs"),isDistractionFree:o("core","distractionFree"),isFocusMode:o("core","focusMode"),isPreviewMode:a().isPreviewMode,isViewable:null!==(s=l(i())?.viewable)&&void 0!==s&&s,isCodeEditingEnabled:r().codeEditingEnabled,isRichEditingEnabled:r().richEditingEnabled,isPublishSidebarEnabled:e(Tc).isPublishSidebarEnabled()}}),[]),{getActiveComplementaryArea:p}=(0,c.useSelect)(za),{toggle:m}=(0,c.useDispatch)(k.store),{createInfoNotice:g}=(0,c.useDispatch)(_s.store),{__unstableSaveForPreview:_,setIsListViewOpened:f,switchEditorMode:b,toggleDistractionFree:y,toggleSpotlightMode:x,toggleTopToolbar:w}=(0,c.useDispatch)(Tc),{openModal:S,enableComplementaryArea:C,disableComplementaryArea:P}=(0,c.useDispatch)(za),{getCurrentPostId:j}=(0,c.useSelect)(Tc),{isBlockBasedTheme:E,canCreateTemplate:T}=(0,c.useSelect)((e=>({isBlockBasedTheme:e(d.store).getCurrentTheme()?.is_block_theme,canCreateTemplate:e(d.store).canUser("create",{kind:"postType",name:"wp_template"})})),[]),B=a&&l;if(i)return{commands:[],isLoading:!1};const I=[];if(I.push({name:"core/open-shortcut-help",label:(0,fs.__)("Keyboard shortcuts"),icon:ra,callback:({close:e})=>{e(),S("editor/keyboard-shortcut-help")}}),I.push({name:"core/toggle-distraction-free",label:o?(0,fs.__)("Exit Distraction free"):(0,fs.__)("Enter Distraction free"),callback:({close:e})=>{y(),e()}}),I.push({name:"core/open-preferences",label:(0,fs.__)("Editor preferences"),callback:({close:e})=>{e(),S("editor/preferences")}}),I.push({name:"core/toggle-spotlight-mode",label:n?(0,fs.__)("Exit Spotlight mode"):(0,fs.__)("Enter Spotlight mode"),callback:({close:e})=>{x(),e()}}),I.push({name:"core/toggle-list-view",label:t?(0,fs.__)("Close List View"):(0,fs.__)("Open List View"),icon:aa,callback:({close:e})=>{f(!t),e(),g(t?(0,fs.__)("List View off."):(0,fs.__)("List View on."),{id:"core/editor/toggle-list-view/notice",type:"snackbar"})}}),I.push({name:"core/toggle-top-toolbar",label:(0,fs.__)("Top toolbar"),callback:({close:e})=>{w(),e()}}),B&&I.push({name:"core/toggle-code-editor",label:"visual"===e?(0,fs.__)("Open code editor"):(0,fs.__)("Exit code editor"),icon:la,callback:({close:t})=>{b("visual"===e?"text":"visual"),t()}}),I.push({name:"core/toggle-breadcrumbs",label:s?(0,fs.__)("Hide block breadcrumbs"):(0,fs.__)("Show block breadcrumbs"),callback:({close:e})=>{m("core","showBlockBreadcrumbs"),e(),g(s?(0,fs.__)("Breadcrumbs hidden."):(0,fs.__)("Breadcrumbs visible."),{id:"core/editor/toggle-breadcrumbs/notice",type:"snackbar"})}}),I.push({name:"core/open-settings-sidebar",label:(0,fs.__)("Show or hide the Settings panel."),icon:(0,fs.isRTL)()?ca:da,callback:({close:e})=>{const t=p("core");e(),"edit-post/document"===t?P("core"):C("core","edit-post/document")}}),I.push({name:"core/open-block-inspector",label:(0,fs.__)("Show or hide the Block settings panel"),icon:ua,callback:({close:e})=>{const t=p("core");e(),"edit-post/block"===t?P("core"):C("core","edit-post/block")}}),I.push({name:"core/toggle-publish-sidebar",label:u?(0,fs.__)("Disable pre-publish checks"):(0,fs.__)("Enable pre-publish checks"),icon:pa,callback:({close:e})=>{e(),m("core","isPublishSidebarEnabled"),g(u?(0,fs.__)("Pre-publish checks disabled."):(0,fs.__)("Pre-publish checks enabled."),{id:"core/editor/publish-sidebar/notice",type:"snackbar"})}}),r&&I.push({name:"core/preview-link",label:(0,fs.__)("Preview in a new tab"),icon:Fo,callback:async({close:e})=>{e();const t=j(),s=await _();window.open(s,`wp-preview-${t}`)}}),T&&E){const e=(0,v.getPath)(window.location.href)?.includes("site-editor.php");e||I.push({name:"core/go-to-site-editor",label:(0,fs.__)("Open Site Editor"),callback:({close:e})=>{e(),document.location="site-editor.php"}})}return{commands:I,isLoading:!1}}}),(0,ba.useCommandLoader)({name:"core/editor/contextual-commands",hook:function(){const{postType:e}=(0,c.useSelect)((e=>{const{getCurrentPostType:t}=e(Tc);return{postType:t()}}),[]),{openModal:t}=(0,c.useDispatch)(za),s=[];return e===I&&(s.push({name:"core/rename-pattern",label:(0,fs.__)("Rename pattern"),icon:ma,callback:({close:e})=>{t(ll),e()}}),s.push({name:"core/duplicate-pattern",label:(0,fs.__)("Duplicate pattern"),icon:ha,callback:({close:e})=>{t(ul),e()}})),{isLoading:!1,commands:s}},context:"entity-edit"}),(0,ba.useCommandLoader)({name:"core/editor/page-content-focus",hook:function(){const{onNavigateToEntityRecord:e,goBack:t,templateId:s,isPreviewMode:o}=(0,c.useSelect)((e=>{const{getRenderingMode:t,getEditorSettings:s,getCurrentTemplateId:o}=$(e(Tc)),n=s();return{isTemplateHidden:"post-only"===t(),onNavigateToEntityRecord:n.onNavigateToEntityRecord,getEditorSettings:s,goBack:n.onNavigateToPreviousEntityRecord,templateId:o(),isPreviewMode:n.isPreviewMode}}),[]),{editedRecord:n,hasResolved:i}=(0,d.useEntityRecord)("postType","wp_template",s);if(o)return{isLoading:!1,commands:[]};const r=[];return s&&i&&r.push({name:"core/switch-to-template-focus",label:(0,fs.sprintf)((0,fs.__)("Edit template: %s"),(0,Lo.decodeEntities)(n.title)),icon:W,callback:({close:t})=>{e({postId:s,postType:"wp_template"}),t()}}),t&&r.push({name:"core/switch-to-previous-entity",label:(0,fs.__)("Go back"),icon:ga,callback:({close:e})=>{t(),e()}}),{isLoading:!1,commands:r}},context:"entity-edit"}),(0,ba.useCommandLoader)({name:"core/edit-site/manipulate-document",hook:function(){const{postType:e,postId:t}=(0,c.useSelect)((e=>{const{getCurrentPostId:t,getCurrentPostType:s}=e(Tc);return{postType:s(),postId:t()}}),[]),{editedRecord:s,hasResolved:o}=(0,d.useEntityRecord)("postType",e,t),{revertTemplate:n}=$((0,c.useDispatch)(Tc));if(!o||![B,T].includes(e))return{isLoading:!0,commands:[]};const i=[];if(Oo(s)){const e=s.type===T?(0,fs.sprintf)((0,fs.__)("Reset template: %s"),(0,Lo.decodeEntities)(s.title)):(0,fs.sprintf)((0,fs.__)("Reset template part: %s"),(0,Lo.decodeEntities)(s.title));i.push({name:"core/reset-template",label:e,icon:(0,fs.isRTL)()?_a:fa,callback:({close:e})=>{n(s),e()}})}return{isLoading:!o,commands:i}}}),g&&_?(0,L.jsx)(d.EntityProvider,{kind:"root",type:"site",children:(0,L.jsx)(d.EntityProvider,{kind:"postType",type:e.type,id:e.id,children:(0,L.jsx)(h.BlockContextProvider,{value:S,children:(0,L.jsxs)(i,{value:E,onChange:A,onInput:N,selection:p,settings:j,useSubRegistry:!1,children:[n,!t.isPreviewMode&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Ul,{}),(0,L.jsx)(Fl,{}),(0,L.jsx)(Il,{}),"template-locked"===_&&(0,L.jsx)(oa,{}),"wp_navigation"===P&&(0,L.jsx)(na,{}),(0,L.jsx)(Ml,{}),(0,L.jsx)(El,{}),(0,L.jsx)(_l,{}),(0,L.jsx)(fl,{}),(0,L.jsx)(Rl,{}),(0,L.jsx)(cl,{}),(0,L.jsx)(pl,{})]})]})})})}):null}));function Zl(e){return(0,L.jsx)(Wl,{...e,BlockEditorProviderComponent:h.BlockEditorProvider,children:e.children})}const Yl=Zl,{useGlobalStyle:Kl}=$(h.privateApis);function ql({template:e,post:t}){const[s="white"]=Kl("color.background"),[o]=(0,d.useEntityBlockEditor)("postType",t.type,{id:t.id}),[n]=(0,d.useEntityBlockEditor)("postType",e?.type,{id:e?.id}),i=e&&n?n:o,r=!i?.length;return(0,L.jsxs)("div",{className:"editor-fields-content-preview",style:{backgroundColor:s},children:[r&&(0,L.jsx)("span",{className:"editor-fields-content-preview__empty",children:(0,fs.__)("Empty content")}),!r&&(0,L.jsx)(h.BlockPreview.Async,{children:(0,L.jsx)(h.BlockPreview,{blocks:i})})]})}const Ql={type:"media",id:"content-preview",label:(0,fs.__)("Content preview"),render:function({item:e}){const{settings:t,template:s}=(0,c.useSelect)((t=>{var s;const{canUser:o,getPostType:n,getTemplateId:i,getEntityRecord:r}=$(t(d.store)),a=o("read",{kind:"postType",name:"wp_template"}),l=t(Tc).getEditorSettings(),c=l.supportsTemplateMode,u=null!==(s=n(e.type)?.viewable)&&void 0!==s&&s,p=c&&u&&a?i(e.type,e.id):null;return{settings:l,template:p?r("postType","wp_template",p):void 0}}),[e.type,e.id]);return(0,L.jsx)(Zl,{post:e,settings:t,__unstableTemplate:s,children:(0,L.jsx)(ql,{template:s,post:e})})},enableSorting:!1},Xl=Ql;function Jl(e,t,s){return{type:"REGISTER_ENTITY_ACTION",kind:e,name:t,config:s}}function ec(e,t,s){return{type:"UNREGISTER_ENTITY_ACTION",kind:e,name:t,actionId:s}}function tc(e,t,s){return{type:"REGISTER_ENTITY_FIELD",kind:e,name:t,config:s}}function sc(e,t,s){return{type:"UNREGISTER_ENTITY_FIELD",kind:e,name:t,fieldId:s}}function oc(e,t){return{type:"SET_IS_READY",kind:e,name:t}}const nc=e=>async({registry:t})=>{if($(t.select(Tc)).isEntityReady("postType",e))return;$(t.dispatch(Tc)).setIsReady("postType",e);const s=await t.resolveSelect(d.store).getPostType(e),o=await t.resolveSelect(d.store).canUser("create",{kind:"postType",name:e}),n=await t.resolveSelect(d.store).getCurrentTheme(),i=[s.viewable?Vo:void 0,s.supports?.revisions?zo:void 0,void 0,"wp_template_part"===s.slug&&o&&n?.is_block_theme?an:void 0,o&&"wp_block"===s.slug?hn:void 0,s.supports?.title?fn:void 0,s.supports?.["page-attributes"]?Fn:void 0,"wp_block"===s.slug?mi:void 0,gi,bi,Si,Ci,ji].filter(Boolean),r=[s.supports?.thumbnail&&n?.theme_supports?.["post-thumbnails"]&&Ii,s.supports?.author&&Li,$i,Yi,er,s.supports?.["page-attributes"]&&rr,s.supports?.comments&&ar,cr,dr,s.supports?.editor&&s.viewable&&Xl].filter(Boolean);if(s.supports?.title){let t;t="page"===e?hr:"wp_template"===e?gr:"wp_block"===e?yr:xr,r.push(t)}t.batch((()=>{i.forEach((s=>{$(t.dispatch(Tc)).registerEntityAction("postType",e,s)})),r.forEach((s=>{$(t.dispatch(Tc)).registerEntityField("postType",e,s)}))})),(0,m.doAction)("core.registerPostTypeSchema",e)};function ic(e){return{type:"SET_CURRENT_TEMPLATE_ID",id:e}}const rc=e=>async({select:t,dispatch:s,registry:o})=>{const n=await o.dispatch(d.store).saveEntityRecord("postType","wp_template",e);return o.dispatch(d.store).editEntityRecord("postType",t.getCurrentPostType(),t.getCurrentPostId(),{template:n.slug}),o.dispatch(_s.store).createSuccessNotice((0,fs.__)("Custom template created. You're in template mode now."),{type:"snackbar",actions:[{label:(0,fs.__)("Go back"),onClick:()=>s.setRenderingMode(t.getEditorSettings().defaultRenderingMode)}]}),n},ac=e=>({registry:t})=>{var s;const o=(null!==(s=t.select(k.store).get("core","hiddenBlockTypes"))&&void 0!==s?s:[]).filter((t=>!(Array.isArray(e)?e:[e]).includes(t)));t.dispatch(k.store).set("core","hiddenBlockTypes",o)},lc=e=>({registry:t})=>{var s;const o=null!==(s=t.select(k.store).get("core","hiddenBlockTypes"))&&void 0!==s?s:[],n=new Set([...o,...Array.isArray(e)?e:[e]]);t.dispatch(k.store).set("core","hiddenBlockTypes",[...n])},cc=({onSave:e,dirtyEntityRecords:t=[],entitiesToSkip:s=[],close:o}={})=>({registry:n})=>{const i=[{kind:"postType",name:"wp_navigation"}],r="site-editor-save-success",a=n.select(d.store).getEntityRecord("root","__unstableBase")?.home;n.dispatch(_s.store).removeNotice(r);const l=t.filter((({kind:e,name:t,key:o,property:n})=>!s.some((s=>s.kind===e&&s.name===t&&s.key===o&&s.property===n))));o?.(l);const c=[],u=[];l.forEach((({kind:e,name:t,key:s,property:o})=>{"root"===e&&"site"===t?c.push(o):(i.some((s=>s.kind===e&&s.name===t))&&n.dispatch(d.store).editEntityRecord(e,t,s,{status:"publish"}),u.push(n.dispatch(d.store).saveEditedEntityRecord(e,t,s)))})),c.length&&u.push(n.dispatch(d.store).__experimentalSaveSpecifiedEntityEdits("root","site",void 0,c)),n.dispatch(h.store).__unstableMarkLastChangeAsPersistent(),Promise.all(u).then((t=>e?e(t):t)).then((e=>{e.some((e=>void 0===e))?n.dispatch(_s.store).createErrorNotice((0,fs.__)("Saving failed.")):n.dispatch(_s.store).createSuccessNotice((0,fs.__)("Site updated."),{type:"snackbar",id:r,actions:[{label:(0,fs.__)("View site"),url:a}]})})).catch((e=>n.dispatch(_s.store).createErrorNotice(`${(0,fs.__)("Saving failed.")} ${e}`)))},dc=(e,{allowUndo:t=!0}={})=>async({registry:s})=>{const o="edit-site-template-reverted";if(s.dispatch(_s.store).removeNotice(o),Oo(e))try{const n=s.select(d.store).getEntityConfig("postType",e.type);if(!n)return void s.dispatch(_s.store).createErrorNotice((0,fs.__)("The editor has encountered an unexpected error. Please reload."),{type:"snackbar"});const i=(0,v.addQueryArgs)(`${n.baseURL}/${e.id}`,{context:"edit",source:e.origin}),r=await gs()({path:i});if(!r)return void s.dispatch(_s.store).createErrorNotice((0,fs.__)("The editor has encountered an unexpected error. Please reload."),{type:"snackbar"});const a=({blocks:e=[]})=>(0,y.__unstableSerializeAndClean)(e),l=s.select(d.store).getEditedEntityRecord("postType",e.type,e.id);s.dispatch(d.store).editEntityRecord("postType",e.type,e.id,{content:a,blocks:l.blocks,source:"custom"},{undoIgnore:!0});const c=(0,y.parse)(r?.content?.raw);if(s.dispatch(d.store).editEntityRecord("postType",e.type,r.id,{content:a,blocks:c,source:"theme"}),t){const t=()=>{s.dispatch(d.store).editEntityRecord("postType",e.type,l.id,{content:a,blocks:l.blocks,source:"custom"})};s.dispatch(_s.store).createSuccessNotice((0,fs.__)("Template reset."),{type:"snackbar",id:o,actions:[{label:(0,fs.__)("Undo"),onClick:t}]})}}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,fs.__)("Template revert failed. Please reload.");s.dispatch(_s.store).createErrorNotice(t,{type:"snackbar"})}else s.dispatch(_s.store).createErrorNotice((0,fs.__)("This template is not revertable."),{type:"snackbar"})},uc=e=>async({registry:t})=>{const s=e.every((e=>e?.has_theme_file)),o=await Promise.allSettled(e.map((e=>t.dispatch(d.store).deleteEntityRecord("postType",e.type,e.id,{force:!0},{throwOnError:!0}))));if(o.every((({status:e})=>"fulfilled"===e))){let o;if(1===e.length){let t;"string"==typeof e[0].title?t=e[0].title:"string"==typeof e[0].title?.rendered?t=e[0].title?.rendered:"string"==typeof e[0].title?.raw&&(t=e[0].title?.raw),o=s?(0,fs.sprintf)((0,fs.__)('"%s" reset.'),(0,Lo.decodeEntities)(t)):(0,fs.sprintf)((0,fs._x)('"%s" deleted.',"template part"),(0,Lo.decodeEntities)(t))}else o=s?(0,fs.__)("Items reset."):(0,fs.__)("Items deleted.");t.dispatch(_s.store).createSuccessNotice(o,{type:"snackbar",id:"editor-template-deleted-success"})}else{let e;if(1===o.length)e=o[0].reason?.message?o[0].reason.message:s?(0,fs.__)("An error occurred while reverting the item."):(0,fs.__)("An error occurred while deleting the item.");else{const t=new Set,n=o.filter((({status:e})=>"rejected"===e));for(const e of n)e.reason?.message&&t.add(e.reason.message);e=0===t.size?(0,fs.__)("An error occurred while deleting the items."):1===t.size?s?(0,fs.sprintf)((0,fs.__)("An error occurred while reverting the items: %s"),[...t][0]):(0,fs.sprintf)((0,fs.__)("An error occurred while deleting the items: %s"),[...t][0]):s?(0,fs.sprintf)((0,fs.__)("Some errors occurred while reverting the items: %s"),[...t].join(",")):(0,fs.sprintf)((0,fs.__)("Some errors occurred while deleting the items: %s"),[...t].join(","))}t.dispatch(_s.store).createErrorNotice(e,{type:"snackbar"})}};var pc=s(5215),mc=s.n(pc);const hc=(0,L.jsx)(M.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,L.jsx)(M.Path,{d:"M12 4c-4.4 0-8 3.6-8 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8zm0 14.5c-3.6 0-6.5-2.9-6.5-6.5S8.4 5.5 12 5.5s6.5 2.9 6.5 6.5-2.9 6.5-6.5 6.5zM9 16l4.5-3L15 8.4l-4.5 3L9 16z"})}),gc=(0,L.jsx)(M.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,L.jsx)(M.Path,{d:"M17.8 2l-.9.3c-.1 0-3.6 1-5.2 2.1C10 5.5 9.3 6.5 8.9 7.1c-.6.9-1.7 4.7-1.7 6.3l-.9 2.3c-.2.4 0 .8.4 1 .1 0 .2.1.3.1.3 0 .6-.2.7-.5l.6-1.5c.3 0 .7-.1 1.2-.2.7-.1 1.4-.3 2.2-.5.8-.2 1.6-.5 2.4-.8.7-.3 1.4-.7 1.9-1.2s.8-1.2 1-1.9c.2-.7.3-1.6.4-2.4.1-.8.1-1.7.2-2.5 0-.8.1-1.5.2-2.1V2zm-1.9 5.6c-.1.8-.2 1.5-.3 2.1-.2.6-.4 1-.6 1.3-.3.3-.8.6-1.4.9-.7.3-1.4.5-2.2.8-.6.2-1.3.3-1.8.4L15 7.5c.3-.3.6-.7 1-1.1 0 .4 0 .8-.1 1.2zM6 20h8v-1.5H6V20z"})}),_c=[];const fc={rootClientId:void 0,insertionIndex:void 0,filterValue:void 0},bc=(0,c.createRegistrySelector)((e=>(0,c.createSelector)((t=>{if("object"==typeof t.blockInserterPanel)return t.blockInserterPanel;if("template-locked"===st(t)){const[t]=e(h.store).getBlocksByName("core/post-content");if(t)return{rootClientId:t,insertionIndex:void 0,filterValue:void 0}}return fc}),(t=>{const[s]=e(h.store).getBlocksByName("core/post-content");return[t.blockInserterPanel,st(t),s]}))));function yc(e){return e.listViewToggleRef}function xc(e){return e.inserterSidebarToggleRef}const vc={wp_block:ha,wp_navigation:hc,page:ga,post:gc},wc=(0,c.createRegistrySelector)((e=>(t,s,o)=>{{if("wp_template_part"===s||"wp_template"===s){const t=(e(d.store).getEntityRecord("root","__unstableBase")?.default_template_part_areas||[]).find((e=>o.area===e.area));return t?.icon?U(t.icon):W}if(vc[s])return vc[s];const t=e(d.store).getPostType(s);return"string"==typeof t?.icon&&t.icon.startsWith("dashicons-")?t.icon.slice(10):ga}})),Sc=(0,c.createRegistrySelector)((e=>(t,s,o)=>{const{type:n,id:i}=oe(t),r=e(d.store).getEntityRecordNonTransientEdits("postType",s||n,o||i);if(!r?.meta)return!1;const a=e(d.store).getEntityRecord("postType",s||n,o||i)?.meta;return!mc()({...a,footnotes:void 0},{...r.meta,footnotes:void 0})}));function kc(e,...t){return function(e,t,s){var o;return null!==(o=e.actions[t]?.[s])&&void 0!==o?o:_c}(e.dataviews,...t)}function Cc(e,...t){return function(e,t,s){return e.isReady[t]?.[s]}(e.dataviews,...t)}function Pc(e,...t){return function(e,t,s){var o;return null!==(o=e.fields[t]?.[s])&&void 0!==o?o:_c}(e.dataviews,...t)}const jc=(0,c.createRegistrySelector)((e=>(0,c.createSelector)(((t,s)=>{s=Array.isArray(s)?s:[s];const{getBlocksByName:o,getBlockParents:n,getBlockName:i}=e(h.store);return o(s).filter((e=>n(e).every((e=>{const t=i(e);return"core/query"!==t&&!s.includes(t)}))))}),(()=>[e(h.store).getBlocks()])))),Ec={reducer:b,selectors:e,actions:t},Tc=(0,c.createReduxStore)("core/editor",{...Ec});(0,c.register)(Tc),$(Tc).registerPrivateActions(a),$(Tc).registerPrivateSelectors(l);function Bc(e){const t=e.avatar_urls&&e.avatar_urls[24]?(0,L.jsx)("img",{className:"editor-autocompleters__user-avatar",alt:"",src:e.avatar_urls[24]}):(0,L.jsx)("span",{className:"editor-autocompleters__no-avatar"});return(0,L.jsxs)(L.Fragment,{children:[t,(0,L.jsx)("span",{className:"editor-autocompleters__user-name",children:e.name}),(0,L.jsx)("span",{className:"editor-autocompleters__user-slug",children:e.slug})]})}(0,m.addFilter)("blocks.registerBlockType","core/editor/custom-sources-backwards-compatibility/shim-attribute-source",(function(e){var t;const s=Object.fromEntries(Object.entries(null!==(t=e.attributes)&&void 0!==t?t:{}).filter((([,{source:e}])=>"meta"===e)).map((([e,{meta:t}])=>[e,t])));return Object.entries(s).length&&(e.edit=(e=>(0,p.createHigherOrderComponent)((t=>({attributes:s,setAttributes:o,...n})=>{const i=(0,c.useSelect)((e=>e(Tc).getCurrentPostType()),[]),[r,a]=(0,d.useEntityProp)("postType",i,"meta"),l=(0,u.useMemo)((()=>({...s,...Object.fromEntries(Object.entries(e).map((([e,t])=>[e,r[t]])))})),[s,r]);return(0,L.jsx)(t,{attributes:l,setAttributes:t=>{const s=Object.fromEntries(Object.entries(null!=t?t:{}).filter((([t])=>t in e)).map((([t,s])=>[e[t],s])));Object.entries(s).length&&a(s),o(t)},...n})}),"withMetaAttributeSource"))(s)(e.edit)),e}));const Ic={name:"users",className:"editor-autocompleters__user",triggerPrefix:"@",useItems(e){const t=(0,c.useSelect)((t=>{const{getUsers:s}=t(d.store);return s({context:"view",search:encodeURIComponent(e)})}),[e]),s=(0,u.useMemo)((()=>t?t.map((e=>({key:`user-${e.slug}`,value:e,label:Bc(e)}))):[]),[t]);return[s]},getOptionCompletion:e=>`@${e.slug}`};(0,m.addFilter)("editor.Autocomplete.completers","editor/autocompleters/set-default-completers",(function(e=[]){return e.push({...Ic}),e})),(0,m.addFilter)("editor.MediaUpload","core/editor/components/media-upload",(()=>Ei.MediaUpload));const{PatternOverridesControls:Nc,ResetOverridesControl:Ac,PatternOverridesBlockControls:Dc,PATTERN_TYPES:Rc,PARTIAL_SYNCING_SUPPORTED_BLOCKS:Mc,PATTERN_SYNC_TYPES:Lc}=$(ln.privateApis),Oc=(0,p.createHigherOrderComponent)((e=>t=>{const s=!!Mc[t.name];return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(e,{...t},"edit"),t.isSelected&&s&&(0,L.jsx)(Fc,{...t}),s&&(0,L.jsx)(Dc,{})]})}),"withPatternOverrideControls");function Fc(e){const t=(0,h.useBlockEditingMode)(),{hasPatternOverridesSource:s,isEditingSyncedPattern:o}=(0,c.useSelect)((e=>{const{getCurrentPostType:t,getEditedPostAttribute:s}=e(Tc);return{hasPatternOverridesSource:!!(0,y.getBlockBindingsSource)("core/pattern-overrides"),isEditingSyncedPattern:t()===Rc.user&&s("meta")?.wp_pattern_sync_status!==Lc.unsynced&&s("wp_pattern_sync_status")!==Lc.unsynced}}),[]),n=e.attributes.metadata?.bindings,i=!!n&&Object.values(n).some((e=>"core/pattern-overrides"===e.source)),r=o&&"default"===t,a=!o&&!!e.attributes.metadata?.name&&"disabled"!==t&&i;return s?(0,L.jsxs)(L.Fragment,{children:[r&&(0,L.jsx)(Nc,{...e}),a&&(0,L.jsx)(Ac,{...e})]}):null}(0,m.addFilter)("editor.BlockEdit","core/editor/with-pattern-override-controls",Oc);class Vc extends u.Component{constructor(e){super(e),this.needsAutosave=!(!e.isDirty||!e.isAutosaveable)}componentDidMount(){this.props.disableIntervalChecks||this.setAutosaveTimer()}componentDidUpdate(e){this.props.disableIntervalChecks?this.props.editsReference!==e.editsReference&&this.props.autosave():(this.props.interval!==e.interval&&(clearTimeout(this.timerId),this.setAutosaveTimer()),this.props.isDirty&&(!this.props.isAutosaving||e.isAutosaving)?this.props.editsReference!==e.editsReference&&(this.needsAutosave=!0):this.needsAutosave=!1)}componentWillUnmount(){clearTimeout(this.timerId)}setAutosaveTimer(e=1e3*this.props.interval){this.timerId=setTimeout((()=>{this.autosaveTimerHandler()}),e)}autosaveTimerHandler(){this.props.isAutosaveable?(this.needsAutosave&&(this.needsAutosave=!1,this.props.autosave()),this.setAutosaveTimer()):this.setAutosaveTimer(1e3)}render(){return null}}const zc=(0,p.compose)([(0,c.withSelect)(((e,t)=>{const{getReferenceByDistinctEdits:s}=e(d.store),{isEditedPostDirty:o,isEditedPostAutosaveable:n,isAutosavingPost:i,getEditorSettings:r}=e(Tc),{interval:a=r().autosaveInterval}=t;return{editsReference:s(),isDirty:o(),isAutosaveable:n(),isAutosaving:i(),interval:a}})),(0,c.withDispatch)(((e,t)=>({autosave(){const{autosave:s=e(Tc).autosave}=t;s()}})))])(Vc),Uc=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.Path,{d:"M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z"})}),Hc=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.Path,{d:"m13.1 16-3.4-4 3.4-4 1.1 1-2.6 3 2.6 3-1.1 1z"})}),Gc=window.wp.dom;function $c(e){const{isFrontPage:t,isPostsPage:s}=(0,c.useSelect)((t=>{const{canUser:s,getEditedEntityRecord:o}=t(d.store),n=s("read",{kind:"root",name:"site"})?o("root","site"):void 0,i=parseInt(e,10);return{isFrontPage:n?.page_on_front===i,isPostsPage:n?.page_for_posts===i}}));return t?(0,fs.__)("Homepage"):!!s&&(0,fs.__)("Posts Page")}const Wc=(0,Uo.__unstableMotion)(Uo.Button);function Zc(e){const{postId:t,postType:s,postTypeLabel:o,documentTitle:n,isNotFound:i,templateTitle:r,onNavigateToPreviousEntityRecord:a,isTemplatePreview:l}=(0,c.useSelect)((e=>{var t;const{getCurrentPostType:s,getCurrentPostId:o,getEditorSettings:n,getRenderingMode:i}=e(Tc),{getEditedEntityRecord:r,getPostType:a,isResolving:l}=e(d.store),c=s(),u=o(),p=r("postType",c,u),{default_template_types:m=[]}=null!==(t=e(d.store).getEntityRecord("root","__unstableBase"))&&void 0!==t?t:{},h=Y({templateTypes:m,template:p}),g=a(c)?.labels?.singular_name;return{postId:u,postType:c,postTypeLabel:g,documentTitle:p.title,isNotFound:!p&&!l("getEditedEntityRecord","postType",c,u),templateTitle:h.title,onNavigateToPreviousEntityRecord:n().onNavigateToPreviousEntityRecord,isTemplatePreview:"template-locked"===i()}}),[]),{open:m}=(0,c.useDispatch)(ba.store),g=(0,p.useReducedMotion)(),_=D.includes(s),f=!!a,b=_?r:n,y=e.title||b,x=e.icon,v=$c(t),w=(0,u.useRef)(!1);return(0,u.useEffect)((()=>{w.current=!0}),[]),(0,L.jsxs)("div",{className:Ai("editor-document-bar",{"has-back-button":f}),children:[(0,L.jsx)(Uo.__unstableAnimatePresence,{children:f&&(0,L.jsx)(Wc,{className:"editor-document-bar__back",icon:(0,fs.isRTL)()?Uc:Hc,onClick:e=>{e.stopPropagation(),a()},size:"compact",initial:!!w.current&&{opacity:0,transform:"translateX(15%)"},animate:{opacity:1,transform:"translateX(0%)"},exit:{opacity:0,transform:"translateX(15%)"},transition:g?{duration:0}:void 0,children:(0,fs.__)("Back")})}),!_&&l&&(0,L.jsx)(h.BlockIcon,{icon:W,className:"editor-document-bar__icon-layout"}),i?(0,L.jsx)(Uo.__experimentalText,{children:(0,fs.__)("Document not found")}):(0,L.jsxs)(Uo.Button,{className:"editor-document-bar__command",onClick:()=>m(),size:"compact",children:[(0,L.jsxs)(Uo.__unstableMotion.div,{className:"editor-document-bar__title",initial:!!w.current&&{opacity:0,transform:f?"translateX(15%)":"translateX(-15%)"},animate:{opacity:1,transform:"translateX(0%)"},transition:g?{duration:0}:void 0,children:[x&&(0,L.jsx)(h.BlockIcon,{icon:x}),(0,L.jsxs)(Uo.__experimentalText,{size:"body",as:"h1",children:[(0,L.jsx)("span",{className:"editor-document-bar__post-title",children:y?(0,Gc.__unstableStripHTML)(y):(0,fs.__)("No title")}),v&&(0,L.jsx)("span",{className:"editor-document-bar__post-type-label",children:`· ${v}`}),o&&!e.title&&!v&&(0,L.jsx)("span",{className:"editor-document-bar__post-type-label",children:`· ${(0,Lo.decodeEntities)(o)}`})]})]},f),(0,L.jsx)("span",{className:"editor-document-bar__shortcut",children:xl.displayShortcut.primary("k")})]})]})}const Yc=window.wp.richText,Kc=({children:e,isValid:t,level:s,href:o,onSelect:n})=>(0,L.jsx)("li",{className:Ai("document-outline__item",`is-${s.toLowerCase()}`,{"is-invalid":!t}),children:(0,L.jsxs)("a",{href:o,className:"document-outline__button",onClick:n,children:[(0,L.jsx)("span",{className:"document-outline__emdash","aria-hidden":"true"}),(0,L.jsx)("strong",{className:"document-outline__level",children:s}),(0,L.jsx)("span",{className:"document-outline__item-content",children:e})]})}),qc=(0,L.jsx)("em",{children:(0,fs.__)("(Empty heading)")}),Qc=[(0,L.jsx)("br",{},"incorrect-break"),(0,L.jsx)("em",{children:(0,fs.__)("(Incorrect heading level)")},"incorrect-message")],Xc=[(0,L.jsx)("br",{},"incorrect-break-h1"),(0,L.jsx)("em",{children:(0,fs.__)("(Your theme may already use a H1 for the post title)")},"incorrect-message-h1")],Jc=[(0,L.jsx)("br",{},"incorrect-break-multiple-h1"),(0,L.jsx)("em",{children:(0,fs.__)("(Multiple H1 headings are not recommended)")},"incorrect-message-multiple-h1")];function ed(){return(0,L.jsxs)(Uo.SVG,{width:"138",height:"148",viewBox:"0 0 138 148",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,L.jsx)(Uo.Rect,{width:"138",height:"148",rx:"4",fill:"#F0F6FC"}),(0,L.jsx)(Uo.Line,{x1:"44",y1:"28",x2:"24",y2:"28",stroke:"#DDDDDD"}),(0,L.jsx)(Uo.Rect,{x:"48",y:"16",width:"27",height:"23",rx:"4",fill:"#DDDDDD"}),(0,L.jsx)(Uo.Path,{d:"M54.7585 32V23.2727H56.6037V26.8736H60.3494V23.2727H62.1903V32H60.3494V28.3949H56.6037V32H54.7585ZM67.4574 23.2727V32H65.6122V25.0241H65.5611L63.5625 26.277V24.6406L65.723 23.2727H67.4574Z",fill:"black"}),(0,L.jsx)(Uo.Line,{x1:"55",y1:"59",x2:"24",y2:"59",stroke:"#DDDDDD"}),(0,L.jsx)(Uo.Rect,{x:"59",y:"47",width:"29",height:"23",rx:"4",fill:"#DDDDDD"}),(0,L.jsx)(Uo.Path,{d:"M65.7585 63V54.2727H67.6037V57.8736H71.3494V54.2727H73.1903V63H71.3494V59.3949H67.6037V63H65.7585ZM74.6605 63V61.6705L77.767 58.794C78.0313 58.5384 78.2528 58.3082 78.4318 58.1037C78.6136 57.8991 78.7514 57.6989 78.8452 57.5028C78.9389 57.304 78.9858 57.0895 78.9858 56.8594C78.9858 56.6037 78.9276 56.3835 78.8111 56.1989C78.6946 56.0114 78.5355 55.8679 78.3338 55.7685C78.1321 55.6662 77.9034 55.6151 77.6477 55.6151C77.3807 55.6151 77.1477 55.669 76.9489 55.777C76.75 55.8849 76.5966 56.0398 76.4886 56.2415C76.3807 56.4432 76.3267 56.6832 76.3267 56.9616H74.5753C74.5753 56.3906 74.7045 55.8949 74.9631 55.4744C75.2216 55.054 75.5838 54.7287 76.0497 54.4986C76.5156 54.2685 77.0526 54.1534 77.6605 54.1534C78.2855 54.1534 78.8295 54.2642 79.2926 54.4858C79.7585 54.7045 80.1207 55.0085 80.3793 55.3977C80.6378 55.7869 80.767 56.233 80.767 56.7358C80.767 57.0653 80.7017 57.3906 80.571 57.7116C80.4432 58.0327 80.2145 58.3892 79.8849 58.7812C79.5554 59.1705 79.0909 59.6378 78.4915 60.1832L77.2173 61.4318V61.4915H80.8821V63H74.6605Z",fill:"black"}),(0,L.jsx)(Uo.Line,{x1:"80",y1:"90",x2:"24",y2:"90",stroke:"#DDDDDD"}),(0,L.jsx)(Uo.Rect,{x:"84",y:"78",width:"30",height:"23",rx:"4",fill:"#F0B849"}),(0,L.jsx)(Uo.Path,{d:"M90.7585 94V85.2727H92.6037V88.8736H96.3494V85.2727H98.1903V94H96.3494V90.3949H92.6037V94H90.7585ZM99.5284 92.4659V91.0128L103.172 85.2727H104.425V87.2841H103.683L101.386 90.919V90.9872H106.564V92.4659H99.5284ZM103.717 94V92.0227L103.751 91.3793V85.2727H105.482V94H103.717Z",fill:"black"}),(0,L.jsx)(Uo.Line,{x1:"66",y1:"121",x2:"24",y2:"121",stroke:"#DDDDDD"}),(0,L.jsx)(Uo.Rect,{x:"70",y:"109",width:"29",height:"23",rx:"4",fill:"#DDDDDD"}),(0,L.jsx)(Uo.Path,{d:"M76.7585 125V116.273H78.6037V119.874H82.3494V116.273H84.1903V125H82.3494V121.395H78.6037V125H76.7585ZM88.8864 125.119C88.25 125.119 87.6832 125.01 87.1861 124.791C86.6918 124.57 86.3011 124.266 86.0142 123.879C85.7301 123.49 85.5838 123.041 85.5753 122.533H87.4332C87.4446 122.746 87.5142 122.933 87.642 123.095C87.7727 123.254 87.946 123.378 88.1619 123.466C88.3778 123.554 88.6207 123.598 88.8906 123.598C89.1719 123.598 89.4205 123.548 89.6364 123.449C89.8523 123.349 90.0213 123.212 90.1435 123.036C90.2656 122.859 90.3267 122.656 90.3267 122.426C90.3267 122.193 90.2614 121.987 90.1307 121.808C90.0028 121.626 89.8182 121.484 89.5767 121.382C89.3381 121.28 89.054 121.229 88.7244 121.229H87.9105V119.874H88.7244C89.0028 119.874 89.2486 119.825 89.4616 119.729C89.6776 119.632 89.8452 119.499 89.9645 119.328C90.0838 119.155 90.1435 118.953 90.1435 118.723C90.1435 118.504 90.0909 118.312 89.9858 118.148C89.8835 117.98 89.7386 117.849 89.5511 117.756C89.3665 117.662 89.1506 117.615 88.9034 117.615C88.6534 117.615 88.4247 117.661 88.2173 117.751C88.0099 117.839 87.8438 117.966 87.7188 118.131C87.5938 118.295 87.527 118.489 87.5185 118.71H85.75C85.7585 118.207 85.902 117.764 86.1804 117.381C86.4588 116.997 86.8338 116.697 87.3054 116.482C87.7798 116.263 88.3153 116.153 88.9119 116.153C89.5142 116.153 90.0412 116.263 90.4929 116.482C90.9446 116.7 91.2955 116.996 91.5455 117.368C91.7983 117.737 91.9233 118.152 91.9205 118.612C91.9233 119.101 91.7713 119.509 91.4645 119.835C91.1605 120.162 90.7642 120.369 90.2756 120.457V120.526C90.9176 120.608 91.4063 120.831 91.7415 121.195C92.0795 121.555 92.2472 122.007 92.2443 122.55C92.2472 123.047 92.1037 123.489 91.8139 123.875C91.527 124.261 91.1307 124.565 90.625 124.787C90.1193 125.009 89.5398 125.119 88.8864 125.119Z",fill:"black"})]})}const td=(e=[])=>e.flatMap(((e={})=>"core/heading"===e.name?{...e,level:e.attributes.level,isEmpty:sd(e)}:td(e.innerBlocks))),sd=e=>!e.attributes.content||0===e.attributes.content.trim().length;function od({onSelect:e,hasOutlineItemsDisabled:t}){const{selectBlock:s}=(0,c.useDispatch)(h.store),{blocks:o,title:n,isTitleSupported:i}=(0,c.useSelect)((e=>{var t;const{getBlocks:s}=e(h.store),{getEditedPostAttribute:o}=e(Tc),{getPostType:n}=e(d.store),i=n(o("type"));return{title:o("title"),blocks:s(),isTitleSupported:null!==(t=i?.supports?.title)&&void 0!==t&&t}})),r=(0,u.useRef)(1),a=td(o);if(a.length<1)return(0,L.jsxs)("div",{className:"editor-document-outline has-no-headings",children:[(0,L.jsx)(ed,{}),(0,L.jsx)("p",{children:(0,fs.__)("Navigate the structure of your document and address issues like empty or incorrect heading levels.")})]});const l=document.querySelector(".editor-post-title__input"),p=i&&n&&l,m=a.reduce(((e,t)=>({...e,[t.level]:(e[t.level]||0)+1})),{})[1]>1;return(0,L.jsx)("div",{className:"document-outline",children:(0,L.jsxs)("ul",{children:[p&&(0,L.jsx)(Kc,{level:(0,fs.__)("Title"),isValid:!0,onSelect:e,href:`#${l.id}`,isDisabled:t,children:n}),a.map((o=>{const n=o.level>r.current+1,i=!(o.isEmpty||n||!o.level||1===o.level&&(m||p));return r.current=o.level,(0,L.jsxs)(Kc,{level:`H${o.level}`,isValid:i,isDisabled:t,href:`#block-${o.clientId}`,onSelect:()=>{s(o.clientId),e?.()},children:[o.isEmpty?qc:(0,Yc.getTextContent)((0,Yc.create)({html:o.attributes.content})),n&&Qc,1===o.level&&m&&Jc,p&&1===o.level&&!m&&Xc]},o.clientId)}))]})})}function nd({children:e}){const t=(0,c.useSelect)((e=>{const{getGlobalBlockCount:t}=e(h.store);return t("core/heading")>0}));return t?e:null}const id=function(){const{registerShortcut:e}=(0,c.useDispatch)(bl.store);return(0,u.useEffect)((()=>{e({name:"core/editor/toggle-mode",category:"global",description:(0,fs.__)("Switch between visual editor and code editor."),keyCombination:{modifier:"secondary",character:"m"}}),e({name:"core/editor/save",category:"global",description:(0,fs.__)("Save your changes."),keyCombination:{modifier:"primary",character:"s"}}),e({name:"core/editor/undo",category:"global",description:(0,fs.__)("Undo your last changes."),keyCombination:{modifier:"primary",character:"z"}}),e({name:"core/editor/redo",category:"global",description:(0,fs.__)("Redo your last undo."),keyCombination:{modifier:"primaryShift",character:"z"},aliases:(0,xl.isAppleOS)()?[]:[{modifier:"primary",character:"y"}]}),e({name:"core/editor/toggle-list-view",category:"global",description:(0,fs.__)("Show or hide the List View."),keyCombination:{modifier:"access",character:"o"}}),e({name:"core/editor/toggle-distraction-free",category:"global",description:(0,fs.__)("Enter or exit distraction free mode."),keyCombination:{modifier:"primaryShift",character:"\\"}}),e({name:"core/editor/toggle-sidebar",category:"global",description:(0,fs.__)("Show or hide the Settings panel."),keyCombination:{modifier:"primaryShift",character:","}}),e({name:"core/editor/keyboard-shortcuts",category:"main",description:(0,fs.__)("Display these keyboard shortcuts."),keyCombination:{modifier:"access",character:"h"}}),e({name:"core/editor/next-region",category:"global",description:(0,fs.__)("Navigate to the next part of the editor."),keyCombination:{modifier:"ctrl",character:"`"},aliases:[{modifier:"access",character:"n"}]}),e({name:"core/editor/previous-region",category:"global",description:(0,fs.__)("Navigate to the previous part of the editor."),keyCombination:{modifier:"ctrlShift",character:"`"},aliases:[{modifier:"access",character:"p"},{modifier:"ctrlShift",character:"~"}]})}),[e]),(0,L.jsx)(h.BlockEditorKeyboardShortcuts.Register,{})},rd=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.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"})}),ad=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.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"})});const ld=(0,u.forwardRef)((function(e,t){const s=(0,xl.isAppleOS)()?xl.displayShortcut.primaryShift("z"):xl.displayShortcut.primary("y"),o=(0,c.useSelect)((e=>e(Tc).hasEditorRedo()),[]),{redo:n}=(0,c.useDispatch)(Tc);return(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,...e,ref:t,icon:(0,fs.isRTL)()?ad:rd,label:(0,fs.__)("Redo"),shortcut:s,"aria-disabled":!o,onClick:o?n:void 0,className:"editor-history__redo"})}));const cd=(0,u.forwardRef)((function(e,t){const s=(0,c.useSelect)((e=>e(Tc).hasEditorUndo()),[]),{undo:o}=(0,c.useDispatch)(Tc);return(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,...e,ref:t,icon:(0,fs.isRTL)()?rd:ad,label:(0,fs.__)("Undo"),shortcut:xl.displayShortcut.primary("z"),"aria-disabled":!s,onClick:s?o:void 0,className:"editor-history__undo"})}));function dd(){const[e,t]=(0,u.useState)(!1),s=(0,c.useSelect)((e=>e(h.store).isValidTemplate()),[]),{setTemplateValidity:o,synchronizeTemplate:n}=(0,c.useDispatch)(h.store);return s?null:(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Uo.Notice,{className:"editor-template-validation-notice",isDismissible:!1,status:"warning",actions:[{label:(0,fs.__)("Keep it as is"),onClick:()=>o(!0)},{label:(0,fs.__)("Reset the template"),onClick:()=>t(!0)}],children:(0,fs.__)("The content of your post doesn’t match the template assigned to your post type.")}),(0,L.jsx)(Uo.__experimentalConfirmDialog,{isOpen:e,confirmButtonText:(0,fs.__)("Reset"),onConfirm:()=>{t(!1),n()},onCancel:()=>t(!1),size:"medium",children:(0,fs.__)("Resetting the template may result in loss of content, do you want to continue?")})]})}const ud=function(){const{notices:e}=(0,c.useSelect)((e=>({notices:e(_s.store).getNotices()})),[]),{removeNotice:t}=(0,c.useDispatch)(_s.store),s=e.filter((({isDismissible:e,type:t})=>e&&"default"===t)),o=e.filter((({isDismissible:e,type:t})=>!e&&"default"===t));return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Uo.NoticeList,{notices:o,className:"components-editor-notices__pinned"}),(0,L.jsx)(Uo.NoticeList,{notices:s,className:"components-editor-notices__dismissible",onRemove:t,children:(0,L.jsx)(dd,{})})]})},pd=-3;function md(){const e=(0,c.useSelect)((e=>e(_s.store).getNotices()),[]),{removeNotice:t}=(0,c.useDispatch)(_s.store),s=e.filter((({type:e})=>"snackbar"===e)).slice(pd);return(0,L.jsx)(Uo.SnackbarList,{notices:s,className:"components-editor-notices__snackbar",onRemove:t})}function hd({record:e,checked:t,onChange:s}){const{name:o,kind:n,title:i,key:r}=e,{entityRecordTitle:a,hasPostMetaChanges:l}=(0,c.useSelect)((e=>{var t;if("postType"!==n||"wp_template"!==o)return{entityRecordTitle:i,hasPostMetaChanges:$(e(Tc)).hasPostMetaChanges(o,r)};const s=e(d.store).getEditedEntityRecord(n,o,r),{default_template_types:a=[]}=null!==(t=e(d.store).getEntityRecord("root","__unstableBase"))&&void 0!==t?t:{};return{entityRecordTitle:Y({template:s,templateTypes:a}).title,hasPostMetaChanges:$(e(Tc)).hasPostMetaChanges(o,r)}}),[o,n,i,r]);return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Uo.PanelRow,{children:(0,L.jsx)(Uo.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,Lo.decodeEntities)(a)||(0,fs.__)("Untitled"),checked:t,onChange:s})}),l&&(0,L.jsx)("ul",{className:"entities-saved-states__changes",children:(0,L.jsx)("li",{children:(0,fs.__)("Post Meta.")})})]})}const{getGlobalStylesChanges:gd,GlobalStylesContext:_d}=$(h.privateApis);function fd({record:e}){const{user:t}=(0,u.useContext)(_d),s=(0,c.useSelect)((t=>t(d.store).getEntityRecord(e.kind,e.name,e.key)),[e.kind,e.name,e.key]),o=gd(t,s,{maxResults:10});return o.length?(0,L.jsx)("ul",{className:"entities-saved-states__changes",children:o.map((e=>(0,L.jsx)("li",{children:e},e)))}):null}function bd({record:e,count:t}){if("globalStyles"===e?.name)return null;const s=function(e,t){switch(e){case"site":return 1===t?(0,fs.__)("This change will affect your whole site."):(0,fs.__)("These changes will affect your whole site.");case"wp_template":return(0,fs.__)("This change will affect pages and posts that use this template.");case"page":case"post":return(0,fs.__)("The following has been modified.")}}(e?.name,t);return s?(0,L.jsx)(Uo.PanelRow,{children:s}):null}function yd({list:e,unselectedEntities:t,setUnselectedEntities:s}){const o=e.length,n=e[0];let i=(0,c.useSelect)((e=>e(d.store).getEntityConfig(n.kind,n.name)),[n.kind,n.name]).label;return"wp_template_part"===n?.name&&(i=1===o?(0,fs.__)("Template Part"):(0,fs.__)("Template Parts")),(0,L.jsxs)(Uo.PanelBody,{title:i,initialOpen:!0,children:[(0,L.jsx)(bd,{record:n,count:o}),e.map((e=>(0,L.jsx)(hd,{record:e,checked:!t.some((t=>t.kind===e.kind&&t.name===e.name&&t.key===e.key&&t.property===e.property)),onChange:t=>s(e,t)},e.key||e.property))),"globalStyles"===n?.name&&(0,L.jsx)(fd,{record:n})]})}const xd=()=>{const{editedEntities:e,siteEdits:t,siteEntityConfig:s}=(0,c.useSelect)((e=>{const{__experimentalGetDirtyEntityRecords:t,getEntityRecordEdits:s,getEntityConfig:o}=e(d.store);return{editedEntities:t(),siteEdits:s("root","site"),siteEntityConfig:o("root","site")}}),[]),o=(0,u.useMemo)((()=>{var o;const n=e.filter((e=>!("root"===e.kind&&"site"===e.name))),i=null!==(o=s?.meta?.labels)&&void 0!==o?o:{},r=[];for(const e in t)r.push({kind:"root",name:"site",title:i[e]||e,property:e});return[...n,...r]}),[e,t,s]),[n,i]=(0,u.useState)([]);return{dirtyEntityRecords:o,isDirty:o.length-n.length>0,setUnselectedEntities:({kind:e,name:t,key:s,property:o},r)=>{i(r?n.filter((n=>n.kind!==e||n.name!==t||n.key!==s||n.property!==o)):[...n,{kind:e,name:t,key:s,property:o}])},unselectedEntities:n}};function vd(e){return e}function wd({close:e,renderDialog:t}){const s=xd();return(0,L.jsx)(Sd,{close:e,renderDialog:t,...s})}function Sd({additionalPrompt:e,close:t,onSave:s=vd,saveEnabled:o,saveLabel:n=(0,fs.__)("Save"),renderDialog:i,dirtyEntityRecords:r,isDirty:a,setUnselectedEntities:l,unselectedEntities:d}){const m=(0,u.useRef)(),{saveDirtyEntities:h}=$((0,c.useDispatch)(Tc)),g=r.reduce(((e,t)=>{const{name:s}=t;return e[s]||(e[s]=[]),e[s].push(t),e}),{}),{site:_,wp_template:f,wp_template_part:b,...y}=g,x=[_,f,b,...Object.values(y)].filter(Array.isArray),v=null!=o?o:a,w=(0,u.useCallback)((()=>t()),[t]),[S,k]=(0,p.__experimentalUseDialog)({onClose:()=>w()}),C=(0,p.useInstanceId)(Sd,"label"),P=(0,p.useInstanceId)(Sd,"description"),j=r.length?(0,fs.__)("Select the items you want to save."):void 0;return(0,L.jsxs)("div",{ref:i?S:void 0,...i&&k,className:"entities-saved-states__panel",role:i?"dialog":void 0,"aria-labelledby":i?C:void 0,"aria-describedby":i?P:void 0,children:[(0,L.jsxs)(Uo.Flex,{className:"entities-saved-states__panel-header",gap:2,children:[(0,L.jsx)(Uo.FlexItem,{isBlock:!0,as:Uo.Button,variant:"secondary",size:"compact",onClick:w,children:(0,fs.__)("Cancel")}),(0,L.jsx)(Uo.FlexItem,{isBlock:!0,as:Uo.Button,ref:m,variant:"primary",size:"compact",disabled:!v,accessibleWhenDisabled:!0,onClick:()=>h({onSave:s,dirtyEntityRecords:r,entitiesToSkip:d,close:t}),className:"editor-entities-saved-states__save-button",children:n})]}),(0,L.jsxs)("div",{className:"entities-saved-states__text-prompt",children:[(0,L.jsxs)("div",{className:"entities-saved-states__text-prompt--header-wrapper",id:i?C:void 0,children:[(0,L.jsx)("strong",{className:"entities-saved-states__text-prompt--header",children:(0,fs.__)("Are you ready to save?")}),e]}),(0,L.jsx)("p",{id:i?P:void 0,children:a?(0,u.createInterpolateElement)((0,fs.sprintf)((0,fs._n)("There is %d site change waiting to be saved.","There are %d site changes waiting to be saved.",r.length),r.length),{strong:(0,L.jsx)("strong",{})}):j})]}),x.map((e=>(0,L.jsx)(yd,{list:e,unselectedEntities:d,setUnselectedEntities:l},e[0].name)))]})}function kd(){try{return(0,c.select)(Tc).getEditedPostContent()}catch(e){}}function Cd({text:e,children:t,variant:s="secondary"}){const o=(0,p.useCopyToClipboard)(e);return(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,variant:s,ref:o,children:t})}class Pd extends u.Component{constructor(){super(...arguments),this.state={error:null}}componentDidCatch(e){(0,m.doAction)("editor.ErrorBoundary.errorLogged",e)}static getDerivedStateFromError(e){return{error:e}}render(){const{error:e}=this.state,{canCopyContent:t=!1}=this.props;return e?(0,L.jsxs)(Uo.__experimentalHStack,{className:"editor-error-boundary",alignment:"baseline",spacing:4,justify:"space-between",expanded:!1,wrap:!0,children:[(0,L.jsx)(Uo.__experimentalText,{as:"p",children:(0,fs.__)("The editor has encountered an unexpected error.")}),(0,L.jsxs)(Uo.__experimentalHStack,{expanded:!1,children:[t&&(0,L.jsx)(Cd,{text:kd,children:(0,fs.__)("Copy contents")}),(0,L.jsx)(Cd,{variant:"primary",text:e?.stack,children:(0,fs.__)("Copy error")})]})]}):this.props.children}}const jd=Pd,Ed=window.requestIdleCallback?window.requestIdleCallback:window.requestAnimationFrame;let Td;function Bd(){const{postId:e,isEditedPostNew:t,hasRemoteAutosave:s}=(0,c.useSelect)((e=>({postId:e(Tc).getCurrentPostId(),isEditedPostNew:e(Tc).isEditedPostNew(),hasRemoteAutosave:!!e(Tc).getEditorSettings().autosave})),[]),{getEditedPostAttribute:o}=(0,c.useSelect)(Tc),{createWarningNotice:n,removeNotice:i}=(0,c.useDispatch)(_s.store),{editPost:r,resetEditorBlocks:a}=(0,c.useDispatch)(Tc);(0,u.useEffect)((()=>{let l=function(e,t){return window.sessionStorage.getItem(bs(e,t))}(e,t);if(!l)return;try{l=JSON.parse(l)}catch{return}const{post_title:c,content:d,excerpt:u}=l,p={title:c,content:d,excerpt:u};if(!Object.keys(p).some((e=>p[e]!==o(e))))return void ys(e,t);if(s)return;const m="wpEditorAutosaveRestore";n((0,fs.__)("The backup of this post in your browser is different from the version below."),{id:m,actions:[{label:(0,fs.__)("Restore the backup"),onClick(){const{content:e,...t}=p;r(t),a((0,y.parse)(p.content)),i(m)}}]})}),[t,e])}const Id=(0,p.ifCondition)((()=>{if(void 0!==Td)return Td;try{window.sessionStorage.setItem("__wpEditorTestSessionStorage",""),window.sessionStorage.removeItem("__wpEditorTestSessionStorage"),Td=!0}catch{Td=!1}return Td}))((function(){const{autosave:e}=(0,c.useDispatch)(Tc),t=(0,u.useCallback)((()=>{Ed((()=>e({local:!0})))}),[]);Bd(),function(){const{postId:e,isEditedPostNew:t,isDirty:s,isAutosaving:o,didError:n}=(0,c.useSelect)((e=>({postId:e(Tc).getCurrentPostId(),isEditedPostNew:e(Tc).isEditedPostNew(),isDirty:e(Tc).isEditedPostDirty(),isAutosaving:e(Tc).isAutosavingPost(),didError:e(Tc).didPostSaveRequestFail()})),[]),i=(0,u.useRef)(s),r=(0,u.useRef)(o);(0,u.useEffect)((()=>{!n&&(r.current&&!o||i.current&&!s)&&ys(e,t),i.current=s,r.current=o}),[s,o,n]);const a=(0,p.usePrevious)(t),l=(0,p.usePrevious)(e);(0,u.useEffect)((()=>{l===e&&a&&!t&&ys(e,!0)}),[t,e])}();const s=(0,c.useSelect)((e=>e(Tc).getEditorSettings().localAutosaveInterval),[]);return(0,L.jsx)(zc,{interval:s,autosave:t})}));const Nd=function({children:e}){const t=(0,c.useSelect)((e=>{const{getEditedPostAttribute:t}=e(Tc),{getPostType:s}=e(d.store),o=s(t("type"));return!!o?.supports?.["page-attributes"]}),[]);return t?e:null};const Ad=function({children:e,supportKeys:t}){const s=(0,c.useSelect)((e=>{const{getEditedPostAttribute:t}=e(Tc),{getPostType:s}=e(d.store);return s(t("type"))}),[]);let o=!!s;return s&&(o=(Array.isArray(t)?t:[t]).some((e=>!!s.supports[e]))),o?e:null};function Dd(){const e=(0,c.useSelect)((e=>{var t;return null!==(t=e(Tc).getEditedPostAttribute("menu_order"))&&void 0!==t?t:0}),[]),{editPost:t}=(0,c.useDispatch)(Tc),[s,o]=(0,u.useState)(null),n=null!=s?s:e;return(0,L.jsx)(Uo.Flex,{children:(0,L.jsx)(Uo.FlexBlock,{children:(0,L.jsx)(Uo.__experimentalNumberControl,{__next40pxDefaultSize:!0,label:(0,fs.__)("Order"),help:(0,fs.__)("Set the page order."),value:n,onChange:e=>{o(e);const s=Number(e);Number.isInteger(s)&&""!==e.trim?.()&&t({menu_order:s})},hideLabelFromVision:!0,onBlur:()=>{o(null)}})})})}function Rd(){return(0,L.jsx)(Ad,{supportKeys:"page-attributes",children:(0,L.jsx)(Dd,{})})}const Md=(0,u.forwardRef)((({className:e,label:t,children:s},o)=>(0,L.jsxs)(Uo.__experimentalHStack,{className:Ai("editor-post-panel__row",e),ref:o,children:[t&&(0,L.jsx)("div",{className:"editor-post-panel__row-label",children:t}),(0,L.jsx)("div",{className:"editor-post-panel__row-control",children:s})]})));function Ld(e){const t=e.map((e=>({children:[],parent:void 0,...e})));if(t.some((({parent:e})=>void 0===e)))return t;const s=t.reduce(((e,t)=>{const{parent:s}=t;return e[s]||(e[s]=[]),e[s].push(t),e}),{}),o=e=>e.map((e=>{const t=s[e.id];return{...e,children:t&&t.length?o(t):[]}}));return o(s[0]||[])}const Od=e=>(0,Lo.decodeEntities)(e),Fd=e=>({...e,name:Od(e.name)}),Vd=e=>(null!=e?e:[]).map(Fd);function zd(e){return e?.title?.rendered?(0,Lo.decodeEntities)(e.title.rendered):`#${e.id} (${(0,fs.__)("no title")})`}const Ud=(e,t)=>{const s=sr()(e||"").toLowerCase(),o=sr()(t||"").toLowerCase();return s===o?0:s.startsWith(o)?s.length:1/0};function Hd(){const{editPost:e}=(0,c.useDispatch)(Tc),[t,s]=(0,u.useState)(!1),{isHierarchical:o,parentPostId:n,parentPostTitle:i,pageItems:r}=(0,c.useSelect)((e=>{var s;const{getPostType:o,getEntityRecords:n,getEntityRecord:i}=e(d.store),{getCurrentPostId:r,getEditedPostAttribute:a}=e(Tc),l=a("type"),c=a("parent"),u=o(l),p=r(),m=null!==(s=u?.hierarchical)&&void 0!==s&&s,h={per_page:100,exclude:p,parent_exclude:p,orderby:"menu_order",order:"asc",_fields:"id,title,parent"};t&&(h.search=t);const g=c?i("postType",l,c):null;return{isHierarchical:m,parentPostId:c,parentPostTitle:g?zd(g):"",pageItems:m?n("postType",l,h):null}}),[t]),a=(0,u.useMemo)((()=>{const e=(s,o=0)=>{const n=s.map((t=>[{value:t.id,label:"— ".repeat(o)+(0,Lo.decodeEntities)(t.name),rawName:t.name},...e(t.children||[],o+1)])).sort((([e],[s])=>Ud(e.rawName,t)>=Ud(s.rawName,t)?1:-1));return n.flat()};if(!r)return[];let s=r.map((e=>({id:e.id,parent:e.parent,name:zd(e)})));t||(s=Ld(s));const o=e(s),a=o.find((e=>e.value===n));return i&&!a&&o.unshift({value:n,label:i}),o}),[r,t,i,n]);if(!o)return null;return(0,L.jsx)(Uo.ComboboxControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,className:"editor-page-attributes__parent",label:(0,fs.__)("Parent"),help:(0,fs.__)("Choose a parent page."),value:n,options:a,onFilterValueChange:(0,p.debounce)((e=>{s(e)}),300),onChange:t=>{e({parent:t})},hideLabelFromVision:!0})}function Gd({isOpen:e,onClick:t}){const s=(0,c.useSelect)((e=>{const{getEditedPostAttribute:t}=e(Tc),s=t("parent");if(!s)return null;const{getEntityRecord:o}=e(d.store);return o("postType",t("type"),s)}),[]),o=(0,u.useMemo)((()=>s?zd(s):(0,fs.__)("None")),[s]);return(0,L.jsx)(Uo.Button,{size:"compact",className:"editor-post-parent__panel-toggle",variant:"tertiary","aria-expanded":e,"aria-label":(0,fs.sprintf)((0,fs.__)("Change parent: %s"),o),onClick:t,children:o})}function $d(){const e=(0,c.useSelect)((e=>e(d.store).getEntityRecord("root","__unstableBase")?.home),[]),[t,s]=(0,u.useState)(null),o=(0,u.useMemo)((()=>({anchor:t,placement:"left-start",offset:36,shift:!0})),[t]);return(0,L.jsx)(Md,{label:(0,fs.__)("Parent"),ref:s,children:(0,L.jsx)(Uo.Dropdown,{popoverProps:o,className:"editor-post-parent__panel-dropdown",contentClassName:"editor-post-parent__panel-dialog",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,L.jsx)(Gd,{isOpen:e,onClick:t}),renderContent:({onClose:t})=>(0,L.jsxs)("div",{className:"editor-post-parent",children:[(0,L.jsx)(h.__experimentalInspectorPopoverHeader,{title:(0,fs.__)("Parent"),onClose:t}),(0,L.jsxs)("div",{children:[(0,u.createInterpolateElement)((0,fs.sprintf)((0,fs.__)('Child pages inherit characteristics from their parent, such as URL structure. For instance, if "Pricing" is a child of "Services", its URL would be %s/services/pricing.'),(0,v.filterURLForDisplay)(e).replace(/([/.])/g,"$1")),{wbr:(0,L.jsx)("wbr",{})}),(0,L.jsx)("p",{children:(0,u.createInterpolateElement)((0,fs.__)("They also show up as sub-items in the default navigation menu. Learn more."),{a:(0,L.jsx)(Uo.ExternalLink,{href:(0,fs.__)("https://wordpress.org/documentation/article/page-post-settings-sidebar/#page-attributes")})})})]}),(0,L.jsx)(Hd,{})]})})})}const Wd=Hd,Zd="page-attributes";function Yd(){const{isEnabled:e,postType:t}=(0,c.useSelect)((e=>{const{getEditedPostAttribute:t,isEditorPanelEnabled:s}=e(Tc),{getPostType:o}=e(d.store);return{isEnabled:s(Zd),postType:o(t("type"))}}),[]);return e&&t?(0,L.jsx)($d,{}):null}function Kd(){return(0,L.jsx)(Nd,{children:(0,L.jsx)(Yd,{})})}const qd=(0,L.jsx)(M.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,L.jsx)(M.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M18.5 5.5V8H20V5.5H22.5V4H20V1.5H18.5V4H16V5.5H18.5ZM13.9624 4H6C4.89543 4 4 4.89543 4 6V18C4 19.1046 4.89543 20 6 20H18C19.1046 20 20 19.1046 20 18V10.0391H18.5V18C18.5 18.2761 18.2761 18.5 18 18.5H10L10 10.4917L16.4589 10.5139L16.4641 9.01389L5.5 8.97618V6C5.5 5.72386 5.72386 5.5 6 5.5H13.9624V4ZM5.5 10.4762V18C5.5 18.2761 5.72386 18.5 6 18.5H8.5L8.5 10.4865L5.5 10.4762Z"})}),Qd=(0,fs.__)("Custom Template");function Xd({onClose:e}){const{defaultBlockTemplate:t,onNavigateToEntityRecord:s}=(0,c.useSelect)((e=>{const{getEditorSettings:t,getCurrentTemplateId:s}=e(Tc);return{defaultBlockTemplate:t().defaultBlockTemplate,onNavigateToEntityRecord:t().onNavigateToEntityRecord,getTemplateId:s}})),{createTemplate:o}=$((0,c.useDispatch)(Tc)),[n,i]=(0,u.useState)(""),[r,a]=(0,u.useState)(!1),l=()=>{i(""),e()};return(0,L.jsx)(Uo.Modal,{title:(0,fs.__)("Create custom template"),onRequestClose:l,focusOnMount:"firstContentElement",size:"small",children:(0,L.jsx)("form",{className:"editor-post-template__create-form",onSubmit:async e=>{if(e.preventDefault(),r)return;a(!0);const i=null!=t?t:(0,y.serialize)([(0,y.createBlock)("core/group",{tagName:"header",layout:{inherit:!0}},[(0,y.createBlock)("core/site-title"),(0,y.createBlock)("core/site-tagline")]),(0,y.createBlock)("core/separator"),(0,y.createBlock)("core/group",{tagName:"main"},[(0,y.createBlock)("core/group",{layout:{inherit:!0}},[(0,y.createBlock)("core/post-title")]),(0,y.createBlock)("core/post-content",{layout:{inherit:!0}})])]),c=await o({slug:(0,v.cleanForSlug)(n||Qd),content:i,title:n||Qd});a(!1),s({postId:c.id,postType:"wp_template"}),l()},children:(0,L.jsxs)(Uo.__experimentalVStack,{spacing:"3",children:[(0,L.jsx)(Uo.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,fs.__)("Name"),value:n,onChange:i,placeholder:Qd,disabled:r,help:(0,fs.__)('Describe the template, e.g. "Post with sidebar". A custom template can be manually applied to any post or page.')}),(0,L.jsxs)(Uo.__experimentalHStack,{justify:"right",children:[(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:l,children:(0,fs.__)("Cancel")}),(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",isBusy:r,"aria-disabled":r,children:(0,fs.__)("Create")})]})]})})})}function Jd(){return(0,c.useSelect)((e=>{const{getCurrentPostId:t,getCurrentPostType:s}=e(Tc);return{postId:t(),postType:s()}}),[])}function eu(){const{postType:e,postId:t}=Jd();return(0,c.useSelect)((s=>{const{canUser:o,getEntityRecord:n,getEntityRecords:i}=s(d.store),r=o("read",{kind:"root",name:"site"})?n("root","site"):void 0,a=i("postType","wp_template",{per_page:-1}),l=+t===r?.page_for_posts,c="page"===e&&+t===r?.page_on_front&&a?.some((({slug:e})=>"front-page"===e));return!l&&!c}),[t,e])}function tu(e){return(0,c.useSelect)((t=>t(d.store).getEntityRecords("postType","wp_template",{per_page:-1,post_type:e})),[e])}function su(e){const t=ou(),s=eu(),o=tu(e);return(0,u.useMemo)((()=>s&&o?.filter((e=>e.is_custom&&e.slug!==t&&!!e.content.raw))),[o,t,s])}function ou(){const{postType:e,postId:t}=Jd(),s=tu(e),o=(0,c.useSelect)((s=>{const o=s(d.store).getEditedEntityRecord("postType",e,t);return o?.template}),[e,t]);if(o)return s?.find((e=>e.slug===o))?.slug}const nu={className:"editor-post-template__dropdown",placement:"bottom-start"};function iu({isOpen:e,onClick:t}){const s=(0,c.useSelect)((e=>{const t=e(Tc).getEditedPostAttribute("template"),{supportsTemplateMode:s,availableTemplates:o}=e(Tc).getEditorSettings();if(!s&&o[t])return o[t];const n=e(d.store).canUser("create",{kind:"postType",name:"wp_template"})&&e(Tc).getCurrentTemplateId();return n?.title||n?.slug||o?.[t]}),[]);return(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,variant:"tertiary","aria-expanded":e,"aria-label":(0,fs.__)("Template options"),onClick:t,children:null!=s?s:(0,fs.__)("Default template")})}function ru({onClose:e}){var t,s;const o=eu(),{availableTemplates:n,fetchedTemplates:i,selectedTemplateSlug:r,canCreate:a,canEdit:l,currentTemplateId:p,onNavigateToEntityRecord:m,getEditorSettings:g}=(0,c.useSelect)((e=>{const{canUser:t,getEntityRecords:s}=e(d.store),n=e(Tc).getEditorSettings(),i=t("create",{kind:"postType",name:"wp_template"}),r=e(Tc).getCurrentTemplateId();return{availableTemplates:n.availableTemplates,fetchedTemplates:i?s("postType","wp_template",{post_type:e(Tc).getCurrentPostType(),per_page:-1}):void 0,selectedTemplateSlug:e(Tc).getEditedPostAttribute("template"),canCreate:o&&i&&n.supportsTemplateMode,canEdit:o&&i&&n.supportsTemplateMode&&!!r,currentTemplateId:r,onNavigateToEntityRecord:n.onNavigateToEntityRecord,getEditorSettings:e(Tc).getEditorSettings}}),[o]),_=(0,u.useMemo)((()=>Object.entries({...n,...Object.fromEntries((null!=i?i:[]).map((({slug:e,title:t})=>[e,t.rendered])))}).map((([e,t])=>({value:e,label:t})))),[n,i]),f=null!==(t=_.find((e=>e.value===r)))&&void 0!==t?t:_.find((e=>!e.value)),{editPost:b}=(0,c.useDispatch)(Tc),{createSuccessNotice:y}=(0,c.useDispatch)(_s.store),[x,v]=(0,u.useState)(!1);return(0,L.jsxs)("div",{className:"editor-post-template__classic-theme-dropdown",children:[(0,L.jsx)(h.__experimentalInspectorPopoverHeader,{title:(0,fs.__)("Template"),help:(0,fs.__)("Templates define the way content is displayed when viewing your site."),actions:a?[{icon:qd,label:(0,fs.__)("Add template"),onClick:()=>v(!0)}]:[],onClose:e}),o?(0,L.jsx)(Uo.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,hideLabelFromVision:!0,label:(0,fs.__)("Template"),value:null!==(s=f?.value)&&void 0!==s?s:"",options:_,onChange:e=>b({template:e||""})}):(0,L.jsx)(Uo.Notice,{status:"warning",isDismissible:!1,children:(0,fs.__)("The posts page template cannot be changed.")}),l&&m&&(0,L.jsx)("p",{children:(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,variant:"link",onClick:()=>{m({postId:p,postType:"wp_template"}),e(),y((0,fs.__)("Editing template. Changes made here affect all posts and pages that use the template."),{type:"snackbar",actions:[{label:(0,fs.__)("Go back"),onClick:()=>g().onNavigateToPreviousEntityRecord()}]})},children:(0,fs.__)("Edit template")})}),x&&(0,L.jsx)(Xd,{onClose:()=>v(!1)})]})}const au=function(){return(0,L.jsx)(Uo.Dropdown,{popoverProps:nu,focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,L.jsx)(iu,{isOpen:e,onClick:t}),renderContent:({onClose:e})=>(0,L.jsx)(ru,{onClose:e})})},{PreferenceBaseOption:lu}=(window.wp.warning,$(k.privateApis));function cu(e){const{toggleEditorPanelEnabled:t}=(0,c.useDispatch)(Tc),{isChecked:s,isRemoved:o}=(0,c.useSelect)((t=>{const{isEditorPanelEnabled:s,isEditorPanelRemoved:o}=t(Tc);return{isChecked:s(e.panelName),isRemoved:o(e.panelName)}}),[e.panelName]);return o?null:(0,L.jsx)(lu,{isChecked:s,onChange:()=>t(e.panelName),...e})}const{Fill:du,Slot:uu}=(0,Uo.createSlotFill)("EnablePluginDocumentSettingPanelOption"),pu=({label:e,panelName:t})=>(0,L.jsx)(du,{children:(0,L.jsx)(cu,{label:e,panelName:t})});pu.Slot=uu;const mu=pu,{Fill:hu,Slot:gu}=(0,Uo.createSlotFill)("PluginDocumentSettingPanel"),_u=({name:e,className:t,title:s,icon:o,children:n})=>{const{name:i}=(0,wa.usePluginContext)(),r=`${i}/${e}`,{opened:a,isEnabled:l}=(0,c.useSelect)((e=>{const{isEditorPanelOpened:t,isEditorPanelEnabled:s}=e(Tc);return{opened:t(r),isEnabled:s(r)}}),[r]),{toggleEditorPanelOpened:d}=(0,c.useDispatch)(Tc);return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(mu,{label:s,panelName:r}),(0,L.jsx)(hu,{children:l&&(0,L.jsx)(Uo.PanelBody,{className:t,title:s,icon:o,opened:a,onToggle:()=>d(r),children:n})})]})};_u.Slot=gu;const fu=_u,bu=({allowedBlocks:e,icon:t,label:s,onClick:o,small:n,role:i})=>(0,L.jsx)(h.BlockSettingsMenuControls,{children:({selectedBlocks:r,onClose:a})=>((e,t)=>{return!Array.isArray(t)||(s=t,0===e.filter((e=>!s.includes(e))).length);var s})(r,e)?(0,L.jsx)(Uo.MenuItem,{onClick:(0,p.compose)(o,a),icon:t,label:n?s:void 0,role:i,children:!n&&s}):null});function yu(e){var t;const s=(0,wa.usePluginContext)();return(0,L.jsx)(Wa,{name:"core/plugin-more-menu",as:null!==(t=e.as)&&void 0!==t?t:Uo.MenuItem,icon:e.icon||s.icon,...e})}const{Fill:xu,Slot:vu}=(0,Uo.createSlotFill)("PluginPostPublishPanel"),wu=({children:e,className:t,title:s,initialOpen:o=!1,icon:n})=>{const{icon:i}=(0,wa.usePluginContext)();return(0,L.jsx)(xu,{children:(0,L.jsx)(Uo.PanelBody,{className:t,initialOpen:o||!s,title:s,icon:null!=n?n:i,children:e})})};wu.Slot=vu;const Su=wu,{Fill:ku,Slot:Cu}=(0,Uo.createSlotFill)("PluginPostStatusInfo"),Pu=({children:e,className:t})=>(0,L.jsx)(ku,{children:(0,L.jsx)(Uo.PanelRow,{className:t,children:e})});Pu.Slot=Cu;const ju=Pu,{Fill:Eu,Slot:Tu}=(0,Uo.createSlotFill)("PluginPrePublishPanel"),Bu=({children:e,className:t,title:s,initialOpen:o=!1,icon:n})=>{const{icon:i}=(0,wa.usePluginContext)();return(0,L.jsx)(Eu,{children:(0,L.jsx)(Uo.PanelBody,{className:t,initialOpen:o||!s,title:s,icon:null!=n?n:i,children:e})})};Bu.Slot=Tu;const Iu=Bu;function Nu(e){var t;const s=(0,wa.usePluginContext)();return(0,L.jsx)(Wa,{name:"core/plugin-preview-menu",as:null!==(t=e.as)&&void 0!==t?t:Uo.MenuItem,icon:e.icon||s.icon,...e})}function Au({className:e,...t}){return(0,L.jsx)(el,{panelClassName:e,className:"editor-sidebar",scope:"core",...t})}function Du(e){return(0,L.jsx)(Ya,{__unstableExplicitMenuItem:!0,scope:"core",...e})}function Ru({onClick:e}){const[t,s]=(0,u.useState)(!1),{postType:o,postId:n}=Jd(),i=su(o),{editEntityRecord:r}=(0,c.useDispatch)(d.store);if(!i?.length)return null;return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Uo.MenuItem,{onClick:()=>s(!0),children:(0,fs.__)("Change template")}),t&&(0,L.jsx)(Uo.Modal,{title:(0,fs.__)("Choose a template"),onRequestClose:()=>s(!1),overlayClassName:"editor-post-template__swap-template-modal",isFullScreen:!0,children:(0,L.jsx)("div",{className:"editor-post-template__swap-template-modal-content",children:(0,L.jsx)(Mu,{postType:o,onSelect:async t=>{r("postType",o,n,{template:t.name},{undoIgnore:!0}),s(!1),e()}})})})]})}function Mu({postType:e,onSelect:t}){const s=su(e),o=(0,u.useMemo)((()=>s.map((e=>({name:e.slug,blocks:(0,y.parse)(e.content.raw),title:(0,Lo.decodeEntities)(e.title.rendered),id:e.id})))),[s]);return(0,L.jsx)(h.__experimentalBlockPatternsList,{label:(0,fs.__)("Templates"),blockPatterns:o,onClickPattern:t})}function Lu({onClick:e}){const t=ou(),s=eu(),{postType:o,postId:n}=Jd(),{editEntityRecord:i}=(0,c.useDispatch)(d.store);return t&&s?(0,L.jsx)(Uo.MenuItem,{onClick:()=>{i("postType",o,n,{template:""},{undoIgnore:!0}),e()},children:(0,fs.__)("Use default template")}):null}function Ou({onClick:e}){const{canCreateTemplates:t}=(0,c.useSelect)((e=>{const{canUser:t}=e(d.store);return{canCreateTemplates:t("create",{kind:"postType",name:"wp_template"})}}),[]),[s,o]=(0,u.useState)(!1),n=eu();return t&&n?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Uo.MenuItem,{onClick:()=>{o(!0)},children:(0,fs.__)("Create new template")}),s&&(0,L.jsx)(Xd,{onClose:()=>{o(!1),e()}})]}):null}const Fu={className:"editor-post-template__dropdown",placement:"bottom-start"};function Vu({id:e}){const{isTemplateHidden:t,onNavigateToEntityRecord:s,getEditorSettings:o,hasGoBack:n}=(0,c.useSelect)((e=>{const{getRenderingMode:t,getEditorSettings:s}=$(e(Tc)),o=s();return{isTemplateHidden:"post-only"===t(),onNavigateToEntityRecord:o.onNavigateToEntityRecord,getEditorSettings:s,hasGoBack:o.hasOwnProperty("onNavigateToPreviousEntityRecord")}}),[]),{get:i}=(0,c.useSelect)(k.store),{editedRecord:r,hasResolved:a}=(0,d.useEntityRecord)("postType","wp_template",e),{createSuccessNotice:l}=(0,c.useDispatch)(_s.store),{setRenderingMode:u}=(0,c.useDispatch)(Tc),p=(0,c.useSelect)((e=>!!e(d.store).canUser("create",{kind:"postType",name:"wp_template"})),[]);if(!a)return null;const m=n?[{label:(0,fs.__)("Go back"),onClick:()=>o().onNavigateToPreviousEntityRecord()}]:void 0;return(0,L.jsx)(Uo.DropdownMenu,{popoverProps:Fu,focusOnMount:!0,toggleProps:{size:"compact",variant:"tertiary",tooltipPosition:"middle left"},label:(0,fs.__)("Template options"),text:(0,Lo.decodeEntities)(r.title),icon:null,children:({onClose:e})=>(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(Uo.MenuGroup,{children:[p&&(0,L.jsx)(Uo.MenuItem,{onClick:()=>{s({postId:r.id,postType:"wp_template"}),e(),i("core/edit-site","welcomeGuideTemplate")||l((0,fs.__)("Editing template. Changes made here affect all posts and pages that use the template."),{type:"snackbar",actions:m})},children:(0,fs.__)("Edit template")}),(0,L.jsx)(Ru,{onClick:e}),(0,L.jsx)(Lu,{onClick:e}),p&&(0,L.jsx)(Ou,{onClick:e})]}),(0,L.jsx)(Uo.MenuGroup,{children:(0,L.jsx)(Uo.MenuItem,{icon:t?void 0:Ho,isSelected:!t,role:"menuitemcheckbox",onClick:()=>{u(t?"template-locked":"post-only")},children:(0,fs.__)("Show template")})})]})})}function zu(){const{templateId:e,isBlockTheme:t}=(0,c.useSelect)((e=>{const{getCurrentTemplateId:t,getEditorSettings:s}=e(Tc);return{templateId:t(),isBlockTheme:s().__unstableIsBlockBasedTheme}}),[]),s=(0,c.useSelect)((e=>{var t;const s=e(Tc).getCurrentPostType(),o=e(d.store).getPostType(s);if(!o?.viewable)return!1;const n=e(Tc).getEditorSettings();if(!!n.availableTemplates&&Object.keys(n.availableTemplates).length>0)return!0;if(!n.supportsTemplateMode)return!1;return null!==(t=e(d.store).canUser("create",{kind:"postType",name:"wp_template"}))&&void 0!==t&&t}),[]),o=(0,c.useSelect)((e=>{var t;return null!==(t=e(d.store).canUser("read",{kind:"postType",name:"wp_template"}))&&void 0!==t&&t}),[]);return t&&o||!s?t&&e?(0,L.jsx)(Md,{label:(0,fs.__)("Template"),children:(0,L.jsx)(Vu,{id:e})}):null:(0,L.jsx)(Md,{label:(0,fs.__)("Template"),children:(0,L.jsx)(au,{})})}const Uu={_fields:"id,name",context:"view"},Hu={who:"authors",per_page:100,...Uu};function Gu(e){const{authorId:t,authors:s,postAuthor:o}=(0,c.useSelect)((t=>{const{getUser:s,getUsers:o}=t(d.store),{getEditedPostAttribute:n}=t(Tc),i=n("author"),r={...Hu};return e&&(r.search=e,r.search_columns=["name"]),{authorId:i,authors:o(r),postAuthor:s(i,Uu)}}),[e]),n=(0,u.useMemo)((()=>{const e=(null!=s?s:[]).map((e=>({value:e.id,label:(0,Lo.decodeEntities)(e.name)}))),t=e.findIndex((({value:e})=>o?.id===e));let n=[];return t<0&&o?n=[{value:o.id,label:(0,Lo.decodeEntities)(o.name)}]:t<0&&!o&&(n=[{value:0,label:(0,fs.__)("(No author)")}]),[...n,...e]}),[s,o]);return{authorId:t,authorOptions:n,postAuthor:o}}function $u(){const[e,t]=(0,u.useState)(),{editPost:s}=(0,c.useDispatch)(Tc),{authorId:o,authorOptions:n}=Gu(e);return(0,L.jsx)(Uo.ComboboxControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,fs.__)("Author"),options:n,value:o,onFilterValueChange:(0,p.debounce)((e=>{t(e)}),300),onChange:e=>{e&&s({author:e})},allowReset:!1,hideLabelFromVision:!0})}function Wu(){const{editPost:e}=(0,c.useDispatch)(Tc),{authorId:t,authorOptions:s}=Gu();return(0,L.jsx)(Uo.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,className:"post-author-selector",label:(0,fs.__)("Author"),options:s,onChange:t=>{const s=Number(t);e({author:s})},value:t,hideLabelFromVision:!0})}const Zu=function(){return(0,c.useSelect)((e=>{const t=e(d.store).getUsers(Hu);return t?.length>=25}),[])?(0,L.jsx)($u,{}):(0,L.jsx)(Wu,{})};function Yu({children:e}){const{hasAssignAuthorAction:t,hasAuthors:s}=(0,c.useSelect)((e=>{var t;const s=e(Tc).getCurrentPost(),o=e(d.store).getUsers(Hu);return{hasAssignAuthorAction:null!==(t=s._links?.["wp:action-assign-author"])&&void 0!==t&&t,hasAuthors:o?.length>=1}}),[]);return t&&s?(0,L.jsx)(Ad,{supportKeys:"author",children:e}):null}function Ku({isOpen:e,onClick:t}){const{postAuthor:s}=Gu(),o=(0,Lo.decodeEntities)(s?.name)||(0,fs.__)("(No author)");return(0,L.jsx)(Uo.Button,{size:"compact",className:"editor-post-author__panel-toggle",variant:"tertiary","aria-expanded":e,"aria-label":(0,fs.sprintf)((0,fs.__)("Change author: %s"),o),onClick:t,children:o})}const qu=function(){const[e,t]=(0,u.useState)(null),s=(0,u.useMemo)((()=>({anchor:e,placement:"left-start",offset:36,shift:!0})),[e]);return(0,L.jsx)(Yu,{children:(0,L.jsx)(Md,{label:(0,fs.__)("Author"),ref:t,children:(0,L.jsx)(Uo.Dropdown,{popoverProps:s,contentClassName:"editor-post-author__panel-dialog",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,L.jsx)(Ku,{isOpen:e,onClick:t}),renderContent:({onClose:e})=>(0,L.jsxs)("div",{className:"editor-post-author",children:[(0,L.jsx)(h.__experimentalInspectorPopoverHeader,{title:(0,fs.__)("Author"),onClose:e}),(0,L.jsx)(Zu,{onClose:e})]})})})})},Qu=[{label:(0,fs._x)("Open",'Adjective: e.g. "Comments are open"'),value:"open",description:(0,fs.__)("Visitors can add new comments and replies.")},{label:(0,fs.__)("Closed"),value:"closed",description:[(0,fs.__)("Visitors cannot add new comments or replies."),(0,fs.__)("Existing comments remain visible.")].join(" ")}];const Xu=function(){const e=(0,c.useSelect)((e=>{var t;return null!==(t=e(Tc).getEditedPostAttribute("comment_status"))&&void 0!==t?t:"open"}),[]),{editPost:t}=(0,c.useDispatch)(Tc);return(0,L.jsx)("form",{children:(0,L.jsx)(Uo.__experimentalVStack,{spacing:4,children:(0,L.jsx)(Uo.RadioControl,{className:"editor-change-status__options",hideLabelFromVision:!0,label:(0,fs.__)("Comment status"),options:Qu,onChange:e=>t({comment_status:e}),selected:e})})})};const Ju=function(){const e=(0,c.useSelect)((e=>{var t;return null!==(t=e(Tc).getEditedPostAttribute("ping_status"))&&void 0!==t?t:"open"}),[]),{editPost:t}=(0,c.useDispatch)(Tc);return(0,L.jsx)(Uo.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,fs.__)("Enable pingbacks & trackbacks"),checked:"open"===e,onChange:()=>t({ping_status:"open"===e?"closed":"open"}),help:(0,L.jsx)(Uo.ExternalLink,{href:(0,fs.__)("https://wordpress.org/documentation/article/trackbacks-and-pingbacks/"),children:(0,fs.__)("Learn more about pingbacks & trackbacks")})})},ep="discussion-panel";function tp({onClose:e}){return(0,L.jsxs)("div",{className:"editor-post-discussion",children:[(0,L.jsx)(h.__experimentalInspectorPopoverHeader,{title:(0,fs.__)("Discussion"),onClose:e}),(0,L.jsxs)(Uo.__experimentalVStack,{spacing:4,children:[(0,L.jsx)(Ad,{supportKeys:"comments",children:(0,L.jsx)(Xu,{})}),(0,L.jsx)(Ad,{supportKeys:"trackbacks",children:(0,L.jsx)(Ju,{})})]})]})}function sp({isOpen:e,onClick:t}){const{commentStatus:s,pingStatus:o,commentsSupported:n,trackbacksSupported:i}=(0,c.useSelect)((e=>{var t,s;const{getEditedPostAttribute:o}=e(Tc),{getPostType:n}=e(d.store),i=n(o("type"));return{commentStatus:null!==(t=o("comment_status"))&&void 0!==t?t:"open",pingStatus:null!==(s=o("ping_status"))&&void 0!==s?s:"open",commentsSupported:!!i.supports.comments,trackbacksSupported:!!i.supports.trackbacks}}),[]);let r;return r="open"===s?"open"===o?(0,fs._x)("Open",'Adjective: e.g. "Comments are open"'):i?(0,fs.__)("Comments only"):(0,fs._x)("Open",'Adjective: e.g. "Comments are open"'):"open"===o?n?(0,fs.__)("Pings only"):(0,fs.__)("Pings enabled"):(0,fs.__)("Closed"),(0,L.jsx)(Uo.Button,{size:"compact",className:"editor-post-discussion__panel-toggle",variant:"tertiary","aria-label":(0,fs.__)("Change discussion options"),"aria-expanded":e,onClick:t,children:r})}function op(){const{isEnabled:e}=(0,c.useSelect)((e=>{const{isEditorPanelEnabled:t}=e(Tc);return{isEnabled:t(ep)}}),[]),[t,s]=(0,u.useState)(null),o=(0,u.useMemo)((()=>({anchor:t,placement:"left-start",offset:36,shift:!0})),[t]);return e?(0,L.jsx)(Ad,{supportKeys:["comments","trackbacks"],children:(0,L.jsx)(Md,{label:(0,fs.__)("Discussion"),ref:s,children:(0,L.jsx)(Uo.Dropdown,{popoverProps:o,className:"editor-post-discussion__panel-dropdown",contentClassName:"editor-post-discussion__panel-dialog",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,L.jsx)(sp,{isOpen:e,onClick:t}),renderContent:({onClose:e})=>(0,L.jsx)(tp,{onClose:e})})})}):null}function np({hideLabelFromVision:e=!1,updateOnBlur:t=!1}){const{excerpt:s,shouldUseDescriptionLabel:o,usedAttribute:n}=(0,c.useSelect)((e=>{const{getCurrentPostType:t,getEditedPostAttribute:s}=e(Tc),o=t(),n=["wp_template","wp_template_part"].includes(o)?"description":"excerpt";return{excerpt:s(n),shouldUseDescriptionLabel:["wp_template","wp_template_part","wp_block"].includes(o),usedAttribute:n}}),[]),{editPost:i}=(0,c.useDispatch)(Tc),[r,a]=(0,u.useState)((0,Lo.decodeEntities)(s)),l=e=>{i({[n]:e})},d=o?(0,fs.__)("Write a description (optional)"):(0,fs.__)("Write an excerpt (optional)");return(0,L.jsx)("div",{className:"editor-post-excerpt",children:(0,L.jsx)(Uo.TextareaControl,{__nextHasNoMarginBottom:!0,label:d,hideLabelFromVision:e,className:"editor-post-excerpt__textarea",onChange:t?a:l,onBlur:t?()=>l(r):void 0,value:t?r:s,help:o?(0,fs.__)("Write a description"):(0,L.jsx)(Uo.ExternalLink,{href:(0,fs.__)("https://wordpress.org/documentation/article/page-post-settings-sidebar/#excerpt"),children:(0,fs.__)("Learn more about manual excerpts")})})})}const ip=function({children:e}){return(0,L.jsx)(Ad,{supportKeys:"excerpt",children:e})},{Fill:rp,Slot:ap}=(0,Uo.createSlotFill)("PluginPostExcerpt"),lp=({children:e,className:t})=>(0,L.jsx)(rp,{children:(0,L.jsx)(Uo.PanelRow,{className:t,children:e})});lp.Slot=ap;const cp=lp,dp="post-excerpt";function up(){const{isOpened:e,isEnabled:t,postType:s}=(0,c.useSelect)((e=>{const{isEditorPanelOpened:t,isEditorPanelEnabled:s,getCurrentPostType:o}=e(Tc);return{isOpened:t(dp),isEnabled:s(dp),postType:o()}}),[]),{toggleEditorPanelOpened:o}=(0,c.useDispatch)(Tc);if(!t)return null;const n=["wp_template","wp_template_part","wp_block"].includes(s);return(0,L.jsx)(Uo.PanelBody,{title:n?(0,fs.__)("Description"):(0,fs.__)("Excerpt"),opened:e,onToggle:()=>o(dp),children:(0,L.jsx)(cp.Slot,{children:e=>(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(np,{}),e]})})})}function pp(){return(0,L.jsx)(ip,{children:(0,L.jsx)(up,{})})}function mp(){return(0,L.jsx)(ip,{children:(0,L.jsx)(hp,{})})}function hp(){const{shouldRender:e,excerpt:t,shouldBeUsedAsDescription:s,allowEditing:o}=(0,c.useSelect)((e=>{const{getCurrentPostType:t,getCurrentPostId:s,getEditedPostAttribute:o,isEditorPanelEnabled:n}=e(Tc),i=t(),r=["wp_template","wp_template_part"].includes(i),a="wp_block"===i,l=r||a,c=r?"description":"excerpt",u=r&&e(d.store).getEntityRecord("postType",i,s()),p=n(dp)||l;return{excerpt:o(c),shouldRender:p,shouldBeUsedAsDescription:l,allowEditing:p&&(!l||a||u&&u.source===A&&!u.has_theme_file&&u.is_custom)}}),[]),[n,i]=(0,u.useState)(null),r=s?(0,fs.__)("Description"):(0,fs.__)("Excerpt"),a=(0,u.useMemo)((()=>({anchor:n,"aria-label":r,headerTitle:r,placement:"left-start",offset:36,shift:!0})),[n,r]);if(!e)return!1;const l=!!t&&(0,L.jsx)(Uo.__experimentalText,{align:"left",numberOfLines:4,truncate:o,children:(0,Lo.decodeEntities)(t)});if(!o)return l;const p=s?(0,fs.__)("Add a description…"):(0,fs.__)("Add an excerpt…"),m=s?(0,fs.__)("Edit description"):(0,fs.__)("Edit excerpt");return(0,L.jsxs)(Uo.__experimentalVStack,{children:[l,(0,L.jsx)(Uo.Dropdown,{className:"editor-post-excerpt__dropdown",contentClassName:"editor-post-excerpt__dropdown__content",popoverProps:a,focusOnMount:!0,ref:i,renderToggle:({onToggle:e})=>(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,onClick:e,variant:"link",children:l?m:p}),renderContent:({onClose:e})=>(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(h.__experimentalInspectorPopoverHeader,{title:r,onClose:e}),(0,L.jsx)(Uo.__experimentalVStack,{spacing:4,children:(0,L.jsx)(cp.Slot,{children:e=>(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(np,{hideLabelFromVision:!0,updateOnBlur:!0}),e]})})})]})})]})}function gp({children:e,supportKeys:t}){const{postType:s,themeSupports:o}=(0,c.useSelect)((e=>({postType:e(Tc).getEditedPostAttribute("type"),themeSupports:e(d.store).getThemeSupports()})),[]);return(Array.isArray(t)?t:[t]).some((e=>{var t;const n=null!==(t=o?.[e])&&void 0!==t&&t;return"post-thumbnails"===e&&Array.isArray(n)?n.includes(s):n}))?e:null}const _p=function({children:e}){return(0,L.jsx)(gp,{supportKeys:"post-thumbnails",children:(0,L.jsx)(Ad,{supportKeys:"thumbnail",children:e})})},fp=["image"],bp=(0,fs.__)("Featured image"),yp=(0,fs.__)("Add a featured image"),xp=(0,L.jsx)("p",{children:(0,fs.__)("To edit the featured image, you need permission to upload media.")});const vp=(0,c.withSelect)((e=>{const{getMedia:t,getPostType:s,hasFinishedResolution:o}=e(d.store),{getCurrentPostId:n,getEditedPostAttribute:i}=e(Tc),r=i("featured_media");return{media:r?t(r,{context:"view"}):null,currentPostId:n(),postType:s(i("type")),featuredImageId:r,isRequestingFeaturedImageMedia:!!r&&!o("getMedia",[r,{context:"view"}])}})),wp=(0,c.withDispatch)(((e,{noticeOperations:t},{select:s})=>{const{editPost:o}=e(Tc);return{onUpdateImage(e){o({featured_media:e.id})},onDropImage(e){s(h.store).getSettings().mediaUpload({allowedTypes:["image"],filesList:e,onFileChange([e]){o({featured_media:e.id})},onError(e){t.removeAllNotices(),t.createErrorNotice(e)}})},onRemoveImage(){o({featured_media:0})}}})),Sp=(0,p.compose)(Uo.withNotices,vp,wp,(0,Uo.withFilters)("editor.PostFeaturedImage"))((function({currentPostId:e,featuredImageId:t,onUpdateImage:s,onRemoveImage:o,media:n,postType:i,noticeUI:r,noticeOperations:a,isRequestingFeaturedImageMedia:l}){const d=(0,u.useRef)(!1),[p,g]=(0,u.useState)(!1),{getSettings:_}=(0,c.useSelect)(h.store),{mediaSourceUrl:f}=function(e,t){var s,o;if(!e)return{};const n=(0,m.applyFilters)("editor.PostFeaturedImage.imageSize","large",e.id,t);if(n in(null!==(s=e?.media_details?.sizes)&&void 0!==s?s:{}))return{mediaWidth:e.media_details.sizes[n].width,mediaHeight:e.media_details.sizes[n].height,mediaSourceUrl:e.media_details.sizes[n].source_url};const i=(0,m.applyFilters)("editor.PostFeaturedImage.imageSize","thumbnail",e.id,t);return i in(null!==(o=e?.media_details?.sizes)&&void 0!==o?o:{})?{mediaWidth:e.media_details.sizes[i].width,mediaHeight:e.media_details.sizes[i].height,mediaSourceUrl:e.media_details.sizes[i].source_url}:{mediaWidth:e.media_details.width,mediaHeight:e.media_details.height,mediaSourceUrl:e.source_url}}(n,e);function b(e){_().mediaUpload({allowedTypes:fp,filesList:e,onFileChange([e]){(0,di.isBlobURL)(e?.url)?g(!0):(e&&s(e),g(!1))},onError(e){a.removeAllNotices(),a.createErrorNotice(e)}})}function y(e){return e.alt_text?(0,fs.sprintf)((0,fs.__)("Current image: %s"),e.alt_text):(0,fs.sprintf)((0,fs.__)("The current image has no alternative text. The file name is: %s"),e.media_details.sizes?.full?.file||e.slug)}function x(e){d.current&&e&&(e.focus(),d.current=!1)}const v=!l&&!!t&&!n;return(0,L.jsxs)(_p,{children:[r,(0,L.jsxs)("div",{className:"editor-post-featured-image",children:[n&&(0,L.jsx)("div",{id:`editor-post-featured-image-${t}-describedby`,className:"hidden",children:y(n)}),(0,L.jsx)(h.MediaUploadCheck,{fallback:xp,children:(0,L.jsx)(h.MediaUpload,{title:i?.labels?.featured_image||bp,onSelect:s,unstableFeaturedImageFlow:!0,allowedTypes:fp,modalClass:"editor-post-featured-image__media-modal",render:({open:e})=>(0,L.jsxs)("div",{className:"editor-post-featured-image__container",children:[v?(0,L.jsx)(Uo.Notice,{status:"warning",isDismissible:!1,children:(0,fs.__)("Could not retrieve the featured image data.")}):(0,L.jsxs)(Uo.Button,{__next40pxDefaultSize:!0,ref:x,className:t?"editor-post-featured-image__preview":"editor-post-featured-image__toggle",onClick:e,"aria-label":t?(0,fs.__)("Edit or replace the featured image"):null,"aria-describedby":t?`editor-post-featured-image-${t}-describedby`:null,"aria-haspopup":"dialog",disabled:p,accessibleWhenDisabled:!0,children:[!!t&&n&&(0,L.jsx)("img",{className:"editor-post-featured-image__preview-image",src:f,alt:y(n)}),(p||l)&&(0,L.jsx)(Uo.Spinner,{}),!t&&!p&&(i?.labels?.set_featured_image||yp)]}),!!t&&(0,L.jsxs)(Uo.__experimentalHStack,{className:Ai("editor-post-featured-image__actions",{"editor-post-featured-image__actions-missing-image":v,"editor-post-featured-image__actions-is-requesting-image":l}),children:[(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,className:"editor-post-featured-image__action",onClick:e,"aria-haspopup":"dialog",variant:v?"secondary":void 0,children:(0,fs.__)("Replace")}),(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,className:"editor-post-featured-image__action",onClick:()=>{o(),d.current=!0},variant:v?"secondary":void 0,isDestructive:v,children:(0,fs.__)("Remove")})]}),(0,L.jsx)(Uo.DropZone,{onFilesDrop:b})]}),value:t})})]})]})})),kp="featured-image";function Cp({withPanelBody:e=!0}){var t;const{postType:s,isEnabled:o,isOpened:n}=(0,c.useSelect)((e=>{const{getEditedPostAttribute:t,isEditorPanelEnabled:s,isEditorPanelOpened:o}=e(Tc),{getPostType:n}=e(d.store);return{postType:n(t("type")),isEnabled:s(kp),isOpened:o(kp)}}),[]),{toggleEditorPanelOpened:i}=(0,c.useDispatch)(Tc);return o?e?(0,L.jsx)(_p,{children:(0,L.jsx)(Uo.PanelBody,{title:null!==(t=s?.labels?.featured_image)&&void 0!==t?t:(0,fs.__)("Featured image"),opened:n,onToggle:()=>i(kp),children:(0,L.jsx)(Sp,{})})}):(0,L.jsx)(_p,{children:(0,L.jsx)(Sp,{})}):null}function Pp({children:e}){return(0,c.useSelect)((e=>e(Tc).getEditorSettings().disablePostFormats),[])?null:(0,L.jsx)(Ad,{supportKeys:"post-formats",children:e})}const jp=[{id:"aside",caption:(0,fs.__)("Aside")},{id:"audio",caption:(0,fs.__)("Audio")},{id:"chat",caption:(0,fs.__)("Chat")},{id:"gallery",caption:(0,fs.__)("Gallery")},{id:"image",caption:(0,fs.__)("Image")},{id:"link",caption:(0,fs.__)("Link")},{id:"quote",caption:(0,fs.__)("Quote")},{id:"standard",caption:(0,fs.__)("Standard")},{id:"status",caption:(0,fs.__)("Status")},{id:"video",caption:(0,fs.__)("Video")}].sort(((e,t)=>{const s=e.caption.toUpperCase(),o=t.caption.toUpperCase();return so?1:0}));function Ep(){const e=`post-format-selector-${(0,p.useInstanceId)(Ep)}`,{postFormat:t,suggestedFormat:s,supportedFormats:o}=(0,c.useSelect)((e=>{const{getEditedPostAttribute:t,getSuggestedPostFormat:s}=e(Tc),o=t("format"),n=e(d.store).getThemeSupports();return{postFormat:null!=o?o:"standard",suggestedFormat:s(),supportedFormats:n.formats}}),[]),n=jp.filter((e=>o?.includes(e.id)||t===e.id)),i=n.find((e=>e.id===s)),{editPost:r}=(0,c.useDispatch)(Tc),a=e=>r({format:e});return(0,L.jsx)(Pp,{children:(0,L.jsxs)("div",{className:"editor-post-format",children:[(0,L.jsx)(Uo.RadioControl,{className:"editor-post-format__options",label:(0,fs.__)("Post Format"),selected:t,onChange:e=>a(e),id:e,options:n.map((e=>({label:e.caption,value:e.id}))),hideLabelFromVision:!0}),i&&i.id!==t&&(0,L.jsx)("p",{className:"editor-post-format__suggestion",children:(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,variant:"link",onClick:()=>a(i.id),children:(0,fs.sprintf)((0,fs.__)("Apply suggested format: %s"),i.caption)})})]})})}const Tp=function({children:e}){const{lastRevisionId:t,revisionsCount:s}=(0,c.useSelect)((e=>{const{getCurrentPostLastRevisionId:t,getCurrentPostRevisionsCount:s}=e(Tc);return{lastRevisionId:t(),revisionsCount:s()}}),[]);return!t||s<2?null:(0,L.jsx)(Ad,{supportKeys:"revisions",children:e})};function Bp(){return(0,c.useSelect)((e=>{const{getCurrentPostLastRevisionId:t,getCurrentPostRevisionsCount:s}=e(Tc);return{lastRevisionId:t(),revisionsCount:s()}}),[])}function Ip(){const{lastRevisionId:e,revisionsCount:t}=Bp();return(0,L.jsx)(Tp,{children:(0,L.jsx)(Md,{label:(0,fs.__)("Revisions"),children:(0,L.jsx)(Uo.Button,{href:(0,v.addQueryArgs)("revision.php",{revision:e}),className:"editor-private-post-last-revision__button",text:t,variant:"tertiary",size:"compact"})})})}const Np=function(){const{lastRevisionId:e,revisionsCount:t}=Bp();return(0,L.jsx)(Tp,{children:(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,href:(0,v.addQueryArgs)("revision.php",{revision:e}),className:"editor-post-last-revision__title",icon:hi,iconPosition:"right",text:(0,fs.sprintf)((0,fs.__)("Revisions (%s)"),t)})})};const Ap=function(){return(0,L.jsx)(Tp,{children:(0,L.jsx)(Uo.PanelBody,{className:"editor-post-last-revision__panel",children:(0,L.jsx)(Np,{})})})};function Dp(){const e="core/editor/post-locked-modal-"+(0,p.useInstanceId)(Dp),{autosave:t,updatePostLock:s}=(0,c.useDispatch)(Tc),{isLocked:o,isTakeover:n,user:i,postId:r,postLockUtils:a,activePostLock:l,postType:h,previewLink:g}=(0,c.useSelect)((e=>{const{isPostLocked:t,isPostLockTakeover:s,getPostLockUser:o,getCurrentPostId:n,getActivePostLock:i,getEditedPostAttribute:r,getEditedPostPreviewLink:a,getEditorSettings:l}=e(Tc),{getPostType:c}=e(d.store);return{isLocked:t(),isTakeover:s(),user:o(),postId:n(),postLockUtils:l().postLockUtils,activePostLock:i(),postType:c(r("type")),previewLink:a()}}),[]);if((0,u.useEffect)((()=>{function n(){if(o||!l)return;const e=new window.FormData;if(e.append("action","wp-remove-post-lock"),e.append("_wpnonce",a.unlockNonce),e.append("post_ID",r),e.append("active_post_lock",l),window.navigator.sendBeacon)window.navigator.sendBeacon(a.ajaxUrl,e);else{const t=new window.XMLHttpRequest;t.open("POST",a.ajaxUrl,!1),t.send(e)}}return(0,m.addAction)("heartbeat.send",e,(function(e){o||(e["wp-refresh-post-lock"]={lock:l,post_id:r})})),(0,m.addAction)("heartbeat.tick",e,(function(e){if(!e["wp-refresh-post-lock"])return;const o=e["wp-refresh-post-lock"];o.lock_error?(t(),s({isLocked:!0,isTakeover:!0,user:{name:o.lock_error.name,avatar:o.lock_error.avatar_src_2x}})):o.new_lock&&s({isLocked:!1,activePostLock:o.new_lock})})),window.addEventListener("beforeunload",n),()=>{(0,m.removeAction)("heartbeat.send",e),(0,m.removeAction)("heartbeat.tick",e),window.removeEventListener("beforeunload",n)}}),[]),!o)return null;const _=i.name,f=i.avatar,b=(0,v.addQueryArgs)("post.php",{"get-post-lock":"1",lockKey:!0,post:r,action:"edit",_wpnonce:a.nonce}),y=(0,v.addQueryArgs)("edit.php",{post_type:h?.slug}),x=(0,fs.__)("Exit editor");return(0,L.jsx)(Uo.Modal,{title:n?(0,fs.__)("Someone else has taken over this post"):(0,fs.__)("This post is already being edited"),focusOnMount:!0,shouldCloseOnClickOutside:!1,shouldCloseOnEsc:!1,isDismissible:!1,className:"editor-post-locked-modal",size:"medium",children:(0,L.jsxs)(Uo.__experimentalHStack,{alignment:"top",spacing:6,children:[!!f&&(0,L.jsx)("img",{src:f,alt:(0,fs.__)("Avatar"),className:"editor-post-locked-modal__avatar",width:64,height:64}),(0,L.jsxs)("div",{children:[!!n&&(0,L.jsx)("p",{children:(0,u.createInterpolateElement)(_?(0,fs.sprintf)((0,fs.__)("%s now has editing control of this post (). Don’t worry, your changes up to this moment have been saved."),_):(0,fs.__)("Another user now has editing control of this post (). Don’t worry, your changes up to this moment have been saved."),{strong:(0,L.jsx)("strong",{}),PreviewLink:(0,L.jsx)(Uo.ExternalLink,{href:g,children:(0,fs.__)("preview")})})}),!n&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)("p",{children:(0,u.createInterpolateElement)(_?(0,fs.sprintf)((0,fs.__)("%s is currently working on this post (), which means you cannot make changes, unless you take over."),_):(0,fs.__)("Another user is currently working on this post (), which means you cannot make changes, unless you take over."),{strong:(0,L.jsx)("strong",{}),PreviewLink:(0,L.jsx)(Uo.ExternalLink,{href:g,children:(0,fs.__)("preview")})})}),(0,L.jsx)("p",{children:(0,fs.__)("If you take over, the other user will lose editing control to the post, but their changes will be saved.")})]}),(0,L.jsxs)(Uo.__experimentalHStack,{className:"editor-post-locked-modal__buttons",justify:"flex-end",children:[!n&&(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,variant:"tertiary",href:b,children:(0,fs.__)("Take over")}),(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,variant:"primary",href:y,children:x})]})]})]})})}const Rp=function({children:e}){const{hasPublishAction:t,isPublished:s}=(0,c.useSelect)((e=>{var t;const{isCurrentPostPublished:s,getCurrentPost:o}=e(Tc);return{hasPublishAction:null!==(t=o()._links?.["wp:action-publish"])&&void 0!==t&&t,isPublished:s()}}),[]);return s||!t?null:e};const Mp=function(){const e=(0,c.useSelect)((e=>e(Tc).getEditedPostAttribute("status")),[]),{editPost:t}=(0,c.useDispatch)(Tc);return(0,L.jsx)(Rp,{children:(0,L.jsx)(Uo.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,fs.__)("Pending review"),checked:"pending"===e,onChange:()=>{t({status:"pending"===e?"draft":"pending"})}})})};function Lp({className:e,textContent:t,forceIsAutosaveable:s,role:o,onPreview:n}){const{postId:i,currentPostLink:r,previewLink:a,isSaveable:l,isViewable:p}=(0,c.useSelect)((e=>{var t;const s=e(Tc),o=e(d.store).getPostType(s.getCurrentPostType("type")),n=null!==(t=o?.viewable)&&void 0!==t&&t;return n?{postId:s.getCurrentPostId(),currentPostLink:s.getCurrentPostAttribute("link"),previewLink:s.getEditedPostPreviewLink(),isSaveable:s.isEditedPostSaveable(),isViewable:n}:{isViewable:n}}),[]),{__unstableSaveForPreview:h}=(0,c.useDispatch)(Tc);if(!p)return null;const g=`wp-preview-${i}`,_=a||r;return(0,L.jsx)(Uo.Button,{variant:e?void 0:"tertiary",className:e||"editor-post-preview",href:_,target:g,accessibleWhenDisabled:!0,disabled:!l,onClick:async e=>{e.preventDefault();const t=window.open("",g);t.focus(),function(e){let t=(0,u.renderToString)((0,L.jsxs)("div",{className:"editor-post-preview-button__interstitial-message",children:[(0,L.jsxs)(Uo.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 96 96",children:[(0,L.jsx)(Uo.Path,{className:"outer",d:"M48 12c19.9 0 36 16.1 36 36S67.9 84 48 84 12 67.9 12 48s16.1-36 36-36",fill:"none"}),(0,L.jsx)(Uo.Path,{className:"inner",d:"M69.5 46.4c0-3.9-1.4-6.7-2.6-8.8-1.6-2.6-3.1-4.9-3.1-7.5 0-2.9 2.2-5.7 5.4-5.7h.4C63.9 19.2 56.4 16 48 16c-11.2 0-21 5.7-26.7 14.4h2.1c3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3L40 67.5l7-20.9L42 33c-1.7-.1-3.3-.3-3.3-.3-1.7-.1-1.5-2.7.2-2.6 0 0 5.3.4 8.4.4 3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3l11.5 34.3 3.3-10.4c1.6-4.5 2.4-7.8 2.4-10.5zM16.1 48c0 12.6 7.3 23.5 18 28.7L18.8 35c-1.7 4-2.7 8.4-2.7 13zm32.5 2.8L39 78.6c2.9.8 5.9 1.3 9 1.3 3.7 0 7.3-.6 10.6-1.8-.1-.1-.2-.3-.2-.4l-9.8-26.9zM76.2 36c0 3.2-.6 6.9-2.4 11.4L64 75.6c9.5-5.5 15.9-15.8 15.9-27.6 0-5.5-1.4-10.8-3.9-15.3.1 1 .2 2.1.2 3.3z",fill:"none"})]}),(0,L.jsx)("p",{children:(0,fs.__)("Generating preview…")})]}));t+='\n\t\t\n\t',t=(0,m.applyFilters)("editor.PostPreview.interstitialMarkup",t),e.write(t),e.title=(0,fs.__)("Generating preview…"),e.close()}(t.document);const o=await h({forceIsAutosaveable:s});t.location=o,n?.()},role:o,size:"compact",children:t||(0,L.jsxs)(L.Fragment,{children:[(0,fs._x)("Preview","imperative verb"),(0,L.jsx)(Uo.VisuallyHidden,{as:"span",children:(0,fs.__)("(opens in a new tab)")})]})})}function Op(){const e=(0,p.useViewportMatch)("medium","<"),{isPublished:t,isBeingScheduled:s,isSaving:o,isPublishing:n,hasPublishAction:i,isAutosaving:r,hasNonPostEntityChanges:a,postStatusHasChanged:l,postStatus:d}=(0,c.useSelect)((e=>{var t;const{isCurrentPostPublished:s,isEditedPostBeingScheduled:o,isSavingPost:n,isPublishingPost:i,getCurrentPost:r,getCurrentPostType:a,isAutosavingPost:l,getPostEdits:c,getEditedPostAttribute:d}=e(Tc);return{isPublished:s(),isBeingScheduled:o(),isSaving:n(),isPublishing:i(),hasPublishAction:null!==(t=r()._links?.["wp:action-publish"])&&void 0!==t&&t,postType:a(),isAutosaving:l(),hasNonPostEntityChanges:e(Tc).hasNonPostEntityChanges(),postStatusHasChanged:!!c()?.status,postStatus:d("status")}}),[]);return n?(0,fs.__)("Publishing…"):(t||s)&&o&&!r?(0,fs.__)("Saving…"):i?a||t||l&&!["future","publish"].includes(d)||!l&&"future"===d?(0,fs.__)("Save"):s?(0,fs.__)("Schedule"):(0,fs.__)("Publish"):e?(0,fs.__)("Publish"):(0,fs.__)("Submit for Review")}const Fp=()=>{};class Vp extends u.Component{constructor(e){super(e),this.createOnClick=this.createOnClick.bind(this),this.closeEntitiesSavedStates=this.closeEntitiesSavedStates.bind(this),this.state={entitiesSavedStatesCallback:!1}}createOnClick(e){return(...t)=>{const{hasNonPostEntityChanges:s,setEntitiesSavedStatesCallback:o}=this.props;return s&&o?(this.setState({entitiesSavedStatesCallback:()=>e(...t)}),o((()=>this.closeEntitiesSavedStates)),Fp):e(...t)}}closeEntitiesSavedStates(e){const{postType:t,postId:s}=this.props,{entitiesSavedStatesCallback:o}=this.state;this.setState({entitiesSavedStatesCallback:!1},(()=>{e&&e.some((e=>"postType"===e.kind&&e.name===t&&e.key===s))&&o()}))}render(){const{forceIsDirty:e,hasPublishAction:t,isBeingScheduled:s,isOpen:o,isPostSavingLocked:n,isPublishable:i,isPublished:r,isSaveable:a,isSaving:l,isAutoSaving:c,isToggle:d,savePostStatus:u,onSubmit:p=Fp,onToggle:m,visibility:h,hasNonPostEntityChanges:g,isSavingNonPostEntityChanges:_,postStatus:f,postStatusHasChanged:b}=this.props,y=(l||!a||n||!i&&!e)&&(!g||_),x=(r||l||!a||!i&&!e)&&(!g||_);let v="publish";b?v=f:t?"private"===h?v="private":s&&(v="future"):v="pending";const w={"aria-disabled":y,className:"editor-post-publish-button",isBusy:!c&&l,variant:"primary",onClick:this.createOnClick((()=>{y||(p(),u(v))})),"aria-haspopup":g?"dialog":void 0},S={"aria-disabled":x,"aria-expanded":o,className:"editor-post-publish-panel__toggle",isBusy:l&&r,variant:"primary",size:"compact",onClick:this.createOnClick((()=>{x||m()})),"aria-haspopup":g?"dialog":void 0},k=d?S:w;return(0,L.jsx)(L.Fragment,{children:(0,L.jsx)(Uo.Button,{...k,className:`${k.className} editor-post-publish-button__button`,size:"compact",children:(0,L.jsx)(Op,{})})})}}const zp=(0,p.compose)([(0,c.withSelect)((e=>{var t;const{isSavingPost:s,isAutosavingPost:o,isEditedPostBeingScheduled:n,getEditedPostVisibility:i,isCurrentPostPublished:r,isEditedPostSaveable:a,isEditedPostPublishable:l,isPostSavingLocked:c,getCurrentPost:d,getCurrentPostType:u,getCurrentPostId:p,hasNonPostEntityChanges:m,isSavingNonPostEntityChanges:h,getEditedPostAttribute:g,getPostEdits:_}=e(Tc);return{isSaving:s(),isAutoSaving:o(),isBeingScheduled:n(),visibility:i(),isSaveable:a(),isPostSavingLocked:c(),isPublishable:l(),isPublished:r(),hasPublishAction:null!==(t=d()._links?.["wp:action-publish"])&&void 0!==t&&t,postType:u(),postId:p(),postStatus:g("status"),postStatusHasChanged:_()?.status,hasNonPostEntityChanges:m(),isSavingNonPostEntityChanges:h()}})),(0,c.withDispatch)((e=>{const{editPost:t,savePost:s}=e(Tc);return{savePostStatus:e=>{t({status:e},{undoIgnore:!0}),s()}}}))])(Vp),Up=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24",children:(0,L.jsx)(M.Path,{d:"M20 10c0-5.51-4.49-10-10-10C4.48 0 0 4.49 0 10c0 5.52 4.48 10 10 10 5.51 0 10-4.48 10-10zM7.78 15.37L4.37 6.22c.55-.02 1.17-.08 1.17-.08.5-.06.44-1.13-.06-1.11 0 0-1.45.11-2.37.11-.18 0-.37 0-.58-.01C4.12 2.69 6.87 1.11 10 1.11c2.33 0 4.45.87 6.05 2.34-.68-.11-1.65.39-1.65 1.58 0 .74.45 1.36.9 2.1.35.61.55 1.36.55 2.46 0 1.49-1.4 5-1.4 5l-3.03-8.37c.54-.02.82-.17.82-.17.5-.05.44-1.25-.06-1.22 0 0-1.44.12-2.38.12-.87 0-2.33-.12-2.33-.12-.5-.03-.56 1.2-.06 1.22l.92.08 1.26 3.41zM17.41 10c.24-.64.74-1.87.43-4.25.7 1.29 1.05 2.71 1.05 4.25 0 3.29-1.73 6.24-4.4 7.78.97-2.59 1.94-5.2 2.92-7.78zM6.1 18.09C3.12 16.65 1.11 13.53 1.11 10c0-1.3.23-2.48.72-3.59C3.25 10.3 4.67 14.2 6.1 18.09zm4.03-6.63l2.58 6.98c-.86.29-1.76.45-2.71.45-.79 0-1.57-.11-2.29-.33.81-2.38 1.62-4.74 2.42-7.1z"})}),Hp={public:{label:(0,fs.__)("Public"),info:(0,fs.__)("Visible to everyone.")},private:{label:(0,fs.__)("Private"),info:(0,fs.__)("Only visible to site admins and editors.")},password:{label:(0,fs.__)("Password protected"),info:(0,fs.__)("Only those with the password can view this post.")}};function Gp({onClose:e}){const t=(0,p.useInstanceId)(Gp),{status:s,visibility:o,password:n}=(0,c.useSelect)((e=>({status:e(Tc).getEditedPostAttribute("status"),visibility:e(Tc).getEditedPostVisibility(),password:e(Tc).getEditedPostAttribute("password")}))),{editPost:i,savePost:r}=(0,c.useDispatch)(Tc),[a,l]=(0,u.useState)(!!n),[d,m]=(0,u.useState)(!1);return(0,L.jsxs)("div",{className:"editor-post-visibility",children:[(0,L.jsx)(h.__experimentalInspectorPopoverHeader,{title:(0,fs.__)("Visibility"),help:(0,fs.__)("Control how this post is viewed."),onClose:e}),(0,L.jsxs)("fieldset",{className:"editor-post-visibility__fieldset",children:[(0,L.jsx)(Uo.VisuallyHidden,{as:"legend",children:(0,fs.__)("Visibility")}),(0,L.jsx)($p,{instanceId:t,value:"public",label:Hp.public.label,info:Hp.public.info,checked:"public"===o&&!a,onChange:()=>{i({status:"private"===o?"draft":s,password:""}),l(!1)}}),(0,L.jsx)($p,{instanceId:t,value:"private",label:Hp.private.label,info:Hp.private.info,checked:"private"===o,onChange:()=>{m(!0)}}),(0,L.jsx)($p,{instanceId:t,value:"password",label:Hp.password.label,info:Hp.password.info,checked:a,onChange:()=>{i({status:"private"===o?"draft":s,password:n||""}),l(!0)}}),a&&(0,L.jsxs)("div",{className:"editor-post-visibility__password",children:[(0,L.jsx)(Uo.VisuallyHidden,{as:"label",htmlFor:`editor-post-visibility__password-input-${t}`,children:(0,fs.__)("Create password")}),(0,L.jsx)("input",{className:"editor-post-visibility__password-input",id:`editor-post-visibility__password-input-${t}`,type:"text",onChange:e=>{i({password:e.target.value})},value:n,placeholder:(0,fs.__)("Use a secure password")})]})]}),(0,L.jsx)(Uo.__experimentalConfirmDialog,{isOpen:d,onConfirm:()=>{i({status:"private",password:""}),l(!1),m(!1),r()},onCancel:()=>{m(!1)},confirmButtonText:(0,fs.__)("Publish"),size:"medium",children:(0,fs.__)("Would you like to privately publish this post now?")})]})}function $p({instanceId:e,value:t,label:s,info:o,...n}){return(0,L.jsxs)("div",{className:"editor-post-visibility__choice",children:[(0,L.jsx)("input",{type:"radio",name:`editor-post-visibility__setting-${e}`,value:t,id:`editor-post-${t}-${e}`,"aria-describedby":`editor-post-${t}-${e}-description`,className:"editor-post-visibility__radio",...n}),(0,L.jsx)("label",{htmlFor:`editor-post-${t}-${e}`,className:"editor-post-visibility__label",children:s}),(0,L.jsx)("p",{id:`editor-post-${t}-${e}-description`,className:"editor-post-visibility__info",children:o})]})}function Wp(){return Zp()}function Zp(){const e=(0,c.useSelect)((e=>e(Tc).getEditedPostVisibility()));return Hp[e]?.label}function Yp(e){const t=Object.prototype.toString.call(e);return e instanceof Date||"object"==typeof e&&"[object Date]"===t?new e.constructor(+e):"number"==typeof e||"[object Number]"===t||"string"==typeof e||"[object String]"===t?new Date(e):new Date(NaN)}function Kp(e){const t=Yp(e);return t.setDate(1),t.setHours(0,0,0,0),t}function qp(e){const t=Yp(e),s=t.getMonth();return t.setFullYear(t.getFullYear(),s+1,0),t.setHours(23,59,59,999),t}Math.pow(10,8);const Qp=6e4,Xp=36e5;function Jp(e,t){const s=t?.additionalDigits??2,o=function(e){const t={},s=e.split(em.dateTimeDelimiter);let o;if(s.length>2)return t;/:/.test(s[0])?o=s[0]:(t.date=s[0],o=s[1],em.timeZoneDelimiter.test(t.date)&&(t.date=e.split(em.timeZoneDelimiter)[0],o=e.substr(t.date.length,e.length)));if(o){const e=em.timezone.exec(o);e?(t.time=o.replace(e[1],""),t.timezone=e[1]):t.time=o}return t}(e);let n;if(o.date){const e=function(e,t){const s=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),o=e.match(s);if(!o)return{year:NaN,restDateString:""};const n=o[1]?parseInt(o[1]):null,i=o[2]?parseInt(o[2]):null;return{year:null===i?n:100*i,restDateString:e.slice((o[1]||o[2]).length)}}(o.date,s);n=function(e,t){if(null===t)return new Date(NaN);const s=e.match(tm);if(!s)return new Date(NaN);const o=!!s[4],n=nm(s[1]),i=nm(s[2])-1,r=nm(s[3]),a=nm(s[4]),l=nm(s[5])-1;if(o)return function(e,t,s){return t>=1&&t<=53&&s>=0&&s<=6}(0,a,l)?function(e,t,s){const o=new Date(0);o.setUTCFullYear(e,0,4);const n=o.getUTCDay()||7,i=7*(t-1)+s+1-n;return o.setUTCDate(o.getUTCDate()+i),o}(t,a,l):new Date(NaN);{const e=new Date(0);return function(e,t,s){return t>=0&&t<=11&&s>=1&&s<=(rm[t]||(am(e)?29:28))}(t,i,r)&&function(e,t){return t>=1&&t<=(am(e)?366:365)}(t,n)?(e.setUTCFullYear(t,i,Math.max(n,r)),e):new Date(NaN)}}(e.restDateString,e.year)}if(!n||isNaN(n.getTime()))return new Date(NaN);const i=n.getTime();let r,a=0;if(o.time&&(a=function(e){const t=e.match(sm);if(!t)return NaN;const s=im(t[1]),o=im(t[2]),n=im(t[3]);if(!function(e,t,s){if(24===e)return 0===t&&0===s;return s>=0&&s<60&&t>=0&&t<60&&e>=0&&e<25}(s,o,n))return NaN;return s*Xp+o*Qp+1e3*n}(o.time),isNaN(a)))return new Date(NaN);if(!o.timezone){const e=new Date(i+a),t=new Date(0);return t.setFullYear(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()),t.setHours(e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds()),t}return r=function(e){if("Z"===e)return 0;const t=e.match(om);if(!t)return 0;const s="+"===t[1]?-1:1,o=parseInt(t[2]),n=t[3]&&parseInt(t[3])||0;if(!function(e,t){return t>=0&&t<=59}(0,n))return NaN;return s*(o*Xp+n*Qp)}(o.timezone),isNaN(r)?new Date(NaN):new Date(i+a+r)}const em={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},tm=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,sm=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,om=/^([+-])(\d{2})(?::?(\d{2}))?$/;function nm(e){return e?parseInt(e):1}function im(e){return e&&parseFloat(e.replace(",","."))||0}const rm=[31,null,31,30,31,30,31,31,30,31,30,31];function am(e){return e%400==0||e%4==0&&e%100!=0}const{PrivatePublishDateTimePicker:lm}=$(h.privateApis);function cm(e){return(0,L.jsx)(dm,{...e,showPopoverHeaderActions:!0,isCompact:!1})}function dm({onClose:e,showPopoverHeaderActions:t,isCompact:s}){const{postDate:o,postType:n}=(0,c.useSelect)((e=>({postDate:e(Tc).getEditedPostAttribute("date"),postType:e(Tc).getCurrentPostType()})),[]),{editPost:i}=(0,c.useDispatch)(Tc),[r,a]=(0,u.useState)(Kp(new Date(o))),l=(0,c.useSelect)((e=>e(d.store).getEntityRecords("postType",n,{status:"publish,future",after:Kp(r).toISOString(),before:qp(r).toISOString(),exclude:[e(Tc).getCurrentPostId()],per_page:100,_fields:"id,date"})),[r,n]),p=(0,u.useMemo)((()=>(l||[]).map((({date:e})=>({date:new Date(e)})))),[l]),m=(0,x.getSettings)(),h=/a(?!\\)/i.test(m.formats.time.toLowerCase().replace(/\\\\/g,"").split("").reverse().join(""));return(0,L.jsx)(lm,{currentDate:o,onChange:e=>i({date:e}),is12Hour:h,dateOrder:(0,fs._x)("dmy","date order"),events:p,onMonthPreviewed:e=>a(Jp(e)),onClose:e,isCompact:s,showPopoverHeaderActions:t})}function um(e){return pm(e)}function pm({full:e=!1}={}){const{date:t,isFloating:s}=(0,c.useSelect)((e=>({date:e(Tc).getEditedPostAttribute("date"),isFloating:e(Tc).isEditedPostDateFloating()})),[]);return e?mm(t):function(e,{isFloating:t=!1,now:s=new Date}={}){if(!e||t)return(0,fs.__)("Immediately");if(!function(e){const{timezone:t}=(0,x.getSettings)(),s=Number(t.offset),o=e.getTimezoneOffset()/60*-1;return s===o}(s))return mm(e);const o=(0,x.getDate)(e);if(hm(o,s))return(0,fs.sprintf)((0,fs.__)("Today at %s"),(0,x.dateI18n)((0,fs._x)("g:i a","post schedule time format"),o));const n=new Date(s);if(n.setDate(n.getDate()+1),hm(o,n))return(0,fs.sprintf)((0,fs.__)("Tomorrow at %s"),(0,x.dateI18n)((0,fs._x)("g:i a","post schedule time format"),o));if(o.getFullYear()===s.getFullYear())return(0,x.dateI18n)((0,fs._x)("F j g:i a","post schedule date format without year"),o);return(0,x.dateI18n)((0,fs._x)("F j, Y g:i a","post schedule full date format"),o)}(t,{isFloating:s})}function mm(e){const t=(0,x.getDate)(e),s=function(){const{timezone:e}=(0,x.getSettings)();if(e.abbr&&isNaN(Number(e.abbr)))return e.abbr;const t=e.offset<0?"":"+";return`UTC${t}${e.offsetFormatted}`}(),o=(0,x.dateI18n)((0,fs._x)("F j, Y g:i a","post schedule full date format"),t);return(0,fs.isRTL)()?`${s} ${o}`:`${o} ${s}`}function hm(e,t){return e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}const gm=3,_m={per_page:10,orderby:"count",order:"desc",hide_empty:!0,_fields:"id,name,count",context:"view"};function fm({onSelect:e,taxonomy:t}){const{_terms:s,showTerms:o}=(0,c.useSelect)((e=>{const s=e(d.store).getEntityRecords("taxonomy",t.slug,_m);return{_terms:s,showTerms:s?.length>=gm}}),[t.slug]);if(!o)return null;const n=Vd(s);return(0,L.jsxs)("div",{className:"editor-post-taxonomies__flat-term-most-used",children:[(0,L.jsx)(Uo.BaseControl.VisualLabel,{as:"h3",className:"editor-post-taxonomies__flat-term-most-used-label",children:t.labels.most_used}),(0,L.jsx)("ul",{role:"list",className:"editor-post-taxonomies__flat-term-most-used-list",children:n.map((t=>(0,L.jsx)("li",{children:(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,variant:"link",onClick:()=>e(t),children:t.name})},t.id)))})]})}const bm=[],ym=100,xm={per_page:ym,_fields:"id,name",context:"view"},vm=(e,t)=>Od(e).toLowerCase()===Od(t).toLowerCase(),wm=(e,t)=>e.map((e=>t.find((t=>vm(t.name,e)))?.id)).filter((e=>void 0!==e)),Sm=({children:e,__nextHasNoMarginBottom:t})=>t?(0,L.jsx)(Uo.__experimentalVStack,{spacing:4,children:e}):(0,L.jsx)(u.Fragment,{children:e});function km({slug:e,__nextHasNoMarginBottom:t}){var s,o;const[n,i]=(0,u.useState)([]),[r,a]=(0,u.useState)(""),l=(0,p.useDebounce)(a,500);t||S()("Bottom margin styles for wp.editor.PostTaxonomiesFlatTermSelector",{since:"6.7",version:"7.0",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version."});const{terms:m,termIds:h,taxonomy:g,hasAssignAction:_,hasCreateAction:f,hasResolvedTerms:b}=(0,c.useSelect)((t=>{var s,o;const{getCurrentPost:n,getEditedPostAttribute:i}=t(Tc),{getEntityRecords:r,getTaxonomy:a,hasFinishedResolution:l}=t(d.store),c=n(),u=a(e),p=u?i(u.rest_base):bm,m={...xm,include:p?.join(","),per_page:-1};return{hasCreateAction:!!u&&(null!==(s=c._links?.["wp:action-create-"+u.rest_base])&&void 0!==s&&s),hasAssignAction:!!u&&(null!==(o=c._links?.["wp:action-assign-"+u.rest_base])&&void 0!==o&&o),taxonomy:u,termIds:p,terms:p?.length?r("taxonomy",e,m):bm,hasResolvedTerms:l("getEntityRecords",["taxonomy",e,m])}}),[e]),{searchResults:y}=(0,c.useSelect)((t=>{const{getEntityRecords:s}=t(d.store);return{searchResults:r?s("taxonomy",e,{...xm,search:r}):bm}}),[r,e]);(0,u.useEffect)((()=>{if(b){const e=(null!=m?m:[]).map((e=>Od(e.name)));i(e)}}),[m,b]);const x=(0,u.useMemo)((()=>(null!=y?y:[]).map((e=>Od(e.name)))),[y]),{editPost:v}=(0,c.useDispatch)(Tc),{saveEntityRecord:w}=(0,c.useDispatch)(d.store),{createErrorNotice:k}=(0,c.useDispatch)(_s.store);if(!_)return null;function C(e){v({[g.rest_base]:e})}const P=null!==(s=g?.labels?.add_new_item)&&void 0!==s?s:"post_tag"===e?(0,fs.__)("Add new tag"):(0,fs.__)("Add new Term"),j=null!==(o=g?.labels?.singular_name)&&void 0!==o?o:"post_tag"===e?(0,fs.__)("Tag"):(0,fs.__)("Term"),E=(0,fs.sprintf)((0,fs._x)("%s added","term"),j),T=(0,fs.sprintf)((0,fs._x)("%s removed","term"),j),B=(0,fs.sprintf)((0,fs._x)("Remove %s","term"),j);return(0,L.jsxs)(Sm,{__nextHasNoMarginBottom:t,children:[(0,L.jsx)(Uo.FormTokenField,{__next40pxDefaultSize:!0,value:n,suggestions:x,onChange:function(t){const s=[...null!=m?m:[],...null!=y?y:[]],o=t.reduce(((e,t)=>(e.some((e=>e.toLowerCase()===t.toLowerCase()))||e.push(t),e)),[]),n=o.filter((e=>!s.find((t=>vm(t.name,e)))));i(o),0!==n.length?f&&Promise.all(n.map((t=>async function(t){try{const s=await w("taxonomy",e,t,{throwOnError:!0});return Fd(s)}catch(e){if("term_exists"!==e.code)throw e;return{id:e.data.term_id,name:t.name}}}({name:t})))).then((e=>{const t=s.concat(e);C(wm(o,t))})).catch((e=>{k(e.message,{type:"snackbar"}),C(wm(o,s))})):C(wm(o,s))},onInputChange:l,maxSuggestions:ym,label:P,messages:{added:E,removed:T,remove:B},__nextHasNoMarginBottom:t}),(0,L.jsx)(fm,{taxonomy:g,onSelect:function(t){var s;if(h.includes(t.id))return;const o=[...h,t.id],n="post_tag"===e?(0,fs.__)("Tag"):(0,fs.__)("Term"),i=(0,fs.sprintf)((0,fs._x)("%s added","term"),null!==(s=g?.labels?.singular_name)&&void 0!==s?s:n);(0,ms.speak)(i,"assertive"),C(o)}})]})}const Cm=(0,Uo.withFilters)("editor.PostTaxonomyType")(km),Pm=()=>{const e=[(0,fs.__)("Suggestion:"),(0,L.jsx)("span",{className:"editor-post-publish-panel__link",children:(0,fs.__)("Add tags")},"label")];return(0,L.jsxs)(Uo.PanelBody,{initialOpen:!1,title:e,children:[(0,L.jsx)("p",{children:(0,fs.__)("Tags help users and search engines navigate your site and find your content. Add a few keywords to describe your post.")}),(0,L.jsx)(Cm,{slug:"post_tag",__nextHasNoMarginBottom:!0})]})},jm=()=>{const{hasTags:e,isPostTypeSupported:t}=(0,c.useSelect)((e=>{const t=e(Tc).getCurrentPostType(),s=e(d.store).getTaxonomy("post_tag"),o=s?.types?.includes(t),n=void 0!==s,i=s&&e(Tc).getEditedPostAttribute(s.rest_base);return{hasTags:!!i?.length,isPostTypeSupported:n&&o}}),[]),[s]=(0,u.useState)(e);return t?s?null:(0,L.jsx)(Pm,{}):null},Em=(e,t)=>jp.filter((t=>e?.includes(t.id))).find((e=>e.id===t)),Tm=({suggestedPostFormat:e,suggestionText:t,onUpdatePostFormat:s})=>(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,variant:"link",onClick:()=>s(e),children:t});function Bm(){const{currentPostFormat:e,suggestion:t}=(0,c.useSelect)((e=>{var t;const{getEditedPostAttribute:s,getSuggestedPostFormat:o}=e(Tc),n=null!==(t=e(d.store).getThemeSupports().formats)&&void 0!==t?t:[];return{currentPostFormat:s("format"),suggestion:Em(n,o())}}),[]),{editPost:s}=(0,c.useDispatch)(Tc),o=[(0,fs.__)("Suggestion:"),(0,L.jsx)("span",{className:"editor-post-publish-panel__link",children:(0,fs.__)("Use a post format")},"label")];return t&&t.id!==e?(0,L.jsxs)(Uo.PanelBody,{initialOpen:!1,title:o,children:[(0,L.jsx)("p",{children:(0,fs.__)("Your theme uses post formats to highlight different kinds of content, like images or videos. Apply a post format to see this special styling.")}),(0,L.jsx)("p",{children:(0,L.jsx)(Tm,{onUpdatePostFormat:e=>s({format:e}),suggestedPostFormat:t.id,suggestionText:(0,fs.sprintf)((0,fs.__)('Apply the "%1$s" format.'),t.caption)})})]}):null}const Im={per_page:-1,orderby:"name",order:"asc",_fields:"id,name,parent",context:"view"},Nm=8,Am=[];function Dm({slug:e}){var t,s;const[o,n]=(0,u.useState)(!1),[i,r]=(0,u.useState)(""),[a,l]=(0,u.useState)(""),[m,h]=(0,u.useState)(!1),[g,_]=(0,u.useState)(""),[f,b]=(0,u.useState)([]),y=(0,p.useDebounce)(ms.speak,500),{hasCreateAction:x,hasAssignAction:v,terms:w,loading:S,availableTerms:k,taxonomy:C}=(0,c.useSelect)((t=>{var s,o;const{getCurrentPost:n,getEditedPostAttribute:i}=t(Tc),{getTaxonomy:r,getEntityRecords:a,isResolving:l}=t(d.store),c=r(e),u=n();return{hasCreateAction:!!c&&(null!==(s=u._links?.["wp:action-create-"+c.rest_base])&&void 0!==s&&s),hasAssignAction:!!c&&(null!==(o=u._links?.["wp:action-assign-"+c.rest_base])&&void 0!==o&&o),terms:c?i(c.rest_base):Am,loading:l("getEntityRecords",["taxonomy",e,Im]),availableTerms:a("taxonomy",e,Im)||Am,taxonomy:c}}),[e]),{editPost:P}=(0,c.useDispatch)(Tc),{saveEntityRecord:j}=(0,c.useDispatch)(d.store),E=(0,u.useMemo)((()=>function(e,t){const s=e=>-1!==t.indexOf(e.id)||void 0!==e.children&&e.children.map(s).filter((e=>e)).length>0,o=[...e];return o.sort(((e,t)=>{const o=s(e),n=s(t);return o===n?0:o&&!n?-1:!o&&n?1:0})),o}(Ld(k),w)),[k]),{createErrorNotice:T}=(0,c.useDispatch)(_s.store);if(!v)return null;const B=e=>{P({[C.rest_base]:e})},I=e=>e.map((e=>(0,L.jsxs)("div",{className:"editor-post-taxonomies__hierarchical-terms-choice",children:[(0,L.jsx)(Uo.CheckboxControl,{__nextHasNoMarginBottom:!0,checked:-1!==w.indexOf(e.id),onChange:()=>{(e=>{const t=w.includes(e)?w.filter((t=>t!==e)):[...w,e];B(t)})(parseInt(e.id,10))},label:(0,Lo.decodeEntities)(e.name)}),!!e.children.length&&(0,L.jsx)("div",{className:"editor-post-taxonomies__hierarchical-terms-subchoices",children:I(e.children)})]},e.id))),N=(t,s,o)=>{var n;return null!==(n=C?.labels?.[t])&&void 0!==n?n:"category"===e?s:o},A=N("add_new_item",(0,fs.__)("Add new category"),(0,fs.__)("Add new term")),D=N("new_item_name",(0,fs.__)("Add new category"),(0,fs.__)("Add new term")),R=N("parent_item",(0,fs.__)("Parent Category"),(0,fs.__)("Parent Term")),M=`— ${R} —`,O=A,F=null!==(t=C?.labels?.search_items)&&void 0!==t?t:(0,fs.__)("Search Terms"),V=null!==(s=C?.name)&&void 0!==s?s:(0,fs.__)("Terms"),z=k.length>=Nm;return(0,L.jsxs)(Uo.Flex,{direction:"column",gap:"4",children:[z&&(0,L.jsx)(Uo.SearchControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:F,placeholder:F,value:g,onChange:e=>{const t=E.map(function(e){const t=s=>{if(""===e)return s;const o={...s};return o.children.length>0&&(o.children=o.children.map(t).filter((e=>e))),(-1!==o.name.toLowerCase().indexOf(e.toLowerCase())||o.children.length>0)&&o};return t}(e)).filter((e=>e)),s=e=>{let t=0;for(let o=0;o{h(!m)},className:"editor-post-taxonomies__hierarchical-terms-add","aria-expanded":m,variant:"link",children:A})}),m&&(0,L.jsx)("form",{onSubmit:async t=>{var s;if(t.preventDefault(),""===i||o)return;const c=function(e,t,s){return e.find((e=>(!e.parent&&!t||parseInt(e.parent)===parseInt(t))&&e.name.toLowerCase()===s.toLowerCase()))}(k,a,i);if(c)return w.some((e=>e===c.id))||B([...w,c.id]),r(""),void l("");let d;n(!0);try{d=await(u={name:i,parent:a||void 0},j("taxonomy",e,u,{throwOnError:!0}))}catch(e){return void T(e.message,{type:"snackbar"})}var u;const p="category"===e?(0,fs.__)("Category"):(0,fs.__)("Term"),m=(0,fs.sprintf)((0,fs._x)("%s added","term"),null!==(s=C?.labels?.singular_name)&&void 0!==s?s:p);(0,ms.speak)(m,"assertive"),n(!1),r(""),l(""),B([...w,d.id])},children:(0,L.jsxs)(Uo.Flex,{direction:"column",gap:"4",children:[(0,L.jsx)(Uo.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,className:"editor-post-taxonomies__hierarchical-terms-input",label:D,value:i,onChange:e=>{r(e)},required:!0}),!!k.length&&(0,L.jsx)(Uo.TreeSelect,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:R,noOptionLabel:M,onChange:e=>{l(e)},selectedId:a,tree:E}),(0,L.jsx)(Uo.FlexItem,{children:(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,variant:"secondary",type:"submit",className:"editor-post-taxonomies__hierarchical-terms-submit",children:O})})]})})]})}const Rm=(0,Uo.withFilters)("editor.PostTaxonomyType")(Dm);const Mm=function(){const e=(0,c.useSelect)((e=>{const t=e(Tc).getCurrentPostType(),{canUser:s,getEntityRecord:o,getTaxonomy:n}=e(d.store),i=n("category"),r=s("read",{kind:"root",name:"site"})?o("root","site")?.default_category:void 0,a=r?o("taxonomy","category",r):void 0,l=i&&i.types.some((e=>e===t)),c=i&&e(Tc).getEditedPostAttribute(i.rest_base);return!!i&&!!a&&l&&(0===c?.length||1===c?.length&&a?.id===c[0])}),[]),[t,s]=(0,u.useState)(!1);if((0,u.useEffect)((()=>{e&&s(!0)}),[e]),!t)return null;const o=[(0,fs.__)("Suggestion:"),(0,L.jsx)("span",{className:"editor-post-publish-panel__link",children:(0,fs.__)("Assign a category")},"label")];return(0,L.jsxs)(Uo.PanelBody,{initialOpen:!1,title:o,children:[(0,L.jsx)("p",{children:(0,fs.__)("Categories provide a helpful way to group related posts together and to quickly tell readers what a post is about.")}),(0,L.jsx)(Rm,{slug:"category"})]})};function Lm(e){return Object.fromEntries(Object.entries(function(e){const t=new Set;return Object.fromEntries(e.map((e=>{const s=(0,v.getFilename)(e);let o="";if(s){const e=s.split(".");e.length>1&&e.pop(),o=e.join(".")}return o||(o=Ar()),t.has(o)&&(o=`${o}-${Ar()}`),t.add(o),[e,o]})))}(e)).map((([e,t])=>{const s=window.fetch(e.includes("?")?e:e+"?").then((e=>e.blob())).then((e=>new File([e],`${t}.png`,{type:e.type})));return[e,s]})))}function Om(e){const t=[];return e.forEach((e=>{t.push(e),t.push(...Om(e.innerBlocks))})),t}function Fm(e){if("core/image"===e.name||"core/cover"===e.name){const{url:t,alt:s,id:o}=e.attributes;return{url:t,alt:s,id:o}}if("core/media-text"===e.name){const{mediaUrl:t,mediaAlt:s,mediaId:o}=e.attributes;return{url:t,alt:s,id:o}}return{}}function Vm({clientId:e,alt:t,url:s}){const{selectBlock:o}=(0,c.useDispatch)(h.store);return(0,L.jsx)(Uo.__unstableMotion.img,{tabIndex:0,role:"button","aria-label":(0,fs.__)("Select image block."),onClick:()=>{o(e)},onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||(o(e),t.preventDefault())},alt:t,src:s,animate:{opacity:1},exit:{opacity:0,scale:0},style:{width:"32px",height:"32px",objectFit:"cover",borderRadius:"2px",cursor:"pointer"},whileHover:{scale:1.08}},e)}function zm(){const[e,t]=(0,u.useState)(!1),[s,o]=(0,u.useState)(!1),[n,i]=(0,u.useState)(!1),{editorBlocks:r,mediaUpload:a}=(0,c.useSelect)((e=>({editorBlocks:e(h.store).getBlocks(),mediaUpload:e(h.store).getSettings().mediaUpload})),[]),l=Om(r).filter((e=>function(e){return"core/image"===e.name||"core/cover"===e.name?e.attributes.url&&!e.attributes.id:"core/media-text"===e.name?e.attributes.mediaUrl&&!e.attributes.mediaId:void 0}(e))),{updateBlockAttributes:d}=(0,c.useDispatch)(h.store);if(!a||!l.length)return null;const p=[(0,fs.__)("Suggestion:"),(0,L.jsx)("span",{className:"editor-post-publish-panel__link",children:(0,fs.__)("External media")},"label")];return(0,L.jsxs)(Uo.PanelBody,{initialOpen:!0,title:p,children:[(0,L.jsx)("p",{children:(0,fs.__)("Upload external images to the Media Library. Images from different domains may load slowly, display incorrectly, or be removed unexpectedly.")}),(0,L.jsxs)("div",{style:{display:"inline-flex",flexWrap:"wrap",gap:"8px"},children:[(0,L.jsx)(Uo.__unstableAnimatePresence,{onExitComplete:()=>o(!1),children:l.map((e=>{const{url:t,alt:s}=Fm(e);return(0,L.jsx)(Vm,{clientId:e.clientId,url:t,alt:s},e.clientId)}))}),e||s?(0,L.jsx)(Uo.Spinner,{}):(0,L.jsx)(Uo.Button,{size:"compact",variant:"primary",onClick:function(){t(!0),i(!1);const e=new Set(l.map((e=>{const{url:t}=Fm(e);return t}))),s=Object.fromEntries(Object.entries(Lm([...e])).map((([e,t])=>[e,t.then((e=>new Promise(((t,s)=>{a({filesList:[e],onFileChange:([e])=>{(0,di.isBlobURL)(e.url)||t(e)},onError(){s()}})}))))])));Promise.allSettled(l.map((e=>{const{url:t}=Fm(e);return s[t].then((t=>function(e,t){"core/image"!==e.name&&"core/cover"!==e.name||d(e.clientId,{id:t.id,url:t.url}),"core/media-text"===e.name&&d(e.clientId,{mediaId:t.id,mediaUrl:t.url})}(e,t))).then((()=>o(!0))).catch((()=>i(!0)))}))).finally((()=>{t(!1)}))},children:(0,fs._x)("Upload","verb")})]}),n&&(0,L.jsx)("p",{children:(0,fs.__)("Upload failed, try again.")})]})}const Um=function({children:e}){const{isBeingScheduled:t,isRequestingSiteIcon:s,hasPublishAction:o,siteIconUrl:n,siteTitle:i,siteHome:r}=(0,c.useSelect)((e=>{var t;const{getCurrentPost:s,isEditedPostBeingScheduled:o}=e(Tc),{getEntityRecord:n,isResolving:i}=e(d.store),r=n("root","__unstableBase",void 0)||{};return{hasPublishAction:null!==(t=s()._links?.["wp:action-publish"])&&void 0!==t&&t,isBeingScheduled:o(),isRequestingSiteIcon:i("getEntityRecord",["root","__unstableBase",void 0]),siteIconUrl:r.site_icon_url,siteTitle:r.name,siteHome:r.home&&(0,v.filterURLForDisplay)(r.home)}}),[]);let a,l,u=(0,L.jsx)(Uo.Icon,{className:"components-site-icon",size:"36px",icon:Up});return n&&(u=(0,L.jsx)("img",{alt:(0,fs.__)("Site Icon"),className:"components-site-icon",src:n})),s&&(u=null),o?t?(a=(0,fs.__)("Are you ready to schedule?"),l=(0,fs.__)("Your work will be published at the specified date and time.")):(a=(0,fs.__)("Are you ready to publish?"),l=(0,fs.__)("Double-check your settings before publishing.")):(a=(0,fs.__)("Are you ready to submit for review?"),l=(0,fs.__)("Your work will be reviewed and then approved.")),(0,L.jsxs)("div",{className:"editor-post-publish-panel__prepublish",children:[(0,L.jsx)("div",{children:(0,L.jsx)("strong",{children:a})}),(0,L.jsx)("p",{children:l}),(0,L.jsxs)("div",{className:"components-site-card",children:[u,(0,L.jsxs)("div",{className:"components-site-info",children:[(0,L.jsx)("span",{className:"components-site-name",children:(0,Lo.decodeEntities)(i)||(0,fs.__)("(Untitled)")}),(0,L.jsx)("span",{className:"components-site-home",children:r})]})]}),(0,L.jsx)(zm,{}),o&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Uo.PanelBody,{initialOpen:!1,title:[(0,fs.__)("Visibility:"),(0,L.jsx)("span",{className:"editor-post-publish-panel__link",children:(0,L.jsx)(Wp,{})},"label")],children:(0,L.jsx)(Gp,{})}),(0,L.jsx)(Uo.PanelBody,{initialOpen:!1,title:[(0,fs.__)("Publish:"),(0,L.jsx)("span",{className:"editor-post-publish-panel__link",children:(0,L.jsx)(um,{})},"label")],children:(0,L.jsx)(cm,{})})]}),(0,L.jsx)(Bm,{}),(0,L.jsx)(jm,{}),(0,L.jsx)(Mm,{}),e]})},Hm="%postname%",Gm="%pagename%";function $m({text:e}){const[t,s]=(0,u.useState)(!1),o=(0,u.useRef)(),n=(0,p.useCopyToClipboard)(e,(()=>{s(!0),o.current&&clearTimeout(o.current),o.current=setTimeout((()=>{s(!1)}),4e3)}));return(0,u.useEffect)((()=>()=>{o.current&&clearTimeout(o.current)}),[]),(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,variant:"secondary",ref:n,children:t?(0,fs.__)("Copied!"):(0,fs.__)("Copy")})}function Wm({focusOnMount:e,children:t}){const{post:s,postType:o,isScheduled:n}=(0,c.useSelect)((e=>{const{getEditedPostAttribute:t,getCurrentPost:s,isCurrentPostScheduled:o}=e(Tc),{getPostType:n}=e(d.store);return{post:s(),postType:n(t("type")),isScheduled:o()}}),[]),i=o?.labels?.singular_name,r=o?.labels?.view_item,a=o?.labels?.add_new_item,l="future"===s.status?(e=>{const{slug:t}=e;return e.permalink_template.includes(Hm)?e.permalink_template.replace(Hm,t):e.permalink_template.includes(Gm)?e.permalink_template.replace(Gm,t):e.permalink_template})(s):s.link,p=(0,v.addQueryArgs)("post-new.php",{post_type:s.type}),m=(0,u.useCallback)((t=>{e&&t&&t.focus()}),[e]),h=n?(0,L.jsxs)(L.Fragment,{children:[(0,fs.__)("is now scheduled. It will go live on")," ",(0,L.jsx)(um,{}),"."]}):(0,fs.__)("is now live.");return(0,L.jsxs)("div",{className:"post-publish-panel__postpublish",children:[(0,L.jsxs)(Uo.PanelBody,{className:"post-publish-panel__postpublish-header",children:[(0,L.jsx)("a",{ref:m,href:l,children:(0,Lo.decodeEntities)(s.title)||(0,fs.__)("(no title)")})," ",h]}),(0,L.jsxs)(Uo.PanelBody,{children:[(0,L.jsx)("p",{className:"post-publish-panel__postpublish-subheader",children:(0,L.jsx)("strong",{children:(0,fs.__)("What’s next?")})}),(0,L.jsxs)("div",{className:"post-publish-panel__postpublish-post-address-container",children:[(0,L.jsx)(Uo.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,className:"post-publish-panel__postpublish-post-address",readOnly:!0,label:(0,fs.sprintf)((0,fs.__)("%s address"),i),value:(0,v.safeDecodeURIComponent)(l),onFocus:e=>e.target.select()}),(0,L.jsx)("div",{className:"post-publish-panel__postpublish-post-address__copy-button-wrap",children:(0,L.jsx)($m,{text:l})})]}),(0,L.jsxs)("div",{className:"post-publish-panel__postpublish-buttons",children:[!n&&(0,L.jsx)(Uo.Button,{variant:"primary",href:l,__next40pxDefaultSize:!0,children:r}),(0,L.jsx)(Uo.Button,{variant:n?"primary":"secondary",__next40pxDefaultSize:!0,href:p,children:a})]})]}),t]})}class Zm extends u.Component{constructor(){super(...arguments),this.onSubmit=this.onSubmit.bind(this),this.cancelButtonNode=(0,u.createRef)()}componentDidMount(){this.timeoutID=setTimeout((()=>{this.cancelButtonNode.current.focus()}),0)}componentWillUnmount(){clearTimeout(this.timeoutID)}componentDidUpdate(e){(e.isPublished&&!this.props.isSaving&&this.props.isDirty||this.props.currentPostId!==e.currentPostId)&&this.props.onClose()}onSubmit(){const{onClose:e,hasPublishAction:t,isPostTypeViewable:s}=this.props;t&&s||e()}render(){const{forceIsDirty:e,isBeingScheduled:t,isPublished:s,isPublishSidebarEnabled:o,isScheduled:n,isSaving:i,isSavingNonPostEntityChanges:r,onClose:a,onTogglePublishSidebar:l,PostPublishExtension:c,PrePublishExtension:d,currentPostId:u,...p}=this.props,{hasPublishAction:m,isDirty:h,isPostTypeViewable:g,..._}=p,f=s||n&&t,b=!f&&!i,y=f&&!i;return(0,L.jsxs)("div",{className:"editor-post-publish-panel",..._,children:[(0,L.jsx)("div",{className:"editor-post-publish-panel__header",children:y?(0,L.jsx)(Uo.Button,{size:"compact",onClick:a,icon:Bn,label:(0,fs.__)("Close panel")}):(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)("div",{className:"editor-post-publish-panel__header-cancel-button",children:(0,L.jsx)(Uo.Button,{ref:this.cancelButtonNode,accessibleWhenDisabled:!0,disabled:r,onClick:a,variant:"secondary",size:"compact",children:(0,fs.__)("Cancel")})}),(0,L.jsx)("div",{className:"editor-post-publish-panel__header-publish-button",children:(0,L.jsx)(zp,{onSubmit:this.onSubmit,forceIsDirty:e})})]})}),(0,L.jsxs)("div",{className:"editor-post-publish-panel__content",children:[b&&(0,L.jsx)(Um,{children:d&&(0,L.jsx)(d,{})}),y&&(0,L.jsx)(Wm,{focusOnMount:!0,children:c&&(0,L.jsx)(c,{})}),i&&(0,L.jsx)(Uo.Spinner,{})]}),(0,L.jsx)("div",{className:"editor-post-publish-panel__footer",children:(0,L.jsx)(Uo.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,fs.__)("Always show pre-publish checks."),checked:o,onChange:l})})]})}}const Ym=(0,p.compose)([(0,c.withSelect)((e=>{var t;const{getPostType:s}=e(d.store),{getCurrentPost:o,getCurrentPostId:n,getEditedPostAttribute:i,isCurrentPostPublished:r,isCurrentPostScheduled:a,isEditedPostBeingScheduled:l,isEditedPostDirty:c,isAutosavingPost:u,isSavingPost:p,isSavingNonPostEntityChanges:m}=e(Tc),{isPublishSidebarEnabled:h}=e(Tc),g=s(i("type"));return{hasPublishAction:null!==(t=o()._links?.["wp:action-publish"])&&void 0!==t&&t,isPostTypeViewable:g?.viewable,isBeingScheduled:l(),isDirty:c(),isPublished:r(),isPublishSidebarEnabled:h(),isSaving:p()&&!u(),isSavingNonPostEntityChanges:m(),isScheduled:a(),currentPostId:n()}})),(0,c.withDispatch)(((e,{isPublishSidebarEnabled:t})=>{const{disablePublishSidebar:s,enablePublishSidebar:o}=e(Tc);return{onTogglePublishSidebar:()=>{t?s():o()}}})),Uo.withFocusReturn,Uo.withConstrainedTabbing])(Zm),Km=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.Path,{d:"M17.3 10.1C17.3 7.60001 15.2 5.70001 12.5 5.70001C10.3 5.70001 8.4 7.10001 7.9 9.00001H7.7C5.7 9.00001 4 10.7 4 12.8C4 14.9 5.7 16.6 7.7 16.6H9.5V15.2H7.7C6.5 15.2 5.5 14.1 5.5 12.9C5.5 11.7 6.5 10.5 7.7 10.5H9L9.3 9.40001C9.7 8.10001 11 7.20001 12.5 7.20001C14.3 7.20001 15.8 8.50001 15.8 10.1V11.4L17.1 11.6C17.9 11.7 18.5 12.5 18.5 13.4C18.5 14.4 17.7 15.2 16.8 15.2H14.5V16.6H16.7C18.5 16.6 19.9 15.1 19.9 13.3C20 11.7 18.8 10.4 17.3 10.1Z M14.1245 14.2426L15.1852 13.182L12.0032 10L8.82007 13.1831L9.88072 14.2438L11.25 12.8745V18H12.75V12.8681L14.1245 14.2426Z"})}),qm=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.Path,{d:"M17.3 10.1c0-2.5-2.1-4.4-4.8-4.4-2.2 0-4.1 1.4-4.6 3.3h-.2C5.7 9 4 10.7 4 12.8c0 2.1 1.7 3.8 3.7 3.8h9c1.8 0 3.2-1.5 3.2-3.3.1-1.6-1.1-2.9-2.6-3.2zm-.5 5.1h-9c-1.2 0-2.2-1.1-2.2-2.3s1-2.4 2.2-2.4h1.3l.3-1.1c.4-1.3 1.7-2.2 3.2-2.2 1.8 0 3.3 1.3 3.3 2.9v1.3l1.3.2c.8.1 1.4.9 1.4 1.8-.1 1-.9 1.8-1.8 1.8z"})});function Qm({children:e}){const{hasStickyAction:t,postType:s}=(0,c.useSelect)((e=>{var t;const s=e(Tc).getCurrentPost();return{hasStickyAction:null!==(t=s._links?.["wp:action-sticky"])&&void 0!==t&&t,postType:e(Tc).getCurrentPostType()}}),[]);return"post"===s&&t?e:null}function Xm(){const e=(0,c.useSelect)((e=>{var t;return null!==(t=e(Tc).getEditedPostAttribute("sticky"))&&void 0!==t&&t}),[]),{editPost:t}=(0,c.useDispatch)(Tc);return(0,L.jsx)(Qm,{children:(0,L.jsx)(Uo.CheckboxControl,{className:"editor-post-sticky__checkbox-control",label:(0,fs.__)("Sticky"),help:(0,fs.__)("Pin this post to the top of the blog"),checked:e,onChange:()=>t({sticky:!e}),__nextHasNoMarginBottom:!0})})}const Jm={"auto-draft":{label:(0,fs.__)("Draft"),icon:Oi},draft:{label:(0,fs.__)("Draft"),icon:Oi},pending:{label:(0,fs.__)("Pending"),icon:Vi},private:{label:(0,fs.__)("Private"),icon:zi},future:{label:(0,fs.__)("Scheduled"),icon:Fi},publish:{label:(0,fs.__)("Published"),icon:Ui}},eh=[{label:(0,fs.__)("Draft"),value:"draft",description:(0,fs.__)("Not ready to publish.")},{label:(0,fs.__)("Pending"),value:"pending",description:(0,fs.__)("Waiting for review before publishing.")},{label:(0,fs.__)("Private"),value:"private",description:(0,fs.__)("Only visible to site admins and editors.")},{label:(0,fs.__)("Scheduled"),value:"future",description:(0,fs.__)("Publish automatically on a chosen date.")},{label:(0,fs.__)("Published"),value:"publish",description:(0,fs.__)("Visible to everyone.")}],th=[T,B,I,N];function sh(){const{status:e,date:t,password:s,postId:o,postType:n,canEdit:i}=(0,c.useSelect)((e=>{var t;const{getEditedPostAttribute:s,getCurrentPostId:o,getCurrentPostType:n,getCurrentPost:i}=e(Tc);return{status:s("status"),date:s("date"),password:s("password"),postId:o(),postType:n(),canEdit:null!==(t=i()._links?.["wp:action-publish"])&&void 0!==t&&t}}),[]),[r,a]=(0,u.useState)(!!s),l=(0,p.useInstanceId)(sh,"editor-change-status__password-input"),{editEntityRecord:m}=(0,c.useDispatch)(d.store),[g,_]=(0,u.useState)(null),f=(0,u.useMemo)((()=>({anchor:g,"aria-label":(0,fs.__)("Status & visibility"),headerTitle:(0,fs.__)("Status & visibility"),placement:"left-start",offset:36,shift:!0})),[g]);if(th.includes(n))return null;const b=({status:i=e,password:r=s,date:a=t})=>{m("postType",n,o,{status:i,date:a,password:r})},y=e=>{a(e),e||b({password:""})},x=o=>{let n=t,i=s;"future"===e&&new Date(t)>new Date&&(n=null),"private"===o&&s&&(i=""),b({status:o,date:n,password:i})};return(0,L.jsx)(Md,{label:(0,fs.__)("Status"),ref:_,children:i?(0,L.jsx)(Uo.Dropdown,{className:"editor-post-status",contentClassName:"editor-change-status__content",popoverProps:f,focusOnMount:!0,renderToggle:({onToggle:t,isOpen:s})=>(0,L.jsx)(Uo.Button,{className:"editor-post-status__toggle",variant:"tertiary",size:"compact",onClick:t,icon:Jm[e]?.icon,"aria-label":(0,fs.sprintf)((0,fs.__)("Change status: %s"),Jm[e]?.label),"aria-expanded":s,children:Jm[e]?.label}),renderContent:({onClose:t})=>(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(h.__experimentalInspectorPopoverHeader,{title:(0,fs.__)("Status & visibility"),onClose:t}),(0,L.jsx)("form",{children:(0,L.jsxs)(Uo.__experimentalVStack,{spacing:4,children:[(0,L.jsx)(Uo.RadioControl,{className:"editor-change-status__options",hideLabelFromVision:!0,label:(0,fs.__)("Status"),options:eh,onChange:x,selected:"auto-draft"===e?"draft":e}),"future"===e&&(0,L.jsx)("div",{className:"editor-change-status__publish-date-wrapper",children:(0,L.jsx)(dm,{showPopoverHeaderActions:!1,isCompact:!0})}),"private"!==e&&(0,L.jsxs)(Uo.__experimentalVStack,{as:"fieldset",spacing:4,className:"editor-change-status__password-fieldset",children:[(0,L.jsx)(Uo.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,fs.__)("Password protected"),help:(0,fs.__)("Only visible to those who know the password"),checked:r,onChange:y}),r&&(0,L.jsx)("div",{className:"editor-change-status__password-input",children:(0,L.jsx)(Uo.TextControl,{label:(0,fs.__)("Password"),onChange:e=>b({password:e}),value:s,placeholder:(0,fs.__)("Use a secure password"),type:"text",id:l,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,maxLength:255})})]}),(0,L.jsx)(Xm,{})]})})]})}):(0,L.jsx)("div",{className:"editor-post-status is-read-only",children:Jm[e]?.label})})}function oh({forceIsDirty:e}){const[t,s]=(0,u.useState)(!1),o=(0,p.useViewportMatch)("small"),{isAutosaving:n,isDirty:i,isNew:r,isPublished:a,isSaveable:l,isSaving:d,isScheduled:m,hasPublishAction:h,showIconLabels:g,postStatus:_,postStatusHasChanged:f}=(0,c.useSelect)((t=>{var s;const{isEditedPostNew:o,isCurrentPostPublished:n,isCurrentPostScheduled:i,isEditedPostDirty:r,isSavingPost:a,isEditedPostSaveable:l,getCurrentPost:c,isAutosavingPost:d,getEditedPostAttribute:u,getPostEdits:p}=t(Tc),{get:m}=t(k.store);return{isAutosaving:d(),isDirty:e||r(),isNew:o(),isPublished:n(),isSaving:a(),isSaveable:l(),isScheduled:i(),hasPublishAction:null!==(s=c()?._links?.["wp:action-publish"])&&void 0!==s&&s,showIconLabels:m("core","showIconLabels"),postStatus:u("status"),postStatusHasChanged:!!p()?.status}}),[e]),b="pending"===_,{savePost:y}=(0,c.useDispatch)(Tc),x=(0,p.usePrevious)(d);if((0,u.useEffect)((()=>{let e;return x&&!d&&(s(!0),e=setTimeout((()=>{s(!1)}),1e3)),()=>clearTimeout(e)}),[d]),!h&&b)return null;const v=!["pending","draft","auto-draft"].includes(_)&&eh.map((({value:e})=>e)).includes(_);if(a||m||v||f&&["pending","draft"].includes(_))return null;const w=b?(0,fs.__)("Save as pending"):(0,fs.__)("Save draft"),S=(0,fs.__)("Save"),C=t||!r&&!i,P=d||C,j=d||C||!l;let E;return d?E=n?(0,fs.__)("Autosaving"):(0,fs.__)("Saving"):C?E=(0,fs.__)("Saved"):o?E=w:g&&(E=S),(0,L.jsxs)(Uo.Button,{className:l||d?Ai({"editor-post-save-draft":!P,"editor-post-saved-state":P,"is-saving":d,"is-autosaving":n,"is-saved":C,[(0,Uo.__unstableGetAnimateClassName)({type:"loading"})]:d}):void 0,onClick:j?void 0:()=>y(),shortcut:j?void 0:xl.displayShortcut.primary("s"),variant:"tertiary",size:"compact",icon:o?void 0:Km,label:E||w,"aria-disabled":j,children:[P&&(0,L.jsx)(_r,{icon:C?Ho:qm}),E]})}function nh({children:e}){return(0,c.useSelect)((e=>{var t;return null!==(t=e(Tc).getCurrentPost()._links?.["wp:action-publish"])&&void 0!==t&&t}),[])?e:null}const ih=[T,B,I,N];function rh(){const[e,t]=(0,u.useState)(null),s=(0,c.useSelect)((e=>e(Tc).getCurrentPostType()),[]),o=(0,u.useMemo)((()=>({anchor:e,"aria-label":(0,fs.__)("Change publish date"),placement:"left-start",offset:36,shift:!0})),[e]),n=pm(),i=pm({full:!0});return ih.includes(s)?null:(0,L.jsx)(nh,{children:(0,L.jsx)(Md,{label:(0,fs.__)("Publish"),ref:t,children:(0,L.jsx)(Uo.Dropdown,{popoverProps:o,focusOnMount:!0,className:"editor-post-schedule__panel-dropdown",contentClassName:"editor-post-schedule__dialog",renderToggle:({onToggle:e,isOpen:t})=>(0,L.jsx)(Uo.Button,{size:"compact",className:"editor-post-schedule__dialog-toggle",variant:"tertiary",tooltipPosition:"middle left",onClick:e,"aria-label":(0,fs.sprintf)((0,fs.__)("Change date: %s"),n),label:i,showTooltip:n!==i,"aria-expanded":t,children:n}),renderContent:({onClose:e})=>(0,L.jsx)(cm,{onClose:e})})})})}function ah(){S()("wp.editor.PostSwitchToDraftButton",{since:"6.7",version:"6.9"});const[e,t]=(0,u.useState)(!1),{editPost:s,savePost:o}=(0,c.useDispatch)(Tc),{isSaving:n,isPublished:i,isScheduled:r}=(0,c.useSelect)((e=>{const{isSavingPost:t,isCurrentPostPublished:s,isCurrentPostScheduled:o}=e(Tc);return{isSaving:t(),isPublished:s(),isScheduled:o()}}),[]),a=n||!i&&!r;let l,d;i?(l=(0,fs.__)("Are you sure you want to unpublish this post?"),d=(0,fs.__)("Unpublish")):r&&(l=(0,fs.__)("Are you sure you want to unschedule this post?"),d=(0,fs.__)("Unschedule"));return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,className:"editor-post-switch-to-draft",onClick:()=>{a||t(!0)},"aria-disabled":a,variant:"secondary",style:{flexGrow:"1",justifyContent:"center"},children:(0,fs.__)("Switch to draft")}),(0,L.jsx)(Uo.__experimentalConfirmDialog,{isOpen:e,onConfirm:()=>{t(!1),s({status:"draft"}),o()},onCancel:()=>t(!1),confirmButtonText:d,children:l})]})}function lh(){const{syncStatus:e,postType:t}=(0,c.useSelect)((e=>{const{getEditedPostAttribute:t}=e(Tc),s=t("meta");return{syncStatus:"unsynced"===s?.wp_pattern_sync_status?"unsynced":t("wp_pattern_sync_status"),postType:t("type")}}));return"wp_block"!==t?null:(0,L.jsx)(Md,{label:(0,fs.__)("Sync status"),children:(0,L.jsx)("div",{className:"editor-post-sync-status__value",children:"unsynced"===e?(0,fs._x)("Not synced","pattern (singular)"):(0,fs._x)("Synced","pattern (singular)")})})}const ch=e=>e;const dh=function({taxonomyWrapper:e=ch}){const{postType:t,taxonomies:s}=(0,c.useSelect)((e=>({postType:e(Tc).getCurrentPostType(),taxonomies:e(d.store).getTaxonomies({per_page:-1})})),[]);return(null!=s?s:[]).filter((e=>e.types.includes(t)&&e.visibility?.show_ui)).map((t=>{const s=t.hierarchical?Rm:Cm,o={slug:t.slug,...t.hierarchical?{}:{__nextHasNoMarginBottom:!0}};return(0,L.jsx)(u.Fragment,{children:e((0,L.jsx)(s,{...o}),t)},`taxonomy-${t.slug}`)}))};function uh({children:e}){const t=(0,c.useSelect)((e=>{const t=e(Tc).getCurrentPostType(),s=e(d.store).getTaxonomies({per_page:-1});return s?.some((e=>e.types.includes(t)))}),[]);return t?e:null}function ph({taxonomy:e,children:t}){const s=e?.slug,o=s?`taxonomy-panel-${s}`:"",{isEnabled:n,isOpened:i}=(0,c.useSelect)((e=>{const{isEditorPanelEnabled:t,isEditorPanelOpened:n}=e(Tc);return{isEnabled:!!s&&t(o),isOpened:!!s&&n(o)}}),[o,s]),{toggleEditorPanelOpened:r}=(0,c.useDispatch)(Tc);if(!n)return null;const a=e?.labels?.menu_name;return a?(0,L.jsx)(Uo.PanelBody,{title:a,opened:i,onToggle:()=>r(o),children:t}):null}function mh(){return(0,L.jsx)(uh,{children:(0,L.jsx)(dh,{taxonomyWrapper:(e,t)=>(0,L.jsx)(ph,{taxonomy:t,children:e})})})}var hh=s(4132);function gh(){const e=(0,p.useInstanceId)(gh),{content:t,blocks:s,type:o,id:n}=(0,c.useSelect)((e=>{const{getEditedEntityRecord:t}=e(d.store),{getCurrentPostType:s,getCurrentPostId:o}=e(Tc),n=s(),i=o(),r=t("postType",n,i);return{content:r?.content,blocks:r?.blocks,type:n,id:i}}),[]),{editEntityRecord:i}=(0,c.useDispatch)(d.store),r=(0,u.useMemo)((()=>t instanceof Function?t({blocks:s}):s?(0,y.__unstableSerializeAndClean)(s):t),[t,s]);return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Uo.VisuallyHidden,{as:"label",htmlFor:`post-content-${e}`,children:(0,fs.__)("Type text or HTML")}),(0,L.jsx)(hh.A,{autoComplete:"off",dir:"auto",value:r,onChange:e=>{i("postType",o,n,{content:e.target.value,blocks:void 0,selection:void 0})},className:"editor-post-text-editor",id:`post-content-${e}`,placeholder:(0,fs.__)("Start writing with text or HTML")})]})}const _h="wp-block wp-block-post-title block-editor-block-list__block editor-post-title editor-post-title__input rich-text",fh=/[\r\n]+/g;function bh(e){const t=(0,u.useRef)(),{isCleanNewPost:s}=(0,c.useSelect)((e=>{const{isCleanNewPost:t}=e(Tc);return{isCleanNewPost:t()}}),[]);return(0,u.useImperativeHandle)(e,(()=>({focus:()=>{t?.current?.focus()}}))),(0,u.useEffect)((()=>{if(!t.current)return;const{defaultView:e}=t.current.ownerDocument,{name:o,parent:n}=e,i="editor-canvas"===o?n.document:e.document,{activeElement:r,body:a}=i;!s||r&&a!==r||t.current.focus()}),[s]),{ref:t}}function yh(){const{editPost:e}=(0,c.useDispatch)(Tc),{title:t}=(0,c.useSelect)((e=>{const{getEditedPostAttribute:t}=e(Tc);return{title:t("title")}}),[]);return{title:t,setTitle:function(t){e({title:t})}}}const xh=(0,u.forwardRef)(((e,t)=>{const{placeholder:s}=(0,c.useSelect)((e=>{const{getSettings:t}=e(h.store),{titlePlaceholder:s}=t();return{placeholder:s}}),[]),[o,n]=(0,u.useState)(!1),{ref:i}=bh(t),{title:r,setTitle:a}=yh(),[l,d]=(0,u.useState)({}),{clearSelectedBlock:m,insertBlocks:g,insertDefaultBlock:_}=(0,c.useDispatch)(h.store),f=(0,Lo.decodeEntities)(s)||(0,fs.__)("Add title"),{value:b,onChange:x,ref:v}=(0,Yc.__unstableUseRichText)({value:r,onChange(e){a(e.replace(fh," "))},placeholder:f,selectionStart:l.start,selectionEnd:l.end,onSelectionChange(e,t){d((s=>{const{start:o,end:n}=s;return o===e&&n===t?s:{start:e,end:t}}))},__unstableDisableFormats:!1});function w(e){g(e,0)}const S=Ai(_h,{"is-selected":o});return(0,L.jsx)("h1",{ref:(0,p.useMergeRefs)([v,i]),contentEditable:!0,className:S,"aria-label":f,role:"textbox","aria-multiline":"true",onFocus:function(){n(!0),m()},onBlur:function(){n(!1),d({})},onKeyDown:function(e){e.keyCode===xl.ENTER&&(e.preventDefault(),_(void 0,void 0,0))},onPaste:function(e){const t=e.clipboardData;let s="",o="";try{s=t.getData("text/plain"),o=t.getData("text/html")}catch(e){return}window.console.log("Received HTML:\n\n",o),window.console.log("Received plain text:\n\n",s);const n=(0,y.pasteHandler)({HTML:o,plainText:s});if(e.preventDefault(),n.length)if("string"!=typeof n){const[e]=n;if(r||"core/heading"!==e.name&&"core/paragraph"!==e.name)w(n);else{const t=(0,Gc.__unstableStripHTML)(e.attributes.content);a(t),w(n.slice(1))}}else{const e=(0,Gc.__unstableStripHTML)(n);x((0,Yc.insert)(b,(0,Yc.create)({html:e})))}}})})),vh=(0,u.forwardRef)(((e,t)=>(0,L.jsx)(Ad,{supportKeys:"title",children:(0,L.jsx)(xh,{ref:t})})));const wh=(0,u.forwardRef)((function(e,t){const{placeholder:s}=(0,c.useSelect)((e=>{const{getSettings:t}=e(h.store),{titlePlaceholder:s}=t();return{placeholder:s}}),[]),[o,n]=(0,u.useState)(!1),{title:i,setTitle:r}=yh(),{ref:a}=bh(t),l=Ai(_h,{"is-selected":o,"is-raw-text":!0}),d=(0,Lo.decodeEntities)(s)||(0,fs.__)("Add title");return(0,L.jsx)(Uo.TextareaControl,{ref:a,value:i,onChange:function(e){r(e.replace(fh," "))},onFocus:function(){n(!0)},onBlur:function(){n(!1)},label:s,className:l,placeholder:d,hideLabelFromVision:!0,autoComplete:"off",dir:"auto",rows:1,__nextHasNoMarginBottom:!0})}));function Sh({children:e}){const{canTrashPost:t}=(0,c.useSelect)((e=>{const{isEditedPostNew:t,getCurrentPostId:s,getCurrentPostType:o}=e(Tc),{canUser:n}=e(d.store),i=o(),r=s(),a=t(),l=!!r&&n("delete",{kind:"postType",name:i,id:r});return{canTrashPost:(!a||r)&&l&&!R.includes(i)}}),[]);return t?e:null}function kh({onActionPerformed:e}){const t=(0,c.useRegistry)(),{isNew:s,isDeleting:o,postId:n,title:i}=(0,c.useSelect)((e=>{const t=e(Tc);return{isNew:t.isEditedPostNew(),isDeleting:t.isDeletingPost(),postId:t.getCurrentPostId(),title:t.getCurrentPostAttribute("title")}}),[]),{trashPost:r}=(0,c.useDispatch)(Tc),[a,l]=(0,u.useState)(!1);if(s||!n)return null;return(0,L.jsxs)(Sh,{children:[(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,className:"editor-post-trash",isDestructive:!0,variant:"secondary",isBusy:o,"aria-disabled":o,onClick:o?void 0:()=>l(!0),children:(0,fs.__)("Move to trash")}),(0,L.jsx)(Uo.__experimentalConfirmDialog,{isOpen:a,onConfirm:async()=>{l(!1),await r();const s=await t.resolveSelect(Tc).getCurrentPost();e?.("move-to-trash",[s])},onCancel:()=>l(!1),confirmButtonText:(0,fs.__)("Move to trash"),size:"small",children:(0,fs.sprintf)((0,fs.__)('Are you sure you want to move "%s" to the trash?'),i)})]})}function Ch({onClose:e}){const{isEditable:t,postSlug:s,postLink:o,permalinkPrefix:n,permalinkSuffix:i,permalink:r}=(0,c.useSelect)((e=>{var t;const s=e(Tc).getCurrentPost(),o=e(Tc).getCurrentPostType(),n=e(d.store).getPostType(o),i=e(Tc).getPermalinkParts(),r=null!==(t=s?._links?.["wp:action-publish"])&&void 0!==t&&t;return{isEditable:e(Tc).isPermalinkEditable()&&r,postSlug:(0,v.safeDecodeURIComponent)(e(Tc).getEditedPostSlug()),viewPostLabel:n?.labels.view_item,postLink:s.link,permalinkPrefix:i?.prefix,permalinkSuffix:i?.suffix,permalink:(0,v.safeDecodeURIComponent)(e(Tc).getPermalink())}}),[]),{editPost:a}=(0,c.useDispatch)(Tc),{createNotice:l}=(0,c.useDispatch)(_s.store),[m,g]=(0,u.useState)(!1),_=(0,p.useCopyToClipboard)(r,(()=>{l("info",(0,fs.__)("Copied Permalink to clipboard."),{isDismissible:!0,type:"snackbar"})})),f="editor-post-url__slug-description-"+(0,p.useInstanceId)(Ch);return(0,L.jsxs)("div",{className:"editor-post-url",children:[(0,L.jsx)(h.__experimentalInspectorPopoverHeader,{title:(0,fs.__)("Slug"),onClose:e}),(0,L.jsxs)(Uo.__experimentalVStack,{spacing:3,children:[t&&(0,L.jsx)("p",{className:"editor-post-url__intro",children:(0,u.createInterpolateElement)((0,fs.__)("Customize the last part of the Permalink. Learn more."),{span:(0,L.jsx)("span",{id:f}),a:(0,L.jsx)(Uo.ExternalLink,{href:(0,fs.__)("https://wordpress.org/documentation/article/page-post-settings-sidebar/#permalink")})})}),(0,L.jsxs)("div",{children:[t&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Uo.__experimentalInputControl,{__next40pxDefaultSize:!0,prefix:(0,L.jsx)(Uo.__experimentalInputControlPrefixWrapper,{children:"/"}),suffix:(0,L.jsx)(Uo.__experimentalInputControlSuffixWrapper,{variant:"control",children:(0,L.jsx)(Uo.Button,{icon:Ki,ref:_,size:"small",label:"Copy"})}),label:(0,fs.__)("Slug"),hideLabelFromVision:!0,value:m?"":s,autoComplete:"off",spellCheck:"false",type:"text",className:"editor-post-url__input",onChange:e=>{a({slug:e}),e?m&&g(!1):m||g(!0)},onBlur:e=>{a({slug:(0,v.cleanForSlug)(e.target.value)}),m&&g(!1)},"aria-describedby":f}),(0,L.jsxs)("p",{className:"editor-post-url__permalink",children:[(0,L.jsx)("span",{className:"editor-post-url__permalink-visual-label",children:(0,fs.__)("Permalink:")}),(0,L.jsxs)(Uo.ExternalLink,{className:"editor-post-url__link",href:o,target:"_blank",children:[(0,L.jsx)("span",{className:"editor-post-url__link-prefix",children:n}),(0,L.jsx)("span",{className:"editor-post-url__link-slug",children:s}),(0,L.jsx)("span",{className:"editor-post-url__link-suffix",children:i})]})]})]}),!t&&(0,L.jsx)(Uo.ExternalLink,{className:"editor-post-url__link",href:o,target:"_blank",children:o})]})]})]})}function Ph({children:e}){const t=(0,c.useSelect)((e=>{const t=e(Tc).getCurrentPostType(),s=e(d.store).getPostType(t);if(!s?.viewable)return!1;if(!e(Tc).getCurrentPost().link)return!1;return!!e(Tc).getPermalinkParts()}),[]);return t?e:null}function jh(){return Eh()}function Eh(){const e=(0,c.useSelect)((e=>e(Tc).getPermalink()),[]);return(0,v.filterURLForDisplay)((0,v.safeDecodeURIComponent)(e))}function Th(){const{isFrontPage:e}=(0,c.useSelect)((e=>{const{getCurrentPostId:t}=e(Tc),{getEditedEntityRecord:s,canUser:o}=e(d.store),n=o("read",{kind:"root",name:"site"})?s("root","site"):void 0,i=t();return{isFrontPage:n?.page_on_front===i}}),[]),[t,s]=(0,u.useState)(null),o=(0,u.useMemo)((()=>({anchor:t,placement:"left-start",offset:36,shift:!0})),[t]),n=e?(0,fs.__)("Link"):(0,fs.__)("Slug");return(0,L.jsx)(Ph,{children:(0,L.jsxs)(Md,{label:n,ref:s,children:[!e&&(0,L.jsx)(Uo.Dropdown,{popoverProps:o,className:"editor-post-url__panel-dropdown",contentClassName:"editor-post-url__panel-dialog",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,L.jsx)(Bh,{isOpen:e,onClick:t}),renderContent:({onClose:e})=>(0,L.jsx)(Ch,{onClose:e})}),e&&(0,L.jsx)(Ih,{})]})})}function Bh({isOpen:e,onClick:t}){const{slug:s}=(0,c.useSelect)((e=>({slug:e(Tc).getEditedPostSlug()})),[]),o=(0,v.safeDecodeURIComponent)(s);return(0,L.jsx)(Uo.Button,{size:"compact",className:"editor-post-url__panel-toggle",variant:"tertiary","aria-expanded":e,"aria-label":(0,fs.sprintf)((0,fs.__)("Change link: %s"),o),onClick:t,children:(0,L.jsx)(L.Fragment,{children:o})})}function Ih(){const{postLink:e}=(0,c.useSelect)((e=>{const{getCurrentPost:t}=e(Tc);return{postLink:t()?.link}}),[]);return(0,L.jsx)(Uo.ExternalLink,{className:"editor-post-url__front-page-link",href:e,target:"_blank",children:e})}function Nh({render:e}){return e({canEdit:(0,c.useSelect)((e=>{var t;return null!==(t=e(Tc).getCurrentPost()._links?.["wp:action-publish"])&&void 0!==t&&t}))})}const Ah=(0,L.jsx)(M.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,L.jsx)(M.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M5.5 12a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0ZM12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm.75 4v1.5h-1.5V8h1.5Zm0 8v-5h-1.5v5h1.5Z"})}),Dh=window.wp.wordcount;function Rh(){const e=(0,c.useSelect)((e=>e(Tc).getEditedPostAttribute("content")),[]),t=(0,fs._x)("words","Word count type. Do not translate!");return(0,L.jsx)("span",{className:"word-count",children:(0,Dh.count)(e,t)})}const Mh=189;function Lh(){const e=(0,c.useSelect)((e=>e(Tc).getEditedPostAttribute("content")),[]),t=(0,fs._x)("words","Word count type. Do not translate!"),s=Math.round((0,Dh.count)(e,t)/Mh),o=0===s?(0,u.createInterpolateElement)((0,fs.__)("< 1 minute"),{span:(0,L.jsx)("span",{})}):(0,u.createInterpolateElement)((0,fs.sprintf)((0,fs._n)("%s minute","%s minutes",s),s),{span:(0,L.jsx)("span",{})});return(0,L.jsx)("span",{className:"time-to-read",children:o})}function Oh(){const e=(0,c.useSelect)((e=>e(Tc).getEditedPostAttribute("content")),[]);return(0,Dh.count)(e,"characters_including_spaces")}const Fh=function({hasOutlineItemsDisabled:e,onRequestClose:t}){const{headingCount:s,paragraphCount:o,numberOfBlocks:n}=(0,c.useSelect)((e=>{const{getGlobalBlockCount:t}=e(h.store);return{headingCount:t("core/heading"),paragraphCount:t("core/paragraph"),numberOfBlocks:t()}}),[]);return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)("div",{className:"table-of-contents__wrapper",role:"note","aria-label":(0,fs.__)("Document Statistics"),tabIndex:"0",children:(0,L.jsxs)("ul",{role:"list",className:"table-of-contents__counts",children:[(0,L.jsxs)("li",{className:"table-of-contents__count",children:[(0,fs.__)("Words"),(0,L.jsx)(Rh,{})]}),(0,L.jsxs)("li",{className:"table-of-contents__count",children:[(0,fs.__)("Characters"),(0,L.jsx)("span",{className:"table-of-contents__number",children:(0,L.jsx)(Oh,{})})]}),(0,L.jsxs)("li",{className:"table-of-contents__count",children:[(0,fs.__)("Time to read"),(0,L.jsx)(Lh,{})]}),(0,L.jsxs)("li",{className:"table-of-contents__count",children:[(0,fs.__)("Headings"),(0,L.jsx)("span",{className:"table-of-contents__number",children:s})]}),(0,L.jsxs)("li",{className:"table-of-contents__count",children:[(0,fs.__)("Paragraphs"),(0,L.jsx)("span",{className:"table-of-contents__number",children:o})]}),(0,L.jsxs)("li",{className:"table-of-contents__count",children:[(0,fs.__)("Blocks"),(0,L.jsx)("span",{className:"table-of-contents__number",children:n})]})]})}),s>0&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)("hr",{}),(0,L.jsx)("h2",{className:"table-of-contents__title",children:(0,fs.__)("Document Outline")}),(0,L.jsx)(od,{onSelect:t,hasOutlineItemsDisabled:e})]})]})};const Vh=(0,u.forwardRef)((function({hasOutlineItemsDisabled:e,repositionDropdown:t,...s},o){const n=(0,c.useSelect)((e=>!!e(h.store).getBlockCount()),[]);return(0,L.jsx)(Uo.Dropdown,{popoverProps:{placement:t?"right":"bottom"},className:"table-of-contents",contentClassName:"table-of-contents__popover",renderToggle:({isOpen:e,onToggle:t})=>(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,...s,ref:o,onClick:n?t:void 0,icon:Ah,"aria-expanded":e,"aria-haspopup":"true",label:(0,fs.__)("Details"),tooltipPosition:"bottom","aria-disabled":!n}),renderContent:({onClose:t})=>(0,L.jsx)(Fh,{onRequestClose:t,hasOutlineItemsDisabled:e})})}));function zh(){const{__experimentalGetDirtyEntityRecords:e}=(0,c.useSelect)(d.store);return(0,u.useEffect)((()=>{const t=t=>{if(e().length>0)return t.returnValue=(0,fs.__)("You have unsaved changes. If you proceed, they will be lost."),t.returnValue};return window.addEventListener("beforeunload",t),()=>{window.removeEventListener("beforeunload",t)}}),[e]),null}const Uh=window.wp.serverSideRender;var Hh=s.n(Uh);function Gh(e,t,s=[]){const o=(0,u.forwardRef)(((s,o)=>(S()("wp.editor."+e,{since:"5.3",alternative:"wp.blockEditor."+e,version:"6.2"}),(0,L.jsx)(t,{ref:o,...s}))));return s.forEach((s=>{o[s]=Gh(e+"."+s,t[s])})),o}function $h(e,t){return(...s)=>(S()("wp.editor."+e,{since:"5.3",alternative:"wp.blockEditor."+e,version:"6.2"}),t(...s))}const Wh=Gh("RichText",h.RichText,["Content"]);Wh.isEmpty=$h("RichText.isEmpty",h.RichText.isEmpty);const Zh=Gh("Autocomplete",h.Autocomplete),Yh=Gh("AlignmentToolbar",h.AlignmentToolbar),Kh=Gh("BlockAlignmentToolbar",h.BlockAlignmentToolbar),qh=Gh("BlockControls",h.BlockControls,["Slot"]),Qh=Gh("BlockEdit",h.BlockEdit),Xh=Gh("BlockEditorKeyboardShortcuts",h.BlockEditorKeyboardShortcuts),Jh=Gh("BlockFormatControls",h.BlockFormatControls,["Slot"]),eg=Gh("BlockIcon",h.BlockIcon),tg=Gh("BlockInspector",h.BlockInspector),sg=Gh("BlockList",h.BlockList),og=Gh("BlockMover",h.BlockMover),ng=Gh("BlockNavigationDropdown",h.BlockNavigationDropdown),ig=Gh("BlockSelectionClearer",h.BlockSelectionClearer),rg=Gh("BlockSettingsMenu",h.BlockSettingsMenu),ag=Gh("BlockTitle",h.BlockTitle),lg=Gh("BlockToolbar",h.BlockToolbar),cg=Gh("ColorPalette",h.ColorPalette),dg=Gh("ContrastChecker",h.ContrastChecker),ug=Gh("CopyHandler",h.CopyHandler),pg=Gh("DefaultBlockAppender",h.DefaultBlockAppender),mg=Gh("FontSizePicker",h.FontSizePicker),hg=Gh("Inserter",h.Inserter),gg=Gh("InnerBlocks",h.InnerBlocks,["ButtonBlockAppender","DefaultBlockAppender","Content"]),_g=Gh("InspectorAdvancedControls",h.InspectorAdvancedControls,["Slot"]),fg=Gh("InspectorControls",h.InspectorControls,["Slot"]),bg=Gh("PanelColorSettings",h.PanelColorSettings),yg=Gh("PlainText",h.PlainText),xg=Gh("RichTextShortcut",h.RichTextShortcut),vg=Gh("RichTextToolbarButton",h.RichTextToolbarButton),wg=Gh("__unstableRichTextInputEvent",h.__unstableRichTextInputEvent),Sg=Gh("MediaPlaceholder",h.MediaPlaceholder),kg=Gh("MediaUpload",h.MediaUpload),Cg=Gh("MediaUploadCheck",h.MediaUploadCheck),Pg=Gh("MultiSelectScrollIntoView",h.MultiSelectScrollIntoView),jg=Gh("NavigableToolbar",h.NavigableToolbar),Eg=Gh("ObserveTyping",h.ObserveTyping),Tg=Gh("SkipToSelectedBlock",h.SkipToSelectedBlock),Bg=Gh("URLInput",h.URLInput),Ig=Gh("URLInputButton",h.URLInputButton),Ng=Gh("URLPopover",h.URLPopover),Ag=Gh("Warning",h.Warning),Dg=Gh("WritingFlow",h.WritingFlow),Rg=$h("createCustomColorsHOC",h.createCustomColorsHOC),Mg=$h("getColorClassName",h.getColorClassName),Lg=$h("getColorObjectByAttributeValues",h.getColorObjectByAttributeValues),Og=$h("getColorObjectByColorValue",h.getColorObjectByColorValue),Fg=$h("getFontSize",h.getFontSize),Vg=$h("getFontSizeClass",h.getFontSizeClass),zg=$h("withColorContext",h.withColorContext),Ug=$h("withColors",h.withColors),Hg=$h("withFontSizes",h.withFontSizes),Gg=Ml,$g=Ml;function Wg(e){return S()("wp.editor.cleanForSlug",{since:"12.7",plugin:"Gutenberg",alternative:"wp.url.cleanForSlug"}),(0,v.cleanForSlug)(e)}const Zg=(0,Uo.createSlotFill)(Symbol("EditCanvasContainerSlot")),Yg="__experimentalMainDashboardButton",{Fill:Kg,Slot:qg}=(0,Uo.createSlotFill)(Yg),Qg=Kg;Qg.Slot=()=>{const e=(0,Uo.__experimentalUseSlotFills)(Yg);return(0,L.jsx)(qg,{bubblesVirtually:!0,fillProps:{length:e?e.length:0}})};const Xg=Qg,Jg=(0,L.jsx)(M.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,L.jsx)(M.Path,{d:"M18 4H6c-1.1 0-2 .9-2 2v12.9c0 .6.5 1.1 1.1 1.1.3 0 .5-.1.8-.3L8.5 17H18c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5H7.9l-2.4 2.4V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v9z"})}),e_="edit-post/collab-sidebar",t_=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"})});const s_=function({avatar:e,name:t,date:s}){const o=(0,x.getSettings)(),[n=o.formats.time]=(0,d.useEntityProp)("root","site","time_format"),{currentUserAvatar:i,currentUserName:r}=(0,c.useSelect)((e=>{var t;const s=e(d.store).getCurrentUser(),{getSettings:o}=e(h.store),{__experimentalDiscussionSettings:n}=o(),i=n?.avatarURL;return{currentUserAvatar:null!==(t=s?.avatar_urls[48])&&void 0!==t?t:i,currentUserName:s?.name}}),[]),a=new Date;return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)("img",{src:null!=e?e:i,className:"editor-collab-sidebar-panel__user-avatar",alt:(0,fs.__)("User avatar"),width:32,height:32}),(0,L.jsxs)(Uo.__experimentalVStack,{spacing:"0",children:[(0,L.jsx)("span",{className:"editor-collab-sidebar-panel__user-name",children:null!=t?t:r}),(0,L.jsx)("time",{dateTime:(0,x.dateI18n)("c",null!=s?s:a),className:"editor-collab-sidebar-panel__user-time",children:(0,x.dateI18n)(n,null!=s?s:a)})]})]})};const o_=function({onSubmit:e,onCancel:t,thread:s,submitButtonText:o}){var n;const[i,r]=(0,u.useState)(null!==(n=s?.content?.raw)&&void 0!==n?n:"");return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Uo.TextareaControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:null!=i?i:"",onChange:r}),(0,L.jsxs)(Uo.__experimentalHStack,{alignment:"left",spacing:"3",justify:"flex-start",children:[(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,accessibleWhenDisabled:!0,variant:"primary",onClick:()=>{e(i),r("")},disabled:0===(a=i,a.trim()).length,text:o}),(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:t,text:(0,fs._x)("Cancel","Cancel comment button")})]})]});var a};function n_({threads:e,onEditComment:t,onAddReply:s,onCommentDelete:o,onCommentResolve:n,showCommentBoard:i,setShowCommentBoard:r}){const{blockCommentId:a}=(0,c.useSelect)((e=>{const{getBlockAttributes:t,getSelectedBlockClientId:s}=e(h.store),o=s();return{blockCommentId:o?t(o)?.blockCommentId:null}}),[]),[l,d]=(0,u.useState)(i&&a?a:null),p=()=>{d(null),r(!1)};return(0,L.jsxs)(L.Fragment,{children:[(!Array.isArray(e)||0===e.length)&&(0,L.jsx)(Uo.__experimentalVStack,{alignment:"left",className:"editor-collab-sidebar-panel__thread",justify:"flex-start",spacing:"3",children:(0,fs.__)("No comments available")}),Array.isArray(e)&&e.length>0&&e.map((e=>(0,L.jsx)(Uo.__experimentalVStack,{className:Ai("editor-collab-sidebar-panel__thread",{"editor-collab-sidebar-panel__active-thread":a&&a===e.id,"editor-collab-sidebar-panel__focus-thread":l&&l===e.id}),id:e.id,spacing:"3",onClick:()=>d(e.id),children:(0,L.jsx)(i_,{thread:e,onAddReply:s,onCommentDelete:o,onCommentResolve:n,onEditComment:t,isFocused:l===e.id,clearThreadFocus:p})},e.id)))]})}function i_({thread:e,onEditComment:t,onAddReply:s,onCommentDelete:o,onCommentResolve:n,isFocused:i,clearThreadFocus:r}){return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(r_,{thread:e,onResolve:n,onEdit:t,onDelete:o,status:e.status}),0(0,L.jsxs)(Uo.__experimentalVStack,{className:"editor-collab-sidebar-panel__child-thread",id:s.id,spacing:"2",children:["approved"!==e.status&&(0,L.jsx)(r_,{thread:s,onEdit:t,onDelete:o}),"approved"===e.status&&(0,L.jsx)(r_,{thread:s})]},s.id)))]}),"approved"!==e.status&&i&&(0,L.jsxs)(Uo.__experimentalVStack,{className:"editor-collab-sidebar-panel__child-thread",spacing:"2",children:[(0,L.jsx)(Uo.__experimentalHStack,{alignment:"left",spacing:"3",justify:"flex-start",children:(0,L.jsx)(s_,{})}),(0,L.jsx)(Uo.__experimentalVStack,{spacing:"3",className:"editor-collab-sidebar-panel__comment-field",children:(0,L.jsx)(o_,{onSubmit:t=>{s(t,e.id)},onCancel:e=>{e.stopPropagation(),r()},submitButtonText:(0,fs._x)("Reply","Add reply comment")})})]})]})}const r_=({thread:e,onResolve:t,onEdit:s,onDelete:o,status:n})=>{const[i,r]=(0,u.useState)(!1),[a,l]=(0,u.useState)(!1),c=()=>{r(!1),l(!1)},d=[s&&{title:(0,fs._x)("Edit","Edit comment"),onClick:()=>{r("edit")}},o&&{title:(0,fs._x)("Delete","Delete comment"),onClick:()=>{r("delete"),l(!0)}}].filter((e=>e?.onClick));return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(Uo.__experimentalHStack,{alignment:"left",spacing:"3",justify:"flex-start",children:[(0,L.jsx)(s_,{avatar:e?.author_avatar_urls?.[48],name:e?.author_name,date:e?.date}),(0,L.jsxs)("span",{className:"editor-collab-sidebar-panel__comment-status",children:["approved"!==n&&(0,L.jsxs)(Uo.__experimentalHStack,{alignment:"right",justify:"flex-end",spacing:"0",children:[0===e?.parent&&t&&(0,L.jsx)(Uo.Button,{label:(0,fs._x)("Resolve","Mark comment as resolved"),__next40pxDefaultSize:!0,icon:Ui,onClick:()=>{r("resolve"),l(!0)},showTooltip:!0}),0{s(e.id,t),r(!1)},onCancel:()=>c(),thread:e,submitButtonText:(0,fs._x)("Update","verb")}),"edit"!==i&&(0,L.jsx)(u.RawHTML,{children:e?.content?.raw})]})}),"resolve"===i&&(0,L.jsx)(Uo.__experimentalConfirmDialog,{isOpen:a,onConfirm:()=>{t(e.id),r(!1),l(!1)},onCancel:c,confirmButtonText:"Yes",cancelButtonText:"No",children:(0,fs.__)("Are you sure you want to mark this comment as resolved?")}),"delete"===i&&(0,L.jsx)(Uo.__experimentalConfirmDialog,{isOpen:a,onConfirm:()=>{o(e.id),r(!1),l(!1)},onCancel:c,confirmButtonText:"Yes",cancelButtonText:"No",children:(0,fs.__)("Are you sure you want to delete this comment?")})]})};function a_({onSubmit:e,showCommentBoard:t,setShowCommentBoard:s}){const{clientId:o,blockCommentId:n}=(0,c.useSelect)((e=>{const{getSelectedBlock:t}=e(h.store),s=t();return{clientId:s?.clientId,blockCommentId:s?.attributes?.blockCommentId}}));return t&&o&&void 0===n?(0,L.jsxs)(Uo.__experimentalVStack,{spacing:"3",className:"editor-collab-sidebar-panel__thread editor-collab-sidebar-panel__active-thread editor-collab-sidebar-panel__focus-thread",children:[(0,L.jsx)(Uo.__experimentalHStack,{alignment:"left",spacing:"3",children:(0,L.jsx)(s_,{})}),(0,L.jsx)(o_,{onSubmit:t=>{e(t)},onCancel:()=>{s(!1)},submitButtonText:(0,fs._x)("Comment","Add comment button")})]}):null}const{CommentIconSlotFill:l_}=$(h.privateApis),c_=({onClick:e})=>(0,L.jsx)(l_.Fill,{children:({onClose:t})=>(0,L.jsx)(Uo.MenuItem,{icon:Jg,onClick:()=>{e(),t()},"aria-haspopup":"dialog",children:(0,fs._x)("Comment","Add comment button")})}),{CommentIconToolbarSlotFill:d_}=$(h.privateApis),u_=({onClick:e})=>(0,L.jsx)(d_.Fill,{children:(0,L.jsx)(Uo.ToolbarButton,{accessibleWhenDisabled:!0,icon:Jg,label:(0,fs._x)("Comment","View comment"),onClick:e})});function p_({showCommentBoard:e,setShowCommentBoard:t,styles:s,comments:o}){const{createNotice:n}=(0,c.useDispatch)(_s.store),{saveEntityRecord:i,deleteEntityRecord:r}=(0,c.useDispatch)(d.store),{getEntityRecord:a}=(0,c.resolveSelect)(d.store),{postId:l}=(0,c.useSelect)((e=>{const{getCurrentPostId:t}=e(Tc);return{postId:t()}}),[]),{getSelectedBlockClientId:u}=(0,c.useSelect)(h.store),{updateBlockAttributes:p}=(0,c.useDispatch)(h.store),m=async(e,t)=>{const s={...{post:l,content:e,comment_type:"block_comment",comment_approved:0},...t?{parent:t}:{}},o=await i("root","comment",s);o?(t||p(u(),{blockCommentId:o?.id}),n("snackbar",t?(0,fs.__)("Reply added successfully."):(0,fs.__)("Comment added successfully."),{type:"snackbar",isDismissible:!0})):g()},g=()=>{n("error",(0,fs.__)("Something went wrong. Please try publishing the post, or you may have already submitted your comment earlier."),{isDismissible:!0})};return(0,L.jsxs)("div",{className:"editor-collab-sidebar-panel",style:s,children:[(0,L.jsx)(a_,{onSubmit:m,showCommentBoard:e,setShowCommentBoard:t}),(0,L.jsx)(n_,{threads:o,onEditComment:async(e,t)=>{await i("root","comment",{id:e,content:t})?n("snackbar",(0,fs.__)("Comment edited successfully."),{type:"snackbar",isDismissible:!0}):g()},onAddReply:m,onCommentDelete:async e=>{const t=await a("root","comment",e);await r("root","comment",e),t&&!t.parent&&p(u(),{blockCommentId:void 0}),n("snackbar",(0,fs.__)("Comment deleted successfully."),{type:"snackbar",isDismissible:!0})},onCommentResolve:async e=>{await i("root","comment",{id:e,status:"approved"})?n("snackbar",(0,fs.__)("Comment marked as resolved."),{type:"snackbar",isDismissible:!0}):g()},showCommentBoard:e,setShowCommentBoard:t},u())]})}function m_(){const[e,t]=(0,u.useState)(!1),{enableComplementaryArea:s}=(0,c.useDispatch)(za),{getActiveComplementaryArea:o}=(0,c.useSelect)(za),{postId:n,postType:i,postStatus:r,threads:a}=(0,c.useSelect)((e=>{const{getCurrentPostId:t,getCurrentPostType:s}=e(Tc),o=t(),n=o&&"number"==typeof o?e(d.store).getEntityRecords("root","comment",{post:o,type:"block_comment",status:"any",per_page:100}):null;return{postId:o,postType:s(),postStatus:e(Tc).getEditedPostAttribute("status"),threads:n}}),[]),{blockCommentId:l}=(0,c.useSelect)((e=>{const{getBlockAttributes:t,getSelectedBlockClientId:s}=e(h.store),o=s();return{blockCommentId:o?t(o)?.blockCommentId:null}}),[]),[p]=(0,d.useEntityBlockEditor)("postType",i,{id:n}),{resultComments:m,sortedThreads:g}=(0,u.useMemo)((()=>{const e={},t=[],s=(null!=a?a:[]).filter((e=>"trash"!==e.status));if(s.forEach((t=>{e[t.id]={...t,reply:[]}})),s.forEach((s=>{0===s.parent?t.push(e[s.id]):e[s.parent]&&e[s.parent].reply.push(e[s.id])})),0===t?.length)return{resultComments:[],sortedThreads:[]};const o=t.map((e=>({...e,reply:[...e.reply].reverse()}))),n=function(e){const t=e=>e.reduce(((e,s)=>{if(s.attributes&&s.attributes.blockCommentId&&!e.includes(s.attributes.blockCommentId)&&e.push(s.attributes.blockCommentId),s.innerBlocks&&s.innerBlocks.length>0){const o=t(s.innerBlocks);e.push(...o)}return e}),[]);return t(e)}(p),i=new Map(o.map((e=>[e.id,e])));return{resultComments:o,sortedThreads:n.map((e=>i.get(e))).filter((e=>void 0!==e))}}),[a,p]),{merged:_}=$r(),f=_?.styles?.color?.background;if(0{o("core")||(s("core",e_),e())}))}if("publish"===r)return null;const b=l?u_:c_;return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(b,{onClick:()=>{t(!0),s("core","edit-post/collab-sidebar")}}),(0,L.jsx)(Au,{identifier:"edit-post/collab-history-sidebar",title:(0,fs.__)("Comments"),icon:Jg,children:(0,L.jsx)(p_,{comments:m,showCommentBoard:e,setShowCommentBoard:t})}),(0,L.jsx)(Au,{isPinnable:!1,header:!1,identifier:e_,className:"editor-collab-sidebar",headerClassName:"editor-collab-sidebar__header",children:(0,L.jsx)(p_,{comments:g,showCommentBoard:e,setShowCommentBoard:t,styles:{backgroundColor:f}})})]})}(0,m.addFilter)("blocks.registerBlockType","block-comment/modify-core-block-attributes",(e=>(e.attributes.blockCommentId||(e.attributes={...e.attributes,blockCommentId:{type:"number"}}),e)));const h_=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.Path,{d:"M6.6 6L5.4 7l4.5 5-4.5 5 1.1 1 5.5-6-5.4-6zm6 0l-1.1 1 4.5 5-4.5 5 1.1 1 5.5-6-5.5-6z"})}),g_=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.Path,{d:"M11.6 7l-1.1-1L5 12l5.5 6 1.1-1L7 12l4.6-5zm6 0l-1.1-1-5.5 6 5.5 6 1.1-1-4.6-5 4.6-5z"})}),{useHasBlockToolbar:__}=$(h.privateApis);function f_({isCollapsed:e,onToggle:t}){const{blockSelectionStart:s}=(0,c.useSelect)((e=>({blockSelectionStart:e(h.store).getBlockSelectionStart()})),[]),o=__(),n=!!s;return(0,u.useEffect)((()=>{s&&t(!1)}),[s,t]),o?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)("div",{className:Ai("editor-collapsible-block-toolbar",{"is-collapsed":e||!n}),children:(0,L.jsx)(h.BlockToolbar,{hideDragHandle:!0})}),(0,L.jsx)(Uo.Popover.Slot,{name:"block-toolbar"}),(0,L.jsx)(Uo.Button,{className:"editor-collapsible-block-toolbar__toggle",icon:e?h_:g_,onClick:()=>{t(!e)},label:e?(0,fs.__)("Show block tools"):(0,fs.__)("Hide block tools"),size:"compact"})]}):null}const b_=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.Path,{d:"M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z"})});const y_=function({className:e,disableBlockTools:t=!1}){const{setIsInserterOpened:s,setIsListViewOpened:o}=(0,c.useDispatch)(Tc),{isDistractionFree:n,isInserterOpened:i,isListViewOpen:r,listViewShortcut:a,inserterSidebarToggleRef:l,listViewToggleRef:d,showIconLabels:m,showTools:g}=(0,c.useSelect)((e=>{const{get:t}=e(k.store),{isListViewOpened:s,getEditorMode:o,getInserterSidebarToggleRef:n,getListViewToggleRef:i,getRenderingMode:r,getCurrentPostType:a}=$(e(Tc)),{getShortcutRepresentation:l}=e(bl.store);return{isInserterOpened:e(Tc).isInserterOpened(),isListViewOpen:s(),listViewShortcut:l("core/editor/toggle-list-view"),inserterSidebarToggleRef:n(),listViewToggleRef:i(),showIconLabels:t("core","showIconLabels"),isDistractionFree:t("core","distractionFree"),isVisualMode:"visual"===o(),showTools:!!window?.__experimentalEditorWriteMode&&("post-only"!==r()||"wp_template"===a())}}),[]),_=(0,p.useViewportMatch)("medium"),f=(0,p.useViewportMatch)("wide"),b=(0,fs.__)("Document tools"),y=(0,u.useCallback)((()=>o(!r)),[o,r]),x=(0,u.useCallback)((()=>s(!i)),[i,s]),v=(0,fs._x)("Block Inserter","Generic label for block inserter button"),w=i?(0,fs.__)("Close"):(0,fs.__)("Add");return(0,L.jsx)(h.NavigableToolbar,{className:Ai("editor-document-tools","edit-post-header-toolbar",e),"aria-label":b,variant:"unstyled",children:(0,L.jsxs)("div",{className:"editor-document-tools__left",children:[!n&&(0,L.jsx)(Uo.ToolbarButton,{ref:l,className:"editor-document-tools__inserter-toggle",variant:"primary",isPressed:i,onMouseDown:e=>{i&&e.preventDefault()},onClick:x,disabled:t,icon:b_,label:m?w:v,showTooltip:!m,"aria-expanded":i}),(f||!m)&&(0,L.jsxs)(L.Fragment,{children:[g&&_&&(0,L.jsx)(Uo.ToolbarItem,{as:h.ToolSelector,showTooltip:!m,variant:m?"tertiary":void 0,disabled:t,size:"compact"}),(0,L.jsx)(Uo.ToolbarItem,{as:cd,showTooltip:!m,variant:m?"tertiary":void 0,size:"compact"}),(0,L.jsx)(Uo.ToolbarItem,{as:ld,showTooltip:!m,variant:m?"tertiary":void 0,size:"compact"}),!n&&(0,L.jsx)(Uo.ToolbarButton,{className:"editor-document-tools__document-overview-toggle",icon:aa,disabled:t,isPressed:r,label:(0,fs.__)("Document Overview"),onClick:y,shortcut:a,showTooltip:!m,variant:m?"tertiary":void 0,"aria-expanded":r,ref:d})]})]})})};function x_(){const{createNotice:e}=(0,c.useDispatch)(_s.store),{getCurrentPostId:t,getCurrentPostType:s}=(0,c.useSelect)(Tc),{getEditedEntityRecord:o}=(0,c.useSelect)(d.store);const n=(0,p.useCopyToClipboard)((function(){const e=o("postType",s(),t());return e?"function"==typeof e.content?e.content(e):e.blocks?(0,y.__unstableSerializeAndClean)(e.blocks):e.content?e.content:void 0:""}),(function(){e("info",(0,fs.__)("All content copied."),{isDismissible:!0,type:"snackbar"})}));return(0,L.jsx)(Uo.MenuItem,{ref:n,children:(0,fs.__)("Copy all blocks")})}const v_=[{value:"visual",label:(0,fs.__)("Visual editor")},{value:"text",label:(0,fs.__)("Code editor")}];const w_=function(){const{shortcut:e,isRichEditingEnabled:t,isCodeEditingEnabled:s,mode:o}=(0,c.useSelect)((e=>({shortcut:e(bl.store).getShortcutRepresentation("core/editor/toggle-mode"),isRichEditingEnabled:e(Tc).getEditorSettings().richEditingEnabled,isCodeEditingEnabled:e(Tc).getEditorSettings().codeEditingEnabled,mode:e(Tc).getEditorMode()})),[]),{switchEditorMode:n}=(0,c.useDispatch)(Tc);let i=o;t||"visual"!==o||(i="text"),s||"text"!==o||(i="visual");const r=v_.map((o=>(s||"text"!==o.value||(o={...o,disabled:!0}),t||"visual"!==o.value||(o={...o,disabled:!0,info:(0,fs.__)("You can enable the visual editor in your profile settings.")}),o.value===i||o.disabled?o:{...o,shortcut:e})));return(0,L.jsx)(Uo.MenuGroup,{label:(0,fs.__)("Editor"),children:(0,L.jsx)(Uo.MenuItemsChoice,{choices:r,value:i,onSelect:n})})},{Fill:S_,Slot:k_}=(0,Uo.createSlotFill)("ToolsMoreMenuGroup");S_.Slot=({fillProps:e})=>(0,L.jsx)(k_,{fillProps:e});const C_=S_,{Fill:P_,Slot:j_}=(0,Uo.createSlotFill)("web"===u.Platform.OS?Symbol("ViewMoreMenuGroup"):"ViewMoreMenuGroup");P_.Slot=({fillProps:e})=>(0,L.jsx)(j_,{fillProps:e});const E_=P_;function T_(){const{openModal:e}=(0,c.useDispatch)(za),{set:t}=(0,c.useDispatch)(k.store),{toggleDistractionFree:s}=(0,c.useDispatch)(Tc),o=(0,c.useSelect)((e=>e(k.store).get("core","showIconLabels")),[]),n=()=>{t("core","distractionFree",!1)};return(0,L.jsx)(L.Fragment,{children:(0,L.jsx)(Uo.DropdownMenu,{icon:t_,label:(0,fs.__)("Options"),popoverProps:{placement:"bottom-end",className:"more-menu-dropdown__content"},toggleProps:{showTooltip:!o,...o&&{variant:"tertiary"},tooltipPosition:"bottom",size:"compact"},children:({onClose:t})=>(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(Uo.MenuGroup,{label:(0,fs._x)("View","noun"),children:[(0,L.jsx)(k.PreferenceToggleMenuItem,{scope:"core",name:"fixedToolbar",onToggle:n,label:(0,fs.__)("Top toolbar"),info:(0,fs.__)("Access all block and document tools in a single place"),messageActivated:(0,fs.__)("Top toolbar activated."),messageDeactivated:(0,fs.__)("Top toolbar deactivated.")}),(0,L.jsx)(k.PreferenceToggleMenuItem,{scope:"core",name:"distractionFree",label:(0,fs.__)("Distraction free"),info:(0,fs.__)("Write with calmness"),handleToggling:!1,onToggle:()=>s({createNotice:!1}),messageActivated:(0,fs.__)("Distraction free mode activated."),messageDeactivated:(0,fs.__)("Distraction free mode deactivated."),shortcut:xl.displayShortcut.primaryShift("\\")}),(0,L.jsx)(k.PreferenceToggleMenuItem,{scope:"core",name:"focusMode",label:(0,fs.__)("Spotlight mode"),info:(0,fs.__)("Focus on one block at a time"),messageActivated:(0,fs.__)("Spotlight mode activated."),messageDeactivated:(0,fs.__)("Spotlight mode deactivated.")}),(0,L.jsx)(E_.Slot,{fillProps:{onClose:t}})]}),(0,L.jsx)(w_,{}),(0,L.jsx)(Wa.Slot,{name:"core/plugin-more-menu",label:(0,fs.__)("Plugins"),fillProps:{onClick:t}}),(0,L.jsxs)(Uo.MenuGroup,{label:(0,fs.__)("Tools"),children:[(0,L.jsx)(Uo.MenuItem,{onClick:()=>e("editor/keyboard-shortcut-help"),shortcut:xl.displayShortcut.access("h"),children:(0,fs.__)("Keyboard shortcuts")}),(0,L.jsx)(x_,{}),(0,L.jsxs)(Uo.MenuItem,{icon:Fo,href:(0,fs.__)("https://wordpress.org/documentation/article/wordpress-block-editor/"),target:"_blank",rel:"noopener noreferrer",children:[(0,fs.__)("Help"),(0,L.jsx)(Uo.VisuallyHidden,{as:"span",children:(0,fs.__)("(opens in a new tab)")})]}),(0,L.jsx)(C_.Slot,{fillProps:{onClose:t}})]}),(0,L.jsx)(Uo.MenuGroup,{children:(0,L.jsx)(Uo.MenuItem,{onClick:()=>e("editor/preferences"),children:(0,fs.__)("Preferences")})})]})})})}const B_="toggle",I_="button";function N_({forceIsDirty:e,setEntitiesSavedStatesCallback:t}){let s;const o=(0,p.useViewportMatch)("medium","<"),{togglePublishSidebar:n}=(0,c.useDispatch)(Tc),{hasPublishAction:i,isBeingScheduled:r,isPending:a,isPublished:l,isPublishSidebarEnabled:d,isPublishSidebarOpened:u,isScheduled:m,postStatus:h,postStatusHasChanged:g}=(0,c.useSelect)((e=>{var t;return{hasPublishAction:null!==(t=!!e(Tc).getCurrentPost()?._links?.["wp:action-publish"])&&void 0!==t&&t,isBeingScheduled:e(Tc).isEditedPostBeingScheduled(),isPending:e(Tc).isCurrentPostPending(),isPublished:e(Tc).isCurrentPostPublished(),isPublishSidebarEnabled:e(Tc).isPublishSidebarEnabled(),isPublishSidebarOpened:e(Tc).isPublishSidebarOpened(),isScheduled:e(Tc).isCurrentPostScheduled(),postStatus:e(Tc).getEditedPostAttribute("status"),postStatusHasChanged:e(Tc).getPostEdits()?.status}}),[]);return s=l||g&&!["future","publish"].includes(h)||m&&r||a&&!i&&!o?I_:o||d?B_:I_,(0,L.jsx)(zp,{forceIsDirty:e,isOpen:u,isToggle:s===B_,onToggle:n,setEntitiesSavedStatesCallback:t})}function A_(){const{hasLoaded:e,permalink:t,isPublished:s,label:o,showIconLabels:n}=(0,c.useSelect)((e=>{const t=e(Tc).getCurrentPostType(),s=e(d.store).getPostType(t),{get:o}=e(k.store);return{permalink:e(Tc).getPermalink(),isPublished:e(Tc).isCurrentPostPublished(),label:s?.labels.view_item,hasLoaded:!!s,showIconLabels:o("core","showIconLabels")}}),[]);return s&&t&&e?(0,L.jsx)(Uo.Button,{icon:Fo,label:o||(0,fs.__)("View post"),href:t,target:"_blank",showTooltip:!n,size:"compact"}):null}const D_=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.Path,{d:"M20.5 16h-.7V8c0-1.1-.9-2-2-2H6.2c-1.1 0-2 .9-2 2v8h-.7c-.8 0-1.5.7-1.5 1.5h20c0-.8-.7-1.5-1.5-1.5zM5.7 8c0-.3.2-.5.5-.5h11.6c.3 0 .5.2.5.5v7.6H5.7V8z"})}),R_=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.Path,{d:"M15 4H9c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h6c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H9c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h6c.3 0 .5.2.5.5v12zm-4.5-.5h2V16h-2v1.5z"})}),M_=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,L.jsx)(M.Path,{d:"M17 4H7c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H7c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h10c.3 0 .5.2.5.5v12zm-7.5-.5h4V16h-4v1.5z"})});function L_({forceIsAutosaveable:e,disabled:t}){const{deviceType:s,homeUrl:o,isTemplate:n,isViewable:i,showIconLabels:r,isTemplateHidden:a,templateId:l}=(0,c.useSelect)((e=>{var t;const{getDeviceType:s,getCurrentPostType:o,getCurrentTemplateId:n}=e(Tc),{getRenderingMode:i}=$(e(Tc)),{getEntityRecord:r,getPostType:a}=e(d.store),{get:l}=e(k.store),c=o();return{deviceType:s(),homeUrl:r("root","__unstableBase")?.home,isTemplate:"wp_template"===c,isViewable:null!==(t=a(c)?.viewable)&&void 0!==t&&t,showIconLabels:l("core","showIconLabels"),isTemplateHidden:"post-only"===i(),templateId:n()}}),[]),{setDeviceType:u,setRenderingMode:m}=(0,c.useDispatch)(Tc),{resetZoomLevel:g}=$((0,c.useDispatch)(h.store)),_=e=>{u(e),g()};if((0,p.useViewportMatch)("medium","<"))return null;const f={className:"editor-preview-dropdown__toggle",iconPosition:"right",size:"compact",showTooltip:!r,disabled:t,accessibleWhenDisabled:t},b={"aria-label":(0,fs.__)("View options")},y={desktop:D_,mobile:R_,tablet:M_},x=[{value:"Desktop",label:(0,fs.__)("Desktop"),icon:D_},{value:"Tablet",label:(0,fs.__)("Tablet"),icon:M_},{value:"Mobile",label:(0,fs.__)("Mobile"),icon:R_}];return(0,L.jsx)(Uo.DropdownMenu,{className:Ai("editor-preview-dropdown",`editor-preview-dropdown--${s.toLowerCase()}`),popoverProps:{placement:"bottom-end"},toggleProps:f,menuProps:b,icon:y[s.toLowerCase()],label:(0,fs.__)("View"),disableOpenOnArrowDown:t,children:({onClose:t})=>(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Uo.MenuGroup,{children:(0,L.jsx)(Uo.MenuItemsChoice,{choices:x,value:s,onSelect:_})}),n&&(0,L.jsx)(Uo.MenuGroup,{children:(0,L.jsxs)(Uo.MenuItem,{href:o,target:"_blank",icon:Fo,onClick:t,children:[(0,fs.__)("View site"),(0,L.jsx)(Uo.VisuallyHidden,{as:"span",children:(0,fs.__)("(opens in a new tab)")})]})}),!n&&!!l&&(0,L.jsx)(Uo.MenuGroup,{children:(0,L.jsx)(Uo.MenuItem,{icon:a?void 0:Ho,isSelected:!a,role:"menuitemcheckbox",onClick:()=>{m(a?"template-locked":"post-only")},children:(0,fs.__)("Show template")})}),i&&(0,L.jsx)(Uo.MenuGroup,{children:(0,L.jsx)(Lp,{className:"editor-preview-dropdown__button-external",role:"menuitem",forceIsAutosaveable:e,"aria-label":(0,fs.__)("Preview in new tab"),textContent:(0,L.jsxs)(L.Fragment,{children:[(0,fs.__)("Preview in new tab"),(0,L.jsx)(Uo.Icon,{icon:Fo})]}),onPreview:t})}),(0,L.jsx)(Wa.Slot,{name:"core/plugin-preview-menu",fillProps:{onClick:t}})]})})}const O_=(0,L.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",children:(0,L.jsx)(M.Path,{fill:"none",d:"M5.75 12.75V18.25H11.25M12.75 5.75H18.25V11.25",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"square"})}),F_=({disabled:e})=>{const{isZoomOut:t,showIconLabels:s,isDistractionFree:o}=(0,c.useSelect)((e=>({isZoomOut:$(e(h.store)).isZoomOut(),showIconLabels:e(k.store).get("core","showIconLabels"),isDistractionFree:e(k.store).get("core","distractionFree")}))),{resetZoomLevel:n,setZoomLevel:i}=$((0,c.useDispatch)(h.store)),{registerShortcut:r,unregisterShortcut:a}=(0,c.useDispatch)(bl.store);(0,u.useEffect)((()=>(r({name:"core/editor/zoom",category:"global",description:(0,fs.__)("Enter or exit zoom out."),keyCombination:{modifier:(0,xl.isAppleOS)()?"primaryShift":"secondary",character:"0"}}),()=>{a("core/editor/zoom")})),[r,a]),(0,bl.useShortcut)("core/editor/zoom",(()=>{t?n():i("auto-scaled")}),{isDisabled:o});return(0,L.jsx)(Uo.Button,{accessibleWhenDisabled:!0,disabled:e,onClick:()=>{t?n():i("auto-scaled")},icon:O_,label:(0,fs.__)("Zoom Out"),isPressed:t,size:"compact",showTooltip:!s,className:"editor-zoom-out-toggle"})},V_=window?.__experimentalEnableBlockComment,z_={distractionFreeDisabled:{y:"-50px"},distractionFreeHover:{y:0},distractionFreeHidden:{y:"-50px"},visible:{y:0},hidden:{y:0}},U_={distractionFreeDisabled:{x:"-100%"},distractionFreeHover:{x:0},distractionFreeHidden:{x:"-100%"},visible:{x:0},hidden:{x:0}};const H_=function({customSaveButton:e,forceIsDirty:t,forceDisableBlockTools:s,setEntitiesSavedStatesCallback:o,title:n}){const i=(0,p.useViewportMatch)("large"),r=(0,p.useViewportMatch)("medium"),a=(0,p.useMediaQuery)("(max-width: 403px)"),{postType:l,isTextEditor:d,isPublishSidebarOpened:m,showIconLabels:g,hasFixedToolbar:_,hasBlockSelection:f,hasSectionRootClientId:b}=(0,c.useSelect)((e=>{const{get:t}=e(k.store),{getEditorMode:s,getCurrentPostType:o,isPublishSidebarOpened:n}=e(Tc),{getBlockSelectionStart:i,getSectionRootClientId:r}=$(e(h.store));return{postType:o(),isTextEditor:"text"===s(),isPublishSidebarOpened:n(),showIconLabels:t("core","showIconLabels"),hasFixedToolbar:t("core","fixedToolbar"),hasBlockSelection:!!i(),hasSectionRootClientId:!!r()}}),[]),y=["post","page","wp_template"].includes(l)&&b,x=[N,B,I].includes(l)||s,[v,w]=(0,u.useState)(!0),S=!a&&(!_||_&&(!f||v)),C=(()=>{const e=(0,Uo.__experimentalUseSlotFills)(Yg);return Boolean(e&&e.length)})();return(0,L.jsxs)("div",{className:"editor-header edit-post-header",children:[C&&(0,L.jsx)(Uo.__unstableMotion.div,{className:"editor-header__back-button",variants:U_,transition:{type:"tween"},children:(0,L.jsx)(Xg.Slot,{})}),(0,L.jsxs)(Uo.__unstableMotion.div,{variants:z_,className:"editor-header__toolbar",transition:{type:"tween"},children:[(0,L.jsx)(y_,{disableBlockTools:s||d}),_&&r&&(0,L.jsx)(f_,{isCollapsed:v,onToggle:w})]}),S&&(0,L.jsx)(Uo.__unstableMotion.div,{className:"editor-header__center",variants:z_,transition:{type:"tween"},children:(0,L.jsx)(Zc,{title:n})}),(0,L.jsxs)(Uo.__unstableMotion.div,{variants:z_,transition:{type:"tween"},className:"editor-header__settings",children:[!e&&!m&&(0,L.jsx)(oh,{forceIsDirty:t}),(0,L.jsx)(A_,{}),(0,L.jsx)(L_,{forceIsAutosaveable:t,disabled:x}),(0,L.jsx)(Lp,{className:"editor-header__post-preview-button",forceIsAutosaveable:t}),i&&y&&(0,L.jsx)(F_,{disabled:s}),(i||!g)&&(0,L.jsx)(qa.Slot,{scope:"core"}),!e&&(0,L.jsx)(N_,{forceIsDirty:t,setEntitiesSavedStatesCallback:o}),V_?(0,L.jsx)(m_,{}):void 0,e,(0,L.jsx)(T_,{})]})]})},{PrivateInserterLibrary:G_}=$(h.privateApis);function $_(){const{blockSectionRootClientId:e,inserterSidebarToggleRef:t,inserter:s,showMostUsedBlocks:o,sidebarIsOpened:n}=(0,c.useSelect)((e=>{const{getInserterSidebarToggleRef:t,getInserter:s,isPublishSidebarOpened:o}=$(e(Tc)),{getBlockRootClientId:n,isZoomOut:i,getSectionRootClientId:r}=$(e(h.store)),{get:a}=e(k.store),{getActiveComplementaryArea:l}=e(za);return{inserterSidebarToggleRef:t(),inserter:s(),showMostUsedBlocks:a("core","mostUsedBlocks"),blockSectionRootClientId:(()=>{if(i()){const e=r();if(e)return e}return n()})(),sidebarIsOpened:!(!l("core")&&!o())}}),[]),{setIsInserterOpened:i}=(0,c.useDispatch)(Tc),{disableComplementaryArea:r}=(0,c.useDispatch)(za),a=(0,p.useViewportMatch)("medium","<"),l=(0,u.useRef)(),d=(0,u.useCallback)((()=>{i(!1),t.current?.focus()}),[t,i]),m=(0,u.useCallback)((e=>{e.keyCode!==xl.ESCAPE||e.defaultPrevented||(e.preventDefault(),d())}),[d]),g=(0,L.jsx)("div",{className:"editor-inserter-sidebar__content",children:(0,L.jsx)(G_,{showMostUsedBlocks:o,showInserterHelpPanel:!0,shouldFocusBlock:a,rootClientId:e,onSelect:s.onSelect,__experimentalInitialTab:s.tab,__experimentalInitialCategory:s.category,__experimentalFilterValue:s.filterValue,onPatternCategorySelection:n?()=>r("core"):void 0,ref:l,onClose:d})});return(0,L.jsx)("div",{onKeyDown:m,className:"editor-inserter-sidebar",children:g})}function W_(){return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)("div",{className:"editor-list-view-sidebar__outline",children:[(0,L.jsxs)("div",{children:[(0,L.jsx)(Uo.__experimentalText,{children:(0,fs.__)("Characters:")}),(0,L.jsx)(Uo.__experimentalText,{children:(0,L.jsx)(Oh,{})})]}),(0,L.jsxs)("div",{children:[(0,L.jsx)(Uo.__experimentalText,{children:(0,fs.__)("Words:")}),(0,L.jsx)(Rh,{})]}),(0,L.jsxs)("div",{children:[(0,L.jsx)(Uo.__experimentalText,{children:(0,fs.__)("Time to read:")}),(0,L.jsx)(Lh,{})]})]}),(0,L.jsx)(od,{})]})}const{TabbedSidebar:Z_}=$(h.privateApis);function Y_(){const{setIsListViewOpened:e}=(0,c.useDispatch)(Tc),{getListViewToggleRef:t}=$((0,c.useSelect)(Tc)),s=(0,p.useFocusOnMount)("firstElement"),o=(0,u.useCallback)((()=>{e(!1),t().current?.focus()}),[t,e]),n=(0,u.useCallback)((e=>{e.keyCode!==xl.ESCAPE||e.defaultPrevented||(e.preventDefault(),o())}),[o]),[i,r]=(0,u.useState)(null),[a,l]=(0,u.useState)("list-view"),d=(0,u.useRef)(),m=(0,u.useRef)(),g=(0,u.useRef)(),_=(0,p.useMergeRefs)([s,g,r]);const f=(0,u.useCallback)((()=>{d.current.contains(d.current.ownerDocument.activeElement)?o():function(e){const t=Gc.focus.tabbable.find(m.current)[0];if("list-view"===e){const e=Gc.focus.tabbable.find(g.current)[0];(d.current.contains(e)?e:t).focus()}else t.focus()}(a)}),[o,a]);return(0,bl.useShortcut)("core/editor/toggle-list-view",f),(0,L.jsx)("div",{className:"editor-list-view-sidebar",onKeyDown:n,ref:d,children:(0,L.jsx)(Z_,{tabs:[{name:"list-view",title:(0,fs._x)("List View","Post overview"),panel:(0,L.jsx)("div",{className:"editor-list-view-sidebar__list-view-container",children:(0,L.jsx)("div",{className:"editor-list-view-sidebar__list-view-panel-content",children:(0,L.jsx)(h.__experimentalListView,{dropZoneElement:i})})}),panelRef:_},{name:"outline",title:(0,fs._x)("Outline","Post overview"),panel:(0,L.jsx)("div",{className:"editor-list-view-sidebar__list-view-container",children:(0,L.jsx)(W_,{})})}],onClose:o,onSelect:e=>l(e),defaultTabId:"list-view",ref:m,closeButtonLabel:(0,fs.__)("Close")})})}const{Fill:K_,Slot:q_}=(0,Uo.createSlotFill)("ActionsPanel");function Q_({setEntitiesSavedStatesCallback:e,closeEntitiesSavedStates:t,isEntitiesSavedStatesOpen:s,forceIsDirtyPublishPanel:o}){const{closePublishSidebar:n,togglePublishSidebar:i}=(0,c.useDispatch)(Tc),{publishSidebarOpened:r,isPublishable:a,isDirty:l,hasOtherEntitiesChanges:d}=(0,c.useSelect)((e=>{const{isPublishSidebarOpened:t,isEditedPostPublishable:s,isCurrentPostPublished:o,isEditedPostDirty:n,hasNonPostEntityChanges:i}=e(Tc),r=i();return{publishSidebarOpened:t(),isPublishable:!o()&&s(),isDirty:r||n(),hasOtherEntitiesChanges:r}}),[]),p=(0,u.useCallback)((()=>e(!0)),[]);let m;return m=r?(0,L.jsx)(Ym,{onClose:n,forceIsDirty:o,PrePublishExtension:Iu.Slot,PostPublishExtension:Su.Slot}):a&&!d?(0,L.jsx)("div",{className:"editor-layout__toggle-publish-panel",children:(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,variant:"secondary",onClick:i,"aria-expanded":!1,children:(0,fs.__)("Open publish panel")})}):(0,L.jsx)("div",{className:"editor-layout__toggle-entities-saved-states-panel",children:(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,variant:"secondary",onClick:p,"aria-expanded":!1,"aria-haspopup":"dialog",disabled:!l,accessibleWhenDisabled:!0,children:(0,fs.__)("Open save panel")})}),(0,L.jsxs)(L.Fragment,{children:[s&&(0,L.jsx)(wd,{close:t,renderDialog:!0}),(0,L.jsx)(q_,{bubblesVirtually:!0}),!s&&m]})}function X_({autoFocus:e=!1}){const{switchEditorMode:t}=(0,c.useDispatch)(Tc),{shortcut:s,isRichEditingEnabled:o}=(0,c.useSelect)((e=>{const{getEditorSettings:t}=e(Tc),{getShortcutRepresentation:s}=e(bl.store);return{shortcut:s("core/editor/toggle-mode"),isRichEditingEnabled:t().richEditingEnabled}}),[]),n=(0,u.useRef)();return(0,u.useEffect)((()=>{e||n?.current?.focus()}),[e]),(0,L.jsxs)("div",{className:"editor-text-editor",children:[o&&(0,L.jsxs)("div",{className:"editor-text-editor__toolbar",children:[(0,L.jsx)("h2",{children:(0,fs.__)("Editing code")}),(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>t("visual"),shortcut:s,children:(0,fs.__)("Exit code editor")})]}),(0,L.jsxs)("div",{className:"editor-text-editor__body",children:[(0,L.jsx)(wh,{ref:n}),(0,L.jsx)(gh,{})]})]})}function J_({contentRef:e}){const{onNavigateToEntityRecord:t,templateId:s}=(0,c.useSelect)((e=>{const{getEditorSettings:t,getCurrentTemplateId:s}=e(Tc);return{onNavigateToEntityRecord:t().onNavigateToEntityRecord,templateId:s()}}),[]),o=(0,c.useSelect)((e=>!!e(d.store).canUser("create",{kind:"postType",name:"wp_template"})),[]),[n,i]=(0,u.useState)(!1);return(0,u.useEffect)((()=>{const t=e=>{o&&e.target.classList.contains("is-root-container")&&"core/template-part"!==e.target.dataset?.type&&(e.defaultPrevented||(e.preventDefault(),i(!0)))},s=e.current;return s?.addEventListener("dblclick",t),()=>{s?.removeEventListener("dblclick",t)}}),[e,o]),o?(0,L.jsx)(Uo.__experimentalConfirmDialog,{isOpen:n,confirmButtonText:(0,fs.__)("Edit template"),onConfirm:()=>{i(!1),t({postId:s,postType:"wp_template"})},onCancel:()=>i(!1),size:"medium",children:(0,fs.__)("You’ve tried to select a block that is part of a template, which may be used on other posts and pages. Would you like to edit the template?")}):null}function ef({direction:e,resizeWidthBy:t}){const s=`resizable-editor__resize-help-${e}`;return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Uo.Tooltip,{text:(0,fs.__)("Drag to resize"),children:(0,L.jsx)(Uo.__unstableMotion.button,{className:`editor-resizable-editor__resize-handle is-${e}`,"aria-label":(0,fs.__)("Drag to resize"),"aria-describedby":s,onKeyDown:function(s){const{keyCode:o}=s;o!==xl.LEFT&&o!==xl.RIGHT||(s.preventDefault(),"left"===e&&o===xl.LEFT||"right"===e&&o===xl.RIGHT?t(20):("left"===e&&o===xl.RIGHT||"right"===e&&o===xl.LEFT)&&t(-20))},variants:{active:{opacity:1,scaleY:1.3}},whileFocus:"active",whileHover:"active",whileTap:"active",role:"separator","aria-orientation":"vertical"},"handle")}),(0,L.jsx)(Uo.VisuallyHidden,{id:s,children:(0,fs.__)("Use left and right arrow keys to resize the canvas.")})]})}const tf={position:void 0,userSelect:void 0,cursor:void 0,width:void 0,height:void 0,top:void 0,right:void 0,bottom:void 0,left:void 0};const sf=function({className:e,enableResizing:t,height:s,children:o}){const[n,i]=(0,u.useState)("100%"),r=(0,u.useRef)(),a=(0,u.useCallback)((e=>{r.current&&i(r.current.offsetWidth+e)}),[]);return(0,L.jsx)(Uo.ResizableBox,{className:Ai("editor-resizable-editor",e,{"is-resizable":t}),ref:e=>{r.current=e?.resizable},size:{width:t?n:"100%",height:t&&s?s:"100%"},onResizeStop:(e,t,s)=>{i(s.style.width)},minWidth:300,maxWidth:"100%",maxHeight:"100%",enable:{left:t,right:t},showHandle:t,resizeRatio:2,handleComponent:{left:(0,L.jsx)(ef,{direction:"left",resizeWidthBy:a}),right:(0,L.jsx)(ef,{direction:"right",resizeWidthBy:a})},handleClasses:void 0,handleStyles:{left:tf,right:tf},children:o})};function of(e,t,s){return Math.min(Math.max(e,t),s)}function nf(e,t,s){const o=e-of(e,s.left,s.right),n=t-of(t,s.top,s.bottom);return Math.sqrt(o*o+n*n)}function rf({isEnabled:e=!0}={}){const{getEnabledClientIdsTree:t,getBlockName:s,getBlockOrder:o}=$((0,c.useSelect)(h.store)),{selectBlock:n}=(0,c.useDispatch)(h.store);return(0,p.useRefEffect)((i=>{if(!e)return;const r=e=>{(e.target===i||e.target.classList.contains("is-root-container"))&&((e,r)=>{const a=t().flatMap((({clientId:e})=>{const t=s(e);if("core/template-part"===t)return[];if("core/post-content"===t){const t=o(e);if(t.length)return t}return[e]}));let l=1/0,c=null;for(const t of a){const s=i.querySelector(`[data-block="${t}"]`);if(!s)continue;const o=nf(e,r,s.getBoundingClientRect());oi.removeEventListener("click",r)}),[e])}function af(){const{getSettings:e,isZoomOut:t}=$((0,c.useSelect)(h.store)),{resetZoomLevel:s}=$((0,c.useDispatch)(h.store));return(0,p.useRefEffect)((o=>{function n(o){if(t()&&!o.defaultPrevented){o.preventDefault();const{__experimentalSetIsInserterOpened:t}=e();"function"==typeof t&&t(!1),s()}}return o.addEventListener("dblclick",n),()=>{o.removeEventListener("dblclick",n)}}),[e,t,s])}const{LayoutStyle:lf,useLayoutClasses:cf,useLayoutStyles:df,ExperimentalBlockCanvas:uf,useFlashEditableBlocks:pf}=$(h.privateApis),mf=[I,T,N,B];function hf(e){for(let t=0;t{a(e.borderBoxSize[0].blockSize)})),m=(0,p.useViewportMatch)("small","<"),{renderingMode:g,postContentAttributes:_,editedPostTemplate:f={},wrapperBlockName:b,wrapperUniqueId:x,deviceType:v,isFocusedEntity:w,isDesignPostType:S,postType:k,isPreview:C}=(0,c.useSelect)((e=>{const{getCurrentPostId:t,getCurrentPostType:s,getCurrentTemplateId:o,getEditorSettings:n,getRenderingMode:i,getDeviceType:r}=e(Tc),{getPostType:a,getEditedEntityRecord:l}=e(d.store),c=s(),u=i();let p;c===I?p="core/block":"post-only"===u&&(p="core/post-content");const m=n(),h=m.supportsTemplateMode,g=a(c),_=o(),f=_?l("postType",T,_):void 0;return{renderingMode:u,postContentAttributes:m.postContentAttributes,isDesignPostType:mf.includes(c),editedPostTemplate:g?.viewable&&h?f:void 0,wrapperBlockName:p,wrapperUniqueId:t(),deviceType:r(),isFocusedEntity:!!m.onNavigateToPreviousEntityRecord,postType:c,isPreview:m.isPreviewMode}}),[]),{isCleanNewPost:P}=(0,c.useSelect)(Tc),{hasRootPaddingAwareAlignments:j,themeHasDisabledLayoutStyles:E,themeSupportsLayout:A,isZoomedOut:D}=(0,c.useSelect)((e=>{const{getSettings:t,isZoomOut:s}=$(e(h.store)),o=t();return{themeHasDisabledLayoutStyles:o.disableLayoutStyles,themeSupportsLayout:o.supportsLayout,hasRootPaddingAwareAlignments:o.__experimentalFeatures?.useRootPaddingAwareAlignments,isZoomedOut:s()}}),[]),R=(0,h.__experimentalUseResizeCanvas)(v),[M]=(0,h.useSettings)("layout"),O=(0,u.useMemo)((()=>"post-only"!==g||S?{type:"default"}:A?{...M,type:"constrained"}:{type:"default"}),[g,A,M,S]),F=(0,u.useMemo)((()=>{if(!f?.content&&!f?.blocks&&_)return _;if(f?.blocks)return hf(f?.blocks);const e="string"==typeof f?.content?f?.content:"";return hf((0,y.parse)(e))||{}}),[f?.content,f?.blocks,_]),V=(0,u.useMemo)((()=>{if(!f?.content&&!f?.blocks)return!1;if(f?.blocks)return gf(f?.blocks);const e="string"==typeof f?.content?f?.content:"";return gf((0,y.parse)(e))||!1}),[f?.content,f?.blocks]),{layout:z={},align:U=""}=F||{},H=cf(F,"core/post-content"),G=Ai({"is-layout-flow":!A},A&&H,U&&`align${U}`),W=df(F,"core/post-content",".block-editor-block-list__layout.is-root-container"),Z=(0,u.useMemo)((()=>z&&("constrained"===z?.type||z?.inherit||z?.contentSize||z?.wideSize)?{...M,...z,type:"constrained"}:{...M,...z,type:"default"}),[z?.type,z?.inherit,z?.contentSize,z?.wideSize,M]),Y=_?Z:O,K="default"!==Y?.type||V?Y:O,q=(0,h.__unstableUseTypingObserver)(),Q=(0,u.useRef)();(0,u.useEffect)((()=>{e&&P()&&Q?.current?.focus()}),[e,P]);const X=k===N,J=[N,B,I].includes(k)&&!C&&!m&&!D,ee=(0,u.useMemo)((()=>[...null!=t?t:[],{css:`:where(.block-editor-iframe__body){display:flow-root;}.is-root-container{display:flow-root;${J?"min-height:0!important;":""}}`}]),[t,J]),te=(0,u.useRef)(),se=(0,h.__unstableUseTypewriter)();return n=(0,p.useMergeRefs)([te,n,"post-only"===g?se:null,pf({isEnabled:"template-locked"===g}),rf({isEnabled:"template-locked"===g}),af(),J?l:null]),(0,L.jsx)("div",{className:Ai("editor-visual-editor","edit-post-visual-editor",i,{"has-padding":w||J,"is-resizable":J,"is-iframed":!s,"is-scrollable":s||"Desktop"!==v}),children:(0,L.jsx)(sf,{enableResizing:J,height:r&&!X?r:"100%",children:(0,L.jsxs)(uf,{shouldIframe:!s,contentRef:n,styles:ee,height:"100%",iframeProps:{...o,style:{...o?.style,...R}},children:[A&&!E&&"post-only"===g&&!S&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(lf,{selector:".editor-visual-editor__post-title-wrapper",layout:O}),(0,L.jsx)(lf,{selector:".block-editor-block-list__layout.is-root-container",layout:K}),U&&(0,L.jsx)(lf,{css:".is-root-container.alignwide { max-width: var(--wp--style--global--wide-size); margin-left: auto; margin-right: auto;}\n\t\t.is-root-container.alignwide:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: var(--wp--style--global--wide-size);}\n\t\t.is-root-container.alignfull { max-width: none; margin-left: auto; margin-right: auto;}\n\t\t.is-root-container.alignfull:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: none;}"}),W&&(0,L.jsx)(lf,{layout:Z,css:W})]}),"post-only"===g&&!S&&(0,L.jsx)("div",{className:Ai("editor-visual-editor__post-title-wrapper","edit-post-visual-editor__post-title-wrapper",{"has-global-padding":j}),contentEditable:!1,ref:q,style:{marginTop:"4rem"},children:(0,L.jsx)(vh,{ref:Q})}),(0,L.jsxs)(h.RecursionProvider,{blockName:b,uniqueId:x,children:[(0,L.jsx)(h.BlockList,{className:Ai("is-"+v.toLowerCase()+"-preview","post-only"!==g||S?"wp-site-blocks":`${G} wp-block-post-content`,{"has-global-padding":"post-only"===g&&!S&&j}),layout:Y,dropZoneElement:s?te.current:te.current?.parentNode,__unstableDisableDropZone:"template-locked"===g}),"template-locked"===g&&(0,L.jsx)(J_,{contentRef:te})]})]})})})},ff={header:(0,fs.__)("Editor top bar"),body:(0,fs.__)("Editor content"),sidebar:(0,fs.__)("Editor settings"),actions:(0,fs.__)("Editor publish"),footer:(0,fs.__)("Editor footer")};function bf({className:e,styles:t,children:s,forceIsDirty:o,contentRef:n,disableIframe:i,autoFocus:r,customSaveButton:a,customSavePanel:l,forceDisableBlockTools:d,title:m,iframeProps:g}){const{mode:_,isRichEditingEnabled:f,isInserterOpened:b,isListViewOpened:y,isDistractionFree:x,isPreviewMode:v,showBlockBreadcrumbs:w,documentLabel:S}=(0,c.useSelect)((e=>{const{get:t}=e(k.store),{getEditorSettings:s,getPostTypeLabel:o}=e(Tc),n=s(),i=o();return{mode:e(Tc).getEditorMode(),isRichEditingEnabled:n.richEditingEnabled,isInserterOpened:e(Tc).isInserterOpened(),isListViewOpened:e(Tc).isListViewOpened(),isDistractionFree:t("core","distractionFree"),isPreviewMode:n.isPreviewMode,showBlockBreadcrumbs:t("core","showBlockBreadcrumbs"),documentLabel:i||(0,fs._x)("Document","noun, breadcrumb")}}),[]),C=(0,p.useViewportMatch)("medium"),P=y?(0,fs.__)("Document Overview"):(0,fs.__)("Block Library"),[j,E]=(0,u.useState)(!1),T=(0,u.useCallback)((e=>{"function"==typeof j&&j(e),E(!1)}),[j]);return(0,L.jsx)(rl,{isDistractionFree:x,className:Ai("editor-editor-interface",e,{"is-entity-save-view-open":!!j,"is-distraction-free":x&&!v}),labels:{...ff,secondarySidebar:P},header:!v&&(0,L.jsx)(H_,{forceIsDirty:o,setEntitiesSavedStatesCallback:E,customSaveButton:a,forceDisableBlockTools:d,title:m}),editorNotices:(0,L.jsx)(ud,{}),secondarySidebar:!v&&"visual"===_&&(b&&(0,L.jsx)($_,{})||y&&(0,L.jsx)(Y_,{})),sidebar:!v&&!x&&(0,L.jsx)(el.Slot,{scope:"core"}),content:(0,L.jsxs)(L.Fragment,{children:[!x&&!v&&(0,L.jsx)(ud,{}),(0,L.jsx)(Zg.Slot,{children:([e])=>e||(0,L.jsxs)(L.Fragment,{children:[!v&&("text"===_||!f)&&(0,L.jsx)(X_,{autoFocus:r}),!v&&!C&&"visual"===_&&(0,L.jsx)(h.BlockToolbar,{hideDragHandle:!0}),(v||f&&"visual"===_)&&(0,L.jsx)(_f,{styles:t,contentRef:n,disableIframe:i,autoFocus:r,iframeProps:g}),s]})})]}),footer:!v&&!x&&C&&w&&f&&"visual"===_&&(0,L.jsx)(h.BlockBreadcrumb,{rootLabelText:S}),actions:v?void 0:l||(0,L.jsx)(Q_,{closeEntitiesSavedStates:T,isEntitiesSavedStatesOpen:j,setEntitiesSavedStatesCallback:E,forceIsDirtyPublishPanel:o})})}const{OverridesPanel:yf}=$(ln.privateApis);function xf(){return(0,c.useSelect)((e=>"wp_block"===e(Tc).getCurrentPostType()),[])?(0,L.jsx)(yf,{}):null}function vf(e){return"string"==typeof e.title?(0,Lo.decodeEntities)(e.title):e.title&&"rendered"in e.title?(0,Lo.decodeEntities)(e.title.rendered):e.title&&"raw"in e.title?(0,Lo.decodeEntities)(e.title.raw):""}const wf=({items:e,closeModal:t})=>{const[s]=e,o=vf(s),{showOnFront:n,currentHomePage:i,isSaving:r}=(0,c.useSelect)((e=>{const{getEntityRecord:t,isSavingEntityRecord:s}=e(d.store),o=t("root","site"),n=t("postType","page",o?.page_on_front);return{showOnFront:o?.show_on_front,currentHomePage:n,isSaving:s("root","site")}})),{saveEntityRecord:a}=(0,c.useDispatch)(d.store),{createSuccessNotice:l,createErrorNotice:u}=(0,c.useDispatch)(_s.store);let p="";"posts"===n?p=(0,fs.__)("This will replace the current homepage which is set to display latest posts."):i&&(p=(0,fs.sprintf)((0,fs.__)('This will replace the current homepage: "%s"'),vf(i)));const m=(0,fs.sprintf)((0,fs.__)('Set "%1$s" as the site homepage? %2$s'),o,p).trim(),h=(0,fs.__)("Set homepage");return(0,L.jsx)("form",{onSubmit:async function(e){e.preventDefault();try{await a("root","site",{page_on_front:s.id,show_on_front:"page"}),l((0,fs.__)("Homepage updated."),{type:"snackbar"})}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,fs.__)("An error occurred while setting the homepage.");u(t,{type:"snackbar"})}finally{t?.()}},children:(0,L.jsxs)(Uo.__experimentalVStack,{spacing:"5",children:[(0,L.jsx)(Uo.__experimentalText,{children:m}),(0,L.jsxs)(Uo.__experimentalHStack,{justify:"right",children:[(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>{t?.()},disabled:r,accessibleWhenDisabled:!0,children:(0,fs.__)("Cancel")}),(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",disabled:r,accessibleWhenDisabled:!0,children:h})]})]})})},Sf=({items:e,closeModal:t})=>{const[s]=e,o=vf(s),{currentPostsPage:n,isPageForPostsSet:i,isSaving:r}=(0,c.useSelect)((e=>{const{getEntityRecord:t,isSavingEntityRecord:s}=e(d.store),o=t("root","site");return{currentPostsPage:t("postType","page",o?.page_for_posts),isPageForPostsSet:0!==o?.page_for_posts,isSaving:s("root","site")}})),{saveEntityRecord:a}=(0,c.useDispatch)(d.store),{createSuccessNotice:l,createErrorNotice:u}=(0,c.useDispatch)(_s.store);const p=i&&n?(0,fs.sprintf)((0,fs.__)('This will replace the current posts page: "%s"'),vf(n)):(0,fs.__)("This page will show the latest posts."),m=(0,fs.sprintf)((0,fs.__)('Set "%1$s" as the posts page? %2$s'),o,p),h=(0,fs.__)("Set posts page");return(0,L.jsx)("form",{onSubmit:async function(e){e.preventDefault();try{await a("root","site",{page_for_posts:s.id,show_on_front:"page"}),l((0,fs.__)("Posts page updated."),{type:"snackbar"})}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,fs.__)("An error occurred while setting the posts page.");u(t,{type:"snackbar"})}finally{t?.()}},children:(0,L.jsxs)(Uo.__experimentalVStack,{spacing:"5",children:[(0,L.jsx)(Uo.__experimentalText,{children:m}),(0,L.jsxs)(Uo.__experimentalHStack,{justify:"right",children:[(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>{t?.()},disabled:r,accessibleWhenDisabled:!0,children:(0,fs.__)("Cancel")}),(0,L.jsx)(Uo.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",disabled:r,accessibleWhenDisabled:!0,children:h})]})]})})};function kf({postType:e,onActionPerformed:t,context:s}){const{defaultActions:o}=(0,c.useSelect)((t=>{const{getEntityActions:s}=$(t(Tc));return{defaultActions:s("postType",e)}}),[e]),{canManageOptions:n,hasFrontPageTemplate:i}=(0,c.useSelect)((e=>{const{getEntityRecords:t}=e(d.store),s=t("postType","wp_template",{per_page:-1});return{canManageOptions:e(d.store).canUser("update",{kind:"root",name:"site"}),hasFrontPageTemplate:!!s?.find((e=>"front-page"===e?.slug))}})),r=(()=>{const{pageOnFront:e,pageForPosts:t}=(0,c.useSelect)((e=>{const{getEntityRecord:t,canUser:s}=e(d.store),o=s("read",{kind:"root",name:"site"})?t("root","site"):void 0;return{pageOnFront:o?.page_on_front,pageForPosts:o?.page_for_posts}}));return(0,u.useMemo)((()=>({id:"set-as-homepage",label:(0,fs.__)("Set as homepage"),isEligible:s=>"publish"===s.status&&"page"===s.type&&e!==s.id&&t!==s.id,RenderModal:wf})),[t,e])})(),a=(()=>{const{pageOnFront:e,pageForPosts:t}=(0,c.useSelect)((e=>{const{getEntityRecord:t,canUser:s}=e(d.store),o=s("read",{kind:"root",name:"site"})?t("root","site"):void 0;return{pageOnFront:o?.page_on_front,pageForPosts:o?.page_for_posts}}));return(0,u.useMemo)((()=>({id:"set-as-posts-page",label:(0,fs.__)("Set as posts page"),isEligible:s=>"publish"===s.status&&"page"===s.type&&e!==s.id&&t!==s.id,RenderModal:Sf})),[t,e])})(),l=n&&!i,{registerPostTypeSchema:p}=$((0,c.useDispatch)(Tc));return(0,u.useEffect)((()=>{p(e)}),[p,e]),(0,u.useMemo)((()=>{let e=[...o];if(l&&e.push(r,a),e=e.sort(((e,t)=>"move-to-trash"===t.id?-1:0)),e=e.filter((e=>!e.context||e.context===s)),t)for(let s=0;s{o(n,{...i,onActionPerformed:o=>{i?.onActionPerformed&&i.onActionPerformed(o),t(e[s].id,o)}})}}}if(e[s].RenderModal){const o=e[s].RenderModal;e[s]={...e[s],RenderModal:n=>(0,L.jsx)(o,{...n,onActionPerformed:o=>{n.onActionPerformed&&n.onActionPerformed(o),t(e[s].id,o)}})}}}return e}),[s,o,t,r,a,l])}const{Menu:Cf,kebabCase:Pf}=$(Uo.privateApis);function jf({postType:e,postId:t,onActionPerformed:s}){const[o,n]=(0,u.useState)(null),i=function(e,t){const{items:s,permissions:o}=(0,c.useSelect)((s=>{const{getEditedEntityRecord:o,getEntityRecordPermissions:n}=$(s(d.store));return{items:t.map((t=>o("postType",e,t))),permissions:t.map((t=>n("postType",e,t)))}}),[t,e]);return(0,u.useMemo)((()=>s.map(((e,t)=>({...e,permissions:o[t]})))),[s,o])}(e,(0,u.useMemo)((()=>Array.isArray(t)?t:t?[t]:[]),[t])),r=kf({postType:e,onActionPerformed:s}),a=(0,u.useMemo)((()=>r.filter((e=>(!e.isEligible||i.some((t=>e.isEligible(t))))&&(i.length<2||e.supportsBulk)))),[r,i]);return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(Cf,{placement:"bottom-end",children:[(0,L.jsx)(Cf.TriggerButton,{render:(0,L.jsx)(Uo.Button,{size:"small",icon:t_,label:(0,fs.__)("Actions"),disabled:!a.length,accessibleWhenDisabled:!0,className:"editor-all-actions-button"})}),(0,L.jsx)(Cf.Popover,{children:(0,L.jsx)(Bf,{actions:a,items:i,setActiveModalAction:n})})]}),!!o&&(0,L.jsx)(Tf,{action:o,items:i,closeModal:()=>n(null)})]})}function Ef({action:e,onClick:t,items:s}){const o="string"==typeof e.label?e.label:e.label(s);return(0,L.jsx)(Cf.Item,{onClick:t,children:(0,L.jsx)(Cf.ItemLabel,{children:o})})}function Tf({action:e,items:t,closeModal:s}){const o="string"==typeof e.label?e.label:e.label(t);return(0,L.jsx)(Uo.Modal,{title:e.modalHeader||o,__experimentalHideHeader:!!e.hideModalHeader,onRequestClose:null!=s?s:()=>{},focusOnMount:"firstContentElement",size:"medium",overlayClassName:`editor-action-modal editor-action-modal__${Pf(e.id)}`,children:(0,L.jsx)(e.RenderModal,{items:t,closeModal:s})})}function Bf({actions:e,items:t,setActiveModalAction:s}){const o=(0,c.useRegistry)();return(0,L.jsx)(Cf.Group,{children:e.map((e=>(0,L.jsx)(Ef,{action:e,onClick:()=>{"RenderModal"in e?s(e):e.callback(t,{registry:o})},items:t},e.id)))})}const{Badge:If}=$(Uo.privateApis);function Nf({postType:e,postId:t,onActionPerformed:s}){const o=(0,u.useMemo)((()=>Array.isArray(t)?t:[t]),[t]),{postTitle:n,icon:i,labels:r}=(0,c.useSelect)((t=>{const{getEditedEntityRecord:s,getEntityRecord:n,getPostType:i}=t(d.store),{getPostIcon:r}=$(t(Tc));let a="";const l=s("postType",e,o[0]);if(1===o.length){var c;const{default_template_types:t=[]}=null!==(c=n("root","__unstableBase"))&&void 0!==c?c:{},s=[T,B].includes(e)?Y({template:l,templateTypes:t}):{};a=s?.title||l?.title}return{postTitle:a,icon:r(e,{area:l?.area}),labels:i(e)?.labels}}),[o,e]),a=$c(t);let l=(0,fs.__)("No title");return r?.name&&o.length>1?l=(0,fs.sprintf)((0,fs.__)("%i %s"),t.length,r?.name):n&&(l=(0,Gc.__unstableStripHTML)(n)),(0,L.jsxs)(Uo.__experimentalVStack,{spacing:1,className:"editor-post-card-panel",children:[(0,L.jsxs)(Uo.__experimentalHStack,{spacing:2,className:"editor-post-card-panel__header",align:"flex-start",children:[(0,L.jsx)(Uo.Icon,{className:"editor-post-card-panel__icon",icon:i}),(0,L.jsxs)(Uo.__experimentalText,{numberOfLines:2,truncate:!0,className:"editor-post-card-panel__title",as:"h2",children:[(0,L.jsx)("span",{className:"editor-post-card-panel__title-name",children:l}),a&&1===o.length&&(0,L.jsx)(If,{children:a})]}),(0,L.jsx)(jf,{postType:e,postId:t,onActionPerformed:s})]}),o.length>1&&(0,L.jsx)(Uo.__experimentalText,{className:"editor-post-card-panel__description",children:(0,fs.sprintf)((0,fs.__)("Changes will be applied to all selected %s."),r?.name.toLowerCase())})]})}function Af(){const{postContent:e}=(0,c.useSelect)((e=>{const{getEditedPostAttribute:t,getCurrentPostType:s,getCurrentPostId:o}=e(Tc),{canUser:n}=e(d.store),{getEntityRecord:i}=e(d.store),r=n("read",{kind:"root",name:"site"})?i("root","site"):void 0,a=s();return{postContent:!(+o()===r?.page_for_posts)&&![T,B].includes(a)&&t("content")}}),[]),t=(0,fs._x)("words","Word count type. Do not translate!"),s=(0,u.useMemo)((()=>e?(0,Dh.count)(e,t):0),[e,t]);if(!s)return null;const o=Math.round(s/189),n=(0,fs.sprintf)((0,fs._n)("%s word","%s words",s),s.toLocaleString()),i=o<=1?(0,fs.__)("1 minute"):(0,fs.sprintf)((0,fs._n)("%s minute","%s minutes",o),o.toLocaleString());return(0,L.jsx)("div",{className:"editor-post-content-information",children:(0,L.jsx)(Uo.__experimentalText,{children:(0,fs.sprintf)((0,fs.__)("%1$s, %2$s read time."),n,i)})})}const Df=function(){const{postFormat:e}=(0,c.useSelect)((e=>{const{getEditedPostAttribute:t}=e(Tc),s=t("format");return{postFormat:null!=s?s:"standard"}}),[]),t=jp.find((t=>t.id===e)),[s,o]=(0,u.useState)(null),n=(0,u.useMemo)((()=>({anchor:s,placement:"left-start",offset:36,shift:!0})),[s]);return(0,L.jsx)(Pp,{children:(0,L.jsx)(Md,{label:(0,fs.__)("Format"),ref:o,children:(0,L.jsx)(Uo.Dropdown,{popoverProps:n,contentClassName:"editor-post-format__dialog",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:s})=>(0,L.jsx)(Uo.Button,{size:"compact",variant:"tertiary","aria-expanded":e,"aria-label":(0,fs.sprintf)((0,fs.__)("Change format: %s"),t?.caption),onClick:s,children:t?.caption}),renderContent:({onClose:e})=>(0,L.jsxs)("div",{className:"editor-post-format__dialog-content",children:[(0,L.jsx)(h.__experimentalInspectorPopoverHeader,{title:(0,fs.__)("Format"),onClose:e}),(0,L.jsx)(Ep,{})]})})})})};function Rf(){const e=(0,c.useSelect)((e=>e(Tc).getEditedPostAttribute("modified")),[]),t=e&&(0,fs.sprintf)((0,fs.__)("Last edited %s."),(0,x.humanTimeDiff)(e));return t?(0,L.jsx)("div",{className:"editor-post-last-edited-panel",children:(0,L.jsx)(Uo.__experimentalText,{children:t})}):null}const Mf=function({className:e,children:t}){return(0,L.jsx)(Uo.__experimentalVStack,{className:Ai("editor-post-panel__section",e),children:t})},Lf={};function Of(){const{editEntityRecord:e}=(0,c.useDispatch)(d.store),{postsPageTitle:t,postsPageId:s,isTemplate:o,postSlug:n}=(0,c.useSelect)((e=>{const{getEntityRecord:t,getEditedEntityRecord:s,canUser:o}=e(d.store),n=o("read",{kind:"root",name:"site"})?t("root","site"):void 0,i=n?.page_for_posts?s("postType","page",n?.page_for_posts):Lf,{getEditedPostAttribute:r,getCurrentPostType:a}=e(Tc);return{postsPageId:i?.id,postsPageTitle:i?.title,isTemplate:a()===T,postSlug:r("slug")}}),[]),[i,r]=(0,u.useState)(null),a=(0,u.useMemo)((()=>({anchor:i,placement:"left-start",offset:36,shift:!0})),[i]);if(!o||!["home","index"].includes(n)||!s)return null;const l=t=>{e("postType","page",s,{title:t})},m=(0,Lo.decodeEntities)(t);return(0,L.jsx)(Md,{label:(0,fs.__)("Blog title"),ref:r,children:(0,L.jsx)(Uo.Dropdown,{popoverProps:a,contentClassName:"editor-blog-title-dropdown__content",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,L.jsx)(Uo.Button,{size:"compact",variant:"tertiary","aria-expanded":e,"aria-label":(0,fs.sprintf)((0,fs.__)("Change blog title: %s"),m),onClick:t,children:m}),renderContent:({onClose:e})=>(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(h.__experimentalInspectorPopoverHeader,{title:(0,fs.__)("Blog title"),onClose:e}),(0,L.jsx)(Uo.__experimentalInputControl,{placeholder:(0,fs.__)("No title"),size:"__unstable-large",value:t,onChange:(0,p.debounce)(l,300),label:(0,fs.__)("Blog title"),help:(0,fs.__)("Set the Posts Page title. Appears in search results, and when the page is shared on social media."),hideLabelFromVision:!0})]})})})}function Ff(){const{editEntityRecord:e}=(0,c.useDispatch)(d.store),{postsPerPage:t,isTemplate:s,postSlug:o}=(0,c.useSelect)((e=>{const{getEditedPostAttribute:t,getCurrentPostType:s}=e(Tc),{getEditedEntityRecord:o,canUser:n}=e(d.store),i=n("read",{kind:"root",name:"site"})?o("root","site"):void 0;return{isTemplate:s()===T,postSlug:t("slug"),postsPerPage:i?.posts_per_page||1}}),[]),[n,i]=(0,u.useState)(null),r=(0,u.useMemo)((()=>({anchor:n,placement:"left-start",offset:36,shift:!0})),[n]);if(!s||!["home","index"].includes(o))return null;const a=t=>{e("root","site",void 0,{posts_per_page:t})};return(0,L.jsx)(Md,{label:(0,fs.__)("Posts per page"),ref:i,children:(0,L.jsx)(Uo.Dropdown,{popoverProps:r,contentClassName:"editor-posts-per-page-dropdown__content",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:s})=>(0,L.jsx)(Uo.Button,{size:"compact",variant:"tertiary","aria-expanded":e,"aria-label":(0,fs.__)("Change posts per page"),onClick:s,children:t}),renderContent:({onClose:e})=>(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(h.__experimentalInspectorPopoverHeader,{title:(0,fs.__)("Posts per page"),onClose:e}),(0,L.jsx)(Uo.__experimentalNumberControl,{placeholder:0,value:t,size:"__unstable-large",spinControls:"custom",step:"1",min:"1",onChange:a,label:(0,fs.__)("Posts per page"),help:(0,fs.__)("Set the default number of posts to display on blog pages, including categories and tags. Some templates may override this setting."),hideLabelFromVision:!0})]})})})}const Vf=[{label:(0,fs._x)("Open",'Adjective: e.g. "Comments are open"'),value:"open",description:(0,fs.__)("Visitors can add new comments and replies.")},{label:(0,fs.__)("Closed"),value:"",description:[(0,fs.__)("Visitors cannot add new comments or replies."),(0,fs.__)("Existing comments remain visible.")].join(" ")}];function zf(){const{editEntityRecord:e}=(0,c.useDispatch)(d.store),{allowCommentsOnNewPosts:t,isTemplate:s,postSlug:o}=(0,c.useSelect)((e=>{const{getEditedPostAttribute:t,getCurrentPostType:s}=e(Tc),{getEditedEntityRecord:o,canUser:n}=e(d.store),i=n("read",{kind:"root",name:"site"})?o("root","site"):void 0;return{isTemplate:s()===T,postSlug:t("slug"),allowCommentsOnNewPosts:i?.default_comment_status||""}}),[]),[n,i]=(0,u.useState)(null),r=(0,u.useMemo)((()=>({anchor:n,placement:"left-start",offset:36,shift:!0})),[n]);if(!s||!["home","index"].includes(o))return null;const a=t=>{e("root","site",void 0,{default_comment_status:t?"open":null})};return(0,L.jsx)(Md,{label:(0,fs.__)("Discussion"),ref:i,children:(0,L.jsx)(Uo.Dropdown,{popoverProps:r,contentClassName:"editor-site-discussion-dropdown__content",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:s})=>(0,L.jsx)(Uo.Button,{size:"compact",variant:"tertiary","aria-expanded":e,"aria-label":(0,fs.__)("Change discussion settings"),onClick:s,children:t?(0,fs.__)("Comments open"):(0,fs.__)("Comments closed")}),renderContent:({onClose:e})=>(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(h.__experimentalInspectorPopoverHeader,{title:(0,fs.__)("Discussion"),onClose:e}),(0,L.jsxs)(Uo.__experimentalVStack,{spacing:3,children:[(0,L.jsx)(Uo.__experimentalText,{children:(0,fs.__)("Changes will apply to new posts only. Individual posts may override these settings.")}),(0,L.jsx)(Uo.RadioControl,{className:"editor-site-discussion__options",hideLabelFromVision:!0,label:(0,fs.__)("Comment status"),options:Vf,onChange:a,selected:t})]})]})})})}function Uf({onActionPerformed:e}){const{isRemovedPostStatusPanel:t,postType:s,postId:o}=(0,c.useSelect)((e=>{const{isEditorPanelRemoved:t,getCurrentPostType:s,getCurrentPostId:o}=e(Tc);return{isRemovedPostStatusPanel:t("post-status"),postType:s(),postId:o()}}),[]);return(0,L.jsx)(Mf,{className:"editor-post-summary",children:(0,L.jsx)(ju.Slot,{children:n=>(0,L.jsx)(L.Fragment,{children:(0,L.jsxs)(Uo.__experimentalVStack,{spacing:4,children:[(0,L.jsx)(Nf,{postType:s,postId:o,onActionPerformed:e}),(0,L.jsx)(Cp,{withPanelBody:!1}),(0,L.jsx)(mp,{}),(0,L.jsxs)(Uo.__experimentalVStack,{spacing:1,children:[(0,L.jsx)(Af,{}),(0,L.jsx)(Rf,{})]}),!t&&(0,L.jsxs)(Uo.__experimentalVStack,{spacing:4,children:[(0,L.jsxs)(Uo.__experimentalVStack,{spacing:1,children:[(0,L.jsx)(sh,{}),(0,L.jsx)(rh,{}),(0,L.jsx)(Th,{}),(0,L.jsx)(qu,{}),(0,L.jsx)(zu,{}),(0,L.jsx)(op,{}),(0,L.jsx)(Ip,{}),(0,L.jsx)(Kd,{}),(0,L.jsx)(lh,{}),(0,L.jsx)(Of,{}),(0,L.jsx)(Ff,{}),(0,L.jsx)(zf,{}),(0,L.jsx)(Df,{}),n]}),(0,L.jsx)(kh,{onActionPerformed:e})]})]})})})})}const{EXCLUDED_PATTERN_SOURCES:Hf,PATTERN_TYPES:Gf}=$(ln.privateApis);function $f(e,t){return e.innerBlocks=e.innerBlocks.map((e=>$f(e,t))),"core/template-part"===e.name&&void 0===e.attributes.theme&&(e.attributes.theme=t),e}function Wf(e,t){return e.filter(((e,s,o)=>((e,t,s)=>t===s.findIndex((t=>e.name===t.name)))(e,s,o)&&(e=>!Hf.includes(e.source))(e)&&(e=>e.templateTypes?.includes(t.slug)||e.blockTypes?.includes("core/template-part/"+t.area))(e)))}function Zf(e,t){return e.map((e=>({...e,keywords:e.keywords||[],type:Gf.theme,blocks:(0,y.parse)(e.content,{__unstableSkipMigrationLogs:!0}).map((e=>$f(e,t)))})))}function Yf({availableTemplates:e,onSelect:t}){return e&&0!==e?.length?(0,L.jsx)(h.__experimentalBlockPatternsList,{label:(0,fs.__)("Templates"),blockPatterns:e,onClickPattern:t,showTitlesAsTooltip:!0}):null}function Kf(){const{record:e,postType:t,postId:s}=(0,c.useSelect)((e=>{const{getCurrentPostType:t,getCurrentPostId:s}=e(Tc),{getEditedEntityRecord:o}=e(d.store),n=t(),i=s();return{postType:n,postId:i,record:o("postType",n,i)}}),[]),{editEntityRecord:o}=(0,c.useDispatch)(d.store),n=function(e){const{blockPatterns:t,restBlockPatterns:s,currentThemeStylesheet:o}=(0,c.useSelect)((e=>{var t;const{getEditorSettings:s}=e(Tc),o=s();return{blockPatterns:null!==(t=o.__experimentalAdditionalBlockPatterns)&&void 0!==t?t:o.__experimentalBlockPatterns,restBlockPatterns:e(d.store).getBlockPatterns(),currentThemeStylesheet:e(d.store).getCurrentTheme().stylesheet}}),[]);return(0,u.useMemo)((()=>Zf(Wf([...t||[],...s||[]],e),e)),[t,s,e,o])}(e);return n?.length?(0,L.jsx)(Uo.PanelBody,{title:(0,fs.__)("Design"),initialOpen:e.type===B,children:(0,L.jsx)(Yf,{availableTemplates:n,onSelect:async e=>{await o("postType",t,s,{blocks:e.blocks,content:(0,y.serialize)(e.blocks)})}})}):null}function qf(){const{postType:e}=(0,c.useSelect)((e=>{const{getCurrentPostType:t}=e(Tc);return{postType:t()}}),[]);return[B,T].includes(e)?(0,L.jsx)(Kf,{}):null}const Qf={document:"edit-post/document",block:"edit-post/block"},{Tabs:Xf}=$(Uo.privateApis),Jf=(0,u.forwardRef)(((e,t)=>{const{documentLabel:s}=(0,c.useSelect)((e=>{const{getPostTypeLabel:t}=e(Tc);return{documentLabel:t()||(0,fs._x)("Document","noun, sidebar")}}),[]);return(0,L.jsxs)(Xf.TabList,{ref:t,children:[(0,L.jsx)(Xf.Tab,{tabId:Qf.document,"data-tab-id":Qf.document,children:s}),(0,L.jsx)(Xf.Tab,{tabId:Qf.block,"data-tab-id":Qf.block,children:(0,fs.__)("Block")})]})})),{BlockQuickNavigation:eb}=$(h.privateApis),tb=["core/post-title","core/post-featured-image","core/post-content"];function sb(){const e=(0,u.useMemo)((()=>(0,m.applyFilters)("editor.postContentBlockTypes",tb)),[]),{clientIds:t,postType:s,renderingMode:o}=(0,c.useSelect)((t=>{const{getCurrentPostType:s,getPostBlocksByName:o,getRenderingMode:n}=$(t(Tc)),i=s();return{postType:i,clientIds:o(T===i?"core/template-part":e),renderingMode:n()}}),[e]),{enableComplementaryArea:n}=(0,c.useDispatch)(za);return"post-only"===o&&s!==T||0===t.length?null:(0,L.jsx)(Uo.PanelBody,{title:(0,fs.__)("Content"),children:(0,L.jsx)(eb,{clientIds:t,onSelect:()=>{n("core","edit-post/document")}})})}const{BlockQuickNavigation:ob}=$(h.privateApis);function nb(){const e=(0,c.useSelect)((e=>{const{getBlockTypes:t}=e(y.store);return t()}),[]),t=(0,u.useMemo)((()=>e.filter((e=>"theme"===e.category)).map((({name:e})=>e))),[e]),s=(0,c.useSelect)((e=>{const{getBlocksByName:s}=e(h.store);return s(t)}),[t]);return 0===s.length?null:(0,L.jsx)(Uo.PanelBody,{title:(0,fs.__)("Content"),children:(0,L.jsx)(ob,{clientIds:s})})}function ib(){const e=(0,c.useSelect)((e=>{const{getCurrentPostType:t}=e(Tc);return t()}),[]);return e!==B?null:(0,L.jsx)(nb,{})}const rb=function(){const{hasBlockSelection:e}=(0,c.useSelect)((e=>({hasBlockSelection:!!e(h.store).getBlockSelectionStart()})),[]),{getActiveComplementaryArea:t}=(0,c.useSelect)(za),{enableComplementaryArea:s}=(0,c.useDispatch)(za),{get:o}=(0,c.useSelect)(k.store);(0,u.useEffect)((()=>{const n=t("core"),i=["edit-post/document","edit-post/block"].includes(n),r=o("core","distractionFree");i&&!r&&s("core",e?"edit-post/block":"edit-post/document")}),[e,t,s,o])},{Tabs:ab}=$(Uo.privateApis),lb=u.Platform.select({web:!0,native:!1}),cb=({tabName:e,keyboardShortcut:t,onActionPerformed:s,extraPanels:o})=>{const n=(0,u.useRef)(null),i=(0,u.useContext)(ab.Context);return(0,u.useEffect)((()=>{const t=Array.from(n.current?.querySelectorAll('[role="tab"]')||[]),s=t.find((t=>t.getAttribute("data-tab-id")===e)),o=s?.ownerDocument.activeElement;t.some((e=>o&&o.id===e.id))&&s&&s.id!==o?.id&&s?.focus()}),[e]),(0,L.jsx)(Au,{identifier:e,header:(0,L.jsx)(ab.Context.Provider,{value:i,children:(0,L.jsx)(Jf,{ref:n})}),closeLabel:(0,fs.__)("Close Settings"),className:"editor-sidebar__panel",headerClassName:"editor-sidebar__panel-tabs",title:(0,fs._x)("Settings","sidebar button label"),toggleShortcut:t,icon:(0,fs.isRTL)()?ca:da,isActiveByDefault:lb,children:(0,L.jsxs)(ab.Context.Provider,{value:i,children:[(0,L.jsxs)(ab.TabPanel,{tabId:Qf.document,focusable:!1,children:[(0,L.jsx)(Uf,{onActionPerformed:s}),(0,L.jsx)(fu.Slot,{}),(0,L.jsx)(sb,{}),(0,L.jsx)(ib,{}),(0,L.jsx)(qf,{}),(0,L.jsx)(mh,{}),(0,L.jsx)(xf,{}),o]}),(0,L.jsx)(ab.TabPanel,{tabId:Qf.block,focusable:!1,children:(0,L.jsx)(h.BlockInspector,{})})]})})},db=({extraPanels:e,onActionPerformed:t})=>{rb();const{tabName:s,keyboardShortcut:o,showSummary:n}=(0,c.useSelect)((e=>{const t=e(bl.store).getShortcutRepresentation("core/editor/toggle-sidebar"),s=e(za).getActiveComplementaryArea("core");let o=s;return[Qf.block,Qf.document].includes(s)||(o=e(h.store).getBlockSelectionStart()?Qf.block:Qf.document),{tabName:o,keyboardShortcut:t,showSummary:![T,B,N].includes(e(Tc).getCurrentPostType())}}),[]),{enableComplementaryArea:i}=(0,c.useDispatch)(za),r=(0,u.useCallback)((e=>{e&&i("core",e)}),[i]);return(0,L.jsx)(ab,{selectedTabId:s,onSelect:r,selectOnMove:!1,children:(0,L.jsx)(cb,{tabName:s,keyboardShortcut:o,showSummary:n,onActionPerformed:t,extraPanels:e})})};const ub=function({postType:e,postId:t,templateId:s,settings:o,children:n,initialEdits:i,onActionPerformed:r,extraContent:a,extraSidebarPanels:l,...u}){const{post:p,template:m,hasLoadedPost:h}=(0,c.useSelect)((o=>{const{getEntityRecord:n,hasFinishedResolution:i}=o(d.store);return{post:n("postType",e,t),template:s?n("postType",T,s):void 0,hasLoadedPost:i("getEntityRecord",["postType",e,t])}}),[e,t,s]);return(0,L.jsxs)(L.Fragment,{children:[h&&!p&&(0,L.jsx)(Uo.Notice,{status:"warning",isDismissible:!1,children:(0,fs.__)("You attempted to edit an item that doesn't exist. Perhaps it was deleted?")}),!!p&&(0,L.jsxs)(Wl,{post:p,__unstableTemplate:m,settings:o,initialEdits:i,useSubRegistry:!1,children:[(0,L.jsx)(bf,{...u,children:a}),n,(0,L.jsx)(db,{onActionPerformed:r,extraPanels:l})]})]})},{PreferenceBaseOption:pb}=$(k.privateApis);function mb(e){const t=(0,c.useSelect)((e=>e(Tc).isPublishSidebarEnabled()),[]),{enablePublishSidebar:s,disablePublishSidebar:o}=(0,c.useDispatch)(Tc);return(0,L.jsx)(pb,{isChecked:t,onChange:e=>e?s():o(),...e})}const{BlockManager:hb}=$(h.privateApis);function gb(){const{showBlockTypes:e,hideBlockTypes:t}=$((0,c.useDispatch)(Tc)),{blockTypes:s,allowedBlockTypes:o,hiddenBlockTypes:n}=(0,c.useSelect)((e=>{var t;return{blockTypes:e(y.store).getBlockTypes(),allowedBlockTypes:e(Tc).getEditorSettings().allowedBlockTypes,hiddenBlockTypes:null!==(t=e(k.store).get("core","hiddenBlockTypes"))&&void 0!==t?t:[]}}),[]),i=(0,u.useMemo)((()=>!0===o?s:s.filter((({name:e})=>o?.includes(e)))),[o,s]).filter((e=>(0,y.hasBlockSupport)(e,"inserter",!0)&&(!e.parent||e.parent.includes("core/post-content")))),r=n.filter((e=>i.some((t=>t.name===e)))),a=i.filter((e=>!r.includes(e.name)));return(0,L.jsx)(hb,{blockTypes:i,selectedBlockTypes:a,onChange:s=>{if(a.length>s.length){const e=a.filter((e=>!s.find((({name:t})=>t===e.name))));t(e.map((({name:e})=>e)))}else if(a.length!a.find((({name:t})=>t===e.name))));e(t.map((({name:e})=>e)))}}})}const{PreferencesModal:_b,PreferencesModalTabs:fb,PreferencesModalSection:bb,PreferenceToggleControl:yb}=$(k.privateApis);function xb({extraSections:e={}}){const t=(0,p.useViewportMatch)("medium"),s=(0,c.useSelect)((e=>{const{getEditorSettings:s}=e(Tc),{get:o}=e(k.store),n=s().richEditingEnabled;return!o("core","distractionFree")&&t&&n}),[t]),{setIsListViewOpened:o,setIsInserterOpened:n}=(0,c.useDispatch)(Tc),{set:i}=(0,c.useDispatch)(k.store),r=(0,u.useMemo)((()=>[{name:"general",tabLabel:(0,fs.__)("General"),content:(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(bb,{title:(0,fs.__)("Interface"),children:[(0,L.jsx)(yb,{scope:"core",featureName:"showListViewByDefault",help:(0,fs.__)("Opens the List View sidebar by default."),label:(0,fs.__)("Always open List View")}),s&&(0,L.jsx)(yb,{scope:"core",featureName:"showBlockBreadcrumbs",help:(0,fs.__)("Display the block hierarchy trail at the bottom of the editor."),label:(0,fs.__)("Show block breadcrumbs")}),(0,L.jsx)(yb,{scope:"core",featureName:"allowRightClickOverrides",help:(0,fs.__)("Allows contextual List View menus via right-click, overriding browser defaults."),label:(0,fs.__)("Allow right-click contextual menus")}),(0,L.jsx)(yb,{scope:"core",featureName:"enableChoosePatternModal",help:(0,fs.__)("Shows starter patterns when creating a new page."),label:(0,fs.__)("Show starter patterns")})]}),(0,L.jsxs)(bb,{title:(0,fs.__)("Document settings"),description:(0,fs.__)("Select what settings are shown in the document panel."),children:[(0,L.jsx)(mu.Slot,{}),(0,L.jsx)(dh,{taxonomyWrapper:(e,t)=>(0,L.jsx)(cu,{label:t.labels.menu_name,panelName:`taxonomy-panel-${t.slug}`})}),(0,L.jsx)(_p,{children:(0,L.jsx)(cu,{label:(0,fs.__)("Featured image"),panelName:"featured-image"})}),(0,L.jsx)(ip,{children:(0,L.jsx)(cu,{label:(0,fs.__)("Excerpt"),panelName:"post-excerpt"})}),(0,L.jsx)(Ad,{supportKeys:["comments","trackbacks"],children:(0,L.jsx)(cu,{label:(0,fs.__)("Discussion"),panelName:"discussion-panel"})}),(0,L.jsx)(Nd,{children:(0,L.jsx)(cu,{label:(0,fs.__)("Page attributes"),panelName:"page-attributes"})})]}),t&&(0,L.jsx)(bb,{title:(0,fs.__)("Publishing"),children:(0,L.jsx)(mb,{help:(0,fs.__)("Review settings, such as visibility and tags."),label:(0,fs.__)("Enable pre-publish checks")})}),e?.general]})},{name:"appearance",tabLabel:(0,fs.__)("Appearance"),content:(0,L.jsxs)(bb,{title:(0,fs.__)("Appearance"),description:(0,fs.__)("Customize the editor interface to suit your needs."),children:[(0,L.jsx)(yb,{scope:"core",featureName:"fixedToolbar",onToggle:()=>i("core","distractionFree",!1),help:(0,fs.__)("Access all block and document tools in a single place."),label:(0,fs.__)("Top toolbar")}),(0,L.jsx)(yb,{scope:"core",featureName:"distractionFree",onToggle:()=>{i("core","fixedToolbar",!0),n(!1),o(!1)},help:(0,fs.__)("Reduce visual distractions by hiding the toolbar and other elements to focus on writing."),label:(0,fs.__)("Distraction free")}),(0,L.jsx)(yb,{scope:"core",featureName:"focusMode",help:(0,fs.__)("Highlights the current block and fades other content."),label:(0,fs.__)("Spotlight mode")}),e?.appearance]})},{name:"accessibility",tabLabel:(0,fs.__)("Accessibility"),content:(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(bb,{title:(0,fs.__)("Navigation"),description:(0,fs.__)("Optimize the editing experience for enhanced control."),children:(0,L.jsx)(yb,{scope:"core",featureName:"keepCaretInsideBlock",help:(0,fs.__)("Keeps the text cursor within blocks while navigating with arrow keys, preventing it from moving to other blocks and enhancing accessibility for keyboard users."),label:(0,fs.__)("Contain text cursor inside block")})}),(0,L.jsx)(bb,{title:(0,fs.__)("Interface"),children:(0,L.jsx)(yb,{scope:"core",featureName:"showIconLabels",label:(0,fs.__)("Show button text labels"),help:(0,fs.__)("Show text instead of icons on buttons across the interface.")})})]})},{name:"blocks",tabLabel:(0,fs.__)("Blocks"),content:(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(bb,{title:(0,fs.__)("Inserter"),children:(0,L.jsx)(yb,{scope:"core",featureName:"mostUsedBlocks",help:(0,fs.__)("Adds a category with the most frequently used blocks in the inserter."),label:(0,fs.__)("Show most used blocks")})}),(0,L.jsx)(bb,{title:(0,fs.__)("Manage block visibility"),description:(0,fs.__)("Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later."),children:(0,L.jsx)(gb,{})})]})},window.__experimentalMediaProcessing&&{name:"media",tabLabel:(0,fs.__)("Media"),content:(0,L.jsx)(L.Fragment,{children:(0,L.jsxs)(bb,{title:(0,fs.__)("General"),description:(0,fs.__)("Customize options related to the media upload flow."),children:[(0,L.jsx)(yb,{scope:"core/media",featureName:"optimizeOnUpload",help:(0,fs.__)("Compress media items before uploading to the server."),label:(0,fs.__)("Pre-upload compression")}),(0,L.jsx)(yb,{scope:"core/media",featureName:"requireApproval",help:(0,fs.__)("Require approval step when optimizing existing media."),label:(0,fs.__)("Approval step")})]})})}].filter(Boolean)),[s,e,n,o,i,t]);return(0,L.jsx)(fb,{sections:r})}const vb=function({postType:e}){const{registerPostTypeSchema:t}=$((0,c.useDispatch)(Tc));(0,u.useEffect)((()=>{t(e)}),[t,e]);const{defaultFields:s}=(0,c.useSelect)((t=>{const{getEntityFields:s}=$(t(Tc));return{defaultFields:s("postType",e)}}),[e]),{records:o,isResolving:n}=(0,d.useEntityRecords)("root","user",{per_page:-1});return{isLoading:n,fields:(0,u.useMemo)((()=>s.map((e=>"author"===e.id?{...e,elements:o?.map((({id:e,name:t})=>({value:e,label:t})))}:e))),[o,s])}},wb="content",Sb={name:"core/pattern-overrides",getValues({select:e,clientId:t,context:s,bindings:o}){const n=s["pattern/overrides"],{getBlockAttributes:i}=e(h.store),r=i(t),a={};for(const e of Object.keys(o)){const t=n?.[r?.metadata?.name]?.[e];void 0!==t?a[e]=""===t?void 0:t:a[e]=r[e]}return a},setValues({select:e,dispatch:t,clientId:s,bindings:o}){const{getBlockAttributes:n,getBlockParentsByBlockName:i,getBlocks:r}=e(h.store),a=n(s),l=a?.metadata?.name;if(!l)return;const[c]=i(s,"core/block",!0),d=Object.entries(o).reduce(((e,[t,{newValue:s}])=>(e[t]=s,e)),{});if(!c){const e=s=>{for(const o of s)o.attributes?.metadata?.name===l&&t(h.store).updateBlockAttributes(o.clientId,d),e(o.innerBlocks)};return void e(r())}const u=n(c)?.[wb];t(h.store).updateBlockAttributes(c,{[wb]:{...u,[l]:{...u?.[l],...Object.entries(d).reduce(((e,[t,s])=>(e[t]=void 0===s?"":s,e)),{})}}})},canUserEditValue:()=>!0};function kb(e,t){const{getEditedEntityRecord:s}=e(d.store),{getRegisteredPostMeta:o}=$(e(d.store));let n;t?.postType&&t?.postId&&(n=s("postType",t?.postType,t?.postId).meta);const i=o(t?.postType),r={};return Object.entries(i||{}).forEach((([e,t])=>{var s;"footnotes"!==e&&"_"!==e.charAt(0)&&(r[e]={label:t.title||e,value:null!==(s=n?.[e])&&void 0!==s?s:t.default||void 0,type:t.type})})),Object.keys(r||{}).length?r:null}const Cb={name:"core/post-meta",getValues({select:e,context:t,bindings:s}){const o=kb(e,t),n={};for(const[e,t]of Object.entries(s)){var i;const s=t.args.key,{value:r,label:a}=o?.[s]||{};n[e]=null!==(i=null!=r?r:a)&&void 0!==i?i:s}return n},setValues({dispatch:e,context:t,bindings:s}){const o={};Object.values(s).forEach((({args:e,newValue:t})=>{o[e.key]=t})),e(d.store).editEntityRecord("postType",t?.postType,t?.postId,{meta:o})},canUserEditValue({select:e,context:t,args:s}){if(t?.query||t?.queryId)return!1;if(!t?.postType)return!1;const o=kb(e,t)?.[s.key]?.value;if(void 0===o)return!1;if(e(Tc).getEditorSettings().enableCustomFields)return!1;return!!e(d.store).canUser("update",{kind:"postType",name:t?.postType,id:t?.postId})},getFieldsList:({select:e,context:t})=>kb(e,t)};const{store:Pb,...jb}=r,Eb={};function Tb(e,t,s){const{registerEntityAction:o}=$((0,c.dispatch)(Tc))}function Bb(e,t,s){const{unregisterEntityAction:o}=$((0,c.dispatch)(Tc))}function Ib(e,t,s){const{registerEntityField:o}=$((0,c.dispatch)(Tc))}function Nb(e,t,s){const{unregisterEntityField:o}=$((0,c.dispatch)(Tc))}G(Eb,{CreateTemplatePartModal:Jo,patternTitleField:yr,templateTitleField:gr,BackButton:Xg,EntitiesSavedStatesExtensible:Sd,Editor:ub,EditorContentSlotFill:Zg,GlobalStylesProvider:function({children:e}){const t=$r();return t.isReady?(0,L.jsx)(Ur.Provider,{value:t,children:e}):null},mergeBaseAndUserConfigs:Gr,PluginPostExcerpt:cp,PostCardPanel:Nf,PreferencesModal:function({extraSections:e={}}){const t=(0,c.useSelect)((e=>e(za).isModalActive("editor/preferences")),[]),{closeModal:s}=(0,c.useDispatch)(za);return t?(0,L.jsx)(_b,{closeModal:s,children:(0,L.jsx)(xb,{extraSections:e})}):null},usePostActions:kf,usePostFields:vb,ToolsMoreMenuGroup:C_,ViewMoreMenuGroup:E_,ResizableEditor:sf,registerCoreBlockBindingsSources:function(){(0,y.registerBlockBindingsSource)(Sb),(0,y.registerBlockBindingsSource)(Cb)},getTemplateInfo:Y,interfaceStore:Pb,...jb})})(),(window.wp=window.wp||{}).editor=o})(); \ No newline at end of file diff --git a/wp-includes/js/dist/element.js b/wp-includes/js/dist/element.js index 3b808f940e..a17440ae60 100644 --- a/wp-includes/js/dist/element.js +++ b/wp-includes/js/dist/element.js @@ -135,6 +135,7 @@ __webpack_require__.d(__webpack_exports__, { ;// external "React" const external_React_namespaceObject = window["React"]; ;// ./node_modules/@wordpress/element/build-module/create-interpolate-element.js +/* wp:polyfill */ /** * Internal dependencies */ @@ -445,6 +446,7 @@ function closeOuterElement(endOffset) { /* harmony default export */ const create_interpolate_element = (createInterpolateElement); ;// ./node_modules/@wordpress/element/build-module/react.js +/* wp:polyfill */ /** * External dependencies */ @@ -830,7 +832,7 @@ const Platform = { }; /** * Component used to detect the current Platform being used. - * Use Platform.OS === 'web' to detect if running on web enviroment. + * Use Platform.OS === 'web' to detect if running on web environment. * * This is the same concept as the React Native implementation. * @@ -1151,10 +1153,19 @@ var __setModuleDefault = Object.create ? (function(o, v) { o["default"] = v; }; +var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); +}; + function __importStar(mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); __setModuleDefault(result, mod); return result; } @@ -1235,12 +1246,25 @@ function __disposeResources(env) { return next(); } +function __rewriteRelativeImportExtension(path, preserveJsx) { + if (typeof path === "string" && /^\.\.?\//.test(path)) { + return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) { + return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js"); + }); + } + return path; +} + /* harmony default export */ const tslib_es6 = ({ __extends, __assign, __rest, __decorate, __param, + __esDecorate, + __runInitializers, + __propKey, + __setFunctionName, __metadata, __awaiter, __generator, @@ -1263,6 +1287,7 @@ function __disposeResources(env) { __classPrivateFieldIn, __addDisposableResource, __disposeResources, + __rewriteRelativeImportExtension, }); ;// ./node_modules/lower-case/dist.es2015/index.js @@ -1365,6 +1390,7 @@ function paramCase(input, options) { ;// external ["wp","escapeHtml"] const external_wp_escapeHtml_namespaceObject = window["wp"]["escapeHtml"]; ;// ./node_modules/@wordpress/element/build-module/raw-html.js +/* wp:polyfill */ /** * Internal dependencies */ @@ -1408,6 +1434,7 @@ function RawHTML({ } ;// ./node_modules/@wordpress/element/build-module/serialize.js +/* wp:polyfill */ /** * Parts of this source were derived and modified from fast-react-render, * released under the MIT license. @@ -1785,7 +1812,7 @@ function renderNativeComponent(type, props, context, legacyContext = {}) { * @return {string} Serialized element */ function renderComponent(Component, props, context, legacyContext = {}) { - const instance = new ( /** @type {import('react').ComponentClass} */ + const instance = new (/** @type {import('react').ComponentClass} */ Component)(props, legacyContext); if (typeof // Ignore reason: Current prettier reformats parens and mangles type assertion diff --git a/wp-includes/js/dist/fields.js b/wp-includes/js/dist/fields.js deleted file mode 100644 index 229fe13098..0000000000 --- a/wp-includes/js/dist/fields.js +++ /dev/null @@ -1,1951 +0,0 @@ -/******/ (() => { // webpackBootstrap -/******/ "use strict"; -/******/ // The require scope -/******/ var __webpack_require__ = {}; -/******/ -/************************************************************************/ -/******/ /* webpack/runtime/define property getters */ -/******/ (() => { -/******/ // define getter functions for harmony exports -/******/ __webpack_require__.d = (exports, definition) => { -/******/ for(var key in definition) { -/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { -/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); -/******/ } -/******/ } -/******/ }; -/******/ })(); -/******/ -/******/ /* webpack/runtime/hasOwnProperty shorthand */ -/******/ (() => { -/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) -/******/ })(); -/******/ -/******/ /* webpack/runtime/make namespace object */ -/******/ (() => { -/******/ // define __esModule on exports -/******/ __webpack_require__.r = (exports) => { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ })(); -/******/ -/************************************************************************/ -var __webpack_exports__ = {}; -// ESM COMPAT FLAG -__webpack_require__.r(__webpack_exports__); - -// EXPORTS -__webpack_require__.d(__webpack_exports__, { - duplicatePattern: () => (/* reexport */ duplicate_pattern), - duplicatePost: () => (/* reexport */ duplicate_post), - duplicatePostNative: () => (/* reexport */ duplicate_post_native), - exportPattern: () => (/* reexport */ export_pattern), - exportPatternNative: () => (/* reexport */ export_pattern_native), - orderField: () => (/* reexport */ order), - permanentlyDeletePost: () => (/* reexport */ permanently_delete_post), - reorderPage: () => (/* reexport */ reorder_page), - reorderPageNative: () => (/* reexport */ reorder_page_native), - titleField: () => (/* reexport */ title), - viewPost: () => (/* reexport */ view_post), - viewPostRevisions: () => (/* reexport */ view_post_revisions) -}); - -;// external ["wp","i18n"] -const external_wp_i18n_namespaceObject = window["wp"]["i18n"]; -;// external ["wp","htmlEntities"] -const external_wp_htmlEntities_namespaceObject = window["wp"]["htmlEntities"]; -;// ./node_modules/@wordpress/fields/build-module/actions/utils.js -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - -const TEMPLATE_POST_TYPE = 'wp_template'; -const TEMPLATE_PART_POST_TYPE = 'wp_template_part'; -const TEMPLATE_ORIGINS = { - custom: 'custom', - theme: 'theme', - plugin: 'plugin' -}; -function isTemplate(post) { - return post.type === TEMPLATE_POST_TYPE; -} -function isTemplatePart(post) { - return post.type === TEMPLATE_PART_POST_TYPE; -} -function isTemplateOrTemplatePart(p) { - return p.type === TEMPLATE_POST_TYPE || p.type === TEMPLATE_PART_POST_TYPE; -} -function getItemTitle(item) { - if (typeof item.title === 'string') { - return (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(item.title); - } - if ('rendered' in item.title) { - return (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(item.title.rendered); - } - if ('raw' in item.title) { - return (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(item.title.raw); - } - return ''; -} - -/** - * Check if a template is removable. - * - * @param template The template entity to check. - * @return Whether the template is removable. - */ -function isTemplateRemovable(template) { - if (!template) { - return false; - } - // In patterns list page we map the templates parts to a different object - // than the one returned from the endpoint. This is why we need to check for - // two props whether is custom or has a theme file. - return [template.source, template.source].includes(TEMPLATE_ORIGINS.custom) && !Boolean(template.type === 'wp_template' && template?.plugin) && !template.has_theme_file; -} - -;// ./node_modules/@wordpress/fields/build-module/fields/title/index.js -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - - -const titleField = { - type: 'text', - id: 'title', - label: (0,external_wp_i18n_namespaceObject.__)('Title'), - placeholder: (0,external_wp_i18n_namespaceObject.__)('No title'), - getValue: ({ - item - }) => getItemTitle(item) -}; -/* harmony default export */ const title = (titleField); - -;// ./node_modules/@wordpress/fields/build-module/fields/order/index.js -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - -const orderField = { - type: 'integer', - id: 'menu_order', - label: (0,external_wp_i18n_namespaceObject.__)('Order'), - description: (0,external_wp_i18n_namespaceObject.__)('Determines the order of pages.') -}; -/* harmony default export */ const order = (orderField); - -;// ./node_modules/@wordpress/fields/build-module/fields/index.js - - - -;// external ["wp","primitives"] -const external_wp_primitives_namespaceObject = window["wp"]["primitives"]; -;// external "ReactJSXRuntime" -const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"]; -;// ./node_modules/@wordpress/icons/build-module/library/external.js -/** - * WordPress dependencies - */ - - -const external = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.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" - }) -}); -/* harmony default export */ const library_external = (external); - -;// ./node_modules/@wordpress/fields/build-module/actions/base-post/view-post.js -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - -const viewPost = { - id: 'view-post', - label: (0,external_wp_i18n_namespaceObject._x)('View', 'verb'), - isPrimary: true, - icon: library_external, - isEligible(post) { - return post.status !== 'trash'; - }, - callback(posts, { - onActionPerformed - }) { - const post = posts[0]; - window.open(post?.link, '_blank'); - if (onActionPerformed) { - onActionPerformed(posts); - } - } -}; -/* harmony default export */ const view_post = (viewPost); - -;// external ["wp","data"] -const external_wp_data_namespaceObject = window["wp"]["data"]; -;// external ["wp","coreData"] -const external_wp_coreData_namespaceObject = window["wp"]["coreData"]; -;// external ["wp","notices"] -const external_wp_notices_namespaceObject = window["wp"]["notices"]; -;// external ["wp","element"] -const external_wp_element_namespaceObject = window["wp"]["element"]; -;// ./node_modules/@wordpress/dataviews/build-module/field-types/integer.js -/** - * Internal dependencies - */ - -function sort(a, b, direction) { - return direction === 'asc' ? a - b : b - a; -} -function isValid(value, context) { - // TODO: this implicitely means the value is required. - if (value === '') { - return false; - } - if (!Number.isInteger(Number(value))) { - return false; - } - if (context?.elements) { - const validValues = context?.elements.map(f => f.value); - if (!validValues.includes(Number(value))) { - return false; - } - } - return true; -} -/* harmony default export */ const integer = ({ - sort, - isValid, - Edit: 'integer' -}); - -;// ./node_modules/@wordpress/dataviews/build-module/field-types/text.js -/** - * Internal dependencies - */ - -function text_sort(valueA, valueB, direction) { - return direction === 'asc' ? valueA.localeCompare(valueB) : valueB.localeCompare(valueA); -} -function text_isValid(value, context) { - if (context?.elements) { - const validValues = context?.elements?.map(f => f.value); - if (!validValues.includes(value)) { - return false; - } - } - return true; -} -/* harmony default export */ const field_types_text = ({ - sort: text_sort, - isValid: text_isValid, - Edit: 'text' -}); - -;// ./node_modules/@wordpress/dataviews/build-module/field-types/datetime.js -/** - * Internal dependencies - */ - -function datetime_sort(a, b, direction) { - const timeA = new Date(a).getTime(); - const timeB = new Date(b).getTime(); - return direction === 'asc' ? timeA - timeB : timeB - timeA; -} -function datetime_isValid(value, context) { - if (context?.elements) { - const validValues = context?.elements.map(f => f.value); - if (!validValues.includes(value)) { - return false; - } - } - return true; -} -/* harmony default export */ const datetime = ({ - sort: datetime_sort, - isValid: datetime_isValid, - Edit: 'datetime' -}); - -;// ./node_modules/@wordpress/dataviews/build-module/field-types/index.js -/** - * Internal dependencies - */ - - - - - -/** - * - * @param {FieldType} type The field type definition to get. - * - * @return A field type definition. - */ -function getFieldTypeDefinition(type) { - if ('integer' === type) { - return integer; - } - if ('text' === type) { - return field_types_text; - } - if ('datetime' === type) { - return datetime; - } - return { - sort: (a, b, direction) => { - if (typeof a === 'number' && typeof b === 'number') { - return direction === 'asc' ? a - b : b - a; - } - return direction === 'asc' ? a.localeCompare(b) : b.localeCompare(a); - }, - isValid: (value, context) => { - if (context?.elements) { - const validValues = context?.elements?.map(f => f.value); - if (!validValues.includes(value)) { - return false; - } - } - return true; - }, - Edit: () => null - }; -} - -;// external ["wp","components"] -const external_wp_components_namespaceObject = window["wp"]["components"]; -;// ./node_modules/@wordpress/dataviews/build-module/dataform-controls/datetime.js -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - - -function DateTime({ - data, - field, - onChange, - hideLabelFromVision -}) { - const { - id, - label - } = field; - const value = field.getValue({ - item: data - }); - const onChangeControl = (0,external_wp_element_namespaceObject.useCallback)(newValue => onChange({ - [id]: newValue - }), [id, onChange]); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("fieldset", { - className: "dataviews-controls__datetime", - children: [!hideLabelFromVision && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.BaseControl.VisualLabel, { - as: "legend", - children: label - }), hideLabelFromVision && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, { - as: "legend", - children: label - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TimePicker, { - currentTime: value, - onChange: onChangeControl, - hideLabelFromVision: true - })] - }); -} - -;// ./node_modules/@wordpress/dataviews/build-module/dataform-controls/integer.js -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - -function Integer({ - data, - field, - onChange, - hideLabelFromVision -}) { - var _field$getValue; - const { - id, - label, - description - } = field; - const value = (_field$getValue = field.getValue({ - item: data - })) !== null && _field$getValue !== void 0 ? _field$getValue : ''; - const onChangeControl = (0,external_wp_element_namespaceObject.useCallback)(newValue => onChange({ - [id]: Number(newValue) - }), [id, onChange]); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalNumberControl, { - label: label, - help: description, - value: value, - onChange: onChangeControl, - __next40pxDefaultSize: true, - hideLabelFromVision: hideLabelFromVision - }); -} - -;// ./node_modules/@wordpress/dataviews/build-module/dataform-controls/radio.js -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - -function Radio({ - data, - field, - onChange, - hideLabelFromVision -}) { - const { - id, - label - } = field; - const value = field.getValue({ - item: data - }); - const onChangeControl = (0,external_wp_element_namespaceObject.useCallback)(newValue => onChange({ - [id]: newValue - }), [id, onChange]); - if (field.elements) { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RadioControl, { - label: label, - onChange: onChangeControl, - options: field.elements, - selected: value, - hideLabelFromVision: hideLabelFromVision - }); - } - return null; -} - -;// ./node_modules/@wordpress/dataviews/build-module/dataform-controls/select.js -/** - * WordPress dependencies - */ - - - - -/** - * Internal dependencies - */ - -function Select({ - data, - field, - onChange, - hideLabelFromVision -}) { - var _field$getValue, _field$elements; - const { - id, - label - } = field; - const value = (_field$getValue = field.getValue({ - item: data - })) !== null && _field$getValue !== void 0 ? _field$getValue : ''; - const onChangeControl = (0,external_wp_element_namespaceObject.useCallback)(newValue => onChange({ - [id]: newValue - }), [id, onChange]); - const elements = [ - /* - * Value can be undefined when: - * - * - the field is not required - * - in bulk editing - * - */ - { - label: (0,external_wp_i18n_namespaceObject.__)('Select item'), - value: '' - }, ...((_field$elements = field?.elements) !== null && _field$elements !== void 0 ? _field$elements : [])]; - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { - label: label, - value: value, - options: elements, - onChange: onChangeControl, - __next40pxDefaultSize: true, - __nextHasNoMarginBottom: true, - hideLabelFromVision: hideLabelFromVision - }); -} - -;// ./node_modules/@wordpress/dataviews/build-module/dataform-controls/text.js -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - -function Text({ - data, - field, - onChange, - hideLabelFromVision -}) { - const { - id, - label, - placeholder - } = field; - const value = field.getValue({ - item: data - }); - const onChangeControl = (0,external_wp_element_namespaceObject.useCallback)(newValue => onChange({ - [id]: newValue - }), [id, onChange]); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { - label: label, - placeholder: placeholder, - value: value !== null && value !== void 0 ? value : '', - onChange: onChangeControl, - __next40pxDefaultSize: true, - __nextHasNoMarginBottom: true, - hideLabelFromVision: hideLabelFromVision - }); -} - -;// ./node_modules/@wordpress/dataviews/build-module/dataform-controls/index.js -/** - * External dependencies - */ - -/** - * Internal dependencies - */ - - - - - - -const FORM_CONTROLS = { - datetime: DateTime, - integer: Integer, - radio: Radio, - select: Select, - text: Text -}; -function getControl(field, fieldTypeDefinition) { - if (typeof field.Edit === 'function') { - return field.Edit; - } - if (typeof field.Edit === 'string') { - return getControlByType(field.Edit); - } - if (field.elements) { - return getControlByType('select'); - } - if (typeof fieldTypeDefinition.Edit === 'string') { - return getControlByType(fieldTypeDefinition.Edit); - } - return fieldTypeDefinition.Edit; -} -function getControlByType(type) { - if (Object.keys(FORM_CONTROLS).includes(type)) { - return FORM_CONTROLS[type]; - } - throw 'Control ' + type + ' not found'; -} - -;// ./node_modules/@wordpress/dataviews/build-module/normalize-fields.js -/** - * Internal dependencies - */ - - - -/** - * Apply default values and normalize the fields config. - * - * @param fields Fields config. - * @return Normalized fields config. - */ -function normalizeFields(fields) { - return fields.map(field => { - var _field$sort, _field$isValid, _field$enableHiding, _field$enableSorting; - const fieldTypeDefinition = getFieldTypeDefinition(field.type); - const getValue = field.getValue || (({ - item - }) => item[field.id]); - const sort = (_field$sort = field.sort) !== null && _field$sort !== void 0 ? _field$sort : function sort(a, b, direction) { - return fieldTypeDefinition.sort(getValue({ - item: a - }), getValue({ - item: b - }), direction); - }; - const isValid = (_field$isValid = field.isValid) !== null && _field$isValid !== void 0 ? _field$isValid : function isValid(item, context) { - return fieldTypeDefinition.isValid(getValue({ - item - }), context); - }; - const Edit = getControl(field, fieldTypeDefinition); - const renderFromElements = ({ - item - }) => { - const value = getValue({ - item - }); - return field?.elements?.find(element => element.value === value)?.label || getValue({ - item - }); - }; - const render = field.render || (field.elements ? renderFromElements : getValue); - return { - ...field, - label: field.label || field.id, - header: field.header || field.label || field.id, - getValue, - render, - sort, - isValid, - Edit, - enableHiding: (_field$enableHiding = field.enableHiding) !== null && _field$enableHiding !== void 0 ? _field$enableHiding : true, - enableSorting: (_field$enableSorting = field.enableSorting) !== null && _field$enableSorting !== void 0 ? _field$enableSorting : true - }; - }); -} - -;// ./node_modules/@wordpress/dataviews/build-module/validation.js -/** - * Internal dependencies - */ - -function isItemValid(item, fields, form) { - const _fields = normalizeFields(fields.filter(({ - id - }) => !!form.fields?.includes(id))); - return _fields.every(field => { - return field.isValid(item, { - elements: field.elements - }); - }); -} - -;// ./node_modules/@wordpress/dataviews/build-module/dataforms-layouts/regular/index.js -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - - -function FormRegular({ - data, - fields, - form, - onChange -}) { - const visibleFields = (0,external_wp_element_namespaceObject.useMemo)(() => { - var _form$fields; - return normalizeFields(((_form$fields = form.fields) !== null && _form$fields !== void 0 ? _form$fields : []).map(fieldId => fields.find(({ - id - }) => id === fieldId)).filter(field => !!field)); - }, [fields, form.fields]); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalVStack, { - spacing: 4, - children: visibleFields.map(field => { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(field.Edit, { - data: data, - field: field, - onChange: onChange - }, field.id); - }) - }); -} - -;// ./node_modules/@wordpress/icons/build-module/library/close-small.js -/** - * WordPress dependencies - */ - - -const closeSmall = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.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" - }) -}); -/* harmony default export */ const close_small = (closeSmall); - -;// ./node_modules/@wordpress/dataviews/build-module/dataforms-layouts/panel/index.js -/** - * WordPress dependencies - */ - - - - - -/** - * Internal dependencies - */ - - - - -function DropdownHeader({ - title, - onClose -}) { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalVStack, { - className: "dataforms-layouts-panel__dropdown-header", - spacing: 4, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { - alignment: "center", - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHeading, { - level: 2, - size: 13, - children: title - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalSpacer, {}), onClose && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - label: (0,external_wp_i18n_namespaceObject.__)('Close'), - icon: close_small, - onClick: onClose, - size: "small" - })] - }) - }); -} -function FormField({ - data, - field, - onChange -}) { - // Use internal state instead of a ref to make sure that the component - // re-renders when the popover's anchor updates. - const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null); - // Memoize popoverProps to avoid returning a new object every time. - const popoverProps = (0,external_wp_element_namespaceObject.useMemo)(() => ({ - // Anchor the popover to the middle of the entire row so that it doesn't - // move around when the label changes. - anchor: popoverAnchor, - placement: 'left-start', - offset: 36, - shift: true - }), [popoverAnchor]); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { - ref: setPopoverAnchor, - className: "dataforms-layouts-panel__field", - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { - className: "dataforms-layouts-panel__field-label", - children: field.label - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Dropdown, { - contentClassName: "dataforms-layouts-panel__field-dropdown", - popoverProps: popoverProps, - focusOnMount: true, - toggleProps: { - size: 'compact', - variant: 'tertiary', - tooltipPosition: 'middle left' - }, - renderToggle: ({ - isOpen, - onToggle - }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - className: "dataforms-layouts-panel__field-control", - size: "compact", - variant: "tertiary", - "aria-expanded": isOpen, - "aria-label": (0,external_wp_i18n_namespaceObject.sprintf)( - // translators: %s: Field name. - (0,external_wp_i18n_namespaceObject._x)('Edit %s', 'field'), field.label), - onClick: onToggle, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(field.render, { - item: data - }) - }), - renderContent: ({ - onClose - }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DropdownHeader, { - title: field.label, - onClose: onClose - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(field.Edit, { - data: data, - field: field, - onChange: onChange, - hideLabelFromVision: true - }, field.id)] - }) - }) - })] - }); -} -function FormPanel({ - data, - fields, - form, - onChange -}) { - const visibleFields = (0,external_wp_element_namespaceObject.useMemo)(() => { - var _form$fields; - return normalizeFields(((_form$fields = form.fields) !== null && _form$fields !== void 0 ? _form$fields : []).map(fieldId => fields.find(({ - id - }) => id === fieldId)).filter(field => !!field)); - }, [fields, form.fields]); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalVStack, { - spacing: 2, - children: visibleFields.map(field => { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(FormField, { - data: data, - field: field, - onChange: onChange - }, field.id); - }) - }); -} - -;// ./node_modules/@wordpress/dataviews/build-module/dataforms-layouts/index.js -/** - * Internal dependencies - */ - - -const FORM_LAYOUTS = [{ - type: 'regular', - component: FormRegular -}, { - type: 'panel', - component: FormPanel -}]; -function getFormLayout(type) { - return FORM_LAYOUTS.find(layout => layout.type === type); -} - -;// ./node_modules/@wordpress/dataviews/build-module/components/dataform/index.js -/** - * Internal dependencies - */ - - - -function DataForm({ - form, - ...props -}) { - var _form$type; - const layout = getFormLayout((_form$type = form.type) !== null && _form$type !== void 0 ? _form$type : 'regular'); - if (!layout) { - return null; - } - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(layout.component, { - form: form, - ...props - }); -} - -;// ./node_modules/@wordpress/fields/build-module/actions/base-post/reorder-page.js -/** - * WordPress dependencies - */ - - - - - - - - -/** - * Internal dependencies - */ - - - - -const fields = [order]; -const formOrderAction = { - fields: ['menu_order'] -}; -function ReorderModal({ - items, - closeModal, - onActionPerformed -}) { - const [item, setItem] = (0,external_wp_element_namespaceObject.useState)(items[0]); - const orderInput = item.menu_order; - const { - editEntityRecord, - saveEditedEntityRecord - } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); - const { - createSuccessNotice, - createErrorNotice - } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); - async function onOrder(event) { - event.preventDefault(); - if (!isItemValid(item, fields, formOrderAction)) { - return; - } - try { - await editEntityRecord('postType', item.type, item.id, { - menu_order: orderInput - }); - closeModal?.(); - // Persist edited entity. - await saveEditedEntityRecord('postType', item.type, item.id, { - throwOnError: true - }); - createSuccessNotice((0,external_wp_i18n_namespaceObject.__)('Order updated.'), { - type: 'snackbar' - }); - onActionPerformed?.(items); - } catch (error) { - const typedError = error; - const errorMessage = typedError.message && typedError.code !== 'unknown_error' ? typedError.message : (0,external_wp_i18n_namespaceObject.__)('An error occurred while updating the order'); - createErrorNotice(errorMessage, { - type: 'snackbar' - }); - } - } - const isSaveDisabled = !isItemValid(item, fields, formOrderAction); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("form", { - onSubmit: onOrder, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { - spacing: "5", - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { - children: (0,external_wp_i18n_namespaceObject.__)('Determines the order of pages. Pages with the same order value are sorted alphabetically. Negative order values are supported.') - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataForm, { - data: item, - fields: fields, - form: formOrderAction, - onChange: changes => setItem({ - ...item, - ...changes - }) - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { - justify: "right", - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - __next40pxDefaultSize: true, - variant: "tertiary", - onClick: () => { - closeModal?.(); - }, - children: (0,external_wp_i18n_namespaceObject.__)('Cancel') - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - __next40pxDefaultSize: true, - variant: "primary", - type: "submit", - accessibleWhenDisabled: true, - disabled: isSaveDisabled, - children: (0,external_wp_i18n_namespaceObject.__)('Save') - })] - })] - }) - }); -} -const reorderPage = { - id: 'order-pages', - label: (0,external_wp_i18n_namespaceObject.__)('Order'), - isEligible({ - status - }) { - return status !== 'trash'; - }, - RenderModal: ReorderModal -}; -/* harmony default export */ const reorder_page = (reorderPage); - -;// ./node_modules/@wordpress/fields/build-module/actions/base-post/reorder-page.native.js -const reorder_page_native_reorderPage = undefined; -/* harmony default export */ const reorder_page_native = (reorder_page_native_reorderPage); - -;// ./node_modules/@wordpress/fields/build-module/actions/base-post/duplicate-post.js -/** - * WordPress dependencies - */ - - - - - - - - -/** - * Internal dependencies - */ - - - - -const duplicate_post_fields = [title]; -const formDuplicateAction = { - fields: ['title'] -}; -const duplicatePost = { - id: 'duplicate-post', - label: (0,external_wp_i18n_namespaceObject._x)('Duplicate', 'action label'), - isEligible({ - status - }) { - return status !== 'trash'; - }, - RenderModal: ({ - items, - closeModal, - onActionPerformed - }) => { - const [item, setItem] = (0,external_wp_element_namespaceObject.useState)({ - ...items[0], - title: (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: Existing template title */ - (0,external_wp_i18n_namespaceObject._x)('%s (Copy)', 'template'), getItemTitle(items[0])) - }); - const [isCreatingPage, setIsCreatingPage] = (0,external_wp_element_namespaceObject.useState)(false); - const { - saveEntityRecord - } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); - const { - createSuccessNotice, - createErrorNotice - } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); - async function createPage(event) { - event.preventDefault(); - if (isCreatingPage) { - return; - } - const newItemOject = { - status: 'draft', - title: item.title, - slug: item.title || (0,external_wp_i18n_namespaceObject.__)('No title'), - comment_status: item.comment_status, - content: typeof item.content === 'string' ? item.content : item.content.raw, - excerpt: typeof item.excerpt === 'string' ? item.excerpt : item.excerpt?.raw, - meta: item.meta, - parent: item.parent, - password: item.password, - template: item.template, - format: item.format, - featured_media: item.featured_media, - menu_order: item.menu_order, - ping_status: item.ping_status - }; - const assignablePropertiesPrefix = 'wp:action-assign-'; - // Get all the properties that the current user is able to assign normally author, categories, tags, - // and custom taxonomies. - const assignableProperties = Object.keys(item?._links || {}).filter(property => property.startsWith(assignablePropertiesPrefix)).map(property => property.slice(assignablePropertiesPrefix.length)); - assignableProperties.forEach(property => { - if (item.hasOwnProperty(property)) { - // @ts-ignore - newItemOject[property] = item[property]; - } - }); - setIsCreatingPage(true); - try { - const newItem = await saveEntityRecord('postType', item.type, newItemOject, { - throwOnError: true - }); - createSuccessNotice((0,external_wp_i18n_namespaceObject.sprintf)( - // translators: %s: Title of the created post or template, e.g: "Hello world". - (0,external_wp_i18n_namespaceObject.__)('"%s" successfully created.'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(newItem.title?.rendered || item.title)), { - id: 'duplicate-post-action', - type: 'snackbar' - }); - if (onActionPerformed) { - onActionPerformed([newItem]); - } - } catch (error) { - const typedError = error; - const errorMessage = typedError.message && typedError.code !== 'unknown_error' ? typedError.message : (0,external_wp_i18n_namespaceObject.__)('An error occurred while duplicating the page.'); - createErrorNotice(errorMessage, { - type: 'snackbar' - }); - } finally { - setIsCreatingPage(false); - closeModal?.(); - } - } - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("form", { - onSubmit: createPage, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { - spacing: 3, - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataForm, { - data: item, - fields: duplicate_post_fields, - form: formDuplicateAction, - onChange: changes => setItem(prev => ({ - ...prev, - ...changes - })) - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { - spacing: 2, - justify: "end", - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - variant: "tertiary", - onClick: closeModal, - __next40pxDefaultSize: true, - children: (0,external_wp_i18n_namespaceObject.__)('Cancel') - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - variant: "primary", - type: "submit", - isBusy: isCreatingPage, - "aria-disabled": isCreatingPage, - __next40pxDefaultSize: true, - children: (0,external_wp_i18n_namespaceObject._x)('Duplicate', 'action label') - })] - })] - }) - }); - } -}; -/* harmony default export */ const duplicate_post = (duplicatePost); - -;// ./node_modules/@wordpress/fields/build-module/actions/base-post/duplicate-post.native.js -const duplicate_post_native_duplicatePost = undefined; -/* harmony default export */ const duplicate_post_native = (duplicate_post_native_duplicatePost); - -;// ./node_modules/@wordpress/fields/build-module/actions/base-post/index.js - - - - - - -;// external ["wp","url"] -const external_wp_url_namespaceObject = window["wp"]["url"]; -;// ./node_modules/@wordpress/fields/build-module/actions/common/view-post-revisions.js -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - -const viewPostRevisions = { - id: 'view-post-revisions', - context: 'list', - label(items) { - var _items$0$_links$versi; - const revisionsCount = (_items$0$_links$versi = items[0]._links?.['version-history']?.[0]?.count) !== null && _items$0$_links$versi !== void 0 ? _items$0$_links$versi : 0; - return (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: number of revisions. */ - (0,external_wp_i18n_namespaceObject.__)('View revisions (%s)'), revisionsCount); - }, - isEligible(post) { - var _post$_links$predeces, _post$_links$version; - if (post.status === 'trash') { - return false; - } - const lastRevisionId = (_post$_links$predeces = post?._links?.['predecessor-version']?.[0]?.id) !== null && _post$_links$predeces !== void 0 ? _post$_links$predeces : null; - const revisionsCount = (_post$_links$version = post?._links?.['version-history']?.[0]?.count) !== null && _post$_links$version !== void 0 ? _post$_links$version : 0; - return !!lastRevisionId && revisionsCount > 1; - }, - callback(posts, { - onActionPerformed - }) { - const post = posts[0]; - const href = (0,external_wp_url_namespaceObject.addQueryArgs)('revision.php', { - revision: post?._links?.['predecessor-version']?.[0]?.id - }); - document.location.href = href; - if (onActionPerformed) { - onActionPerformed(posts); - } - } -}; -/* harmony default export */ const view_post_revisions = (viewPostRevisions); - -;// ./node_modules/@wordpress/icons/build-module/library/trash.js -/** - * WordPress dependencies - */ - - -const trash = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M12 5.5A2.25 2.25 0 0 0 9.878 7h4.244A2.251 2.251 0 0 0 12 5.5ZM12 4a3.751 3.751 0 0 0-3.675 3H5v1.5h1.27l.818 8.997a2.75 2.75 0 0 0 2.739 2.501h4.347a2.75 2.75 0 0 0 2.738-2.5L17.73 8.5H19V7h-3.325A3.751 3.751 0 0 0 12 4Zm4.224 4.5H7.776l.806 8.861a1.25 1.25 0 0 0 1.245 1.137h4.347a1.25 1.25 0 0 0 1.245-1.137l.805-8.861Z" - }) -}); -/* harmony default export */ const library_trash = (trash); - -;// ./node_modules/@wordpress/fields/build-module/actions/common/permanently-delete-post.js -/** - * WordPress dependencies - */ - - - - - -/** - * Internal dependencies - */ - -const permanentlyDeletePost = { - id: 'permanently-delete', - label: (0,external_wp_i18n_namespaceObject.__)('Permanently delete'), - supportsBulk: true, - icon: library_trash, - isEligible(item) { - if (isTemplateOrTemplatePart(item) || item.type === 'wp_block') { - return false; - } - const { - status, - permissions - } = item; - return status === 'trash' && permissions?.delete; - }, - async callback(posts, { - registry, - onActionPerformed - }) { - const { - createSuccessNotice, - createErrorNotice - } = registry.dispatch(external_wp_notices_namespaceObject.store); - const { - deleteEntityRecord - } = registry.dispatch(external_wp_coreData_namespaceObject.store); - const promiseResult = await Promise.allSettled(posts.map(post => { - return deleteEntityRecord('postType', post.type, post.id, { - force: true - }, { - throwOnError: true - }); - })); - // If all the promises were fulfilled with success. - if (promiseResult.every(({ - status - }) => status === 'fulfilled')) { - let successMessage; - if (promiseResult.length === 1) { - successMessage = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: The posts's title. */ - (0,external_wp_i18n_namespaceObject.__)('"%s" permanently deleted.'), getItemTitle(posts[0])); - } else { - successMessage = (0,external_wp_i18n_namespaceObject.__)('The items were permanently deleted.'); - } - createSuccessNotice(successMessage, { - type: 'snackbar', - id: 'permanently-delete-post-action' - }); - onActionPerformed?.(posts); - } else { - // If there was at lease one failure. - let errorMessage; - // If we were trying to permanently delete a single post. - if (promiseResult.length === 1) { - const typedError = promiseResult[0]; - if (typedError.reason?.message) { - errorMessage = typedError.reason.message; - } else { - errorMessage = (0,external_wp_i18n_namespaceObject.__)('An error occurred while permanently deleting the item.'); - } - // If we were trying to permanently delete multiple posts - } else { - const errorMessages = new Set(); - const failedPromises = promiseResult.filter(({ - status - }) => status === 'rejected'); - for (const failedPromise of failedPromises) { - const typedError = failedPromise; - if (typedError.reason?.message) { - errorMessages.add(typedError.reason.message); - } - } - if (errorMessages.size === 0) { - errorMessage = (0,external_wp_i18n_namespaceObject.__)('An error occurred while permanently deleting the items.'); - } else if (errorMessages.size === 1) { - errorMessage = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: an error message */ - (0,external_wp_i18n_namespaceObject.__)('An error occurred while permanently deleting the items: %s'), [...errorMessages][0]); - } else { - errorMessage = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: a list of comma separated error messages */ - (0,external_wp_i18n_namespaceObject.__)('Some errors occurred while permanently deleting the items: %s'), [...errorMessages].join(',')); - } - } - createErrorNotice(errorMessage, { - type: 'snackbar' - }); - } - } -}; -/* harmony default export */ const permanently_delete_post = (permanentlyDeletePost); - -;// ./node_modules/@wordpress/fields/build-module/actions/common/index.js - - - -;// external ["wp","patterns"] -const external_wp_patterns_namespaceObject = window["wp"]["patterns"]; -;// external ["wp","privateApis"] -const external_wp_privateApis_namespaceObject = window["wp"]["privateApis"]; -;// ./node_modules/@wordpress/fields/build-module/lock-unlock.js -/** - * WordPress dependencies - */ - -const { - lock, - unlock -} = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/fields'); - -;// ./node_modules/@wordpress/fields/build-module/actions/pattern/duplicate-pattern.js -/** - * WordPress dependencies - */ - -// @ts-ignore - -/** - * Internal dependencies - */ - - -// Patterns. -const { - CreatePatternModalContents, - useDuplicatePatternProps -} = unlock(external_wp_patterns_namespaceObject.privateApis); -const duplicatePattern = { - id: 'duplicate-pattern', - label: (0,external_wp_i18n_namespaceObject._x)('Duplicate', 'action label'), - isEligible: item => item.type !== 'wp_template_part', - modalHeader: (0,external_wp_i18n_namespaceObject._x)('Duplicate pattern', 'action label'), - RenderModal: ({ - items, - closeModal - }) => { - const [item] = items; - const duplicatedProps = useDuplicatePatternProps({ - pattern: item, - onSuccess: () => closeModal?.() - }); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CreatePatternModalContents, { - onClose: closeModal, - confirmLabel: (0,external_wp_i18n_namespaceObject._x)('Duplicate', 'action label'), - ...duplicatedProps - }); - } -}; -/* harmony default export */ const duplicate_pattern = (duplicatePattern); - -;// ./node_modules/tslib/tslib.es6.mjs -/****************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global Reflect, Promise, SuppressedError, Symbol, Iterator */ - -var extendStatics = function(d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); -}; - -function __extends(d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -} - -var __assign = function() { - __assign = Object.assign || function __assign(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - } - return __assign.apply(this, arguments); -} - -function __rest(s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; -} - -function __decorate(decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -} - -function __param(paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -} - -function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } - else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; -}; - -function __runInitializers(thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; -}; - -function __propKey(x) { - return typeof x === "symbol" ? x : "".concat(x); -}; - -function __setFunctionName(f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); -}; - -function __metadata(metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); -} - -function __awaiter(thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} - -function __generator(thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); - return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -} - -var __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -}); - -function __exportStar(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); -} - -function __values(o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); -} - -function __read(o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; -} - -/** @deprecated */ -function __spread() { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; -} - -/** @deprecated */ -function __spreadArrays() { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; -} - -function __spreadArray(to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); -} - -function __await(v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); -} - -function __asyncGenerator(thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i; - function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; } - function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } -} - -function __asyncDelegator(o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } -} - -function __asyncValues(o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } -} - -function __makeTemplateObject(cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; -}; - -var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}; - -function __importStar(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -} - -function __importDefault(mod) { - return (mod && mod.__esModule) ? mod : { default: mod }; -} - -function __classPrivateFieldGet(receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); -} - -function __classPrivateFieldSet(receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; -} - -function __classPrivateFieldIn(state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); -} - -function __addDisposableResource(env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose, inner; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - if (async) inner = dispose; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } }; - env.stack.push({ value: value, dispose: dispose, async: async }); - } - else if (async) { - env.stack.push({ async: true }); - } - return value; -} - -var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; -}; - -function __disposeResources(env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - var r, s = 0; - function next() { - while (r = env.stack.pop()) { - try { - if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next); - if (r.dispose) { - var result = r.dispose.call(r.value); - if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); - } - else s |= 1; - } - catch (e) { - fail(e); - } - } - if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); - if (env.hasError) throw env.error; - } - return next(); -} - -/* harmony default export */ const tslib_es6 = ({ - __extends, - __assign, - __rest, - __decorate, - __param, - __metadata, - __awaiter, - __generator, - __createBinding, - __exportStar, - __values, - __read, - __spread, - __spreadArrays, - __spreadArray, - __await, - __asyncGenerator, - __asyncDelegator, - __asyncValues, - __makeTemplateObject, - __importStar, - __importDefault, - __classPrivateFieldGet, - __classPrivateFieldSet, - __classPrivateFieldIn, - __addDisposableResource, - __disposeResources, -}); - -;// ./node_modules/lower-case/dist.es2015/index.js -/** - * Source: ftp://ftp.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt - */ -var SUPPORTED_LOCALE = { - tr: { - regexp: /\u0130|\u0049|\u0049\u0307/g, - map: { - İ: "\u0069", - I: "\u0131", - İ: "\u0069", - }, - }, - az: { - regexp: /\u0130/g, - map: { - İ: "\u0069", - I: "\u0131", - İ: "\u0069", - }, - }, - lt: { - regexp: /\u0049|\u004A|\u012E|\u00CC|\u00CD|\u0128/g, - map: { - I: "\u0069\u0307", - J: "\u006A\u0307", - Į: "\u012F\u0307", - Ì: "\u0069\u0307\u0300", - Í: "\u0069\u0307\u0301", - Ĩ: "\u0069\u0307\u0303", - }, - }, -}; -/** - * Localized lower case. - */ -function localeLowerCase(str, locale) { - var lang = SUPPORTED_LOCALE[locale.toLowerCase()]; - if (lang) - return lowerCase(str.replace(lang.regexp, function (m) { return lang.map[m]; })); - return lowerCase(str); -} -/** - * Lower case as a function. - */ -function lowerCase(str) { - return str.toLowerCase(); -} - -;// ./node_modules/no-case/dist.es2015/index.js - -// Support camel case ("camelCase" -> "camel Case" and "CAMELCase" -> "CAMEL Case"). -var DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g]; -// Remove all non-word characters. -var DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi; -/** - * Normalize the string into something other libraries can manipulate easier. - */ -function noCase(input, options) { - if (options === void 0) { options = {}; } - var _a = options.splitRegexp, splitRegexp = _a === void 0 ? DEFAULT_SPLIT_REGEXP : _a, _b = options.stripRegexp, stripRegexp = _b === void 0 ? DEFAULT_STRIP_REGEXP : _b, _c = options.transform, transform = _c === void 0 ? lowerCase : _c, _d = options.delimiter, delimiter = _d === void 0 ? " " : _d; - var result = replace(replace(input, splitRegexp, "$1\0$2"), stripRegexp, "\0"); - var start = 0; - var end = result.length; - // Trim the delimiter from around the output string. - while (result.charAt(start) === "\0") - start++; - while (result.charAt(end - 1) === "\0") - end--; - // Transform each token independently. - return result.slice(start, end).split("\0").map(transform).join(delimiter); -} -/** - * Replace `re` in the input string with the replacement value. - */ -function replace(input, re, value) { - if (re instanceof RegExp) - return input.replace(re, value); - return re.reduce(function (input, re) { return input.replace(re, value); }, input); -} - -;// ./node_modules/dot-case/dist.es2015/index.js - - -function dotCase(input, options) { - if (options === void 0) { options = {}; } - return noCase(input, __assign({ delimiter: "." }, options)); -} - -;// ./node_modules/param-case/dist.es2015/index.js - - -function paramCase(input, options) { - if (options === void 0) { options = {}; } - return dotCase(input, __assign({ delimiter: "-" }, options)); -} - -;// ./node_modules/client-zip/index.js -"stream"in Blob.prototype||Object.defineProperty(Blob.prototype,"stream",{value(){return new Response(this).body}}),"setBigUint64"in DataView.prototype||Object.defineProperty(DataView.prototype,"setBigUint64",{value(e,n,t){const i=Number(0xffffffffn&n),r=Number(n>>32n);this.setUint32(e+(t?0:4),i,t),this.setUint32(e+(t?4:0),r,t)}});var e=e=>new DataView(new ArrayBuffer(e)),n=e=>new Uint8Array(e.buffer||e),t=e=>(new TextEncoder).encode(String(e)),i=e=>Math.min(4294967295,Number(e)),r=e=>Math.min(65535,Number(e));function f(e,i){if(void 0===i||i instanceof Date||(i=new Date(i)),e instanceof File)return{isFile:1,t:i||new Date(e.lastModified),i:e.stream()};if(e instanceof Response)return{isFile:1,t:i||new Date(e.headers.get("Last-Modified")||Date.now()),i:e.body};if(void 0===i)i=new Date;else if(isNaN(i))throw new Error("Invalid modification date.");if(void 0===e)return{isFile:0,t:i};if("string"==typeof e)return{isFile:1,t:i,i:t(e)};if(e instanceof Blob)return{isFile:1,t:i,i:e.stream()};if(e instanceof Uint8Array||e instanceof ReadableStream)return{isFile:1,t:i,i:e};if(e instanceof ArrayBuffer||ArrayBuffer.isView(e))return{isFile:1,t:i,i:n(e)};if(Symbol.asyncIterator in e)return{isFile:1,t:i,i:o(e[Symbol.asyncIterator]())};throw new TypeError("Unsupported input format.")}function o(e,n=e){return new ReadableStream({async pull(n){let t=0;for(;n.desiredSize>t;){const i=await e.next();if(!i.value){n.close();break}{const e=a(i.value);n.enqueue(e),t+=e.byteLength}}},cancel(e){n.throw?.(e)}})}function a(e){return"string"==typeof e?t(e):e instanceof Uint8Array?e:n(e)}function s(e,i,r){let[f,o]=function(e){return e?e instanceof Uint8Array?[e,1]:ArrayBuffer.isView(e)||e instanceof ArrayBuffer?[n(e),1]:[t(e),0]:[void 0,0]}(i);if(e instanceof File)return{o:d(f||t(e.name)),u:BigInt(e.size),l:o};if(e instanceof Response){const n=e.headers.get("content-disposition"),i=n&&n.match(/;\s*filename\*?\s*=\s*(?:UTF-\d+''|)["']?([^;"'\r\n]*)["']?(?:;|$)/i),a=i&&i[1]||e.url&&new URL(e.url).pathname.split("/").findLast(Boolean),s=a&&decodeURIComponent(a),u=r||+e.headers.get("content-length");return{o:d(f||t(s)),u:BigInt(u),l:o}}return f=d(f,void 0!==e||void 0!==r),"string"==typeof e?{o:f,u:BigInt(t(e).length),l:o}:e instanceof Blob?{o:f,u:BigInt(e.size),l:o}:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?{o:f,u:BigInt(e.byteLength),l:o}:{o:f,u:u(e,r),l:o}}function u(e,n){return n>-1?BigInt(n):e?void 0:0n}function d(e,n=1){if(!e||e.every((c=>47===c)))throw new Error("The file must have a name.");if(n)for(;47===e[e.length-1];)e=e.subarray(0,-1);else 47!==e[e.length-1]&&(e=new Uint8Array([...e,47]));return e}var l=new Uint32Array(256);for(let e=0;e<256;++e){let n=e;for(let e=0;e<8;++e)n=n>>>1^(1&n&&3988292384);l[e]=n}function y(e,n=0){n^=-1;for(var t=0,i=e.length;t>>8^l[255&n^e[t]];return(-1^n)>>>0}function w(e,n,t=0){const i=e.getSeconds()>>1|e.getMinutes()<<5|e.getHours()<<11,r=e.getDate()|e.getMonth()+1<<5|e.getFullYear()-1980<<9;n.setUint16(t,i,1),n.setUint16(t+2,r,1)}function B({o:e,l:n},t){return 8*(!n||(t??function(e){try{b.decode(e)}catch{return 0}return 1}(e)))}var b=new TextDecoder("utf8",{fatal:1});function p(t,i=0){const r=e(30);return r.setUint32(0,1347093252),r.setUint32(4,754976768|i),w(t.t,r,10),r.setUint16(26,t.o.length,1),n(r)}async function*g(e){let{i:n}=e;if("then"in n&&(n=await n),n instanceof Uint8Array)yield n,e.m=y(n,0),e.u=BigInt(n.length);else{e.u=0n;const t=n.getReader();for(;;){const{value:n,done:i}=await t.read();if(i)break;e.m=y(n,e.m),e.u+=BigInt(n.length),yield n}}}function I(t,r){const f=e(16+(r?8:0));return f.setUint32(0,1347094280),f.setUint32(4,t.isFile?t.m:0,1),r?(f.setBigUint64(8,t.u,1),f.setBigUint64(16,t.u,1)):(f.setUint32(8,i(t.u),1),f.setUint32(12,i(t.u),1)),n(f)}function v(t,r,f=0,o=0){const a=e(46);return a.setUint32(0,1347092738),a.setUint32(4,755182848),a.setUint16(8,2048|f),w(t.t,a,12),a.setUint32(16,t.isFile?t.m:0,1),a.setUint32(20,i(t.u),1),a.setUint32(24,i(t.u),1),a.setUint16(28,t.o.length,1),a.setUint16(30,o,1),a.setUint16(40,t.isFile?33204:16893,1),a.setUint32(42,i(r),1),n(a)}function h(t,i,r){const f=e(r);return f.setUint16(0,1,1),f.setUint16(2,r-4,1),16&r&&(f.setBigUint64(4,t.u,1),f.setBigUint64(12,t.u,1)),f.setBigUint64(r-8,i,1),n(f)}function D(e){return e instanceof File||e instanceof Response?[[e],[e]]:[[e.input,e.name,e.size],[e.input,e.lastModified]]}var S=e=>function(e){let n=BigInt(22),t=0n,i=0;for(const r of e){if(!r.o)throw new Error("Every file must have a non-empty name.");if(void 0===r.u)throw new Error(`Missing size for file "${(new TextDecoder).decode(r.o)}".`);const e=r.u>=0xffffffffn,f=t>=0xffffffffn;t+=BigInt(46+r.o.length+(e&&8))+r.u,n+=BigInt(r.o.length+46+(12*f|28*e)),i||(i=e)}return(i||t>=0xffffffffn)&&(n+=BigInt(76)),n+t}(function*(e){for(const n of e)yield s(...D(n)[0])}(e));function A(e,n={}){const t={"Content-Type":"application/zip","Content-Disposition":"attachment"};return("bigint"==typeof n.length||Number.isInteger(n.length))&&n.length>0&&(t["Content-Length"]=String(n.length)),n.metadata&&(t["Content-Length"]=String(S(n.metadata))),new Response(N(e,n),{headers:t})}function N(t,a={}){const u=function(e){const n=e[Symbol.iterator in e?Symbol.iterator:Symbol.asyncIterator]();return{async next(){const e=await n.next();if(e.done)return e;const[t,i]=D(e.value);return{done:0,value:Object.assign(f(...i),s(...t))}},throw:n.throw?.bind(n),[Symbol.asyncIterator](){return this}}}(t);return o(async function*(t,f){const o=[];let a=0n,s=0n,u=0;for await(const e of t){const n=B(e,f.buffersAreUTF8);yield p(e,n),yield new Uint8Array(e.o),e.isFile&&(yield*g(e));const t=e.u>=0xffffffffn,i=12*(a>=0xffffffffn)|28*t;yield I(e,t),o.push(v(e,a,n,i)),o.push(e.o),i&&o.push(h(e,a,i)),t&&(a+=8n),s++,a+=BigInt(46+e.o.length)+e.u,u||(u=t)}let d=0n;for(const e of o)yield e,d+=BigInt(e.length);if(u||a>=0xffffffffn){const t=e(76);t.setUint32(0,1347094022),t.setBigUint64(4,BigInt(44),1),t.setUint32(12,755182848),t.setBigUint64(24,s,1),t.setBigUint64(32,s,1),t.setBigUint64(40,d,1),t.setBigUint64(48,a,1),t.setUint32(56,1347094023),t.setBigUint64(64,a+d,1),t.setUint32(72,1,1),yield n(t)}const l=e(22);l.setUint32(0,1347093766),l.setUint16(8,r(s),1),l.setUint16(10,r(s),1),l.setUint32(12,i(d),1),l.setUint32(16,i(a),1),yield n(l)}(u,a),u)} -;// external ["wp","blob"] -const external_wp_blob_namespaceObject = window["wp"]["blob"]; -;// ./node_modules/@wordpress/icons/build-module/library/download.js -/** - * WordPress dependencies - */ - - -const download = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - d: "M18 11.3l-1-1.1-4 4V3h-1.5v11.3L7 10.2l-1 1.1 6.2 5.8 5.8-5.8zm.5 3.7v3.5h-13V15H4v5h16v-5h-1.5z" - }) -}); -/* harmony default export */ const library_download = (download); - -;// ./node_modules/@wordpress/fields/build-module/actions/pattern/export-pattern.js -/** - * External dependencies - */ - - - -/** - * WordPress dependencies - */ - - - - -/** - * Internal dependencies - */ - - -function getJsonFromItem(item) { - return JSON.stringify({ - __file: item.type, - title: getItemTitle(item), - content: typeof item.content === 'string' ? item.content : item.content?.raw, - syncStatus: item.wp_pattern_sync_status - }, null, 2); -} -const exportPattern = { - id: 'export-pattern', - label: (0,external_wp_i18n_namespaceObject.__)('Export as JSON'), - icon: library_download, - supportsBulk: true, - isEligible: item => item.type === 'wp_block', - callback: async items => { - if (items.length === 1) { - return (0,external_wp_blob_namespaceObject.downloadBlob)(`${paramCase(getItemTitle(items[0]) || items[0].slug)}.json`, getJsonFromItem(items[0]), 'application/json'); - } - const nameCount = {}; - const filesToZip = items.map(item => { - const name = paramCase(getItemTitle(item) || item.slug); - nameCount[name] = (nameCount[name] || 0) + 1; - return { - name: `${name + (nameCount[name] > 1 ? '-' + (nameCount[name] - 1) : '')}.json`, - lastModified: new Date(), - input: getJsonFromItem(item) - }; - }); - return (0,external_wp_blob_namespaceObject.downloadBlob)((0,external_wp_i18n_namespaceObject.__)('patterns-export') + '.zip', await A(filesToZip).blob(), 'application/zip'); - } -}; -/* harmony default export */ const export_pattern = (exportPattern); - -;// ./node_modules/@wordpress/fields/build-module/actions/pattern/export-pattern.native.js -const export_pattern_native_exportPattern = undefined; -/* harmony default export */ const export_pattern_native = (export_pattern_native_exportPattern); - -;// ./node_modules/@wordpress/fields/build-module/actions/pattern/index.js - - - - -;// ./node_modules/@wordpress/fields/build-module/actions/index.js - - - - -;// ./node_modules/@wordpress/fields/build-module/index.js - - - -(window.wp = window.wp || {}).fields = __webpack_exports__; -/******/ })() -; \ No newline at end of file diff --git a/wp-includes/js/dist/fields.min.js b/wp-includes/js/dist/fields.min.js deleted file mode 100644 index b195f3df85..0000000000 --- a/wp-includes/js/dist/fields.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! This file is auto-generated */ -(()=>{"use strict";var e={d:(t,n)=>{for(var i in n)e.o(n,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:n[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{duplicatePattern:()=>q,duplicatePost:()=>M,duplicatePostNative:()=>L,exportPattern:()=>Ee,exportPatternNative:()=>De,orderField:()=>l,permanentlyDeletePost:()=>T,reorderPage:()=>P,reorderPageNative:()=>A,titleField:()=>s,viewPost:()=>f,viewPostRevisions:()=>z});const n=window.wp.i18n,i=window.wp.htmlEntities,r="wp_template",o="wp_template_part";function a(e){return"string"==typeof e.title?(0,i.decodeEntities)(e.title):"rendered"in e.title?(0,i.decodeEntities)(e.title.rendered):"raw"in e.title?(0,i.decodeEntities)(e.title.raw):""}const s={type:"text",id:"title",label:(0,n.__)("Title"),placeholder:(0,n.__)("No title"),getValue:({item:e})=>a(e)},l={type:"integer",id:"menu_order",label:(0,n.__)("Order"),description:(0,n.__)("Determines the order of pages.")},c=window.wp.primitives,d=window.ReactJSXRuntime,u=(0,d.jsx)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(c.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"})}),f={id:"view-post",label:(0,n._x)("View","verb"),isPrimary:!0,icon:u,isEligible:e=>"trash"!==e.status,callback(e,{onActionPerformed:t}){const n=e[0];window.open(n?.link,"_blank"),t&&t(e)}},p=window.wp.data,m=window.wp.coreData,g=window.wp.notices,h=window.wp.element;const w={sort:function(e,t,n){return"asc"===n?e-t:t-e},isValid:function(e,t){if(""===e)return!1;if(!Number.isInteger(Number(e)))return!1;if(t?.elements){const n=t?.elements.map((e=>e.value));if(!n.includes(Number(e)))return!1}return!0},Edit:"integer"};const y={sort:function(e,t,n){return"asc"===n?e.localeCompare(t):t.localeCompare(e)},isValid:function(e,t){if(t?.elements){const n=t?.elements?.map((e=>e.value));if(!n.includes(e))return!1}return!0},Edit:"text"};const _={sort:function(e,t,n){const i=new Date(e).getTime(),r=new Date(t).getTime();return"asc"===n?i-r:r-i},isValid:function(e,t){if(t?.elements){const n=t?.elements.map((e=>e.value));if(!n.includes(e))return!1}return!0},Edit:"datetime"};const b=window.wp.components;const v={datetime:function({data:e,field:t,onChange:n,hideLabelFromVision:i}){const{id:r,label:o}=t,a=t.getValue({item:e}),s=(0,h.useCallback)((e=>n({[r]:e})),[r,n]);return(0,d.jsxs)("fieldset",{className:"dataviews-controls__datetime",children:[!i&&(0,d.jsx)(b.BaseControl.VisualLabel,{as:"legend",children:o}),i&&(0,d.jsx)(b.VisuallyHidden,{as:"legend",children:o}),(0,d.jsx)(b.TimePicker,{currentTime:a,onChange:s,hideLabelFromVision:!0})]})},integer:function({data:e,field:t,onChange:n,hideLabelFromVision:i}){var r;const{id:o,label:a,description:s}=t,l=null!==(r=t.getValue({item:e}))&&void 0!==r?r:"",c=(0,h.useCallback)((e=>n({[o]:Number(e)})),[o,n]);return(0,d.jsx)(b.__experimentalNumberControl,{label:a,help:s,value:l,onChange:c,__next40pxDefaultSize:!0,hideLabelFromVision:i})},radio:function({data:e,field:t,onChange:n,hideLabelFromVision:i}){const{id:r,label:o}=t,a=t.getValue({item:e}),s=(0,h.useCallback)((e=>n({[r]:e})),[r,n]);return t.elements?(0,d.jsx)(b.RadioControl,{label:o,onChange:s,options:t.elements,selected:a,hideLabelFromVision:i}):null},select:function({data:e,field:t,onChange:i,hideLabelFromVision:r}){var o,a;const{id:s,label:l}=t,c=null!==(o=t.getValue({item:e}))&&void 0!==o?o:"",u=(0,h.useCallback)((e=>i({[s]:e})),[s,i]),f=[{label:(0,n.__)("Select item"),value:""},...null!==(a=t?.elements)&&void 0!==a?a:[]];return(0,d.jsx)(b.SelectControl,{label:l,value:c,options:f,onChange:u,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,hideLabelFromVision:r})},text:function({data:e,field:t,onChange:n,hideLabelFromVision:i}){const{id:r,label:o,placeholder:a}=t,s=t.getValue({item:e}),l=(0,h.useCallback)((e=>n({[r]:e})),[r,n]);return(0,d.jsx)(b.TextControl,{label:o,placeholder:a,value:null!=s?s:"",onChange:l,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,hideLabelFromVision:i})}};function x(e){if(Object.keys(v).includes(e))return v[e];throw"Control "+e+" not found"}function j(e){return e.map((e=>{var t,n,i,r;const o="integer"===(a=e.type)?w:"text"===a?y:"datetime"===a?_:{sort:(e,t,n)=>"number"==typeof e&&"number"==typeof t?"asc"===n?e-t:t-e:"asc"===n?e.localeCompare(t):t.localeCompare(e),isValid:(e,t)=>{if(t?.elements){const n=t?.elements?.map((e=>e.value));if(!n.includes(e))return!1}return!0},Edit:()=>null};var a;const s=e.getValue||(({item:t})=>t[e.id]),l=null!==(t=e.sort)&&void 0!==t?t:function(e,t,n){return o.sort(s({item:e}),s({item:t}),n)},c=null!==(n=e.isValid)&&void 0!==n?n:function(e,t){return o.isValid(s({item:e}),t)},d=function(e,t){return"function"==typeof e.Edit?e.Edit:"string"==typeof e.Edit?x(e.Edit):e.elements?x("select"):"string"==typeof t.Edit?x(t.Edit):t.Edit}(e,o),u=e.render||(e.elements?({item:t})=>{const n=s({item:t});return e?.elements?.find((e=>e.value===n))?.label||s({item:t})}:s);return{...e,label:e.label||e.id,header:e.header||e.label||e.id,getValue:s,render:u,sort:l,isValid:c,Edit:d,enableHiding:null===(i=e.enableHiding)||void 0===i||i,enableSorting:null===(r=e.enableSorting)||void 0===r||r}}))}function S(e,t,n){return j(t.filter((({id:e})=>!!n.fields?.includes(e)))).every((t=>t.isValid(e,{elements:t.elements})))}const U=(0,d.jsx)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(c.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"})});function B({title:e,onClose:t}){return(0,d.jsx)(b.__experimentalVStack,{className:"dataforms-layouts-panel__dropdown-header",spacing:4,children:(0,d.jsxs)(b.__experimentalHStack,{alignment:"center",children:[(0,d.jsx)(b.__experimentalHeading,{level:2,size:13,children:e}),(0,d.jsx)(b.__experimentalSpacer,{}),t&&(0,d.jsx)(b.Button,{label:(0,n.__)("Close"),icon:U,onClick:t,size:"small"})]})})}function C({data:e,field:t,onChange:i}){const[r,o]=(0,h.useState)(null),a=(0,h.useMemo)((()=>({anchor:r,placement:"left-start",offset:36,shift:!0})),[r]);return(0,d.jsxs)(b.__experimentalHStack,{ref:o,className:"dataforms-layouts-panel__field",children:[(0,d.jsx)("div",{className:"dataforms-layouts-panel__field-label",children:t.label}),(0,d.jsx)("div",{children:(0,d.jsx)(b.Dropdown,{contentClassName:"dataforms-layouts-panel__field-dropdown",popoverProps:a,focusOnMount:!0,toggleProps:{size:"compact",variant:"tertiary",tooltipPosition:"middle left"},renderToggle:({isOpen:i,onToggle:r})=>(0,d.jsx)(b.Button,{className:"dataforms-layouts-panel__field-control",size:"compact",variant:"tertiary","aria-expanded":i,"aria-label":(0,n.sprintf)((0,n._x)("Edit %s","field"),t.label),onClick:r,children:(0,d.jsx)(t.render,{item:e})}),renderContent:({onClose:n})=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(B,{title:t.label,onClose:n}),(0,d.jsx)(t.Edit,{data:e,field:t,onChange:i,hideLabelFromVision:!0},t.id)]})})})]})}const V=[{type:"regular",component:function({data:e,fields:t,form:n,onChange:i}){const r=(0,h.useMemo)((()=>{var e;return j((null!==(e=n.fields)&&void 0!==e?e:[]).map((e=>t.find((({id:t})=>t===e)))).filter((e=>!!e)))}),[t,n.fields]);return(0,d.jsx)(b.__experimentalVStack,{spacing:4,children:r.map((t=>(0,d.jsx)(t.Edit,{data:e,field:t,onChange:i},t.id)))})}},{type:"panel",component:function({data:e,fields:t,form:n,onChange:i}){const r=(0,h.useMemo)((()=>{var e;return j((null!==(e=n.fields)&&void 0!==e?e:[]).map((e=>t.find((({id:t})=>t===e)))).filter((e=>!!e)))}),[t,n.fields]);return(0,d.jsx)(b.__experimentalVStack,{spacing:2,children:r.map((t=>(0,d.jsx)(C,{data:e,field:t,onChange:i},t.id)))})}}];function k({form:e,...t}){var n;const i=(r=null!==(n=e.type)&&void 0!==n?n:"regular",V.find((e=>e.type===r)));var r;return i?(0,d.jsx)(i.component,{form:e,...t}):null}const E=[l],D={fields:["menu_order"]};const P={id:"order-pages",label:(0,n.__)("Order"),isEligible:({status:e})=>"trash"!==e,RenderModal:function({items:e,closeModal:t,onActionPerformed:i}){const[r,o]=(0,h.useState)(e[0]),a=r.menu_order,{editEntityRecord:s,saveEditedEntityRecord:l}=(0,p.useDispatch)(m.store),{createSuccessNotice:c,createErrorNotice:u}=(0,p.useDispatch)(g.store),f=!S(r,E,D);return(0,d.jsx)("form",{onSubmit:async function(o){if(o.preventDefault(),S(r,E,D))try{await s("postType",r.type,r.id,{menu_order:a}),t?.(),await l("postType",r.type,r.id,{throwOnError:!0}),c((0,n.__)("Order updated."),{type:"snackbar"}),i?.(e)}catch(e){const t=e,i=t.message&&"unknown_error"!==t.code?t.message:(0,n.__)("An error occurred while updating the order");u(i,{type:"snackbar"})}},children:(0,d.jsxs)(b.__experimentalVStack,{spacing:"5",children:[(0,d.jsx)("div",{children:(0,n.__)("Determines the order of pages. Pages with the same order value are sorted alphabetically. Negative order values are supported.")}),(0,d.jsx)(k,{data:r,fields:E,form:D,onChange:e=>o({...r,...e})}),(0,d.jsxs)(b.__experimentalHStack,{justify:"right",children:[(0,d.jsx)(b.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>{t?.()},children:(0,n.__)("Cancel")}),(0,d.jsx)(b.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",accessibleWhenDisabled:!0,disabled:f,children:(0,n.__)("Save")})]})]})})}},A=undefined,N=[s],F={fields:["title"]},M={id:"duplicate-post",label:(0,n._x)("Duplicate","action label"),isEligible:({status:e})=>"trash"!==e,RenderModal:({items:e,closeModal:t,onActionPerformed:r})=>{const[o,s]=(0,h.useState)({...e[0],title:(0,n.sprintf)((0,n._x)("%s (Copy)","template"),a(e[0]))}),[l,c]=(0,h.useState)(!1),{saveEntityRecord:u}=(0,p.useDispatch)(m.store),{createSuccessNotice:f,createErrorNotice:w}=(0,p.useDispatch)(g.store);return(0,d.jsx)("form",{onSubmit:async function(e){if(e.preventDefault(),l)return;const a={status:"draft",title:o.title,slug:o.title||(0,n.__)("No title"),comment_status:o.comment_status,content:"string"==typeof o.content?o.content:o.content.raw,excerpt:"string"==typeof o.excerpt?o.excerpt:o.excerpt?.raw,meta:o.meta,parent:o.parent,password:o.password,template:o.template,format:o.format,featured_media:o.featured_media,menu_order:o.menu_order,ping_status:o.ping_status},s="wp:action-assign-";Object.keys(o?._links||{}).filter((e=>e.startsWith(s))).map((e=>e.slice(17))).forEach((e=>{o.hasOwnProperty(e)&&(a[e]=o[e])})),c(!0);try{const e=await u("postType",o.type,a,{throwOnError:!0});f((0,n.sprintf)((0,n.__)('"%s" successfully created.'),(0,i.decodeEntities)(e.title?.rendered||o.title)),{id:"duplicate-post-action",type:"snackbar"}),r&&r([e])}catch(e){const t=e,i=t.message&&"unknown_error"!==t.code?t.message:(0,n.__)("An error occurred while duplicating the page.");w(i,{type:"snackbar"})}finally{c(!1),t?.()}},children:(0,d.jsxs)(b.__experimentalVStack,{spacing:3,children:[(0,d.jsx)(k,{data:o,fields:N,form:F,onChange:e=>s((t=>({...t,...e})))}),(0,d.jsxs)(b.__experimentalHStack,{spacing:2,justify:"end",children:[(0,d.jsx)(b.Button,{variant:"tertiary",onClick:t,__next40pxDefaultSize:!0,children:(0,n.__)("Cancel")}),(0,d.jsx)(b.Button,{variant:"primary",type:"submit",isBusy:l,"aria-disabled":l,__next40pxDefaultSize:!0,children:(0,n._x)("Duplicate","action label")})]})]})})}},L=undefined,O=window.wp.url,z={id:"view-post-revisions",context:"list",label(e){var t;const i=null!==(t=e[0]._links?.["version-history"]?.[0]?.count)&&void 0!==t?t:0;return(0,n.sprintf)((0,n.__)("View revisions (%s)"),i)},isEligible(e){var t,n;if("trash"===e.status)return!1;const i=null!==(t=e?._links?.["predecessor-version"]?.[0]?.id)&&void 0!==t?t:null,r=null!==(n=e?._links?.["version-history"]?.[0]?.count)&&void 0!==n?n:0;return!!i&&r>1},callback(e,{onActionPerformed:t}){const n=e[0],i=(0,O.addQueryArgs)("revision.php",{revision:n?._links?.["predecessor-version"]?.[0]?.id});document.location.href=i,t&&t(e)}},I=(0,d.jsx)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(c.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 5.5A2.25 2.25 0 0 0 9.878 7h4.244A2.251 2.251 0 0 0 12 5.5ZM12 4a3.751 3.751 0 0 0-3.675 3H5v1.5h1.27l.818 8.997a2.75 2.75 0 0 0 2.739 2.501h4.347a2.75 2.75 0 0 0 2.738-2.5L17.73 8.5H19V7h-3.325A3.751 3.751 0 0 0 12 4Zm4.224 4.5H7.776l.806 8.861a1.25 1.25 0 0 0 1.245 1.137h4.347a1.25 1.25 0 0 0 1.245-1.137l.805-8.861Z"})}),R={id:"permanently-delete",label:(0,n.__)("Permanently delete"),supportsBulk:!0,icon:I,isEligible(e){if(function(e){return e.type===r||e.type===o}(e)||"wp_block"===e.type)return!1;const{status:t,permissions:n}=e;return"trash"===t&&n?.delete},async callback(e,{registry:t,onActionPerformed:i}){const{createSuccessNotice:r,createErrorNotice:o}=t.dispatch(g.store),{deleteEntityRecord:s}=t.dispatch(m.store),l=await Promise.allSettled(e.map((e=>s("postType",e.type,e.id,{force:!0},{throwOnError:!0}))));if(l.every((({status:e})=>"fulfilled"===e))){let t;t=1===l.length?(0,n.sprintf)((0,n.__)('"%s" permanently deleted.'),a(e[0])):(0,n.__)("The items were permanently deleted."),r(t,{type:"snackbar",id:"permanently-delete-post-action"}),i?.(e)}else{let e;if(1===l.length){const t=l[0];e=t.reason?.message?t.reason.message:(0,n.__)("An error occurred while permanently deleting the item.")}else{const t=new Set,i=l.filter((({status:e})=>"rejected"===e));for(const e of i){const n=e;n.reason?.message&&t.add(n.reason.message)}e=0===t.size?(0,n.__)("An error occurred while permanently deleting the items."):1===t.size?(0,n.sprintf)((0,n.__)("An error occurred while permanently deleting the items: %s"),[...t][0]):(0,n.sprintf)((0,n.__)("Some errors occurred while permanently deleting the items: %s"),[...t].join(","))}o(e,{type:"snackbar"})}}},T=R,H=window.wp.patterns,Z=window.wp.privateApis,{lock:$,unlock:G}=(0,Z.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/fields"),{CreatePatternModalContents:J,useDuplicatePatternProps:W}=G(H.privateApis),q={id:"duplicate-pattern",label:(0,n._x)("Duplicate","action label"),isEligible:e=>"wp_template_part"!==e.type,modalHeader:(0,n._x)("Duplicate pattern","action label"),RenderModal:({items:e,closeModal:t})=>{const[i]=e,r=W({pattern:i,onSuccess:()=>t?.()});return(0,d.jsx)(J,{onClose:t,confirmLabel:(0,n._x)("Duplicate","action label"),...r})}};var Q=function(){return Q=Object.assign||function(e){for(var t,n=1,i=arguments.length;n>32n);this.setUint32(e+(n?0:4),i,n),this.setUint32(e+(n?4:0),r,n)}});var ie=e=>new DataView(new ArrayBuffer(e)),re=e=>new Uint8Array(e.buffer||e),oe=e=>(new TextEncoder).encode(String(e)),ae=e=>Math.min(4294967295,Number(e)),se=e=>Math.min(65535,Number(e));function le(e,t){if(void 0===t||t instanceof Date||(t=new Date(t)),e instanceof File)return{isFile:1,t:t||new Date(e.lastModified),i:e.stream()};if(e instanceof Response)return{isFile:1,t:t||new Date(e.headers.get("Last-Modified")||Date.now()),i:e.body};if(void 0===t)t=new Date;else if(isNaN(t))throw new Error("Invalid modification date.");if(void 0===e)return{isFile:0,t};if("string"==typeof e)return{isFile:1,t,i:oe(e)};if(e instanceof Blob)return{isFile:1,t,i:e.stream()};if(e instanceof Uint8Array||e instanceof ReadableStream)return{isFile:1,t,i:e};if(e instanceof ArrayBuffer||ArrayBuffer.isView(e))return{isFile:1,t,i:re(e)};if(Symbol.asyncIterator in e)return{isFile:1,t,i:ce(e[Symbol.asyncIterator]())};throw new TypeError("Unsupported input format.")}function ce(e,t=e){return new ReadableStream({async pull(t){let n=0;for(;t.desiredSize>n;){const i=await e.next();if(!i.value){t.close();break}{const e=de(i.value);t.enqueue(e),n+=e.byteLength}}},cancel(e){t.throw?.(e)}})}function de(e){return"string"==typeof e?oe(e):e instanceof Uint8Array?e:re(e)}function ue(e,t,n){let[i,r]=function(e){return e?e instanceof Uint8Array?[e,1]:ArrayBuffer.isView(e)||e instanceof ArrayBuffer?[re(e),1]:[oe(e),0]:[void 0,0]}(t);if(e instanceof File)return{o:pe(i||oe(e.name)),u:BigInt(e.size),l:r};if(e instanceof Response){const t=e.headers.get("content-disposition"),o=t&&t.match(/;\s*filename\*?\s*=\s*(?:UTF-\d+''|)["']?([^;"'\r\n]*)["']?(?:;|$)/i),a=o&&o[1]||e.url&&new URL(e.url).pathname.split("/").findLast(Boolean),s=a&&decodeURIComponent(a),l=n||+e.headers.get("content-length");return{o:pe(i||oe(s)),u:BigInt(l),l:r}}return i=pe(i,void 0!==e||void 0!==n),"string"==typeof e?{o:i,u:BigInt(oe(e).length),l:r}:e instanceof Blob?{o:i,u:BigInt(e.size),l:r}:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?{o:i,u:BigInt(e.byteLength),l:r}:{o:i,u:fe(e,n),l:r}}function fe(e,t){return t>-1?BigInt(t):e?void 0:0n}function pe(e,t=1){if(!e||e.every((e=>47===e)))throw new Error("The file must have a name.");if(t)for(;47===e[e.length-1];)e=e.subarray(0,-1);else 47!==e[e.length-1]&&(e=new Uint8Array([...e,47]));return e}var me=new Uint32Array(256);for(let e=0;e<256;++e){let t=e;for(let e=0;e<8;++e)t=t>>>1^(1&t&&3988292384);me[e]=t}function ge(e,t=0){t^=-1;for(var n=0,i=e.length;n>>8^me[255&t^e[n]];return~t>>>0}function he(e,t,n=0){const i=e.getSeconds()>>1|e.getMinutes()<<5|e.getHours()<<11,r=e.getDate()|e.getMonth()+1<<5|e.getFullYear()-1980<<9;t.setUint16(n,i,1),t.setUint16(n+2,r,1)}function we({o:e,l:t},n){return 8*(!t||(n??function(e){try{ye.decode(e)}catch{return 0}return 1}(e)))}var ye=new TextDecoder("utf8",{fatal:1});function _e(e,t=0){const n=ie(30);return n.setUint32(0,1347093252),n.setUint32(4,754976768|t),he(e.t,n,10),n.setUint16(26,e.o.length,1),re(n)}async function*be(e){let{i:t}=e;if("then"in t&&(t=await t),t instanceof Uint8Array)yield t,e.m=ge(t,0),e.u=BigInt(t.length);else{e.u=0n;const n=t.getReader();for(;;){const{value:t,done:i}=await n.read();if(i)break;e.m=ge(t,e.m),e.u+=BigInt(t.length),yield t}}}function ve(e,t){const n=ie(16+(t?8:0));return n.setUint32(0,1347094280),n.setUint32(4,e.isFile?e.m:0,1),t?(n.setBigUint64(8,e.u,1),n.setBigUint64(16,e.u,1)):(n.setUint32(8,ae(e.u),1),n.setUint32(12,ae(e.u),1)),re(n)}function xe(e,t,n=0,i=0){const r=ie(46);return r.setUint32(0,1347092738),r.setUint32(4,755182848),r.setUint16(8,2048|n),he(e.t,r,12),r.setUint32(16,e.isFile?e.m:0,1),r.setUint32(20,ae(e.u),1),r.setUint32(24,ae(e.u),1),r.setUint16(28,e.o.length,1),r.setUint16(30,i,1),r.setUint16(40,e.isFile?33204:16893,1),r.setUint32(42,ae(t),1),re(r)}function je(e,t,n){const i=ie(n);return i.setUint16(0,1,1),i.setUint16(2,n-4,1),16&n&&(i.setBigUint64(4,e.u,1),i.setBigUint64(12,e.u,1)),i.setBigUint64(n-8,t,1),re(i)}function Se(e){return e instanceof File||e instanceof Response?[[e],[e]]:[[e.input,e.name,e.size],[e.input,e.lastModified]]}function Ue(e,t={}){const n={"Content-Type":"application/zip","Content-Disposition":"attachment"};return("bigint"==typeof t.length||Number.isInteger(t.length))&&t.length>0&&(n["Content-Length"]=String(t.length)),t.metadata&&(n["Content-Length"]=String((e=>function(e){let t=BigInt(22),n=0n,i=0;for(const r of e){if(!r.o)throw new Error("Every file must have a non-empty name.");if(void 0===r.u)throw new Error(`Missing size for file "${(new TextDecoder).decode(r.o)}".`);const e=r.u>=0xffffffffn,o=n>=0xffffffffn;n+=BigInt(46+r.o.length+(e&&8))+r.u,t+=BigInt(r.o.length+46+(12*o|28*e)),i||(i=e)}return(i||n>=0xffffffffn)&&(t+=BigInt(76)),t+n}(function*(e){for(const t of e)yield ue(...Se(t)[0])}(e)))(t.metadata))),new Response(Be(e,t),{headers:n})}function Be(e,t={}){const n=function(e){const t=e[Symbol.iterator in e?Symbol.iterator:Symbol.asyncIterator]();return{async next(){const e=await t.next();if(e.done)return e;const[n,i]=Se(e.value);return{done:0,value:Object.assign(le(...i),ue(...n))}},throw:t.throw?.bind(t),[Symbol.asyncIterator](){return this}}}(e);return ce(async function*(e,t){const n=[];let i=0n,r=0n,o=0;for await(const a of e){const e=we(a,t.buffersAreUTF8);yield _e(a,e),yield new Uint8Array(a.o),a.isFile&&(yield*be(a));const s=a.u>=0xffffffffn,l=12*(i>=0xffffffffn)|28*s;yield ve(a,s),n.push(xe(a,i,e,l)),n.push(a.o),l&&n.push(je(a,i,l)),s&&(i+=8n),r++,i+=BigInt(46+a.o.length)+a.u,o||(o=s)}let a=0n;for(const e of n)yield e,a+=BigInt(e.length);if(o||i>=0xffffffffn){const e=ie(76);e.setUint32(0,1347094022),e.setBigUint64(4,BigInt(44),1),e.setUint32(12,755182848),e.setBigUint64(24,r,1),e.setBigUint64(32,r,1),e.setBigUint64(40,a,1),e.setBigUint64(48,i,1),e.setUint32(56,1347094023),e.setBigUint64(64,i+a,1),e.setUint32(72,1,1),yield re(e)}const s=ie(22);s.setUint32(0,1347093766),s.setUint16(8,se(r),1),s.setUint16(10,se(r),1),s.setUint32(12,ae(a),1),s.setUint32(16,ae(i),1),yield re(s)}(n,t),n)}const Ce=window.wp.blob,Ve=(0,d.jsx)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d.jsx)(c.Path,{d:"M18 11.3l-1-1.1-4 4V3h-1.5v11.3L7 10.2l-1 1.1 6.2 5.8 5.8-5.8zm.5 3.7v3.5h-13V15H4v5h16v-5h-1.5z"})});function ke(e){return JSON.stringify({__file:e.type,title:a(e),content:"string"==typeof e.content?e.content:e.content?.raw,syncStatus:e.wp_pattern_sync_status},null,2)}const Ee={id:"export-pattern",label:(0,n.__)("Export as JSON"),icon:Ve,supportsBulk:!0,isEligible:e=>"wp_block"===e.type,callback:async e=>{if(1===e.length)return(0,Ce.downloadBlob)(`${ne(a(e[0])||e[0].slug)}.json`,ke(e[0]),"application/json");const t={},i=e.map((e=>{const n=ne(a(e)||e.slug);return t[n]=(t[n]||0)+1,{name:n+(t[n]>1?"-"+(t[n]-1):"")+".json",lastModified:new Date,input:ke(e)}}));return(0,Ce.downloadBlob)((0,n.__)("patterns-export")+".zip",await Ue(i).blob(),"application/zip")}},De=undefined;(window.wp=window.wp||{}).fields=t})(); \ No newline at end of file diff --git a/wp-includes/js/dist/format-library.js b/wp-includes/js/dist/format-library.js index 69a49a31ed..be34a61ce3 100644 --- a/wp-includes/js/dist/format-library.js +++ b/wp-includes/js/dist/format-library.js @@ -36,8 +36,6 @@ const formatBold = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx) - - const bold_name = 'core/bold'; const title = (0,external_wp_i18n_namespaceObject.__)('Bold'); const bold = { @@ -108,8 +106,6 @@ const code = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(exter - - const code_name = 'core/code'; const code_title = (0,external_wp_i18n_namespaceObject.__)('Inline code'); const code_code = { @@ -191,8 +187,6 @@ const external_wp_element_namespaceObject = window["wp"]["element"]; - - const ALLOWED_MEDIA_TYPES = ['image']; const image_name = 'core/image'; const image_title = (0,external_wp_i18n_namespaceObject.__)('Inline image'); @@ -367,8 +361,6 @@ const formatItalic = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.js - - const italic_name = 'core/italic'; const italic_title = (0,external_wp_i18n_namespaceObject.__)('Italic'); const italic = { @@ -603,7 +595,7 @@ function getFormatBoundary(value, format, startIndex = value.start, endIndex = v // Safe guard: start index cannot be less than 0. startIndex = startIndex < 0 ? 0 : startIndex; - // // Return the indicies of the "edges" as the boundaries. + // // Return the indices of the "edges" as the boundaries. return { start: startIndex, end: endIndex @@ -662,7 +654,7 @@ const walkToEnd = partialRight(walkToBoundary, 'forwards'); -const LINK_SETTINGS = [...external_wp_blockEditor_namespaceObject.__experimentalLinkControl.DEFAULT_LINK_SETTINGS, { +const LINK_SETTINGS = [...external_wp_blockEditor_namespaceObject.LinkControl.DEFAULT_LINK_SETTINGS, { id: 'nofollow', title: (0,external_wp_i18n_namespaceObject.__)('Mark as nofollow') }]; @@ -783,7 +775,7 @@ function InlineLinkUI({ // As "replace" will operate on the first match only, it is // run only against the second half of the value which was // split at the active format's boundary. This avoids a bug - // with incorrectly targetted replacements. + // with incorrectly targeted replacements. // See: https://github.com/WordPress/gutenberg/issues/41771. // Note original formats will be lost when applying this change. // That is expected behaviour. @@ -829,7 +821,7 @@ function InlineLinkUI({ }; } function createButtonText(searchTerm) { - return (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: search term. */ + return (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: search term. */ (0,external_wp_i18n_namespaceObject.__)('Create page: %s'), searchTerm), { mark: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("mark", {}) }); @@ -844,7 +836,7 @@ function InlineLinkUI({ shift: true, focusOnMount: focusOnMount, constrainTabbing: true, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalLinkControl, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.LinkControl, { value: linkValue, onChange: onChangeLink, onRemove: removeLink, @@ -909,8 +901,6 @@ function getRichTextValueFromSelection(value, isActive) { - - const link_name = 'core/link'; const link_title = (0,external_wp_i18n_namespaceObject.__)('Link'); function link_Edit({ @@ -1040,8 +1030,9 @@ function link_Edit({ // Only autofocus if we have clicked a link within the editor const shouldAutoFocus = !(openedBy?.el?.tagName === 'A' && openedBy?.action === 'click'); + const hasSelection = !(0,external_wp_richText_namespaceObject.isCollapsed)(value); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichTextShortcut, { + children: [hasSelection && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichTextShortcut, { type: "primary", character: "k", onUse: addLink @@ -1140,8 +1131,6 @@ const formatStrikethrough = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceOb - - const strikethrough_name = 'core/strikethrough'; const strikethrough_title = (0,external_wp_i18n_namespaceObject.__)('Strikethrough'); const strikethrough = { @@ -1186,8 +1175,6 @@ const strikethrough = { - - const underline_name = 'core/underline'; const underline_title = (0,external_wp_i18n_namespaceObject.__)('Underline'); const underline = { @@ -1236,7 +1223,7 @@ const underline = { * Return an SVG icon. * * @param {IconProps} props icon is the SVG component to render - * size is a number specifiying the icon size in pixels + * size is a number specifying the icon size in pixels * Other props will be passed to wrapped SVG component * @param {import('react').ForwardedRef} ref The forwarded ref to the SVG element. * @@ -1299,6 +1286,7 @@ const { } = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/format-library'); ;// ./node_modules/@wordpress/format-library/build-module/text-color/inline.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -1315,7 +1303,6 @@ const { - const { Tabs } = unlock(external_wp_components_namespaceObject.privateApis); @@ -1477,8 +1464,6 @@ function InlineColorUI({ */ - - const transparentValue = 'rgba(0, 0, 0, 0)'; const text_color_name = 'core/text-color'; const text_color_title = (0,external_wp_i18n_namespaceObject.__)('Highlight'); @@ -1519,7 +1504,7 @@ function TextColorEdit({ const [allowCustomControl, colors = EMPTY_ARRAY] = (0,external_wp_blockEditor_namespaceObject.useSettings)('color.custom', 'color.palette'); const [isAddingColor, setIsAddingColor] = (0,external_wp_element_namespaceObject.useState)(false); const colorIndicatorStyle = (0,external_wp_element_namespaceObject.useMemo)(() => fillComputedColors(contentRef.current, getActiveColors(value, text_color_name, colors)), [contentRef, value, colors]); - const hasColorsToChoose = colors.length || !allowCustomControl; + const hasColorsToChoose = !!colors.length || allowCustomControl; if (!hasColorsToChoose && !isActive) { return null; } @@ -1746,6 +1731,7 @@ const help = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(exter /* harmony default export */ const library_help = (help); ;// ./node_modules/@wordpress/format-library/build-module/unknown/index.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -1823,8 +1809,6 @@ const language = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(e - - const language_name = 'core/language'; const language_title = (0,external_wp_i18n_namespaceObject.__)('Language'); const language_language = { @@ -1981,6 +1965,7 @@ const nonBreakingSpace = { /* harmony default export */ const default_formats = ([bold, code_code, image_image, italic, build_module_link_link, strikethrough, underline, text_color_textColor, subscript_subscript, superscript_superscript, keyboard, unknown, language_language, nonBreakingSpace]); ;// ./node_modules/@wordpress/format-library/build-module/index.js +/* wp:polyfill */ /** * WordPress dependencies */ diff --git a/wp-includes/js/dist/format-library.min.js b/wp-includes/js/dist/format-library.min.js index 7f8bbdc364..f699416f51 100644 --- a/wp-includes/js/dist/format-library.min.js +++ b/wp-includes/js/dist/format-library.min.js @@ -1,2 +1,2 @@ /*! This file is auto-generated */ -(()=>{"use strict";const t=window.wp.richText,e=window.wp.i18n,n=window.wp.blockEditor,o=window.wp.primitives,r=window.ReactJSXRuntime,i=(0,r.jsx)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,r.jsx)(o.Path,{d:"M14.7 11.3c1-.6 1.5-1.6 1.5-3 0-2.3-1.3-3.4-4-3.4H7v14h5.8c1.4 0 2.5-.3 3.3-1 .8-.7 1.2-1.7 1.2-2.9.1-1.9-.8-3.1-2.6-3.7zm-5.1-4h2.3c.6 0 1.1.1 1.4.4.3.3.5.7.5 1.2s-.2 1-.5 1.2c-.3.3-.8.4-1.4.4H9.6V7.3zm4.6 9c-.4.3-1 .4-1.7.4H9.6v-3.9h2.9c.7 0 1.3.2 1.7.5.4.3.6.8.6 1.5s-.2 1.2-.6 1.5z"})}),a="core/bold",s=(0,e.__)("Bold"),l={name:a,title:s,tagName:"strong",className:null,edit({isActive:e,value:o,onChange:l,onFocus:c}){function u(){l((0,t.toggleFormat)(o,{type:a,title:s}))}return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.RichTextShortcut,{type:"primary",character:"b",onUse:u}),(0,r.jsx)(n.RichTextToolbarButton,{name:"bold",icon:i,title:s,onClick:function(){l((0,t.toggleFormat)(o,{type:a})),c()},isActive:e,shortcutType:"primary",shortcutCharacter:"b"}),(0,r.jsx)(n.__unstableRichTextInputEvent,{inputType:"formatBold",onInput:u})]})}},c=(0,r.jsx)(o.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)(o.Path,{d:"M20.8 10.7l-4.3-4.3-1.1 1.1 4.3 4.3c.1.1.1.3 0 .4l-4.3 4.3 1.1 1.1 4.3-4.3c.7-.8.7-1.9 0-2.6zM4.2 11.8l4.3-4.3-1-1-4.3 4.3c-.7.7-.7 1.8 0 2.5l4.3 4.3 1.1-1.1-4.3-4.3c-.2-.1-.2-.3-.1-.4z"})}),u="core/code",h=(0,e.__)("Inline code"),m={name:u,title:h,tagName:"code",className:null,__unstableInputRule(e){const{start:n,text:o}=e;if("`"!==o[n-1])return e;if(n-2<0)return e;const r=o.lastIndexOf("`",n-2);if(-1===r)return e;const i=r,a=n-2;return i===a?e:(e=(0,t.remove)(e,i,i+1),e=(0,t.remove)(e,a,a+1),e=(0,t.applyFormat)(e,{type:u},i,a))},edit({value:e,onChange:o,onFocus:i,isActive:a}){function s(){o((0,t.toggleFormat)(e,{type:u,title:h})),i()}return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.RichTextShortcut,{type:"access",character:"x",onUse:s}),(0,r.jsx)(n.RichTextToolbarButton,{icon:c,title:h,onClick:s,isActive:a,role:"menuitemcheckbox"})]})}},p=window.wp.components,g=window.wp.element,d=["image"],x="core/image",v=(0,e.__)("Inline image"),f={name:x,title:v,keywords:[(0,e.__)("photo"),(0,e.__)("media")],object:!0,tagName:"img",className:null,attributes:{className:"class",style:"style",url:"src",alt:"alt"},edit:function({value:e,onChange:o,onFocus:i,isObjectActive:a,activeObjectAttributes:s,contentRef:l}){return(0,r.jsxs)(n.MediaUploadCheck,{children:[(0,r.jsx)(n.MediaUpload,{allowedTypes:d,onSelect:({id:n,url:r,alt:a,width:s})=>{o((0,t.insertObject)(e,{type:x,attributes:{className:`wp-image-${n}`,style:`width: ${Math.min(s,150)}px;`,url:r,alt:a}})),i()},render:({open:t})=>(0,r.jsx)(n.RichTextToolbarButton,{icon:(0,r.jsx)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,r.jsx)(p.Path,{d:"M4 18.5h16V17H4v1.5zM16 13v1.5h4V13h-4zM5.1 15h7.8c.6 0 1.1-.5 1.1-1.1V6.1c0-.6-.5-1.1-1.1-1.1H5.1C4.5 5 4 5.5 4 6.1v7.8c0 .6.5 1.1 1.1 1.1zm.4-8.5h7V10l-1-1c-.3-.3-.8-.3-1 0l-1.6 1.5-1.2-.7c-.3-.2-.6-.2-.9 0l-1.3 1V6.5zm0 6.1l1.8-1.3 1.3.8c.3.2.7.2.9-.1l1.5-1.4 1.5 1.4v1.5h-7v-.9z"})}),title:v,onClick:t,isActive:a})}),a&&(0,r.jsx)(b,{value:e,onChange:o,activeObjectAttributes:s,contentRef:l})]})}};function b({value:n,onChange:o,activeObjectAttributes:i,contentRef:a}){const{style:s,alt:l}=i,c=s?.replace(/\D/g,""),[u,h]=(0,g.useState)(c),[m,d]=(0,g.useState)(l),v=u!==c||m!==l,b=(0,t.useAnchor)({editableContentElement:a.current,settings:f});return(0,r.jsx)(p.Popover,{placement:"bottom",focusOnMount:!1,anchor:b,className:"block-editor-format-toolbar__image-popover",children:(0,r.jsx)("form",{className:"block-editor-format-toolbar__image-container-content",onSubmit:t=>{const e=n.replacements.slice();e[n.start]={type:x,attributes:{...i,style:c?`width: ${u}px;`:"",alt:m}},o({...n,replacements:e}),t.preventDefault()},children:(0,r.jsxs)(p.__experimentalVStack,{spacing:4,children:[(0,r.jsx)(p.__experimentalNumberControl,{__next40pxDefaultSize:!0,label:(0,e.__)("Width"),value:u,min:1,onChange:t=>{h(t)}}),(0,r.jsx)(p.TextareaControl,{label:(0,e.__)("Alternative text"),__nextHasNoMarginBottom:!0,value:m,onChange:t=>{d(t)},help:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(p.ExternalLink,{href:(0,e.__)("https://www.w3.org/WAI/tutorials/images/decision-tree/"),children:(0,e.__)("Describe the purpose of the image.")}),(0,r.jsx)("br",{}),(0,e.__)("Leave empty if decorative.")]})}),(0,r.jsx)(p.__experimentalHStack,{justify:"right",children:(0,r.jsx)(p.Button,{disabled:!v,accessibleWhenDisabled:!0,variant:"primary",type:"submit",size:"compact",children:(0,e.__)("Apply")})})]})})})}const w=(0,r.jsx)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,r.jsx)(o.Path,{d:"M12.5 5L10 19h1.9l2.5-14z"})}),_="core/italic",y=(0,e.__)("Italic"),j={name:_,title:y,tagName:"em",className:null,edit({isActive:e,value:o,onChange:i,onFocus:a}){function s(){i((0,t.toggleFormat)(o,{type:_,title:y}))}return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.RichTextShortcut,{type:"primary",character:"i",onUse:s}),(0,r.jsx)(n.RichTextToolbarButton,{name:"italic",icon:w,title:y,onClick:function(){i((0,t.toggleFormat)(o,{type:_})),a()},isActive:e,shortcutType:"primary",shortcutCharacter:"i"}),(0,r.jsx)(n.__unstableRichTextInputEvent,{inputType:"formatItalic",onInput:s})]})}},k=window.wp.url,C=window.wp.htmlEntities,S=(0,r.jsx)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,r.jsx)(o.Path,{d:"M10 17.389H8.444A5.194 5.194 0 1 1 8.444 7H10v1.5H8.444a3.694 3.694 0 0 0 0 7.389H10v1.5ZM14 7h1.556a5.194 5.194 0 0 1 0 10.39H14v-1.5h1.556a3.694 3.694 0 0 0 0-7.39H14V7Zm-4.5 6h5v-1.5h-5V13Z"})}),T=window.wp.a11y,A=window.wp.data;function F(t){if(!t)return!1;const e=t.trim();if(!e)return!1;if(/^\S+:/.test(e)){const t=(0,k.getProtocol)(e);if(!(0,k.isValidProtocol)(t))return!1;if(t.startsWith("http")&&!/^https?:\/\/[^\/\s]/i.test(e))return!1;const n=(0,k.getAuthority)(e);if(!(0,k.isValidAuthority)(n))return!1;const o=(0,k.getPath)(e);if(o&&!(0,k.isValidPath)(o))return!1;const r=(0,k.getQueryString)(e);if(r&&!(0,k.isValidQueryString)(r))return!1;const i=(0,k.getFragment)(e);if(i&&!(0,k.isValidFragment)(i))return!1}return!(e.startsWith("#")&&!(0,k.isValidFragment)(e))}function N(t,e,n=t.start,o=t.end){const r={start:null,end:null},{formats:i}=t;let a,s;if(!i?.length)return r;const l=i.slice(),c=l[n]?.find((({type:t})=>t===e.type)),u=l[o]?.find((({type:t})=>t===e.type)),h=l[o-1]?.find((({type:t})=>t===e.type));if(c)a=c,s=n;else if(u)a=u,s=o;else{if(!h)return r;a=h,s=o-1}const m=l[s].indexOf(a),p=[l,s,a,m];return{start:n=(n=M(...p))<0?0:n,end:o=P(...p)}}function R(t,e,n,o,r){let i=e;const a={forwards:1,backwards:-1}[r]||1,s=-1*a;for(;t[i]&&t[i][o]===n;)i+=a;return i+=s,i}const V=(t,...e)=>(...n)=>t(...n,...e),M=V(R,"backwards"),P=V(R,"forwards"),B=[...n.__experimentalLinkControl.DEFAULT_LINK_SETTINGS,{id:"nofollow",title:(0,e.__)("Mark as nofollow")}];const z=function({isActive:o,activeAttributes:i,value:a,onChange:s,onFocusOutside:l,stopAddingLink:c,contentRef:u,focusOnMount:h}){const m=function(e,n){let o=e.start,r=e.end;if(n){const t=N(e,{type:"core/link"});o=t.start,r=t.end+1}return(0,t.slice)(e,o,r)}(a,o).text,{selectionChange:d}=(0,A.useDispatch)(n.store),{createPageEntity:x,userCanCreatePages:v,selectionStart:f}=(0,A.useSelect)((t=>{const{getSettings:e,getSelectionStart:o}=t(n.store),r=e();return{createPageEntity:r.__experimentalCreatePageEntity,userCanCreatePages:r.__experimentalUserCanCreatePages,selectionStart:o()}}),[]),b=(0,g.useMemo)((()=>({url:i.url,type:i.type,id:i.id,opensInNewTab:"_blank"===i.target,nofollow:i.rel?.includes("nofollow"),title:m})),[i.id,i.rel,i.target,i.type,i.url,m]),w=(0,t.useAnchor)({editableContentElement:u.current,settings:{...E,isActive:o}});return(0,r.jsx)(p.Popover,{anchor:w,animate:!1,onClose:c,onFocusOutside:l,placement:"bottom",offset:8,shift:!0,focusOnMount:h,constrainTabbing:!0,children:(0,r.jsx)(n.__experimentalLinkControl,{value:b,onChange:function(n){const r=b?.url,i=!r;n={...b,...n};const l=(0,k.prependHTTP)(n.url),u=function({url:t,type:e,id:n,opensInNewWindow:o,nofollow:r}){const i={type:"core/link",attributes:{url:t}};return e&&(i.attributes.type=e),n&&(i.attributes.id=n),o&&(i.attributes.target="_blank",i.attributes.rel=i.attributes.rel?i.attributes.rel+" noreferrer noopener":"noreferrer noopener"),r&&(i.attributes.rel=i.attributes.rel?i.attributes.rel+" nofollow":"nofollow"),i}({url:l,type:n.type,id:void 0!==n.id&&null!==n.id?String(n.id):void 0,opensInNewWindow:n.opensInNewTab,nofollow:n.nofollow}),h=n.title||l;let p;if((0,t.isCollapsed)(a)&&!o){const e=(0,t.insert)(a,h);return p=(0,t.applyFormat)(e,u,a.start,a.start+h.length),s(p),c(),void d({clientId:f.clientId,identifier:f.attributeKey,start:a.start+h.length+1})}if(h===m)p=(0,t.applyFormat)(a,u);else{p=(0,t.create)({text:h}),p=(0,t.applyFormat)(p,u,0,h.length);const e=N(a,{type:"core/link"}),[n,o]=(0,t.split)(a,e.start,e.start),r=(0,t.replace)(o,m,p);p=(0,t.concat)(n,r)}s(p),i||c(),F(l)?o?(0,T.speak)((0,e.__)("Link edited."),"assertive"):(0,T.speak)((0,e.__)("Link inserted."),"assertive"):(0,T.speak)((0,e.__)("Warning: the link has been inserted but may have errors. Please test it."),"assertive")},onRemove:function(){const n=(0,t.removeFormat)(a,"core/link");s(n),c(),(0,T.speak)((0,e.__)("Link removed."),"assertive")},hasRichPreviews:!0,createSuggestion:x&&async function(t){const e=await x({title:t,status:"draft"});return{id:e.id,type:e.type,title:e.title.rendered,url:e.link,kind:"post-type"}},withCreateSuggestion:v,createSuggestionButtonText:function(t){return(0,g.createInterpolateElement)((0,e.sprintf)((0,e.__)("Create page: %s"),t),{mark:(0,r.jsx)("mark",{})})},hasTextControl:!0,settings:B,showInitialSuggestions:!0,suggestionsQuery:{initialSuggestionsSearchOptions:{type:"post",subtype:"page",perPage:20}}})})},L="core/link",I=(0,e.__)("Link");const E={name:L,title:I,tagName:"a",className:null,attributes:{url:"href",type:"data-type",id:"data-id",_id:"id",target:"target",rel:"rel"},__unstablePasteRule(e,{html:n,plainText:o}){const r=(n||o).replace(/<[^>]+>/g,"").trim();if(!(0,k.isURL)(r)||!/^https?:/.test(r))return e;window.console.log("Created link:\n\n",r);const i={type:L,attributes:{url:(0,C.decodeEntities)(r)}};return(0,t.isCollapsed)(e)?(0,t.insert)(e,(0,t.applyFormat)((0,t.create)({text:o}),i,0,o.length)):(0,t.applyFormat)(e,i)},edit:function({isActive:o,activeAttributes:i,value:a,onChange:s,onFocus:l,contentRef:c}){const[u,h]=(0,g.useState)(!1),[m,p]=(0,g.useState)(null);function d(e){const n=(0,t.getTextContent)((0,t.slice)(a));!o&&n&&(0,k.isURL)(n)&&F(n)?s((0,t.applyFormat)(a,{type:L,attributes:{url:n}})):!o&&n&&(0,k.isEmail)(n)?s((0,t.applyFormat)(a,{type:L,attributes:{url:`mailto:${n}`}})):!o&&n&&(0,k.isPhoneNumber)(n)?s((0,t.applyFormat)(a,{type:L,attributes:{url:`tel:${n.replace(/\D/g,"")}`}})):(e&&p({el:e,action:null}),h(!0))}(0,g.useEffect)((()=>{o||h(!1)}),[o]),(0,g.useLayoutEffect)((()=>{const t=c.current;if(t)return t.addEventListener("click",e),()=>{t.removeEventListener("click",e)};function e(t){const e=t.target.closest("[contenteditable] a");e&&o&&(h(!0),p({el:e,action:"click"}))}}),[c,o]);const x=!("A"===m?.el?.tagName&&"click"===m?.action);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.RichTextShortcut,{type:"primary",character:"k",onUse:d}),(0,r.jsx)(n.RichTextShortcut,{type:"primaryShift",character:"k",onUse:function(){s((0,t.removeFormat)(a,L)),(0,T.speak)((0,e.__)("Link removed."),"assertive")}}),(0,r.jsx)(n.RichTextToolbarButton,{name:"link",icon:S,title:o?(0,e.__)("Link"):I,onClick:t=>{d(t.currentTarget)},isActive:o||u,shortcutType:"primary",shortcutCharacter:"k","aria-haspopup":"true","aria-expanded":u}),u&&(0,r.jsx)(z,{stopAddingLink:function(){h(!1),"BUTTON"===m?.el?.tagName?m.el.focus():l(),p(null)},onFocusOutside:function(){h(!1),p(null)},isActive:o,activeAttributes:i,value:a,onChange:s,contentRef:c,focusOnMount:!!x&&"firstElement"})]})}},H=(0,r.jsx)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,r.jsx)(o.Path,{d:"M9.1 9v-.5c0-.6.2-1.1.7-1.4.5-.3 1.2-.5 2-.5.7 0 1.4.1 2.1.3.7.2 1.4.5 2.1.9l.2-1.9c-.6-.3-1.2-.5-1.9-.7-.8-.1-1.6-.2-2.4-.2-1.5 0-2.7.3-3.6 1-.8.7-1.2 1.5-1.2 2.6V9h2zM20 12H4v1h8.3c.3.1.6.2.8.3.5.2.9.5 1.1.8.3.3.4.7.4 1.2 0 .7-.2 1.1-.8 1.5-.5.3-1.2.5-2.1.5-.8 0-1.6-.1-2.4-.3-.8-.2-1.5-.5-2.2-.8L7 18.1c.5.2 1.2.4 2 .6.8.2 1.6.3 2.4.3 1.7 0 3-.3 3.9-1 .9-.7 1.3-1.6 1.3-2.8 0-.9-.2-1.7-.7-2.2H20v-1z"})}),O="core/strikethrough",U=(0,e.__)("Strikethrough"),G={name:O,title:U,tagName:"s",className:null,edit({isActive:e,value:o,onChange:i,onFocus:a}){function s(){i((0,t.toggleFormat)(o,{type:O,title:U})),a()}return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.RichTextShortcut,{type:"access",character:"d",onUse:s}),(0,r.jsx)(n.RichTextToolbarButton,{icon:H,title:U,onClick:s,isActive:e,role:"menuitemcheckbox"})]})}},D="core/underline",W=(0,e.__)("Underline"),Z={name:D,title:W,tagName:"span",className:null,attributes:{style:"style"},edit({value:e,onChange:o}){const i=()=>{o((0,t.toggleFormat)(e,{type:D,attributes:{style:"text-decoration: underline;"},title:W}))};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.RichTextShortcut,{type:"primary",character:"u",onUse:i}),(0,r.jsx)(n.__unstableRichTextInputEvent,{inputType:"formatUnderline",onInput:i})]})}};const $=(0,g.forwardRef)((function({icon:t,size:e=24,...n},o){return(0,g.cloneElement)(t,{width:e,height:e,...n,ref:o})})),K=(0,r.jsx)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,r.jsx)(o.Path,{d:"M12.9 6h-2l-4 11h1.9l1.1-3h4.2l1.1 3h1.9L12.9 6zm-2.5 6.5l1.5-4.9 1.7 4.9h-3.2z"})}),Q=(0,r.jsx)(o.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)(o.Path,{d:"M17.2 10.9c-.5-1-1.2-2.1-2.1-3.2-.6-.9-1.3-1.7-2.1-2.6L12 4l-1 1.1c-.6.9-1.3 1.7-2 2.6-.8 1.2-1.5 2.3-2 3.2-.6 1.2-1 2.2-1 3 0 3.4 2.7 6.1 6.1 6.1s6.1-2.7 6.1-6.1c0-.8-.3-1.8-1-3zm-5.1 7.6c-2.5 0-4.6-2.1-4.6-4.6 0-.3.1-1 .8-2.3.5-.9 1.1-1.9 2-3.1.7-.9 1.3-1.7 1.8-2.3.7.8 1.3 1.6 1.8 2.3.8 1.1 1.5 2.2 2 3.1.7 1.3.8 2 .8 2.3 0 2.5-2.1 4.6-4.6 4.6z"})}),J=window.wp.privateApis,{lock:X,unlock:q}=(0,J.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/format-library"),{Tabs:Y}=q(p.privateApis),tt=[{name:"color",title:(0,e.__)("Text")},{name:"backgroundColor",title:(0,e.__)("Background")}];function et(t=""){return t.split(";").reduce(((t,e)=>{if(e){const[n,o]=e.split(":");"color"===n&&(t.color=o),"background-color"===n&&o!==at&&(t.backgroundColor=o)}return t}),{})}function nt(t="",e){return t.split(" ").reduce(((t,o)=>{if(o.startsWith("has-")&&o.endsWith("-color")){const r=o.replace(/^has-/,"").replace(/-color$/,""),i=(0,n.getColorObjectByAttributeValues)(e,r);t.color=i.color}return t}),{})}function ot(e,n,o){const r=(0,t.getActiveFormat)(e,n);return r?{...et(r.attributes.style),...nt(r.attributes.class,o)}:{}}function rt({name:e,property:o,value:i,onChange:a}){const s=(0,A.useSelect)((t=>{var e;const{getSettings:o}=t(n.store);return null!==(e=o().colors)&&void 0!==e?e:[]}),[]),l=(0,g.useMemo)((()=>ot(i,e,s)),[e,i,s]);return(0,r.jsx)(n.ColorPalette,{value:l[o],onChange:r=>{a(function(e,o,r,i){const{color:a,backgroundColor:s}={...ot(e,o,r),...i};if(!a&&!s)return(0,t.removeFormat)(e,o);const l=[],c=[],u={};if(s?l.push(["background-color",s].join(":")):l.push(["background-color",at].join(":")),a){const t=(0,n.getColorObjectByColorValue)(r,a);t?c.push((0,n.getColorClassName)("color",t.slug)):l.push(["color",a].join(":"))}return l.length&&(u.style=l.join(";")),c.length&&(u.class=c.join(" ")),(0,t.applyFormat)(e,{type:o,attributes:u})}(i,e,s,{[o]:r}))}})}function it({name:e,value:n,onChange:o,onClose:i,contentRef:a,isActive:s}){const l=(0,t.useAnchor)({editableContentElement:a.current,settings:{...ht,isActive:s}});return(0,r.jsx)(p.Popover,{onClose:i,className:"format-library__inline-color-popover",anchor:l,children:(0,r.jsxs)(Y,{children:[(0,r.jsx)(Y.TabList,{children:tt.map((t=>(0,r.jsx)(Y.Tab,{tabId:t.name,children:t.title},t.name)))}),tt.map((t=>(0,r.jsx)(Y.TabPanel,{tabId:t.name,focusable:!1,children:(0,r.jsx)(rt,{name:e,property:t.name,value:n,onChange:o})},t.name)))]})})}const at="rgba(0, 0, 0, 0)",st="core/text-color",lt=(0,e.__)("Highlight"),ct=[];function ut(t,e){const{ownerDocument:n}=t,{defaultView:o}=n,r=o.getComputedStyle(t).getPropertyValue(e);return"background-color"===e&&r===at&&t.parentElement?ut(t.parentElement,e):r}const ht={name:st,title:lt,tagName:"mark",className:"has-inline-color",attributes:{style:"style",class:"class"},edit:function({value:e,onChange:o,isActive:i,activeAttributes:a,contentRef:s}){const[l,c=ct]=(0,n.useSettings)("color.custom","color.palette"),[u,h]=(0,g.useState)(!1),m=(0,g.useMemo)((()=>function(t,{color:e,backgroundColor:n}){if(e||n)return{color:e||ut(t,"color"),backgroundColor:n===at?ut(t,"background-color"):n}}(s.current,ot(e,st,c))),[s,e,c]),p=c.length||!l;return p||i?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.RichTextToolbarButton,{className:"format-library-text-color-button",isActive:i,icon:(0,r.jsx)($,{icon:Object.keys(a).length?K:Q,style:m}),title:lt,onClick:p?()=>h(!0):()=>o((0,t.removeFormat)(e,st)),role:"menuitemcheckbox"}),u&&(0,r.jsx)(it,{name:st,onClose:()=>h(!1),activeAttributes:a,value:e,onChange:o,contentRef:s,isActive:i})]}):null}},mt=(0,r.jsx)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,r.jsx)(o.Path,{d:"M16.9 18.3l.8-1.2c.4-.6.7-1.2.9-1.6.2-.4.3-.8.3-1.2 0-.3-.1-.7-.2-1-.1-.3-.4-.5-.6-.7-.3-.2-.6-.3-1-.3s-.8.1-1.1.2c-.3.1-.7.3-1 .6l.2 1.3c.3-.3.5-.5.8-.6s.6-.2.9-.2c.3 0 .5.1.7.2.2.2.2.4.2.7 0 .3-.1.5-.2.8-.1.3-.4.7-.8 1.3L15 19.4h4.3v-1.2h-2.4zM14.1 7.2h-2L9.5 11 6.9 7.2h-2l3.6 5.3L4.7 18h2l2.7-4 2.7 4h2l-3.8-5.5 3.8-5.3z"})}),pt="core/subscript",gt=(0,e.__)("Subscript"),dt={name:pt,title:gt,tagName:"sub",className:null,edit:({isActive:e,value:o,onChange:i,onFocus:a})=>(0,r.jsx)(n.RichTextToolbarButton,{icon:mt,title:gt,onClick:function(){i((0,t.toggleFormat)(o,{type:pt,title:gt})),a()},isActive:e,role:"menuitemcheckbox"})},xt=(0,r.jsx)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,r.jsx)(o.Path,{d:"M16.9 10.3l.8-1.3c.4-.6.7-1.2.9-1.6.2-.4.3-.8.3-1.2 0-.3-.1-.7-.2-1-.2-.2-.4-.4-.7-.6-.3-.2-.6-.3-1-.3s-.8.1-1.1.2c-.3.1-.7.3-1 .6l.1 1.3c.3-.3.5-.5.8-.6s.6-.2.9-.2c.3 0 .5.1.7.2.2.2.2.4.2.7 0 .3-.1.5-.2.8-.1.3-.4.7-.8 1.3l-1.8 2.8h4.3v-1.2h-2.2zm-2.8-3.1h-2L9.5 11 6.9 7.2h-2l3.6 5.3L4.7 18h2l2.7-4 2.7 4h2l-3.8-5.5 3.8-5.3z"})}),vt="core/superscript",ft=(0,e.__)("Superscript"),bt={name:vt,title:ft,tagName:"sup",className:null,edit:({isActive:e,value:o,onChange:i,onFocus:a})=>(0,r.jsx)(n.RichTextToolbarButton,{icon:xt,title:ft,onClick:function(){i((0,t.toggleFormat)(o,{type:vt,title:ft})),a()},isActive:e,role:"menuitemcheckbox"})},wt=(0,r.jsx)(o.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)(o.Path,{d:"M8 12.5h8V11H8v1.5Z M19 6.5H5a2 2 0 0 0-2 2V15a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8.5a2 2 0 0 0-2-2ZM5 8h14a.5.5 0 0 1 .5.5V15a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V8.5A.5.5 0 0 1 5 8Z"})}),_t="core/keyboard",yt=(0,e.__)("Keyboard input"),jt={name:_t,title:yt,tagName:"kbd",className:null,edit:({isActive:e,value:o,onChange:i,onFocus:a})=>(0,r.jsx)(n.RichTextToolbarButton,{icon:wt,title:yt,onClick:function(){i((0,t.toggleFormat)(o,{type:_t,title:yt})),a()},isActive:e,role:"menuitemcheckbox"})},kt=(0,r.jsx)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,r.jsx)(o.Path,{d:"M12 4.75a7.25 7.25 0 100 14.5 7.25 7.25 0 000-14.5zM3.25 12a8.75 8.75 0 1117.5 0 8.75 8.75 0 01-17.5 0zM12 8.75a1.5 1.5 0 01.167 2.99c-.465.052-.917.44-.917 1.01V14h1.5v-.845A3 3 0 109 10.25h1.5a1.5 1.5 0 011.5-1.5zM11.25 15v1.5h1.5V15h-1.5z"})}),Ct="core/unknown",St=(0,e.__)("Clear Unknown Formatting");const Tt={name:Ct,title:St,tagName:"*",className:null,edit({isActive:e,value:o,onChange:i,onFocus:a}){if(!e&&!function(e){return!(0,t.isCollapsed)(e)&&(0,t.slice)(e).formats.some((t=>t.some((t=>t.type===Ct))))}(o))return null;return(0,r.jsx)(n.RichTextToolbarButton,{name:"unknown",icon:kt,title:St,onClick:function(){i((0,t.removeFormat)(o,Ct)),a()},isActive:!0})}},At=(0,r.jsx)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,r.jsx)(o.Path,{d:"M17.5 10h-1.7l-3.7 10.5h1.7l.9-2.6h3.9l.9 2.6h1.7L17.5 10zm-2.2 6.3 1.4-4 1.4 4h-2.8zm-4.8-3.8c1.6-1.8 2.9-3.6 3.7-5.7H16V5.2h-5.8V3H8.8v2.2H3v1.5h9.6c-.7 1.6-1.8 3.1-3.1 4.6C8.6 10.2 7.8 9 7.2 8H5.6c.6 1.4 1.7 2.9 2.9 4.4l-2.4 2.4c-.3.4-.7.8-1.1 1.2l1 1 1.2-1.2c.8-.8 1.6-1.5 2.3-2.3.8.9 1.7 1.7 2.5 2.5l.6-1.5c-.7-.6-1.4-1.3-2.1-2z"})}),Ft="core/language",Nt=(0,e.__)("Language"),Rt={name:Ft,tagName:"bdo",className:null,edit:function({isActive:e,value:o,onChange:i,contentRef:a}){const[s,l]=(0,g.useState)(!1),c=()=>{l((t=>!t))};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.RichTextToolbarButton,{icon:At,label:Nt,title:Nt,onClick:()=>{e?i((0,t.removeFormat)(o,Ft)):c()},isActive:e,role:"menuitemcheckbox"}),s&&(0,r.jsx)(Vt,{value:o,onChange:i,onClose:c,contentRef:a})]})},title:Nt};function Vt({value:n,contentRef:o,onChange:i,onClose:a}){const s=(0,t.useAnchor)({editableContentElement:o.current,settings:Rt}),[l,c]=(0,g.useState)(""),[u,h]=(0,g.useState)("ltr");return(0,r.jsx)(p.Popover,{className:"block-editor-format-toolbar__language-popover",anchor:s,onClose:a,children:(0,r.jsxs)(p.__experimentalVStack,{as:"form",spacing:4,className:"block-editor-format-toolbar__language-container-content",onSubmit:e=>{e.preventDefault(),i((0,t.applyFormat)(n,{type:Ft,attributes:{lang:l,dir:u}})),a()},children:[(0,r.jsx)(p.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:Nt,value:l,onChange:t=>c(t),help:(0,e.__)('A valid language attribute, like "en" or "fr".')}),(0,r.jsx)(p.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,e.__)("Text direction"),value:u,options:[{label:(0,e.__)("Left to right"),value:"ltr"},{label:(0,e.__)("Right to left"),value:"rtl"}],onChange:t=>h(t)}),(0,r.jsx)(p.__experimentalHStack,{alignment:"right",children:(0,r.jsx)(p.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",text:(0,e.__)("Apply")})})]})})}const Mt=(0,e.__)("Non breaking space");[l,m,f,j,E,G,Z,ht,dt,bt,jt,Tt,Rt,{name:"core/non-breaking-space",title:Mt,tagName:"nbsp",className:null,edit:({value:e,onChange:o})=>(0,r.jsx)(n.RichTextShortcut,{type:"primaryShift",character:" ",onUse:function(){o((0,t.insert)(e," "))}})}].forEach((({name:e,...n})=>(0,t.registerFormatType)(e,n))),(window.wp=window.wp||{}).formatLibrary={}})(); \ No newline at end of file +(()=>{"use strict";const t=window.wp.richText,e=window.wp.i18n,n=window.wp.blockEditor,o=window.wp.primitives,r=window.ReactJSXRuntime,i=(0,r.jsx)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,r.jsx)(o.Path,{d:"M14.7 11.3c1-.6 1.5-1.6 1.5-3 0-2.3-1.3-3.4-4-3.4H7v14h5.8c1.4 0 2.5-.3 3.3-1 .8-.7 1.2-1.7 1.2-2.9.1-1.9-.8-3.1-2.6-3.7zm-5.1-4h2.3c.6 0 1.1.1 1.4.4.3.3.5.7.5 1.2s-.2 1-.5 1.2c-.3.3-.8.4-1.4.4H9.6V7.3zm4.6 9c-.4.3-1 .4-1.7.4H9.6v-3.9h2.9c.7 0 1.3.2 1.7.5.4.3.6.8.6 1.5s-.2 1.2-.6 1.5z"})}),a="core/bold",s=(0,e.__)("Bold"),l={name:a,title:s,tagName:"strong",className:null,edit({isActive:e,value:o,onChange:l,onFocus:c}){function u(){l((0,t.toggleFormat)(o,{type:a,title:s}))}return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.RichTextShortcut,{type:"primary",character:"b",onUse:u}),(0,r.jsx)(n.RichTextToolbarButton,{name:"bold",icon:i,title:s,onClick:function(){l((0,t.toggleFormat)(o,{type:a})),c()},isActive:e,shortcutType:"primary",shortcutCharacter:"b"}),(0,r.jsx)(n.__unstableRichTextInputEvent,{inputType:"formatBold",onInput:u})]})}},c=(0,r.jsx)(o.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)(o.Path,{d:"M20.8 10.7l-4.3-4.3-1.1 1.1 4.3 4.3c.1.1.1.3 0 .4l-4.3 4.3 1.1 1.1 4.3-4.3c.7-.8.7-1.9 0-2.6zM4.2 11.8l4.3-4.3-1-1-4.3 4.3c-.7.7-.7 1.8 0 2.5l4.3 4.3 1.1-1.1-4.3-4.3c-.2-.1-.2-.3-.1-.4z"})}),u="core/code",h=(0,e.__)("Inline code"),m={name:u,title:h,tagName:"code",className:null,__unstableInputRule(e){const{start:n,text:o}=e;if("`"!==o[n-1])return e;if(n-2<0)return e;const r=o.lastIndexOf("`",n-2);if(-1===r)return e;const i=r,a=n-2;return i===a?e:(e=(0,t.remove)(e,i,i+1),e=(0,t.remove)(e,a,a+1),e=(0,t.applyFormat)(e,{type:u},i,a))},edit({value:e,onChange:o,onFocus:i,isActive:a}){function s(){o((0,t.toggleFormat)(e,{type:u,title:h})),i()}return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.RichTextShortcut,{type:"access",character:"x",onUse:s}),(0,r.jsx)(n.RichTextToolbarButton,{icon:c,title:h,onClick:s,isActive:a,role:"menuitemcheckbox"})]})}},p=window.wp.components,g=window.wp.element,d=["image"],x="core/image",v=(0,e.__)("Inline image"),f={name:x,title:v,keywords:[(0,e.__)("photo"),(0,e.__)("media")],object:!0,tagName:"img",className:null,attributes:{className:"class",style:"style",url:"src",alt:"alt"},edit:function({value:e,onChange:o,onFocus:i,isObjectActive:a,activeObjectAttributes:s,contentRef:l}){return(0,r.jsxs)(n.MediaUploadCheck,{children:[(0,r.jsx)(n.MediaUpload,{allowedTypes:d,onSelect:({id:n,url:r,alt:a,width:s})=>{o((0,t.insertObject)(e,{type:x,attributes:{className:`wp-image-${n}`,style:`width: ${Math.min(s,150)}px;`,url:r,alt:a}})),i()},render:({open:t})=>(0,r.jsx)(n.RichTextToolbarButton,{icon:(0,r.jsx)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,r.jsx)(p.Path,{d:"M4 18.5h16V17H4v1.5zM16 13v1.5h4V13h-4zM5.1 15h7.8c.6 0 1.1-.5 1.1-1.1V6.1c0-.6-.5-1.1-1.1-1.1H5.1C4.5 5 4 5.5 4 6.1v7.8c0 .6.5 1.1 1.1 1.1zm.4-8.5h7V10l-1-1c-.3-.3-.8-.3-1 0l-1.6 1.5-1.2-.7c-.3-.2-.6-.2-.9 0l-1.3 1V6.5zm0 6.1l1.8-1.3 1.3.8c.3.2.7.2.9-.1l1.5-1.4 1.5 1.4v1.5h-7v-.9z"})}),title:v,onClick:t,isActive:a})}),a&&(0,r.jsx)(b,{value:e,onChange:o,activeObjectAttributes:s,contentRef:l})]})}};function b({value:n,onChange:o,activeObjectAttributes:i,contentRef:a}){const{style:s,alt:l}=i,c=s?.replace(/\D/g,""),[u,h]=(0,g.useState)(c),[m,d]=(0,g.useState)(l),v=u!==c||m!==l,b=(0,t.useAnchor)({editableContentElement:a.current,settings:f});return(0,r.jsx)(p.Popover,{placement:"bottom",focusOnMount:!1,anchor:b,className:"block-editor-format-toolbar__image-popover",children:(0,r.jsx)("form",{className:"block-editor-format-toolbar__image-container-content",onSubmit:t=>{const e=n.replacements.slice();e[n.start]={type:x,attributes:{...i,style:c?`width: ${u}px;`:"",alt:m}},o({...n,replacements:e}),t.preventDefault()},children:(0,r.jsxs)(p.__experimentalVStack,{spacing:4,children:[(0,r.jsx)(p.__experimentalNumberControl,{__next40pxDefaultSize:!0,label:(0,e.__)("Width"),value:u,min:1,onChange:t=>{h(t)}}),(0,r.jsx)(p.TextareaControl,{label:(0,e.__)("Alternative text"),__nextHasNoMarginBottom:!0,value:m,onChange:t=>{d(t)},help:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(p.ExternalLink,{href:(0,e.__)("https://www.w3.org/WAI/tutorials/images/decision-tree/"),children:(0,e.__)("Describe the purpose of the image.")}),(0,r.jsx)("br",{}),(0,e.__)("Leave empty if decorative.")]})}),(0,r.jsx)(p.__experimentalHStack,{justify:"right",children:(0,r.jsx)(p.Button,{disabled:!v,accessibleWhenDisabled:!0,variant:"primary",type:"submit",size:"compact",children:(0,e.__)("Apply")})})]})})})}const w=(0,r.jsx)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,r.jsx)(o.Path,{d:"M12.5 5L10 19h1.9l2.5-14z"})}),_="core/italic",y=(0,e.__)("Italic"),j={name:_,title:y,tagName:"em",className:null,edit({isActive:e,value:o,onChange:i,onFocus:a}){function s(){i((0,t.toggleFormat)(o,{type:_,title:y}))}return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.RichTextShortcut,{type:"primary",character:"i",onUse:s}),(0,r.jsx)(n.RichTextToolbarButton,{name:"italic",icon:w,title:y,onClick:function(){i((0,t.toggleFormat)(o,{type:_})),a()},isActive:e,shortcutType:"primary",shortcutCharacter:"i"}),(0,r.jsx)(n.__unstableRichTextInputEvent,{inputType:"formatItalic",onInput:s})]})}},k=window.wp.url,C=window.wp.htmlEntities,S=(0,r.jsx)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,r.jsx)(o.Path,{d:"M10 17.389H8.444A5.194 5.194 0 1 1 8.444 7H10v1.5H8.444a3.694 3.694 0 0 0 0 7.389H10v1.5ZM14 7h1.556a5.194 5.194 0 0 1 0 10.39H14v-1.5h1.556a3.694 3.694 0 0 0 0-7.39H14V7Zm-4.5 6h5v-1.5h-5V13Z"})}),T=window.wp.a11y,A=window.wp.data;function F(t){if(!t)return!1;const e=t.trim();if(!e)return!1;if(/^\S+:/.test(e)){const t=(0,k.getProtocol)(e);if(!(0,k.isValidProtocol)(t))return!1;if(t.startsWith("http")&&!/^https?:\/\/[^\/\s]/i.test(e))return!1;const n=(0,k.getAuthority)(e);if(!(0,k.isValidAuthority)(n))return!1;const o=(0,k.getPath)(e);if(o&&!(0,k.isValidPath)(o))return!1;const r=(0,k.getQueryString)(e);if(r&&!(0,k.isValidQueryString)(r))return!1;const i=(0,k.getFragment)(e);if(i&&!(0,k.isValidFragment)(i))return!1}return!(e.startsWith("#")&&!(0,k.isValidFragment)(e))}function N(t,e,n=t.start,o=t.end){const r={start:null,end:null},{formats:i}=t;let a,s;if(!i?.length)return r;const l=i.slice(),c=l[n]?.find((({type:t})=>t===e.type)),u=l[o]?.find((({type:t})=>t===e.type)),h=l[o-1]?.find((({type:t})=>t===e.type));if(c)a=c,s=n;else if(u)a=u,s=o;else{if(!h)return r;a=h,s=o-1}const m=l[s].indexOf(a),p=[l,s,a,m];return{start:n=(n=M(...p))<0?0:n,end:o=P(...p)}}function R(t,e,n,o,r){let i=e;const a={forwards:1,backwards:-1}[r]||1,s=-1*a;for(;t[i]&&t[i][o]===n;)i+=a;return i+=s,i}const V=(t,...e)=>(...n)=>t(...n,...e),M=V(R,"backwards"),P=V(R,"forwards"),B=[...n.LinkControl.DEFAULT_LINK_SETTINGS,{id:"nofollow",title:(0,e.__)("Mark as nofollow")}];const z=function({isActive:o,activeAttributes:i,value:a,onChange:s,onFocusOutside:l,stopAddingLink:c,contentRef:u,focusOnMount:h}){const m=function(e,n){let o=e.start,r=e.end;if(n){const t=N(e,{type:"core/link"});o=t.start,r=t.end+1}return(0,t.slice)(e,o,r)}(a,o).text,{selectionChange:d}=(0,A.useDispatch)(n.store),{createPageEntity:x,userCanCreatePages:v,selectionStart:f}=(0,A.useSelect)((t=>{const{getSettings:e,getSelectionStart:o}=t(n.store),r=e();return{createPageEntity:r.__experimentalCreatePageEntity,userCanCreatePages:r.__experimentalUserCanCreatePages,selectionStart:o()}}),[]),b=(0,g.useMemo)((()=>({url:i.url,type:i.type,id:i.id,opensInNewTab:"_blank"===i.target,nofollow:i.rel?.includes("nofollow"),title:m})),[i.id,i.rel,i.target,i.type,i.url,m]),w=(0,t.useAnchor)({editableContentElement:u.current,settings:{...E,isActive:o}});return(0,r.jsx)(p.Popover,{anchor:w,animate:!1,onClose:c,onFocusOutside:l,placement:"bottom",offset:8,shift:!0,focusOnMount:h,constrainTabbing:!0,children:(0,r.jsx)(n.LinkControl,{value:b,onChange:function(n){const r=b?.url,i=!r;n={...b,...n};const l=(0,k.prependHTTP)(n.url),u=function({url:t,type:e,id:n,opensInNewWindow:o,nofollow:r}){const i={type:"core/link",attributes:{url:t}};return e&&(i.attributes.type=e),n&&(i.attributes.id=n),o&&(i.attributes.target="_blank",i.attributes.rel=i.attributes.rel?i.attributes.rel+" noreferrer noopener":"noreferrer noopener"),r&&(i.attributes.rel=i.attributes.rel?i.attributes.rel+" nofollow":"nofollow"),i}({url:l,type:n.type,id:void 0!==n.id&&null!==n.id?String(n.id):void 0,opensInNewWindow:n.opensInNewTab,nofollow:n.nofollow}),h=n.title||l;let p;if((0,t.isCollapsed)(a)&&!o){const e=(0,t.insert)(a,h);return p=(0,t.applyFormat)(e,u,a.start,a.start+h.length),s(p),c(),void d({clientId:f.clientId,identifier:f.attributeKey,start:a.start+h.length+1})}if(h===m)p=(0,t.applyFormat)(a,u);else{p=(0,t.create)({text:h}),p=(0,t.applyFormat)(p,u,0,h.length);const e=N(a,{type:"core/link"}),[n,o]=(0,t.split)(a,e.start,e.start),r=(0,t.replace)(o,m,p);p=(0,t.concat)(n,r)}s(p),i||c(),F(l)?o?(0,T.speak)((0,e.__)("Link edited."),"assertive"):(0,T.speak)((0,e.__)("Link inserted."),"assertive"):(0,T.speak)((0,e.__)("Warning: the link has been inserted but may have errors. Please test it."),"assertive")},onRemove:function(){const n=(0,t.removeFormat)(a,"core/link");s(n),c(),(0,T.speak)((0,e.__)("Link removed."),"assertive")},hasRichPreviews:!0,createSuggestion:x&&async function(t){const e=await x({title:t,status:"draft"});return{id:e.id,type:e.type,title:e.title.rendered,url:e.link,kind:"post-type"}},withCreateSuggestion:v,createSuggestionButtonText:function(t){return(0,g.createInterpolateElement)((0,e.sprintf)((0,e.__)("Create page: %s"),t),{mark:(0,r.jsx)("mark",{})})},hasTextControl:!0,settings:B,showInitialSuggestions:!0,suggestionsQuery:{initialSuggestionsSearchOptions:{type:"post",subtype:"page",perPage:20}}})})},L="core/link",I=(0,e.__)("Link");const E={name:L,title:I,tagName:"a",className:null,attributes:{url:"href",type:"data-type",id:"data-id",_id:"id",target:"target",rel:"rel"},__unstablePasteRule(e,{html:n,plainText:o}){const r=(n||o).replace(/<[^>]+>/g,"").trim();if(!(0,k.isURL)(r)||!/^https?:/.test(r))return e;window.console.log("Created link:\n\n",r);const i={type:L,attributes:{url:(0,C.decodeEntities)(r)}};return(0,t.isCollapsed)(e)?(0,t.insert)(e,(0,t.applyFormat)((0,t.create)({text:o}),i,0,o.length)):(0,t.applyFormat)(e,i)},edit:function({isActive:o,activeAttributes:i,value:a,onChange:s,onFocus:l,contentRef:c}){const[u,h]=(0,g.useState)(!1),[m,p]=(0,g.useState)(null);function d(e){const n=(0,t.getTextContent)((0,t.slice)(a));!o&&n&&(0,k.isURL)(n)&&F(n)?s((0,t.applyFormat)(a,{type:L,attributes:{url:n}})):!o&&n&&(0,k.isEmail)(n)?s((0,t.applyFormat)(a,{type:L,attributes:{url:`mailto:${n}`}})):!o&&n&&(0,k.isPhoneNumber)(n)?s((0,t.applyFormat)(a,{type:L,attributes:{url:`tel:${n.replace(/\D/g,"")}`}})):(e&&p({el:e,action:null}),h(!0))}(0,g.useEffect)((()=>{o||h(!1)}),[o]),(0,g.useLayoutEffect)((()=>{const t=c.current;if(t)return t.addEventListener("click",e),()=>{t.removeEventListener("click",e)};function e(t){const e=t.target.closest("[contenteditable] a");e&&o&&(h(!0),p({el:e,action:"click"}))}}),[c,o]);const x=!("A"===m?.el?.tagName&&"click"===m?.action),v=!(0,t.isCollapsed)(a);return(0,r.jsxs)(r.Fragment,{children:[v&&(0,r.jsx)(n.RichTextShortcut,{type:"primary",character:"k",onUse:d}),(0,r.jsx)(n.RichTextShortcut,{type:"primaryShift",character:"k",onUse:function(){s((0,t.removeFormat)(a,L)),(0,T.speak)((0,e.__)("Link removed."),"assertive")}}),(0,r.jsx)(n.RichTextToolbarButton,{name:"link",icon:S,title:o?(0,e.__)("Link"):I,onClick:t=>{d(t.currentTarget)},isActive:o||u,shortcutType:"primary",shortcutCharacter:"k","aria-haspopup":"true","aria-expanded":u}),u&&(0,r.jsx)(z,{stopAddingLink:function(){h(!1),"BUTTON"===m?.el?.tagName?m.el.focus():l(),p(null)},onFocusOutside:function(){h(!1),p(null)},isActive:o,activeAttributes:i,value:a,onChange:s,contentRef:c,focusOnMount:!!x&&"firstElement"})]})}},H=(0,r.jsx)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,r.jsx)(o.Path,{d:"M9.1 9v-.5c0-.6.2-1.1.7-1.4.5-.3 1.2-.5 2-.5.7 0 1.4.1 2.1.3.7.2 1.4.5 2.1.9l.2-1.9c-.6-.3-1.2-.5-1.9-.7-.8-.1-1.6-.2-2.4-.2-1.5 0-2.7.3-3.6 1-.8.7-1.2 1.5-1.2 2.6V9h2zM20 12H4v1h8.3c.3.1.6.2.8.3.5.2.9.5 1.1.8.3.3.4.7.4 1.2 0 .7-.2 1.1-.8 1.5-.5.3-1.2.5-2.1.5-.8 0-1.6-.1-2.4-.3-.8-.2-1.5-.5-2.2-.8L7 18.1c.5.2 1.2.4 2 .6.8.2 1.6.3 2.4.3 1.7 0 3-.3 3.9-1 .9-.7 1.3-1.6 1.3-2.8 0-.9-.2-1.7-.7-2.2H20v-1z"})}),O="core/strikethrough",U=(0,e.__)("Strikethrough"),G={name:O,title:U,tagName:"s",className:null,edit({isActive:e,value:o,onChange:i,onFocus:a}){function s(){i((0,t.toggleFormat)(o,{type:O,title:U})),a()}return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.RichTextShortcut,{type:"access",character:"d",onUse:s}),(0,r.jsx)(n.RichTextToolbarButton,{icon:H,title:U,onClick:s,isActive:e,role:"menuitemcheckbox"})]})}},D="core/underline",W=(0,e.__)("Underline"),Z={name:D,title:W,tagName:"span",className:null,attributes:{style:"style"},edit({value:e,onChange:o}){const i=()=>{o((0,t.toggleFormat)(e,{type:D,attributes:{style:"text-decoration: underline;"},title:W}))};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.RichTextShortcut,{type:"primary",character:"u",onUse:i}),(0,r.jsx)(n.__unstableRichTextInputEvent,{inputType:"formatUnderline",onInput:i})]})}};const $=(0,g.forwardRef)((function({icon:t,size:e=24,...n},o){return(0,g.cloneElement)(t,{width:e,height:e,...n,ref:o})})),K=(0,r.jsx)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,r.jsx)(o.Path,{d:"M12.9 6h-2l-4 11h1.9l1.1-3h4.2l1.1 3h1.9L12.9 6zm-2.5 6.5l1.5-4.9 1.7 4.9h-3.2z"})}),Q=(0,r.jsx)(o.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)(o.Path,{d:"M17.2 10.9c-.5-1-1.2-2.1-2.1-3.2-.6-.9-1.3-1.7-2.1-2.6L12 4l-1 1.1c-.6.9-1.3 1.7-2 2.6-.8 1.2-1.5 2.3-2 3.2-.6 1.2-1 2.2-1 3 0 3.4 2.7 6.1 6.1 6.1s6.1-2.7 6.1-6.1c0-.8-.3-1.8-1-3zm-5.1 7.6c-2.5 0-4.6-2.1-4.6-4.6 0-.3.1-1 .8-2.3.5-.9 1.1-1.9 2-3.1.7-.9 1.3-1.7 1.8-2.3.7.8 1.3 1.6 1.8 2.3.8 1.1 1.5 2.2 2 3.1.7 1.3.8 2 .8 2.3 0 2.5-2.1 4.6-4.6 4.6z"})}),J=window.wp.privateApis,{lock:X,unlock:q}=(0,J.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/format-library"),{Tabs:Y}=q(p.privateApis),tt=[{name:"color",title:(0,e.__)("Text")},{name:"backgroundColor",title:(0,e.__)("Background")}];function et(t=""){return t.split(";").reduce(((t,e)=>{if(e){const[n,o]=e.split(":");"color"===n&&(t.color=o),"background-color"===n&&o!==at&&(t.backgroundColor=o)}return t}),{})}function nt(t="",e){return t.split(" ").reduce(((t,o)=>{if(o.startsWith("has-")&&o.endsWith("-color")){const r=o.replace(/^has-/,"").replace(/-color$/,""),i=(0,n.getColorObjectByAttributeValues)(e,r);t.color=i.color}return t}),{})}function ot(e,n,o){const r=(0,t.getActiveFormat)(e,n);return r?{...et(r.attributes.style),...nt(r.attributes.class,o)}:{}}function rt({name:e,property:o,value:i,onChange:a}){const s=(0,A.useSelect)((t=>{var e;const{getSettings:o}=t(n.store);return null!==(e=o().colors)&&void 0!==e?e:[]}),[]),l=(0,g.useMemo)((()=>ot(i,e,s)),[e,i,s]);return(0,r.jsx)(n.ColorPalette,{value:l[o],onChange:r=>{a(function(e,o,r,i){const{color:a,backgroundColor:s}={...ot(e,o,r),...i};if(!a&&!s)return(0,t.removeFormat)(e,o);const l=[],c=[],u={};if(s?l.push(["background-color",s].join(":")):l.push(["background-color",at].join(":")),a){const t=(0,n.getColorObjectByColorValue)(r,a);t?c.push((0,n.getColorClassName)("color",t.slug)):l.push(["color",a].join(":"))}return l.length&&(u.style=l.join(";")),c.length&&(u.class=c.join(" ")),(0,t.applyFormat)(e,{type:o,attributes:u})}(i,e,s,{[o]:r}))}})}function it({name:e,value:n,onChange:o,onClose:i,contentRef:a,isActive:s}){const l=(0,t.useAnchor)({editableContentElement:a.current,settings:{...ht,isActive:s}});return(0,r.jsx)(p.Popover,{onClose:i,className:"format-library__inline-color-popover",anchor:l,children:(0,r.jsxs)(Y,{children:[(0,r.jsx)(Y.TabList,{children:tt.map((t=>(0,r.jsx)(Y.Tab,{tabId:t.name,children:t.title},t.name)))}),tt.map((t=>(0,r.jsx)(Y.TabPanel,{tabId:t.name,focusable:!1,children:(0,r.jsx)(rt,{name:e,property:t.name,value:n,onChange:o})},t.name)))]})})}const at="rgba(0, 0, 0, 0)",st="core/text-color",lt=(0,e.__)("Highlight"),ct=[];function ut(t,e){const{ownerDocument:n}=t,{defaultView:o}=n,r=o.getComputedStyle(t).getPropertyValue(e);return"background-color"===e&&r===at&&t.parentElement?ut(t.parentElement,e):r}const ht={name:st,title:lt,tagName:"mark",className:"has-inline-color",attributes:{style:"style",class:"class"},edit:function({value:e,onChange:o,isActive:i,activeAttributes:a,contentRef:s}){const[l,c=ct]=(0,n.useSettings)("color.custom","color.palette"),[u,h]=(0,g.useState)(!1),m=(0,g.useMemo)((()=>function(t,{color:e,backgroundColor:n}){if(e||n)return{color:e||ut(t,"color"),backgroundColor:n===at?ut(t,"background-color"):n}}(s.current,ot(e,st,c))),[s,e,c]),p=!!c.length||l;return p||i?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.RichTextToolbarButton,{className:"format-library-text-color-button",isActive:i,icon:(0,r.jsx)($,{icon:Object.keys(a).length?K:Q,style:m}),title:lt,onClick:p?()=>h(!0):()=>o((0,t.removeFormat)(e,st)),role:"menuitemcheckbox"}),u&&(0,r.jsx)(it,{name:st,onClose:()=>h(!1),activeAttributes:a,value:e,onChange:o,contentRef:s,isActive:i})]}):null}},mt=(0,r.jsx)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,r.jsx)(o.Path,{d:"M16.9 18.3l.8-1.2c.4-.6.7-1.2.9-1.6.2-.4.3-.8.3-1.2 0-.3-.1-.7-.2-1-.1-.3-.4-.5-.6-.7-.3-.2-.6-.3-1-.3s-.8.1-1.1.2c-.3.1-.7.3-1 .6l.2 1.3c.3-.3.5-.5.8-.6s.6-.2.9-.2c.3 0 .5.1.7.2.2.2.2.4.2.7 0 .3-.1.5-.2.8-.1.3-.4.7-.8 1.3L15 19.4h4.3v-1.2h-2.4zM14.1 7.2h-2L9.5 11 6.9 7.2h-2l3.6 5.3L4.7 18h2l2.7-4 2.7 4h2l-3.8-5.5 3.8-5.3z"})}),pt="core/subscript",gt=(0,e.__)("Subscript"),dt={name:pt,title:gt,tagName:"sub",className:null,edit:({isActive:e,value:o,onChange:i,onFocus:a})=>(0,r.jsx)(n.RichTextToolbarButton,{icon:mt,title:gt,onClick:function(){i((0,t.toggleFormat)(o,{type:pt,title:gt})),a()},isActive:e,role:"menuitemcheckbox"})},xt=(0,r.jsx)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,r.jsx)(o.Path,{d:"M16.9 10.3l.8-1.3c.4-.6.7-1.2.9-1.6.2-.4.3-.8.3-1.2 0-.3-.1-.7-.2-1-.2-.2-.4-.4-.7-.6-.3-.2-.6-.3-1-.3s-.8.1-1.1.2c-.3.1-.7.3-1 .6l.1 1.3c.3-.3.5-.5.8-.6s.6-.2.9-.2c.3 0 .5.1.7.2.2.2.2.4.2.7 0 .3-.1.5-.2.8-.1.3-.4.7-.8 1.3l-1.8 2.8h4.3v-1.2h-2.2zm-2.8-3.1h-2L9.5 11 6.9 7.2h-2l3.6 5.3L4.7 18h2l2.7-4 2.7 4h2l-3.8-5.5 3.8-5.3z"})}),vt="core/superscript",ft=(0,e.__)("Superscript"),bt={name:vt,title:ft,tagName:"sup",className:null,edit:({isActive:e,value:o,onChange:i,onFocus:a})=>(0,r.jsx)(n.RichTextToolbarButton,{icon:xt,title:ft,onClick:function(){i((0,t.toggleFormat)(o,{type:vt,title:ft})),a()},isActive:e,role:"menuitemcheckbox"})},wt=(0,r.jsx)(o.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)(o.Path,{d:"M8 12.5h8V11H8v1.5Z M19 6.5H5a2 2 0 0 0-2 2V15a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8.5a2 2 0 0 0-2-2ZM5 8h14a.5.5 0 0 1 .5.5V15a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V8.5A.5.5 0 0 1 5 8Z"})}),_t="core/keyboard",yt=(0,e.__)("Keyboard input"),jt={name:_t,title:yt,tagName:"kbd",className:null,edit:({isActive:e,value:o,onChange:i,onFocus:a})=>(0,r.jsx)(n.RichTextToolbarButton,{icon:wt,title:yt,onClick:function(){i((0,t.toggleFormat)(o,{type:_t,title:yt})),a()},isActive:e,role:"menuitemcheckbox"})},kt=(0,r.jsx)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,r.jsx)(o.Path,{d:"M12 4.75a7.25 7.25 0 100 14.5 7.25 7.25 0 000-14.5zM3.25 12a8.75 8.75 0 1117.5 0 8.75 8.75 0 01-17.5 0zM12 8.75a1.5 1.5 0 01.167 2.99c-.465.052-.917.44-.917 1.01V14h1.5v-.845A3 3 0 109 10.25h1.5a1.5 1.5 0 011.5-1.5zM11.25 15v1.5h1.5V15h-1.5z"})}),Ct="core/unknown",St=(0,e.__)("Clear Unknown Formatting");const Tt={name:Ct,title:St,tagName:"*",className:null,edit({isActive:e,value:o,onChange:i,onFocus:a}){if(!e&&!function(e){return!(0,t.isCollapsed)(e)&&(0,t.slice)(e).formats.some((t=>t.some((t=>t.type===Ct))))}(o))return null;return(0,r.jsx)(n.RichTextToolbarButton,{name:"unknown",icon:kt,title:St,onClick:function(){i((0,t.removeFormat)(o,Ct)),a()},isActive:!0})}},At=(0,r.jsx)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,r.jsx)(o.Path,{d:"M17.5 10h-1.7l-3.7 10.5h1.7l.9-2.6h3.9l.9 2.6h1.7L17.5 10zm-2.2 6.3 1.4-4 1.4 4h-2.8zm-4.8-3.8c1.6-1.8 2.9-3.6 3.7-5.7H16V5.2h-5.8V3H8.8v2.2H3v1.5h9.6c-.7 1.6-1.8 3.1-3.1 4.6C8.6 10.2 7.8 9 7.2 8H5.6c.6 1.4 1.7 2.9 2.9 4.4l-2.4 2.4c-.3.4-.7.8-1.1 1.2l1 1 1.2-1.2c.8-.8 1.6-1.5 2.3-2.3.8.9 1.7 1.7 2.5 2.5l.6-1.5c-.7-.6-1.4-1.3-2.1-2z"})}),Ft="core/language",Nt=(0,e.__)("Language"),Rt={name:Ft,tagName:"bdo",className:null,edit:function({isActive:e,value:o,onChange:i,contentRef:a}){const[s,l]=(0,g.useState)(!1),c=()=>{l((t=>!t))};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.RichTextToolbarButton,{icon:At,label:Nt,title:Nt,onClick:()=>{e?i((0,t.removeFormat)(o,Ft)):c()},isActive:e,role:"menuitemcheckbox"}),s&&(0,r.jsx)(Vt,{value:o,onChange:i,onClose:c,contentRef:a})]})},title:Nt};function Vt({value:n,contentRef:o,onChange:i,onClose:a}){const s=(0,t.useAnchor)({editableContentElement:o.current,settings:Rt}),[l,c]=(0,g.useState)(""),[u,h]=(0,g.useState)("ltr");return(0,r.jsx)(p.Popover,{className:"block-editor-format-toolbar__language-popover",anchor:s,onClose:a,children:(0,r.jsxs)(p.__experimentalVStack,{as:"form",spacing:4,className:"block-editor-format-toolbar__language-container-content",onSubmit:e=>{e.preventDefault(),i((0,t.applyFormat)(n,{type:Ft,attributes:{lang:l,dir:u}})),a()},children:[(0,r.jsx)(p.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:Nt,value:l,onChange:t=>c(t),help:(0,e.__)('A valid language attribute, like "en" or "fr".')}),(0,r.jsx)(p.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,e.__)("Text direction"),value:u,options:[{label:(0,e.__)("Left to right"),value:"ltr"},{label:(0,e.__)("Right to left"),value:"rtl"}],onChange:t=>h(t)}),(0,r.jsx)(p.__experimentalHStack,{alignment:"right",children:(0,r.jsx)(p.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",text:(0,e.__)("Apply")})})]})})}const Mt=(0,e.__)("Non breaking space");[l,m,f,j,E,G,Z,ht,dt,bt,jt,Tt,Rt,{name:"core/non-breaking-space",title:Mt,tagName:"nbsp",className:null,edit:({value:e,onChange:o})=>(0,r.jsx)(n.RichTextShortcut,{type:"primaryShift",character:" ",onUse:function(){o((0,t.insert)(e," "))}})}].forEach((({name:e,...n})=>(0,t.registerFormatType)(e,n))),(window.wp=window.wp||{}).formatLibrary={}})(); \ No newline at end of file diff --git a/wp-includes/js/dist/hooks.js b/wp-includes/js/dist/hooks.js index 4848b96a5c..767e99e3fb 100644 --- a/wp-includes/js/dist/hooks.js +++ b/wp-includes/js/dist/hooks.js @@ -118,6 +118,7 @@ function validateHookName(hookName) { /* harmony default export */ const build_module_validateHookName = (validateHookName); ;// ./node_modules/@wordpress/hooks/build-module/createAddHook.js +/* wp:polyfill */ /** * Internal dependencies */ @@ -212,6 +213,7 @@ function createAddHook(hooks, storeKey) { /* harmony default export */ const build_module_createAddHook = (createAddHook); ;// ./node_modules/@wordpress/hooks/build-module/createRemoveHook.js +/* wp:polyfill */ /** * Internal dependencies */ @@ -292,6 +294,7 @@ function createRemoveHook(hooks, storeKey, removeAll = false) { /* harmony default export */ const build_module_createRemoveHook = (createRemoveHook); ;// ./node_modules/@wordpress/hooks/build-module/createHasHook.js +/* wp:polyfill */ /** * @callback HasHook * @@ -421,6 +424,7 @@ function createCurrentHook(hooks, storeKey) { /* harmony default export */ const build_module_createCurrentHook = (createCurrentHook); ;// ./node_modules/@wordpress/hooks/build-module/createDoingHook.js +/* wp:polyfill */ /** * @callback DoingHook * Returns whether a hook is currently being executed. diff --git a/wp-includes/js/dist/i18n.js b/wp-includes/js/dist/i18n.js index a64955552d..32c1d66e78 100644 --- a/wp-includes/js/dist/i18n.js +++ b/wp-includes/js/dist/i18n.js @@ -1040,6 +1040,7 @@ Tannin.prototype.dcnpgettext = function( domain, context, singular, plural, n ) }; ;// ./node_modules/@wordpress/i18n/build-module/create-i18n.js +/* wp:polyfill */ /** * External dependencies */ @@ -1319,9 +1320,7 @@ const createI18n = (initialData, initialDomain, hooks) => { */ translation = /** @type {string} */ /** @type {*} */hooks.applyFilters('i18n.gettext', translation, text, domain); - return /** @type {string} */( - /** @type {*} */hooks.applyFilters('i18n.gettext_' + getFilterDomain(domain), translation, text, domain) - ); + return /** @type {string} */ /** @type {*} */hooks.applyFilters('i18n.gettext_' + getFilterDomain(domain), translation, text, domain); }; /** @type {_x} */ @@ -1341,9 +1340,7 @@ const createI18n = (initialData, initialDomain, hooks) => { */ translation = /** @type {string} */ /** @type {*} */hooks.applyFilters('i18n.gettext_with_context', translation, text, context, domain); - return /** @type {string} */( - /** @type {*} */hooks.applyFilters('i18n.gettext_with_context_' + getFilterDomain(domain), translation, text, context, domain) - ); + return /** @type {string} */ /** @type {*} */hooks.applyFilters('i18n.gettext_with_context_' + getFilterDomain(domain), translation, text, context, domain); }; /** @type {_n} */ @@ -1364,9 +1361,7 @@ const createI18n = (initialData, initialDomain, hooks) => { */ translation = /** @type {string} */ /** @type {*} */hooks.applyFilters('i18n.ngettext', translation, single, plural, number, domain); - return /** @type {string} */( - /** @type {*} */hooks.applyFilters('i18n.ngettext_' + getFilterDomain(domain), translation, single, plural, number, domain) - ); + return /** @type {string} */ /** @type {*} */hooks.applyFilters('i18n.ngettext_' + getFilterDomain(domain), translation, single, plural, number, domain); }; /** @type {_nx} */ @@ -1388,9 +1383,7 @@ const createI18n = (initialData, initialDomain, hooks) => { */ translation = /** @type {string} */ /** @type {*} */hooks.applyFilters('i18n.ngettext_with_context', translation, single, plural, number, context, domain); - return /** @type {string} */( - /** @type {*} */hooks.applyFilters('i18n.ngettext_with_context_' + getFilterDomain(domain), translation, single, plural, number, context, domain) - ); + return /** @type {string} */ /** @type {*} */hooks.applyFilters('i18n.ngettext_with_context_' + getFilterDomain(domain), translation, single, plural, number, context, domain); }; /** @type {IsRtl} */ diff --git a/wp-includes/js/dist/keyboard-shortcuts.js b/wp-includes/js/dist/keyboard-shortcuts.js index 714002deac..4e47a1f569 100644 --- a/wp-includes/js/dist/keyboard-shortcuts.js +++ b/wp-includes/js/dist/keyboard-shortcuts.js @@ -233,6 +233,7 @@ function unregisterShortcut(name) { ;// external ["wp","keycodes"] const external_wp_keycodes_namespaceObject = window["wp"]["keycodes"]; ;// ./node_modules/@wordpress/keyboard-shortcuts/build-module/store/selectors.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -271,7 +272,7 @@ const FORMATTING_METHODS = { * @param {keyof FORMATTING_METHODS} representation Type of representation * (display, raw, ariaLabel). * - * @return {string?} Shortcut representation. + * @return {?string} Shortcut representation. */ function getKeyCombinationRepresentation(shortcut, representation) { if (!shortcut) { @@ -361,7 +362,7 @@ function getShortcutKeyCombination(state, name) { * }; *``` * - * @return {string?} Shortcut representation. + * @return {?string} Shortcut representation. */ function getShortcutRepresentation(state, name, representation = 'display') { const shortcut = getShortcutKeyCombination(state, name); @@ -394,7 +395,7 @@ function getShortcutRepresentation(state, name, representation = 'display') { * ); * }; *``` - * @return {string?} Shortcut description. + * @return {?string} Shortcut description. */ function getShortcutDescription(state, name) { return state[name] ? state[name].description : null; @@ -624,6 +625,7 @@ const store = (0,external_wp_data_namespaceObject.createReduxStore)(STORE_NAME, ;// external ["wp","element"] const external_wp_element_namespaceObject = window["wp"]["element"]; ;// ./node_modules/@wordpress/keyboard-shortcuts/build-module/hooks/use-shortcut-event-match.js +/* wp:polyfill */ /** * WordPress dependencies */ diff --git a/wp-includes/js/dist/keycodes.js b/wp-includes/js/dist/keycodes.js index 4e562bdd8f..72ec85a4a0 100644 --- a/wp-includes/js/dist/keycodes.js +++ b/wp-includes/js/dist/keycodes.js @@ -92,6 +92,7 @@ function isAppleOS(_window = null) { } ;// ./node_modules/@wordpress/keycodes/build-module/index.js +/* wp:polyfill */ /** * Note: The order of the modifier keys in many of the [foo]Shortcut() * functions in this file are intentional and should not be changed. They're @@ -294,7 +295,8 @@ const modifiers = { * @type {WPModifierHandler>} Keyed map of functions to raw * shortcuts. */ -const rawShortcut = mapValues(modifiers, ( /** @type {WPModifier} */modifier) => { +const rawShortcut = /* @__PURE__ */ +mapValues(modifiers, (/** @type {WPModifier} */modifier) => { return /** @type {WPKeyHandler} */(character, _isApple = isAppleOS) => { return [...modifier(_isApple), character.toLowerCase()].join('+'); }; @@ -313,7 +315,8 @@ const rawShortcut = mapValues(modifiers, ( /** @type {WPModifier} */modifier) => * @type {WPModifierHandler>} Keyed map of functions to * shortcut sequences. */ -const displayShortcutList = mapValues(modifiers, ( /** @type {WPModifier} */modifier) => { +const displayShortcutList = /* @__PURE__ */ +mapValues(modifiers, (/** @type {WPModifier} */modifier) => { return /** @type {WPKeyHandler} */(character, _isApple = isAppleOS) => { const isApple = _isApple(); const replacementKeyMap = { @@ -349,7 +352,8 @@ const displayShortcutList = mapValues(modifiers, ( /** @type {WPModifier} */modi * @type {WPModifierHandler>} Keyed map of functions to * display shortcuts. */ -const displayShortcut = mapValues(displayShortcutList, ( /** @type {WPKeyHandler} */shortcutList) => { +const displayShortcut = /* @__PURE__ */ +mapValues(displayShortcutList, (/** @type {WPKeyHandler} */shortcutList) => { return /** @type {WPKeyHandler} */(character, _isApple = isAppleOS) => shortcutList(character, _isApple).join(''); }); @@ -367,7 +371,8 @@ const displayShortcut = mapValues(displayShortcutList, ( /** @type {WPKeyHandler * @type {WPModifierHandler>} Keyed map of functions to * shortcut ARIA labels. */ -const shortcutAriaLabel = mapValues(modifiers, ( /** @type {WPModifier} */modifier) => { +const shortcutAriaLabel = /* @__PURE__ */ +mapValues(modifiers, (/** @type {WPModifier} */modifier) => { return /** @type {WPKeyHandler} */(character, _isApple = isAppleOS) => { const isApple = _isApple(); /** @type {Record} */ @@ -401,7 +406,7 @@ const shortcutAriaLabel = mapValues(modifiers, ( /** @type {WPModifier} */modifi * @return {Array} Active modifier constants. */ function getEventModifiers(event) { - return /** @type {WPModifierPart[]} */[ALT, CTRL, COMMAND, SHIFT].filter(key => event[( /** @type {'altKey' | 'ctrlKey' | 'metaKey' | 'shiftKey'} */ + return /** @type {WPModifierPart[]} */[ALT, CTRL, COMMAND, SHIFT].filter(key => event[(/** @type {'altKey' | 'ctrlKey' | 'metaKey' | 'shiftKey'} */ `${key}Key`)]); } @@ -419,7 +424,8 @@ function getEventModifiers(event) { * @type {WPModifierHandler} Keyed map of functions * to match events. */ -const isKeyboardEvent = mapValues(modifiers, ( /** @type {WPModifier} */getModifiers) => { +const isKeyboardEvent = /* @__PURE__ */ +mapValues(modifiers, (/** @type {WPModifier} */getModifiers) => { return /** @type {WPEventKeyHandler} */(event, character, _isApple = isAppleOS) => { const mods = getModifiers(_isApple); const eventMods = getEventModifiers(event); @@ -438,7 +444,7 @@ const isKeyboardEvent = mapValues(modifiers, ( /** @type {WPModifier} */getModif } let key = event.key.toLowerCase(); if (!character) { - return mods.includes( /** @type {WPModifierPart} */key); + return mods.includes(/** @type {WPModifierPart} */key); } if (event.altKey && character.length === 1) { key = String.fromCharCode(event.keyCode).toLowerCase(); diff --git a/wp-includes/js/dist/list-reusable-blocks.js b/wp-includes/js/dist/list-reusable-blocks.js index 182622fc0b..e92ed26f20 100644 --- a/wp-includes/js/dist/list-reusable-blocks.js +++ b/wp-includes/js/dist/list-reusable-blocks.js @@ -306,10 +306,19 @@ var __setModuleDefault = Object.create ? (function(o, v) { o["default"] = v; }; +var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); +}; + function __importStar(mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); __setModuleDefault(result, mod); return result; } @@ -390,12 +399,25 @@ function __disposeResources(env) { return next(); } +function __rewriteRelativeImportExtension(path, preserveJsx) { + if (typeof path === "string" && /^\.\.?\//.test(path)) { + return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) { + return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js"); + }); + } + return path; +} + /* harmony default export */ const tslib_es6 = ({ __extends, __assign, __rest, __decorate, __param, + __esDecorate, + __runInitializers, + __propKey, + __setFunctionName, __metadata, __awaiter, __generator, @@ -418,6 +440,7 @@ function __disposeResources(env) { __classPrivateFieldIn, __addDisposableResource, __disposeResources, + __rewriteRelativeImportExtension, }); ;// ./node_modules/lower-case/dist.es2015/index.js @@ -648,7 +671,6 @@ const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"]; */ - function ImportForm({ instanceId, onUpload @@ -811,7 +833,7 @@ document.addEventListener('DOMContentLoaded', () => { const container = document.createElement('div'); container.className = 'list-reusable-blocks__container'; button.parentNode.insertBefore(container, button); - (0,external_wp_element_namespaceObject.createRoot)(container).render( /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.StrictMode, { + (0,external_wp_element_namespaceObject.createRoot)(container).render(/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.StrictMode, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(import_dropdown, { onUpload: showNotice }) diff --git a/wp-includes/js/dist/media-utils.js b/wp-includes/js/dist/media-utils.js index 12c3b92dbf..d58a356b98 100644 --- a/wp-includes/js/dist/media-utils.js +++ b/wp-includes/js/dist/media-utils.js @@ -52,6 +52,7 @@ __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { MediaUpload: () => (/* reexport */ media_upload), + privateApis: () => (/* reexport */ privateApis), transformAttachment: () => (/* reexport */ transformAttachment), uploadMedia: () => (/* reexport */ uploadMedia), validateFileSize: () => (/* reexport */ validateFileSize), @@ -64,6 +65,7 @@ const external_wp_element_namespaceObject = window["wp"]["element"]; ;// external ["wp","i18n"] const external_wp_i18n_namespaceObject = window["wp"]["i18n"]; ;// ./node_modules/@wordpress/media-utils/build-module/components/media-upload/index.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -126,6 +128,45 @@ const getFeaturedImageMediaFrame = () => { }); }; +/** + * Prepares the default frame for selecting a single media item. + * + * @return {window.wp.media.view.MediaFrame.Select} The default media workflow. + */ +const getSingleMediaFrame = () => { + const { + wp + } = window; + + // Extend the default Select frame, and use the same `createStates` method as in core, + // but with the addition of `filterable: 'uploaded'` to the Library state, so that + // the user can filter the media library by uploaded media. + return wp.media.view.MediaFrame.Select.extend({ + /** + * Create the default states on the frame. + */ + createStates() { + const options = this.options; + if (this.options.states) { + return; + } + + // Add the default states. + this.states.add([ + // Main states. + new wp.media.controller.Library({ + library: wp.media.query(options.library), + multiple: options.multiple, + title: options.title, + priority: 20, + filterable: 'uploaded' // Allow filtering by uploaded images. + }), new wp.media.controller.EditImage({ + model: options.editImage + })]); + } + }); +}; + /** * Prepares the Gallery toolbars and frames. * @@ -315,7 +356,7 @@ class MediaUpload extends external_wp_element_namespaceObject.Component { state: currentState, multiple, selection, - editing: value && value.length ? true : false + editing: !!value?.length }); wp.media.frame = this.frame; this.initializeListeners(); @@ -357,6 +398,49 @@ class MediaUpload extends external_wp_element_namespaceObject.Component { featuredImageId: featuredImageId || -1 }; } + + /** + * Initializes the Media Library requirements for the single image flow. + * + * @return {void} + */ + buildAndSetSingleMediaFrame() { + const { + wp + } = window; + const { + allowedTypes, + multiple = false, + title = (0,external_wp_i18n_namespaceObject.__)('Select or Upload Media'), + value + } = this.props; + const frameConfig = { + title, + multiple + }; + if (!!allowedTypes) { + frameConfig.library = { + type: allowedTypes + }; + } + + // If a frame already exists, remove it. + if (this.frame) { + this.frame.remove(); + } + const singleImageFrame = getSingleMediaFrame(); + const attachments = getAttachmentsCollection(value); + const selection = new wp.media.model.Selection(attachments.models, { + props: attachments.props.toJSON() + }); + this.frame = new singleImageFrame({ + mimeType: allowedTypes, + multiple, + selection, + ...frameConfig + }); + wp.media.frame = this.frame; + } componentWillUnmount() { this.frame?.remove(); } @@ -450,29 +534,14 @@ class MediaUpload extends external_wp_element_namespaceObject.Component { } openModal() { const { - allowedTypes, gallery = false, unstableFeaturedImageFlow = false, - modalClass, - multiple = false, - title = (0,external_wp_i18n_namespaceObject.__)('Select or Upload Media') + modalClass } = this.props; - const { - wp - } = window; if (gallery) { this.buildAndSetGalleryFrame(); } else { - const frameConfig = { - title, - multiple - }; - if (!!allowedTypes) { - frameConfig.library = { - type: allowedTypes - }; - } - this.frame = wp.media(frameConfig); + this.buildAndSetSingleMediaFrame(); } if (modalClass) { this.frame.$el.addClass(modalClass); @@ -605,6 +674,7 @@ class UploadError extends Error { } ;// ./node_modules/@wordpress/media-utils/build-module/utils/validate-mime-type.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -647,6 +717,7 @@ function validateMimeType(file, allowedTypes) { } ;// ./node_modules/@wordpress/media-utils/build-module/utils/get-mime-types-array.js +/* wp:polyfill */ /** * Browsers may use unexpected mime types, and they differ from browser to browser. * This function computes a flexible array of mime types from the mime type structured provided by the server. @@ -786,8 +857,11 @@ function uploadMedia({ const validFiles = []; const filesSet = []; const setAndUpdateFiles = (index, value) => { - if (filesSet[index]?.url) { - (0,external_wp_blob_namespaceObject.revokeBlobURL)(filesSet[index].url); + // For client-side media processing, this is handled by the upload-media package. + if (!window.__experimentalMediaProcessing) { + if (filesSet[index]?.url) { + (0,external_wp_blob_namespaceObject.revokeBlobURL)(filesSet[index].url); + } } filesSet[index] = value; onFileChange?.(filesSet.filter(attachment => attachment !== null)); @@ -820,12 +894,15 @@ function uploadMedia({ } validFiles.push(mediaFile); - // Set temporary URL to create placeholder media file, this is replaced - // with final file from media gallery when upload is `done` below. - filesSet.push({ - url: (0,external_wp_blob_namespaceObject.createBlobURL)(mediaFile) - }); - onFileChange?.(filesSet); + // For client-side media processing, this is handled by the upload-media package. + if (!window.__experimentalMediaProcessing) { + // Set temporary URL to create placeholder media file, this is replaced + // with final file from media gallery when upload is `done` below. + filesSet.push({ + url: (0,external_wp_blob_namespaceObject.createBlobURL)(mediaFile) + }); + onFileChange?.(filesSet); + } } validFiles.map(async (file, index) => { try { @@ -852,6 +929,124 @@ function uploadMedia({ }); } +;// ./node_modules/@wordpress/media-utils/build-module/utils/sideload-to-server.js +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + + + +/** + * Uploads a file to the server without creating an attachment. + * + * @param file Media File to Save. + * @param attachmentId Parent attachment ID. + * @param additionalData Additional data to include in the request. + * @param signal Abort signal. + * + * @return The saved attachment. + */ +async function sideloadToServer(file, attachmentId, additionalData = {}, signal) { + // Create upload payload. + const data = new FormData(); + data.append('file', file, file.name || file.type.replace('/', '.')); + for (const [key, value] of Object.entries(additionalData)) { + flattenFormData(data, key, value); + } + return transformAttachment(await external_wp_apiFetch_default()({ + path: `/wp/v2/media/${attachmentId}/sideload`, + body: data, + method: 'POST', + signal + })); +} + +;// ./node_modules/@wordpress/media-utils/build-module/utils/sideload-media.js +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + + +const noop = () => {}; +/** + * Uploads a file to the server without creating an attachment. + * + * @param $0 Parameters object passed to the function. + * @param $0.file Media File to Save. + * @param $0.attachmentId Parent attachment ID. + * @param $0.additionalData Additional data to include in the request. + * @param $0.signal Abort signal. + * @param $0.onFileChange Function called each time a file or a temporary representation of the file is available. + * @param $0.onError Function called when an error happens. + */ +async function sideloadMedia({ + file, + attachmentId, + additionalData = {}, + signal, + onFileChange, + onError = noop +}) { + try { + const attachment = await sideloadToServer(file, attachmentId, additionalData, signal); + onFileChange?.([attachment]); + } catch (error) { + let message; + if (error instanceof Error) { + message = error.message; + } else { + message = (0,external_wp_i18n_namespaceObject.sprintf)( + // translators: %s: file name + (0,external_wp_i18n_namespaceObject.__)('Error while sideloading file %s to the server.'), file.name); + } + onError(new UploadError({ + code: 'GENERAL', + message, + file, + cause: error instanceof Error ? error : undefined + })); + } +} + +;// external ["wp","privateApis"] +const external_wp_privateApis_namespaceObject = window["wp"]["privateApis"]; +;// ./node_modules/@wordpress/media-utils/build-module/lock-unlock.js +/** + * WordPress dependencies + */ + +const { + lock, + unlock +} = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/media-utils'); + +;// ./node_modules/@wordpress/media-utils/build-module/private-apis.js +/** + * Internal dependencies + */ + + + +/** + * Private @wordpress/media-utils APIs. + */ +const privateApis = {}; +lock(privateApis, { + sideloadMedia: sideloadMedia +}); + ;// ./node_modules/@wordpress/media-utils/build-module/index.js @@ -860,6 +1055,7 @@ function uploadMedia({ + (window.wp = window.wp || {}).mediaUtils = __webpack_exports__; /******/ })() ; \ No newline at end of file diff --git a/wp-includes/js/dist/media-utils.min.js b/wp-includes/js/dist/media-utils.min.js index dc4328b76c..fdf5786cfa 100644 --- a/wp-includes/js/dist/media-utils.min.js +++ b/wp-includes/js/dist/media-utils.min.js @@ -1,2 +1,2 @@ /*! This file is auto-generated */ -(()=>{"use strict";var e={n:t=>{var i=t&&t.__esModule?()=>t.default:()=>t;return e.d(i,{a:i}),i},d:(t,i)=>{for(var o in i)e.o(i,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:i[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{MediaUpload:()=>p,transformAttachment:()=>y,uploadMedia:()=>S,validateFileSize:()=>b,validateMimeType:()=>w,validateMimeTypeForUser:()=>g});const i=window.wp.element,o=window.wp.i18n,a=[],s=()=>{const{wp:e}=window;return e.media.view.MediaFrame.Select.extend({featuredImageToolbar(t){this.createSelectToolbar(t,{text:e.media.view.l10n.setFeaturedImage,state:this.options.state})},editState(){const t=this.state("featured-image").get("selection"),i=new e.media.view.EditImage({model:t.single(),controller:this}).render();this.content.set(i),i.loadEditor()},createStates:function(){this.on("toolbar:create:featured-image",this.featuredImageToolbar,this),this.on("content:render:edit-image",this.editState,this),this.states.add([new e.media.controller.FeaturedImage,new e.media.controller.EditImage({model:this.options.editImage})])}})},r=()=>{const{wp:e}=window;return e.media.view.MediaFrame.Post.extend({galleryToolbar(){const t=this.state().get("editing");this.toolbar.set(new e.media.view.Toolbar({controller:this,items:{insert:{style:"primary",text:t?e.media.view.l10n.updateGallery:e.media.view.l10n.insertGallery,priority:80,requires:{library:!0},click(){const e=this.controller,t=e.state();e.close(),t.trigger("update",t.get("library")),e.setState(e.options.state),e.reset()}}}}))},editState(){const t=this.state("gallery").get("selection"),i=new e.media.view.EditImage({model:t.single(),controller:this}).render();this.content.set(i),i.loadEditor()},createStates:function(){this.on("toolbar:create:main-gallery",this.galleryToolbar,this),this.on("content:render:edit-image",this.editState,this),this.states.add([new e.media.controller.Library({id:"gallery",title:e.media.view.l10n.createGalleryTitle,priority:40,toolbar:"main-gallery",filterable:"uploaded",multiple:"add",editable:!1,library:e.media.query({type:"image",...this.options.library})}),new e.media.controller.EditImage({model:this.options.editImage}),new e.media.controller.GalleryEdit({library:this.options.selection,editing:this.options.editing,menu:"gallery",displaySettings:!1,multiple:!0}),new e.media.controller.GalleryAdd])}})},n=e=>["sizes","mime","type","subtype","id","url","alt","link","caption"].reduce(((t,i)=>(e?.hasOwnProperty(i)&&(t[i]=e[i]),t)),{}),l=e=>{const{wp:t}=window;return t.media.query({order:"ASC",orderby:"post__in",post__in:e,posts_per_page:-1,query:!0,type:"image"})};class d extends i.Component{constructor(){super(...arguments),this.openModal=this.openModal.bind(this),this.onOpen=this.onOpen.bind(this),this.onSelect=this.onSelect.bind(this),this.onUpdate=this.onUpdate.bind(this),this.onClose=this.onClose.bind(this)}initializeListeners(){this.frame.on("select",this.onSelect),this.frame.on("update",this.onUpdate),this.frame.on("open",this.onOpen),this.frame.on("close",this.onClose)}buildAndSetGalleryFrame(){const{addToGallery:e=!1,allowedTypes:t,multiple:i=!1,value:o=a}=this.props;if(o===this.lastGalleryValue)return;const{wp:s}=window;let n;this.lastGalleryValue=o,this.frame&&this.frame.remove(),n=e?"gallery-library":o&&o.length?"gallery-edit":"gallery",this.GalleryDetailsMediaFrame||(this.GalleryDetailsMediaFrame=r());const d=l(o),p=new s.media.model.Selection(d.models,{props:d.props.toJSON(),multiple:i});this.frame=new this.GalleryDetailsMediaFrame({mimeType:t,state:n,multiple:i,selection:p,editing:!(!o||!o.length)}),s.media.frame=this.frame,this.initializeListeners()}buildAndSetFeatureImageFrame(){const{wp:e}=window,{value:t,multiple:i,allowedTypes:o}=this.props,a=s(),r=l(t),n=new e.media.model.Selection(r.models,{props:r.props.toJSON()});this.frame=new a({mimeType:o,state:"featured-image",multiple:i,selection:n,editing:t}),e.media.frame=this.frame,e.media.view.settings.post={...e.media.view.settings.post,featuredImageId:t||-1}}componentWillUnmount(){this.frame?.remove()}onUpdate(e){const{onSelect:t,multiple:i=!1}=this.props,o=this.frame.state(),a=e||o.get("selection");a&&a.models.length&&t(i?a.models.map((e=>n(e.toJSON()))):n(a.models[0].toJSON()))}onSelect(){const{onSelect:e,multiple:t=!1}=this.props,i=this.frame.state().get("selection").toJSON();e(t?i:i[0])}onOpen(){const{wp:e}=window,{value:t}=this.props;this.updateCollection(),this.props.mode&&this.frame.content.mode(this.props.mode);if(!(Array.isArray(t)?!!t?.length:!!t))return;const i=this.props.gallery,o=this.frame.state().get("selection"),a=Array.isArray(t)?t:[t];i||a.forEach((t=>{o.add(e.media.attachment(t))}));const s=l(a);s.more().done((function(){i&&s?.models?.length&&o.add(s.models)}))}onClose(){const{onClose:e}=this.props;e&&e(),this.frame.detach()}updateCollection(){const e=this.frame.content.get();if(e&&e.collection){const t=e.collection;t.toArray().forEach((e=>e.trigger("destroy",e))),t.mirroring._hasMore=!0,t.more()}}openModal(){const{allowedTypes:e,gallery:t=!1,unstableFeaturedImageFlow:i=!1,modalClass:a,multiple:s=!1,title:r=(0,o.__)("Select or Upload Media")}=this.props,{wp:n}=window;if(t)this.buildAndSetGalleryFrame();else{const t={title:r,multiple:s};e&&(t.library={type:e}),this.frame=n.media(t)}a&&this.frame.$el.addClass(a),i&&this.buildAndSetFeatureImageFrame(),this.initializeListeners(),this.frame.open()}render(){return this.props.render({open:this.openModal})}}const p=d,m=window.wp.blob,c=window.wp.apiFetch;var h=e.n(c);function u(e,t,i){if(function(e){return null!==e&&"object"==typeof e&&Object.getPrototypeOf(e)===Object.prototype}(i))for(const[o,a]of Object.entries(i))u(e,`${t}[${o}]`,a);else void 0!==i&&e.append(t,String(i))}function y(e){var t;const{alt_text:i,source_url:o,...a}=e;return{...a,alt:e.alt_text,caption:null!==(t=e.caption?.raw)&&void 0!==t?t:"",title:e.title.raw,url:e.source_url,poster:e._embedded?.["wp:featuredmedia"]?.[0]?.source_url||void 0}}class f extends Error{constructor({code:e,message:t,file:i,cause:o}){super(t,{cause:o}),Object.setPrototypeOf(this,new.target.prototype),this.code=e,this.file=i}}function w(e,t){if(!t)return;const i=t.some((t=>t.includes("/")?t===e.type:e.type.startsWith(`${t}/`)));if(e.type&&!i)throw new f({code:"MIME_TYPE_NOT_SUPPORTED",message:(0,o.sprintf)((0,o.__)("%s: Sorry, this file type is not supported here."),e.name),file:e})}function g(e,t){const i=(a=t)?Object.entries(a).flatMap((([e,t])=>{const[i]=t.split("/");return[t,...e.split("|").map((e=>`${i}/${e}`))]})):null;var a;if(!i)return;const s=i.includes(e.type);if(e.type&&!s)throw new f({code:"MIME_TYPE_NOT_ALLOWED_FOR_USER",message:(0,o.sprintf)((0,o.__)("%s: Sorry, you are not allowed to upload this file type."),e.name),file:e})}function b(e,t){if(e.size<=0)throw new f({code:"EMPTY_FILE",message:(0,o.sprintf)((0,o.__)("%s: This file is empty."),e.name),file:e});if(t&&e.size>t)throw new f({code:"SIZE_ABOVE_LIMIT",message:(0,o.sprintf)((0,o.__)("%s: This file exceeds the maximum upload size for this site."),e.name),file:e})}function S({wpAllowedMimeTypes:e,allowedTypes:t,additionalData:i={},filesList:a,maxUploadFileSize:s,onError:r,onFileChange:n,signal:l}){const d=[],p=[],c=(e,t)=>{p[e]?.url&&(0,m.revokeBlobURL)(p[e].url),p[e]=t,n?.(p.filter((e=>null!==e)))};for(const i of a){try{g(i,e)}catch(e){r?.(e);continue}try{w(i,t)}catch(e){r?.(e);continue}try{b(i,s)}catch(e){r?.(e);continue}d.push(i),p.push({url:(0,m.createBlobURL)(i)}),n?.(p)}d.map((async(e,t)=>{try{const o=await async function(e,t={},i){const o=new FormData;o.append("file",e,e.name||e.type.replace("/","."));for(const[e,i]of Object.entries(t))u(o,e,i);return y(await h()({path:"/wp/v2/media?_embed=wp:featuredmedia",body:o,method:"POST",signal:i}))}(e,i,l);c(t,o)}catch(i){let a;c(t,null),a=i instanceof Error?i.message:(0,o.sprintf)((0,o.__)("Error while uploading file %s to the media library."),e.name),r?.(new f({code:"GENERAL",message:a,file:e,cause:i instanceof Error?i:void 0}))}}))}(window.wp=window.wp||{}).mediaUtils=t})(); \ No newline at end of file +(()=>{"use strict";var e={n:t=>{var i=t&&t.__esModule?()=>t.default:()=>t;return e.d(i,{a:i}),i},d:(t,i)=>{for(var o in i)e.o(i,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:i[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{MediaUpload:()=>m,privateApis:()=>T,transformAttachment:()=>f,uploadMedia:()=>_,validateFileSize:()=>S,validateMimeType:()=>g,validateMimeTypeForUser:()=>b});const i=window.wp.element,o=window.wp.i18n,a=[],r=()=>{const{wp:e}=window;return e.media.view.MediaFrame.Select.extend({featuredImageToolbar(t){this.createSelectToolbar(t,{text:e.media.view.l10n.setFeaturedImage,state:this.options.state})},editState(){const t=this.state("featured-image").get("selection"),i=new e.media.view.EditImage({model:t.single(),controller:this}).render();this.content.set(i),i.loadEditor()},createStates:function(){this.on("toolbar:create:featured-image",this.featuredImageToolbar,this),this.on("content:render:edit-image",this.editState,this),this.states.add([new e.media.controller.FeaturedImage,new e.media.controller.EditImage({model:this.options.editImage})])}})},s=()=>{const{wp:e}=window;return e.media.view.MediaFrame.Select.extend({createStates(){const t=this.options;this.options.states||this.states.add([new e.media.controller.Library({library:e.media.query(t.library),multiple:t.multiple,title:t.title,priority:20,filterable:"uploaded"}),new e.media.controller.EditImage({model:t.editImage})])}})},n=()=>{const{wp:e}=window;return e.media.view.MediaFrame.Post.extend({galleryToolbar(){const t=this.state().get("editing");this.toolbar.set(new e.media.view.Toolbar({controller:this,items:{insert:{style:"primary",text:t?e.media.view.l10n.updateGallery:e.media.view.l10n.insertGallery,priority:80,requires:{library:!0},click(){const e=this.controller,t=e.state();e.close(),t.trigger("update",t.get("library")),e.setState(e.options.state),e.reset()}}}}))},editState(){const t=this.state("gallery").get("selection"),i=new e.media.view.EditImage({model:t.single(),controller:this}).render();this.content.set(i),i.loadEditor()},createStates:function(){this.on("toolbar:create:main-gallery",this.galleryToolbar,this),this.on("content:render:edit-image",this.editState,this),this.states.add([new e.media.controller.Library({id:"gallery",title:e.media.view.l10n.createGalleryTitle,priority:40,toolbar:"main-gallery",filterable:"uploaded",multiple:"add",editable:!1,library:e.media.query({type:"image",...this.options.library})}),new e.media.controller.EditImage({model:this.options.editImage}),new e.media.controller.GalleryEdit({library:this.options.selection,editing:this.options.editing,menu:"gallery",displaySettings:!1,multiple:!0}),new e.media.controller.GalleryAdd])}})},l=e=>["sizes","mime","type","subtype","id","url","alt","link","caption"].reduce(((t,i)=>(e?.hasOwnProperty(i)&&(t[i]=e[i]),t)),{}),d=e=>{const{wp:t}=window;return t.media.query({order:"ASC",orderby:"post__in",post__in:e,posts_per_page:-1,query:!0,type:"image"})};class p extends i.Component{constructor(){super(...arguments),this.openModal=this.openModal.bind(this),this.onOpen=this.onOpen.bind(this),this.onSelect=this.onSelect.bind(this),this.onUpdate=this.onUpdate.bind(this),this.onClose=this.onClose.bind(this)}initializeListeners(){this.frame.on("select",this.onSelect),this.frame.on("update",this.onUpdate),this.frame.on("open",this.onOpen),this.frame.on("close",this.onClose)}buildAndSetGalleryFrame(){const{addToGallery:e=!1,allowedTypes:t,multiple:i=!1,value:o=a}=this.props;if(o===this.lastGalleryValue)return;const{wp:r}=window;let s;this.lastGalleryValue=o,this.frame&&this.frame.remove(),s=e?"gallery-library":o&&o.length?"gallery-edit":"gallery",this.GalleryDetailsMediaFrame||(this.GalleryDetailsMediaFrame=n());const l=d(o),p=new r.media.model.Selection(l.models,{props:l.props.toJSON(),multiple:i});this.frame=new this.GalleryDetailsMediaFrame({mimeType:t,state:s,multiple:i,selection:p,editing:!!o?.length}),r.media.frame=this.frame,this.initializeListeners()}buildAndSetFeatureImageFrame(){const{wp:e}=window,{value:t,multiple:i,allowedTypes:o}=this.props,a=r(),s=d(t),n=new e.media.model.Selection(s.models,{props:s.props.toJSON()});this.frame=new a({mimeType:o,state:"featured-image",multiple:i,selection:n,editing:t}),e.media.frame=this.frame,e.media.view.settings.post={...e.media.view.settings.post,featuredImageId:t||-1}}buildAndSetSingleMediaFrame(){const{wp:e}=window,{allowedTypes:t,multiple:i=!1,title:a=(0,o.__)("Select or Upload Media"),value:r}=this.props,n={title:a,multiple:i};t&&(n.library={type:t}),this.frame&&this.frame.remove();const l=s(),p=d(r),m=new e.media.model.Selection(p.models,{props:p.props.toJSON()});this.frame=new l({mimeType:t,multiple:i,selection:m,...n}),e.media.frame=this.frame}componentWillUnmount(){this.frame?.remove()}onUpdate(e){const{onSelect:t,multiple:i=!1}=this.props,o=this.frame.state(),a=e||o.get("selection");a&&a.models.length&&t(i?a.models.map((e=>l(e.toJSON()))):l(a.models[0].toJSON()))}onSelect(){const{onSelect:e,multiple:t=!1}=this.props,i=this.frame.state().get("selection").toJSON();e(t?i:i[0])}onOpen(){const{wp:e}=window,{value:t}=this.props;this.updateCollection(),this.props.mode&&this.frame.content.mode(this.props.mode);if(!(Array.isArray(t)?!!t?.length:!!t))return;const i=this.props.gallery,o=this.frame.state().get("selection"),a=Array.isArray(t)?t:[t];i||a.forEach((t=>{o.add(e.media.attachment(t))}));const r=d(a);r.more().done((function(){i&&r?.models?.length&&o.add(r.models)}))}onClose(){const{onClose:e}=this.props;e&&e(),this.frame.detach()}updateCollection(){const e=this.frame.content.get();if(e&&e.collection){const t=e.collection;t.toArray().forEach((e=>e.trigger("destroy",e))),t.mirroring._hasMore=!0,t.more()}}openModal(){const{gallery:e=!1,unstableFeaturedImageFlow:t=!1,modalClass:i}=this.props;e?this.buildAndSetGalleryFrame():this.buildAndSetSingleMediaFrame(),i&&this.frame.$el.addClass(i),t&&this.buildAndSetFeatureImageFrame(),this.initializeListeners(),this.frame.open()}render(){return this.props.render({open:this.openModal})}}const m=p,c=window.wp.blob,h=window.wp.apiFetch;var u=e.n(h);function w(e,t,i){if(function(e){return null!==e&&"object"==typeof e&&Object.getPrototypeOf(e)===Object.prototype}(i))for(const[o,a]of Object.entries(i))w(e,`${t}[${o}]`,a);else void 0!==i&&e.append(t,String(i))}function f(e){var t;const{alt_text:i,source_url:o,...a}=e;return{...a,alt:e.alt_text,caption:null!==(t=e.caption?.raw)&&void 0!==t?t:"",title:e.title.raw,url:e.source_url,poster:e._embedded?.["wp:featuredmedia"]?.[0]?.source_url||void 0}}class y extends Error{constructor({code:e,message:t,file:i,cause:o}){super(t,{cause:o}),Object.setPrototypeOf(this,new.target.prototype),this.code=e,this.file=i}}function g(e,t){if(!t)return;const i=t.some((t=>t.includes("/")?t===e.type:e.type.startsWith(`${t}/`)));if(e.type&&!i)throw new y({code:"MIME_TYPE_NOT_SUPPORTED",message:(0,o.sprintf)((0,o.__)("%s: Sorry, this file type is not supported here."),e.name),file:e})}function b(e,t){const i=(a=t)?Object.entries(a).flatMap((([e,t])=>{const[i]=t.split("/");return[t,...e.split("|").map((e=>`${i}/${e}`))]})):null;var a;if(!i)return;const r=i.includes(e.type);if(e.type&&!r)throw new y({code:"MIME_TYPE_NOT_ALLOWED_FOR_USER",message:(0,o.sprintf)((0,o.__)("%s: Sorry, you are not allowed to upload this file type."),e.name),file:e})}function S(e,t){if(e.size<=0)throw new y({code:"EMPTY_FILE",message:(0,o.sprintf)((0,o.__)("%s: This file is empty."),e.name),file:e});if(t&&e.size>t)throw new y({code:"SIZE_ABOVE_LIMIT",message:(0,o.sprintf)((0,o.__)("%s: This file exceeds the maximum upload size for this site."),e.name),file:e})}function _({wpAllowedMimeTypes:e,allowedTypes:t,additionalData:i={},filesList:a,maxUploadFileSize:r,onError:s,onFileChange:n,signal:l}){const d=[],p=[],m=(e,t)=>{window.__experimentalMediaProcessing||p[e]?.url&&(0,c.revokeBlobURL)(p[e].url),p[e]=t,n?.(p.filter((e=>null!==e)))};for(const i of a){try{b(i,e)}catch(e){s?.(e);continue}try{g(i,t)}catch(e){s?.(e);continue}try{S(i,r)}catch(e){s?.(e);continue}d.push(i),window.__experimentalMediaProcessing||(p.push({url:(0,c.createBlobURL)(i)}),n?.(p))}d.map((async(e,t)=>{try{const o=await async function(e,t={},i){const o=new FormData;o.append("file",e,e.name||e.type.replace("/","."));for(const[e,i]of Object.entries(t))w(o,e,i);return f(await u()({path:"/wp/v2/media?_embed=wp:featuredmedia",body:o,method:"POST",signal:i}))}(e,i,l);m(t,o)}catch(i){let a;m(t,null),a=i instanceof Error?i.message:(0,o.sprintf)((0,o.__)("Error while uploading file %s to the media library."),e.name),s?.(new y({code:"GENERAL",message:a,file:e,cause:i instanceof Error?i:void 0}))}}))}const v=()=>{};const O=window.wp.privateApis,{lock:E,unlock:M}=(0,O.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/media-utils"),T={};E(T,{sideloadMedia:async function({file:e,attachmentId:t,additionalData:i={},signal:a,onFileChange:r,onError:s=v}){try{const o=await async function(e,t,i={},o){const a=new FormData;a.append("file",e,e.name||e.type.replace("/","."));for(const[e,t]of Object.entries(i))w(a,e,t);return f(await u()({path:`/wp/v2/media/${t}/sideload`,body:a,method:"POST",signal:o}))}(e,t,i,a);r?.([o])}catch(t){let i;i=t instanceof Error?t.message:(0,o.sprintf)((0,o.__)("Error while sideloading file %s to the server."),e.name),s(new y({code:"GENERAL",message:i,file:e,cause:t instanceof Error?t:void 0}))}}}),(window.wp=window.wp||{}).mediaUtils=t})(); \ No newline at end of file diff --git a/wp-includes/js/dist/notices.js b/wp-includes/js/dist/notices.js index abaf4d03d1..cd69f1de41 100644 --- a/wp-includes/js/dist/notices.js +++ b/wp-includes/js/dist/notices.js @@ -96,6 +96,7 @@ const onSubKey = actionProperty => reducer => (state = {}, action) => { /* harmony default export */ const on_sub_key = (onSubKey); ;// ./node_modules/@wordpress/notices/build-module/store/reducer.js +/* wp:polyfill */ /** * Internal dependencies */ diff --git a/wp-includes/js/dist/nux.js b/wp-includes/js/dist/nux.js index 6ad3f97b34..88fbcdeb70 100644 --- a/wp-includes/js/dist/nux.js +++ b/wp-includes/js/dist/nux.js @@ -205,6 +205,7 @@ function enableTips() { } ;// ./node_modules/@wordpress/nux/build-module/store/selectors.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -358,7 +359,6 @@ const close_close = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx */ - function onClick(event) { // Tips are often nested within buttons. We stop propagation so that clicking // on a tip doesn't result in the button being clicked. diff --git a/wp-includes/js/dist/patterns.js b/wp-includes/js/dist/patterns.js index d1c6bd8b4b..9f7f769f5b 100644 --- a/wp-includes/js/dist/patterns.js +++ b/wp-includes/js/dist/patterns.js @@ -109,6 +109,7 @@ const PARTIAL_SYNCING_SUPPORTED_BLOCKS = { const PATTERN_OVERRIDES_BINDING_SOURCE = 'core/pattern-overrides'; ;// ./node_modules/@wordpress/patterns/build-module/store/actions.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -191,7 +192,7 @@ const convertSyncedPatternToStatic = clientId => ({ delete metadata.bindings; // Use overridden values of the pattern block if they exist. if (existingOverrides?.[metadata.name]) { - // Iterate over each overriden attribute. + // Iterate over each overridden attribute. for (const [attributeName, value] of Object.entries(existingOverrides[metadata.name])) { // Skip if the attribute does not exist in the block type. if (!(0,external_wp_blocks_namespaceObject.getBlockType)(block.name)?.attributes[attributeName]) { @@ -303,6 +304,7 @@ const external_wp_element_namespaceObject = window["wp"]["element"]; ;// external ["wp","i18n"] const external_wp_i18n_namespaceObject = window["wp"]["i18n"]; ;// ./node_modules/@wordpress/patterns/build-module/api/index.js +/* wp:polyfill */ /** * Internal dependencies */ @@ -338,6 +340,7 @@ function hasOverridableBlocks(blocks) { ;// external "ReactJSXRuntime" const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"]; ;// ./node_modules/@wordpress/patterns/build-module/components/overrides-panel.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -383,6 +386,7 @@ const external_wp_compose_namespaceObject = window["wp"]["compose"]; ;// external ["wp","htmlEntities"] const external_wp_htmlEntities_namespaceObject = window["wp"]["htmlEntities"]; ;// ./node_modules/@wordpress/patterns/build-module/components/category-selector.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -435,6 +439,7 @@ function CategorySelector({ } ;// ./node_modules/@wordpress/patterns/build-module/private-hooks.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -530,6 +535,7 @@ function useAddPatternCategory() { } ;// ./node_modules/@wordpress/patterns/build-module/components/create-pattern-modal.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -549,7 +555,6 @@ function useAddPatternCategory() { - function CreatePatternModal({ className = 'patterns-menu-items__convert-modal', modalTitle, @@ -685,7 +690,7 @@ function getTermLabels(pattern, categories) { if (pattern.type !== PATTERN_TYPES.user) { return categories.core?.filter(category => pattern.categories?.includes(category.name)).map(category => category.label); } - return categories.user?.filter(category => pattern.wp_pattern_category.includes(category.id)).map(category => category.label); + return categories.user?.filter(category => pattern.wp_pattern_category?.includes(category.id)).map(category => category.label); } function useDuplicatePatternProps({ pattern, @@ -712,7 +717,7 @@ function useDuplicatePatternProps({ defaultCategories: getTermLabels(pattern, categories), defaultSyncType: pattern.type !== PATTERN_TYPES.user // Theme patterns are unsynced by default. ? PATTERN_SYNC_TYPES.unsynced : pattern.wp_pattern_sync_status || PATTERN_SYNC_TYPES.full, - defaultTitle: (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: Existing pattern title */ + defaultTitle: (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: Existing pattern title */ (0,external_wp_i18n_namespaceObject._x)('%s (Copy)', 'pattern'), typeof pattern.title === 'string' ? pattern.title : pattern.title.raw), onSuccess: ({ pattern: newPattern @@ -762,7 +767,6 @@ function DuplicatePatternModal({ - function RenamePatternModal({ onClose, onError, @@ -871,6 +875,7 @@ const symbol = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ext /* harmony default export */ const library_symbol = (symbol); ;// ./node_modules/@wordpress/patterns/build-module/components/pattern-convert-button.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -901,8 +906,6 @@ const symbol = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ext * @return {import('react').ComponentType} The menu control or null. */ - - function PatternConvertButton({ clientIds, rootClientId, @@ -932,6 +935,15 @@ function PatternConvertButton({ } = select(external_wp_blockEditor_namespaceObject.store); const rootId = rootClientId || (clientIds.length > 0 ? getBlockRootClientId(clientIds[0]) : undefined); const blocks = (_getBlocksByClientId = getBlocksByClientId(clientIds)) !== null && _getBlocksByClientId !== void 0 ? _getBlocksByClientId : []; + + // Check if the block has reusable support defined. + const hasReusableBlockSupport = blockName => { + const blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(blockName); + const hasParent = blockType && 'parent' in blockType; + + // If the block has a parent, check with false as default, otherwise with true. + return (0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockName, 'reusable', !hasParent); + }; const isReusable = blocks.length === 1 && blocks[0] && (0,external_wp_blocks_namespaceObject.isReusableBlock)(blocks[0]) && !!select(external_wp_coreData_namespaceObject.store).getEntityRecord('postType', 'wp_block', blocks[0].attributes.ref); const _canConvert = // Hide when this is already a synced pattern. @@ -943,7 +955,7 @@ function PatternConvertButton({ // Hide on invalid blocks. block.isValid && // Hide when block doesn't support being made into a pattern. - (0,external_wp_blocks_namespaceObject.hasBlockSupport)(block.name, 'reusable', true)) && + hasReusableBlockSupport(block.name)) && // Hide when current doesn't have permission to do that. // Blocks refers to the wp_block post type, this checks the ability to create a post of that type. !!canUser('create', { @@ -1022,8 +1034,6 @@ const external_wp_url_namespaceObject = window["wp"]["url"]; - - function PatternsManageButton({ clientId }) { @@ -1095,8 +1105,6 @@ function PatternsManageButton({ - - function PatternsMenuItems({ rootClientId }) { @@ -1119,6 +1127,7 @@ function PatternsMenuItems({ ;// external ["wp","a11y"] const external_wp_a11y_namespaceObject = window["wp"]["a11y"]; ;// ./node_modules/@wordpress/patterns/build-module/components/rename-pattern-category-modal.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -1136,7 +1145,6 @@ const external_wp_a11y_namespaceObject = window["wp"]["a11y"]; */ - function RenamePatternCategoryModal({ category, existingCategories, @@ -1278,7 +1286,6 @@ function RenamePatternCategoryModal({ - function AllowOverridesModal({ placeholder, initialName = '', @@ -1290,7 +1297,7 @@ function AllowOverridesModal({ const isNameValid = !!editedBlockName.trim(); const handleSubmit = () => { if (editedBlockName !== initialName) { - const message = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: new name/label for the block */ + const message = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: new name/label for the block */ (0,external_wp_i18n_namespaceObject.__)('Block name changed to: "%s".'), editedBlockName); // Must be assertive to immediately announce change. @@ -1406,8 +1413,6 @@ function DisallowOverridesModal({ - - function PatternOverridesControls({ attributes, setAttributes, @@ -1497,7 +1502,7 @@ const CONTENT = 'content'; function ResetOverridesControl(props) { const name = props.attributes.metadata?.name; const registry = (0,external_wp_data_namespaceObject.useRegistry)(); - const isOverriden = (0,external_wp_data_namespaceObject.useSelect)(select => { + const isOverridden = (0,external_wp_data_namespaceObject.useSelect)(select => { if (!name) { return; } @@ -1548,7 +1553,7 @@ function ResetOverridesControl(props) { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { onClick: onClick, - disabled: !isOverriden, + disabled: !isOverridden, children: (0,external_wp_i18n_namespaceObject.__)('Reset') }) }) @@ -1573,6 +1578,7 @@ const copy = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(exter /* harmony default export */ const library_copy = (copy); ;// ./node_modules/@wordpress/patterns/build-module/components/pattern-overrides-block-controls.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -1590,7 +1596,6 @@ const copy = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(exter - const { useBlockDisplayTitle } = unlock(external_wp_blockEditor_namespaceObject.privateApis); @@ -1633,7 +1638,7 @@ function PatternOverridesToolbarIndicator({ clientId: clientIds[0], maximumLength: 35 }); - const blockDescription = isSingleBlockSelected ? (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: 1: The block type's name. 2: The block's user-provided name (the same as the override name). */ + const blockDescription = isSingleBlockSelected ? (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: 1: The block type's name. 2: The block's user-provided name (the same as the override name). */ (0,external_wp_i18n_namespaceObject.__)('This %1$s is editable using the "%2$s" override.'), firstBlockTitle.toLowerCase(), firstBlockName) : (0,external_wp_i18n_namespaceObject.__)('These blocks are editable using overrides.'); const descriptionId = (0,external_wp_element_namespaceObject.useId)(); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarItem, { diff --git a/wp-includes/js/dist/patterns.min.js b/wp-includes/js/dist/patterns.min.js index 6a2c2c1cc7..0f62fb3358 100644 --- a/wp-includes/js/dist/patterns.min.js +++ b/wp-includes/js/dist/patterns.min.js @@ -1,2 +1,2 @@ /*! This file is auto-generated */ -(()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{privateApis:()=>K,store:()=>k});var n={};e.r(n),e.d(n,{convertSyncedPatternToStatic:()=>h,createPattern:()=>m,createPatternFromFile:()=>g,setEditingPattern:()=>y});var r={};e.r(r),e.d(r,{isEditingPattern:()=>f});const a=window.wp.data;const s=(0,a.combineReducers)({isEditingPattern:function(e={},t){return"SET_EDITING_PATTERN"===t?.type?{...e,[t.clientId]:t.isEditing}:e}}),o=window.wp.blocks,i=window.wp.coreData,c=window.wp.blockEditor,l={theme:"pattern",user:"wp_block"},d="all-patterns",u={full:"fully",unsynced:"unsynced"},p={"core/paragraph":["content"],"core/heading":["content"],"core/button":["text","url","linkTarget","rel"],"core/image":["id","url","title","alt"]},_="core/pattern-overrides",m=(e,t,n,r)=>async({registry:a})=>{const s={title:e,content:n,status:"publish",meta:t===u.unsynced?{wp_pattern_sync_status:t}:void 0,wp_pattern_category:r};return await a.dispatch(i.store).saveEntityRecord("postType","wp_block",s)},g=(e,t)=>async({dispatch:n})=>{const r=await e.text();let a;try{a=JSON.parse(r)}catch(e){throw new Error("Invalid JSON file")}if("wp_block"!==a.__file||!a.title||!a.content||"string"!=typeof a.title||"string"!=typeof a.content||a.syncStatus&&"string"!=typeof a.syncStatus)throw new Error("Invalid pattern JSON file");return await n.createPattern(a.title,a.syncStatus,a.content,t)},h=e=>({registry:t})=>{const n=t.select(c.store).getBlock(e),r=n.attributes?.content;const a=t.select(c.store).getBlocks(n.clientId);t.dispatch(c.store).replaceBlocks(n.clientId,function e(t){return t.map((t=>{let n=t.attributes.metadata;if(n&&(n={...n},delete n.id,delete n.bindings,r?.[n.name]))for(const[e,a]of Object.entries(r[n.name]))(0,o.getBlockType)(t.name)?.attributes[e]&&(t.attributes[e]=a);return(0,o.cloneBlock)(t,{metadata:n&&Object.keys(n).length>0?n:void 0},e(t.innerBlocks))}))}(a))};function y(e,t){return{type:"SET_EDITING_PATTERN",clientId:e,isEditing:t}}function f(e,t){return e.isEditingPattern[t]}const x=window.wp.privateApis,{lock:b,unlock:v}=(0,x.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/patterns"),w={reducer:s},k=(0,a.createReduxStore)("core/patterns",{...w});(0,a.register)(k),v(k).registerPrivateActions(n),v(k).registerPrivateSelectors(r);const S=window.wp.components,C=window.wp.element,j=window.wp.i18n;function B(e){return Object.keys(p).includes(e.name)&&!!e.attributes.metadata?.name&&!!e.attributes.metadata?.bindings&&Object.values(e.attributes.metadata.bindings).some((e=>"core/pattern-overrides"===e.source))}const P=window.ReactJSXRuntime,{BlockQuickNavigation:T}=v(c.privateApis);const E=window.wp.notices,D=window.wp.compose,I=window.wp.htmlEntities,N="wp_pattern_category";function R({categoryTerms:e,onChange:t,categoryMap:n}){const[r,a]=(0,C.useState)(""),s=(0,D.useDebounce)(a,500),o=(0,C.useMemo)((()=>Array.from(n.values()).map((e=>{return t=e.label,(0,I.decodeEntities)(t);var t})).filter((e=>""===r||e.toLowerCase().includes(r.toLowerCase()))).sort(((e,t)=>e.localeCompare(t)))),[r,n]);return(0,P.jsx)(S.FormTokenField,{className:"patterns-menu-items__convert-modal-categories",value:e,suggestions:o,onChange:function(e){const n=e.reduce(((e,t)=>(e.some((e=>e.toLowerCase()===t.toLowerCase()))||e.push(t),e)),[]);t(n)},onInputChange:s,label:(0,j.__)("Categories"),tokenizeOnBlur:!0,__experimentalExpandOnFocus:!0,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0})}function M(){const{saveEntityRecord:e,invalidateResolution:t}=(0,a.useDispatch)(i.store),{corePatternCategories:n,userPatternCategories:r}=(0,a.useSelect)((e=>{const{getUserPatternCategories:t,getBlockPatternCategories:n}=e(i.store);return{corePatternCategories:n(),userPatternCategories:t()}}),[]),s=(0,C.useMemo)((()=>{const e=new Map;return r.forEach((t=>{e.set(t.label.toLowerCase(),{label:t.label,name:t.name,id:t.id})})),n.forEach((t=>{e.has(t.label.toLowerCase())||"query"===t.name||e.set(t.label.toLowerCase(),{label:t.label,name:t.name})})),e}),[r,n]);return{categoryMap:s,findOrCreateTerm:async function(n){try{const r=s.get(n.toLowerCase());if(r?.id)return r.id;const a=r?{name:r.label,slug:r.name}:{name:n},o=await e("taxonomy",N,a,{throwOnError:!0});return t("getUserPatternCategories"),o.id}catch(e){if("term_exists"!==e.code)throw e;return e.data.term_id}}}}function O({className:e="patterns-menu-items__convert-modal",modalTitle:t,...n}){const r=(0,a.useSelect)((e=>e(i.store).getPostType(l.user)?.labels?.add_new_item),[]);return(0,P.jsx)(S.Modal,{title:t||r,onRequestClose:n.onClose,overlayClassName:e,focusOnMount:"firstContentElement",size:"small",children:(0,P.jsx)(A,{...n})})}function A({confirmLabel:e=(0,j.__)("Add"),defaultCategories:t=[],content:n,onClose:r,onError:s,onSuccess:o,defaultSyncType:i=u.full,defaultTitle:c=""}){const[l,p]=(0,C.useState)(i),[_,m]=(0,C.useState)(t),[g,h]=(0,C.useState)(c),[y,f]=(0,C.useState)(!1),{createPattern:x}=v((0,a.useDispatch)(k)),{createErrorNotice:b}=(0,a.useDispatch)(E.store),{categoryMap:w,findOrCreateTerm:B}=M();return(0,P.jsx)("form",{onSubmit:e=>{e.preventDefault(),async function(e,t){if(g&&!y)try{f(!0);const r=await Promise.all(_.map((e=>B(e)))),a=await x(e,t,"function"==typeof n?n():n,r);o({pattern:a,categoryId:d})}catch(e){b(e.message,{type:"snackbar",id:"pattern-create"}),s?.()}finally{f(!1),m([]),h("")}}(g,l)},children:(0,P.jsxs)(S.__experimentalVStack,{spacing:"5",children:[(0,P.jsx)(S.TextControl,{label:(0,j.__)("Name"),value:g,onChange:h,placeholder:(0,j.__)("My pattern"),className:"patterns-create-modal__name-input",__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0}),(0,P.jsx)(R,{categoryTerms:_,onChange:m,categoryMap:w}),(0,P.jsx)(S.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,j._x)("Synced","pattern (singular)"),help:(0,j.__)("Sync this pattern across multiple locations."),checked:l===u.full,onChange:()=>{p(l===u.full?u.unsynced:u.full)}}),(0,P.jsxs)(S.__experimentalHStack,{justify:"right",children:[(0,P.jsx)(S.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>{r(),h("")},children:(0,j.__)("Cancel")}),(0,P.jsx)(S.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit","aria-disabled":!g||y,isBusy:y,children:e})]})]})})}function z(e,t){return e.type!==l.user?t.core?.filter((t=>e.categories?.includes(t.name))).map((e=>e.label)):t.user?.filter((t=>e.wp_pattern_category.includes(t.id))).map((e=>e.label))}function L({pattern:e,onSuccess:t}){const{createSuccessNotice:n}=(0,a.useDispatch)(E.store),r=(0,a.useSelect)((e=>{const{getUserPatternCategories:t,getBlockPatternCategories:n}=e(i.store);return{core:n(),user:t()}}));return e?{content:e.content,defaultCategories:z(e,r),defaultSyncType:e.type!==l.user?u.unsynced:e.wp_pattern_sync_status||u.full,defaultTitle:(0,j.sprintf)((0,j._x)("%s (Copy)","pattern"),"string"==typeof e.title?e.title:e.title.raw),onSuccess:({pattern:e})=>{n((0,j.sprintf)((0,j._x)('"%s" duplicated.',"pattern"),e.title.raw),{type:"snackbar",id:"patterns-create"}),t?.({pattern:e})}}:null}const U=window.wp.primitives,H=(0,P.jsx)(U.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,P.jsx)(U.Path,{d:"M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-1 1.4l-5.6 5.6c-.1.1-.3.1-.4 0l-5.6-5.6c-.1-.1-.1-.3 0-.4l5.6-5.6s.1-.1.2-.1.1 0 .2.1l5.6 5.6c.1.1.1.3 0 .4zm-16.6-.4L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"})});function V({clientIds:e,rootClientId:t,closeBlockSettingsMenu:n}){const{createSuccessNotice:r}=(0,a.useDispatch)(E.store),{replaceBlocks:s}=(0,a.useDispatch)(c.store),{setEditingPattern:l}=v((0,a.useDispatch)(k)),[d,p]=(0,C.useState)(!1),_=(0,a.useSelect)((n=>{var r;const{canUser:a}=n(i.store),{getBlocksByClientId:s,canInsertBlockType:l,getBlockRootClientId:d}=n(c.store),u=t||(e.length>0?d(e[0]):void 0),p=null!==(r=s(e))&&void 0!==r?r:[];return!(1===p.length&&p[0]&&(0,o.isReusableBlock)(p[0])&&!!n(i.store).getEntityRecord("postType","wp_block",p[0].attributes.ref))&&l("core/block",u)&&p.every((e=>!!e&&e.isValid&&(0,o.hasBlockSupport)(e.name,"reusable",!0)))&&!!a("create",{kind:"postType",name:"wp_block"})}),[e,t]),{getBlocksByClientId:m}=(0,a.useSelect)(c.store),g=(0,C.useCallback)((()=>(0,o.serialize)(m(e))),[m,e]);if(!_)return null;return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(S.MenuItem,{icon:H,onClick:()=>p(!0),"aria-expanded":d,"aria-haspopup":"dialog",children:(0,j.__)("Create pattern")}),d&&(0,P.jsx)(O,{content:g,onSuccess:t=>{(({pattern:t})=>{if(t.wp_pattern_sync_status!==u.unsynced){const r=(0,o.createBlock)("core/block",{ref:t.id});s(e,r),l(r.clientId,!0),n()}r(t.wp_pattern_sync_status===u.unsynced?(0,j.sprintf)((0,j.__)("Unsynced pattern created: %s"),t.title.raw):(0,j.sprintf)((0,j.__)("Synced pattern created: %s"),t.title.raw),{type:"snackbar",id:"convert-to-pattern-success"}),p(!1)})(t)},onError:()=>{p(!1)},onClose:()=>{p(!1)}})]})}const F=window.wp.url;const q=function({clientId:e}){const{canRemove:t,isVisible:n,managePatternsUrl:r}=(0,a.useSelect)((t=>{const{getBlock:n,canRemoveBlock:r,getBlockCount:a}=t(c.store),{canUser:s}=t(i.store),l=n(e);return{canRemove:r(e),isVisible:!!l&&(0,o.isReusableBlock)(l)&&!!s("update",{kind:"postType",name:"wp_block",id:l.attributes.ref}),innerBlockCount:a(e),managePatternsUrl:s("create",{kind:"postType",name:"wp_template"})?(0,F.addQueryArgs)("site-editor.php",{path:"/patterns"}):(0,F.addQueryArgs)("edit.php",{post_type:"wp_block"})}}),[e]),{convertSyncedPatternToStatic:s}=v((0,a.useDispatch)(k));return n?(0,P.jsxs)(P.Fragment,{children:[t&&(0,P.jsx)(S.MenuItem,{onClick:()=>s(e),children:(0,j.__)("Detach")}),(0,P.jsx)(S.MenuItem,{href:r,children:(0,j.__)("Manage patterns")})]}):null};const G=window.wp.a11y;function Y({placeholder:e,initialName:t="",onClose:n,onSave:r}){const[a,s]=(0,C.useState)(t),o=(0,C.useId)(),i=!!a.trim();return(0,P.jsx)(S.Modal,{title:(0,j.__)("Enable overrides"),onRequestClose:n,focusOnMount:"firstContentElement",aria:{describedby:o},size:"small",children:(0,P.jsx)("form",{onSubmit:e=>{e.preventDefault(),i&&(()=>{if(a!==t){const e=(0,j.sprintf)((0,j.__)('Block name changed to: "%s".'),a);(0,G.speak)(e,"assertive")}r(a),n()})()},children:(0,P.jsxs)(S.__experimentalVStack,{spacing:"6",children:[(0,P.jsx)(S.__experimentalText,{id:o,children:(0,j.__)("Overrides are changes you make to a block within a synced pattern instance. Use overrides to customize a synced pattern instance to suit its new context. Name this block to specify an override.")}),(0,P.jsx)(S.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,value:a,label:(0,j.__)("Name"),help:(0,j.__)('For example, if you are creating a recipe pattern, you use "Recipe Title", "Recipe Description", etc.'),placeholder:e,onChange:s}),(0,P.jsxs)(S.__experimentalHStack,{justify:"right",children:[(0,P.jsx)(S.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:n,children:(0,j.__)("Cancel")}),(0,P.jsx)(S.Button,{__next40pxDefaultSize:!0,"aria-disabled":!i,variant:"primary",type:"submit",children:(0,j.__)("Enable")})]})]})})})}function J({onClose:e,onSave:t}){const n=(0,C.useId)();return(0,P.jsx)(S.Modal,{title:(0,j.__)("Disable overrides"),onRequestClose:e,aria:{describedby:n},size:"small",children:(0,P.jsx)("form",{onSubmit:n=>{n.preventDefault(),t(),e()},children:(0,P.jsxs)(S.__experimentalVStack,{spacing:"6",children:[(0,P.jsx)(S.__experimentalText,{id:n,children:(0,j.__)("Are you sure you want to disable overrides? Disabling overrides will revert all applied overrides for this block throughout instances of this pattern.")}),(0,P.jsxs)(S.__experimentalHStack,{justify:"right",children:[(0,P.jsx)(S.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:e,children:(0,j.__)("Cancel")}),(0,P.jsx)(S.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",children:(0,j.__)("Disable")})]})]})})})}const Q=function({attributes:e,setAttributes:t,name:n}){const r=(0,C.useId)(),[a,s]=(0,C.useState)(!1),[o,i]=(0,C.useState)(!1),l=!!e.metadata?.name,d=e.metadata?.bindings?.__default,u=l&&d?.source===_,p=d?.source&&d.source!==_,{updateBlockBindings:m}=(0,c.useBlockBindingsUtils)();function g(n,r){r&&t({metadata:{...e.metadata,name:r}}),m({__default:n?{source:_}:void 0})}if(p)return null;const h=!("core/image"!==n||!e.caption?.length&&!e.href?.length),y=!u&&h?(0,j.__)("Overrides currently don't support image captions or links. Remove the caption or link first before enabling overrides."):(0,j.__)("Allow changes to this block throughout instances of this pattern.");return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(c.InspectorControls,{group:"advanced",children:(0,P.jsx)(S.BaseControl,{__nextHasNoMarginBottom:!0,id:r,label:(0,j.__)("Overrides"),help:y,children:(0,P.jsx)(S.Button,{__next40pxDefaultSize:!0,className:"pattern-overrides-control__allow-overrides-button",variant:"secondary","aria-haspopup":"dialog",onClick:()=>{u?i(!0):s(!0)},disabled:!u&&h,accessibleWhenDisabled:!0,children:u?(0,j.__)("Disable overrides"):(0,j.__)("Enable overrides")})})}),a&&(0,P.jsx)(Y,{initialName:e.metadata?.name,onClose:()=>s(!1),onSave:e=>{g(!0,e)}}),o&&(0,P.jsx)(J,{onClose:()=>i(!1),onSave:()=>g(!1)})]})},W="content";const Z=(0,P.jsx)(U.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,P.jsx)(U.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M5 4.5h11a.5.5 0 0 1 .5.5v11a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V5a.5.5 0 0 1 .5-.5ZM3 5a2 2 0 0 1 2-2h11a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5Zm17 3v10.75c0 .69-.56 1.25-1.25 1.25H6v1.5h12.75a2.75 2.75 0 0 0 2.75-2.75V8H20Z"})}),{useBlockDisplayTitle:$}=v(c.privateApis);function X({clientIds:e}){const t=1===e.length,{icon:n,firstBlockName:r}=(0,a.useSelect)((n=>{const{getBlockAttributes:r,getBlockNamesByClientId:a}=n(c.store),{getBlockType:s,getActiveBlockVariation:i}=n(o.store),l=a(e),d=l[0],u=s(d);let p;if(t){const t=i(d,r(e[0]));p=t?.icon||u.icon}else{p=1===new Set(l).size?u.icon:Z}return{icon:p,firstBlockName:r(e[0]).metadata.name}}),[e,t]),s=$({clientId:e[0],maximumLength:35}),i=t?(0,j.sprintf)((0,j.__)('This %1$s is editable using the "%2$s" override.'),s.toLowerCase(),r):(0,j.__)("These blocks are editable using overrides."),l=(0,C.useId)();return(0,P.jsx)(S.ToolbarItem,{children:e=>(0,P.jsx)(S.DropdownMenu,{className:"patterns-pattern-overrides-toolbar-indicator",label:s,popoverProps:{placement:"bottom-start",className:"patterns-pattern-overrides-toolbar-indicator__popover"},icon:(0,P.jsx)(P.Fragment,{children:(0,P.jsx)(c.BlockIcon,{icon:n,className:"patterns-pattern-overrides-toolbar-indicator-icon",showColors:!0})}),toggleProps:{description:i,...e},menuProps:{orientation:"both","aria-describedby":l},children:()=>(0,P.jsx)(S.__experimentalText,{id:l,children:i})})})}const K={};b(K,{OverridesPanel:function(){const e=(0,a.useSelect)((e=>e(c.store).getClientIdsWithDescendants()),[]),{getBlock:t}=(0,a.useSelect)(c.store),n=(0,C.useMemo)((()=>e.filter((e=>B(t(e))))),[e,t]);return n?.length?(0,P.jsx)(S.PanelBody,{title:(0,j.__)("Overrides"),children:(0,P.jsx)(T,{clientIds:n})}):null},CreatePatternModal:O,CreatePatternModalContents:A,DuplicatePatternModal:function({pattern:e,onClose:t,onSuccess:n}){const r=L({pattern:e,onSuccess:n});return e?(0,P.jsx)(O,{modalTitle:(0,j.__)("Duplicate pattern"),confirmLabel:(0,j.__)("Duplicate"),onClose:t,onError:t,...r}):null},isOverridableBlock:B,hasOverridableBlocks:function e(t){return t.some((t=>!!B(t)||e(t.innerBlocks)))},useDuplicatePatternProps:L,RenamePatternModal:function({onClose:e,onError:t,onSuccess:n,pattern:r,...s}){const o=(0,I.decodeEntities)(r.title),[c,l]=(0,C.useState)(o),[d,u]=(0,C.useState)(!1),{editEntityRecord:p,__experimentalSaveSpecifiedEntityEdits:_}=(0,a.useDispatch)(i.store),{createSuccessNotice:m,createErrorNotice:g}=(0,a.useDispatch)(E.store);return(0,P.jsx)(S.Modal,{title:(0,j.__)("Rename"),...s,onRequestClose:e,focusOnMount:"firstContentElement",size:"small",children:(0,P.jsx)("form",{onSubmit:async a=>{if(a.preventDefault(),c&&c!==r.title&&!d)try{await p("postType",r.type,r.id,{title:c}),u(!0),l(""),e?.();const t=await _("postType",r.type,r.id,["title"],{throwOnError:!0});n?.(t),m((0,j.__)("Pattern renamed"),{type:"snackbar",id:"pattern-update"})}catch(e){t?.();const n=e.message&&"unknown_error"!==e.code?e.message:(0,j.__)("An error occurred while renaming the pattern.");g(n,{type:"snackbar",id:"pattern-update"})}finally{u(!1),l("")}},children:(0,P.jsxs)(S.__experimentalVStack,{spacing:"5",children:[(0,P.jsx)(S.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,j.__)("Name"),value:c,onChange:l,required:!0}),(0,P.jsxs)(S.__experimentalHStack,{justify:"right",children:[(0,P.jsx)(S.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>{e?.(),l("")},children:(0,j.__)("Cancel")}),(0,P.jsx)(S.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",children:(0,j.__)("Save")})]})]})})})},PatternsMenuItems:function({rootClientId:e}){return(0,P.jsx)(c.BlockSettingsMenuControls,{children:({selectedClientIds:t,onClose:n})=>(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(V,{clientIds:t,rootClientId:e,closeBlockSettingsMenu:n}),1===t.length&&(0,P.jsx)(q,{clientId:t[0]})]})})},RenamePatternCategoryModal:function({category:e,existingCategories:t,onClose:n,onError:r,onSuccess:s,...o}){const c=(0,C.useId)(),l=(0,C.useRef)(),[d,u]=(0,C.useState)((0,I.decodeEntities)(e.name)),[p,_]=(0,C.useState)(!1),[m,g]=(0,C.useState)(!1),h=m?`patterns-rename-pattern-category-modal__validation-message-${c}`:void 0,{saveEntityRecord:y,invalidateResolution:f}=(0,a.useDispatch)(i.store),{createErrorNotice:x,createSuccessNotice:b}=(0,a.useDispatch)(E.store),v=()=>{n(),u("")};return(0,P.jsx)(S.Modal,{title:(0,j.__)("Rename"),onRequestClose:v,...o,children:(0,P.jsx)("form",{onSubmit:async a=>{if(a.preventDefault(),!p){if(!d||d===e.name){const e=(0,j.__)("Please enter a new name for this category.");return(0,G.speak)(e,"assertive"),g(e),void l.current?.focus()}if(t.patternCategories.find((t=>t.id!==e.id&&t.label.toLowerCase()===d.toLowerCase()))){const e=(0,j.__)("This category already exists. Please use a different name.");return(0,G.speak)(e,"assertive"),g(e),void l.current?.focus()}try{_(!0);const t=await y("taxonomy",N,{id:e.id,slug:e.slug,name:d});f("getUserPatternCategories"),s?.(t),n(),b((0,j.__)("Pattern category renamed."),{type:"snackbar",id:"pattern-category-update"})}catch(e){r?.(),x(e.message,{type:"snackbar",id:"pattern-category-update"})}finally{_(!1),u("")}}},children:(0,P.jsxs)(S.__experimentalVStack,{spacing:"5",children:[(0,P.jsxs)(S.__experimentalVStack,{spacing:"2",children:[(0,P.jsx)(S.TextControl,{ref:l,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,j.__)("Name"),value:d,onChange:e=>{m&&g(void 0),u(e)},"aria-describedby":h,required:!0}),m&&(0,P.jsx)("span",{className:"patterns-rename-pattern-category-modal__validation-message",id:h,children:m})]}),(0,P.jsxs)(S.__experimentalHStack,{justify:"right",children:[(0,P.jsx)(S.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:v,children:(0,j.__)("Cancel")}),(0,P.jsx)(S.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit","aria-disabled":!d||d===e.name||p,isBusy:p,children:(0,j.__)("Save")})]})]})})})},PatternOverridesControls:Q,ResetOverridesControl:function(e){const t=e.attributes.metadata?.name,n=(0,a.useRegistry)(),r=(0,a.useSelect)((n=>{if(!t)return;const{getBlockAttributes:r,getBlockParentsByBlockName:a}=n(c.store),[s]=a(e.clientId,"core/block",!0);if(!s)return;const o=r(s)[W];return o?o.hasOwnProperty(t):void 0}),[e.clientId,t]);return(0,P.jsx)(c.__unstableBlockToolbarLastItem,{children:(0,P.jsx)(S.ToolbarGroup,{children:(0,P.jsx)(S.ToolbarButton,{onClick:function(){const{getBlockAttributes:r,getBlockParentsByBlockName:a}=n.select(c.store),[s]=a(e.clientId,"core/block",!0);if(!s)return;const o=r(s)[W];if(!o.hasOwnProperty(t))return;const{updateBlockAttributes:i,__unstableMarkLastChangeAsPersistent:l}=n.dispatch(c.store);l();let d={...o};delete d[t],Object.keys(d).length||(d=void 0),i(s,{[W]:d})},disabled:!r,children:(0,j.__)("Reset")})})})},PatternOverridesBlockControls:function(){const{clientIds:e,hasPatternOverrides:t,hasParentPattern:n}=(0,a.useSelect)((e=>{const{getBlockAttributes:t,getSelectedBlockClientIds:n,getBlockParentsByBlockName:r}=e(c.store),a=n(),s=a.every((e=>{var n;return Object.values(null!==(n=t(e)?.metadata?.bindings)&&void 0!==n?n:{}).some((e=>e?.source===_))})),o=a.every((e=>r(e,"core/block",!0).length>0));return{clientIds:a,hasPatternOverrides:s,hasParentPattern:o}}),[]);return t&&n?(0,P.jsx)(c.BlockControls,{group:"parent",children:(0,P.jsx)(X,{clientIds:e})}):null},useAddPatternCategory:M,PATTERN_TYPES:l,PATTERN_DEFAULT_CATEGORY:d,PATTERN_USER_CATEGORY:"my-patterns",EXCLUDED_PATTERN_SOURCES:["core","pattern-directory/core","pattern-directory/featured"],PATTERN_SYNC_TYPES:u,PARTIAL_SYNCING_SUPPORTED_BLOCKS:p}),(window.wp=window.wp||{}).patterns=t})(); \ No newline at end of file +(()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{privateApis:()=>K,store:()=>k});var n={};e.r(n),e.d(n,{convertSyncedPatternToStatic:()=>h,createPattern:()=>m,createPatternFromFile:()=>g,setEditingPattern:()=>y});var r={};e.r(r),e.d(r,{isEditingPattern:()=>f});const a=window.wp.data;const s=(0,a.combineReducers)({isEditingPattern:function(e={},t){return"SET_EDITING_PATTERN"===t?.type?{...e,[t.clientId]:t.isEditing}:e}}),o=window.wp.blocks,i=window.wp.coreData,c=window.wp.blockEditor,l={theme:"pattern",user:"wp_block"},u="all-patterns",d={full:"fully",unsynced:"unsynced"},p={"core/paragraph":["content"],"core/heading":["content"],"core/button":["text","url","linkTarget","rel"],"core/image":["id","url","title","alt"]},_="core/pattern-overrides",m=(e,t,n,r)=>async({registry:a})=>{const s={title:e,content:n,status:"publish",meta:t===d.unsynced?{wp_pattern_sync_status:t}:void 0,wp_pattern_category:r};return await a.dispatch(i.store).saveEntityRecord("postType","wp_block",s)},g=(e,t)=>async({dispatch:n})=>{const r=await e.text();let a;try{a=JSON.parse(r)}catch(e){throw new Error("Invalid JSON file")}if("wp_block"!==a.__file||!a.title||!a.content||"string"!=typeof a.title||"string"!=typeof a.content||a.syncStatus&&"string"!=typeof a.syncStatus)throw new Error("Invalid pattern JSON file");return await n.createPattern(a.title,a.syncStatus,a.content,t)},h=e=>({registry:t})=>{const n=t.select(c.store).getBlock(e),r=n.attributes?.content;const a=t.select(c.store).getBlocks(n.clientId);t.dispatch(c.store).replaceBlocks(n.clientId,function e(t){return t.map((t=>{let n=t.attributes.metadata;if(n&&(n={...n},delete n.id,delete n.bindings,r?.[n.name]))for(const[e,a]of Object.entries(r[n.name]))(0,o.getBlockType)(t.name)?.attributes[e]&&(t.attributes[e]=a);return(0,o.cloneBlock)(t,{metadata:n&&Object.keys(n).length>0?n:void 0},e(t.innerBlocks))}))}(a))};function y(e,t){return{type:"SET_EDITING_PATTERN",clientId:e,isEditing:t}}function f(e,t){return e.isEditingPattern[t]}const x=window.wp.privateApis,{lock:b,unlock:v}=(0,x.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/patterns"),w={reducer:s},k=(0,a.createReduxStore)("core/patterns",{...w});(0,a.register)(k),v(k).registerPrivateActions(n),v(k).registerPrivateSelectors(r);const S=window.wp.components,C=window.wp.element,j=window.wp.i18n;function B(e){return Object.keys(p).includes(e.name)&&!!e.attributes.metadata?.name&&!!e.attributes.metadata?.bindings&&Object.values(e.attributes.metadata.bindings).some((e=>"core/pattern-overrides"===e.source))}const P=window.ReactJSXRuntime,{BlockQuickNavigation:T}=v(c.privateApis);const E=window.wp.notices,D=window.wp.compose,I=window.wp.htmlEntities,N="wp_pattern_category";function R({categoryTerms:e,onChange:t,categoryMap:n}){const[r,a]=(0,C.useState)(""),s=(0,D.useDebounce)(a,500),o=(0,C.useMemo)((()=>Array.from(n.values()).map((e=>{return t=e.label,(0,I.decodeEntities)(t);var t})).filter((e=>""===r||e.toLowerCase().includes(r.toLowerCase()))).sort(((e,t)=>e.localeCompare(t)))),[r,n]);return(0,P.jsx)(S.FormTokenField,{className:"patterns-menu-items__convert-modal-categories",value:e,suggestions:o,onChange:function(e){const n=e.reduce(((e,t)=>(e.some((e=>e.toLowerCase()===t.toLowerCase()))||e.push(t),e)),[]);t(n)},onInputChange:s,label:(0,j.__)("Categories"),tokenizeOnBlur:!0,__experimentalExpandOnFocus:!0,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0})}function M(){const{saveEntityRecord:e,invalidateResolution:t}=(0,a.useDispatch)(i.store),{corePatternCategories:n,userPatternCategories:r}=(0,a.useSelect)((e=>{const{getUserPatternCategories:t,getBlockPatternCategories:n}=e(i.store);return{corePatternCategories:n(),userPatternCategories:t()}}),[]),s=(0,C.useMemo)((()=>{const e=new Map;return r.forEach((t=>{e.set(t.label.toLowerCase(),{label:t.label,name:t.name,id:t.id})})),n.forEach((t=>{e.has(t.label.toLowerCase())||"query"===t.name||e.set(t.label.toLowerCase(),{label:t.label,name:t.name})})),e}),[r,n]);return{categoryMap:s,findOrCreateTerm:async function(n){try{const r=s.get(n.toLowerCase());if(r?.id)return r.id;const a=r?{name:r.label,slug:r.name}:{name:n},o=await e("taxonomy",N,a,{throwOnError:!0});return t("getUserPatternCategories"),o.id}catch(e){if("term_exists"!==e.code)throw e;return e.data.term_id}}}}function O({className:e="patterns-menu-items__convert-modal",modalTitle:t,...n}){const r=(0,a.useSelect)((e=>e(i.store).getPostType(l.user)?.labels?.add_new_item),[]);return(0,P.jsx)(S.Modal,{title:t||r,onRequestClose:n.onClose,overlayClassName:e,focusOnMount:"firstContentElement",size:"small",children:(0,P.jsx)(A,{...n})})}function A({confirmLabel:e=(0,j.__)("Add"),defaultCategories:t=[],content:n,onClose:r,onError:s,onSuccess:o,defaultSyncType:i=d.full,defaultTitle:c=""}){const[l,p]=(0,C.useState)(i),[_,m]=(0,C.useState)(t),[g,h]=(0,C.useState)(c),[y,f]=(0,C.useState)(!1),{createPattern:x}=v((0,a.useDispatch)(k)),{createErrorNotice:b}=(0,a.useDispatch)(E.store),{categoryMap:w,findOrCreateTerm:B}=M();return(0,P.jsx)("form",{onSubmit:e=>{e.preventDefault(),async function(e,t){if(g&&!y)try{f(!0);const r=await Promise.all(_.map((e=>B(e)))),a=await x(e,t,"function"==typeof n?n():n,r);o({pattern:a,categoryId:u})}catch(e){b(e.message,{type:"snackbar",id:"pattern-create"}),s?.()}finally{f(!1),m([]),h("")}}(g,l)},children:(0,P.jsxs)(S.__experimentalVStack,{spacing:"5",children:[(0,P.jsx)(S.TextControl,{label:(0,j.__)("Name"),value:g,onChange:h,placeholder:(0,j.__)("My pattern"),className:"patterns-create-modal__name-input",__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0}),(0,P.jsx)(R,{categoryTerms:_,onChange:m,categoryMap:w}),(0,P.jsx)(S.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,j._x)("Synced","pattern (singular)"),help:(0,j.__)("Sync this pattern across multiple locations."),checked:l===d.full,onChange:()=>{p(l===d.full?d.unsynced:d.full)}}),(0,P.jsxs)(S.__experimentalHStack,{justify:"right",children:[(0,P.jsx)(S.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>{r(),h("")},children:(0,j.__)("Cancel")}),(0,P.jsx)(S.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit","aria-disabled":!g||y,isBusy:y,children:e})]})]})})}function z(e,t){return e.type!==l.user?t.core?.filter((t=>e.categories?.includes(t.name))).map((e=>e.label)):t.user?.filter((t=>e.wp_pattern_category?.includes(t.id))).map((e=>e.label))}function L({pattern:e,onSuccess:t}){const{createSuccessNotice:n}=(0,a.useDispatch)(E.store),r=(0,a.useSelect)((e=>{const{getUserPatternCategories:t,getBlockPatternCategories:n}=e(i.store);return{core:n(),user:t()}}));return e?{content:e.content,defaultCategories:z(e,r),defaultSyncType:e.type!==l.user?d.unsynced:e.wp_pattern_sync_status||d.full,defaultTitle:(0,j.sprintf)((0,j._x)("%s (Copy)","pattern"),"string"==typeof e.title?e.title:e.title.raw),onSuccess:({pattern:e})=>{n((0,j.sprintf)((0,j._x)('"%s" duplicated.',"pattern"),e.title.raw),{type:"snackbar",id:"patterns-create"}),t?.({pattern:e})}}:null}const U=window.wp.primitives,H=(0,P.jsx)(U.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,P.jsx)(U.Path,{d:"M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-1 1.4l-5.6 5.6c-.1.1-.3.1-.4 0l-5.6-5.6c-.1-.1-.1-.3 0-.4l5.6-5.6s.1-.1.2-.1.1 0 .2.1l5.6 5.6c.1.1.1.3 0 .4zm-16.6-.4L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"})});function V({clientIds:e,rootClientId:t,closeBlockSettingsMenu:n}){const{createSuccessNotice:r}=(0,a.useDispatch)(E.store),{replaceBlocks:s}=(0,a.useDispatch)(c.store),{setEditingPattern:l}=v((0,a.useDispatch)(k)),[u,p]=(0,C.useState)(!1),_=(0,a.useSelect)((n=>{var r;const{canUser:a}=n(i.store),{getBlocksByClientId:s,canInsertBlockType:l,getBlockRootClientId:u}=n(c.store),d=t||(e.length>0?u(e[0]):void 0),p=null!==(r=s(e))&&void 0!==r?r:[];return!(1===p.length&&p[0]&&(0,o.isReusableBlock)(p[0])&&!!n(i.store).getEntityRecord("postType","wp_block",p[0].attributes.ref))&&l("core/block",d)&&p.every((e=>!!e&&e.isValid&&(e=>{const t=(0,o.getBlockType)(e),n=t&&"parent"in t;return(0,o.hasBlockSupport)(e,"reusable",!n)})(e.name)))&&!!a("create",{kind:"postType",name:"wp_block"})}),[e,t]),{getBlocksByClientId:m}=(0,a.useSelect)(c.store),g=(0,C.useCallback)((()=>(0,o.serialize)(m(e))),[m,e]);if(!_)return null;return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(S.MenuItem,{icon:H,onClick:()=>p(!0),"aria-expanded":u,"aria-haspopup":"dialog",children:(0,j.__)("Create pattern")}),u&&(0,P.jsx)(O,{content:g,onSuccess:t=>{(({pattern:t})=>{if(t.wp_pattern_sync_status!==d.unsynced){const r=(0,o.createBlock)("core/block",{ref:t.id});s(e,r),l(r.clientId,!0),n()}r(t.wp_pattern_sync_status===d.unsynced?(0,j.sprintf)((0,j.__)("Unsynced pattern created: %s"),t.title.raw):(0,j.sprintf)((0,j.__)("Synced pattern created: %s"),t.title.raw),{type:"snackbar",id:"convert-to-pattern-success"}),p(!1)})(t)},onError:()=>{p(!1)},onClose:()=>{p(!1)}})]})}const F=window.wp.url;const q=function({clientId:e}){const{canRemove:t,isVisible:n,managePatternsUrl:r}=(0,a.useSelect)((t=>{const{getBlock:n,canRemoveBlock:r,getBlockCount:a}=t(c.store),{canUser:s}=t(i.store),l=n(e);return{canRemove:r(e),isVisible:!!l&&(0,o.isReusableBlock)(l)&&!!s("update",{kind:"postType",name:"wp_block",id:l.attributes.ref}),innerBlockCount:a(e),managePatternsUrl:s("create",{kind:"postType",name:"wp_template"})?(0,F.addQueryArgs)("site-editor.php",{path:"/patterns"}):(0,F.addQueryArgs)("edit.php",{post_type:"wp_block"})}}),[e]),{convertSyncedPatternToStatic:s}=v((0,a.useDispatch)(k));return n?(0,P.jsxs)(P.Fragment,{children:[t&&(0,P.jsx)(S.MenuItem,{onClick:()=>s(e),children:(0,j.__)("Detach")}),(0,P.jsx)(S.MenuItem,{href:r,children:(0,j.__)("Manage patterns")})]}):null};const G=window.wp.a11y;function Y({placeholder:e,initialName:t="",onClose:n,onSave:r}){const[a,s]=(0,C.useState)(t),o=(0,C.useId)(),i=!!a.trim();return(0,P.jsx)(S.Modal,{title:(0,j.__)("Enable overrides"),onRequestClose:n,focusOnMount:"firstContentElement",aria:{describedby:o},size:"small",children:(0,P.jsx)("form",{onSubmit:e=>{e.preventDefault(),i&&(()=>{if(a!==t){const e=(0,j.sprintf)((0,j.__)('Block name changed to: "%s".'),a);(0,G.speak)(e,"assertive")}r(a),n()})()},children:(0,P.jsxs)(S.__experimentalVStack,{spacing:"6",children:[(0,P.jsx)(S.__experimentalText,{id:o,children:(0,j.__)("Overrides are changes you make to a block within a synced pattern instance. Use overrides to customize a synced pattern instance to suit its new context. Name this block to specify an override.")}),(0,P.jsx)(S.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,value:a,label:(0,j.__)("Name"),help:(0,j.__)('For example, if you are creating a recipe pattern, you use "Recipe Title", "Recipe Description", etc.'),placeholder:e,onChange:s}),(0,P.jsxs)(S.__experimentalHStack,{justify:"right",children:[(0,P.jsx)(S.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:n,children:(0,j.__)("Cancel")}),(0,P.jsx)(S.Button,{__next40pxDefaultSize:!0,"aria-disabled":!i,variant:"primary",type:"submit",children:(0,j.__)("Enable")})]})]})})})}function J({onClose:e,onSave:t}){const n=(0,C.useId)();return(0,P.jsx)(S.Modal,{title:(0,j.__)("Disable overrides"),onRequestClose:e,aria:{describedby:n},size:"small",children:(0,P.jsx)("form",{onSubmit:n=>{n.preventDefault(),t(),e()},children:(0,P.jsxs)(S.__experimentalVStack,{spacing:"6",children:[(0,P.jsx)(S.__experimentalText,{id:n,children:(0,j.__)("Are you sure you want to disable overrides? Disabling overrides will revert all applied overrides for this block throughout instances of this pattern.")}),(0,P.jsxs)(S.__experimentalHStack,{justify:"right",children:[(0,P.jsx)(S.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:e,children:(0,j.__)("Cancel")}),(0,P.jsx)(S.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",children:(0,j.__)("Disable")})]})]})})})}const Q=function({attributes:e,setAttributes:t,name:n}){const r=(0,C.useId)(),[a,s]=(0,C.useState)(!1),[o,i]=(0,C.useState)(!1),l=!!e.metadata?.name,u=e.metadata?.bindings?.__default,d=l&&u?.source===_,p=u?.source&&u.source!==_,{updateBlockBindings:m}=(0,c.useBlockBindingsUtils)();function g(n,r){r&&t({metadata:{...e.metadata,name:r}}),m({__default:n?{source:_}:void 0})}if(p)return null;const h=!("core/image"!==n||!e.caption?.length&&!e.href?.length),y=!d&&h?(0,j.__)("Overrides currently don't support image captions or links. Remove the caption or link first before enabling overrides."):(0,j.__)("Allow changes to this block throughout instances of this pattern.");return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(c.InspectorControls,{group:"advanced",children:(0,P.jsx)(S.BaseControl,{__nextHasNoMarginBottom:!0,id:r,label:(0,j.__)("Overrides"),help:y,children:(0,P.jsx)(S.Button,{__next40pxDefaultSize:!0,className:"pattern-overrides-control__allow-overrides-button",variant:"secondary","aria-haspopup":"dialog",onClick:()=>{d?i(!0):s(!0)},disabled:!d&&h,accessibleWhenDisabled:!0,children:d?(0,j.__)("Disable overrides"):(0,j.__)("Enable overrides")})})}),a&&(0,P.jsx)(Y,{initialName:e.metadata?.name,onClose:()=>s(!1),onSave:e=>{g(!0,e)}}),o&&(0,P.jsx)(J,{onClose:()=>i(!1),onSave:()=>g(!1)})]})},W="content";const Z=(0,P.jsx)(U.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,P.jsx)(U.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M5 4.5h11a.5.5 0 0 1 .5.5v11a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V5a.5.5 0 0 1 .5-.5ZM3 5a2 2 0 0 1 2-2h11a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5Zm17 3v10.75c0 .69-.56 1.25-1.25 1.25H6v1.5h12.75a2.75 2.75 0 0 0 2.75-2.75V8H20Z"})}),{useBlockDisplayTitle:$}=v(c.privateApis);function X({clientIds:e}){const t=1===e.length,{icon:n,firstBlockName:r}=(0,a.useSelect)((n=>{const{getBlockAttributes:r,getBlockNamesByClientId:a}=n(c.store),{getBlockType:s,getActiveBlockVariation:i}=n(o.store),l=a(e),u=l[0],d=s(u);let p;if(t){const t=i(u,r(e[0]));p=t?.icon||d.icon}else{p=1===new Set(l).size?d.icon:Z}return{icon:p,firstBlockName:r(e[0]).metadata.name}}),[e,t]),s=$({clientId:e[0],maximumLength:35}),i=t?(0,j.sprintf)((0,j.__)('This %1$s is editable using the "%2$s" override.'),s.toLowerCase(),r):(0,j.__)("These blocks are editable using overrides."),l=(0,C.useId)();return(0,P.jsx)(S.ToolbarItem,{children:e=>(0,P.jsx)(S.DropdownMenu,{className:"patterns-pattern-overrides-toolbar-indicator",label:s,popoverProps:{placement:"bottom-start",className:"patterns-pattern-overrides-toolbar-indicator__popover"},icon:(0,P.jsx)(P.Fragment,{children:(0,P.jsx)(c.BlockIcon,{icon:n,className:"patterns-pattern-overrides-toolbar-indicator-icon",showColors:!0})}),toggleProps:{description:i,...e},menuProps:{orientation:"both","aria-describedby":l},children:()=>(0,P.jsx)(S.__experimentalText,{id:l,children:i})})})}const K={};b(K,{OverridesPanel:function(){const e=(0,a.useSelect)((e=>e(c.store).getClientIdsWithDescendants()),[]),{getBlock:t}=(0,a.useSelect)(c.store),n=(0,C.useMemo)((()=>e.filter((e=>B(t(e))))),[e,t]);return n?.length?(0,P.jsx)(S.PanelBody,{title:(0,j.__)("Overrides"),children:(0,P.jsx)(T,{clientIds:n})}):null},CreatePatternModal:O,CreatePatternModalContents:A,DuplicatePatternModal:function({pattern:e,onClose:t,onSuccess:n}){const r=L({pattern:e,onSuccess:n});return e?(0,P.jsx)(O,{modalTitle:(0,j.__)("Duplicate pattern"),confirmLabel:(0,j.__)("Duplicate"),onClose:t,onError:t,...r}):null},isOverridableBlock:B,hasOverridableBlocks:function e(t){return t.some((t=>!!B(t)||e(t.innerBlocks)))},useDuplicatePatternProps:L,RenamePatternModal:function({onClose:e,onError:t,onSuccess:n,pattern:r,...s}){const o=(0,I.decodeEntities)(r.title),[c,l]=(0,C.useState)(o),[u,d]=(0,C.useState)(!1),{editEntityRecord:p,__experimentalSaveSpecifiedEntityEdits:_}=(0,a.useDispatch)(i.store),{createSuccessNotice:m,createErrorNotice:g}=(0,a.useDispatch)(E.store);return(0,P.jsx)(S.Modal,{title:(0,j.__)("Rename"),...s,onRequestClose:e,focusOnMount:"firstContentElement",size:"small",children:(0,P.jsx)("form",{onSubmit:async a=>{if(a.preventDefault(),c&&c!==r.title&&!u)try{await p("postType",r.type,r.id,{title:c}),d(!0),l(""),e?.();const t=await _("postType",r.type,r.id,["title"],{throwOnError:!0});n?.(t),m((0,j.__)("Pattern renamed"),{type:"snackbar",id:"pattern-update"})}catch(e){t?.();const n=e.message&&"unknown_error"!==e.code?e.message:(0,j.__)("An error occurred while renaming the pattern.");g(n,{type:"snackbar",id:"pattern-update"})}finally{d(!1),l("")}},children:(0,P.jsxs)(S.__experimentalVStack,{spacing:"5",children:[(0,P.jsx)(S.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,j.__)("Name"),value:c,onChange:l,required:!0}),(0,P.jsxs)(S.__experimentalHStack,{justify:"right",children:[(0,P.jsx)(S.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>{e?.(),l("")},children:(0,j.__)("Cancel")}),(0,P.jsx)(S.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",children:(0,j.__)("Save")})]})]})})})},PatternsMenuItems:function({rootClientId:e}){return(0,P.jsx)(c.BlockSettingsMenuControls,{children:({selectedClientIds:t,onClose:n})=>(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(V,{clientIds:t,rootClientId:e,closeBlockSettingsMenu:n}),1===t.length&&(0,P.jsx)(q,{clientId:t[0]})]})})},RenamePatternCategoryModal:function({category:e,existingCategories:t,onClose:n,onError:r,onSuccess:s,...o}){const c=(0,C.useId)(),l=(0,C.useRef)(),[u,d]=(0,C.useState)((0,I.decodeEntities)(e.name)),[p,_]=(0,C.useState)(!1),[m,g]=(0,C.useState)(!1),h=m?`patterns-rename-pattern-category-modal__validation-message-${c}`:void 0,{saveEntityRecord:y,invalidateResolution:f}=(0,a.useDispatch)(i.store),{createErrorNotice:x,createSuccessNotice:b}=(0,a.useDispatch)(E.store),v=()=>{n(),d("")};return(0,P.jsx)(S.Modal,{title:(0,j.__)("Rename"),onRequestClose:v,...o,children:(0,P.jsx)("form",{onSubmit:async a=>{if(a.preventDefault(),!p){if(!u||u===e.name){const e=(0,j.__)("Please enter a new name for this category.");return(0,G.speak)(e,"assertive"),g(e),void l.current?.focus()}if(t.patternCategories.find((t=>t.id!==e.id&&t.label.toLowerCase()===u.toLowerCase()))){const e=(0,j.__)("This category already exists. Please use a different name.");return(0,G.speak)(e,"assertive"),g(e),void l.current?.focus()}try{_(!0);const t=await y("taxonomy",N,{id:e.id,slug:e.slug,name:u});f("getUserPatternCategories"),s?.(t),n(),b((0,j.__)("Pattern category renamed."),{type:"snackbar",id:"pattern-category-update"})}catch(e){r?.(),x(e.message,{type:"snackbar",id:"pattern-category-update"})}finally{_(!1),d("")}}},children:(0,P.jsxs)(S.__experimentalVStack,{spacing:"5",children:[(0,P.jsxs)(S.__experimentalVStack,{spacing:"2",children:[(0,P.jsx)(S.TextControl,{ref:l,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,j.__)("Name"),value:u,onChange:e=>{m&&g(void 0),d(e)},"aria-describedby":h,required:!0}),m&&(0,P.jsx)("span",{className:"patterns-rename-pattern-category-modal__validation-message",id:h,children:m})]}),(0,P.jsxs)(S.__experimentalHStack,{justify:"right",children:[(0,P.jsx)(S.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:v,children:(0,j.__)("Cancel")}),(0,P.jsx)(S.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit","aria-disabled":!u||u===e.name||p,isBusy:p,children:(0,j.__)("Save")})]})]})})})},PatternOverridesControls:Q,ResetOverridesControl:function(e){const t=e.attributes.metadata?.name,n=(0,a.useRegistry)(),r=(0,a.useSelect)((n=>{if(!t)return;const{getBlockAttributes:r,getBlockParentsByBlockName:a}=n(c.store),[s]=a(e.clientId,"core/block",!0);if(!s)return;const o=r(s)[W];return o?o.hasOwnProperty(t):void 0}),[e.clientId,t]);return(0,P.jsx)(c.__unstableBlockToolbarLastItem,{children:(0,P.jsx)(S.ToolbarGroup,{children:(0,P.jsx)(S.ToolbarButton,{onClick:function(){const{getBlockAttributes:r,getBlockParentsByBlockName:a}=n.select(c.store),[s]=a(e.clientId,"core/block",!0);if(!s)return;const o=r(s)[W];if(!o.hasOwnProperty(t))return;const{updateBlockAttributes:i,__unstableMarkLastChangeAsPersistent:l}=n.dispatch(c.store);l();let u={...o};delete u[t],Object.keys(u).length||(u=void 0),i(s,{[W]:u})},disabled:!r,children:(0,j.__)("Reset")})})})},PatternOverridesBlockControls:function(){const{clientIds:e,hasPatternOverrides:t,hasParentPattern:n}=(0,a.useSelect)((e=>{const{getBlockAttributes:t,getSelectedBlockClientIds:n,getBlockParentsByBlockName:r}=e(c.store),a=n(),s=a.every((e=>{var n;return Object.values(null!==(n=t(e)?.metadata?.bindings)&&void 0!==n?n:{}).some((e=>e?.source===_))})),o=a.every((e=>r(e,"core/block",!0).length>0));return{clientIds:a,hasPatternOverrides:s,hasParentPattern:o}}),[]);return t&&n?(0,P.jsx)(c.BlockControls,{group:"parent",children:(0,P.jsx)(X,{clientIds:e})}):null},useAddPatternCategory:M,PATTERN_TYPES:l,PATTERN_DEFAULT_CATEGORY:u,PATTERN_USER_CATEGORY:"my-patterns",EXCLUDED_PATTERN_SOURCES:["core","pattern-directory/core","pattern-directory/featured"],PATTERN_SYNC_TYPES:d,PARTIAL_SYNCING_SUPPORTED_BLOCKS:p}),(window.wp=window.wp||{}).patterns=t})(); \ No newline at end of file diff --git a/wp-includes/js/dist/plugins.js b/wp-includes/js/dist/plugins.js index 2535a6a85e..801066599a 100644 --- a/wp-includes/js/dist/plugins.js +++ b/wp-includes/js/dist/plugins.js @@ -231,6 +231,9 @@ const external_wp_isShallowEqual_namespaceObject = window["wp"]["isShallowEqual" var external_wp_isShallowEqual_default = /*#__PURE__*/__webpack_require__.n(external_wp_isShallowEqual_namespaceObject); ;// external ["wp","compose"] const external_wp_compose_namespaceObject = window["wp"]["compose"]; +;// external ["wp","deprecated"] +const external_wp_deprecated_namespaceObject = window["wp"]["deprecated"]; +var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject); ;// external "ReactJSXRuntime" const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"]; ;// ./node_modules/@wordpress/plugins/build-module/components/plugin-context/index.js @@ -240,6 +243,7 @@ const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"]; + /** * Internal dependencies */ @@ -263,6 +267,8 @@ function usePluginContext() { * A Higher Order Component used to inject Plugin context to the * wrapped component. * + * @deprecated 6.8.0 Use `usePluginContext` hook instead. + * * @param mapContextToProps Function called on every context change, * expected to return object of props to * merge with the component's own props. @@ -270,6 +276,10 @@ function usePluginContext() { * @return {Component} Enhanced component with injected context as props. */ const withPluginContext = mapContextToProps => (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(OriginalComponent => { + external_wp_deprecated_default()('wp.plugins.withPluginContext', { + since: '6.8.0', + alternative: 'wp.plugins.usePluginContext' + }); return props => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Context.Consumer, { children: context => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(OriginalComponent, { ...props, @@ -337,6 +347,7 @@ const plugins = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ex /* harmony default export */ const library_plugins = (plugins); ;// ./node_modules/@wordpress/plugins/build-module/api/index.js +/* wp:polyfill */ /* eslint no-console: [ 'error', { allow: [ 'error' ] } ] */ /** * External dependencies @@ -537,6 +548,7 @@ function getPlugins(scope) { } ;// ./node_modules/@wordpress/plugins/build-module/components/plugin-area/index.js +/* wp:polyfill */ /** * External dependencies */ diff --git a/wp-includes/js/dist/plugins.min.js b/wp-includes/js/dist/plugins.min.js index 0d75dc8995..ee5c47719b 100644 --- a/wp-includes/js/dist/plugins.min.js +++ b/wp-includes/js/dist/plugins.min.js @@ -1,2 +1,2 @@ /*! This file is auto-generated */ -(()=>{"use strict";var e={n:n=>{var r=n&&n.__esModule?()=>n.default:()=>n;return e.d(r,{a:r}),r},d:(n,r)=>{for(var t in r)e.o(r,t)&&!e.o(n,t)&&Object.defineProperty(n,t,{enumerable:!0,get:r[t]})},o:(e,n)=>Object.prototype.hasOwnProperty.call(e,n),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},n={};e.r(n),e.d(n,{PluginArea:()=>P,getPlugin:()=>w,getPlugins:()=>x,registerPlugin:()=>h,unregisterPlugin:()=>f,usePluginContext:()=>c,withPluginContext:()=>p});const r=window.wp.element,t=window.wp.hooks,o=window.wp.isShallowEqual;var i=e.n(o);const l=window.wp.compose,s=window.ReactJSXRuntime,u=(0,r.createContext)({name:null,icon:null}),a=u.Provider;function c(){return(0,r.useContext)(u)}const p=e=>(0,l.createHigherOrderComponent)((n=>r=>(0,s.jsx)(u.Consumer,{children:t=>(0,s.jsx)(n,{...r,...e(t,r)})})),"withPluginContext");class g extends r.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e){const{name:n,onError:r}=this.props;r&&r(n,e)}render(){return this.state.hasError?null:this.props.children}}const d=window.wp.primitives,v=(0,s.jsx)(d.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,s.jsx)(d.Path,{d:"M10.5 4v4h3V4H15v4h1.5a1 1 0 011 1v4l-3 4v2a1 1 0 01-1 1h-3a1 1 0 01-1-1v-2l-3-4V9a1 1 0 011-1H9V4h1.5zm.5 12.5v2h2v-2l3-4v-3H8v3l3 4z"})}),m={};function h(e,n){if("object"!=typeof n)return console.error("No settings object provided!"),null;if("string"!=typeof e)return console.error("Plugin name must be string."),null;if(!/^[a-z][a-z0-9-]*$/.test(e))return console.error('Plugin name must include only lowercase alphanumeric characters or dashes, and start with a letter. Example: "my-plugin".'),null;m[e]&&console.error(`Plugin "${e}" is already registered.`),n=(0,t.applyFilters)("plugins.registerPlugin",n,e);const{render:r,scope:o}=n;if("function"!=typeof r)return console.error('The "render" property must be specified and must be a valid function.'),null;if(o){if("string"!=typeof o)return console.error("Plugin scope must be string."),null;if(!/^[a-z][a-z0-9-]*$/.test(o))return console.error('Plugin scope must include only lowercase alphanumeric characters or dashes, and start with a letter. Example: "my-page".'),null}return m[e]={name:e,icon:v,...n},(0,t.doAction)("plugins.pluginRegistered",n,e),n}function f(e){if(!m[e])return void console.error('Plugin "'+e+'" is not registered.');const n=m[e];return delete m[e],(0,t.doAction)("plugins.pluginUnregistered",n,e),n}function w(e){return m[e]}function x(e){return Object.values(m).filter((n=>n.scope===e))}const y=function(e,n){var r,t,o=0;function i(){var i,l,s=r,u=arguments.length;e:for(;s;){if(s.args.length===arguments.length){for(l=0;l({icon:e,name:n})));const P=function({scope:e,onError:n}){const o=(0,r.useMemo)((()=>{let n=[];return{subscribe:e=>((0,t.addAction)("plugins.pluginRegistered","core/plugins/plugin-area/plugins-registered",e),(0,t.addAction)("plugins.pluginUnregistered","core/plugins/plugin-area/plugins-unregistered",e),()=>{(0,t.removeAction)("plugins.pluginRegistered","core/plugins/plugin-area/plugins-registered"),(0,t.removeAction)("plugins.pluginUnregistered","core/plugins/plugin-area/plugins-unregistered")}),getValue(){const r=x(e);return i()(n,r)||(n=r),n}}}),[e]),l=(0,r.useSyncExternalStore)(o.subscribe,o.getValue,o.getValue);return(0,s.jsx)("div",{style:{display:"none"},children:l.map((({icon:e,name:r,render:t})=>(0,s.jsx)(a,{value:y(e,r),children:(0,s.jsx)(g,{name:r,onError:n,children:(0,s.jsx)(t,{})})},r)))})};(window.wp=window.wp||{}).plugins=n})(); \ No newline at end of file +(()=>{"use strict";var e={n:n=>{var r=n&&n.__esModule?()=>n.default:()=>n;return e.d(r,{a:r}),r},d:(n,r)=>{for(var t in r)e.o(r,t)&&!e.o(n,t)&&Object.defineProperty(n,t,{enumerable:!0,get:r[t]})},o:(e,n)=>Object.prototype.hasOwnProperty.call(e,n),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},n={};e.r(n),e.d(n,{PluginArea:()=>j,getPlugin:()=>y,getPlugins:()=>P,registerPlugin:()=>f,unregisterPlugin:()=>x,usePluginContext:()=>g,withPluginContext:()=>d});const r=window.wp.element,t=window.wp.hooks,i=window.wp.isShallowEqual;var o=e.n(i);const l=window.wp.compose,s=window.wp.deprecated;var u=e.n(s);const a=window.ReactJSXRuntime,c=(0,r.createContext)({name:null,icon:null}),p=c.Provider;function g(){return(0,r.useContext)(c)}const d=e=>(0,l.createHigherOrderComponent)((n=>(u()("wp.plugins.withPluginContext",{since:"6.8.0",alternative:"wp.plugins.usePluginContext"}),r=>(0,a.jsx)(c.Consumer,{children:t=>(0,a.jsx)(n,{...r,...e(t,r)})}))),"withPluginContext");class v extends r.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e){const{name:n,onError:r}=this.props;r&&r(n,e)}render(){return this.state.hasError?null:this.props.children}}const w=window.wp.primitives,h=(0,a.jsx)(w.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,a.jsx)(w.Path,{d:"M10.5 4v4h3V4H15v4h1.5a1 1 0 011 1v4l-3 4v2a1 1 0 01-1 1h-3a1 1 0 01-1-1v-2l-3-4V9a1 1 0 011-1H9V4h1.5zm.5 12.5v2h2v-2l3-4v-3H8v3l3 4z"})}),m={};function f(e,n){if("object"!=typeof n)return console.error("No settings object provided!"),null;if("string"!=typeof e)return console.error("Plugin name must be string."),null;if(!/^[a-z][a-z0-9-]*$/.test(e))return console.error('Plugin name must include only lowercase alphanumeric characters or dashes, and start with a letter. Example: "my-plugin".'),null;m[e]&&console.error(`Plugin "${e}" is already registered.`),n=(0,t.applyFilters)("plugins.registerPlugin",n,e);const{render:r,scope:i}=n;if("function"!=typeof r)return console.error('The "render" property must be specified and must be a valid function.'),null;if(i){if("string"!=typeof i)return console.error("Plugin scope must be string."),null;if(!/^[a-z][a-z0-9-]*$/.test(i))return console.error('Plugin scope must include only lowercase alphanumeric characters or dashes, and start with a letter. Example: "my-page".'),null}return m[e]={name:e,icon:h,...n},(0,t.doAction)("plugins.pluginRegistered",n,e),n}function x(e){if(!m[e])return void console.error('Plugin "'+e+'" is not registered.');const n=m[e];return delete m[e],(0,t.doAction)("plugins.pluginUnregistered",n,e),n}function y(e){return m[e]}function P(e){return Object.values(m).filter((n=>n.scope===e))}const b=function(e,n){var r,t,i=0;function o(){var o,l,s=r,u=arguments.length;e:for(;s;){if(s.args.length===arguments.length){for(l=0;l({icon:e,name:n})));const j=function({scope:e,onError:n}){const i=(0,r.useMemo)((()=>{let n=[];return{subscribe:e=>((0,t.addAction)("plugins.pluginRegistered","core/plugins/plugin-area/plugins-registered",e),(0,t.addAction)("plugins.pluginUnregistered","core/plugins/plugin-area/plugins-unregistered",e),()=>{(0,t.removeAction)("plugins.pluginRegistered","core/plugins/plugin-area/plugins-registered"),(0,t.removeAction)("plugins.pluginUnregistered","core/plugins/plugin-area/plugins-unregistered")}),getValue(){const r=P(e);return o()(n,r)||(n=r),n}}}),[e]),l=(0,r.useSyncExternalStore)(i.subscribe,i.getValue,i.getValue);return(0,a.jsx)("div",{style:{display:"none"},children:l.map((({icon:e,name:r,render:t})=>(0,a.jsx)(p,{value:b(e,r),children:(0,a.jsx)(v,{name:r,onError:n,children:(0,a.jsx)(t,{})})},r)))})};(window.wp=window.wp||{}).plugins=n})(); \ No newline at end of file diff --git a/wp-includes/js/dist/preferences-persistence.js b/wp-includes/js/dist/preferences-persistence.js index e64ff89c95..375e6f0c85 100644 --- a/wp-includes/js/dist/preferences-persistence.js +++ b/wp-includes/js/dist/preferences-persistence.js @@ -355,6 +355,7 @@ function moveFeaturePreferences(state, sourceStoreName) { } ;// ./node_modules/@wordpress/preferences-persistence/build-module/migrations/legacy-local-storage-data/move-third-party-feature-preferences.js +/* wp:polyfill */ /** * The interface package previously had a public API that could be used by * plugins to set persisted boolean 'feature' preferences. @@ -527,6 +528,7 @@ function moveIndividualPreferenceToPreferences(state, { } ;// ./node_modules/@wordpress/preferences-persistence/build-module/migrations/legacy-local-storage-data/move-interface-enable-items.js +/* wp:polyfill */ /** * Migrates interface 'enableItems' data to the preferences store. * @@ -637,6 +639,7 @@ function moveInterfaceEnableItems(state) { } ;// ./node_modules/@wordpress/preferences-persistence/build-module/migrations/legacy-local-storage-data/convert-edit-post-panels.js +/* wp:polyfill */ /** * Convert the post editor's panels state from: * ``` @@ -784,6 +787,7 @@ function convertLegacyLocalStorageData(userId) { } ;// ./node_modules/@wordpress/preferences-persistence/build-module/migrations/preferences-package-data/convert-complementary-areas.js +/* wp:polyfill */ function convertComplementaryAreas(state) { return Object.keys(state).reduce((stateAccumulator, scope) => { const scopeData = state[scope]; diff --git a/wp-includes/js/dist/preferences.js b/wp-includes/js/dist/preferences.js index 3216d997e6..2ec5cdb3fa 100644 --- a/wp-includes/js/dist/preferences.js +++ b/wp-includes/js/dist/preferences.js @@ -386,11 +386,11 @@ function PreferenceToggleMenuItem({ } = (0,external_wp_data_namespaceObject.useDispatch)(store); const speakMessage = () => { if (isActive) { - const message = messageDeactivated || (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: preference name, e.g. 'Fullscreen mode' */ + const message = messageDeactivated || (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: preference name, e.g. 'Fullscreen mode' */ (0,external_wp_i18n_namespaceObject.__)('Preference deactivated - %s'), label); (0,external_wp_a11y_namespaceObject.speak)(message); } else { - const message = messageActivated || (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: preference name, e.g. 'Fullscreen mode' */ + const message = messageActivated || (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: preference name, e.g. 'Fullscreen mode' */ (0,external_wp_i18n_namespaceObject.__)('Preference activated - %s'), label); (0,external_wp_a11y_namespaceObject.speak)(message); } @@ -422,7 +422,6 @@ function PreferenceToggleMenuItem({ */ - function BaseOption({ help, label, @@ -499,7 +498,6 @@ function PreferencesModal({ ;// ./node_modules/@wordpress/preferences/build-module/components/preferences-modal-section/index.js - const Section = ({ description, title, @@ -538,7 +536,7 @@ const external_wp_element_namespaceObject = window["wp"]["element"]; * Return an SVG icon. * * @param {IconProps} props icon is the SVG component to render - * size is a number specifiying the icon size in pixels + * size is a number specifying the icon size in pixels * Other props will be passed to wrapped SVG component * @param {import('react').ForwardedRef} ref The forwarded ref to the SVG element. * @@ -601,6 +599,7 @@ const { } = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/preferences'); ;// ./node_modules/@wordpress/preferences/build-module/components/preferences-modal-tabs/index.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -615,7 +614,6 @@ const { */ - const { Tabs } = unlock(external_wp_components_namespaceObject.privateApis); @@ -685,10 +683,10 @@ function PreferencesModalTabs({ }) }); } else { - modalContent = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalNavigatorProvider, { + modalContent = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Navigator, { initialPath: "/", className: "preferences__provider", - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalNavigatorScreen, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Navigator.Screen, { path: "/", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Card, { isBorderless: true, @@ -696,7 +694,7 @@ function PreferencesModalTabs({ children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.CardBody, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalItemGroup, { children: tabs.map(tab => { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalNavigatorButton, { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Navigator.Button, { path: `/${tab.name}`, as: external_wp_components_namespaceObject.__experimentalItem, isAction: true, @@ -718,7 +716,7 @@ function PreferencesModalTabs({ }) }) }), sections.length && sections.map(section => { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalNavigatorScreen, { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Navigator.Screen, { path: `/${section.name}`, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Card, { isBorderless: true, @@ -728,7 +726,7 @@ function PreferencesModalTabs({ justify: "left", size: "small", gap: "6", - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalNavigatorBackButton, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Navigator.BackButton, { icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_right : chevron_left, label: (0,external_wp_i18n_namespaceObject.__)('Back') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { diff --git a/wp-includes/js/dist/preferences.min.js b/wp-includes/js/dist/preferences.min.js index aa9c18c739..fcf15c7e1b 100644 --- a/wp-includes/js/dist/preferences.min.js +++ b/wp-includes/js/dist/preferences.min.js @@ -1,2 +1,2 @@ /*! This file is auto-generated */ -(()=>{"use strict";var e={n:t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},d:(t,n)=>{for(var s in n)e.o(n,s)&&!e.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:n[s]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{PreferenceToggleMenuItem:()=>v,privateApis:()=>A,store:()=>j});var n={};e.r(n),e.d(n,{set:()=>f,setDefaults:()=>h,setPersistenceLayer:()=>_,toggle:()=>m});var s={};e.r(s),e.d(s,{get:()=>g});const r=window.wp.data,a=window.wp.components,o=window.wp.i18n,i=window.wp.primitives,c=window.ReactJSXRuntime,l=(0,c.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(i.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})}),d=window.wp.a11y;const p=function(e){let t;return(n,s)=>{if("SET_PERSISTENCE_LAYER"===s.type){const{persistenceLayer:e,persistedData:n}=s;return t=e,n}const r=e(n,s);return"SET_PREFERENCE_VALUE"===s.type&&t?.set(r),r}}(((e={},t)=>{if("SET_PREFERENCE_VALUE"===t.type){const{scope:n,name:s,value:r}=t;return{...e,[n]:{...e[n],[s]:r}}}return e})),u=(0,r.combineReducers)({defaults:function(e={},t){if("SET_PREFERENCE_DEFAULTS"===t.type){const{scope:n,defaults:s}=t;return{...e,[n]:{...e[n],...s}}}return e},preferences:p});function m(e,t){return function({select:n,dispatch:s}){const r=n.get(e,t);s.set(e,t,!r)}}function f(e,t,n){return{type:"SET_PREFERENCE_VALUE",scope:e,name:t,value:n}}function h(e,t){return{type:"SET_PREFERENCE_DEFAULTS",scope:e,defaults:t}}async function _(e){const t=await e.get();return{type:"SET_PERSISTENCE_LAYER",persistenceLayer:e,persistedData:t}}const w=window.wp.deprecated;var x=e.n(w);const g=(b=(e,t,n)=>{const s=e.preferences[t]?.[n];return void 0!==s?s:e.defaults[t]?.[n]},(e,t,n)=>["allowRightClickOverrides","distractionFree","editorMode","fixedToolbar","focusMode","hiddenBlockTypes","inactivePanels","keepCaretInsideBlock","mostUsedBlocks","openPanels","showBlockBreadcrumbs","showIconLabels","showListViewByDefault","isPublishSidebarEnabled","isComplementaryAreaVisible","pinnedItems"].includes(n)&&["core/edit-post","core/edit-site"].includes(t)?(x()(`wp.data.select( 'core/preferences' ).get( '${t}', '${n}' )`,{since:"6.5",alternative:`wp.data.select( 'core/preferences' ).get( 'core', '${n}' )`}),b(e,"core",n)):b(e,t,n));var b;const j=(0,r.createReduxStore)("core/preferences",{reducer:u,actions:n,selectors:s});function v({scope:e,name:t,label:n,info:s,messageActivated:i,messageDeactivated:p,shortcut:u,handleToggling:m=!0,onToggle:f=()=>null,disabled:h=!1}){const _=(0,r.useSelect)((n=>!!n(j).get(e,t)),[e,t]),{toggle:w}=(0,r.useDispatch)(j);return(0,c.jsx)(a.MenuItem,{icon:_&&l,isSelected:_,onClick:()=>{f(),m&&w(e,t),(()=>{if(_){const e=p||(0,o.sprintf)((0,o.__)("Preference deactivated - %s"),n);(0,d.speak)(e)}else{const e=i||(0,o.sprintf)((0,o.__)("Preference activated - %s"),n);(0,d.speak)(e)}})()},role:"menuitemcheckbox",info:s,shortcut:u,disabled:h,children:n})}(0,r.register)(j);const E=function({help:e,label:t,isChecked:n,onChange:s,children:r}){return(0,c.jsxs)("div",{className:"preference-base-option",children:[(0,c.jsx)(a.ToggleControl,{__nextHasNoMarginBottom:!0,help:e,label:t,checked:n,onChange:s}),r]})};const S=function(e){const{scope:t,featureName:n,onToggle:s=()=>{},...a}=e,o=(0,r.useSelect)((e=>!!e(j).get(t,n)),[t,n]),{toggle:i}=(0,r.useDispatch)(j);return(0,c.jsx)(E,{onChange:()=>{s(),i(t,n)},isChecked:o,...a})};const P=({description:e,title:t,children:n})=>(0,c.jsxs)("fieldset",{className:"preferences-modal__section",children:[(0,c.jsxs)("legend",{className:"preferences-modal__section-legend",children:[(0,c.jsx)("h2",{className:"preferences-modal__section-title",children:t}),e&&(0,c.jsx)("p",{className:"preferences-modal__section-description",children:e})]}),(0,c.jsx)("div",{className:"preferences-modal__section-content",children:n})]}),T=window.wp.compose,y=window.wp.element;const C=(0,y.forwardRef)((function({icon:e,size:t=24,...n},s){return(0,y.cloneElement)(e,{width:t,height:t,...n,ref:s})})),N=(0,c.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(i.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"})}),M=(0,c.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(i.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"})}),R=window.wp.privateApis,{lock:k,unlock:B}=(0,R.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/preferences"),{Tabs:L}=B(a.privateApis),I="preferences-menu";const A={};k(A,{PreferenceBaseOption:E,PreferenceToggleControl:S,PreferencesModal:function({closeModal:e,children:t}){return(0,c.jsx)(a.Modal,{className:"preferences-modal",title:(0,o.__)("Preferences"),onRequestClose:e,children:t})},PreferencesModalSection:P,PreferencesModalTabs:function({sections:e}){const t=(0,T.useViewportMatch)("medium"),[n,s]=(0,y.useState)(I),{tabs:r,sectionsContentMap:i}=(0,y.useMemo)((()=>{let t={tabs:[],sectionsContentMap:{}};return e.length&&(t=e.reduce(((e,{name:t,tabLabel:n,content:s})=>(e.tabs.push({name:t,title:n}),e.sectionsContentMap[t]=s,e)),{tabs:[],sectionsContentMap:{}})),t}),[e]);let l;return l=t?(0,c.jsx)("div",{className:"preferences__tabs",children:(0,c.jsxs)(L,{defaultTabId:n!==I?n:void 0,onSelect:s,orientation:"vertical",children:[(0,c.jsx)(L.TabList,{className:"preferences__tabs-tablist",children:r.map((e=>(0,c.jsx)(L.Tab,{tabId:e.name,className:"preferences__tabs-tab",children:e.title},e.name)))}),r.map((e=>(0,c.jsx)(L.TabPanel,{tabId:e.name,className:"preferences__tabs-tabpanel",focusable:!1,children:i[e.name]||null},e.name)))]})}):(0,c.jsxs)(a.__experimentalNavigatorProvider,{initialPath:"/",className:"preferences__provider",children:[(0,c.jsx)(a.__experimentalNavigatorScreen,{path:"/",children:(0,c.jsx)(a.Card,{isBorderless:!0,size:"small",children:(0,c.jsx)(a.CardBody,{children:(0,c.jsx)(a.__experimentalItemGroup,{children:r.map((e=>(0,c.jsx)(a.__experimentalNavigatorButton,{path:`/${e.name}`,as:a.__experimentalItem,isAction:!0,children:(0,c.jsxs)(a.__experimentalHStack,{justify:"space-between",children:[(0,c.jsx)(a.FlexItem,{children:(0,c.jsx)(a.__experimentalTruncate,{children:e.title})}),(0,c.jsx)(a.FlexItem,{children:(0,c.jsx)(C,{icon:(0,o.isRTL)()?N:M})})]})},e.name)))})})})}),e.length&&e.map((e=>(0,c.jsx)(a.__experimentalNavigatorScreen,{path:`/${e.name}`,children:(0,c.jsxs)(a.Card,{isBorderless:!0,size:"large",children:[(0,c.jsxs)(a.CardHeader,{isBorderless:!1,justify:"left",size:"small",gap:"6",children:[(0,c.jsx)(a.__experimentalNavigatorBackButton,{icon:(0,o.isRTL)()?M:N,label:(0,o.__)("Back")}),(0,c.jsx)(a.__experimentalText,{size:"16",children:e.tabLabel})]}),(0,c.jsx)(a.CardBody,{children:e.content})]})},`${e.name}-menu`)))]}),l}}),(window.wp=window.wp||{}).preferences=t})(); \ No newline at end of file +(()=>{"use strict";var e={n:t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},d:(t,n)=>{for(var s in n)e.o(n,s)&&!e.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:n[s]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{PreferenceToggleMenuItem:()=>v,privateApis:()=>A,store:()=>j});var n={};e.r(n),e.d(n,{set:()=>f,setDefaults:()=>h,setPersistenceLayer:()=>w,toggle:()=>m});var s={};e.r(s),e.d(s,{get:()=>x});const r=window.wp.data,a=window.wp.components,o=window.wp.i18n,i=window.wp.primitives,c=window.ReactJSXRuntime,l=(0,c.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(i.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})}),d=window.wp.a11y;const p=function(e){let t;return(n,s)=>{if("SET_PERSISTENCE_LAYER"===s.type){const{persistenceLayer:e,persistedData:n}=s;return t=e,n}const r=e(n,s);return"SET_PREFERENCE_VALUE"===s.type&&t?.set(r),r}}(((e={},t)=>{if("SET_PREFERENCE_VALUE"===t.type){const{scope:n,name:s,value:r}=t;return{...e,[n]:{...e[n],[s]:r}}}return e})),u=(0,r.combineReducers)({defaults:function(e={},t){if("SET_PREFERENCE_DEFAULTS"===t.type){const{scope:n,defaults:s}=t;return{...e,[n]:{...e[n],...s}}}return e},preferences:p});function m(e,t){return function({select:n,dispatch:s}){const r=n.get(e,t);s.set(e,t,!r)}}function f(e,t,n){return{type:"SET_PREFERENCE_VALUE",scope:e,name:t,value:n}}function h(e,t){return{type:"SET_PREFERENCE_DEFAULTS",scope:e,defaults:t}}async function w(e){const t=await e.get();return{type:"SET_PERSISTENCE_LAYER",persistenceLayer:e,persistedData:t}}const g=window.wp.deprecated;var _=e.n(g);const x=(b=(e,t,n)=>{const s=e.preferences[t]?.[n];return void 0!==s?s:e.defaults[t]?.[n]},(e,t,n)=>["allowRightClickOverrides","distractionFree","editorMode","fixedToolbar","focusMode","hiddenBlockTypes","inactivePanels","keepCaretInsideBlock","mostUsedBlocks","openPanels","showBlockBreadcrumbs","showIconLabels","showListViewByDefault","isPublishSidebarEnabled","isComplementaryAreaVisible","pinnedItems"].includes(n)&&["core/edit-post","core/edit-site"].includes(t)?(_()(`wp.data.select( 'core/preferences' ).get( '${t}', '${n}' )`,{since:"6.5",alternative:`wp.data.select( 'core/preferences' ).get( 'core', '${n}' )`}),b(e,"core",n)):b(e,t,n));var b;const j=(0,r.createReduxStore)("core/preferences",{reducer:u,actions:n,selectors:s});function v({scope:e,name:t,label:n,info:s,messageActivated:i,messageDeactivated:p,shortcut:u,handleToggling:m=!0,onToggle:f=()=>null,disabled:h=!1}){const w=(0,r.useSelect)((n=>!!n(j).get(e,t)),[e,t]),{toggle:g}=(0,r.useDispatch)(j);return(0,c.jsx)(a.MenuItem,{icon:w&&l,isSelected:w,onClick:()=>{f(),m&&g(e,t),(()=>{if(w){const e=p||(0,o.sprintf)((0,o.__)("Preference deactivated - %s"),n);(0,d.speak)(e)}else{const e=i||(0,o.sprintf)((0,o.__)("Preference activated - %s"),n);(0,d.speak)(e)}})()},role:"menuitemcheckbox",info:s,shortcut:u,disabled:h,children:n})}(0,r.register)(j);const E=function({help:e,label:t,isChecked:n,onChange:s,children:r}){return(0,c.jsxs)("div",{className:"preference-base-option",children:[(0,c.jsx)(a.ToggleControl,{__nextHasNoMarginBottom:!0,help:e,label:t,checked:n,onChange:s}),r]})};const S=function(e){const{scope:t,featureName:n,onToggle:s=()=>{},...a}=e,o=(0,r.useSelect)((e=>!!e(j).get(t,n)),[t,n]),{toggle:i}=(0,r.useDispatch)(j);return(0,c.jsx)(E,{onChange:()=>{s(),i(t,n)},isChecked:o,...a})};const T=({description:e,title:t,children:n})=>(0,c.jsxs)("fieldset",{className:"preferences-modal__section",children:[(0,c.jsxs)("legend",{className:"preferences-modal__section-legend",children:[(0,c.jsx)("h2",{className:"preferences-modal__section-title",children:t}),e&&(0,c.jsx)("p",{className:"preferences-modal__section-description",children:e})]}),(0,c.jsx)("div",{className:"preferences-modal__section-content",children:n})]}),P=window.wp.compose,y=window.wp.element;const C=(0,y.forwardRef)((function({icon:e,size:t=24,...n},s){return(0,y.cloneElement)(e,{width:t,height:t,...n,ref:s})})),N=(0,c.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(i.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"})}),M=(0,c.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(i.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"})}),R=window.wp.privateApis,{lock:k,unlock:B}=(0,R.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/preferences"),{Tabs:L}=B(a.privateApis),I="preferences-menu";const A={};k(A,{PreferenceBaseOption:E,PreferenceToggleControl:S,PreferencesModal:function({closeModal:e,children:t}){return(0,c.jsx)(a.Modal,{className:"preferences-modal",title:(0,o.__)("Preferences"),onRequestClose:e,children:t})},PreferencesModalSection:T,PreferencesModalTabs:function({sections:e}){const t=(0,P.useViewportMatch)("medium"),[n,s]=(0,y.useState)(I),{tabs:r,sectionsContentMap:i}=(0,y.useMemo)((()=>{let t={tabs:[],sectionsContentMap:{}};return e.length&&(t=e.reduce(((e,{name:t,tabLabel:n,content:s})=>(e.tabs.push({name:t,title:n}),e.sectionsContentMap[t]=s,e)),{tabs:[],sectionsContentMap:{}})),t}),[e]);let l;return l=t?(0,c.jsx)("div",{className:"preferences__tabs",children:(0,c.jsxs)(L,{defaultTabId:n!==I?n:void 0,onSelect:s,orientation:"vertical",children:[(0,c.jsx)(L.TabList,{className:"preferences__tabs-tablist",children:r.map((e=>(0,c.jsx)(L.Tab,{tabId:e.name,className:"preferences__tabs-tab",children:e.title},e.name)))}),r.map((e=>(0,c.jsx)(L.TabPanel,{tabId:e.name,className:"preferences__tabs-tabpanel",focusable:!1,children:i[e.name]||null},e.name)))]})}):(0,c.jsxs)(a.Navigator,{initialPath:"/",className:"preferences__provider",children:[(0,c.jsx)(a.Navigator.Screen,{path:"/",children:(0,c.jsx)(a.Card,{isBorderless:!0,size:"small",children:(0,c.jsx)(a.CardBody,{children:(0,c.jsx)(a.__experimentalItemGroup,{children:r.map((e=>(0,c.jsx)(a.Navigator.Button,{path:`/${e.name}`,as:a.__experimentalItem,isAction:!0,children:(0,c.jsxs)(a.__experimentalHStack,{justify:"space-between",children:[(0,c.jsx)(a.FlexItem,{children:(0,c.jsx)(a.__experimentalTruncate,{children:e.title})}),(0,c.jsx)(a.FlexItem,{children:(0,c.jsx)(C,{icon:(0,o.isRTL)()?N:M})})]})},e.name)))})})})}),e.length&&e.map((e=>(0,c.jsx)(a.Navigator.Screen,{path:`/${e.name}`,children:(0,c.jsxs)(a.Card,{isBorderless:!0,size:"large",children:[(0,c.jsxs)(a.CardHeader,{isBorderless:!1,justify:"left",size:"small",gap:"6",children:[(0,c.jsx)(a.Navigator.BackButton,{icon:(0,o.isRTL)()?M:N,label:(0,o.__)("Back")}),(0,c.jsx)(a.__experimentalText,{size:"16",children:e.tabLabel})]}),(0,c.jsx)(a.CardBody,{children:e.content})]})},`${e.name}-menu`)))]}),l}}),(window.wp=window.wp||{}).preferences=t})(); \ No newline at end of file diff --git a/wp-includes/js/dist/private-apis.js b/wp-includes/js/dist/private-apis.js index 1c34943faa..59cdeca218 100644 --- a/wp-includes/js/dist/private-apis.js +++ b/wp-includes/js/dist/private-apis.js @@ -47,20 +47,18 @@ __webpack_require__.d(__webpack_exports__, { * wordpress/private-apis – the utilities to enable private cross-package * exports of private APIs. * - * This "implementation.js" file is needed for the sake of the unit tests. It + * This "implementation.ts" file is needed for the sake of the unit tests. It * exports more than the public API of the package to aid in testing. */ /** * The list of core modules allowed to opt-in to the private APIs. */ -const CORE_MODULES_USING_PRIVATE_APIS = ['@wordpress/block-directory', '@wordpress/block-editor', '@wordpress/block-library', '@wordpress/blocks', '@wordpress/commands', '@wordpress/components', '@wordpress/core-commands', '@wordpress/core-data', '@wordpress/customize-widgets', '@wordpress/data', '@wordpress/edit-post', '@wordpress/edit-site', '@wordpress/edit-widgets', '@wordpress/editor', '@wordpress/format-library', '@wordpress/interface', '@wordpress/patterns', '@wordpress/preferences', '@wordpress/reusable-blocks', '@wordpress/router', '@wordpress/dataviews', '@wordpress/fields']; +const CORE_MODULES_USING_PRIVATE_APIS = ['@wordpress/block-directory', '@wordpress/block-editor', '@wordpress/block-library', '@wordpress/blocks', '@wordpress/commands', '@wordpress/components', '@wordpress/core-commands', '@wordpress/core-data', '@wordpress/customize-widgets', '@wordpress/data', '@wordpress/edit-post', '@wordpress/edit-site', '@wordpress/edit-widgets', '@wordpress/editor', '@wordpress/format-library', '@wordpress/patterns', '@wordpress/preferences', '@wordpress/reusable-blocks', '@wordpress/router', '@wordpress/dataviews', '@wordpress/fields', '@wordpress/media-utils', '@wordpress/upload-media']; /** * A list of core modules that already opted-in to * the privateApis package. - * - * @type {string[]} */ const registeredPrivateApis = []; @@ -80,26 +78,16 @@ const registeredPrivateApis = []; */ const requiredConsent = 'I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.'; -/** @type {boolean} */ -let allowReRegistration; -// The safety measure is meant for WordPress core where IS_WORDPRESS_CORE -// is set to true. -// For the general use-case, the re-registration should be allowed by default -// Let's default to true, then. Try/catch will fall back to "true" even if the -// environment variable is not explicitly defined. -try { - allowReRegistration = true ? false : 0; -} catch (error) { - allowReRegistration = true; -} +// The safety measure is meant for WordPress core where IS_WORDPRESS_CORE is set to true. +const allowReRegistration = true ? false : 0; /** * Called by a @wordpress package wishing to opt-in to accessing or exposing * private private APIs. * - * @param {string} consent The consent string. - * @param {string} moduleName The name of the module that is opting in. - * @return {{lock: typeof lock, unlock: typeof unlock}} An object containing the lock and unlock functions. + * @param consent The consent string. + * @param moduleName The name of the module that is opting in. + * @return An object containing the lock and unlock functions. */ const __dangerousOptInToUnstableAPIsOnlyForCoreModules = (consent, moduleName) => { if (!CORE_MODULES_USING_PRIVATE_APIS.includes(moduleName)) { @@ -142,17 +130,18 @@ const __dangerousOptInToUnstableAPIsOnlyForCoreModules = (consent, moduleName) = * // { a: 1 } * ``` * - * @param {any} object The object to bind the private data to. - * @param {any} privateData The private data to bind to the object. + * @param object The object to bind the private data to. + * @param privateData The private data to bind to the object. */ function lock(object, privateData) { if (!object) { throw new Error('Cannot lock an undefined object.'); } - if (!(__private in object)) { - object[__private] = {}; + const _object = object; + if (!(__private in _object)) { + _object[__private] = {}; } - lockedData.set(object[__private], privateData); + lockedData.set(_object[__private], privateData); } /** @@ -175,17 +164,18 @@ function lock(object, privateData) { * // { a: 1 } * ``` * - * @param {any} object The object to unlock the private data from. - * @return {any} The private data bound to the object. + * @param object The object to unlock the private data from. + * @return The private data bound to the object. */ function unlock(object) { if (!object) { throw new Error('Cannot unlock an undefined object.'); } - if (!(__private in object)) { + const _object = object; + if (!(__private in _object)) { throw new Error('Cannot unlock an object that was not locked before. '); } - return lockedData.get(object[__private]); + return lockedData.get(_object[__private]); } const lockedData = new WeakMap(); @@ -201,7 +191,7 @@ const __private = Symbol('Private API ID'); * Private function to allow the unit tests to allow * a mock module to access the private APIs. * - * @param {string} name The name of the module. + * @param name The name of the module. */ function allowCoreModule(name) { CORE_MODULES_USING_PRIVATE_APIS.push(name); diff --git a/wp-includes/js/dist/private-apis.min.js b/wp-includes/js/dist/private-apis.min.js index 6036ac51b6..195dc90df6 100644 --- a/wp-includes/js/dist/private-apis.min.js +++ b/wp-includes/js/dist/private-apis.min.js @@ -1,2 +1,2 @@ /*! This file is auto-generated */ -(()=>{"use strict";var e={d:(r,o)=>{for(var s in o)e.o(o,s)&&!e.o(r,s)&&Object.defineProperty(r,s,{enumerable:!0,get:o[s]})},o:(e,r)=>Object.prototype.hasOwnProperty.call(e,r),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},r={};e.r(r),e.d(r,{__dangerousOptInToUnstableAPIsOnlyForCoreModules:()=>n});const o=["@wordpress/block-directory","@wordpress/block-editor","@wordpress/block-library","@wordpress/blocks","@wordpress/commands","@wordpress/components","@wordpress/core-commands","@wordpress/core-data","@wordpress/customize-widgets","@wordpress/data","@wordpress/edit-post","@wordpress/edit-site","@wordpress/edit-widgets","@wordpress/editor","@wordpress/format-library","@wordpress/interface","@wordpress/patterns","@wordpress/preferences","@wordpress/reusable-blocks","@wordpress/router","@wordpress/dataviews","@wordpress/fields"],s=[];let t;try{t=!1}catch(e){t=!0}const n=(e,r)=>{if(!o.includes(r))throw new Error(`You tried to opt-in to unstable APIs as module "${r}". This feature is only for JavaScript modules shipped with WordPress core. Please do not use it in plugins and themes as the unstable APIs will be removed without a warning. If you ignore this error and depend on unstable features, your product will inevitably break on one of the next WordPress releases.`);if(!t&&s.includes(r))throw new Error(`You tried to opt-in to unstable APIs as module "${r}" which is already registered. This feature is only for JavaScript modules shipped with WordPress core. Please do not use it in plugins and themes as the unstable APIs will be removed without a warning. If you ignore this error and depend on unstable features, your product will inevitably break on one of the next WordPress releases.`);if("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress."!==e)throw new Error("You tried to opt-in to unstable APIs without confirming you know the consequences. This feature is only for JavaScript modules shipped with WordPress core. Please do not use it in plugins and themes as the unstable APIs will removed without a warning. If you ignore this error and depend on unstable features, your product will inevitably break on the next WordPress release.");return s.push(r),{lock:i,unlock:d}};function i(e,r){if(!e)throw new Error("Cannot lock an undefined object.");l in e||(e[l]={}),a.set(e[l],r)}function d(e){if(!e)throw new Error("Cannot unlock an undefined object.");if(!(l in e))throw new Error("Cannot unlock an object that was not locked before. ");return a.get(e[l])}const a=new WeakMap,l=Symbol("Private API ID");(window.wp=window.wp||{}).privateApis=r})(); \ No newline at end of file +(()=>{"use strict";var e={d:(r,o)=>{for(var s in o)e.o(o,s)&&!e.o(r,s)&&Object.defineProperty(r,s,{enumerable:!0,get:o[s]})},o:(e,r)=>Object.prototype.hasOwnProperty.call(e,r),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},r={};e.r(r),e.d(r,{__dangerousOptInToUnstableAPIsOnlyForCoreModules:()=>t});const o=["@wordpress/block-directory","@wordpress/block-editor","@wordpress/block-library","@wordpress/blocks","@wordpress/commands","@wordpress/components","@wordpress/core-commands","@wordpress/core-data","@wordpress/customize-widgets","@wordpress/data","@wordpress/edit-post","@wordpress/edit-site","@wordpress/edit-widgets","@wordpress/editor","@wordpress/format-library","@wordpress/patterns","@wordpress/preferences","@wordpress/reusable-blocks","@wordpress/router","@wordpress/dataviews","@wordpress/fields","@wordpress/media-utils","@wordpress/upload-media"],s=[],t=(e,r)=>{if(!o.includes(r))throw new Error(`You tried to opt-in to unstable APIs as module "${r}". This feature is only for JavaScript modules shipped with WordPress core. Please do not use it in plugins and themes as the unstable APIs will be removed without a warning. If you ignore this error and depend on unstable features, your product will inevitably break on one of the next WordPress releases.`);if(s.includes(r))throw new Error(`You tried to opt-in to unstable APIs as module "${r}" which is already registered. This feature is only for JavaScript modules shipped with WordPress core. Please do not use it in plugins and themes as the unstable APIs will be removed without a warning. If you ignore this error and depend on unstable features, your product will inevitably break on one of the next WordPress releases.`);if("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress."!==e)throw new Error("You tried to opt-in to unstable APIs without confirming you know the consequences. This feature is only for JavaScript modules shipped with WordPress core. Please do not use it in plugins and themes as the unstable APIs will removed without a warning. If you ignore this error and depend on unstable features, your product will inevitably break on the next WordPress release.");return s.push(r),{lock:n,unlock:i}};function n(e,r){if(!e)throw new Error("Cannot lock an undefined object.");const o=e;a in o||(o[a]={}),d.set(o[a],r)}function i(e){if(!e)throw new Error("Cannot unlock an undefined object.");const r=e;if(!(a in r))throw new Error("Cannot unlock an object that was not locked before. ");return d.get(r[a])}const d=new WeakMap,a=Symbol("Private API ID");(window.wp=window.wp||{}).privateApis=r})(); \ No newline at end of file diff --git a/wp-includes/js/dist/redux-routine.js b/wp-includes/js/dist/redux-routine.js index dfc3c67e4b..f0ff6c9668 100644 --- a/wp-includes/js/dist/redux-routine.js +++ b/wp-includes/js/dist/redux-routine.js @@ -797,6 +797,7 @@ function isActionOfType(object, expectedType) { } ;// ./node_modules/@wordpress/redux-routine/build-module/runtime.js +/* wp:polyfill */ /** * External dependencies */ diff --git a/wp-includes/js/dist/reusable-blocks.js b/wp-includes/js/dist/reusable-blocks.js index d1dc6ab379..2695076176 100644 --- a/wp-includes/js/dist/reusable-blocks.js +++ b/wp-includes/js/dist/reusable-blocks.js @@ -69,6 +69,7 @@ const external_wp_blocks_namespaceObject = window["wp"]["blocks"]; ;// external ["wp","i18n"] const external_wp_i18n_namespaceObject = window["wp"]["i18n"]; ;// ./node_modules/@wordpress/reusable-blocks/build-module/store/actions.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -249,6 +250,7 @@ const external_wp_notices_namespaceObject = window["wp"]["notices"]; ;// external ["wp","coreData"] const external_wp_coreData_namespaceObject = window["wp"]["coreData"]; ;// ./node_modules/@wordpress/reusable-blocks/build-module/components/reusable-blocks-menu-items/reusable-block-convert-button.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -277,8 +279,6 @@ const external_wp_coreData_namespaceObject = window["wp"]["coreData"]; * @return {import('react').ComponentType} The menu control or null. */ - - function ReusableBlockConvertButton({ clientIds, rootClientId, @@ -426,8 +426,6 @@ const external_wp_url_namespaceObject = window["wp"]["url"]; */ - - function ReusableBlocksManageButton({ clientId }) { @@ -496,8 +494,6 @@ function ReusableBlocksManageButton({ - - function ReusableBlocksMenuItems({ rootClientId }) { diff --git a/wp-includes/js/dist/rich-text.js b/wp-includes/js/dist/rich-text.js index 468b6fe38d..668773214e 100644 --- a/wp-includes/js/dist/rich-text.js +++ b/wp-includes/js/dist/rich-text.js @@ -103,6 +103,7 @@ __webpack_require__.d(actions_namespaceObject, { ;// external ["wp","data"] const external_wp_data_namespaceObject = window["wp"]["data"]; ;// ./node_modules/@wordpress/rich-text/build-module/store/reducer.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -137,6 +138,7 @@ function formatTypes(state = {}, action) { })); ;// ./node_modules/@wordpress/rich-text/build-module/store/selectors.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -211,7 +213,7 @@ const getFormatTypes = (0,external_wp_data_namespaceObject.createSelector)(state * }; * ``` * - * @return {Object?} Format type. + * @return {?Object} Format type. */ function getFormatType(state, name) { return state.formatTypes[name]; @@ -417,6 +419,7 @@ function isFormatEqual(format1, format2) { } ;// ./node_modules/@wordpress/rich-text/build-module/normalise-formats.js +/* wp:polyfill */ /** * Internal dependencies */ @@ -455,6 +458,7 @@ function normaliseFormats(value) { } ;// ./node_modules/@wordpress/rich-text/build-module/apply-format.js +/* wp:polyfill */ /** * Internal dependencies */ @@ -584,6 +588,7 @@ const ZWNBSP = '\ufeff'; ;// external ["wp","escapeHtml"] const external_wp_escapeHtml_namespaceObject = window["wp"]["escapeHtml"]; ;// ./node_modules/@wordpress/rich-text/build-module/get-active-formats.js +/* wp:polyfill */ /** @typedef {import('./types').RichTextValue} RichTextValue */ /** @typedef {import('./types').RichTextFormatList} RichTextFormatList */ @@ -691,6 +696,7 @@ function get_format_type_getFormatType(name) { } ;// ./node_modules/@wordpress/rich-text/build-module/to-tree.js +/* wp:polyfill */ /** * Internal dependencies */ @@ -896,7 +902,18 @@ function toTree({ innerHTML } = replacement; const formatType = get_format_type_getFormatType(type); - if (!isEditableTree && type === 'script') { + if (isEditableTree && type === '#comment') { + pointer = append(getParent(pointer), { + type: 'span', + attributes: { + contenteditable: 'false', + 'data-rich-text-comment': attributes['data-rich-text-comment'] + } + }); + append(append(pointer, { + type: 'span' + }), attributes['data-rich-text-comment'].trim()); + } else if (!isEditableTree && type === 'script') { pointer = append(getParent(pointer), fromFormat({ type: 'script', isEditableTree @@ -970,6 +987,7 @@ function toTree({ } ;// ./node_modules/@wordpress/rich-text/build-module/to-html-string.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -987,7 +1005,7 @@ function toTree({ /** * Create an HTML string from a Rich Text value. * - * @param {Object} $1 Named argements. + * @param {Object} $1 Named arguments. * @param {RichTextValue} $1.value Rich text value. * @param {boolean} [$1.preserveWhiteSpace] Preserves newlines if true. * @@ -1061,6 +1079,14 @@ function createElementHTML({ object, children }) { + if (type === '#comment') { + // We can't restore the original comment delimiters, because once parsed + // into DOM nodes, we don't have the information. But in the future we + // could allow comment handlers to specify custom delimiters, for + // example `` for Bits, where `comment-content` + // would be `/{bit-name}` or `__{translatable-string}` (TBD). + return ``; + } let attributeString = ''; for (const key in attributes) { if (!(0,external_wp_escapeHtml_namespaceObject.isValidAttributeName)(key)) { @@ -1105,6 +1131,7 @@ function getTextContent({ } ;// ./node_modules/@wordpress/rich-text/build-module/create.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -1226,6 +1253,13 @@ class RichTextData { html })); } + /** + * Create a RichTextData instance from an HTML element. + * + * @param {HTMLElement} htmlElement The HTML element to create the instance from. + * @param {{preserveWhiteSpace?: boolean}} options Options. + * @return {RichTextData} The RichTextData instance. + */ static fromHTMLElement(htmlElement, options = {}) { const { preserveWhiteSpace = false @@ -1247,6 +1281,12 @@ class RichTextData { } // We could expose `toHTMLElement` at some point as well, but we'd only use // it internally. + /** + * Convert the rich text value to an HTML string. + * + * @param {{preserveWhiteSpace?: boolean}} options Options. + * @return {string} The HTML string. + */ toHTMLString({ preserveWhiteSpace } = {}) { @@ -1517,7 +1557,7 @@ function removeReservedCharacters(string) { /** * Creates a Rich Text value from a DOM element and range. * - * @param {Object} $1 Named argements. + * @param {Object} $1 Named arguments. * @param {Element} [$1.element] Element to create value from. * @param {Range} [$1.range] Range to create value from. * @param {boolean} [$1.isEditableTree] @@ -1556,6 +1596,21 @@ function createFromElement({ accumulator.text += text; continue; } + if (node.nodeType === node.COMMENT_NODE || node.nodeType === node.ELEMENT_NODE && node.tagName === 'SPAN' && node.hasAttribute('data-rich-text-comment')) { + const value = { + formats: [,], + replacements: [{ + type: '#comment', + attributes: { + 'data-rich-text-comment': node.nodeType === node.COMMENT_NODE ? node.nodeValue : node.getAttribute('data-rich-text-comment') + } + }], + text: OBJECT_REPLACEMENT_CHARACTER + }; + accumulateSelection(accumulator, node, range, value); + mergePair(accumulator, value); + continue; + } if (node.nodeType !== node.ELEMENT_NODE) { continue; } @@ -1659,7 +1714,7 @@ function createFromElement({ /** * Gets the attributes of an element in object shape. * - * @param {Object} $1 Named argements. + * @param {Object} $1 Named arguments. * @param {Element} $1.element Element to get attributes from. * * @return {Object|void} Attribute object or `undefined` if the element has no @@ -1691,6 +1746,7 @@ function getAttributes({ } ;// ./node_modules/@wordpress/rich-text/build-module/concat.js +/* wp:polyfill */ /** * Internal dependencies */ @@ -1729,6 +1785,7 @@ function concat(...values) { } ;// ./node_modules/@wordpress/rich-text/build-module/get-active-format.js +/* wp:polyfill */ /** * Internal dependencies */ @@ -1828,6 +1885,7 @@ function isEmpty({ } ;// ./node_modules/@wordpress/rich-text/build-module/join.js +/* wp:polyfill */ /** * Internal dependencies */ @@ -1853,14 +1911,14 @@ function join(values, separator = '') { text: separator }); } - return normaliseFormats(values.reduce((accumlator, { + return normaliseFormats(values.reduce((accumulator, { formats, replacements, text }) => ({ - formats: accumlator.formats.concat(separator.formats, formats), - replacements: accumlator.replacements.concat(separator.replacements, replacements), - text: accumlator.text + separator.text + text + formats: accumulator.formats.concat(separator.formats, formats), + replacements: accumulator.replacements.concat(separator.replacements, replacements), + text: accumulator.text + separator.text + text }))); } @@ -1956,6 +2014,7 @@ function registerFormatType(name, settings) { } ;// ./node_modules/@wordpress/rich-text/build-module/remove-format.js +/* wp:polyfill */ /** * Internal dependencies */ @@ -2226,6 +2285,7 @@ function slice(value, startIndex = value.start, endIndex = value.end) { } ;// ./node_modules/@wordpress/rich-text/build-module/split.js +/* wp:polyfill */ /** * Internal dependencies */ @@ -2380,9 +2440,13 @@ function to_dom_append(element, child) { attributes } = child; if (type) { - child = element.ownerDocument.createElement(type); - for (const key in attributes) { - child.setAttribute(key, attributes[key]); + if (type === '#comment') { + child = element.ownerDocument.createComment(attributes['data-rich-text-comment']); + } else { + child = element.ownerDocument.createElement(type); + for (const key in attributes) { + child.setAttribute(key, attributes[key]); + } } } return element.appendChild(child); @@ -2786,7 +2850,7 @@ const external_wp_compose_namespaceObject = window["wp"]["compose"]; function getFormatElement(range, editableContentElement, tagName, className) { let element = range.startContainer; - // Even if the active format is defined, the actualy DOM range's start + // Even if the active format is defined, the actually DOM range's start // container may be outside of the format's DOM element: // `a‸b` (DOM) while visually it's `a‸b`. // So at a given selection index, start with the deepest format DOM element. @@ -3139,6 +3203,7 @@ function useBoundaryStyle({ ;// external ["wp","keycodes"] const external_wp_keycodes_namespaceObject = window["wp"]["keycodes"]; ;// ./node_modules/@wordpress/rich-text/build-module/component/event-listeners/format-boundaries.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -3285,6 +3350,7 @@ const EMPTY_ACTIVE_FORMATS = []; }); ;// ./node_modules/@wordpress/rich-text/build-module/update-formats.js +/* wp:polyfill */ /** * Internal dependencies */ @@ -3628,7 +3694,54 @@ function fixPlaceholderSelection(defaultView) { }; }); +;// ./node_modules/@wordpress/rich-text/build-module/component/event-listeners/prevent-focus-capture.js +/** + * Prevents focus from being captured by the element when clicking _outside_ + * around the element. This may happen when the parent element is flex. + * @see https://github.com/WordPress/gutenberg/pull/65857 + * @see https://github.com/WordPress/gutenberg/pull/66402 + */ +function preventFocusCapture() { + return element => { + const { + ownerDocument + } = element; + const { + defaultView + } = ownerDocument; + let value = null; + function onPointerDown(event) { + // Abort if the event is default prevented, we will not get a pointer up event. + if (event.defaultPrevented) { + return; + } + if (event.target === element) { + return; + } + if (!event.target.contains(element)) { + return; + } + value = element.getAttribute('contenteditable'); + element.setAttribute('contenteditable', 'false'); + defaultView.getSelection().removeAllRanges(); + } + function onPointerUp() { + if (value !== null) { + element.setAttribute('contenteditable', value); + value = null; + } + } + defaultView.addEventListener('pointerdown', onPointerDown); + defaultView.addEventListener('pointerup', onPointerUp); + return () => { + defaultView.removeEventListener('pointerdown', onPointerDown); + defaultView.removeEventListener('pointerup', onPointerUp); + }; + }; +} + ;// ./node_modules/@wordpress/rich-text/build-module/component/event-listeners/index.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -3644,10 +3757,13 @@ function fixPlaceholderSelection(defaultView) { -const allEventListeners = [copy_handler, select_object, format_boundaries, event_listeners_delete, input_and_selection, selection_change_compat]; + +const allEventListeners = [copy_handler, select_object, format_boundaries, event_listeners_delete, input_and_selection, selection_change_compat, preventFocusCapture]; function useEventListeners(props) { const propsRef = (0,external_wp_element_namespaceObject.useRef)(props); - propsRef.current = props; + (0,external_wp_element_namespaceObject.useInsertionEffect)(() => { + propsRef.current = props; + }); const refEffects = (0,external_wp_element_namespaceObject.useMemo)(() => allEventListeners.map(refEffect => refEffect(propsRef)), [propsRef]); return (0,external_wp_compose_namespaceObject.useRefEffect)(element => { const cleanups = refEffects.map(effect => effect(element)); @@ -3810,7 +3926,7 @@ function useRichText({ } const didMountRef = (0,external_wp_element_namespaceObject.useRef)(false); - // Value updates must happen synchonously to avoid overwriting newer values. + // Value updates must happen synchronously to avoid overwriting newer values. (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { if (didMountRef.current && value !== _valueRef.current) { applyFromProps(); @@ -3818,7 +3934,7 @@ function useRichText({ } }, [value]); - // Value updates must happen synchonously to avoid overwriting newer values. + // Value updates must happen synchronously to avoid overwriting newer values. (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { if (!hadSelectionUpdateRef.current) { return; diff --git a/wp-includes/js/dist/rich-text.min.js b/wp-includes/js/dist/rich-text.min.js index c64c48c5d8..644d6498c9 100644 --- a/wp-includes/js/dist/rich-text.min.js +++ b/wp-includes/js/dist/rich-text.min.js @@ -1,2 +1,2 @@ /*! This file is auto-generated */ -(()=>{"use strict";var e={n:t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{RichTextData:()=>j,__experimentalRichText:()=>Xe,__unstableCreateElement:()=>y,__unstableToDom:()=>be,__unstableUseRichText:()=>Be,applyFormat:()=>h,concat:()=>Y,create:()=>V,getActiveFormat:()=>G,getActiveFormats:()=>T,getActiveObject:()=>Z,getTextContent:()=>H,insert:()=>oe,insertObject:()=>ie,isCollapsed:()=>J,isEmpty:()=>Q,join:()=>ee,registerFormatType:()=>te,remove:()=>ae,removeFormat:()=>ne,replace:()=>se,slice:()=>ce,split:()=>le,store:()=>f,toHTMLString:()=>_,toggleFormat:()=>Le,unregisterFormatType:()=>Ce,useAnchor:()=>De,useAnchorRef:()=>Se});var n={};e.r(n),e.d(n,{getFormatType:()=>i,getFormatTypeForBareElement:()=>c,getFormatTypeForClassName:()=>l,getFormatTypes:()=>s});var r={};e.r(r),e.d(r,{addFormatTypes:()=>u,removeFormatTypes:()=>d});const o=window.wp.data;const a=(0,o.combineReducers)({formatTypes:function(e={},t){switch(t.type){case"ADD_FORMAT_TYPES":return{...e,...t.formatTypes.reduce(((e,t)=>({...e,[t.name]:t})),{})};case"REMOVE_FORMAT_TYPES":return Object.fromEntries(Object.entries(e).filter((([e])=>!t.names.includes(e))))}return e}}),s=(0,o.createSelector)((e=>Object.values(e.formatTypes)),(e=>[e.formatTypes]));function i(e,t){return e.formatTypes[t]}function c(e,t){const n=s(e);return n.find((({className:e,tagName:n})=>null===e&&t===n))||n.find((({className:e,tagName:t})=>null===e&&"*"===t))}function l(e,t){return s(e).find((({className:e})=>null!==e&&` ${t} `.indexOf(` ${e} `)>=0))}function u(e){return{type:"ADD_FORMAT_TYPES",formatTypes:Array.isArray(e)?e:[e]}}function d(e){return{type:"REMOVE_FORMAT_TYPES",names:Array.isArray(e)?e:[e]}}const f=(0,o.createReduxStore)("core/rich-text",{reducer:a,selectors:n,actions:r});function m(e,t){if(e===t)return!0;if(!e||!t)return!1;if(e.type!==t.type)return!1;const n=e.attributes,r=t.attributes;if(n===r)return!0;if(!n||!r)return!1;const o=Object.keys(n),a=Object.keys(r);if(o.length!==a.length)return!1;const s=o.length;for(let e=0;e{const r=t[n-1];if(r){const o=e.slice();o.forEach(((e,t)=>{const n=r[t];m(e,n)&&(o[t]=n)})),t[n]=o}})),{...e,formats:t}}function g(e,t,n){return(e=e.slice())[t]=n,e}function h(e,t,n=e.start,r=e.end){const{formats:o,activeFormats:a}=e,s=o.slice();if(n===r){const e=s[n]?.find((({type:e})=>e===t.type));if(e){const o=s[n].indexOf(e);for(;s[n]&&s[n][o]===e;)s[n]=g(s[n],o,t),n--;for(r++;s[r]&&s[r][o]===e;)s[r]=g(s[r],o,t),r++}}else{let e=1/0;for(let o=n;oe!==t.type));const n=s[o].length;ne!==t.type))||[],t]})}function y({implementation:e},t){return y.body||(y.body=e.createHTMLDocument("").body),y.body.innerHTML=t,y.body}(0,o.register)(f);const v="",E="\ufeff",b=window.wp.escapeHtml;function T(e,t=[]){const{formats:n,start:r,end:o,activeFormats:a}=e;if(void 0===r)return t;if(r===o){if(a)return a;const e=n[r-1]||t,o=n[r]||t;return e.lengthm(t,e)))||i.splice(n,1)}if(0===i.length)return t}return i||t}function x(e){return(0,o.select)(f).getFormatType(e)}function w(e,t){if(t)return e;const n={};for(const t in e){let r=t;t.startsWith("data-disable-rich-text-")&&(r=t.slice(23)),n[r]=e[t]}return n}function N({type:e,tagName:t,attributes:n,unregisteredAttributes:r,object:o,boundaryClass:a,isEditableTree:s}){const i=x(e);let c={};if(a&&s&&(c["data-rich-text-format-boundary"]="true"),!i)return n&&(c={...n,...c}),{type:e,attributes:w(c,s),object:o};c={...r,...c};for(const e in n){const t=!!i.attributes&&i.attributes[e];t?c[t]=n[e]:c[e]=n[e]}return i.className&&(c.class?c.class=`${i.className} ${c.class}`:c.class=i.className),s&&!1===i.contentEditable&&(c.contenteditable="false"),{type:t||i.tagName,object:i.object,attributes:w(c,s)}}function L(e,t,n){do{if(e[n]!==t[n])return!1}while(n--);return!0}function C({value:e,preserveWhiteSpace:t,createEmpty:n,append:r,getLastChild:o,getParent:a,isText:s,getText:i,remove:c,appendText:l,onStartIndex:u,onEndIndex:d,isEditableTree:f,placeholder:m}){const{formats:p,replacements:g,text:h,start:y,end:b}=e,w=p.length+1,C=n(),_=T(e),F=_[_.length-1];let O,S;r(C,"");for(let e=0;e{if(_&&O&&L(w,O,t))return void(_=o(_));const{type:n,tagName:l,attributes:u,unregisteredAttributes:d}=e,m=f&&e===F,p=a(_),g=r(p,N({type:n,tagName:l,attributes:u,unregisteredAttributes:d,boundaryClass:m,isEditableTree:f}));s(_)&&0===i(_).length&&c(_),_=r(g,"")})),0===e&&(u&&0===y&&u(C,_),d&&0===b&&d(C,_)),n===v){const t=g[e];if(!t)continue;const{type:n,attributes:o,innerHTML:s}=t,i=x(n);f||"script"!==n?!1===i?.contentEditable?(_=r(a(_),N({...t,isEditableTree:f,boundaryClass:y===e&&b===e+1})),s&&r(_,{html:s})):_=r(a(_),N({...t,object:!0,isEditableTree:f})):(_=r(a(_),N({type:"script",isEditableTree:f})),r(_,{html:decodeURIComponent(o["data-rich-text-script"])})),_=r(a(_),"")}else t||"\n"!==n?s(_)?l(_,n):_=r(a(_),n):(_=r(a(_),{type:"br",attributes:f?{"data-rich-text-line-break":"true"}:void 0,object:!0}),_=r(a(_),""));u&&y===e+1&&u(C,_),d&&b===e+1&&d(C,_),T&&e===h.length&&(r(a(_),E),m&&0===h.length&&r(a(_),{type:"span",attributes:{"data-rich-text-placeholder":m,style:"pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;"}})),O=w,S=n}return C}function _({value:e,preserveWhiteSpace:t}){return $(C({value:e,preserveWhiteSpace:t,createEmpty:F,append:S,getLastChild:O,getParent:R,isText:D,getText:M,remove:k,appendText:A}).children)}function F(){return{}}function O({children:e}){return e&&e[e.length-1]}function S(e,t){return"string"==typeof t&&(t={text:t}),t.parent=e,e.children=e.children||[],e.children.push(t),t}function A(e,t){e.text+=t}function R({parent:e}){return e}function D({text:e}){return"string"==typeof e}function M({text:e}){return e}function k(e){const t=e.parent.children.indexOf(e);return-1!==t&&e.parent.children.splice(t,1),e}function $(e=[]){return e.map((e=>void 0!==e.html?e.html:void 0===e.text?function({type:e,attributes:t,object:n,children:r}){let o="";for(const e in t)(0,b.isValidAttributeName)(e)&&(o+=` ${e}="${(0,b.escapeAttribute)(t[e])}"`);return n?`<${e}${o}>`:`<${e}${o}>${$(r)}`}(e):(0,b.escapeEditableHTML)(e.text))).join("")}function H({text:e}){return e.replace(v,"")}function P({tagName:e,attributes:t}){let n;if(t&&t.class&&(n=(0,o.select)(f).getFormatTypeForClassName(t.class),n&&(t.class=` ${t.class} `.replace(` ${n.className} `," ").trim(),t.class||delete t.class)),n||(n=(0,o.select)(f).getFormatTypeForBareElement(e)),!n)return t?{type:e,attributes:t}:{type:e};if(n.__experimentalCreatePrepareEditableTree&&!n.__experimentalCreateOnChangeEditableValue)return null;if(!t)return{formatType:n,type:n.name,tagName:e};const r={},a={},s={...t};for(const e in n.attributes){const t=n.attributes[e];r[e]=s[t],delete s[t],void 0===r[e]&&delete r[e]}for(const e in s)a[e]=t[e];return!1===n.contentEditable&&delete a.contenteditable,{formatType:n,type:n.name,tagName:e,attributes:r,unregisteredAttributes:a}}class j{#e;static empty(){return new j}static fromPlainText(e){return new j(V({text:e}))}static fromHTMLString(e){return new j(V({html:e}))}static fromHTMLElement(e,t={}){const{preserveWhiteSpace:n=!1}=t,r=n?e:z(e),o=new j(V({element:r}));return Object.defineProperty(o,"originalHTML",{value:e.innerHTML}),o}constructor(e={formats:[],replacements:[],text:""}){this.#e=e}toPlainText(){return H(this.#e)}toHTMLString({preserveWhiteSpace:e}={}){return this.originalHTML||_({value:this.#e,preserveWhiteSpace:e})}valueOf(){return this.toHTMLString()}toString(){return this.toHTMLString()}toJSON(){return this.toHTMLString()}get length(){return this.text.length}get formats(){return this.#e.formats}get replacements(){return this.#e.replacements}get text(){return this.#e.text}}for(const e of Object.getOwnPropertyNames(String.prototype))j.prototype.hasOwnProperty(e)||Object.defineProperty(j.prototype,e,{value(...t){return this.toHTMLString()[e](...t)}});function V({element:e,text:t,html:n,range:r,__unstableIsEditableTree:o}={}){return n instanceof j?{text:n.text,formats:n.formats,replacements:n.replacements}:"string"==typeof t&&t.length>0?{formats:Array(t.length),replacements:Array(t.length),text:t}:("string"==typeof n&&n.length>0&&(e=y(document,n)),"object"!=typeof e?{formats:[],replacements:[],text:""}:K({element:e,range:r,isEditableTree:o}))}function I(e,t,n,r){if(!n)return;const{parentNode:o}=t,{startContainer:a,startOffset:s,endContainer:i,endOffset:c}=n,l=e.text.length;void 0!==r.start?e.start=l+r.start:t===a&&t.nodeType===t.TEXT_NODE?e.start=l+s:o===a&&t===a.childNodes[s]?e.start=l:o===a&&t===a.childNodes[s-1]?e.start=l+r.text.length:t===a&&(e.start=l),void 0!==r.end?e.end=l+r.end:t===i&&t.nodeType===t.TEXT_NODE?e.end=l+c:o===i&&t===i.childNodes[c-1]?e.end=l+r.text.length:o===i&&t===i.childNodes[c]?e.end=l:t===i&&(e.end=l+c)}function W(e,t,n){if(!t)return;const{startContainer:r,endContainer:o}=t;let{startOffset:a,endOffset:s}=t;return e===r&&(a=n(e.nodeValue.slice(0,a)).length),e===o&&(s=n(e.nodeValue.slice(0,s)).length),{startContainer:r,startOffset:a,endContainer:o,endOffset:s}}function z(e,t=!0){const n=e.cloneNode(!0);return n.normalize(),Array.from(n.childNodes).forEach(((e,n,r)=>{if(e.nodeType===e.TEXT_NODE){let o=e.nodeValue;/[\n\t\r\f]/.test(o)&&(o=o.replace(/[\n\t\r\f]+/g," ")),-1!==o.indexOf(" ")&&(o=o.replace(/ {2,}/g," ")),0===n&&o.startsWith(" ")?o=o.slice(1):t&&n===r.length-1&&o.endsWith(" ")&&(o=o.slice(0,-1)),e.nodeValue=o}else e.nodeType===e.ELEMENT_NODE&&z(e,!1)})),n}const B="\r";function X(e){return e.replace(new RegExp(`[${E}${v}${B}]`,"gu"),"")}function K({element:e,range:t,isEditableTree:n}){const r={formats:[],replacements:[],text:""};if(!e)return r;if(!e.hasChildNodes())return I(r,e,t,{formats:[],replacements:[],text:""}),r;const o=e.childNodes.length;for(let a=0;ae===t))}function Z({start:e,end:t,replacements:n,text:r}){if(e+1===t&&r[e]===v)return n[e]}function J({start:e,end:t}){if(void 0!==e&&void 0!==t)return e===t}function Q({text:e}){return 0===e.length}function ee(e,t=""){return"string"==typeof t&&(t=V({text:t})),p(e.reduce(((e,{formats:n,replacements:r,text:o})=>({formats:e.formats.concat(t.formats,n),replacements:e.replacements.concat(t.replacements,r),text:e.text+t.text+o}))))}function te(e,t){if("string"==typeof(t={name:e,...t}).name)if(/^[a-z][a-z0-9-]*\/[a-z][a-z0-9-]*$/.test(t.name))if((0,o.select)(f).getFormatType(t.name))window.console.error('Format "'+t.name+'" is already registered.');else if("string"==typeof t.tagName&&""!==t.tagName)if("string"==typeof t.className&&""!==t.className||null===t.className)if(/^[_a-zA-Z]+[a-zA-Z0-9_-]*$/.test(t.className)){if(null===t.className){const e=(0,o.select)(f).getFormatTypeForBareElement(t.tagName);if(e&&"core/unknown"!==e.name)return void window.console.error(`Format "${e.name}" is already registered to handle bare tag name "${t.tagName}".`)}else{const e=(0,o.select)(f).getFormatTypeForClassName(t.className);if(e)return void window.console.error(`Format "${e.name}" is already registered to handle class name "${t.className}".`)}if("title"in t&&""!==t.title)if("keywords"in t&&t.keywords.length>3)window.console.error('The format "'+t.name+'" can have a maximum of 3 keywords.');else{if("string"==typeof t.title)return(0,o.dispatch)(f).addFormatTypes(t),t;window.console.error("Format titles must be strings.")}else window.console.error('The format "'+t.name+'" must have a title.')}else window.console.error("A class name must begin with a letter, followed by any number of hyphens, underscores, letters, or numbers.");else window.console.error("Format class names must be a string, or null to handle bare elements.");else window.console.error("Format tag names must be a string.");else window.console.error("Format names must contain a namespace prefix, include only lowercase alphanumeric characters or dashes, and start with a letter. Example: my-plugin/my-custom-format");else window.console.error("Format names must be strings.")}function ne(e,t,n=e.start,r=e.end){const{formats:o,activeFormats:a}=e,s=o.slice();if(n===r){const e=s[n]?.find((({type:e})=>e===t));if(e){for(;s[n]?.find((t=>t===e));)re(s,n,t),n--;for(r++;s[r]?.find((t=>t===e));)re(s,r,t),r++}}else for(let e=n;ee!==t))||[]})}function re(e,t,n){const r=e[t].filter((({type:e})=>e!==n));r.length?e[t]=r:delete e[t]}function oe(e,t,n=e.start,r=e.end){const{formats:o,replacements:a,text:s}=e;"string"==typeof t&&(t=V({text:t}));const i=n+t.text.length;return p({formats:o.slice(0,n).concat(t.formats,o.slice(r)),replacements:a.slice(0,n).concat(t.replacements,a.slice(r)),text:s.slice(0,n)+t.text+s.slice(r),start:i,end:i})}function ae(e,t,n){return oe(e,V(),t,n)}function se({formats:e,replacements:t,text:n,start:r,end:o},a,s){return n=n.replace(a,((n,...a)=>{const i=a[a.length-2];let c,l,u=s;return"function"==typeof u&&(u=s(n,...a)),"object"==typeof u?(c=u.formats,l=u.replacements,u=u.text):(c=Array(u.length),l=Array(u.length),e[i]&&(c=c.fill(e[i]))),e=e.slice(0,i).concat(c,e.slice(i+n.length)),t=t.slice(0,i).concat(l,t.slice(i+n.length)),r&&(r=o=i+u.length),u})),p({formats:e,replacements:t,text:n,start:r,end:o})}function ie(e,t,n,r){return oe(e,{formats:[,],replacements:[t],text:v},n,r)}function ce(e,t=e.start,n=e.end){const{formats:r,replacements:o,text:a}=e;return void 0===t||void 0===n?{...e}:{formats:r.slice(t,n),replacements:o.slice(t,n),text:a.slice(t,n)}}function le({formats:e,replacements:t,text:n,start:r,end:o},a){if("string"!=typeof a)return function({formats:e,replacements:t,text:n,start:r,end:o},a=r,s=o){if(void 0===r||void 0===o)return;const i={formats:e.slice(0,a),replacements:t.slice(0,a),text:n.slice(0,a)},c={formats:e.slice(s),replacements:t.slice(s),text:n.slice(s),start:0,end:0};return[i,c]}(...arguments);let s=0;return n.split(a).map((n=>{const i=s,c={formats:e.slice(i,i+n.length),replacements:t.slice(i,i+n.length),text:n};return s+=a.length+n.length,void 0!==r&&void 0!==o&&(r>=i&&ri&&(c.start=0),o>=i&&os&&(c.end=n.length)),c}))}function ue(e,t){return e===t||e&&t&&e.startContainer===t.startContainer&&e.startOffset===t.startOffset&&e.endContainer===t.endContainer&&e.endOffset===t.endOffset}function de(e,t,n){const r=e.parentNode;let o=0;for(;e=e.previousSibling;)o++;return n=[o,...n],r!==t&&(n=de(r,t,n)),n}function fe(e,t){for(t=[...t];e&&t.length>1;)e=e.childNodes[t.shift()];return{node:e,offset:t[0]}}function me(e,t){if(void 0!==t.html)return e.innerHTML+=t.html;"string"==typeof t&&(t=e.ownerDocument.createTextNode(t));const{type:n,attributes:r}=t;if(n){t=e.ownerDocument.createElement(n);for(const e in r)t.setAttribute(e,r[e])}return e.appendChild(t)}function pe(e,t){e.appendData(t)}function ge({lastChild:e}){return e}function he({parentNode:e}){return e}function ye(e){return e.nodeType===e.TEXT_NODE}function ve({nodeValue:e}){return e}function Ee(e){return e.parentNode.removeChild(e)}function be({value:e,prepareEditableTree:t,isEditableTree:n=!0,placeholder:r,doc:o=document}){let a=[],s=[];t&&(e={...e,formats:t(e)});return{body:C({value:e,createEmpty:()=>y(o,""),append:me,getLastChild:ge,getParent:he,isText:ye,getText:ve,remove:Ee,appendText:pe,onStartIndex(e,t){a=de(t,e,[t.nodeValue.length])},onEndIndex(e,t){s=de(t,e,[t.nodeValue.length])},isEditableTree:n,placeholder:r}),selection:{startPath:a,endPath:s}}}function Te({value:e,current:t,prepareEditableTree:n,__unstableDomOnly:r,placeholder:o}){const{body:a,selection:s}=be({value:e,prepareEditableTree:n,placeholder:o,doc:t.ownerDocument});xe(a,t),void 0===e.start||r||function({startPath:e,endPath:t},n){const{node:r,offset:o}=fe(n,e),{node:a,offset:s}=fe(n,t),{ownerDocument:i}=n,{defaultView:c}=i,l=c.getSelection(),u=i.createRange();u.setStart(r,o),u.setEnd(a,s);const{activeElement:d}=i;if(l.rangeCount>0){if(ue(u,l.getRangeAt(0)))return;l.removeAllRanges()}l.addRange(u),d!==i.activeElement&&d instanceof c.HTMLElement&&d.focus()}(s,t)}function xe(e,t){let n,r=0;for(;n=e.firstChild;){const o=t.childNodes[r];if(o)if(o.isEqualNode(n))e.removeChild(n);else if(o.nodeName!==n.nodeName||o.nodeType===o.TEXT_NODE&&o.data!==n.data)t.replaceChild(n,o);else{const t=o.attributes,r=n.attributes;if(t){let e=t.length;for(;e--;){const{name:r}=t[e];n.getAttribute(r)||o.removeAttribute(r)}}if(r)for(let e=0;e{if(!e.current)return;const{ownerDocument:{defaultView:t}}=e.current,n=t.getSelection();if(!n.rangeCount)return;const a=n.getRangeAt(0);if(!s)return a;let i=a.startContainer;for(i=i.nextElementSibling||i;i.nodeType!==i.ELEMENT_NODE;)i=i.parentNode;return i.closest(r+(o?"."+o:""))}),[s,t.start,t.end,r,o])}const Ae=window.wp.compose;function Re(e,t,n){if(!e)return;const{ownerDocument:r}=e,{defaultView:o}=r,a=o.getSelection();if(!a)return;if(!a.rangeCount)return;const s=a.getRangeAt(0);if(!s||!s.startContainer)return;const i=function(e,t,n,r){let o=e.startContainer;if(o.nodeType===o.TEXT_NODE&&e.startOffset===o.length&&o.nextSibling)for(o=o.nextSibling;o.firstChild;)o=o.firstChild;if(o.nodeType!==o.ELEMENT_NODE&&(o=o.parentElement),!o)return;if(o===t)return;if(!t.contains(o))return;const a=n+(r?"."+r:"");for(;o!==t;){if(o.matches(a))return o;o=o.parentElement}}(s,e,t,n);return i||function(e,t){return{contextElement:t,getBoundingClientRect:()=>t.contains(e.startContainer)?e.getBoundingClientRect():t.getBoundingClientRect()}}(s,e)}function De({editableContentElement:e,settings:t={}}){const{tagName:n,className:r,isActive:o}=t,[a,s]=(0,_e.useState)((()=>Re(e,n,r))),i=(0,Ae.usePrevious)(o);return(0,_e.useLayoutEffect)((()=>{if(!e)return;function t(){s(Re(e,n,r))}function a(){l.addEventListener("selectionchange",t)}function c(){l.removeEventListener("selectionchange",t)}const{ownerDocument:l}=e;return(e===l.activeElement||!i&&o||i&&!o)&&(s(Re(e,n,r)),a()),e.addEventListener("focusin",a),e.addEventListener("focusout",c),()=>{c(),e.removeEventListener("focusin",a),e.removeEventListener("focusout",c)}}),[e,n,r,o,i]),a}const Me="pre-wrap",ke="1px";function $e({record:e}){const t=(0,_e.useRef)(),{activeFormats:n=[],replacements:r,start:o}=e.current,a=r[o];return(0,_e.useEffect)((()=>{if(!(n&&n.length||a))return;const e="*[data-rich-text-format-boundary]",r=t.current.querySelector(e);if(!r)return;const{ownerDocument:o}=r,{defaultView:s}=o,i=`${`.rich-text:focus ${e}`} {${`background-color: ${s.getComputedStyle(r).color.replace(")",", 0.2)").replace("rgb","rgba")}`}}`,c="rich-text-boundary-style";let l=o.getElementById(c);l||(l=o.createElement("style"),l.id=c,o.head.appendChild(l)),l.innerHTML!==i&&(l.innerHTML=i)}),[n,a]),t}const He=window.wp.keycodes,Pe=[];const je=new Set(["insertParagraph","insertOrderedList","insertUnorderedList","insertHorizontalRule","insertLink"]),Ve=[],Ie="data-rich-text-placeholder";const We=[e=>t=>{function n(n){const{record:r}=e.current,{ownerDocument:o}=t;if(J(r.current)||!t.contains(o.activeElement))return;const a=ce(r.current),s=H(a),i=_({value:a});n.clipboardData.setData("text/plain",s),n.clipboardData.setData("text/html",i),n.clipboardData.setData("rich-text","true"),n.preventDefault(),"cut"===n.type&&o.execCommand("delete")}const{defaultView:r}=t.ownerDocument;return r.addEventListener("copy",n),r.addEventListener("cut",n),()=>{r.removeEventListener("copy",n),r.removeEventListener("cut",n)}},()=>e=>{function t(t){const{target:n}=t;if(n===e||n.textContent&&n.isContentEditable)return;const{ownerDocument:r}=n,{defaultView:o}=r,a=o.getSelection();if(a.containsNode(n))return;const s=r.createRange(),i=n.isContentEditable?n:n.closest("[contenteditable]");s.selectNode(i),a.removeAllRanges(),a.addRange(s),t.preventDefault()}function n(n){n.relatedTarget&&!e.contains(n.relatedTarget)&&"A"===n.relatedTarget.tagName&&t(n)}return e.addEventListener("click",t),e.addEventListener("focusin",n),()=>{e.removeEventListener("click",t),e.removeEventListener("focusin",n)}},e=>t=>{function n(n){const{keyCode:r,shiftKey:o,altKey:a,metaKey:s,ctrlKey:i}=n;if(o||a||s||i||r!==He.LEFT&&r!==He.RIGHT)return;const{record:c,applyRecord:l,forceRender:u}=e.current,{text:d,formats:f,start:m,end:p,activeFormats:g=[]}=c.current,h=J(c.current),{ownerDocument:y}=t,{defaultView:v}=y,{direction:E}=v.getComputedStyle(t),b="rtl"===E?He.RIGHT:He.LEFT,T=n.keyCode===b;if(h&&0===g.length){if(0===m&&T)return;if(p===d.length&&!T)return}if(!h)return;const x=f[m-1]||Pe,w=f[m]||Pe,N=T?x:w,L=g.every(((e,t)=>e===N[t]));let C=g.length;if(L?C{t.removeEventListener("keydown",n)}},e=>t=>{function n(t){const{keyCode:n}=t,{createRecord:r,handleChange:o}=e.current;if(t.defaultPrevented)return;if(n!==He.DELETE&&n!==He.BACKSPACE)return;const a=r(),{start:s,end:i,text:c}=a;0===s&&0!==i&&i===c.length&&(o(ae(a)),t.preventDefault())}return t.addEventListener("keydown",n),()=>{t.removeEventListener("keydown",n)}},e=>t=>{const{ownerDocument:n}=t,{defaultView:r}=n;let o=!1;function a(t){if(o)return;let n;t&&(n=t.inputType);const{record:r,applyRecord:a,createRecord:s,handleChange:i}=e.current;if(n&&(0===n.indexOf("format")||je.has(n)))return void a(r.current);const c=s(),{start:l,activeFormats:u=[]}=r.current,d=function({value:e,start:t,end:n,formats:r}){const o=Math.min(t,n),a=Math.max(t,n),s=e.formats[o-1]||[],i=e.formats[a]||[];for(e.activeFormats=r.map(((e,t)=>{if(s[t]){if(m(e,s[t]))return s[t]}else if(i[t]&&m(e,i[t]))return i[t];return e}));--n>=t;)e.activeFormats.length>0?e.formats[n]=e.activeFormats:delete e.formats[n];return e}({value:c,start:l,end:c.start,formats:u});i(d)}function s(){const{record:i,applyRecord:c,createRecord:l,onSelectionChange:u}=e.current;if("true"!==t.contentEditable)return;if(n.activeElement!==t)return void n.removeEventListener("selectionchange",s);if(o)return;const{start:d,end:f,text:m}=l(),p=i.current;if(m!==p.text)return void a();if(d===p.start&&f===p.end)return void(0===p.text.length&&0===d&&function(e){const t=e.getSelection(),{anchorNode:n,anchorOffset:r}=t;if(n.nodeType!==n.ELEMENT_NODE)return;const o=n.childNodes[r];o&&o.nodeType===o.ELEMENT_NODE&&o.hasAttribute(Ie)&&t.collapseToStart()}(r));const g={...p,start:d,end:f,activeFormats:p._newActiveFormats,_newActiveFormats:void 0},h=T(g,Ve);g.activeFormats=h,i.current=g,c(g,{domOnly:!0}),u(d,f)}function i(){o=!0,n.removeEventListener("selectionchange",s),t.querySelector(`[${Ie}]`)?.remove()}function c(){o=!1,a({inputType:"insertText"}),n.addEventListener("selectionchange",s)}function l(){const{record:r,isSelected:o,onSelectionChange:a,applyRecord:i}=e.current;if(!t.parentElement.closest('[contenteditable="true"]')){if(o)i(r.current,{domOnly:!0});else{const e=void 0;r.current={...r.current,start:e,end:e,activeFormats:Ve}}a(r.current.start,r.current.end),window.queueMicrotask(s),n.addEventListener("selectionchange",s)}}return t.addEventListener("input",a),t.addEventListener("compositionstart",i),t.addEventListener("compositionend",c),t.addEventListener("focus",l),()=>{t.removeEventListener("input",a),t.removeEventListener("compositionstart",i),t.removeEventListener("compositionend",c),t.removeEventListener("focus",l)}},()=>e=>{const{ownerDocument:t}=e,{defaultView:n}=t,r=n?.getSelection();let o;function a(){return r.rangeCount?r.getRangeAt(0):null}function s(e){const n="keydown"===e.type?"keyup":"pointerup";function r(){t.removeEventListener(n,s),t.removeEventListener("selectionchange",r),t.removeEventListener("input",r)}function s(){r(),ue(o,a())||t.dispatchEvent(new Event("selectionchange"))}t.addEventListener(n,s),t.addEventListener("selectionchange",r),t.addEventListener("input",r),o=a()}return e.addEventListener("pointerdown",s),e.addEventListener("keydown",s),()=>{e.removeEventListener("pointerdown",s),e.removeEventListener("keydown",s)}}];function ze(e){const t=(0,_e.useRef)(e);t.current=e;const n=(0,_e.useMemo)((()=>We.map((e=>e(t)))),[t]);return(0,Ae.useRefEffect)((e=>{const t=n.map((t=>t(e)));return()=>{t.forEach((e=>e()))}}),[n])}function Be({value:e="",selectionStart:t,selectionEnd:n,placeholder:r,onSelectionChange:a,preserveWhiteSpace:s,onChange:i,__unstableDisableFormats:c,__unstableIsSelected:l,__unstableDependencies:u=[],__unstableAfterParse:d,__unstableBeforeSerialize:f,__unstableAddInvisibleFormats:m}){const p=(0,o.useRegistry)(),[,g]=(0,_e.useReducer)((()=>({}))),h=(0,_e.useRef)();function y(e,{domOnly:t}={}){Te({value:e,current:h.current,prepareEditableTree:m,__unstableDomOnly:t,placeholder:r})}const v=(0,_e.useRef)(e),E=(0,_e.useRef)();function b(){v.current=e,E.current=e,e instanceof j||(E.current=e?j.fromHTMLString(e,{preserveWhiteSpace:s}):j.empty()),E.current={text:E.current.text,formats:E.current.formats,replacements:E.current.replacements},c&&(E.current.formats=Array(e.length),E.current.replacements=Array(e.length)),d&&(E.current.formats=d(E.current)),E.current.start=t,E.current.end=n}const T=(0,_e.useRef)(!1);function x(t){if(E.current=t,y(t),c)v.current=t.text;else{const n=f?f(t):t.formats;t={...t,formats:n},v.current="string"==typeof e?_({value:t,preserveWhiteSpace:s}):new j(t)}const{start:n,end:r,formats:o,text:l}=E.current;p.batch((()=>{a(n,r),i(v.current,{__unstableFormats:o,__unstableText:l})})),g()}function w(){b(),y(E.current)}E.current?t===E.current.start&&n===E.current.end||(T.current=l,E.current={...E.current,start:t,end:n,activeFormats:void 0}):(T.current=l,b());const N=(0,_e.useRef)(!1);(0,_e.useLayoutEffect)((()=>{N.current&&e!==v.current&&(w(),g())}),[e]),(0,_e.useLayoutEffect)((()=>{T.current&&(h.current.ownerDocument.activeElement!==h.current&&h.current.focus(),y(E.current),T.current=!1)}),[T.current]);const L=(0,Ae.useMergeRefs)([h,(0,_e.useCallback)((e=>{e&&(e.style.whiteSpace=Me,e.style.minWidth=ke)}),[]),$e({record:E}),ze({record:E,handleChange:x,applyRecord:y,createRecord:function(){const{ownerDocument:{defaultView:e}}=h.current,t=e.getSelection(),n=t.rangeCount>0?t.getRangeAt(0):null;return V({element:h.current,range:n,__unstableIsEditableTree:!0})},isSelected:l,onSelectionChange:a,forceRender:g}),(0,Ae.useRefEffect)((()=>{w(),N.current=!0}),[r,...u])]);return{value:E.current,getValue:()=>E.current,onChange:x,ref:L}}function Xe(){}(window.wp=window.wp||{}).richText=t})(); \ No newline at end of file +(()=>{"use strict";var e={n:t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{RichTextData:()=>j,__experimentalRichText:()=>Xe,__unstableCreateElement:()=>y,__unstableToDom:()=>be,__unstableUseRichText:()=>Be,applyFormat:()=>h,concat:()=>Y,create:()=>V,getActiveFormat:()=>G,getActiveFormats:()=>T,getActiveObject:()=>Z,getTextContent:()=>P,insert:()=>oe,insertObject:()=>ie,isCollapsed:()=>J,isEmpty:()=>Q,join:()=>ee,registerFormatType:()=>te,remove:()=>ae,removeFormat:()=>ne,replace:()=>se,slice:()=>ce,split:()=>le,store:()=>f,toHTMLString:()=>_,toggleFormat:()=>Le,unregisterFormatType:()=>Ce,useAnchor:()=>Re,useAnchorRef:()=>Oe});var n={};e.r(n),e.d(n,{getFormatType:()=>i,getFormatTypeForBareElement:()=>c,getFormatTypeForClassName:()=>l,getFormatTypes:()=>s});var r={};e.r(r),e.d(r,{addFormatTypes:()=>u,removeFormatTypes:()=>d});const o=window.wp.data;const a=(0,o.combineReducers)({formatTypes:function(e={},t){switch(t.type){case"ADD_FORMAT_TYPES":return{...e,...t.formatTypes.reduce(((e,t)=>({...e,[t.name]:t})),{})};case"REMOVE_FORMAT_TYPES":return Object.fromEntries(Object.entries(e).filter((([e])=>!t.names.includes(e))))}return e}}),s=(0,o.createSelector)((e=>Object.values(e.formatTypes)),(e=>[e.formatTypes]));function i(e,t){return e.formatTypes[t]}function c(e,t){const n=s(e);return n.find((({className:e,tagName:n})=>null===e&&t===n))||n.find((({className:e,tagName:t})=>null===e&&"*"===t))}function l(e,t){return s(e).find((({className:e})=>null!==e&&` ${t} `.indexOf(` ${e} `)>=0))}function u(e){return{type:"ADD_FORMAT_TYPES",formatTypes:Array.isArray(e)?e:[e]}}function d(e){return{type:"REMOVE_FORMAT_TYPES",names:Array.isArray(e)?e:[e]}}const f=(0,o.createReduxStore)("core/rich-text",{reducer:a,selectors:n,actions:r});function m(e,t){if(e===t)return!0;if(!e||!t)return!1;if(e.type!==t.type)return!1;const n=e.attributes,r=t.attributes;if(n===r)return!0;if(!n||!r)return!1;const o=Object.keys(n),a=Object.keys(r);if(o.length!==a.length)return!1;const s=o.length;for(let e=0;e{const r=t[n-1];if(r){const o=e.slice();o.forEach(((e,t)=>{const n=r[t];m(e,n)&&(o[t]=n)})),t[n]=o}})),{...e,formats:t}}function g(e,t,n){return(e=e.slice())[t]=n,e}function h(e,t,n=e.start,r=e.end){const{formats:o,activeFormats:a}=e,s=o.slice();if(n===r){const e=s[n]?.find((({type:e})=>e===t.type));if(e){const o=s[n].indexOf(e);for(;s[n]&&s[n][o]===e;)s[n]=g(s[n],o,t),n--;for(r++;s[r]&&s[r][o]===e;)s[r]=g(s[r],o,t),r++}}else{let e=1/0;for(let o=n;oe!==t.type));const n=s[o].length;ne!==t.type))||[],t]})}function y({implementation:e},t){return y.body||(y.body=e.createHTMLDocument("").body),y.body.innerHTML=t,y.body}(0,o.register)(f);const v="",E="\ufeff",b=window.wp.escapeHtml;function T(e,t=[]){const{formats:n,start:r,end:o,activeFormats:a}=e;if(void 0===r)return t;if(r===o){if(a)return a;const e=n[r-1]||t,o=n[r]||t;return e.lengthm(t,e)))||i.splice(n,1)}if(0===i.length)return t}return i||t}function x(e){return(0,o.select)(f).getFormatType(e)}function w(e,t){if(t)return e;const n={};for(const t in e){let r=t;t.startsWith("data-disable-rich-text-")&&(r=t.slice(23)),n[r]=e[t]}return n}function N({type:e,tagName:t,attributes:n,unregisteredAttributes:r,object:o,boundaryClass:a,isEditableTree:s}){const i=x(e);let c={};if(a&&s&&(c["data-rich-text-format-boundary"]="true"),!i)return n&&(c={...n,...c}),{type:e,attributes:w(c,s),object:o};c={...r,...c};for(const e in n){const t=!!i.attributes&&i.attributes[e];t?c[t]=n[e]:c[e]=n[e]}return i.className&&(c.class?c.class=`${i.className} ${c.class}`:c.class=i.className),s&&!1===i.contentEditable&&(c.contenteditable="false"),{type:t||i.tagName,object:i.object,attributes:w(c,s)}}function L(e,t,n){do{if(e[n]!==t[n])return!1}while(n--);return!0}function C({value:e,preserveWhiteSpace:t,createEmpty:n,append:r,getLastChild:o,getParent:a,isText:s,getText:i,remove:c,appendText:l,onStartIndex:u,onEndIndex:d,isEditableTree:f,placeholder:m}){const{formats:p,replacements:g,text:h,start:y,end:b}=e,w=p.length+1,C=n(),_=T(e),A=_[_.length-1];let F,O;r(C,"");for(let e=0;e{if(_&&F&&L(w,F,t))return void(_=o(_));const{type:n,tagName:l,attributes:u,unregisteredAttributes:d}=e,m=f&&e===A,p=a(_),g=r(p,N({type:n,tagName:l,attributes:u,unregisteredAttributes:d,boundaryClass:m,isEditableTree:f}));s(_)&&0===i(_).length&&c(_),_=r(g,"")})),0===e&&(u&&0===y&&u(C,_),d&&0===b&&d(C,_)),n===v){const t=g[e];if(!t)continue;const{type:n,attributes:o,innerHTML:s}=t,i=x(n);f&&"#comment"===n?(_=r(a(_),{type:"span",attributes:{contenteditable:"false","data-rich-text-comment":o["data-rich-text-comment"]}}),r(r(_,{type:"span"}),o["data-rich-text-comment"].trim())):f||"script"!==n?!1===i?.contentEditable?(_=r(a(_),N({...t,isEditableTree:f,boundaryClass:y===e&&b===e+1})),s&&r(_,{html:s})):_=r(a(_),N({...t,object:!0,isEditableTree:f})):(_=r(a(_),N({type:"script",isEditableTree:f})),r(_,{html:decodeURIComponent(o["data-rich-text-script"])})),_=r(a(_),"")}else t||"\n"!==n?s(_)?l(_,n):_=r(a(_),n):(_=r(a(_),{type:"br",attributes:f?{"data-rich-text-line-break":"true"}:void 0,object:!0}),_=r(a(_),""));u&&y===e+1&&u(C,_),d&&b===e+1&&d(C,_),T&&e===h.length&&(r(a(_),E),m&&0===h.length&&r(a(_),{type:"span",attributes:{"data-rich-text-placeholder":m,style:"pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;"}})),F=w,O=n}return C}function _({value:e,preserveWhiteSpace:t}){return $(C({value:e,preserveWhiteSpace:t,createEmpty:A,append:O,getLastChild:F,getParent:D,isText:R,getText:M,remove:k,appendText:S}).children)}function A(){return{}}function F({children:e}){return e&&e[e.length-1]}function O(e,t){return"string"==typeof t&&(t={text:t}),t.parent=e,e.children=e.children||[],e.children.push(t),t}function S(e,t){e.text+=t}function D({parent:e}){return e}function R({text:e}){return"string"==typeof e}function M({text:e}){return e}function k(e){const t=e.parent.children.indexOf(e);return-1!==t&&e.parent.children.splice(t,1),e}function $(e=[]){return e.map((e=>void 0!==e.html?e.html:void 0===e.text?function({type:e,attributes:t,object:n,children:r}){if("#comment"===e)return`\x3c!--${t["data-rich-text-comment"]}--\x3e`;let o="";for(const e in t)(0,b.isValidAttributeName)(e)&&(o+=` ${e}="${(0,b.escapeAttribute)(t[e])}"`);return n?`<${e}${o}>`:`<${e}${o}>${$(r)}`}(e):(0,b.escapeEditableHTML)(e.text))).join("")}function P({text:e}){return e.replace(v,"")}function H({tagName:e,attributes:t}){let n;if(t&&t.class&&(n=(0,o.select)(f).getFormatTypeForClassName(t.class),n&&(t.class=` ${t.class} `.replace(` ${n.className} `," ").trim(),t.class||delete t.class)),n||(n=(0,o.select)(f).getFormatTypeForBareElement(e)),!n)return t?{type:e,attributes:t}:{type:e};if(n.__experimentalCreatePrepareEditableTree&&!n.__experimentalCreateOnChangeEditableValue)return null;if(!t)return{formatType:n,type:n.name,tagName:e};const r={},a={},s={...t};for(const e in n.attributes){const t=n.attributes[e];r[e]=s[t],delete s[t],void 0===r[e]&&delete r[e]}for(const e in s)a[e]=t[e];return!1===n.contentEditable&&delete a.contenteditable,{formatType:n,type:n.name,tagName:e,attributes:r,unregisteredAttributes:a}}class j{#e;static empty(){return new j}static fromPlainText(e){return new j(V({text:e}))}static fromHTMLString(e){return new j(V({html:e}))}static fromHTMLElement(e,t={}){const{preserveWhiteSpace:n=!1}=t,r=n?e:z(e),o=new j(V({element:r}));return Object.defineProperty(o,"originalHTML",{value:e.innerHTML}),o}constructor(e={formats:[],replacements:[],text:""}){this.#e=e}toPlainText(){return P(this.#e)}toHTMLString({preserveWhiteSpace:e}={}){return this.originalHTML||_({value:this.#e,preserveWhiteSpace:e})}valueOf(){return this.toHTMLString()}toString(){return this.toHTMLString()}toJSON(){return this.toHTMLString()}get length(){return this.text.length}get formats(){return this.#e.formats}get replacements(){return this.#e.replacements}get text(){return this.#e.text}}for(const e of Object.getOwnPropertyNames(String.prototype))j.prototype.hasOwnProperty(e)||Object.defineProperty(j.prototype,e,{value(...t){return this.toHTMLString()[e](...t)}});function V({element:e,text:t,html:n,range:r,__unstableIsEditableTree:o}={}){return n instanceof j?{text:n.text,formats:n.formats,replacements:n.replacements}:"string"==typeof t&&t.length>0?{formats:Array(t.length),replacements:Array(t.length),text:t}:("string"==typeof n&&n.length>0&&(e=y(document,n)),"object"!=typeof e?{formats:[],replacements:[],text:""}:K({element:e,range:r,isEditableTree:o}))}function I(e,t,n,r){if(!n)return;const{parentNode:o}=t,{startContainer:a,startOffset:s,endContainer:i,endOffset:c}=n,l=e.text.length;void 0!==r.start?e.start=l+r.start:t===a&&t.nodeType===t.TEXT_NODE?e.start=l+s:o===a&&t===a.childNodes[s]?e.start=l:o===a&&t===a.childNodes[s-1]?e.start=l+r.text.length:t===a&&(e.start=l),void 0!==r.end?e.end=l+r.end:t===i&&t.nodeType===t.TEXT_NODE?e.end=l+c:o===i&&t===i.childNodes[c-1]?e.end=l+r.text.length:o===i&&t===i.childNodes[c]?e.end=l:t===i&&(e.end=l+c)}function W(e,t,n){if(!t)return;const{startContainer:r,endContainer:o}=t;let{startOffset:a,endOffset:s}=t;return e===r&&(a=n(e.nodeValue.slice(0,a)).length),e===o&&(s=n(e.nodeValue.slice(0,s)).length),{startContainer:r,startOffset:a,endContainer:o,endOffset:s}}function z(e,t=!0){const n=e.cloneNode(!0);return n.normalize(),Array.from(n.childNodes).forEach(((e,n,r)=>{if(e.nodeType===e.TEXT_NODE){let o=e.nodeValue;/[\n\t\r\f]/.test(o)&&(o=o.replace(/[\n\t\r\f]+/g," ")),-1!==o.indexOf(" ")&&(o=o.replace(/ {2,}/g," ")),0===n&&o.startsWith(" ")?o=o.slice(1):t&&n===r.length-1&&o.endsWith(" ")&&(o=o.slice(0,-1)),e.nodeValue=o}else e.nodeType===e.ELEMENT_NODE&&z(e,!1)})),n}const B="\r";function X(e){return e.replace(new RegExp(`[${E}${v}${B}]`,"gu"),"")}function K({element:e,range:t,isEditableTree:n}){const r={formats:[],replacements:[],text:""};if(!e)return r;if(!e.hasChildNodes())return I(r,e,t,{formats:[],replacements:[],text:""}),r;const o=e.childNodes.length;for(let a=0;ae===t))}function Z({start:e,end:t,replacements:n,text:r}){if(e+1===t&&r[e]===v)return n[e]}function J({start:e,end:t}){if(void 0!==e&&void 0!==t)return e===t}function Q({text:e}){return 0===e.length}function ee(e,t=""){return"string"==typeof t&&(t=V({text:t})),p(e.reduce(((e,{formats:n,replacements:r,text:o})=>({formats:e.formats.concat(t.formats,n),replacements:e.replacements.concat(t.replacements,r),text:e.text+t.text+o}))))}function te(e,t){if("string"==typeof(t={name:e,...t}).name)if(/^[a-z][a-z0-9-]*\/[a-z][a-z0-9-]*$/.test(t.name))if((0,o.select)(f).getFormatType(t.name))window.console.error('Format "'+t.name+'" is already registered.');else if("string"==typeof t.tagName&&""!==t.tagName)if("string"==typeof t.className&&""!==t.className||null===t.className)if(/^[_a-zA-Z]+[a-zA-Z0-9_-]*$/.test(t.className)){if(null===t.className){const e=(0,o.select)(f).getFormatTypeForBareElement(t.tagName);if(e&&"core/unknown"!==e.name)return void window.console.error(`Format "${e.name}" is already registered to handle bare tag name "${t.tagName}".`)}else{const e=(0,o.select)(f).getFormatTypeForClassName(t.className);if(e)return void window.console.error(`Format "${e.name}" is already registered to handle class name "${t.className}".`)}if("title"in t&&""!==t.title)if("keywords"in t&&t.keywords.length>3)window.console.error('The format "'+t.name+'" can have a maximum of 3 keywords.');else{if("string"==typeof t.title)return(0,o.dispatch)(f).addFormatTypes(t),t;window.console.error("Format titles must be strings.")}else window.console.error('The format "'+t.name+'" must have a title.')}else window.console.error("A class name must begin with a letter, followed by any number of hyphens, underscores, letters, or numbers.");else window.console.error("Format class names must be a string, or null to handle bare elements.");else window.console.error("Format tag names must be a string.");else window.console.error("Format names must contain a namespace prefix, include only lowercase alphanumeric characters or dashes, and start with a letter. Example: my-plugin/my-custom-format");else window.console.error("Format names must be strings.")}function ne(e,t,n=e.start,r=e.end){const{formats:o,activeFormats:a}=e,s=o.slice();if(n===r){const e=s[n]?.find((({type:e})=>e===t));if(e){for(;s[n]?.find((t=>t===e));)re(s,n,t),n--;for(r++;s[r]?.find((t=>t===e));)re(s,r,t),r++}}else for(let e=n;ee!==t))||[]})}function re(e,t,n){const r=e[t].filter((({type:e})=>e!==n));r.length?e[t]=r:delete e[t]}function oe(e,t,n=e.start,r=e.end){const{formats:o,replacements:a,text:s}=e;"string"==typeof t&&(t=V({text:t}));const i=n+t.text.length;return p({formats:o.slice(0,n).concat(t.formats,o.slice(r)),replacements:a.slice(0,n).concat(t.replacements,a.slice(r)),text:s.slice(0,n)+t.text+s.slice(r),start:i,end:i})}function ae(e,t,n){return oe(e,V(),t,n)}function se({formats:e,replacements:t,text:n,start:r,end:o},a,s){return n=n.replace(a,((n,...a)=>{const i=a[a.length-2];let c,l,u=s;return"function"==typeof u&&(u=s(n,...a)),"object"==typeof u?(c=u.formats,l=u.replacements,u=u.text):(c=Array(u.length),l=Array(u.length),e[i]&&(c=c.fill(e[i]))),e=e.slice(0,i).concat(c,e.slice(i+n.length)),t=t.slice(0,i).concat(l,t.slice(i+n.length)),r&&(r=o=i+u.length),u})),p({formats:e,replacements:t,text:n,start:r,end:o})}function ie(e,t,n,r){return oe(e,{formats:[,],replacements:[t],text:v},n,r)}function ce(e,t=e.start,n=e.end){const{formats:r,replacements:o,text:a}=e;return void 0===t||void 0===n?{...e}:{formats:r.slice(t,n),replacements:o.slice(t,n),text:a.slice(t,n)}}function le({formats:e,replacements:t,text:n,start:r,end:o},a){if("string"!=typeof a)return function({formats:e,replacements:t,text:n,start:r,end:o},a=r,s=o){if(void 0===r||void 0===o)return;const i={formats:e.slice(0,a),replacements:t.slice(0,a),text:n.slice(0,a)},c={formats:e.slice(s),replacements:t.slice(s),text:n.slice(s),start:0,end:0};return[i,c]}(...arguments);let s=0;return n.split(a).map((n=>{const i=s,c={formats:e.slice(i,i+n.length),replacements:t.slice(i,i+n.length),text:n};return s+=a.length+n.length,void 0!==r&&void 0!==o&&(r>=i&&ri&&(c.start=0),o>=i&&os&&(c.end=n.length)),c}))}function ue(e,t){return e===t||e&&t&&e.startContainer===t.startContainer&&e.startOffset===t.startOffset&&e.endContainer===t.endContainer&&e.endOffset===t.endOffset}function de(e,t,n){const r=e.parentNode;let o=0;for(;e=e.previousSibling;)o++;return n=[o,...n],r!==t&&(n=de(r,t,n)),n}function fe(e,t){for(t=[...t];e&&t.length>1;)e=e.childNodes[t.shift()];return{node:e,offset:t[0]}}function me(e,t){if(void 0!==t.html)return e.innerHTML+=t.html;"string"==typeof t&&(t=e.ownerDocument.createTextNode(t));const{type:n,attributes:r}=t;if(n)if("#comment"===n)t=e.ownerDocument.createComment(r["data-rich-text-comment"]);else{t=e.ownerDocument.createElement(n);for(const e in r)t.setAttribute(e,r[e])}return e.appendChild(t)}function pe(e,t){e.appendData(t)}function ge({lastChild:e}){return e}function he({parentNode:e}){return e}function ye(e){return e.nodeType===e.TEXT_NODE}function ve({nodeValue:e}){return e}function Ee(e){return e.parentNode.removeChild(e)}function be({value:e,prepareEditableTree:t,isEditableTree:n=!0,placeholder:r,doc:o=document}){let a=[],s=[];t&&(e={...e,formats:t(e)});return{body:C({value:e,createEmpty:()=>y(o,""),append:me,getLastChild:ge,getParent:he,isText:ye,getText:ve,remove:Ee,appendText:pe,onStartIndex(e,t){a=de(t,e,[t.nodeValue.length])},onEndIndex(e,t){s=de(t,e,[t.nodeValue.length])},isEditableTree:n,placeholder:r}),selection:{startPath:a,endPath:s}}}function Te({value:e,current:t,prepareEditableTree:n,__unstableDomOnly:r,placeholder:o}){const{body:a,selection:s}=be({value:e,prepareEditableTree:n,placeholder:o,doc:t.ownerDocument});xe(a,t),void 0===e.start||r||function({startPath:e,endPath:t},n){const{node:r,offset:o}=fe(n,e),{node:a,offset:s}=fe(n,t),{ownerDocument:i}=n,{defaultView:c}=i,l=c.getSelection(),u=i.createRange();u.setStart(r,o),u.setEnd(a,s);const{activeElement:d}=i;if(l.rangeCount>0){if(ue(u,l.getRangeAt(0)))return;l.removeAllRanges()}l.addRange(u),d!==i.activeElement&&d instanceof c.HTMLElement&&d.focus()}(s,t)}function xe(e,t){let n,r=0;for(;n=e.firstChild;){const o=t.childNodes[r];if(o)if(o.isEqualNode(n))e.removeChild(n);else if(o.nodeName!==n.nodeName||o.nodeType===o.TEXT_NODE&&o.data!==n.data)t.replaceChild(n,o);else{const t=o.attributes,r=n.attributes;if(t){let e=t.length;for(;e--;){const{name:r}=t[e];n.getAttribute(r)||o.removeAttribute(r)}}if(r)for(let e=0;e{if(!e.current)return;const{ownerDocument:{defaultView:t}}=e.current,n=t.getSelection();if(!n.rangeCount)return;const a=n.getRangeAt(0);if(!s)return a;let i=a.startContainer;for(i=i.nextElementSibling||i;i.nodeType!==i.ELEMENT_NODE;)i=i.parentNode;return i.closest(r+(o?"."+o:""))}),[s,t.start,t.end,r,o])}const Se=window.wp.compose;function De(e,t,n){if(!e)return;const{ownerDocument:r}=e,{defaultView:o}=r,a=o.getSelection();if(!a)return;if(!a.rangeCount)return;const s=a.getRangeAt(0);if(!s||!s.startContainer)return;const i=function(e,t,n,r){let o=e.startContainer;if(o.nodeType===o.TEXT_NODE&&e.startOffset===o.length&&o.nextSibling)for(o=o.nextSibling;o.firstChild;)o=o.firstChild;if(o.nodeType!==o.ELEMENT_NODE&&(o=o.parentElement),!o)return;if(o===t)return;if(!t.contains(o))return;const a=n+(r?"."+r:"");for(;o!==t;){if(o.matches(a))return o;o=o.parentElement}}(s,e,t,n);return i||function(e,t){return{contextElement:t,getBoundingClientRect:()=>t.contains(e.startContainer)?e.getBoundingClientRect():t.getBoundingClientRect()}}(s,e)}function Re({editableContentElement:e,settings:t={}}){const{tagName:n,className:r,isActive:o}=t,[a,s]=(0,_e.useState)((()=>De(e,n,r))),i=(0,Se.usePrevious)(o);return(0,_e.useLayoutEffect)((()=>{if(!e)return;function t(){s(De(e,n,r))}function a(){l.addEventListener("selectionchange",t)}function c(){l.removeEventListener("selectionchange",t)}const{ownerDocument:l}=e;return(e===l.activeElement||!i&&o||i&&!o)&&(s(De(e,n,r)),a()),e.addEventListener("focusin",a),e.addEventListener("focusout",c),()=>{c(),e.removeEventListener("focusin",a),e.removeEventListener("focusout",c)}}),[e,n,r,o,i]),a}const Me="pre-wrap",ke="1px";function $e({record:e}){const t=(0,_e.useRef)(),{activeFormats:n=[],replacements:r,start:o}=e.current,a=r[o];return(0,_e.useEffect)((()=>{if(!(n&&n.length||a))return;const e="*[data-rich-text-format-boundary]",r=t.current.querySelector(e);if(!r)return;const{ownerDocument:o}=r,{defaultView:s}=o,i=`${`.rich-text:focus ${e}`} {${`background-color: ${s.getComputedStyle(r).color.replace(")",", 0.2)").replace("rgb","rgba")}`}}`,c="rich-text-boundary-style";let l=o.getElementById(c);l||(l=o.createElement("style"),l.id=c,o.head.appendChild(l)),l.innerHTML!==i&&(l.innerHTML=i)}),[n,a]),t}const Pe=window.wp.keycodes,He=[];const je=new Set(["insertParagraph","insertOrderedList","insertUnorderedList","insertHorizontalRule","insertLink"]),Ve=[],Ie="data-rich-text-placeholder";const We=[e=>t=>{function n(n){const{record:r}=e.current,{ownerDocument:o}=t;if(J(r.current)||!t.contains(o.activeElement))return;const a=ce(r.current),s=P(a),i=_({value:a});n.clipboardData.setData("text/plain",s),n.clipboardData.setData("text/html",i),n.clipboardData.setData("rich-text","true"),n.preventDefault(),"cut"===n.type&&o.execCommand("delete")}const{defaultView:r}=t.ownerDocument;return r.addEventListener("copy",n),r.addEventListener("cut",n),()=>{r.removeEventListener("copy",n),r.removeEventListener("cut",n)}},()=>e=>{function t(t){const{target:n}=t;if(n===e||n.textContent&&n.isContentEditable)return;const{ownerDocument:r}=n,{defaultView:o}=r,a=o.getSelection();if(a.containsNode(n))return;const s=r.createRange(),i=n.isContentEditable?n:n.closest("[contenteditable]");s.selectNode(i),a.removeAllRanges(),a.addRange(s),t.preventDefault()}function n(n){n.relatedTarget&&!e.contains(n.relatedTarget)&&"A"===n.relatedTarget.tagName&&t(n)}return e.addEventListener("click",t),e.addEventListener("focusin",n),()=>{e.removeEventListener("click",t),e.removeEventListener("focusin",n)}},e=>t=>{function n(n){const{keyCode:r,shiftKey:o,altKey:a,metaKey:s,ctrlKey:i}=n;if(o||a||s||i||r!==Pe.LEFT&&r!==Pe.RIGHT)return;const{record:c,applyRecord:l,forceRender:u}=e.current,{text:d,formats:f,start:m,end:p,activeFormats:g=[]}=c.current,h=J(c.current),{ownerDocument:y}=t,{defaultView:v}=y,{direction:E}=v.getComputedStyle(t),b="rtl"===E?Pe.RIGHT:Pe.LEFT,T=n.keyCode===b;if(h&&0===g.length){if(0===m&&T)return;if(p===d.length&&!T)return}if(!h)return;const x=f[m-1]||He,w=f[m]||He,N=T?x:w,L=g.every(((e,t)=>e===N[t]));let C=g.length;if(L?C{t.removeEventListener("keydown",n)}},e=>t=>{function n(t){const{keyCode:n}=t,{createRecord:r,handleChange:o}=e.current;if(t.defaultPrevented)return;if(n!==Pe.DELETE&&n!==Pe.BACKSPACE)return;const a=r(),{start:s,end:i,text:c}=a;0===s&&0!==i&&i===c.length&&(o(ae(a)),t.preventDefault())}return t.addEventListener("keydown",n),()=>{t.removeEventListener("keydown",n)}},e=>t=>{const{ownerDocument:n}=t,{defaultView:r}=n;let o=!1;function a(t){if(o)return;let n;t&&(n=t.inputType);const{record:r,applyRecord:a,createRecord:s,handleChange:i}=e.current;if(n&&(0===n.indexOf("format")||je.has(n)))return void a(r.current);const c=s(),{start:l,activeFormats:u=[]}=r.current,d=function({value:e,start:t,end:n,formats:r}){const o=Math.min(t,n),a=Math.max(t,n),s=e.formats[o-1]||[],i=e.formats[a]||[];for(e.activeFormats=r.map(((e,t)=>{if(s[t]){if(m(e,s[t]))return s[t]}else if(i[t]&&m(e,i[t]))return i[t];return e}));--n>=t;)e.activeFormats.length>0?e.formats[n]=e.activeFormats:delete e.formats[n];return e}({value:c,start:l,end:c.start,formats:u});i(d)}function s(){const{record:i,applyRecord:c,createRecord:l,onSelectionChange:u}=e.current;if("true"!==t.contentEditable)return;if(n.activeElement!==t)return void n.removeEventListener("selectionchange",s);if(o)return;const{start:d,end:f,text:m}=l(),p=i.current;if(m!==p.text)return void a();if(d===p.start&&f===p.end)return void(0===p.text.length&&0===d&&function(e){const t=e.getSelection(),{anchorNode:n,anchorOffset:r}=t;if(n.nodeType!==n.ELEMENT_NODE)return;const o=n.childNodes[r];o&&o.nodeType===o.ELEMENT_NODE&&o.hasAttribute(Ie)&&t.collapseToStart()}(r));const g={...p,start:d,end:f,activeFormats:p._newActiveFormats,_newActiveFormats:void 0},h=T(g,Ve);g.activeFormats=h,i.current=g,c(g,{domOnly:!0}),u(d,f)}function i(){o=!0,n.removeEventListener("selectionchange",s),t.querySelector(`[${Ie}]`)?.remove()}function c(){o=!1,a({inputType:"insertText"}),n.addEventListener("selectionchange",s)}function l(){const{record:r,isSelected:o,onSelectionChange:a,applyRecord:i}=e.current;if(!t.parentElement.closest('[contenteditable="true"]')){if(o)i(r.current,{domOnly:!0});else{const e=void 0;r.current={...r.current,start:e,end:e,activeFormats:Ve}}a(r.current.start,r.current.end),window.queueMicrotask(s),n.addEventListener("selectionchange",s)}}return t.addEventListener("input",a),t.addEventListener("compositionstart",i),t.addEventListener("compositionend",c),t.addEventListener("focus",l),()=>{t.removeEventListener("input",a),t.removeEventListener("compositionstart",i),t.removeEventListener("compositionend",c),t.removeEventListener("focus",l)}},()=>e=>{const{ownerDocument:t}=e,{defaultView:n}=t,r=n?.getSelection();let o;function a(){return r.rangeCount?r.getRangeAt(0):null}function s(e){const n="keydown"===e.type?"keyup":"pointerup";function r(){t.removeEventListener(n,s),t.removeEventListener("selectionchange",r),t.removeEventListener("input",r)}function s(){r(),ue(o,a())||t.dispatchEvent(new Event("selectionchange"))}t.addEventListener(n,s),t.addEventListener("selectionchange",r),t.addEventListener("input",r),o=a()}return e.addEventListener("pointerdown",s),e.addEventListener("keydown",s),()=>{e.removeEventListener("pointerdown",s),e.removeEventListener("keydown",s)}},function(){return e=>{const{ownerDocument:t}=e,{defaultView:n}=t;let r=null;function o(t){t.defaultPrevented||t.target!==e&&t.target.contains(e)&&(r=e.getAttribute("contenteditable"),e.setAttribute("contenteditable","false"),n.getSelection().removeAllRanges())}function a(){null!==r&&(e.setAttribute("contenteditable",r),r=null)}return n.addEventListener("pointerdown",o),n.addEventListener("pointerup",a),()=>{n.removeEventListener("pointerdown",o),n.removeEventListener("pointerup",a)}}}];function ze(e){const t=(0,_e.useRef)(e);(0,_e.useInsertionEffect)((()=>{t.current=e}));const n=(0,_e.useMemo)((()=>We.map((e=>e(t)))),[t]);return(0,Se.useRefEffect)((e=>{const t=n.map((t=>t(e)));return()=>{t.forEach((e=>e()))}}),[n])}function Be({value:e="",selectionStart:t,selectionEnd:n,placeholder:r,onSelectionChange:a,preserveWhiteSpace:s,onChange:i,__unstableDisableFormats:c,__unstableIsSelected:l,__unstableDependencies:u=[],__unstableAfterParse:d,__unstableBeforeSerialize:f,__unstableAddInvisibleFormats:m}){const p=(0,o.useRegistry)(),[,g]=(0,_e.useReducer)((()=>({}))),h=(0,_e.useRef)();function y(e,{domOnly:t}={}){Te({value:e,current:h.current,prepareEditableTree:m,__unstableDomOnly:t,placeholder:r})}const v=(0,_e.useRef)(e),E=(0,_e.useRef)();function b(){v.current=e,E.current=e,e instanceof j||(E.current=e?j.fromHTMLString(e,{preserveWhiteSpace:s}):j.empty()),E.current={text:E.current.text,formats:E.current.formats,replacements:E.current.replacements},c&&(E.current.formats=Array(e.length),E.current.replacements=Array(e.length)),d&&(E.current.formats=d(E.current)),E.current.start=t,E.current.end=n}const T=(0,_e.useRef)(!1);function x(t){if(E.current=t,y(t),c)v.current=t.text;else{const n=f?f(t):t.formats;t={...t,formats:n},v.current="string"==typeof e?_({value:t,preserveWhiteSpace:s}):new j(t)}const{start:n,end:r,formats:o,text:l}=E.current;p.batch((()=>{a(n,r),i(v.current,{__unstableFormats:o,__unstableText:l})})),g()}function w(){b(),y(E.current)}E.current?t===E.current.start&&n===E.current.end||(T.current=l,E.current={...E.current,start:t,end:n,activeFormats:void 0}):(T.current=l,b());const N=(0,_e.useRef)(!1);(0,_e.useLayoutEffect)((()=>{N.current&&e!==v.current&&(w(),g())}),[e]),(0,_e.useLayoutEffect)((()=>{T.current&&(h.current.ownerDocument.activeElement!==h.current&&h.current.focus(),y(E.current),T.current=!1)}),[T.current]);const L=(0,Se.useMergeRefs)([h,(0,_e.useCallback)((e=>{e&&(e.style.whiteSpace=Me,e.style.minWidth=ke)}),[]),$e({record:E}),ze({record:E,handleChange:x,applyRecord:y,createRecord:function(){const{ownerDocument:{defaultView:e}}=h.current,t=e.getSelection(),n=t.rangeCount>0?t.getRangeAt(0):null;return V({element:h.current,range:n,__unstableIsEditableTree:!0})},isSelected:l,onSelectionChange:a,forceRender:g}),(0,Se.useRefEffect)((()=>{w(),N.current=!0}),[r,...u])]);return{value:E.current,getValue:()=>E.current,onChange:x,ref:L}}function Xe(){}(window.wp=window.wp||{}).richText=t})(); \ No newline at end of file diff --git a/wp-includes/js/dist/router.js b/wp-includes/js/dist/router.js index f63e1aa392..3608424fd7 100644 --- a/wp-includes/js/dist/router.js +++ b/wp-includes/js/dist/router.js @@ -42,23 +42,703 @@ __webpack_require__.d(__webpack_exports__, { privateApis: () => (/* reexport */ privateApis) }); -;// external ["wp","element"] -const external_wp_element_namespaceObject = window["wp"]["element"]; +;// ./node_modules/route-recognizer/dist/route-recognizer.es.js +var createObject = Object.create; +function createMap() { + var map = createObject(null); + map["__"] = undefined; + delete map["__"]; + return map; +} + +var Target = function Target(path, matcher, delegate) { + this.path = path; + this.matcher = matcher; + this.delegate = delegate; +}; +Target.prototype.to = function to (target, callback) { + var delegate = this.delegate; + if (delegate && delegate.willAddRoute) { + target = delegate.willAddRoute(this.matcher.target, target); + } + this.matcher.add(this.path, target); + if (callback) { + if (callback.length === 0) { + throw new Error("You must have an argument in the function passed to `to`"); + } + this.matcher.addChild(this.path, target, callback, this.delegate); + } +}; +var Matcher = function Matcher(target) { + this.routes = createMap(); + this.children = createMap(); + this.target = target; +}; +Matcher.prototype.add = function add (path, target) { + this.routes[path] = target; +}; +Matcher.prototype.addChild = function addChild (path, target, callback, delegate) { + var matcher = new Matcher(target); + this.children[path] = matcher; + var match = generateMatch(path, matcher, delegate); + if (delegate && delegate.contextEntered) { + delegate.contextEntered(target, match); + } + callback(match); +}; +function generateMatch(startingPath, matcher, delegate) { + function match(path, callback) { + var fullPath = startingPath + path; + if (callback) { + callback(generateMatch(fullPath, matcher, delegate)); + } + else { + return new Target(fullPath, matcher, delegate); + } + } + + return match; +} +function addRoute(routeArray, path, handler) { + var len = 0; + for (var i = 0; i < routeArray.length; i++) { + len += routeArray[i].path.length; + } + path = path.substr(len); + var route = { path: path, handler: handler }; + routeArray.push(route); +} +function eachRoute(baseRoute, matcher, callback, binding) { + var routes = matcher.routes; + var paths = Object.keys(routes); + for (var i = 0; i < paths.length; i++) { + var path = paths[i]; + var routeArray = baseRoute.slice(); + addRoute(routeArray, path, routes[path]); + var nested = matcher.children[path]; + if (nested) { + eachRoute(routeArray, nested, callback, binding); + } + else { + callback.call(binding, routeArray); + } + } +} +var map = function (callback, addRouteCallback) { + var matcher = new Matcher(); + callback(generateMatch("", matcher, this.delegate)); + eachRoute([], matcher, function (routes) { + if (addRouteCallback) { + addRouteCallback(this, routes); + } + else { + this.add(routes); + } + }, this); +}; + +// Normalizes percent-encoded values in `path` to upper-case and decodes percent-encoded +// values that are not reserved (i.e., unicode characters, emoji, etc). The reserved +// chars are "/" and "%". +// Safe to call multiple times on the same path. +// Normalizes percent-encoded values in `path` to upper-case and decodes percent-encoded +function normalizePath(path) { + return path.split("/") + .map(normalizeSegment) + .join("/"); +} +// We want to ensure the characters "%" and "/" remain in percent-encoded +// form when normalizing paths, so replace them with their encoded form after +// decoding the rest of the path +var SEGMENT_RESERVED_CHARS = /%|\//g; +function normalizeSegment(segment) { + if (segment.length < 3 || segment.indexOf("%") === -1) + { return segment; } + return decodeURIComponent(segment).replace(SEGMENT_RESERVED_CHARS, encodeURIComponent); +} +// We do not want to encode these characters when generating dynamic path segments +// See https://tools.ietf.org/html/rfc3986#section-3.3 +// sub-delims: "!", "$", "&", "'", "(", ")", "*", "+", ",", ";", "=" +// others allowed by RFC 3986: ":", "@" +// +// First encode the entire path segment, then decode any of the encoded special chars. +// +// The chars "!", "'", "(", ")", "*" do not get changed by `encodeURIComponent`, +// so the possible encoded chars are: +// ['%24', '%26', '%2B', '%2C', '%3B', '%3D', '%3A', '%40']. +var PATH_SEGMENT_ENCODINGS = /%(?:2(?:4|6|B|C)|3(?:B|D|A)|40)/g; +function encodePathSegment(str) { + return encodeURIComponent(str).replace(PATH_SEGMENT_ENCODINGS, decodeURIComponent); +} + +var escapeRegex = /(\/|\.|\*|\+|\?|\||\(|\)|\[|\]|\{|\}|\\)/g; +var isArray = Array.isArray; +var route_recognizer_es_hasOwnProperty = Object.prototype.hasOwnProperty; +function getParam(params, key) { + if (typeof params !== "object" || params === null) { + throw new Error("You must pass an object as the second argument to `generate`."); + } + if (!route_recognizer_es_hasOwnProperty.call(params, key)) { + throw new Error("You must provide param `" + key + "` to `generate`."); + } + var value = params[key]; + var str = typeof value === "string" ? value : "" + value; + if (str.length === 0) { + throw new Error("You must provide a param `" + key + "`."); + } + return str; +} +var eachChar = []; +eachChar[0 /* Static */] = function (segment, currentState) { + var state = currentState; + var value = segment.value; + for (var i = 0; i < value.length; i++) { + var ch = value.charCodeAt(i); + state = state.put(ch, false, false); + } + return state; +}; +eachChar[1 /* Dynamic */] = function (_, currentState) { + return currentState.put(47 /* SLASH */, true, true); +}; +eachChar[2 /* Star */] = function (_, currentState) { + return currentState.put(-1 /* ANY */, false, true); +}; +eachChar[4 /* Epsilon */] = function (_, currentState) { + return currentState; +}; +var regex = []; +regex[0 /* Static */] = function (segment) { + return segment.value.replace(escapeRegex, "\\$1"); +}; +regex[1 /* Dynamic */] = function () { + return "([^/]+)"; +}; +regex[2 /* Star */] = function () { + return "(.+)"; +}; +regex[4 /* Epsilon */] = function () { + return ""; +}; +var generate = []; +generate[0 /* Static */] = function (segment) { + return segment.value; +}; +generate[1 /* Dynamic */] = function (segment, params) { + var value = getParam(params, segment.value); + if (RouteRecognizer.ENCODE_AND_DECODE_PATH_SEGMENTS) { + return encodePathSegment(value); + } + else { + return value; + } +}; +generate[2 /* Star */] = function (segment, params) { + return getParam(params, segment.value); +}; +generate[4 /* Epsilon */] = function () { + return ""; +}; +var EmptyObject = Object.freeze({}); +var EmptyArray = Object.freeze([]); +// The `names` will be populated with the paramter name for each dynamic/star +// segment. `shouldDecodes` will be populated with a boolean for each dyanamic/star +// segment, indicating whether it should be decoded during recognition. +function parse(segments, route, types) { + // normalize route as not starting with a "/". Recognition will + // also normalize. + if (route.length > 0 && route.charCodeAt(0) === 47 /* SLASH */) { + route = route.substr(1); + } + var parts = route.split("/"); + var names = undefined; + var shouldDecodes = undefined; + for (var i = 0; i < parts.length; i++) { + var part = parts[i]; + var flags = 0; + var type = 0; + if (part === "") { + type = 4 /* Epsilon */; + } + else if (part.charCodeAt(0) === 58 /* COLON */) { + type = 1 /* Dynamic */; + } + else if (part.charCodeAt(0) === 42 /* STAR */) { + type = 2 /* Star */; + } + else { + type = 0 /* Static */; + } + flags = 2 << type; + if (flags & 12 /* Named */) { + part = part.slice(1); + names = names || []; + names.push(part); + shouldDecodes = shouldDecodes || []; + shouldDecodes.push((flags & 4 /* Decoded */) !== 0); + } + if (flags & 14 /* Counted */) { + types[type]++; + } + segments.push({ + type: type, + value: normalizeSegment(part) + }); + } + return { + names: names || EmptyArray, + shouldDecodes: shouldDecodes || EmptyArray, + }; +} +function isEqualCharSpec(spec, char, negate) { + return spec.char === char && spec.negate === negate; +} +// A State has a character specification and (`charSpec`) and a list of possible +// subsequent states (`nextStates`). +// +// If a State is an accepting state, it will also have several additional +// properties: +// +// * `regex`: A regular expression that is used to extract parameters from paths +// that reached this accepting state. +// * `handlers`: Information on how to convert the list of captures into calls +// to registered handlers with the specified parameters +// * `types`: How many static, dynamic or star segments in this route. Used to +// decide which route to use if multiple registered routes match a path. +// +// Currently, State is implemented naively by looping over `nextStates` and +// comparing a character specification against a character. A more efficient +// implementation would use a hash of keys pointing at one or more next states. +var State = function State(states, id, char, negate, repeat) { + this.states = states; + this.id = id; + this.char = char; + this.negate = negate; + this.nextStates = repeat ? id : null; + this.pattern = ""; + this._regex = undefined; + this.handlers = undefined; + this.types = undefined; +}; +State.prototype.regex = function regex$1 () { + if (!this._regex) { + this._regex = new RegExp(this.pattern); + } + return this._regex; +}; +State.prototype.get = function get (char, negate) { + var this$1 = this; + + var nextStates = this.nextStates; + if (nextStates === null) + { return; } + if (isArray(nextStates)) { + for (var i = 0; i < nextStates.length; i++) { + var child = this$1.states[nextStates[i]]; + if (isEqualCharSpec(child, char, negate)) { + return child; + } + } + } + else { + var child$1 = this.states[nextStates]; + if (isEqualCharSpec(child$1, char, negate)) { + return child$1; + } + } +}; +State.prototype.put = function put (char, negate, repeat) { + var state; + // If the character specification already exists in a child of the current + // state, just return that state. + if (state = this.get(char, negate)) { + return state; + } + // Make a new state for the character spec + var states = this.states; + state = new State(states, states.length, char, negate, repeat); + states[states.length] = state; + // Insert the new state as a child of the current state + if (this.nextStates == null) { + this.nextStates = state.id; + } + else if (isArray(this.nextStates)) { + this.nextStates.push(state.id); + } + else { + this.nextStates = [this.nextStates, state.id]; + } + // Return the new state + return state; +}; +// Find a list of child states matching the next character +State.prototype.match = function match (ch) { + var this$1 = this; + + var nextStates = this.nextStates; + if (!nextStates) + { return []; } + var returned = []; + if (isArray(nextStates)) { + for (var i = 0; i < nextStates.length; i++) { + var child = this$1.states[nextStates[i]]; + if (isMatch(child, ch)) { + returned.push(child); + } + } + } + else { + var child$1 = this.states[nextStates]; + if (isMatch(child$1, ch)) { + returned.push(child$1); + } + } + return returned; +}; +function isMatch(spec, char) { + return spec.negate ? spec.char !== char && spec.char !== -1 /* ANY */ : spec.char === char || spec.char === -1 /* ANY */; +} +// This is a somewhat naive strategy, but should work in a lot of cases +// A better strategy would properly resolve /posts/:id/new and /posts/edit/:id. +// +// This strategy generally prefers more static and less dynamic matching. +// Specifically, it +// +// * prefers fewer stars to more, then +// * prefers using stars for less of the match to more, then +// * prefers fewer dynamic segments to more, then +// * prefers more static segments to more +function sortSolutions(states) { + return states.sort(function (a, b) { + var ref = a.types || [0, 0, 0]; + var astatics = ref[0]; + var adynamics = ref[1]; + var astars = ref[2]; + var ref$1 = b.types || [0, 0, 0]; + var bstatics = ref$1[0]; + var bdynamics = ref$1[1]; + var bstars = ref$1[2]; + if (astars !== bstars) { + return astars - bstars; + } + if (astars) { + if (astatics !== bstatics) { + return bstatics - astatics; + } + if (adynamics !== bdynamics) { + return bdynamics - adynamics; + } + } + if (adynamics !== bdynamics) { + return adynamics - bdynamics; + } + if (astatics !== bstatics) { + return bstatics - astatics; + } + return 0; + }); +} +function recognizeChar(states, ch) { + var nextStates = []; + for (var i = 0, l = states.length; i < l; i++) { + var state = states[i]; + nextStates = nextStates.concat(state.match(ch)); + } + return nextStates; +} +var RecognizeResults = function RecognizeResults(queryParams) { + this.length = 0; + this.queryParams = queryParams || {}; +}; + +RecognizeResults.prototype.splice = Array.prototype.splice; +RecognizeResults.prototype.slice = Array.prototype.slice; +RecognizeResults.prototype.push = Array.prototype.push; +function findHandler(state, originalPath, queryParams) { + var handlers = state.handlers; + var regex = state.regex(); + if (!regex || !handlers) + { throw new Error("state not initialized"); } + var captures = originalPath.match(regex); + var currentCapture = 1; + var result = new RecognizeResults(queryParams); + result.length = handlers.length; + for (var i = 0; i < handlers.length; i++) { + var handler = handlers[i]; + var names = handler.names; + var shouldDecodes = handler.shouldDecodes; + var params = EmptyObject; + var isDynamic = false; + if (names !== EmptyArray && shouldDecodes !== EmptyArray) { + for (var j = 0; j < names.length; j++) { + isDynamic = true; + var name = names[j]; + var capture = captures && captures[currentCapture++]; + if (params === EmptyObject) { + params = {}; + } + if (RouteRecognizer.ENCODE_AND_DECODE_PATH_SEGMENTS && shouldDecodes[j]) { + params[name] = capture && decodeURIComponent(capture); + } + else { + params[name] = capture; + } + } + } + result[i] = { + handler: handler.handler, + params: params, + isDynamic: isDynamic + }; + } + return result; +} +function decodeQueryParamPart(part) { + // http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.1 + part = part.replace(/\+/gm, "%20"); + var result; + try { + result = decodeURIComponent(part); + } + catch (error) { + result = ""; + } + return result; +} +var RouteRecognizer = function RouteRecognizer() { + this.names = createMap(); + var states = []; + var state = new State(states, 0, -1 /* ANY */, true, false); + states[0] = state; + this.states = states; + this.rootState = state; +}; +RouteRecognizer.prototype.add = function add (routes, options) { + var currentState = this.rootState; + var pattern = "^"; + var types = [0, 0, 0]; + var handlers = new Array(routes.length); + var allSegments = []; + var isEmpty = true; + var j = 0; + for (var i = 0; i < routes.length; i++) { + var route = routes[i]; + var ref = parse(allSegments, route.path, types); + var names = ref.names; + var shouldDecodes = ref.shouldDecodes; + // preserve j so it points to the start of newly added segments + for (; j < allSegments.length; j++) { + var segment = allSegments[j]; + if (segment.type === 4 /* Epsilon */) { + continue; + } + isEmpty = false; + // Add a "/" for the new segment + currentState = currentState.put(47 /* SLASH */, false, false); + pattern += "/"; + // Add a representation of the segment to the NFA and regex + currentState = eachChar[segment.type](segment, currentState); + pattern += regex[segment.type](segment); + } + handlers[i] = { + handler: route.handler, + names: names, + shouldDecodes: shouldDecodes + }; + } + if (isEmpty) { + currentState = currentState.put(47 /* SLASH */, false, false); + pattern += "/"; + } + currentState.handlers = handlers; + currentState.pattern = pattern + "$"; + currentState.types = types; + var name; + if (typeof options === "object" && options !== null && options.as) { + name = options.as; + } + if (name) { + // if (this.names[name]) { + // throw new Error("You may not add a duplicate route named `" + name + "`."); + // } + this.names[name] = { + segments: allSegments, + handlers: handlers + }; + } +}; +RouteRecognizer.prototype.handlersFor = function handlersFor (name) { + var route = this.names[name]; + if (!route) { + throw new Error("There is no route named " + name); + } + var result = new Array(route.handlers.length); + for (var i = 0; i < route.handlers.length; i++) { + var handler = route.handlers[i]; + result[i] = handler; + } + return result; +}; +RouteRecognizer.prototype.hasRoute = function hasRoute (name) { + return !!this.names[name]; +}; +RouteRecognizer.prototype.generate = function generate$1 (name, params) { + var route = this.names[name]; + var output = ""; + if (!route) { + throw new Error("There is no route named " + name); + } + var segments = route.segments; + for (var i = 0; i < segments.length; i++) { + var segment = segments[i]; + if (segment.type === 4 /* Epsilon */) { + continue; + } + output += "/"; + output += generate[segment.type](segment, params); + } + if (output.charAt(0) !== "/") { + output = "/" + output; + } + if (params && params.queryParams) { + output += this.generateQueryString(params.queryParams); + } + return output; +}; +RouteRecognizer.prototype.generateQueryString = function generateQueryString (params) { + var pairs = []; + var keys = Object.keys(params); + keys.sort(); + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + var value = params[key]; + if (value == null) { + continue; + } + var pair = encodeURIComponent(key); + if (isArray(value)) { + for (var j = 0; j < value.length; j++) { + var arrayPair = key + "[]" + "=" + encodeURIComponent(value[j]); + pairs.push(arrayPair); + } + } + else { + pair += "=" + encodeURIComponent(value); + pairs.push(pair); + } + } + if (pairs.length === 0) { + return ""; + } + return "?" + pairs.join("&"); +}; +RouteRecognizer.prototype.parseQueryString = function parseQueryString (queryString) { + var pairs = queryString.split("&"); + var queryParams = {}; + for (var i = 0; i < pairs.length; i++) { + var pair = pairs[i].split("="), key = decodeQueryParamPart(pair[0]), keyLength = key.length, isArray = false, value = (void 0); + if (pair.length === 1) { + value = "true"; + } + else { + // Handle arrays + if (keyLength > 2 && key.slice(keyLength - 2) === "[]") { + isArray = true; + key = key.slice(0, keyLength - 2); + if (!queryParams[key]) { + queryParams[key] = []; + } + } + value = pair[1] ? decodeQueryParamPart(pair[1]) : ""; + } + if (isArray) { + queryParams[key].push(value); + } + else { + queryParams[key] = value; + } + } + return queryParams; +}; +RouteRecognizer.prototype.recognize = function recognize (path) { + var results; + var states = [this.rootState]; + var queryParams = {}; + var isSlashDropped = false; + var hashStart = path.indexOf("#"); + if (hashStart !== -1) { + path = path.substr(0, hashStart); + } + var queryStart = path.indexOf("?"); + if (queryStart !== -1) { + var queryString = path.substr(queryStart + 1, path.length); + path = path.substr(0, queryStart); + queryParams = this.parseQueryString(queryString); + } + if (path.charAt(0) !== "/") { + path = "/" + path; + } + var originalPath = path; + if (RouteRecognizer.ENCODE_AND_DECODE_PATH_SEGMENTS) { + path = normalizePath(path); + } + else { + path = decodeURI(path); + originalPath = decodeURI(originalPath); + } + var pathLen = path.length; + if (pathLen > 1 && path.charAt(pathLen - 1) === "/") { + path = path.substr(0, pathLen - 1); + originalPath = originalPath.substr(0, originalPath.length - 1); + isSlashDropped = true; + } + for (var i = 0; i < path.length; i++) { + states = recognizeChar(states, path.charCodeAt(i)); + if (!states.length) { + break; + } + } + var solutions = []; + for (var i$1 = 0; i$1 < states.length; i$1++) { + if (states[i$1].handlers) { + solutions.push(states[i$1]); + } + } + states = sortSolutions(solutions); + var state = solutions[0]; + if (state && state.handlers) { + // if a trailing slash was dropped and a star segment is the last segment + // specified, put the trailing slash back + if (isSlashDropped && state.pattern && state.pattern.slice(-5) === "(.+)$") { + originalPath = originalPath + "/"; + } + results = findHandler(state, originalPath, queryParams); + } + return results; +}; +RouteRecognizer.VERSION = "0.3.4"; +// Set to false to opt-out of encoding and decoding path segments. +// See https://github.com/tildeio/route-recognizer/pull/55 +RouteRecognizer.ENCODE_AND_DECODE_PATH_SEGMENTS = true; +RouteRecognizer.Normalizer = { + normalizeSegment: normalizeSegment, normalizePath: normalizePath, encodePathSegment: encodePathSegment +}; +RouteRecognizer.prototype.map = map; + +/* harmony default export */ const route_recognizer_es = (RouteRecognizer); + + ;// ./node_modules/@babel/runtime/helpers/esm/extends.js function extends_extends() { - extends_extends = Object.assign ? Object.assign.bind() : function (target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - for (var key in source) { - if (Object.prototype.hasOwnProperty.call(source, key)) { - target[key] = source[key]; - } - } + return extends_extends = Object.assign ? Object.assign.bind() : function (n) { + for (var e = 1; e < arguments.length; e++) { + var t = arguments[e]; + for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } - return target; - }; - return extends_extends.apply(this, arguments); + return n; + }, extends_extends.apply(null, arguments); } + ;// ./node_modules/history/index.js @@ -849,101 +1529,241 @@ function parsePath(path) { +;// external ["wp","element"] +const external_wp_element_namespaceObject = window["wp"]["element"]; ;// external ["wp","url"] const external_wp_url_namespaceObject = window["wp"]["url"]; -;// ./node_modules/@wordpress/router/build-module/history.js +;// external ["wp","compose"] +const external_wp_compose_namespaceObject = window["wp"]["compose"]; +;// external "ReactJSXRuntime" +const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"]; +;// ./node_modules/@wordpress/router/build-module/router.js /* wp:polyfill */ /** * External dependencies */ + /** * WordPress dependencies */ -const history_history = createBrowserHistory(); -const originalHistoryPush = history_history.push; -const originalHistoryReplace = history_history.replace; -// Preserve the `wp_theme_preview` query parameter when navigating -// around the Site Editor. -// TODO: move this hack out of the router into Site Editor code. -function preserveThemePreview(params) { - if (params.hasOwnProperty('wp_theme_preview')) { - return params; - } - const currentSearch = new URLSearchParams(history_history.location.search); - const currentThemePreview = currentSearch.get('wp_theme_preview'); - if (currentThemePreview === null) { - return params; - } - return { - ...params, - wp_theme_preview: currentThemePreview - }; -} -function push(params, state) { - const search = (0,external_wp_url_namespaceObject.buildQueryString)(preserveThemePreview(params)); - return originalHistoryPush.call(history_history, { - search - }, state); -} -function replace(params, state) { - const search = (0,external_wp_url_namespaceObject.buildQueryString)(preserveThemePreview(params)); - return originalHistoryReplace.call(history_history, { - search - }, state); -} + + +/** + * Internal dependencies + */ + +const router_history = createBrowserHistory(); +const RoutesContext = (0,external_wp_element_namespaceObject.createContext)(null); +const ConfigContext = (0,external_wp_element_namespaceObject.createContext)({ + pathArg: 'p' +}); const locationMemo = new WeakMap(); -function getLocationWithParams() { - const location = history_history.location; - let locationWithParams = locationMemo.get(location); - if (!locationWithParams) { - locationWithParams = { +function getLocationWithQuery() { + const location = router_history.location; + let locationWithQuery = locationMemo.get(location); + if (!locationWithQuery) { + locationWithQuery = { ...location, - params: Object.fromEntries(new URLSearchParams(location.search)) + query: Object.fromEntries(new URLSearchParams(location.search)) }; - locationMemo.set(location, locationWithParams); + locationMemo.set(location, locationWithQuery); } - return locationWithParams; + return locationWithQuery; } -history_history.push = push; -history_history.replace = replace; -history_history.getLocationWithParams = getLocationWithParams; -/* harmony default export */ const build_module_history = (history_history); +function useLocation() { + const context = (0,external_wp_element_namespaceObject.useContext)(RoutesContext); + if (!context) { + throw new Error('useLocation must be used within a RouterProvider'); + } + return context; +} +function useHistory() { + const { + pathArg, + beforeNavigate + } = (0,external_wp_element_namespaceObject.useContext)(ConfigContext); + const navigate = (0,external_wp_compose_namespaceObject.useEvent)(async (rawPath, options = {}) => { + var _getPath; + const query = (0,external_wp_url_namespaceObject.getQueryArgs)(rawPath); + const path = (_getPath = (0,external_wp_url_namespaceObject.getPath)('http://domain.com/' + rawPath)) !== null && _getPath !== void 0 ? _getPath : ''; + const performPush = () => { + const result = beforeNavigate ? beforeNavigate({ + path, + query + }) : { + path, + query + }; + return router_history.push({ + search: (0,external_wp_url_namespaceObject.buildQueryString)({ + [pathArg]: result.path, + ...result.query + }) + }, options.state); + }; -;// external "ReactJSXRuntime" -const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"]; -;// ./node_modules/@wordpress/router/build-module/router.js + /* + * Skip transition in mobile, otherwise it crashes the browser. + * See: https://github.com/WordPress/gutenberg/pull/63002. + */ + const isMediumOrBigger = window.matchMedia('(min-width: 782px)').matches; + if (!isMediumOrBigger || !document.startViewTransition || !options.transition) { + performPush(); + return; + } + await new Promise(resolve => { + var _options$transition; + const classname = (_options$transition = options.transition) !== null && _options$transition !== void 0 ? _options$transition : ''; + document.documentElement.classList.add(classname); + const transition = document.startViewTransition(() => performPush()); + transition.finished.finally(() => { + document.documentElement.classList.remove(classname); + resolve(); + }); + }); + }); + return (0,external_wp_element_namespaceObject.useMemo)(() => ({ + navigate, + back: router_history.back + }), [navigate]); +} +function useMatch(location, matcher, pathArg) { + const { + query: rawQuery = {} + } = location; + return (0,external_wp_element_namespaceObject.useMemo)(() => { + const { + [pathArg]: path = '/', + ...query + } = rawQuery; + const result = matcher.recognize(path)?.[0]; + if (!result) { + return { + name: '404', + path: (0,external_wp_url_namespaceObject.addQueryArgs)(path, query), + areas: {}, + widths: {}, + query, + params: {} + }; + } + const matchedRoute = result.handler; + const resolveFunctions = (record = {}) => { + return Object.fromEntries(Object.entries(record).map(([key, value]) => { + if (typeof value === 'function') { + return [key, value({ + query, + params: result.params + })]; + } + return [key, value]; + })); + }; + return { + name: matchedRoute.name, + areas: resolveFunctions(matchedRoute.areas), + widths: resolveFunctions(matchedRoute.widths), + params: result.params, + query, + path: (0,external_wp_url_namespaceObject.addQueryArgs)(path, query) + }; + }, [matcher, rawQuery, pathArg]); +} +function RouterProvider({ + routes, + pathArg, + beforeNavigate, + children +}) { + const location = (0,external_wp_element_namespaceObject.useSyncExternalStore)(router_history.listen, getLocationWithQuery, getLocationWithQuery); + const matcher = (0,external_wp_element_namespaceObject.useMemo)(() => { + const ret = new route_recognizer_es(); + routes.forEach(route => { + ret.add([{ + path: route.path, + handler: route + }], { + as: route.name + }); + }); + return ret; + }, [routes]); + const match = useMatch(location, matcher, pathArg); + const config = (0,external_wp_element_namespaceObject.useMemo)(() => ({ + beforeNavigate, + pathArg + }), [beforeNavigate, pathArg]); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ConfigContext.Provider, { + value: config, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(RoutesContext.Provider, { + value: match, + children: children + }) + }); +} + +;// ./node_modules/@wordpress/router/build-module/link.js /** * WordPress dependencies */ + /** * Internal dependencies */ -const RoutesContext = (0,external_wp_element_namespaceObject.createContext)(); -const HistoryContext = (0,external_wp_element_namespaceObject.createContext)(); -function useLocation() { - return (0,external_wp_element_namespaceObject.useContext)(RoutesContext); +function useLink(to, options = {}) { + var _getPath; + const history = useHistory(); + const { + pathArg, + beforeNavigate + } = (0,external_wp_element_namespaceObject.useContext)(ConfigContext); + function onClick(event) { + event?.preventDefault(); + history.navigate(to, options); + } + const query = (0,external_wp_url_namespaceObject.getQueryArgs)(to); + const path = (_getPath = (0,external_wp_url_namespaceObject.getPath)('http://domain.com/' + to)) !== null && _getPath !== void 0 ? _getPath : ''; + const link = (0,external_wp_element_namespaceObject.useMemo)(() => { + return beforeNavigate ? beforeNavigate({ + path, + query + }) : { + path, + query + }; + }, [path, query, beforeNavigate]); + const [before] = window.location.href.split('?'); + return { + href: `${before}?${(0,external_wp_url_namespaceObject.buildQueryString)({ + [pathArg]: link.path, + ...link.query + })}`, + onClick + }; } -function useHistory() { - return (0,external_wp_element_namespaceObject.useContext)(HistoryContext); -} -function RouterProvider({ - children +function Link({ + to, + options, + children, + ...props }) { - const location = (0,external_wp_element_namespaceObject.useSyncExternalStore)(build_module_history.listen, build_module_history.getLocationWithParams, build_module_history.getLocationWithParams); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(HistoryContext.Provider, { - value: build_module_history, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(RoutesContext.Provider, { - value: location, - children: children - }) + const { + href, + onClick + } = useLink(to, options); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { + href: href, + onClick: onClick, + ...props, + children: children }); } @@ -965,11 +1785,14 @@ const { */ + const privateApis = {}; lock(privateApis, { useHistory: useHistory, useLocation: useLocation, - RouterProvider: RouterProvider + RouterProvider: RouterProvider, + useLink: useLink, + Link: Link }); ;// ./node_modules/@wordpress/router/build-module/index.js diff --git a/wp-includes/js/dist/router.min.js b/wp-includes/js/dist/router.min.js index 82c226c716..5d295d804d 100644 --- a/wp-includes/js/dist/router.min.js +++ b/wp-includes/js/dist/router.min.js @@ -1,2 +1,2 @@ /*! This file is auto-generated */ -(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{privateApis:()=>j});const n=window.wp.element;function r(){return r=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0&&(e.hash=t.substr(n),t=t.substr(0,n));var r=t.indexOf("?");r>=0&&(e.search=t.substr(r),t=t.substr(0,r)),t&&(e.pathname=t)}return e}const p=window.wp.url,d=function(t){void 0===t&&(t={});var e=t.window,n=void 0===e?document.defaultView:e,p=n.history;function d(){var t=n.location,e=t.pathname,r=t.search,o=t.hash,i=p.state||{};return[i.idx,a({pathname:e,search:r,hash:o,state:i.usr||null,key:i.key||"default"})]}var v=null;n.addEventListener(u,(function(){if(v)P.call(v),v=null;else{var t=o.Pop,e=d(),n=e[0],r=e[1];if(P.length){if(null!=n){var a=y-n;a&&(v={action:t,location:r,retry:function(){L(-1*a)}},L(a))}}else j(t)}}));var w=o.Pop,g=d(),y=g[0],m=g[1],b=s(),P=s();function S(t){return"string"==typeof t?t:f(t)}function O(t,e){return void 0===e&&(e=null),a(r({pathname:m.pathname,hash:"",search:""},"string"==typeof t?h(t):t,{state:e,key:l()}))}function x(t,e){return[{usr:t.state,key:t.key,idx:e},S(t)]}function k(t,e,n){return!P.length||(P.call({action:t,location:e,retry:n}),!1)}function j(t){w=t;var e=d();y=e[0],m=e[1],b.call({action:w,location:m})}function L(t){p.go(t)}null==y&&(y=0,p.replaceState(r({},p.state,{idx:y}),""));var _={get action(){return w},get location(){return m},createHref:S,push:function t(e,r){var a=o.Push,i=O(e,r);if(k(a,i,(function(){t(e,r)}))){var u=x(i,y+1),c=u[0],s=u[1];try{p.pushState(c,"",s)}catch(t){n.location.assign(s)}j(a)}},replace:function t(e,n){var r=o.Replace,a=O(e,n);if(k(r,a,(function(){t(e,n)}))){var i=x(a,y),u=i[0],c=i[1];p.replaceState(u,"",c),j(r)}},go:L,back:function(){L(-1)},forward:function(){L(1)},listen:function(t){return b.push(t)},block:function(t){var e=P.push(t);return 1===P.length&&n.addEventListener(i,c),function(){e(),P.length||n.removeEventListener(i,c)}}};return _}(),v=d.push,w=d.replace;function g(t){if(t.hasOwnProperty("wp_theme_preview"))return t;const e=new URLSearchParams(d.location.search).get("wp_theme_preview");return null===e?t:{...t,wp_theme_preview:e}}const y=new WeakMap;d.push=function(t,e){const n=(0,p.buildQueryString)(g(t));return v.call(d,{search:n},e)},d.replace=function(t,e){const n=(0,p.buildQueryString)(g(t));return w.call(d,{search:n},e)},d.getLocationWithParams=function(){const t=d.location;let e=y.get(t);return e||(e={...t,params:Object.fromEntries(new URLSearchParams(t.search))},y.set(t,e)),e};const m=d,b=window.ReactJSXRuntime,P=(0,n.createContext)(),S=(0,n.createContext)();const O=window.wp.privateApis,{lock:x,unlock:k}=(0,O.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/router"),j={};x(j,{useHistory:function(){return(0,n.useContext)(S)},useLocation:function(){return(0,n.useContext)(P)},RouterProvider:function({children:t}){const e=(0,n.useSyncExternalStore)(m.listen,m.getLocationWithParams,m.getLocationWithParams);return(0,b.jsx)(S.Provider,{value:m,children:(0,b.jsx)(P.Provider,{value:e,children:t})})}}),(window.wp=window.wp||{}).router=e})(); \ No newline at end of file +(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{privateApis:()=>rt});var r=Object.create;function n(){var t=r(null);return t.__=void 0,delete t.__,t}var a=function(t,e,r){this.path=t,this.matcher=e,this.delegate=r};a.prototype.to=function(t,e){var r=this.delegate;if(r&&r.willAddRoute&&(t=r.willAddRoute(this.matcher.target,t)),this.matcher.add(this.path,t),e){if(0===e.length)throw new Error("You must have an argument in the function passed to `to`");this.matcher.addChild(this.path,t,e,this.delegate)}};var o=function(t){this.routes=n(),this.children=n(),this.target=t};function i(t,e,r){return function(n,o){var s=t+n;if(!o)return new a(s,e,r);o(i(s,e,r))}}function s(t,e,r){for(var n=0,a=0;a0&&47===e.charCodeAt(0)&&(e=e.substr(1));for(var n=e.split("/"),a=void 0,o=void 0,i=0;i2&&"[]"===o.slice(i-2)&&(s=!0,r[o=o.slice(0,i-2)]||(r[o]=[])),u=a[1]?D(a[1]):""),s?r[o].push(u):r[o]=u}return r},R.prototype.recognize=function(t){var e,r=[this.rootState],n={},a=!1,o=t.indexOf("#");-1!==o&&(t=t.substr(0,o));var i=t.indexOf("?");if(-1!==i){var s=t.substr(i+1,t.length);t=t.substr(0,i),n=this.parseQueryString(s)}"/"!==t.charAt(0)&&(t="/"+t);var u=t;R.ENCODE_AND_DECODE_PATH_SEGMENTS?t=c(t):(t=decodeURI(t),u=decodeURI(u));var h=t.length;h>1&&"/"===t.charAt(h-1)&&(t=t.substr(0,h-1),u=u.substr(0,u.length-1),a=!0);for(var l=0;l=0&&(e.hash=t.substr(r),t=t.substr(0,r));var n=t.indexOf("?");n>=0&&(e.search=t.substr(n),t=t.substr(0,n)),t&&(e.pathname=t)}return e}const H=window.wp.element,V=window.wp.url,$=window.wp.compose,G=window.ReactJSXRuntime,Y=function(t){void 0===t&&(t={});var e=t.window,r=void 0===e?document.defaultView:e,n=r.history;function a(){var t=r.location,e=t.pathname,a=t.search,o=t.hash,i=n.state||{};return[i.idx,I({pathname:e,search:a,hash:o,state:i.usr||null,key:i.key||"default"})]}var o=null;r.addEventListener(T,(function(){if(o)l.call(o),o=null;else{var t=N.Pop,e=a(),r=e[0],n=e[1];if(l.length){if(null!=r){var i=u-r;i&&(o={action:t,location:n,retry:function(){m(-1*i)}},m(i))}}else g(t)}}));var i=N.Pop,s=a(),u=s[0],c=s[1],h=U(),l=U();function p(t){return"string"==typeof t?t:Q(t)}function f(t,e){return void 0===e&&(e=null),I(k({pathname:c.pathname,hash:"",search:""},"string"==typeof t?z(t):t,{state:e,key:L()}))}function d(t,e){return[{usr:t.state,key:t.key,idx:e},p(t)]}function v(t,e,r){return!l.length||(l.call({action:t,location:e,retry:r}),!1)}function g(t){i=t;var e=a();u=e[0],c=e[1],h.call({action:i,location:c})}function m(t){n.go(t)}return null==u&&(u=0,n.replaceState(k({},n.state,{idx:u}),"")),{get action(){return i},get location(){return c},createHref:p,push:function t(e,a){var o=N.Push,i=f(e,a);if(v(o,i,(function(){t(e,a)}))){var s=d(i,u+1),c=s[0],h=s[1];try{n.pushState(c,"",h)}catch(t){r.location.assign(h)}g(o)}},replace:function t(e,r){var a=N.Replace,o=f(e,r);if(v(a,o,(function(){t(e,r)}))){var i=d(o,u),s=i[0],c=i[1];n.replaceState(s,"",c),g(a)}},go:m,back:function(){m(-1)},forward:function(){m(1)},listen:function(t){return h.push(t)},block:function(t){var e=l.push(t);return 1===l.length&&r.addEventListener(M,q),function(){e(),l.length||r.removeEventListener(M,q)}}}}(),B=(0,H.createContext)(null),F=(0,H.createContext)({pathArg:"p"}),W=new WeakMap;function J(){const t=Y.location;let e=W.get(t);return e||(e={...t,query:Object.fromEntries(new URLSearchParams(t.search))},W.set(t,e)),e}function X(){const{pathArg:t,beforeNavigate:e}=(0,H.useContext)(F),r=(0,$.useEvent)((async(r,n={})=>{var a;const o=(0,V.getQueryArgs)(r),i=null!==(a=(0,V.getPath)("http://domain.com/"+r))&&void 0!==a?a:"",s=()=>{const r=e?e({path:i,query:o}):{path:i,query:o};return Y.push({search:(0,V.buildQueryString)({[t]:r.path,...r.query})},n.state)};window.matchMedia("(min-width: 782px)").matches&&document.startViewTransition&&n.transition?await new Promise((t=>{var e;const r=null!==(e=n.transition)&&void 0!==e?e:"";document.documentElement.classList.add(r);document.startViewTransition((()=>s())).finished.finally((()=>{document.documentElement.classList.remove(r),t()}))})):s()}));return(0,H.useMemo)((()=>({navigate:r,back:Y.back})),[r])}function K(t,e={}){var r;const n=X(),{pathArg:a,beforeNavigate:o}=(0,H.useContext)(F);const i=(0,V.getQueryArgs)(t),s=null!==(r=(0,V.getPath)("http://domain.com/"+t))&&void 0!==r?r:"",u=(0,H.useMemo)((()=>o?o({path:s,query:i}):{path:s,query:i}),[s,i,o]),[c]=window.location.href.split("?");return{href:`${c}?${(0,V.buildQueryString)({[a]:u.path,...u.query})}`,onClick:function(r){r?.preventDefault(),n.navigate(t,e)}}}const Z=window.wp.privateApis,{lock:tt,unlock:et}=(0,Z.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/router"),rt={};tt(rt,{useHistory:X,useLocation:function(){const t=(0,H.useContext)(B);if(!t)throw new Error("useLocation must be used within a RouterProvider");return t},RouterProvider:function({routes:t,pathArg:e,beforeNavigate:r,children:n}){const a=function(t,e,r){const{query:n={}}=t;return(0,H.useMemo)((()=>{const{[r]:t="/",...a}=n,o=e.recognize(t)?.[0];if(!o)return{name:"404",path:(0,V.addQueryArgs)(t,a),areas:{},widths:{},query:a,params:{}};const i=o.handler,s=(t={})=>Object.fromEntries(Object.entries(t).map((([t,e])=>"function"==typeof e?[t,e({query:a,params:o.params})]:[t,e])));return{name:i.name,areas:s(i.areas),widths:s(i.widths),params:o.params,query:a,path:(0,V.addQueryArgs)(t,a)}}),[e,n,r])}((0,H.useSyncExternalStore)(Y.listen,J,J),(0,H.useMemo)((()=>{const e=new j;return t.forEach((t=>{e.add([{path:t.path,handler:t}],{as:t.name})})),e}),[t]),e),o=(0,H.useMemo)((()=>({beforeNavigate:r,pathArg:e})),[r,e]);return(0,G.jsx)(F.Provider,{value:o,children:(0,G.jsx)(B.Provider,{value:a,children:n})})},useLink:K,Link:function({to:t,options:e,children:r,...n}){const{href:a,onClick:o}=K(t,e);return(0,G.jsx)("a",{href:a,onClick:o,...n,children:r})}}),(window.wp=window.wp||{}).router=e})(); \ No newline at end of file diff --git a/wp-includes/js/dist/script-modules/block-library/file/view.js b/wp-includes/js/dist/script-modules/block-library/file/view.js index c74654a883..6d887f6f50 100644 --- a/wp-includes/js/dist/script-modules/block-library/file/view.js +++ b/wp-includes/js/dist/script-modules/block-library/file/view.js @@ -42,7 +42,7 @@ const browserSupportsPdfs = () => { return false; } - // Android tablets are the noteable exception. + // Android tablets are the notable exception. if (window.navigator.userAgent.indexOf('Android') > -1) { return false; } diff --git a/wp-includes/js/dist/script-modules/block-library/form/view.js b/wp-includes/js/dist/script-modules/block-library/form/view.js new file mode 100644 index 0000000000..3d4a351790 --- /dev/null +++ b/wp-includes/js/dist/script-modules/block-library/form/view.js @@ -0,0 +1,49 @@ +var __webpack_exports__ = {}; +/* wp:polyfill */ +let formSettings; +try { + formSettings = JSON.parse(document.getElementById('wp-script-module-data-@wordpress/block-library/form/view')?.textContent); +} catch {} + +// eslint-disable-next-line eslint-comments/disable-enable-pair +/* eslint-disable no-undef */ +document.querySelectorAll('form.wp-block-form').forEach(function (form) { + // Bail If the form settings not provided or the form is not using the mailto: action. + if (!formSettings || !form.action || !form.action.startsWith('mailto:')) { + return; + } + const redirectNotification = status => { + const urlParams = new URLSearchParams(window.location.search); + urlParams.append('wp-form-result', status); + window.location.search = urlParams.toString(); + }; + + // Add an event listener for the form submission. + form.addEventListener('submit', async function (event) { + event.preventDefault(); + // Get the form data and merge it with the form action and nonce. + const formData = Object.fromEntries(new FormData(form).entries()); + formData.formAction = form.action; + formData._ajax_nonce = formSettings.nonce; + formData.action = formSettings.action; + formData._wp_http_referer = window.location.href; + formData.formAction = form.action; + try { + const response = await fetch(formSettings.ajaxUrl, { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded' + }, + body: new URLSearchParams(formData).toString() + }); + if (response.ok) { + redirectNotification('success'); + } else { + redirectNotification('error'); + } + } catch (error) { + redirectNotification('error'); + } + }); +}); + diff --git a/wp-includes/js/dist/script-modules/block-library/form/view.min.js b/wp-includes/js/dist/script-modules/block-library/form/view.min.js new file mode 100644 index 0000000000..ca19f106d9 --- /dev/null +++ b/wp-includes/js/dist/script-modules/block-library/form/view.min.js @@ -0,0 +1 @@ +let t;try{t=JSON.parse(document.getElementById("wp-script-module-data-@wordpress/block-library/form/view")?.textContent)}catch{}document.querySelectorAll("form.wp-block-form").forEach((function(o){if(!t||!o.action||!o.action.startsWith("mailto:"))return;const e=t=>{const o=new URLSearchParams(window.location.search);o.append("wp-form-result",t),window.location.search=o.toString()};o.addEventListener("submit",(async function(r){r.preventDefault();const n=Object.fromEntries(new FormData(o).entries());n.formAction=o.action,n._ajax_nonce=t.nonce,n.action=t.action,n._wp_http_referer=window.location.href,n.formAction=o.action;try{(await fetch(t.ajaxUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(n).toString()})).ok?e("success"):e("error")}catch(t){e("error")}}))})); \ No newline at end of file diff --git a/wp-includes/js/dist/script-modules/block-library/image/view.js b/wp-includes/js/dist/script-modules/block-library/image/view.js index a42cd65e12..db3d3c0f0f 100644 --- a/wp-includes/js/dist/script-modules/block-library/image/view.js +++ b/wp-includes/js/dist/script-modules/block-library/image/view.js @@ -337,7 +337,6 @@ const { // adding 1 pixel to the container width and height solves the problem, // though this can be removed if the issue is fixed in the future. state.overlayStyles = ` - :root { --wp--lightbox-initial-top-position: ${screenPosY}px; --wp--lightbox-initial-left-position: ${screenPosX}px; --wp--lightbox-container-width: ${containerWidth + 1}px; @@ -346,8 +345,7 @@ const { --wp--lightbox-image-height: ${lightboxImgHeight}px; --wp--lightbox-scale: ${containerScale}; --wp--lightbox-scrollbar-width: ${window.innerWidth - document.documentElement.clientWidth}px; - } - `; + `; }, setButtonStyles() { const { diff --git a/wp-includes/js/dist/script-modules/block-library/image/view.min.js b/wp-includes/js/dist/script-modules/block-library/image/view.min.js index aa1004f714..a43f6e245d 100644 --- a/wp-includes/js/dist/script-modules/block-library/image/view.min.js +++ b/wp-includes/js/dist/script-modules/block-library/image/view.min.js @@ -1 +1 @@ -import*as t from"@wordpress/interactivity";var e={d:(t,n)=>{for(var o in n)e.o(n,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)};const n=(t=>{var n={};return e.d(n,t),n})({getContext:()=>t.getContext,getElement:()=>t.getElement,store:()=>t.store});let o=!1,a=0;const{state:r,actions:i,callbacks:l}=(0,n.store)("core/image",{state:{currentImageId:null,get currentImage(){return r.metadata[r.currentImageId]},get overlayOpened(){return null!==r.currentImageId},get roleAttribute(){return r.overlayOpened?"dialog":null},get ariaModal(){return r.overlayOpened?"true":null},get enlargedSrc(){return r.currentImage.uploadedSrc||"data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="},get figureStyles(){return r.overlayOpened&&`${r.currentImage.figureStyles?.replace(/margin[^;]*;?/g,"")};`},get imgStyles(){return r.overlayOpened&&`${r.currentImage.imgStyles?.replace(/;$/,"")}; object-fit:cover;`},get imageButtonRight(){const{imageId:t}=(0,n.getContext)();return r.metadata[t].imageButtonRight},get imageButtonTop(){const{imageId:t}=(0,n.getContext)();return r.metadata[t].imageButtonTop},get isContentHidden(){const t=(0,n.getContext)();return r.overlayEnabled&&r.currentImageId===t.imageId},get isContentVisible(){const t=(0,n.getContext)();return!r.overlayEnabled&&r.currentImageId===t.imageId}},actions:{showLightbox(){const{imageId:t}=(0,n.getContext)();r.metadata[t].imageRef?.complete&&(r.scrollTopReset=document.documentElement.scrollTop,r.scrollLeftReset=document.documentElement.scrollLeft,r.overlayEnabled=!0,r.currentImageId=t,l.setOverlayStyles())},hideLightbox(){r.overlayEnabled&&(r.showClosingAnimation=!0,r.overlayEnabled=!1,setTimeout((function(){r.currentImage.buttonRef.focus({preventScroll:!0}),r.currentImageId=null}),450))},handleKeydown(t){if(r.overlayEnabled){if("Tab"===t.key){t.preventDefault();const{ref:e}=(0,n.getElement)();e.querySelector("button").focus()}"Escape"===t.key&&i.hideLightbox()}},handleTouchMove(t){r.overlayEnabled&&t.preventDefault()},handleTouchStart(){o=!0},handleTouchEnd(){a=Date.now(),o=!1},handleScroll(){r.overlayOpened&&!o&&Date.now()-a>450&&window.scrollTo(r.scrollLeftReset,r.scrollTopReset)}},callbacks:{setOverlayStyles(){if(!r.overlayEnabled)return;let{naturalWidth:t,naturalHeight:e,offsetWidth:n,offsetHeight:o}=r.currentImage.imageRef,{x:a,y:i}=r.currentImage.imageRef.getBoundingClientRect();const l=t/e;let g=n/o;if("contain"===r.currentImage.scaleAttr)if(l>g){const t=n/l;i+=(o-t)/2,o=t}else{const t=o*l;a+=(n-t)/2,n=t}g=n/o;let c=parseFloat("none"!==r.currentImage.targetWidth?r.currentImage.targetWidth:t),s=parseFloat("none"!==r.currentImage.targetHeight?r.currentImage.targetHeight:e),d=c/s,u=c,m=s,h=c,p=s;if(l.toFixed(2)!==d.toFixed(2)){if(l>d){const t=c/l;s-t>c?(s=t,c=t*l):s=c/l}else{const t=s*l;c-t>s?(c=t,s=t/l):c=s*l}h=c,p=s,d=c/s,g>d?(u=c,m=u/g):(m=s,u=m*g)}(n>h||o>p)&&(h=n,p=o);let f=0;window.innerWidth>480?f=80:window.innerWidth>1920&&(f=160);const y=Math.min(window.innerWidth-f,h),b=Math.min(window.innerHeight-80,p);g>y/b?(h=y,p=h/g):(p=b,h=p*g);const w=n/h,I=c*(h/u),x=s*(p/m);r.overlayStyles=`\n\t\t\t\t:root {\n\t\t\t\t\t--wp--lightbox-initial-top-position: ${i}px;\n\t\t\t\t\t--wp--lightbox-initial-left-position: ${a}px;\n\t\t\t\t\t--wp--lightbox-container-width: ${h+1}px;\n\t\t\t\t\t--wp--lightbox-container-height: ${p+1}px;\n\t\t\t\t\t--wp--lightbox-image-width: ${I}px;\n\t\t\t\t\t--wp--lightbox-image-height: ${x}px;\n\t\t\t\t\t--wp--lightbox-scale: ${w};\n\t\t\t\t\t--wp--lightbox-scrollbar-width: ${window.innerWidth-document.documentElement.clientWidth}px;\n\t\t\t\t}\n\t\t\t`},setButtonStyles(){const{imageId:t}=(0,n.getContext)(),{ref:e}=(0,n.getElement)();r.metadata[t].imageRef=e,r.metadata[t].currentSrc=e.currentSrc;const{naturalWidth:o,naturalHeight:a,offsetWidth:i,offsetHeight:l}=e;if(0===o||0===a)return;const g=e.parentElement,c=e.parentElement.clientWidth;let s=e.parentElement.clientHeight;const d=g.querySelector("figcaption");if(d){const t=window.getComputedStyle(d);["absolute","fixed"].includes(t.position)||(s=s-d.offsetHeight-parseFloat(t.marginTop)-parseFloat(t.marginBottom))}const u=s-l,m=c-i;let h=u+16,p=m+16;if("contain"===r.metadata[t].scaleAttr){const t=o/a;if(t>=i/l){h=(l-i/t)/2+u+16,p=m+16}else{h=u+16,p=(i-l*t)/2+m+16}}r.metadata[t].imageButtonTop=h,r.metadata[t].imageButtonRight=p},setOverlayFocus(){if(r.overlayEnabled){const{ref:t}=(0,n.getElement)();t.focus()}},initTriggerButton(){const{imageId:t}=(0,n.getContext)(),{ref:e}=(0,n.getElement)();r.metadata[t].buttonRef=e}}},{lock:!0}); \ No newline at end of file +import*as t from"@wordpress/interactivity";var e={d:(t,n)=>{for(var a in n)e.o(n,a)&&!e.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:n[a]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)};const n=(t=>{var n={};return e.d(n,t),n})({getContext:()=>t.getContext,getElement:()=>t.getElement,store:()=>t.store});let a=!1,o=0;const{state:r,actions:i,callbacks:l}=(0,n.store)("core/image",{state:{currentImageId:null,get currentImage(){return r.metadata[r.currentImageId]},get overlayOpened(){return null!==r.currentImageId},get roleAttribute(){return r.overlayOpened?"dialog":null},get ariaModal(){return r.overlayOpened?"true":null},get enlargedSrc(){return r.currentImage.uploadedSrc||"data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="},get figureStyles(){return r.overlayOpened&&`${r.currentImage.figureStyles?.replace(/margin[^;]*;?/g,"")};`},get imgStyles(){return r.overlayOpened&&`${r.currentImage.imgStyles?.replace(/;$/,"")}; object-fit:cover;`},get imageButtonRight(){const{imageId:t}=(0,n.getContext)();return r.metadata[t].imageButtonRight},get imageButtonTop(){const{imageId:t}=(0,n.getContext)();return r.metadata[t].imageButtonTop},get isContentHidden(){const t=(0,n.getContext)();return r.overlayEnabled&&r.currentImageId===t.imageId},get isContentVisible(){const t=(0,n.getContext)();return!r.overlayEnabled&&r.currentImageId===t.imageId}},actions:{showLightbox(){const{imageId:t}=(0,n.getContext)();r.metadata[t].imageRef?.complete&&(r.scrollTopReset=document.documentElement.scrollTop,r.scrollLeftReset=document.documentElement.scrollLeft,r.overlayEnabled=!0,r.currentImageId=t,l.setOverlayStyles())},hideLightbox(){r.overlayEnabled&&(r.showClosingAnimation=!0,r.overlayEnabled=!1,setTimeout((function(){r.currentImage.buttonRef.focus({preventScroll:!0}),r.currentImageId=null}),450))},handleKeydown(t){if(r.overlayEnabled){if("Tab"===t.key){t.preventDefault();const{ref:e}=(0,n.getElement)();e.querySelector("button").focus()}"Escape"===t.key&&i.hideLightbox()}},handleTouchMove(t){r.overlayEnabled&&t.preventDefault()},handleTouchStart(){a=!0},handleTouchEnd(){o=Date.now(),a=!1},handleScroll(){r.overlayOpened&&!a&&Date.now()-o>450&&window.scrollTo(r.scrollLeftReset,r.scrollTopReset)}},callbacks:{setOverlayStyles(){if(!r.overlayEnabled)return;let{naturalWidth:t,naturalHeight:e,offsetWidth:n,offsetHeight:a}=r.currentImage.imageRef,{x:o,y:i}=r.currentImage.imageRef.getBoundingClientRect();const l=t/e;let g=n/a;if("contain"===r.currentImage.scaleAttr)if(l>g){const t=n/l;i+=(a-t)/2,a=t}else{const t=a*l;o+=(n-t)/2,n=t}g=n/a;let c=parseFloat("none"!==r.currentImage.targetWidth?r.currentImage.targetWidth:t),s=parseFloat("none"!==r.currentImage.targetHeight?r.currentImage.targetHeight:e),d=c/s,u=c,m=s,h=c,p=s;if(l.toFixed(2)!==d.toFixed(2)){if(l>d){const t=c/l;s-t>c?(s=t,c=t*l):s=c/l}else{const t=s*l;c-t>s?(c=t,s=t/l):c=s*l}h=c,p=s,d=c/s,g>d?(u=c,m=u/g):(m=s,u=m*g)}(n>h||a>p)&&(h=n,p=a);let f=0;window.innerWidth>480?f=80:window.innerWidth>1920&&(f=160);const y=Math.min(window.innerWidth-f,h),b=Math.min(window.innerHeight-80,p);g>y/b?(h=y,p=h/g):(p=b,h=p*g);const w=n/h,I=c*(h/u),x=s*(p/m);r.overlayStyles=`\n\t\t\t\t\t--wp--lightbox-initial-top-position: ${i}px;\n\t\t\t\t\t--wp--lightbox-initial-left-position: ${o}px;\n\t\t\t\t\t--wp--lightbox-container-width: ${h+1}px;\n\t\t\t\t\t--wp--lightbox-container-height: ${p+1}px;\n\t\t\t\t\t--wp--lightbox-image-width: ${I}px;\n\t\t\t\t\t--wp--lightbox-image-height: ${x}px;\n\t\t\t\t\t--wp--lightbox-scale: ${w};\n\t\t\t\t\t--wp--lightbox-scrollbar-width: ${window.innerWidth-document.documentElement.clientWidth}px;\n\t\t\t\t`},setButtonStyles(){const{imageId:t}=(0,n.getContext)(),{ref:e}=(0,n.getElement)();r.metadata[t].imageRef=e,r.metadata[t].currentSrc=e.currentSrc;const{naturalWidth:a,naturalHeight:o,offsetWidth:i,offsetHeight:l}=e;if(0===a||0===o)return;const g=e.parentElement,c=e.parentElement.clientWidth;let s=e.parentElement.clientHeight;const d=g.querySelector("figcaption");if(d){const t=window.getComputedStyle(d);["absolute","fixed"].includes(t.position)||(s=s-d.offsetHeight-parseFloat(t.marginTop)-parseFloat(t.marginBottom))}const u=s-l,m=c-i;let h=u+16,p=m+16;if("contain"===r.metadata[t].scaleAttr){const t=a/o;if(t>=i/l){h=(l-i/t)/2+u+16,p=m+16}else{h=u+16,p=(i-l*t)/2+m+16}}r.metadata[t].imageButtonTop=h,r.metadata[t].imageButtonRight=p},setOverlayFocus(){if(r.overlayEnabled){const{ref:t}=(0,n.getElement)();t.focus()}},initTriggerButton(){const{imageId:t}=(0,n.getContext)(),{ref:e}=(0,n.getElement)();r.metadata[t].buttonRef=e}}},{lock:!0}); \ No newline at end of file diff --git a/wp-includes/js/dist/script-modules/block-library/navigation/view.js b/wp-includes/js/dist/script-modules/block-library/navigation/view.js index 030e5328e4..8812f6735a 100644 --- a/wp-includes/js/dist/script-modules/block-library/navigation/view.js +++ b/wp-includes/js/dist/script-modules/block-library/navigation/view.js @@ -30,6 +30,7 @@ var x = (y) => { var y = (x) => (() => (x)) const interactivity_namespaceObject = x({ ["getContext"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.getContext), ["getElement"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.getElement), ["store"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.store) }); ;// ./node_modules/@wordpress/block-library/build-module/navigation/view.js +/* wp:polyfill */ /** * WordPress dependencies */ diff --git a/wp-includes/js/dist/script-modules/interactivity-router/index.js b/wp-includes/js/dist/script-modules/interactivity-router/index.js index 6053555ab8..3004913caa 100644 --- a/wp-includes/js/dist/script-modules/interactivity-router/index.js +++ b/wp-includes/js/dist/script-modules/interactivity-router/index.js @@ -67,6 +67,67 @@ var x = (y) => { } var y = (x) => (() => (x)) const interactivity_namespaceObject = x({ ["getConfig"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.getConfig), ["privateApis"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.privateApis), ["store"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.store) }); +;// ./node_modules/@wordpress/interactivity-router/build-module/assets/styles.js +/* wp:polyfill */ +const cssUrlRegEx = /url\(\s*(?:(["'])((?:\\.|[^\n\\"'])+)\1|((?:\\.|[^\s,"'()\\])+))\s*\)/g; +const resolveUrl = (relativeUrl, baseUrl) => { + try { + return new URL(relativeUrl, baseUrl).toString(); + } catch (e) { + return relativeUrl; + } +}; +const withAbsoluteUrls = (cssText, baseUrl) => cssText.replace(cssUrlRegEx, (_match, quotes = '', relUrl1, relUrl2) => `url(${quotes}${resolveUrl(relUrl1 || relUrl2, baseUrl)}${quotes})`); +const styleSheetCache = new Map(); +const getCachedSheet = async (sheetId, factory) => { + if (!styleSheetCache.has(sheetId)) { + styleSheetCache.set(sheetId, factory()); + } + return styleSheetCache.get(sheetId); +}; +const sheetFromLink = async ({ + id, + href, + sheet: elementSheet +}, baseUrl) => { + const sheetId = id || href; + const sheetUrl = resolveUrl(href, baseUrl); + if (elementSheet) { + return getCachedSheet(sheetId, () => { + const sheet = new CSSStyleSheet(); + for (const { + cssText + } of elementSheet.cssRules) { + sheet.insertRule(withAbsoluteUrls(cssText, sheetUrl)); + } + return Promise.resolve(sheet); + }); + } + return getCachedSheet(sheetId, async () => { + const response = await fetch(href); + const text = await response.text(); + const sheet = new CSSStyleSheet(); + await sheet.replace(withAbsoluteUrls(text, sheetUrl)); + return sheet; + }); +}; +const sheetFromStyle = async ({ + textContent +}) => { + const sheetId = textContent; + return getCachedSheet(sheetId, async () => { + const sheet = new CSSStyleSheet(); + await sheet.replace(textContent); + return sheet; + }); +}; +const generateCSSStyleSheets = (doc, baseUrl = (doc.location || window.location).href) => [...doc.querySelectorAll('style,link[rel=stylesheet]')].map(element => { + if ('LINK' === element.nodeName) { + return sheetFromLink(element, baseUrl); + } + return sheetFromStyle(element); +}); + ;// ./node_modules/@wordpress/interactivity-router/build-module/index.js var _getConfig$navigation; /** @@ -93,7 +154,6 @@ const navigationMode = (_getConfig$navigation = (0,interactivity_namespaceObject // The cache of visited and prefetched pages, stylesheets and scripts. const pages = new Map(); -const headElements = new Map(); // Helper to remove domain and hash from the URL. We are only interesting in // caching the path and the query. @@ -115,7 +175,9 @@ const fetchPage = async (url, { html = await res.text(); } const dom = new window.DOMParser().parseFromString(html, 'text/html'); - return regionsToVdom(dom); + return regionsToVdom(dom, { + baseUrl: url + }); } catch (e) { return false; } @@ -123,13 +185,15 @@ const fetchPage = async (url, { // Return an object with VDOM trees of those HTML regions marked with a // `router-region` directive. -const regionsToVdom = async (dom, { - vdom +const regionsToVdom = (dom, { + vdom, + baseUrl } = {}) => { const regions = { body: undefined }; - let head; + const styles = generateCSSStyleSheets(dom, baseUrl); + const scriptModules = [...dom.querySelectorAll('script[type=module][src]')].map(s => s.src); if (false) {} if (navigationMode === 'regionBased') { const attrName = `data-${directivePrefix}-router-region`; @@ -142,29 +206,36 @@ const regionsToVdom = async (dom, { const initialData = parseServerData(dom); return { regions, - head, + styles, + scriptModules, title, initialData }; }; // Render all interactive regions contained in the given page. -const renderRegions = page => { - batch(() => { - if (false) {} - if (navigationMode === 'regionBased') { +const renderRegions = async page => { + // Wait for styles and modules to be ready. + await Promise.all([...page.styles, ...page.scriptModules.map(src => import(/* webpackIgnore: true */src))]); + // Replace style sheets. + const sheets = await Promise.all(page.styles); + window.document.querySelectorAll('style,link[rel=stylesheet]').forEach(element => element.remove()); + window.document.adoptedStyleSheets = sheets; + if (false) {} + if (navigationMode === 'regionBased') { + const attrName = `data-${directivePrefix}-router-region`; + batch(() => { populateServerData(page.initialData); - const attrName = `data-${directivePrefix}-router-region`; document.querySelectorAll(`[${attrName}]`).forEach(region => { const id = region.getAttribute(attrName); const fragment = getRegionRootFragment(region); render(page.regions[id], fragment); }); - } - if (page.title) { - document.title = page.title; - } - }); + }); + } + if (page.title) { + document.title = page.title; + } }; /** @@ -188,7 +259,7 @@ window.addEventListener('popstate', async () => { const pagePath = getPagePath(window.location.href); // Remove hash. const page = pages.has(pagePath) && (await pages.get(pagePath)); if (page) { - renderRegions(page); + await renderRegions(page); // Update the URL in the state. state.url = window.location.href; } else { @@ -199,9 +270,9 @@ window.addEventListener('popstate', async () => { // Initialize the router and cache the initial page using the initial vDOM. // Once this code is tested and more mature, the head should be updated for // region based navigation as well. -if (false) {} pages.set(getPagePath(window.location.href), Promise.resolve(regionsToVdom(document, { - vdom: initialVdom + vdom: initialVdom, + baseUrl: window.location.href }))); // Check if the link is valid for client-side navigation. @@ -232,6 +303,7 @@ const { state: { url: window.location.href, navigation: { + isLoading: false, hasStarted: false, hasFinished: false } @@ -240,7 +312,7 @@ const { /** * Navigates to the specified page. * - * This function normalizes the passed href, fetchs the page HTML if + * This function normalizes the passed href, fetches the page HTML if * needed, and updates any interactive regions whose contents have * changed. It also creates a new entry in the browser session history. * @@ -283,6 +355,7 @@ const { if (navigatingTo !== href) { return; } + navigation.isLoading = true; if (loadingAnimation) { navigation.hasStarted = true; navigation.hasFinished = false; @@ -311,6 +384,7 @@ const { // Update the navigation status once the the new page rendering // has been completed. + navigation.isLoading = false; if (loadingAnimation) { navigation.hasStarted = false; navigation.hasFinished = true; @@ -331,7 +405,7 @@ const { } }, /** - * Prefetchs the page with the passed URL. + * Prefetches the page with the passed URL. * * The function normalizes the URL and stores internally the fetch * promise, to avoid triggering a second fetch for an ongoing request. diff --git a/wp-includes/js/dist/script-modules/interactivity-router/index.min.js b/wp-includes/js/dist/script-modules/interactivity-router/index.min.js index a157c06f6c..c589aa0943 100644 --- a/wp-includes/js/dist/script-modules/interactivity-router/index.min.js +++ b/wp-includes/js/dist/script-modules/interactivity-router/index.min.js @@ -1 +1 @@ -import*as e from"@wordpress/interactivity";var t={317:e=>{e.exports=import("@wordpress/a11y")}},o={};function i(e){var n=o[e];if(void 0!==n)return n.exports;var a=o[e]={exports:{}};return t[e](a,a.exports,i),a.exports}i.d=(e,t)=>{for(var o in t)i.o(t,o)&&!i.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var n={};i.d(n,{o:()=>D,w:()=>A});const a=(e=>{var t={};return i.d(t,e),t})({getConfig:()=>e.getConfig,privateApis:()=>e.privateApis,store:()=>e.store});var r;const{directivePrefix:s,getRegionRootFragment:d,initialVdom:l,toVdom:c,render:g,parseServerData:p,populateServerData:u,batch:w}=(0,a.privateApis)("I acknowledge that using private APIs means my theme or plugin will inevitably break in the next version of WordPress."),h=null!==(r=(0,a.getConfig)("core/router").navigationMode)&&void 0!==r?r:"regionBased",f=new Map,v=(new Map,e=>{const t=new URL(e,window.location.href);return t.pathname+t.search}),m=async(e,{vdom:t}={})=>{const o={body:void 0};if("regionBased"===h){const i=`data-${s}-router-region`;e.querySelectorAll(`[${i}]`).forEach((e=>{const n=e.getAttribute(i);o[n]=t?.has(e)?t.get(e):c(e)}))}const i=e.querySelector("title")?.innerText,n=p(e);return{regions:o,head:undefined,title:i,initialData:n}},y=e=>{w((()=>{if("regionBased"===h){u(e.initialData);const t=`data-${s}-router-region`;document.querySelectorAll(`[${t}]`).forEach((o=>{const i=o.getAttribute(t),n=d(o);g(e.regions[i],n)}))}e.title&&(document.title=e.title)}))},x=e=>(window.location.assign(e),new Promise((()=>{})));window.addEventListener("popstate",(async()=>{const e=v(window.location.href),t=f.has(e)&&await f.get(e);t?(y(t),A.url=window.location.href):window.location.reload()})),f.set(v(window.location.href),Promise.resolve(m(document,{vdom:l})));let b="",S=!1;const P={loading:"Loading page, please wait.",loaded:"Page Loaded."},{state:A,actions:D}=(0,a.store)("core/router",{state:{url:window.location.href,navigation:{hasStarted:!1,hasFinished:!1}},actions:{*navigate(e,t={}){const{clientNavigationDisabled:o}=(0,a.getConfig)();o&&(yield x(e));const i=v(e),{navigation:n}=A,{loadingAnimation:r=!0,screenReaderAnnouncement:s=!0,timeout:d=1e4}=t;b=e,D.prefetch(i,t);const l=new Promise((e=>setTimeout(e,d))),c=setTimeout((()=>{b===e&&(r&&(n.hasStarted=!0,n.hasFinished=!1),s&&C("loading"))}),400),g=yield Promise.race([f.get(i),l]);if(clearTimeout(c),b===e)if(g&&!g.initialData?.config?.["core/router"]?.clientNavigationDisabled){yield y(g),window.history[t.replace?"replaceState":"pushState"]({},"",e),A.url=e,r&&(n.hasStarted=!1,n.hasFinished=!0),s&&C("loaded");const{hash:o}=new URL(e,window.location.href);o&&document.querySelector(o)?.scrollIntoView()}else yield x(e)},prefetch(e,t={}){const{clientNavigationDisabled:o}=(0,a.getConfig)();if(o)return;const i=v(e);!t.force&&f.has(i)||f.set(i,(async(e,{html:t})=>{try{if(!t){const o=await window.fetch(e);if(200!==o.status)return!1;t=await o.text()}const o=(new window.DOMParser).parseFromString(t,"text/html");return m(o)}catch(e){return!1}})(i,{html:t.html}))}}});function C(e){if(!S){S=!0;const e=document.getElementById("wp-script-module-data-@wordpress/interactivity-router")?.textContent;if(e)try{const t=JSON.parse(e);"string"==typeof t?.i18n?.loading&&(P.loading=t.i18n.loading),"string"==typeof t?.i18n?.loaded&&(P.loaded=t.i18n.loaded)}catch{}else A.navigation.texts?.loading&&(P.loading=A.navigation.texts.loading),A.navigation.texts?.loaded&&(P.loaded=A.navigation.texts.loaded)}const t=P[e];Promise.resolve().then(i.bind(i,317)).then((({speak:e})=>e(t)),(()=>{}))}var F=n.o,L=n.w;export{F as actions,L as state}; \ No newline at end of file +import*as e from"@wordpress/interactivity";var t={317:e=>{e.exports=import("@wordpress/a11y")}},o={};function n(e){var i=o[e];if(void 0!==i)return i.exports;var a=o[e]={exports:{}};return t[e](a,a.exports,n),a.exports}n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var i={};n.d(i,{o:()=>M,w:()=>$});const a=(e=>{var t={};return n.d(t,e),t})({getConfig:()=>e.getConfig,privateApis:()=>e.privateApis,store:()=>e.store}),r=/url\(\s*(?:(["'])((?:\\.|[^\n\\"'])+)\1|((?:\\.|[^\s,"'()\\])+))\s*\)/g,s=(e,t)=>{try{return new URL(e,t).toString()}catch(t){return e}},l=(e,t)=>e.replace(r,((e,o="",n,i)=>`url(${o}${s(n||i,t)}${o})`)),c=new Map,d=async(e,t)=>(c.has(e)||c.set(e,t()),c.get(e)),g=(e,t=(e.location||window.location).href)=>[...e.querySelectorAll("style,link[rel=stylesheet]")].map((e=>"LINK"===e.nodeName?(async({id:e,href:t,sheet:o},n)=>{const i=e||t,a=s(t,n);return d(i,o?()=>{const e=new CSSStyleSheet;for(const{cssText:t}of o.cssRules)e.insertRule(l(t,a));return Promise.resolve(e)}:async()=>{const e=await fetch(t),o=await e.text(),n=new CSSStyleSheet;return await n.replace(l(o,a)),n})})(e,t):(async({textContent:e})=>d(e,(async()=>{const t=new CSSStyleSheet;return await t.replace(e),t})))(e)));var w;const{directivePrefix:u,getRegionRootFragment:p,initialVdom:h,toVdom:m,render:y,parseServerData:f,populateServerData:v,batch:S}=(0,a.privateApis)("I acknowledge that using private APIs means my theme or plugin will inevitably break in the next version of WordPress."),x=null!==(w=(0,a.getConfig)("core/router").navigationMode)&&void 0!==w?w:"regionBased",b=new Map,P=e=>{const t=new URL(e,window.location.href);return t.pathname+t.search},A=(e,{vdom:t,baseUrl:o}={})=>{const n={body:void 0},i=g(e,o),a=[...e.querySelectorAll("script[type=module][src]")].map((e=>e.src));if("regionBased"===x){const o=`data-${u}-router-region`;e.querySelectorAll(`[${o}]`).forEach((e=>{const i=e.getAttribute(o);n[i]=t?.has(e)?t.get(e):m(e)}))}const r=e.querySelector("title")?.innerText,s=f(e);return{regions:n,styles:i,scriptModules:a,title:r,initialData:s}},C=async e=>{await Promise.all([...e.styles,...e.scriptModules.map((e=>import(e)))]);const t=await Promise.all(e.styles);if(window.document.querySelectorAll("style,link[rel=stylesheet]").forEach((e=>e.remove())),window.document.adoptedStyleSheets=t,"regionBased"===x){const t=`data-${u}-router-region`;S((()=>{v(e.initialData),document.querySelectorAll(`[${t}]`).forEach((o=>{const n=o.getAttribute(t),i=p(o);y(e.regions[n],i)}))}))}e.title&&(document.title=e.title)},L=e=>(window.location.assign(e),new Promise((()=>{})));window.addEventListener("popstate",(async()=>{const e=P(window.location.href),t=b.has(e)&&await b.get(e);t?(await C(t),$.url=window.location.href):window.location.reload()})),b.set(P(window.location.href),Promise.resolve(A(document,{vdom:h,baseUrl:window.location.href})));let D="",R=!1;const q={loading:"Loading page, please wait.",loaded:"Page Loaded."},{state:$,actions:M}=(0,a.store)("core/router",{state:{url:window.location.href,navigation:{isLoading:!1,hasStarted:!1,hasFinished:!1}},actions:{*navigate(e,t={}){const{clientNavigationDisabled:o}=(0,a.getConfig)();o&&(yield L(e));const n=P(e),{navigation:i}=$,{loadingAnimation:r=!0,screenReaderAnnouncement:s=!0,timeout:l=1e4}=t;D=e,M.prefetch(n,t);const c=new Promise((e=>setTimeout(e,l))),d=setTimeout((()=>{D===e&&(i.isLoading=!0,r&&(i.hasStarted=!0,i.hasFinished=!1),s&&N("loading"))}),400),g=yield Promise.race([b.get(n),c]);if(clearTimeout(d),D===e)if(g&&!g.initialData?.config?.["core/router"]?.clientNavigationDisabled){yield C(g),window.history[t.replace?"replaceState":"pushState"]({},"",e),$.url=e,i.isLoading=!1,r&&(i.hasStarted=!1,i.hasFinished=!0),s&&N("loaded");const{hash:o}=new URL(e,window.location.href);o&&document.querySelector(o)?.scrollIntoView()}else yield L(e)},prefetch(e,t={}){const{clientNavigationDisabled:o}=(0,a.getConfig)();if(o)return;const n=P(e);!t.force&&b.has(n)||b.set(n,(async(e,{html:t})=>{try{if(!t){const o=await window.fetch(e);if(200!==o.status)return!1;t=await o.text()}const o=(new window.DOMParser).parseFromString(t,"text/html");return A(o,{baseUrl:e})}catch(e){return!1}})(n,{html:t.html}))}}});function N(e){if(!R){R=!0;const e=document.getElementById("wp-script-module-data-@wordpress/interactivity-router")?.textContent;if(e)try{const t=JSON.parse(e);"string"==typeof t?.i18n?.loading&&(q.loading=t.i18n.loading),"string"==typeof t?.i18n?.loaded&&(q.loaded=t.i18n.loaded)}catch{}else $.navigation.texts?.loading&&(q.loading=$.navigation.texts.loading),$.navigation.texts?.loaded&&(q.loaded=$.navigation.texts.loaded)}const t=q[e];Promise.resolve().then(n.bind(n,317)).then((({speak:e})=>e(t)),(()=>{}))}var U=i.o,k=i.w;export{U as actions,k as state}; \ No newline at end of file diff --git a/wp-includes/js/dist/script-modules/interactivity/debug.js b/wp-includes/js/dist/script-modules/interactivity/debug.js index 547c5e04d9..a9bfca81d8 100644 --- a/wp-includes/js/dist/script-modules/interactivity/debug.js +++ b/wp-includes/js/dist/script-modules/interactivity/debug.js @@ -28,12 +28,12 @@ __webpack_require__.d(__webpack_exports__, { // EXTERNAL MODULE: ./node_modules/preact/dist/preact.module.js var preact_module = __webpack_require__(622); ;// ./node_modules/preact/hooks/dist/hooks.module.js -var hooks_module_t,r,hooks_module_u,i,hooks_module_o=0,hooks_module_f=[],hooks_module_c=preact_module/* options */.fF,e=hooks_module_c.__b,a=hooks_module_c.__r,v=hooks_module_c.diffed,l=hooks_module_c.__c,m=hooks_module_c.unmount,s=hooks_module_c.__;function d(n,t){hooks_module_c.__h&&hooks_module_c.__h(r,n,hooks_module_o||t),hooks_module_o=0;var u=r.__H||(r.__H={__:[],__h:[]});return n>=u.__.length&&u.__.push({}),u.__[n]}function h(n){return hooks_module_o=1,p(D,n)}function p(n,u,i){var o=d(hooks_module_t++,2);if(o.t=n,!o.__c&&(o.__=[i?i(u):D(void 0,u),function(n){var t=o.__N?o.__N[0]:o.__[0],r=o.t(t,n);t!==r&&(o.__N=[r,o.__[1]],o.__c.setState({}))}],o.__c=r,!r.u)){var f=function(n,t,r){if(!o.__c.__H)return!0;var u=o.__c.__H.__.filter(function(n){return!!n.__c});if(u.every(function(n){return!n.__N}))return!c||c.call(this,n,t,r);var i=!1;return u.forEach(function(n){if(n.__N){var t=n.__[0];n.__=n.__N,n.__N=void 0,t!==n.__[0]&&(i=!0)}}),!(!i&&o.__c.props===n)&&(!c||c.call(this,n,t,r))};r.u=!0;var c=r.shouldComponentUpdate,e=r.componentWillUpdate;r.componentWillUpdate=function(n,t,r){if(this.__e){var u=c;c=void 0,f(n,t,r),c=u}e&&e.call(this,n,t,r)},r.shouldComponentUpdate=f}return o.__N||o.__}function y(n,u){var i=d(hooks_module_t++,3);!hooks_module_c.__s&&C(i.__H,u)&&(i.__=n,i.i=u,r.__H.__h.push(i))}function _(n,u){var i=d(hooks_module_t++,4);!hooks_module_c.__s&&C(i.__H,u)&&(i.__=n,i.i=u,r.__h.push(i))}function A(n){return hooks_module_o=5,T(function(){return{current:n}},[])}function F(n,t,r){hooks_module_o=6,_(function(){return"function"==typeof n?(n(t()),function(){return n(null)}):n?(n.current=t(),function(){return n.current=null}):void 0},null==r?r:r.concat(n))}function T(n,r){var u=d(hooks_module_t++,7);return C(u.__H,r)&&(u.__=n(),u.__H=r,u.__h=n),u.__}function q(n,t){return hooks_module_o=8,T(function(){return n},t)}function x(n){var u=r.context[n.__c],i=d(hooks_module_t++,9);return i.c=n,u?(null==i.__&&(i.__=!0,u.sub(r)),u.props.value):n.__}function P(n,t){hooks_module_c.useDebugValue&&hooks_module_c.useDebugValue(t?t(n):n)}function b(n){var u=d(hooks_module_t++,10),i=h();return u.__=n,r.componentDidCatch||(r.componentDidCatch=function(n,t){u.__&&u.__(n,t),i[1](n)}),[i[0],function(){i[1](void 0)}]}function g(){var n=d(hooks_module_t++,11);if(!n.__){for(var u=r.__v;null!==u&&!u.__m&&null!==u.__;)u=u.__;var i=u.__m||(u.__m=[0,0]);n.__="P"+i[0]+"-"+i[1]++}return n.__}function j(){for(var n;n=hooks_module_f.shift();)if(n.__P&&n.__H)try{n.__H.__h.forEach(z),n.__H.__h.forEach(B),n.__H.__h=[]}catch(t){n.__H.__h=[],hooks_module_c.__e(t,n.__v)}}hooks_module_c.__b=function(n){r=null,e&&e(n)},hooks_module_c.__=function(n,t){n&&t.__k&&t.__k.__m&&(n.__m=t.__k.__m),s&&s(n,t)},hooks_module_c.__r=function(n){a&&a(n),hooks_module_t=0;var i=(r=n.__c).__H;i&&(hooks_module_u===r?(i.__h=[],r.__h=[],i.__.forEach(function(n){n.__N&&(n.__=n.__N),n.i=n.__N=void 0})):(i.__h.forEach(z),i.__h.forEach(B),i.__h=[],hooks_module_t=0)),hooks_module_u=r},hooks_module_c.diffed=function(n){v&&v(n);var t=n.__c;t&&t.__H&&(t.__H.__h.length&&(1!==hooks_module_f.push(t)&&i===hooks_module_c.requestAnimationFrame||((i=hooks_module_c.requestAnimationFrame)||w)(j)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.i=void 0})),hooks_module_u=r=null},hooks_module_c.__c=function(n,t){t.some(function(n){try{n.__h.forEach(z),n.__h=n.__h.filter(function(n){return!n.__||B(n)})}catch(r){t.some(function(n){n.__h&&(n.__h=[])}),t=[],hooks_module_c.__e(r,n.__v)}}),l&&l(n,t)},hooks_module_c.unmount=function(n){m&&m(n);var t,r=n.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{z(n)}catch(n){t=n}}),r.__H=void 0,t&&hooks_module_c.__e(t,r.__v))};var k="function"==typeof requestAnimationFrame;function w(n){var t,r=function(){clearTimeout(u),k&&cancelAnimationFrame(t),setTimeout(n)},u=setTimeout(r,100);k&&(t=requestAnimationFrame(r))}function z(n){var t=r,u=n.__c;"function"==typeof u&&(n.__c=void 0,u()),r=t}function B(n){var t=r;n.__c=n.__(),r=t}function C(n,t){return!n||n.length!==t.length||t.some(function(t,r){return t!==n[r]})}function D(n,t){return"function"==typeof t?t(n):t} +var hooks_module_t,r,hooks_module_u,i,hooks_module_o=0,hooks_module_f=[],hooks_module_c=preact_module/* options */.fF,e=hooks_module_c.__b,a=hooks_module_c.__r,v=hooks_module_c.diffed,l=hooks_module_c.__c,m=hooks_module_c.unmount,s=hooks_module_c.__;function d(n,t){hooks_module_c.__h&&hooks_module_c.__h(r,n,hooks_module_o||t),hooks_module_o=0;var u=r.__H||(r.__H={__:[],__h:[]});return n>=u.__.length&&u.__.push({}),u.__[n]}function h(n){return hooks_module_o=1,p(D,n)}function p(n,u,i){var o=d(hooks_module_t++,2);if(o.t=n,!o.__c&&(o.__=[i?i(u):D(void 0,u),function(n){var t=o.__N?o.__N[0]:o.__[0],r=o.t(t,n);t!==r&&(o.__N=[r,o.__[1]],o.__c.setState({}))}],o.__c=r,!r.u)){var f=function(n,t,r){if(!o.__c.__H)return!0;var u=o.__c.__H.__.filter(function(n){return!!n.__c});if(u.every(function(n){return!n.__N}))return!c||c.call(this,n,t,r);var i=o.__c.props!==n;return u.forEach(function(n){if(n.__N){var t=n.__[0];n.__=n.__N,n.__N=void 0,t!==n.__[0]&&(i=!0)}}),c&&c.call(this,n,t,r)||i};r.u=!0;var c=r.shouldComponentUpdate,e=r.componentWillUpdate;r.componentWillUpdate=function(n,t,r){if(this.__e){var u=c;c=void 0,f(n,t,r),c=u}e&&e.call(this,n,t,r)},r.shouldComponentUpdate=f}return o.__N||o.__}function y(n,u){var i=d(hooks_module_t++,3);!hooks_module_c.__s&&C(i.__H,u)&&(i.__=n,i.i=u,r.__H.__h.push(i))}function _(n,u){var i=d(hooks_module_t++,4);!hooks_module_c.__s&&C(i.__H,u)&&(i.__=n,i.i=u,r.__h.push(i))}function A(n){return hooks_module_o=5,T(function(){return{current:n}},[])}function F(n,t,r){hooks_module_o=6,_(function(){return"function"==typeof n?(n(t()),function(){return n(null)}):n?(n.current=t(),function(){return n.current=null}):void 0},null==r?r:r.concat(n))}function T(n,r){var u=d(hooks_module_t++,7);return C(u.__H,r)&&(u.__=n(),u.__H=r,u.__h=n),u.__}function q(n,t){return hooks_module_o=8,T(function(){return n},t)}function x(n){var u=r.context[n.__c],i=d(hooks_module_t++,9);return i.c=n,u?(null==i.__&&(i.__=!0,u.sub(r)),u.props.value):n.__}function P(n,t){hooks_module_c.useDebugValue&&hooks_module_c.useDebugValue(t?t(n):n)}function b(n){var u=d(hooks_module_t++,10),i=h();return u.__=n,r.componentDidCatch||(r.componentDidCatch=function(n,t){u.__&&u.__(n,t),i[1](n)}),[i[0],function(){i[1](void 0)}]}function g(){var n=d(hooks_module_t++,11);if(!n.__){for(var u=r.__v;null!==u&&!u.__m&&null!==u.__;)u=u.__;var i=u.__m||(u.__m=[0,0]);n.__="P"+i[0]+"-"+i[1]++}return n.__}function j(){for(var n;n=hooks_module_f.shift();)if(n.__P&&n.__H)try{n.__H.__h.forEach(z),n.__H.__h.forEach(B),n.__H.__h=[]}catch(t){n.__H.__h=[],hooks_module_c.__e(t,n.__v)}}hooks_module_c.__b=function(n){r=null,e&&e(n)},hooks_module_c.__=function(n,t){n&&t.__k&&t.__k.__m&&(n.__m=t.__k.__m),s&&s(n,t)},hooks_module_c.__r=function(n){a&&a(n),hooks_module_t=0;var i=(r=n.__c).__H;i&&(hooks_module_u===r?(i.__h=[],r.__h=[],i.__.forEach(function(n){n.__N&&(n.__=n.__N),n.i=n.__N=void 0})):(i.__h.forEach(z),i.__h.forEach(B),i.__h=[],hooks_module_t=0)),hooks_module_u=r},hooks_module_c.diffed=function(n){v&&v(n);var t=n.__c;t&&t.__H&&(t.__H.__h.length&&(1!==hooks_module_f.push(t)&&i===hooks_module_c.requestAnimationFrame||((i=hooks_module_c.requestAnimationFrame)||w)(j)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.i=void 0})),hooks_module_u=r=null},hooks_module_c.__c=function(n,t){t.some(function(n){try{n.__h.forEach(z),n.__h=n.__h.filter(function(n){return!n.__||B(n)})}catch(r){t.some(function(n){n.__h&&(n.__h=[])}),t=[],hooks_module_c.__e(r,n.__v)}}),l&&l(n,t)},hooks_module_c.unmount=function(n){m&&m(n);var t,r=n.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{z(n)}catch(n){t=n}}),r.__H=void 0,t&&hooks_module_c.__e(t,r.__v))};var k="function"==typeof requestAnimationFrame;function w(n){var t,r=function(){clearTimeout(u),k&&cancelAnimationFrame(t),setTimeout(n)},u=setTimeout(r,100);k&&(t=requestAnimationFrame(r))}function z(n){var t=r,u=n.__c;"function"==typeof u&&(n.__c=void 0,u()),r=t}function B(n){var t=r;n.__c=n.__(),r=t}function C(n,t){return!n||n.length!==t.length||t.some(function(t,r){return t!==n[r]})}function D(n,t){return"function"==typeof t?t(n):t} ;// ./node_modules/@preact/signals-core/dist/signals-core.module.js var signals_core_module_i=Symbol.for("preact-signals");function signals_core_module_t(){if(!(signals_core_module_s>1)){var i,t=!1;while(void 0!==signals_core_module_h){var r=signals_core_module_h;signals_core_module_h=void 0;signals_core_module_f++;while(void 0!==r){var o=r.o;r.o=void 0;r.f&=-3;if(!(8&r.f)&&signals_core_module_c(r))try{r.c()}catch(r){if(!t){i=r;t=!0}}r=o}}signals_core_module_f=0;signals_core_module_s--;if(t)throw i}else signals_core_module_s--}function signals_core_module_r(i){if(signals_core_module_s>0)return i();signals_core_module_s++;try{return i()}finally{signals_core_module_t()}}var signals_core_module_o=void 0;function n(i){var t=signals_core_module_o;signals_core_module_o=void 0;try{return i()}finally{signals_core_module_o=t}}var signals_core_module_h=void 0,signals_core_module_s=0,signals_core_module_f=0,signals_core_module_v=0;function signals_core_module_e(i){if(void 0!==signals_core_module_o){var t=i.n;if(void 0===t||t.t!==signals_core_module_o){t={i:0,S:i,p:signals_core_module_o.s,n:void 0,t:signals_core_module_o,e:void 0,x:void 0,r:t};if(void 0!==signals_core_module_o.s)signals_core_module_o.s.n=t;signals_core_module_o.s=t;i.n=t;if(32&signals_core_module_o.f)i.S(t);return t}else if(-1===t.i){t.i=0;if(void 0!==t.n){t.n.p=t.p;if(void 0!==t.p)t.p.n=t.n;t.p=signals_core_module_o.s;t.n=void 0;signals_core_module_o.s.n=t;signals_core_module_o.s=t}return t}}}function signals_core_module_u(i){this.v=i;this.i=0;this.n=void 0;this.t=void 0}signals_core_module_u.prototype.brand=signals_core_module_i;signals_core_module_u.prototype.h=function(){return!0};signals_core_module_u.prototype.S=function(i){if(this.t!==i&&void 0===i.e){i.x=this.t;if(void 0!==this.t)this.t.e=i;this.t=i}};signals_core_module_u.prototype.U=function(i){if(void 0!==this.t){var t=i.e,r=i.x;if(void 0!==t){t.x=r;i.e=void 0}if(void 0!==r){r.e=t;i.x=void 0}if(i===this.t)this.t=r}};signals_core_module_u.prototype.subscribe=function(i){var t=this;return E(function(){var r=t.value,n=signals_core_module_o;signals_core_module_o=void 0;try{i(r)}finally{signals_core_module_o=n}})};signals_core_module_u.prototype.valueOf=function(){return this.value};signals_core_module_u.prototype.toString=function(){return this.value+""};signals_core_module_u.prototype.toJSON=function(){return this.value};signals_core_module_u.prototype.peek=function(){var i=signals_core_module_o;signals_core_module_o=void 0;try{return this.value}finally{signals_core_module_o=i}};Object.defineProperty(signals_core_module_u.prototype,"value",{get:function(){var i=signals_core_module_e(this);if(void 0!==i)i.i=this.i;return this.v},set:function(i){if(i!==this.v){if(signals_core_module_f>100)throw new Error("Cycle detected");this.v=i;this.i++;signals_core_module_v++;signals_core_module_s++;try{for(var r=this.t;void 0!==r;r=r.x)r.t.N()}finally{signals_core_module_t()}}}});function signals_core_module_d(i){return new signals_core_module_u(i)}function signals_core_module_c(i){for(var t=i.s;void 0!==t;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function signals_core_module_a(i){for(var t=i.s;void 0!==t;t=t.n){var r=t.S.n;if(void 0!==r)t.r=r;t.S.n=t;t.i=-1;if(void 0===t.n){i.s=t;break}}}function signals_core_module_l(i){var t=i.s,r=void 0;while(void 0!==t){var o=t.p;if(-1===t.i){t.S.U(t);if(void 0!==o)o.n=t.n;if(void 0!==t.n)t.n.p=o}else r=t;t.S.n=t.r;if(void 0!==t.r)t.r=void 0;t=o}i.s=r}function signals_core_module_y(i){signals_core_module_u.call(this,void 0);this.x=i;this.s=void 0;this.g=signals_core_module_v-1;this.f=4}(signals_core_module_y.prototype=new signals_core_module_u).h=function(){this.f&=-3;if(1&this.f)return!1;if(32==(36&this.f))return!0;this.f&=-5;if(this.g===signals_core_module_v)return!0;this.g=signals_core_module_v;this.f|=1;if(this.i>0&&!signals_core_module_c(this)){this.f&=-2;return!0}var i=signals_core_module_o;try{signals_core_module_a(this);signals_core_module_o=this;var t=this.x();if(16&this.f||this.v!==t||0===this.i){this.v=t;this.f&=-17;this.i++}}catch(i){this.v=i;this.f|=16;this.i++}signals_core_module_o=i;signals_core_module_l(this);this.f&=-2;return!0};signals_core_module_y.prototype.S=function(i){if(void 0===this.t){this.f|=36;for(var t=this.s;void 0!==t;t=t.n)t.S.S(t)}signals_core_module_u.prototype.S.call(this,i)};signals_core_module_y.prototype.U=function(i){if(void 0!==this.t){signals_core_module_u.prototype.U.call(this,i);if(void 0===this.t){this.f&=-33;for(var t=this.s;void 0!==t;t=t.n)t.S.U(t)}}};signals_core_module_y.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var i=this.t;void 0!==i;i=i.x)i.t.N()}};Object.defineProperty(signals_core_module_y.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var i=signals_core_module_e(this);this.h();if(void 0!==i)i.i=this.i;if(16&this.f)throw this.v;return this.v}});function signals_core_module_w(i){return new signals_core_module_y(i)}function signals_core_module_(i){var r=i.u;i.u=void 0;if("function"==typeof r){signals_core_module_s++;var n=signals_core_module_o;signals_core_module_o=void 0;try{r()}catch(t){i.f&=-2;i.f|=8;signals_core_module_g(i);throw t}finally{signals_core_module_o=n;signals_core_module_t()}}}function signals_core_module_g(i){for(var t=i.s;void 0!==t;t=t.n)t.S.U(t);i.x=void 0;i.s=void 0;signals_core_module_(i)}function signals_core_module_p(i){if(signals_core_module_o!==this)throw new Error("Out-of-order effect");signals_core_module_l(this);signals_core_module_o=i;this.f&=-2;if(8&this.f)signals_core_module_g(this);signals_core_module_t()}function signals_core_module_b(i){this.x=i;this.u=void 0;this.s=void 0;this.o=void 0;this.f=32}signals_core_module_b.prototype.c=function(){var i=this.S();try{if(8&this.f)return;if(void 0===this.x)return;var t=this.x();if("function"==typeof t)this.u=t}finally{i()}};signals_core_module_b.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1;this.f&=-9;signals_core_module_(this);signals_core_module_a(this);signals_core_module_s++;var i=signals_core_module_o;signals_core_module_o=this;return signals_core_module_p.bind(this,i)};signals_core_module_b.prototype.N=function(){if(!(2&this.f)){this.f|=2;this.o=signals_core_module_h;signals_core_module_h=this}};signals_core_module_b.prototype.d=function(){this.f|=8;if(!(1&this.f))signals_core_module_g(this)};function E(i){var t=new signals_core_module_b(i);try{t.c()}catch(i){t.d();throw i}return t.d.bind(t)} ;// ./node_modules/@preact/signals/dist/signals.module.js -var signals_module_v,signals_module_s;function signals_module_l(n,i){preact_module/* options */.fF[n]=i.bind(null,preact_module/* options */.fF[n]||function(){})}function signals_module_d(n){if(signals_module_s)signals_module_s();signals_module_s=n&&n.S()}function signals_module_p(n){var r=this,f=n.data,o=useSignal(f);o.value=f;var e=T(function(){var n=r.__v;while(n=n.__)if(n.__c){n.__c.__$f|=4;break}r.__$u.c=function(){var n;if(!(0,preact_module/* isValidElement */.zO)(e.peek())&&3===(null==(n=r.base)?void 0:n.nodeType))r.base.data=e.peek();else{r.__$f|=1;r.setState({})}};return signals_core_module_w(function(){var n=o.value.value;return 0===n?0:!0===n?"":n||""})},[]);return e.value}signals_module_p.displayName="_st";Object.defineProperties(signals_core_module_u.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:signals_module_p},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}});signals_module_l("__b",function(n,r){if("string"==typeof r.type){var i,t=r.props;for(var f in t)if("children"!==f){var o=t[f];if(o instanceof signals_core_module_u){if(!i)r.__np=i={};i[f]=o;t[f]=o.peek()}}}n(r)});signals_module_l("__r",function(n,r){signals_module_d();var i,t=r.__c;if(t){t.__$f&=-2;if(void 0===(i=t.__$u))t.__$u=i=function(n){var r;E(function(){r=this});r.c=function(){t.__$f|=1;t.setState({})};return r}()}signals_module_v=t;signals_module_d(i);n(r)});signals_module_l("__e",function(n,r,i,t){signals_module_d();signals_module_v=void 0;n(r,i,t)});signals_module_l("diffed",function(n,r){signals_module_d();signals_module_v=void 0;var i;if("string"==typeof r.type&&(i=r.__e)){var t=r.__np,f=r.props;if(t){var o=i.U;if(o)for(var e in o){var u=o[e];if(void 0!==u&&!(e in t)){u.d();o[e]=void 0}}else i.U=o={};for(var a in t){var c=o[a],s=t[a];if(void 0===c){c=signals_module_(i,a,s,f);o[a]=c}else c.o(s,f)}}}n(r)});function signals_module_(n,r,i,t){var f=r in n&&void 0===n.ownerSVGElement,o=signals_core_module_d(i);return{o:function(n,r){o.value=n;t=r},d:E(function(){var i=o.value.value;if(t[r]!==i){t[r]=i;if(f)n[r]=i;else if(i)n.setAttribute(r,i);else n.removeAttribute(r)}})}}signals_module_l("unmount",function(n,r){if("string"==typeof r.type){var i=r.__e;if(i){var t=i.U;if(t){i.U=void 0;for(var f in t){var o=t[f];if(o)o.d()}}}}else{var e=r.__c;if(e){var u=e.__$u;if(u){e.__$u=void 0;u.d()}}}n(r)});signals_module_l("__h",function(n,r,i,t){if(t<3||9===t)r.__$f|=2;n(r,i,t)});preact_module/* Component */.uA.prototype.shouldComponentUpdate=function(n,r){var i=this.__$u;if(!(i&&void 0!==i.s||4&this.__$f))return!0;if(3&this.__$f)return!0;for(var t in r)return!0;for(var f in n)if("__source"!==f&&n[f]!==this.props[f])return!0;for(var o in this.props)if(!(o in n))return!0;return!1};function useSignal(n){return T(function(){return signals_core_module_d(n)},[])}function useComputed(n){var r=f(n);r.current=n;signals_module_v.__$f|=4;return t(function(){return u(function(){return r.current()})},[])}function useSignalEffect(n){var r=f(n);r.current=n;o(function(){return c(function(){return r.current()})},[])} +var signals_module_v,signals_module_s;function signals_module_l(i,n){preact_module/* options */.fF[i]=n.bind(null,preact_module/* options */.fF[i]||function(){})}function signals_module_d(i){if(signals_module_s)signals_module_s();signals_module_s=i&&i.S()}function signals_module_h(i){var r=this,f=i.data,o=useSignal(f);o.value=f;var e=T(function(){var i=r.__v;while(i=i.__)if(i.__c){i.__c.__$f|=4;break}r.__$u.c=function(){var i,t=r.__$u.S(),f=e.value;t();if((0,preact_module/* isValidElement */.zO)(f)||3!==(null==(i=r.base)?void 0:i.nodeType)){r.__$f|=1;r.setState({})}else r.base.data=f};return signals_core_module_w(function(){var i=o.value.value;return 0===i?0:!0===i?"":i||""})},[]);return e.value}signals_module_h.displayName="_st";Object.defineProperties(signals_core_module_u.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:signals_module_h},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}});signals_module_l("__b",function(i,r){if("string"==typeof r.type){var n,t=r.props;for(var f in t)if("children"!==f){var o=t[f];if(o instanceof signals_core_module_u){if(!n)r.__np=n={};n[f]=o;t[f]=o.peek()}}}i(r)});signals_module_l("__r",function(i,r){signals_module_d();var n,t=r.__c;if(t){t.__$f&=-2;if(void 0===(n=t.__$u))t.__$u=n=function(i){var r;E(function(){r=this});r.c=function(){t.__$f|=1;t.setState({})};return r}()}signals_module_v=t;signals_module_d(n);i(r)});signals_module_l("__e",function(i,r,n,t){signals_module_d();signals_module_v=void 0;i(r,n,t)});signals_module_l("diffed",function(i,r){signals_module_d();signals_module_v=void 0;var n;if("string"==typeof r.type&&(n=r.__e)){var t=r.__np,f=r.props;if(t){var o=n.U;if(o)for(var e in o){var u=o[e];if(void 0!==u&&!(e in t)){u.d();o[e]=void 0}}else n.U=o={};for(var a in t){var c=o[a],s=t[a];if(void 0===c){c=signals_module_p(n,a,s,f);o[a]=c}else c.o(s,f)}}}i(r)});function signals_module_p(i,r,n,t){var f=r in i&&void 0===i.ownerSVGElement,o=signals_core_module_d(n);return{o:function(i,r){o.value=i;t=r},d:E(function(){var n=o.value.value;if(t[r]!==n){t[r]=n;if(f)i[r]=n;else if(n)i.setAttribute(r,n);else i.removeAttribute(r)}})}}signals_module_l("unmount",function(i,r){if("string"==typeof r.type){var n=r.__e;if(n){var t=n.U;if(t){n.U=void 0;for(var f in t){var o=t[f];if(o)o.d()}}}}else{var e=r.__c;if(e){var u=e.__$u;if(u){e.__$u=void 0;u.d()}}}i(r)});signals_module_l("__h",function(i,r,n,t){if(t<3||9===t)r.__$f|=2;i(r,n,t)});preact_module/* Component */.uA.prototype.shouldComponentUpdate=function(i,r){var n=this.__$u,t=n&&void 0!==n.s;for(var f in r)return!0;if(this.__f||"boolean"==typeof this.u&&!0===this.u){if(!(t||2&this.__$f||4&this.__$f))return!0;if(1&this.__$f)return!0}else{if(!(t||4&this.__$f))return!0;if(3&this.__$f)return!0}for(var o in i)if("__source"!==o&&i[o]!==this.props[o])return!0;for(var e in this.props)if(!(e in i))return!0;return!1};function useSignal(i){return T(function(){return signals_core_module_d(i)},[])}function useComputed(i){var r=f(i);r.current=i;signals_module_v.__$f|=4;return t(function(){return u(function(){return r.current()})},[])}function useSignalEffect(i){var r=f(i);r.current=i;o(function(){return c(function(){return r.current()})},[])} ;// ./node_modules/@wordpress/interactivity/build-module/namespaces.js const namespaceStack = []; const getNamespace = () => namespaceStack.slice(-1)[0]; @@ -105,7 +105,7 @@ const getContext = namespace => { /** * Retrieves a representation of the element where a function from the store - * is being evalutated. Such representation is read-only, and contains a + * is being evaluated. Such representation is read-only, and contains a * reference to the DOM element, its props and a local reactive state. * * @return Element representation. @@ -202,11 +202,10 @@ const afterNextFrame = callback => { /** * Returns a promise that resolves after yielding to main. * - * @return Promise + * @return Promise */ -const splitTask = () => { +const splitTask = typeof window.scheduler?.yield === 'function' ? window.scheduler.yield.bind(window.scheduler) : () => { return new Promise(resolve => { - // TODO: Use scheduler.yield() when available. setTimeout(resolve, 0); }); }; @@ -266,7 +265,7 @@ function utils_useSignalEffect(callback) { * accessible whenever the function runs. This is primarily to make the scope * available inside hook callbacks. * - * Asyncronous functions should use generators that yield promises instead of awaiting them. + * Asynchronous functions should use generators that yield promises instead of awaiting them. * See the documentation for details: https://developer.wordpress.org/block-editor/reference-guides/packages/packages-interactivity/packages-interactivity-api-reference/#the-store * * @param func The passed function. @@ -335,7 +334,7 @@ function useWatch(callback) { /** * Accepts a function that contains imperative code which runs only after the - * element's first render, mainly useful for intialization logic. + * element's first render, mainly useful for initialization logic. * * This hook makes the element's scope available so functions like * `getElement()` and `getContext()` can be used inside the passed callback. @@ -709,6 +708,7 @@ class PropSignal { } ;// ./node_modules/@wordpress/interactivity/build-module/proxies/state.js +/* wp:polyfill */ /** * External dependencies */ @@ -734,7 +734,7 @@ const wellKnownSymbols = new Set(Object.getOwnPropertyNames(Symbol).map(key => S const proxyToProps = new WeakMap(); /** - * Checks wether a {@link PropSignal | `PropSignal`} instance exists for the + * Checks whether a {@link PropSignal | `PropSignal`} instance exists for the * given property in the passed proxy. * * @param proxy Proxy of a state object or array. @@ -954,6 +954,8 @@ const peek = (obj, key) => { * by default). */ const deepMergeRecursive = (target, source, override = true) => { + // If target is not a plain object and the source is, we don't need to merge + // them because the source will be used as the new value of the target. if (!(isPlainObject(target) && isPlainObject(source))) { return; } @@ -964,28 +966,42 @@ const deepMergeRecursive = (target, source, override = true) => { const desc = Object.getOwnPropertyDescriptor(source, key); const proxy = getProxyFromObject(target); const propSignal = !!proxy && hasPropSignal(proxy, key) && getPropSignal(proxy, key); + + // Handle getters and setters if (typeof desc.get === 'function' || typeof desc.set === 'function') { if (override || isNew) { + // Because we are setting a getter or setter, we need to use + // Object.defineProperty to define the property on the target object. Object.defineProperty(target, key, { ...desc, configurable: true, enumerable: true }); + // Update the getter in the property signal if it exists if (desc.get && propSignal) { propSignal.setGetter(desc.get); } } + + // Handle nested objects } else if (isPlainObject(source[key])) { - if (isNew || override && !isPlainObject(target[key])) { + const targetValue = Object.getOwnPropertyDescriptor(target, key)?.value; + if (isNew || override && !isPlainObject(targetValue)) { + // Create a new object if the property is new or needs to be overridden target[key] = {}; if (propSignal) { + // Create a new proxified state for the nested object const ns = getNamespaceFromProxy(proxy); propSignal.setValue(proxifyState(ns, target[key])); } - } - if (isPlainObject(target[key])) { deepMergeRecursive(target[key], source[key], override); } + // Both target and source are plain objects, merge them recursively + else if (isPlainObject(targetValue)) { + deepMergeRecursive(target[key], source[key], override); + } + + // Handle primitive values and non-plain objects } else if (override || isNew) { Object.defineProperty(target, key, desc); if (propSignal) { @@ -993,6 +1009,7 @@ const deepMergeRecursive = (target, source, override = true) => { value } = desc; const ns = getNamespaceFromProxy(proxy); + // Proxify the value if necessary before setting it in the signal propSignal.setValue(shouldProxy(value) ? proxifyState(ns, value) : value); } } @@ -1125,7 +1142,8 @@ const contextHandlers = { return true; }, ownKeys: target => [...new Set([...Object.keys(contextObjectToFallback.get(target)), ...Object.keys(target)])], - getOwnPropertyDescriptor: (target, key) => descriptor(target, key) || descriptor(contextObjectToFallback.get(target), key) + getOwnPropertyDescriptor: (target, key) => descriptor(target, key) || descriptor(contextObjectToFallback.get(target), key), + has: (target, key) => Reflect.has(target, key) || Reflect.has(contextObjectToFallback.get(target), key) }; /** @@ -1162,6 +1180,7 @@ const proxifyContext = (current, inherited = {}) => { ;// ./node_modules/@wordpress/interactivity/build-module/store.js +/* wp:polyfill */ /** * Internal dependencies */ @@ -1190,7 +1209,7 @@ const getConfig = namespace => storeConfigs.get(namespace || getNamespace()) || * * The object returned is read-only, and includes the state defined in PHP with * `wp_interactivity_state()`. When using `actions.navigate()`, this object is - * updated to reflect the changes in its properites, without affecting the state + * updated to reflect the changes in its properties, without affecting the state * returned by `store()`. Directives can subscribe to those changes to update * the state if needed. * @@ -1267,6 +1286,14 @@ const universalUnlock = 'I acknowledge that using a private store means my plugi * @return A reference to the namespace content. */ +// Overload for when the types are inferred. + +// Overload for when types are passed via generics and they contain state. + +// Overload for when types are passed via generics and they don't contain state. + +// Overload for when types are divided into multiple parts. + function store(namespace, { state = {}, ...block @@ -1345,6 +1372,7 @@ const data = parseServerData(); populateServerData(data); ;// ./node_modules/@wordpress/interactivity/build-module/hooks.js +/* wp:polyfill */ // eslint-disable-next-line eslint-comments/disable-enable-pair /* eslint-disable react-hooks/exhaustive-deps */ @@ -1462,7 +1490,7 @@ const resolve = (path, namespace) => { } let resolvedStore = stores.get(namespace); if (typeof resolvedStore === 'undefined') { - resolvedStore = store(namespace, undefined, { + resolvedStore = store(namespace, {}, { lock: universalUnlock }); } @@ -1600,6 +1628,7 @@ preact_module/* options */.fF.vnode = vnode => { }; ;// ./node_modules/@wordpress/interactivity/build-module/directives.js +/* wp:polyfill */ // eslint-disable-next-line eslint-comments/disable-enable-pair /* eslint-disable react-hooks/exhaustive-deps */ @@ -2083,9 +2112,13 @@ const getGlobalAsyncEventDirective = type => { const { namespace } = entry; - const list = evaluate(entry); + const iterable = evaluate(entry); + if (typeof iterable?.[Symbol.iterator] !== 'function') { + return; + } const itemProp = isNonDefaultDirectiveSuffix(entry) ? kebabToCamelCase(entry.suffix) : 'item'; - return list.map(item => { + const result = []; + for (const item of iterable) { const itemContext = proxifyContext(proxifyState(namespace, {}), inheritedValue.client[namespace]); const mergedContext = { client: { @@ -2107,11 +2140,12 @@ const getGlobalAsyncEventDirective = type => { const key = eachKey ? getEvaluate({ scope })(eachKey[0]) : item; - return (0,preact_module.h)(Provider, { + result.push((0,preact_module.h)(Provider, { value: mergedContext, key - }, element.props.content); - }); + }, element.props.content)); + } + return result; }, { priority: 20 }); @@ -2124,6 +2158,7 @@ const getGlobalAsyncEventDirective = type => { const directivePrefix = 'wp'; ;// ./node_modules/@wordpress/interactivity/build-module/vdom.js +/* wp:polyfill */ /** * External dependencies */ @@ -2150,7 +2185,7 @@ const directiveParser = new RegExp(`^data-${directivePrefix}-` + // segments. It excludes underscore intentionally to prevent confusion. // E.g., "custom-directive". '([a-z0-9]+(?:-[a-z0-9]+)*)' + -// (Optional) Match '--' followed by any alphanumeric charachters. It +// (Optional) Match '--' followed by any alphanumeric characters. It // excludes underscore intentionally to prevent confusion, but it can // contain multiple hyphens. E.g., "--custom-prefix--with-more-info". '(?:--([a-z0-9_-]+))?$', 'i' // Case insensitive. @@ -2266,8 +2301,6 @@ function toVdom(root) { return obj; }, {}); } - - // @ts-expect-error Fixed in upcoming preact release https://github.com/preactjs/preact/pull/4334 if (localName === 'template') { props.content = [...elementNode.content.childNodes].map(childNode => toVdom(childNode)); } else { @@ -2323,6 +2356,17 @@ const initialVdom = new WeakMap(); // Initialize the router with the initial DOM. const init = async () => { const nodes = document.querySelectorAll(`[data-${directivePrefix}-interactive]`); + + /* + * This `await` with setTimeout is required to apparently ensure that the interactive blocks have their stores + * fully initialized prior to hydrating the blocks. If this is not present, then an error occurs, for example: + * > view.js:46 Uncaught (in promise) ReferenceError: Cannot access 'state' before initialization + * This occurs when splitTask() is implemented with scheduler.yield() as opposed to setTimeout(), as with the former + * split tasks are added to the front of the task queue whereas with the latter they are added to the end of the queue. + */ + await new Promise(resolve => { + setTimeout(resolve, 0); + }); for (const node of nodes) { if (!hydratedIslands.has(node)) { await splitTask(); @@ -2388,18 +2432,18 @@ init(); /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ FK: () => (/* binding */ b), -/* harmony export */ Ob: () => (/* binding */ E), -/* harmony export */ Qv: () => (/* binding */ D), -/* harmony export */ XX: () => (/* binding */ B), +/* harmony export */ FK: () => (/* binding */ k), +/* harmony export */ Ob: () => (/* binding */ G), +/* harmony export */ Qv: () => (/* binding */ E), +/* harmony export */ XX: () => (/* binding */ D), /* harmony export */ fF: () => (/* binding */ l), -/* harmony export */ h: () => (/* binding */ _), -/* harmony export */ q6: () => (/* binding */ G), -/* harmony export */ uA: () => (/* binding */ k), +/* harmony export */ h: () => (/* binding */ g), +/* harmony export */ q6: () => (/* binding */ J), +/* harmony export */ uA: () => (/* binding */ x), /* harmony export */ zO: () => (/* binding */ t) /* harmony export */ }); /* unused harmony exports createElement, createRef, toChildArray */ -var n,l,u,t,i,o,r,f,e,c,s,a,h={},v=[],p=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,y=Array.isArray;function d(n,l){for(var u in l)n[u]=l[u];return n}function w(n){n&&n.parentNode&&n.parentNode.removeChild(n)}function _(l,u,t){var i,o,r,f={};for(r in u)"key"==r?i=u[r]:"ref"==r?o=u[r]:f[r]=u[r];if(arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):t),"function"==typeof l&&null!=l.defaultProps)for(r in l.defaultProps)void 0===f[r]&&(f[r]=l.defaultProps[r]);return g(l,f,i,o,null)}function g(n,t,i,o,r){var f={type:n,props:t,key:i,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==r?++u:r,__i:-1,__u:0};return null==r&&null!=l.vnode&&l.vnode(f),f}function m(){return{current:null}}function b(n){return n.children}function k(n,l){this.props=n,this.context=l}function x(n,l){if(null==l)return n.__?x(n.__,n.__i+1):null;for(var u;lu&&i.sort(f));M.__r=0}function P(n,l,u,t,i,o,r,f,e,c,s){var a,p,y,d,w,_=t&&t.__k||v,g=l.length;for(u.__d=e,$(u,l,_),e=u.__d,a=0;a0?g(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i).__=n,i.__b=n.__b+1,o=null,-1!==(f=i.__i=L(i,u,r,s))&&(s--,(o=u[f])&&(o.__u|=131072)),null==o||null===o.__v?(-1==f&&a--,"function"!=typeof i.type&&(i.__u|=65536)):f!==r&&(f==r-1?a--:f==r+1?a++:(f>r?a--:a++,i.__u|=65536))):i=n.__k[t]=null;if(s)for(t=0;t(null!=e&&0==(131072&e.__u)?1:0))for(;r>=0||f=0){if((e=l[r])&&0==(131072&e.__u)&&i==e.key&&o===e.type)return r;r--}if(f2&&(e.children=arguments.length>3?n.call(arguments,2):t),g(l.type,e,i||l.key,o||l.ref,null)}function G(n,l){var u={__c:l="__cC"+a++,__:n,Consumer:function(n,l){return n.children(l)},Provider:function(n){var u,t;return this.getChildContext||(u=new Set,(t={})[l]=this,this.getChildContext=function(){return t},this.componentWillUnmount=function(){u=null},this.shouldComponentUpdate=function(n){this.props.value!==n.value&&u.forEach(function(n){n.__e=!0,S(n)})},this.sub=function(n){u.add(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){u&&u.delete(n),l&&l.call(n)}}),n.children}};return u.Provider.__=u.Consumer.contextType=u}n=v.slice,l={__e:function(n,l,u,t){for(var i,o,r;l=l.__;)if((i=l.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(n)),r=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(n,t||{}),r=i.__d),r)return i.__E=i}catch(l){n=l}throw n}},u=0,t=function(n){return null!=n&&null==n.constructor},k.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=d({},this.state),"function"==typeof n&&(n=n(d({},u),this.props)),n&&d(u,n),null!=n&&this.__v&&(l&&this._sb.push(l),S(this))},k.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),S(this))},k.prototype.render=b,i=[],r="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,f=function(n,l){return n.__v.__b-l.__v.__b},M.__r=0,e=0,c=F(!1),s=F(!0),a=0; +var n,l,u,t,i,r,o,e,f,c,s,a,h,p={},v=[],y=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,d=Array.isArray;function w(n,l){for(var u in l)n[u]=l[u];return n}function _(n){n&&n.parentNode&&n.parentNode.removeChild(n)}function g(l,u,t){var i,r,o,e={};for(o in u)"key"==o?i=u[o]:"ref"==o?r=u[o]:e[o]=u[o];if(arguments.length>2&&(e.children=arguments.length>3?n.call(arguments,2):t),"function"==typeof l&&null!=l.defaultProps)for(o in l.defaultProps)void 0===e[o]&&(e[o]=l.defaultProps[o]);return m(l,e,i,r,null)}function m(n,t,i,r,o){var e={type:n,props:t,key:i,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==o?++u:o,__i:-1,__u:0};return null==o&&null!=l.vnode&&l.vnode(e),e}function b(){return{current:null}}function k(n){return n.children}function x(n,l){this.props=n,this.context=l}function C(n,l){if(null==l)return n.__?C(n.__,n.__i+1):null;for(var u;lu&&i.sort(e));P.__r=0}function $(n,l,u,t,i,r,o,e,f,c,s){var a,h,y,d,w,_,g=t&&t.__k||v,m=l.length;for(f=I(u,l,g,f,m),a=0;a0?m(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=n,o.__b=n.__b+1,e=null,-1!==(c=o.__i=L(o,u,f,a))&&(a--,(e=u[c])&&(e.__u|=2)),null==e||null===e.__v?(-1==c&&h--,"function"!=typeof o.type&&(o.__u|=4)):c!=f&&(c==f-1?h--:c==f+1?h++:(c>f?h--:h++,o.__u|=4))):n.__k[r]=null;if(a)for(r=0;r(null!=f&&0==(2&f.__u)?1:0))for(i=u-1,r=u+1;i>=0||r=0){if((f=l[i])&&0==(2&f.__u)&&o==f.key&&e===f.type)return i;i--}if(r2&&(f.children=arguments.length>3?n.call(arguments,2):t),m(l.type,f,i||l.key,r||l.ref,null)}function J(n,l){var u={__c:l="__cC"+h++,__:n,Consumer:function(n,l){return n.children(l)},Provider:function(n){var u,t;return this.getChildContext||(u=new Set,(t={})[l]=this,this.getChildContext=function(){return t},this.componentWillUnmount=function(){u=null},this.shouldComponentUpdate=function(n){this.props.value!==n.value&&u.forEach(function(n){n.__e=!0,M(n)})},this.sub=function(n){u.add(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){u&&u.delete(n),l&&l.call(n)}}),n.children}};return u.Provider.__=u.Consumer.contextType=u}n=v.slice,l={__e:function(n,l,u,t){for(var i,r,o;l=l.__;)if((i=l.__c)&&!i.__)try{if((r=i.constructor)&&null!=r.getDerivedStateFromError&&(i.setState(r.getDerivedStateFromError(n)),o=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(n,t||{}),o=i.__d),o)return i.__E=i}catch(l){n=l}throw n}},u=0,t=function(n){return null!=n&&null==n.constructor},x.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=w({},this.state),"function"==typeof n&&(n=n(w({},u),this.props)),n&&w(u,n),null!=n&&this.__v&&(l&&this._sb.push(l),M(this))},x.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),M(this))},x.prototype.render=k,i=[],o="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,e=function(n,l){return n.__v.__b-l.__v.__b},P.__r=0,f=/(PointerCapture)$|Capture$/i,c=0,s=O(!1),a=O(!0),h=0; /***/ }) @@ -2475,10 +2519,10 @@ __webpack_require__.d(__webpack_exports__, { // EXTERNAL MODULE: ./node_modules/preact/dist/preact.module.js var debug_preact_module = __webpack_require__(622); ;// ./node_modules/preact/devtools/dist/devtools.module.js -var debug_i;function debug_t(o,e){return n.__a&&n.__a(e),o}null!=(debug_i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0)&&debug_i.__PREACT_DEVTOOLS__&&debug_i.__PREACT_DEVTOOLS__.attachPreact("10.24.3",debug_preact_module/* options */.fF,{Fragment:debug_preact_module/* Fragment */.FK,Component:debug_preact_module/* Component */.uA}); +var debug_i;function debug_t(o,e){return n.__a&&n.__a(e),o}null!=(debug_i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0)&&debug_i.__PREACT_DEVTOOLS__&&debug_i.__PREACT_DEVTOOLS__.attachPreact("10.25.4",debug_preact_module/* options */.fF,{Fragment:debug_preact_module/* Fragment */.FK,Component:debug_preact_module/* Component */.uA}); ;// ./node_modules/preact/debug/dist/debug.module.js -var debug_debug_module_t={};function debug_r(){debug_debug_module_t={}}function debug_a(e){return e.type===debug_preact_module/* Fragment */.FK?"Fragment":"function"==typeof e.type?e.type.displayName||e.type.name:"string"==typeof e.type?e.type:"#text"}var debug_debug_module_i=[],debug_s=[];function debug_c(){return debug_debug_module_i.length>0?debug_debug_module_i[debug_debug_module_i.length-1]:null}var debug_l=!0;function debug_u(e){return"function"==typeof e.type&&e.type!=debug_preact_module/* Fragment */.FK}function debug_f(n){for(var e=[n],o=n;null!=o.__o;)e.push(o.__o),o=o.__o;return e.reduce(function(n,e){n+=" in "+debug_a(e);var o=e.__source;return o?n+=" (at "+o.fileName+":"+o.lineNumber+")":debug_l&&console.warn("Add @babel/plugin-transform-react-jsx-source to get a more detailed component stack. Note that you should not add it to production builds of your App for bundle size reasons."),debug_l=!1,n+"\n"},"")}var debug_d="function"==typeof WeakMap;function debug_p(n){var e=[];return n.__k?(n.__k.forEach(function(n){n&&"function"==typeof n.type?e.push.apply(e,debug_p(n)):n&&"string"==typeof n.type&&e.push(n.type)}),e):e}function debug_h(n){return n?"function"==typeof n.type?null==n.__?null!=n.__e&&null!=n.__e.parentNode?n.__e.parentNode.localName:"":debug_h(n.__):n.type:""}var debug_v=debug_preact_module/* Component */.uA.prototype.setState;function debug_y(n){return"table"===n||"tfoot"===n||"tbody"===n||"thead"===n||"td"===n||"tr"===n||"th"===n}debug_preact_module/* Component */.uA.prototype.setState=function(n,e){return null==this.__v&&null==this.state&&console.warn('Calling "this.setState" inside the constructor of a component is a no-op and might be a bug in your application. Instead, set "this.state = {}" directly.\n\n'+debug_f(debug_c())),debug_v.call(this,n,e)};var debug_m=/^(address|article|aside|blockquote|details|div|dl|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hgroup|hr|main|menu|nav|ol|p|pre|search|section|table|ul)$/,debug_b=debug_preact_module/* Component */.uA.prototype.forceUpdate;function debug_w(n){var e=n.props,o=debug_a(n),t="";for(var r in e)if(e.hasOwnProperty(r)&&"children"!==r){var i=e[r];"function"==typeof i&&(i="function "+(i.displayName||i.name)+"() {}"),i=Object(i)!==i||i.toString?i+"":Object.prototype.toString.call(i),t+=" "+r+"="+JSON.stringify(i)}var s=e.children;return"<"+o+t+(s&&s.length?">..":" />")}debug_preact_module/* Component */.uA.prototype.forceUpdate=function(n){return null==this.__v?console.warn('Calling "this.forceUpdate" inside the constructor of a component is a no-op and might be a bug in your application.\n\n'+debug_f(debug_c())):null==this.__P&&console.warn('Can\'t call "this.forceUpdate" on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method.\n\n'+debug_f(this.__v)),debug_b.call(this,n)},debug_preact_module/* options */.fF.__m=function(n,e){var o=n.type,t=e.map(function(n){return n&&n.localName}).filter(Boolean);console.error("Expected a DOM node of type "+o+" but found "+t.join(", ")+"as available DOM-node(s), this is caused by the SSR'd HTML containing different DOM-nodes compared to the hydrated one.\n\n"+debug_f(n))},function(){!function(){var n=debug_preact_module/* options */.fF.__b,o=debug_preact_module/* options */.fF.diffed,t=debug_preact_module/* options */.fF.__,r=debug_preact_module/* options */.fF.vnode,a=debug_preact_module/* options */.fF.__r;debug_preact_module/* options */.fF.diffed=function(n){debug_u(n)&&debug_s.pop(),debug_debug_module_i.pop(),o&&o(n)},debug_preact_module/* options */.fF.__b=function(e){debug_u(e)&&debug_debug_module_i.push(e),n&&n(e)},debug_preact_module/* options */.fF.__=function(n,e){debug_s=[],t&&t(n,e)},debug_preact_module/* options */.fF.vnode=function(n){n.__o=debug_s.length>0?debug_s[debug_s.length-1]:null,r&&r(n)},debug_preact_module/* options */.fF.__r=function(n){debug_u(n)&&debug_s.push(n),a&&a(n)}}();var n=!1,o=debug_preact_module/* options */.fF.__b,r=debug_preact_module/* options */.fF.diffed,c=debug_preact_module/* options */.fF.vnode,l=debug_preact_module/* options */.fF.__r,v=debug_preact_module/* options */.fF.__e,b=debug_preact_module/* options */.fF.__,g=debug_preact_module/* options */.fF.__h,E=debug_d?{useEffect:new WeakMap,useLayoutEffect:new WeakMap,lazyPropTypes:new WeakMap}:null,k=[];debug_preact_module/* options */.fF.__e=function(n,e,o,t){if(e&&e.__c&&"function"==typeof n.then){var r=n;n=new Error("Missing Suspense. The throwing component was: "+debug_a(e));for(var i=e;i;i=i.__)if(i.__c&&i.__c.__c){n=r;break}if(n instanceof Error)throw n}try{(t=t||{}).componentStack=debug_f(e),v(n,e,o,t),"function"!=typeof n.then&&setTimeout(function(){throw n})}catch(n){throw n}},debug_preact_module/* options */.fF.__=function(n,e){if(!e)throw new Error("Undefined parent passed to render(), this is the second argument.\nCheck if the element is available in the DOM/has the correct id.");var o;switch(e.nodeType){case 1:case 11:case 9:o=!0;break;default:o=!1}if(!o){var t=debug_a(n);throw new Error("Expected a valid HTML node as a second argument to render.\tReceived "+e+" instead: render(<"+t+" />, "+e+");")}b&&b(n,e)},debug_preact_module/* options */.fF.__b=function(e){var r=e.type;if(n=!0,void 0===r)throw new Error("Undefined component passed to createElement()\n\nYou likely forgot to export your component or might have mixed up default and named imports"+debug_w(e)+"\n\n"+debug_f(e));if(null!=r&&"object"==typeof r){if(void 0!==r.__k&&void 0!==r.__e)throw new Error("Invalid type passed to createElement(): "+r+"\n\nDid you accidentally pass a JSX literal as JSX twice?\n\n let My"+debug_a(e)+" = "+debug_w(r)+";\n let vnode = ;\n\nThis usually happens when you export a JSX literal and not the component.\n\n"+debug_f(e));throw new Error("Invalid type passed to createElement(): "+(Array.isArray(r)?"array":r))}if(void 0!==e.ref&&"function"!=typeof e.ref&&"object"!=typeof e.ref&&!("$$typeof"in e))throw new Error('Component\'s "ref" property should be a function, or an object created by createRef(), but got ['+typeof e.ref+"] instead\n"+debug_w(e)+"\n\n"+debug_f(e));if("string"==typeof e.type)for(var i in e.props)if("o"===i[0]&&"n"===i[1]&&"function"!=typeof e.props[i]&&null!=e.props[i])throw new Error("Component's \""+i+'" property should be a function, but got ['+typeof e.props[i]+"] instead\n"+debug_w(e)+"\n\n"+debug_f(e));if("function"==typeof e.type&&e.type.propTypes){if("Lazy"===e.type.displayName&&E&&!E.lazyPropTypes.has(e.type)){var s="PropTypes are not supported on lazy(). Use propTypes on the wrapped component itself. ";try{var c=e.type();E.lazyPropTypes.set(e.type,!0),console.warn(s+"Component wrapped in lazy() is "+debug_a(c))}catch(n){console.warn(s+"We will log the wrapped component's name once it is loaded.")}}var l=e.props;e.type.__f&&delete(l=function(n,e){for(var o in e)n[o]=e[o];return n}({},l)).ref,function(n,e,o,r,a){Object.keys(n).forEach(function(o){var i;try{i=n[o](e,o,r,"prop",null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(n){i=n}i&&!(i.message in debug_debug_module_t)&&(debug_debug_module_t[i.message]=!0,console.error("Failed prop type: "+i.message+(a&&"\n"+a()||"")))})}(e.type.propTypes,l,0,debug_a(e),function(){return debug_f(e)})}o&&o(e)};var T,_=0;debug_preact_module/* options */.fF.__r=function(e){l&&l(e),n=!0;var o=e.__c;if(o===T?_++:_=1,_>=25)throw new Error("Too many re-renders. This is limited to prevent an infinite loop which may lock up your browser. The component causing this is: "+debug_a(e));T=o},debug_preact_module/* options */.fF.__h=function(e,o,t){if(!e||!n)throw new Error("Hook can only be invoked from render methods.");g&&g(e,o,t)};var O=function(n,e){return{get:function(){var o="get"+n+e;k&&k.indexOf(o)<0&&(k.push(o),console.warn("getting vnode."+n+" is deprecated, "+e))},set:function(){var o="set"+n+e;k&&k.indexOf(o)<0&&(k.push(o),console.warn("setting vnode."+n+" is not allowed, "+e))}}},I={nodeName:O("nodeName","use vnode.type"),attributes:O("attributes","use vnode.props"),children:O("children","use vnode.props.children")},M=Object.create({},I);debug_preact_module/* options */.fF.vnode=function(n){var e=n.props;if(null!==n.type&&null!=e&&("__source"in e||"__self"in e)){var o=n.props={};for(var t in e){var r=e[t];"__source"===t?n.__source=r:"__self"===t?n.__self=r:o[t]=r}}n.__proto__=M,c&&c(n)},debug_preact_module/* options */.fF.diffed=function(e){var o,t=e.type,i=e.__;if(e.__k&&e.__k.forEach(function(n){if("object"==typeof n&&n&&void 0===n.type){var o=Object.keys(n).join(",");throw new Error("Objects are not valid as a child. Encountered an object with the keys {"+o+"}.\n\n"+debug_f(e))}}),e.__c===T&&(_=0),"string"==typeof t&&(debug_y(t)||"p"===t||"a"===t||"button"===t)){var s=debug_h(i);if(""!==s&&debug_y(t))"table"===t&&"td"!==s&&debug_y(s)?(console.log(s,i.__e),console.error("Improper nesting of table. Your should not have a table-node parent."+debug_w(e)+"\n\n"+debug_f(e))):"thead"!==t&&"tfoot"!==t&&"tbody"!==t||"table"===s?"tr"===t&&"thead"!==s&&"tfoot"!==s&&"tbody"!==s?console.error("Improper nesting of table. Your should have a parent."+debug_w(e)+"\n\n"+debug_f(e)):"td"===t&&"tr"!==s?console.error("Improper nesting of table. Your parent."+debug_w(e)+"\n\n"+debug_f(e)):"th"===t&&"tr"!==s&&console.error("Improper nesting of table. Your ."+debug_w(e)+"\n\n"+debug_f(e)):console.error("Improper nesting of table. Your should have a
    should have a
    should have a
    parent."+debug_w(e)+"\n\n"+debug_f(e));else if("p"===t){var c=debug_p(e).filter(function(n){return debug_m.test(n)});c.length&&console.error("Improper nesting of paragraph. Your

    should not have "+c.join(", ")+"as child-elements."+debug_w(e)+"\n\n"+debug_f(e))}else"a"!==t&&"button"!==t||-1!==debug_p(e).indexOf(t)&&console.error("Improper nesting of interactive content. Your <"+t+"> should not have other "+("a"===t?"anchor":"button")+" tags as child-elements."+debug_w(e)+"\n\n"+debug_f(e))}if(n=!1,r&&r(e),null!=e.__k)for(var l=[],u=0;u0?debug_debug_module_i[debug_debug_module_i.length-1]:null}var debug_l=!0;function debug_u(e){return"function"==typeof e.type&&e.type!=debug_preact_module/* Fragment */.FK}function debug_f(n){for(var e=[n],o=n;null!=o.__o;)e.push(o.__o),o=o.__o;return e.reduce(function(n,e){n+=" in "+debug_a(e);var o=e.__source;return o?n+=" (at "+o.fileName+":"+o.lineNumber+")":debug_l&&console.warn("Add @babel/plugin-transform-react-jsx-source to get a more detailed component stack. Note that you should not add it to production builds of your App for bundle size reasons."),debug_l=!1,n+"\n"},"")}var debug_d="function"==typeof WeakMap;function debug_p(n){var e=[];return n.__k?(n.__k.forEach(function(n){n&&"function"==typeof n.type?e.push.apply(e,debug_p(n)):n&&"string"==typeof n.type&&e.push(n.type)}),e):e}function debug_h(n){return n?"function"==typeof n.type?null==n.__?null!=n.__e&&null!=n.__e.parentNode?n.__e.parentNode.localName:"":debug_h(n.__):n.type:""}var debug_v=debug_preact_module/* Component */.uA.prototype.setState;function debug_y(n){return"table"===n||"tfoot"===n||"tbody"===n||"thead"===n||"td"===n||"tr"===n||"th"===n}debug_preact_module/* Component */.uA.prototype.setState=function(n,e){return null==this.__v&&null==this.state&&console.warn('Calling "this.setState" inside the constructor of a component is a no-op and might be a bug in your application. Instead, set "this.state = {}" directly.\n\n'+debug_f(debug_c())),debug_v.call(this,n,e)};var debug_m=/^(address|article|aside|blockquote|details|div|dl|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hgroup|hr|main|menu|nav|ol|p|pre|search|section|table|ul)$/,debug_b=debug_preact_module/* Component */.uA.prototype.forceUpdate;function debug_w(n){var e=n.props,o=debug_a(n),t="";for(var r in e)if(e.hasOwnProperty(r)&&"children"!==r){var i=e[r];"function"==typeof i&&(i="function "+(i.displayName||i.name)+"() {}"),i=Object(i)!==i||i.toString?i+"":Object.prototype.toString.call(i),t+=" "+r+"="+JSON.stringify(i)}var s=e.children;return"<"+o+t+(s&&s.length?">..":" />")}debug_preact_module/* Component */.uA.prototype.forceUpdate=function(n){return null==this.__v?console.warn('Calling "this.forceUpdate" inside the constructor of a component is a no-op and might be a bug in your application.\n\n'+debug_f(debug_c())):null==this.__P&&console.warn('Can\'t call "this.forceUpdate" on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method.\n\n'+debug_f(this.__v)),debug_b.call(this,n)},debug_preact_module/* options */.fF.__m=function(n,e){var o=n.type,t=e.map(function(n){return n&&n.localName}).filter(Boolean);console.error('Expected a DOM node of type "'+o+'" but found "'+t.join(", ")+"\" as available DOM-node(s), this is caused by the SSR'd HTML containing different DOM-nodes compared to the hydrated one.\n\n"+debug_f(n))},function(){!function(){var n=debug_preact_module/* options */.fF.__b,o=debug_preact_module/* options */.fF.diffed,t=debug_preact_module/* options */.fF.__,r=debug_preact_module/* options */.fF.vnode,a=debug_preact_module/* options */.fF.__r;debug_preact_module/* options */.fF.diffed=function(n){debug_u(n)&&debug_s.pop(),debug_debug_module_i.pop(),o&&o(n)},debug_preact_module/* options */.fF.__b=function(e){debug_u(e)&&debug_debug_module_i.push(e),n&&n(e)},debug_preact_module/* options */.fF.__=function(n,e){debug_s=[],t&&t(n,e)},debug_preact_module/* options */.fF.vnode=function(n){n.__o=debug_s.length>0?debug_s[debug_s.length-1]:null,r&&r(n)},debug_preact_module/* options */.fF.__r=function(n){debug_u(n)&&debug_s.push(n),a&&a(n)}}();var n=!1,o=debug_preact_module/* options */.fF.__b,r=debug_preact_module/* options */.fF.diffed,c=debug_preact_module/* options */.fF.vnode,l=debug_preact_module/* options */.fF.__r,v=debug_preact_module/* options */.fF.__e,b=debug_preact_module/* options */.fF.__,g=debug_preact_module/* options */.fF.__h,E=debug_d?{useEffect:new WeakMap,useLayoutEffect:new WeakMap,lazyPropTypes:new WeakMap}:null,k=[];debug_preact_module/* options */.fF.__e=function(n,e,o,t){if(e&&e.__c&&"function"==typeof n.then){var r=n;n=new Error("Missing Suspense. The throwing component was: "+debug_a(e));for(var i=e;i;i=i.__)if(i.__c&&i.__c.__c){n=r;break}if(n instanceof Error)throw n}try{(t=t||{}).componentStack=debug_f(e),v(n,e,o,t),"function"!=typeof n.then&&setTimeout(function(){throw n})}catch(n){throw n}},debug_preact_module/* options */.fF.__=function(n,e){if(!e)throw new Error("Undefined parent passed to render(), this is the second argument.\nCheck if the element is available in the DOM/has the correct id.");var o;switch(e.nodeType){case 1:case 11:case 9:o=!0;break;default:o=!1}if(!o){var t=debug_a(n);throw new Error("Expected a valid HTML node as a second argument to render.\tReceived "+e+" instead: render(<"+t+" />, "+e+");")}b&&b(n,e)},debug_preact_module/* options */.fF.__b=function(e){var r=e.type;if(n=!0,void 0===r)throw new Error("Undefined component passed to createElement()\n\nYou likely forgot to export your component or might have mixed up default and named imports"+debug_w(e)+"\n\n"+debug_f(e));if(null!=r&&"object"==typeof r){if(void 0!==r.__k&&void 0!==r.__e)throw new Error("Invalid type passed to createElement(): "+r+"\n\nDid you accidentally pass a JSX literal as JSX twice?\n\n let My"+debug_a(e)+" = "+debug_w(r)+";\n let vnode = ;\n\nThis usually happens when you export a JSX literal and not the component.\n\n"+debug_f(e));throw new Error("Invalid type passed to createElement(): "+(Array.isArray(r)?"array":r))}if(void 0!==e.ref&&"function"!=typeof e.ref&&"object"!=typeof e.ref&&!("$$typeof"in e))throw new Error('Component\'s "ref" property should be a function, or an object created by createRef(), but got ['+typeof e.ref+"] instead\n"+debug_w(e)+"\n\n"+debug_f(e));if("string"==typeof e.type)for(var i in e.props)if("o"===i[0]&&"n"===i[1]&&"function"!=typeof e.props[i]&&null!=e.props[i])throw new Error("Component's \""+i+'" property should be a function, but got ['+typeof e.props[i]+"] instead\n"+debug_w(e)+"\n\n"+debug_f(e));if("function"==typeof e.type&&e.type.propTypes){if("Lazy"===e.type.displayName&&E&&!E.lazyPropTypes.has(e.type)){var s="PropTypes are not supported on lazy(). Use propTypes on the wrapped component itself. ";try{var c=e.type();E.lazyPropTypes.set(e.type,!0),console.warn(s+"Component wrapped in lazy() is "+debug_a(c))}catch(n){console.warn(s+"We will log the wrapped component's name once it is loaded.")}}var l=e.props;e.type.__f&&delete(l=function(n,e){for(var o in e)n[o]=e[o];return n}({},l)).ref,function(n,e,o,r,a){Object.keys(n).forEach(function(o){var i;try{i=n[o](e,o,r,"prop",null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(n){i=n}i&&!(i.message in debug_debug_module_t)&&(debug_debug_module_t[i.message]=!0,console.error("Failed prop type: "+i.message+(a&&"\n"+a()||"")))})}(e.type.propTypes,l,0,debug_a(e),function(){return debug_f(e)})}o&&o(e)};var T,_=0;debug_preact_module/* options */.fF.__r=function(e){l&&l(e),n=!0;var o=e.__c;if(o===T?_++:_=1,_>=25)throw new Error("Too many re-renders. This is limited to prevent an infinite loop which may lock up your browser. The component causing this is: "+debug_a(e));T=o},debug_preact_module/* options */.fF.__h=function(e,o,t){if(!e||!n)throw new Error("Hook can only be invoked from render methods.");g&&g(e,o,t)};var O=function(n,e){return{get:function(){var o="get"+n+e;k&&k.indexOf(o)<0&&(k.push(o),console.warn("getting vnode."+n+" is deprecated, "+e))},set:function(){var o="set"+n+e;k&&k.indexOf(o)<0&&(k.push(o),console.warn("setting vnode."+n+" is not allowed, "+e))}}},I={nodeName:O("nodeName","use vnode.type"),attributes:O("attributes","use vnode.props"),children:O("children","use vnode.props.children")},M=Object.create({},I);debug_preact_module/* options */.fF.vnode=function(n){var e=n.props;if(null!==n.type&&null!=e&&("__source"in e||"__self"in e)){var o=n.props={};for(var t in e){var r=e[t];"__source"===t?n.__source=r:"__self"===t?n.__self=r:o[t]=r}}n.__proto__=M,c&&c(n)},debug_preact_module/* options */.fF.diffed=function(e){var o,t=e.type,i=e.__;if(e.__k&&e.__k.forEach(function(n){if("object"==typeof n&&n&&void 0===n.type){var o=Object.keys(n).join(",");throw new Error("Objects are not valid as a child. Encountered an object with the keys {"+o+"}.\n\n"+debug_f(e))}}),e.__c===T&&(_=0),"string"==typeof t&&(debug_y(t)||"p"===t||"a"===t||"button"===t)){var s=debug_h(i);if(""!==s&&debug_y(t))"table"===t&&"td"!==s&&debug_y(s)?(console.log(s,i.__e),console.error("Improper nesting of table. Your

    should not have a table-node parent."+debug_w(e)+"\n\n"+debug_f(e))):"thead"!==t&&"tfoot"!==t&&"tbody"!==t||"table"===s?"tr"===t&&"thead"!==s&&"tfoot"!==s&&"tbody"!==s?console.error("Improper nesting of table. Your should have a parent."+debug_w(e)+"\n\n"+debug_f(e)):"td"===t&&"tr"!==s?console.error("Improper nesting of table. Your parent."+debug_w(e)+"\n\n"+debug_f(e)):"th"===t&&"tr"!==s&&console.error("Improper nesting of table. Your ."+debug_w(e)+"\n\n"+debug_f(e)):console.error("Improper nesting of table. Your should have a
    should have a
    should have a
    parent."+debug_w(e)+"\n\n"+debug_f(e));else if("p"===t){var c=debug_p(e).filter(function(n){return debug_m.test(n)});c.length&&console.error("Improper nesting of paragraph. Your

    should not have "+c.join(", ")+" as child-elements."+debug_w(e)+"\n\n"+debug_f(e))}else"a"!==t&&"button"!==t||-1!==debug_p(e).indexOf(t)&&console.error("Improper nesting of interactive content. Your <"+t+"> should not have other "+("a"===t?"anchor":"button")+" tags as child-elements."+debug_w(e)+"\n\n"+debug_f(e))}if(n=!1,r&&r(e),null!=e.__k)for(var l=[],u=0;u{n.d(t,{zj:()=>ft,SD:()=>ve,V6:()=>ye,$K:()=>me,vT:()=>pt,jb:()=>Jt,yT:()=>we,M_:()=>dt,hb:()=>Oe,vJ:()=>Ee,ip:()=>xe,Nf:()=>Te,Kr:()=>Fe,li:()=>b,J0:()=>m,FH:()=>Se,v4:()=>ke});var r,o,i,s,a=n(622),u=0,l=[],c=a.fF,_=c.__b,f=c.__r,p=c.diffed,h=c.__c,d=c.unmount,v=c.__;function y(e,t){c.__h&&c.__h(o,e,u||t),u=0;var n=o.__H||(o.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function m(e){return u=1,function(e,t,n){var i=y(r++,2);if(i.t=e,!i.__c&&(i.__=[n?n(t):N(void 0,t),function(e){var t=i.__N?i.__N[0]:i.__[0],n=i.t(t,e);t!==n&&(i.__N=[n,i.__[1]],i.__c.setState({}))}],i.__c=o,!o.u)){var s=function(e,t,n){if(!i.__c.__H)return!0;var r=i.__c.__H.__.filter((function(e){return!!e.__c}));if(r.every((function(e){return!e.__N})))return!a||a.call(this,e,t,n);var o=!1;return r.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}})),!(!o&&i.__c.props===e)&&(!a||a.call(this,e,t,n))};o.u=!0;var a=o.shouldComponentUpdate,u=o.componentWillUpdate;o.componentWillUpdate=function(e,t,n){if(this.__e){var r=a;a=void 0,s(e,t,n),a=r}u&&u.call(this,e,t,n)},o.shouldComponentUpdate=s}return i.__N||i.__}(N,e)}function g(e,t){var n=y(r++,3);!c.__s&&C(n.__H,t)&&(n.__=e,n.i=t,o.__H.__h.push(n))}function w(e,t){var n=y(r++,4);!c.__s&&C(n.__H,t)&&(n.__=e,n.i=t,o.__h.push(n))}function b(e){return u=5,k((function(){return{current:e}}),[])}function k(e,t){var n=y(r++,7);return C(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function S(e,t){return u=8,k((function(){return e}),t)}function x(e){var t=o.context[e.__c],n=y(r++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(o)),t.props.value):e.__}function E(){for(var e;e=l.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(F),e.__H.__h.forEach(P),e.__H.__h=[]}catch(t){e.__H.__h=[],c.__e(t,e.__v)}}c.__b=function(e){o=null,_&&_(e)},c.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),v&&v(e,t)},c.__r=function(e){f&&f(e),r=0;var t=(o=e.__c).__H;t&&(i===o?(t.__h=[],o.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.i=e.__N=void 0}))):(t.__h.forEach(F),t.__h.forEach(P),t.__h=[],r=0)),i=o},c.diffed=function(e){p&&p(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==l.push(t)&&s===c.requestAnimationFrame||((s=c.requestAnimationFrame)||O)(E)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.i=void 0}))),i=o=null},c.__c=function(e,t){t.some((function(e){try{e.__h.forEach(F),e.__h=e.__h.filter((function(e){return!e.__||P(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],c.__e(n,e.__v)}})),h&&h(e,t)},c.unmount=function(e){d&&d(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{F(e)}catch(e){t=e}})),n.__H=void 0,t&&c.__e(t,n.__v))};var T="function"==typeof requestAnimationFrame;function O(e){var t,n=function(){clearTimeout(r),T&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);T&&(t=requestAnimationFrame(n))}function F(e){var t=o,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),o=t}function P(e){var t=o;e.__c=e.__(),o=t}function C(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function N(e,t){return"function"==typeof t?t(e):t}var j=Symbol.for("preact-signals");function M(){if(W>1)W--;else{for(var e,t=!1;void 0!==A;){var n=A;for(A=void 0,L++;void 0!==n;){var r=n.o;if(n.o=void 0,n.f&=-3,!(8&n.f)&&V(n))try{n.c()}catch(n){t||(e=n,t=!0)}n=r}}if(L=0,W--,t)throw e}}function H(e){if(W>0)return e();W++;try{return e()}finally{M()}}var $=void 0;var U,A=void 0,W=0,L=0,D=0;function I(e){if(void 0!==$){var t=e.n;if(void 0===t||t.t!==$)return t={i:0,S:e,p:$.s,n:void 0,t:$,e:void 0,x:void 0,r:t},void 0!==$.s&&($.s.n=t),$.s=t,e.n=t,32&$.f&&e.S(t),t;if(-1===t.i)return t.i=0,void 0!==t.n&&(t.n.p=t.p,void 0!==t.p&&(t.p.n=t.n),t.p=$.s,t.n=void 0,$.s.n=t,$.s=t),t}}function R(e){this.v=e,this.i=0,this.n=void 0,this.t=void 0}function z(e){return new R(e)}function V(e){for(var t=e.s;void 0!==t;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function B(e){for(var t=e.s;void 0!==t;t=t.n){var n=t.S.n;if(void 0!==n&&(t.r=n),t.S.n=t,t.i=-1,void 0===t.n){e.s=t;break}}}function J(e){for(var t=e.s,n=void 0;void 0!==t;){var r=t.p;-1===t.i?(t.S.U(t),void 0!==r&&(r.n=t.n),void 0!==t.n&&(t.n.p=r)):n=t,t.S.n=t.r,void 0!==t.r&&(t.r=void 0),t=r}e.s=n}function K(e){R.call(this,void 0),this.x=e,this.s=void 0,this.g=D-1,this.f=4}function q(e){return new K(e)}function Y(e){var t=e.u;if(e.u=void 0,"function"==typeof t){W++;var n=$;$=void 0;try{t()}catch(t){throw e.f&=-2,e.f|=8,X(e),t}finally{$=n,M()}}}function X(e){for(var t=e.s;void 0!==t;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Y(e)}function G(e){if($!==this)throw new Error("Out-of-order effect");J(this),$=e,this.f&=-2,8&this.f&&X(this),M()}function Q(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}function Z(e){var t=new Q(e);try{t.c()}catch(e){throw t.d(),e}return t.d.bind(t)}function ee(e,t){a.fF[e]=t.bind(null,a.fF[e]||function(){})}function te(e){U&&U(),U=e&&e.S()}function ne(e){var t=this,n=e.data,r=function(e){return k((function(){return z(e)}),[])}(n);r.value=n;var o=k((function(){for(var e=t.__v;e=e.__;)if(e.__c){e.__c.__$f|=4;break}return t.__$u.c=function(){var e;(0,a.zO)(o.peek())||3!==(null==(e=t.base)?void 0:e.nodeType)?(t.__$f|=1,t.setState({})):t.base.data=o.peek()},q((function(){var e=r.value.value;return 0===e?0:!0===e?"":e||""}))}),[]);return o.value}function re(e,t,n,r){var o=t in e&&void 0===e.ownerSVGElement,i=z(n);return{o:function(e,t){i.value=e,r=t},d:Z((function(){var n=i.value.value;r[t]!==n&&(r[t]=n,o?e[t]=n:n?e.setAttribute(t,n):e.removeAttribute(t))}))}}R.prototype.brand=j,R.prototype.h=function(){return!0},R.prototype.S=function(e){this.t!==e&&void 0===e.e&&(e.x=this.t,void 0!==this.t&&(this.t.e=e),this.t=e)},R.prototype.U=function(e){if(void 0!==this.t){var t=e.e,n=e.x;void 0!==t&&(t.x=n,e.e=void 0),void 0!==n&&(n.e=t,e.x=void 0),e===this.t&&(this.t=n)}},R.prototype.subscribe=function(e){var t=this;return Z((function(){var n=t.value,r=$;$=void 0;try{e(n)}finally{$=r}}))},R.prototype.valueOf=function(){return this.value},R.prototype.toString=function(){return this.value+""},R.prototype.toJSON=function(){return this.value},R.prototype.peek=function(){var e=$;$=void 0;try{return this.value}finally{$=e}},Object.defineProperty(R.prototype,"value",{get:function(){var e=I(this);return void 0!==e&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(L>100)throw new Error("Cycle detected");this.v=e,this.i++,D++,W++;try{for(var t=this.t;void 0!==t;t=t.x)t.t.N()}finally{M()}}}}),(K.prototype=new R).h=function(){if(this.f&=-3,1&this.f)return!1;if(32==(36&this.f))return!0;if(this.f&=-5,this.g===D)return!0;if(this.g=D,this.f|=1,this.i>0&&!V(this))return this.f&=-2,!0;var e=$;try{B(this),$=this;var t=this.x();(16&this.f||this.v!==t||0===this.i)&&(this.v=t,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return $=e,J(this),this.f&=-2,!0},K.prototype.S=function(e){if(void 0===this.t){this.f|=36;for(var t=this.s;void 0!==t;t=t.n)t.S.S(t)}R.prototype.S.call(this,e)},K.prototype.U=function(e){if(void 0!==this.t&&(R.prototype.U.call(this,e),void 0===this.t)){this.f&=-33;for(var t=this.s;void 0!==t;t=t.n)t.S.U(t)}},K.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;void 0!==e;e=e.x)e.t.N()}},Object.defineProperty(K.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=I(this);if(this.h(),void 0!==e&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),Q.prototype.c=function(){var e=this.S();try{if(8&this.f)return;if(void 0===this.x)return;var t=this.x();"function"==typeof t&&(this.u=t)}finally{e()}},Q.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,Y(this),B(this),W++;var e=$;return $=this,G.bind(this,e)},Q.prototype.N=function(){2&this.f||(this.f|=2,this.o=A,A=this)},Q.prototype.d=function(){this.f|=8,1&this.f||X(this)},ne.displayName="_st",Object.defineProperties(R.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:ne},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}}),ee("__b",(function(e,t){if("string"==typeof t.type){var n,r=t.props;for(var o in r)if("children"!==o){var i=r[o];i instanceof R&&(n||(t.__np=n={}),n[o]=i,r[o]=i.peek())}}e(t)})),ee("__r",(function(e,t){te();var n,r=t.__c;r&&(r.__$f&=-2,void 0===(n=r.__$u)&&(r.__$u=n=function(){var e;return Z((function(){e=this})),e.c=function(){r.__$f|=1,r.setState({})},e}())),te(n),e(t)})),ee("__e",(function(e,t,n,r){te(),e(t,n,r)})),ee("diffed",(function(e,t){var n;if(te(),"string"==typeof t.type&&(n=t.__e)){var r=t.__np,o=t.props;if(r){var i=n.U;if(i)for(var s in i){var a=i[s];void 0===a||s in r||(a.d(),i[s]=void 0)}else n.U=i={};for(var u in r){var l=i[u],c=r[u];void 0===l?(l=re(n,u,c,o),i[u]=l):l.o(c,o)}}}e(t)})),ee("unmount",(function(e,t){if("string"==typeof t.type){var n=t.__e;if(n){var r=n.U;if(r)for(var o in n.U=void 0,r){var i=r[o];i&&i.d()}}}else{var s=t.__c;if(s){var a=s.__$u;a&&(s.__$u=void 0,a.d())}}e(t)})),ee("__h",(function(e,t,n,r){(r<3||9===r)&&(t.__$f|=2),e(t,n,r)})),a.uA.prototype.shouldComponentUpdate=function(e,t){var n=this.__$u;if(!(n&&void 0!==n.s||4&this.__$f))return!0;if(3&this.__$f)return!0;for(var r in t)return!0;for(var o in e)if("__source"!==o&&e[o]!==this.props[o])return!0;for(var i in this.props)if(!(i in e))return!0;return!1};const oe=[],ie=()=>oe.slice(-1)[0],se=e=>{oe.push(e)},ae=()=>{oe.pop()},ue=[],le=()=>ue.slice(-1)[0],ce=e=>{ue.push(e)},_e=()=>{ue.pop()},fe=new WeakMap,pe=()=>{throw new Error("Please use `data-wp-bind` to modify the attributes of an element.")},he={get(e,t,n){const r=Reflect.get(e,t,n);return r&&"object"==typeof r?de(r):r},set:pe,deleteProperty:pe},de=e=>(fe.has(e)||fe.set(e,new Proxy(e,he)),fe.get(e)),ve=e=>le().context[e||ie()],ye=()=>{const e=le();const{ref:t,attributes:n}=e;return Object.freeze({ref:t.current,attributes:de(n)})},me=e=>le().serverContext[e||ie()],ge=e=>new Promise((t=>{const n=()=>{clearTimeout(r),window.cancelAnimationFrame(o),setTimeout((()=>{e(),t()}))},r=setTimeout(n,100),o=window.requestAnimationFrame(n)})),we=()=>new Promise((e=>{setTimeout(e,0)}));function be(e){g((()=>{let t=null,n=!1;return t=function(e,t){let n=()=>{};const r=Z((function(){return n=this.c.bind(this),this.x=e,this.c=t,e()}));return{flush:n,dispose:r}}(e,(async()=>{t&&!n&&(n=!0,await ge(t.flush),n=!1)})),t.dispose}),[])}function ke(e){const t=le(),n=ie();return"GeneratorFunction"===e?.constructor?.name?async(...r)=>{const o=e(...r);let i,s;for(;;){se(n),ce(t);try{s=o.next(i)}finally{_e(),ae()}try{i=await s.value}catch(e){se(n),ce(t),o.throw(e)}finally{_e(),ae()}if(s.done)break}return i}:(...r)=>{se(n),ce(t);try{return e(...r)}finally{ae(),_e()}}}function Se(e){be(ke(e))}function xe(e){g(ke(e),[])}function Ee(e,t){g(ke(e),t)}function Te(e,t){w(ke(e),t)}function Oe(e,t){return S(ke(e),t)}function Fe(e,t){return k(ke(e),t)}new Set;const Pe=e=>{0},Ce=e=>Boolean(e&&"object"==typeof e&&e.constructor===Object),Ne=new WeakMap,je=new WeakMap,Me=new WeakMap,He=new Set([Object,Array]),$e=(e,t,n)=>{if(!We(t))throw Error("This object cannot be proxified.");if(!Ne.has(t)){const r=new Proxy(t,n);Ne.set(t,r),je.set(r,t),Me.set(r,e)}return Ne.get(t)},Ue=e=>Ne.get(e),Ae=e=>Me.get(e),We=e=>"object"==typeof e&&null!==e&&(!Me.has(e)&&He.has(e.constructor)),Le={};class De{constructor(e){this.owner=e,this.computedsByScope=new WeakMap}setValue(e){this.update({value:e})}setGetter(e){this.update({get:e})}getComputed(){const e=le()||Le;if(this.valueSignal||this.getterSignal||this.update({}),!this.computedsByScope.has(e)){const t=()=>{const e=this.getterSignal?.value;return e?e.call(this.owner):this.valueSignal?.value};se(Ae(this.owner)),this.computedsByScope.set(e,q(ke(t))),ae()}return this.computedsByScope.get(e)}update({get:e,value:t}){this.valueSignal?t===this.valueSignal.peek()&&e===this.getterSignal.peek()||H((()=>{this.valueSignal.value=t,this.getterSignal.value=e})):(this.valueSignal=z(t),this.getterSignal=z(e))}}const Ie=new Set(Object.getOwnPropertyNames(Symbol).map((e=>Symbol[e])).filter((e=>"symbol"==typeof e))),Re=new WeakMap,ze=(e,t)=>Re.has(e)&&Re.get(e).has(t),Ve=new WeakSet,Be=(e,t,n)=>{Re.has(e)||Re.set(e,new Map),t="number"==typeof t?`${t}`:t;const r=Re.get(e);if(!r.has(t)){const o=Ae(e),i=new De(e);if(r.set(t,i),n){const{get:t,value:r}=n;if(t)i.setGetter(t);else{const t=Ve.has(e);i.setValue(We(r)?Ye(o,r,{readOnly:t}):r)}}}return r.get(t)},Je=new WeakMap;let Ke=!1;const qe={get(e,t,n){if(Ke||!e.hasOwnProperty(t)&&t in e||"symbol"==typeof t&&Ie.has(t))return Reflect.get(e,t,n);const r=Object.getOwnPropertyDescriptor(e,t),o=Be(n,t,r).getComputed().value;if("function"==typeof o){const e=Ae(n);return(...t)=>{se(e);try{return o.call(n,...t)}finally{ae()}}}return o},set(e,t,n,r){if(Ve.has(r))return!1;se(Ae(r));try{return Reflect.set(e,t,n,r)}finally{ae()}},defineProperty(e,t,n){if(Ve.has(Ue(e)))return!1;const r=!(t in e),o=Reflect.defineProperty(e,t,n);if(o){const o=Ue(e),i=Be(o,t),{get:s,value:a}=n;if(s)i.setGetter(s);else{const e=Ae(o);i.setValue(We(a)?Ye(e,a):a)}if(r&&Je.has(e)&&Je.get(e).value++,Array.isArray(e)&&Re.get(o)?.has("length")){Be(o,"length").setValue(e.length)}}return o},deleteProperty(e,t){if(Ve.has(Ue(e)))return!1;const n=Reflect.deleteProperty(e,t);if(n){Be(Ue(e),t).setValue(void 0),Je.has(e)&&Je.get(e).value++}return n},ownKeys:e=>(Je.has(e)||Je.set(e,z(0)),Je._=Je.get(e).value,Reflect.ownKeys(e))},Ye=(e,t,n)=>{const r=$e(e,t,qe);return n?.readOnly&&Ve.add(r),r},Xe=(e,t,n=!0)=>{if(!Ce(e)||!Ce(t))return;let r=!1;for(const o in t){const i=!(o in e);r=r||i;const s=Object.getOwnPropertyDescriptor(t,o),a=Ue(e),u=!!a&&ze(a,o)&&Be(a,o);if("function"==typeof s.get||"function"==typeof s.set)(n||i)&&(Object.defineProperty(e,o,{...s,configurable:!0,enumerable:!0}),s.get&&u&&u.setGetter(s.get));else if(Ce(t[o])){if((i||n&&!Ce(e[o]))&&(e[o]={},u)){const t=Ae(a);u.setValue(Ye(t,e[o]))}Ce(e[o])&&Xe(e[o],t[o],n)}else if((n||i)&&(Object.defineProperty(e,o,s),u)){const{value:e}=s,t=Ae(a);u.setValue(We(e)?Ye(t,e):e)}}r&&Je.has(e)&&Je.get(e).value++},Ge=(e,t,n=!0)=>H((()=>{return Xe((r=e,je.get(r)||e),t,n);var r})),Qe=new WeakSet,Ze={get:(e,t,n)=>{const r=Reflect.get(e,t),o=Ae(n);if(void 0===r&&Qe.has(n)){const n={};return Reflect.set(e,t,n),et(o,n,!1)}if("function"==typeof r){se(o);const e=ke(r);return ae(),e}return Ce(r)&&We(r)?et(o,r,!1):r}},et=(e,t,n=!0)=>{const r=$e(e,t,Ze);return r&&n&&Qe.add(r),r},tt=new WeakMap,nt=new WeakMap,rt=new WeakSet,ot=Reflect.getOwnPropertyDescriptor,it={get:(e,t)=>{const n=nt.get(e),r=e[t];return t in e?r:n[t]},set:(e,t,n)=>{const r=nt.get(e);return(t in e||!(t in r)?e:r)[t]=n,!0},ownKeys:e=>[...new Set([...Object.keys(nt.get(e)),...Object.keys(e)])],getOwnPropertyDescriptor:(e,t)=>ot(e,t)||ot(nt.get(e),t)},st=(e,t={})=>{if(rt.has(e))throw Error("This object cannot be proxified.");if(nt.set(e,t),!tt.has(e)){const t=new Proxy(e,it);tt.set(e,t),rt.add(t)}return tt.get(e)},at=new Map,ut=new Map,lt=new Map,ct=new Map,_t=new Map,ft=e=>ct.get(e||ie())||{},pt=e=>{const t=e||ie();return _t.has(t)||_t.set(t,Ye(t,{},{readOnly:!0})),_t.get(t)},ht="I acknowledge that using a private store means my plugin will inevitably break on the next store release.";function dt(e,{state:t={},...n}={},{lock:r=!1}={}){if(at.has(e)){if(r===ht||lt.has(e)){const t=lt.get(e);if(!(r===ht||!0!==r&&r===t))throw t?Error("Cannot unlock a private store with an invalid lock code"):Error("Cannot lock a public store")}else lt.set(e,r);const o=ut.get(e);Ge(o,n),Ge(o.state,t)}else{r!==ht&<.set(e,r);const o={state:Ye(e,Ce(t)?t:{}),...n},i=et(e,o);ut.set(e,o),at.set(e,i)}return at.get(e)}const vt=(e=document)=>{var t;const n=null!==(t=e.getElementById("wp-script-module-data-@wordpress/interactivity"))&&void 0!==t?t:e.getElementById("wp-interactivity-data");if(n?.textContent)try{return JSON.parse(n.textContent)}catch{}return{}},yt=e=>{Ce(e?.state)&&Object.entries(e.state).forEach((([e,t])=>{const n=dt(e,{},{lock:ht});Ge(n.state,t,!1),Ge(pt(e),t)})),Ce(e?.config)&&Object.entries(e.config).forEach((([e,t])=>{ct.set(e,t)}))},mt=vt();function gt(e){return null!==e.suffix}function wt(e){return null===e.suffix}yt(mt);const bt=(0,a.q6)({client:{},server:{}}),kt={},St={},xt=(e,t,{priority:n=10}={})=>{kt[e]=t,St[e]=n},Et=({scope:e})=>(t,...n)=>{let{value:r,namespace:o}=t;if("string"!=typeof r)throw new Error("The `value` prop should be a string path");const i="!"===r[0]&&!!(r=r.slice(1));ce(e);const s=((e,t)=>{if(!t)return void Pe();let n=at.get(t);void 0===n&&(n=dt(t,void 0,{lock:ht}));const r={...n,context:le().context[t]};try{return e.split(".").reduce(((e,t)=>e[t]),r)}catch(e){}})(r,o),a="function"==typeof s?s(...n):s;return _e(),i?!a:a},Tt=({directives:e,priorityLevels:[t,...n],element:r,originalProps:o,previousScope:i})=>{const s=b({}).current;s.evaluate=S(Et({scope:s}),[]);const{client:u,server:l}=x(bt);s.context=u,s.serverContext=l,s.ref=i?.ref||b(null),r=(0,a.Ob)(r,{ref:s.ref}),s.attributes=r.props;const c=n.length>0?(0,a.h)(Tt,{directives:e,priorityLevels:n,element:r,originalProps:o,previousScope:s}):r,_={...o,children:c},f={directives:e,props:_,element:r,context:bt,evaluate:s.evaluate};ce(s);for(const e of t){const t=kt[e]?.(f);void 0!==t&&(_.children=t)}return _e(),_.children},Ot=a.fF.vnode;function Ft(e){return Ce(e)?Object.fromEntries(Object.entries(e).map((([e,t])=>[e,Ft(t)]))):Array.isArray(e)?e.map((e=>Ft(e))):e}a.fF.vnode=e=>{if(e.props.__directives){const t=e.props,n=t.__directives;n.key&&(e.key=n.key.find(wt).value),delete t.__directives;const r=(e=>{const t=Object.keys(e).reduce(((e,t)=>{if(kt[t]){const n=St[t];(e[n]=e[n]||[]).push(t)}return e}),{});return Object.entries(t).sort((([e],[t])=>parseInt(e)-parseInt(t))).map((([,e])=>e))})(n);r.length>0&&(e.props={directives:n,priorityLevels:r,originalProps:t,type:e.type,element:(0,a.h)(e.type,t),top:!0},e.type=Tt)}Ot&&Ot(e)};const Pt=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,Ct=/\/\*[^]*?\*\/| +/g,Nt=/\n+/g,jt=e=>({directives:t,evaluate:n})=>{t[`on-${e}`].filter(gt).forEach((t=>{const r=t.suffix.split("--",1)[0];xe((()=>{const o=e=>n(t,e),i="window"===e?window:document;return i.addEventListener(r,o),()=>i.removeEventListener(r,o)}))}))},Mt=e=>({directives:t,evaluate:n})=>{t[`on-async-${e}`].filter(gt).forEach((t=>{const r=t.suffix.split("--",1)[0];xe((()=>{const o=async e=>{await we(),n(t,e)},i="window"===e?window:document;return i.addEventListener(r,o,{passive:!0}),()=>i.removeEventListener(r,o)}))}))},Ht="wp",$t=`data-${Ht}-ignore`,Ut=`data-${Ht}-interactive`,At=`data-${Ht}-`,Wt=[],Lt=new RegExp(`^data-${Ht}-([a-z0-9]+(?:-[a-z0-9]+)*)(?:--([a-z0-9_-]+))?$`,"i"),Dt=/^([\w_\/-]+)::(.+)$/,It=new WeakSet;function Rt(e){const t=document.createTreeWalker(e,205);return function e(n){const{nodeType:r}=n;if(3===r)return[n.data];if(4===r){var o;const e=t.nextSibling();return n.replaceWith(new window.Text(null!==(o=n.nodeValue)&&void 0!==o?o:"")),[n.nodeValue,e]}if(8===r||7===r){const e=t.nextSibling();return n.remove(),[null,e]}const i=n,{attributes:s}=i,u=i.localName,l={},c=[],_=[];let f=!1,p=!1;for(let e=0;e{const o=Lt.exec(t);if(null===o)return Pe(),e;const i=o[1]||"",s=o[2]||null;var a;return e[i]=e[i]||[],e[i].push({namespace:null!=n?n:null!==(a=Wt[Wt.length-1])&&void 0!==a?a:null,value:r,suffix:s}),e}),{})),"template"===u)l.content=[...i.content.childNodes].map((e=>Rt(e)));else{let n=t.firstChild();if(n){for(;n;){const[r,o]=e(n);r&&c.push(r),n=o||t.nextSibling()}t.parentNode()}}return p&&Wt.pop(),[(0,a.h)(u,l,c)]}(t.currentNode)}const zt=new WeakMap,Vt=e=>{if(!e.parentElement)throw Error("The passed region should be an element with a parent.");return zt.has(e)||zt.set(e,((e,t)=>{const n=(t=[].concat(t))[t.length-1].nextSibling;function r(t,r){e.insertBefore(t,r||n)}return e.__k={nodeType:1,parentNode:e,firstChild:t[0],childNodes:t,insertBefore:r,appendChild:r,removeChild(t){e.removeChild(t)}}})(e.parentElement,e)),zt.get(e)},Bt=new WeakMap,Jt=e=>{if("I acknowledge that using private APIs means my theme or plugin will inevitably break in the next version of WordPress."===e)return{directivePrefix:Ht,getRegionRootFragment:Vt,initialVdom:Bt,toVdom:Rt,directive:xt,getNamespace:ie,h:a.h,cloneElement:a.Ob,render:a.XX,proxifyState:Ye,parseServerData:vt,populateServerData:yt,batch:H};throw new Error("Forbidden access.")};xt("context",(({directives:{context:e},props:{children:t},context:n})=>{const{Provider:r}=n,o=e.find(wt),{client:i,server:s}=x(n),u=o.namespace,l=b(Ye(u,{})),c=b(Ye(u,{},{readOnly:!0})),_=k((()=>{const e={client:{...i},server:{...s}};if(o){const{namespace:t,value:n}=o;Ce(n)||Pe(),Ge(l.current,Ft(n),!1),Ge(c.current,Ft(n)),e.client[t]=st(l.current,i[t]),e.server[t]=st(c.current,s[t])}return e}),[o,i,s]);return(0,a.h)(r,{value:_},t)}),{priority:5}),xt("watch",(({directives:{watch:e},evaluate:t})=>{e.forEach((e=>{Se((()=>t(e)))}))})),xt("init",(({directives:{init:e},evaluate:t})=>{e.forEach((e=>{xe((()=>t(e)))}))})),xt("on",(({directives:{on:e},element:t,evaluate:n})=>{const r=new Map;e.filter(gt).forEach((e=>{const t=e.suffix.split("--")[0];r.has(t)||r.set(t,new Set),r.get(t).add(e)})),r.forEach(((e,r)=>{const o=t.props[`on${r}`];t.props[`on${r}`]=t=>{e.forEach((e=>{o&&o(t),n(e,t)}))}}))})),xt("on-async",(({directives:{"on-async":e},element:t,evaluate:n})=>{const r=new Map;e.filter(gt).forEach((e=>{const t=e.suffix.split("--")[0];r.has(t)||r.set(t,new Set),r.get(t).add(e)})),r.forEach(((e,r)=>{const o=t.props[`on${r}`];t.props[`on${r}`]=t=>{o&&o(t),e.forEach((async e=>{await we(),n(e,t)}))}}))})),xt("on-window",jt("window")),xt("on-document",jt("document")),xt("on-async-window",Mt("window")),xt("on-async-document",Mt("document")),xt("class",(({directives:{class:e},element:t,evaluate:n})=>{e.filter(gt).forEach((e=>{const r=e.suffix,o=n(e),i=t.props.class||"",s=new RegExp(`(^|\\s)${r}(\\s|$)`,"g");o?s.test(i)||(t.props.class=i?`${i} ${r}`:r):t.props.class=i.replace(s," ").trim(),xe((()=>{o?t.ref.current.classList.add(r):t.ref.current.classList.remove(r)}))}))})),xt("style",(({directives:{style:e},element:t,evaluate:n})=>{e.filter(gt).forEach((e=>{const r=e.suffix,o=n(e);t.props.style=t.props.style||{},"string"==typeof t.props.style&&(t.props.style=(e=>{const t=[{}];let n,r;for(;n=Pt.exec(e.replace(Ct,""));)n[4]?t.shift():n[3]?(r=n[3].replace(Nt," ").trim(),t.unshift(t[0][r]=t[0][r]||{})):t[0][n[1]]=n[2].replace(Nt," ").trim();return t[0]})(t.props.style)),o?t.props.style[r]=o:delete t.props.style[r],xe((()=>{o?t.ref.current.style[r]=o:t.ref.current.style.removeProperty(r)}))}))})),xt("bind",(({directives:{bind:e},element:t,evaluate:n})=>{e.filter(gt).forEach((e=>{const r=e.suffix,o=n(e);t.props[r]=o,xe((()=>{const e=t.ref.current;if("style"!==r){if("width"!==r&&"height"!==r&&"href"!==r&&"list"!==r&&"form"!==r&&"tabIndex"!==r&&"download"!==r&&"rowSpan"!==r&&"colSpan"!==r&&"role"!==r&&r in e)try{return void(e[r]=null==o?"":o)}catch(e){}null==o||!1===o&&"-"!==r[4]?e.removeAttribute(r):e.setAttribute(r,o)}else"string"==typeof o&&(e.style.cssText=o)}))}))})),xt("ignore",(({element:{type:e,props:{innerHTML:t,...n}}})=>{const r=k((()=>t),[]);return(0,a.h)(e,{dangerouslySetInnerHTML:{__html:r},...n})})),xt("text",(({directives:{text:e},element:t,evaluate:n})=>{const r=e.find(wt);if(r)try{const e=n(r);t.props.children="object"==typeof e?null:e.toString()}catch(e){t.props.children=null}else t.props.children=null})),xt("run",(({directives:{run:e},evaluate:t})=>{e.forEach((e=>t(e)))})),xt("each",(({directives:{each:e,"each-key":t},context:n,element:r,evaluate:o})=>{if("template"!==r.type)return;const{Provider:i}=n,s=x(n),[u]=e,{namespace:l}=u,c=o(u),_=gt(u)?u.suffix.replace(/^-+|-+$/g,"").toLowerCase().replace(/-([a-z])/g,(function(e,t){return t.toUpperCase()})):"item";return c.map((e=>{const n=st(Ye(l,{}),s.client[l]),o={client:{...s.client,[l]:n},server:{...s.server}};o.client[l][_]=e;const u={...le(),context:o.client,serverContext:o.server},c=t?Et({scope:u})(t[0]):e;return(0,a.h)(i,{value:o,key:c},r.props.content)}))}),{priority:20}),xt("each-child",(()=>null),{priority:1}),(async()=>{const e=document.querySelectorAll(`[data-${Ht}-interactive]`);for(const t of e)if(!It.has(t)){await we();const e=Vt(t),n=Rt(t);Bt.set(t,n),await we(),(0,a.Qv)(n,e)}})()},622:(e,t,n)=>{n.d(t,{FK:()=>S,Ob:()=>V,Qv:()=>z,XX:()=>R,fF:()=>o,h:()=>b,q6:()=>B,uA:()=>x,zO:()=>s});var r,o,i,s,a,u,l,c,_,f,p,h,d={},v=[],y=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,m=Array.isArray;function g(e,t){for(var n in t)e[n]=t[n];return e}function w(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function b(e,t,n){var o,i,s,a={};for(s in t)"key"==s?o=t[s]:"ref"==s?i=t[s]:a[s]=t[s];if(arguments.length>2&&(a.children=arguments.length>3?r.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(s in e.defaultProps)void 0===a[s]&&(a[s]=e.defaultProps[s]);return k(e,a,o,i,null)}function k(e,t,n,r,s){var a={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==s?++i:s,__i:-1,__u:0};return null==s&&null!=o.vnode&&o.vnode(a),a}function S(e){return e.children}function x(e,t){this.props=e,this.context=t}function E(e,t){if(null==t)return e.__?E(e.__,e.__i+1):null;for(var n;tt&&a.sort(c));F.__r=0}function P(e,t,n,r,o,i,s,a,u,l,c){var _,f,p,h,y,m=r&&r.__k||v,g=t.length;for(n.__d=u,C(n,t,m),u=n.__d,_=0;_0?k(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=e,o.__b=e.__b+1,i=null,-1!==(a=o.__i=j(o,n,s,c))&&(c--,(i=n[a])&&(i.__u|=131072)),null==i||null===i.__v?(-1==a&&_--,"function"!=typeof o.type&&(o.__u|=65536)):a!==s&&(a==s-1?_--:a==s+1?_++:(a>s?_--:_++,o.__u|=65536))):o=e.__k[r]=null;if(c)for(r=0;r(null==u||131072&u.__u?0:1))for(;s>=0||a=0){if((u=t[s])&&!(131072&u.__u)&&o==u.key&&i===u.type)return s;s--}if(a2&&(u.children=arguments.length>3?r.call(arguments,2):n),k(e.type,u,o||e.key,i||e.ref,null)}function B(e,t){var n={__c:t="__cC"+h++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,r;return this.getChildContext||(n=new Set,(r={})[t]=this,this.getChildContext=function(){return r},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.forEach((function(e){e.__e=!0,O(e)}))},this.sub=function(e){n.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n&&n.delete(e),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}r=v.slice,o={__e:function(e,t,n,r){for(var o,i,s;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&null!=i.getDerivedStateFromError&&(o.setState(i.getDerivedStateFromError(e)),s=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(e,r||{}),s=o.__d),s)return o.__E=o}catch(t){e=t}throw e}},i=0,s=function(e){return null!=e&&null==e.constructor},x.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=g({},this.state),"function"==typeof e&&(e=e(g({},n),this.props)),e&&g(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),O(this))},x.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),O(this))},x.prototype.render=S,a=[],l="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,c=function(e,t){return e.__v.__b-t.__v.__b},F.__r=0,_=0,f=$(!1),p=$(!0),h=0}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var r={};n.d(r,{zj:()=>k.zj,SD:()=>k.SD,V6:()=>k.V6,$K:()=>k.$K,vT:()=>k.vT,jb:()=>k.jb,yT:()=>k.yT,M_:()=>k.M_,hb:()=>k.hb,vJ:()=>k.vJ,ip:()=>k.ip,Nf:()=>k.Nf,Kr:()=>k.Kr,li:()=>k.li,J0:()=>k.J0,FH:()=>k.FH,v4:()=>k.v4});var o,i=n(622);null!=(o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0)&&o.__PREACT_DEVTOOLS__&&o.__PREACT_DEVTOOLS__.attachPreact("10.24.3",i.fF,{Fragment:i.FK,Component:i.uA});var s={};function a(e){return e.type===i.FK?"Fragment":"function"==typeof e.type?e.type.displayName||e.type.name:"string"==typeof e.type?e.type:"#text"}var u=[],l=[];function c(){return u.length>0?u[u.length-1]:null}var _=!0;function f(e){return"function"==typeof e.type&&e.type!=i.FK}function p(e){for(var t=[e],n=e;null!=n.__o;)t.push(n.__o),n=n.__o;return t.reduce((function(e,t){e+=" in "+a(t);var n=t.__source;return n?e+=" (at "+n.fileName+":"+n.lineNumber+")":_&&console.warn("Add @babel/plugin-transform-react-jsx-source to get a more detailed component stack. Note that you should not add it to production builds of your App for bundle size reasons."),_=!1,e+"\n"}),"")}var h="function"==typeof WeakMap;function d(e){var t=[];return e.__k?(e.__k.forEach((function(e){e&&"function"==typeof e.type?t.push.apply(t,d(e)):e&&"string"==typeof e.type&&t.push(e.type)})),t):t}function v(e){return e?"function"==typeof e.type?null==e.__?null!=e.__e&&null!=e.__e.parentNode?e.__e.parentNode.localName:"":v(e.__):e.type:""}var y=i.uA.prototype.setState;function m(e){return"table"===e||"tfoot"===e||"tbody"===e||"thead"===e||"td"===e||"tr"===e||"th"===e}i.uA.prototype.setState=function(e,t){return null==this.__v&&null==this.state&&console.warn('Calling "this.setState" inside the constructor of a component is a no-op and might be a bug in your application. Instead, set "this.state = {}" directly.\n\n'+p(c())),y.call(this,e,t)};var g=/^(address|article|aside|blockquote|details|div|dl|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hgroup|hr|main|menu|nav|ol|p|pre|search|section|table|ul)$/,w=i.uA.prototype.forceUpdate;function b(e){var t=e.props,n=a(e),r="";for(var o in t)if(t.hasOwnProperty(o)&&"children"!==o){var i=t[o];"function"==typeof i&&(i="function "+(i.displayName||i.name)+"() {}"),i=Object(i)!==i||i.toString?i+"":Object.prototype.toString.call(i),r+=" "+o+"="+JSON.stringify(i)}var s=t.children;return"<"+n+r+(s&&s.length?">..":" />")}i.uA.prototype.forceUpdate=function(e){return null==this.__v?console.warn('Calling "this.forceUpdate" inside the constructor of a component is a no-op and might be a bug in your application.\n\n'+p(c())):null==this.__P&&console.warn('Can\'t call "this.forceUpdate" on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method.\n\n'+p(this.__v)),w.call(this,e)},i.fF.__m=function(e,t){var n=e.type,r=t.map((function(e){return e&&e.localName})).filter(Boolean);console.error("Expected a DOM node of type "+n+" but found "+r.join(", ")+"as available DOM-node(s), this is caused by the SSR'd HTML containing different DOM-nodes compared to the hydrated one.\n\n"+p(e))},function(){!function(){var e=i.fF.__b,t=i.fF.diffed,n=i.fF.__,r=i.fF.vnode,o=i.fF.__r;i.fF.diffed=function(e){f(e)&&l.pop(),u.pop(),t&&t(e)},i.fF.__b=function(t){f(t)&&u.push(t),e&&e(t)},i.fF.__=function(e,t){l=[],n&&n(e,t)},i.fF.vnode=function(e){e.__o=l.length>0?l[l.length-1]:null,r&&r(e)},i.fF.__r=function(e){f(e)&&l.push(e),o&&o(e)}}();var e=!1,t=i.fF.__b,n=i.fF.diffed,r=i.fF.vnode,o=i.fF.__r,c=i.fF.__e,_=i.fF.__,y=i.fF.__h,w=h?{useEffect:new WeakMap,useLayoutEffect:new WeakMap,lazyPropTypes:new WeakMap}:null,k=[];i.fF.__e=function(e,t,n,r){if(t&&t.__c&&"function"==typeof e.then){var o=e;e=new Error("Missing Suspense. The throwing component was: "+a(t));for(var i=t;i;i=i.__)if(i.__c&&i.__c.__c){e=o;break}if(e instanceof Error)throw e}try{(r=r||{}).componentStack=p(t),c(e,t,n,r),"function"!=typeof e.then&&setTimeout((function(){throw e}))}catch(e){throw e}},i.fF.__=function(e,t){if(!t)throw new Error("Undefined parent passed to render(), this is the second argument.\nCheck if the element is available in the DOM/has the correct id.");var n;switch(t.nodeType){case 1:case 11:case 9:n=!0;break;default:n=!1}if(!n){var r=a(e);throw new Error("Expected a valid HTML node as a second argument to render.\tReceived "+t+" instead: render(<"+r+" />, "+t+");")}_&&_(e,t)},i.fF.__b=function(n){var r=n.type;if(e=!0,void 0===r)throw new Error("Undefined component passed to createElement()\n\nYou likely forgot to export your component or might have mixed up default and named imports"+b(n)+"\n\n"+p(n));if(null!=r&&"object"==typeof r){if(void 0!==r.__k&&void 0!==r.__e)throw new Error("Invalid type passed to createElement(): "+r+"\n\nDid you accidentally pass a JSX literal as JSX twice?\n\n let My"+a(n)+" = "+b(r)+";\n let vnode = ;\n\nThis usually happens when you export a JSX literal and not the component.\n\n"+p(n));throw new Error("Invalid type passed to createElement(): "+(Array.isArray(r)?"array":r))}if(void 0!==n.ref&&"function"!=typeof n.ref&&"object"!=typeof n.ref&&!("$$typeof"in n))throw new Error('Component\'s "ref" property should be a function, or an object created by createRef(), but got ['+typeof n.ref+"] instead\n"+b(n)+"\n\n"+p(n));if("string"==typeof n.type)for(var o in n.props)if("o"===o[0]&&"n"===o[1]&&"function"!=typeof n.props[o]&&null!=n.props[o])throw new Error("Component's \""+o+'" property should be a function, but got ['+typeof n.props[o]+"] instead\n"+b(n)+"\n\n"+p(n));if("function"==typeof n.type&&n.type.propTypes){if("Lazy"===n.type.displayName&&w&&!w.lazyPropTypes.has(n.type)){var i="PropTypes are not supported on lazy(). Use propTypes on the wrapped component itself. ";try{var u=n.type();w.lazyPropTypes.set(n.type,!0),console.warn(i+"Component wrapped in lazy() is "+a(u))}catch(e){console.warn(i+"We will log the wrapped component's name once it is loaded.")}}var l=n.props;n.type.__f&&delete(l=function(e,t){for(var n in t)e[n]=t[n];return e}({},l)).ref,function(e,t,n,r,o){Object.keys(e).forEach((function(n){var i;try{i=e[n](t,n,r,"prop",null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(e){i=e}i&&!(i.message in s)&&(s[i.message]=!0,console.error("Failed prop type: "+i.message+(o&&"\n"+o()||"")))}))}(n.type.propTypes,l,0,a(n),(function(){return p(n)}))}t&&t(n)};var S,x=0;i.fF.__r=function(t){o&&o(t),e=!0;var n=t.__c;if(n===S?x++:x=1,x>=25)throw new Error("Too many re-renders. This is limited to prevent an infinite loop which may lock up your browser. The component causing this is: "+a(t));S=n},i.fF.__h=function(t,n,r){if(!t||!e)throw new Error("Hook can only be invoked from render methods.");y&&y(t,n,r)};var E=function(e,t){return{get:function(){var n="get"+e+t;k&&k.indexOf(n)<0&&(k.push(n),console.warn("getting vnode."+e+" is deprecated, "+t))},set:function(){var n="set"+e+t;k&&k.indexOf(n)<0&&(k.push(n),console.warn("setting vnode."+e+" is not allowed, "+t))}}},T={nodeName:E("nodeName","use vnode.type"),attributes:E("attributes","use vnode.props"),children:E("children","use vnode.props.children")},O=Object.create({},T);i.fF.vnode=function(e){var t=e.props;if(null!==e.type&&null!=t&&("__source"in t||"__self"in t)){var n=e.props={};for(var o in t){var i=t[o];"__source"===o?e.__source=i:"__self"===o?e.__self=i:n[o]=i}}e.__proto__=O,r&&r(e)},i.fF.diffed=function(t){var r,o=t.type,i=t.__;if(t.__k&&t.__k.forEach((function(e){if("object"==typeof e&&e&&void 0===e.type){var n=Object.keys(e).join(",");throw new Error("Objects are not valid as a child. Encountered an object with the keys {"+n+"}.\n\n"+p(t))}})),t.__c===S&&(x=0),"string"==typeof o&&(m(o)||"p"===o||"a"===o||"button"===o)){var s=v(i);if(""!==s&&m(o))"table"===o&&"td"!==s&&m(s)?(console.log(s,i.__e),console.error("Improper nesting of table. Your

    should not have a table-node parent."+b(t)+"\n\n"+p(t))):"thead"!==o&&"tfoot"!==o&&"tbody"!==o||"table"===s?"tr"===o&&"thead"!==s&&"tfoot"!==s&&"tbody"!==s?console.error("Improper nesting of table. Your should have a parent."+b(t)+"\n\n"+p(t)):"td"===o&&"tr"!==s?console.error("Improper nesting of table. Your parent."+b(t)+"\n\n"+p(t)):"th"===o&&"tr"!==s&&console.error("Improper nesting of table. Your ."+b(t)+"\n\n"+p(t)):console.error("Improper nesting of table. Your should have a
    should have a
    should have a
    parent."+b(t)+"\n\n"+p(t));else if("p"===o){var u=d(t).filter((function(e){return g.test(e)}));u.length&&console.error("Improper nesting of paragraph. Your

    should not have "+u.join(", ")+"as child-elements."+b(t)+"\n\n"+p(t))}else"a"!==o&&"button"!==o||-1!==d(t).indexOf(o)&&console.error("Improper nesting of interactive content. Your <"+o+"> should not have other "+("a"===o?"anchor":"button")+" tags as child-elements."+b(t)+"\n\n"+p(t))}if(e=!1,n&&n(t),null!=t.__k)for(var l=[],c=0;c{n.d(t,{zj:()=>ft,SD:()=>ve,V6:()=>ye,$K:()=>me,vT:()=>pt,jb:()=>Jt,yT:()=>we,M_:()=>dt,hb:()=>Oe,vJ:()=>Ee,ip:()=>xe,Nf:()=>Te,Kr:()=>Pe,li:()=>b,J0:()=>m,FH:()=>Se,v4:()=>ke});var r,o,i,s,a=n(622),u=0,l=[],c=a.fF,_=c.__b,f=c.__r,p=c.diffed,h=c.__c,d=c.unmount,v=c.__;function y(e,t){c.__h&&c.__h(o,e,u||t),u=0;var n=o.__H||(o.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function m(e){return u=1,function(e,t,n){var i=y(r++,2);if(i.t=e,!i.__c&&(i.__=[n?n(t):N(void 0,t),function(e){var t=i.__N?i.__N[0]:i.__[0],n=i.t(t,e);t!==n&&(i.__N=[n,i.__[1]],i.__c.setState({}))}],i.__c=o,!o.u)){var s=function(e,t,n){if(!i.__c.__H)return!0;var r=i.__c.__H.__.filter((function(e){return!!e.__c}));if(r.every((function(e){return!e.__N})))return!a||a.call(this,e,t,n);var o=i.__c.props!==e;return r.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}})),a&&a.call(this,e,t,n)||o};o.u=!0;var a=o.shouldComponentUpdate,u=o.componentWillUpdate;o.componentWillUpdate=function(e,t,n){if(this.__e){var r=a;a=void 0,s(e,t,n),a=r}u&&u.call(this,e,t,n)},o.shouldComponentUpdate=s}return i.__N||i.__}(N,e)}function g(e,t){var n=y(r++,3);!c.__s&&C(n.__H,t)&&(n.__=e,n.i=t,o.__H.__h.push(n))}function w(e,t){var n=y(r++,4);!c.__s&&C(n.__H,t)&&(n.__=e,n.i=t,o.__h.push(n))}function b(e){return u=5,k((function(){return{current:e}}),[])}function k(e,t){var n=y(r++,7);return C(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function S(e,t){return u=8,k((function(){return e}),t)}function x(e){var t=o.context[e.__c],n=y(r++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(o)),t.props.value):e.__}function E(){for(var e;e=l.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(P),e.__H.__h.forEach(F),e.__H.__h=[]}catch(t){e.__H.__h=[],c.__e(t,e.__v)}}c.__b=function(e){o=null,_&&_(e)},c.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),v&&v(e,t)},c.__r=function(e){f&&f(e),r=0;var t=(o=e.__c).__H;t&&(i===o?(t.__h=[],o.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.i=e.__N=void 0}))):(t.__h.forEach(P),t.__h.forEach(F),t.__h=[],r=0)),i=o},c.diffed=function(e){p&&p(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==l.push(t)&&s===c.requestAnimationFrame||((s=c.requestAnimationFrame)||O)(E)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.i=void 0}))),i=o=null},c.__c=function(e,t){t.some((function(e){try{e.__h.forEach(P),e.__h=e.__h.filter((function(e){return!e.__||F(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],c.__e(n,e.__v)}})),h&&h(e,t)},c.unmount=function(e){d&&d(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{P(e)}catch(e){t=e}})),n.__H=void 0,t&&c.__e(t,n.__v))};var T="function"==typeof requestAnimationFrame;function O(e){var t,n=function(){clearTimeout(r),T&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);T&&(t=requestAnimationFrame(n))}function P(e){var t=o,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),o=t}function F(e){var t=o;e.__c=e.__(),o=t}function C(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function N(e,t){return"function"==typeof t?t(e):t}var j=Symbol.for("preact-signals");function M(){if(W>1)W--;else{for(var e,t=!1;void 0!==A;){var n=A;for(A=void 0,L++;void 0!==n;){var r=n.o;if(n.o=void 0,n.f&=-3,!(8&n.f)&&V(n))try{n.c()}catch(n){t||(e=n,t=!0)}n=r}}if(L=0,W--,t)throw e}}function $(e){if(W>0)return e();W++;try{return e()}finally{M()}}var H=void 0;var U,A=void 0,W=0,L=0,D=0;function I(e){if(void 0!==H){var t=e.n;if(void 0===t||t.t!==H)return t={i:0,S:e,p:H.s,n:void 0,t:H,e:void 0,x:void 0,r:t},void 0!==H.s&&(H.s.n=t),H.s=t,e.n=t,32&H.f&&e.S(t),t;if(-1===t.i)return t.i=0,void 0!==t.n&&(t.n.p=t.p,void 0!==t.p&&(t.p.n=t.n),t.p=H.s,t.n=void 0,H.s.n=t,H.s=t),t}}function R(e){this.v=e,this.i=0,this.n=void 0,this.t=void 0}function z(e){return new R(e)}function V(e){for(var t=e.s;void 0!==t;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function B(e){for(var t=e.s;void 0!==t;t=t.n){var n=t.S.n;if(void 0!==n&&(t.r=n),t.S.n=t,t.i=-1,void 0===t.n){e.s=t;break}}}function J(e){for(var t=e.s,n=void 0;void 0!==t;){var r=t.p;-1===t.i?(t.S.U(t),void 0!==r&&(r.n=t.n),void 0!==t.n&&(t.n.p=r)):n=t,t.S.n=t.r,void 0!==t.r&&(t.r=void 0),t=r}e.s=n}function K(e){R.call(this,void 0),this.x=e,this.s=void 0,this.g=D-1,this.f=4}function q(e){return new K(e)}function Y(e){var t=e.u;if(e.u=void 0,"function"==typeof t){W++;var n=H;H=void 0;try{t()}catch(t){throw e.f&=-2,e.f|=8,X(e),t}finally{H=n,M()}}}function X(e){for(var t=e.s;void 0!==t;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Y(e)}function G(e){if(H!==this)throw new Error("Out-of-order effect");J(this),H=e,this.f&=-2,8&this.f&&X(this),M()}function Q(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}function Z(e){var t=new Q(e);try{t.c()}catch(e){throw t.d(),e}return t.d.bind(t)}function ee(e,t){a.fF[e]=t.bind(null,a.fF[e]||function(){})}function te(e){U&&U(),U=e&&e.S()}function ne(e){var t=this,n=e.data,r=function(e){return k((function(){return z(e)}),[])}(n);r.value=n;var o=k((function(){for(var e=t.__v;e=e.__;)if(e.__c){e.__c.__$f|=4;break}return t.__$u.c=function(){var e,n=t.__$u.S(),r=o.value;n(),(0,a.zO)(r)||3!==(null==(e=t.base)?void 0:e.nodeType)?(t.__$f|=1,t.setState({})):t.base.data=r},q((function(){var e=r.value.value;return 0===e?0:!0===e?"":e||""}))}),[]);return o.value}function re(e,t,n,r){var o=t in e&&void 0===e.ownerSVGElement,i=z(n);return{o:function(e,t){i.value=e,r=t},d:Z((function(){var n=i.value.value;r[t]!==n&&(r[t]=n,o?e[t]=n:n?e.setAttribute(t,n):e.removeAttribute(t))}))}}R.prototype.brand=j,R.prototype.h=function(){return!0},R.prototype.S=function(e){this.t!==e&&void 0===e.e&&(e.x=this.t,void 0!==this.t&&(this.t.e=e),this.t=e)},R.prototype.U=function(e){if(void 0!==this.t){var t=e.e,n=e.x;void 0!==t&&(t.x=n,e.e=void 0),void 0!==n&&(n.e=t,e.x=void 0),e===this.t&&(this.t=n)}},R.prototype.subscribe=function(e){var t=this;return Z((function(){var n=t.value,r=H;H=void 0;try{e(n)}finally{H=r}}))},R.prototype.valueOf=function(){return this.value},R.prototype.toString=function(){return this.value+""},R.prototype.toJSON=function(){return this.value},R.prototype.peek=function(){var e=H;H=void 0;try{return this.value}finally{H=e}},Object.defineProperty(R.prototype,"value",{get:function(){var e=I(this);return void 0!==e&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(L>100)throw new Error("Cycle detected");this.v=e,this.i++,D++,W++;try{for(var t=this.t;void 0!==t;t=t.x)t.t.N()}finally{M()}}}}),(K.prototype=new R).h=function(){if(this.f&=-3,1&this.f)return!1;if(32==(36&this.f))return!0;if(this.f&=-5,this.g===D)return!0;if(this.g=D,this.f|=1,this.i>0&&!V(this))return this.f&=-2,!0;var e=H;try{B(this),H=this;var t=this.x();(16&this.f||this.v!==t||0===this.i)&&(this.v=t,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return H=e,J(this),this.f&=-2,!0},K.prototype.S=function(e){if(void 0===this.t){this.f|=36;for(var t=this.s;void 0!==t;t=t.n)t.S.S(t)}R.prototype.S.call(this,e)},K.prototype.U=function(e){if(void 0!==this.t&&(R.prototype.U.call(this,e),void 0===this.t)){this.f&=-33;for(var t=this.s;void 0!==t;t=t.n)t.S.U(t)}},K.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;void 0!==e;e=e.x)e.t.N()}},Object.defineProperty(K.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=I(this);if(this.h(),void 0!==e&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),Q.prototype.c=function(){var e=this.S();try{if(8&this.f)return;if(void 0===this.x)return;var t=this.x();"function"==typeof t&&(this.u=t)}finally{e()}},Q.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,Y(this),B(this),W++;var e=H;return H=this,G.bind(this,e)},Q.prototype.N=function(){2&this.f||(this.f|=2,this.o=A,A=this)},Q.prototype.d=function(){this.f|=8,1&this.f||X(this)},ne.displayName="_st",Object.defineProperties(R.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:ne},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}}),ee("__b",(function(e,t){if("string"==typeof t.type){var n,r=t.props;for(var o in r)if("children"!==o){var i=r[o];i instanceof R&&(n||(t.__np=n={}),n[o]=i,r[o]=i.peek())}}e(t)})),ee("__r",(function(e,t){te();var n,r=t.__c;r&&(r.__$f&=-2,void 0===(n=r.__$u)&&(r.__$u=n=function(){var e;return Z((function(){e=this})),e.c=function(){r.__$f|=1,r.setState({})},e}())),te(n),e(t)})),ee("__e",(function(e,t,n,r){te(),e(t,n,r)})),ee("diffed",(function(e,t){var n;if(te(),"string"==typeof t.type&&(n=t.__e)){var r=t.__np,o=t.props;if(r){var i=n.U;if(i)for(var s in i){var a=i[s];void 0===a||s in r||(a.d(),i[s]=void 0)}else n.U=i={};for(var u in r){var l=i[u],c=r[u];void 0===l?(l=re(n,u,c,o),i[u]=l):l.o(c,o)}}}e(t)})),ee("unmount",(function(e,t){if("string"==typeof t.type){var n=t.__e;if(n){var r=n.U;if(r)for(var o in n.U=void 0,r){var i=r[o];i&&i.d()}}}else{var s=t.__c;if(s){var a=s.__$u;a&&(s.__$u=void 0,a.d())}}e(t)})),ee("__h",(function(e,t,n,r){(r<3||9===r)&&(t.__$f|=2),e(t,n,r)})),a.uA.prototype.shouldComponentUpdate=function(e,t){var n=this.__$u,r=n&&void 0!==n.s;for(var o in t)return!0;if(this.__f||"boolean"==typeof this.u&&!0===this.u){if(!(r||2&this.__$f||4&this.__$f))return!0;if(1&this.__$f)return!0}else{if(!(r||4&this.__$f))return!0;if(3&this.__$f)return!0}for(var i in e)if("__source"!==i&&e[i]!==this.props[i])return!0;for(var s in this.props)if(!(s in e))return!0;return!1};const oe=[],ie=()=>oe.slice(-1)[0],se=e=>{oe.push(e)},ae=()=>{oe.pop()},ue=[],le=()=>ue.slice(-1)[0],ce=e=>{ue.push(e)},_e=()=>{ue.pop()},fe=new WeakMap,pe=()=>{throw new Error("Please use `data-wp-bind` to modify the attributes of an element.")},he={get(e,t,n){const r=Reflect.get(e,t,n);return r&&"object"==typeof r?de(r):r},set:pe,deleteProperty:pe},de=e=>(fe.has(e)||fe.set(e,new Proxy(e,he)),fe.get(e)),ve=e=>le().context[e||ie()],ye=()=>{const e=le();const{ref:t,attributes:n}=e;return Object.freeze({ref:t.current,attributes:de(n)})},me=e=>le().serverContext[e||ie()],ge=e=>new Promise((t=>{const n=()=>{clearTimeout(r),window.cancelAnimationFrame(o),setTimeout((()=>{e(),t()}))},r=setTimeout(n,100),o=window.requestAnimationFrame(n)})),we="function"==typeof window.scheduler?.yield?window.scheduler.yield.bind(window.scheduler):()=>new Promise((e=>{setTimeout(e,0)}));function be(e){g((()=>{let t=null,n=!1;return t=function(e,t){let n=()=>{};const r=Z((function(){return n=this.c.bind(this),this.x=e,this.c=t,e()}));return{flush:n,dispose:r}}(e,(async()=>{t&&!n&&(n=!0,await ge(t.flush),n=!1)})),t.dispose}),[])}function ke(e){const t=le(),n=ie();return"GeneratorFunction"===e?.constructor?.name?async(...r)=>{const o=e(...r);let i,s;for(;;){se(n),ce(t);try{s=o.next(i)}finally{_e(),ae()}try{i=await s.value}catch(e){se(n),ce(t),o.throw(e)}finally{_e(),ae()}if(s.done)break}return i}:(...r)=>{se(n),ce(t);try{return e(...r)}finally{ae(),_e()}}}function Se(e){be(ke(e))}function xe(e){g(ke(e),[])}function Ee(e,t){g(ke(e),t)}function Te(e,t){w(ke(e),t)}function Oe(e,t){return S(ke(e),t)}function Pe(e,t){return k(ke(e),t)}new Set;const Fe=e=>{0},Ce=e=>Boolean(e&&"object"==typeof e&&e.constructor===Object),Ne=new WeakMap,je=new WeakMap,Me=new WeakMap,$e=new Set([Object,Array]),He=(e,t,n)=>{if(!We(t))throw Error("This object cannot be proxified.");if(!Ne.has(t)){const r=new Proxy(t,n);Ne.set(t,r),je.set(r,t),Me.set(r,e)}return Ne.get(t)},Ue=e=>Ne.get(e),Ae=e=>Me.get(e),We=e=>"object"==typeof e&&null!==e&&(!Me.has(e)&&$e.has(e.constructor)),Le={};class De{constructor(e){this.owner=e,this.computedsByScope=new WeakMap}setValue(e){this.update({value:e})}setGetter(e){this.update({get:e})}getComputed(){const e=le()||Le;if(this.valueSignal||this.getterSignal||this.update({}),!this.computedsByScope.has(e)){const t=()=>{const e=this.getterSignal?.value;return e?e.call(this.owner):this.valueSignal?.value};se(Ae(this.owner)),this.computedsByScope.set(e,q(ke(t))),ae()}return this.computedsByScope.get(e)}update({get:e,value:t}){this.valueSignal?t===this.valueSignal.peek()&&e===this.getterSignal.peek()||$((()=>{this.valueSignal.value=t,this.getterSignal.value=e})):(this.valueSignal=z(t),this.getterSignal=z(e))}}const Ie=new Set(Object.getOwnPropertyNames(Symbol).map((e=>Symbol[e])).filter((e=>"symbol"==typeof e))),Re=new WeakMap,ze=(e,t)=>Re.has(e)&&Re.get(e).has(t),Ve=new WeakSet,Be=(e,t,n)=>{Re.has(e)||Re.set(e,new Map),t="number"==typeof t?`${t}`:t;const r=Re.get(e);if(!r.has(t)){const o=Ae(e),i=new De(e);if(r.set(t,i),n){const{get:t,value:r}=n;if(t)i.setGetter(t);else{const t=Ve.has(e);i.setValue(We(r)?Ye(o,r,{readOnly:t}):r)}}}return r.get(t)},Je=new WeakMap;let Ke=!1;const qe={get(e,t,n){if(Ke||!e.hasOwnProperty(t)&&t in e||"symbol"==typeof t&&Ie.has(t))return Reflect.get(e,t,n);const r=Object.getOwnPropertyDescriptor(e,t),o=Be(n,t,r).getComputed().value;if("function"==typeof o){const e=Ae(n);return(...t)=>{se(e);try{return o.call(n,...t)}finally{ae()}}}return o},set(e,t,n,r){if(Ve.has(r))return!1;se(Ae(r));try{return Reflect.set(e,t,n,r)}finally{ae()}},defineProperty(e,t,n){if(Ve.has(Ue(e)))return!1;const r=!(t in e),o=Reflect.defineProperty(e,t,n);if(o){const o=Ue(e),i=Be(o,t),{get:s,value:a}=n;if(s)i.setGetter(s);else{const e=Ae(o);i.setValue(We(a)?Ye(e,a):a)}if(r&&Je.has(e)&&Je.get(e).value++,Array.isArray(e)&&Re.get(o)?.has("length")){Be(o,"length").setValue(e.length)}}return o},deleteProperty(e,t){if(Ve.has(Ue(e)))return!1;const n=Reflect.deleteProperty(e,t);if(n){Be(Ue(e),t).setValue(void 0),Je.has(e)&&Je.get(e).value++}return n},ownKeys:e=>(Je.has(e)||Je.set(e,z(0)),Je._=Je.get(e).value,Reflect.ownKeys(e))},Ye=(e,t,n)=>{const r=He(e,t,qe);return n?.readOnly&&Ve.add(r),r},Xe=(e,t,n=!0)=>{if(!Ce(e)||!Ce(t))return;let r=!1;for(const o in t){const i=!(o in e);r=r||i;const s=Object.getOwnPropertyDescriptor(t,o),a=Ue(e),u=!!a&&ze(a,o)&&Be(a,o);if("function"==typeof s.get||"function"==typeof s.set)(n||i)&&(Object.defineProperty(e,o,{...s,configurable:!0,enumerable:!0}),s.get&&u&&u.setGetter(s.get));else if(Ce(t[o])){const r=Object.getOwnPropertyDescriptor(e,o)?.value;if(i||n&&!Ce(r)){if(e[o]={},u){const t=Ae(a);u.setValue(Ye(t,e[o]))}Xe(e[o],t[o],n)}else Ce(r)&&Xe(e[o],t[o],n)}else if((n||i)&&(Object.defineProperty(e,o,s),u)){const{value:e}=s,t=Ae(a);u.setValue(We(e)?Ye(t,e):e)}}r&&Je.has(e)&&Je.get(e).value++},Ge=(e,t,n=!0)=>$((()=>{return Xe((r=e,je.get(r)||e),t,n);var r})),Qe=new WeakSet,Ze={get:(e,t,n)=>{const r=Reflect.get(e,t),o=Ae(n);if(void 0===r&&Qe.has(n)){const n={};return Reflect.set(e,t,n),et(o,n,!1)}if("function"==typeof r){se(o);const e=ke(r);return ae(),e}return Ce(r)&&We(r)?et(o,r,!1):r}},et=(e,t,n=!0)=>{const r=He(e,t,Ze);return r&&n&&Qe.add(r),r},tt=new WeakMap,nt=new WeakMap,rt=new WeakSet,ot=Reflect.getOwnPropertyDescriptor,it={get:(e,t)=>{const n=nt.get(e),r=e[t];return t in e?r:n[t]},set:(e,t,n)=>{const r=nt.get(e);return(t in e||!(t in r)?e:r)[t]=n,!0},ownKeys:e=>[...new Set([...Object.keys(nt.get(e)),...Object.keys(e)])],getOwnPropertyDescriptor:(e,t)=>ot(e,t)||ot(nt.get(e),t),has:(e,t)=>Reflect.has(e,t)||Reflect.has(nt.get(e),t)},st=(e,t={})=>{if(rt.has(e))throw Error("This object cannot be proxified.");if(nt.set(e,t),!tt.has(e)){const t=new Proxy(e,it);tt.set(e,t),rt.add(t)}return tt.get(e)},at=new Map,ut=new Map,lt=new Map,ct=new Map,_t=new Map,ft=e=>ct.get(e||ie())||{},pt=e=>{const t=e||ie();return _t.has(t)||_t.set(t,Ye(t,{},{readOnly:!0})),_t.get(t)},ht="I acknowledge that using a private store means my plugin will inevitably break on the next store release.";function dt(e,{state:t={},...n}={},{lock:r=!1}={}){if(at.has(e)){if(r===ht||lt.has(e)){const t=lt.get(e);if(!(r===ht||!0!==r&&r===t))throw t?Error("Cannot unlock a private store with an invalid lock code"):Error("Cannot lock a public store")}else lt.set(e,r);const o=ut.get(e);Ge(o,n),Ge(o.state,t)}else{r!==ht&<.set(e,r);const o={state:Ye(e,Ce(t)?t:{}),...n},i=et(e,o);ut.set(e,o),at.set(e,i)}return at.get(e)}const vt=(e=document)=>{var t;const n=null!==(t=e.getElementById("wp-script-module-data-@wordpress/interactivity"))&&void 0!==t?t:e.getElementById("wp-interactivity-data");if(n?.textContent)try{return JSON.parse(n.textContent)}catch{}return{}},yt=e=>{Ce(e?.state)&&Object.entries(e.state).forEach((([e,t])=>{const n=dt(e,{},{lock:ht});Ge(n.state,t,!1),Ge(pt(e),t)})),Ce(e?.config)&&Object.entries(e.config).forEach((([e,t])=>{ct.set(e,t)}))},mt=vt();function gt(e){return null!==e.suffix}function wt(e){return null===e.suffix}yt(mt);const bt=(0,a.q6)({client:{},server:{}}),kt={},St={},xt=(e,t,{priority:n=10}={})=>{kt[e]=t,St[e]=n},Et=({scope:e})=>(t,...n)=>{let{value:r,namespace:o}=t;if("string"!=typeof r)throw new Error("The `value` prop should be a string path");const i="!"===r[0]&&!!(r=r.slice(1));ce(e);const s=((e,t)=>{if(!t)return void Fe();let n=at.get(t);void 0===n&&(n=dt(t,{},{lock:ht}));const r={...n,context:le().context[t]};try{return e.split(".").reduce(((e,t)=>e[t]),r)}catch(e){}})(r,o),a="function"==typeof s?s(...n):s;return _e(),i?!a:a},Tt=({directives:e,priorityLevels:[t,...n],element:r,originalProps:o,previousScope:i})=>{const s=b({}).current;s.evaluate=S(Et({scope:s}),[]);const{client:u,server:l}=x(bt);s.context=u,s.serverContext=l,s.ref=i?.ref||b(null),r=(0,a.Ob)(r,{ref:s.ref}),s.attributes=r.props;const c=n.length>0?(0,a.h)(Tt,{directives:e,priorityLevels:n,element:r,originalProps:o,previousScope:s}):r,_={...o,children:c},f={directives:e,props:_,element:r,context:bt,evaluate:s.evaluate};ce(s);for(const e of t){const t=kt[e]?.(f);void 0!==t&&(_.children=t)}return _e(),_.children},Ot=a.fF.vnode;function Pt(e){return Ce(e)?Object.fromEntries(Object.entries(e).map((([e,t])=>[e,Pt(t)]))):Array.isArray(e)?e.map((e=>Pt(e))):e}a.fF.vnode=e=>{if(e.props.__directives){const t=e.props,n=t.__directives;n.key&&(e.key=n.key.find(wt).value),delete t.__directives;const r=(e=>{const t=Object.keys(e).reduce(((e,t)=>{if(kt[t]){const n=St[t];(e[n]=e[n]||[]).push(t)}return e}),{});return Object.entries(t).sort((([e],[t])=>parseInt(e)-parseInt(t))).map((([,e])=>e))})(n);r.length>0&&(e.props={directives:n,priorityLevels:r,originalProps:t,type:e.type,element:(0,a.h)(e.type,t),top:!0},e.type=Tt)}Ot&&Ot(e)};const Ft=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,Ct=/\/\*[^]*?\*\/| +/g,Nt=/\n+/g,jt=e=>({directives:t,evaluate:n})=>{t[`on-${e}`].filter(gt).forEach((t=>{const r=t.suffix.split("--",1)[0];xe((()=>{const o=e=>n(t,e),i="window"===e?window:document;return i.addEventListener(r,o),()=>i.removeEventListener(r,o)}))}))},Mt=e=>({directives:t,evaluate:n})=>{t[`on-async-${e}`].filter(gt).forEach((t=>{const r=t.suffix.split("--",1)[0];xe((()=>{const o=async e=>{await we(),n(t,e)},i="window"===e?window:document;return i.addEventListener(r,o,{passive:!0}),()=>i.removeEventListener(r,o)}))}))},$t="wp",Ht=`data-${$t}-ignore`,Ut=`data-${$t}-interactive`,At=`data-${$t}-`,Wt=[],Lt=new RegExp(`^data-${$t}-([a-z0-9]+(?:-[a-z0-9]+)*)(?:--([a-z0-9_-]+))?$`,"i"),Dt=/^([\w_\/-]+)::(.+)$/,It=new WeakSet;function Rt(e){const t=document.createTreeWalker(e,205);return function e(n){const{nodeType:r}=n;if(3===r)return[n.data];if(4===r){var o;const e=t.nextSibling();return n.replaceWith(new window.Text(null!==(o=n.nodeValue)&&void 0!==o?o:"")),[n.nodeValue,e]}if(8===r||7===r){const e=t.nextSibling();return n.remove(),[null,e]}const i=n,{attributes:s}=i,u=i.localName,l={},c=[],_=[];let f=!1,p=!1;for(let e=0;e{const o=Lt.exec(t);if(null===o)return Fe(),e;const i=o[1]||"",s=o[2]||null;var a;return e[i]=e[i]||[],e[i].push({namespace:null!=n?n:null!==(a=Wt[Wt.length-1])&&void 0!==a?a:null,value:r,suffix:s}),e}),{})),"template"===u)l.content=[...i.content.childNodes].map((e=>Rt(e)));else{let n=t.firstChild();if(n){for(;n;){const[r,o]=e(n);r&&c.push(r),n=o||t.nextSibling()}t.parentNode()}}return p&&Wt.pop(),[(0,a.h)(u,l,c)]}(t.currentNode)}const zt=new WeakMap,Vt=e=>{if(!e.parentElement)throw Error("The passed region should be an element with a parent.");return zt.has(e)||zt.set(e,((e,t)=>{const n=(t=[].concat(t))[t.length-1].nextSibling;function r(t,r){e.insertBefore(t,r||n)}return e.__k={nodeType:1,parentNode:e,firstChild:t[0],childNodes:t,insertBefore:r,appendChild:r,removeChild(t){e.removeChild(t)}}})(e.parentElement,e)),zt.get(e)},Bt=new WeakMap,Jt=e=>{if("I acknowledge that using private APIs means my theme or plugin will inevitably break in the next version of WordPress."===e)return{directivePrefix:$t,getRegionRootFragment:Vt,initialVdom:Bt,toVdom:Rt,directive:xt,getNamespace:ie,h:a.h,cloneElement:a.Ob,render:a.XX,proxifyState:Ye,parseServerData:vt,populateServerData:yt,batch:$};throw new Error("Forbidden access.")};xt("context",(({directives:{context:e},props:{children:t},context:n})=>{const{Provider:r}=n,o=e.find(wt),{client:i,server:s}=x(n),u=o.namespace,l=b(Ye(u,{})),c=b(Ye(u,{},{readOnly:!0})),_=k((()=>{const e={client:{...i},server:{...s}};if(o){const{namespace:t,value:n}=o;Ce(n)||Fe(),Ge(l.current,Pt(n),!1),Ge(c.current,Pt(n)),e.client[t]=st(l.current,i[t]),e.server[t]=st(c.current,s[t])}return e}),[o,i,s]);return(0,a.h)(r,{value:_},t)}),{priority:5}),xt("watch",(({directives:{watch:e},evaluate:t})=>{e.forEach((e=>{Se((()=>t(e)))}))})),xt("init",(({directives:{init:e},evaluate:t})=>{e.forEach((e=>{xe((()=>t(e)))}))})),xt("on",(({directives:{on:e},element:t,evaluate:n})=>{const r=new Map;e.filter(gt).forEach((e=>{const t=e.suffix.split("--")[0];r.has(t)||r.set(t,new Set),r.get(t).add(e)})),r.forEach(((e,r)=>{const o=t.props[`on${r}`];t.props[`on${r}`]=t=>{e.forEach((e=>{o&&o(t),n(e,t)}))}}))})),xt("on-async",(({directives:{"on-async":e},element:t,evaluate:n})=>{const r=new Map;e.filter(gt).forEach((e=>{const t=e.suffix.split("--")[0];r.has(t)||r.set(t,new Set),r.get(t).add(e)})),r.forEach(((e,r)=>{const o=t.props[`on${r}`];t.props[`on${r}`]=t=>{o&&o(t),e.forEach((async e=>{await we(),n(e,t)}))}}))})),xt("on-window",jt("window")),xt("on-document",jt("document")),xt("on-async-window",Mt("window")),xt("on-async-document",Mt("document")),xt("class",(({directives:{class:e},element:t,evaluate:n})=>{e.filter(gt).forEach((e=>{const r=e.suffix,o=n(e),i=t.props.class||"",s=new RegExp(`(^|\\s)${r}(\\s|$)`,"g");o?s.test(i)||(t.props.class=i?`${i} ${r}`:r):t.props.class=i.replace(s," ").trim(),xe((()=>{o?t.ref.current.classList.add(r):t.ref.current.classList.remove(r)}))}))})),xt("style",(({directives:{style:e},element:t,evaluate:n})=>{e.filter(gt).forEach((e=>{const r=e.suffix,o=n(e);t.props.style=t.props.style||{},"string"==typeof t.props.style&&(t.props.style=(e=>{const t=[{}];let n,r;for(;n=Ft.exec(e.replace(Ct,""));)n[4]?t.shift():n[3]?(r=n[3].replace(Nt," ").trim(),t.unshift(t[0][r]=t[0][r]||{})):t[0][n[1]]=n[2].replace(Nt," ").trim();return t[0]})(t.props.style)),o?t.props.style[r]=o:delete t.props.style[r],xe((()=>{o?t.ref.current.style[r]=o:t.ref.current.style.removeProperty(r)}))}))})),xt("bind",(({directives:{bind:e},element:t,evaluate:n})=>{e.filter(gt).forEach((e=>{const r=e.suffix,o=n(e);t.props[r]=o,xe((()=>{const e=t.ref.current;if("style"!==r){if("width"!==r&&"height"!==r&&"href"!==r&&"list"!==r&&"form"!==r&&"tabIndex"!==r&&"download"!==r&&"rowSpan"!==r&&"colSpan"!==r&&"role"!==r&&r in e)try{return void(e[r]=null==o?"":o)}catch(e){}null==o||!1===o&&"-"!==r[4]?e.removeAttribute(r):e.setAttribute(r,o)}else"string"==typeof o&&(e.style.cssText=o)}))}))})),xt("ignore",(({element:{type:e,props:{innerHTML:t,...n}}})=>{const r=k((()=>t),[]);return(0,a.h)(e,{dangerouslySetInnerHTML:{__html:r},...n})})),xt("text",(({directives:{text:e},element:t,evaluate:n})=>{const r=e.find(wt);if(r)try{const e=n(r);t.props.children="object"==typeof e?null:e.toString()}catch(e){t.props.children=null}else t.props.children=null})),xt("run",(({directives:{run:e},evaluate:t})=>{e.forEach((e=>t(e)))})),xt("each",(({directives:{each:e,"each-key":t},context:n,element:r,evaluate:o})=>{if("template"!==r.type)return;const{Provider:i}=n,s=x(n),[u]=e,{namespace:l}=u,c=o(u);if("function"!=typeof c?.[Symbol.iterator])return;const _=gt(u)?u.suffix.replace(/^-+|-+$/g,"").toLowerCase().replace(/-([a-z])/g,(function(e,t){return t.toUpperCase()})):"item",f=[];for(const e of c){const n=st(Ye(l,{}),s.client[l]),o={client:{...s.client,[l]:n},server:{...s.server}};o.client[l][_]=e;const u={...le(),context:o.client,serverContext:o.server},c=t?Et({scope:u})(t[0]):e;f.push((0,a.h)(i,{value:o,key:c},r.props.content))}return f}),{priority:20}),xt("each-child",(()=>null),{priority:1}),(async()=>{const e=document.querySelectorAll(`[data-${$t}-interactive]`);await new Promise((e=>{setTimeout(e,0)}));for(const t of e)if(!It.has(t)){await we();const e=Vt(t),n=Rt(t);Bt.set(t,n),await we(),(0,a.Qv)(n,e)}})()},622:(e,t,n)=>{n.d(t,{FK:()=>x,Ob:()=>B,Qv:()=>V,XX:()=>z,fF:()=>o,h:()=>k,q6:()=>J,uA:()=>E,zO:()=>s});var r,o,i,s,a,u,l,c,_,f,p,h,d,v={},y=[],m=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,g=Array.isArray;function w(e,t){for(var n in t)e[n]=t[n];return e}function b(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function k(e,t,n){var o,i,s,a={};for(s in t)"key"==s?o=t[s]:"ref"==s?i=t[s]:a[s]=t[s];if(arguments.length>2&&(a.children=arguments.length>3?r.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(s in e.defaultProps)void 0===a[s]&&(a[s]=e.defaultProps[s]);return S(e,a,o,i,null)}function S(e,t,n,r,s){var a={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==s?++i:s,__i:-1,__u:0};return null==s&&null!=o.vnode&&o.vnode(a),a}function x(e){return e.children}function E(e,t){this.props=e,this.context=t}function T(e,t){if(null==t)return e.__?T(e.__,e.__i+1):null;for(var n;tt&&a.sort(c));F.__r=0}function C(e,t,n,r,o,i,s,a,u,l,c){var _,f,p,h,d,m,g=r&&r.__k||y,w=t.length;for(u=N(n,t,g,u,w),_=0;_0?S(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):s).__=e,s.__b=e.__b+1,a=null,-1!==(l=s.__i=M(s,n,u,_))&&(_--,(a=n[l])&&(a.__u|=2)),null==a||null===a.__v?(-1==l&&f--,"function"!=typeof s.type&&(s.__u|=4)):l!=u&&(l==u-1?f--:l==u+1?f++:(l>u?f--:f++,s.__u|=4))):e.__k[i]=null;if(_)for(i=0;i(null==u||2&u.__u?0:1))for(o=n-1,i=n+1;o>=0||i=0){if((u=t[o])&&!(2&u.__u)&&s==u.key&&a===u.type)return o;o--}if(i2&&(u.children=arguments.length>3?r.call(arguments,2):n),S(e.type,u,o||e.key,i||e.ref,null)}function J(e,t){var n={__c:t="__cC"+d++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,r;return this.getChildContext||(n=new Set,(r={})[t]=this,this.getChildContext=function(){return r},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.forEach((function(e){e.__e=!0,P(e)}))},this.sub=function(e){n.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n&&n.delete(e),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}r=y.slice,o={__e:function(e,t,n,r){for(var o,i,s;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&null!=i.getDerivedStateFromError&&(o.setState(i.getDerivedStateFromError(e)),s=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(e,r||{}),s=o.__d),s)return o.__E=o}catch(t){e=t}throw e}},i=0,s=function(e){return null!=e&&null==e.constructor},E.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=w({},this.state),"function"==typeof e&&(e=e(w({},n),this.props)),e&&w(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),P(this))},E.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),P(this))},E.prototype.render=x,a=[],l="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,c=function(e,t){return e.__v.__b-t.__v.__b},F.__r=0,_=/(PointerCapture)$|Capture$/i,f=0,p=U(!1),h=U(!0),d=0}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var r={};n.d(r,{zj:()=>k.zj,SD:()=>k.SD,V6:()=>k.V6,$K:()=>k.$K,vT:()=>k.vT,jb:()=>k.jb,yT:()=>k.yT,M_:()=>k.M_,hb:()=>k.hb,vJ:()=>k.vJ,ip:()=>k.ip,Nf:()=>k.Nf,Kr:()=>k.Kr,li:()=>k.li,J0:()=>k.J0,FH:()=>k.FH,v4:()=>k.v4});var o,i=n(622);null!=(o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0)&&o.__PREACT_DEVTOOLS__&&o.__PREACT_DEVTOOLS__.attachPreact("10.25.4",i.fF,{Fragment:i.FK,Component:i.uA});var s={};function a(e){return e.type===i.FK?"Fragment":"function"==typeof e.type?e.type.displayName||e.type.name:"string"==typeof e.type?e.type:"#text"}var u=[],l=[];function c(){return u.length>0?u[u.length-1]:null}var _=!0;function f(e){return"function"==typeof e.type&&e.type!=i.FK}function p(e){for(var t=[e],n=e;null!=n.__o;)t.push(n.__o),n=n.__o;return t.reduce((function(e,t){e+=" in "+a(t);var n=t.__source;return n?e+=" (at "+n.fileName+":"+n.lineNumber+")":_&&console.warn("Add @babel/plugin-transform-react-jsx-source to get a more detailed component stack. Note that you should not add it to production builds of your App for bundle size reasons."),_=!1,e+"\n"}),"")}var h="function"==typeof WeakMap;function d(e){var t=[];return e.__k?(e.__k.forEach((function(e){e&&"function"==typeof e.type?t.push.apply(t,d(e)):e&&"string"==typeof e.type&&t.push(e.type)})),t):t}function v(e){return e?"function"==typeof e.type?null==e.__?null!=e.__e&&null!=e.__e.parentNode?e.__e.parentNode.localName:"":v(e.__):e.type:""}var y=i.uA.prototype.setState;function m(e){return"table"===e||"tfoot"===e||"tbody"===e||"thead"===e||"td"===e||"tr"===e||"th"===e}i.uA.prototype.setState=function(e,t){return null==this.__v&&null==this.state&&console.warn('Calling "this.setState" inside the constructor of a component is a no-op and might be a bug in your application. Instead, set "this.state = {}" directly.\n\n'+p(c())),y.call(this,e,t)};var g=/^(address|article|aside|blockquote|details|div|dl|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hgroup|hr|main|menu|nav|ol|p|pre|search|section|table|ul)$/,w=i.uA.prototype.forceUpdate;function b(e){var t=e.props,n=a(e),r="";for(var o in t)if(t.hasOwnProperty(o)&&"children"!==o){var i=t[o];"function"==typeof i&&(i="function "+(i.displayName||i.name)+"() {}"),i=Object(i)!==i||i.toString?i+"":Object.prototype.toString.call(i),r+=" "+o+"="+JSON.stringify(i)}var s=t.children;return"<"+n+r+(s&&s.length?">..":" />")}i.uA.prototype.forceUpdate=function(e){return null==this.__v?console.warn('Calling "this.forceUpdate" inside the constructor of a component is a no-op and might be a bug in your application.\n\n'+p(c())):null==this.__P&&console.warn('Can\'t call "this.forceUpdate" on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method.\n\n'+p(this.__v)),w.call(this,e)},i.fF.__m=function(e,t){var n=e.type,r=t.map((function(e){return e&&e.localName})).filter(Boolean);console.error('Expected a DOM node of type "'+n+'" but found "'+r.join(", ")+"\" as available DOM-node(s), this is caused by the SSR'd HTML containing different DOM-nodes compared to the hydrated one.\n\n"+p(e))},function(){!function(){var e=i.fF.__b,t=i.fF.diffed,n=i.fF.__,r=i.fF.vnode,o=i.fF.__r;i.fF.diffed=function(e){f(e)&&l.pop(),u.pop(),t&&t(e)},i.fF.__b=function(t){f(t)&&u.push(t),e&&e(t)},i.fF.__=function(e,t){l=[],n&&n(e,t)},i.fF.vnode=function(e){e.__o=l.length>0?l[l.length-1]:null,r&&r(e)},i.fF.__r=function(e){f(e)&&l.push(e),o&&o(e)}}();var e=!1,t=i.fF.__b,n=i.fF.diffed,r=i.fF.vnode,o=i.fF.__r,c=i.fF.__e,_=i.fF.__,y=i.fF.__h,w=h?{useEffect:new WeakMap,useLayoutEffect:new WeakMap,lazyPropTypes:new WeakMap}:null,k=[];i.fF.__e=function(e,t,n,r){if(t&&t.__c&&"function"==typeof e.then){var o=e;e=new Error("Missing Suspense. The throwing component was: "+a(t));for(var i=t;i;i=i.__)if(i.__c&&i.__c.__c){e=o;break}if(e instanceof Error)throw e}try{(r=r||{}).componentStack=p(t),c(e,t,n,r),"function"!=typeof e.then&&setTimeout((function(){throw e}))}catch(e){throw e}},i.fF.__=function(e,t){if(!t)throw new Error("Undefined parent passed to render(), this is the second argument.\nCheck if the element is available in the DOM/has the correct id.");var n;switch(t.nodeType){case 1:case 11:case 9:n=!0;break;default:n=!1}if(!n){var r=a(e);throw new Error("Expected a valid HTML node as a second argument to render.\tReceived "+t+" instead: render(<"+r+" />, "+t+");")}_&&_(e,t)},i.fF.__b=function(n){var r=n.type;if(e=!0,void 0===r)throw new Error("Undefined component passed to createElement()\n\nYou likely forgot to export your component or might have mixed up default and named imports"+b(n)+"\n\n"+p(n));if(null!=r&&"object"==typeof r){if(void 0!==r.__k&&void 0!==r.__e)throw new Error("Invalid type passed to createElement(): "+r+"\n\nDid you accidentally pass a JSX literal as JSX twice?\n\n let My"+a(n)+" = "+b(r)+";\n let vnode = ;\n\nThis usually happens when you export a JSX literal and not the component.\n\n"+p(n));throw new Error("Invalid type passed to createElement(): "+(Array.isArray(r)?"array":r))}if(void 0!==n.ref&&"function"!=typeof n.ref&&"object"!=typeof n.ref&&!("$$typeof"in n))throw new Error('Component\'s "ref" property should be a function, or an object created by createRef(), but got ['+typeof n.ref+"] instead\n"+b(n)+"\n\n"+p(n));if("string"==typeof n.type)for(var o in n.props)if("o"===o[0]&&"n"===o[1]&&"function"!=typeof n.props[o]&&null!=n.props[o])throw new Error("Component's \""+o+'" property should be a function, but got ['+typeof n.props[o]+"] instead\n"+b(n)+"\n\n"+p(n));if("function"==typeof n.type&&n.type.propTypes){if("Lazy"===n.type.displayName&&w&&!w.lazyPropTypes.has(n.type)){var i="PropTypes are not supported on lazy(). Use propTypes on the wrapped component itself. ";try{var u=n.type();w.lazyPropTypes.set(n.type,!0),console.warn(i+"Component wrapped in lazy() is "+a(u))}catch(e){console.warn(i+"We will log the wrapped component's name once it is loaded.")}}var l=n.props;n.type.__f&&delete(l=function(e,t){for(var n in t)e[n]=t[n];return e}({},l)).ref,function(e,t,n,r,o){Object.keys(e).forEach((function(n){var i;try{i=e[n](t,n,r,"prop",null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(e){i=e}i&&!(i.message in s)&&(s[i.message]=!0,console.error("Failed prop type: "+i.message+(o&&"\n"+o()||"")))}))}(n.type.propTypes,l,0,a(n),(function(){return p(n)}))}t&&t(n)};var S,x=0;i.fF.__r=function(t){o&&o(t),e=!0;var n=t.__c;if(n===S?x++:x=1,x>=25)throw new Error("Too many re-renders. This is limited to prevent an infinite loop which may lock up your browser. The component causing this is: "+a(t));S=n},i.fF.__h=function(t,n,r){if(!t||!e)throw new Error("Hook can only be invoked from render methods.");y&&y(t,n,r)};var E=function(e,t){return{get:function(){var n="get"+e+t;k&&k.indexOf(n)<0&&(k.push(n),console.warn("getting vnode."+e+" is deprecated, "+t))},set:function(){var n="set"+e+t;k&&k.indexOf(n)<0&&(k.push(n),console.warn("setting vnode."+e+" is not allowed, "+t))}}},T={nodeName:E("nodeName","use vnode.type"),attributes:E("attributes","use vnode.props"),children:E("children","use vnode.props.children")},O=Object.create({},T);i.fF.vnode=function(e){var t=e.props;if(null!==e.type&&null!=t&&("__source"in t||"__self"in t)){var n=e.props={};for(var o in t){var i=t[o];"__source"===o?e.__source=i:"__self"===o?e.__self=i:n[o]=i}}e.__proto__=O,r&&r(e)},i.fF.diffed=function(t){var r,o=t.type,i=t.__;if(t.__k&&t.__k.forEach((function(e){if("object"==typeof e&&e&&void 0===e.type){var n=Object.keys(e).join(",");throw new Error("Objects are not valid as a child. Encountered an object with the keys {"+n+"}.\n\n"+p(t))}})),t.__c===S&&(x=0),"string"==typeof o&&(m(o)||"p"===o||"a"===o||"button"===o)){var s=v(i);if(""!==s&&m(o))"table"===o&&"td"!==s&&m(s)?(console.log(s,i.__e),console.error("Improper nesting of table. Your

    should not have a table-node parent."+b(t)+"\n\n"+p(t))):"thead"!==o&&"tfoot"!==o&&"tbody"!==o||"table"===s?"tr"===o&&"thead"!==s&&"tfoot"!==s&&"tbody"!==s?console.error("Improper nesting of table. Your should have a parent."+b(t)+"\n\n"+p(t)):"td"===o&&"tr"!==s?console.error("Improper nesting of table. Your parent."+b(t)+"\n\n"+p(t)):"th"===o&&"tr"!==s&&console.error("Improper nesting of table. Your ."+b(t)+"\n\n"+p(t)):console.error("Improper nesting of table. Your should have a
    should have a
    should have a
    parent."+b(t)+"\n\n"+p(t));else if("p"===o){var u=d(t).filter((function(e){return g.test(e)}));u.length&&console.error("Improper nesting of paragraph. Your

    should not have "+u.join(", ")+" as child-elements."+b(t)+"\n\n"+p(t))}else"a"!==o&&"button"!==o||-1!==d(t).indexOf(o)&&console.error("Improper nesting of interactive content. Your <"+o+"> should not have other "+("a"===o?"anchor":"button")+" tags as child-elements."+b(t)+"\n\n"+p(t))}if(e=!1,n&&n(t),null!=t.__k)for(var l=[],c=0;c { /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ Ob: () => (/* binding */ E), -/* harmony export */ Qv: () => (/* binding */ D), -/* harmony export */ XX: () => (/* binding */ B), +/* harmony export */ Ob: () => (/* binding */ G), +/* harmony export */ Qv: () => (/* binding */ E), +/* harmony export */ XX: () => (/* binding */ D), /* harmony export */ fF: () => (/* binding */ l), -/* harmony export */ h: () => (/* binding */ _), -/* harmony export */ q6: () => (/* binding */ G), -/* harmony export */ uA: () => (/* binding */ k), +/* harmony export */ h: () => (/* binding */ g), +/* harmony export */ q6: () => (/* binding */ J), +/* harmony export */ uA: () => (/* binding */ x), /* harmony export */ zO: () => (/* binding */ t) /* harmony export */ }); /* unused harmony exports Fragment, createElement, createRef, toChildArray */ -var n,l,u,t,i,o,r,f,e,c,s,a,h={},v=[],p=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,y=Array.isArray;function d(n,l){for(var u in l)n[u]=l[u];return n}function w(n){n&&n.parentNode&&n.parentNode.removeChild(n)}function _(l,u,t){var i,o,r,f={};for(r in u)"key"==r?i=u[r]:"ref"==r?o=u[r]:f[r]=u[r];if(arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):t),"function"==typeof l&&null!=l.defaultProps)for(r in l.defaultProps)void 0===f[r]&&(f[r]=l.defaultProps[r]);return g(l,f,i,o,null)}function g(n,t,i,o,r){var f={type:n,props:t,key:i,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==r?++u:r,__i:-1,__u:0};return null==r&&null!=l.vnode&&l.vnode(f),f}function m(){return{current:null}}function b(n){return n.children}function k(n,l){this.props=n,this.context=l}function x(n,l){if(null==l)return n.__?x(n.__,n.__i+1):null;for(var u;lu&&i.sort(f));M.__r=0}function P(n,l,u,t,i,o,r,f,e,c,s){var a,p,y,d,w,_=t&&t.__k||v,g=l.length;for(u.__d=e,$(u,l,_),e=u.__d,a=0;a0?g(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i).__=n,i.__b=n.__b+1,o=null,-1!==(f=i.__i=L(i,u,r,s))&&(s--,(o=u[f])&&(o.__u|=131072)),null==o||null===o.__v?(-1==f&&a--,"function"!=typeof i.type&&(i.__u|=65536)):f!==r&&(f==r-1?a--:f==r+1?a++:(f>r?a--:a++,i.__u|=65536))):i=n.__k[t]=null;if(s)for(t=0;t(null!=e&&0==(131072&e.__u)?1:0))for(;r>=0||f=0){if((e=l[r])&&0==(131072&e.__u)&&i==e.key&&o===e.type)return r;r--}if(f2&&(e.children=arguments.length>3?n.call(arguments,2):t),g(l.type,e,i||l.key,o||l.ref,null)}function G(n,l){var u={__c:l="__cC"+a++,__:n,Consumer:function(n,l){return n.children(l)},Provider:function(n){var u,t;return this.getChildContext||(u=new Set,(t={})[l]=this,this.getChildContext=function(){return t},this.componentWillUnmount=function(){u=null},this.shouldComponentUpdate=function(n){this.props.value!==n.value&&u.forEach(function(n){n.__e=!0,S(n)})},this.sub=function(n){u.add(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){u&&u.delete(n),l&&l.call(n)}}),n.children}};return u.Provider.__=u.Consumer.contextType=u}n=v.slice,l={__e:function(n,l,u,t){for(var i,o,r;l=l.__;)if((i=l.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(n)),r=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(n,t||{}),r=i.__d),r)return i.__E=i}catch(l){n=l}throw n}},u=0,t=function(n){return null!=n&&null==n.constructor},k.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=d({},this.state),"function"==typeof n&&(n=n(d({},u),this.props)),n&&d(u,n),null!=n&&this.__v&&(l&&this._sb.push(l),S(this))},k.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),S(this))},k.prototype.render=b,i=[],r="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,f=function(n,l){return n.__v.__b-l.__v.__b},M.__r=0,e=0,c=F(!1),s=F(!0),a=0; +var n,l,u,t,i,r,o,e,f,c,s,a,h,p={},v=[],y=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,d=Array.isArray;function w(n,l){for(var u in l)n[u]=l[u];return n}function _(n){n&&n.parentNode&&n.parentNode.removeChild(n)}function g(l,u,t){var i,r,o,e={};for(o in u)"key"==o?i=u[o]:"ref"==o?r=u[o]:e[o]=u[o];if(arguments.length>2&&(e.children=arguments.length>3?n.call(arguments,2):t),"function"==typeof l&&null!=l.defaultProps)for(o in l.defaultProps)void 0===e[o]&&(e[o]=l.defaultProps[o]);return m(l,e,i,r,null)}function m(n,t,i,r,o){var e={type:n,props:t,key:i,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==o?++u:o,__i:-1,__u:0};return null==o&&null!=l.vnode&&l.vnode(e),e}function b(){return{current:null}}function k(n){return n.children}function x(n,l){this.props=n,this.context=l}function C(n,l){if(null==l)return n.__?C(n.__,n.__i+1):null;for(var u;lu&&i.sort(e));P.__r=0}function $(n,l,u,t,i,r,o,e,f,c,s){var a,h,y,d,w,_,g=t&&t.__k||v,m=l.length;for(f=I(u,l,g,f,m),a=0;a0?m(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=n,o.__b=n.__b+1,e=null,-1!==(c=o.__i=L(o,u,f,a))&&(a--,(e=u[c])&&(e.__u|=2)),null==e||null===e.__v?(-1==c&&h--,"function"!=typeof o.type&&(o.__u|=4)):c!=f&&(c==f-1?h--:c==f+1?h++:(c>f?h--:h++,o.__u|=4))):n.__k[r]=null;if(a)for(r=0;r(null!=f&&0==(2&f.__u)?1:0))for(i=u-1,r=u+1;i>=0||r=0){if((f=l[i])&&0==(2&f.__u)&&o==f.key&&e===f.type)return i;i--}if(r2&&(f.children=arguments.length>3?n.call(arguments,2):t),m(l.type,f,i||l.key,r||l.ref,null)}function J(n,l){var u={__c:l="__cC"+h++,__:n,Consumer:function(n,l){return n.children(l)},Provider:function(n){var u,t;return this.getChildContext||(u=new Set,(t={})[l]=this,this.getChildContext=function(){return t},this.componentWillUnmount=function(){u=null},this.shouldComponentUpdate=function(n){this.props.value!==n.value&&u.forEach(function(n){n.__e=!0,M(n)})},this.sub=function(n){u.add(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){u&&u.delete(n),l&&l.call(n)}}),n.children}};return u.Provider.__=u.Consumer.contextType=u}n=v.slice,l={__e:function(n,l,u,t){for(var i,r,o;l=l.__;)if((i=l.__c)&&!i.__)try{if((r=i.constructor)&&null!=r.getDerivedStateFromError&&(i.setState(r.getDerivedStateFromError(n)),o=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(n,t||{}),o=i.__d),o)return i.__E=i}catch(l){n=l}throw n}},u=0,t=function(n){return null!=n&&null==n.constructor},x.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=w({},this.state),"function"==typeof n&&(n=n(w({},u),this.props)),n&&w(u,n),null!=n&&this.__v&&(l&&this._sb.push(l),M(this))},x.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),M(this))},x.prototype.render=k,i=[],o="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,e=function(n,l){return n.__v.__b-l.__v.__b},P.__r=0,f=/(PointerCapture)$|Capture$/i,c=0,s=O(!1),a=O(!0),h=0; /***/ }) @@ -90,12 +90,12 @@ __webpack_require__.d(__webpack_exports__, { // EXTERNAL MODULE: ./node_modules/preact/dist/preact.module.js var preact_module = __webpack_require__(622); ;// ./node_modules/preact/hooks/dist/hooks.module.js -var hooks_module_t,r,hooks_module_u,i,hooks_module_o=0,hooks_module_f=[],hooks_module_c=preact_module/* options */.fF,e=hooks_module_c.__b,a=hooks_module_c.__r,v=hooks_module_c.diffed,l=hooks_module_c.__c,m=hooks_module_c.unmount,s=hooks_module_c.__;function d(n,t){hooks_module_c.__h&&hooks_module_c.__h(r,n,hooks_module_o||t),hooks_module_o=0;var u=r.__H||(r.__H={__:[],__h:[]});return n>=u.__.length&&u.__.push({}),u.__[n]}function h(n){return hooks_module_o=1,p(D,n)}function p(n,u,i){var o=d(hooks_module_t++,2);if(o.t=n,!o.__c&&(o.__=[i?i(u):D(void 0,u),function(n){var t=o.__N?o.__N[0]:o.__[0],r=o.t(t,n);t!==r&&(o.__N=[r,o.__[1]],o.__c.setState({}))}],o.__c=r,!r.u)){var f=function(n,t,r){if(!o.__c.__H)return!0;var u=o.__c.__H.__.filter(function(n){return!!n.__c});if(u.every(function(n){return!n.__N}))return!c||c.call(this,n,t,r);var i=!1;return u.forEach(function(n){if(n.__N){var t=n.__[0];n.__=n.__N,n.__N=void 0,t!==n.__[0]&&(i=!0)}}),!(!i&&o.__c.props===n)&&(!c||c.call(this,n,t,r))};r.u=!0;var c=r.shouldComponentUpdate,e=r.componentWillUpdate;r.componentWillUpdate=function(n,t,r){if(this.__e){var u=c;c=void 0,f(n,t,r),c=u}e&&e.call(this,n,t,r)},r.shouldComponentUpdate=f}return o.__N||o.__}function y(n,u){var i=d(hooks_module_t++,3);!hooks_module_c.__s&&C(i.__H,u)&&(i.__=n,i.i=u,r.__H.__h.push(i))}function _(n,u){var i=d(hooks_module_t++,4);!hooks_module_c.__s&&C(i.__H,u)&&(i.__=n,i.i=u,r.__h.push(i))}function A(n){return hooks_module_o=5,T(function(){return{current:n}},[])}function F(n,t,r){hooks_module_o=6,_(function(){return"function"==typeof n?(n(t()),function(){return n(null)}):n?(n.current=t(),function(){return n.current=null}):void 0},null==r?r:r.concat(n))}function T(n,r){var u=d(hooks_module_t++,7);return C(u.__H,r)&&(u.__=n(),u.__H=r,u.__h=n),u.__}function q(n,t){return hooks_module_o=8,T(function(){return n},t)}function x(n){var u=r.context[n.__c],i=d(hooks_module_t++,9);return i.c=n,u?(null==i.__&&(i.__=!0,u.sub(r)),u.props.value):n.__}function P(n,t){hooks_module_c.useDebugValue&&hooks_module_c.useDebugValue(t?t(n):n)}function b(n){var u=d(hooks_module_t++,10),i=h();return u.__=n,r.componentDidCatch||(r.componentDidCatch=function(n,t){u.__&&u.__(n,t),i[1](n)}),[i[0],function(){i[1](void 0)}]}function g(){var n=d(hooks_module_t++,11);if(!n.__){for(var u=r.__v;null!==u&&!u.__m&&null!==u.__;)u=u.__;var i=u.__m||(u.__m=[0,0]);n.__="P"+i[0]+"-"+i[1]++}return n.__}function j(){for(var n;n=hooks_module_f.shift();)if(n.__P&&n.__H)try{n.__H.__h.forEach(z),n.__H.__h.forEach(B),n.__H.__h=[]}catch(t){n.__H.__h=[],hooks_module_c.__e(t,n.__v)}}hooks_module_c.__b=function(n){r=null,e&&e(n)},hooks_module_c.__=function(n,t){n&&t.__k&&t.__k.__m&&(n.__m=t.__k.__m),s&&s(n,t)},hooks_module_c.__r=function(n){a&&a(n),hooks_module_t=0;var i=(r=n.__c).__H;i&&(hooks_module_u===r?(i.__h=[],r.__h=[],i.__.forEach(function(n){n.__N&&(n.__=n.__N),n.i=n.__N=void 0})):(i.__h.forEach(z),i.__h.forEach(B),i.__h=[],hooks_module_t=0)),hooks_module_u=r},hooks_module_c.diffed=function(n){v&&v(n);var t=n.__c;t&&t.__H&&(t.__H.__h.length&&(1!==hooks_module_f.push(t)&&i===hooks_module_c.requestAnimationFrame||((i=hooks_module_c.requestAnimationFrame)||w)(j)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.i=void 0})),hooks_module_u=r=null},hooks_module_c.__c=function(n,t){t.some(function(n){try{n.__h.forEach(z),n.__h=n.__h.filter(function(n){return!n.__||B(n)})}catch(r){t.some(function(n){n.__h&&(n.__h=[])}),t=[],hooks_module_c.__e(r,n.__v)}}),l&&l(n,t)},hooks_module_c.unmount=function(n){m&&m(n);var t,r=n.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{z(n)}catch(n){t=n}}),r.__H=void 0,t&&hooks_module_c.__e(t,r.__v))};var k="function"==typeof requestAnimationFrame;function w(n){var t,r=function(){clearTimeout(u),k&&cancelAnimationFrame(t),setTimeout(n)},u=setTimeout(r,100);k&&(t=requestAnimationFrame(r))}function z(n){var t=r,u=n.__c;"function"==typeof u&&(n.__c=void 0,u()),r=t}function B(n){var t=r;n.__c=n.__(),r=t}function C(n,t){return!n||n.length!==t.length||t.some(function(t,r){return t!==n[r]})}function D(n,t){return"function"==typeof t?t(n):t} +var hooks_module_t,r,hooks_module_u,i,hooks_module_o=0,hooks_module_f=[],hooks_module_c=preact_module/* options */.fF,e=hooks_module_c.__b,a=hooks_module_c.__r,v=hooks_module_c.diffed,l=hooks_module_c.__c,m=hooks_module_c.unmount,s=hooks_module_c.__;function d(n,t){hooks_module_c.__h&&hooks_module_c.__h(r,n,hooks_module_o||t),hooks_module_o=0;var u=r.__H||(r.__H={__:[],__h:[]});return n>=u.__.length&&u.__.push({}),u.__[n]}function h(n){return hooks_module_o=1,p(D,n)}function p(n,u,i){var o=d(hooks_module_t++,2);if(o.t=n,!o.__c&&(o.__=[i?i(u):D(void 0,u),function(n){var t=o.__N?o.__N[0]:o.__[0],r=o.t(t,n);t!==r&&(o.__N=[r,o.__[1]],o.__c.setState({}))}],o.__c=r,!r.u)){var f=function(n,t,r){if(!o.__c.__H)return!0;var u=o.__c.__H.__.filter(function(n){return!!n.__c});if(u.every(function(n){return!n.__N}))return!c||c.call(this,n,t,r);var i=o.__c.props!==n;return u.forEach(function(n){if(n.__N){var t=n.__[0];n.__=n.__N,n.__N=void 0,t!==n.__[0]&&(i=!0)}}),c&&c.call(this,n,t,r)||i};r.u=!0;var c=r.shouldComponentUpdate,e=r.componentWillUpdate;r.componentWillUpdate=function(n,t,r){if(this.__e){var u=c;c=void 0,f(n,t,r),c=u}e&&e.call(this,n,t,r)},r.shouldComponentUpdate=f}return o.__N||o.__}function y(n,u){var i=d(hooks_module_t++,3);!hooks_module_c.__s&&C(i.__H,u)&&(i.__=n,i.i=u,r.__H.__h.push(i))}function _(n,u){var i=d(hooks_module_t++,4);!hooks_module_c.__s&&C(i.__H,u)&&(i.__=n,i.i=u,r.__h.push(i))}function A(n){return hooks_module_o=5,T(function(){return{current:n}},[])}function F(n,t,r){hooks_module_o=6,_(function(){return"function"==typeof n?(n(t()),function(){return n(null)}):n?(n.current=t(),function(){return n.current=null}):void 0},null==r?r:r.concat(n))}function T(n,r){var u=d(hooks_module_t++,7);return C(u.__H,r)&&(u.__=n(),u.__H=r,u.__h=n),u.__}function q(n,t){return hooks_module_o=8,T(function(){return n},t)}function x(n){var u=r.context[n.__c],i=d(hooks_module_t++,9);return i.c=n,u?(null==i.__&&(i.__=!0,u.sub(r)),u.props.value):n.__}function P(n,t){hooks_module_c.useDebugValue&&hooks_module_c.useDebugValue(t?t(n):n)}function b(n){var u=d(hooks_module_t++,10),i=h();return u.__=n,r.componentDidCatch||(r.componentDidCatch=function(n,t){u.__&&u.__(n,t),i[1](n)}),[i[0],function(){i[1](void 0)}]}function g(){var n=d(hooks_module_t++,11);if(!n.__){for(var u=r.__v;null!==u&&!u.__m&&null!==u.__;)u=u.__;var i=u.__m||(u.__m=[0,0]);n.__="P"+i[0]+"-"+i[1]++}return n.__}function j(){for(var n;n=hooks_module_f.shift();)if(n.__P&&n.__H)try{n.__H.__h.forEach(z),n.__H.__h.forEach(B),n.__H.__h=[]}catch(t){n.__H.__h=[],hooks_module_c.__e(t,n.__v)}}hooks_module_c.__b=function(n){r=null,e&&e(n)},hooks_module_c.__=function(n,t){n&&t.__k&&t.__k.__m&&(n.__m=t.__k.__m),s&&s(n,t)},hooks_module_c.__r=function(n){a&&a(n),hooks_module_t=0;var i=(r=n.__c).__H;i&&(hooks_module_u===r?(i.__h=[],r.__h=[],i.__.forEach(function(n){n.__N&&(n.__=n.__N),n.i=n.__N=void 0})):(i.__h.forEach(z),i.__h.forEach(B),i.__h=[],hooks_module_t=0)),hooks_module_u=r},hooks_module_c.diffed=function(n){v&&v(n);var t=n.__c;t&&t.__H&&(t.__H.__h.length&&(1!==hooks_module_f.push(t)&&i===hooks_module_c.requestAnimationFrame||((i=hooks_module_c.requestAnimationFrame)||w)(j)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.i=void 0})),hooks_module_u=r=null},hooks_module_c.__c=function(n,t){t.some(function(n){try{n.__h.forEach(z),n.__h=n.__h.filter(function(n){return!n.__||B(n)})}catch(r){t.some(function(n){n.__h&&(n.__h=[])}),t=[],hooks_module_c.__e(r,n.__v)}}),l&&l(n,t)},hooks_module_c.unmount=function(n){m&&m(n);var t,r=n.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{z(n)}catch(n){t=n}}),r.__H=void 0,t&&hooks_module_c.__e(t,r.__v))};var k="function"==typeof requestAnimationFrame;function w(n){var t,r=function(){clearTimeout(u),k&&cancelAnimationFrame(t),setTimeout(n)},u=setTimeout(r,100);k&&(t=requestAnimationFrame(r))}function z(n){var t=r,u=n.__c;"function"==typeof u&&(n.__c=void 0,u()),r=t}function B(n){var t=r;n.__c=n.__(),r=t}function C(n,t){return!n||n.length!==t.length||t.some(function(t,r){return t!==n[r]})}function D(n,t){return"function"==typeof t?t(n):t} ;// ./node_modules/@preact/signals-core/dist/signals-core.module.js var signals_core_module_i=Symbol.for("preact-signals");function signals_core_module_t(){if(!(signals_core_module_s>1)){var i,t=!1;while(void 0!==signals_core_module_h){var r=signals_core_module_h;signals_core_module_h=void 0;signals_core_module_f++;while(void 0!==r){var o=r.o;r.o=void 0;r.f&=-3;if(!(8&r.f)&&signals_core_module_c(r))try{r.c()}catch(r){if(!t){i=r;t=!0}}r=o}}signals_core_module_f=0;signals_core_module_s--;if(t)throw i}else signals_core_module_s--}function signals_core_module_r(i){if(signals_core_module_s>0)return i();signals_core_module_s++;try{return i()}finally{signals_core_module_t()}}var signals_core_module_o=void 0;function n(i){var t=signals_core_module_o;signals_core_module_o=void 0;try{return i()}finally{signals_core_module_o=t}}var signals_core_module_h=void 0,signals_core_module_s=0,signals_core_module_f=0,signals_core_module_v=0;function signals_core_module_e(i){if(void 0!==signals_core_module_o){var t=i.n;if(void 0===t||t.t!==signals_core_module_o){t={i:0,S:i,p:signals_core_module_o.s,n:void 0,t:signals_core_module_o,e:void 0,x:void 0,r:t};if(void 0!==signals_core_module_o.s)signals_core_module_o.s.n=t;signals_core_module_o.s=t;i.n=t;if(32&signals_core_module_o.f)i.S(t);return t}else if(-1===t.i){t.i=0;if(void 0!==t.n){t.n.p=t.p;if(void 0!==t.p)t.p.n=t.n;t.p=signals_core_module_o.s;t.n=void 0;signals_core_module_o.s.n=t;signals_core_module_o.s=t}return t}}}function signals_core_module_u(i){this.v=i;this.i=0;this.n=void 0;this.t=void 0}signals_core_module_u.prototype.brand=signals_core_module_i;signals_core_module_u.prototype.h=function(){return!0};signals_core_module_u.prototype.S=function(i){if(this.t!==i&&void 0===i.e){i.x=this.t;if(void 0!==this.t)this.t.e=i;this.t=i}};signals_core_module_u.prototype.U=function(i){if(void 0!==this.t){var t=i.e,r=i.x;if(void 0!==t){t.x=r;i.e=void 0}if(void 0!==r){r.e=t;i.x=void 0}if(i===this.t)this.t=r}};signals_core_module_u.prototype.subscribe=function(i){var t=this;return E(function(){var r=t.value,n=signals_core_module_o;signals_core_module_o=void 0;try{i(r)}finally{signals_core_module_o=n}})};signals_core_module_u.prototype.valueOf=function(){return this.value};signals_core_module_u.prototype.toString=function(){return this.value+""};signals_core_module_u.prototype.toJSON=function(){return this.value};signals_core_module_u.prototype.peek=function(){var i=signals_core_module_o;signals_core_module_o=void 0;try{return this.value}finally{signals_core_module_o=i}};Object.defineProperty(signals_core_module_u.prototype,"value",{get:function(){var i=signals_core_module_e(this);if(void 0!==i)i.i=this.i;return this.v},set:function(i){if(i!==this.v){if(signals_core_module_f>100)throw new Error("Cycle detected");this.v=i;this.i++;signals_core_module_v++;signals_core_module_s++;try{for(var r=this.t;void 0!==r;r=r.x)r.t.N()}finally{signals_core_module_t()}}}});function signals_core_module_d(i){return new signals_core_module_u(i)}function signals_core_module_c(i){for(var t=i.s;void 0!==t;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function signals_core_module_a(i){for(var t=i.s;void 0!==t;t=t.n){var r=t.S.n;if(void 0!==r)t.r=r;t.S.n=t;t.i=-1;if(void 0===t.n){i.s=t;break}}}function signals_core_module_l(i){var t=i.s,r=void 0;while(void 0!==t){var o=t.p;if(-1===t.i){t.S.U(t);if(void 0!==o)o.n=t.n;if(void 0!==t.n)t.n.p=o}else r=t;t.S.n=t.r;if(void 0!==t.r)t.r=void 0;t=o}i.s=r}function signals_core_module_y(i){signals_core_module_u.call(this,void 0);this.x=i;this.s=void 0;this.g=signals_core_module_v-1;this.f=4}(signals_core_module_y.prototype=new signals_core_module_u).h=function(){this.f&=-3;if(1&this.f)return!1;if(32==(36&this.f))return!0;this.f&=-5;if(this.g===signals_core_module_v)return!0;this.g=signals_core_module_v;this.f|=1;if(this.i>0&&!signals_core_module_c(this)){this.f&=-2;return!0}var i=signals_core_module_o;try{signals_core_module_a(this);signals_core_module_o=this;var t=this.x();if(16&this.f||this.v!==t||0===this.i){this.v=t;this.f&=-17;this.i++}}catch(i){this.v=i;this.f|=16;this.i++}signals_core_module_o=i;signals_core_module_l(this);this.f&=-2;return!0};signals_core_module_y.prototype.S=function(i){if(void 0===this.t){this.f|=36;for(var t=this.s;void 0!==t;t=t.n)t.S.S(t)}signals_core_module_u.prototype.S.call(this,i)};signals_core_module_y.prototype.U=function(i){if(void 0!==this.t){signals_core_module_u.prototype.U.call(this,i);if(void 0===this.t){this.f&=-33;for(var t=this.s;void 0!==t;t=t.n)t.S.U(t)}}};signals_core_module_y.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var i=this.t;void 0!==i;i=i.x)i.t.N()}};Object.defineProperty(signals_core_module_y.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var i=signals_core_module_e(this);this.h();if(void 0!==i)i.i=this.i;if(16&this.f)throw this.v;return this.v}});function signals_core_module_w(i){return new signals_core_module_y(i)}function signals_core_module_(i){var r=i.u;i.u=void 0;if("function"==typeof r){signals_core_module_s++;var n=signals_core_module_o;signals_core_module_o=void 0;try{r()}catch(t){i.f&=-2;i.f|=8;signals_core_module_g(i);throw t}finally{signals_core_module_o=n;signals_core_module_t()}}}function signals_core_module_g(i){for(var t=i.s;void 0!==t;t=t.n)t.S.U(t);i.x=void 0;i.s=void 0;signals_core_module_(i)}function signals_core_module_p(i){if(signals_core_module_o!==this)throw new Error("Out-of-order effect");signals_core_module_l(this);signals_core_module_o=i;this.f&=-2;if(8&this.f)signals_core_module_g(this);signals_core_module_t()}function signals_core_module_b(i){this.x=i;this.u=void 0;this.s=void 0;this.o=void 0;this.f=32}signals_core_module_b.prototype.c=function(){var i=this.S();try{if(8&this.f)return;if(void 0===this.x)return;var t=this.x();if("function"==typeof t)this.u=t}finally{i()}};signals_core_module_b.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1;this.f&=-9;signals_core_module_(this);signals_core_module_a(this);signals_core_module_s++;var i=signals_core_module_o;signals_core_module_o=this;return signals_core_module_p.bind(this,i)};signals_core_module_b.prototype.N=function(){if(!(2&this.f)){this.f|=2;this.o=signals_core_module_h;signals_core_module_h=this}};signals_core_module_b.prototype.d=function(){this.f|=8;if(!(1&this.f))signals_core_module_g(this)};function E(i){var t=new signals_core_module_b(i);try{t.c()}catch(i){t.d();throw i}return t.d.bind(t)} ;// ./node_modules/@preact/signals/dist/signals.module.js -var signals_module_v,signals_module_s;function signals_module_l(n,i){preact_module/* options */.fF[n]=i.bind(null,preact_module/* options */.fF[n]||function(){})}function signals_module_d(n){if(signals_module_s)signals_module_s();signals_module_s=n&&n.S()}function signals_module_p(n){var r=this,f=n.data,o=useSignal(f);o.value=f;var e=T(function(){var n=r.__v;while(n=n.__)if(n.__c){n.__c.__$f|=4;break}r.__$u.c=function(){var n;if(!(0,preact_module/* isValidElement */.zO)(e.peek())&&3===(null==(n=r.base)?void 0:n.nodeType))r.base.data=e.peek();else{r.__$f|=1;r.setState({})}};return signals_core_module_w(function(){var n=o.value.value;return 0===n?0:!0===n?"":n||""})},[]);return e.value}signals_module_p.displayName="_st";Object.defineProperties(signals_core_module_u.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:signals_module_p},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}});signals_module_l("__b",function(n,r){if("string"==typeof r.type){var i,t=r.props;for(var f in t)if("children"!==f){var o=t[f];if(o instanceof signals_core_module_u){if(!i)r.__np=i={};i[f]=o;t[f]=o.peek()}}}n(r)});signals_module_l("__r",function(n,r){signals_module_d();var i,t=r.__c;if(t){t.__$f&=-2;if(void 0===(i=t.__$u))t.__$u=i=function(n){var r;E(function(){r=this});r.c=function(){t.__$f|=1;t.setState({})};return r}()}signals_module_v=t;signals_module_d(i);n(r)});signals_module_l("__e",function(n,r,i,t){signals_module_d();signals_module_v=void 0;n(r,i,t)});signals_module_l("diffed",function(n,r){signals_module_d();signals_module_v=void 0;var i;if("string"==typeof r.type&&(i=r.__e)){var t=r.__np,f=r.props;if(t){var o=i.U;if(o)for(var e in o){var u=o[e];if(void 0!==u&&!(e in t)){u.d();o[e]=void 0}}else i.U=o={};for(var a in t){var c=o[a],s=t[a];if(void 0===c){c=signals_module_(i,a,s,f);o[a]=c}else c.o(s,f)}}}n(r)});function signals_module_(n,r,i,t){var f=r in n&&void 0===n.ownerSVGElement,o=signals_core_module_d(i);return{o:function(n,r){o.value=n;t=r},d:E(function(){var i=o.value.value;if(t[r]!==i){t[r]=i;if(f)n[r]=i;else if(i)n.setAttribute(r,i);else n.removeAttribute(r)}})}}signals_module_l("unmount",function(n,r){if("string"==typeof r.type){var i=r.__e;if(i){var t=i.U;if(t){i.U=void 0;for(var f in t){var o=t[f];if(o)o.d()}}}}else{var e=r.__c;if(e){var u=e.__$u;if(u){e.__$u=void 0;u.d()}}}n(r)});signals_module_l("__h",function(n,r,i,t){if(t<3||9===t)r.__$f|=2;n(r,i,t)});preact_module/* Component */.uA.prototype.shouldComponentUpdate=function(n,r){var i=this.__$u;if(!(i&&void 0!==i.s||4&this.__$f))return!0;if(3&this.__$f)return!0;for(var t in r)return!0;for(var f in n)if("__source"!==f&&n[f]!==this.props[f])return!0;for(var o in this.props)if(!(o in n))return!0;return!1};function useSignal(n){return T(function(){return signals_core_module_d(n)},[])}function useComputed(n){var r=f(n);r.current=n;signals_module_v.__$f|=4;return t(function(){return u(function(){return r.current()})},[])}function useSignalEffect(n){var r=f(n);r.current=n;o(function(){return c(function(){return r.current()})},[])} +var signals_module_v,signals_module_s;function signals_module_l(i,n){preact_module/* options */.fF[i]=n.bind(null,preact_module/* options */.fF[i]||function(){})}function signals_module_d(i){if(signals_module_s)signals_module_s();signals_module_s=i&&i.S()}function signals_module_h(i){var r=this,f=i.data,o=useSignal(f);o.value=f;var e=T(function(){var i=r.__v;while(i=i.__)if(i.__c){i.__c.__$f|=4;break}r.__$u.c=function(){var i,t=r.__$u.S(),f=e.value;t();if((0,preact_module/* isValidElement */.zO)(f)||3!==(null==(i=r.base)?void 0:i.nodeType)){r.__$f|=1;r.setState({})}else r.base.data=f};return signals_core_module_w(function(){var i=o.value.value;return 0===i?0:!0===i?"":i||""})},[]);return e.value}signals_module_h.displayName="_st";Object.defineProperties(signals_core_module_u.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:signals_module_h},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}});signals_module_l("__b",function(i,r){if("string"==typeof r.type){var n,t=r.props;for(var f in t)if("children"!==f){var o=t[f];if(o instanceof signals_core_module_u){if(!n)r.__np=n={};n[f]=o;t[f]=o.peek()}}}i(r)});signals_module_l("__r",function(i,r){signals_module_d();var n,t=r.__c;if(t){t.__$f&=-2;if(void 0===(n=t.__$u))t.__$u=n=function(i){var r;E(function(){r=this});r.c=function(){t.__$f|=1;t.setState({})};return r}()}signals_module_v=t;signals_module_d(n);i(r)});signals_module_l("__e",function(i,r,n,t){signals_module_d();signals_module_v=void 0;i(r,n,t)});signals_module_l("diffed",function(i,r){signals_module_d();signals_module_v=void 0;var n;if("string"==typeof r.type&&(n=r.__e)){var t=r.__np,f=r.props;if(t){var o=n.U;if(o)for(var e in o){var u=o[e];if(void 0!==u&&!(e in t)){u.d();o[e]=void 0}}else n.U=o={};for(var a in t){var c=o[a],s=t[a];if(void 0===c){c=signals_module_p(n,a,s,f);o[a]=c}else c.o(s,f)}}}i(r)});function signals_module_p(i,r,n,t){var f=r in i&&void 0===i.ownerSVGElement,o=signals_core_module_d(n);return{o:function(i,r){o.value=i;t=r},d:E(function(){var n=o.value.value;if(t[r]!==n){t[r]=n;if(f)i[r]=n;else if(n)i.setAttribute(r,n);else i.removeAttribute(r)}})}}signals_module_l("unmount",function(i,r){if("string"==typeof r.type){var n=r.__e;if(n){var t=n.U;if(t){n.U=void 0;for(var f in t){var o=t[f];if(o)o.d()}}}}else{var e=r.__c;if(e){var u=e.__$u;if(u){e.__$u=void 0;u.d()}}}i(r)});signals_module_l("__h",function(i,r,n,t){if(t<3||9===t)r.__$f|=2;i(r,n,t)});preact_module/* Component */.uA.prototype.shouldComponentUpdate=function(i,r){var n=this.__$u,t=n&&void 0!==n.s;for(var f in r)return!0;if(this.__f||"boolean"==typeof this.u&&!0===this.u){if(!(t||2&this.__$f||4&this.__$f))return!0;if(1&this.__$f)return!0}else{if(!(t||4&this.__$f))return!0;if(3&this.__$f)return!0}for(var o in i)if("__source"!==o&&i[o]!==this.props[o])return!0;for(var e in this.props)if(!(e in i))return!0;return!1};function useSignal(i){return T(function(){return signals_core_module_d(i)},[])}function useComputed(i){var r=f(i);r.current=i;signals_module_v.__$f|=4;return t(function(){return u(function(){return r.current()})},[])}function useSignalEffect(i){var r=f(i);r.current=i;o(function(){return c(function(){return r.current()})},[])} ;// ./node_modules/@wordpress/interactivity/build-module/namespaces.js const namespaceStack = []; const getNamespace = () => namespaceStack.slice(-1)[0]; @@ -167,7 +167,7 @@ const getContext = namespace => { /** * Retrieves a representation of the element where a function from the store - * is being evalutated. Such representation is read-only, and contains a + * is being evaluated. Such representation is read-only, and contains a * reference to the DOM element, its props and a local reactive state. * * @return Element representation. @@ -264,11 +264,10 @@ const afterNextFrame = callback => { /** * Returns a promise that resolves after yielding to main. * - * @return Promise + * @return Promise */ -const splitTask = () => { +const splitTask = typeof window.scheduler?.yield === 'function' ? window.scheduler.yield.bind(window.scheduler) : () => { return new Promise(resolve => { - // TODO: Use scheduler.yield() when available. setTimeout(resolve, 0); }); }; @@ -328,7 +327,7 @@ function utils_useSignalEffect(callback) { * accessible whenever the function runs. This is primarily to make the scope * available inside hook callbacks. * - * Asyncronous functions should use generators that yield promises instead of awaiting them. + * Asynchronous functions should use generators that yield promises instead of awaiting them. * See the documentation for details: https://developer.wordpress.org/block-editor/reference-guides/packages/packages-interactivity/packages-interactivity-api-reference/#the-store * * @param func The passed function. @@ -397,7 +396,7 @@ function useWatch(callback) { /** * Accepts a function that contains imperative code which runs only after the - * element's first render, mainly useful for intialization logic. + * element's first render, mainly useful for initialization logic. * * This hook makes the element's scope available so functions like * `getElement()` and `getContext()` can be used inside the passed callback. @@ -771,6 +770,7 @@ class PropSignal { } ;// ./node_modules/@wordpress/interactivity/build-module/proxies/state.js +/* wp:polyfill */ /** * External dependencies */ @@ -796,7 +796,7 @@ const wellKnownSymbols = new Set(Object.getOwnPropertyNames(Symbol).map(key => S const proxyToProps = new WeakMap(); /** - * Checks wether a {@link PropSignal | `PropSignal`} instance exists for the + * Checks whether a {@link PropSignal | `PropSignal`} instance exists for the * given property in the passed proxy. * * @param proxy Proxy of a state object or array. @@ -1016,6 +1016,8 @@ const peek = (obj, key) => { * by default). */ const deepMergeRecursive = (target, source, override = true) => { + // If target is not a plain object and the source is, we don't need to merge + // them because the source will be used as the new value of the target. if (!(isPlainObject(target) && isPlainObject(source))) { return; } @@ -1026,28 +1028,42 @@ const deepMergeRecursive = (target, source, override = true) => { const desc = Object.getOwnPropertyDescriptor(source, key); const proxy = getProxyFromObject(target); const propSignal = !!proxy && hasPropSignal(proxy, key) && getPropSignal(proxy, key); + + // Handle getters and setters if (typeof desc.get === 'function' || typeof desc.set === 'function') { if (override || isNew) { + // Because we are setting a getter or setter, we need to use + // Object.defineProperty to define the property on the target object. Object.defineProperty(target, key, { ...desc, configurable: true, enumerable: true }); + // Update the getter in the property signal if it exists if (desc.get && propSignal) { propSignal.setGetter(desc.get); } } + + // Handle nested objects } else if (isPlainObject(source[key])) { - if (isNew || override && !isPlainObject(target[key])) { + const targetValue = Object.getOwnPropertyDescriptor(target, key)?.value; + if (isNew || override && !isPlainObject(targetValue)) { + // Create a new object if the property is new or needs to be overridden target[key] = {}; if (propSignal) { + // Create a new proxified state for the nested object const ns = getNamespaceFromProxy(proxy); propSignal.setValue(proxifyState(ns, target[key])); } - } - if (isPlainObject(target[key])) { deepMergeRecursive(target[key], source[key], override); } + // Both target and source are plain objects, merge them recursively + else if (isPlainObject(targetValue)) { + deepMergeRecursive(target[key], source[key], override); + } + + // Handle primitive values and non-plain objects } else if (override || isNew) { Object.defineProperty(target, key, desc); if (propSignal) { @@ -1055,6 +1071,7 @@ const deepMergeRecursive = (target, source, override = true) => { value } = desc; const ns = getNamespaceFromProxy(proxy); + // Proxify the value if necessary before setting it in the signal propSignal.setValue(shouldProxy(value) ? proxifyState(ns, value) : value); } } @@ -1187,7 +1204,8 @@ const contextHandlers = { return true; }, ownKeys: target => [...new Set([...Object.keys(contextObjectToFallback.get(target)), ...Object.keys(target)])], - getOwnPropertyDescriptor: (target, key) => descriptor(target, key) || descriptor(contextObjectToFallback.get(target), key) + getOwnPropertyDescriptor: (target, key) => descriptor(target, key) || descriptor(contextObjectToFallback.get(target), key), + has: (target, key) => Reflect.has(target, key) || Reflect.has(contextObjectToFallback.get(target), key) }; /** @@ -1224,6 +1242,7 @@ const proxifyContext = (current, inherited = {}) => { ;// ./node_modules/@wordpress/interactivity/build-module/store.js +/* wp:polyfill */ /** * Internal dependencies */ @@ -1252,7 +1271,7 @@ const getConfig = namespace => storeConfigs.get(namespace || getNamespace()) || * * The object returned is read-only, and includes the state defined in PHP with * `wp_interactivity_state()`. When using `actions.navigate()`, this object is - * updated to reflect the changes in its properites, without affecting the state + * updated to reflect the changes in its properties, without affecting the state * returned by `store()`. Directives can subscribe to those changes to update * the state if needed. * @@ -1329,6 +1348,14 @@ const universalUnlock = 'I acknowledge that using a private store means my plugi * @return A reference to the namespace content. */ +// Overload for when the types are inferred. + +// Overload for when types are passed via generics and they contain state. + +// Overload for when types are passed via generics and they don't contain state. + +// Overload for when types are divided into multiple parts. + function store(namespace, { state = {}, ...block @@ -1407,6 +1434,7 @@ const data = parseServerData(); populateServerData(data); ;// ./node_modules/@wordpress/interactivity/build-module/hooks.js +/* wp:polyfill */ // eslint-disable-next-line eslint-comments/disable-enable-pair /* eslint-disable react-hooks/exhaustive-deps */ @@ -1524,7 +1552,7 @@ const resolve = (path, namespace) => { } let resolvedStore = stores.get(namespace); if (typeof resolvedStore === 'undefined') { - resolvedStore = store(namespace, undefined, { + resolvedStore = store(namespace, {}, { lock: universalUnlock }); } @@ -1662,6 +1690,7 @@ preact_module/* options */.fF.vnode = vnode => { }; ;// ./node_modules/@wordpress/interactivity/build-module/directives.js +/* wp:polyfill */ // eslint-disable-next-line eslint-comments/disable-enable-pair /* eslint-disable react-hooks/exhaustive-deps */ @@ -2145,9 +2174,13 @@ const getGlobalAsyncEventDirective = type => { const { namespace } = entry; - const list = evaluate(entry); + const iterable = evaluate(entry); + if (typeof iterable?.[Symbol.iterator] !== 'function') { + return; + } const itemProp = isNonDefaultDirectiveSuffix(entry) ? kebabToCamelCase(entry.suffix) : 'item'; - return list.map(item => { + const result = []; + for (const item of iterable) { const itemContext = proxifyContext(proxifyState(namespace, {}), inheritedValue.client[namespace]); const mergedContext = { client: { @@ -2169,11 +2202,12 @@ const getGlobalAsyncEventDirective = type => { const key = eachKey ? getEvaluate({ scope })(eachKey[0]) : item; - return (0,preact_module.h)(Provider, { + result.push((0,preact_module.h)(Provider, { value: mergedContext, key - }, element.props.content); - }); + }, element.props.content)); + } + return result; }, { priority: 20 }); @@ -2186,6 +2220,7 @@ const getGlobalAsyncEventDirective = type => { const directivePrefix = 'wp'; ;// ./node_modules/@wordpress/interactivity/build-module/vdom.js +/* wp:polyfill */ /** * External dependencies */ @@ -2212,7 +2247,7 @@ const directiveParser = new RegExp(`^data-${directivePrefix}-` + // segments. It excludes underscore intentionally to prevent confusion. // E.g., "custom-directive". '([a-z0-9]+(?:-[a-z0-9]+)*)' + -// (Optional) Match '--' followed by any alphanumeric charachters. It +// (Optional) Match '--' followed by any alphanumeric characters. It // excludes underscore intentionally to prevent confusion, but it can // contain multiple hyphens. E.g., "--custom-prefix--with-more-info". '(?:--([a-z0-9_-]+))?$', 'i' // Case insensitive. @@ -2328,8 +2363,6 @@ function toVdom(root) { return obj; }, {}); } - - // @ts-expect-error Fixed in upcoming preact release https://github.com/preactjs/preact/pull/4334 if (localName === 'template') { props.content = [...elementNode.content.childNodes].map(childNode => toVdom(childNode)); } else { @@ -2385,6 +2418,17 @@ const initialVdom = new WeakMap(); // Initialize the router with the initial DOM. const init = async () => { const nodes = document.querySelectorAll(`[data-${directivePrefix}-interactive]`); + + /* + * This `await` with setTimeout is required to apparently ensure that the interactive blocks have their stores + * fully initialized prior to hydrating the blocks. If this is not present, then an error occurs, for example: + * > view.js:46 Uncaught (in promise) ReferenceError: Cannot access 'state' before initialization + * This occurs when splitTask() is implemented with scheduler.yield() as opposed to setTimeout(), as with the former + * split tasks are added to the front of the task queue whereas with the latter they are added to the end of the queue. + */ + await new Promise(resolve => { + setTimeout(resolve, 0); + }); for (const node of nodes) { if (!hydratedIslands.has(node)) { await splitTask(); diff --git a/wp-includes/js/dist/script-modules/interactivity/index.min.js b/wp-includes/js/dist/script-modules/interactivity/index.min.js index a22f0948c6..89db2fce95 100644 --- a/wp-includes/js/dist/script-modules/interactivity/index.min.js +++ b/wp-includes/js/dist/script-modules/interactivity/index.min.js @@ -1 +1 @@ -var e={622:(e,t,n)=>{n.d(t,{Ob:()=>B,Qv:()=>V,XX:()=>I,fF:()=>o,h:()=>b,q6:()=>z,uA:()=>k,zO:()=>s});var r,o,i,s,u,_,c,l,a,f,p,h,v={},d=[],y=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,g=Array.isArray;function m(e,t){for(var n in t)e[n]=t[n];return e}function w(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function b(e,t,n){var o,i,s,u={};for(s in t)"key"==s?o=t[s]:"ref"==s?i=t[s]:u[s]=t[s];if(arguments.length>2&&(u.children=arguments.length>3?r.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(s in e.defaultProps)void 0===u[s]&&(u[s]=e.defaultProps[s]);return x(e,u,o,i,null)}function x(e,t,n,r,s){var u={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==s?++i:s,__i:-1,__u:0};return null==s&&null!=o.vnode&&o.vnode(u),u}function S(e){return e.children}function k(e,t){this.props=e,this.context=t}function E(e,t){if(null==t)return e.__?E(e.__,e.__i+1):null;for(var n;tt&&u.sort(l));O.__r=0}function T(e,t,n,r,o,i,s,u,_,c,l){var a,f,p,h,y,g=r&&r.__k||d,m=t.length;for(n.__d=_,$(n,t,g),_=n.__d,a=0;a0?x(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=e,o.__b=e.__b+1,i=null,-1!==(u=o.__i=N(o,n,s,l))&&(l--,(i=n[u])&&(i.__u|=131072)),null==i||null===i.__v?(-1==u&&a--,"function"!=typeof o.type&&(o.__u|=65536)):u!==s&&(u==s-1?a--:u==s+1?a++:(u>s?a--:a++,o.__u|=65536))):o=e.__k[r]=null;if(l)for(r=0;r(null==_||131072&_.__u?0:1))for(;s>=0||u=0){if((_=t[s])&&!(131072&_.__u)&&o==_.key&&i===_.type)return s;s--}if(u2&&(_.children=arguments.length>3?r.call(arguments,2):n),x(e.type,_,o||e.key,i||e.ref,null)}function z(e,t){var n={__c:t="__cC"+h++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,r;return this.getChildContext||(n=new Set,(r={})[t]=this,this.getChildContext=function(){return r},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.forEach((function(e){e.__e=!0,C(e)}))},this.sub=function(e){n.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n&&n.delete(e),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}r=d.slice,o={__e:function(e,t,n,r){for(var o,i,s;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&null!=i.getDerivedStateFromError&&(o.setState(i.getDerivedStateFromError(e)),s=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(e,r||{}),s=o.__d),s)return o.__E=o}catch(t){e=t}throw e}},i=0,s=function(e){return null!=e&&null==e.constructor},k.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=m({},this.state),"function"==typeof e&&(e=e(m({},n),this.props)),e&&m(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),C(this))},k.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),C(this))},k.prototype.render=S,u=[],c="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,l=function(e,t){return e.__v.__b-t.__v.__b},O.__r=0,a=0,f=U(!1),p=U(!0),h=0}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var r={};n.d(r,{zj:()=>pt,SD:()=>ye,V6:()=>ge,$K:()=>me,vT:()=>ht,jb:()=>Jt,yT:()=>be,M_:()=>dt,hb:()=>Oe,vJ:()=>Pe,ip:()=>Ee,Nf:()=>Ce,Kr:()=>Te,li:()=>x,J0:()=>m,FH:()=>ke,v4:()=>Se});var o,i,s,u,_=n(622),c=0,l=[],a=_.fF,f=a.__b,p=a.__r,h=a.diffed,v=a.__c,d=a.unmount,y=a.__;function g(e,t){a.__h&&a.__h(i,e,c||t),c=0;var n=i.__H||(i.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function m(e){return c=1,function(e,t,n){var r=g(o++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):N(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=i,!i.u)){var s=function(e,t,n){if(!r.__c.__H)return!0;var o=r.__c.__H.__.filter((function(e){return!!e.__c}));if(o.every((function(e){return!e.__N})))return!u||u.call(this,e,t,n);var i=!1;return o.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(i=!0)}})),!(!i&&r.__c.props===e)&&(!u||u.call(this,e,t,n))};i.u=!0;var u=i.shouldComponentUpdate,_=i.componentWillUpdate;i.componentWillUpdate=function(e,t,n){if(this.__e){var r=u;u=void 0,s(e,t,n),u=r}_&&_.call(this,e,t,n)},i.shouldComponentUpdate=s}return r.__N||r.__}(N,e)}function w(e,t){var n=g(o++,3);!a.__s&&M(n.__H,t)&&(n.__=e,n.i=t,i.__H.__h.push(n))}function b(e,t){var n=g(o++,4);!a.__s&&M(n.__H,t)&&(n.__=e,n.i=t,i.__h.push(n))}function x(e){return c=5,S((function(){return{current:e}}),[])}function S(e,t){var n=g(o++,7);return M(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function k(e,t){return c=8,S((function(){return e}),t)}function E(e){var t=i.context[e.__c],n=g(o++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(i)),t.props.value):e.__}function P(){for(var e;e=l.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(T),e.__H.__h.forEach($),e.__H.__h=[]}catch(t){e.__H.__h=[],a.__e(t,e.__v)}}a.__b=function(e){i=null,f&&f(e)},a.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),y&&y(e,t)},a.__r=function(e){p&&p(e),o=0;var t=(i=e.__c).__H;t&&(s===i?(t.__h=[],i.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.i=e.__N=void 0}))):(t.__h.forEach(T),t.__h.forEach($),t.__h=[],o=0)),s=i},a.diffed=function(e){h&&h(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==l.push(t)&&u===a.requestAnimationFrame||((u=a.requestAnimationFrame)||O)(P)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.i=void 0}))),s=i=null},a.__c=function(e,t){t.some((function(e){try{e.__h.forEach(T),e.__h=e.__h.filter((function(e){return!e.__||$(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],a.__e(n,e.__v)}})),v&&v(e,t)},a.unmount=function(e){d&&d(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{T(e)}catch(e){t=e}})),n.__H=void 0,t&&a.__e(t,n.__v))};var C="function"==typeof requestAnimationFrame;function O(e){var t,n=function(){clearTimeout(r),C&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);C&&(t=requestAnimationFrame(n))}function T(e){var t=i,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),i=t}function $(e){var t=i;e.__c=e.__(),i=t}function M(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function N(e,t){return"function"==typeof t?t(e):t}var j=Symbol.for("preact-signals");function H(){if(L>1)L--;else{for(var e,t=!1;void 0!==A;){var n=A;for(A=void 0,D++;void 0!==n;){var r=n.o;if(n.o=void 0,n.f&=-3,!(8&n.f)&&z(n))try{n.c()}catch(n){t||(e=n,t=!0)}n=r}}if(D=0,L--,t)throw e}}function U(e){if(L>0)return e();L++;try{return e()}finally{H()}}var W=void 0;var F,A=void 0,L=0,D=0,R=0;function I(e){if(void 0!==W){var t=e.n;if(void 0===t||t.t!==W)return t={i:0,S:e,p:W.s,n:void 0,t:W,e:void 0,x:void 0,r:t},void 0!==W.s&&(W.s.n=t),W.s=t,e.n=t,32&W.f&&e.S(t),t;if(-1===t.i)return t.i=0,void 0!==t.n&&(t.n.p=t.p,void 0!==t.p&&(t.p.n=t.n),t.p=W.s,t.n=void 0,W.s.n=t,W.s=t),t}}function V(e){this.v=e,this.i=0,this.n=void 0,this.t=void 0}function B(e){return new V(e)}function z(e){for(var t=e.s;void 0!==t;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function q(e){for(var t=e.s;void 0!==t;t=t.n){var n=t.S.n;if(void 0!==n&&(t.r=n),t.S.n=t,t.i=-1,void 0===t.n){e.s=t;break}}}function J(e){for(var t=e.s,n=void 0;void 0!==t;){var r=t.p;-1===t.i?(t.S.U(t),void 0!==r&&(r.n=t.n),void 0!==t.n&&(t.n.p=r)):n=t,t.S.n=t.r,void 0!==t.r&&(t.r=void 0),t=r}e.s=n}function K(e){V.call(this,void 0),this.x=e,this.s=void 0,this.g=R-1,this.f=4}function G(e){return new K(e)}function X(e){var t=e.u;if(e.u=void 0,"function"==typeof t){L++;var n=W;W=void 0;try{t()}catch(t){throw e.f&=-2,e.f|=8,Q(e),t}finally{W=n,H()}}}function Q(e){for(var t=e.s;void 0!==t;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,X(e)}function Y(e){if(W!==this)throw new Error("Out-of-order effect");J(this),W=e,this.f&=-2,8&this.f&&Q(this),H()}function Z(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}function ee(e){var t=new Z(e);try{t.c()}catch(e){throw t.d(),e}return t.d.bind(t)}function te(e,t){_.fF[e]=t.bind(null,_.fF[e]||function(){})}function ne(e){F&&F(),F=e&&e.S()}function re(e){var t=this,n=e.data,r=function(e){return S((function(){return B(e)}),[])}(n);r.value=n;var o=S((function(){for(var e=t.__v;e=e.__;)if(e.__c){e.__c.__$f|=4;break}return t.__$u.c=function(){var e;(0,_.zO)(o.peek())||3!==(null==(e=t.base)?void 0:e.nodeType)?(t.__$f|=1,t.setState({})):t.base.data=o.peek()},G((function(){var e=r.value.value;return 0===e?0:!0===e?"":e||""}))}),[]);return o.value}function oe(e,t,n,r){var o=t in e&&void 0===e.ownerSVGElement,i=B(n);return{o:function(e,t){i.value=e,r=t},d:ee((function(){var n=i.value.value;r[t]!==n&&(r[t]=n,o?e[t]=n:n?e.setAttribute(t,n):e.removeAttribute(t))}))}}V.prototype.brand=j,V.prototype.h=function(){return!0},V.prototype.S=function(e){this.t!==e&&void 0===e.e&&(e.x=this.t,void 0!==this.t&&(this.t.e=e),this.t=e)},V.prototype.U=function(e){if(void 0!==this.t){var t=e.e,n=e.x;void 0!==t&&(t.x=n,e.e=void 0),void 0!==n&&(n.e=t,e.x=void 0),e===this.t&&(this.t=n)}},V.prototype.subscribe=function(e){var t=this;return ee((function(){var n=t.value,r=W;W=void 0;try{e(n)}finally{W=r}}))},V.prototype.valueOf=function(){return this.value},V.prototype.toString=function(){return this.value+""},V.prototype.toJSON=function(){return this.value},V.prototype.peek=function(){var e=W;W=void 0;try{return this.value}finally{W=e}},Object.defineProperty(V.prototype,"value",{get:function(){var e=I(this);return void 0!==e&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(D>100)throw new Error("Cycle detected");this.v=e,this.i++,R++,L++;try{for(var t=this.t;void 0!==t;t=t.x)t.t.N()}finally{H()}}}}),(K.prototype=new V).h=function(){if(this.f&=-3,1&this.f)return!1;if(32==(36&this.f))return!0;if(this.f&=-5,this.g===R)return!0;if(this.g=R,this.f|=1,this.i>0&&!z(this))return this.f&=-2,!0;var e=W;try{q(this),W=this;var t=this.x();(16&this.f||this.v!==t||0===this.i)&&(this.v=t,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return W=e,J(this),this.f&=-2,!0},K.prototype.S=function(e){if(void 0===this.t){this.f|=36;for(var t=this.s;void 0!==t;t=t.n)t.S.S(t)}V.prototype.S.call(this,e)},K.prototype.U=function(e){if(void 0!==this.t&&(V.prototype.U.call(this,e),void 0===this.t)){this.f&=-33;for(var t=this.s;void 0!==t;t=t.n)t.S.U(t)}},K.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;void 0!==e;e=e.x)e.t.N()}},Object.defineProperty(K.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=I(this);if(this.h(),void 0!==e&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),Z.prototype.c=function(){var e=this.S();try{if(8&this.f)return;if(void 0===this.x)return;var t=this.x();"function"==typeof t&&(this.u=t)}finally{e()}},Z.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,X(this),q(this),L++;var e=W;return W=this,Y.bind(this,e)},Z.prototype.N=function(){2&this.f||(this.f|=2,this.o=A,A=this)},Z.prototype.d=function(){this.f|=8,1&this.f||Q(this)},re.displayName="_st",Object.defineProperties(V.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:re},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}}),te("__b",(function(e,t){if("string"==typeof t.type){var n,r=t.props;for(var o in r)if("children"!==o){var i=r[o];i instanceof V&&(n||(t.__np=n={}),n[o]=i,r[o]=i.peek())}}e(t)})),te("__r",(function(e,t){ne();var n,r=t.__c;r&&(r.__$f&=-2,void 0===(n=r.__$u)&&(r.__$u=n=function(){var e;return ee((function(){e=this})),e.c=function(){r.__$f|=1,r.setState({})},e}())),ne(n),e(t)})),te("__e",(function(e,t,n,r){ne(),e(t,n,r)})),te("diffed",(function(e,t){var n;if(ne(),"string"==typeof t.type&&(n=t.__e)){var r=t.__np,o=t.props;if(r){var i=n.U;if(i)for(var s in i){var u=i[s];void 0===u||s in r||(u.d(),i[s]=void 0)}else n.U=i={};for(var _ in r){var c=i[_],l=r[_];void 0===c?(c=oe(n,_,l,o),i[_]=c):c.o(l,o)}}}e(t)})),te("unmount",(function(e,t){if("string"==typeof t.type){var n=t.__e;if(n){var r=n.U;if(r)for(var o in n.U=void 0,r){var i=r[o];i&&i.d()}}}else{var s=t.__c;if(s){var u=s.__$u;u&&(s.__$u=void 0,u.d())}}e(t)})),te("__h",(function(e,t,n,r){(r<3||9===r)&&(t.__$f|=2),e(t,n,r)})),_.uA.prototype.shouldComponentUpdate=function(e,t){var n=this.__$u;if(!(n&&void 0!==n.s||4&this.__$f))return!0;if(3&this.__$f)return!0;for(var r in t)return!0;for(var o in e)if("__source"!==o&&e[o]!==this.props[o])return!0;for(var i in this.props)if(!(i in e))return!0;return!1};const ie=[],se=()=>ie.slice(-1)[0],ue=e=>{ie.push(e)},_e=()=>{ie.pop()},ce=[],le=()=>ce.slice(-1)[0],ae=e=>{ce.push(e)},fe=()=>{ce.pop()},pe=new WeakMap,he=()=>{throw new Error("Please use `data-wp-bind` to modify the attributes of an element.")},ve={get(e,t,n){const r=Reflect.get(e,t,n);return r&&"object"==typeof r?de(r):r},set:he,deleteProperty:he},de=e=>(pe.has(e)||pe.set(e,new Proxy(e,ve)),pe.get(e)),ye=e=>le().context[e||se()],ge=()=>{const e=le();const{ref:t,attributes:n}=e;return Object.freeze({ref:t.current,attributes:de(n)})},me=e=>le().serverContext[e||se()],we=e=>new Promise((t=>{const n=()=>{clearTimeout(r),window.cancelAnimationFrame(o),setTimeout((()=>{e(),t()}))},r=setTimeout(n,100),o=window.requestAnimationFrame(n)})),be=()=>new Promise((e=>{setTimeout(e,0)}));function xe(e){w((()=>{let t=null,n=!1;return t=function(e,t){let n=()=>{};const r=ee((function(){return n=this.c.bind(this),this.x=e,this.c=t,e()}));return{flush:n,dispose:r}}(e,(async()=>{t&&!n&&(n=!0,await we(t.flush),n=!1)})),t.dispose}),[])}function Se(e){const t=le(),n=se();return"GeneratorFunction"===e?.constructor?.name?async(...r)=>{const o=e(...r);let i,s;for(;;){ue(n),ae(t);try{s=o.next(i)}finally{fe(),_e()}try{i=await s.value}catch(e){ue(n),ae(t),o.throw(e)}finally{fe(),_e()}if(s.done)break}return i}:(...r)=>{ue(n),ae(t);try{return e(...r)}finally{_e(),fe()}}}function ke(e){xe(Se(e))}function Ee(e){w(Se(e),[])}function Pe(e,t){w(Se(e),t)}function Ce(e,t){b(Se(e),t)}function Oe(e,t){return k(Se(e),t)}function Te(e,t){return S(Se(e),t)}new Set;const $e=e=>{0},Me=e=>Boolean(e&&"object"==typeof e&&e.constructor===Object),Ne=new WeakMap,je=new WeakMap,He=new WeakMap,Ue=new Set([Object,Array]),We=(e,t,n)=>{if(!Le(t))throw Error("This object cannot be proxified.");if(!Ne.has(t)){const r=new Proxy(t,n);Ne.set(t,r),je.set(r,t),He.set(r,e)}return Ne.get(t)},Fe=e=>Ne.get(e),Ae=e=>He.get(e),Le=e=>"object"==typeof e&&null!==e&&(!He.has(e)&&Ue.has(e.constructor)),De={};class Re{constructor(e){this.owner=e,this.computedsByScope=new WeakMap}setValue(e){this.update({value:e})}setGetter(e){this.update({get:e})}getComputed(){const e=le()||De;if(this.valueSignal||this.getterSignal||this.update({}),!this.computedsByScope.has(e)){const t=()=>{const e=this.getterSignal?.value;return e?e.call(this.owner):this.valueSignal?.value};ue(Ae(this.owner)),this.computedsByScope.set(e,G(Se(t))),_e()}return this.computedsByScope.get(e)}update({get:e,value:t}){this.valueSignal?t===this.valueSignal.peek()&&e===this.getterSignal.peek()||U((()=>{this.valueSignal.value=t,this.getterSignal.value=e})):(this.valueSignal=B(t),this.getterSignal=B(e))}}const Ie=new Set(Object.getOwnPropertyNames(Symbol).map((e=>Symbol[e])).filter((e=>"symbol"==typeof e))),Ve=new WeakMap,Be=(e,t)=>Ve.has(e)&&Ve.get(e).has(t),ze=new WeakSet,qe=(e,t,n)=>{Ve.has(e)||Ve.set(e,new Map),t="number"==typeof t?`${t}`:t;const r=Ve.get(e);if(!r.has(t)){const o=Ae(e),i=new Re(e);if(r.set(t,i),n){const{get:t,value:r}=n;if(t)i.setGetter(t);else{const t=ze.has(e);i.setValue(Le(r)?Xe(o,r,{readOnly:t}):r)}}}return r.get(t)},Je=new WeakMap;let Ke=!1;const Ge={get(e,t,n){if(Ke||!e.hasOwnProperty(t)&&t in e||"symbol"==typeof t&&Ie.has(t))return Reflect.get(e,t,n);const r=Object.getOwnPropertyDescriptor(e,t),o=qe(n,t,r).getComputed().value;if("function"==typeof o){const e=Ae(n);return(...t)=>{ue(e);try{return o.call(n,...t)}finally{_e()}}}return o},set(e,t,n,r){if(ze.has(r))return!1;ue(Ae(r));try{return Reflect.set(e,t,n,r)}finally{_e()}},defineProperty(e,t,n){if(ze.has(Fe(e)))return!1;const r=!(t in e),o=Reflect.defineProperty(e,t,n);if(o){const o=Fe(e),i=qe(o,t),{get:s,value:u}=n;if(s)i.setGetter(s);else{const e=Ae(o);i.setValue(Le(u)?Xe(e,u):u)}if(r&&Je.has(e)&&Je.get(e).value++,Array.isArray(e)&&Ve.get(o)?.has("length")){qe(o,"length").setValue(e.length)}}return o},deleteProperty(e,t){if(ze.has(Fe(e)))return!1;const n=Reflect.deleteProperty(e,t);if(n){qe(Fe(e),t).setValue(void 0),Je.has(e)&&Je.get(e).value++}return n},ownKeys:e=>(Je.has(e)||Je.set(e,B(0)),Je._=Je.get(e).value,Reflect.ownKeys(e))},Xe=(e,t,n)=>{const r=We(e,t,Ge);return n?.readOnly&&ze.add(r),r},Qe=(e,t,n=!0)=>{if(!Me(e)||!Me(t))return;let r=!1;for(const o in t){const i=!(o in e);r=r||i;const s=Object.getOwnPropertyDescriptor(t,o),u=Fe(e),_=!!u&&Be(u,o)&&qe(u,o);if("function"==typeof s.get||"function"==typeof s.set)(n||i)&&(Object.defineProperty(e,o,{...s,configurable:!0,enumerable:!0}),s.get&&_&&_.setGetter(s.get));else if(Me(t[o])){if((i||n&&!Me(e[o]))&&(e[o]={},_)){const t=Ae(u);_.setValue(Xe(t,e[o]))}Me(e[o])&&Qe(e[o],t[o],n)}else if((n||i)&&(Object.defineProperty(e,o,s),_)){const{value:e}=s,t=Ae(u);_.setValue(Le(e)?Xe(t,e):e)}}r&&Je.has(e)&&Je.get(e).value++},Ye=(e,t,n=!0)=>U((()=>{return Qe((r=e,je.get(r)||e),t,n);var r})),Ze=new WeakSet,et={get:(e,t,n)=>{const r=Reflect.get(e,t),o=Ae(n);if(void 0===r&&Ze.has(n)){const n={};return Reflect.set(e,t,n),tt(o,n,!1)}if("function"==typeof r){ue(o);const e=Se(r);return _e(),e}return Me(r)&&Le(r)?tt(o,r,!1):r}},tt=(e,t,n=!0)=>{const r=We(e,t,et);return r&&n&&Ze.add(r),r},nt=new WeakMap,rt=new WeakMap,ot=new WeakSet,it=Reflect.getOwnPropertyDescriptor,st={get:(e,t)=>{const n=rt.get(e),r=e[t];return t in e?r:n[t]},set:(e,t,n)=>{const r=rt.get(e);return(t in e||!(t in r)?e:r)[t]=n,!0},ownKeys:e=>[...new Set([...Object.keys(rt.get(e)),...Object.keys(e)])],getOwnPropertyDescriptor:(e,t)=>it(e,t)||it(rt.get(e),t)},ut=(e,t={})=>{if(ot.has(e))throw Error("This object cannot be proxified.");if(rt.set(e,t),!nt.has(e)){const t=new Proxy(e,st);nt.set(e,t),ot.add(t)}return nt.get(e)},_t=new Map,ct=new Map,lt=new Map,at=new Map,ft=new Map,pt=e=>at.get(e||se())||{},ht=e=>{const t=e||se();return ft.has(t)||ft.set(t,Xe(t,{},{readOnly:!0})),ft.get(t)},vt="I acknowledge that using a private store means my plugin will inevitably break on the next store release.";function dt(e,{state:t={},...n}={},{lock:r=!1}={}){if(_t.has(e)){if(r===vt||lt.has(e)){const t=lt.get(e);if(!(r===vt||!0!==r&&r===t))throw t?Error("Cannot unlock a private store with an invalid lock code"):Error("Cannot lock a public store")}else lt.set(e,r);const o=ct.get(e);Ye(o,n),Ye(o.state,t)}else{r!==vt&<.set(e,r);const o={state:Xe(e,Me(t)?t:{}),...n},i=tt(e,o);ct.set(e,o),_t.set(e,i)}return _t.get(e)}const yt=(e=document)=>{var t;const n=null!==(t=e.getElementById("wp-script-module-data-@wordpress/interactivity"))&&void 0!==t?t:e.getElementById("wp-interactivity-data");if(n?.textContent)try{return JSON.parse(n.textContent)}catch{}return{}},gt=e=>{Me(e?.state)&&Object.entries(e.state).forEach((([e,t])=>{const n=dt(e,{},{lock:vt});Ye(n.state,t,!1),Ye(ht(e),t)})),Me(e?.config)&&Object.entries(e.config).forEach((([e,t])=>{at.set(e,t)}))},mt=yt();function wt(e){return null!==e.suffix}function bt(e){return null===e.suffix}gt(mt);const xt=(0,_.q6)({client:{},server:{}}),St={},kt={},Et=(e,t,{priority:n=10}={})=>{St[e]=t,kt[e]=n},Pt=({scope:e})=>(t,...n)=>{let{value:r,namespace:o}=t;if("string"!=typeof r)throw new Error("The `value` prop should be a string path");const i="!"===r[0]&&!!(r=r.slice(1));ae(e);const s=((e,t)=>{if(!t)return void $e();let n=_t.get(t);void 0===n&&(n=dt(t,void 0,{lock:vt}));const r={...n,context:le().context[t]};try{return e.split(".").reduce(((e,t)=>e[t]),r)}catch(e){}})(r,o),u="function"==typeof s?s(...n):s;return fe(),i?!u:u},Ct=({directives:e,priorityLevels:[t,...n],element:r,originalProps:o,previousScope:i})=>{const s=x({}).current;s.evaluate=k(Pt({scope:s}),[]);const{client:u,server:c}=E(xt);s.context=u,s.serverContext=c,s.ref=i?.ref||x(null),r=(0,_.Ob)(r,{ref:s.ref}),s.attributes=r.props;const l=n.length>0?(0,_.h)(Ct,{directives:e,priorityLevels:n,element:r,originalProps:o,previousScope:s}):r,a={...o,children:l},f={directives:e,props:a,element:r,context:xt,evaluate:s.evaluate};ae(s);for(const e of t){const t=St[e]?.(f);void 0!==t&&(a.children=t)}return fe(),a.children},Ot=_.fF.vnode;function Tt(e){return Me(e)?Object.fromEntries(Object.entries(e).map((([e,t])=>[e,Tt(t)]))):Array.isArray(e)?e.map((e=>Tt(e))):e}_.fF.vnode=e=>{if(e.props.__directives){const t=e.props,n=t.__directives;n.key&&(e.key=n.key.find(bt).value),delete t.__directives;const r=(e=>{const t=Object.keys(e).reduce(((e,t)=>{if(St[t]){const n=kt[t];(e[n]=e[n]||[]).push(t)}return e}),{});return Object.entries(t).sort((([e],[t])=>parseInt(e)-parseInt(t))).map((([,e])=>e))})(n);r.length>0&&(e.props={directives:n,priorityLevels:r,originalProps:t,type:e.type,element:(0,_.h)(e.type,t),top:!0},e.type=Ct)}Ot&&Ot(e)};const $t=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,Mt=/\/\*[^]*?\*\/| +/g,Nt=/\n+/g,jt=e=>({directives:t,evaluate:n})=>{t[`on-${e}`].filter(wt).forEach((t=>{const r=t.suffix.split("--",1)[0];Ee((()=>{const o=e=>n(t,e),i="window"===e?window:document;return i.addEventListener(r,o),()=>i.removeEventListener(r,o)}))}))},Ht=e=>({directives:t,evaluate:n})=>{t[`on-async-${e}`].filter(wt).forEach((t=>{const r=t.suffix.split("--",1)[0];Ee((()=>{const o=async e=>{await be(),n(t,e)},i="window"===e?window:document;return i.addEventListener(r,o,{passive:!0}),()=>i.removeEventListener(r,o)}))}))},Ut="wp",Wt=`data-${Ut}-ignore`,Ft=`data-${Ut}-interactive`,At=`data-${Ut}-`,Lt=[],Dt=new RegExp(`^data-${Ut}-([a-z0-9]+(?:-[a-z0-9]+)*)(?:--([a-z0-9_-]+))?$`,"i"),Rt=/^([\w_\/-]+)::(.+)$/,It=new WeakSet;function Vt(e){const t=document.createTreeWalker(e,205);return function e(n){const{nodeType:r}=n;if(3===r)return[n.data];if(4===r){var o;const e=t.nextSibling();return n.replaceWith(new window.Text(null!==(o=n.nodeValue)&&void 0!==o?o:"")),[n.nodeValue,e]}if(8===r||7===r){const e=t.nextSibling();return n.remove(),[null,e]}const i=n,{attributes:s}=i,u=i.localName,c={},l=[],a=[];let f=!1,p=!1;for(let e=0;e{const o=Dt.exec(t);if(null===o)return $e(),e;const i=o[1]||"",s=o[2]||null;var u;return e[i]=e[i]||[],e[i].push({namespace:null!=n?n:null!==(u=Lt[Lt.length-1])&&void 0!==u?u:null,value:r,suffix:s}),e}),{})),"template"===u)c.content=[...i.content.childNodes].map((e=>Vt(e)));else{let n=t.firstChild();if(n){for(;n;){const[r,o]=e(n);r&&l.push(r),n=o||t.nextSibling()}t.parentNode()}}return p&&Lt.pop(),[(0,_.h)(u,c,l)]}(t.currentNode)}const Bt=new WeakMap,zt=e=>{if(!e.parentElement)throw Error("The passed region should be an element with a parent.");return Bt.has(e)||Bt.set(e,((e,t)=>{const n=(t=[].concat(t))[t.length-1].nextSibling;function r(t,r){e.insertBefore(t,r||n)}return e.__k={nodeType:1,parentNode:e,firstChild:t[0],childNodes:t,insertBefore:r,appendChild:r,removeChild(t){e.removeChild(t)}}})(e.parentElement,e)),Bt.get(e)},qt=new WeakMap,Jt=e=>{if("I acknowledge that using private APIs means my theme or plugin will inevitably break in the next version of WordPress."===e)return{directivePrefix:Ut,getRegionRootFragment:zt,initialVdom:qt,toVdom:Vt,directive:Et,getNamespace:se,h:_.h,cloneElement:_.Ob,render:_.XX,proxifyState:Xe,parseServerData:yt,populateServerData:gt,batch:U};throw new Error("Forbidden access.")};Et("context",(({directives:{context:e},props:{children:t},context:n})=>{const{Provider:r}=n,o=e.find(bt),{client:i,server:s}=E(n),u=o.namespace,c=x(Xe(u,{})),l=x(Xe(u,{},{readOnly:!0})),a=S((()=>{const e={client:{...i},server:{...s}};if(o){const{namespace:t,value:n}=o;Me(n)||$e(),Ye(c.current,Tt(n),!1),Ye(l.current,Tt(n)),e.client[t]=ut(c.current,i[t]),e.server[t]=ut(l.current,s[t])}return e}),[o,i,s]);return(0,_.h)(r,{value:a},t)}),{priority:5}),Et("watch",(({directives:{watch:e},evaluate:t})=>{e.forEach((e=>{ke((()=>t(e)))}))})),Et("init",(({directives:{init:e},evaluate:t})=>{e.forEach((e=>{Ee((()=>t(e)))}))})),Et("on",(({directives:{on:e},element:t,evaluate:n})=>{const r=new Map;e.filter(wt).forEach((e=>{const t=e.suffix.split("--")[0];r.has(t)||r.set(t,new Set),r.get(t).add(e)})),r.forEach(((e,r)=>{const o=t.props[`on${r}`];t.props[`on${r}`]=t=>{e.forEach((e=>{o&&o(t),n(e,t)}))}}))})),Et("on-async",(({directives:{"on-async":e},element:t,evaluate:n})=>{const r=new Map;e.filter(wt).forEach((e=>{const t=e.suffix.split("--")[0];r.has(t)||r.set(t,new Set),r.get(t).add(e)})),r.forEach(((e,r)=>{const o=t.props[`on${r}`];t.props[`on${r}`]=t=>{o&&o(t),e.forEach((async e=>{await be(),n(e,t)}))}}))})),Et("on-window",jt("window")),Et("on-document",jt("document")),Et("on-async-window",Ht("window")),Et("on-async-document",Ht("document")),Et("class",(({directives:{class:e},element:t,evaluate:n})=>{e.filter(wt).forEach((e=>{const r=e.suffix,o=n(e),i=t.props.class||"",s=new RegExp(`(^|\\s)${r}(\\s|$)`,"g");o?s.test(i)||(t.props.class=i?`${i} ${r}`:r):t.props.class=i.replace(s," ").trim(),Ee((()=>{o?t.ref.current.classList.add(r):t.ref.current.classList.remove(r)}))}))})),Et("style",(({directives:{style:e},element:t,evaluate:n})=>{e.filter(wt).forEach((e=>{const r=e.suffix,o=n(e);t.props.style=t.props.style||{},"string"==typeof t.props.style&&(t.props.style=(e=>{const t=[{}];let n,r;for(;n=$t.exec(e.replace(Mt,""));)n[4]?t.shift():n[3]?(r=n[3].replace(Nt," ").trim(),t.unshift(t[0][r]=t[0][r]||{})):t[0][n[1]]=n[2].replace(Nt," ").trim();return t[0]})(t.props.style)),o?t.props.style[r]=o:delete t.props.style[r],Ee((()=>{o?t.ref.current.style[r]=o:t.ref.current.style.removeProperty(r)}))}))})),Et("bind",(({directives:{bind:e},element:t,evaluate:n})=>{e.filter(wt).forEach((e=>{const r=e.suffix,o=n(e);t.props[r]=o,Ee((()=>{const e=t.ref.current;if("style"!==r){if("width"!==r&&"height"!==r&&"href"!==r&&"list"!==r&&"form"!==r&&"tabIndex"!==r&&"download"!==r&&"rowSpan"!==r&&"colSpan"!==r&&"role"!==r&&r in e)try{return void(e[r]=null==o?"":o)}catch(e){}null==o||!1===o&&"-"!==r[4]?e.removeAttribute(r):e.setAttribute(r,o)}else"string"==typeof o&&(e.style.cssText=o)}))}))})),Et("ignore",(({element:{type:e,props:{innerHTML:t,...n}}})=>{const r=S((()=>t),[]);return(0,_.h)(e,{dangerouslySetInnerHTML:{__html:r},...n})})),Et("text",(({directives:{text:e},element:t,evaluate:n})=>{const r=e.find(bt);if(r)try{const e=n(r);t.props.children="object"==typeof e?null:e.toString()}catch(e){t.props.children=null}else t.props.children=null})),Et("run",(({directives:{run:e},evaluate:t})=>{e.forEach((e=>t(e)))})),Et("each",(({directives:{each:e,"each-key":t},context:n,element:r,evaluate:o})=>{if("template"!==r.type)return;const{Provider:i}=n,s=E(n),[u]=e,{namespace:c}=u,l=o(u),a=wt(u)?u.suffix.replace(/^-+|-+$/g,"").toLowerCase().replace(/-([a-z])/g,(function(e,t){return t.toUpperCase()})):"item";return l.map((e=>{const n=ut(Xe(c,{}),s.client[c]),o={client:{...s.client,[c]:n},server:{...s.server}};o.client[c][a]=e;const u={...le(),context:o.client,serverContext:o.server},l=t?Pt({scope:u})(t[0]):e;return(0,_.h)(i,{value:o,key:l},r.props.content)}))}),{priority:20}),Et("each-child",(()=>null),{priority:1}),(async()=>{const e=document.querySelectorAll(`[data-${Ut}-interactive]`);for(const t of e)if(!It.has(t)){await be();const e=zt(t),n=Vt(t);qt.set(t,n),await be(),(0,_.Qv)(n,e)}})();var Kt=r.zj,Gt=r.SD,Xt=r.V6,Qt=r.$K,Yt=r.vT,Zt=r.jb,en=r.yT,tn=r.M_,nn=r.hb,rn=r.vJ,on=r.ip,sn=r.Nf,un=r.Kr,_n=r.li,cn=r.J0,ln=r.FH,an=r.v4;export{Kt as getConfig,Gt as getContext,Xt as getElement,Qt as getServerContext,Yt as getServerState,Zt as privateApis,en as splitTask,tn as store,nn as useCallback,rn as useEffect,on as useInit,sn as useLayoutEffect,un as useMemo,_n as useRef,cn as useState,ln as useWatch,an as withScope}; \ No newline at end of file +var e={622:(e,t,n)=>{n.d(t,{Ob:()=>z,Qv:()=>B,XX:()=>V,fF:()=>o,h:()=>S,q6:()=>q,uA:()=>E,zO:()=>s});var r,o,i,s,u,c,l,_,a,f,p,h,v,d={},y=[],g=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,m=Array.isArray;function w(e,t){for(var n in t)e[n]=t[n];return e}function b(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function S(e,t,n){var o,i,s,u={};for(s in t)"key"==s?o=t[s]:"ref"==s?i=t[s]:u[s]=t[s];if(arguments.length>2&&(u.children=arguments.length>3?r.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(s in e.defaultProps)void 0===u[s]&&(u[s]=e.defaultProps[s]);return x(e,u,o,i,null)}function x(e,t,n,r,s){var u={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==s?++i:s,__i:-1,__u:0};return null==s&&null!=o.vnode&&o.vnode(u),u}function k(e){return e.children}function E(e,t){this.props=e,this.context=t}function P(e,t){if(null==t)return e.__?P(e.__,e.__i+1):null;for(var n;tt&&u.sort(_));$.__r=0}function T(e,t,n,r,o,i,s,u,c,l,_){var a,f,p,h,v,g,m=r&&r.__k||y,w=t.length;for(c=M(n,t,m,c,w),a=0;a0?x(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):s).__=e,s.__b=e.__b+1,u=null,-1!==(l=s.__i=j(s,n,c,a))&&(a--,(u=n[l])&&(u.__u|=2)),null==u||null===u.__v?(-1==l&&f--,"function"!=typeof s.type&&(s.__u|=4)):l!=c&&(l==c-1?f--:l==c+1?f++:(l>c?f--:f++,s.__u|=4))):e.__k[i]=null;if(a)for(i=0;i<_;i++)null!=(u=n[i])&&!(2&u.__u)&&(u.__e==r&&(r=P(u)),D(u,u));return r}function N(e,t,n){var r,o;if("function"==typeof e.type){for(r=e.__k,o=0;r&&o(null==c||2&c.__u?0:1))for(o=n-1,i=n+1;o>=0||i=0){if((c=t[o])&&!(2&c.__u)&&s==c.key&&u===c.type)return o;o--}if(i2&&(c.children=arguments.length>3?r.call(arguments,2):n),x(e.type,c,o||e.key,i||e.ref,null)}function q(e,t){var n={__c:t="__cC"+v++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,r;return this.getChildContext||(n=new Set,(r={})[t]=this,this.getChildContext=function(){return r},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.forEach((function(e){e.__e=!0,O(e)}))},this.sub=function(e){n.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n&&n.delete(e),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}r=y.slice,o={__e:function(e,t,n,r){for(var o,i,s;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&null!=i.getDerivedStateFromError&&(o.setState(i.getDerivedStateFromError(e)),s=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(e,r||{}),s=o.__d),s)return o.__E=o}catch(t){e=t}throw e}},i=0,s=function(e){return null!=e&&null==e.constructor},E.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=w({},this.state),"function"==typeof e&&(e=e(w({},n),this.props)),e&&w(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),O(this))},E.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),O(this))},E.prototype.render=k,u=[],l="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,_=function(e,t){return e.__v.__b-t.__v.__b},$.__r=0,a=/(PointerCapture)$|Capture$/i,f=0,p=W(!1),h=W(!0),v=0}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var r={};n.d(r,{zj:()=>pt,SD:()=>ye,V6:()=>ge,$K:()=>me,vT:()=>ht,jb:()=>Jt,yT:()=>be,M_:()=>dt,hb:()=>Oe,vJ:()=>Pe,ip:()=>Ee,Nf:()=>Ce,Kr:()=>$e,li:()=>S,J0:()=>m,FH:()=>ke,v4:()=>xe});var o,i,s,u,c=n(622),l=0,_=[],a=c.fF,f=a.__b,p=a.__r,h=a.diffed,v=a.__c,d=a.unmount,y=a.__;function g(e,t){a.__h&&a.__h(i,e,l||t),l=0;var n=i.__H||(i.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function m(e){return l=1,function(e,t,n){var r=g(o++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):N(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=i,!i.u)){var s=function(e,t,n){if(!r.__c.__H)return!0;var o=r.__c.__H.__.filter((function(e){return!!e.__c}));if(o.every((function(e){return!e.__N})))return!u||u.call(this,e,t,n);var i=r.__c.props!==e;return o.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(i=!0)}})),u&&u.call(this,e,t,n)||i};i.u=!0;var u=i.shouldComponentUpdate,c=i.componentWillUpdate;i.componentWillUpdate=function(e,t,n){if(this.__e){var r=u;u=void 0,s(e,t,n),u=r}c&&c.call(this,e,t,n)},i.shouldComponentUpdate=s}return r.__N||r.__}(N,e)}function w(e,t){var n=g(o++,3);!a.__s&&M(n.__H,t)&&(n.__=e,n.i=t,i.__H.__h.push(n))}function b(e,t){var n=g(o++,4);!a.__s&&M(n.__H,t)&&(n.__=e,n.i=t,i.__h.push(n))}function S(e){return l=5,x((function(){return{current:e}}),[])}function x(e,t){var n=g(o++,7);return M(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function k(e,t){return l=8,x((function(){return e}),t)}function E(e){var t=i.context[e.__c],n=g(o++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(i)),t.props.value):e.__}function P(){for(var e;e=_.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach($),e.__H.__h.forEach(T),e.__H.__h=[]}catch(t){e.__H.__h=[],a.__e(t,e.__v)}}a.__b=function(e){i=null,f&&f(e)},a.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),y&&y(e,t)},a.__r=function(e){p&&p(e),o=0;var t=(i=e.__c).__H;t&&(s===i?(t.__h=[],i.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.i=e.__N=void 0}))):(t.__h.forEach($),t.__h.forEach(T),t.__h=[],o=0)),s=i},a.diffed=function(e){h&&h(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==_.push(t)&&u===a.requestAnimationFrame||((u=a.requestAnimationFrame)||O)(P)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.i=void 0}))),s=i=null},a.__c=function(e,t){t.some((function(e){try{e.__h.forEach($),e.__h=e.__h.filter((function(e){return!e.__||T(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],a.__e(n,e.__v)}})),v&&v(e,t)},a.unmount=function(e){d&&d(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{$(e)}catch(e){t=e}})),n.__H=void 0,t&&a.__e(t,n.__v))};var C="function"==typeof requestAnimationFrame;function O(e){var t,n=function(){clearTimeout(r),C&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);C&&(t=requestAnimationFrame(n))}function $(e){var t=i,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),i=t}function T(e){var t=i;e.__c=e.__(),i=t}function M(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function N(e,t){return"function"==typeof t?t(e):t}var j=Symbol.for("preact-signals");function H(){if(L>1)L--;else{for(var e,t=!1;void 0!==A;){var n=A;for(A=void 0,R++;void 0!==n;){var r=n.o;if(n.o=void 0,n.f&=-3,!(8&n.f)&&z(n))try{n.c()}catch(n){t||(e=n,t=!0)}n=r}}if(R=0,L--,t)throw e}}function U(e){if(L>0)return e();L++;try{return e()}finally{H()}}var W=void 0;var F,A=void 0,L=0,R=0,D=0;function I(e){if(void 0!==W){var t=e.n;if(void 0===t||t.t!==W)return t={i:0,S:e,p:W.s,n:void 0,t:W,e:void 0,x:void 0,r:t},void 0!==W.s&&(W.s.n=t),W.s=t,e.n=t,32&W.f&&e.S(t),t;if(-1===t.i)return t.i=0,void 0!==t.n&&(t.n.p=t.p,void 0!==t.p&&(t.p.n=t.n),t.p=W.s,t.n=void 0,W.s.n=t,W.s=t),t}}function V(e){this.v=e,this.i=0,this.n=void 0,this.t=void 0}function B(e){return new V(e)}function z(e){for(var t=e.s;void 0!==t;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function q(e){for(var t=e.s;void 0!==t;t=t.n){var n=t.S.n;if(void 0!==n&&(t.r=n),t.S.n=t,t.i=-1,void 0===t.n){e.s=t;break}}}function J(e){for(var t=e.s,n=void 0;void 0!==t;){var r=t.p;-1===t.i?(t.S.U(t),void 0!==r&&(r.n=t.n),void 0!==t.n&&(t.n.p=r)):n=t,t.S.n=t.r,void 0!==t.r&&(t.r=void 0),t=r}e.s=n}function K(e){V.call(this,void 0),this.x=e,this.s=void 0,this.g=D-1,this.f=4}function G(e){return new K(e)}function X(e){var t=e.u;if(e.u=void 0,"function"==typeof t){L++;var n=W;W=void 0;try{t()}catch(t){throw e.f&=-2,e.f|=8,Q(e),t}finally{W=n,H()}}}function Q(e){for(var t=e.s;void 0!==t;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,X(e)}function Y(e){if(W!==this)throw new Error("Out-of-order effect");J(this),W=e,this.f&=-2,8&this.f&&Q(this),H()}function Z(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}function ee(e){var t=new Z(e);try{t.c()}catch(e){throw t.d(),e}return t.d.bind(t)}function te(e,t){c.fF[e]=t.bind(null,c.fF[e]||function(){})}function ne(e){F&&F(),F=e&&e.S()}function re(e){var t=this,n=e.data,r=function(e){return x((function(){return B(e)}),[])}(n);r.value=n;var o=x((function(){for(var e=t.__v;e=e.__;)if(e.__c){e.__c.__$f|=4;break}return t.__$u.c=function(){var e,n=t.__$u.S(),r=o.value;n(),(0,c.zO)(r)||3!==(null==(e=t.base)?void 0:e.nodeType)?(t.__$f|=1,t.setState({})):t.base.data=r},G((function(){var e=r.value.value;return 0===e?0:!0===e?"":e||""}))}),[]);return o.value}function oe(e,t,n,r){var o=t in e&&void 0===e.ownerSVGElement,i=B(n);return{o:function(e,t){i.value=e,r=t},d:ee((function(){var n=i.value.value;r[t]!==n&&(r[t]=n,o?e[t]=n:n?e.setAttribute(t,n):e.removeAttribute(t))}))}}V.prototype.brand=j,V.prototype.h=function(){return!0},V.prototype.S=function(e){this.t!==e&&void 0===e.e&&(e.x=this.t,void 0!==this.t&&(this.t.e=e),this.t=e)},V.prototype.U=function(e){if(void 0!==this.t){var t=e.e,n=e.x;void 0!==t&&(t.x=n,e.e=void 0),void 0!==n&&(n.e=t,e.x=void 0),e===this.t&&(this.t=n)}},V.prototype.subscribe=function(e){var t=this;return ee((function(){var n=t.value,r=W;W=void 0;try{e(n)}finally{W=r}}))},V.prototype.valueOf=function(){return this.value},V.prototype.toString=function(){return this.value+""},V.prototype.toJSON=function(){return this.value},V.prototype.peek=function(){var e=W;W=void 0;try{return this.value}finally{W=e}},Object.defineProperty(V.prototype,"value",{get:function(){var e=I(this);return void 0!==e&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(R>100)throw new Error("Cycle detected");this.v=e,this.i++,D++,L++;try{for(var t=this.t;void 0!==t;t=t.x)t.t.N()}finally{H()}}}}),(K.prototype=new V).h=function(){if(this.f&=-3,1&this.f)return!1;if(32==(36&this.f))return!0;if(this.f&=-5,this.g===D)return!0;if(this.g=D,this.f|=1,this.i>0&&!z(this))return this.f&=-2,!0;var e=W;try{q(this),W=this;var t=this.x();(16&this.f||this.v!==t||0===this.i)&&(this.v=t,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return W=e,J(this),this.f&=-2,!0},K.prototype.S=function(e){if(void 0===this.t){this.f|=36;for(var t=this.s;void 0!==t;t=t.n)t.S.S(t)}V.prototype.S.call(this,e)},K.prototype.U=function(e){if(void 0!==this.t&&(V.prototype.U.call(this,e),void 0===this.t)){this.f&=-33;for(var t=this.s;void 0!==t;t=t.n)t.S.U(t)}},K.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;void 0!==e;e=e.x)e.t.N()}},Object.defineProperty(K.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=I(this);if(this.h(),void 0!==e&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),Z.prototype.c=function(){var e=this.S();try{if(8&this.f)return;if(void 0===this.x)return;var t=this.x();"function"==typeof t&&(this.u=t)}finally{e()}},Z.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,X(this),q(this),L++;var e=W;return W=this,Y.bind(this,e)},Z.prototype.N=function(){2&this.f||(this.f|=2,this.o=A,A=this)},Z.prototype.d=function(){this.f|=8,1&this.f||Q(this)},re.displayName="_st",Object.defineProperties(V.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:re},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}}),te("__b",(function(e,t){if("string"==typeof t.type){var n,r=t.props;for(var o in r)if("children"!==o){var i=r[o];i instanceof V&&(n||(t.__np=n={}),n[o]=i,r[o]=i.peek())}}e(t)})),te("__r",(function(e,t){ne();var n,r=t.__c;r&&(r.__$f&=-2,void 0===(n=r.__$u)&&(r.__$u=n=function(){var e;return ee((function(){e=this})),e.c=function(){r.__$f|=1,r.setState({})},e}())),ne(n),e(t)})),te("__e",(function(e,t,n,r){ne(),e(t,n,r)})),te("diffed",(function(e,t){var n;if(ne(),"string"==typeof t.type&&(n=t.__e)){var r=t.__np,o=t.props;if(r){var i=n.U;if(i)for(var s in i){var u=i[s];void 0===u||s in r||(u.d(),i[s]=void 0)}else n.U=i={};for(var c in r){var l=i[c],_=r[c];void 0===l?(l=oe(n,c,_,o),i[c]=l):l.o(_,o)}}}e(t)})),te("unmount",(function(e,t){if("string"==typeof t.type){var n=t.__e;if(n){var r=n.U;if(r)for(var o in n.U=void 0,r){var i=r[o];i&&i.d()}}}else{var s=t.__c;if(s){var u=s.__$u;u&&(s.__$u=void 0,u.d())}}e(t)})),te("__h",(function(e,t,n,r){(r<3||9===r)&&(t.__$f|=2),e(t,n,r)})),c.uA.prototype.shouldComponentUpdate=function(e,t){var n=this.__$u,r=n&&void 0!==n.s;for(var o in t)return!0;if(this.__f||"boolean"==typeof this.u&&!0===this.u){if(!(r||2&this.__$f||4&this.__$f))return!0;if(1&this.__$f)return!0}else{if(!(r||4&this.__$f))return!0;if(3&this.__$f)return!0}for(var i in e)if("__source"!==i&&e[i]!==this.props[i])return!0;for(var s in this.props)if(!(s in e))return!0;return!1};const ie=[],se=()=>ie.slice(-1)[0],ue=e=>{ie.push(e)},ce=()=>{ie.pop()},le=[],_e=()=>le.slice(-1)[0],ae=e=>{le.push(e)},fe=()=>{le.pop()},pe=new WeakMap,he=()=>{throw new Error("Please use `data-wp-bind` to modify the attributes of an element.")},ve={get(e,t,n){const r=Reflect.get(e,t,n);return r&&"object"==typeof r?de(r):r},set:he,deleteProperty:he},de=e=>(pe.has(e)||pe.set(e,new Proxy(e,ve)),pe.get(e)),ye=e=>_e().context[e||se()],ge=()=>{const e=_e();const{ref:t,attributes:n}=e;return Object.freeze({ref:t.current,attributes:de(n)})},me=e=>_e().serverContext[e||se()],we=e=>new Promise((t=>{const n=()=>{clearTimeout(r),window.cancelAnimationFrame(o),setTimeout((()=>{e(),t()}))},r=setTimeout(n,100),o=window.requestAnimationFrame(n)})),be="function"==typeof window.scheduler?.yield?window.scheduler.yield.bind(window.scheduler):()=>new Promise((e=>{setTimeout(e,0)}));function Se(e){w((()=>{let t=null,n=!1;return t=function(e,t){let n=()=>{};const r=ee((function(){return n=this.c.bind(this),this.x=e,this.c=t,e()}));return{flush:n,dispose:r}}(e,(async()=>{t&&!n&&(n=!0,await we(t.flush),n=!1)})),t.dispose}),[])}function xe(e){const t=_e(),n=se();return"GeneratorFunction"===e?.constructor?.name?async(...r)=>{const o=e(...r);let i,s;for(;;){ue(n),ae(t);try{s=o.next(i)}finally{fe(),ce()}try{i=await s.value}catch(e){ue(n),ae(t),o.throw(e)}finally{fe(),ce()}if(s.done)break}return i}:(...r)=>{ue(n),ae(t);try{return e(...r)}finally{ce(),fe()}}}function ke(e){Se(xe(e))}function Ee(e){w(xe(e),[])}function Pe(e,t){w(xe(e),t)}function Ce(e,t){b(xe(e),t)}function Oe(e,t){return k(xe(e),t)}function $e(e,t){return x(xe(e),t)}new Set;const Te=e=>{0},Me=e=>Boolean(e&&"object"==typeof e&&e.constructor===Object),Ne=new WeakMap,je=new WeakMap,He=new WeakMap,Ue=new Set([Object,Array]),We=(e,t,n)=>{if(!Le(t))throw Error("This object cannot be proxified.");if(!Ne.has(t)){const r=new Proxy(t,n);Ne.set(t,r),je.set(r,t),He.set(r,e)}return Ne.get(t)},Fe=e=>Ne.get(e),Ae=e=>He.get(e),Le=e=>"object"==typeof e&&null!==e&&(!He.has(e)&&Ue.has(e.constructor)),Re={};class De{constructor(e){this.owner=e,this.computedsByScope=new WeakMap}setValue(e){this.update({value:e})}setGetter(e){this.update({get:e})}getComputed(){const e=_e()||Re;if(this.valueSignal||this.getterSignal||this.update({}),!this.computedsByScope.has(e)){const t=()=>{const e=this.getterSignal?.value;return e?e.call(this.owner):this.valueSignal?.value};ue(Ae(this.owner)),this.computedsByScope.set(e,G(xe(t))),ce()}return this.computedsByScope.get(e)}update({get:e,value:t}){this.valueSignal?t===this.valueSignal.peek()&&e===this.getterSignal.peek()||U((()=>{this.valueSignal.value=t,this.getterSignal.value=e})):(this.valueSignal=B(t),this.getterSignal=B(e))}}const Ie=new Set(Object.getOwnPropertyNames(Symbol).map((e=>Symbol[e])).filter((e=>"symbol"==typeof e))),Ve=new WeakMap,Be=(e,t)=>Ve.has(e)&&Ve.get(e).has(t),ze=new WeakSet,qe=(e,t,n)=>{Ve.has(e)||Ve.set(e,new Map),t="number"==typeof t?`${t}`:t;const r=Ve.get(e);if(!r.has(t)){const o=Ae(e),i=new De(e);if(r.set(t,i),n){const{get:t,value:r}=n;if(t)i.setGetter(t);else{const t=ze.has(e);i.setValue(Le(r)?Xe(o,r,{readOnly:t}):r)}}}return r.get(t)},Je=new WeakMap;let Ke=!1;const Ge={get(e,t,n){if(Ke||!e.hasOwnProperty(t)&&t in e||"symbol"==typeof t&&Ie.has(t))return Reflect.get(e,t,n);const r=Object.getOwnPropertyDescriptor(e,t),o=qe(n,t,r).getComputed().value;if("function"==typeof o){const e=Ae(n);return(...t)=>{ue(e);try{return o.call(n,...t)}finally{ce()}}}return o},set(e,t,n,r){if(ze.has(r))return!1;ue(Ae(r));try{return Reflect.set(e,t,n,r)}finally{ce()}},defineProperty(e,t,n){if(ze.has(Fe(e)))return!1;const r=!(t in e),o=Reflect.defineProperty(e,t,n);if(o){const o=Fe(e),i=qe(o,t),{get:s,value:u}=n;if(s)i.setGetter(s);else{const e=Ae(o);i.setValue(Le(u)?Xe(e,u):u)}if(r&&Je.has(e)&&Je.get(e).value++,Array.isArray(e)&&Ve.get(o)?.has("length")){qe(o,"length").setValue(e.length)}}return o},deleteProperty(e,t){if(ze.has(Fe(e)))return!1;const n=Reflect.deleteProperty(e,t);if(n){qe(Fe(e),t).setValue(void 0),Je.has(e)&&Je.get(e).value++}return n},ownKeys:e=>(Je.has(e)||Je.set(e,B(0)),Je._=Je.get(e).value,Reflect.ownKeys(e))},Xe=(e,t,n)=>{const r=We(e,t,Ge);return n?.readOnly&&ze.add(r),r},Qe=(e,t,n=!0)=>{if(!Me(e)||!Me(t))return;let r=!1;for(const o in t){const i=!(o in e);r=r||i;const s=Object.getOwnPropertyDescriptor(t,o),u=Fe(e),c=!!u&&Be(u,o)&&qe(u,o);if("function"==typeof s.get||"function"==typeof s.set)(n||i)&&(Object.defineProperty(e,o,{...s,configurable:!0,enumerable:!0}),s.get&&c&&c.setGetter(s.get));else if(Me(t[o])){const r=Object.getOwnPropertyDescriptor(e,o)?.value;if(i||n&&!Me(r)){if(e[o]={},c){const t=Ae(u);c.setValue(Xe(t,e[o]))}Qe(e[o],t[o],n)}else Me(r)&&Qe(e[o],t[o],n)}else if((n||i)&&(Object.defineProperty(e,o,s),c)){const{value:e}=s,t=Ae(u);c.setValue(Le(e)?Xe(t,e):e)}}r&&Je.has(e)&&Je.get(e).value++},Ye=(e,t,n=!0)=>U((()=>{return Qe((r=e,je.get(r)||e),t,n);var r})),Ze=new WeakSet,et={get:(e,t,n)=>{const r=Reflect.get(e,t),o=Ae(n);if(void 0===r&&Ze.has(n)){const n={};return Reflect.set(e,t,n),tt(o,n,!1)}if("function"==typeof r){ue(o);const e=xe(r);return ce(),e}return Me(r)&&Le(r)?tt(o,r,!1):r}},tt=(e,t,n=!0)=>{const r=We(e,t,et);return r&&n&&Ze.add(r),r},nt=new WeakMap,rt=new WeakMap,ot=new WeakSet,it=Reflect.getOwnPropertyDescriptor,st={get:(e,t)=>{const n=rt.get(e),r=e[t];return t in e?r:n[t]},set:(e,t,n)=>{const r=rt.get(e);return(t in e||!(t in r)?e:r)[t]=n,!0},ownKeys:e=>[...new Set([...Object.keys(rt.get(e)),...Object.keys(e)])],getOwnPropertyDescriptor:(e,t)=>it(e,t)||it(rt.get(e),t),has:(e,t)=>Reflect.has(e,t)||Reflect.has(rt.get(e),t)},ut=(e,t={})=>{if(ot.has(e))throw Error("This object cannot be proxified.");if(rt.set(e,t),!nt.has(e)){const t=new Proxy(e,st);nt.set(e,t),ot.add(t)}return nt.get(e)},ct=new Map,lt=new Map,_t=new Map,at=new Map,ft=new Map,pt=e=>at.get(e||se())||{},ht=e=>{const t=e||se();return ft.has(t)||ft.set(t,Xe(t,{},{readOnly:!0})),ft.get(t)},vt="I acknowledge that using a private store means my plugin will inevitably break on the next store release.";function dt(e,{state:t={},...n}={},{lock:r=!1}={}){if(ct.has(e)){if(r===vt||_t.has(e)){const t=_t.get(e);if(!(r===vt||!0!==r&&r===t))throw t?Error("Cannot unlock a private store with an invalid lock code"):Error("Cannot lock a public store")}else _t.set(e,r);const o=lt.get(e);Ye(o,n),Ye(o.state,t)}else{r!==vt&&_t.set(e,r);const o={state:Xe(e,Me(t)?t:{}),...n},i=tt(e,o);lt.set(e,o),ct.set(e,i)}return ct.get(e)}const yt=(e=document)=>{var t;const n=null!==(t=e.getElementById("wp-script-module-data-@wordpress/interactivity"))&&void 0!==t?t:e.getElementById("wp-interactivity-data");if(n?.textContent)try{return JSON.parse(n.textContent)}catch{}return{}},gt=e=>{Me(e?.state)&&Object.entries(e.state).forEach((([e,t])=>{const n=dt(e,{},{lock:vt});Ye(n.state,t,!1),Ye(ht(e),t)})),Me(e?.config)&&Object.entries(e.config).forEach((([e,t])=>{at.set(e,t)}))},mt=yt();function wt(e){return null!==e.suffix}function bt(e){return null===e.suffix}gt(mt);const St=(0,c.q6)({client:{},server:{}}),xt={},kt={},Et=(e,t,{priority:n=10}={})=>{xt[e]=t,kt[e]=n},Pt=({scope:e})=>(t,...n)=>{let{value:r,namespace:o}=t;if("string"!=typeof r)throw new Error("The `value` prop should be a string path");const i="!"===r[0]&&!!(r=r.slice(1));ae(e);const s=((e,t)=>{if(!t)return void Te();let n=ct.get(t);void 0===n&&(n=dt(t,{},{lock:vt}));const r={...n,context:_e().context[t]};try{return e.split(".").reduce(((e,t)=>e[t]),r)}catch(e){}})(r,o),u="function"==typeof s?s(...n):s;return fe(),i?!u:u},Ct=({directives:e,priorityLevels:[t,...n],element:r,originalProps:o,previousScope:i})=>{const s=S({}).current;s.evaluate=k(Pt({scope:s}),[]);const{client:u,server:l}=E(St);s.context=u,s.serverContext=l,s.ref=i?.ref||S(null),r=(0,c.Ob)(r,{ref:s.ref}),s.attributes=r.props;const _=n.length>0?(0,c.h)(Ct,{directives:e,priorityLevels:n,element:r,originalProps:o,previousScope:s}):r,a={...o,children:_},f={directives:e,props:a,element:r,context:St,evaluate:s.evaluate};ae(s);for(const e of t){const t=xt[e]?.(f);void 0!==t&&(a.children=t)}return fe(),a.children},Ot=c.fF.vnode;function $t(e){return Me(e)?Object.fromEntries(Object.entries(e).map((([e,t])=>[e,$t(t)]))):Array.isArray(e)?e.map((e=>$t(e))):e}c.fF.vnode=e=>{if(e.props.__directives){const t=e.props,n=t.__directives;n.key&&(e.key=n.key.find(bt).value),delete t.__directives;const r=(e=>{const t=Object.keys(e).reduce(((e,t)=>{if(xt[t]){const n=kt[t];(e[n]=e[n]||[]).push(t)}return e}),{});return Object.entries(t).sort((([e],[t])=>parseInt(e)-parseInt(t))).map((([,e])=>e))})(n);r.length>0&&(e.props={directives:n,priorityLevels:r,originalProps:t,type:e.type,element:(0,c.h)(e.type,t),top:!0},e.type=Ct)}Ot&&Ot(e)};const Tt=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,Mt=/\/\*[^]*?\*\/| +/g,Nt=/\n+/g,jt=e=>({directives:t,evaluate:n})=>{t[`on-${e}`].filter(wt).forEach((t=>{const r=t.suffix.split("--",1)[0];Ee((()=>{const o=e=>n(t,e),i="window"===e?window:document;return i.addEventListener(r,o),()=>i.removeEventListener(r,o)}))}))},Ht=e=>({directives:t,evaluate:n})=>{t[`on-async-${e}`].filter(wt).forEach((t=>{const r=t.suffix.split("--",1)[0];Ee((()=>{const o=async e=>{await be(),n(t,e)},i="window"===e?window:document;return i.addEventListener(r,o,{passive:!0}),()=>i.removeEventListener(r,o)}))}))},Ut="wp",Wt=`data-${Ut}-ignore`,Ft=`data-${Ut}-interactive`,At=`data-${Ut}-`,Lt=[],Rt=new RegExp(`^data-${Ut}-([a-z0-9]+(?:-[a-z0-9]+)*)(?:--([a-z0-9_-]+))?$`,"i"),Dt=/^([\w_\/-]+)::(.+)$/,It=new WeakSet;function Vt(e){const t=document.createTreeWalker(e,205);return function e(n){const{nodeType:r}=n;if(3===r)return[n.data];if(4===r){var o;const e=t.nextSibling();return n.replaceWith(new window.Text(null!==(o=n.nodeValue)&&void 0!==o?o:"")),[n.nodeValue,e]}if(8===r||7===r){const e=t.nextSibling();return n.remove(),[null,e]}const i=n,{attributes:s}=i,u=i.localName,l={},_=[],a=[];let f=!1,p=!1;for(let e=0;e{const o=Rt.exec(t);if(null===o)return Te(),e;const i=o[1]||"",s=o[2]||null;var u;return e[i]=e[i]||[],e[i].push({namespace:null!=n?n:null!==(u=Lt[Lt.length-1])&&void 0!==u?u:null,value:r,suffix:s}),e}),{})),"template"===u)l.content=[...i.content.childNodes].map((e=>Vt(e)));else{let n=t.firstChild();if(n){for(;n;){const[r,o]=e(n);r&&_.push(r),n=o||t.nextSibling()}t.parentNode()}}return p&&Lt.pop(),[(0,c.h)(u,l,_)]}(t.currentNode)}const Bt=new WeakMap,zt=e=>{if(!e.parentElement)throw Error("The passed region should be an element with a parent.");return Bt.has(e)||Bt.set(e,((e,t)=>{const n=(t=[].concat(t))[t.length-1].nextSibling;function r(t,r){e.insertBefore(t,r||n)}return e.__k={nodeType:1,parentNode:e,firstChild:t[0],childNodes:t,insertBefore:r,appendChild:r,removeChild(t){e.removeChild(t)}}})(e.parentElement,e)),Bt.get(e)},qt=new WeakMap,Jt=e=>{if("I acknowledge that using private APIs means my theme or plugin will inevitably break in the next version of WordPress."===e)return{directivePrefix:Ut,getRegionRootFragment:zt,initialVdom:qt,toVdom:Vt,directive:Et,getNamespace:se,h:c.h,cloneElement:c.Ob,render:c.XX,proxifyState:Xe,parseServerData:yt,populateServerData:gt,batch:U};throw new Error("Forbidden access.")};Et("context",(({directives:{context:e},props:{children:t},context:n})=>{const{Provider:r}=n,o=e.find(bt),{client:i,server:s}=E(n),u=o.namespace,l=S(Xe(u,{})),_=S(Xe(u,{},{readOnly:!0})),a=x((()=>{const e={client:{...i},server:{...s}};if(o){const{namespace:t,value:n}=o;Me(n)||Te(),Ye(l.current,$t(n),!1),Ye(_.current,$t(n)),e.client[t]=ut(l.current,i[t]),e.server[t]=ut(_.current,s[t])}return e}),[o,i,s]);return(0,c.h)(r,{value:a},t)}),{priority:5}),Et("watch",(({directives:{watch:e},evaluate:t})=>{e.forEach((e=>{ke((()=>t(e)))}))})),Et("init",(({directives:{init:e},evaluate:t})=>{e.forEach((e=>{Ee((()=>t(e)))}))})),Et("on",(({directives:{on:e},element:t,evaluate:n})=>{const r=new Map;e.filter(wt).forEach((e=>{const t=e.suffix.split("--")[0];r.has(t)||r.set(t,new Set),r.get(t).add(e)})),r.forEach(((e,r)=>{const o=t.props[`on${r}`];t.props[`on${r}`]=t=>{e.forEach((e=>{o&&o(t),n(e,t)}))}}))})),Et("on-async",(({directives:{"on-async":e},element:t,evaluate:n})=>{const r=new Map;e.filter(wt).forEach((e=>{const t=e.suffix.split("--")[0];r.has(t)||r.set(t,new Set),r.get(t).add(e)})),r.forEach(((e,r)=>{const o=t.props[`on${r}`];t.props[`on${r}`]=t=>{o&&o(t),e.forEach((async e=>{await be(),n(e,t)}))}}))})),Et("on-window",jt("window")),Et("on-document",jt("document")),Et("on-async-window",Ht("window")),Et("on-async-document",Ht("document")),Et("class",(({directives:{class:e},element:t,evaluate:n})=>{e.filter(wt).forEach((e=>{const r=e.suffix,o=n(e),i=t.props.class||"",s=new RegExp(`(^|\\s)${r}(\\s|$)`,"g");o?s.test(i)||(t.props.class=i?`${i} ${r}`:r):t.props.class=i.replace(s," ").trim(),Ee((()=>{o?t.ref.current.classList.add(r):t.ref.current.classList.remove(r)}))}))})),Et("style",(({directives:{style:e},element:t,evaluate:n})=>{e.filter(wt).forEach((e=>{const r=e.suffix,o=n(e);t.props.style=t.props.style||{},"string"==typeof t.props.style&&(t.props.style=(e=>{const t=[{}];let n,r;for(;n=Tt.exec(e.replace(Mt,""));)n[4]?t.shift():n[3]?(r=n[3].replace(Nt," ").trim(),t.unshift(t[0][r]=t[0][r]||{})):t[0][n[1]]=n[2].replace(Nt," ").trim();return t[0]})(t.props.style)),o?t.props.style[r]=o:delete t.props.style[r],Ee((()=>{o?t.ref.current.style[r]=o:t.ref.current.style.removeProperty(r)}))}))})),Et("bind",(({directives:{bind:e},element:t,evaluate:n})=>{e.filter(wt).forEach((e=>{const r=e.suffix,o=n(e);t.props[r]=o,Ee((()=>{const e=t.ref.current;if("style"!==r){if("width"!==r&&"height"!==r&&"href"!==r&&"list"!==r&&"form"!==r&&"tabIndex"!==r&&"download"!==r&&"rowSpan"!==r&&"colSpan"!==r&&"role"!==r&&r in e)try{return void(e[r]=null==o?"":o)}catch(e){}null==o||!1===o&&"-"!==r[4]?e.removeAttribute(r):e.setAttribute(r,o)}else"string"==typeof o&&(e.style.cssText=o)}))}))})),Et("ignore",(({element:{type:e,props:{innerHTML:t,...n}}})=>{const r=x((()=>t),[]);return(0,c.h)(e,{dangerouslySetInnerHTML:{__html:r},...n})})),Et("text",(({directives:{text:e},element:t,evaluate:n})=>{const r=e.find(bt);if(r)try{const e=n(r);t.props.children="object"==typeof e?null:e.toString()}catch(e){t.props.children=null}else t.props.children=null})),Et("run",(({directives:{run:e},evaluate:t})=>{e.forEach((e=>t(e)))})),Et("each",(({directives:{each:e,"each-key":t},context:n,element:r,evaluate:o})=>{if("template"!==r.type)return;const{Provider:i}=n,s=E(n),[u]=e,{namespace:l}=u,_=o(u);if("function"!=typeof _?.[Symbol.iterator])return;const a=wt(u)?u.suffix.replace(/^-+|-+$/g,"").toLowerCase().replace(/-([a-z])/g,(function(e,t){return t.toUpperCase()})):"item",f=[];for(const e of _){const n=ut(Xe(l,{}),s.client[l]),o={client:{...s.client,[l]:n},server:{...s.server}};o.client[l][a]=e;const u={..._e(),context:o.client,serverContext:o.server},_=t?Pt({scope:u})(t[0]):e;f.push((0,c.h)(i,{value:o,key:_},r.props.content))}return f}),{priority:20}),Et("each-child",(()=>null),{priority:1}),(async()=>{const e=document.querySelectorAll(`[data-${Ut}-interactive]`);await new Promise((e=>{setTimeout(e,0)}));for(const t of e)if(!It.has(t)){await be();const e=zt(t),n=Vt(t);qt.set(t,n),await be(),(0,c.Qv)(n,e)}})();var Kt=r.zj,Gt=r.SD,Xt=r.V6,Qt=r.$K,Yt=r.vT,Zt=r.jb,en=r.yT,tn=r.M_,nn=r.hb,rn=r.vJ,on=r.ip,sn=r.Nf,un=r.Kr,cn=r.li,ln=r.J0,_n=r.FH,an=r.v4;export{Kt as getConfig,Gt as getContext,Xt as getElement,Qt as getServerContext,Yt as getServerState,Zt as privateApis,en as splitTask,tn as store,nn as useCallback,rn as useEffect,on as useInit,sn as useLayoutEffect,un as useMemo,cn as useRef,ln as useState,_n as useWatch,an as withScope}; \ No newline at end of file diff --git a/wp-includes/js/dist/server-side-render.js b/wp-includes/js/dist/server-side-render.js index 8768a2366b..7d50a2c052 100644 --- a/wp-includes/js/dist/server-side-render.js +++ b/wp-includes/js/dist/server-side-render.js @@ -184,7 +184,6 @@ const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"]; - const EMPTY_OBJECT = {}; function rendererPath(block, attributes = null, urlQueryArgs = {}) { return (0,external_wp_url_namespaceObject.addQueryArgs)(`/wp/v2/block-renderer/${block}`, { diff --git a/wp-includes/js/dist/shortcode.js b/wp-includes/js/dist/shortcode.js index fab44a5402..d3c95313d3 100644 --- a/wp-includes/js/dist/shortcode.js +++ b/wp-includes/js/dist/shortcode.js @@ -194,39 +194,12 @@ function memize(fn, options) { ;// ./node_modules/@wordpress/shortcode/build-module/index.js +/* wp:polyfill */ /** * External dependencies */ -/** - * Shortcode attributes object. - * - * @typedef {Object} WPShortcodeAttrs - * - * @property {Object} named Object with named attributes. - * @property {Array} numeric Array with numeric attributes. - */ - -/** - * Shortcode object. - * - * @typedef {Object} WPShortcode - * - * @property {string} tag Shortcode tag. - * @property {WPShortcodeAttrs} attrs Shortcode attributes. - * @property {string} content Shortcode content. - * @property {string} type Shortcode type: `self-closing`, - * `closed`, or `single`. - */ - -/** - * @typedef {Object} WPShortcodeMatch - * - * @property {number} index Index the shortcode is found at. - * @property {string} content Matched content. - * @property {WPShortcode} shortcode Shortcode instance of the match. - */ /** * Find the next matching shortcode. @@ -235,7 +208,7 @@ function memize(fn, options) { * @param {string} text Text to search. * @param {number} index Index to start search from. * - * @return {WPShortcodeMatch | undefined} Matched information. + * @return {import('./types').ShortcodeMatch | undefined} Matched information. */ function next(tag, text, index = 0) { const re = regexp(tag); @@ -272,10 +245,10 @@ function next(tag, text, index = 0) { /** * Replace matching shortcodes in a block of text. * - * @param {string} tag Shortcode tag. - * @param {string} text Text to search. - * @param {Function} callback Function to process the match and return - * replacement string. + * @param {string} tag Shortcode tag. + * @param {string} text Text to search. + * @param {import('./types').ReplaceCallback} callback Function to process the match and return + * replacement string. * * @return {string} Text with shortcodes replaced. */ @@ -352,7 +325,7 @@ function regexp(tag) { * * @param {string} text Serialised shortcode attributes. * - * @return {WPShortcodeAttrs} Parsed shortcode attributes. + * @return {import('./types').ShortcodeAttrs} Parsed shortcode attributes. */ const attrs = memize(text => { const named = {}; @@ -407,9 +380,9 @@ const attrs = memize(text => { * by `regexp()`. `match` can also be set to the `arguments` from a callback * passed to `regexp.replace()`. * - * @param {Array} match Match array. + * @param {import('./types').Match} match Match array. * - * @return {WPShortcode} Shortcode instance. + * @return {InstanceType} Shortcode instance. */ function fromMatch(match) { let type; @@ -436,9 +409,7 @@ function fromMatch(match) { * the `type` of the shortcode ('single', 'self-closing', or 'closed'), and a * `content` string. * - * @param {Object} options Options as described. - * - * @return {WPShortcode} Shortcode instance. + * @type {import('./types').shortcode} Shortcode instance. */ const shortcode = Object.assign(function (options) { const { @@ -506,7 +477,7 @@ Object.assign(shortcode.prototype, { * @param {(number|string)} attr Attribute key. * @param {string} value Attribute value. * - * @return {WPShortcode} Shortcode instance. + * @return {InstanceType< import('./types').shortcode >} Shortcode instance. */ set(attr, value) { this.attrs[typeof attr === 'number' ? 'numeric' : 'named'][attr] = value; diff --git a/wp-includes/js/dist/style-engine.js b/wp-includes/js/dist/style-engine.js index 14bc068aa1..9ae187a5a9 100644 --- a/wp-includes/js/dist/style-engine.js +++ b/wp-includes/js/dist/style-engine.js @@ -310,10 +310,19 @@ var __setModuleDefault = Object.create ? (function(o, v) { o["default"] = v; }; +var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); +}; + function __importStar(mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); __setModuleDefault(result, mod); return result; } @@ -394,12 +403,25 @@ function __disposeResources(env) { return next(); } +function __rewriteRelativeImportExtension(path, preserveJsx) { + if (typeof path === "string" && /^\.\.?\//.test(path)) { + return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) { + return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js"); + }); + } + return path; +} + /* harmony default export */ const tslib_es6 = ({ __extends, __assign, __rest, __decorate, __param, + __esDecorate, + __runInitializers, + __propKey, + __setFunctionName, __metadata, __awaiter, __generator, @@ -422,6 +444,7 @@ function __disposeResources(env) { __classPrivateFieldIn, __addDisposableResource, __disposeResources, + __rewriteRelativeImportExtension, }); ;// ./node_modules/lower-case/dist.es2015/index.js @@ -527,6 +550,7 @@ const VARIABLE_PATH_SEPARATOR_TOKEN_ATTRIBUTE = '|'; const VARIABLE_PATH_SEPARATOR_TOKEN_STYLE = '--'; ;// ./node_modules/@wordpress/style-engine/build-module/styles/utils.js +/* wp:polyfill */ /** * External dependencies */ @@ -1057,6 +1081,7 @@ const writingMode = { const styleDefinitions = [...border, ...styles_color, ...dimensions, ...outline, ...spacing, ...typography, ...styles_shadow, ...styles_background]; ;// ./node_modules/@wordpress/style-engine/build-module/index.js +/* wp:polyfill */ /** * External dependencies */ diff --git a/wp-includes/js/dist/token-list.js b/wp-includes/js/dist/token-list.js index 98b080bb2b..db9873e750 100644 --- a/wp-includes/js/dist/token-list.js +++ b/wp-includes/js/dist/token-list.js @@ -26,6 +26,7 @@ var __webpack_exports__ = {}; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ TokenList) /* harmony export */ }); +/* wp:polyfill */ /** * A set of tokens. * diff --git a/wp-includes/js/dist/undo-manager.js b/wp-includes/js/dist/undo-manager.js deleted file mode 100644 index 066e11d367..0000000000 --- a/wp-includes/js/dist/undo-manager.js +++ /dev/null @@ -1,260 +0,0 @@ -/******/ (() => { // webpackBootstrap -/******/ "use strict"; -/******/ var __webpack_modules__ = ({ - -/***/ 923: -/***/ ((module) => { - -module.exports = window["wp"]["isShallowEqual"]; - -/***/ }) - -/******/ }); -/************************************************************************/ -/******/ // The module cache -/******/ var __webpack_module_cache__ = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ // Check if module is in cache -/******/ var cachedModule = __webpack_module_cache__[moduleId]; -/******/ if (cachedModule !== undefined) { -/******/ return cachedModule.exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = __webpack_module_cache__[moduleId] = { -/******/ // no module.id needed -/******/ // no module.loaded needed -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/************************************************************************/ -/******/ /* webpack/runtime/compat get default export */ -/******/ (() => { -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = (module) => { -/******/ var getter = module && module.__esModule ? -/******/ () => (module['default']) : -/******/ () => (module); -/******/ __webpack_require__.d(getter, { a: getter }); -/******/ return getter; -/******/ }; -/******/ })(); -/******/ -/******/ /* webpack/runtime/define property getters */ -/******/ (() => { -/******/ // define getter functions for harmony exports -/******/ __webpack_require__.d = (exports, definition) => { -/******/ for(var key in definition) { -/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { -/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); -/******/ } -/******/ } -/******/ }; -/******/ })(); -/******/ -/******/ /* webpack/runtime/hasOwnProperty shorthand */ -/******/ (() => { -/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) -/******/ })(); -/******/ -/******/ /* webpack/runtime/make namespace object */ -/******/ (() => { -/******/ // define __esModule on exports -/******/ __webpack_require__.r = (exports) => { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ })(); -/******/ -/************************************************************************/ -var __webpack_exports__ = {}; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ createUndoManager: () => (/* binding */ createUndoManager) -/* harmony export */ }); -/* harmony import */ var _wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(923); -/* harmony import */ var _wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_0__); -/** - * WordPress dependencies - */ - - -/** @typedef {import('./types').HistoryRecord} HistoryRecord */ -/** @typedef {import('./types').HistoryChange} HistoryChange */ -/** @typedef {import('./types').HistoryChanges} HistoryChanges */ -/** @typedef {import('./types').UndoManager} UndoManager */ - -/** - * Merge changes for a single item into a record of changes. - * - * @param {Record< string, HistoryChange >} changes1 Previous changes - * @param {Record< string, HistoryChange >} changes2 NextChanges - * - * @return {Record< string, HistoryChange >} Merged changes - */ -function mergeHistoryChanges(changes1, changes2) { - /** - * @type {Record< string, HistoryChange >} - */ - const newChanges = { - ...changes1 - }; - Object.entries(changes2).forEach(([key, value]) => { - if (newChanges[key]) { - newChanges[key] = { - ...newChanges[key], - to: value.to - }; - } else { - newChanges[key] = value; - } - }); - return newChanges; -} - -/** - * Adds history changes for a single item into a record of changes. - * - * @param {HistoryRecord} record The record to merge into. - * @param {HistoryChanges} changes The changes to merge. - */ -const addHistoryChangesIntoRecord = (record, changes) => { - const existingChangesIndex = record?.findIndex(({ - id: recordIdentifier - }) => { - return typeof recordIdentifier === 'string' ? recordIdentifier === changes.id : _wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_0___default()(recordIdentifier, changes.id); - }); - const nextRecord = [...record]; - if (existingChangesIndex !== -1) { - // If the edit is already in the stack leave the initial "from" value. - nextRecord[existingChangesIndex] = { - id: changes.id, - changes: mergeHistoryChanges(nextRecord[existingChangesIndex].changes, changes.changes) - }; - } else { - nextRecord.push(changes); - } - return nextRecord; -}; - -/** - * Creates an undo manager. - * - * @return {UndoManager} Undo manager. - */ -function createUndoManager() { - /** - * @type {HistoryRecord[]} - */ - let history = []; - /** - * @type {HistoryRecord} - */ - let stagedRecord = []; - /** - * @type {number} - */ - let offset = 0; - const dropPendingRedos = () => { - history = history.slice(0, offset || undefined); - offset = 0; - }; - const appendStagedRecordToLatestHistoryRecord = () => { - var _history$index; - const index = history.length === 0 ? 0 : history.length - 1; - let latestRecord = (_history$index = history[index]) !== null && _history$index !== void 0 ? _history$index : []; - stagedRecord.forEach(changes => { - latestRecord = addHistoryChangesIntoRecord(latestRecord, changes); - }); - stagedRecord = []; - history[index] = latestRecord; - }; - - /** - * Checks whether a record is empty. - * A record is considered empty if it the changes keep the same values. - * Also updates to function values are ignored. - * - * @param {HistoryRecord} record - * @return {boolean} Whether the record is empty. - */ - const isRecordEmpty = record => { - const filteredRecord = record.filter(({ - changes - }) => { - return Object.values(changes).some(({ - from, - to - }) => typeof from !== 'function' && typeof to !== 'function' && !_wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_0___default()(from, to)); - }); - return !filteredRecord.length; - }; - return { - /** - * Record changes into the history. - * - * @param {HistoryRecord=} record A record of changes to record. - * @param {boolean} isStaged Whether to immediately create an undo point or not. - */ - addRecord(record, isStaged = false) { - const isEmpty = !record || isRecordEmpty(record); - if (isStaged) { - if (isEmpty) { - return; - } - record.forEach(changes => { - stagedRecord = addHistoryChangesIntoRecord(stagedRecord, changes); - }); - } else { - dropPendingRedos(); - if (stagedRecord.length) { - appendStagedRecordToLatestHistoryRecord(); - } - if (isEmpty) { - return; - } - history.push(record); - } - }, - undo() { - if (stagedRecord.length) { - dropPendingRedos(); - appendStagedRecordToLatestHistoryRecord(); - } - const undoRecord = history[history.length - 1 + offset]; - if (!undoRecord) { - return; - } - offset -= 1; - return undoRecord; - }, - redo() { - const redoRecord = history[history.length + offset]; - if (!redoRecord) { - return; - } - offset += 1; - return redoRecord; - }, - hasUndo() { - return !!history[history.length - 1 + offset]; - }, - hasRedo() { - return !!history[history.length + offset]; - } - }; -} - -(window.wp = window.wp || {}).undoManager = __webpack_exports__; -/******/ })() -; \ No newline at end of file diff --git a/wp-includes/js/dist/undo-manager.min.js b/wp-includes/js/dist/undo-manager.min.js deleted file mode 100644 index ea95ef619c..0000000000 --- a/wp-includes/js/dist/undo-manager.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! This file is auto-generated */ -(()=>{"use strict";var e={923:e=>{e.exports=window.wp.isShallowEqual}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var i=t[o]={exports:{}};return e[o](i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};n.r(o),n.d(o,{createUndoManager:()=>s});var r=n(923),i=n.n(r);function a(e,t){const n={...e};return Object.entries(t).forEach((([e,t])=>{n[e]?n[e]={...n[e],to:t.to}:n[e]=t})),n}const d=(e,t)=>{const n=e?.findIndex((({id:e})=>"string"==typeof e?e===t.id:i()(e,t.id))),o=[...e];return-1!==n?o[n]={id:t.id,changes:a(o[n].changes,t.changes)}:o.push(t),o};function s(){let e=[],t=[],n=0;const o=()=>{e=e.slice(0,n||void 0),n=0},r=()=>{var n;const o=0===e.length?0:e.length-1;let r=null!==(n=e[o])&&void 0!==n?n:[];t.forEach((e=>{r=d(r,e)})),t=[],e[o]=r};return{addRecord(n,a=!1){const s=!n||(e=>!e.filter((({changes:e})=>Object.values(e).some((({from:e,to:t})=>"function"!=typeof e&&"function"!=typeof t&&!i()(e,t))))).length)(n);if(a){if(s)return;n.forEach((e=>{t=d(t,e)}))}else{if(o(),t.length&&r(),s)return;e.push(n)}},undo(){t.length&&(o(),r());const i=e[e.length-1+n];if(i)return n-=1,i},redo(){const t=e[e.length+n];if(t)return n+=1,t},hasUndo:()=>!!e[e.length-1+n],hasRedo:()=>!!e[e.length+n]}}(window.wp=window.wp||{}).undoManager=o})(); \ No newline at end of file diff --git a/wp-includes/js/dist/url.js b/wp-includes/js/dist/url.js index 32647be0e0..e611ee9ab9 100644 --- a/wp-includes/js/dist/url.js +++ b/wp-includes/js/dist/url.js @@ -659,7 +659,7 @@ const PHONE_REGEXP = /^(tel:)?(\+)?\d{6,15}$/; * @return {boolean} Whether or not it looks like a phone number. */ function isPhoneNumber(phoneNumber) { - // Remove any seperator from phone number. + // Remove any separator from phone number. phoneNumber = phoneNumber.replace(/[-.() ]/g, ''); return PHONE_REGEXP.test(phoneNumber); } @@ -815,6 +815,7 @@ function getQueryString(url) { } ;// ./node_modules/@wordpress/url/build-module/build-query-string.js +/* wp:polyfill */ /** * Generates URL-encoded query string using input query data. * @@ -984,6 +985,7 @@ function safeDecodeURIComponent(uriComponent) { } ;// ./node_modules/@wordpress/url/build-module/get-query-args.js +/* wp:polyfill */ /** * Internal dependencies */ @@ -1168,6 +1170,7 @@ function hasQueryArg(url, arg) { } ;// ./node_modules/@wordpress/url/build-module/remove-query-args.js +/* wp:polyfill */ /** * Internal dependencies */ @@ -1371,6 +1374,7 @@ function getFilename(url) { } ;// ./node_modules/@wordpress/url/build-module/normalize-path.js +/* wp:polyfill */ /** * Given a path, returns a normalized path where equal query parameter values * will be treated as identical, regardless of order they appear in the original @@ -1381,9 +1385,9 @@ function getFilename(url) { * @return {string} Normalized path. */ function normalizePath(path) { - const splitted = path.split('?'); - const query = splitted[1]; - const base = splitted[0]; + const split = path.split('?'); + const query = split[1]; + const base = split[0]; if (!query) { return base; } diff --git a/wp-includes/js/dist/vendor/wp-polyfill.js b/wp-includes/js/dist/vendor/wp-polyfill.js index 72b8b96470..32756d09da 100644 --- a/wp-includes/js/dist/vendor/wp-polyfill.js +++ b/wp-includes/js/dist/vendor/wp-polyfill.js @@ -1,7 +1,7 @@ /** - * core-js 3.35.1 + * core-js 3.39.0 * © 2014-2024 Denis Pushkarev (zloirock.ru) - * license: https://github.com/zloirock/core-js/blob/v3.35.1/LICENSE + * license: https://github.com/zloirock/core-js/blob/v3.39.0/LICENSE * source: https://github.com/zloirock/core-js */ !function (undefined) { 'use strict'; /******/ (function(modules) { // webpackBootstrap @@ -99,20 +99,38 @@ __webpack_require__(73); __webpack_require__(76); __webpack_require__(78); __webpack_require__(80); -__webpack_require__(92); -__webpack_require__(93); +__webpack_require__(86); __webpack_require__(95); -__webpack_require__(98); -__webpack_require__(100); -__webpack_require__(101); +__webpack_require__(96); +__webpack_require__(102); __webpack_require__(110); -__webpack_require__(111); -__webpack_require__(114); -__webpack_require__(120); +__webpack_require__(119); +__webpack_require__(121); +__webpack_require__(122); +__webpack_require__(124); +__webpack_require__(125); +__webpack_require__(126); +__webpack_require__(128); +__webpack_require__(129); +__webpack_require__(130); +__webpack_require__(131); +__webpack_require__(132); +__webpack_require__(134); __webpack_require__(135); -__webpack_require__(137); -__webpack_require__(138); -module.exports = __webpack_require__(139); +__webpack_require__(140); +__webpack_require__(141); +__webpack_require__(143); +__webpack_require__(145); +__webpack_require__(146); +__webpack_require__(152); +__webpack_require__(153); +__webpack_require__(156); +__webpack_require__(161); +__webpack_require__(169); +__webpack_require__(171); +__webpack_require__(172); +__webpack_require__(173); +module.exports = __webpack_require__(174); /***/ }), @@ -145,7 +163,7 @@ addToUnscopables('toReversed'); "use strict"; -var global = __webpack_require__(3); +var globalThis = __webpack_require__(3); var getOwnPropertyDescriptor = __webpack_require__(4).f; var createNonEnumerableProperty = __webpack_require__(42); var defineBuiltIn = __webpack_require__(46); @@ -174,11 +192,11 @@ module.exports = function (options, source) { var STATIC = options.stat; var FORCED, target, key, targetProperty, sourceProperty, descriptor; if (GLOBAL) { - target = global; + target = globalThis; } else if (STATIC) { - target = global[TARGET] || defineGlobalProperty(TARGET, {}); + target = globalThis[TARGET] || defineGlobalProperty(TARGET, {}); } else { - target = global[TARGET] && global[TARGET].prototype; + target = globalThis[TARGET] && globalThis[TARGET].prototype; } if (target) for (key in source) { sourceProperty = source[key]; @@ -565,7 +583,7 @@ module.exports = USE_SYMBOL_AS_UID ? function (it) { "use strict"; -var global = __webpack_require__(3); +var globalThis = __webpack_require__(3); var isCallable = __webpack_require__(20); var aFunction = function (argument) { @@ -573,7 +591,7 @@ var aFunction = function (argument) { }; module.exports = function (namespace, method) { - return arguments.length < 2 ? aFunction(global[namespace]) : global[namespace] && global[namespace][method]; + return arguments.length < 2 ? aFunction(globalThis[namespace]) : globalThis[namespace] && globalThis[namespace][method]; }; @@ -597,9 +615,9 @@ module.exports = uncurryThis({}.isPrototypeOf); /* eslint-disable es/no-symbol -- required for testing */ var NATIVE_SYMBOL = __webpack_require__(25); -module.exports = NATIVE_SYMBOL - && !Symbol.sham - && typeof Symbol.iterator == 'symbol'; +module.exports = NATIVE_SYMBOL && + !Symbol.sham && + typeof Symbol.iterator == 'symbol'; /***/ }), @@ -611,9 +629,9 @@ module.exports = NATIVE_SYMBOL /* eslint-disable es/no-symbol -- required for testing */ var V8_VERSION = __webpack_require__(26); var fails = __webpack_require__(6); -var global = __webpack_require__(3); +var globalThis = __webpack_require__(3); -var $String = global.String; +var $String = globalThis.String; // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing module.exports = !!Object.getOwnPropertySymbols && !fails(function () { @@ -634,11 +652,11 @@ module.exports = !!Object.getOwnPropertySymbols && !fails(function () { "use strict"; -var global = __webpack_require__(3); +var globalThis = __webpack_require__(3); var userAgent = __webpack_require__(27); -var process = global.process; -var Deno = global.Deno; +var process = globalThis.process; +var Deno = globalThis.Deno; var versions = process && process.versions || Deno && Deno.version; var v8 = versions && versions.v8; var match, version; @@ -669,7 +687,12 @@ module.exports = version; "use strict"; -module.exports = typeof navigator != 'undefined' && String(navigator.userAgent) || ''; +var globalThis = __webpack_require__(3); + +var navigator = globalThis.navigator; +var userAgent = navigator && navigator.userAgent; + +module.exports = userAgent ? String(userAgent) : ''; /***/ }), @@ -753,14 +776,14 @@ module.exports = function (input, pref) { "use strict"; -var global = __webpack_require__(3); +var globalThis = __webpack_require__(3); var shared = __webpack_require__(33); var hasOwn = __webpack_require__(37); var uid = __webpack_require__(39); var NATIVE_SYMBOL = __webpack_require__(25); var USE_SYMBOL_AS_UID = __webpack_require__(24); -var Symbol = global.Symbol; +var Symbol = globalThis.Symbol; var WellKnownSymbolsStore = shared('wks'); var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol['for'] || Symbol : Symbol && Symbol.withoutSetter || uid; @@ -779,18 +802,11 @@ module.exports = function (name) { "use strict"; -var IS_PURE = __webpack_require__(34); -var store = __webpack_require__(35); +var store = __webpack_require__(34); -(module.exports = function (key, value) { - return store[key] || (store[key] = value !== undefined ? value : {}); -})('versions', []).push({ - version: '3.35.1', - mode: IS_PURE ? 'pure' : 'global', - copyright: '© 2014-2024 Denis Pushkarev (zloirock.ru)', - license: 'https://github.com/zloirock/core-js/blob/v3.35.1/LICENSE', - source: 'https://github.com/zloirock/core-js' -}); +module.exports = function (key, value) { + return store[key] || (store[key] = value || {}); +}; /***/ }), @@ -799,7 +815,20 @@ var store = __webpack_require__(35); "use strict"; -module.exports = false; +var IS_PURE = __webpack_require__(35); +var globalThis = __webpack_require__(3); +var defineGlobalProperty = __webpack_require__(36); + +var SHARED = '__core-js_shared__'; +var store = module.exports = globalThis[SHARED] || defineGlobalProperty(SHARED, {}); + +(store.versions || (store.versions = [])).push({ + version: '3.39.0', + mode: IS_PURE ? 'pure' : 'global', + copyright: '© 2014-2024 Denis Pushkarev (zloirock.ru)', + license: 'https://github.com/zloirock/core-js/blob/v3.39.0/LICENSE', + source: 'https://github.com/zloirock/core-js' +}); /***/ }), @@ -808,13 +837,7 @@ module.exports = false; "use strict"; -var global = __webpack_require__(3); -var defineGlobalProperty = __webpack_require__(36); - -var SHARED = '__core-js_shared__'; -var store = global[SHARED] || defineGlobalProperty(SHARED, {}); - -module.exports = store; +module.exports = false; /***/ }), @@ -823,16 +846,16 @@ module.exports = store; "use strict"; -var global = __webpack_require__(3); +var globalThis = __webpack_require__(3); // eslint-disable-next-line es/no-object-defineproperty -- safe var defineProperty = Object.defineProperty; module.exports = function (key, value) { try { - defineProperty(global, key, { value: value, configurable: true, writable: true }); + defineProperty(globalThis, key, { value: value, configurable: true, writable: true }); } catch (error) { - global[key] = value; + globalThis[key] = value; } return value; }; @@ -915,10 +938,10 @@ module.exports = !DESCRIPTORS && !fails(function () { "use strict"; -var global = __webpack_require__(3); +var globalThis = __webpack_require__(3); var isObject = __webpack_require__(19); -var document = global.document; +var document = globalThis.document; // typeof document.createElement is 'object' in old IE var EXISTS = isObject(document) && isObject(document.createElement); @@ -1164,7 +1187,7 @@ module.exports = { var uncurryThis = __webpack_require__(13); var isCallable = __webpack_require__(20); -var store = __webpack_require__(35); +var store = __webpack_require__(34); var functionToString = uncurryThis(Function.toString); @@ -1185,17 +1208,17 @@ module.exports = store.inspectSource; "use strict"; var NATIVE_WEAK_MAP = __webpack_require__(51); -var global = __webpack_require__(3); +var globalThis = __webpack_require__(3); var isObject = __webpack_require__(19); var createNonEnumerableProperty = __webpack_require__(42); var hasOwn = __webpack_require__(37); -var shared = __webpack_require__(35); +var shared = __webpack_require__(34); var sharedKey = __webpack_require__(52); var hiddenKeys = __webpack_require__(53); var OBJECT_ALREADY_INITIALIZED = 'Object already initialized'; -var TypeError = global.TypeError; -var WeakMap = global.WeakMap; +var TypeError = globalThis.TypeError; +var WeakMap = globalThis.WeakMap; var set, get, has; var enforce = function (it) { @@ -1262,10 +1285,10 @@ module.exports = { "use strict"; -var global = __webpack_require__(3); +var globalThis = __webpack_require__(3); var isCallable = __webpack_require__(20); -var WeakMap = global.WeakMap; +var WeakMap = globalThis.WeakMap; module.exports = isCallable(WeakMap) && /native code/.test(String(WeakMap)); @@ -1403,6 +1426,7 @@ var createMethod = function (IS_INCLUDES) { return function ($this, el, fromIndex) { var O = toIndexedObject($this); var length = lengthOfArrayLike(O); + if (length === 0) return !IS_INCLUDES && -1; var index = toAbsoluteIndex(fromIndex, length); var value; // Array#includes uses SameValueZero equality algorithm @@ -1653,7 +1677,8 @@ var NullProtoObjectViaActiveX = function (activeXDocument) { activeXDocument.write(scriptTag('')); activeXDocument.close(); var temp = activeXDocument.parentWindow.Object; - activeXDocument = null; // avoid memory leak + // eslint-disable-next-line no-useless-assignment -- avoid memory leak + activeXDocument = null; return temp; }; @@ -1822,10 +1847,10 @@ module.exports = function (Constructor, list, $length) { "use strict"; -var global = __webpack_require__(3); +var globalThis = __webpack_require__(3); module.exports = function (CONSTRUCTOR, METHOD) { - var Constructor = global[CONSTRUCTOR]; + var Constructor = globalThis[CONSTRUCTOR]; var Prototype = Constructor && Constructor.prototype; return Prototype && Prototype[METHOD]; }; @@ -1949,36 +1974,22 @@ module.exports = function (O, C, index, value) { "use strict"; -var $ = __webpack_require__(2); -var uncurryThis = __webpack_require__(13); -var aCallable = __webpack_require__(29); -var requireObjectCoercible = __webpack_require__(15); -var iterate = __webpack_require__(81); -var MapHelpers = __webpack_require__(91); -var IS_PURE = __webpack_require__(34); +var DESCRIPTORS = __webpack_require__(5); +var defineBuiltInAccessor = __webpack_require__(81); +var isDetached = __webpack_require__(82); -var Map = MapHelpers.Map; -var has = MapHelpers.has; -var get = MapHelpers.get; -var set = MapHelpers.set; -var push = uncurryThis([].push); +var ArrayBufferPrototype = ArrayBuffer.prototype; -// `Map.groupBy` method -// https://github.com/tc39/proposal-array-grouping -$({ target: 'Map', stat: true, forced: IS_PURE }, { - groupBy: function groupBy(items, callbackfn) { - requireObjectCoercible(items); - aCallable(callbackfn); - var map = new Map(); - var k = 0; - iterate(items, function (value) { - var key = callbackfn(value, k++); - if (!has(map, key)) set(map, key, [value]); - else push(get(map, key), value); - }); - return map; - } -}); +// `ArrayBuffer.prototype.detached` getter +// https://tc39.es/ecma262/#sec-get-arraybuffer.prototype.detached +if (DESCRIPTORS && !('detached' in ArrayBufferPrototype)) { + defineBuiltInAccessor(ArrayBufferPrototype, 'detached', { + configurable: true, + get: function detached() { + return isDetached(this); + } + }); +} /***/ }), @@ -1987,16 +1998,833 @@ $({ target: 'Map', stat: true, forced: IS_PURE }, { "use strict"; -var bind = __webpack_require__(82); +var makeBuiltIn = __webpack_require__(47); +var defineProperty = __webpack_require__(43); + +module.exports = function (target, name, descriptor) { + if (descriptor.get) makeBuiltIn(descriptor.get, name, { getter: true }); + if (descriptor.set) makeBuiltIn(descriptor.set, name, { setter: true }); + return defineProperty.f(target, name, descriptor); +}; + + +/***/ }), +/* 82 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var globalThis = __webpack_require__(3); +var uncurryThis = __webpack_require__(83); +var arrayBufferByteLength = __webpack_require__(84); + +var ArrayBuffer = globalThis.ArrayBuffer; +var ArrayBufferPrototype = ArrayBuffer && ArrayBuffer.prototype; +var slice = ArrayBufferPrototype && uncurryThis(ArrayBufferPrototype.slice); + +module.exports = function (O) { + if (arrayBufferByteLength(O) !== 0) return false; + if (!slice) return false; + try { + slice(O, 0, 0); + return false; + } catch (error) { + return true; + } +}; + + +/***/ }), +/* 83 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var classofRaw = __webpack_require__(14); +var uncurryThis = __webpack_require__(13); + +module.exports = function (fn) { + // Nashorn bug: + // https://github.com/zloirock/core-js/issues/1128 + // https://github.com/zloirock/core-js/issues/1130 + if (classofRaw(fn) === 'Function') return uncurryThis(fn); +}; + + +/***/ }), +/* 84 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var globalThis = __webpack_require__(3); +var uncurryThisAccessor = __webpack_require__(85); +var classof = __webpack_require__(14); + +var ArrayBuffer = globalThis.ArrayBuffer; +var TypeError = globalThis.TypeError; + +// Includes +// - Perform ? RequireInternalSlot(O, [[ArrayBufferData]]). +// - If IsSharedArrayBuffer(O) is true, throw a TypeError exception. +module.exports = ArrayBuffer && uncurryThisAccessor(ArrayBuffer.prototype, 'byteLength', 'get') || function (O) { + if (classof(O) !== 'ArrayBuffer') throw new TypeError('ArrayBuffer expected'); + return O.byteLength; +}; + + +/***/ }), +/* 85 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var uncurryThis = __webpack_require__(13); +var aCallable = __webpack_require__(29); + +module.exports = function (object, key, method) { + try { + // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe + return uncurryThis(aCallable(Object.getOwnPropertyDescriptor(object, key)[method])); + } catch (error) { /* empty */ } +}; + + +/***/ }), +/* 86 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $ = __webpack_require__(2); +var $transfer = __webpack_require__(87); + +// `ArrayBuffer.prototype.transfer` method +// https://tc39.es/proposal-arraybuffer-transfer/#sec-arraybuffer.prototype.transfer +if ($transfer) $({ target: 'ArrayBuffer', proto: true }, { + transfer: function transfer() { + return $transfer(this, arguments.length ? arguments[0] : undefined, true); + } +}); + + +/***/ }), +/* 87 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var globalThis = __webpack_require__(3); +var uncurryThis = __webpack_require__(13); +var uncurryThisAccessor = __webpack_require__(85); +var toIndex = __webpack_require__(88); +var notDetached = __webpack_require__(89); +var arrayBufferByteLength = __webpack_require__(84); +var detachTransferable = __webpack_require__(90); +var PROPER_STRUCTURED_CLONE_TRANSFER = __webpack_require__(94); + +var structuredClone = globalThis.structuredClone; +var ArrayBuffer = globalThis.ArrayBuffer; +var DataView = globalThis.DataView; +var min = Math.min; +var ArrayBufferPrototype = ArrayBuffer.prototype; +var DataViewPrototype = DataView.prototype; +var slice = uncurryThis(ArrayBufferPrototype.slice); +var isResizable = uncurryThisAccessor(ArrayBufferPrototype, 'resizable', 'get'); +var maxByteLength = uncurryThisAccessor(ArrayBufferPrototype, 'maxByteLength', 'get'); +var getInt8 = uncurryThis(DataViewPrototype.getInt8); +var setInt8 = uncurryThis(DataViewPrototype.setInt8); + +module.exports = (PROPER_STRUCTURED_CLONE_TRANSFER || detachTransferable) && function (arrayBuffer, newLength, preserveResizability) { + var byteLength = arrayBufferByteLength(arrayBuffer); + var newByteLength = newLength === undefined ? byteLength : toIndex(newLength); + var fixedLength = !isResizable || !isResizable(arrayBuffer); + var newBuffer; + notDetached(arrayBuffer); + if (PROPER_STRUCTURED_CLONE_TRANSFER) { + arrayBuffer = structuredClone(arrayBuffer, { transfer: [arrayBuffer] }); + if (byteLength === newByteLength && (preserveResizability || fixedLength)) return arrayBuffer; + } + if (byteLength >= newByteLength && (!preserveResizability || fixedLength)) { + newBuffer = slice(arrayBuffer, 0, newByteLength); + } else { + var options = preserveResizability && !fixedLength && maxByteLength ? { maxByteLength: maxByteLength(arrayBuffer) } : undefined; + newBuffer = new ArrayBuffer(newByteLength, options); + var a = new DataView(arrayBuffer); + var b = new DataView(newBuffer); + var copyLength = min(newByteLength, byteLength); + for (var i = 0; i < copyLength; i++) setInt8(b, i, getInt8(a, i)); + } + if (!PROPER_STRUCTURED_CLONE_TRANSFER) detachTransferable(arrayBuffer); + return newBuffer; +}; + + +/***/ }), +/* 88 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var toIntegerOrInfinity = __webpack_require__(60); +var toLength = __webpack_require__(63); + +var $RangeError = RangeError; + +// `ToIndex` abstract operation +// https://tc39.es/ecma262/#sec-toindex +module.exports = function (it) { + if (it === undefined) return 0; + var number = toIntegerOrInfinity(it); + var length = toLength(number); + if (number !== length) throw new $RangeError('Wrong length or index'); + return length; +}; + + +/***/ }), +/* 89 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var isDetached = __webpack_require__(82); + +var $TypeError = TypeError; + +module.exports = function (it) { + if (isDetached(it)) throw new $TypeError('ArrayBuffer is detached'); + return it; +}; + + +/***/ }), +/* 90 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var globalThis = __webpack_require__(3); +var getBuiltInNodeModule = __webpack_require__(91); +var PROPER_STRUCTURED_CLONE_TRANSFER = __webpack_require__(94); + +var structuredClone = globalThis.structuredClone; +var $ArrayBuffer = globalThis.ArrayBuffer; +var $MessageChannel = globalThis.MessageChannel; +var detach = false; +var WorkerThreads, channel, buffer, $detach; + +if (PROPER_STRUCTURED_CLONE_TRANSFER) { + detach = function (transferable) { + structuredClone(transferable, { transfer: [transferable] }); + }; +} else if ($ArrayBuffer) try { + if (!$MessageChannel) { + WorkerThreads = getBuiltInNodeModule('worker_threads'); + if (WorkerThreads) $MessageChannel = WorkerThreads.MessageChannel; + } + + if ($MessageChannel) { + channel = new $MessageChannel(); + buffer = new $ArrayBuffer(2); + + $detach = function (transferable) { + channel.port1.postMessage(null, [transferable]); + }; + + if (buffer.byteLength === 2) { + $detach(buffer); + if (buffer.byteLength === 0) detach = $detach; + } + } +} catch (error) { /* empty */ } + +module.exports = detach; + + +/***/ }), +/* 91 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var globalThis = __webpack_require__(3); +var IS_NODE = __webpack_require__(92); + +module.exports = function (name) { + if (IS_NODE) { + try { + return globalThis.process.getBuiltinModule(name); + } catch (error) { /* empty */ } + try { + // eslint-disable-next-line no-new-func -- safe + return Function('return require("' + name + '")')(); + } catch (error) { /* empty */ } + } +}; + + +/***/ }), +/* 92 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var ENVIRONMENT = __webpack_require__(93); + +module.exports = ENVIRONMENT === 'NODE'; + + +/***/ }), +/* 93 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/* global Bun, Deno -- detection */ +var globalThis = __webpack_require__(3); +var userAgent = __webpack_require__(27); +var classof = __webpack_require__(14); + +var userAgentStartsWith = function (string) { + return userAgent.slice(0, string.length) === string; +}; + +module.exports = (function () { + if (userAgentStartsWith('Bun/')) return 'BUN'; + if (userAgentStartsWith('Cloudflare-Workers')) return 'CLOUDFLARE'; + if (userAgentStartsWith('Deno/')) return 'DENO'; + if (userAgentStartsWith('Node.js/')) return 'NODE'; + if (globalThis.Bun && typeof Bun.version == 'string') return 'BUN'; + if (globalThis.Deno && typeof Deno.version == 'object') return 'DENO'; + if (classof(globalThis.process) === 'process') return 'NODE'; + if (globalThis.window && globalThis.document) return 'BROWSER'; + return 'REST'; +})(); + + +/***/ }), +/* 94 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var globalThis = __webpack_require__(3); +var fails = __webpack_require__(6); +var V8 = __webpack_require__(26); +var ENVIRONMENT = __webpack_require__(93); + +var structuredClone = globalThis.structuredClone; + +module.exports = !!structuredClone && !fails(function () { + // prevent V8 ArrayBufferDetaching protector cell invalidation and performance degradation + // https://github.com/zloirock/core-js/issues/679 + if ((ENVIRONMENT === 'DENO' && V8 > 92) || (ENVIRONMENT === 'NODE' && V8 > 94) || (ENVIRONMENT === 'BROWSER' && V8 > 97)) return false; + var buffer = new ArrayBuffer(8); + var clone = structuredClone(buffer, { transfer: [buffer] }); + return buffer.byteLength !== 0 || clone.byteLength !== 8; +}); + + +/***/ }), +/* 95 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $ = __webpack_require__(2); +var $transfer = __webpack_require__(87); + +// `ArrayBuffer.prototype.transferToFixedLength` method +// https://tc39.es/proposal-arraybuffer-transfer/#sec-arraybuffer.prototype.transfertofixedlength +if ($transfer) $({ target: 'ArrayBuffer', proto: true }, { + transferToFixedLength: function transferToFixedLength() { + return $transfer(this, arguments.length ? arguments[0] : undefined, false); + } +}); + + +/***/ }), +/* 96 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $ = __webpack_require__(2); +var globalThis = __webpack_require__(3); +var anInstance = __webpack_require__(97); +var anObject = __webpack_require__(45); +var isCallable = __webpack_require__(20); +var getPrototypeOf = __webpack_require__(98); +var defineBuiltInAccessor = __webpack_require__(81); +var createProperty = __webpack_require__(100); +var fails = __webpack_require__(6); +var hasOwn = __webpack_require__(37); +var wellKnownSymbol = __webpack_require__(32); +var IteratorPrototype = __webpack_require__(101).IteratorPrototype; +var DESCRIPTORS = __webpack_require__(5); +var IS_PURE = __webpack_require__(35); + +var CONSTRUCTOR = 'constructor'; +var ITERATOR = 'Iterator'; +var TO_STRING_TAG = wellKnownSymbol('toStringTag'); + +var $TypeError = TypeError; +var NativeIterator = globalThis[ITERATOR]; + +// FF56- have non-standard global helper `Iterator` +var FORCED = IS_PURE + || !isCallable(NativeIterator) + || NativeIterator.prototype !== IteratorPrototype + // FF44- non-standard `Iterator` passes previous tests + || !fails(function () { NativeIterator({}); }); + +var IteratorConstructor = function Iterator() { + anInstance(this, IteratorPrototype); + if (getPrototypeOf(this) === IteratorPrototype) throw new $TypeError('Abstract class Iterator not directly constructable'); +}; + +var defineIteratorPrototypeAccessor = function (key, value) { + if (DESCRIPTORS) { + defineBuiltInAccessor(IteratorPrototype, key, { + configurable: true, + get: function () { + return value; + }, + set: function (replacement) { + anObject(this); + if (this === IteratorPrototype) throw new $TypeError("You can't redefine this property"); + if (hasOwn(this, key)) this[key] = replacement; + else createProperty(this, key, replacement); + } + }); + } else IteratorPrototype[key] = value; +}; + +if (!hasOwn(IteratorPrototype, TO_STRING_TAG)) defineIteratorPrototypeAccessor(TO_STRING_TAG, ITERATOR); + +if (FORCED || !hasOwn(IteratorPrototype, CONSTRUCTOR) || IteratorPrototype[CONSTRUCTOR] === Object) { + defineIteratorPrototypeAccessor(CONSTRUCTOR, IteratorConstructor); +} + +IteratorConstructor.prototype = IteratorPrototype; + +// `Iterator` constructor +// https://tc39.es/ecma262/#sec-iterator +$({ global: true, constructor: true, forced: FORCED }, { + Iterator: IteratorConstructor +}); + + +/***/ }), +/* 97 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var isPrototypeOf = __webpack_require__(23); + +var $TypeError = TypeError; + +module.exports = function (it, Prototype) { + if (isPrototypeOf(Prototype, it)) return it; + throw new $TypeError('Incorrect invocation'); +}; + + +/***/ }), +/* 98 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var hasOwn = __webpack_require__(37); +var isCallable = __webpack_require__(20); +var toObject = __webpack_require__(38); +var sharedKey = __webpack_require__(52); +var CORRECT_PROTOTYPE_GETTER = __webpack_require__(99); + +var IE_PROTO = sharedKey('IE_PROTO'); +var $Object = Object; +var ObjectPrototype = $Object.prototype; + +// `Object.getPrototypeOf` method +// https://tc39.es/ecma262/#sec-object.getprototypeof +// eslint-disable-next-line es/no-object-getprototypeof -- safe +module.exports = CORRECT_PROTOTYPE_GETTER ? $Object.getPrototypeOf : function (O) { + var object = toObject(O); + if (hasOwn(object, IE_PROTO)) return object[IE_PROTO]; + var constructor = object.constructor; + if (isCallable(constructor) && object instanceof constructor) { + return constructor.prototype; + } return object instanceof $Object ? ObjectPrototype : null; +}; + + +/***/ }), +/* 99 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var fails = __webpack_require__(6); + +module.exports = !fails(function () { + function F() { /* empty */ } + F.prototype.constructor = null; + // eslint-disable-next-line es/no-object-getprototypeof -- required for testing + return Object.getPrototypeOf(new F()) !== F.prototype; +}); + + +/***/ }), +/* 100 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var DESCRIPTORS = __webpack_require__(5); +var definePropertyModule = __webpack_require__(43); +var createPropertyDescriptor = __webpack_require__(10); + +module.exports = function (object, key, value) { + if (DESCRIPTORS) definePropertyModule.f(object, key, createPropertyDescriptor(0, value)); + else object[key] = value; +}; + + +/***/ }), +/* 101 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var fails = __webpack_require__(6); +var isCallable = __webpack_require__(20); +var isObject = __webpack_require__(19); +var create = __webpack_require__(69); +var getPrototypeOf = __webpack_require__(98); +var defineBuiltIn = __webpack_require__(46); +var wellKnownSymbol = __webpack_require__(32); +var IS_PURE = __webpack_require__(35); + +var ITERATOR = wellKnownSymbol('iterator'); +var BUGGY_SAFARI_ITERATORS = false; + +// `%IteratorPrototype%` object +// https://tc39.es/ecma262/#sec-%iteratorprototype%-object +var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator; + +/* eslint-disable es/no-array-prototype-keys -- safe */ +if ([].keys) { + arrayIterator = [].keys(); + // Safari 8 has buggy iterators w/o `next` + if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true; + else { + PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator)); + if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype; + } +} + +var NEW_ITERATOR_PROTOTYPE = !isObject(IteratorPrototype) || fails(function () { + var test = {}; + // FF44- legacy iterators case + return IteratorPrototype[ITERATOR].call(test) !== test; +}); + +if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype = {}; +else if (IS_PURE) IteratorPrototype = create(IteratorPrototype); + +// `%IteratorPrototype%[@@iterator]()` method +// https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator +if (!isCallable(IteratorPrototype[ITERATOR])) { + defineBuiltIn(IteratorPrototype, ITERATOR, function () { + return this; + }); +} + +module.exports = { + IteratorPrototype: IteratorPrototype, + BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS +}; + + +/***/ }), +/* 102 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $ = __webpack_require__(2); +var call = __webpack_require__(7); +var anObject = __webpack_require__(45); +var getIteratorDirect = __webpack_require__(103); +var notANaN = __webpack_require__(104); +var toPositiveInteger = __webpack_require__(105); +var createIteratorProxy = __webpack_require__(106); +var IS_PURE = __webpack_require__(35); + +var IteratorProxy = createIteratorProxy(function () { + var iterator = this.iterator; + var next = this.next; + var result, done; + while (this.remaining) { + this.remaining--; + result = anObject(call(next, iterator)); + done = this.done = !!result.done; + if (done) return; + } + result = anObject(call(next, iterator)); + done = this.done = !!result.done; + if (!done) return result.value; +}); + +// `Iterator.prototype.drop` method +// https://tc39.es/ecma262/#sec-iterator.prototype.drop +$({ target: 'Iterator', proto: true, real: true, forced: IS_PURE }, { + drop: function drop(limit) { + anObject(this); + var remaining = toPositiveInteger(notANaN(+limit)); + return new IteratorProxy(getIteratorDirect(this), { + remaining: remaining + }); + } +}); + + +/***/ }), +/* 103 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// `GetIteratorDirect(obj)` abstract operation +// https://tc39.es/proposal-iterator-helpers/#sec-getiteratordirect +module.exports = function (obj) { + return { + iterator: obj, + next: obj.next, + done: false + }; +}; + + +/***/ }), +/* 104 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $RangeError = RangeError; + +module.exports = function (it) { + // eslint-disable-next-line no-self-compare -- NaN check + if (it === it) return it; + throw new $RangeError('NaN is not allowed'); +}; + + +/***/ }), +/* 105 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var toIntegerOrInfinity = __webpack_require__(60); + +var $RangeError = RangeError; + +module.exports = function (it) { + var result = toIntegerOrInfinity(it); + if (result < 0) throw new $RangeError("The argument can't be less than 0"); + return result; +}; + + +/***/ }), +/* 106 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var call = __webpack_require__(7); +var create = __webpack_require__(69); +var createNonEnumerableProperty = __webpack_require__(42); +var defineBuiltIns = __webpack_require__(107); +var wellKnownSymbol = __webpack_require__(32); +var InternalStateModule = __webpack_require__(50); +var getMethod = __webpack_require__(28); +var IteratorPrototype = __webpack_require__(101).IteratorPrototype; +var createIterResultObject = __webpack_require__(108); +var iteratorClose = __webpack_require__(109); + +var TO_STRING_TAG = wellKnownSymbol('toStringTag'); +var ITERATOR_HELPER = 'IteratorHelper'; +var WRAP_FOR_VALID_ITERATOR = 'WrapForValidIterator'; +var setInternalState = InternalStateModule.set; + +var createIteratorProxyPrototype = function (IS_ITERATOR) { + var getInternalState = InternalStateModule.getterFor(IS_ITERATOR ? WRAP_FOR_VALID_ITERATOR : ITERATOR_HELPER); + + return defineBuiltIns(create(IteratorPrototype), { + next: function next() { + var state = getInternalState(this); + // for simplification: + // for `%WrapForValidIteratorPrototype%.next` our `nextHandler` returns `IterResultObject` + // for `%IteratorHelperPrototype%.next` - just a value + if (IS_ITERATOR) return state.nextHandler(); + try { + var result = state.done ? undefined : state.nextHandler(); + return createIterResultObject(result, state.done); + } catch (error) { + state.done = true; + throw error; + } + }, + 'return': function () { + var state = getInternalState(this); + var iterator = state.iterator; + state.done = true; + if (IS_ITERATOR) { + var returnMethod = getMethod(iterator, 'return'); + return returnMethod ? call(returnMethod, iterator) : createIterResultObject(undefined, true); + } + if (state.inner) try { + iteratorClose(state.inner.iterator, 'normal'); + } catch (error) { + return iteratorClose(iterator, 'throw', error); + } + if (iterator) iteratorClose(iterator, 'normal'); + return createIterResultObject(undefined, true); + } + }); +}; + +var WrapForValidIteratorPrototype = createIteratorProxyPrototype(true); +var IteratorHelperPrototype = createIteratorProxyPrototype(false); + +createNonEnumerableProperty(IteratorHelperPrototype, TO_STRING_TAG, 'Iterator Helper'); + +module.exports = function (nextHandler, IS_ITERATOR) { + var IteratorProxy = function Iterator(record, state) { + if (state) { + state.iterator = record.iterator; + state.next = record.next; + } else state = record; + state.type = IS_ITERATOR ? WRAP_FOR_VALID_ITERATOR : ITERATOR_HELPER; + state.nextHandler = nextHandler; + state.counter = 0; + state.done = false; + setInternalState(this, state); + }; + + IteratorProxy.prototype = IS_ITERATOR ? WrapForValidIteratorPrototype : IteratorHelperPrototype; + + return IteratorProxy; +}; + + +/***/ }), +/* 107 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var defineBuiltIn = __webpack_require__(46); + +module.exports = function (target, src, options) { + for (var key in src) defineBuiltIn(target, key, src[key], options); + return target; +}; + + +/***/ }), +/* 108 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// `CreateIterResultObject` abstract operation +// https://tc39.es/ecma262/#sec-createiterresultobject +module.exports = function (value, done) { + return { value: value, done: done }; +}; + + +/***/ }), +/* 109 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var call = __webpack_require__(7); +var anObject = __webpack_require__(45); +var getMethod = __webpack_require__(28); + +module.exports = function (iterator, kind, value) { + var innerResult, innerError; + anObject(iterator); + try { + innerResult = getMethod(iterator, 'return'); + if (!innerResult) { + if (kind === 'throw') throw value; + return value; + } + innerResult = call(innerResult, iterator); + } catch (error) { + innerError = true; + innerResult = error; + } + if (kind === 'throw') throw value; + if (innerError) throw innerResult; + anObject(innerResult); + return value; +}; + + +/***/ }), +/* 110 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $ = __webpack_require__(2); +var iterate = __webpack_require__(111); +var aCallable = __webpack_require__(29); +var anObject = __webpack_require__(45); +var getIteratorDirect = __webpack_require__(103); + +// `Iterator.prototype.every` method +// https://tc39.es/ecma262/#sec-iterator.prototype.every +$({ target: 'Iterator', proto: true, real: true }, { + every: function every(predicate) { + anObject(this); + aCallable(predicate); + var record = getIteratorDirect(this); + var counter = 0; + return !iterate(record, function (value, stop) { + if (!predicate(value, counter++)) return stop(); + }, { IS_RECORD: true, INTERRUPTED: true }).stopped; + } +}); + + +/***/ }), +/* 111 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var bind = __webpack_require__(112); var call = __webpack_require__(7); var anObject = __webpack_require__(45); var tryToString = __webpack_require__(30); -var isArrayIteratorMethod = __webpack_require__(84); +var isArrayIteratorMethod = __webpack_require__(113); var lengthOfArrayLike = __webpack_require__(62); var isPrototypeOf = __webpack_require__(23); -var getIterator = __webpack_require__(86); -var getIteratorMethod = __webpack_require__(87); -var iteratorClose = __webpack_require__(90); +var getIterator = __webpack_require__(115); +var getIteratorMethod = __webpack_require__(116); +var iteratorClose = __webpack_require__(109); var $TypeError = TypeError; @@ -2058,7 +2886,7 @@ module.exports = function (iterable, unboundFunction, options) { /***/ }), -/* 82 */ +/* 112 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2079,30 +2907,13 @@ module.exports = function (fn, that) { /***/ }), -/* 83 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var classofRaw = __webpack_require__(14); -var uncurryThis = __webpack_require__(13); - -module.exports = function (fn) { - // Nashorn bug: - // https://github.com/zloirock/core-js/issues/1128 - // https://github.com/zloirock/core-js/issues/1130 - if (classofRaw(fn) === 'Function') return uncurryThis(fn); -}; - - -/***/ }), -/* 84 */ +/* 113 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var wellKnownSymbol = __webpack_require__(32); -var Iterators = __webpack_require__(85); +var Iterators = __webpack_require__(114); var ITERATOR = wellKnownSymbol('iterator'); var ArrayPrototype = Array.prototype; @@ -2114,7 +2925,7 @@ module.exports = function (it) { /***/ }), -/* 85 */ +/* 114 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2123,7 +2934,7 @@ module.exports = {}; /***/ }), -/* 86 */ +/* 115 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2132,7 +2943,7 @@ var call = __webpack_require__(7); var aCallable = __webpack_require__(29); var anObject = __webpack_require__(45); var tryToString = __webpack_require__(30); -var getIteratorMethod = __webpack_require__(87); +var getIteratorMethod = __webpack_require__(116); var $TypeError = TypeError; @@ -2144,15 +2955,15 @@ module.exports = function (argument, usingIterator) { /***/ }), -/* 87 */ +/* 116 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var classof = __webpack_require__(88); +var classof = __webpack_require__(117); var getMethod = __webpack_require__(28); var isNullOrUndefined = __webpack_require__(16); -var Iterators = __webpack_require__(85); +var Iterators = __webpack_require__(114); var wellKnownSymbol = __webpack_require__(32); var ITERATOR = wellKnownSymbol('iterator'); @@ -2165,12 +2976,12 @@ module.exports = function (it) { /***/ }), -/* 88 */ +/* 117 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var TO_STRING_TAG_SUPPORT = __webpack_require__(89); +var TO_STRING_TAG_SUPPORT = __webpack_require__(118); var isCallable = __webpack_require__(20); var classofRaw = __webpack_require__(14); var wellKnownSymbol = __webpack_require__(32); @@ -2202,7 +3013,7 @@ module.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) { /***/ }), -/* 89 */ +/* 118 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2218,38 +3029,446 @@ module.exports = String(test) === '[object z]'; /***/ }), -/* 90 */ +/* 119 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $ = __webpack_require__(2); +var call = __webpack_require__(7); +var aCallable = __webpack_require__(29); +var anObject = __webpack_require__(45); +var getIteratorDirect = __webpack_require__(103); +var createIteratorProxy = __webpack_require__(106); +var callWithSafeIterationClosing = __webpack_require__(120); +var IS_PURE = __webpack_require__(35); + +var IteratorProxy = createIteratorProxy(function () { + var iterator = this.iterator; + var predicate = this.predicate; + var next = this.next; + var result, done, value; + while (true) { + result = anObject(call(next, iterator)); + done = this.done = !!result.done; + if (done) return; + value = result.value; + if (callWithSafeIterationClosing(iterator, predicate, [value, this.counter++], true)) return value; + } +}); + +// `Iterator.prototype.filter` method +// https://tc39.es/ecma262/#sec-iterator.prototype.filter +$({ target: 'Iterator', proto: true, real: true, forced: IS_PURE }, { + filter: function filter(predicate) { + anObject(this); + aCallable(predicate); + return new IteratorProxy(getIteratorDirect(this), { + predicate: predicate + }); + } +}); + + +/***/ }), +/* 120 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var anObject = __webpack_require__(45); +var iteratorClose = __webpack_require__(109); + +// call something on iterator step with safe closing on error +module.exports = function (iterator, fn, value, ENTRIES) { + try { + return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value); + } catch (error) { + iteratorClose(iterator, 'throw', error); + } +}; + + +/***/ }), +/* 121 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $ = __webpack_require__(2); +var iterate = __webpack_require__(111); +var aCallable = __webpack_require__(29); +var anObject = __webpack_require__(45); +var getIteratorDirect = __webpack_require__(103); + +// `Iterator.prototype.find` method +// https://tc39.es/ecma262/#sec-iterator.prototype.find +$({ target: 'Iterator', proto: true, real: true }, { + find: function find(predicate) { + anObject(this); + aCallable(predicate); + var record = getIteratorDirect(this); + var counter = 0; + return iterate(record, function (value, stop) { + if (predicate(value, counter++)) return stop(value); + }, { IS_RECORD: true, INTERRUPTED: true }).result; + } +}); + + +/***/ }), +/* 122 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $ = __webpack_require__(2); +var call = __webpack_require__(7); +var aCallable = __webpack_require__(29); +var anObject = __webpack_require__(45); +var getIteratorDirect = __webpack_require__(103); +var getIteratorFlattenable = __webpack_require__(123); +var createIteratorProxy = __webpack_require__(106); +var iteratorClose = __webpack_require__(109); +var IS_PURE = __webpack_require__(35); + +var IteratorProxy = createIteratorProxy(function () { + var iterator = this.iterator; + var mapper = this.mapper; + var result, inner; + + while (true) { + if (inner = this.inner) try { + result = anObject(call(inner.next, inner.iterator)); + if (!result.done) return result.value; + this.inner = null; + } catch (error) { iteratorClose(iterator, 'throw', error); } + + result = anObject(call(this.next, iterator)); + + if (this.done = !!result.done) return; + + try { + this.inner = getIteratorFlattenable(mapper(result.value, this.counter++), false); + } catch (error) { iteratorClose(iterator, 'throw', error); } + } +}); + +// `Iterator.prototype.flatMap` method +// https://tc39.es/ecma262/#sec-iterator.prototype.flatmap +$({ target: 'Iterator', proto: true, real: true, forced: IS_PURE }, { + flatMap: function flatMap(mapper) { + anObject(this); + aCallable(mapper); + return new IteratorProxy(getIteratorDirect(this), { + mapper: mapper, + inner: null + }); + } +}); + + +/***/ }), +/* 123 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var call = __webpack_require__(7); var anObject = __webpack_require__(45); -var getMethod = __webpack_require__(28); +var getIteratorDirect = __webpack_require__(103); +var getIteratorMethod = __webpack_require__(116); -module.exports = function (iterator, kind, value) { - var innerResult, innerError; - anObject(iterator); - try { - innerResult = getMethod(iterator, 'return'); - if (!innerResult) { - if (kind === 'throw') throw value; - return value; - } - innerResult = call(innerResult, iterator); - } catch (error) { - innerError = true; - innerResult = error; - } - if (kind === 'throw') throw value; - if (innerError) throw innerResult; - anObject(innerResult); - return value; +module.exports = function (obj, stringHandling) { + if (!stringHandling || typeof obj !== 'string') anObject(obj); + var method = getIteratorMethod(obj); + return getIteratorDirect(anObject(method !== undefined ? call(method, obj) : obj)); }; /***/ }), -/* 91 */ +/* 124 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $ = __webpack_require__(2); +var iterate = __webpack_require__(111); +var aCallable = __webpack_require__(29); +var anObject = __webpack_require__(45); +var getIteratorDirect = __webpack_require__(103); + +// `Iterator.prototype.forEach` method +// https://tc39.es/ecma262/#sec-iterator.prototype.foreach +$({ target: 'Iterator', proto: true, real: true }, { + forEach: function forEach(fn) { + anObject(this); + aCallable(fn); + var record = getIteratorDirect(this); + var counter = 0; + iterate(record, function (value) { + fn(value, counter++); + }, { IS_RECORD: true }); + } +}); + + +/***/ }), +/* 125 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $ = __webpack_require__(2); +var call = __webpack_require__(7); +var toObject = __webpack_require__(38); +var isPrototypeOf = __webpack_require__(23); +var IteratorPrototype = __webpack_require__(101).IteratorPrototype; +var createIteratorProxy = __webpack_require__(106); +var getIteratorFlattenable = __webpack_require__(123); +var IS_PURE = __webpack_require__(35); + +var IteratorProxy = createIteratorProxy(function () { + return call(this.next, this.iterator); +}, true); + +// `Iterator.from` method +// https://tc39.es/ecma262/#sec-iterator.from +$({ target: 'Iterator', stat: true, forced: IS_PURE }, { + from: function from(O) { + var iteratorRecord = getIteratorFlattenable(typeof O == 'string' ? toObject(O) : O, true); + return isPrototypeOf(IteratorPrototype, iteratorRecord.iterator) + ? iteratorRecord.iterator + : new IteratorProxy(iteratorRecord); + } +}); + + +/***/ }), +/* 126 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $ = __webpack_require__(2); +var map = __webpack_require__(127); +var IS_PURE = __webpack_require__(35); + +// `Iterator.prototype.map` method +// https://tc39.es/ecma262/#sec-iterator.prototype.map +$({ target: 'Iterator', proto: true, real: true, forced: IS_PURE }, { + map: map +}); + + +/***/ }), +/* 127 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var call = __webpack_require__(7); +var aCallable = __webpack_require__(29); +var anObject = __webpack_require__(45); +var getIteratorDirect = __webpack_require__(103); +var createIteratorProxy = __webpack_require__(106); +var callWithSafeIterationClosing = __webpack_require__(120); + +var IteratorProxy = createIteratorProxy(function () { + var iterator = this.iterator; + var result = anObject(call(this.next, iterator)); + var done = this.done = !!result.done; + if (!done) return callWithSafeIterationClosing(iterator, this.mapper, [result.value, this.counter++], true); +}); + +// `Iterator.prototype.map` method +// https://github.com/tc39/proposal-iterator-helpers +module.exports = function map(mapper) { + anObject(this); + aCallable(mapper); + return new IteratorProxy(getIteratorDirect(this), { + mapper: mapper + }); +}; + + +/***/ }), +/* 128 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $ = __webpack_require__(2); +var iterate = __webpack_require__(111); +var aCallable = __webpack_require__(29); +var anObject = __webpack_require__(45); +var getIteratorDirect = __webpack_require__(103); + +var $TypeError = TypeError; + +// `Iterator.prototype.reduce` method +// https://tc39.es/ecma262/#sec-iterator.prototype.reduce +$({ target: 'Iterator', proto: true, real: true }, { + reduce: function reduce(reducer /* , initialValue */) { + anObject(this); + aCallable(reducer); + var record = getIteratorDirect(this); + var noInitial = arguments.length < 2; + var accumulator = noInitial ? undefined : arguments[1]; + var counter = 0; + iterate(record, function (value) { + if (noInitial) { + noInitial = false; + accumulator = value; + } else { + accumulator = reducer(accumulator, value, counter); + } + counter++; + }, { IS_RECORD: true }); + if (noInitial) throw new $TypeError('Reduce of empty iterator with no initial value'); + return accumulator; + } +}); + + +/***/ }), +/* 129 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $ = __webpack_require__(2); +var iterate = __webpack_require__(111); +var aCallable = __webpack_require__(29); +var anObject = __webpack_require__(45); +var getIteratorDirect = __webpack_require__(103); + +// `Iterator.prototype.some` method +// https://tc39.es/ecma262/#sec-iterator.prototype.some +$({ target: 'Iterator', proto: true, real: true }, { + some: function some(predicate) { + anObject(this); + aCallable(predicate); + var record = getIteratorDirect(this); + var counter = 0; + return iterate(record, function (value, stop) { + if (predicate(value, counter++)) return stop(); + }, { IS_RECORD: true, INTERRUPTED: true }).stopped; + } +}); + + +/***/ }), +/* 130 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $ = __webpack_require__(2); +var call = __webpack_require__(7); +var anObject = __webpack_require__(45); +var getIteratorDirect = __webpack_require__(103); +var notANaN = __webpack_require__(104); +var toPositiveInteger = __webpack_require__(105); +var createIteratorProxy = __webpack_require__(106); +var iteratorClose = __webpack_require__(109); +var IS_PURE = __webpack_require__(35); + +var IteratorProxy = createIteratorProxy(function () { + var iterator = this.iterator; + if (!this.remaining--) { + this.done = true; + return iteratorClose(iterator, 'normal', undefined); + } + var result = anObject(call(this.next, iterator)); + var done = this.done = !!result.done; + if (!done) return result.value; +}); + +// `Iterator.prototype.take` method +// https://tc39.es/ecma262/#sec-iterator.prototype.take +$({ target: 'Iterator', proto: true, real: true, forced: IS_PURE }, { + take: function take(limit) { + anObject(this); + var remaining = toPositiveInteger(notANaN(+limit)); + return new IteratorProxy(getIteratorDirect(this), { + remaining: remaining + }); + } +}); + + +/***/ }), +/* 131 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $ = __webpack_require__(2); +var anObject = __webpack_require__(45); +var iterate = __webpack_require__(111); +var getIteratorDirect = __webpack_require__(103); + +var push = [].push; + +// `Iterator.prototype.toArray` method +// https://tc39.es/ecma262/#sec-iterator.prototype.toarray +$({ target: 'Iterator', proto: true, real: true }, { + toArray: function toArray() { + var result = []; + iterate(getIteratorDirect(anObject(this)), push, { that: result, IS_RECORD: true }); + return result; + } +}); + + +/***/ }), +/* 132 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $ = __webpack_require__(2); +var uncurryThis = __webpack_require__(13); +var aCallable = __webpack_require__(29); +var requireObjectCoercible = __webpack_require__(15); +var iterate = __webpack_require__(111); +var MapHelpers = __webpack_require__(133); +var IS_PURE = __webpack_require__(35); +var fails = __webpack_require__(6); + +var Map = MapHelpers.Map; +var has = MapHelpers.has; +var get = MapHelpers.get; +var set = MapHelpers.set; +var push = uncurryThis([].push); + +var DOES_NOT_WORK_WITH_PRIMITIVES = IS_PURE || fails(function () { + return Map.groupBy('ab', function (it) { + return it; + }).get('a').length !== 1; +}); + +// `Map.groupBy` method +// https://tc39.es/ecma262/#sec-map.groupby +$({ target: 'Map', stat: true, forced: IS_PURE || DOES_NOT_WORK_WITH_PRIMITIVES }, { + groupBy: function groupBy(items, callbackfn) { + requireObjectCoercible(items); + aCallable(callbackfn); + var map = new Map(); + var k = 0; + iterate(items, function (value) { + var key = callbackfn(value, k++); + if (!has(map, key)) set(map, key, [value]); + else push(get(map, key), value); + }); + return map; + } +}); + + +/***/ }), +/* 133 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2271,7 +3490,7 @@ module.exports = { /***/ }), -/* 92 */ +/* 134 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2282,14 +3501,23 @@ var uncurryThis = __webpack_require__(13); var aCallable = __webpack_require__(29); var requireObjectCoercible = __webpack_require__(15); var toPropertyKey = __webpack_require__(17); -var iterate = __webpack_require__(81); +var iterate = __webpack_require__(111); +var fails = __webpack_require__(6); +// eslint-disable-next-line es/no-object-groupby -- testing +var nativeGroupBy = Object.groupBy; var create = getBuiltIn('Object', 'create'); var push = uncurryThis([].push); +var DOES_NOT_WORK_WITH_PRIMITIVES = !nativeGroupBy || fails(function () { + return nativeGroupBy('ab', function (it) { + return it; + }).a.length !== 1; +}); + // `Object.groupBy` method -// https://github.com/tc39/proposal-array-grouping -$({ target: 'Object', stat: true }, { +// https://tc39.es/ecma262/#sec-object.groupby +$({ target: 'Object', stat: true, forced: DOES_NOT_WORK_WITH_PRIMITIVES }, { groupBy: function groupBy(items, callbackfn) { requireObjectCoercible(items); aCallable(callbackfn); @@ -2308,30 +3536,76 @@ $({ target: 'Object', stat: true }, { /***/ }), -/* 93 */ +/* 135 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(2); -var newPromiseCapabilityModule = __webpack_require__(94); +var globalThis = __webpack_require__(3); +var apply = __webpack_require__(136); +var slice = __webpack_require__(137); +var newPromiseCapabilityModule = __webpack_require__(138); +var aCallable = __webpack_require__(29); +var perform = __webpack_require__(139); -// `Promise.withResolvers` method -// https://github.com/tc39/proposal-promise-with-resolvers -$({ target: 'Promise', stat: true }, { - withResolvers: function withResolvers() { +var Promise = globalThis.Promise; + +var ACCEPT_ARGUMENTS = false; +// Avoiding the use of polyfills of the previous iteration of this proposal +// that does not accept arguments of the callback +var FORCED = !Promise || !Promise['try'] || perform(function () { + Promise['try'](function (argument) { + ACCEPT_ARGUMENTS = argument === 8; + }, 8); +}).error || !ACCEPT_ARGUMENTS; + +// `Promise.try` method +// https://tc39.es/ecma262/#sec-promise.try +$({ target: 'Promise', stat: true, forced: FORCED }, { + 'try': function (callbackfn /* , ...args */) { + var args = arguments.length > 1 ? slice(arguments, 1) : []; var promiseCapability = newPromiseCapabilityModule.f(this); - return { - promise: promiseCapability.promise, - resolve: promiseCapability.resolve, - reject: promiseCapability.reject - }; + var result = perform(function () { + return apply(aCallable(callbackfn), undefined, args); + }); + (result.error ? promiseCapability.reject : promiseCapability.resolve)(result.value); + return promiseCapability.promise; } }); /***/ }), -/* 94 */ +/* 136 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var NATIVE_BIND = __webpack_require__(8); + +var FunctionPrototype = Function.prototype; +var apply = FunctionPrototype.apply; +var call = FunctionPrototype.call; + +// eslint-disable-next-line es/no-reflect -- safe +module.exports = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND ? call.bind(apply) : function () { + return call.apply(apply, arguments); +}); + + +/***/ }), +/* 137 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var uncurryThis = __webpack_require__(13); + +module.exports = uncurryThis([].slice); + + +/***/ }), +/* 138 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2359,19 +3633,57 @@ module.exports.f = function (C) { /***/ }), -/* 95 */ +/* 139 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var global = __webpack_require__(3); +module.exports = function (exec) { + try { + return { error: false, value: exec() }; + } catch (error) { + return { error: true, value: error }; + } +}; + + +/***/ }), +/* 140 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $ = __webpack_require__(2); +var newPromiseCapabilityModule = __webpack_require__(138); + +// `Promise.withResolvers` method +// https://tc39.es/ecma262/#sec-promise.withResolvers +$({ target: 'Promise', stat: true }, { + withResolvers: function withResolvers() { + var promiseCapability = newPromiseCapabilityModule.f(this); + return { + promise: promiseCapability.promise, + resolve: promiseCapability.resolve, + reject: promiseCapability.reject + }; + } +}); + + +/***/ }), +/* 141 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var globalThis = __webpack_require__(3); var DESCRIPTORS = __webpack_require__(5); -var defineBuiltInAccessor = __webpack_require__(96); -var regExpFlags = __webpack_require__(97); +var defineBuiltInAccessor = __webpack_require__(81); +var regExpFlags = __webpack_require__(142); var fails = __webpack_require__(6); // babel-minify and Closure Compiler transpiles RegExp('.', 'd') -> /./d and it causes SyntaxError -var RegExp = global.RegExp; +var RegExp = globalThis.RegExp; var RegExpPrototype = RegExp.prototype; var FORCED = DESCRIPTORS && fails(function () { @@ -2422,23 +3734,7 @@ if (FORCED) defineBuiltInAccessor(RegExpPrototype, 'flags', { /***/ }), -/* 96 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var makeBuiltIn = __webpack_require__(47); -var defineProperty = __webpack_require__(43); - -module.exports = function (target, name, descriptor) { - if (descriptor.get) makeBuiltIn(descriptor.get, name, { getter: true }); - if (descriptor.set) makeBuiltIn(descriptor.set, name, { setter: true }); - return defineProperty.f(target, name, descriptor); -}; - - -/***/ }), -/* 97 */ +/* 142 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2463,7 +3759,7 @@ module.exports = function () { /***/ }), -/* 98 */ +/* 143 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2471,12 +3767,12 @@ module.exports = function () { var $ = __webpack_require__(2); var uncurryThis = __webpack_require__(13); var requireObjectCoercible = __webpack_require__(15); -var toString = __webpack_require__(99); +var toString = __webpack_require__(144); var charCodeAt = uncurryThis(''.charCodeAt); // `String.prototype.isWellFormed` method -// https://github.com/tc39/proposal-is-usv-string +// https://tc39.es/ecma262/#sec-string.prototype.iswellformed $({ target: 'String', proto: true }, { isWellFormed: function isWellFormed() { var S = toString(requireObjectCoercible(this)); @@ -2493,12 +3789,12 @@ $({ target: 'String', proto: true }, { /***/ }), -/* 99 */ +/* 144 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var classof = __webpack_require__(88); +var classof = __webpack_require__(117); var $String = String; @@ -2509,7 +3805,7 @@ module.exports = function (argument) { /***/ }), -/* 100 */ +/* 145 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2518,14 +3814,14 @@ var $ = __webpack_require__(2); var call = __webpack_require__(7); var uncurryThis = __webpack_require__(13); var requireObjectCoercible = __webpack_require__(15); -var toString = __webpack_require__(99); +var toString = __webpack_require__(144); var fails = __webpack_require__(6); var $Array = Array; var charAt = uncurryThis(''.charAt); var charCodeAt = uncurryThis(''.charCodeAt); var join = uncurryThis([].join); -// eslint-disable-next-line es/no-string-prototype-iswellformed-towellformed -- safe +// eslint-disable-next-line es/no-string-prototype-towellformed -- safe var $toWellFormed = ''.toWellFormed; var REPLACEMENT_CHARACTER = '\uFFFD'; @@ -2535,7 +3831,7 @@ var TO_STRING_CONVERSION_BUG = $toWellFormed && fails(function () { }); // `String.prototype.toWellFormed` method -// https://github.com/tc39/proposal-is-usv-string +// https://tc39.es/ecma262/#sec-string.prototype.towellformed $({ target: 'String', proto: true, forced: TO_STRING_CONVERSION_BUG }, { toWellFormed: function toWellFormed() { var S = toString(requireObjectCoercible(this)); @@ -2559,13 +3855,13 @@ $({ target: 'String', proto: true, forced: TO_STRING_CONVERSION_BUG }, { /***/ }), -/* 101 */ +/* 146 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var arrayToReversed = __webpack_require__(67); -var ArrayBufferViewCore = __webpack_require__(102); +var ArrayBufferViewCore = __webpack_require__(147); var aTypedArray = ArrayBufferViewCore.aTypedArray; var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; @@ -2579,45 +3875,45 @@ exportTypedArrayMethod('toReversed', function toReversed() { /***/ }), -/* 102 */ +/* 147 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var NATIVE_ARRAY_BUFFER = __webpack_require__(103); +var NATIVE_ARRAY_BUFFER = __webpack_require__(148); var DESCRIPTORS = __webpack_require__(5); -var global = __webpack_require__(3); +var globalThis = __webpack_require__(3); var isCallable = __webpack_require__(20); var isObject = __webpack_require__(19); var hasOwn = __webpack_require__(37); -var classof = __webpack_require__(88); +var classof = __webpack_require__(117); var tryToString = __webpack_require__(30); var createNonEnumerableProperty = __webpack_require__(42); var defineBuiltIn = __webpack_require__(46); -var defineBuiltInAccessor = __webpack_require__(96); +var defineBuiltInAccessor = __webpack_require__(81); var isPrototypeOf = __webpack_require__(23); -var getPrototypeOf = __webpack_require__(104); -var setPrototypeOf = __webpack_require__(106); +var getPrototypeOf = __webpack_require__(98); +var setPrototypeOf = __webpack_require__(149); var wellKnownSymbol = __webpack_require__(32); var uid = __webpack_require__(39); var InternalStateModule = __webpack_require__(50); var enforceInternalState = InternalStateModule.enforce; var getInternalState = InternalStateModule.get; -var Int8Array = global.Int8Array; +var Int8Array = globalThis.Int8Array; var Int8ArrayPrototype = Int8Array && Int8Array.prototype; -var Uint8ClampedArray = global.Uint8ClampedArray; +var Uint8ClampedArray = globalThis.Uint8ClampedArray; var Uint8ClampedArrayPrototype = Uint8ClampedArray && Uint8ClampedArray.prototype; var TypedArray = Int8Array && getPrototypeOf(Int8Array); var TypedArrayPrototype = Int8ArrayPrototype && getPrototypeOf(Int8ArrayPrototype); var ObjectPrototype = Object.prototype; -var TypeError = global.TypeError; +var TypeError = globalThis.TypeError; var TO_STRING_TAG = wellKnownSymbol('toStringTag'); var TYPED_ARRAY_TAG = uid('TYPED_ARRAY_TAG'); var TYPED_ARRAY_CONSTRUCTOR = 'TypedArrayConstructor'; // Fixing native typed arrays in Opera Presto crashes the browser, see #595 -var NATIVE_ARRAY_BUFFER_VIEWS = NATIVE_ARRAY_BUFFER && !!setPrototypeOf && classof(global.opera) !== 'Opera'; +var NATIVE_ARRAY_BUFFER_VIEWS = NATIVE_ARRAY_BUFFER && !!setPrototypeOf && classof(globalThis.opera) !== 'Opera'; var TYPED_ARRAY_TAG_REQUIRED = false; var NAME, Constructor, Prototype; @@ -2673,7 +3969,7 @@ var aTypedArrayConstructor = function (C) { var exportTypedArrayMethod = function (KEY, property, forced, options) { if (!DESCRIPTORS) return; if (forced) for (var ARRAY in TypedArrayConstructorsList) { - var TypedArrayConstructor = global[ARRAY]; + var TypedArrayConstructor = globalThis[ARRAY]; if (TypedArrayConstructor && hasOwn(TypedArrayConstructor.prototype, KEY)) try { delete TypedArrayConstructor.prototype[KEY]; } catch (error) { @@ -2694,7 +3990,7 @@ var exportTypedArrayStaticMethod = function (KEY, property, forced) { if (!DESCRIPTORS) return; if (setPrototypeOf) { if (forced) for (ARRAY in TypedArrayConstructorsList) { - TypedArrayConstructor = global[ARRAY]; + TypedArrayConstructor = globalThis[ARRAY]; if (TypedArrayConstructor && hasOwn(TypedArrayConstructor, KEY)) try { delete TypedArrayConstructor[KEY]; } catch (error) { /* empty */ } @@ -2707,7 +4003,7 @@ var exportTypedArrayStaticMethod = function (KEY, property, forced) { } else return; } for (ARRAY in TypedArrayConstructorsList) { - TypedArrayConstructor = global[ARRAY]; + TypedArrayConstructor = globalThis[ARRAY]; if (TypedArrayConstructor && (!TypedArrayConstructor[KEY] || forced)) { defineBuiltIn(TypedArrayConstructor, KEY, property); } @@ -2715,14 +4011,14 @@ var exportTypedArrayStaticMethod = function (KEY, property, forced) { }; for (NAME in TypedArrayConstructorsList) { - Constructor = global[NAME]; + Constructor = globalThis[NAME]; Prototype = Constructor && Constructor.prototype; if (Prototype) enforceInternalState(Prototype)[TYPED_ARRAY_CONSTRUCTOR] = Constructor; else NATIVE_ARRAY_BUFFER_VIEWS = false; } for (NAME in BigIntArrayConstructorsList) { - Constructor = global[NAME]; + Constructor = globalThis[NAME]; Prototype = Constructor && Constructor.prototype; if (Prototype) enforceInternalState(Prototype)[TYPED_ARRAY_CONSTRUCTOR] = Constructor; } @@ -2734,14 +4030,14 @@ if (!NATIVE_ARRAY_BUFFER_VIEWS || !isCallable(TypedArray) || TypedArray === Func throw new TypeError('Incorrect invocation'); }; if (NATIVE_ARRAY_BUFFER_VIEWS) for (NAME in TypedArrayConstructorsList) { - if (global[NAME]) setPrototypeOf(global[NAME], TypedArray); + if (globalThis[NAME]) setPrototypeOf(globalThis[NAME], TypedArray); } } if (!NATIVE_ARRAY_BUFFER_VIEWS || !TypedArrayPrototype || TypedArrayPrototype === ObjectPrototype) { TypedArrayPrototype = TypedArray.prototype; if (NATIVE_ARRAY_BUFFER_VIEWS) for (NAME in TypedArrayConstructorsList) { - if (global[NAME]) setPrototypeOf(global[NAME].prototype, TypedArrayPrototype); + if (globalThis[NAME]) setPrototypeOf(globalThis[NAME].prototype, TypedArrayPrototype); } } @@ -2758,8 +4054,8 @@ if (DESCRIPTORS && !hasOwn(TypedArrayPrototype, TO_STRING_TAG)) { return isObject(this) ? this[TYPED_ARRAY_TAG] : undefined; } }); - for (NAME in TypedArrayConstructorsList) if (global[NAME]) { - createNonEnumerableProperty(global[NAME], TYPED_ARRAY_TAG, NAME); + for (NAME in TypedArrayConstructorsList) if (globalThis[NAME]) { + createNonEnumerableProperty(globalThis[NAME], TYPED_ARRAY_TAG, NAME); } } @@ -2779,7 +4075,7 @@ module.exports = { /***/ }), -/* 103 */ +/* 148 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2789,60 +4085,16 @@ module.exports = typeof ArrayBuffer != 'undefined' && typeof DataView != 'undefi /***/ }), -/* 104 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var hasOwn = __webpack_require__(37); -var isCallable = __webpack_require__(20); -var toObject = __webpack_require__(38); -var sharedKey = __webpack_require__(52); -var CORRECT_PROTOTYPE_GETTER = __webpack_require__(105); - -var IE_PROTO = sharedKey('IE_PROTO'); -var $Object = Object; -var ObjectPrototype = $Object.prototype; - -// `Object.getPrototypeOf` method -// https://tc39.es/ecma262/#sec-object.getprototypeof -// eslint-disable-next-line es/no-object-getprototypeof -- safe -module.exports = CORRECT_PROTOTYPE_GETTER ? $Object.getPrototypeOf : function (O) { - var object = toObject(O); - if (hasOwn(object, IE_PROTO)) return object[IE_PROTO]; - var constructor = object.constructor; - if (isCallable(constructor) && object instanceof constructor) { - return constructor.prototype; - } return object instanceof $Object ? ObjectPrototype : null; -}; - - -/***/ }), -/* 105 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var fails = __webpack_require__(6); - -module.exports = !fails(function () { - function F() { /* empty */ } - F.prototype.constructor = null; - // eslint-disable-next-line es/no-object-getprototypeof -- required for testing - return Object.getPrototypeOf(new F()) !== F.prototype; -}); - - -/***/ }), -/* 106 */ +/* 149 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* eslint-disable no-proto -- safe */ -var uncurryThisAccessor = __webpack_require__(107); -var anObject = __webpack_require__(45); -var aPossiblePrototype = __webpack_require__(108); +var uncurryThisAccessor = __webpack_require__(85); +var isObject = __webpack_require__(19); +var requireObjectCoercible = __webpack_require__(15); +var aPossiblePrototype = __webpack_require__(150); // `Object.setPrototypeOf` method // https://tc39.es/ecma262/#sec-object.setprototypeof @@ -2858,8 +4110,9 @@ module.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () { CORRECT_SETTER = test instanceof Array; } catch (error) { /* empty */ } return function setPrototypeOf(O, proto) { - anObject(O); + requireObjectCoercible(O); aPossiblePrototype(proto); + if (!isObject(O)) return O; if (CORRECT_SETTER) setter(O, proto); else O.__proto__ = proto; return O; @@ -2868,29 +4121,12 @@ module.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () { /***/ }), -/* 107 */ +/* 150 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var uncurryThis = __webpack_require__(13); -var aCallable = __webpack_require__(29); - -module.exports = function (object, key, method) { - try { - // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe - return uncurryThis(aCallable(Object.getOwnPropertyDescriptor(object, key)[method])); - } catch (error) { /* empty */ } -}; - - -/***/ }), -/* 108 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var isPossiblePrototype = __webpack_require__(109); +var isPossiblePrototype = __webpack_require__(151); var $String = String; var $TypeError = TypeError; @@ -2902,7 +4138,7 @@ module.exports = function (argument) { /***/ }), -/* 109 */ +/* 151 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2915,12 +4151,12 @@ module.exports = function (argument) { /***/ }), -/* 110 */ +/* 152 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var ArrayBufferViewCore = __webpack_require__(102); +var ArrayBufferViewCore = __webpack_require__(147); var uncurryThis = __webpack_require__(13); var aCallable = __webpack_require__(29); var arrayFromConstructorAndList = __webpack_require__(74); @@ -2941,16 +4177,16 @@ exportTypedArrayMethod('toSorted', function toSorted(compareFn) { /***/ }), -/* 111 */ +/* 153 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var arrayWith = __webpack_require__(79); -var ArrayBufferViewCore = __webpack_require__(102); -var isBigIntArray = __webpack_require__(112); +var ArrayBufferViewCore = __webpack_require__(147); +var isBigIntArray = __webpack_require__(154); var toIntegerOrInfinity = __webpack_require__(60); -var toBigInt = __webpack_require__(113); +var toBigInt = __webpack_require__(155); var aTypedArray = ArrayBufferViewCore.aTypedArray; var getTypedArrayConstructor = ArrayBufferViewCore.getTypedArrayConstructor; @@ -2978,12 +4214,12 @@ exportTypedArrayMethod('with', { 'with': function (index, value) { /***/ }), -/* 112 */ +/* 154 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var classof = __webpack_require__(88); +var classof = __webpack_require__(117); module.exports = function (it) { var klass = classof(it); @@ -2992,7 +4228,7 @@ module.exports = function (it) { /***/ }), -/* 113 */ +/* 155 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -3012,24 +4248,24 @@ module.exports = function (argument) { /***/ }), -/* 114 */ +/* 156 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(2); -var global = __webpack_require__(3); +var globalThis = __webpack_require__(3); var getBuiltIn = __webpack_require__(22); var createPropertyDescriptor = __webpack_require__(10); var defineProperty = __webpack_require__(43).f; var hasOwn = __webpack_require__(37); -var anInstance = __webpack_require__(115); -var inheritIfRequired = __webpack_require__(116); -var normalizeStringArgument = __webpack_require__(117); -var DOMExceptionConstants = __webpack_require__(118); -var clearErrorStack = __webpack_require__(119); +var anInstance = __webpack_require__(97); +var inheritIfRequired = __webpack_require__(157); +var normalizeStringArgument = __webpack_require__(158); +var DOMExceptionConstants = __webpack_require__(159); +var clearErrorStack = __webpack_require__(160); var DESCRIPTORS = __webpack_require__(5); -var IS_PURE = __webpack_require__(34); +var IS_PURE = __webpack_require__(35); var DOM_EXCEPTION = 'DOMException'; var Error = getBuiltIn('Error'); @@ -3054,7 +4290,7 @@ var ERROR_HAS_STACK = 'stack' in new Error(DOM_EXCEPTION); var DOM_EXCEPTION_HAS_STACK = 'stack' in new NativeDOMException(1, 2); // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe -var descriptor = NativeDOMException && DESCRIPTORS && Object.getOwnPropertyDescriptor(global, DOM_EXCEPTION); +var descriptor = NativeDOMException && DESCRIPTORS && Object.getOwnPropertyDescriptor(globalThis, DOM_EXCEPTION); // Bun ~ 0.1.1 DOMException have incorrect descriptor and we can't redefine it // https://github.com/Jarred-Sumner/bun/issues/399 @@ -3087,30 +4323,14 @@ if (PolyfilledDOMExceptionPrototype.constructor !== PolyfilledDOMException) { /***/ }), -/* 115 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var isPrototypeOf = __webpack_require__(23); - -var $TypeError = TypeError; - -module.exports = function (it, Prototype) { - if (isPrototypeOf(Prototype, it)) return it; - throw new $TypeError('Incorrect invocation'); -}; - - -/***/ }), -/* 116 */ +/* 157 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var isCallable = __webpack_require__(20); var isObject = __webpack_require__(19); -var setPrototypeOf = __webpack_require__(106); +var setPrototypeOf = __webpack_require__(149); // makes subclassing work correct for wrapped built-ins module.exports = function ($this, dummy, Wrapper) { @@ -3129,12 +4349,12 @@ module.exports = function ($this, dummy, Wrapper) { /***/ }), -/* 117 */ +/* 158 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var toString = __webpack_require__(99); +var toString = __webpack_require__(144); module.exports = function (argument, $default) { return argument === undefined ? arguments.length < 2 ? '' : $default : toString(argument); @@ -3142,7 +4362,7 @@ module.exports = function (argument, $default) { /***/ }), -/* 118 */ +/* 159 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -3177,7 +4397,7 @@ module.exports = { /***/ }), -/* 119 */ +/* 160 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -3188,7 +4408,7 @@ var $Error = Error; var replace = uncurryThis(''.replace); var TEST = (function (arg) { return String(new $Error(arg).stack); })('zxcasd'); -// eslint-disable-next-line redos/no-vulnerable -- safe +// eslint-disable-next-line redos/no-vulnerable, sonarjs/slow-regex -- safe var V8_OR_CHAKRA_STACK_ENTRY = /\n\s*at [^:]*:[^\n]*/; var IS_V8_OR_CHAKRA_STACK = V8_OR_CHAKRA_STACK_ENTRY.test(TEST); @@ -3200,45 +4420,45 @@ module.exports = function (stack, dropEntries) { /***/ }), -/* 120 */ +/* 161 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var IS_PURE = __webpack_require__(34); +var IS_PURE = __webpack_require__(35); var $ = __webpack_require__(2); -var global = __webpack_require__(3); +var globalThis = __webpack_require__(3); var getBuiltIn = __webpack_require__(22); var uncurryThis = __webpack_require__(13); var fails = __webpack_require__(6); var uid = __webpack_require__(39); var isCallable = __webpack_require__(20); -var isConstructor = __webpack_require__(121); +var isConstructor = __webpack_require__(162); var isNullOrUndefined = __webpack_require__(16); var isObject = __webpack_require__(19); var isSymbol = __webpack_require__(21); -var iterate = __webpack_require__(81); +var iterate = __webpack_require__(111); var anObject = __webpack_require__(45); -var classof = __webpack_require__(88); +var classof = __webpack_require__(117); var hasOwn = __webpack_require__(37); -var createProperty = __webpack_require__(122); +var createProperty = __webpack_require__(100); var createNonEnumerableProperty = __webpack_require__(42); var lengthOfArrayLike = __webpack_require__(62); -var validateArgumentsLength = __webpack_require__(123); -var getRegExpFlags = __webpack_require__(124); -var MapHelpers = __webpack_require__(91); -var SetHelpers = __webpack_require__(125); -var setIterate = __webpack_require__(126); -var detachTransferable = __webpack_require__(128); -var ERROR_STACK_INSTALLABLE = __webpack_require__(134); -var PROPER_STRUCTURED_CLONE_TRANSFER = __webpack_require__(131); +var validateArgumentsLength = __webpack_require__(163); +var getRegExpFlags = __webpack_require__(164); +var MapHelpers = __webpack_require__(133); +var SetHelpers = __webpack_require__(165); +var setIterate = __webpack_require__(166); +var detachTransferable = __webpack_require__(90); +var ERROR_STACK_INSTALLABLE = __webpack_require__(168); +var PROPER_STRUCTURED_CLONE_TRANSFER = __webpack_require__(94); -var Object = global.Object; -var Array = global.Array; -var Date = global.Date; -var Error = global.Error; -var TypeError = global.TypeError; -var PerformanceMark = global.PerformanceMark; +var Object = globalThis.Object; +var Array = globalThis.Array; +var Date = globalThis.Date; +var Error = globalThis.Error; +var TypeError = globalThis.TypeError; +var PerformanceMark = globalThis.PerformanceMark; var DOMException = getBuiltIn('DOMException'); var Map = MapHelpers.Map; var mapHas = MapHelpers.has; @@ -3259,7 +4479,7 @@ var TRANSFERRING = 'Transferring'; var checkBasicSemantic = function (structuredCloneImplementation) { return !fails(function () { - var set1 = new global.Set([7]); + var set1 = new globalThis.Set([7]); var set2 = structuredCloneImplementation(set1); var number = structuredCloneImplementation(Object(7)); return set2 === set1 || !set2.has(7) || !isObject(number) || +number !== 7; @@ -3277,7 +4497,7 @@ var checkErrorsCloning = function (structuredCloneImplementation, $Error) { // https://github.com/whatwg/html/pull/5749 var checkNewErrorsCloningSemantic = function (structuredCloneImplementation) { return !fails(function () { - var test = structuredCloneImplementation(new global.AggregateError([1], PERFORMANCE_MARK, { cause: 3 })); + var test = structuredCloneImplementation(new globalThis.AggregateError([1], PERFORMANCE_MARK, { cause: 3 })); return test.name !== 'AggregateError' || test.errors[0] !== 1 || test.message !== PERFORMANCE_MARK || test.cause !== 3; }); }; @@ -3294,7 +4514,7 @@ var checkNewErrorsCloningSemantic = function (structuredCloneImplementation) { // NodeJS implementation can't clone DOMExceptions // https://github.com/nodejs/node/issues/41038 // only FF103+ supports new (html/5749) error cloning semantic -var nativeStructuredClone = global.structuredClone; +var nativeStructuredClone = globalThis.structuredClone; var FORCED_REPLACEMENT = IS_PURE || !checkErrorsCloning(nativeStructuredClone, Error) @@ -3334,10 +4554,10 @@ var tryNativeRestrictedStructuredClone = function (value, type) { var createDataTransfer = function () { var dataTransfer; try { - dataTransfer = new global.DataTransfer(); + dataTransfer = new globalThis.DataTransfer(); } catch (error) { try { - dataTransfer = new global.ClipboardEvent('').clipboardData; + dataTransfer = new globalThis.ClipboardEvent('').clipboardData; } catch (error2) { /* empty */ } } return dataTransfer && dataTransfer.items && dataTransfer.files ? dataTransfer : null; @@ -3354,7 +4574,7 @@ var cloneBuffer = function (value, map, $type) { // SharedArrayBuffer should use shared memory, we can't polyfill it, so return the original else clone = value; } else { - var DataView = global.DataView; + var DataView = globalThis.DataView; // `ArrayBuffer#slice` is not available in IE10 // `ArrayBuffer#slice` and `DataView` are not available in old FF @@ -3385,7 +4605,7 @@ var cloneBuffer = function (value, map, $type) { }; var cloneView = function (value, type, offset, length, map) { - var C = global[type]; + var C = globalThis[type]; // in some old engines like Safari 9, typeof C is 'object' // on Uint8ClampedArray or some other constructors if (!isObject(C)) throwUnpolyfillable(type); @@ -3540,7 +4760,7 @@ var structuredCloneInternal = function (value, map) { } break; case 'DOMPoint': case 'DOMPointReadOnly': - C = global[type]; + C = globalThis[type]; try { cloned = C.fromPoint ? C.fromPoint(value) @@ -3550,7 +4770,7 @@ var structuredCloneInternal = function (value, map) { } break; case 'DOMRect': case 'DOMRectReadOnly': - C = global[type]; + C = globalThis[type]; try { cloned = C.fromRect ? C.fromRect(value) @@ -3560,7 +4780,7 @@ var structuredCloneInternal = function (value, map) { } break; case 'DOMMatrix': case 'DOMMatrixReadOnly': - C = global[type]; + C = globalThis[type]; try { cloned = C.fromMatrix ? C.fromMatrix(value) @@ -3665,7 +4885,7 @@ var tryToTransfer = function (rawTransfer, map) { transferred = nativeStructuredClone(value, { transfer: [value] }); } else switch (type) { case 'ImageBitmap': - C = global.OffscreenCanvas; + C = globalThis.OffscreenCanvas; if (!isConstructor(C)) throwUnpolyfillable(type, TRANSFERRING); try { canvas = new C(value.width, value.height); @@ -3684,9 +4904,13 @@ var tryToTransfer = function (rawTransfer, map) { break; case 'MediaSourceHandle': case 'MessagePort': + case 'MIDIAccess': case 'OffscreenCanvas': case 'ReadableStream': + case 'RTCDataChannel': case 'TransformStream': + case 'WebTransportReceiveStream': + case 'WebTransportSendStream': case 'WritableStream': throwUnpolyfillable(type, TRANSFERRING); } @@ -3738,7 +4962,7 @@ $({ global: true, enumerable: true, sham: !PROPER_STRUCTURED_CLONE_TRANSFER, for /***/ }), -/* 121 */ +/* 162 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -3746,7 +4970,7 @@ $({ global: true, enumerable: true, sham: !PROPER_STRUCTURED_CLONE_TRANSFER, for var uncurryThis = __webpack_require__(13); var fails = __webpack_require__(6); var isCallable = __webpack_require__(20); -var classof = __webpack_require__(88); +var classof = __webpack_require__(117); var getBuiltIn = __webpack_require__(22); var inspectSource = __webpack_require__(49); @@ -3797,24 +5021,7 @@ module.exports = !construct || fails(function () { /***/ }), -/* 122 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var toPropertyKey = __webpack_require__(17); -var definePropertyModule = __webpack_require__(43); -var createPropertyDescriptor = __webpack_require__(10); - -module.exports = function (object, key, value) { - var propertyKey = toPropertyKey(key); - if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value)); - else object[propertyKey] = value; -}; - - -/***/ }), -/* 123 */ +/* 163 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -3828,7 +5035,7 @@ module.exports = function (passed, required) { /***/ }), -/* 124 */ +/* 164 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -3836,7 +5043,7 @@ module.exports = function (passed, required) { var call = __webpack_require__(7); var hasOwn = __webpack_require__(37); var isPrototypeOf = __webpack_require__(23); -var regExpFlags = __webpack_require__(97); +var regExpFlags = __webpack_require__(142); var RegExpPrototype = RegExp.prototype; @@ -3848,7 +5055,7 @@ module.exports = function (R) { /***/ }), -/* 125 */ +/* 165 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -3869,14 +5076,14 @@ module.exports = { /***/ }), -/* 126 */ +/* 166 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var uncurryThis = __webpack_require__(13); -var iterateSimple = __webpack_require__(127); -var SetHelpers = __webpack_require__(125); +var iterateSimple = __webpack_require__(167); +var SetHelpers = __webpack_require__(165); var Set = SetHelpers.Set; var SetPrototype = SetHelpers.proto; @@ -3890,7 +5097,7 @@ module.exports = function (set, fn, interruptible) { /***/ }), -/* 127 */ +/* 167 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -3909,128 +5116,7 @@ module.exports = function (record, fn, ITERATOR_INSTEAD_OF_RECORD) { /***/ }), -/* 128 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var global = __webpack_require__(3); -var tryNodeRequire = __webpack_require__(129); -var PROPER_STRUCTURED_CLONE_TRANSFER = __webpack_require__(131); - -var structuredClone = global.structuredClone; -var $ArrayBuffer = global.ArrayBuffer; -var $MessageChannel = global.MessageChannel; -var detach = false; -var WorkerThreads, channel, buffer, $detach; - -if (PROPER_STRUCTURED_CLONE_TRANSFER) { - detach = function (transferable) { - structuredClone(transferable, { transfer: [transferable] }); - }; -} else if ($ArrayBuffer) try { - if (!$MessageChannel) { - WorkerThreads = tryNodeRequire('worker_threads'); - if (WorkerThreads) $MessageChannel = WorkerThreads.MessageChannel; - } - - if ($MessageChannel) { - channel = new $MessageChannel(); - buffer = new $ArrayBuffer(2); - - $detach = function (transferable) { - channel.port1.postMessage(null, [transferable]); - }; - - if (buffer.byteLength === 2) { - $detach(buffer); - if (buffer.byteLength === 0) detach = $detach; - } - } -} catch (error) { /* empty */ } - -module.exports = detach; - - -/***/ }), -/* 129 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var IS_NODE = __webpack_require__(130); - -module.exports = function (name) { - try { - // eslint-disable-next-line no-new-func -- safe - if (IS_NODE) return Function('return require("' + name + '")')(); - } catch (error) { /* empty */ } -}; - - -/***/ }), -/* 130 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var global = __webpack_require__(3); -var classof = __webpack_require__(14); - -module.exports = classof(global.process) === 'process'; - - -/***/ }), -/* 131 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var global = __webpack_require__(3); -var fails = __webpack_require__(6); -var V8 = __webpack_require__(26); -var IS_BROWSER = __webpack_require__(132); -var IS_DENO = __webpack_require__(133); -var IS_NODE = __webpack_require__(130); - -var structuredClone = global.structuredClone; - -module.exports = !!structuredClone && !fails(function () { - // prevent V8 ArrayBufferDetaching protector cell invalidation and performance degradation - // https://github.com/zloirock/core-js/issues/679 - if ((IS_DENO && V8 > 92) || (IS_NODE && V8 > 94) || (IS_BROWSER && V8 > 97)) return false; - var buffer = new ArrayBuffer(8); - var clone = structuredClone(buffer, { transfer: [buffer] }); - return buffer.byteLength !== 0 || clone.byteLength !== 8; -}); - - -/***/ }), -/* 132 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var IS_DENO = __webpack_require__(133); -var IS_NODE = __webpack_require__(130); - -module.exports = !IS_DENO && !IS_NODE - && typeof window == 'object' - && typeof document == 'object'; - - -/***/ }), -/* 133 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -/* global Deno -- Deno case */ -module.exports = typeof Deno == 'object' && Deno && typeof Deno.version == 'object'; - - -/***/ }), -/* 134 */ +/* 168 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -4048,7 +5134,7 @@ module.exports = !fails(function () { /***/ }), -/* 135 */ +/* 169 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -4056,9 +5142,9 @@ module.exports = !fails(function () { var $ = __webpack_require__(2); var getBuiltIn = __webpack_require__(22); var fails = __webpack_require__(6); -var validateArgumentsLength = __webpack_require__(123); -var toString = __webpack_require__(99); -var USE_NATIVE_URL = __webpack_require__(136); +var validateArgumentsLength = __webpack_require__(163); +var toString = __webpack_require__(144); +var USE_NATIVE_URL = __webpack_require__(170); var URL = getBuiltIn('URL'); @@ -4068,9 +5154,15 @@ var THROWS_WITHOUT_ARGUMENTS = USE_NATIVE_URL && fails(function () { URL.canParse(); }); +// Bun ~ 1.0.30 bug +// https://github.com/oven-sh/bun/issues/9250 +var WRONG_ARITY = fails(function () { + return URL.canParse.length !== 1; +}); + // `URL.canParse` method // https://url.spec.whatwg.org/#dom-url-canparse -$({ target: 'URL', stat: true, forced: !THROWS_WITHOUT_ARGUMENTS }, { +$({ target: 'URL', stat: true, forced: !THROWS_WITHOUT_ARGUMENTS || WRONG_ARITY }, { canParse: function canParse(url) { var length = validateArgumentsLength(arguments.length, 1); var urlString = toString(url); @@ -4085,7 +5177,7 @@ $({ target: 'URL', stat: true, forced: !THROWS_WITHOUT_ARGUMENTS }, { /***/ }), -/* 136 */ +/* 170 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -4093,13 +5185,13 @@ $({ target: 'URL', stat: true, forced: !THROWS_WITHOUT_ARGUMENTS }, { var fails = __webpack_require__(6); var wellKnownSymbol = __webpack_require__(32); var DESCRIPTORS = __webpack_require__(5); -var IS_PURE = __webpack_require__(34); +var IS_PURE = __webpack_require__(35); var ITERATOR = wellKnownSymbol('iterator'); module.exports = !fails(function () { // eslint-disable-next-line unicorn/relative-url-style -- required for testing - var url = new URL('b?a=1&b=2&c=3', 'http://a'); + var url = new URL('b?a=1&b=2&c=3', 'https://a'); var params = url.searchParams; var params2 = new URLSearchParams('a=1&a=2&b=3'); var result = ''; @@ -4115,7 +5207,7 @@ module.exports = !fails(function () { return (IS_PURE && (!url.toJSON || !params2.has('a', 1) || params2.has('a', 2) || !params2.has('a', undefined) || params2.has('b'))) || (!params.size && (IS_PURE || !DESCRIPTORS)) || !params.sort - || url.href !== 'http://a/c%20d?a=1&c=3' + || url.href !== 'https://a/c%20d?a=1&c=3' || params.get('c') !== '3' || String(new URLSearchParams('?a=1')) !== 'a=1' || !params[ITERATOR] @@ -4123,26 +5215,56 @@ module.exports = !fails(function () { || new URL('https://a@b').username !== 'a' || new URLSearchParams(new URLSearchParams('a=b')).get('a') !== 'b' // not punycoded in Edge - || new URL('http://тест').host !== 'xn--e1aybc' + || new URL('https://тест').host !== 'xn--e1aybc' // not escaped in Chrome 62- - || new URL('http://a#б').hash !== '#%D0%B1' + || new URL('https://a#б').hash !== '#%D0%B1' // fails in Chrome 66- || result !== 'a1c3' // throws in Safari - || new URL('http://x', undefined).host !== 'x'; + || new URL('https://x', undefined).host !== 'x'; }); /***/ }), -/* 137 */ +/* 171 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $ = __webpack_require__(2); +var getBuiltIn = __webpack_require__(22); +var validateArgumentsLength = __webpack_require__(163); +var toString = __webpack_require__(144); +var USE_NATIVE_URL = __webpack_require__(170); + +var URL = getBuiltIn('URL'); + +// `URL.parse` method +// https://url.spec.whatwg.org/#dom-url-canparse +$({ target: 'URL', stat: true, forced: !USE_NATIVE_URL }, { + parse: function parse(url) { + var length = validateArgumentsLength(arguments.length, 1); + var urlString = toString(url); + var base = length < 2 || arguments[1] === undefined ? undefined : toString(arguments[1]); + try { + return new URL(urlString, base); + } catch (error) { + return null; + } + } +}); + + +/***/ }), +/* 172 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var defineBuiltIn = __webpack_require__(46); var uncurryThis = __webpack_require__(13); -var toString = __webpack_require__(99); -var validateArgumentsLength = __webpack_require__(123); +var toString = __webpack_require__(144); +var validateArgumentsLength = __webpack_require__(163); var $URLSearchParams = URLSearchParams; var URLSearchParamsPrototype = $URLSearchParams.prototype; @@ -4190,15 +5312,15 @@ if (params + '' !== 'a=2') { /***/ }), -/* 138 */ +/* 173 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var defineBuiltIn = __webpack_require__(46); var uncurryThis = __webpack_require__(13); -var toString = __webpack_require__(99); -var validateArgumentsLength = __webpack_require__(123); +var toString = __webpack_require__(144); +var validateArgumentsLength = __webpack_require__(163); var $URLSearchParams = URLSearchParams; var URLSearchParamsPrototype = $URLSearchParams.prototype; @@ -4225,14 +5347,14 @@ if (params.has('a', 2) || !params.has('a', undefined)) { /***/ }), -/* 139 */ +/* 174 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var DESCRIPTORS = __webpack_require__(5); var uncurryThis = __webpack_require__(13); -var defineBuiltInAccessor = __webpack_require__(96); +var defineBuiltInAccessor = __webpack_require__(81); var URLSearchParamsPrototype = URLSearchParams.prototype; var forEach = uncurryThis(URLSearchParamsPrototype.forEach); diff --git a/wp-includes/js/dist/vendor/wp-polyfill.min.js b/wp-includes/js/dist/vendor/wp-polyfill.min.js index 0bed05b2a5..0dfea32c97 100644 --- a/wp-includes/js/dist/vendor/wp-polyfill.min.js +++ b/wp-includes/js/dist/vendor/wp-polyfill.min.js @@ -1 +1 @@ -!function(r){"use strict";var t,e,n;t=[function(r,t,e){e(1),e(73),e(76),e(78),e(80),e(92),e(93),e(95),e(98),e(100),e(101),e(110),e(111),e(114),e(120),e(135),e(137),e(138),r.exports=e(139)},function(r,t,e){var n=e(2),o=e(67),a=e(11),i=e(68),c=Array;n({target:"Array",proto:!0},{toReversed:function(){return o(a(this),c)}}),i("toReversed")},function(t,e,n){var o=n(3),a=n(4).f,i=n(42),c=n(46),u=n(36),f=n(54),s=n(66);t.exports=function(t,e){var n,p,l,y,v,h=t.target,g=t.global,d=t.stat;if(n=g?o:d?o[h]||u(h,{}):o[h]&&o[h].prototype)for(p in e){if(y=e[p],l=t.dontCallGetSet?(v=a(n,p))&&v.value:n[p],!s(g?p:h+(d?".":"#")+p,t.forced)&&l!==r){if(typeof y==typeof l)continue;f(y,l)}(t.sham||l&&l.sham)&&i(y,"sham",!0),c(n,p,y,t)}}},function(r,t,e){var n=function(r){return r&&r.Math===Math&&r};r.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof global&&global)||n("object"==typeof this&&this)||function(){return this}()||Function("return this")()},function(r,t,e){var n=e(5),o=e(7),a=e(9),i=e(10),c=e(11),u=e(17),f=e(37),s=e(40),p=Object.getOwnPropertyDescriptor;t.f=n?p:function(r,t){if(r=c(r),t=u(t),s)try{return p(r,t)}catch(r){}if(f(r,t))return i(!o(a.f,r,t),r[t])}},function(r,t,e){var n=e(6);r.exports=!n((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))},function(r,t,e){r.exports=function(r){try{return!!r()}catch(r){return!0}}},function(r,t,e){var n=e(8),o=Function.prototype.call;r.exports=n?o.bind(o):function(){return o.apply(o,arguments)}},function(r,t,e){var n=e(6);r.exports=!n((function(){var r=function(){}.bind();return"function"!=typeof r||r.hasOwnProperty("prototype")}))},function(r,t,e){var n={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,a=o&&!n.call({1:2},1);t.f=a?function(r){var t=o(this,r);return!!t&&t.enumerable}:n},function(r,t,e){r.exports=function(r,t){return{enumerable:!(1&r),configurable:!(2&r),writable:!(4&r),value:t}}},function(r,t,e){var n=e(12),o=e(15);r.exports=function(r){return n(o(r))}},function(r,t,e){var n=e(13),o=e(6),a=e(14),i=Object,c=n("".split);r.exports=o((function(){return!i("z").propertyIsEnumerable(0)}))?function(r){return"String"===a(r)?c(r,""):i(r)}:i},function(r,t,e){var n=e(8),o=Function.prototype,a=o.call,i=n&&o.bind.bind(a,a);r.exports=n?i:function(r){return function(){return a.apply(r,arguments)}}},function(r,t,e){var n=e(13),o=n({}.toString),a=n("".slice);r.exports=function(r){return a(o(r),8,-1)}},function(r,t,e){var n=e(16),o=TypeError;r.exports=function(r){if(n(r))throw new o("Can't call method on "+r);return r}},function(t,e,n){t.exports=function(t){return null===t||t===r}},function(r,t,e){var n=e(18),o=e(21);r.exports=function(r){var t=n(r,"string");return o(t)?t:t+""}},function(t,e,n){var o=n(7),a=n(19),i=n(21),c=n(28),u=n(31),f=n(32),s=TypeError,p=f("toPrimitive");t.exports=function(t,e){if(!a(t)||i(t))return t;var n,f=c(t,p);if(f){if(e===r&&(e="default"),n=o(f,t,e),!a(n)||i(n))return n;throw new s("Can't convert object to primitive value")}return e===r&&(e="number"),u(t,e)}},function(r,t,e){var n=e(20);r.exports=function(r){return"object"==typeof r?null!==r:n(r)}},function(t,e,n){var o="object"==typeof document&&document.all;t.exports=void 0===o&&o!==r?function(r){return"function"==typeof r||r===o}:function(r){return"function"==typeof r}},function(r,t,e){var n=e(22),o=e(20),a=e(23),i=e(24),c=Object;r.exports=i?function(r){return"symbol"==typeof r}:function(r){var t=n("Symbol");return o(t)&&a(t.prototype,c(r))}},function(t,e,n){var o=n(3),a=n(20);t.exports=function(t,e){return arguments.length<2?(n=o[t],a(n)?n:r):o[t]&&o[t][e];var n}},function(r,t,e){var n=e(13);r.exports=n({}.isPrototypeOf)},function(r,t,e){var n=e(25);r.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},function(r,t,e){var n=e(26),o=e(6),a=e(3).String;r.exports=!!Object.getOwnPropertySymbols&&!o((function(){var r=Symbol("symbol detection");return!a(r)||!(Object(r)instanceof Symbol)||!Symbol.sham&&n&&n<41}))},function(r,t,e){var n,o,a=e(3),i=e(27),c=a.process,u=a.Deno,f=c&&c.versions||u&&u.version,s=f&&f.v8;s&&(o=(n=s.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!o&&i&&(!(n=i.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=i.match(/Chrome\/(\d+)/))&&(o=+n[1]),r.exports=o},function(r,t,e){r.exports="undefined"!=typeof navigator&&String(navigator.userAgent)||""},function(t,e,n){var o=n(29),a=n(16);t.exports=function(t,e){var n=t[e];return a(n)?r:o(n)}},function(r,t,e){var n=e(20),o=e(30),a=TypeError;r.exports=function(r){if(n(r))return r;throw new a(o(r)+" is not a function")}},function(r,t,e){var n=String;r.exports=function(r){try{return n(r)}catch(r){return"Object"}}},function(r,t,e){var n=e(7),o=e(20),a=e(19),i=TypeError;r.exports=function(r,t){var e,c;if("string"===t&&o(e=r.toString)&&!a(c=n(e,r)))return c;if(o(e=r.valueOf)&&!a(c=n(e,r)))return c;if("string"!==t&&o(e=r.toString)&&!a(c=n(e,r)))return c;throw new i("Can't convert object to primitive value")}},function(r,t,e){var n=e(3),o=e(33),a=e(37),i=e(39),c=e(25),u=e(24),f=n.Symbol,s=o("wks"),p=u?f.for||f:f&&f.withoutSetter||i;r.exports=function(r){return a(s,r)||(s[r]=c&&a(f,r)?f[r]:p("Symbol."+r)),s[r]}},function(t,e,n){var o=n(34),a=n(35);(t.exports=function(t,e){return a[t]||(a[t]=e!==r?e:{})})("versions",[]).push({version:"3.35.1",mode:o?"pure":"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.35.1/LICENSE",source:"https://github.com/zloirock/core-js"})},function(r,t,e){r.exports=!1},function(r,t,e){var n=e(3),o=e(36),a="__core-js_shared__",i=n[a]||o(a,{});r.exports=i},function(r,t,e){var n=e(3),o=Object.defineProperty;r.exports=function(r,t){try{o(n,r,{value:t,configurable:!0,writable:!0})}catch(e){n[r]=t}return t}},function(r,t,e){var n=e(13),o=e(38),a=n({}.hasOwnProperty);r.exports=Object.hasOwn||function(r,t){return a(o(r),t)}},function(r,t,e){var n=e(15),o=Object;r.exports=function(r){return o(n(r))}},function(t,e,n){var o=n(13),a=0,i=Math.random(),c=o(1..toString);t.exports=function(t){return"Symbol("+(t===r?"":t)+")_"+c(++a+i,36)}},function(r,t,e){var n=e(5),o=e(6),a=e(41);r.exports=!n&&!o((function(){return 7!==Object.defineProperty(a("div"),"a",{get:function(){return 7}}).a}))},function(r,t,e){var n=e(3),o=e(19),a=n.document,i=o(a)&&o(a.createElement);r.exports=function(r){return i?a.createElement(r):{}}},function(r,t,e){var n=e(5),o=e(43),a=e(10);r.exports=n?function(r,t,e){return o.f(r,t,a(1,e))}:function(r,t,e){return r[t]=e,r}},function(r,t,e){var n=e(5),o=e(40),a=e(44),i=e(45),c=e(17),u=TypeError,f=Object.defineProperty,s=Object.getOwnPropertyDescriptor,p="enumerable",l="configurable",y="writable";t.f=n?a?function(r,t,e){if(i(r),t=c(t),i(e),"function"==typeof r&&"prototype"===t&&"value"in e&&y in e&&!e[y]){var n=s(r,t);n&&n[y]&&(r[t]=e.value,e={configurable:l in e?e[l]:n[l],enumerable:p in e?e[p]:n[p],writable:!1})}return f(r,t,e)}:f:function(r,t,e){if(i(r),t=c(t),i(e),o)try{return f(r,t,e)}catch(r){}if("get"in e||"set"in e)throw new u("Accessors not supported");return"value"in e&&(r[t]=e.value),r}},function(r,t,e){var n=e(5),o=e(6);r.exports=n&&o((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},function(r,t,e){var n=e(19),o=String,a=TypeError;r.exports=function(r){if(n(r))return r;throw new a(o(r)+" is not an object")}},function(t,e,n){var o=n(20),a=n(43),i=n(47),c=n(36);t.exports=function(t,e,n,u){u||(u={});var f=u.enumerable,s=u.name!==r?u.name:e;if(o(n)&&i(n,s,u),u.global)f?t[e]=n:c(e,n);else{try{u.unsafe?t[e]&&(f=!0):delete t[e]}catch(r){}f?t[e]=n:a.f(t,e,{value:n,enumerable:!1,configurable:!u.nonConfigurable,writable:!u.nonWritable})}return t}},function(t,e,n){var o=n(13),a=n(6),i=n(20),c=n(37),u=n(5),f=n(48).CONFIGURABLE,s=n(49),p=n(50),l=p.enforce,y=p.get,v=String,h=Object.defineProperty,g=o("".slice),d=o("".replace),b=o([].join),m=u&&!a((function(){return 8!==h((function(){}),"length",{value:8}).length})),w=String(String).split("String"),x=t.exports=function(t,e,n){"Symbol("===g(v(e),0,7)&&(e="["+d(v(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),n&&n.getter&&(e="get "+e),n&&n.setter&&(e="set "+e),(!c(t,"name")||f&&t.name!==e)&&(u?h(t,"name",{value:e,configurable:!0}):t.name=e),m&&n&&c(n,"arity")&&t.length!==n.arity&&h(t,"length",{value:n.arity});try{n&&c(n,"constructor")&&n.constructor?u&&h(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=r)}catch(r){}var o=l(t);return c(o,"source")||(o.source=b(w,"string"==typeof e?e:"")),t};Function.prototype.toString=x((function(){return i(this)&&y(this).source||s(this)}),"toString")},function(r,t,e){var n=e(5),o=e(37),a=Function.prototype,i=n&&Object.getOwnPropertyDescriptor,c=o(a,"name"),u=c&&"something"===function(){}.name,f=c&&(!n||n&&i(a,"name").configurable);r.exports={EXISTS:c,PROPER:u,CONFIGURABLE:f}},function(r,t,e){var n=e(13),o=e(20),a=e(35),i=n(Function.toString);o(a.inspectSource)||(a.inspectSource=function(r){return i(r)}),r.exports=a.inspectSource},function(r,t,e){var n,o,a,i=e(51),c=e(3),u=e(19),f=e(42),s=e(37),p=e(35),l=e(52),y=e(53),v="Object already initialized",h=c.TypeError,g=c.WeakMap;if(i||p.state){var d=p.state||(p.state=new g);d.get=d.get,d.has=d.has,d.set=d.set,n=function(r,t){if(d.has(r))throw new h(v);return t.facade=r,d.set(r,t),t},o=function(r){return d.get(r)||{}},a=function(r){return d.has(r)}}else{var b=l("state");y[b]=!0,n=function(r,t){if(s(r,b))throw new h(v);return t.facade=r,f(r,b,t),t},o=function(r){return s(r,b)?r[b]:{}},a=function(r){return s(r,b)}}r.exports={set:n,get:o,has:a,enforce:function(r){return a(r)?o(r):n(r,{})},getterFor:function(r){return function(t){var e;if(!u(t)||(e=o(t)).type!==r)throw new h("Incompatible receiver, "+r+" required");return e}}}},function(r,t,e){var n=e(3),o=e(20),a=n.WeakMap;r.exports=o(a)&&/native code/.test(String(a))},function(r,t,e){var n=e(33),o=e(39),a=n("keys");r.exports=function(r){return a[r]||(a[r]=o(r))}},function(r,t,e){r.exports={}},function(r,t,e){var n=e(37),o=e(55),a=e(4),i=e(43);r.exports=function(r,t,e){for(var c=o(t),u=i.f,f=a.f,s=0;sf;)o(n,e=t[f++])&&(~i(s,e)||u(s,e));return s}},function(r,t,e){var n=e(11),o=e(59),a=e(62),i=function(r){return function(t,e,i){var c,u=n(t),f=a(u),s=o(i,f);if(r&&e!=e){for(;f>s;)if((c=u[s++])!=c)return!0}else for(;f>s;s++)if((r||s in u)&&u[s]===e)return r||s||0;return!r&&-1}};r.exports={includes:i(!0),indexOf:i(!1)}},function(r,t,e){var n=e(60),o=Math.max,a=Math.min;r.exports=function(r,t){var e=n(r);return e<0?o(e+t,0):a(e,t)}},function(r,t,e){var n=e(61);r.exports=function(r){var t=+r;return t!=t||0===t?0:n(t)}},function(r,t,e){var n=Math.ceil,o=Math.floor;r.exports=Math.trunc||function(r){var t=+r;return(t>0?o:n)(t)}},function(r,t,e){var n=e(63);r.exports=function(r){return n(r.length)}},function(r,t,e){var n=e(60),o=Math.min;r.exports=function(r){var t=n(r);return t>0?o(t,9007199254740991):0}},function(r,t,e){r.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(r,t,e){t.f=Object.getOwnPropertySymbols},function(r,t,e){var n=e(6),o=e(20),a=/#|\.prototype\./,i=function(r,t){var e=u[c(r)];return e===s||e!==f&&(o(t)?n(t):!!t)},c=i.normalize=function(r){return String(r).replace(a,".").toLowerCase()},u=i.data={},f=i.NATIVE="N",s=i.POLYFILL="P";r.exports=i},function(r,t,e){var n=e(62);r.exports=function(r,t){for(var e=n(r),o=new t(e),a=0;a"+r+""},d=function(r){r.write(g("")),r.close();var t=r.parentWindow.Object;return r=null,t},b=function(){try{o=new ActiveXObject("htmlfile")}catch(r){}var r,t,e;b="undefined"!=typeof document?document.domain&&o?d(o):(t=s("iframe"),e="java"+y+":",t.style.display="none",f.appendChild(t),t.src=String(e),(r=t.contentWindow.document).open(),r.write(g("document.F=Object")),r.close(),r.F):d(o);for(var n=c.length;n--;)delete b[l][c[n]];return b()};u[v]=!0,t.exports=Object.create||function(t,e){var n;return null!==t?(h[l]=a(t),n=new h,h[l]=null,n[v]=t):n=b(),e===r?n:i.f(n,e)}},function(r,t,e){var n=e(5),o=e(44),a=e(43),i=e(45),c=e(11),u=e(71);t.f=n&&!o?Object.defineProperties:function(r,t){i(r);for(var e,n=c(t),o=u(t),f=o.length,s=0;f>s;)a.f(r,e=o[s++],n[e]);return r}},function(r,t,e){var n=e(57),o=e(64);r.exports=Object.keys||function(r){return n(r,o)}},function(r,t,e){var n=e(22);r.exports=n("document","documentElement")},function(t,e,n){var o=n(2),a=n(13),i=n(29),c=n(11),u=n(74),f=n(75),s=n(68),p=Array,l=a(f("Array","sort"));o({target:"Array",proto:!0},{toSorted:function(t){t!==r&&i(t);var e=c(this),n=u(p,e);return l(n,t)}}),s("toSorted")},function(r,t,e){var n=e(62);r.exports=function(r,t,e){for(var o=0,a=arguments.length>2?e:n(t),i=new r(a);a>o;)i[o]=t[o++];return i}},function(r,t,e){var n=e(3);r.exports=function(r,t){var e=n[r],o=e&&e.prototype;return o&&o[t]}},function(r,t,e){var n=e(2),o=e(68),a=e(77),i=e(62),c=e(59),u=e(11),f=e(60),s=Array,p=Math.max,l=Math.min;n({target:"Array",proto:!0},{toSpliced:function(r,t){var e,n,o,y,v=u(this),h=i(v),g=c(r,h),d=arguments.length,b=0;for(0===d?e=n=0:1===d?(e=0,n=h-g):(e=d-2,n=l(p(f(t),0),h-g)),o=a(h+e-n),y=s(o);b9007199254740991)throw n("Maximum allowed index exceeded");return r}},function(r,t,e){var n=e(2),o=e(79),a=e(11),i=Array;n({target:"Array",proto:!0},{with:function(r,t){return o(a(this),i,r,t)}})},function(r,t,e){var n=e(62),o=e(60),a=RangeError;r.exports=function(r,t,e,i){var c=n(r),u=o(e),f=u<0?c+u:u;if(f>=c||f<0)throw new a("Incorrect index");for(var s=new t(c),p=0;pb;b++)if((w=j(r[b]))&&f(h,w))return w;return new v(!1)}g=s(r,d)}for(x=S?r.next:g.next;!(E=o(x,g)).done;){try{w=j(E.value)}catch(r){l(g,"throw",r)}if("object"==typeof w&&w&&f(h,w))return w}return new v(!1)}},function(t,e,n){var o=n(83),a=n(29),i=n(8),c=o(o.bind);t.exports=function(t,e){return a(t),e===r?t:i?c(t,e):function(){return t.apply(e,arguments)}}},function(r,t,e){var n=e(14),o=e(13);r.exports=function(r){if("Function"===n(r))return o(r)}},function(t,e,n){var o=n(32),a=n(85),i=o("iterator"),c=Array.prototype;t.exports=function(t){return t!==r&&(a.Array===t||c[i]===t)}},function(r,t,e){r.exports={}},function(r,t,e){var n=e(7),o=e(29),a=e(45),i=e(30),c=e(87),u=TypeError;r.exports=function(r,t){var e=arguments.length<2?c(r):t;if(o(e))return a(n(e,r));throw new u(i(r)+" is not iterable")}},function(r,t,e){var n=e(88),o=e(28),a=e(16),i=e(85),c=e(32)("iterator");r.exports=function(r){if(!a(r))return o(r,c)||o(r,"@@iterator")||i[n(r)]}},function(t,e,n){var o=n(89),a=n(20),i=n(14),c=n(32)("toStringTag"),u=Object,f="Arguments"===i(function(){return arguments}());t.exports=o?i:function(t){var e,n,o;return t===r?"Undefined":null===t?"Null":"string"==typeof(n=function(r,t){try{return r[t]}catch(r){}}(e=u(t),c))?n:f?i(e):"Object"===(o=i(e))&&a(e.callee)?"Arguments":o}},function(r,t,e){var n={};n[e(32)("toStringTag")]="z",r.exports="[object z]"===String(n)},function(r,t,e){var n=e(7),o=e(45),a=e(28);r.exports=function(r,t,e){var i,c;o(r);try{if(!(i=a(r,"return"))){if("throw"===t)throw e;return e}i=n(i,r)}catch(r){c=!0,i=r}if("throw"===t)throw e;if(c)throw i;return o(i),e}},function(r,t,e){var n=e(13),o=Map.prototype;r.exports={Map,set:n(o.set),get:n(o.get),has:n(o.has),remove:n(o.delete),proto:o}},function(r,t,e){var n=e(2),o=e(22),a=e(13),i=e(29),c=e(15),u=e(17),f=e(81),s=o("Object","create"),p=a([].push);n({target:"Object",stat:!0},{groupBy:function(r,t){c(r),i(t);var e=s(null),n=0;return f(r,(function(r){var o=u(t(r,n++));o in e?p(e[o],r):e[o]=[r]})),e}})},function(r,t,e){var n=e(2),o=e(94);n({target:"Promise",stat:!0},{withResolvers:function(){var r=o.f(this);return{promise:r.promise,resolve:r.resolve,reject:r.reject}}})},function(t,e,n){var o=n(29),a=TypeError,i=function(t){var e,n;this.promise=new t((function(t,o){if(e!==r||n!==r)throw new a("Bad Promise constructor");e=t,n=o})),this.resolve=o(e),this.reject=o(n)};t.exports.f=function(r){return new i(r)}},function(r,t,e){var n=e(3),o=e(5),a=e(96),i=e(97),c=e(6),u=n.RegExp,f=u.prototype;o&&c((function(){var r=!0;try{u(".","d")}catch(t){r=!1}var t={},e="",n=r?"dgimsy":"gimsy",o=function(r,n){Object.defineProperty(t,r,{get:function(){return e+=n,!0}})},a={dotAll:"s",global:"g",ignoreCase:"i",multiline:"m",sticky:"y"};for(var i in r&&(a.hasIndices="d"),a)o(i,a[i]);return Object.getOwnPropertyDescriptor(f,"flags").get.call(t)!==n||e!==n}))&&a(f,"flags",{configurable:!0,get:i})},function(r,t,e){var n=e(47),o=e(43);r.exports=function(r,t,e){return e.get&&n(e.get,t,{getter:!0}),e.set&&n(e.set,t,{setter:!0}),o.f(r,t,e)}},function(r,t,e){var n=e(45);r.exports=function(){var r=n(this),t="";return r.hasIndices&&(t+="d"),r.global&&(t+="g"),r.ignoreCase&&(t+="i"),r.multiline&&(t+="m"),r.dotAll&&(t+="s"),r.unicode&&(t+="u"),r.unicodeSets&&(t+="v"),r.sticky&&(t+="y"),t}},function(r,t,e){var n=e(2),o=e(13),a=e(15),i=e(99),c=o("".charCodeAt);n({target:"String",proto:!0},{isWellFormed:function(){for(var r=i(a(this)),t=r.length,e=0;e=56320||++e>=t||56320!=(64512&c(r,e))))return!1}return!0}})},function(r,t,e){var n=e(88),o=String;r.exports=function(r){if("Symbol"===n(r))throw new TypeError("Cannot convert a Symbol value to a string");return o(r)}},function(r,t,e){var n=e(2),o=e(7),a=e(13),i=e(15),c=e(99),u=e(6),f=Array,s=a("".charAt),p=a("".charCodeAt),l=a([].join),y="".toWellFormed,v=y&&u((function(){return"1"!==o(y,1)}));n({target:"String",proto:!0,forced:v},{toWellFormed:function(){var r=c(i(this));if(v)return o(y,r);for(var t=r.length,e=f(t),n=0;n=56320||n+1>=t||56320!=(64512&p(r,n+1))?e[n]="�":(e[n]=s(r,n),e[++n]=s(r,n))}return l(e,"")}})},function(r,t,e){var n=e(67),o=e(102),a=o.aTypedArray,i=o.exportTypedArrayMethod,c=o.getTypedArrayConstructor;i("toReversed",(function(){return n(a(this),c(this))}))},function(t,e,n){var o,a,i,c=n(103),u=n(5),f=n(3),s=n(20),p=n(19),l=n(37),y=n(88),v=n(30),h=n(42),g=n(46),d=n(96),b=n(23),m=n(104),w=n(106),x=n(32),E=n(39),A=n(50),O=A.enforce,S=A.get,R=f.Int8Array,T=R&&R.prototype,_=f.Uint8ClampedArray,I=_&&_.prototype,j=R&&m(R),M=T&&m(T),D=Object.prototype,P=f.TypeError,k=x("toStringTag"),C=E("TYPED_ARRAY_TAG"),U="TypedArrayConstructor",L=c&&!!w&&"Opera"!==y(f.opera),N=!1,F={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},B={BigInt64Array:8,BigUint64Array:8},V=function(r){var t=m(r);if(p(t)){var e=S(t);return e&&l(e,U)?e[U]:V(t)}},z=function(r){if(!p(r))return!1;var t=y(r);return l(F,t)||l(B,t)};for(o in F)(i=(a=f[o])&&a.prototype)?O(i)[U]=a:L=!1;for(o in B)(i=(a=f[o])&&a.prototype)&&(O(i)[U]=a);if((!L||!s(j)||j===Function.prototype)&&(j=function(){throw new P("Incorrect invocation")},L))for(o in F)f[o]&&w(f[o],j);if((!L||!M||M===D)&&(M=j.prototype,L))for(o in F)f[o]&&w(f[o].prototype,M);if(L&&m(I)!==M&&w(I,M),u&&!l(M,k))for(o in N=!0,d(M,k,{configurable:!0,get:function(){return p(this)?this[C]:r}}),F)f[o]&&h(f[o],C,o);t.exports={NATIVE_ARRAY_BUFFER_VIEWS:L,TYPED_ARRAY_TAG:N&&C,aTypedArray:function(r){if(z(r))return r;throw new P("Target is not a typed array")},aTypedArrayConstructor:function(r){if(s(r)&&(!w||b(j,r)))return r;throw new P(v(r)+" is not a typed array constructor")},exportTypedArrayMethod:function(r,t,e,n){if(u){if(e)for(var o in F){var a=f[o];if(a&&l(a.prototype,r))try{delete a.prototype[r]}catch(e){try{a.prototype[r]=t}catch(r){}}}M[r]&&!e||g(M,r,e?t:L&&T[r]||t,n)}},exportTypedArrayStaticMethod:function(r,t,e){var n,o;if(u){if(w){if(e)for(n in F)if((o=f[n])&&l(o,r))try{delete o[r]}catch(r){}if(j[r]&&!e)return;try{return g(j,r,e?t:L&&j[r]||t)}catch(r){}}for(n in F)!(o=f[n])||o[r]&&!e||g(o,r,t)}},getTypedArrayConstructor:V,isView:function(r){if(!p(r))return!1;var t=y(r);return"DataView"===t||l(F,t)||l(B,t)},isTypedArray:z,TypedArray:j,TypedArrayPrototype:M}},function(r,t,e){r.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},function(r,t,e){var n=e(37),o=e(20),a=e(38),i=e(52),c=e(105),u=i("IE_PROTO"),f=Object,s=f.prototype;r.exports=c?f.getPrototypeOf:function(r){var t=a(r);if(n(t,u))return t[u];var e=t.constructor;return o(e)&&t instanceof e?e.prototype:t instanceof f?s:null}},function(r,t,e){var n=e(6);r.exports=!n((function(){function r(){}return r.prototype.constructor=null,Object.getPrototypeOf(new r)!==r.prototype}))},function(t,e,n){var o=n(107),a=n(45),i=n(108);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var r,t=!1,e={};try{(r=o(Object.prototype,"__proto__","set"))(e,[]),t=e instanceof Array}catch(r){}return function(e,n){return a(e),i(n),t?r(e,n):e.__proto__=n,e}}():r)},function(r,t,e){var n=e(13),o=e(29);r.exports=function(r,t,e){try{return n(o(Object.getOwnPropertyDescriptor(r,t)[e]))}catch(r){}}},function(r,t,e){var n=e(109),o=String,a=TypeError;r.exports=function(r){if(n(r))return r;throw new a("Can't set "+o(r)+" as a prototype")}},function(r,t,e){var n=e(19);r.exports=function(r){return n(r)||null===r}},function(t,e,n){var o=n(102),a=n(13),i=n(29),c=n(74),u=o.aTypedArray,f=o.getTypedArrayConstructor,s=o.exportTypedArrayMethod,p=a(o.TypedArrayPrototype.sort);s("toSorted",(function(t){t!==r&&i(t);var e=u(this),n=c(f(e),e);return p(n,t)}))},function(r,t,e){var n=e(79),o=e(102),a=e(112),i=e(60),c=e(113),u=o.aTypedArray,f=o.getTypedArrayConstructor,s=o.exportTypedArrayMethod,p=!!function(){try{new Int8Array(1).with(2,{valueOf:function(){throw 8}})}catch(r){return 8===r}}();s("with",{with:function(r,t){var e=u(this),o=i(r),s=a(e)?c(t):+t;return n(e,f(e),o,s)}}.with,!p)},function(r,t,e){var n=e(88);r.exports=function(r){var t=n(r);return"BigInt64Array"===t||"BigUint64Array"===t}},function(r,t,e){var n=e(18),o=TypeError;r.exports=function(r){var t=n(r,"number");if("number"==typeof t)throw new o("Can't convert number to bigint");return BigInt(t)}},function(t,e,n){var o=n(2),a=n(3),i=n(22),c=n(10),u=n(43).f,f=n(37),s=n(115),p=n(116),l=n(117),y=n(118),v=n(119),h=n(5),g=n(34),d="DOMException",b=i("Error"),m=i(d),w=function(){s(this,x);var t=arguments.length,e=l(t<1?r:arguments[0]),n=l(t<2?r:arguments[1],"Error"),o=new m(e,n),a=new b(e);return a.name=d,u(o,"stack",c(1,v(a.stack,1))),p(o,this,w),o},x=w.prototype=m.prototype,E="stack"in new b(d),A="stack"in new m(1,2),O=m&&h&&Object.getOwnPropertyDescriptor(a,d),S=!(!O||O.writable&&O.configurable),R=E&&!S&&!A;o({global:!0,constructor:!0,forced:g||R},{DOMException:R?w:m});var T=i(d),_=T.prototype;if(_.constructor!==T)for(var I in g||u(_,"constructor",c(1,T)),y)if(f(y,I)){var j=y[I],M=j.s;f(T,M)||u(T,M,c(6,j.c))}},function(r,t,e){var n=e(23),o=TypeError;r.exports=function(r,t){if(n(t,r))return r;throw new o("Incorrect invocation")}},function(r,t,e){var n=e(20),o=e(19),a=e(106);r.exports=function(r,t,e){var i,c;return a&&n(i=t.constructor)&&i!==e&&o(c=i.prototype)&&c!==e.prototype&&a(r,c),r}},function(t,e,n){var o=n(99);t.exports=function(t,e){return t===r?arguments.length<2?"":e:o(t)}},function(r,t,e){r.exports={IndexSizeError:{s:"INDEX_SIZE_ERR",c:1,m:1},DOMStringSizeError:{s:"DOMSTRING_SIZE_ERR",c:2,m:0},HierarchyRequestError:{s:"HIERARCHY_REQUEST_ERR",c:3,m:1},WrongDocumentError:{s:"WRONG_DOCUMENT_ERR",c:4,m:1},InvalidCharacterError:{s:"INVALID_CHARACTER_ERR",c:5,m:1},NoDataAllowedError:{s:"NO_DATA_ALLOWED_ERR",c:6,m:0},NoModificationAllowedError:{s:"NO_MODIFICATION_ALLOWED_ERR",c:7,m:1},NotFoundError:{s:"NOT_FOUND_ERR",c:8,m:1},NotSupportedError:{s:"NOT_SUPPORTED_ERR",c:9,m:1},InUseAttributeError:{s:"INUSE_ATTRIBUTE_ERR",c:10,m:1},InvalidStateError:{s:"INVALID_STATE_ERR",c:11,m:1},SyntaxError:{s:"SYNTAX_ERR",c:12,m:1},InvalidModificationError:{s:"INVALID_MODIFICATION_ERR",c:13,m:1},NamespaceError:{s:"NAMESPACE_ERR",c:14,m:1},InvalidAccessError:{s:"INVALID_ACCESS_ERR",c:15,m:1},ValidationError:{s:"VALIDATION_ERR",c:16,m:0},TypeMismatchError:{s:"TYPE_MISMATCH_ERR",c:17,m:1},SecurityError:{s:"SECURITY_ERR",c:18,m:1},NetworkError:{s:"NETWORK_ERR",c:19,m:1},AbortError:{s:"ABORT_ERR",c:20,m:1},URLMismatchError:{s:"URL_MISMATCH_ERR",c:21,m:1},QuotaExceededError:{s:"QUOTA_EXCEEDED_ERR",c:22,m:1},TimeoutError:{s:"TIMEOUT_ERR",c:23,m:1},InvalidNodeTypeError:{s:"INVALID_NODE_TYPE_ERR",c:24,m:1},DataCloneError:{s:"DATA_CLONE_ERR",c:25,m:1}}},function(r,t,e){var n=e(13),o=Error,a=n("".replace),i=String(new o("zxcasd").stack),c=/\n\s*at [^:]*:[^\n]*/,u=c.test(i);r.exports=function(r,t){if(u&&"string"==typeof r&&!o.prepareStackTrace)for(;t--;)r=a(r,c,"");return r}},function(t,e,n){var o,a=n(34),i=n(2),c=n(3),u=n(22),f=n(13),s=n(6),p=n(39),l=n(20),y=n(121),v=n(16),h=n(19),g=n(21),d=n(81),b=n(45),m=n(88),w=n(37),x=n(122),E=n(42),A=n(62),O=n(123),S=n(124),R=n(91),T=n(125),_=n(126),I=n(128),j=n(134),M=n(131),D=c.Object,P=c.Array,k=c.Date,C=c.Error,U=c.TypeError,L=c.PerformanceMark,N=u("DOMException"),F=R.Map,B=R.has,V=R.get,z=R.set,W=T.Set,G=T.add,Y=T.has,H=u("Object","keys"),Q=f([].push),X=f((!0).valueOf),q=f(1..valueOf),K=f("".valueOf),Z=f(k.prototype.getTime),$=p("structuredClone"),J="DataCloneError",rr="Transferring",tr=function(r){return!s((function(){var t=new c.Set([7]),e=r(t),n=r(D(7));return e===t||!e.has(7)||!h(n)||7!=+n}))&&r},er=function(r,t){return!s((function(){var e=new t,n=r({a:e,b:e});return!(n&&n.a===n.b&&n.a instanceof t&&n.a.stack===e.stack)}))},nr=c.structuredClone,or=a||!er(nr,C)||!er(nr,N)||(o=nr,!!s((function(){var r=o(new c.AggregateError([1],$,{cause:3}));return"AggregateError"!==r.name||1!==r.errors[0]||r.message!==$||3!==r.cause}))),ar=!nr&&tr((function(r){return new L($,{detail:r}).detail})),ir=tr(nr)||ar,cr=function(r){throw new N("Uncloneable type: "+r,J)},ur=function(r,t){throw new N((t||"Cloning")+" of "+r+" cannot be properly polyfilled in this engine",J)},fr=function(r,t){return ir||ur(t),ir(r)},sr=function(t,e,n){if(B(e,t))return V(e,t);var o,a,i,u,f,s;if("SharedArrayBuffer"===(n||m(t)))o=ir?ir(t):t;else{var p=c.DataView;p||l(t.slice)||ur("ArrayBuffer");try{if(l(t.slice)&&!t.resizable)o=t.slice(0);else{a=t.byteLength,i="maxByteLength"in t?{maxByteLength:t.maxByteLength}:r,o=new ArrayBuffer(a,i),u=new p(t),f=new p(o);for(s=0;s1&&!v(arguments[1])?b(arguments[1]):r,a=o?o.transfer:r;a!==r&&(n=function(t,e){if(!h(t))throw new U("Transfer option cannot be converted to a sequence");var n=[];d(t,(function(r){Q(n,b(r))}));for(var o,a,i,u,f,s=0,p=A(n),v=new W;s92||u&&a>94||i&&a>97)return!1;var r=new ArrayBuffer(8),t=f(r,{transfer:[r]});return 0!==r.byteLength||8!==t.byteLength}))},function(r,t,e){var n=e(133),o=e(130);r.exports=!n&&!o&&"object"==typeof window&&"object"==typeof document},function(r,t,e){r.exports="object"==typeof Deno&&Deno&&"object"==typeof Deno.version},function(r,t,e){var n=e(6),o=e(10);r.exports=!n((function(){var r=new Error("a");return!("stack"in r)||(Object.defineProperty(r,"stack",o(1,7)),7!==r.stack)}))},function(t,e,n){var o=n(2),a=n(22),i=n(6),c=n(123),u=n(99),f=n(136),s=a("URL");o({target:"URL",stat:!0,forced:!(f&&i((function(){s.canParse()})))},{canParse:function(t){var e=c(arguments.length,1),n=u(t),o=e<2||arguments[1]===r?r:u(arguments[1]);try{return!!new s(n,o)}catch(r){return!1}}})},function(t,e,n){var o=n(6),a=n(32),i=n(5),c=n(34),u=a("iterator");t.exports=!o((function(){var t=new URL("b?a=1&b=2&c=3","http://a"),e=t.searchParams,n=new URLSearchParams("a=1&a=2&b=3"),o="";return t.pathname="c%20d",e.forEach((function(r,t){e.delete("b"),o+=t+r})),n.delete("a",2),n.delete("b",r),c&&(!t.toJSON||!n.has("a",1)||n.has("a",2)||!n.has("a",r)||n.has("b"))||!e.size&&(c||!i)||!e.sort||"http://a/c%20d?a=1&c=3"!==t.href||"3"!==e.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!e[u]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==o||"x"!==new URL("http://x",r).host}))},function(t,e,n){var o=n(46),a=n(13),i=n(99),c=n(123),u=URLSearchParams,f=u.prototype,s=a(f.append),p=a(f.delete),l=a(f.forEach),y=a([].push),v=new u("a=1&a=2&b=3");v.delete("a",1),v.delete("b",r),v+""!="a=2"&&o(f,"delete",(function(t){var e=arguments.length,n=e<2?r:arguments[1];if(e&&n===r)return p(this,t);var o=[];l(this,(function(r,t){y(o,{key:t,value:r})})),c(e,1);for(var a,u=i(t),f=i(n),v=0,h=0,g=!1,d=o.length;v0&&n[0]<4?1:+(n[0]+n[1])),!o&&i&&(!(n=i.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=i.match(/Chrome\/(\d+)/))&&(o=+n[1]),r.exports=o},function(r,t,e){var n=e(3).navigator,o=n&&n.userAgent;r.exports=o?String(o):""},function(t,e,n){var o=n(29),a=n(16);t.exports=function(t,e){var n=t[e];return a(n)?r:o(n)}},function(r,t,e){var n=e(20),o=e(30),a=TypeError;r.exports=function(r){if(n(r))return r;throw new a(o(r)+" is not a function")}},function(r,t,e){var n=String;r.exports=function(r){try{return n(r)}catch(r){return"Object"}}},function(r,t,e){var n=e(7),o=e(20),a=e(19),i=TypeError;r.exports=function(r,t){var e,c;if("string"===t&&o(e=r.toString)&&!a(c=n(e,r)))return c;if(o(e=r.valueOf)&&!a(c=n(e,r)))return c;if("string"!==t&&o(e=r.toString)&&!a(c=n(e,r)))return c;throw new i("Can't convert object to primitive value")}},function(r,t,e){var n=e(3),o=e(33),a=e(37),i=e(39),c=e(25),u=e(24),f=n.Symbol,s=o("wks"),p=u?f.for||f:f&&f.withoutSetter||i;r.exports=function(r){return a(s,r)||(s[r]=c&&a(f,r)?f[r]:p("Symbol."+r)),s[r]}},function(r,t,e){var n=e(34);r.exports=function(r,t){return n[r]||(n[r]=t||{})}},function(r,t,e){var n=e(35),o=e(3),a=e(36),i="__core-js_shared__",c=r.exports=o[i]||a(i,{});(c.versions||(c.versions=[])).push({version:"3.39.0",mode:n?"pure":"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.39.0/LICENSE",source:"https://github.com/zloirock/core-js"})},function(r,t,e){r.exports=!1},function(r,t,e){var n=e(3),o=Object.defineProperty;r.exports=function(r,t){try{o(n,r,{value:t,configurable:!0,writable:!0})}catch(e){n[r]=t}return t}},function(r,t,e){var n=e(13),o=e(38),a=n({}.hasOwnProperty);r.exports=Object.hasOwn||function(r,t){return a(o(r),t)}},function(r,t,e){var n=e(15),o=Object;r.exports=function(r){return o(n(r))}},function(t,e,n){var o=n(13),a=0,i=Math.random(),c=o(1..toString);t.exports=function(t){return"Symbol("+(t===r?"":t)+")_"+c(++a+i,36)}},function(r,t,e){var n=e(5),o=e(6),a=e(41);r.exports=!n&&!o((function(){return 7!==Object.defineProperty(a("div"),"a",{get:function(){return 7}}).a}))},function(r,t,e){var n=e(3),o=e(19),a=n.document,i=o(a)&&o(a.createElement);r.exports=function(r){return i?a.createElement(r):{}}},function(r,t,e){var n=e(5),o=e(43),a=e(10);r.exports=n?function(r,t,e){return o.f(r,t,a(1,e))}:function(r,t,e){return r[t]=e,r}},function(r,t,e){var n=e(5),o=e(40),a=e(44),i=e(45),c=e(17),u=TypeError,f=Object.defineProperty,s=Object.getOwnPropertyDescriptor,p="enumerable",l="configurable",y="writable";t.f=n?a?function(r,t,e){if(i(r),t=c(t),i(e),"function"==typeof r&&"prototype"===t&&"value"in e&&y in e&&!e[y]){var n=s(r,t);n&&n[y]&&(r[t]=e.value,e={configurable:l in e?e[l]:n[l],enumerable:p in e?e[p]:n[p],writable:!1})}return f(r,t,e)}:f:function(r,t,e){if(i(r),t=c(t),i(e),o)try{return f(r,t,e)}catch(r){}if("get"in e||"set"in e)throw new u("Accessors not supported");return"value"in e&&(r[t]=e.value),r}},function(r,t,e){var n=e(5),o=e(6);r.exports=n&&o((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},function(r,t,e){var n=e(19),o=String,a=TypeError;r.exports=function(r){if(n(r))return r;throw new a(o(r)+" is not an object")}},function(t,e,n){var o=n(20),a=n(43),i=n(47),c=n(36);t.exports=function(t,e,n,u){u||(u={});var f=u.enumerable,s=u.name!==r?u.name:e;if(o(n)&&i(n,s,u),u.global)f?t[e]=n:c(e,n);else{try{u.unsafe?t[e]&&(f=!0):delete t[e]}catch(r){}f?t[e]=n:a.f(t,e,{value:n,enumerable:!1,configurable:!u.nonConfigurable,writable:!u.nonWritable})}return t}},function(t,e,n){var o=n(13),a=n(6),i=n(20),c=n(37),u=n(5),f=n(48).CONFIGURABLE,s=n(49),p=n(50),l=p.enforce,y=p.get,h=String,v=Object.defineProperty,g=o("".slice),d=o("".replace),b=o([].join),m=u&&!a((function(){return 8!==v((function(){}),"length",{value:8}).length})),w=String(String).split("String"),x=t.exports=function(t,e,n){"Symbol("===g(h(e),0,7)&&(e="["+d(h(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),n&&n.getter&&(e="get "+e),n&&n.setter&&(e="set "+e),(!c(t,"name")||f&&t.name!==e)&&(u?v(t,"name",{value:e,configurable:!0}):t.name=e),m&&n&&c(n,"arity")&&t.length!==n.arity&&v(t,"length",{value:n.arity});try{n&&c(n,"constructor")&&n.constructor?u&&v(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=r)}catch(r){}var o=l(t);return c(o,"source")||(o.source=b(w,"string"==typeof e?e:"")),t};Function.prototype.toString=x((function(){return i(this)&&y(this).source||s(this)}),"toString")},function(r,t,e){var n=e(5),o=e(37),a=Function.prototype,i=n&&Object.getOwnPropertyDescriptor,c=o(a,"name"),u=c&&"something"===function(){}.name,f=c&&(!n||n&&i(a,"name").configurable);r.exports={EXISTS:c,PROPER:u,CONFIGURABLE:f}},function(r,t,e){var n=e(13),o=e(20),a=e(34),i=n(Function.toString);o(a.inspectSource)||(a.inspectSource=function(r){return i(r)}),r.exports=a.inspectSource},function(r,t,e){var n,o,a,i=e(51),c=e(3),u=e(19),f=e(42),s=e(37),p=e(34),l=e(52),y=e(53),h="Object already initialized",v=c.TypeError,g=c.WeakMap;if(i||p.state){var d=p.state||(p.state=new g);d.get=d.get,d.has=d.has,d.set=d.set,n=function(r,t){if(d.has(r))throw new v(h);return t.facade=r,d.set(r,t),t},o=function(r){return d.get(r)||{}},a=function(r){return d.has(r)}}else{var b=l("state");y[b]=!0,n=function(r,t){if(s(r,b))throw new v(h);return t.facade=r,f(r,b,t),t},o=function(r){return s(r,b)?r[b]:{}},a=function(r){return s(r,b)}}r.exports={set:n,get:o,has:a,enforce:function(r){return a(r)?o(r):n(r,{})},getterFor:function(r){return function(t){var e;if(!u(t)||(e=o(t)).type!==r)throw new v("Incompatible receiver, "+r+" required");return e}}}},function(r,t,e){var n=e(3),o=e(20),a=n.WeakMap;r.exports=o(a)&&/native code/.test(String(a))},function(r,t,e){var n=e(33),o=e(39),a=n("keys");r.exports=function(r){return a[r]||(a[r]=o(r))}},function(r,t,e){r.exports={}},function(r,t,e){var n=e(37),o=e(55),a=e(4),i=e(43);r.exports=function(r,t,e){for(var c=o(t),u=i.f,f=a.f,s=0;sf;)o(n,e=t[f++])&&(~i(s,e)||u(s,e));return s}},function(r,t,e){var n=e(11),o=e(59),a=e(62),i=function(r){return function(t,e,i){var c=n(t),u=a(c);if(0===u)return!r&&-1;var f,s=o(i,u);if(r&&e!=e){for(;u>s;)if((f=c[s++])!=f)return!0}else for(;u>s;s++)if((r||s in c)&&c[s]===e)return r||s||0;return!r&&-1}};r.exports={includes:i(!0),indexOf:i(!1)}},function(r,t,e){var n=e(60),o=Math.max,a=Math.min;r.exports=function(r,t){var e=n(r);return e<0?o(e+t,0):a(e,t)}},function(r,t,e){var n=e(61);r.exports=function(r){var t=+r;return t!=t||0===t?0:n(t)}},function(r,t,e){var n=Math.ceil,o=Math.floor;r.exports=Math.trunc||function(r){var t=+r;return(t>0?o:n)(t)}},function(r,t,e){var n=e(63);r.exports=function(r){return n(r.length)}},function(r,t,e){var n=e(60),o=Math.min;r.exports=function(r){var t=n(r);return t>0?o(t,9007199254740991):0}},function(r,t,e){r.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(r,t,e){t.f=Object.getOwnPropertySymbols},function(r,t,e){var n=e(6),o=e(20),a=/#|\.prototype\./,i=function(r,t){var e=u[c(r)];return e===s||e!==f&&(o(t)?n(t):!!t)},c=i.normalize=function(r){return String(r).replace(a,".").toLowerCase()},u=i.data={},f=i.NATIVE="N",s=i.POLYFILL="P";r.exports=i},function(r,t,e){var n=e(62);r.exports=function(r,t){for(var e=n(r),o=new t(e),a=0;a"+r+""},d=function(r){r.write(g("")),r.close();var t=r.parentWindow.Object;return r=null,t},b=function(){try{o=new ActiveXObject("htmlfile")}catch(r){}var r,t,e;b="undefined"!=typeof document?document.domain&&o?d(o):(t=s("iframe"),e="java"+y+":",t.style.display="none",f.appendChild(t),t.src=String(e),(r=t.contentWindow.document).open(),r.write(g("document.F=Object")),r.close(),r.F):d(o);for(var n=c.length;n--;)delete b[l][c[n]];return b()};u[h]=!0,t.exports=Object.create||function(t,e){var n;return null!==t?(v[l]=a(t),n=new v,v[l]=null,n[h]=t):n=b(),e===r?n:i.f(n,e)}},function(r,t,e){var n=e(5),o=e(44),a=e(43),i=e(45),c=e(11),u=e(71);t.f=n&&!o?Object.defineProperties:function(r,t){i(r);for(var e,n=c(t),o=u(t),f=o.length,s=0;f>s;)a.f(r,e=o[s++],n[e]);return r}},function(r,t,e){var n=e(57),o=e(64);r.exports=Object.keys||function(r){return n(r,o)}},function(r,t,e){var n=e(22);r.exports=n("document","documentElement")},function(t,e,n){var o=n(2),a=n(13),i=n(29),c=n(11),u=n(74),f=n(75),s=n(68),p=Array,l=a(f("Array","sort"));o({target:"Array",proto:!0},{toSorted:function(t){t!==r&&i(t);var e=c(this),n=u(p,e);return l(n,t)}}),s("toSorted")},function(r,t,e){var n=e(62);r.exports=function(r,t,e){for(var o=0,a=arguments.length>2?e:n(t),i=new r(a);a>o;)i[o]=t[o++];return i}},function(r,t,e){var n=e(3);r.exports=function(r,t){var e=n[r],o=e&&e.prototype;return o&&o[t]}},function(r,t,e){var n=e(2),o=e(68),a=e(77),i=e(62),c=e(59),u=e(11),f=e(60),s=Array,p=Math.max,l=Math.min;n({target:"Array",proto:!0},{toSpliced:function(r,t){var e,n,o,y,h=u(this),v=i(h),g=c(r,v),d=arguments.length,b=0;for(0===d?e=n=0:1===d?(e=0,n=v-g):(e=d-2,n=l(p(f(t),0),v-g)),o=a(v+e-n),y=s(o);b9007199254740991)throw n("Maximum allowed index exceeded");return r}},function(r,t,e){var n=e(2),o=e(79),a=e(11),i=Array;n({target:"Array",proto:!0},{with:function(r,t){return o(a(this),i,r,t)}})},function(r,t,e){var n=e(62),o=e(60),a=RangeError;r.exports=function(r,t,e,i){var c=n(r),u=o(e),f=u<0?c+u:u;if(f>=c||f<0)throw new a("Incorrect index");for(var s=new t(c),p=0;p=i&&(!n||g))o=b(t,0,i);else{var d=n&&!g&&w?{maxByteLength:w(t)}:r;o=new y(i,d);for(var A=new h(t),R=new h(o),O=v(i,a),S=0;S92||"NODE"===i&&a>94||"BROWSER"===i&&a>97)return!1;var r=new ArrayBuffer(8),t=c(r,{transfer:[r]});return 0!==r.byteLength||8!==t.byteLength}))},function(t,e,n){var o=n(2),a=n(87);a&&o({target:"ArrayBuffer",proto:!0},{transferToFixedLength:function(){return a(this,arguments.length?arguments[0]:r,!1)}})},function(r,t,e){var n=e(2),o=e(3),a=e(97),i=e(45),c=e(20),u=e(98),f=e(81),s=e(100),p=e(6),l=e(37),y=e(32),h=e(101).IteratorPrototype,v=e(5),g=e(35),d="constructor",b="Iterator",m=y("toStringTag"),w=TypeError,x=o[b],E=g||!c(x)||x.prototype!==h||!p((function(){x({})})),A=function(){if(a(this,h),u(this)===h)throw new w("Abstract class Iterator not directly constructable")},R=function(r,t){v?f(h,r,{configurable:!0,get:function(){return t},set:function(t){if(i(this),this===h)throw new w("You can't redefine this property");l(this,r)?this[r]=t:s(this,r,t)}}):h[r]=t};l(h,m)||R(m,b),!E&&l(h,d)&&h[d]!==Object||R(d,A),A.prototype=h,n({global:!0,constructor:!0,forced:E},{Iterator:A})},function(r,t,e){var n=e(23),o=TypeError;r.exports=function(r,t){if(n(t,r))return r;throw new o("Incorrect invocation")}},function(r,t,e){var n=e(37),o=e(20),a=e(38),i=e(52),c=e(99),u=i("IE_PROTO"),f=Object,s=f.prototype;r.exports=c?f.getPrototypeOf:function(r){var t=a(r);if(n(t,u))return t[u];var e=t.constructor;return o(e)&&t instanceof e?e.prototype:t instanceof f?s:null}},function(r,t,e){var n=e(6);r.exports=!n((function(){function r(){}return r.prototype.constructor=null,Object.getPrototypeOf(new r)!==r.prototype}))},function(r,t,e){var n=e(5),o=e(43),a=e(10);r.exports=function(r,t,e){n?o.f(r,t,a(0,e)):r[t]=e}},function(r,t,e){var n,o,a,i=e(6),c=e(20),u=e(19),f=e(69),s=e(98),p=e(46),l=e(32),y=e(35),h=l("iterator"),v=!1;[].keys&&("next"in(a=[].keys())?(o=s(s(a)))!==Object.prototype&&(n=o):v=!0),!u(n)||i((function(){var r={};return n[h].call(r)!==r}))?n={}:y&&(n=f(n)),c(n[h])||p(n,h,(function(){return this})),r.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:v}},function(r,t,e){var n=e(2),o=e(7),a=e(45),i=e(103),c=e(104),u=e(105),f=e(106),s=e(35),p=f((function(){for(var r,t=this.iterator,e=this.next;this.remaining;)if(this.remaining--,r=a(o(e,t)),this.done=!!r.done)return;if(r=a(o(e,t)),!(this.done=!!r.done))return r.value}));n({target:"Iterator",proto:!0,real:!0,forced:s},{drop:function(r){a(this);var t=u(c(+r));return new p(i(this),{remaining:t})}})},function(r,t,e){r.exports=function(r){return{iterator:r,next:r.next,done:!1}}},function(r,t,e){var n=RangeError;r.exports=function(r){if(r==r)return r;throw new n("NaN is not allowed")}},function(r,t,e){var n=e(60),o=RangeError;r.exports=function(r){var t=n(r);if(t<0)throw new o("The argument can't be less than 0");return t}},function(t,e,n){var o=n(7),a=n(69),i=n(42),c=n(107),u=n(32),f=n(50),s=n(28),p=n(101).IteratorPrototype,l=n(108),y=n(109),h=u("toStringTag"),v="IteratorHelper",g="WrapForValidIterator",d=f.set,b=function(t){var e=f.getterFor(t?g:v);return c(a(p),{next:function(){var n=e(this);if(t)return n.nextHandler();try{var o=n.done?r:n.nextHandler();return l(o,n.done)}catch(r){throw n.done=!0,r}},return:function(){var n=e(this),a=n.iterator;if(n.done=!0,t){var i=s(a,"return");return i?o(i,a):l(r,!0)}if(n.inner)try{y(n.inner.iterator,"normal")}catch(r){return y(a,"throw",r)}return a&&y(a,"normal"),l(r,!0)}})},m=b(!0),w=b(!1);i(w,h,"Iterator Helper"),t.exports=function(r,t){var e=function(e,n){n?(n.iterator=e.iterator,n.next=e.next):n=e,n.type=t?g:v,n.nextHandler=r,n.counter=0,n.done=!1,d(this,n)};return e.prototype=t?m:w,e}},function(r,t,e){var n=e(46);r.exports=function(r,t,e){for(var o in t)n(r,o,t[o],e);return r}},function(r,t,e){r.exports=function(r,t){return{value:r,done:t}}},function(r,t,e){var n=e(7),o=e(45),a=e(28);r.exports=function(r,t,e){var i,c;o(r);try{if(!(i=a(r,"return"))){if("throw"===t)throw e;return e}i=n(i,r)}catch(r){c=!0,i=r}if("throw"===t)throw e;if(c)throw i;return o(i),e}},function(r,t,e){var n=e(2),o=e(111),a=e(29),i=e(45),c=e(103);n({target:"Iterator",proto:!0,real:!0},{every:function(r){i(this),a(r);var t=c(this),e=0;return!o(t,(function(t,n){if(!r(t,e++))return n()}),{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},function(r,t,e){var n=e(112),o=e(7),a=e(45),i=e(30),c=e(113),u=e(62),f=e(23),s=e(115),p=e(116),l=e(109),y=TypeError,h=function(r,t){this.stopped=r,this.result=t},v=h.prototype;r.exports=function(r,t,e){var g,d,b,m,w,x,E,A=e&&e.that,R=!(!e||!e.AS_ENTRIES),O=!(!e||!e.IS_RECORD),S=!(!e||!e.IS_ITERATOR),T=!(!e||!e.INTERRUPTED),I=n(t,A),_=function(r){return g&&l(g,"normal",r),new h(!0,r)},D=function(r){return R?(a(r),T?I(r[0],r[1],_):I(r[0],r[1])):T?I(r,_):I(r)};if(O)g=r.iterator;else if(S)g=r;else{if(!(d=p(r)))throw new y(i(r)+" is not iterable");if(c(d)){for(b=0,m=u(r);m>b;b++)if((w=D(r[b]))&&f(v,w))return w;return new h(!1)}g=s(r,d)}for(x=O?r.next:g.next;!(E=o(x,g)).done;){try{w=D(E.value)}catch(r){l(g,"throw",r)}if("object"==typeof w&&w&&f(v,w))return w}return new h(!1)}},function(t,e,n){var o=n(83),a=n(29),i=n(8),c=o(o.bind);t.exports=function(t,e){return a(t),e===r?t:i?c(t,e):function(){return t.apply(e,arguments)}}},function(t,e,n){var o=n(32),a=n(114),i=o("iterator"),c=Array.prototype;t.exports=function(t){return t!==r&&(a.Array===t||c[i]===t)}},function(r,t,e){r.exports={}},function(r,t,e){var n=e(7),o=e(29),a=e(45),i=e(30),c=e(116),u=TypeError;r.exports=function(r,t){var e=arguments.length<2?c(r):t;if(o(e))return a(n(e,r));throw new u(i(r)+" is not iterable")}},function(r,t,e){var n=e(117),o=e(28),a=e(16),i=e(114),c=e(32)("iterator");r.exports=function(r){if(!a(r))return o(r,c)||o(r,"@@iterator")||i[n(r)]}},function(t,e,n){var o=n(118),a=n(20),i=n(14),c=n(32)("toStringTag"),u=Object,f="Arguments"===i(function(){return arguments}());t.exports=o?i:function(t){var e,n,o;return t===r?"Undefined":null===t?"Null":"string"==typeof(n=function(r,t){try{return r[t]}catch(r){}}(e=u(t),c))?n:f?i(e):"Object"===(o=i(e))&&a(e.callee)?"Arguments":o}},function(r,t,e){var n={};n[e(32)("toStringTag")]="z",r.exports="[object z]"===String(n)},function(r,t,e){var n=e(2),o=e(7),a=e(29),i=e(45),c=e(103),u=e(106),f=e(120),s=e(35),p=u((function(){for(var r,t,e=this.iterator,n=this.predicate,a=this.next;;){if(r=i(o(a,e)),this.done=!!r.done)return;if(t=r.value,f(e,n,[t,this.counter++],!0))return t}}));n({target:"Iterator",proto:!0,real:!0,forced:s},{filter:function(r){return i(this),a(r),new p(c(this),{predicate:r})}})},function(r,t,e){var n=e(45),o=e(109);r.exports=function(r,t,e,a){try{return a?t(n(e)[0],e[1]):t(e)}catch(t){o(r,"throw",t)}}},function(r,t,e){var n=e(2),o=e(111),a=e(29),i=e(45),c=e(103);n({target:"Iterator",proto:!0,real:!0},{find:function(r){i(this),a(r);var t=c(this),e=0;return o(t,(function(t,n){if(r(t,e++))return n(t)}),{IS_RECORD:!0,INTERRUPTED:!0}).result}})},function(r,t,e){var n=e(2),o=e(7),a=e(29),i=e(45),c=e(103),u=e(123),f=e(106),s=e(109),p=e(35),l=f((function(){for(var r,t,e=this.iterator,n=this.mapper;;){if(t=this.inner)try{if(!(r=i(o(t.next,t.iterator))).done)return r.value;this.inner=null}catch(r){s(e,"throw",r)}if(r=i(o(this.next,e)),this.done=!!r.done)return;try{this.inner=u(n(r.value,this.counter++),!1)}catch(r){s(e,"throw",r)}}}));n({target:"Iterator",proto:!0,real:!0,forced:p},{flatMap:function(r){return i(this),a(r),new l(c(this),{mapper:r,inner:null})}})},function(t,e,n){var o=n(7),a=n(45),i=n(103),c=n(116);t.exports=function(t,e){e&&"string"==typeof t||a(t);var n=c(t);return i(a(n!==r?o(n,t):t))}},function(r,t,e){var n=e(2),o=e(111),a=e(29),i=e(45),c=e(103);n({target:"Iterator",proto:!0,real:!0},{forEach:function(r){i(this),a(r);var t=c(this),e=0;o(t,(function(t){r(t,e++)}),{IS_RECORD:!0})}})},function(r,t,e){var n=e(2),o=e(7),a=e(38),i=e(23),c=e(101).IteratorPrototype,u=e(106),f=e(123),s=e(35),p=u((function(){return o(this.next,this.iterator)}),!0);n({target:"Iterator",stat:!0,forced:s},{from:function(r){var t=f("string"==typeof r?a(r):r,!0);return i(c,t.iterator)?t.iterator:new p(t)}})},function(r,t,e){var n=e(2),o=e(127);n({target:"Iterator",proto:!0,real:!0,forced:e(35)},{map:o})},function(r,t,e){var n=e(7),o=e(29),a=e(45),i=e(103),c=e(106),u=e(120),f=c((function(){var r=this.iterator,t=a(n(this.next,r));if(!(this.done=!!t.done))return u(r,this.mapper,[t.value,this.counter++],!0)}));r.exports=function(r){return a(this),o(r),new f(i(this),{mapper:r})}},function(t,e,n){var o=n(2),a=n(111),i=n(29),c=n(45),u=n(103),f=TypeError;o({target:"Iterator",proto:!0,real:!0},{reduce:function(t){c(this),i(t);var e=u(this),n=arguments.length<2,o=n?r:arguments[1],s=0;if(a(e,(function(r){n?(n=!1,o=r):o=t(o,r,s),s++}),{IS_RECORD:!0}),n)throw new f("Reduce of empty iterator with no initial value");return o}})},function(r,t,e){var n=e(2),o=e(111),a=e(29),i=e(45),c=e(103);n({target:"Iterator",proto:!0,real:!0},{some:function(r){i(this),a(r);var t=c(this),e=0;return o(t,(function(t,n){if(r(t,e++))return n()}),{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},function(t,e,n){var o=n(2),a=n(7),i=n(45),c=n(103),u=n(104),f=n(105),s=n(106),p=n(109),l=n(35),y=s((function(){var t=this.iterator;if(!this.remaining--)return this.done=!0,p(t,"normal",r);var e=i(a(this.next,t));return(this.done=!!e.done)?void 0:e.value}));o({target:"Iterator",proto:!0,real:!0,forced:l},{take:function(r){i(this);var t=f(u(+r));return new y(c(this),{remaining:t})}})},function(r,t,e){var n=e(2),o=e(45),a=e(111),i=e(103),c=[].push;n({target:"Iterator",proto:!0,real:!0},{toArray:function(){var r=[];return a(i(o(this)),c,{that:r,IS_RECORD:!0}),r}})},function(r,t,e){var n=e(2),o=e(13),a=e(29),i=e(15),c=e(111),u=e(133),f=e(35),s=e(6),p=u.Map,l=u.has,y=u.get,h=u.set,v=o([].push),g=f||s((function(){return 1!==p.groupBy("ab",(function(r){return r})).get("a").length}));n({target:"Map",stat:!0,forced:f||g},{groupBy:function(r,t){i(r),a(t);var e=new p,n=0;return c(r,(function(r){var o=t(r,n++);l(e,o)?v(y(e,o),r):h(e,o,[r])})),e}})},function(r,t,e){var n=e(13),o=Map.prototype;r.exports={Map,set:n(o.set),get:n(o.get),has:n(o.has),remove:n(o.delete),proto:o}},function(r,t,e){var n=e(2),o=e(22),a=e(13),i=e(29),c=e(15),u=e(17),f=e(111),s=e(6),p=Object.groupBy,l=o("Object","create"),y=a([].push);n({target:"Object",stat:!0,forced:!p||s((function(){return 1!==p("ab",(function(r){return r})).a.length}))},{groupBy:function(r,t){c(r),i(t);var e=l(null),n=0;return f(r,(function(r){var o=u(t(r,n++));o in e?y(e[o],r):e[o]=[r]})),e}})},function(t,e,n){var o=n(2),a=n(3),i=n(136),c=n(137),u=n(138),f=n(29),s=n(139),p=a.Promise,l=!1;o({target:"Promise",stat:!0,forced:!p||!p.try||s((function(){p.try((function(r){l=8===r}),8)})).error||!l},{try:function(t){var e=arguments.length>1?c(arguments,1):[],n=u.f(this),o=s((function(){return i(f(t),r,e)}));return(o.error?n.reject:n.resolve)(o.value),n.promise}})},function(r,t,e){var n=e(8),o=Function.prototype,a=o.apply,i=o.call;r.exports="object"==typeof Reflect&&Reflect.apply||(n?i.bind(a):function(){return i.apply(a,arguments)})},function(r,t,e){var n=e(13);r.exports=n([].slice)},function(t,e,n){var o=n(29),a=TypeError,i=function(t){var e,n;this.promise=new t((function(t,o){if(e!==r||n!==r)throw new a("Bad Promise constructor");e=t,n=o})),this.resolve=o(e),this.reject=o(n)};t.exports.f=function(r){return new i(r)}},function(r,t,e){r.exports=function(r){try{return{error:!1,value:r()}}catch(r){return{error:!0,value:r}}}},function(r,t,e){var n=e(2),o=e(138);n({target:"Promise",stat:!0},{withResolvers:function(){var r=o.f(this);return{promise:r.promise,resolve:r.resolve,reject:r.reject}}})},function(r,t,e){var n=e(3),o=e(5),a=e(81),i=e(142),c=e(6),u=n.RegExp,f=u.prototype;o&&c((function(){var r=!0;try{u(".","d")}catch(t){r=!1}var t={},e="",n=r?"dgimsy":"gimsy",o=function(r,n){Object.defineProperty(t,r,{get:function(){return e+=n,!0}})},a={dotAll:"s",global:"g",ignoreCase:"i",multiline:"m",sticky:"y"};for(var i in r&&(a.hasIndices="d"),a)o(i,a[i]);return Object.getOwnPropertyDescriptor(f,"flags").get.call(t)!==n||e!==n}))&&a(f,"flags",{configurable:!0,get:i})},function(r,t,e){var n=e(45);r.exports=function(){var r=n(this),t="";return r.hasIndices&&(t+="d"),r.global&&(t+="g"),r.ignoreCase&&(t+="i"),r.multiline&&(t+="m"),r.dotAll&&(t+="s"),r.unicode&&(t+="u"),r.unicodeSets&&(t+="v"),r.sticky&&(t+="y"),t}},function(r,t,e){var n=e(2),o=e(13),a=e(15),i=e(144),c=o("".charCodeAt);n({target:"String",proto:!0},{isWellFormed:function(){for(var r=i(a(this)),t=r.length,e=0;e=56320||++e>=t||56320!=(64512&c(r,e))))return!1}return!0}})},function(r,t,e){var n=e(117),o=String;r.exports=function(r){if("Symbol"===n(r))throw new TypeError("Cannot convert a Symbol value to a string");return o(r)}},function(r,t,e){var n=e(2),o=e(7),a=e(13),i=e(15),c=e(144),u=e(6),f=Array,s=a("".charAt),p=a("".charCodeAt),l=a([].join),y="".toWellFormed,h=y&&u((function(){return"1"!==o(y,1)}));n({target:"String",proto:!0,forced:h},{toWellFormed:function(){var r=c(i(this));if(h)return o(y,r);for(var t=r.length,e=f(t),n=0;n=56320||n+1>=t||56320!=(64512&p(r,n+1))?e[n]="�":(e[n]=s(r,n),e[++n]=s(r,n))}return l(e,"")}})},function(r,t,e){var n=e(67),o=e(147),a=o.aTypedArray,i=o.exportTypedArrayMethod,c=o.getTypedArrayConstructor;i("toReversed",(function(){return n(a(this),c(this))}))},function(t,e,n){var o,a,i,c=n(148),u=n(5),f=n(3),s=n(20),p=n(19),l=n(37),y=n(117),h=n(30),v=n(42),g=n(46),d=n(81),b=n(23),m=n(98),w=n(149),x=n(32),E=n(39),A=n(50),R=A.enforce,O=A.get,S=f.Int8Array,T=S&&S.prototype,I=f.Uint8ClampedArray,_=I&&I.prototype,D=S&&m(S),j=T&&m(T),P=Object.prototype,C=f.TypeError,M=x("toStringTag"),k=E("TYPED_ARRAY_TAG"),B="TypedArrayConstructor",N=c&&!!w&&"Opera"!==y(f.opera),U=!1,L={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},F={BigInt64Array:8,BigUint64Array:8},W=function(r){var t=m(r);if(p(t)){var e=O(t);return e&&l(e,B)?e[B]:W(t)}},V=function(r){if(!p(r))return!1;var t=y(r);return l(L,t)||l(F,t)};for(o in L)(i=(a=f[o])&&a.prototype)?R(i)[B]=a:N=!1;for(o in F)(i=(a=f[o])&&a.prototype)&&(R(i)[B]=a);if((!N||!s(D)||D===Function.prototype)&&(D=function(){throw new C("Incorrect invocation")},N))for(o in L)f[o]&&w(f[o],D);if((!N||!j||j===P)&&(j=D.prototype,N))for(o in L)f[o]&&w(f[o].prototype,j);if(N&&m(_)!==j&&w(_,j),u&&!l(j,M))for(o in U=!0,d(j,M,{configurable:!0,get:function(){return p(this)?this[k]:r}}),L)f[o]&&v(f[o],k,o);t.exports={NATIVE_ARRAY_BUFFER_VIEWS:N,TYPED_ARRAY_TAG:U&&k,aTypedArray:function(r){if(V(r))return r;throw new C("Target is not a typed array")},aTypedArrayConstructor:function(r){if(s(r)&&(!w||b(D,r)))return r;throw new C(h(r)+" is not a typed array constructor")},exportTypedArrayMethod:function(r,t,e,n){if(u){if(e)for(var o in L){var a=f[o];if(a&&l(a.prototype,r))try{delete a.prototype[r]}catch(e){try{a.prototype[r]=t}catch(r){}}}j[r]&&!e||g(j,r,e?t:N&&T[r]||t,n)}},exportTypedArrayStaticMethod:function(r,t,e){var n,o;if(u){if(w){if(e)for(n in L)if((o=f[n])&&l(o,r))try{delete o[r]}catch(r){}if(D[r]&&!e)return;try{return g(D,r,e?t:N&&D[r]||t)}catch(r){}}for(n in L)!(o=f[n])||o[r]&&!e||g(o,r,t)}},getTypedArrayConstructor:W,isView:function(r){if(!p(r))return!1;var t=y(r);return"DataView"===t||l(L,t)||l(F,t)},isTypedArray:V,TypedArray:D,TypedArrayPrototype:j}},function(r,t,e){r.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},function(t,e,n){var o=n(85),a=n(19),i=n(15),c=n(150);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var r,t=!1,e={};try{(r=o(Object.prototype,"__proto__","set"))(e,[]),t=e instanceof Array}catch(r){}return function(e,n){return i(e),c(n),a(e)?(t?r(e,n):e.__proto__=n,e):e}}():r)},function(r,t,e){var n=e(151),o=String,a=TypeError;r.exports=function(r){if(n(r))return r;throw new a("Can't set "+o(r)+" as a prototype")}},function(r,t,e){var n=e(19);r.exports=function(r){return n(r)||null===r}},function(t,e,n){var o=n(147),a=n(13),i=n(29),c=n(74),u=o.aTypedArray,f=o.getTypedArrayConstructor,s=o.exportTypedArrayMethod,p=a(o.TypedArrayPrototype.sort);s("toSorted",(function(t){t!==r&&i(t);var e=u(this),n=c(f(e),e);return p(n,t)}))},function(r,t,e){var n=e(79),o=e(147),a=e(154),i=e(60),c=e(155),u=o.aTypedArray,f=o.getTypedArrayConstructor,s=o.exportTypedArrayMethod,p=!!function(){try{new Int8Array(1).with(2,{valueOf:function(){throw 8}})}catch(r){return 8===r}}();s("with",{with:function(r,t){var e=u(this),o=i(r),s=a(e)?c(t):+t;return n(e,f(e),o,s)}}.with,!p)},function(r,t,e){var n=e(117);r.exports=function(r){var t=n(r);return"BigInt64Array"===t||"BigUint64Array"===t}},function(r,t,e){var n=e(18),o=TypeError;r.exports=function(r){var t=n(r,"number");if("number"==typeof t)throw new o("Can't convert number to bigint");return BigInt(t)}},function(t,e,n){var o=n(2),a=n(3),i=n(22),c=n(10),u=n(43).f,f=n(37),s=n(97),p=n(157),l=n(158),y=n(159),h=n(160),v=n(5),g=n(35),d="DOMException",b=i("Error"),m=i(d),w=function(){s(this,x);var t=arguments.length,e=l(t<1?r:arguments[0]),n=l(t<2?r:arguments[1],"Error"),o=new m(e,n),a=new b(e);return a.name=d,u(o,"stack",c(1,h(a.stack,1))),p(o,this,w),o},x=w.prototype=m.prototype,E="stack"in new b(d),A="stack"in new m(1,2),R=m&&v&&Object.getOwnPropertyDescriptor(a,d),O=!(!R||R.writable&&R.configurable),S=E&&!O&&!A;o({global:!0,constructor:!0,forced:g||S},{DOMException:S?w:m});var T=i(d),I=T.prototype;if(I.constructor!==T)for(var _ in g||u(I,"constructor",c(1,T)),y)if(f(y,_)){var D=y[_],j=D.s;f(T,j)||u(T,j,c(6,D.c))}},function(r,t,e){var n=e(20),o=e(19),a=e(149);r.exports=function(r,t,e){var i,c;return a&&n(i=t.constructor)&&i!==e&&o(c=i.prototype)&&c!==e.prototype&&a(r,c),r}},function(t,e,n){var o=n(144);t.exports=function(t,e){return t===r?arguments.length<2?"":e:o(t)}},function(r,t,e){r.exports={IndexSizeError:{s:"INDEX_SIZE_ERR",c:1,m:1},DOMStringSizeError:{s:"DOMSTRING_SIZE_ERR",c:2,m:0},HierarchyRequestError:{s:"HIERARCHY_REQUEST_ERR",c:3,m:1},WrongDocumentError:{s:"WRONG_DOCUMENT_ERR",c:4,m:1},InvalidCharacterError:{s:"INVALID_CHARACTER_ERR",c:5,m:1},NoDataAllowedError:{s:"NO_DATA_ALLOWED_ERR",c:6,m:0},NoModificationAllowedError:{s:"NO_MODIFICATION_ALLOWED_ERR",c:7,m:1},NotFoundError:{s:"NOT_FOUND_ERR",c:8,m:1},NotSupportedError:{s:"NOT_SUPPORTED_ERR",c:9,m:1},InUseAttributeError:{s:"INUSE_ATTRIBUTE_ERR",c:10,m:1},InvalidStateError:{s:"INVALID_STATE_ERR",c:11,m:1},SyntaxError:{s:"SYNTAX_ERR",c:12,m:1},InvalidModificationError:{s:"INVALID_MODIFICATION_ERR",c:13,m:1},NamespaceError:{s:"NAMESPACE_ERR",c:14,m:1},InvalidAccessError:{s:"INVALID_ACCESS_ERR",c:15,m:1},ValidationError:{s:"VALIDATION_ERR",c:16,m:0},TypeMismatchError:{s:"TYPE_MISMATCH_ERR",c:17,m:1},SecurityError:{s:"SECURITY_ERR",c:18,m:1},NetworkError:{s:"NETWORK_ERR",c:19,m:1},AbortError:{s:"ABORT_ERR",c:20,m:1},URLMismatchError:{s:"URL_MISMATCH_ERR",c:21,m:1},QuotaExceededError:{s:"QUOTA_EXCEEDED_ERR",c:22,m:1},TimeoutError:{s:"TIMEOUT_ERR",c:23,m:1},InvalidNodeTypeError:{s:"INVALID_NODE_TYPE_ERR",c:24,m:1},DataCloneError:{s:"DATA_CLONE_ERR",c:25,m:1}}},function(r,t,e){var n=e(13),o=Error,a=n("".replace),i=String(new o("zxcasd").stack),c=/\n\s*at [^:]*:[^\n]*/,u=c.test(i);r.exports=function(r,t){if(u&&"string"==typeof r&&!o.prepareStackTrace)for(;t--;)r=a(r,c,"");return r}},function(t,e,n){var o,a=n(35),i=n(2),c=n(3),u=n(22),f=n(13),s=n(6),p=n(39),l=n(20),y=n(162),h=n(16),v=n(19),g=n(21),d=n(111),b=n(45),m=n(117),w=n(37),x=n(100),E=n(42),A=n(62),R=n(163),O=n(164),S=n(133),T=n(165),I=n(166),_=n(90),D=n(168),j=n(94),P=c.Object,C=c.Array,M=c.Date,k=c.Error,B=c.TypeError,N=c.PerformanceMark,U=u("DOMException"),L=S.Map,F=S.has,W=S.get,V=S.set,z=T.Set,H=T.add,G=T.has,Y=u("Object","keys"),Q=f([].push),X=f((!0).valueOf),q=f(1..valueOf),K=f("".valueOf),Z=f(M.prototype.getTime),$=p("structuredClone"),J="DataCloneError",rr="Transferring",tr=function(r){return!s((function(){var t=new c.Set([7]),e=r(t),n=r(P(7));return e===t||!e.has(7)||!v(n)||7!=+n}))&&r},er=function(r,t){return!s((function(){var e=new t,n=r({a:e,b:e});return!(n&&n.a===n.b&&n.a instanceof t&&n.a.stack===e.stack)}))},nr=c.structuredClone,or=a||!er(nr,k)||!er(nr,U)||(o=nr,!!s((function(){var r=o(new c.AggregateError([1],$,{cause:3}));return"AggregateError"!==r.name||1!==r.errors[0]||r.message!==$||3!==r.cause}))),ar=!nr&&tr((function(r){return new N($,{detail:r}).detail})),ir=tr(nr)||ar,cr=function(r){throw new U("Uncloneable type: "+r,J)},ur=function(r,t){throw new U((t||"Cloning")+" of "+r+" cannot be properly polyfilled in this engine",J)},fr=function(r,t){return ir||ur(t),ir(r)},sr=function(t,e,n){if(F(e,t))return W(e,t);var o,a,i,u,f,s;if("SharedArrayBuffer"===(n||m(t)))o=ir?ir(t):t;else{var p=c.DataView;p||l(t.slice)||ur("ArrayBuffer");try{if(l(t.slice)&&!t.resizable)o=t.slice(0);else{a=t.byteLength,i="maxByteLength"in t?{maxByteLength:t.maxByteLength}:r,o=new ArrayBuffer(a,i),u=new p(t),f=new p(o);for(s=0;s1&&!h(arguments[1])?b(arguments[1]):r,a=o?o.transfer:r;a!==r&&(n=function(t,e){if(!v(t))throw new B("Transfer option cannot be converted to a sequence");var n=[];d(t,(function(r){Q(n,b(r))}));for(var o,a,i,u,f,s=0,p=A(n),h=new z;s { ;// external "ReactJSXRuntime" const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"]; ;// ./node_modules/@wordpress/viewport/build-module/with-viewport-match.js +/* wp:polyfill */ /** * WordPress dependencies */ diff --git a/wp-includes/js/dist/widgets.js b/wp-includes/js/dist/widgets.js index c9848292ef..a303dd08a8 100644 --- a/wp-includes/js/dist/widgets.js +++ b/wp-includes/js/dist/widgets.js @@ -123,11 +123,12 @@ const brush = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(exte const external_wp_i18n_namespaceObject = window["wp"]["i18n"]; ;// external ["wp","element"] const external_wp_element_namespaceObject = window["wp"]["element"]; -;// external ["wp","data"] -const external_wp_data_namespaceObject = window["wp"]["data"]; ;// external ["wp","coreData"] const external_wp_coreData_namespaceObject = window["wp"]["coreData"]; +;// external ["wp","data"] +const external_wp_data_namespaceObject = window["wp"]["data"]; ;// ./node_modules/@wordpress/widgets/build-module/blocks/legacy-widget/edit/widget-type-selector.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -184,7 +185,6 @@ function WidgetTypeSelector({ ;// ./node_modules/@wordpress/widgets/build-module/blocks/legacy-widget/edit/inspector-card.js - function InspectorCard({ name, description @@ -219,7 +219,7 @@ var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_w /** * An API for creating and loading a widget control (a

    * element) that is compatible with most third party widget scripts. By not - * using React for this, we ensure that we have complete contorl over the DOM + * using React for this, we ensure that we have complete control over the DOM * and do not accidentally remove any elements that a third party widget script * has attached an event listener to. * @@ -266,7 +266,7 @@ class Control { } /** - * Clean up the control so that it can be garabge collected. + * Clean up the control so that it can be garbage collected. * * @access public */ @@ -637,7 +637,6 @@ function serializeForm(form) { */ - function Form({ title, isVisible, @@ -677,7 +676,7 @@ function Form({ onChangeHasPreview, onError(error) { window.console.error(error); - createNotice('error', (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: the name of the affected block. */ + createNotice('error', (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: the name of the affected block. */ (0,external_wp_i18n_namespaceObject.__)('The "%s" block was affected by errors and may not function properly. Check the developer tools for more details.'), idBase || id)); } }); @@ -739,8 +738,6 @@ function Form({ - - function Preview({ idBase, instance, @@ -849,7 +846,6 @@ function Preview({ */ - function NoPreview({ name }) { @@ -914,7 +910,6 @@ function ConvertToBlocksButton({ - /** * Internal dependencies */ @@ -925,8 +920,6 @@ function ConvertToBlocksButton({ - - function Edit(props) { const { id, @@ -1011,7 +1004,6 @@ function NotEmpty({ record: widgetType, hasResolved: hasResolvedWidgetType } = (0,external_wp_coreData_namespaceObject.useEntityRecord)('root', 'widgetType', widgetTypeId); - const isNavigationMode = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).isNavigationMode(), []); const setInstance = (0,external_wp_element_namespaceObject.useCallback)(nextInstance => { setAttributes({ instance: nextInstance @@ -1031,7 +1023,7 @@ function NotEmpty({ children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}) }); } - const mode = idBase && (isNavigationMode || !isSelected) ? 'preview' : 'edit'; + const mode = idBase && !isSelected ? 'preview' : 'edit'; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [idBase === 'text' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "other", @@ -1068,6 +1060,7 @@ function NotEmpty({ } ;// ./node_modules/@wordpress/widgets/build-module/blocks/legacy-widget/transforms.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -1354,8 +1347,6 @@ const group = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(exte - - function edit_Edit(props) { const { clientId @@ -1418,8 +1409,6 @@ function PreviewContent({ */ - - function save({ attributes }) { @@ -1441,8 +1430,6 @@ function save({ */ - - const v1 = { attributes: { title: { @@ -1470,6 +1457,7 @@ const v1 = { /* harmony default export */ const deprecated = ([v1]); ;// ./node_modules/@wordpress/widgets/build-module/blocks/widget-group/index.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -1565,6 +1553,7 @@ const moveTo = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ext /* harmony default export */ const move_to = (moveTo); ;// ./node_modules/@wordpress/widgets/build-module/components/move-to-widget-area/index.js +/* wp:polyfill */ /** * WordPress dependencies */ @@ -1644,6 +1633,7 @@ function addWidgetIdToBlock(block, widgetId) { } ;// ./node_modules/@wordpress/widgets/build-module/register-legacy-widget-variations.js +/* wp:polyfill */ /** * WordPress dependencies */ diff --git a/wp-includes/js/dist/widgets.min.js b/wp-includes/js/dist/widgets.min.js index 4802afde26..f401f55fc6 100644 --- a/wp-includes/js/dist/widgets.min.js +++ b/wp-includes/js/dist/widgets.min.js @@ -1,2 +1,2 @@ /*! This file is auto-generated */ -(()=>{"use strict";var e={n:t=>{var i=t&&t.__esModule?()=>t.default:()=>t;return e.d(i,{a:i}),i},d:(t,i)=>{for(var n in i)e.o(i,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:i[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{MoveToWidgetArea:()=>X,addWidgetIdToBlock:()=>K,getWidgetIdFromBlock:()=>q,registerLegacyWidgetBlock:()=>ee,registerLegacyWidgetVariations:()=>Y,registerWidgetGroupBlock:()=>te});var i={};e.r(i),e.d(i,{yu:()=>W,UU:()=>A,W0:()=>O});var n={};e.r(n),e.d(n,{yu:()=>$,UU:()=>Q,W0:()=>Z});const s=window.wp.blocks,r=window.wp.primitives,o=window.ReactJSXRuntime,a=(0,o.jsx)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,o.jsx)(r.Path,{d:"M6 3H8V5H16V3H18V5C19.1046 5 20 5.89543 20 7V19C20 20.1046 19.1046 21 18 21H6C4.89543 21 4 20.1046 4 19V7C4 5.89543 4.89543 5 6 5V3ZM18 6.5H6C5.72386 6.5 5.5 6.72386 5.5 7V8H18.5V7C18.5 6.72386 18.2761 6.5 18 6.5ZM18.5 9.5H5.5V19C5.5 19.2761 5.72386 19.5 6 19.5H18C18.2761 19.5 18.5 19.2761 18.5 19V9.5ZM11 11H13V13H11V11ZM7 11V13H9V11H7ZM15 13V11H17V13H15Z"})});function c(e){var t,i,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var s=e.length;for(t=0;t{var t;const i=null!==(t=e(d.store).getSettings()?.widgetTypesToHideFromLegacyWidgetBlock)&&void 0!==t?t:[];return e(p.store).getWidgetTypes({per_page:-1})?.filter((e=>!i.includes(e.id)))}),[]);return i?0===i.length?(0,m.__)("There are no widgets available."):(0,o.jsx)(h.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,m.__)("Legacy widget"),value:null!=e?e:"",options:[{value:"",label:(0,m.__)("Select widget")},...i.map((e=>({value:e.id,label:e.name})))],onChange:e=>{if(e){const n=i.find((t=>t.id===e));t({selectedId:n.id,isMulti:n.is_multi})}else t({selectedId:null})}}):(0,o.jsx)(h.Spinner,{})}function b({name:e,description:t}){return(0,o.jsxs)("div",{className:"wp-block-legacy-widget-inspector-card",children:[(0,o.jsx)("h3",{className:"wp-block-legacy-widget-inspector-card__name",children:e}),(0,o.jsx)("span",{children:t})]})}const v=window.wp.notices,y=window.wp.compose,_=window.wp.apiFetch;var x=e.n(_);class j{constructor({id:e,idBase:t,instance:i,onChangeInstance:n,onChangeHasPreview:s,onError:r}){this.id=e,this.idBase=t,this._instance=i,this._hasPreview=null,this.onChangeInstance=n,this.onChangeHasPreview=s,this.onError=r,this.number=++k,this.handleFormChange=(0,y.debounce)(this.handleFormChange.bind(this),200),this.handleFormSubmit=this.handleFormSubmit.bind(this),this.initDOM(),this.bindEvents(),this.loadContent()}destroy(){this.unbindEvents(),this.element.remove()}initDOM(){var e,t;this.element=B("div",{class:"widget open"},[B("div",{class:"widget-inside"},[this.form=B("form",{class:"form",method:"post"},[B("input",{class:"widget-id",type:"hidden",name:"widget-id",value:null!==(e=this.id)&&void 0!==e?e:`${this.idBase}-${this.number}`}),B("input",{class:"id_base",type:"hidden",name:"id_base",value:null!==(t=this.idBase)&&void 0!==t?t:this.id}),B("input",{class:"widget-width",type:"hidden",name:"widget-width",value:"250"}),B("input",{class:"widget-height",type:"hidden",name:"widget-height",value:"200"}),B("input",{class:"widget_number",type:"hidden",name:"widget_number",value:this.idBase?this.number.toString():""}),this.content=B("div",{class:"widget-content"}),this.id&&B("button",{class:"button is-primary",type:"submit"},(0,m.__)("Save"))])])])}bindEvents(){if(window.jQuery){const{jQuery:e}=window;e(this.form).on("change",null,this.handleFormChange),e(this.form).on("input",null,this.handleFormChange),e(this.form).on("submit",this.handleFormSubmit)}else this.form.addEventListener("change",this.handleFormChange),this.form.addEventListener("input",this.handleFormChange),this.form.addEventListener("submit",this.handleFormSubmit)}unbindEvents(){if(window.jQuery){const{jQuery:e}=window;e(this.form).off("change",null,this.handleFormChange),e(this.form).off("input",null,this.handleFormChange),e(this.form).off("submit",this.handleFormSubmit)}else this.form.removeEventListener("change",this.handleFormChange),this.form.removeEventListener("input",this.handleFormChange),this.form.removeEventListener("submit",this.handleFormSubmit)}async loadContent(){try{if(this.id){const{form:e}=await C(this.id);this.content.innerHTML=e}else if(this.idBase){const{form:e,preview:t}=await S({idBase:this.idBase,instance:this.instance,number:this.number});if(this.content.innerHTML=e,this.hasPreview=!T(t),!this.instance.hash){const{instance:e}=await S({idBase:this.idBase,instance:this.instance,number:this.number,formData:H(this.form)});this.instance=e}}if(window.jQuery){const{jQuery:e}=window;e(document).trigger("widget-added",[e(this.element)])}}catch(e){this.onError(e)}}handleFormChange(){this.idBase&&this.saveForm()}handleFormSubmit(e){e.preventDefault(),this.saveForm()}async saveForm(){const e=H(this.form);try{if(this.id){const{form:t}=await C(this.id,e);if(this.content.innerHTML=t,window.jQuery){const{jQuery:e}=window;e(document).trigger("widget-updated",[e(this.element)])}}else if(this.idBase){const{instance:t,preview:i}=await S({idBase:this.idBase,instance:this.instance,number:this.number,formData:e});this.instance=t,this.hasPreview=!T(i)}}catch(e){this.onError(e)}}get instance(){return this._instance}set instance(e){this._instance!==e&&(this._instance=e,this.onChangeInstance(e))}get hasPreview(){return this._hasPreview}set hasPreview(e){this._hasPreview!==e&&(this._hasPreview=e,this.onChangeHasPreview(e))}}let k=0;function B(e,t={},i=null){const n=document.createElement(e);for(const[e,i]of Object.entries(t))n.setAttribute(e,i);if(Array.isArray(i))for(const e of i)e&&n.appendChild(e);else"string"==typeof i&&(n.innerText=i);return n}async function C(e,t=null){let i;return i=t?await x()({path:`/wp/v2/widgets/${e}?context=edit`,method:"PUT",data:{form_data:t}}):await x()({path:`/wp/v2/widgets/${e}?context=edit`,method:"GET"}),{form:i.rendered_form}}async function S({idBase:e,instance:t,number:i,formData:n=null}){const s=await x()({path:`/wp/v2/widget-types/${e}/encode`,method:"POST",data:{instance:t,number:i,form_data:n}});return{instance:s.instance,form:s.form,preview:s.preview}}function T(e){const t=document.createElement("div");return t.innerHTML=e,M(t)}function M(e){switch(e.nodeType){case e.TEXT_NODE:return""===e.nodeValue.trim();case e.ELEMENT_NODE:return!["AUDIO","CANVAS","EMBED","IFRAME","IMG","MATH","OBJECT","SVG","VIDEO"].includes(e.tagName)&&(!e.hasChildNodes()||Array.from(e.childNodes).every(M));default:return!0}}function H(e){return new window.URLSearchParams(Array.from(new window.FormData(e))).toString()}function I({title:e,isVisible:t,id:i,idBase:n,instance:s,isWide:r,onChangeInstance:a,onChangeHasPreview:c}){const d=(0,w.useRef)(),u=(0,y.useViewportMatch)("small"),p=(0,w.useRef)(new Set),f=(0,w.useRef)(new Set),{createNotice:b}=(0,g.useDispatch)(v.store);return(0,w.useEffect)((()=>{if(f.current.has(s))return void f.current.delete(s);const e=new j({id:i,idBase:n,instance:s,onChangeInstance(e){p.current.add(s),f.current.add(e),a(e)},onChangeHasPreview:c,onError(e){window.console.error(e),b("error",(0,m.sprintf)((0,m.__)('The "%s" block was affected by errors and may not function properly. Check the developer tools for more details.'),n||i))}});return d.current.appendChild(e.element),()=>{p.current.has(s)?p.current.delete(s):e.destroy()}}),[i,n,s,a,c,u]),r&&u?(0,o.jsxs)("div",{className:l({"wp-block-legacy-widget__container":t}),children:[t&&(0,o.jsx)("h3",{className:"wp-block-legacy-widget__edit-form-title",children:e}),(0,o.jsx)(h.Popover,{focusOnMount:!1,placement:"right",offset:32,resize:!1,flip:!1,shift:!0,children:(0,o.jsx)("div",{ref:d,className:"wp-block-legacy-widget__edit-form",hidden:!t})})]}):(0,o.jsx)("div",{ref:d,className:"wp-block-legacy-widget__edit-form",hidden:!t,children:(0,o.jsx)("h3",{className:"wp-block-legacy-widget__edit-form-title",children:e})})}function V({idBase:e,instance:t,isVisible:i}){const[n,s]=(0,w.useState)(!1),[r,a]=(0,w.useState)("");(0,w.useEffect)((()=>{const i=void 0===window.AbortController?void 0:new window.AbortController;return async function(){const n=`/wp/v2/widget-types/${e}/render`;return await x()({path:n,method:"POST",signal:i?.signal,data:t?{instance:t}:{}})}().then((e=>{a(e.preview)})).catch((e=>{if("AbortError"!==e.name)throw e})),()=>i?.abort()}),[e,t]);const c=(0,y.useRefEffect)((e=>{if(!n)return;function t(){var t,i;const n=Math.max(null!==(t=e.contentDocument.documentElement?.offsetHeight)&&void 0!==t?t:0,null!==(i=e.contentDocument.body?.offsetHeight)&&void 0!==i?i:0);e.style.height=`${0!==n?n:100}px`}const{IntersectionObserver:i}=e.ownerDocument.defaultView,s=new i((([e])=>{e.isIntersecting&&t()}),{threshold:1});return s.observe(e),e.addEventListener("load",t),()=>{s.disconnect(),e.removeEventListener("load",t)}}),[n]);return(0,o.jsxs)(o.Fragment,{children:[i&&!n&&(0,o.jsx)(h.Placeholder,{children:(0,o.jsx)(h.Spinner,{})}),(0,o.jsx)("div",{className:l("wp-block-legacy-widget__edit-preview",{"is-offscreen":!i||!n}),children:(0,o.jsx)(h.Disabled,{children:(0,o.jsx)("iframe",{ref:c,className:"wp-block-legacy-widget__edit-preview-iframe",tabIndex:"-1",title:(0,m.__)("Legacy Widget Preview"),srcDoc:r,onLoad:e=>{e.target.contentDocument.body.style.overflow="hidden",s(!0)},height:100})})})]})}function P({name:e}){return(0,o.jsxs)("div",{className:"wp-block-legacy-widget__edit-no-preview",children:[e&&(0,o.jsx)("h3",{children:e}),(0,o.jsx)("p",{children:(0,m.__)("No preview available.")})]})}function E({clientId:e,rawInstance:t}){const{replaceBlocks:i}=(0,g.useDispatch)(d.store);return(0,o.jsx)(h.ToolbarButton,{onClick:()=>{t.title?i(e,[(0,s.createBlock)("core/heading",{content:t.title}),...(0,s.rawHandler)({HTML:t.text})]):i(e,(0,s.rawHandler)({HTML:t.text}))},children:(0,m.__)("Convert to blocks")})}function F({attributes:{id:e,idBase:t},setAttributes:i}){return(0,o.jsx)(h.Placeholder,{icon:(0,o.jsx)(d.BlockIcon,{icon:u}),label:(0,m.__)("Legacy Widget"),children:(0,o.jsx)(h.Flex,{children:(0,o.jsx)(h.FlexBlock,{children:(0,o.jsx)(f,{selectedId:null!=e?e:t,onSelect:({selectedId:e,isMulti:t})=>{i(e?t?{id:null,idBase:e,instance:{}}:{id:e,idBase:null,instance:null}:{id:null,idBase:null,instance:null})}})})})})}function N({attributes:{id:e,idBase:t,instance:i},setAttributes:n,clientId:s,isSelected:r,isWide:a=!1}){const[c,l]=(0,w.useState)(null),f=null!=e?e:t,{record:v,hasResolved:y}=(0,p.useEntityRecord)("root","widgetType",f),_=(0,g.useSelect)((e=>e(d.store).isNavigationMode()),[]),x=(0,w.useCallback)((e=>{n({instance:e})}),[]);if(!v&&y)return(0,o.jsx)(h.Placeholder,{icon:(0,o.jsx)(d.BlockIcon,{icon:u}),label:(0,m.__)("Legacy Widget"),children:(0,m.__)("Widget is missing.")});if(!y)return(0,o.jsx)(h.Placeholder,{children:(0,o.jsx)(h.Spinner,{})});const j=!t||!_&&r?"edit":"preview";return(0,o.jsxs)(o.Fragment,{children:["text"===t&&(0,o.jsx)(d.BlockControls,{group:"other",children:(0,o.jsx)(E,{clientId:s,rawInstance:i.raw})}),(0,o.jsx)(d.InspectorControls,{children:(0,o.jsx)(b,{name:v.name,description:v.description})}),(0,o.jsx)(I,{title:v.name,isVisible:"edit"===j,id:e,idBase:t,instance:i,isWide:a,onChangeInstance:x,onChangeHasPreview:l}),t&&(0,o.jsxs)(o.Fragment,{children:[null===c&&"preview"===j&&(0,o.jsx)(h.Placeholder,{children:(0,o.jsx)(h.Spinner,{})}),!0===c&&(0,o.jsx)(V,{idBase:t,instance:i,isVisible:"preview"===j}),!1===c&&"preview"===j&&(0,o.jsx)(P,{name:v.name})]})]})}const L=[{block:"core/calendar",widget:"calendar"},{block:"core/search",widget:"search"},{block:"core/html",widget:"custom_html",transform:({content:e})=>({content:e})},{block:"core/archives",widget:"archives",transform:({count:e,dropdown:t})=>({displayAsDropdown:!!t,showPostCounts:!!e})},{block:"core/latest-posts",widget:"recent-posts",transform:({show_date:e,number:t})=>({displayPostDate:!!e,postsToShow:t})},{block:"core/latest-comments",widget:"recent-comments",transform:({number:e})=>({commentsToShow:e})},{block:"core/tag-cloud",widget:"tag_cloud",transform:({taxonomy:e,count:t})=>({showTagCounts:!!t,taxonomy:e})},{block:"core/categories",widget:"categories",transform:({count:e,dropdown:t,hierarchical:i})=>({displayAsDropdown:!!t,showPostCounts:!!e,showHierarchy:!!i})},{block:"core/audio",widget:"media_audio",transform:({url:e,preload:t,loop:i,attachment_id:n})=>({src:e,id:n,preload:t,loop:i})},{block:"core/video",widget:"media_video",transform:({url:e,preload:t,loop:i,attachment_id:n})=>({src:e,id:n,preload:t,loop:i})},{block:"core/image",widget:"media_image",transform:({alt:e,attachment_id:t,caption:i,height:n,link_classes:s,link_rel:r,link_target_blank:o,link_type:a,link_url:c,size:l,url:d,width:h})=>({alt:e,caption:i,height:n,id:t,link:c,linkClass:s,linkDestination:a,linkTarget:o?"_blank":void 0,rel:r,sizeSlug:l,url:d,width:h})},{block:"core/gallery",widget:"media_gallery",transform:({ids:e,link_type:t,size:i,number:n})=>({ids:e,columns:n,linkTo:t,sizeSlug:i,images:e.map((e=>({id:e})))})},{block:"core/rss",widget:"rss",transform:({url:e,show_author:t,show_date:i,show_summary:n,items:s})=>({feedURL:e,displayAuthor:!!t,displayDate:!!i,displayExcerpt:!!n,itemsToShow:s})}].map((({block:e,widget:t,transform:i})=>({type:"block",blocks:[e],isMatch:({idBase:e,instance:i})=>e===t&&!!i?.raw,transform:({instance:t})=>{const n=(0,s.createBlock)(e,i?i(t.raw):void 0);return t.raw?.title?[(0,s.createBlock)("core/heading",{content:t.raw.title}),n]:n}}))),D={to:L},W={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/legacy-widget",title:"Legacy Widget",category:"widgets",description:"Display a legacy widget.",textdomain:"default",attributes:{id:{type:"string",default:null},idBase:{type:"string",default:null},instance:{type:"object",default:null}},supports:{html:!1,customClassName:!1,reusable:!1},editorStyle:"wp-block-legacy-widget-editor"},{name:A}=W,O={icon:a,edit:function(e){const{id:t,idBase:i}=e.attributes,{isWide:n=!1}=e,s=(0,d.useBlockProps)({className:l({"is-wide-widget":n})});return(0,o.jsx)("div",{...s,children:t||i?(0,o.jsx)(N,{...e}):(0,o.jsx)(F,{...e})})},transforms:D},z=(0,o.jsx)(r.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)(r.Path,{d:"M18 4h-7c-1.1 0-2 .9-2 2v3H6c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2v-3h3c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h3V13c0 1.1.9 2 2 2h2.5v3zm0-4.5H11c-.3 0-.5-.2-.5-.5v-2.5H13c.3 0 .5.2.5.5v2.5zm5-.5c0 .3-.2.5-.5.5h-3V11c0-1.1-.9-2-2-2h-2.5V6c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v7z"})});function R({clientId:e}){return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(h.Placeholder,{className:"wp-block-widget-group__placeholder",icon:(0,o.jsx)(d.BlockIcon,{icon:z}),label:(0,m.__)("Widget Group"),children:(0,o.jsx)(d.ButtonBlockAppender,{rootClientId:e})}),(0,o.jsx)(d.InnerBlocks,{renderAppender:!1})]})}function G({attributes:e,setAttributes:t}){var i;return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(d.RichText,{tagName:"h2",identifier:"title",className:"widget-title",allowedFormats:[],placeholder:(0,m.__)("Title"),value:null!==(i=e.title)&&void 0!==i?i:"",onChange:e=>t({title:e})}),(0,o.jsx)(d.InnerBlocks,{})]})}const U=[{attributes:{title:{type:"string"}},supports:{html:!1,inserter:!0,customClassName:!0,reusable:!1},save:({attributes:e})=>(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(d.RichText.Content,{tagName:"h2",className:"widget-title",value:e.title}),(0,o.jsx)(d.InnerBlocks.Content,{})]})}],$={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/widget-group",title:"Widget Group",category:"widgets",attributes:{title:{type:"string"}},supports:{html:!1,inserter:!0,customClassName:!0,reusable:!1},editorStyle:"wp-block-widget-group-editor",style:"wp-block-widget-group"},{name:Q}=$,Z={title:(0,m.__)("Widget Group"),description:(0,m.__)("Create a classic widget layout with a title that’s styled by your theme for your widget areas."),icon:z,__experimentalLabel:({name:e})=>e,edit:function(e){const{clientId:t}=e,{innerBlocks:i}=(0,g.useSelect)((e=>e(d.store).getBlock(t)),[t]);return(0,o.jsx)("div",{...(0,d.useBlockProps)({className:"widget"}),children:0===i.length?(0,o.jsx)(R,{...e}):(0,o.jsx)(G,{...e})})},save:function({attributes:e}){return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(d.RichText.Content,{tagName:"h2",className:"widget-title",value:e.title}),(0,o.jsx)("div",{className:"wp-widget-group__inner-blocks",children:(0,o.jsx)(d.InnerBlocks.Content,{})})]})},transforms:{from:[{type:"block",isMultiBlock:!0,blocks:["*"],isMatch:(e,t)=>!t.some((e=>"core/widget-group"===e.name)),__experimentalConvert(e){let t=[...e.map((e=>(0,s.createBlock)(e.name,e.attributes,e.innerBlocks)))];const i="core/heading"===t[0].name?t[0]:null;return t=t.filter((e=>e!==i)),(0,s.createBlock)("core/widget-group",{...i&&{title:i.attributes.content}},t)}}]},deprecated:U},J=(0,o.jsx)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,o.jsx)(r.Path,{d:"M19.75 9c0-1.257-.565-2.197-1.39-2.858-.797-.64-1.827-1.017-2.815-1.247-1.802-.42-3.703-.403-4.383-.396L11 4.5V6l.177-.001c.696-.006 2.416-.02 4.028.356.887.207 1.67.518 2.216.957.52.416.829.945.829 1.688 0 .592-.167.966-.407 1.23-.255.281-.656.508-1.236.674-1.19.34-2.82.346-4.607.346h-.077c-1.692 0-3.527 0-4.942.404-.732.209-1.424.545-1.935 1.108-.526.579-.796 1.33-.796 2.238 0 1.257.565 2.197 1.39 2.858.797.64 1.827 1.017 2.815 1.247 1.802.42 3.703.403 4.383.396L13 19.5h.714V22L18 18.5 13.714 15v3H13l-.177.001c-.696.006-2.416.02-4.028-.356-.887-.207-1.67-.518-2.216-.957-.52-.416-.829-.945-.829-1.688 0-.592.167-.966.407-1.23.255-.281.656-.508 1.237-.674 1.189-.34 2.819-.346 4.606-.346h.077c1.692 0 3.527 0 4.941-.404.732-.209 1.425-.545 1.936-1.108.526-.579.796-1.33.796-2.238z"})});function X({currentWidgetAreaId:e,widgetAreas:t,onSelect:i}){return(0,o.jsx)(h.ToolbarGroup,{children:(0,o.jsx)(h.ToolbarItem,{children:n=>(0,o.jsx)(h.DropdownMenu,{icon:J,label:(0,m.__)("Move to widget area"),toggleProps:n,children:({onClose:n})=>(0,o.jsx)(h.MenuGroup,{label:(0,m.__)("Move to"),children:(0,o.jsx)(h.MenuItemsChoice,{choices:t.map((e=>({value:e.id,label:e.name,info:e.description}))),value:e,onSelect:e=>{i(e),n()}})})})})})}function q(e){return e.attributes.__internalWidgetId}function K(e,t){return{...e,attributes:{...e.attributes||{},__internalWidgetId:t}}}function Y(e){const t=(0,g.subscribe)((()=>{var i;const n=null!==(i=e?.widgetTypesToHideFromLegacyWidgetBlock)&&void 0!==i?i:[],r=(0,g.select)(p.store).getWidgetTypes({per_page:-1})?.filter((e=>!n.includes(e.id)));r&&(t(),(0,g.dispatch)(s.store).addBlockVariations("core/legacy-widget",r.map((e=>({name:e.id,title:e.name,description:e.description,attributes:e.is_multi?{idBase:e.id,instance:{}}:{id:e.id}})))))}))}function ee(e={}){const{yu:t,W0:n,UU:r}=i;(0,s.registerBlockType)({name:r,...t},{...n,supports:{...n.supports,...e}})}function te(e={}){const{yu:t,W0:i,UU:r}=n;(0,s.registerBlockType)({name:r,...t},{...i,supports:{...i.supports,...e}})}(window.wp=window.wp||{}).widgets=t})(); \ No newline at end of file +(()=>{"use strict";var e={n:t=>{var i=t&&t.__esModule?()=>t.default:()=>t;return e.d(i,{a:i}),i},d:(t,i)=>{for(var n in i)e.o(i,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:i[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{MoveToWidgetArea:()=>X,addWidgetIdToBlock:()=>K,getWidgetIdFromBlock:()=>q,registerLegacyWidgetBlock:()=>ee,registerLegacyWidgetVariations:()=>Y,registerWidgetGroupBlock:()=>te});var i={};e.r(i),e.d(i,{yu:()=>W,UU:()=>A,W0:()=>O});var n={};e.r(n),e.d(n,{yu:()=>$,UU:()=>Q,W0:()=>Z});const s=window.wp.blocks,r=window.wp.primitives,o=window.ReactJSXRuntime,a=(0,o.jsx)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,o.jsx)(r.Path,{d:"M6 3H8V5H16V3H18V5C19.1046 5 20 5.89543 20 7V19C20 20.1046 19.1046 21 18 21H6C4.89543 21 4 20.1046 4 19V7C4 5.89543 4.89543 5 6 5V3ZM18 6.5H6C5.72386 6.5 5.5 6.72386 5.5 7V8H18.5V7C18.5 6.72386 18.2761 6.5 18 6.5ZM18.5 9.5H5.5V19C5.5 19.2761 5.72386 19.5 6 19.5H18C18.2761 19.5 18.5 19.2761 18.5 19V9.5ZM11 11H13V13H11V11ZM7 11V13H9V11H7ZM15 13V11H17V13H15Z"})});function c(e){var t,i,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var s=e.length;for(t=0;t{var t;const i=null!==(t=e(d.store).getSettings()?.widgetTypesToHideFromLegacyWidgetBlock)&&void 0!==t?t:[];return e(g.store).getWidgetTypes({per_page:-1})?.filter((e=>!i.includes(e.id)))}),[]);return i?0===i.length?(0,m.__)("There are no widgets available."):(0,o.jsx)(h.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,m.__)("Legacy widget"),value:null!=e?e:"",options:[{value:"",label:(0,m.__)("Select widget")},...i.map((e=>({value:e.id,label:e.name})))],onChange:e=>{if(e){const n=i.find((t=>t.id===e));t({selectedId:n.id,isMulti:n.is_multi})}else t({selectedId:null})}}):(0,o.jsx)(h.Spinner,{})}function b({name:e,description:t}){return(0,o.jsxs)("div",{className:"wp-block-legacy-widget-inspector-card",children:[(0,o.jsx)("h3",{className:"wp-block-legacy-widget-inspector-card__name",children:e}),(0,o.jsx)("span",{children:t})]})}const v=window.wp.notices,y=window.wp.compose,_=window.wp.apiFetch;var x=e.n(_);class j{constructor({id:e,idBase:t,instance:i,onChangeInstance:n,onChangeHasPreview:s,onError:r}){this.id=e,this.idBase=t,this._instance=i,this._hasPreview=null,this.onChangeInstance=n,this.onChangeHasPreview=s,this.onError=r,this.number=++k,this.handleFormChange=(0,y.debounce)(this.handleFormChange.bind(this),200),this.handleFormSubmit=this.handleFormSubmit.bind(this),this.initDOM(),this.bindEvents(),this.loadContent()}destroy(){this.unbindEvents(),this.element.remove()}initDOM(){var e,t;this.element=B("div",{class:"widget open"},[B("div",{class:"widget-inside"},[this.form=B("form",{class:"form",method:"post"},[B("input",{class:"widget-id",type:"hidden",name:"widget-id",value:null!==(e=this.id)&&void 0!==e?e:`${this.idBase}-${this.number}`}),B("input",{class:"id_base",type:"hidden",name:"id_base",value:null!==(t=this.idBase)&&void 0!==t?t:this.id}),B("input",{class:"widget-width",type:"hidden",name:"widget-width",value:"250"}),B("input",{class:"widget-height",type:"hidden",name:"widget-height",value:"200"}),B("input",{class:"widget_number",type:"hidden",name:"widget_number",value:this.idBase?this.number.toString():""}),this.content=B("div",{class:"widget-content"}),this.id&&B("button",{class:"button is-primary",type:"submit"},(0,m.__)("Save"))])])])}bindEvents(){if(window.jQuery){const{jQuery:e}=window;e(this.form).on("change",null,this.handleFormChange),e(this.form).on("input",null,this.handleFormChange),e(this.form).on("submit",this.handleFormSubmit)}else this.form.addEventListener("change",this.handleFormChange),this.form.addEventListener("input",this.handleFormChange),this.form.addEventListener("submit",this.handleFormSubmit)}unbindEvents(){if(window.jQuery){const{jQuery:e}=window;e(this.form).off("change",null,this.handleFormChange),e(this.form).off("input",null,this.handleFormChange),e(this.form).off("submit",this.handleFormSubmit)}else this.form.removeEventListener("change",this.handleFormChange),this.form.removeEventListener("input",this.handleFormChange),this.form.removeEventListener("submit",this.handleFormSubmit)}async loadContent(){try{if(this.id){const{form:e}=await C(this.id);this.content.innerHTML=e}else if(this.idBase){const{form:e,preview:t}=await S({idBase:this.idBase,instance:this.instance,number:this.number});if(this.content.innerHTML=e,this.hasPreview=!T(t),!this.instance.hash){const{instance:e}=await S({idBase:this.idBase,instance:this.instance,number:this.number,formData:M(this.form)});this.instance=e}}if(window.jQuery){const{jQuery:e}=window;e(document).trigger("widget-added",[e(this.element)])}}catch(e){this.onError(e)}}handleFormChange(){this.idBase&&this.saveForm()}handleFormSubmit(e){e.preventDefault(),this.saveForm()}async saveForm(){const e=M(this.form);try{if(this.id){const{form:t}=await C(this.id,e);if(this.content.innerHTML=t,window.jQuery){const{jQuery:e}=window;e(document).trigger("widget-updated",[e(this.element)])}}else if(this.idBase){const{instance:t,preview:i}=await S({idBase:this.idBase,instance:this.instance,number:this.number,formData:e});this.instance=t,this.hasPreview=!T(i)}}catch(e){this.onError(e)}}get instance(){return this._instance}set instance(e){this._instance!==e&&(this._instance=e,this.onChangeInstance(e))}get hasPreview(){return this._hasPreview}set hasPreview(e){this._hasPreview!==e&&(this._hasPreview=e,this.onChangeHasPreview(e))}}let k=0;function B(e,t={},i=null){const n=document.createElement(e);for(const[e,i]of Object.entries(t))n.setAttribute(e,i);if(Array.isArray(i))for(const e of i)e&&n.appendChild(e);else"string"==typeof i&&(n.innerText=i);return n}async function C(e,t=null){let i;return i=t?await x()({path:`/wp/v2/widgets/${e}?context=edit`,method:"PUT",data:{form_data:t}}):await x()({path:`/wp/v2/widgets/${e}?context=edit`,method:"GET"}),{form:i.rendered_form}}async function S({idBase:e,instance:t,number:i,formData:n=null}){const s=await x()({path:`/wp/v2/widget-types/${e}/encode`,method:"POST",data:{instance:t,number:i,form_data:n}});return{instance:s.instance,form:s.form,preview:s.preview}}function T(e){const t=document.createElement("div");return t.innerHTML=e,H(t)}function H(e){switch(e.nodeType){case e.TEXT_NODE:return""===e.nodeValue.trim();case e.ELEMENT_NODE:return!["AUDIO","CANVAS","EMBED","IFRAME","IMG","MATH","OBJECT","SVG","VIDEO"].includes(e.tagName)&&(!e.hasChildNodes()||Array.from(e.childNodes).every(H));default:return!0}}function M(e){return new window.URLSearchParams(Array.from(new window.FormData(e))).toString()}function I({title:e,isVisible:t,id:i,idBase:n,instance:s,isWide:r,onChangeInstance:a,onChangeHasPreview:c}){const d=(0,w.useRef)(),u=(0,y.useViewportMatch)("small"),g=(0,w.useRef)(new Set),f=(0,w.useRef)(new Set),{createNotice:b}=(0,p.useDispatch)(v.store);return(0,w.useEffect)((()=>{if(f.current.has(s))return void f.current.delete(s);const e=new j({id:i,idBase:n,instance:s,onChangeInstance(e){g.current.add(s),f.current.add(e),a(e)},onChangeHasPreview:c,onError(e){window.console.error(e),b("error",(0,m.sprintf)((0,m.__)('The "%s" block was affected by errors and may not function properly. Check the developer tools for more details.'),n||i))}});return d.current.appendChild(e.element),()=>{g.current.has(s)?g.current.delete(s):e.destroy()}}),[i,n,s,a,c,u]),r&&u?(0,o.jsxs)("div",{className:l({"wp-block-legacy-widget__container":t}),children:[t&&(0,o.jsx)("h3",{className:"wp-block-legacy-widget__edit-form-title",children:e}),(0,o.jsx)(h.Popover,{focusOnMount:!1,placement:"right",offset:32,resize:!1,flip:!1,shift:!0,children:(0,o.jsx)("div",{ref:d,className:"wp-block-legacy-widget__edit-form",hidden:!t})})]}):(0,o.jsx)("div",{ref:d,className:"wp-block-legacy-widget__edit-form",hidden:!t,children:(0,o.jsx)("h3",{className:"wp-block-legacy-widget__edit-form-title",children:e})})}function V({idBase:e,instance:t,isVisible:i}){const[n,s]=(0,w.useState)(!1),[r,a]=(0,w.useState)("");(0,w.useEffect)((()=>{const i=void 0===window.AbortController?void 0:new window.AbortController;return async function(){const n=`/wp/v2/widget-types/${e}/render`;return await x()({path:n,method:"POST",signal:i?.signal,data:t?{instance:t}:{}})}().then((e=>{a(e.preview)})).catch((e=>{if("AbortError"!==e.name)throw e})),()=>i?.abort()}),[e,t]);const c=(0,y.useRefEffect)((e=>{if(!n)return;function t(){var t,i;const n=Math.max(null!==(t=e.contentDocument.documentElement?.offsetHeight)&&void 0!==t?t:0,null!==(i=e.contentDocument.body?.offsetHeight)&&void 0!==i?i:0);e.style.height=`${0!==n?n:100}px`}const{IntersectionObserver:i}=e.ownerDocument.defaultView,s=new i((([e])=>{e.isIntersecting&&t()}),{threshold:1});return s.observe(e),e.addEventListener("load",t),()=>{s.disconnect(),e.removeEventListener("load",t)}}),[n]);return(0,o.jsxs)(o.Fragment,{children:[i&&!n&&(0,o.jsx)(h.Placeholder,{children:(0,o.jsx)(h.Spinner,{})}),(0,o.jsx)("div",{className:l("wp-block-legacy-widget__edit-preview",{"is-offscreen":!i||!n}),children:(0,o.jsx)(h.Disabled,{children:(0,o.jsx)("iframe",{ref:c,className:"wp-block-legacy-widget__edit-preview-iframe",tabIndex:"-1",title:(0,m.__)("Legacy Widget Preview"),srcDoc:r,onLoad:e=>{e.target.contentDocument.body.style.overflow="hidden",s(!0)},height:100})})})]})}function P({name:e}){return(0,o.jsxs)("div",{className:"wp-block-legacy-widget__edit-no-preview",children:[e&&(0,o.jsx)("h3",{children:e}),(0,o.jsx)("p",{children:(0,m.__)("No preview available.")})]})}function E({clientId:e,rawInstance:t}){const{replaceBlocks:i}=(0,p.useDispatch)(d.store);return(0,o.jsx)(h.ToolbarButton,{onClick:()=>{t.title?i(e,[(0,s.createBlock)("core/heading",{content:t.title}),...(0,s.rawHandler)({HTML:t.text})]):i(e,(0,s.rawHandler)({HTML:t.text}))},children:(0,m.__)("Convert to blocks")})}function F({attributes:{id:e,idBase:t},setAttributes:i}){return(0,o.jsx)(h.Placeholder,{icon:(0,o.jsx)(d.BlockIcon,{icon:u}),label:(0,m.__)("Legacy Widget"),children:(0,o.jsx)(h.Flex,{children:(0,o.jsx)(h.FlexBlock,{children:(0,o.jsx)(f,{selectedId:null!=e?e:t,onSelect:({selectedId:e,isMulti:t})=>{i(e?t?{id:null,idBase:e,instance:{}}:{id:e,idBase:null,instance:null}:{id:null,idBase:null,instance:null})}})})})})}function N({attributes:{id:e,idBase:t,instance:i},setAttributes:n,clientId:s,isSelected:r,isWide:a=!1}){const[c,l]=(0,w.useState)(null),p=null!=e?e:t,{record:f,hasResolved:v}=(0,g.useEntityRecord)("root","widgetType",p),y=(0,w.useCallback)((e=>{n({instance:e})}),[]);if(!f&&v)return(0,o.jsx)(h.Placeholder,{icon:(0,o.jsx)(d.BlockIcon,{icon:u}),label:(0,m.__)("Legacy Widget"),children:(0,m.__)("Widget is missing.")});if(!v)return(0,o.jsx)(h.Placeholder,{children:(0,o.jsx)(h.Spinner,{})});const _=t&&!r?"preview":"edit";return(0,o.jsxs)(o.Fragment,{children:["text"===t&&(0,o.jsx)(d.BlockControls,{group:"other",children:(0,o.jsx)(E,{clientId:s,rawInstance:i.raw})}),(0,o.jsx)(d.InspectorControls,{children:(0,o.jsx)(b,{name:f.name,description:f.description})}),(0,o.jsx)(I,{title:f.name,isVisible:"edit"===_,id:e,idBase:t,instance:i,isWide:a,onChangeInstance:y,onChangeHasPreview:l}),t&&(0,o.jsxs)(o.Fragment,{children:[null===c&&"preview"===_&&(0,o.jsx)(h.Placeholder,{children:(0,o.jsx)(h.Spinner,{})}),!0===c&&(0,o.jsx)(V,{idBase:t,instance:i,isVisible:"preview"===_}),!1===c&&"preview"===_&&(0,o.jsx)(P,{name:f.name})]})]})}const L=[{block:"core/calendar",widget:"calendar"},{block:"core/search",widget:"search"},{block:"core/html",widget:"custom_html",transform:({content:e})=>({content:e})},{block:"core/archives",widget:"archives",transform:({count:e,dropdown:t})=>({displayAsDropdown:!!t,showPostCounts:!!e})},{block:"core/latest-posts",widget:"recent-posts",transform:({show_date:e,number:t})=>({displayPostDate:!!e,postsToShow:t})},{block:"core/latest-comments",widget:"recent-comments",transform:({number:e})=>({commentsToShow:e})},{block:"core/tag-cloud",widget:"tag_cloud",transform:({taxonomy:e,count:t})=>({showTagCounts:!!t,taxonomy:e})},{block:"core/categories",widget:"categories",transform:({count:e,dropdown:t,hierarchical:i})=>({displayAsDropdown:!!t,showPostCounts:!!e,showHierarchy:!!i})},{block:"core/audio",widget:"media_audio",transform:({url:e,preload:t,loop:i,attachment_id:n})=>({src:e,id:n,preload:t,loop:i})},{block:"core/video",widget:"media_video",transform:({url:e,preload:t,loop:i,attachment_id:n})=>({src:e,id:n,preload:t,loop:i})},{block:"core/image",widget:"media_image",transform:({alt:e,attachment_id:t,caption:i,height:n,link_classes:s,link_rel:r,link_target_blank:o,link_type:a,link_url:c,size:l,url:d,width:h})=>({alt:e,caption:i,height:n,id:t,link:c,linkClass:s,linkDestination:a,linkTarget:o?"_blank":void 0,rel:r,sizeSlug:l,url:d,width:h})},{block:"core/gallery",widget:"media_gallery",transform:({ids:e,link_type:t,size:i,number:n})=>({ids:e,columns:n,linkTo:t,sizeSlug:i,images:e.map((e=>({id:e})))})},{block:"core/rss",widget:"rss",transform:({url:e,show_author:t,show_date:i,show_summary:n,items:s})=>({feedURL:e,displayAuthor:!!t,displayDate:!!i,displayExcerpt:!!n,itemsToShow:s})}].map((({block:e,widget:t,transform:i})=>({type:"block",blocks:[e],isMatch:({idBase:e,instance:i})=>e===t&&!!i?.raw,transform:({instance:t})=>{const n=(0,s.createBlock)(e,i?i(t.raw):void 0);return t.raw?.title?[(0,s.createBlock)("core/heading",{content:t.raw.title}),n]:n}}))),D={to:L},W={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/legacy-widget",title:"Legacy Widget",category:"widgets",description:"Display a legacy widget.",textdomain:"default",attributes:{id:{type:"string",default:null},idBase:{type:"string",default:null},instance:{type:"object",default:null}},supports:{html:!1,customClassName:!1,reusable:!1},editorStyle:"wp-block-legacy-widget-editor"},{name:A}=W,O={icon:a,edit:function(e){const{id:t,idBase:i}=e.attributes,{isWide:n=!1}=e,s=(0,d.useBlockProps)({className:l({"is-wide-widget":n})});return(0,o.jsx)("div",{...s,children:t||i?(0,o.jsx)(N,{...e}):(0,o.jsx)(F,{...e})})},transforms:D},z=(0,o.jsx)(r.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)(r.Path,{d:"M18 4h-7c-1.1 0-2 .9-2 2v3H6c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2v-3h3c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h3V13c0 1.1.9 2 2 2h2.5v3zm0-4.5H11c-.3 0-.5-.2-.5-.5v-2.5H13c.3 0 .5.2.5.5v2.5zm5-.5c0 .3-.2.5-.5.5h-3V11c0-1.1-.9-2-2-2h-2.5V6c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v7z"})});function R({clientId:e}){return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(h.Placeholder,{className:"wp-block-widget-group__placeholder",icon:(0,o.jsx)(d.BlockIcon,{icon:z}),label:(0,m.__)("Widget Group"),children:(0,o.jsx)(d.ButtonBlockAppender,{rootClientId:e})}),(0,o.jsx)(d.InnerBlocks,{renderAppender:!1})]})}function G({attributes:e,setAttributes:t}){var i;return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(d.RichText,{tagName:"h2",identifier:"title",className:"widget-title",allowedFormats:[],placeholder:(0,m.__)("Title"),value:null!==(i=e.title)&&void 0!==i?i:"",onChange:e=>t({title:e})}),(0,o.jsx)(d.InnerBlocks,{})]})}const U=[{attributes:{title:{type:"string"}},supports:{html:!1,inserter:!0,customClassName:!0,reusable:!1},save:({attributes:e})=>(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(d.RichText.Content,{tagName:"h2",className:"widget-title",value:e.title}),(0,o.jsx)(d.InnerBlocks.Content,{})]})}],$={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/widget-group",title:"Widget Group",category:"widgets",attributes:{title:{type:"string"}},supports:{html:!1,inserter:!0,customClassName:!0,reusable:!1},editorStyle:"wp-block-widget-group-editor",style:"wp-block-widget-group"},{name:Q}=$,Z={title:(0,m.__)("Widget Group"),description:(0,m.__)("Create a classic widget layout with a title that’s styled by your theme for your widget areas."),icon:z,__experimentalLabel:({name:e})=>e,edit:function(e){const{clientId:t}=e,{innerBlocks:i}=(0,p.useSelect)((e=>e(d.store).getBlock(t)),[t]);return(0,o.jsx)("div",{...(0,d.useBlockProps)({className:"widget"}),children:0===i.length?(0,o.jsx)(R,{...e}):(0,o.jsx)(G,{...e})})},save:function({attributes:e}){return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(d.RichText.Content,{tagName:"h2",className:"widget-title",value:e.title}),(0,o.jsx)("div",{className:"wp-widget-group__inner-blocks",children:(0,o.jsx)(d.InnerBlocks.Content,{})})]})},transforms:{from:[{type:"block",isMultiBlock:!0,blocks:["*"],isMatch:(e,t)=>!t.some((e=>"core/widget-group"===e.name)),__experimentalConvert(e){let t=[...e.map((e=>(0,s.createBlock)(e.name,e.attributes,e.innerBlocks)))];const i="core/heading"===t[0].name?t[0]:null;return t=t.filter((e=>e!==i)),(0,s.createBlock)("core/widget-group",{...i&&{title:i.attributes.content}},t)}}]},deprecated:U},J=(0,o.jsx)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,o.jsx)(r.Path,{d:"M19.75 9c0-1.257-.565-2.197-1.39-2.858-.797-.64-1.827-1.017-2.815-1.247-1.802-.42-3.703-.403-4.383-.396L11 4.5V6l.177-.001c.696-.006 2.416-.02 4.028.356.887.207 1.67.518 2.216.957.52.416.829.945.829 1.688 0 .592-.167.966-.407 1.23-.255.281-.656.508-1.236.674-1.19.34-2.82.346-4.607.346h-.077c-1.692 0-3.527 0-4.942.404-.732.209-1.424.545-1.935 1.108-.526.579-.796 1.33-.796 2.238 0 1.257.565 2.197 1.39 2.858.797.64 1.827 1.017 2.815 1.247 1.802.42 3.703.403 4.383.396L13 19.5h.714V22L18 18.5 13.714 15v3H13l-.177.001c-.696.006-2.416.02-4.028-.356-.887-.207-1.67-.518-2.216-.957-.52-.416-.829-.945-.829-1.688 0-.592.167-.966.407-1.23.255-.281.656-.508 1.237-.674 1.189-.34 2.819-.346 4.606-.346h.077c1.692 0 3.527 0 4.941-.404.732-.209 1.425-.545 1.936-1.108.526-.579.796-1.33.796-2.238z"})});function X({currentWidgetAreaId:e,widgetAreas:t,onSelect:i}){return(0,o.jsx)(h.ToolbarGroup,{children:(0,o.jsx)(h.ToolbarItem,{children:n=>(0,o.jsx)(h.DropdownMenu,{icon:J,label:(0,m.__)("Move to widget area"),toggleProps:n,children:({onClose:n})=>(0,o.jsx)(h.MenuGroup,{label:(0,m.__)("Move to"),children:(0,o.jsx)(h.MenuItemsChoice,{choices:t.map((e=>({value:e.id,label:e.name,info:e.description}))),value:e,onSelect:e=>{i(e),n()}})})})})})}function q(e){return e.attributes.__internalWidgetId}function K(e,t){return{...e,attributes:{...e.attributes||{},__internalWidgetId:t}}}function Y(e){const t=(0,p.subscribe)((()=>{var i;const n=null!==(i=e?.widgetTypesToHideFromLegacyWidgetBlock)&&void 0!==i?i:[],r=(0,p.select)(g.store).getWidgetTypes({per_page:-1})?.filter((e=>!n.includes(e.id)));r&&(t(),(0,p.dispatch)(s.store).addBlockVariations("core/legacy-widget",r.map((e=>({name:e.id,title:e.name,description:e.description,attributes:e.is_multi?{idBase:e.id,instance:{}}:{id:e.id}})))))}))}function ee(e={}){const{yu:t,W0:n,UU:r}=i;(0,s.registerBlockType)({name:r,...t},{...n,supports:{...n.supports,...e}})}function te(e={}){const{yu:t,W0:i,UU:r}=n;(0,s.registerBlockType)({name:r,...t},{...i,supports:{...i.supports,...e}})}(window.wp=window.wp||{}).widgets=t})(); \ No newline at end of file diff --git a/wp-includes/js/dist/wordcount.js b/wp-includes/js/dist/wordcount.js index 7e97bad8ee..77a1592e81 100644 --- a/wp-includes/js/dist/wordcount.js +++ b/wp-includes/js/dist/wordcount.js @@ -265,6 +265,7 @@ function transposeHTMLEntitiesToCountableChars(settings, text) { } ;// ./node_modules/@wordpress/wordcount/build-module/index.js +/* wp:polyfill */ /** * Internal dependencies */ diff --git a/wp-includes/version.php b/wp-includes/version.php index 0d764b8216..b2019839c4 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.8-alpha-59774'; +$wp_version = '6.8-alpha-59775'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.